diff options
author | Martin Storsjo <martin@martin.st> | 2013-11-15 12:22:23 +0200 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2013-11-21 09:49:30 +0200 |
commit | c490e80239f090c67b00a88468155e1c406da938 (patch) | |
tree | a5fb385d0a3c246eccada526e6956b9da7a6ec77 /media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp | |
parent | 96aed4fb18e5303b039cc7e5dc252e0827491d09 (diff) | |
download | frameworks_av-c490e80239f090c67b00a88468155e1c406da938.zip frameworks_av-c490e80239f090c67b00a88468155e1c406da938.tar.gz frameworks_av-c490e80239f090c67b00a88468155e1c406da938.tar.bz2 |
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
Diffstat (limited to 'media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp')
-rw-r--r-- | media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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; } |