diff options
author | Steve Kondik <steve@cyngn.com> | 2015-12-13 13:03:56 -0800 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-12-13 13:16:01 -0800 |
commit | 90ef5244517520eb54f7516465050b911f68de51 (patch) | |
tree | 3c8a67ccf7a234496884e716eed7f5fab1ec530d | |
parent | 715a22fefe8118d07370a95b48135607ba5fb956 (diff) | |
download | frameworks_av-90ef5244517520eb54f7516465050b911f68de51.zip frameworks_av-90ef5244517520eb54f7516465050b911f68de51.tar.gz frameworks_av-90ef5244517520eb54f7516465050b911f68de51.tar.bz2 |
stagefright: Finish "Port AOSP fixes"
* Fill in stubs for CAF commit bd019775a921ae9165e924e4d37bc838a7ef5781
Change-Id: Ia97d965d121aa3c3c2fc0ab8b164244416852ca5
-rw-r--r-- | media/libavextensions/stagefright/AVUtils.cpp | 42 | ||||
-rw-r--r-- | media/libstagefright/ACodec.cpp | 2 |
2 files changed, 39 insertions, 5 deletions
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 <utils/Log.h> +#include <utils/StrongPointer.h> #include <media/stagefright/foundation/ADebug.h> #include <media/stagefright/foundation/AMessage.h> @@ -49,6 +50,9 @@ #endif #endif +#include <binder/IPCThreadState.h> +#include <camera/CameraParameters.h> + #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<ICamera>, video_encoder) { - return; +void AVUtils::cacheCaptureBuffers(sp<ICamera> 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; |