From 4381d017c8afc2e551ee3ee9f6e87bb2438a3f4f Mon Sep 17 00:00:00 2001 From: Sejun Park Date: Tue, 28 Jun 2016 18:55:53 +0900 Subject: [PATCH] Enable to reoder timestamp Change-Id: I23882a517d5cc2ee444edbb3d9c442041a9e30c7 --- omx/gstomx.h | 36 +++++++++++++++++++++--------------- omx/gstomxvideodec.c | 24 ++++++++++++++++++++---- packaging/gst-omx.spec | 2 +- 3 files changed, 42 insertions(+), 20 deletions(-) diff --git a/omx/gstomx.h b/omx/gstomx.h index 12c98c9..862fc3c 100755 --- a/omx/gstomx.h +++ b/omx/gstomx.h @@ -183,36 +183,42 @@ struct _EnableGemBuffersParams enum { - BUF_SHARE_METHOD_PADDR = 0, - BUF_SHARE_METHOD_FD = 1, - BUF_SHARE_METHOD_TIZEN_BUFFER = 2, - BUF_SHARE_METHOD_FLUSH_BUFFER = 3, + BUF_SHARE_METHOD_PADDR = 0, + BUF_SHARE_METHOD_FD = 1, + BUF_SHARE_METHOD_TIZEN_BUFFER = 2, + BUF_SHARE_METHOD_FLUSH_BUFFER = 3, }; /* buf_share_method */ /* Extended color formats */ enum { - OMX_EXT_COLOR_FormatNV12TPhysicalAddress = 0x7F000001, /**< Reserved region for introducing Vendor Extensions */ - OMX_EXT_COLOR_FormatNV12LPhysicalAddress = 0x7F000002, - OMX_EXT_COLOR_FormatNV12Tiled = 0x7FC00002, - OMX_EXT_COLOR_FormatNV12TFdValue = 0x7F000012, - OMX_EXT_COLOR_FormatNV12LFdValue = 0x7F000013 + OMX_EXT_COLOR_FormatNV12TPhysicalAddress = 0x7F000001, /**< Reserved region for introducing Vendor Extensions */ + OMX_EXT_COLOR_FormatNV12LPhysicalAddress = 0x7F000002, + OMX_EXT_COLOR_FormatNV12Tiled = 0x7FC00002, + OMX_EXT_COLOR_FormatNV12TFdValue = 0x7F000012, + OMX_EXT_COLOR_FormatNV12LFdValue = 0x7F000013 }; #ifdef GST_TIZEN_MODIFICATION /* Extended port settings. */ enum { - OMX_IndexParamEnablePlatformSpecificBuffers = 0x7F000011 + OMX_IndexParamEnablePlatformSpecificBuffers = 0x7F000011, + OMX_IndexParamGetAndroidNativeBuffer = 0x7F000012, + OMX_IndexParamUseAndroidNativeBuffer = 0x7F000013, + OMX_IndexParamStoreMetaDataBuffer = 0x7F000014, + OMX_IndexParamPrependSPSPPSToIDR = 0x7F000015, + OMX_IndexParamEnableTimestampReorder = 0x7F000016, + OMX_IndexParamSharedOutputFD = 0x7F000017 }; #endif /* modification: Add_component_vendor */ enum GOmxVendor { - GOMX_VENDOR_DEFAULT, - GOMX_VENDOR_SLSI_SEC, - GOMX_VENDOR_SLSI_EXYNOS, - GOMX_VENDOR_QCT, - GOMX_VENDOR_SPRD + GOMX_VENDOR_DEFAULT, + GOMX_VENDOR_SLSI_SEC, + GOMX_VENDOR_SLSI_EXYNOS, + GOMX_VENDOR_QCT, + GOMX_VENDOR_SPRD }; typedef enum { diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c index eee27a3..06e4c00 100755 --- a/omx/gstomxvideodec.c +++ b/omx/gstomxvideodec.c @@ -1871,6 +1871,7 @@ gst_omx_video_dec_negotiate (GstOMXVideoDec * self) gchar *format_tmp; int i; EnableGemBuffersParams gemBuffers; + EnableGemBuffersParams config; #endif GST_DEBUG_OBJECT (self, "Trying to negotiate a video format with downstream"); @@ -1970,16 +1971,31 @@ gst_omx_video_dec_negotiate (GstOMXVideoDec * self) /* Set platform specific buffer settings. to avoid plane support error.. */ #ifdef GST_TIZEN_MODIFICATION - OMX_INIT_STRUCTURE(gemBuffers); - gemBuffers.enable = OMX_TRUE; - gemBuffers.nPortIndex = 1; - err = + OMX_INIT_STRUCTURE(gemBuffers); + gemBuffers.enable = OMX_TRUE; + gemBuffers.nPortIndex = 1; + + err = gst_omx_component_set_parameter (self->dec, OMX_IndexParamEnablePlatformSpecificBuffers,&gemBuffers); + if (err != OMX_ErrorNone) { GST_ERROR_OBJECT (self, "Failed to set video port format: %s (0x%08x)", gst_omx_error_to_string (err), err); } + + OMX_INIT_STRUCTURE(config); + config.enable = OMX_TRUE; + config.nPortIndex = 0; + + err = + gst_omx_component_set_parameter (self->dec, + OMX_IndexParamEnableTimestampReorder, &config); + + if (err != OMX_ErrorNone) { + GST_ERROR_OBJECT (self, "Failed to set timestamp reorder: %s (0x%08x)", + gst_omx_error_to_string (err), err); + } #endif gst_caps_unref (intersection); return (err == OMX_ErrorNone); diff --git a/packaging/gst-omx.spec b/packaging/gst-omx.spec index 3f406d0..a9c420e 100755 --- a/packaging/gst-omx.spec +++ b/packaging/gst-omx.spec @@ -1,6 +1,6 @@ Name: gst-omx Summary: GStreamer plug-in that allows communication with OpenMAX IL components -Version: 1.2.1 +Version: 1.2.2 Release: 0 License: LGPL-2.1+ Group: Multimedia/Framework -- 2.7.4