aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhanh V. Nguyen <khanh.v.nguyen@intel.com>2013-07-01 16:58:54 -0700
committerPatrick Tjin <pattjin@google.com>2014-07-21 22:02:52 -0700
commitaaefabb42927db20baba7e55bf7e16e607e581e2 (patch)
tree0ca5a014d758713d4e0566f97b2a3e6cd49a56f2
parent9ef000acda95fca3c57b98792f9c05f3919592c6 (diff)
downloadandroid_hardware_intel_common_omx-components-aaefabb42927db20baba7e55bf7e16e607e581e2.tar.gz
android_hardware_intel_common_omx-components-aaefabb42927db20baba7e55bf7e16e607e581e2.tar.bz2
android_hardware_intel_common_omx-components-aaefabb42927db20baba7e55bf7e16e607e581e2.zip
Retain the requested NaluFormat
BZ: 120399 This patch makes sure NaluFormat is set to default base on input only when it was not explicitly requested by the caller Change-Id: Idc8bd5f468761696d7bcf9b4088d33c13bdbef6c Signed-off-by: Khanh V. Nguyen <khanh.v.nguyen@intel.com> Reviewed-on: http://android.intel.com:8080/116451 Reviewed-by: Zhao, Leo <leo.zhao@intel.com> Reviewed-by: Ding, Haitao <haitao.ding@intel.com> Reviewed-by: Shi, PingX <pingx.shi@intel.com> Tested-by: Shi, PingX <pingx.shi@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
-rwxr-xr-xvideocodec/OMXVideoEncoderAVC.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/videocodec/OMXVideoEncoderAVC.cpp b/videocodec/OMXVideoEncoderAVC.cpp
index df96cf1..128cf56 100755
--- a/videocodec/OMXVideoEncoderAVC.cpp
+++ b/videocodec/OMXVideoEncoderAVC.cpp
@@ -143,7 +143,6 @@ OMX_ERRORTYPE OMXVideoEncoderAVC::InitOutputPortFormatSpecific(OMX_PARAM_PORTDEF
SetTypeHeader(&mNalStreamFormat, sizeof(mNalStreamFormat));
mNalStreamFormat.nPortIndex = OUTPORT_INDEX;
// TODO: check if this is desired Nalu Format
- mNalStreamFormat.eNaluFormat = OMX_NaluFormatStartCodesSeparateFirstHeader;
//mNalStreamFormat.eNaluFormat = OMX_NaluFormatLengthPrefixedSeparateFirstHeader;
// OMX_VIDEO_CONFIG_AVCINTRAPERIOD
memset(&mConfigAvcIntraPeriod, 0, sizeof(mConfigAvcIntraPeriod));
@@ -399,8 +398,15 @@ OMX_ERRORTYPE OMXVideoEncoderAVC::ProcessDataRetrieve(
OMX_NALUFORMATSTYPE NaluFormat = mNalStreamFormat.eNaluFormat;
- if (mStoreMetaDataInBuffers)
- NaluFormat = OMX_NaluFormatLengthPrefixedSeparateFirstHeader;
+ // NaluFormat not set, setting default
+ if (NaluFormat == 0) {
+ if (mStoreMetaDataInBuffers) {
+ NaluFormat = OMX_NaluFormatLengthPrefixedSeparateFirstHeader;
+ } else {
+ NaluFormat = OMX_NaluFormatStartCodesSeparateFirstHeader;
+ }
+ mNalStreamFormat.eNaluFormat = NaluFormat;
+ }
VideoEncOutputBuffer outBuf;
outBuf.data = buffers[OUTPORT_INDEX]->pBuffer + buffers[OUTPORT_INDEX]->nOffset;