1bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber/*
2bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber * Copyright (C) 2011 The Android Open Source Project
3bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber *
4bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber * Licensed under the Apache License, Version 2.0 (the "License");
5bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber * you may not use this file except in compliance with the License.
6bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber * You may obtain a copy of the License at
7bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber *
8bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber *      http://www.apache.org/licenses/LICENSE-2.0
9bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber *
10bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber * Unless required by applicable law or agreed to in writing, software
11bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber * distributed under the License is distributed on an "AS IS" BASIS,
12bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber * See the License for the specific language governing permissions and
14bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber * limitations under the License.
15bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber */
16bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber
17bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber#ifndef SOFT_MPEG4_H_
18bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber
19bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber#define SOFT_MPEG4_H_
20bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber
21bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber#include "SimpleSoftOMXComponent.h"
22bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber
23bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huberstruct tagvideoDecControls;
24bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber
25bbba88cb1bdc34705d1477208990a06904c022e7Andreas Hubernamespace android {
26bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber
27bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huberstruct SoftMPEG4 : public SimpleSoftOMXComponent {
28bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber    SoftMPEG4(const char *name,
29bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber            const OMX_CALLBACKTYPE *callbacks,
30bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber            OMX_PTR appData,
31bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber            OMX_COMPONENTTYPE **component);
32bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber
33bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huberprotected:
34bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber    virtual ~SoftMPEG4();
35bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber
36bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber    virtual OMX_ERRORTYPE internalGetParameter(
37bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber            OMX_INDEXTYPE index, OMX_PTR params);
38bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber
39bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber    virtual OMX_ERRORTYPE internalSetParameter(
40bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber            OMX_INDEXTYPE index, const OMX_PTR params);
41bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber
42bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber    virtual OMX_ERRORTYPE getConfig(OMX_INDEXTYPE index, OMX_PTR params);
43bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber
44bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber    virtual void onQueueFilled(OMX_U32 portIndex);
45bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber    virtual void onPortFlushCompleted(OMX_U32 portIndex);
46bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber    virtual void onPortEnableCompleted(OMX_U32 portIndex, bool enabled);
47bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber
48bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huberprivate:
49bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber    enum {
50bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber        kNumInputBuffers  = 4,
51bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber        kNumOutputBuffers = 2,
52bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber    };
53bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber
54bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber    enum {
55bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber        MODE_MPEG4,
56bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber        MODE_H263,
57bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber
58bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber    } mMode;
59