summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorxiaoqiny <quic_xiaoqiny@codeaurora.org>2015-01-13 17:59:04 +0800
committerSteve Kondik <steve@cyngn.com>2016-04-13 13:54:55 -0700
commitf888cedf170f6d3cc060cc14ad9c56918f3a03c3 (patch)
tree666c429913ec56e43948136169c3b46d50173745 /include
parent0ecd6fb627dabf286b7742862e25a592bc1f606c (diff)
downloadframeworks_av-f888cedf170f6d3cc060cc14ad9c56918f3a03c3.zip
frameworks_av-f888cedf170f6d3cc060cc14ad9c56918f3a03c3.tar.gz
frameworks_av-f888cedf170f6d3cc060cc14ad9c56918f3a03c3.tar.bz2
libstagefright: handle error when B-frame is sent to MPEG4Writer
Without this patch, writing B-frame to MediaMuxer will be blocked and cannot return a result. This may cause an endless progress bar shown in gallery when triming or muting some videos. Change-Id: Ib9f902a57da470c0357ec68aab00a35fbb26fb77 CRs-Fixed: 521005
Diffstat (limited to 'include')
-rw-r--r--include/media/stagefright/MediaAdapter.h4
-rw-r--r--include/media/stagefright/MediaBuffer.h1
-rw-r--r--include/media/stagefright/MediaSource.h1
3 files changed, 6 insertions, 0 deletions
diff --git a/include/media/stagefright/MediaAdapter.h b/include/media/stagefright/MediaAdapter.h
index 369fce6..8622546 100644
--- a/include/media/stagefright/MediaAdapter.h
+++ b/include/media/stagefright/MediaAdapter.h
@@ -56,6 +56,8 @@ public:
// deep copy, such that after pushBuffer return, the buffer can be re-used.
status_t pushBuffer(MediaBuffer *buffer);
+ virtual void notifyError(status_t err);
+
private:
Mutex mAdapterLock;
// Make sure the read() wait for the incoming buffer.
@@ -68,6 +70,8 @@ private:
bool mStarted;
sp<MetaData> mOutputFormat;
+ status_t mStatus;
+
DISALLOW_EVIL_CONSTRUCTORS(MediaAdapter);
};
diff --git a/include/media/stagefright/MediaBuffer.h b/include/media/stagefright/MediaBuffer.h
index c8a50e8..5ab266f 100644
--- a/include/media/stagefright/MediaBuffer.h
+++ b/include/media/stagefright/MediaBuffer.h
@@ -93,6 +93,7 @@ protected:
private:
friend class MediaBufferGroup;
friend class OMXDecoder;
+ friend class MediaAdapter;
// For use by OMXDecoder, reference count must be 1, drop reference
// count to 0 without signalling the observer.
diff --git a/include/media/stagefright/MediaSource.h b/include/media/stagefright/MediaSource.h
index a653db9..7ab5f62 100644
--- a/include/media/stagefright/MediaSource.h
+++ b/include/media/stagefright/MediaSource.h
@@ -59,6 +59,7 @@ struct MediaSource : public virtual RefBase {
virtual status_t read(
MediaBuffer **buffer, const ReadOptions *options = NULL) = 0;
+ virtual void notifyError(status_t) {}
// Options that modify read() behaviour. The default is to
// a) not request a seek
// b) not be late, i.e. lateness_us = 0