MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSRC_QUE].gst, "empty-buffers", TRUE);
MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSINK_QUE].gst, "empty-buffers", TRUE);
- _mmcamcorder_gst_set_state(handle, sc->element[_MMCAMCORDER_MAIN_PIPE].gst, GST_STATE_READY);
+ if (!_mmcamcorder_is_encoded_preview_pixel_format(preview_format))
+ _mmcamcorder_gst_set_state(handle, sc->element[_MMCAMCORDER_MAIN_PIPE].gst, GST_STATE_READY);
/* check decoder recreation */
if (!_mmcamcorder_recreate_decoder_for_encoded_preview(handle)) {
MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSRC_QUE].gst, "empty-buffers", FALSE);
MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSINK_QUE].gst, "empty-buffers", FALSE);
- _mmcamcorder_gst_set_state(handle, sc->element[_MMCAMCORDER_MAIN_PIPE].gst, GST_STATE_PLAYING);
+ if (!_mmcamcorder_is_encoded_preview_pixel_format(preview_format))
+ _mmcamcorder_gst_set_state(handle, sc->element[_MMCAMCORDER_MAIN_PIPE].gst, GST_STATE_PLAYING);
/* unlock */
g_mutex_unlock(&hcamcorder->restart_preview_lock);
MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSRC_QUE].gst, "empty-buffers", TRUE);
MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSINK_QUE].gst, "empty-buffers", TRUE);
- _mmcamcorder_gst_set_state(handle, sc->element[_MMCAMCORDER_MAIN_PIPE].gst, GST_STATE_READY);
+ if (!_mmcamcorder_is_encoded_preview_pixel_format(preview_format))
+ _mmcamcorder_gst_set_state(handle, sc->element[_MMCAMCORDER_MAIN_PIPE].gst, GST_STATE_READY);
/* check decoder recreation */
if (!_mmcamcorder_recreate_decoder_for_encoded_preview(handle)) {
MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSRC_QUE].gst, "empty-buffers", FALSE);
MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_VIDEOSINK_QUE].gst, "empty-buffers", FALSE);
- _mmcamcorder_gst_set_state(handle, sc->element[_MMCAMCORDER_MAIN_PIPE].gst, GST_STATE_PLAYING);
+ if (!_mmcamcorder_is_encoded_preview_pixel_format(preview_format))
+ _mmcamcorder_gst_set_state(handle, sc->element[_MMCAMCORDER_MAIN_PIPE].gst, GST_STATE_PLAYING);
/* unlock */
g_mutex_unlock(&hcamcorder->restart_preview_lock);
static GstPadProbeReturn __mmcamcorder_video_dataprobe_push_buffer_to_record(GstPad *pad, GstPadProbeInfo *info, gpointer u_data);
static int __mmcamcorder_get_amrnb_bitrate_mode(int bitrate);
static guint32 _mmcamcorder_convert_fourcc_string_to_value(const gchar* format_name);
-static inline bool __mmcamcorder_is_encoded_preview_pixel_format(int pixel_format);
#ifdef _MMCAMCORDER_PRODUCT_TV
static bool __mmcamcorder_find_max_resolution(MMHandleType handle, gint *max_width, gint *max_height);
#endif /* _MMCAMCORDER_PRODUCT_TV */
}
}
- if (__mmcamcorder_is_encoded_preview_pixel_format(sc->info_image->preview_format)) {
+ if (_mmcamcorder_is_encoded_preview_pixel_format(sc->info_image->preview_format)) {
/* get recreate_decoder flag */
_mmcamcorder_conf_get_value_int(handle, hcamcorder->conf_main,
CONFIGURE_CATEGORY_MAIN_VIDEO_OUTPUT,
/* set capsfilter */
if (profile == MM_CAMCORDER_ENCBIN_PROFILE_VIDEO) {
- if (__mmcamcorder_is_encoded_preview_pixel_format(sc->info_image->preview_format)) {
+ if (_mmcamcorder_is_encoded_preview_pixel_format(sc->info_image->preview_format)) {
_mmcam_dbg_log("get pad from videosrc_filter");
pad = gst_element_get_static_pad(sc->element[_MMCAMCORDER_VIDEOSRC_FILT].gst, "src");
} else {
goto pipeline_creation_error;
}
- if (__mmcamcorder_is_encoded_preview_pixel_format(sc->info_image->preview_format)) {
+ if (_mmcamcorder_is_encoded_preview_pixel_format(sc->info_image->preview_format)) {
/* set dummy element */
gst_element_venc_name = "identity";
} else {
}
/* set dataprobe for video recording */
- if (__mmcamcorder_is_encoded_preview_pixel_format(sc->info_image->preview_format))
+ if (_mmcamcorder_is_encoded_preview_pixel_format(sc->info_image->preview_format))
srcpad = gst_element_get_static_pad(sc->element[_MMCAMCORDER_VIDEOSRC_QUE].gst, "src");
else
srcpad = gst_element_get_static_pad(sc->element[_MMCAMCORDER_VIDEOSINK_QUE].gst, "src");
GstMemory *memory = NULL;
GstMapInfo mapinfo;
- if (!__mmcamcorder_is_encoded_preview_pixel_format(sc->info_image->preview_format)) {
+ if (!_mmcamcorder_is_encoded_preview_pixel_format(sc->info_image->preview_format)) {
state = _mmcamcorder_get_state((MMHandleType)hcamcorder);
if (state < MM_CAMCORDER_STATE_PREPARE) {
_mmcam_dbg_warn("Not ready for stream callback");
}
/* set size and timestamp */
- if (__mmcamcorder_is_encoded_preview_pixel_format(sc->info_image->preview_format))
+ if (_mmcamcorder_is_encoded_preview_pixel_format(sc->info_image->preview_format))
memory = gst_buffer_get_all_memory(buffer);
else
memory = gst_buffer_peek_memory(buffer, 0);
/* unmap memory */
if (mapinfo.data)
gst_memory_unmap(memory, &mapinfo);
- if (__mmcamcorder_is_encoded_preview_pixel_format(sc->info_image->preview_format))
+ if (_mmcamcorder_is_encoded_preview_pixel_format(sc->info_image->preview_format))
gst_memory_unref(memory);
}
gst_structure_get_int(structure, "rotate", &caps_rotate);
#ifdef _MMCAMCORDER_PRODUCT_TV
- if (__mmcamcorder_is_encoded_preview_pixel_format(sc->info_image->preview_format)) {
+ if (_mmcamcorder_is_encoded_preview_pixel_format(sc->info_image->preview_format)) {
if (set_width == caps_width && set_height == caps_height &&
set_rotate == caps_rotate && fps == caps_fps) {
_mmcam_dbg_log("No need to replace caps.");
_MMCamcorderSubContext *sc = NULL;
mmf_camcorder_t *hcamcorder = NULL;
const char *videodecoder_name = NULL;
+ int display_surface_type = MM_DISPLAY_SURFACE_NULL;
#ifdef _MMCAMCORDER_RM_SUPPORT
char decoder_name[20] = {'\0',};
int decoder_index = 0;
return FALSE;
}
- if (__mmcamcorder_is_encoded_preview_pixel_format(sc->info_image->preview_format) == false ||
+ if (_mmcamcorder_is_encoded_preview_pixel_format(sc->info_image->preview_format) == false ||
hcamcorder->recreate_decoder == FALSE) {
_mmcam_dbg_log("skip this fuction - format %d, recreate decoder %d",
sc->info_image->preview_format, hcamcorder->recreate_decoder);
return TRUE;
}
+ mm_camcorder_get_attributes(handle, NULL,
+ MMCAM_DISPLAY_SURFACE, &display_surface_type,
+ NULL);
+
+ if (display_surface_type == MM_DISPLAY_SURFACE_NULL) {
+ _mmcam_dbg_log("no need to control decoder element");
+ return TRUE;
+ }
+
if (sc->element[_MMCAMCORDER_MAIN_PIPE].gst == NULL ||
sc->element[_MMCAMCORDER_VIDEOSRC_DECODE].gst == NULL) {
_mmcam_dbg_warn("main pipeline or decoder plugin is NULL");
return TRUE;
}
-static inline bool __mmcamcorder_is_encoded_preview_pixel_format(int pixel_format) {
- if (pixel_format == MM_PIXEL_FORMAT_ENCODED_H264 || pixel_format == MM_PIXEL_FORMAT_ENCODED_MJPEG)
- return true;
-
- return false;
-}
-
#ifdef _MMCAMCORDER_PRODUCT_TV
static bool __mmcamcorder_find_max_resolution(MMHandleType handle, gint *max_width, gint *max_height)
{