summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorRam Mohan M2017-07-04 08:51:19 -0500
committerPawin Vongmasa2017-08-01 22:10:41 -0500
commitbf556d1b91f112405411a3655c582612fe060821 (patch)
treec2d72c3eadd1a133d22085b690b6fe32a58dff00 /media
parent5b25fa66ca58f7f7b11aa890973eb61ecdbf314e (diff)
downloadplatform-hardware-interfaces-bf556d1b91f112405411a3655c582612fe060821.tar.gz
platform-hardware-interfaces-bf556d1b91f112405411a3655c582612fe060821.tar.xz
platform-hardware-interfaces-bf556d1b91f112405411a3655c582612fe060821.zip
bug fix: output colorformat configuration fixed
The eColorFormat field in OMX_PARAM_PORTDEFINITIONTYPE structure has no effect on the component. This has to be configured from OMX_VIDEO_PARAM_PORTFORMATTYPE. This is corrected. This color format information is passed to graphic buffer during its allocation Bug: 63796949 Change-Id: I51b1e59631647d1291ecfac373781ac5e5a0ffd5
Diffstat (limited to 'media')
-rw-r--r--[-rwxr-xr-x]media/omx/1.0/vts/functional/common/Android.bp0
-rw-r--r--[-rwxr-xr-x]media/omx/1.0/vts/functional/common/media_hidl_test_common.cpp0
-rw-r--r--media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp240
-rw-r--r--[-rwxr-xr-x]media/res/bbb_aac_stereo_128kbps_48000hz.aacbin159216 -> 159216 bytes
-rw-r--r--[-rwxr-xr-x]media/res/bbb_aac_stereo_128kbps_48000hz.info0
-rw-r--r--[-rwxr-xr-x]media/res/bbb_amrwb_1ch_14kbps_16000hz.amrwbbin20254 -> 20254 bytes
-rw-r--r--[-rwxr-xr-x]media/res/bbb_amrwb_1ch_14kbps_16000hz.info0
-rw-r--r--[-rwxr-xr-x]media/res/bbb_g711alaw_1ch_8khz.info0
-rw-r--r--[-rwxr-xr-x]media/res/bbb_g711alaw_1ch_8khz.raw0
-rw-r--r--[-rwxr-xr-x]media/res/bbb_g711mulaw_1ch_8khz.info0
-rw-r--r--[-rwxr-xr-x]media/res/bbb_g711mulaw_1ch_8khz.raw0
-rw-r--r--[-rwxr-xr-x]media/res/bbb_gsm_1ch_8khz_13kbps.info0
-rw-r--r--[-rwxr-xr-x]media/res/bbb_gsm_1ch_8khz_13kbps.rawbin16120 -> 16120 bytes
-rw-r--r--[-rwxr-xr-x]media/res/bbb_opus_stereo_128kbps_48000hz.info0
-rw-r--r--[-rwxr-xr-x]media/res/bbb_opus_stereo_128kbps_48000hz.opusbin163743 -> 163743 bytes
-rw-r--r--[-rwxr-xr-x]media/res/bbb_raw_1ch_8khz_s32le.info0
-rw-r--r--[-rwxr-xr-x]media/res/bbb_raw_1ch_8khz_s32le.rawbin158380 -> 158380 bytes
-rw-r--r--[-rwxr-xr-x]media/res/bbb_vorbis_stereo_128kbps_48000hz.info0
-rw-r--r--[-rwxr-xr-x]media/res/bbb_vorbis_stereo_128kbps_48000hz.vorbisbin147450 -> 147450 bytes
19 files changed, 196 insertions, 44 deletions
diff --git a/media/omx/1.0/vts/functional/common/Android.bp b/media/omx/1.0/vts/functional/common/Android.bp
index 93251fe8..93251fe8 100755..100644
--- a/media/omx/1.0/vts/functional/common/Android.bp
+++ b/media/omx/1.0/vts/functional/common/Android.bp
diff --git a/media/omx/1.0/vts/functional/common/media_hidl_test_common.cpp b/media/omx/1.0/vts/functional/common/media_hidl_test_common.cpp
index 863731aa..863731aa 100755..100644
--- a/media/omx/1.0/vts/functional/common/media_hidl_test_common.cpp
+++ b/media/omx/1.0/vts/functional/common/media_hidl_test_common.cpp
diff --git a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp
index 16ba745e..0771719c 100644
--- a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp
+++ b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp
@@ -27,6 +27,7 @@
27#include <android/hidl/allocator/1.0/IAllocator.h> 27#include <android/hidl/allocator/1.0/IAllocator.h>
28#include <android/hidl/memory/1.0/IMapper.h> 28#include <android/hidl/memory/1.0/IMapper.h>
29#include <android/hidl/memory/1.0/IMemory.h> 29#include <android/hidl/memory/1.0/IMemory.h>
30#include <cutils/atomic.h>
30 31
31using ::android::hardware::graphics::common::V1_0::BufferUsage; 32using ::android::hardware::graphics::common::V1_0::BufferUsage;
32using ::android::hardware::graphics::common::V1_0::PixelFormat; 33using ::android::hardware::graphics::common::V1_0::PixelFormat;
@@ -47,6 +48,7 @@ using ::android::sp;
47 48
48#include <VtsHalHidlTargetTestBase.h> 49#include <VtsHalHidlTargetTestBase.h>
49#include <getopt.h> 50#include <getopt.h>
51#include <media/hardware/HardwareAPI.h>
50#include <media_hidl_test_common.h> 52#include <media_hidl_test_common.h>
51#include <media_video_hidl_test_common.h> 53#include <media_video_hidl_test_common.h>
52#include <fstream> 54#include <fstream>
@@ -410,7 +412,7 @@ void GetURLForComponent(VideoDecHidlTest::standardComp comp, char* mURL,
410void allocateGraphicBuffers(sp<IOmxNode> omxNode, OMX_U32 portIndex, 412void allocateGraphicBuffers(sp<IOmxNode> omxNode, OMX_U32 portIndex,
411 android::Vector<BufferInfo>* buffArray, 413 android::Vector<BufferInfo>* buffArray,
412 uint32_t nFrameWidth, uint32_t nFrameHeight, 414 uint32_t nFrameWidth, uint32_t nFrameHeight,
413 int32_t* nStride, uint32_t count) { 415 int32_t* nStride, int format, uint32_t count) {
414 android::hardware::media::omx::V1_0::Status status; 416 android::hardware::media::omx::V1_0::Status status;
415 sp<android::hardware::graphics::allocator::V2_0::IAllocator> allocator = 417 sp<android::hardware::graphics::allocator::V2_0::IAllocator> allocator =
416 android::hardware::graphics::allocator::V2_0::IAllocator::getService(); 418 android::hardware::graphics::allocator::V2_0::IAllocator::getService();
@@ -427,7 +429,7 @@ void allocateGraphicBuffers(sp<IOmxNode> omxNode, OMX_U32 portIndex,
427 descriptorInfo.width = nFrameWidth; 429 descriptorInfo.width = nFrameWidth;
428 descriptorInfo.height = nFrameHeight; 430 descriptorInfo.height = nFrameHeight;
429 descriptorInfo.layerCount = 1; 431 descriptorInfo.layerCount = 1;
430 descriptorInfo.format = PixelFormat::RGBA_8888; 432 descriptorInfo.format = static_cast<PixelFormat>(format);
431 descriptorInfo.usage = static_cast<uint64_t>(BufferUsage::CPU_READ_OFTEN); 433 descriptorInfo.usage = static_cast<uint64_t>(BufferUsage::CPU_READ_OFTEN);
432 omxNode->getGraphicBufferUsage( 434 omxNode->getGraphicBufferUsage(
433 portIndex, 435 portIndex,
@@ -452,6 +454,9 @@ void allocateGraphicBuffers(sp<IOmxNode> omxNode, OMX_U32 portIndex,
452 EXPECT_EQ(error, android::hardware::graphics::mapper::V2_0::Error::NONE); 454 EXPECT_EQ(error, android::hardware::graphics::mapper::V2_0::Error::NONE);
453 455
454 EXPECT_EQ(buffArray->size(), count); 456 EXPECT_EQ(buffArray->size(), count);
457
458 static volatile int32_t nextId = 0;
459 uint64_t id = static_cast<uint64_t>(getpid()) << 32;
455 allocator->allocate( 460 allocator->allocate(
456 descriptor, count, 461 descriptor, count,
457 [&](android::hardware::graphics::mapper::V2_0::Error _s, uint32_t _n1, 462 [&](android::hardware::graphics::mapper::V2_0::Error _s, uint32_t _n1,
@@ -475,7 +480,7 @@ void allocateGraphicBuffers(sp<IOmxNode> omxNode, OMX_U32 portIndex,
475 buffArray->editItemAt(i).omxBuffer.attr.anwBuffer.layerCount = 480 buffArray->editItemAt(i).omxBuffer.attr.anwBuffer.layerCount =
476 descriptorInfo.layerCount; 481 descriptorInfo.layerCount;
477 buffArray->editItemAt(i).omxBuffer.attr.anwBuffer.id = 482 buffArray->editItemAt(i).omxBuffer.attr.anwBuffer.id =
478 (*buffArray)[i].id; 483 id | static_cast<uint32_t>(android_atomic_inc(&nextId));
479 } 484 }
480 }); 485 });
481} 486}
@@ -521,12 +526,15 @@ void portReconfiguration(sp<IOmxNode> omxNode, sp<CodecObserver> observer,
521 526
522 // set Port Params 527 // set Port Params
523 uint32_t nFrameWidth, nFrameHeight, xFramerate; 528 uint32_t nFrameWidth, nFrameHeight, xFramerate;
524 OMX_COLOR_FORMATTYPE eColorFormat =
525 OMX_COLOR_FormatYUV420Planar;
526 getInputChannelInfo(omxNode, kPortIndexInput, &nFrameWidth, 529 getInputChannelInfo(omxNode, kPortIndexInput, &nFrameWidth,
527 &nFrameHeight, &xFramerate); 530 &nFrameHeight, &xFramerate);
531 // get configured color format
532 OMX_PARAM_PORTDEFINITIONTYPE portDef;
533 status = getPortParam(omxNode, OMX_IndexParamPortDefinition,
534 kPortIndexOutput, &portDef);
528 setDefaultPortParam(omxNode, kPortIndexOutput, 535 setDefaultPortParam(omxNode, kPortIndexOutput,
529 OMX_VIDEO_CodingUnused, eColorFormat, 536 OMX_VIDEO_CodingUnused,
537 portDef.format.video.eColorFormat,
530 nFrameWidth, nFrameHeight, 0, xFramerate); 538 nFrameWidth, nFrameHeight, 0, xFramerate);
531 539
532 // If you can disable a port, then you should be able to 540 // If you can disable a port, then you should be able to
@@ -558,6 +566,7 @@ void portReconfiguration(sp<IOmxNode> omxNode, sp<CodecObserver> observer,
558 portDef.format.video.nFrameWidth, 566 portDef.format.video.nFrameWidth,
559 portDef.format.video.nFrameHeight, 567 portDef.format.video.nFrameHeight,
560 &portDef.format.video.nStride, 568 &portDef.format.video.nStride,
569 portDef.format.video.eColorFormat,
561 portDef.nBufferCountActual); 570 portDef.nBufferCountActual);
562 } 571 }
563 status = observer->dequeueMessage(&msg, DEFAULT_TIMEOUT, 572 status = observer->dequeueMessage(&msg, DEFAULT_TIMEOUT,
@@ -717,6 +726,116 @@ void decodeNFrames(sp<IOmxNode> omxNode, sp<CodecObserver> observer,
717 } 726 }
718} 727}
719 728
729// DescribeColorFormatParams Copy Constructor (Borrowed from OMXUtils.cpp)
730android::DescribeColorFormatParams::DescribeColorFormatParams(
731 const android::DescribeColorFormat2Params& params) {
732 eColorFormat = params.eColorFormat;
733 nFrameWidth = params.nFrameWidth;
734 nFrameHeight = params.nFrameHeight;
735 nStride = params.nStride;
736 nSliceHeight = params.nSliceHeight;
737 bUsingNativeBuffers = params.bUsingNativeBuffers;
738};
739
740bool isColorFormatFlexibleYUV(sp<IOmxNode> omxNode,
741 OMX_COLOR_FORMATTYPE eColorFormat) {
742 android::hardware::media::omx::V1_0::Status status;
743 unsigned int index = OMX_IndexMax, index2 = OMX_IndexMax;
744 omxNode->getExtensionIndex(
745 "OMX.google.android.index.describeColorFormat",
746 [&index](android::hardware::media::omx::V1_0::Status _s,
747 unsigned int _nl) {
748 if (_s == ::android::hardware::media::omx::V1_0::Status::OK)
749 index = _nl;
750 });
751 omxNode->getExtensionIndex(
752 "OMX.google.android.index.describeColorFormat2",
753 [&index2](android::hardware::media::omx::V1_0::Status _s,
754 unsigned int _nl) {
755 if (_s == ::android::hardware::media::omx::V1_0::Status::OK)
756 index2 = _nl;
757 });
758
759 android::DescribeColorFormat2Params describeParams;
760 describeParams.eColorFormat = eColorFormat;
761 describeParams.nFrameWidth = 128;
762 describeParams.nFrameHeight = 128;
763 describeParams.nStride = 128;
764 describeParams.nSliceHeight = 128;
765 describeParams.bUsingNativeBuffers = OMX_FALSE;
766 if (index != OMX_IndexMax) {
767 android::DescribeColorFormatParams describeParamsV1(describeParams);
768 status = getParam(omxNode, static_cast<OMX_INDEXTYPE>(index),
769 &describeParamsV1);
770 if (status == ::android::hardware::media::omx::V1_0::Status::OK) {
771 android::MediaImage& img = describeParamsV1.sMediaImage;
772 if (img.mType == android::MediaImage::MEDIA_IMAGE_TYPE_YUV) {
773 if (img.mNumPlanes == 3 &&
774 img.mPlane[img.Y].mHorizSubsampling == 1 &&
775 img.mPlane[img.Y].mVertSubsampling == 1) {
776 if (img.mPlane[img.U].mHorizSubsampling == 2 &&
777 img.mPlane[img.U].mVertSubsampling == 2 &&
778 img.mPlane[img.V].mHorizSubsampling == 2 &&
779 img.mPlane[img.V].mVertSubsampling == 2) {
780 if (img.mBitDepth <= 8) {
781 return true;
782 }
783 }
784 }
785 }
786 }
787 } else if (index2 != OMX_IndexMax) {
788 status = getParam(omxNode, static_cast<OMX_INDEXTYPE>(index2),
789 &describeParams);
790 android::MediaImage2& img = describeParams.sMediaImage;
791 if (img.mType == android::MediaImage2::MEDIA_IMAGE_TYPE_YUV) {
792 if (img.mNumPlanes == 3 &&
793 img.mPlane[img.Y].mHorizSubsampling == 1 &&
794 img.mPlane[img.Y].mVertSubsampling == 1) {
795 if (img.mPlane[img.U].mHorizSubsampling == 2 &&
796 img.mPlane[img.U].mVertSubsampling == 2 &&
797 img.mPlane[img.V].mHorizSubsampling == 2 &&
798 img.mPlane[img.V].mVertSubsampling == 2) {
799 if (img.mBitDepth <= 8) {
800 return true;
801 }
802 }
803 }
804 }
805 }
806 return false;
807}
808
809// get default color format for output port
810void getDefaultColorFormat(sp<IOmxNode> omxNode, OMX_U32 kPortIndexOutput,
811 PortMode oPortMode,
812 OMX_COLOR_FORMATTYPE* eColorFormat) {
813 android::hardware::media::omx::V1_0::Status status;
814 OMX_VIDEO_PARAM_PORTFORMATTYPE portFormat;
815 *eColorFormat = OMX_COLOR_FormatUnused;
816 portFormat.nIndex = 0;
817 while (1) {
818 status = getPortParam(omxNode, OMX_IndexParamVideoPortFormat,
819 kPortIndexOutput, &portFormat);
820 if (status != ::android::hardware::media::omx::V1_0::Status::OK) break;
821 EXPECT_EQ(portFormat.eCompressionFormat, OMX_VIDEO_CodingUnused);
822 if (oPortMode != PortMode::PRESET_BYTE_BUFFER) {
823 *eColorFormat = portFormat.eColorFormat;
824 break;
825 }
826 if (isColorFormatFlexibleYUV(omxNode, portFormat.eColorFormat)) {
827 *eColorFormat = portFormat.eColorFormat;
828 break;
829 }
830 if (OMX_COLOR_FormatYUV420SemiPlanar == portFormat.eColorFormat ||
831 OMX_COLOR_FormatYUV420Planar == portFormat.eColorFormat) {
832 *eColorFormat = portFormat.eColorFormat;
833 break;
834 }
835 portFormat.nIndex++;
836 }
837}
838
720// set component role 839// set component role
721TEST_F(VideoDecHidlTest, SetRole) { 840TEST_F(VideoDecHidlTest, SetRole) {
722 description("Test Set Component Role"); 841 description("Test Set Component Role");
@@ -806,9 +925,17 @@ TEST_F(VideoDecHidlTest, DecodeTest) {
806 925
807 // set Port Params 926 // set Port Params
808 uint32_t nFrameWidth, nFrameHeight, xFramerate; 927 uint32_t nFrameWidth, nFrameHeight, xFramerate;
809 OMX_COLOR_FORMATTYPE eColorFormat = OMX_COLOR_FormatYUV420Planar;
810 getInputChannelInfo(omxNode, kPortIndexInput, &nFrameWidth, &nFrameHeight, 928 getInputChannelInfo(omxNode, kPortIndexInput, &nFrameWidth, &nFrameHeight,
811 &xFramerate); 929 &xFramerate);
930 // get default color format
931 OMX_COLOR_FORMATTYPE eColorFormat = OMX_COLOR_FormatUnused;
932 getDefaultColorFormat(omxNode, kPortIndexOutput, portMode[1],
933 &eColorFormat);
934 ASSERT_NE(eColorFormat, OMX_COLOR_FormatUnused);
935 status =
936 setVideoPortFormat(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused,
937 eColorFormat, xFramerate);
938 EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
812 setDefaultPortParam(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused, 939 setDefaultPortParam(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused,
813 eColorFormat, nFrameWidth, nFrameHeight, 0, xFramerate); 940 eColorFormat, nFrameWidth, nFrameHeight, 0, xFramerate);
814 omxNode->prepareForAdaptivePlayback(kPortIndexOutput, false, 1920, 1080); 941 omxNode->prepareForAdaptivePlayback(kPortIndexOutput, false, 1920, 1080);
@@ -830,7 +957,8 @@ TEST_F(VideoDecHidlTest, DecodeTest) {
830 allocateGraphicBuffers( 957 allocateGraphicBuffers(
831 omxNode, kPortIndexOutput, &oBuffer, 958 omxNode, kPortIndexOutput, &oBuffer,
832 portDef.format.video.nFrameWidth, portDef.format.video.nFrameHeight, 959 portDef.format.video.nFrameWidth, portDef.format.video.nFrameHeight,
833 &portDef.format.video.nStride, portDef.nBufferCountActual); 960 &portDef.format.video.nStride, portDef.format.video.eColorFormat,
961 portDef.nBufferCountActual);
834 } 962 }
835 963
836 // Port Reconfiguration 964 // Port Reconfiguration
@@ -868,22 +996,28 @@ TEST_F(VideoDecHidlTest, EOSTest_M) {
868 kPortIndexOutput = kPortIndexInput + 1; 996 kPortIndexOutput = kPortIndexInput + 1;
869 } 997 }
870 998
999 // set port mode
1000 status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
1001 ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
1002 status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
1003 ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
1004
871 // set Port Params 1005 // set Port Params
872 uint32_t nFrameWidth, nFrameHeight, xFramerate; 1006 uint32_t nFrameWidth, nFrameHeight, xFramerate;
873 OMX_COLOR_FORMATTYPE eColorFormat = OMX_COLOR_FormatYUV420Planar;
874 getInputChannelInfo(omxNode, kPortIndexInput, &nFrameWidth, &nFrameHeight, 1007 getInputChannelInfo(omxNode, kPortIndexInput, &nFrameWidth, &nFrameHeight,
875 &xFramerate); 1008 &xFramerate);
1009 // get default color format
1010 OMX_COLOR_FORMATTYPE eColorFormat = OMX_COLOR_FormatUnused;
1011 getDefaultColorFormat(omxNode, kPortIndexOutput, portMode[1],
1012 &eColorFormat);
1013 ASSERT_NE(eColorFormat, OMX_COLOR_FormatUnused);
1014 status =
1015 setVideoPortFormat(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused,
1016 eColorFormat, xFramerate);
1017 EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
876 setDefaultPortParam(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused, 1018 setDefaultPortParam(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused,
877 eColorFormat, nFrameWidth, nFrameHeight, 0, xFramerate); 1019 eColorFormat, nFrameWidth, nFrameHeight, 0, xFramerate);
878 1020
879 // set port mode
880 PortMode portMode[2];
881 portMode[0] = portMode[1] = PortMode::PRESET_BYTE_BUFFER;
882 status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
883 ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
884 status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
885 ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
886
887 android::Vector<BufferInfo> iBuffer, oBuffer; 1021 android::Vector<BufferInfo> iBuffer, oBuffer;
888 1022
889 // set state to idle 1023 // set state to idle
@@ -944,22 +1078,28 @@ TEST_F(VideoDecHidlTest, ThumbnailTest) {
944 } 1078 }
945 eleInfo.close(); 1079 eleInfo.close();
946 1080
1081 // set port mode
1082 status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
1083 ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
1084 status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
1085 ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
1086
947 // set Port Params 1087 // set Port Params
948 uint32_t nFrameWidth, nFrameHeight, xFramerate; 1088 uint32_t nFrameWidth, nFrameHeight, xFramerate;
949 OMX_COLOR_FORMATTYPE eColorFormat = OMX_COLOR_FormatYUV420Planar;
950 getInputChannelInfo(omxNode, kPortIndexInput, &nFrameWidth, &nFrameHeight, 1089 getInputChannelInfo(omxNode, kPortIndexInput, &nFrameWidth, &nFrameHeight,
951 &xFramerate); 1090 &xFramerate);
1091 // get default color format
1092 OMX_COLOR_FORMATTYPE eColorFormat = OMX_COLOR_FormatUnused;
1093 getDefaultColorFormat(omxNode, kPortIndexOutput, portMode[1],
1094 &eColorFormat);
1095 ASSERT_NE(eColorFormat, OMX_COLOR_FormatUnused);
1096 status =
1097 setVideoPortFormat(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused,
1098 eColorFormat, xFramerate);
1099 EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
952 setDefaultPortParam(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused, 1100 setDefaultPortParam(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused,
953 eColorFormat, nFrameWidth, nFrameHeight, 0, xFramerate); 1101 eColorFormat, nFrameWidth, nFrameHeight, 0, xFramerate);
954 1102
955 // set port mode
956 PortMode portMode[2];
957 portMode[0] = portMode[1] = PortMode::PRESET_BYTE_BUFFER;
958 status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
959 ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
960 status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
961 ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
962
963 android::Vector<BufferInfo> iBuffer, oBuffer; 1103 android::Vector<BufferInfo> iBuffer, oBuffer;
964 1104
965 // set state to idle 1105 // set state to idle
@@ -1045,22 +1185,28 @@ TEST_F(VideoDecHidlTest, SimpleEOSTest) {
1045 } 1185 }
1046 eleInfo.close(); 1186 eleInfo.close();
1047 1187
1188 // set port mode
1189 status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
1190 ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
1191 status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
1192 ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
1193
1048 // set Port Params 1194 // set Port Params
1049 uint32_t nFrameWidth, nFrameHeight, xFramerate; 1195 uint32_t nFrameWidth, nFrameHeight, xFramerate;
1050 OMX_COLOR_FORMATTYPE eColorFormat = OMX_COLOR_FormatYUV420Planar;
1051 getInputChannelInfo(omxNode, kPortIndexInput, &nFrameWidth, &nFrameHeight, 1196 getInputChannelInfo(omxNode, kPortIndexInput, &nFrameWidth, &nFrameHeight,
1052 &xFramerate); 1197 &xFramerate);
1198 // get default color format
1199 OMX_COLOR_FORMATTYPE eColorFormat = OMX_COLOR_FormatUnused;
1200 getDefaultColorFormat(omxNode, kPortIndexOutput, portMode[1],
1201 &eColorFormat);
1202 ASSERT_NE(eColorFormat, OMX_COLOR_FormatUnused);
1203 status =
1204 setVideoPortFormat(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused,
1205 eColorFormat, xFramerate);
1206 EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
1053 setDefaultPortParam(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused, 1207 setDefaultPortParam(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused,
1054 eColorFormat, nFrameWidth, nFrameHeight, 0, xFramerate); 1208 eColorFormat, nFrameWidth, nFrameHeight, 0, xFramerate);
1055 1209
1056 // set port mode
1057 PortMode portMode[2];
1058 portMode[0] = portMode[1] = PortMode::PRESET_BYTE_BUFFER;
1059 status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
1060 ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
1061 status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
1062 ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
1063
1064 android::Vector<BufferInfo> iBuffer, oBuffer; 1210 android::Vector<BufferInfo> iBuffer, oBuffer;
1065 1211
1066 // set state to idle 1212 // set state to idle
@@ -1128,22 +1274,28 @@ TEST_F(VideoDecHidlTest, FlushTest) {
1128 } 1274 }
1129 eleInfo.close(); 1275 eleInfo.close();
1130 1276
1277 // set port mode
1278 status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
1279 ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
1280 status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
1281 ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
1282
1131 // set Port Params 1283 // set Port Params
1132 uint32_t nFrameWidth, nFrameHeight, xFramerate; 1284 uint32_t nFrameWidth, nFrameHeight, xFramerate;
1133 OMX_COLOR_FORMATTYPE eColorFormat = OMX_COLOR_FormatYUV420Planar;
1134 getInputChannelInfo(omxNode, kPortIndexInput, &nFrameWidth, &nFrameHeight, 1285 getInputChannelInfo(omxNode, kPortIndexInput, &nFrameWidth, &nFrameHeight,
1135 &xFramerate); 1286 &xFramerate);
1287 // get default color format
1288 OMX_COLOR_FORMATTYPE eColorFormat = OMX_COLOR_FormatUnused;
1289 getDefaultColorFormat(omxNode, kPortIndexOutput, portMode[1],
1290 &eColorFormat);
1291 ASSERT_NE(eColorFormat, OMX_COLOR_FormatUnused);
1292 status =
1293 setVideoPortFormat(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused,
1294 eColorFormat, xFramerate);
1295 EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
1136 setDefaultPortParam(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused, 1296 setDefaultPortParam(omxNode, kPortIndexOutput, OMX_VIDEO_CodingUnused,
1137 eColorFormat, nFrameWidth, nFrameHeight, 0, xFramerate); 1297 eColorFormat, nFrameWidth, nFrameHeight, 0, xFramerate);
1138 1298
1139 // set port mode
1140 PortMode portMode[2];
1141 portMode[0] = portMode[1] = PortMode::PRESET_BYTE_BUFFER;
1142 status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
1143 ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
1144 status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
1145 ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
1146
1147 android::Vector<BufferInfo> iBuffer, oBuffer; 1299 android::Vector<BufferInfo> iBuffer, oBuffer;
1148 1300
1149 // set state to idle 1301 // set state to idle
diff --git a/media/res/bbb_aac_stereo_128kbps_48000hz.aac b/media/res/bbb_aac_stereo_128kbps_48000hz.aac
index 831102d2..831102d2 100755..100644
--- a/media/res/bbb_aac_stereo_128kbps_48000hz.aac
+++ b/media/res/bbb_aac_stereo_128kbps_48000hz.aac
Binary files differ
diff --git a/media/res/bbb_aac_stereo_128kbps_48000hz.info b/media/res/bbb_aac_stereo_128kbps_48000hz.info
index d124f30d..d124f30d 100755..100644
--- a/media/res/bbb_aac_stereo_128kbps_48000hz.info
+++ b/media/res/bbb_aac_stereo_128kbps_48000hz.info
diff --git a/media/res/bbb_amrwb_1ch_14kbps_16000hz.amrwb b/media/res/bbb_amrwb_1ch_14kbps_16000hz.amrwb
index 0d825937..0d825937 100755..100644
--- a/media/res/bbb_amrwb_1ch_14kbps_16000hz.amrwb
+++ b/media/res/bbb_amrwb_1ch_14kbps_16000hz.amrwb
Binary files differ
diff --git a/media/res/bbb_amrwb_1ch_14kbps_16000hz.info b/media/res/bbb_amrwb_1ch_14kbps_16000hz.info
index 71cffefe..71cffefe 100755..100644
--- a/media/res/bbb_amrwb_1ch_14kbps_16000hz.info
+++ b/media/res/bbb_amrwb_1ch_14kbps_16000hz.info
diff --git a/media/res/bbb_g711alaw_1ch_8khz.info b/media/res/bbb_g711alaw_1ch_8khz.info
index 2ffe358e..2ffe358e 100755..100644
--- a/media/res/bbb_g711alaw_1ch_8khz.info
+++ b/media/res/bbb_g711alaw_1ch_8khz.info
diff --git a/media/res/bbb_g711alaw_1ch_8khz.raw b/media/res/bbb_g711alaw_1ch_8khz.raw
index cfc4a11c..cfc4a11c 100755..100644
--- a/media/res/bbb_g711alaw_1ch_8khz.raw
+++ b/media/res/bbb_g711alaw_1ch_8khz.raw
diff --git a/media/res/bbb_g711mulaw_1ch_8khz.info b/media/res/bbb_g711mulaw_1ch_8khz.info
index 5162a17f..5162a17f 100755..100644
--- a/media/res/bbb_g711mulaw_1ch_8khz.info
+++ b/media/res/bbb_g711mulaw_1ch_8khz.info
diff --git a/media/res/bbb_g711mulaw_1ch_8khz.raw b/media/res/bbb_g711mulaw_1ch_8khz.raw
index f38f1cae..f38f1cae 100755..100644
--- a/media/res/bbb_g711mulaw_1ch_8khz.raw
+++ b/media/res/bbb_g711mulaw_1ch_8khz.raw
diff --git a/media/res/bbb_gsm_1ch_8khz_13kbps.info b/media/res/bbb_gsm_1ch_8khz_13kbps.info
index b15b296a..b15b296a 100755..100644
--- a/media/res/bbb_gsm_1ch_8khz_13kbps.info
+++ b/media/res/bbb_gsm_1ch_8khz_13kbps.info
diff --git a/media/res/bbb_gsm_1ch_8khz_13kbps.raw b/media/res/bbb_gsm_1ch_8khz_13kbps.raw
index df903a8d..df903a8d 100755..100644
--- a/media/res/bbb_gsm_1ch_8khz_13kbps.raw
+++ b/media/res/bbb_gsm_1ch_8khz_13kbps.raw
Binary files differ
diff --git a/media/res/bbb_opus_stereo_128kbps_48000hz.info b/media/res/bbb_opus_stereo_128kbps_48000hz.info
index 12a6b996..12a6b996 100755..100644
--- a/media/res/bbb_opus_stereo_128kbps_48000hz.info
+++ b/media/res/bbb_opus_stereo_128kbps_48000hz.info
diff --git a/media/res/bbb_opus_stereo_128kbps_48000hz.opus b/media/res/bbb_opus_stereo_128kbps_48000hz.opus
index 7b763b2c..7b763b2c 100755..100644
--- a/media/res/bbb_opus_stereo_128kbps_48000hz.opus
+++ b/media/res/bbb_opus_stereo_128kbps_48000hz.opus
Binary files differ
diff --git a/media/res/bbb_raw_1ch_8khz_s32le.info b/media/res/bbb_raw_1ch_8khz_s32le.info
index 933925be..933925be 100755..100644
--- a/media/res/bbb_raw_1ch_8khz_s32le.info
+++ b/media/res/bbb_raw_1ch_8khz_s32le.info
diff --git a/media/res/bbb_raw_1ch_8khz_s32le.raw b/media/res/bbb_raw_1ch_8khz_s32le.raw
index fd91b462..fd91b462 100755..100644
--- a/media/res/bbb_raw_1ch_8khz_s32le.raw
+++ b/media/res/bbb_raw_1ch_8khz_s32le.raw
Binary files differ
diff --git a/media/res/bbb_vorbis_stereo_128kbps_48000hz.info b/media/res/bbb_vorbis_stereo_128kbps_48000hz.info
index 0716643c..0716643c 100755..100644
--- a/media/res/bbb_vorbis_stereo_128kbps_48000hz.info
+++ b/media/res/bbb_vorbis_stereo_128kbps_48000hz.info
diff --git a/media/res/bbb_vorbis_stereo_128kbps_48000hz.vorbis b/media/res/bbb_vorbis_stereo_128kbps_48000hz.vorbis
index 404c5f81..404c5f81 100755..100644
--- a/media/res/bbb_vorbis_stereo_128kbps_48000hz.vorbis
+++ b/media/res/bbb_vorbis_stereo_128kbps_48000hz.vorbis
Binary files differ