From: Jeongmo Yang Date: Tue, 19 Mar 2013 08:34:39 +0000 (+0900) Subject: Support H/W video encoder when use zero copy format X-Git-Tag: 2.1b_release~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ebc5cf181f14896766689f54cbf2661ec79b5c46;p=framework%2Fmultimedia%2Flibmm-camcorder.git Support H/W video encoder when use zero copy format --- diff --git a/packaging/libmm-camcorder.spec b/packaging/libmm-camcorder.spec index eff02fa..32f5621 100644 --- a/packaging/libmm-camcorder.spec +++ b/packaging/libmm-camcorder.spec @@ -1,6 +1,6 @@ Name: libmm-camcorder Summary: Camera and recorder library -Version: 0.7.8 +Version: 0.7.9 Release: 0 Group: libs License: Apache-2.0 diff --git a/src/include/mm_camcorder_internal.h b/src/include/mm_camcorder_internal.h index 8819aac..fbd080f 100644 --- a/src/include/mm_camcorder_internal.h +++ b/src/include/mm_camcorder_internal.h @@ -436,6 +436,7 @@ typedef enum { _MMCAMCORDER_ENCSINK_AENC, _MMCAMCORDER_ENCSINK_AENC_QUE, _MMCAMCORDER_ENCSINK_VQUE, + _MMCAMCORDER_ENCSINK_VCONV, _MMCAMCORDER_ENCSINK_VENC, _MMCAMCORDER_ENCSINK_VENC_QUE, _MMCAMCORDER_ENCSINK_ITOG, diff --git a/src/mm_camcorder_gstcommon.c b/src/mm_camcorder_gstcommon.c index 7998bc2..c943783 100644 --- a/src/mm_camcorder_gstcommon.c +++ b/src/mm_camcorder_gstcommon.c @@ -120,7 +120,8 @@ gboolean videocodec_fileformat_compatibility_table[MM_VIDEO_CODEC_NUM][MM_FILE_F | LOCAL VARIABLE DEFINITIONS for internal | -----------------------------------------------------------------------*/ #define USE_AUDIO_CLOCK_TUNE -#define _MMCAMCORDER_WAIT_EOS_TIME 5.0 //sec +#define _MMCAMCORDER_WAIT_EOS_TIME 5.0 /* sec */ +#define _MMCAMCORDER_CONVERT_OUTPUT_BUFFER_NUM 6 /*----------------------------------------------------------------------- | LOCAL FUNCTION PROTOTYPES: | @@ -989,6 +990,33 @@ int _mmcamcorder_create_encodesink_bin(MMHandleType handle, MMCamcorderEncodebin MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_ENCSINK_ENCBIN].gst, "venc-name", gst_element_venc_name); _MMCAMCORDER_ENCODEBIN_ELMGET(sc, _MMCAMCORDER_ENCSINK_VENC, "video-encode", err); + /* set color convert plugin */ + if (hcamcorder->use_zero_copy_format && + sc->fourcc != GST_MAKE_FOURCC('S','N','1','2')) { + int dst_buffer_num = _MMCAMCORDER_CONVERT_OUTPUT_BUFFER_NUM; + + /* set fimcconvert as colorspace element */ + MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_ENCSINK_ENCBIN].gst, "vconv-name", "fimcconvert"); + _MMCAMCORDER_ENCODEBIN_ELMGET(sc, _MMCAMCORDER_ENCSINK_VCONV, "video-convert", err); + + caps = gst_caps_new_simple("video/x-raw-yuv", + "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC('S','N','1','2'), + NULL); + if (caps) { + MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_ENCSINK_ENCBIN].gst, "vcaps", caps); + MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_ENCSINK_VCONV].gst, "dst-buffer-num", dst_buffer_num); + MMCAMCORDER_G_OBJECT_SET(sc->element[_MMCAMCORDER_ENCSINK_ENCBIN].gst, "auto-colorspace", TRUE); + + gst_caps_unref (caps); + caps = NULL; + } else { + err = MM_ERROR_CAMCORDER_RESOURCE_CREATION; + goto pipeline_creation_error; + } + + _mmcam_dbg_log("fimcconvert dst-buffer-num %d", dst_buffer_num); + } + _mmcamcorder_conf_get_value_int(hcamcorder->conf_main, CONFIGURE_CATEGORY_MAIN_RECORD, "UseVideoEncoderQueue",