diff options
author | Surajit Podder <spodder@codeaurora.org> | 2015-07-22 18:58:29 +0530 |
---|---|---|
committer | Satish Kamuju <skamuj@codeaurora.org> | 2015-10-06 17:35:24 +0530 |
commit | bd019775a921ae9165e924e4d37bc838a7ef5781 (patch) | |
tree | e0ca419e9f0d1d28a9caed2d00ebcb7021284c4e /media/libstagefright | |
parent | 61f6cfa961d22a9a54d91366fefec135f091012d (diff) | |
download | frameworks_av-bd019775a921ae9165e924e4d37bc838a7ef5781.zip frameworks_av-bd019775a921ae9165e924e4d37bc838a7ef5781.tar.gz frameworks_av-bd019775a921ae9165e924e4d37bc838a7ef5781.tar.bz2 |
video: Port AOSP fixes
Includes following fixes:
f510d0c libstagefright: Disable multi slice mode for video encode
ca46843 audio: Fix for failure in CTS MediaRecorderTest cases
b4d0490 libstagefright: check the audio source when adding to MPEG4Writer
89c6c3f libstagefright: Allocate cached camera buffers for sw encoders
f2c387b libstagefright: Choose target specific media_codecs.xml
f3e7122 libstagefright: Implement fallback mechanism to SW decoder
Change-Id: I90398b2fead1f4e163935bf1db342e24275f7933
Diffstat (limited to 'media/libstagefright')
-rw-r--r-- | media/libstagefright/ACodec.cpp | 8 | ||||
-rw-r--r-- | media/libstagefright/MPEG4Writer.cpp | 9 | ||||
-rw-r--r-- | media/libstagefright/MediaCodec.cpp | 1 | ||||
-rw-r--r-- | media/libstagefright/MediaCodecList.cpp | 3 |
4 files changed, 18 insertions, 3 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 9af5f4b..97a0be0 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -5715,6 +5715,7 @@ bool ACodec::LoadedState::onConfigureComponent( { sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", CodecBase::kWhatComponentConfigured); + notify->setString("componentName", mCodec->mComponentName.c_str()); notify->setMessage("input-format", mCodec->mInputFormat); notify->setMessage("output-format", mCodec->mOutputFormat); notify->post(); @@ -6377,6 +6378,13 @@ void ACodec::onSignalEndOfInputStream() { notify->post(); } +sp<IOMXObserver> ACodec::createObserver() { + sp<CodecObserver> observer = new CodecObserver; + sp<AMessage> notify = new AMessage(kWhatOMXMessageList, this); + observer->setNotificationMessage(notify); + return observer; +} + bool ACodec::ExecutingState::onOMXFrameRendered(int64_t mediaTimeUs, nsecs_t systemNano) { mCodec->onFrameRendered(mediaTimeUs, systemNano); return true; diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp index 86ca2a1..dd80b42 100644 --- a/media/libstagefright/MPEG4Writer.cpp +++ b/media/libstagefright/MPEG4Writer.cpp @@ -42,7 +42,7 @@ #include <cutils/properties.h> #include "include/ESDS.h" - +#include <stagefright/AVExtensions.h> #ifndef __predict_false #define __predict_false(exp) __builtin_expect((exp) != 0, 0) @@ -508,6 +508,11 @@ status_t MPEG4Writer::addSource(const sp<MediaSource> &source) { mIsVideoHEVC = AVUtils::get()->HEVCMuxerUtils().isVideoHEVC(mime); } + if (isAudio && !AVUtils::get()->isAudioMuxFormatSupported(mime)) { + ALOGE("Muxing is not supported for %s", mime); + return ERROR_UNSUPPORTED; + } + // At this point, we know the track to be added is either // video or audio. Thus, we only need to check whether it // is an audio track or not (if it is not, then it must be @@ -595,7 +600,7 @@ int64_t MPEG4Writer::estimateMoovBoxSize(int32_t bitRate) { // If the estimation is wrong, we will pay the price of wasting // some reserved space. This should not happen so often statistically. - static const int32_t factor = mUse32BitOffset? 1: 2; + int32_t factor = mUse32BitOffset? 1: 2; static const int64_t MIN_MOOV_BOX_SIZE = 3 * 1024; // 3 KB static const int64_t MAX_MOOV_BOX_SIZE = (180 * 3000000 * 6LL / 8000); int64_t size = MIN_MOOV_BOX_SIZE; diff --git a/media/libstagefright/MediaCodec.cpp b/media/libstagefright/MediaCodec.cpp index fca8b2c..7f7c7fa 100644 --- a/media/libstagefright/MediaCodec.cpp +++ b/media/libstagefright/MediaCodec.cpp @@ -1178,6 +1178,7 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) { // reset input surface flag mHaveInputSurface = false; + CHECK(msg->findString("componentName", &mComponentName)); CHECK(msg->findMessage("input-format", &mInputFormat)); CHECK(msg->findMessage("output-format", &mOutputFormat)); diff --git a/media/libstagefright/MediaCodecList.cpp b/media/libstagefright/MediaCodecList.cpp index b1dd96f..ff94314 100644 --- a/media/libstagefright/MediaCodecList.cpp +++ b/media/libstagefright/MediaCodecList.cpp @@ -40,6 +40,7 @@ #include <cutils/properties.h> #include <libexpat/expat.h> +#include <stagefright/AVExtensions.h> namespace android { @@ -174,7 +175,7 @@ MediaCodecList::MediaCodecList() : mInitCheck(NO_INIT), mUpdate(false), mGlobalSettings(new AMessage()) { - parseTopLevelXMLFile("/etc/media_codecs.xml"); + parseTopLevelXMLFile(AVUtils::get()->getCustomCodecsLocation()); parseTopLevelXMLFile("/etc/media_codecs_performance.xml", true/* ignore_errors */); parseTopLevelXMLFile(kProfilingResults, true/* ignore_errors */); } |