From 95dc7fae7a3d8ddbd020e588a33d9215e9105c50 Mon Sep 17 00:00:00 2001 From: Hashcode Date: Sun, 27 Jan 2013 02:38:04 -0800 Subject: Video Encoder: Enable Ducati h264 encoder profile change This patch enables the TI ducati H264 encoder profile via BoardConfig setting: BOARD_USE_TI_DUCATI_H264_PROFILE := true Allows correct video decoding on Motorola OMAP4 / Kindle Fires and other devices using newer DOMX libs. Effectively a cherry-pick of omapzoom commit (with creative board setting name): http://www.omapzoom.org/?p=platform/frameworks/av.git;a=commit;h=e28784d5c68c8699cfd9ebe0231e7132d8b13dad Change-Id: Idc49b00030558a22a9e50e8798e5814ad54fe841 Signed-off-by: Hashcode --- media/libstagefright/Android.mk | 4 ++++ media/libstagefright/OMXCodec.cpp | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/media/libstagefright/Android.mk b/media/libstagefright/Android.mk index bfc83b0..7939be4 100755 --- a/media/libstagefright/Android.mk +++ b/media/libstagefright/Android.mk @@ -160,6 +160,10 @@ LOCAL_C_INCLUDES += \ endif +ifeq ($(BOARD_USE_TI_DUCATI_H264_PROFILE), true) +LOCAL_CFLAGS += -DUSE_TI_DUCATI_H264_PROFILE +endif + LOCAL_MODULE:= libstagefright LOCAL_MODULE_TAGS := optional diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp index 42b6281..e7ba1cc 100644 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -1336,7 +1336,12 @@ status_t OMXCodec::setupAVCEncoderParameters(const sp& meta) { h264type.eLevel = static_cast(profileLevel.mLevel); // XXX +#ifdef USE_TI_DUCATI_H264_PROFILE + if ((strncmp(mComponentName, "OMX.TI.DUCATI1", 14) != 0) + && (h264type.eProfile != OMX_VIDEO_AVCProfileBaseline)) { +#else if (h264type.eProfile != OMX_VIDEO_AVCProfileBaseline) { +#endif ALOGW("Use baseline profile instead of %d for AVC recording", h264type.eProfile); h264type.eProfile = OMX_VIDEO_AVCProfileBaseline; -- cgit v1.1