1 | /* |
2 | mediastreamer2 library - modular sound and video processing and streaming |
3 | Copyright (C) 2010 Simon MORLAT (simon.morlat@linphone.org) |
4 | |
5 | This program is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU General Public License |
7 | as published by the Free Software Foundation; either version 2 |
8 | of the License, or (at your option) any later version. |
9 | |
10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. |
14 | |
15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | */ |
19 | |
20 | #ifndef msinterfaces_h |
21 | #define msinterfaces_h |
22 | |
23 | /** |
24 | * Interface definition for video display filters. |
25 | **/ |
26 | |
27 | typedef struct _MSVideoDisplayDecodingSupport MSVideoDisplayDecodingSupport; |
28 | |
29 | struct _MSVideoDisplayDecodingSupport { |
30 | const char *mime_type; /**< Input parameter to asking if the display supports decoding of this mime type */ |
31 | bool_t supported; /**< Output telling whether the display supports decoding to the specified mime type */ |
32 | }; |
33 | |
34 | /** whether the video window should be resized to the stream's resolution*/ |
35 | #define MS_VIDEO_DISPLAY_ENABLE_AUTOFIT \ |
36 | MS_FILTER_METHOD(MSFilterVideoDisplayInterface,0,int) |
37 | |
38 | /**position of the local view */ |
39 | #define MS_VIDEO_DISPLAY_SET_LOCAL_VIEW_MODE \ |
40 | MS_FILTER_METHOD(MSFilterVideoDisplayInterface,1,int) |
41 | |
42 | /**whether the video should be reversed as in mirror */ |
43 | #define MS_VIDEO_DISPLAY_ENABLE_MIRRORING \ |
44 | MS_FILTER_METHOD(MSFilterVideoDisplayInterface,2,int) |
45 | |
46 | /**returns a platform dependant window id where the video is drawn */ |
47 | #define MS_VIDEO_DISPLAY_GET_NATIVE_WINDOW_ID \ |
48 | MS_FILTER_METHOD(MSFilterVideoDisplayInterface,3,long) |
49 | |
50 | |
51 | /**Sets an external native window id where the video is to be drawn */ |
52 | #define MS_VIDEO_DISPLAY_SET_NATIVE_WINDOW_ID \ |
53 | MS_FILTER_METHOD(MSFilterVideoDisplayInterface,4,long) |
54 | |
55 | |
56 | /**scale factor of the local view */ |
57 | #define MS_VIDEO_DISPLAY_SET_LOCAL_VIEW_SCALEFACTOR \ |
58 | MS_FILTER_METHOD(MSFilterVideoDisplayInterface,5,float) |
59 | |
60 | /**Set the background colour for video window */ |
61 | #define MS_VIDEO_DISPLAY_SET_BACKGROUND_COLOR \ |
62 | MS_FILTER_METHOD(MSFilterVideoDisplayInterface,8,int[3]) |
63 | |
64 | /**Show video. Useful to free XV port */ |
65 | #define MS_VIDEO_DISPLAY_SHOW_VIDEO \ |
66 | MS_FILTER_METHOD(MSFilterVideoDisplayInterface,9,int) |
67 | |
68 | #define MS_VIDEO_DISPLAY_ZOOM \ |
69 | MS_FILTER_METHOD(MSFilterVideoDisplayInterface,10,int[4]) |
70 | |
71 | /**Specifiy device orientation from portrait */ |
72 | #define MS_VIDEO_DISPLAY_SET_DEVICE_ORIENTATION \ |
73 | MS_FILTER_METHOD(MSFilterVideoDisplayInterface,11,int) |
74 | |
75 | #define MS_VIDEO_DISPLAY_SUPPORT_DECODING \ |
76 | MS_FILTER_METHOD(MSFilterVideoDisplayInterface, 12, MSVideoDisplayDecodingSupport*) |
77 | |
78 | /** |
79 | * Interface definitions for players |
80 | **/ |
81 | |
82 | enum _MSPlayerState{ |
83 | MSPlayerClosed, |
84 | MSPlayerPaused, |
85 | MSPlayerPlaying |
86 | }; |
87 | |
88 | typedef enum _MSPlayerState MSPlayerState; |
89 | |
90 | /**open a media file*/ |
91 | #define MS_PLAYER_OPEN \ |
92 | MS_FILTER_METHOD(MSFilterPlayerInterface,0,const char ) |
93 | |
94 | #define MS_PLAYER_START \ |
95 | MS_FILTER_METHOD_NO_ARG(MSFilterPlayerInterface,1) |
96 | |
97 | #define MS_PLAYER_PAUSE \ |
98 | MS_FILTER_METHOD_NO_ARG(MSFilterPlayerInterface,2) |
99 | |
100 | #define MS_PLAYER_CLOSE \ |
101 | MS_FILTER_METHOD_NO_ARG(MSFilterPlayerInterface,3) |
102 | |
103 | #define MS_PLAYER_SEEK_MS \ |
104 | MS_FILTER_METHOD(MSFilterPlayerInterface,4,int) |
105 | |
106 | #define MS_PLAYER_GET_STATE \ |
107 | MS_FILTER_METHOD(MSFilterPlayerInterface,5,MSPlayerState) |
108 | |
109 | |
110 | |
111 | /** |
112 | * Interface definitions for recorders |
113 | **/ |
114 | |
115 | enum _MSRecorderState{ |
116 | MSRecorderClosed, |
117 | MSRecorderPaused, |
118 | MSRecorderRunning |
119 | }; |
120 | |
121 | typedef enum _MSRecorderState MSRecorderState; |
122 | |
123 | /**open a media file for recording*/ |
124 | #define MS_RECORDER_OPEN \ |
125 | MS_FILTER_METHOD(MSFilterRecorderInterface,0,const char ) |
126 | |
127 | #define MS_RECORDER_START \ |
128 | MS_FILTER_METHOD_NO_ARG(MSFilterRecorderInterface,1) |
129 | |
130 | #define MS_RECORDER_PAUSE \ |
131 | MS_FILTER_METHOD_NO_ARG(MSFilterRecorderInterface,2) |
132 | |
133 | #define MS_RECORDER_CLOSE \ |
134 | MS_FILTER_METHOD_NO_ARG(MSFilterRecorderInterface,3) |
135 | |
136 | #define MS_RECORDER_GET_STATE \ |
137 | MS_FILTER_METHOD(MSFilterRecorderInterface,5,MSRecorderState) |
138 | |
139 | |
140 | |
141 | |
142 | /** Interface definitions for echo cancellers */ |
143 | |
144 | /** sets the echo delay in milliseconds*/ |
145 | #define MS_ECHO_CANCELLER_SET_DELAY \ |
146 | MS_FILTER_METHOD(MSFilterEchoCancellerInterface,0,int) |
147 | |
148 | #define MS_ECHO_CANCELLER_SET_FRAMESIZE \ |
149 | MS_FILTER_METHOD(MSFilterEchoCancellerInterface,1,int) |
150 | |
151 | /** sets tail length in milliseconds */ |
152 | #define MS_ECHO_CANCELLER_SET_TAIL_LENGTH \ |
153 | MS_FILTER_METHOD(MSFilterEchoCancellerInterface,2,int) |
154 | |
155 | /** put filter in bypass mode */ |
156 | #define MS_ECHO_CANCELLER_SET_BYPASS_MODE \ |
157 | MS_FILTER_METHOD(MSFilterEchoCancellerInterface,3,bool_t) |
158 | /** get filter bypass mode */ |
159 | #define MS_ECHO_CANCELLER_GET_BYPASS_MODE \ |
160 | MS_FILTER_METHOD(MSFilterEchoCancellerInterface,4,bool_t) |
161 | |
162 | /** retrieve echo canceller internal state, as a base64 encoded string */ |
163 | #define MS_ECHO_CANCELLER_GET_STATE_STRING \ |
164 | MS_FILTER_METHOD(MSFilterEchoCancellerInterface,5,char **) |
165 | |
166 | /** restore a previous state suppling the echo canceller config as base64 encoded string */ |
167 | #define MS_ECHO_CANCELLER_SET_STATE_STRING \ |
168 | MS_FILTER_METHOD(MSFilterEchoCancellerInterface,6, const char *) |
169 | |
170 | |
171 | |
172 | /** Interface definitions for video decoders */ |
173 | #define MS_VIDEO_DECODER_DECODING_ERRORS \ |
174 | MS_FILTER_EVENT_NO_ARG(MSFilterVideoDecoderInterface,0) |
175 | #define MS_VIDEO_DECODER_FIRST_IMAGE_DECODED \ |
176 | MS_FILTER_EVENT_NO_ARG(MSFilterVideoDecoderInterface,1) |
177 | #define MS_VIDEO_DECODER_RESET_FIRST_IMAGE_NOTIFICATION \ |
178 | MS_FILTER_METHOD_NO_ARG(MSFilterVideoDecoderInterface, 0) |
179 | |
180 | /** Interface definitions for video capture */ |
181 | #define MS_VIDEO_CAPTURE_SET_DEVICE_ORIENTATION \ |
182 | MS_FILTER_METHOD(MSFilterVideoCaptureInterface,0,int) |
183 | #define MS_VIDEO_CAPTURE_GET_CAMERA_SENSOR_ROTATION \ |
184 | MS_FILTER_METHOD(MSFilterVideoCaptureInterface, 1, int) |
185 | |
186 | /** Interface definitions for audio decoder */ |
187 | |
188 | #define MS_AUDIO_DECODER_HAVE_PLC \ |
189 | MS_FILTER_METHOD(MSFilterAudioDecoderInterface,0,int) |
190 | |
191 | #define MS_DECODER_HAVE_PLC MS_AUDIO_DECODER_HAVE_PLC /*for backward compatibility*/ |
192 | |
193 | /** Interface definitions for video encoders */ |
194 | #define MS_VIDEO_ENCODER_HAS_BUILTIN_CONVERTER \ |
195 | MS_FILTER_METHOD(MSFilterVideoEncoderInterface, 0, bool_t) |
196 | /* request a video-fast-update (=I frame for H263,MP4V-ES) to a video encoder*/ |
197 | #define MS_VIDEO_ENCODER_REQ_VFU \ |
198 | MS_FILTER_METHOD_NO_ARG(MSFilterVideoEncoderInterface, 1) |
199 | #define MS_VIDEO_ENCODER_GET_CONFIGURATION_LIST \ |
200 | MS_FILTER_METHOD(MSFilterVideoEncoderInterface, 2, const MSVideoConfiguration **) |
201 | #define MS_VIDEO_ENCODER_SET_CONFIGURATION \ |
202 | MS_FILTER_METHOD(MSFilterVideoEncoderInterface, 3, const MSVideoConfiguration *) |
203 | |
204 | /** Interface definitions for audio capture */ |
205 | /* Start numbering from the end for hacks */ |
206 | #define MS_AUDIO_CAPTURE_FORCE_SPEAKER_STATE \ |
207 | MS_FILTER_METHOD(MSFilterAudioCaptureInterface, 255, bool_t) |
208 | |
209 | /** Interface definitions for audio encoder */ |
210 | #define MS_AUDIO_ENCODER_SET_PTIME \ |
211 | MS_FILTER_METHOD(MSFilterAudioEncoderInterface,0,int) |
212 | |
213 | #define MS_AUDIO_ENCODER_GET_PTIME \ |
214 | MS_FILTER_METHOD(MSFilterAudioEncoderInterface,1,int) |
215 | |
216 | /* Enable encoder's builtin forward error correction, if available*/ |
217 | #define MS_AUDIO_ENCODER_ENABLE_FEC \ |
218 | MS_FILTER_METHOD(MSFilterAudioEncoderInterface,2,int) |
219 | |
220 | /* Set the packet loss percentage reported, so that encoder may compensate if forward-correction is enabled and implemented.*/ |
221 | #define MS_AUDIO_ENCODER_SET_PACKET_LOSS \ |
222 | MS_FILTER_METHOD(MSFilterAudioEncoderInterface,3,int) |
223 | #endif |
224 | |