From c490e80239f090c67b00a88468155e1c406da938 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Fri, 15 Nov 2013 12:22:23 +0200 Subject: avcenc: Update video port parameters in the base class This makes sure that the right parameters are returned on both input and output ports if queried after setting. This also makes sure that the output MediaFormat from the MediaCodec class contains the right video size. Change-Id: I0667b3b4c6bb90331ad0ae7d51388e1bca3d1bbd --- media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp b/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp index 4a21a3e..1d398fb 100644 --- a/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp +++ b/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp @@ -593,6 +593,17 @@ OMX_ERRORTYPE SoftAVCEncoder::internalSetParameter( mVideoHeight = def->format.video.nFrameHeight; mVideoFrameRate = def->format.video.xFramerate >> 16; mVideoColorFormat = def->format.video.eColorFormat; + + OMX_PARAM_PORTDEFINITIONTYPE *portDef = + &editPortInfo(0)->mDef; + portDef->format.video.nFrameWidth = mVideoWidth; + portDef->format.video.nFrameHeight = mVideoHeight; + portDef->format.video.xFramerate = def->format.video.xFramerate; + portDef->format.video.eColorFormat = + (OMX_COLOR_FORMATTYPE) mVideoColorFormat; + portDef = &editPortInfo(1)->mDef; + portDef->format.video.nFrameWidth = mVideoWidth; + portDef->format.video.nFrameHeight = mVideoHeight; } else { mVideoBitRate = def->format.video.nBitrate; } -- cgit v1.1