frameworks/av
Revision | a0cd4411904e248223a922ff454d6f09d959861b (tree) |
---|---|
Time | 2020-04-14 22:49:59 |
Author | Paulo Sergio Travaglia <pstglia@gmai...> |
Commiter | Chih-Wei Huang |
Allow screenrecord usage on Android-x86
Selects a supported color format for screenrecord (
OMX_COLOR_FormatYUV420Planar instead of OMX_COLOR_FormatAndroidOpaque)
and removes a check on SoftVideoEncoderOMXComponent.cpp
in order to make screenrecord work on Android-x86.
@@ -187,7 +187,7 @@ static status_t prepareEncoder(float displayFps, sp<MediaCodec>* pCodec, | ||
187 | 187 | format->setInt32(KEY_WIDTH, gVideoWidth); |
188 | 188 | format->setInt32(KEY_HEIGHT, gVideoHeight); |
189 | 189 | format->setString(KEY_MIME, kMimeTypeAvc); |
190 | - format->setInt32(KEY_COLOR_FORMAT, OMX_COLOR_FormatAndroidOpaque); | |
190 | + format->setInt32(KEY_COLOR_FORMAT, OMX_COLOR_FormatYUV420Planar); | |
191 | 191 | format->setInt32(KEY_BIT_RATE, gBitRate); |
192 | 192 | format->setFloat(KEY_FRAME_RATE, displayFps); |
193 | 193 | format->setInt32(KEY_I_FRAME_INTERVAL, 10); |
@@ -397,8 +397,10 @@ OMX_ERRORTYPE SoftVideoEncoderOMXComponent::internalGetParameter( | ||
397 | 397 | // XXX: For now just configure input and output buffers the same size. |
398 | 398 | // May want to determine a more suitable output buffer size independent |
399 | 399 | // of YUV format. |
400 | +#if !defined(__i386__) && !defined(__x86_64__) | |
400 | 401 | CHECK(mColorFormat == OMX_COLOR_FormatYUV420Planar || |
401 | 402 | mColorFormat == OMX_COLOR_FormatYUV420SemiPlanar); |
403 | +#endif | |
402 | 404 | def->nBufferSize = mWidth * mHeight * 3 / 2; |
403 | 405 | |
404 | 406 | return OMX_ErrorNone; |