OSDN Git Service

SoftFFmpegVideo: fix adpative video scaling problem
[android-x86/external-stagefright-plugins.git] / omx / FFmpegOMXPlugin.h
1 /*
2  * Copyright (C) 2015 The CyanogenMod 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 FFMPEG_OMX_PLUGIN_H_
18
19 #define FFMPEG_OMX_PLUGIN_H_
20
21 #include <media/stagefright/foundation/ABase.h>
22 #include <OMXPluginBase.h>
23
24 #include <OMX_AudioExt.h>
25 #include <OMX_IndexExt.h>
26
27 #include "config.h"
28 #include "libavformat/avformat.h"
29 #include "libavcodec/avcodec.h"
30
31 #include <OMX_FFMPEG_Extn.h>
32
33 namespace android {
34
35 struct FFmpegOMXPlugin : public OMXPluginBase {
36     FFmpegOMXPlugin();
37
38     virtual OMX_ERRORTYPE makeComponentInstance(
39             const char *name,
40             const OMX_CALLBACKTYPE *callbacks,
41             OMX_PTR appData,
42             OMX_COMPONENTTYPE **component);
43
44     virtual OMX_ERRORTYPE destroyComponentInstance(
45             OMX_COMPONENTTYPE *component);
46
47     virtual OMX_ERRORTYPE enumerateComponents(
48             OMX_STRING name,
49             size_t size,
50             OMX_U32 index);
51
52     virtual OMX_ERRORTYPE getRolesOfComponent(
53             const char *name,
54             Vector<String8> *roles);
55
56 private:
57
58     typedef OMX_ERRORTYPE (*ComponentNameEnumFunc)(
59             OMX_STRING, OMX_U32, OMX_U32);
60
61     typedef OMX_ERRORTYPE (*GetHandleFunc)(
62             OMX_HANDLETYPE *, OMX_STRING, OMX_PTR, OMX_CALLBACKTYPE *);
63
64     typedef OMX_ERRORTYPE (*FreeHandleFunc)(OMX_HANDLETYPE *);
65
66     typedef OMX_ERRORTYPE (*GetRolesOfComponentFunc)(
67             OMX_STRING, OMX_U32 *, OMX_U8 **);
68
69     DISALLOW_EVIL_CONSTRUCTORS(FFmpegOMXPlugin);
70 };
71
72 }  // namespace android
73
74 #endif  // SOFT_OMX_PLUGIN_H_