|
@@ -671,8 +671,7 @@ static void salesrecord_audio_capture_destroy(rvc_audio_capture_t *audio_cap)
|
|
|
audio_cap->uaudiolen = 0;
|
|
|
}
|
|
|
#endif
|
|
|
- free(audio_cap);
|
|
|
- audio_cap = NULL;
|
|
|
+ FREE(audio_cap);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -700,12 +699,15 @@ static void audio_capture_destroy(audio_capture_t *audio_cap)
|
|
|
audio_cap->shm_queue = NULL;
|
|
|
delete audio_cap->salesol_shm_queue;
|
|
|
audio_cap->salesol_shm_queue = NULL;
|
|
|
- free(audio_cap);
|
|
|
+
|
|
|
#ifdef RVC_OS_LINUX
|
|
|
- delete audio_cap->paudio_buffer;
|
|
|
- audio_cap->paudio_buffer = NULL;
|
|
|
- audio_cap->uaudiolen = 0;
|
|
|
+ if (NULL != audio_cap->paudio_buffer) {
|
|
|
+ delete audio_cap->paudio_buffer;
|
|
|
+ audio_cap->paudio_buffer = NULL;
|
|
|
+ audio_cap->uaudiolen = 0;
|
|
|
+ }
|
|
|
#endif
|
|
|
+ FREE(audio_cap);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1157,7 +1159,7 @@ static void video_capture_destroy(video_capture_t *video_cap)
|
|
|
delete video_cap->preview_shm_queue;
|
|
|
video_cap->preview_shm_queue = NULL;
|
|
|
}
|
|
|
- free(video_cap);
|
|
|
+ FREE(video_cap);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1367,13 +1369,13 @@ namespace MediaController {
|
|
|
int capture_create(const capture_config_t *config, capture_t **p_cap)
|
|
|
{
|
|
|
capture_t *cap = ZALLOC_T(capture_t);
|
|
|
- cap->audio = NULL;
|
|
|
+ cap->handfree_audio = NULL;
|
|
|
cap->env_video = NULL;
|
|
|
cap->opt_video = NULL;
|
|
|
memcpy(&cap->config, config, sizeof(capture_config_t));
|
|
|
- cap->audio = audio_capture_create(cap);
|
|
|
- if (!cap->audio) {
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("create audio capture object failed!");
|
|
|
+ cap->handfree_audio = audio_capture_create(cap);
|
|
|
+ if (!cap->handfree_audio) {
|
|
|
+ DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_SYSTEM)("create handfree audio capture object failed!");
|
|
|
return Error_Unexpect;
|
|
|
}
|
|
|
|
|
@@ -1446,7 +1448,7 @@ namespace MediaController {
|
|
|
memcpy(&cap->rvc_audio_config, config, sizeof(rvc_audio_capture_config_t));
|
|
|
cap->rvc_audio = salesrecord_audio_capture_create(cap);
|
|
|
if (!cap->rvc_audio) {
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("create sales record audio capture object failed!");
|
|
|
+ DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_SYSTEM)("create sales record audio capture object failed!");
|
|
|
salesaudio_capture_destroy(cap);
|
|
|
cap = NULL;
|
|
|
return Error_Unexpect;
|
|
@@ -1467,7 +1469,7 @@ namespace MediaController {
|
|
|
salesrecord_audio_capture_destroy(cap->rvc_audio);
|
|
|
cap->rvc_audio = NULL;
|
|
|
}
|
|
|
- free(cap);
|
|
|
+ FREE(cap);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1482,11 +1484,11 @@ namespace MediaController {
|
|
|
video_capture_destroy(cap->opt_video);
|
|
|
cap->opt_video = NULL;
|
|
|
}
|
|
|
- if (cap->audio) {
|
|
|
- audio_capture_destroy(cap->audio);
|
|
|
- cap->audio = NULL;
|
|
|
+ if (cap->handfree_audio) {
|
|
|
+ audio_capture_destroy(cap->handfree_audio);
|
|
|
+ cap->handfree_audio = NULL;
|
|
|
}
|
|
|
- free(cap);
|
|
|
+ FREE(cap);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1648,7 +1650,7 @@ namespace MediaController {
|
|
|
int rc = 0;
|
|
|
|
|
|
if ('N' == cap->config.strAudioState[0] || 'P' == cap->config.strAudioState[0]) {
|
|
|
- ErrorCodeEnum rslt = start_audio_capture(cap->audio);
|
|
|
+ ErrorCodeEnum rslt = start_audio_capture(cap->handfree_audio);
|
|
|
if (Error_Succeed != rslt) {
|
|
|
return rslt;
|
|
|
}
|
|
@@ -1748,9 +1750,10 @@ namespace MediaController {
|
|
|
|
|
|
void capture_stop(capture_t *cap)
|
|
|
{
|
|
|
- if (cap->audio) {
|
|
|
- audio_capture_stop(cap->audio);
|
|
|
+ if (cap->handfree_audio) {
|
|
|
+ audio_capture_stop(cap->handfree_audio);
|
|
|
}
|
|
|
+
|
|
|
if (cap->env_video) {
|
|
|
if (0 != cap->env_video->ustarttime) {
|
|
|
int ienvtime = y2k_time_now() - cap->env_video->ustarttime;
|