blob: adf75446a90e68db5cd2d4d5f9db3d498e2dcc5f [file] [log] [blame]
Ajit Khare73cfaf42013-01-07 23:28:47 -08001/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef DASHPLAYER_DECODER_H_
18
19#define DASHPLAYER_DECODER_H_
20
21#include "DashPlayerRenderer.h"
22#include "DashPlayer.h"
23#include <media/stagefright/foundation/AHandler.h>
24
25namespace android {
26
27struct ABuffer;
28
29struct DashPlayer::Decoder : public AHandler {
30 Decoder(const sp<AMessage> &notify,
31 const sp<NativeWindowWrapper> &nativeWindow = NULL);
32
33 void configure(const sp<MetaData> &meta);
34
35 void signalFlush();
36 void signalResume();
37 void initiateShutdown();
38 void setSink(const sp<MediaPlayerBase::AudioSink> &sink, sp<Renderer> Renderer);
39
40protected:
41 virtual ~Decoder();
42
43 virtual void onMessageReceived(const sp<AMessage> &msg);
44
45private:
46 enum {
47 kWhatCodecNotify = 'cdcN',
48 };
49
50 sp<AMessage> mNotify;
51 sp<NativeWindowWrapper> mNativeWindow;
52
Shalaj Jain65506622013-01-29 18:27:08 -080053 sp<DashCodec> mCodec;
Ajit Khare73cfaf42013-01-07 23:28:47 -080054 sp<ALooper> mCodecLooper;
55 sp<MediaPlayerBase::AudioSink> mAudioSink;
56 sp<Renderer> mRenderer;
57
58 Vector<sp<ABuffer> > mCSD;
59 size_t mCSDIndex;
60
61 sp<AMessage> makeFormat(const sp<MetaData> &meta);
62
63 void onFillThisBuffer(const sp<AMessage> &msg);
64
65 DISALLOW_EVIL_CONSTRUCTORS(Decoder);
66};
67
68} // namespace android
69
70#endif // DASHPLAYER_DECODER_H_