diff options
Diffstat (limited to 'media/libstagefright/OMXCodec.cpp')
-rwxr-xr-x[-rw-r--r--] | media/libstagefright/OMXCodec.cpp | 55 |
1 files changed, 4 insertions, 51 deletions
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp index 33e85a9a06ff..c080b6c31f2a 100644..100755 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -117,7 +117,6 @@ static sp<MediaSource> InstantiateSoftwareEncoder( static const CodecInfo kDecoderInfo[] = { { MEDIA_MIMETYPE_IMAGE_JPEG, "OMX.TI.JPEG.decode" }, - { MEDIA_MIMETYPE_AUDIO_MPEG, "OMX.ST.mp3.decoder" }, // { MEDIA_MIMETYPE_AUDIO_MPEG, "OMX.TI.MP3.decode" }, { MEDIA_MIMETYPE_AUDIO_MPEG, "OMX.google.mp3.decoder" }, { MEDIA_MIMETYPE_AUDIO_MPEG_LAYER_II, "OMX.Nvidia.mp2.decoder" }, @@ -127,13 +126,11 @@ static const CodecInfo kDecoderInfo[] = { // { MEDIA_MIMETYPE_AUDIO_AMR_NB, "OMX.Nvidia.amrwb.decoder" }, { MEDIA_MIMETYPE_AUDIO_AMR_WB, "OMX.TI.WBAMR.decode" }, { MEDIA_MIMETYPE_AUDIO_AMR_WB, "OMX.google.amrwb.decoder" }, - { MEDIA_MIMETYPE_AUDIO_AAC, "OMX.ST.aac.decoder" }, // { MEDIA_MIMETYPE_AUDIO_AAC, "OMX.Nvidia.aac.decoder" }, { MEDIA_MIMETYPE_AUDIO_AAC, "OMX.TI.AAC.decode" }, { MEDIA_MIMETYPE_AUDIO_AAC, "OMX.google.aac.decoder" }, { MEDIA_MIMETYPE_AUDIO_G711_ALAW, "OMX.google.g711.alaw.decoder" }, { MEDIA_MIMETYPE_AUDIO_G711_MLAW, "OMX.google.g711.mlaw.decoder" }, - { MEDIA_MIMETYPE_VIDEO_MPEG4, "OMX.ST.VFM.MPEG4Dec" }, { MEDIA_MIMETYPE_VIDEO_MPEG4, "OMX.TI.DUCATI1.VIDEO.DECODER" }, { MEDIA_MIMETYPE_VIDEO_MPEG4, "OMX.Nvidia.mp4.decode" }, { MEDIA_MIMETYPE_VIDEO_MPEG4, "OMX.qcom.7x30.video.decoder.mpeg4" }, @@ -141,15 +138,12 @@ static const CodecInfo kDecoderInfo[] = { { MEDIA_MIMETYPE_VIDEO_MPEG4, "OMX.TI.Video.Decoder" }, { MEDIA_MIMETYPE_VIDEO_MPEG4, "OMX.SEC.MPEG4.Decoder" }, { MEDIA_MIMETYPE_VIDEO_MPEG4, "OMX.google.mpeg4.decoder" }, - { MEDIA_MIMETYPE_VIDEO_H263, "OMX.ST.VFM.MPEG4Dec" }, { MEDIA_MIMETYPE_VIDEO_H263, "OMX.TI.DUCATI1.VIDEO.DECODER" }, { MEDIA_MIMETYPE_VIDEO_H263, "OMX.Nvidia.h263.decode" }, { MEDIA_MIMETYPE_VIDEO_H263, "OMX.qcom.7x30.video.decoder.h263" }, { MEDIA_MIMETYPE_VIDEO_H263, "OMX.qcom.video.decoder.h263" }, { MEDIA_MIMETYPE_VIDEO_H263, "OMX.SEC.H263.Decoder" }, { MEDIA_MIMETYPE_VIDEO_H263, "OMX.google.h263.decoder" }, - { MEDIA_MIMETYPE_VIDEO_H263_SW, "OMX.ST.VFM.MPEG4HostDec" }, - { MEDIA_MIMETYPE_VIDEO_AVC, "OMX.ST.VFM.H264Dec" }, { MEDIA_MIMETYPE_VIDEO_AVC, "OMX.TI.DUCATI1.VIDEO.DECODER" }, { MEDIA_MIMETYPE_VIDEO_AVC, "OMX.Nvidia.h264.decode" }, { MEDIA_MIMETYPE_VIDEO_AVC, "OMX.qcom.7x30.video.decoder.avc" }, @@ -161,7 +155,6 @@ static const CodecInfo kDecoderInfo[] = { { MEDIA_MIMETYPE_AUDIO_VORBIS, "OMX.google.vorbis.decoder" }, { MEDIA_MIMETYPE_VIDEO_VPX, "OMX.google.vpx.decoder" }, { MEDIA_MIMETYPE_VIDEO_MPEG2, "OMX.Nvidia.mpeg2v.decode" }, - { MEDIA_MIMETYPE_VIDEO_VC1, "OMX.ST.VFM.VC1Dec" }, }; static const CodecInfo kEncoderInfo[] = { @@ -171,7 +164,6 @@ static const CodecInfo kEncoderInfo[] = { { MEDIA_MIMETYPE_AUDIO_AMR_WB, "AMRWBEncoder" }, { MEDIA_MIMETYPE_AUDIO_AAC, "OMX.TI.AAC.encode" }, { MEDIA_MIMETYPE_AUDIO_AAC, "AACEncoder" }, - { MEDIA_MIMETYPE_VIDEO_MPEG4, "OMX.ST.VFM.MPEG4Enc" }, { MEDIA_MIMETYPE_VIDEO_MPEG4, "OMX.TI.DUCATI1.VIDEO.MPEG4E" }, { MEDIA_MIMETYPE_VIDEO_MPEG4, "OMX.qcom.7x30.video.encoder.mpeg4" }, { MEDIA_MIMETYPE_VIDEO_MPEG4, "OMX.qcom.video.encoder.mpeg4" }, @@ -179,7 +171,6 @@ static const CodecInfo kEncoderInfo[] = { { MEDIA_MIMETYPE_VIDEO_MPEG4, "OMX.Nvidia.mp4.encoder" }, { MEDIA_MIMETYPE_VIDEO_MPEG4, "OMX.SEC.MPEG4.Encoder" }, { MEDIA_MIMETYPE_VIDEO_MPEG4, "M4vH263Encoder" }, - { MEDIA_MIMETYPE_VIDEO_H263, "OMX.ST.VFM.MPEG4Enc" }, { MEDIA_MIMETYPE_VIDEO_H263, "OMX.TI.DUCATI1.VIDEO.MPEG4E" }, { MEDIA_MIMETYPE_VIDEO_H263, "OMX.qcom.7x30.video.encoder.h263" }, { MEDIA_MIMETYPE_VIDEO_H263, "OMX.qcom.video.encoder.h263" }, @@ -187,7 +178,6 @@ static const CodecInfo kEncoderInfo[] = { { MEDIA_MIMETYPE_VIDEO_H263, "OMX.Nvidia.h263.encoder" }, { MEDIA_MIMETYPE_VIDEO_H263, "OMX.SEC.H263.Encoder" }, { MEDIA_MIMETYPE_VIDEO_H263, "M4vH263Encoder" }, - { MEDIA_MIMETYPE_VIDEO_AVC, "OMX.ST.VFM.H264Enc" }, { MEDIA_MIMETYPE_VIDEO_AVC, "OMX.TI.DUCATI1.VIDEO.H264E" }, { MEDIA_MIMETYPE_VIDEO_AVC, "OMX.qcom.7x30.video.encoder.avc" }, { MEDIA_MIMETYPE_VIDEO_AVC, "OMX.qcom.video.encoder.avc" }, @@ -302,18 +292,6 @@ static int CompareSoftwareCodecsFirst( return 0; } -static uint32_t OmxToHALFormat(OMX_COLOR_FORMATTYPE omxValue) { - switch (omxValue) { - case OMX_STE_COLOR_FormatYUV420PackedSemiPlanarMB: - return HAL_PIXEL_FORMAT_YCBCR42XMBN; - case OMX_COLOR_FormatYUV420Planar: - return HAL_PIXEL_FORMAT_YCbCr_420_P; - default: - LOGI("Unknown OMX pixel format (0x%X), passing it on unchanged", omxValue); - return omxValue; - } -} - // static uint32_t OMXCodec::getComponentQuirks( const char *componentName, bool isEncoder) { @@ -398,17 +376,6 @@ uint32_t OMXCodec::getComponentQuirks( quirks |= kOutputBuffersAreUnreadable; } - if (!isEncoder && !strncmp(componentName, "OMX.ST.VFM.", 11)) { - quirks |= kRequiresAllocateBufferOnInputPorts; - quirks |= kRequiresAllocateBufferOnOutputPorts; - } - - if (!strncmp(componentName, "OMX.ST.VFM.MPEG4Enc", 19) || - !strncmp(componentName, "OMX.ST.VFM.H264Enc", 18)) { - quirks |= kRequiresAllocateBufferOnOutputPorts; - quirks |= kRequiresStoreMetaDataBeforeIdle; - } - return quirks; } @@ -934,7 +901,6 @@ static size_t getFrameSize( case OMX_COLOR_FormatYUV420Planar: case OMX_COLOR_FormatYUV420SemiPlanar: case OMX_TI_COLOR_FormatYUV420PackedSemiPlanar: - case OMX_STE_COLOR_FormatYUV420PackedSemiPlanarMB: /* * FIXME: For the Opaque color format, the frame size does not * need to be (w*h*3)/2. It just needs to @@ -1466,7 +1432,7 @@ status_t OMXCodec::setVideoOutputFormat( || format.eColorFormat == OMX_COLOR_FormatYUV420SemiPlanar || format.eColorFormat == OMX_COLOR_FormatCbYCrY || format.eColorFormat == OMX_TI_COLOR_FormatYUV420PackedSemiPlanar - || format.eColorFormat == OMX_STE_COLOR_FormatYUV420PackedSemiPlanarMB + || format.eColorFormat == OMX_QCOM_COLOR_FormatYVU420SemiPlanar #ifdef SAMSUNG_CODEC_SUPPORT || format.eColorFormat == OMX_SEC_COLOR_FormatNV12TPhysicalAddress || format.eColorFormat == OMX_SEC_COLOR_FormatNV12Tiled @@ -1624,8 +1590,6 @@ void OMXCodec::setComponentRole( "video_decoder.mpeg4", "video_encoder.mpeg4" }, { MEDIA_MIMETYPE_VIDEO_H263, "video_decoder.h263", "video_encoder.h263" }, - { MEDIA_MIMETYPE_VIDEO_VC1, - "video_decoder.vc1", "video_encoder.vc1" }, }; static const size_t kNumMimeToRole = @@ -1695,15 +1659,6 @@ status_t OMXCodec::init() { CHECK_EQ((int)mState, (int)LOADED); status_t err; - if ((mQuirks & kRequiresStoreMetaDataBeforeIdle) - && (mFlags & kStoreMetaDataInVideoBuffers)) { - err = mOMX->storeMetaDataInBuffers(mNode, kPortIndexInput, OMX_TRUE); - if (err != OK) { - LOGE("Storing meta data in video buffers is not supported"); - return err; - } - } - if (!(mQuirks & kRequiresLoadedToIdleAfterAllocation)) { err = mOMX->sendCommand(mNode, OMX_CommandStateSet, OMX_StateIdle); CHECK_EQ(err, (status_t)OK); @@ -1759,8 +1714,7 @@ status_t OMXCodec::allocateBuffersOnPort(OMX_U32 portIndex) { } status_t err = OK; - if (!(mQuirks & kRequiresStoreMetaDataBeforeIdle) - && (mFlags & kStoreMetaDataInVideoBuffers) + if ((mFlags & kStoreMetaDataInVideoBuffers) && portIndex == kPortIndexInput) { err = mOMX->storeMetaDataInBuffers(mNode, kPortIndexInput, OMX_TRUE); if (err != OK) { @@ -1937,8 +1891,8 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() { mNativeWindow.get(), def.format.video.nFrameWidth, def.format.video.nFrameHeight, - OmxToHALFormat(def.format.video.eColorFormat)); -#else /* SAMSUNG_CODEC_SUPPORT */ + def.format.video.eColorFormat); +#else OMX_COLOR_FORMATTYPE eColorFormat; switch (def.format.video.eColorFormat) { @@ -4318,7 +4272,6 @@ static const char *videoCompressionFormatString(OMX_VIDEO_CODINGTYPE type) { "OMX_VIDEO_CodingRV", "OMX_VIDEO_CodingAVC", "OMX_VIDEO_CodingMJPEG", - "OMX_VIDEO_CodingVC1", }; size_t numNames = sizeof(kNames) / sizeof(kNames[0]); |