• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

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

frameworks/av


コミットメタ情報

リビジョン97390c6bf23326a0d9a97b9d63e7f72eab396303 (tree)
日時2019-09-05 10:40:56
作者Chong Zhang <chz@goog...>
コミッターChong Zhang

ログメッセージ

ACodec: query grid config from component even if grid is disabled

bug: 138397508
test: cts HeifWriterTest on devices that can enable OMX HEIC encoder.

Change-Id: I6e8437c0b8cc4901e943f2ed7cb23cb16ed096fe
(cherry picked from commit 7b0ff1953ddeee2e83c8f8871cdf69db3ac32c85)

変更サマリ

差分

--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -4505,22 +4505,38 @@ status_t ACodec::setupAVCEncoderParameters(const sp<AMessage> &msg) {
45054505 status_t ACodec::configureImageGrid(
45064506 const sp<AMessage> &msg, sp<AMessage> &outputFormat) {
45074507 int32_t tileWidth, tileHeight, gridRows, gridCols;
4508- if (!msg->findInt32("tile-width", &tileWidth) ||
4509- !msg->findInt32("tile-height", &tileHeight) ||
4510- !msg->findInt32("grid-rows", &gridRows) ||
4511- !msg->findInt32("grid-cols", &gridCols)) {
4508+ OMX_BOOL useGrid = OMX_FALSE;
4509+ if (msg->findInt32("tile-width", &tileWidth) &&
4510+ msg->findInt32("tile-height", &tileHeight) &&
4511+ msg->findInt32("grid-rows", &gridRows) &&
4512+ msg->findInt32("grid-cols", &gridCols)) {
4513+ useGrid = OMX_TRUE;
4514+ } else {
4515+ // when bEnabled is false, the tile info is not used,
4516+ // but clear out these too.
4517+ tileWidth = tileHeight = gridRows = gridCols = 0;
4518+ }
4519+
4520+ if (!mIsImage && !useGrid) {
45124521 return OK;
45134522 }
45144523
45154524 OMX_VIDEO_PARAM_ANDROID_IMAGEGRIDTYPE gridType;
45164525 InitOMXParams(&gridType);
45174526 gridType.nPortIndex = kPortIndexOutput;
4518- gridType.bEnabled = OMX_TRUE;
4527+ gridType.bEnabled = useGrid;
45194528 gridType.nTileWidth = tileWidth;
45204529 gridType.nTileHeight = tileHeight;
45214530 gridType.nGridRows = gridRows;
45224531 gridType.nGridCols = gridCols;
45234532
4533+ ALOGV("sending image grid info to component: bEnabled %d, tile %dx%d, grid %dx%d",
4534+ gridType.bEnabled,
4535+ gridType.nTileWidth,
4536+ gridType.nTileHeight,
4537+ gridType.nGridRows,
4538+ gridType.nGridCols);
4539+
45244540 status_t err = mOMXNode->setParameter(
45254541 (OMX_INDEXTYPE)OMX_IndexParamVideoAndroidImageGrid,
45264542 &gridType, sizeof(gridType));
@@ -4541,6 +4557,13 @@ status_t ACodec::configureImageGrid(
45414557 (OMX_INDEXTYPE)OMX_IndexParamVideoAndroidImageGrid,
45424558 &gridType, sizeof(gridType));
45434559
4560+ ALOGV("received image grid info from component: bEnabled %d, tile %dx%d, grid %dx%d",
4561+ gridType.bEnabled,
4562+ gridType.nTileWidth,
4563+ gridType.nTileHeight,
4564+ gridType.nGridRows,
4565+ gridType.nGridCols);
4566+
45444567 if (err == OK && gridType.bEnabled) {
45454568 outputFormat->setInt32("tile-width", gridType.nTileWidth);
45464569 outputFormat->setInt32("tile-height", gridType.nTileHeight);