• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

frameworks/av


Commit MetaInfo

Revisiona0cd4411904e248223a922ff454d6f09d959861b (tree)
Time2020-04-14 22:49:59
AuthorPaulo Sergio Travaglia <pstglia@gmai...>
CommiterChih-Wei Huang

Log Message

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.

Change Summary

Incremental Difference

--- a/cmds/screenrecord/screenrecord.cpp
+++ b/cmds/screenrecord/screenrecord.cpp
@@ -187,7 +187,7 @@ static status_t prepareEncoder(float displayFps, sp<MediaCodec>* pCodec,
187187 format->setInt32(KEY_WIDTH, gVideoWidth);
188188 format->setInt32(KEY_HEIGHT, gVideoHeight);
189189 format->setString(KEY_MIME, kMimeTypeAvc);
190- format->setInt32(KEY_COLOR_FORMAT, OMX_COLOR_FormatAndroidOpaque);
190+ format->setInt32(KEY_COLOR_FORMAT, OMX_COLOR_FormatYUV420Planar);
191191 format->setInt32(KEY_BIT_RATE, gBitRate);
192192 format->setFloat(KEY_FRAME_RATE, displayFps);
193193 format->setInt32(KEY_I_FRAME_INTERVAL, 10);
--- a/media/libstagefright/omx/SoftVideoEncoderOMXComponent.cpp
+++ b/media/libstagefright/omx/SoftVideoEncoderOMXComponent.cpp
@@ -397,8 +397,10 @@ OMX_ERRORTYPE SoftVideoEncoderOMXComponent::internalGetParameter(
397397 // XXX: For now just configure input and output buffers the same size.
398398 // May want to determine a more suitable output buffer size independent
399399 // of YUV format.
400+#if !defined(__i386__) && !defined(__x86_64__)
400401 CHECK(mColorFormat == OMX_COLOR_FormatYUV420Planar ||
401402 mColorFormat == OMX_COLOR_FormatYUV420SemiPlanar);
403+#endif
402404 def->nBufferSize = mWidth * mHeight * 3 / 2;
403405
404406 return OMX_ErrorNone;