2 * Copyright (C) 2009 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef M4V_H263_DECODER_H_
19 #define M4V_H263_DECODER_H_
21 #include <media/stagefright/MediaBuffer.h>
22 #include <media/stagefright/MediaSource.h>
24 struct tagvideoDecControls;
28 struct M4vH263Decoder : public MediaSource,
29 public MediaBufferObserver {
30 M4vH263Decoder(const sp<MediaSource> &source);
32 virtual status_t start(MetaData *params);
33 virtual status_t stop();
35 virtual sp<MetaData> getFormat();
37 virtual status_t read(
38 MediaBuffer **buffer, const ReadOptions *options);
40 virtual void signalBufferReturned(MediaBuffer *buffer);
43 virtual ~M4vH263Decoder();
46 sp<MediaSource> mSource;
48 int32_t mWidth, mHeight;
52 tagvideoDecControls *mHandle;
53 MediaBuffer *mFrames[2];
54 MediaBuffer *mInputBuffer;
56 int64_t mNumSamplesOutput;
57 int64_t mTargetTimeUs;
59 void allocateFrames(int32_t width, int32_t height);
62 M4vH263Decoder(const M4vH263Decoder &);
63 M4vH263Decoder &operator=(const M4vH263Decoder &);
66 } // namespace android
68 #endif // M4V_H263_DECODER_H_