From 90ef5244517520eb54f7516465050b911f68de51 Mon Sep 17 00:00:00 2001 From: Steve Kondik Date: Sun, 13 Dec 2015 13:03:56 -0800 Subject: stagefright: Finish "Port AOSP fixes" * Fill in stubs for CAF commit bd019775a921ae9165e924e4d37bc838a7ef5781 Change-Id: Ia97d965d121aa3c3c2fc0ab8b164244416852ca5 --- media/libavextensions/stagefright/AVUtils.cpp | 42 ++++++++++++++++++++++++--- media/libstagefright/ACodec.cpp | 2 +- 2 files changed, 39 insertions(+), 5 deletions(-) (limited to 'media') diff --git a/media/libavextensions/stagefright/AVUtils.cpp b/media/libavextensions/stagefright/AVUtils.cpp index 16ff97c..b17ab2e 100644 --- a/media/libavextensions/stagefright/AVUtils.cpp +++ b/media/libavextensions/stagefright/AVUtils.cpp @@ -29,6 +29,7 @@ #define LOG_TAG "AVUtils" #include +#include #include #include @@ -49,6 +50,9 @@ #endif #endif +#include +#include + #include "common/ExtensionsLoader.hpp" #include "stagefright/AVExtensions.h" @@ -966,12 +970,42 @@ void AVUtils::HEVCMuxer::getHEVCCodecSpecificDataFromInputFormatIfPossible( } } -bool AVUtils::isAudioMuxFormatSupported(const char *) { - return true; +bool AVUtils::isAudioMuxFormatSupported(const char * mime) { + if (mime == NULL) { + ALOGE("NULL audio mime type"); + return false; + } + + if (!strcasecmp(MEDIA_MIMETYPE_AUDIO_AMR_NB, mime) + || !strcasecmp(MEDIA_MIMETYPE_AUDIO_AMR_WB, mime) + || !strcasecmp(MEDIA_MIMETYPE_AUDIO_AAC, mime)) { + return true; + } + return false; } -void AVUtils::cacheCaptureBuffers(sp, video_encoder) { - return; +void AVUtils::cacheCaptureBuffers(sp camera, video_encoder encoder) { + if (camera != NULL) { + char mDeviceName[PROPERTY_VALUE_MAX]; + property_get("ro.board.platform", mDeviceName, "0"); + if (!strncmp(mDeviceName, "msm8909", 7)) { + int64_t token = IPCThreadState::self()->clearCallingIdentity(); + String8 s = camera->getParameters(); + CameraParameters params(s); + const char *enable; + if (encoder == VIDEO_ENCODER_H263 || + encoder == VIDEO_ENCODER_MPEG_4_SP) { + enable = "1"; + } else { + enable = "0"; + } + params.set("cache-video-buffers", enable); + if (camera->setParameters(params.flatten()) != OK) { + ALOGE("Failed to enabled cached camera buffers"); + } + IPCThreadState::self()->restoreCallingIdentity(token); + } + } } const char *AVUtils::getCustomCodecsLocation() { diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index ea91085..672e50a 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -3778,7 +3778,7 @@ status_t ACodec::setupErrorCorrectionParameters() { errorCorrectionType.bEnableHEC = OMX_FALSE; errorCorrectionType.bEnableResync = OMX_TRUE; - errorCorrectionType.nResynchMarkerSpacing = 256; + errorCorrectionType.nResynchMarkerSpacing = 0; errorCorrectionType.bEnableDataPartitioning = OMX_FALSE; errorCorrectionType.bEnableRVLC = OMX_FALSE; -- cgit v1.1