Sound signal to unset focus watch callback is missed or the reading session is failed because of some reason.
This patch unset focus watch callback explicitly when sound stream info is set,
because it means sound focus related function should be controlled by application.
[Version] 0.10.107
[Profile] Common
[Issue Type] Update
[Dependency module] N/A
[Test] [M(T) - Boot=(OK), sdb=(OK), Home=(OK), Touch=(OK), Version=tizen-3.0-mobile_20170227.2]
Change-Id: I25df25ca93eb20f5657adb9a578d5684069e5631
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
Name: libmm-camcorder
Summary: Camera and recorder library
-Version: 0.10.108
+Version: 0.10.109
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0
new_pid = value->value.i_val;
- _mmcam_dbg_log("Commit : pid %d, current focus id %d, subscribe id %u",
+ _mmcam_dbg_warn("Commit : pid %d, current focus id %d, subscribe id %u",
new_pid, hcamcorder->sound_focus_id, hcamcorder->sound_focus_subscribe_id);
/* unregister sound focus and unsubscribe sound signal before set new one */
return FALSE;
}
- sc = MMF_CAMCORDER_SUBCONTEXT(handle);
- if (!sc || !sc->encode_element ||
- !sc->encode_element[_MMCAMCORDER_AUDIOSRC_SRC].gst) {
- _mmcam_dbg_log("audiosrc element is not initialized, it will be set later");
- return TRUE;
- }
-
mm_camcorder_get_attributes(handle, NULL,
MMCAM_SOUND_STREAM_INDEX, &stream_index,
NULL);
return FALSE;
}
- _mmcam_dbg_log("Commit : sound stream info - type %s, index %d", stream_type, stream_index);
+ /* unset watch callback if existed */
+ _mmcamcorder_sound_signal_callback(MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS, 1, (void *)handle);
+
+ sc = MMF_CAMCORDER_SUBCONTEXT(handle);
+ if (!sc || !sc->encode_element ||
+ !sc->encode_element[_MMCAMCORDER_AUDIOSRC_SRC].gst) {
+ _mmcam_dbg_warn("audiosrc element is not initialized, it will be set later");
+ return TRUE;
+ }
+
+ _mmcam_dbg_warn("Commit : sound stream info - type %s, index %d", stream_type, stream_index);
return _mmcamcorder_set_sound_stream_info(sc->encode_element[_MMCAMCORDER_AUDIOSRC_SRC].gst, stream_type, stream_index);
}
"props,media.role=%s, media.parent_id=%d",
stream_type, stream_index);
- _mmcam_dbg_log("stream type %s, index %d -> [%s]", stream_type, stream_index, stream_props);
+ _mmcam_dbg_warn("stream type %s, index %d -> [%s]", stream_type, stream_index, stream_props);
props = gst_structure_from_string(stream_props, NULL);
if (!props) {
_MMCAMCORDER_LOCK_ASM(hcamcorder);
if (signal == MM_SOUND_SIGNAL_RELEASE_INTERNAL_FOCUS && value == 1) {
- _mmcam_dbg_warn("watch cb id %d", hcamcorder->sound_focus_watch_id);
+ _mmcam_dbg_warn("focus id %d, focus watch id %d",
+ hcamcorder->sound_focus_id, hcamcorder->sound_focus_watch_id);
+
+ /* unregister focus related callback */
+ if (hcamcorder->sound_focus_id > 0) {
+ if (hcamcorder->acquired_focus > 0) {
+ mm_sound_release_focus(hcamcorder->sound_focus_id, hcamcorder->acquired_focus, NULL);
+ _mmcam_dbg_warn("release acquired focus [focus %d] done", hcamcorder->acquired_focus);
+ hcamcorder->acquired_focus = 0;
+ }
+
+ mm_sound_unregister_focus(hcamcorder->sound_focus_id);
+ _mmcam_dbg_warn("unregister sound focus done");
+ hcamcorder->sound_focus_id = 0;
+ }
- /* unregister watch callback */
if (hcamcorder->sound_focus_watch_id > 0) {
mm_sound_unset_focus_watch_callback(hcamcorder->sound_focus_watch_id);
_mmcam_dbg_warn("unset watch cb done");