goto pipeline_creation_error;
}
- if (element_list) {
+ if (element_list)
g_list_free(element_list);
- element_list = NULL;
- }
/* extra preview */
if (extra_preview_enable)
_MMCAMCORDER_ELEMENT_REMOVE(sc->element, _MMCAMCORDER_VIDEOSINK_QUE);
_MMCAMCORDER_ELEMENT_REMOVE(sc->element, _MMCAMCORDER_VIDEOSINK_SINK);
- if (element_list) {
+ if (element_list)
g_list_free(element_list);
- element_list = NULL;
- }
return err;
}
&audiosrc_element, &audiosrc_name);
free(cat_name);
- cat_name = NULL;
MMCAM_LOG_INFO("Audio src name : %s", audiosrc_name);
if (caps) {
MMCAMCORDER_G_OBJECT_SET_POINTER((sc->encode_element[_MMCAMCORDER_AUDIOSRC_CAPS].gst), "caps", caps);
gst_caps_unref(caps);
- caps = NULL;
} else {
MMCAM_LOG_ERROR("create caps error");
err = MM_ERROR_CAMCORDER_RESOURCE_CREATION;
pad = gst_element_get_static_pad(last_element->gst, "src");
if (!gst_element_add_pad(sc->encode_element[_MMCAMCORDER_AUDIOSRC_BIN].gst, gst_ghost_pad_new("src", pad))) {
gst_object_unref(pad);
- pad = NULL;
MMCAM_LOG_ERROR("failed to create ghost pad on _MMCAMCORDER_AUDIOSRC_BIN.");
err = MM_ERROR_CAMCORDER_GST_LINK;
goto pipeline_creation_error;
}
gst_object_unref(pad);
- pad = NULL;
- if (element_list) {
+ if (element_list)
g_list_free(element_list);
- element_list = NULL;
- }
return MM_ERROR_NONE;
_MMCAMCORDER_ELEMENT_REMOVE(sc->encode_element, _MMCAMCORDER_AUDIOSRC_VOL);
_MMCAMCORDER_ELEMENT_REMOVE(sc->encode_element, _MMCAMCORDER_AUDIOSRC_BIN);
- if (element_list) {
+ if (element_list)
g_list_free(element_list);
- element_list = NULL;
- }
return err;
}
caps_from_pad = gst_pad_get_allowed_caps(pad);
video_caps = gst_caps_copy(caps_from_pad);
gst_caps_unref(caps_from_pad);
- caps_from_pad = NULL;
gst_object_unref(pad);
- pad = NULL;
/* fixate caps */
video_caps = gst_caps_fixate(video_caps);
MMCAM_LOG_INFO("encodebin caps [%s]", caps_str);
g_free(caps_str);
- caps_str = NULL;
MMCAMCORDER_G_OBJECT_SET_POINTER(sc->encode_element[_MMCAMCORDER_ENCSINK_CAPS].gst, "caps", video_caps);
gst_caps_unref(video_caps);
- video_caps = NULL;
/* video scale */
if (profile == MM_CAMCORDER_ENCBIN_PROFILE_VIDEO &&
MMCAM_LOG_INFO("encodebin videocale [%s][%s]", gst_element_vscale_name, caps_str);
g_free(caps_str);
- caps_str = NULL;
_MMCAMCORDER_ELEMENT_MAKE(sc, sc->encode_element, _MMCAMCORDER_ENCSINK_VSCALE, gst_element_vscale_name, "esink_vs", element_list, err);
_MMCAMCORDER_ELEMENT_MAKE(sc, sc->encode_element, _MMCAMCORDER_ENCSINK_VSCALE_CAPS, "capsfilter", "esink_vs_c", element_list, err);
if (video_caps) {
MMCAMCORDER_G_OBJECT_SET_POINTER(sc->encode_element[_MMCAMCORDER_ENCSINK_ENCBIN].gst, "vcaps", video_caps);
MMCAMCORDER_G_OBJECT_SET(sc->encode_element[_MMCAMCORDER_ENCSINK_VCONV].gst, "dst-buffer-num", _MMCAMCORDER_CONVERT_OUTPUT_BUFFER_NUM);
-
gst_caps_unref(video_caps);
- video_caps = NULL;
} else {
MMCAM_LOG_WARNING("failed to create caps");
}
MMCAMCORDER_G_OBJECT_SET(sc->encode_element[_MMCAMCORDER_ENCSINK_ENCBIN].gst, "auto-audio-convert", TRUE);
MMCAMCORDER_G_OBJECT_SET_POINTER(sc->encode_element[_MMCAMCORDER_ENCSINK_ENCBIN].gst, "acaps", audio_caps);
gst_caps_unref(audio_caps);
- audio_caps = NULL;
}
if (audio_enc == MM_AUDIO_CODEC_OGG) {
MMCAMCORDER_G_OBJECT_SET(sc->encode_element[_MMCAMCORDER_ENCSINK_ENCBIN].gst, "auto-audio-convert", TRUE);
MMCAMCORDER_G_OBJECT_SET_POINTER(sc->encode_element[_MMCAMCORDER_ENCSINK_ENCBIN].gst, "acaps", audio_caps);
gst_caps_unref(audio_caps);
- audio_caps = NULL;
MMCAM_LOG_INFO("***** MM_AUDIO_CODEC_OGG : setting audio/x-raw-int ");
}
pad = gst_element_request_pad_simple(sc->encode_element[_MMCAMCORDER_ENCSINK_ENCBIN].gst, "video");
if (!gst_element_add_pad(sc->encode_element[_MMCAMCORDER_ENCSINK_BIN].gst, gst_ghost_pad_new("video_sink0", pad))) {
gst_object_unref(pad);
- pad = NULL;
MMCAM_LOG_ERROR("failed to create ghost video_sink0 on _MMCAMCORDER_ENCSINK_BIN.");
err = MM_ERROR_CAMCORDER_GST_LINK;
goto pipeline_creation_error;
}
gst_object_unref(pad);
- pad = NULL;
if (sc->audio_disable == FALSE) {
pad = gst_element_request_pad_simple(sc->encode_element[_MMCAMCORDER_ENCSINK_ENCBIN].gst, "audio");
if (!gst_element_add_pad(sc->encode_element[_MMCAMCORDER_ENCSINK_BIN].gst, gst_ghost_pad_new("audio_sink0", pad))) {
gst_object_unref(pad);
- pad = NULL;
MMCAM_LOG_ERROR("failed to create ghost audio_sink0 on _MMCAMCORDER_ENCSINK_BIN.");
err = MM_ERROR_CAMCORDER_GST_LINK;
goto pipeline_creation_error;
}
gst_object_unref(pad);
- pad = NULL;
}
} else if (profile == MM_CAMCORDER_ENCBIN_PROFILE_AUDIO) {
pad = gst_element_request_pad_simple(sc->encode_element[_MMCAMCORDER_ENCSINK_ENCBIN].gst, "audio");
if (!gst_element_add_pad(sc->encode_element[_MMCAMCORDER_ENCSINK_BIN].gst, gst_ghost_pad_new("audio_sink0", pad))) {
gst_object_unref(pad);
- pad = NULL;
MMCAM_LOG_ERROR("failed to create ghost audio_sink0 on _MMCAMCORDER_ENCSINK_BIN.");
err = MM_ERROR_CAMCORDER_GST_LINK;
goto pipeline_creation_error;
}
gst_object_unref(pad);
- pad = NULL;
} else {
/* for stillshot */
pad = gst_element_request_pad_simple(sc->encode_element[_MMCAMCORDER_ENCSINK_ENCBIN].gst, "image");
if (!gst_element_add_pad(sc->encode_element[_MMCAMCORDER_ENCSINK_BIN].gst, gst_ghost_pad_new("image_sink0", pad))) {
gst_object_unref(pad);
- pad = NULL;
MMCAM_LOG_ERROR("failed to create ghost image_sink0 on _MMCAMCORDER_ENCSINK_BIN.");
err = MM_ERROR_CAMCORDER_GST_LINK;
goto pipeline_creation_error;
}
gst_object_unref(pad);
- pad = NULL;
}
MMCAM_LOG_INFO("Get pad complete");
__mmcamcorder_video_dataprobe_preview, hcamcorder);
gst_object_unref(srcpad);
- srcpad = NULL;
} else {
MMCAM_LOG_ERROR("failed to get srcpad");
goto pipeline_creation_error;
MMCAMCORDER_ADD_BUFFER_PROBE(srcpad, _MMCAMCORDER_HANDLER_PREVIEW,
__mmcamcorder_video_dataprobe_record, hcamcorder);
gst_object_unref(srcpad);
- srcpad = NULL;
}
bus = gst_pipeline_get_bus(GST_PIPELINE(sc->element[_MMCAMCORDER_MAIN_PIPE].gst));
gst_bus_set_sync_handler(bus, _mmcamcorder_pipeline_bus_sync_callback, (gpointer)hcamcorder, NULL);
gst_object_unref(bus);
- bus = NULL;
/* capture mode */
err = _mmcamcorder_initialize_capture_mode(handle);
}
gst_object_unref(parent);
- parent = NULL;
break;
case GST_EVENT_EOS:
MMCAM_LOG_WARNING("[%s:%s] gots %s", GST_DEBUG_PAD_NAME(pad), GST_EVENT_TYPE_NAME(event));
do_set_caps = TRUE;
}
- if (caps) {
+ if (caps)
gst_caps_unref(caps);
- caps = NULL;
- }
if (hcamcorder->type != MM_CAMCORDER_MODE_AUDIO) {
/* assume that it's camera capture mode */
MMCAMCORDER_G_OBJECT_SET_POINTER(element, "stream-properties", props);
gst_structure_free(props);
- props = NULL;
return TRUE;
}
MMCAMCORDER_ADD_BUFFER_PROBE(sinkpad, _MMCAMCORDER_HANDLER_VIDEOREC,
__mmcamcorder_audioque_dataprobe, hcamcorder);
gst_object_unref(sinkpad);
- sinkpad = NULL;
/* for voice mute */
srcpad = gst_element_get_static_pad(sc->encode_element[_MMCAMCORDER_AUDIOSRC_SRC].gst, "src");
MMCAMCORDER_ADD_BUFFER_PROBE(srcpad, _MMCAMCORDER_HANDLER_VIDEOREC,
__mmcamcorder_audio_dataprobe_audio_mute, hcamcorder);
gst_object_unref(srcpad);
- srcpad = NULL;
if (sc->encode_element[_MMCAMCORDER_ENCSINK_AENC_QUE].gst) {
srcpad = gst_element_get_static_pad(sc->encode_element[_MMCAMCORDER_ENCSINK_AENC_QUE].gst, "src");
MMCAMCORDER_ADD_EVENT_PROBE(srcpad, _MMCAMCORDER_HANDLER_VIDEOREC,
__mmcamcorder_eventprobe_monitor, hcamcorder);
gst_object_unref(srcpad);
- srcpad = NULL;
}
}
MMCAMCORDER_ADD_EVENT_PROBE(srcpad, _MMCAMCORDER_HANDLER_VIDEOREC,
__mmcamcorder_eventprobe_monitor, hcamcorder);
gst_object_unref(srcpad);
- srcpad = NULL;
}
if (sc->audio_disable) {
MMCAMCORDER_ADD_BUFFER_PROBE(sinkpad, _MMCAMCORDER_HANDLER_VIDEOREC,
__mmcamcorder_video_dataprobe_audio_disable, hcamcorder);
gst_object_unref(sinkpad);
- sinkpad = NULL;
}
if (!strcmp(gst_element_rsink_name, "filesink")) {
MMCAMCORDER_ADD_BUFFER_PROBE(srcpad, _MMCAMCORDER_HANDLER_VIDEOREC,
__mmcamcorder_video_dataprobe_encoded, hcamcorder);
gst_object_unref(srcpad);
- srcpad = NULL;
if (sc->audio_disable == FALSE) {
srcpad = gst_element_get_static_pad(sc->encode_element[_MMCAMCORDER_ENCSINK_AENC].gst, "src");
MMCAMCORDER_ADD_BUFFER_PROBE(srcpad, _MMCAMCORDER_HANDLER_VIDEOREC,
__mmcamcorder_audio_dataprobe_check, hcamcorder);
gst_object_unref(srcpad);
- srcpad = NULL;
}
}
MMCAMCORDER_ADD_EVENT_PROBE(sinkpad, _MMCAMCORDER_HANDLER_VIDEOREC,
__mmcamcorder_eventprobe_monitor, hcamcorder);
gst_object_unref(sinkpad);
- sinkpad = NULL;
bus = gst_pipeline_get_bus(GST_PIPELINE(sc->encode_element[_MMCAMCORDER_ENCODE_MAIN_PIPE].gst));
gst_bus_set_sync_handler(bus, _mmcamcorder_encode_pipeline_bus_sync_callback, (gpointer)hcamcorder, NULL);
gst_object_unref(bus);
- bus = NULL;
return MM_ERROR_NONE;
if (reqpad) {
gst_element_release_request_pad(sc->encode_element[_MMCAMCORDER_ENCSINK_ENCBIN].gst, reqpad);
gst_object_unref(reqpad);
- reqpad = NULL;
}
reqpad = gst_element_get_static_pad(sc->encode_element[_MMCAMCORDER_ENCSINK_ENCBIN].gst, "video");
if (reqpad) {
gst_element_release_request_pad(sc->encode_element[_MMCAMCORDER_ENCSINK_ENCBIN].gst, reqpad);
gst_object_unref(reqpad);
- reqpad = NULL;
}
/* release encode main pipeline */
while ((gst_msg = gst_bus_pop(bus)) != NULL) {
_mmcamcorder_pipeline_cb_message(bus, gst_msg, (gpointer)hcamcorder);
gst_message_unref(gst_msg);
- gst_msg = NULL;
}
gst_object_unref(bus);
- bus = NULL;
}
MMCAM_LOG_INFO("done");