diff options
Diffstat (limited to 'include/media/stagefright/MediaCodec.h')
-rw-r--r-- | include/media/stagefright/MediaCodec.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/include/media/stagefright/MediaCodec.h b/include/media/stagefright/MediaCodec.h index 4ff0d62..b87a09e 100644 --- a/include/media/stagefright/MediaCodec.h +++ b/include/media/stagefright/MediaCodec.h @@ -55,10 +55,10 @@ struct MediaCodec : public AHandler { struct BatteryNotifier; static sp<MediaCodec> CreateByType( - const sp<ALooper> &looper, const char *mime, bool encoder); + const sp<ALooper> &looper, const char *mime, bool encoder, status_t *err = NULL); static sp<MediaCodec> CreateByComponentName( - const sp<ALooper> &looper, const char *name); + const sp<ALooper> &looper, const char *name, status_t *err = NULL); status_t configure( const sp<AMessage> &format, @@ -223,6 +223,7 @@ private: AString mComponentName; uint32_t mReplyID; uint32_t mFlags; + status_t mStickyError; sp<Surface> mNativeWindow; SoftwareRenderer *mSoftRenderer; sp<AMessage> mOutputFormat; @@ -304,6 +305,18 @@ private: void updateBatteryStat(); bool isExecuting() const; + /* called to get the last codec error when the sticky flag is set. + * if no such codec error is found, returns UNKNOWN_ERROR. + */ + inline status_t getStickyError() const { + return mStickyError != 0 ? mStickyError : UNKNOWN_ERROR; + } + + inline void setStickyError(status_t err) { + mFlags |= kFlagStickyError; + mStickyError = err; + } + DISALLOW_EVIL_CONSTRUCTORS(MediaCodec); }; |