diff options
author | Lajos Molnar <lajos@google.com> | 2014-10-28 06:24:59 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2014-10-28 06:24:59 +0000 |
commit | bc83643295f034ed518a1da4320b48157e1dece5 (patch) | |
tree | 0d4ac19620b712b2a1ebff32988d588c92563530 | |
parent | eb9ee3c08f3e397a726395f8658a087fb659e780 (diff) | |
parent | 294c7f36e6a92419017e7fe2a204fba1284cdc08 (diff) | |
download | frameworks_av-bc83643295f034ed518a1da4320b48157e1dece5.zip frameworks_av-bc83643295f034ed518a1da4320b48157e1dece5.tar.gz frameworks_av-bc83643295f034ed518a1da4320b48157e1dece5.tar.bz2 |
Merge "libstagefright: set actual stride info for SW encoder input port" into lmp-mr1-dev automerge: 701b964
automerge: 294c7f3
* commit '294c7f36e6a92419017e7fe2a204fba1284cdc08':
libstagefright: set actual stride info for SW encoder input port
4 files changed, 17 insertions, 1 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 4702874..4c8a199 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -2221,7 +2221,11 @@ status_t ACodec::setupVideoEncoder(const char *mime, const sp<AMessage> &msg) { video_def->xFramerate = (OMX_U32)(frameRate * 65536.0f); video_def->eCompressionFormat = OMX_VIDEO_CodingUnused; - video_def->eColorFormat = colorFormat; + // this is redundant as it was already set up in setVideoPortFormatType + // FIXME for now skip this only for flexible YUV formats + if (colorFormat != OMX_COLOR_FormatYUV420Flexible) { + video_def->eColorFormat = colorFormat; + } err = mOMX->setParameter( mNode, OMX_IndexParamPortDefinition, &def, sizeof(def)); diff --git a/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp b/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp index 1513b0b..cfc37b7 100644 --- a/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp +++ b/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp @@ -575,9 +575,13 @@ OMX_ERRORTYPE SoftAVCEncoder::internalSetParameter( &editPortInfo(0)->mDef; portDef->format.video.nFrameWidth = mVideoWidth; portDef->format.video.nFrameHeight = mVideoHeight; + portDef->format.video.nStride = portDef->format.video.nFrameWidth; + portDef->format.video.nSliceHeight = portDef->format.video.nFrameHeight; portDef->format.video.xFramerate = def->format.video.xFramerate; portDef->format.video.eColorFormat = (OMX_COLOR_FORMATTYPE) mVideoColorFormat; + portDef->nBufferSize = + (portDef->format.video.nStride * portDef->format.video.nSliceHeight * 3) / 2; portDef = &editPortInfo(1)->mDef; portDef->format.video.nFrameWidth = mVideoWidth; portDef->format.video.nFrameHeight = mVideoHeight; diff --git a/media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.cpp b/media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.cpp index 28edff8..1d0a2f0 100644 --- a/media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.cpp +++ b/media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.cpp @@ -462,9 +462,13 @@ OMX_ERRORTYPE SoftMPEG4Encoder::internalSetParameter( &editPortInfo(0)->mDef; portDef->format.video.nFrameWidth = mVideoWidth; portDef->format.video.nFrameHeight = mVideoHeight; + portDef->format.video.nStride = portDef->format.video.nFrameWidth; + portDef->format.video.nSliceHeight = portDef->format.video.nFrameHeight; portDef->format.video.xFramerate = def->format.video.xFramerate; portDef->format.video.eColorFormat = (OMX_COLOR_FORMATTYPE) mVideoColorFormat; + portDef->nBufferSize = + (portDef->format.video.nStride * portDef->format.video.nSliceHeight * 3) / 2; portDef = &editPortInfo(1)->mDef; portDef->format.video.nFrameWidth = mVideoWidth; portDef->format.video.nFrameHeight = mVideoHeight; diff --git a/media/libstagefright/codecs/on2/enc/SoftVPXEncoder.cpp b/media/libstagefright/codecs/on2/enc/SoftVPXEncoder.cpp index eb621d5..0285feb 100644 --- a/media/libstagefright/codecs/on2/enc/SoftVPXEncoder.cpp +++ b/media/libstagefright/codecs/on2/enc/SoftVPXEncoder.cpp @@ -805,8 +805,12 @@ OMX_ERRORTYPE SoftVPXEncoder::internalSetPortParams( OMX_PARAM_PORTDEFINITIONTYPE *def = &editPortInfo(kInputPortIndex)->mDef; def->format.video.nFrameWidth = mWidth; def->format.video.nFrameHeight = mHeight; + def->format.video.nStride = def->format.video.nFrameWidth; + def->format.video.nSliceHeight = def->format.video.nFrameHeight; def->format.video.xFramerate = mFramerate; def->format.video.eColorFormat = mColorFormat; + def->nBufferSize = + (def->format.video.nStride * def->format.video.nSliceHeight * 3) / 2; def = &editPortInfo(kOutputPortIndex)->mDef; def->format.video.nFrameWidth = mWidth; def->format.video.nFrameHeight = mHeight; |