OSDN Git Service

FFmpegExtractor: Don't use our extractor when we agree with StageFright
[android-x86/external-stagefright-plugins.git] / include / FFmpegComponents.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_COMPONENTS_H_
18
19 #define FFMPEG_COMPONENTS_H_
20
21 #include <OMX_AudioExt.h>
22 #include <OMX_IndexExt.h>
23
24 #include "config.h"
25 #include "libavformat/avformat.h"
26 #include "libavcodec/avcodec.h"
27
28 #include <OMX_FFMPEG_Extn.h>
29
30 namespace android {
31
32 static const struct AudioCodingMapEntry {
33     const char *mName;
34     OMX_AUDIO_CODINGTYPE mAudioCodingType;
35     const char *mRole;
36     enum AVCodecID mCodecID;
37 } kAudioComponents[] = {
38     { "OMX.ffmpeg.aac.decoder",
39         OMX_AUDIO_CodingAAC, "audio_decoder.aac", AV_CODEC_ID_AAC },
40     { "OMX.ffmpeg.ac3.decoder",
41         (OMX_AUDIO_CODINGTYPE)OMX_AUDIO_CodingAC3, "audio_decoder.ac3", AV_CODEC_ID_AC3 },
42     { "OMX.ffmpeg.ape.decoder",
43         (OMX_AUDIO_CODINGTYPE)OMX_AUDIO_CodingAPE, "audio_decoder.ape", AV_CODEC_ID_APE },
44     { "OMX.ffmpeg.atrial.decoder",
45         OMX_AUDIO_CodingAutoDetect, "audio_decoder.trial", AV_CODEC_ID_NONE },
46     { "OMX.ffmpeg.dts.decoder",
47         (OMX_AUDIO_CODINGTYPE)OMX_AUDIO_CodingDTS, "audio_decoder.dts", AV_CODEC_ID_DTS },
48     { "OMX.ffmpeg.flac.decoder",
49         OMX_AUDIO_CodingFLAC, "audio_decoder.flac", AV_CODEC_ID_FLAC },
50     { "OMX.ffmpeg.mp2.decoder",
51         (OMX_AUDIO_CODINGTYPE)OMX_AUDIO_CodingMP2, "audio_decoder.mp2", AV_CODEC_ID_MP2 },
52     { "OMX.ffmpeg.mp3.decoder",
53         OMX_AUDIO_CodingMP3, "audio_decoder.mp3", AV_CODEC_ID_MP3 },
54     { "OMX.ffmpeg.ra.decoder",
55         OMX_AUDIO_CodingRA, "audio_decoder.ra", AV_CODEC_ID_COOK },
56     { "OMX.ffmpeg.vorbis.decoder",
57         OMX_AUDIO_CodingVORBIS, "audio_decoder.vorbis", AV_CODEC_ID_VORBIS },
58     { "OMX.ffmpeg.wma.decoder",
59         OMX_AUDIO_CodingWMA, "audio_decoder.wma", AV_CODEC_ID_WMAV2 },
60     { "OMX.ffmpeg.alac.decoder",
61         (OMX_AUDIO_CODINGTYPE)OMX_AUDIO_CodingALAC, "audio_decoder.alac", AV_CODEC_ID_ALAC },
62 };
63
64 static const struct VideoCodingMapEntry {
65     const char *mName;
66     OMX_VIDEO_CODINGTYPE mVideoCodingType;
67     const char *mRole;
68     enum AVCodecID mCodecID;
69 } kVideoComponents[] = {
70     { "OMX.ffmpeg.divx.decoder",
71         (OMX_VIDEO_CODINGTYPE)OMX_VIDEO_CodingDIVX, "video_decoder.divx", AV_CODEC_ID_MPEG4 },
72     { "OMX.ffmpeg.flv1.decoder",
73         (OMX_VIDEO_CODINGTYPE)OMX_VIDEO_CodingFLV1, "video_decoder.flv1", AV_CODEC_ID_FLV1 },
74     { "OMX.ffmpeg.h264.decoder",
75         OMX_VIDEO_CodingAVC, "video_decoder.avc", AV_CODEC_ID_H264 },
76     { "OMX.ffmpeg.h263.decoder",
77         OMX_VIDEO_CodingH263, "video_decoder.h263", AV_CODEC_ID_H263 },
78     { "OMX.ffmpeg.hevc.decoder",
79         OMX_VIDEO_CodingHEVC, "video_decoder.hevc", AV_CODEC_ID_HEVC },
80     { "OMX.ffmpeg.mpeg2.decoder",
81         OMX_VIDEO_CodingMPEG2, "video_decoder.mpeg2", AV_CODEC_ID_MPEG2VIDEO },
82     { "OMX.ffmpeg.mpeg4.decoder",
83         OMX_VIDEO_CodingMPEG4, "video_decoder.mpeg4", AV_CODEC_ID_MPEG4 },
84     { "OMX.ffmpeg.rv.decoder",
85         OMX_VIDEO_CodingRV, "video_decoder.rv", AV_CODEC_ID_RV40 },
86     { "OMX.ffmpeg.vc1.decoder",
87         (OMX_VIDEO_CODINGTYPE)OMX_VIDEO_CodingVC1, "video_decoder.vc1", AV_CODEC_ID_VC1 },
88     { "OMX.ffmpeg.vp8.decoder",
89         OMX_VIDEO_CodingVP8, "video_decoder.vp8", AV_CODEC_ID_VP8 },
90     { "OMX.ffmpeg.vp9.decoder",
91         OMX_VIDEO_CodingVP9, "video_decoder.vp9", AV_CODEC_ID_VP9 },
92     { "OMX.ffmpeg.vtrial.decoder",
93         OMX_VIDEO_CodingAutoDetect, "video_decoder.trial", AV_CODEC_ID_NONE },
94     { "OMX.ffmpeg.wmv.decoder",
95         OMX_VIDEO_CodingWMV, "video_decoder.wmv", AV_CODEC_ID_WMV2 },
96 };
97
98 static const size_t kNumAudioComponents =
99     (sizeof(kAudioComponents) / sizeof(kAudioComponents[0]));
100
101 static const size_t kNumVideoComponents =
102     (sizeof(kVideoComponents) / sizeof(kVideoComponents[0]));
103
104 static const size_t kNumComponents = kNumAudioComponents + kNumVideoComponents;
105
106 }  // namespace android
107
108 #endif  // FFMPEG_OMX_PLUGIN_H_