OSDN Git Service

stagefright-plugins: Fix port reset problem
[android-x86/external-stagefright-plugins.git] / include / OMX_FFMPEG_Extn.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 OMX_FFMPEG_Extn_h
18 #define OMX_FFMPEG_Extn_h
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif /* __cplusplus */
23
24 enum OMX_FFMPEG_VIDEO_CODINGTYPE
25 {
26     OMX_VIDEO_CodingVC1  = 0x7F000001,
27     OMX_VIDEO_CodingFLV1 = 0x7F000002,
28     OMX_VIDEO_CodingDIVX = 0x7F000003,
29 };
30
31 /**
32  * FFMPEG Video Params
33  */
34 typedef struct OMX_VIDEO_PARAM_FFMPEGTYPE {
35     OMX_U32 nSize;
36     OMX_VERSIONTYPE nVersion;
37     OMX_U32 nPortIndex;
38
39     OMX_S32 eCodecId;              /**< enum AVCodecID */
40     OMX_U32 nWidth;
41     OMX_U32 nHeight;
42 } OMX_VIDEO_PARAM_FFMPEGTYPE;
43
44 enum OMX_FFMPEG_AUDIO_CODINGTYPE
45 {
46     OMX_AUDIO_CodingMP2  = 0x7F000001,
47     OMX_AUDIO_CodingAC3  = 0x7F000002,
48     OMX_AUDIO_CodingAPE  = 0x7F000003,
49     OMX_AUDIO_CodingDTS  = 0x7F000004,
50 };
51
52 /** MP2 params */
53 typedef struct OMX_AUDIO_PARAM_MP2TYPE {
54     OMX_U32 nSize;                 /**< size of the structure in bytes */
55     OMX_VERSIONTYPE nVersion;      /**< OMX specification version information */
56     OMX_U32 nPortIndex;            /**< port that this structure applies to */
57     OMX_U32 nChannels;             /**< Number of channels */
58     OMX_U32 nBitRate;              /**< Bit rate of the input data.  Use 0 for variable
59                                         rate or unknown bit rates */
60     OMX_U32 nSampleRate;           /**< Sampling rate of the source data.  Use 0 for
61                                         variable or unknown sampling rate. */
62     OMX_AUDIO_CHANNELMODETYPE eChannelMode;   /**< Channel mode enumeration */
63     OMX_AUDIO_MP3STREAMFORMATTYPE eFormat;  /**< MP3 stream format */
64 } OMX_AUDIO_PARAM_MP2TYPE;
65
66 /** AC3 params */
67 typedef struct OMX_AUDIO_PARAM_AC3TYPE {
68     OMX_U32 nSize;                 /**< size of the structure in bytes */
69     OMX_VERSIONTYPE nVersion;      /**< OMX specification version information */
70     OMX_U32 nPortIndex;            /**< port that this structure applies to */
71     OMX_U32 nChannels;             /**< Number of channels */
72     OMX_U32 nBitRate;              /**< Bit rate of the input data.  Use 0 for variable
73                                         rate or unknown bit rates */
74     OMX_U32 nSamplingRate;         /**< Sampling rate of the source data.  Use 0 for
75                                         variable or unknown sampling rate. */
76     OMX_AUDIO_CHANNELMODETYPE eChannelMode;   /**< Channel mode enumeration */
77 } OMX_AUDIO_PARAM_AC3TYPE;
78
79 /** APE params */
80 typedef struct OMX_AUDIO_PARAM_APETYPE {
81     OMX_U32 nSize;                /**< size of the structure in bytes */
82     OMX_VERSIONTYPE nVersion;     /**< OMX specification version information */
83     OMX_U32 nPortIndex;           /**< port that this structure applies to */
84     OMX_U32 nChannels;            /**< Number of channels */
85     OMX_U32 nBitRate;             /**< Bit rate of the input data.  Use 0 for variable
86                                        rate or unknown bit rates */
87     OMX_U32 nSamplingRate;        /**< Sampling rate of the source data.  Use 0 for
88                                        variable or unknown sampling rate. */
89     OMX_U32 nBitsPerSample;       /**< Number of bits in each sample */
90     OMX_AUDIO_CHANNELMODETYPE eChannelMode;   /**< Channel mode enumeration */
91 } OMX_AUDIO_PARAM_APETYPE;
92
93 /** DTS params */
94 typedef struct OMX_AUDIO_PARAM_DTSTYPE {
95     OMX_U32 nSize;                 /**< size of the structure in bytes */
96     OMX_VERSIONTYPE nVersion;      /**< OMX specification version information */
97     OMX_U32 nPortIndex;            /**< port that this structure applies to */
98     OMX_U32 nChannels;             /**< Number of channels */
99     OMX_U32 nBitRate;              /**< Bit rate of the input data.  Use 0 for variable
100                                         rate or unknown bit rates */
101     OMX_U32 nSamplingRate;         /**< Sampling rate of the source data.  Use 0 for
102                                         variable or unknown sampling rate. */
103     OMX_AUDIO_CHANNELMODETYPE eChannelMode;   /**< Channel mode enumeration */
104 } OMX_AUDIO_PARAM_DTSTYPE;
105
106 /** FFMPEG Audio params */
107 typedef struct OMX_AUDIO_PARAM_FFMPEGTYPE {
108     OMX_U32 nSize;
109     OMX_VERSIONTYPE nVersion;
110     OMX_U32 nPortIndex;
111
112     OMX_S32 eCodecId;              /**< enum AVCodecID */
113     OMX_U32 nChannels;             /**< Number of channels */
114     OMX_U32 nBitRate;              /**< Bit rate of the input data.  Use 0 for variable
115                                         rate or unknown bit rates */
116     OMX_U32 nBitsPerSample;        /**< Number of bits in each sample */
117     OMX_U32 nSampleRate;           /**< Sampling rate of the source data.  Use 0 for
118                                         variable or unknown sampling rate. */
119     OMX_U32 nBlockAlign;           /**< is the block alignment, or block size, in bytes of the audio codec */
120
121     OMX_S32 eSampleFormat;         /**< enum AVSampleFormat */
122 } OMX_AUDIO_PARAM_FFMPEGTYPE;
123
124 enum OMX_FFMPEG_INDEXTYPE
125 {
126     OMX_IndexParamAudioMp2     = 0x7FB0001,  /**< reference: OMX_AUDIO_PARAM_MP2TYPE */
127     OMX_IndexParamAudioAc3     = 0x7FB0002,  /**< reference: OMX_AUDIO_PARAM_AC3TYPE */
128     OMX_IndexParamAudioApe     = 0x7FB0003,  /**< reference: OMX_AUDIO_PARAM_APETYPE */
129     OMX_IndexParamAudioDts     = 0x7FB0004,  /**< reference: OMX_AUDIO_PARAM_DTSTYPE */
130     OMX_IndexParamVideoFFmpeg  = 0x7FB0005,  /**< reference: OMX_VIDEO_PARAM_FFMPEGTYPE */
131     OMX_IndexParamAudioFFmpeg  = 0x7FB0006,  /**< reference: OMX_AUDIO_PARAM_FFMPEGTYPE */
132 };
133
134 #ifdef __cplusplus
135 };
136 #endif /* __cplusplus */
137
138 #endif