{
int ret = MM_ERROR_NONE;
int state = MM_CAMCORDER_STATE_NONE;
+ int audio_disable = FALSE;
int dpm_mic_state = DPM_ALLOWED;
mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
+ _MMCamcorderSubContext *sc = NULL;
_mmcam_dbg_log("");
- if (!hcamcorder) {
+ if (!hcamcorder || !MMF_CAMCORDER_SUBCONTEXT(hcamcorder)) {
_mmcam_dbg_err("Not initialized");
ret = MM_ERROR_CAMCORDER_NOT_INITIALIZED;
return ret;
}
+ sc = MMF_CAMCORDER_SUBCONTEXT(handle);
+
if (!_MMCAMCORDER_TRYLOCK_CMD(hcamcorder)) {
_mmcam_dbg_err("Another command is running.");
ret = MM_ERROR_CAMCORDER_CMD_IS_RUNNING;
/* initialize error code */
hcamcorder->error_code = MM_ERROR_NONE;
+ /* get audio disable */
+ mm_camcorder_get_attributes(handle, NULL,
+ MMCAM_AUDIO_DISABLE, &sc->audio_disable,
+ NULL);
+
+ sc->audio_disable |= sc->is_modified_rate;
+
/* check mic policy from DPM */
- if (hcamcorder->dpm_handle) {
+ if (hcamcorder->dpm_handle && sc->audio_disable == FALSE) {
if (dpm_restriction_get_microphone_state(hcamcorder->dpm_handle, &dpm_mic_state) == DPM_ERROR_NONE) {
_mmcam_dbg_log("DPM mic state %d", dpm_mic_state);
if (dpm_mic_state == DPM_DISALLOWED) {
_mmcam_dbg_err("get DPM mic state failed, keep going...");
}
} else {
- _mmcam_dbg_warn("NULL dpm_handle");
+ _mmcam_dbg_warn("skip dpm check - handle %p, audio disable %d",
+ hcamcorder->dpm_handle, sc->audio_disable);
}
ret = hcamcorder->command((MMHandleType)hcamcorder, _MMCamcorder_CMD_RECORD);
{
int i = 0;
int err = MM_ERROR_NONE;
- int audio_disable = FALSE;
const char* gst_element_rsink_name = NULL;
GstBus *bus = NULL;
/* get audio disable */
mm_camcorder_get_attributes(handle, NULL,
- MMCAM_AUDIO_DISABLE, &audio_disable,
+ MMCAM_AUDIO_DISABLE, &sc->audio_disable,
NULL);
- if (sc->is_modified_rate || audio_disable)
- sc->audio_disable = TRUE;
- else
- sc->audio_disable = FALSE;
+ _mmcam_dbg_log("MMCAM_AUDIO_DISABLE %d, is_modified_rate %d",
+ sc->audio_disable, sc->is_modified_rate);
- _mmcam_dbg_log("AUDIO DISABLE : %d (is_modified_rate %d, audio_disable %d)",
- sc->audio_disable, sc->is_modified_rate, audio_disable);
+ sc->audio_disable |= sc->is_modified_rate;
if (sc->audio_disable == FALSE) {
/* create audiosrc bin */