diff options
author | Lajos Molnar <lajos@google.com> | 2014-01-17 15:12:51 -0800 |
---|---|---|
committer | Lajos Molnar <lajos@google.com> | 2014-03-10 11:40:04 -0700 |
commit | 1cd139824b2e6832f239cd27d8962d3239053c02 (patch) | |
tree | a56580b67303cd3a4aef0ab6914facc98f6f9a83 /media/libmediaplayerservice/nuplayer/NuPlayerDecoder.h | |
parent | e0381245dff04aa823a59aa8b85869eddab0f39f (diff) | |
download | frameworks_av-1cd139824b2e6832f239cd27d8962d3239053c02.zip frameworks_av-1cd139824b2e6832f239cd27d8962d3239053c02.tar.gz frameworks_av-1cd139824b2e6832f239cd27d8962d3239053c02.tar.bz2 |
NuPlayer: use MediaCodec instead of ACodec
Bug: 11785204
Change-Id: I1455bfc683469c7a69e565b179aceacbc5c459f5
Diffstat (limited to 'media/libmediaplayerservice/nuplayer/NuPlayerDecoder.h')
-rw-r--r-- | media/libmediaplayerservice/nuplayer/NuPlayerDecoder.h | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.h b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.h index 78ea74a..94243fc 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.h +++ b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.h @@ -25,12 +25,14 @@ namespace android { struct ABuffer; +struct MediaCodec; struct NuPlayer::Decoder : public AHandler { Decoder(const sp<AMessage> ¬ify, const sp<NativeWindowWrapper> &nativeWindow = NULL); void configure(const sp<AMessage> &format); + void init(); void signalFlush(); void signalResume(); @@ -38,7 +40,18 @@ struct NuPlayer::Decoder : public AHandler { bool supportsSeamlessFormatChange(const sp<AMessage> &to) const; + enum { + kWhatFillThisBuffer = 'flTB', + kWhatDrainThisBuffer = 'drTB', + kWhatOutputFormatChanged = 'fmtC', + kWhatFlushCompleted = 'flsC', + kWhatShutdownCompleted = 'shDC', + kWhatEOS = 'eos ', + kWhatError = 'err ', + }; + protected: + virtual ~Decoder(); virtual void onMessageReceived(const sp<AMessage> &msg); @@ -46,21 +59,40 @@ protected: private: enum { kWhatCodecNotify = 'cdcN', + kWhatConfigure = 'conf', + kWhatInputBufferFilled = 'inpF', + kWhatRenderBuffer = 'rndr', + kWhatFlush = 'flus', + kWhatShutdown = 'shuD', }; sp<AMessage> mNotify; sp<NativeWindowWrapper> mNativeWindow; - sp<AMessage> mFormat; - sp<ACodec> mCodec; + sp<AMessage> mInputFormat; + sp<AMessage> mOutputFormat; + sp<MediaCodec> mCodec; sp<ALooper> mCodecLooper; + sp<ALooper> mDecoderLooper; + + Vector<sp<ABuffer> > mInputBuffers; + Vector<sp<ABuffer> > mOutputBuffers; + + void handleError(int32_t err); + bool handleAnInputBuffer(); + bool handleAnOutputBuffer(); - Vector<sp<ABuffer> > mCSD; - size_t mCSDIndex; + void requestCodecNotification(); + bool isStaleReply(const sp<AMessage> &msg); - sp<AMessage> makeFormat(const sp<MetaData> &meta); + void onConfigure(const sp<AMessage> &format); + void onFlush(); + void onInputBufferFilled(const sp<AMessage> &msg); + void onRenderBuffer(const sp<AMessage> &msg); + void onShutdown(); - void onFillThisBuffer(const sp<AMessage> &msg); + int32_t mBufferGeneration; + AString mComponentName; bool supportsSeamlessAudioFormatChange(const sp<AMessage> &targetFormat) const; |