diff options
author | Wei Jia <wjia@google.com> | 2014-09-23 16:17:45 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-09-23 16:17:45 +0000 |
commit | d93ebc8aa9433678b36285f8d43dcbc00a8dd534 (patch) | |
tree | 37dd06dff4580c6417f582c5d5f2003876ac4ab8 /media/libmediaplayerservice | |
parent | 129e03672a58af34f24fea84e085aaed8e7847a5 (diff) | |
parent | 0973af247786ff1be980390cc274364fca6b2d6e (diff) | |
download | frameworks_av-d93ebc8aa9433678b36285f8d43dcbc00a8dd534.zip frameworks_av-d93ebc8aa9433678b36285f8d43dcbc00a8dd534.tar.gz frameworks_av-d93ebc8aa9433678b36285f8d43dcbc00a8dd534.tar.bz2 |
am 0973af24: am 0079b331: Merge "MediaBuffer: ABuffer will release MediaBuffer when it\'s destructed." into lmp-dev
* commit '0973af247786ff1be980390cc274364fca6b2d6e':
MediaBuffer: ABuffer will release MediaBuffer when it's destructed.
Diffstat (limited to 'media/libmediaplayerservice')
-rw-r--r-- | media/libmediaplayerservice/nuplayer/GenericSource.cpp | 2 | ||||
-rw-r--r-- | media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp | 21 |
2 files changed, 4 insertions, 19 deletions
diff --git a/media/libmediaplayerservice/nuplayer/GenericSource.cpp b/media/libmediaplayerservice/nuplayer/GenericSource.cpp index cf9c962..bd75034 100644 --- a/media/libmediaplayerservice/nuplayer/GenericSource.cpp +++ b/media/libmediaplayerservice/nuplayer/GenericSource.cpp @@ -1115,8 +1115,8 @@ sp<ABuffer> NuPlayer::GenericSource::mediaBufferToABuffer( if (mIsWidevine && !audio) { // data is already provided in the buffer ab = new ABuffer(NULL, mb->range_length()); - ab->meta()->setPointer("mediaBuffer", mb); mb->add_ref(); + ab->setMediaBufferBase(mb); } else { ab = new ABuffer(outLength); memcpy(ab->data(), diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp index 915dd81..cdb860c 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp @@ -283,14 +283,9 @@ void android::NuPlayer::Decoder::onInputBufferFilled(const sp<AMessage> &msg) { // handle widevine classic source - that fills an arbitrary input buffer MediaBuffer *mediaBuffer = NULL; - if (hasBuffer && buffer->meta()->findPointer( - "mediaBuffer", (void **)&mediaBuffer)) { - if (mediaBuffer == NULL) { - // received no actual buffer - ALOGW("[%s] received null MediaBuffer %s", - mComponentName.c_str(), msg->debugString().c_str()); - buffer = NULL; - } else { + if (hasBuffer) { + mediaBuffer = (MediaBuffer *)(buffer->getMediaBufferBase()); + if (mediaBuffer != NULL) { // likely filled another buffer than we requested: adjust buffer index size_t ix; for (ix = 0; ix < mInputBuffers.size(); ix++) { @@ -600,16 +595,6 @@ void NuPlayer::Decoder::onMessageReceived(const sp<AMessage> &msg) { { if (!isStaleReply(msg)) { onInputBufferFilled(msg); - } else { - /* release any MediaBuffer passed in the stale buffer */ - sp<ABuffer> buffer; - MediaBuffer *mediaBuffer = NULL; - if (msg->findBuffer("buffer", &buffer) && - buffer->meta()->findPointer( - "mediaBuffer", (void **)&mediaBuffer) && - mediaBuffer != NULL) { - mediaBuffer->release(); - } } break; |