Mercurial > mplayer.hg
annotate dec_video.c @ 4692:f78d2b53aa48
a few quick fixes to the FLI decoder
author | melanson |
---|---|
date | Thu, 14 Feb 2002 03:26:50 +0000 |
parents | 2973e997c4a5 |
children | d3a52470594c |
rev | line source |
---|---|
4188 | 1 |
2 #define USE_MP_IMAGE | |
2775 | 3 |
4 #include "config.h" | |
1294 | 5 |
6 #include <stdio.h> | |
2775 | 7 #ifdef HAVE_MALLOC_H |
8 #include <malloc.h> | |
9 #endif | |
1294 | 10 #include <stdlib.h> |
1430 | 11 #include <unistd.h> |
1294 | 12 |
1567 | 13 #include "mp_msg.h" |
1973
5216f108cb4f
all error/warn/info messages moved to help_mp-en.h for translation
arpi
parents:
1949
diff
changeset
|
14 #include "help_mp.h" |
1294 | 15 |
1327
b12e1817bcc2
some cleanup - fixed warnings, removed old stuff, moved audio resync to dec_audio
arpi
parents:
1309
diff
changeset
|
16 #include "linux/timer.h" |
1496 | 17 #include "linux/shmem.h" |
1327
b12e1817bcc2
some cleanup - fixed warnings, removed old stuff, moved audio resync to dec_audio
arpi
parents:
1309
diff
changeset
|
18 |
2563 | 19 extern int verbose; // defined in mplayer.c |
20 | |
1294 | 21 #include "stream.h" |
22 #include "demuxer.h" | |
1375
dbcb5b5e1fae
file-format detection stuff moved out from mplayer.c to demuxer.c and dec_video.c
arpi
parents:
1367
diff
changeset
|
23 #include "parse_es.h" |
1294 | 24 |
25 #include "codec-cfg.h" | |
26 | |
1422 | 27 #ifdef USE_LIBVO2 |
28 #include "libvo2/libvo2.h" | |
29 #else | |
1294 | 30 #include "libvo/video_out.h" |
1422 | 31 #endif |
1294 | 32 |
4188 | 33 #include "stheader.h" |
34 | |
2563 | 35 #include "dec_video.h" |
36 | |
4486 | 37 #include "roqav.h" |
38 | |
2563 | 39 // =================================================================== |
40 | |
41 extern double video_time_usage; | |
42 extern double vout_time_usage; | |
4388 | 43 extern vo_vaa_t vo_vaa; |
2563 | 44 |
45 extern int frameratecode2framerate[16]; | |
46 | |
47 #include "dll_init.h" | |
48 | |
49 //#include <inttypes.h> | |
50 //#include "libvo/img_format.h" | |
51 | |
1294 | 52 #include "libmpeg2/mpeg2.h" |
53 #include "libmpeg2/mpeg2_internal.h" | |
54 | |
2184 | 55 #include "postproc/postprocess.h" |
56 | |
3144 | 57 #include "cpudetect.h" |
58 | |
1294 | 59 extern picture_t *picture; // exported from libmpeg2/decode.c |
60 | |
2563 | 61 int divx_quality=0; |
1294 | 62 |
63 #ifdef USE_DIRECTSHOW | |
3947
2eb8c8aacca7
using dshow headers from dshow/ instead of c++ version
arpi
parents:
3877
diff
changeset
|
64 #include "loader/dshow/DS_VideoDecoder.h" |
2eb8c8aacca7
using dshow headers from dshow/ instead of c++ version
arpi
parents:
3877
diff
changeset
|
65 static DS_VideoDecoder* ds_vdec=NULL; |
3062 | 66 #endif |
1294 | 67 |
68 #ifdef USE_LIBAVCODEC | |
2496 | 69 #ifdef USE_LIBAVCODEC_SO |
70 #include <libffmpeg/avcodec.h> | |
71 #else | |
1294 | 72 #include "libavcodec/avcodec.h" |
2496 | 73 #endif |
1927 | 74 static AVCodec *lavc_codec=NULL; |
75 static AVCodecContext lavc_context; | |
76 static AVPicture lavc_picture; | |
77 int avcodec_inited=0; | |
1294 | 78 #endif |
2228 | 79 #ifdef FF_POSTPROCESS |
80 unsigned int lavc_pp=0; | |
81 #endif | |
1294 | 82 |
4489 | 83 #ifdef USE_DIVX |
1349 | 84 #ifndef NEW_DECORE |
1294 | 85 #include "opendivx/decore.h" |
1349 | 86 #else |
87 #include <decore.h> | |
88 #endif | |
4489 | 89 #endif |
1294 | 90 |
2378 | 91 #ifdef USE_XANIM |
92 #include "xacodec.h" | |
93 #endif | |
94 | |
2938
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
95 #ifdef USE_TV |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
96 #include "libmpdemux/tv.h" |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
97 extern int tv_param_on; |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
98 extern tvi_handle_t *tv_handler; |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
99 #endif |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
100 |
1948 | 101 void AVI_Decode_RLE8(char *image,char *delta,int tdsize, |
102 unsigned int *map,int imagex,int imagey,unsigned char x11_bytes_pixel); | |
103 | |
2827
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
104 void AVI_Decode_Video1_16( |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
105 char *encoded, |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
106 int encoded_size, |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
107 char *decoded, |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
108 int width, |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
109 int height, |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
110 int bytes_per_pixel); |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
111 |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
112 void AVI_Decode_Video1_8( |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
113 char *encoded, |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
114 int encoded_size, |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
115 char *decoded, |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
116 int width, |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
117 int height, |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
118 unsigned char *palette_map, |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
119 int bytes_per_pixel); |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
120 |
4687
2973e997c4a5
some obscure bug fixes to the FLI decoder, with many thanks to Roberto
melanson
parents:
4672
diff
changeset
|
121 void *init_fli_decoder(int width, int height); |
2973e997c4a5
some obscure bug fixes to the FLI decoder, with many thanks to Roberto
melanson
parents:
4672
diff
changeset
|
122 |
2973e997c4a5
some obscure bug fixes to the FLI decoder, with many thanks to Roberto
melanson
parents:
4672
diff
changeset
|
123 void decode_fli_frame( |
3172 | 124 unsigned char *encoded, |
125 int encoded_size, | |
126 unsigned char *decoded, | |
127 int width, | |
128 int height, | |
4687
2973e997c4a5
some obscure bug fixes to the FLI decoder, with many thanks to Roberto
melanson
parents:
4672
diff
changeset
|
129 int bytes_per_pixel, |
2973e997c4a5
some obscure bug fixes to the FLI decoder, with many thanks to Roberto
melanson
parents:
4672
diff
changeset
|
130 void *context); |
3172 | 131 |
3687
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
132 void qt_decode_rle( |
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
133 unsigned char *encoded, |
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
134 int encoded_size, |
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
135 unsigned char *decoded, |
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
136 int width, |
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
137 int height, |
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
138 int encoded_bpp, |
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
139 int bytes_per_pixel); |
3172 | 140 |
3804
53ed66a4f0bf
NuppelVideo decoder added, based on Panagiotis Issaris' patch
alex
parents:
3745
diff
changeset
|
141 void decode_nuv( |
53ed66a4f0bf
NuppelVideo decoder added, based on Panagiotis Issaris' patch
alex
parents:
3745
diff
changeset
|
142 unsigned char *encoded, |
53ed66a4f0bf
NuppelVideo decoder added, based on Panagiotis Issaris' patch
alex
parents:
3745
diff
changeset
|
143 int encoded_size, |
53ed66a4f0bf
NuppelVideo decoder added, based on Panagiotis Issaris' patch
alex
parents:
3745
diff
changeset
|
144 unsigned char *decoded, |
53ed66a4f0bf
NuppelVideo decoder added, based on Panagiotis Issaris' patch
alex
parents:
3745
diff
changeset
|
145 int width, |
53ed66a4f0bf
NuppelVideo decoder added, based on Panagiotis Issaris' patch
alex
parents:
3745
diff
changeset
|
146 int height); |
53ed66a4f0bf
NuppelVideo decoder added, based on Panagiotis Issaris' patch
alex
parents:
3745
diff
changeset
|
147 |
3969 | 148 void *decode_cinepak_init(void); |
149 | |
150 void decode_cinepak( | |
151 void *context, | |
152 unsigned char *buf, | |
153 int size, | |
154 unsigned char *frame, | |
155 int width, | |
156 int height, | |
157 int bit_per_pixel); | |
158 | |
159 void decode_cyuv( | |
160 unsigned char *buf, | |
161 int size, | |
162 unsigned char *frame, | |
163 int width, | |
164 int height, | |
165 int bit_per_pixel); | |
166 | |
4275
818be6ba8758
initial implementation of SMC codec; it almost works, too!
melanson
parents:
4227
diff
changeset
|
167 int qt_init_decode_smc(void); |
818be6ba8758
initial implementation of SMC codec; it almost works, too!
melanson
parents:
4227
diff
changeset
|
168 |
4227 | 169 void qt_decode_smc( |
170 unsigned char *encoded, | |
171 int encoded_size, | |
172 unsigned char *decoded, | |
173 int width, | |
174 int height, | |
4275
818be6ba8758
initial implementation of SMC codec; it almost works, too!
melanson
parents:
4227
diff
changeset
|
175 unsigned char *palette_map, |
4227 | 176 int bytes_per_pixel); |
177 | |
4301
8f43b10f387f
added skeleton for Duck Truemotion v1 decoder (doesn't do anything yet)
melanson
parents:
4275
diff
changeset
|
178 void decode_duck_tm1( |
8f43b10f387f
added skeleton for Duck Truemotion v1 decoder (doesn't do anything yet)
melanson
parents:
4275
diff
changeset
|
179 unsigned char *encoded, |
8f43b10f387f
added skeleton for Duck Truemotion v1 decoder (doesn't do anything yet)
melanson
parents:
4275
diff
changeset
|
180 int encoded_size, |
8f43b10f387f
added skeleton for Duck Truemotion v1 decoder (doesn't do anything yet)
melanson
parents:
4275
diff
changeset
|
181 unsigned char *decoded, |
8f43b10f387f
added skeleton for Duck Truemotion v1 decoder (doesn't do anything yet)
melanson
parents:
4275
diff
changeset
|
182 int width, |
8f43b10f387f
added skeleton for Duck Truemotion v1 decoder (doesn't do anything yet)
melanson
parents:
4275
diff
changeset
|
183 int height, |
8f43b10f387f
added skeleton for Duck Truemotion v1 decoder (doesn't do anything yet)
melanson
parents:
4275
diff
changeset
|
184 int bytes_per_pixel); |
8f43b10f387f
added skeleton for Duck Truemotion v1 decoder (doesn't do anything yet)
melanson
parents:
4275
diff
changeset
|
185 |
4656 | 186 #ifdef HAVE_PNG |
187 void decode_mpng( | |
188 unsigned char *encoded, | |
189 int encoded_size, | |
190 unsigned char *decoded, | |
191 int width, | |
192 int height, | |
193 int bytes_per_pixel); | |
194 #endif | |
195 | |
4615
b1fe5f58cd82
Added native codec support for QT RPZA data, courtesy of Roberto Togni
melanson
parents:
4516
diff
changeset
|
196 void qt_decode_rpza( |
b1fe5f58cd82
Added native codec support for QT RPZA data, courtesy of Roberto Togni
melanson
parents:
4516
diff
changeset
|
197 unsigned char *encoded, |
b1fe5f58cd82
Added native codec support for QT RPZA data, courtesy of Roberto Togni
melanson
parents:
4516
diff
changeset
|
198 int encoded_size, |
b1fe5f58cd82
Added native codec support for QT RPZA data, courtesy of Roberto Togni
melanson
parents:
4516
diff
changeset
|
199 unsigned char *decoded, |
b1fe5f58cd82
Added native codec support for QT RPZA data, courtesy of Roberto Togni
melanson
parents:
4516
diff
changeset
|
200 int width, |
b1fe5f58cd82
Added native codec support for QT RPZA data, courtesy of Roberto Togni
melanson
parents:
4516
diff
changeset
|
201 int height, |
b1fe5f58cd82
Added native codec support for QT RPZA data, courtesy of Roberto Togni
melanson
parents:
4516
diff
changeset
|
202 int bytes_per_pixel); |
b1fe5f58cd82
Added native codec support for QT RPZA data, courtesy of Roberto Togni
melanson
parents:
4516
diff
changeset
|
203 |
1294 | 204 //**************************************************************************// |
205 // The OpenDivX stuff: | |
206 //**************************************************************************// | |
207 | |
208 #ifndef NEW_DECORE | |
209 | |
210 static unsigned char *opendivx_src[3]; | |
211 static int opendivx_stride[3]; | |
212 | |
213 // callback, the opendivx decoder calls this for each frame: | |
214 void convert_linux(unsigned char *puc_y, int stride_y, | |
215 unsigned char *puc_u, unsigned char *puc_v, int stride_uv, | |
216 unsigned char *bmp, int width_y, int height_y){ | |
217 | |
218 // printf("convert_yuv called %dx%d stride: %d,%d\n",width_y,height_y,stride_y,stride_uv); | |
219 | |
220 opendivx_src[0]=puc_y; | |
221 opendivx_src[1]=puc_u; | |
222 opendivx_src[2]=puc_v; | |
223 | |
224 opendivx_stride[0]=stride_y; | |
225 opendivx_stride[1]=stride_uv; | |
226 opendivx_stride[2]=stride_uv; | |
227 } | |
228 #endif | |
229 | |
1429 | 230 int get_video_quality_max(sh_video_t *sh_video){ |
231 switch(sh_video->codec->driver){ | |
2087 | 232 #ifdef USE_WIN32DLL |
233 case VFM_VFW: | |
234 case VFM_VFWEX: | |
2184 | 235 return 9; // for Divx.dll (divx4) |
2087 | 236 #endif |
1429 | 237 #ifdef USE_DIRECTSHOW |
238 case VFM_DSHOW: | |
239 return 4; | |
240 #endif | |
241 #ifdef MPEG12_POSTPROC | |
242 case VFM_MPEG: | |
2184 | 243 return GET_PP_QUALITY_MAX; |
1429 | 244 #endif |
2228 | 245 #ifdef FF_POSTPROCESS |
246 case VFM_FFMPEG: | |
247 return GET_PP_QUALITY_MAX; | |
248 #endif | |
4489 | 249 #ifdef USE_DIVX |
1429 | 250 case VFM_DIVX4: |
251 case VFM_ODIVX: | |
2184 | 252 #ifdef NEW_DECORE |
253 return 9; // for divx4linux | |
254 #else | |
255 return GET_PP_QUALITY_MAX; // for opendivx | |
256 #endif | |
4489 | 257 #endif |
1429 | 258 } |
259 return 0; | |
260 } | |
261 | |
262 void set_video_quality(sh_video_t *sh_video,int quality){ | |
263 switch(sh_video->codec->driver){ | |
2087 | 264 #ifdef USE_WIN32DLL |
265 case VFM_VFW: | |
266 case VFM_VFWEX: | |
267 vfw_set_postproc(sh_video,10*quality); | |
268 break; | |
269 #endif | |
1429 | 270 #ifdef USE_DIRECTSHOW |
271 case VFM_DSHOW: { | |
272 if(quality<0 || quality>4) quality=4; | |
3062 | 273 DS_VideoDecoder_SetValue(ds_vdec,"Quality",quality); |
1429 | 274 } |
275 break; | |
276 #endif | |
277 #ifdef MPEG12_POSTPROC | |
278 case VFM_MPEG: { | |
2184 | 279 if(quality<0 || quality>GET_PP_QUALITY_MAX) quality=GET_PP_QUALITY_MAX; |
280 picture->pp_options=getPpModeForQuality(quality); | |
1429 | 281 } |
282 break; | |
283 #endif | |
2228 | 284 #ifdef FF_POSTPROCESS |
285 case VFM_FFMPEG: | |
286 if(quality<0 || quality>GET_PP_QUALITY_MAX) quality=GET_PP_QUALITY_MAX; | |
287 lavc_pp=getPpModeForQuality(quality); | |
288 break; | |
289 #endif | |
4489 | 290 #ifdef USE_DIVX |
1429 | 291 case VFM_DIVX4: |
292 case VFM_ODIVX: { | |
293 DEC_SET dec_set; | |
2184 | 294 #ifdef NEW_DECORE |
295 if(quality<0 || quality>9) quality=9; | |
296 dec_set.postproc_level=quality*10; | |
297 #else | |
298 if(quality<0 || quality>GET_PP_QUALITY_MAX) quality=GET_PP_QUALITY_MAX; | |
299 dec_set.postproc_level=getPpModeForQuality(quality); | |
300 #endif | |
1429 | 301 decore(0x123,DEC_OPT_SETPP,&dec_set,NULL); |
302 } | |
4489 | 303 #endif |
1429 | 304 break; |
305 } | |
306 } | |
307 | |
4395 | 308 int set_video_colors(sh_video_t *sh_video,char *item,int value) |
309 { | |
310 if(vo_vaa.get_video_eq) | |
4388 | 311 { |
4395 | 312 vidix_video_eq_t veq; |
313 if(vo_vaa.get_video_eq(&veq) == 0) | |
4388 | 314 { |
4395 | 315 int v_hw_equ_cap = veq.cap; |
316 if(v_hw_equ_cap != 0) | |
317 { | |
318 if(vo_vaa.set_video_eq) | |
319 { | |
320 vidix_video_eq_t veq; | |
321 veq.flags = VEQ_FLG_ITU_R_BT_601; /* Fixme please !!! */ | |
322 if(strcmp(item,"Brightness") == 0) | |
323 { | |
324 if(!(v_hw_equ_cap & VEQ_CAP_BRIGHTNESS)) goto try_sw_control; | |
325 veq.brightness = value*10; | |
326 veq.cap = VEQ_CAP_BRIGHTNESS; | |
327 } | |
328 else | |
329 if(strcmp(item,"Contrast") == 0) | |
330 { | |
331 if(!(v_hw_equ_cap & VEQ_CAP_CONTRAST)) goto try_sw_control; | |
332 veq.contrast = value*10; | |
333 veq.cap = VEQ_CAP_CONTRAST; | |
334 } | |
335 else | |
336 if(strcmp(item,"Saturation") == 0) | |
337 { | |
338 if(!(v_hw_equ_cap & VEQ_CAP_SATURATION)) goto try_sw_control; | |
339 veq.saturation = value*10; | |
340 veq.cap = VEQ_CAP_SATURATION; | |
341 } | |
342 else | |
343 if(strcmp(item,"Hue") == 0) | |
344 { | |
345 if(!(v_hw_equ_cap & VEQ_CAP_HUE)) goto try_sw_control; | |
346 veq.hue = value*10; | |
347 veq.cap = VEQ_CAP_HUE; | |
348 } | |
349 else goto try_sw_control;; | |
350 vo_vaa.set_video_eq(&veq); | |
351 } | |
352 return 1; | |
353 } | |
4388 | 354 } |
355 } | |
4395 | 356 try_sw_control: |
1431 | 357 #ifdef USE_DIRECTSHOW |
2295 | 358 if(sh_video->codec->driver==VFM_DSHOW){ |
3062 | 359 DS_VideoDecoder_SetValue(ds_vdec,item,value); |
1429 | 360 return 1; |
361 } | |
1431 | 362 #endif |
2938
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
363 |
2295 | 364 #ifdef NEW_DECORE |
365 #ifdef DECORE_VERSION | |
366 #if DECORE_VERSION >= 20011010 | |
367 if(sh_video->codec->driver==VFM_DIVX4){ | |
368 int option; | |
369 if(!strcmp(item,"Brightness")) option=DEC_GAMMA_BRIGHTNESS; | |
370 else if(!strcmp(item, "Contrast")) option=DEC_GAMMA_CONTRAST; | |
371 else if(!strcmp(item,"Saturation")) option=DEC_GAMMA_SATURATION; | |
372 else return 0; | |
373 value = (value * 256) / 100 - 128; | |
374 decore(0x123, DEC_OPT_GAMMA, (void *)option, (void *) value); | |
375 return 1; | |
376 } | |
377 #endif | |
378 #endif | |
379 #endif | |
2938
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
380 |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
381 #ifdef USE_TV |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
382 |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
383 if (tv_param_on == 1) |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
384 { |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
385 if (!strcmp(item, "Brightness")) |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
386 { |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
387 tv_set_color_options(tv_handler, TV_COLOR_BRIGHTNESS, value); |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
388 return(1); |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
389 } |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
390 if (!strcmp(item, "Hue")) |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
391 { |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
392 tv_set_color_options(tv_handler, TV_COLOR_HUE, value); |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
393 return(1); |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
394 } |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
395 if (!strcmp(item, "Saturation")) |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
396 { |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
397 tv_set_color_options(tv_handler, TV_COLOR_SATURATION, value); |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
398 return(1); |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
399 } |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
400 if (!strcmp(item, "Contrast")) |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
401 { |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
402 tv_set_color_options(tv_handler, TV_COLOR_CONTRAST, value); |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
403 return(1); |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
404 } |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
405 } |
757c3ab1a45a
added support for setting color values on tv interface
alex
parents:
2827
diff
changeset
|
406 #endif |
1429 | 407 return 0; |
408 } | |
1294 | 409 |
2049
df41903fd7d7
VfW stuff moved to dll_init, warnings fixed, using dll_init.h
arpi
parents:
2044
diff
changeset
|
410 void uninit_video(sh_video_t *sh_video){ |
1654 | 411 if(!sh_video->inited) return; |
1973
5216f108cb4f
all error/warn/info messages moved to help_mp-en.h for translation
arpi
parents:
1949
diff
changeset
|
412 mp_msg(MSGT_DECVIDEO,MSGL_V,"uninit video: %d \n",sh_video->codec->driver); |
1654 | 413 switch(sh_video->codec->driver){ |
1666 | 414 #ifdef USE_LIBAVCODEC |
1654 | 415 case VFM_FFMPEG: |
416 if (avcodec_close(&lavc_context) < 0) | |
1973
5216f108cb4f
all error/warn/info messages moved to help_mp-en.h for translation
arpi
parents:
1949
diff
changeset
|
417 mp_msg(MSGT_DECVIDEO,MSGL_ERR, MSGTR_CantCloseCodec); |
1654 | 418 break; |
1666 | 419 #endif |
1669 | 420 #ifdef USE_DIRECTSHOW |
1664 | 421 case VFM_DSHOW: // Win32/DirectShow |
3062 | 422 if(ds_vdec){ DS_VideoDecoder_Destroy(ds_vdec); ds_vdec=NULL; } |
1664 | 423 break; |
1666 | 424 #endif |
1654 | 425 case VFM_MPEG: |
426 mpeg2_free_image_buffers (picture); | |
427 break; | |
2563 | 428 #ifdef USE_XANIM |
429 case VFM_XANIM: | |
430 xacodec_exit(); | |
431 break; | |
432 #endif | |
4489 | 433 #ifdef USE_DIVX |
4156
22fadd4022b5
playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents:
3969
diff
changeset
|
434 case VFM_DIVX4: |
22fadd4022b5
playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents:
3969
diff
changeset
|
435 case VFM_ODIVX: |
22fadd4022b5
playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents:
3969
diff
changeset
|
436 decore(0x123,DEC_OPT_RELEASE,NULL,NULL); |
22fadd4022b5
playtree-based config patch by Alban Bedel <albeu@free.fr>
arpi
parents:
3969
diff
changeset
|
437 break; |
4489 | 438 #endif |
1654 | 439 } |
440 if(sh_video->our_out_buffer){ | |
441 free(sh_video->our_out_buffer); | |
442 sh_video->our_out_buffer=NULL; | |
443 } | |
444 sh_video->inited=0; | |
445 } | |
446 | |
4453 | 447 int init_video(sh_video_t *sh_video,int *pitches) |
448 { | |
1294 | 449 unsigned int out_fmt=sh_video->codec->outfmt[sh_video->outfmtidx]; |
4453 | 450 pitches[0] = pitches[1] =pitches[2] = 0; /* fake unknown */ |
1294 | 451 |
1454
3e5b5be0b61d
temporary hack: YUV422P -> YUY2 converter (for ffmpeg MJPEG testing)
arpi
parents:
1431
diff
changeset
|
452 sh_video->our_out_buffer=NULL; |
3e5b5be0b61d
temporary hack: YUV422P -> YUY2 converter (for ffmpeg MJPEG testing)
arpi
parents:
1431
diff
changeset
|
453 |
4188 | 454 sh_video->image=new_mp_image(sh_video->disp_w,sh_video->disp_h); |
455 mp_image_setfmt(sh_video->image,out_fmt); | |
456 | |
1294 | 457 switch(sh_video->codec->driver){ |
4486 | 458 case VFM_ROQVIDEO: |
459 #ifdef USE_MP_IMAGE | |
460 sh_video->image->type=MP_IMGTYPE_STATIC; | |
461 #else | |
462 sh_video->our_out_buffer = | |
463 (char*)memalign(64, sh_video->disp_w * sh_video->disp_h * 1.5); | |
464 #endif | |
465 sh_video->context = roq_decode_video_init(); | |
466 break; | |
3643
fb9fd7e2dd35
native opensourec Cinepak (CVID) codec by im Ferguson <timf@mail.csse.monash.edu.au>
arpi
parents:
3449
diff
changeset
|
467 case VFM_CINEPAK: { |
4188 | 468 #ifdef USE_MP_IMAGE |
469 sh_video->image->type=MP_IMGTYPE_STATIC; | |
470 #else | |
3643
fb9fd7e2dd35
native opensourec Cinepak (CVID) codec by im Ferguson <timf@mail.csse.monash.edu.au>
arpi
parents:
3449
diff
changeset
|
471 int bpp=((out_fmt&255)+7)/8; |
fb9fd7e2dd35
native opensourec Cinepak (CVID) codec by im Ferguson <timf@mail.csse.monash.edu.au>
arpi
parents:
3449
diff
changeset
|
472 sh_video->our_out_buffer = |
fb9fd7e2dd35
native opensourec Cinepak (CVID) codec by im Ferguson <timf@mail.csse.monash.edu.au>
arpi
parents:
3449
diff
changeset
|
473 (char*)memalign(64, sh_video->disp_w*sh_video->disp_h*bpp); |
4188 | 474 #endif |
3643
fb9fd7e2dd35
native opensourec Cinepak (CVID) codec by im Ferguson <timf@mail.csse.monash.edu.au>
arpi
parents:
3449
diff
changeset
|
475 sh_video->context = decode_cinepak_init(); |
fb9fd7e2dd35
native opensourec Cinepak (CVID) codec by im Ferguson <timf@mail.csse.monash.edu.au>
arpi
parents:
3449
diff
changeset
|
476 break; |
fb9fd7e2dd35
native opensourec Cinepak (CVID) codec by im Ferguson <timf@mail.csse.monash.edu.au>
arpi
parents:
3449
diff
changeset
|
477 } |
2659 | 478 case VFM_XANIM: { |
2378 | 479 #ifdef USE_XANIM |
2827
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
480 int ret=xacodec_init_video(sh_video,out_fmt); |
2378 | 481 if(!ret) return 0; |
2659 | 482 #else |
2660 | 483 // mp_msg(MSGT_DECVIDEO, MSGL_ERR, MSGTR_NoXAnimSupport); |
484 mp_msg(MSGT_DECVIDEO, MSGL_ERR, "MPlayer was compiled WIHTOUT XAnim support!\n"); | |
2659 | 485 return 0; |
486 #endif | |
2378 | 487 break; |
488 } | |
1517
0e9c29538a86
Use USE_WIN32DLL define instead of ARCH_X86 to decide whether or not to compile
jkeil
parents:
1496
diff
changeset
|
489 #ifdef USE_WIN32DLL |
1410
eda16e490ae7
using AFM_/VFM_ macros instead of hardcoded constants (idea by al3x)
arpi
parents:
1401
diff
changeset
|
490 case VFM_VFW: { |
2049
df41903fd7d7
VfW stuff moved to dll_init, warnings fixed, using dll_init.h
arpi
parents:
2044
diff
changeset
|
491 if(!init_vfw_video_codec(sh_video,0)) { |
1294 | 492 return 0; |
493 } | |
1567 | 494 mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: Win32 video codec init OK!\n"); |
4516 | 495 /* Warning: these pitches tested only with YUY2 fourcc */ |
496 pitches[0] = 16; pitches[1] = pitches[2] = 8; | |
1294 | 497 break; |
498 } | |
1410
eda16e490ae7
using AFM_/VFM_ macros instead of hardcoded constants (idea by al3x)
arpi
parents:
1401
diff
changeset
|
499 case VFM_VFWEX: { |
2049
df41903fd7d7
VfW stuff moved to dll_init, warnings fixed, using dll_init.h
arpi
parents:
2044
diff
changeset
|
500 if(!init_vfw_video_codec(sh_video,1)) { |
1297 | 501 return 0; |
502 } | |
1567 | 503 mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: Win32Ex video codec init OK!\n"); |
4516 | 504 /* Warning: these pitches tested only with YUY2 fourcc */ |
505 pitches[0] = 16; pitches[1] = pitches[2] = 8; | |
1297 | 506 break; |
507 } | |
1410
eda16e490ae7
using AFM_/VFM_ macros instead of hardcoded constants (idea by al3x)
arpi
parents:
1401
diff
changeset
|
508 case VFM_DSHOW: { // Win32/DirectShow |
1294 | 509 #ifndef USE_DIRECTSHOW |
1973
5216f108cb4f
all error/warn/info messages moved to help_mp-en.h for translation
arpi
parents:
1949
diff
changeset
|
510 mp_msg(MSGT_DECVIDEO,MSGL_ERR,MSGTR_NoDShowSupport); |
1294 | 511 return 0; |
512 #else | |
1547
4b0046db8e64
alloc frame buffer for directshow codec - requires for avifile sync
arpi
parents:
1517
diff
changeset
|
513 int bpp; |
3448 | 514 if(!(ds_vdec=DS_VideoDecoder_Open(sh_video->codec->dll,&sh_video->codec->guid, sh_video->bih, 0, 0))){ |
1294 | 515 // if(DS_VideoDecoder_Open(sh_video->codec->dll,&sh_video->codec->guid, sh_video->bih, 0, NULL)){ |
1973
5216f108cb4f
all error/warn/info messages moved to help_mp-en.h for translation
arpi
parents:
1949
diff
changeset
|
516 mp_msg(MSGT_DECVIDEO,MSGL_ERR,MSGTR_MissingDLLcodec,sh_video->codec->dll); |
1567 | 517 mp_msg(MSGT_DECVIDEO,MSGL_HINT,"Maybe you forget to upgrade your win32 codecs?? It's time to download the new\n"); |
518 mp_msg(MSGT_DECVIDEO,MSGL_HINT,"package from: ftp://mplayerhq.hu/MPlayer/releases/w32codec.zip !\n"); | |
519 // mp_msg(MSGT_DECVIDEO,MSGL_HINT,"Or you should disable DShow support: make distclean;make -f Makefile.No-DS\n"); | |
1294 | 520 return 0; |
521 } | |
4188 | 522 |
523 #ifdef USE_MP_IMAGE | |
524 sh_video->image->type=MP_IMGTYPE_STATIC; | |
525 bpp=sh_video->image->bpp; | |
526 if(sh_video->image->flags&MP_IMGFLAG_YUV){ | |
527 DS_VideoDecoder_SetDestFmt(ds_vdec,bpp,out_fmt); // YUV | |
528 } else { | |
529 DS_VideoDecoder_SetDestFmt(ds_vdec,out_fmt&255,0); // RGB/BGR | |
530 } | |
531 #else | |
1294 | 532 switch(out_fmt){ |
533 case IMGFMT_YUY2: | |
534 case IMGFMT_UYVY: | |
1547
4b0046db8e64
alloc frame buffer for directshow codec - requires for avifile sync
arpi
parents:
1517
diff
changeset
|
535 bpp=16; |
3062 | 536 DS_VideoDecoder_SetDestFmt(ds_vdec,16,out_fmt);break; // packed YUV |
1294 | 537 case IMGFMT_YV12: |
538 case IMGFMT_I420: | |
539 case IMGFMT_IYUV: | |
1547
4b0046db8e64
alloc frame buffer for directshow codec - requires for avifile sync
arpi
parents:
1517
diff
changeset
|
540 bpp=12; |
3062 | 541 DS_VideoDecoder_SetDestFmt(ds_vdec,12,out_fmt);break; // planar YUV |
1294 | 542 default: |
1547
4b0046db8e64
alloc frame buffer for directshow codec - requires for avifile sync
arpi
parents:
1517
diff
changeset
|
543 bpp=((out_fmt&255)+7)&(~7); |
3062 | 544 DS_VideoDecoder_SetDestFmt(ds_vdec,out_fmt&255,0); // RGB/BGR |
1294 | 545 } |
546 | |
2049
df41903fd7d7
VfW stuff moved to dll_init, warnings fixed, using dll_init.h
arpi
parents:
2044
diff
changeset
|
547 sh_video->our_out_buffer = (char*)memalign(64,sh_video->disp_w*sh_video->disp_h*bpp/8); // FIXME!!! |
4188 | 548 #endif |
4457 | 549 /* Warning: these pitches tested only with YUY2 fourcc */ |
550 pitches[0] = 16; pitches[1] = pitches[2] = 8; | |
3062 | 551 DS_SetAttr_DivX("Quality",divx_quality); |
1294 | 552 |
3062 | 553 DS_VideoDecoder_StartInternal(ds_vdec); |
1294 | 554 // printf("DivX setting result = %d\n", DS_SetAttr_DivX("Quality",divx_quality) ); |
555 // printf("DivX setting result = %d\n", DS_SetValue_DivX("Brightness",60) ); | |
556 | |
1567 | 557 mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: Win32/DShow video codec init OK!\n"); |
1294 | 558 break; |
559 #endif | |
560 } | |
1517
0e9c29538a86
Use USE_WIN32DLL define instead of ARCH_X86 to decide whether or not to compile
jkeil
parents:
1496
diff
changeset
|
561 #else /* !USE_WIN32DLL */ |
1410
eda16e490ae7
using AFM_/VFM_ macros instead of hardcoded constants (idea by al3x)
arpi
parents:
1401
diff
changeset
|
562 case VFM_VFW: |
eda16e490ae7
using AFM_/VFM_ macros instead of hardcoded constants (idea by al3x)
arpi
parents:
1401
diff
changeset
|
563 case VFM_DSHOW: |
eda16e490ae7
using AFM_/VFM_ macros instead of hardcoded constants (idea by al3x)
arpi
parents:
1401
diff
changeset
|
564 case VFM_VFWEX: |
2006 | 565 mp_msg(MSGT_DECVIDEO,MSGL_ERR,MSGTR_NoWfvSupport); |
1309
598e3047ce13
Add some preliminary support for non-x86 architectures to mplayer
jkeil
parents:
1297
diff
changeset
|
566 return 0; |
1517
0e9c29538a86
Use USE_WIN32DLL define instead of ARCH_X86 to decide whether or not to compile
jkeil
parents:
1496
diff
changeset
|
567 #endif /* !USE_WIN32DLL */ |
1410
eda16e490ae7
using AFM_/VFM_ macros instead of hardcoded constants (idea by al3x)
arpi
parents:
1401
diff
changeset
|
568 case VFM_ODIVX: { // OpenDivX |
4489 | 569 #ifndef USE_DIVX |
570 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"MPlayer was compiled WITHOUT OpenDivx support!\n"); | |
571 return 0; | |
572 #else | |
1567 | 573 mp_msg(MSGT_DECVIDEO,MSGL_V,"OpenDivX video codec\n"); |
1294 | 574 { DEC_PARAM dec_param; |
575 DEC_SET dec_set; | |
1349 | 576 memset(&dec_param,0,sizeof(dec_param)); |
1294 | 577 #ifdef NEW_DECORE |
578 dec_param.output_format=DEC_USER; | |
579 #else | |
580 dec_param.color_depth = 32; | |
581 #endif | |
582 dec_param.x_dim = sh_video->bih->biWidth; | |
583 dec_param.y_dim = sh_video->bih->biHeight; | |
584 decore(0x123, DEC_OPT_INIT, &dec_param, NULL); | |
585 dec_set.postproc_level = divx_quality; | |
586 decore(0x123, DEC_OPT_SETPP, &dec_set, NULL); | |
1349 | 587 } |
1567 | 588 mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: OpenDivX video codec init OK!\n"); |
1349 | 589 break; |
4489 | 590 #endif |
1349 | 591 } |
1410
eda16e490ae7
using AFM_/VFM_ macros instead of hardcoded constants (idea by al3x)
arpi
parents:
1401
diff
changeset
|
592 case VFM_DIVX4: { // DivX4Linux |
1352
5ac130627602
fixed shmem size, and now compiles without divx4linux too :)
arpi
parents:
1349
diff
changeset
|
593 #ifndef NEW_DECORE |
1973
5216f108cb4f
all error/warn/info messages moved to help_mp-en.h for translation
arpi
parents:
1949
diff
changeset
|
594 mp_msg(MSGT_DECVIDEO,MSGL_ERR,MSGTR_NoDivx4Support); |
1631 | 595 return 0; |
1352
5ac130627602
fixed shmem size, and now compiles without divx4linux too :)
arpi
parents:
1349
diff
changeset
|
596 #else |
1567 | 597 mp_msg(MSGT_DECVIDEO,MSGL_V,"DivX4Linux video codec\n"); |
1349 | 598 { DEC_PARAM dec_param; |
599 DEC_SET dec_set; | |
600 int bits=16; | |
601 memset(&dec_param,0,sizeof(dec_param)); | |
602 switch(out_fmt){ | |
603 case IMGFMT_YV12: dec_param.output_format=DEC_YV12;bits=12;break; | |
604 case IMGFMT_YUY2: dec_param.output_format=DEC_YUY2;break; | |
605 case IMGFMT_UYVY: dec_param.output_format=DEC_UYVY;break; | |
606 case IMGFMT_I420: dec_param.output_format=DEC_420;bits=12;break; | |
607 case IMGFMT_BGR15: dec_param.output_format=DEC_RGB555_INV;break; | |
608 case IMGFMT_BGR16: dec_param.output_format=DEC_RGB565_INV;break; | |
609 case IMGFMT_BGR24: dec_param.output_format=DEC_RGB24_INV;bits=24;break; | |
610 case IMGFMT_BGR32: dec_param.output_format=DEC_RGB32_INV;bits=32;break; | |
611 default: | |
1567 | 612 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Unsupported out_fmt: 0x%X\n",out_fmt); |
1349 | 613 return 0; |
614 } | |
615 dec_param.x_dim = sh_video->bih->biWidth; | |
616 dec_param.y_dim = sh_video->bih->biHeight; | |
617 decore(0x123, DEC_OPT_INIT, &dec_param, NULL); | |
618 dec_set.postproc_level = divx_quality; | |
619 decore(0x123, DEC_OPT_SETPP, &dec_set, NULL); | |
4188 | 620 #ifdef USE_MP_IMAGE |
621 sh_video->image->type=MP_IMGTYPE_STATIC; | |
622 #else | |
2049
df41903fd7d7
VfW stuff moved to dll_init, warnings fixed, using dll_init.h
arpi
parents:
2044
diff
changeset
|
623 sh_video->our_out_buffer = (char*)memalign(64,((bits*dec_param.x_dim+7)/8)*dec_param.y_dim); |
1352
5ac130627602
fixed shmem size, and now compiles without divx4linux too :)
arpi
parents:
1349
diff
changeset
|
624 // sh_video->our_out_buffer = shmem_alloc(dec_param.x_dim*dec_param.y_dim*5); |
4188 | 625 #endif |
1294 | 626 } |
1567 | 627 mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: OpenDivX video codec init OK!\n"); |
1294 | 628 break; |
1352
5ac130627602
fixed shmem size, and now compiles without divx4linux too :)
arpi
parents:
1349
diff
changeset
|
629 #endif |
1294 | 630 } |
1410
eda16e490ae7
using AFM_/VFM_ macros instead of hardcoded constants (idea by al3x)
arpi
parents:
1401
diff
changeset
|
631 case VFM_FFMPEG: { // FFmpeg's libavcodec |
1294 | 632 #ifndef USE_LIBAVCODEC |
1973
5216f108cb4f
all error/warn/info messages moved to help_mp-en.h for translation
arpi
parents:
1949
diff
changeset
|
633 mp_msg(MSGT_DECVIDEO,MSGL_ERR,MSGTR_NoLAVCsupport); |
1631 | 634 return 0; |
1294 | 635 #else |
4453 | 636 /* Just because we know that */ |
637 pitches[0] = 16; | |
638 pitches[1] = pitches[2] = 8; | |
1567 | 639 mp_msg(MSGT_DECVIDEO,MSGL_V,"FFmpeg's libavcodec video codec\n"); |
1654 | 640 if(!avcodec_inited){ |
641 avcodec_init(); | |
642 avcodec_register_all(); | |
643 avcodec_inited=1; | |
644 } | |
1294 | 645 lavc_codec = (AVCodec *)avcodec_find_decoder_by_name(sh_video->codec->dll); |
646 if(!lavc_codec){ | |
1973
5216f108cb4f
all error/warn/info messages moved to help_mp-en.h for translation
arpi
parents:
1949
diff
changeset
|
647 mp_msg(MSGT_DECVIDEO,MSGL_ERR,MSGTR_MissingLAVCcodec,sh_video->codec->dll); |
1631 | 648 return 0; |
1294 | 649 } |
650 memset(&lavc_context, 0, sizeof(lavc_context)); | |
1462 | 651 // sh_video->disp_h/=2; // !! |
1294 | 652 lavc_context.width=sh_video->disp_w; |
653 lavc_context.height=sh_video->disp_h; | |
1567 | 654 mp_dbg(MSGT_DECVIDEO,MSGL_DBG2,"libavcodec.size: %d x %d\n",lavc_context.width,lavc_context.height); |
3877 | 655 if (sh_video->format == mmioFOURCC('R', 'V', '1', '3')) |
656 lavc_context.sub_id = 3; | |
1294 | 657 /* open it */ |
658 if (avcodec_open(&lavc_context, lavc_codec) < 0) { | |
1973
5216f108cb4f
all error/warn/info messages moved to help_mp-en.h for translation
arpi
parents:
1949
diff
changeset
|
659 mp_msg(MSGT_DECVIDEO,MSGL_ERR, MSGTR_CantOpenCodec); |
1631 | 660 return 0; |
1294 | 661 } |
2228 | 662 #ifdef FF_POSTPROCESS |
663 lavc_pp=divx_quality; | |
664 #endif | |
1567 | 665 mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: libavcodec init OK!\n"); |
1294 | 666 break; |
667 #endif | |
668 } | |
669 | |
1410
eda16e490ae7
using AFM_/VFM_ macros instead of hardcoded constants (idea by al3x)
arpi
parents:
1401
diff
changeset
|
670 case VFM_MPEG: { |
1294 | 671 // init libmpeg2: |
2567 | 672 mpeg2_init(); |
1294 | 673 #ifdef MPEG12_POSTPROC |
674 picture->pp_options=divx_quality; | |
675 #else | |
1973
5216f108cb4f
all error/warn/info messages moved to help_mp-en.h for translation
arpi
parents:
1949
diff
changeset
|
676 if(divx_quality) mp_msg(MSGT_DECVIDEO,MSGL_HINT,MSGTR_MpegPPhint); |
1294 | 677 #endif |
4453 | 678 /* Just because we know that */ |
679 pitches[0] = 16; | |
680 pitches[1] = pitches[2] = 8; | |
2567 | 681 // send seq header to the decoder: |
682 mpeg2_decode_data(NULL,videobuffer,videobuffer+videobuf_len,0); | |
1294 | 683 mpeg2_allocate_image_buffers (picture); |
684 break; | |
685 } | |
1488 | 686 case VFM_RAW: { |
3397
39abf443aac4
vfm_raw hack: set outfmt if format != 0x0 (for tv input)
alex
parents:
3303
diff
changeset
|
687 if (sh_video->format != 0x0) |
39abf443aac4
vfm_raw hack: set outfmt if format != 0x0 (for tv input)
alex
parents:
3303
diff
changeset
|
688 /* set out_fmt */ |
39abf443aac4
vfm_raw hack: set outfmt if format != 0x0 (for tv input)
alex
parents:
3303
diff
changeset
|
689 sh_video->codec->outfmt[sh_video->outfmtidx] = sh_video->format; |
1488 | 690 break; |
691 } | |
1948 | 692 case VFM_RLE: { |
693 int bpp=((out_fmt&255)+7)/8; // RGB only | |
4188 | 694 #ifdef USE_MP_IMAGE |
695 sh_video->image->type=MP_IMGTYPE_STATIC; | |
696 #else | |
697 sh_video->our_out_buffer = (char*)memalign(64,sh_video->disp_w*sh_video->disp_h*bpp); // FIXME!!! | |
698 #endif | |
1949 | 699 if(bpp==2){ // 15 or 16 bpp ==> palette conversion! |
700 unsigned int* pal=(unsigned int*)(((char*)sh_video->bih)+40); | |
3303 | 701 int cols=(sh_video->bih->biSize-40)/4; |
702 //int cols=1<<(sh_video->bih->biBitCount); | |
1949 | 703 int i; |
704 if(cols>256) cols=256; | |
1973
5216f108cb4f
all error/warn/info messages moved to help_mp-en.h for translation
arpi
parents:
1949
diff
changeset
|
705 mp_msg(MSGT_DECVIDEO,MSGL_V,"RLE: converting palette for %d colors.\n",cols); |
1949 | 706 for(i=0;i<cols;i++){ |
707 unsigned int c=pal[i]; | |
708 unsigned int b=c&255; | |
709 unsigned int g=(c>>8)&255; | |
710 unsigned int r=(c>>16)&255; | |
711 if((out_fmt&255)==15) | |
712 pal[i]=((r>>3)<<10)|((g>>3)<<5)|((b>>3)); | |
713 else | |
714 pal[i]=((r>>3)<<11)|((g>>2)<<5)|((b>>3)); | |
715 } | |
716 } | |
1948 | 717 break; |
4687
2973e997c4a5
some obscure bug fixes to the FLI decoder, with many thanks to Roberto
melanson
parents:
4672
diff
changeset
|
718 case VFM_FLI: |
2973e997c4a5
some obscure bug fixes to the FLI decoder, with many thanks to Roberto
melanson
parents:
4672
diff
changeset
|
719 sh_video->context = init_fli_decoder(sh_video->disp_w, sh_video->disp_h); |
3687
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
720 case VFM_MSVIDC: |
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
721 case VFM_QTRLE: |
4301
8f43b10f387f
added skeleton for Duck Truemotion v1 decoder (doesn't do anything yet)
melanson
parents:
4275
diff
changeset
|
722 case VFM_DUCKTM1: |
4656 | 723 #ifdef HAVE_PNG |
724 case VFM_MPNG: | |
725 #endif | |
4615
b1fe5f58cd82
Added native codec support for QT RPZA data, courtesy of Roberto Togni
melanson
parents:
4516
diff
changeset
|
726 case VFM_QTRPZA: |
3687
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
727 { |
4188 | 728 #ifdef USE_MP_IMAGE |
729 sh_video->image->type=MP_IMGTYPE_STATIC; | |
730 #else | |
2827
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
731 int bpp=((out_fmt&255)+7)/8; // RGB only |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
732 sh_video->our_out_buffer = |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
733 (char*)memalign(64, sh_video->disp_w*sh_video->disp_h*bpp); // FIXME!!! |
4188 | 734 #endif |
3687
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
735 if ((sh_video->codec->driver == VFM_QTRLE) && (sh_video->bih->biBitCount != 24)) |
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
736 printf ( |
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
737 " *** FYI: This Quicktime file is using %d-bit RLE Animation\n" \ |
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
738 " encoding, which is not yet supported by MPlayer. But if you upload\n" \ |
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
739 " this Quicktime file to the MPlayer FTP, the team could look at it.\n", |
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
740 sh_video->bih->biBitCount); |
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
741 |
3804
53ed66a4f0bf
NuppelVideo decoder added, based on Panagiotis Issaris' patch
alex
parents:
3745
diff
changeset
|
742 break; |
3172 | 743 } |
4275
818be6ba8758
initial implementation of SMC codec; it almost works, too!
melanson
parents:
4227
diff
changeset
|
744 case VFM_QTSMC: |
818be6ba8758
initial implementation of SMC codec; it almost works, too!
melanson
parents:
4227
diff
changeset
|
745 { |
818be6ba8758
initial implementation of SMC codec; it almost works, too!
melanson
parents:
4227
diff
changeset
|
746 if (qt_init_decode_smc() != 0) |
818be6ba8758
initial implementation of SMC codec; it almost works, too!
melanson
parents:
4227
diff
changeset
|
747 mp_msg(MSGT_DECVIDEO, MSGL_ERR, "SMC decoder could not allocate enough memory"); |
818be6ba8758
initial implementation of SMC codec; it almost works, too!
melanson
parents:
4227
diff
changeset
|
748 #ifdef USE_MP_IMAGE |
818be6ba8758
initial implementation of SMC codec; it almost works, too!
melanson
parents:
4227
diff
changeset
|
749 sh_video->image->type=MP_IMGTYPE_STATIC; |
818be6ba8758
initial implementation of SMC codec; it almost works, too!
melanson
parents:
4227
diff
changeset
|
750 #else |
818be6ba8758
initial implementation of SMC codec; it almost works, too!
melanson
parents:
4227
diff
changeset
|
751 int bpp=((out_fmt&255)+7)/8; // RGB only |
818be6ba8758
initial implementation of SMC codec; it almost works, too!
melanson
parents:
4227
diff
changeset
|
752 sh_video->our_out_buffer = |
818be6ba8758
initial implementation of SMC codec; it almost works, too!
melanson
parents:
4227
diff
changeset
|
753 (char*)memalign(64, sh_video->disp_w*sh_video->disp_h*bpp); // FIXME!!! |
818be6ba8758
initial implementation of SMC codec; it almost works, too!
melanson
parents:
4227
diff
changeset
|
754 #endif |
818be6ba8758
initial implementation of SMC codec; it almost works, too!
melanson
parents:
4227
diff
changeset
|
755 break; |
818be6ba8758
initial implementation of SMC codec; it almost works, too!
melanson
parents:
4227
diff
changeset
|
756 } |
3804
53ed66a4f0bf
NuppelVideo decoder added, based on Panagiotis Issaris' patch
alex
parents:
3745
diff
changeset
|
757 case VFM_NUV: |
4188 | 758 #ifdef USE_MP_IMAGE |
759 sh_video->image->type=MP_IMGTYPE_STATIC; | |
760 #else | |
3804
53ed66a4f0bf
NuppelVideo decoder added, based on Panagiotis Issaris' patch
alex
parents:
3745
diff
changeset
|
761 sh_video->our_out_buffer = (char *)memalign(64, sh_video->disp_w*sh_video->disp_h*3/2); |
4188 | 762 #endif |
3172 | 763 break; |
3969 | 764 case VFM_CYUV: { |
4188 | 765 // int bpp=((out_fmt&255)+7)/8; |
766 #ifdef USE_MP_IMAGE | |
767 sh_video->image->type=MP_IMGTYPE_STATIC; | |
768 #else | |
3969 | 769 sh_video->our_out_buffer = |
770 (char*)memalign(64, sh_video->disp_w*sh_video->disp_h*3); | |
4188 | 771 #endif |
3969 | 772 break; |
773 } | |
1948 | 774 } |
1294 | 775 } |
1654 | 776 sh_video->inited=1; |
1294 | 777 return 1; |
778 } | |
779 | |
4494 | 780 extern int vaa_use_dr; |
4515 | 781 |
782 static int use_dr=0; | |
783 static bes_da_t bda; | |
784 void init_video_vaa( void ) | |
785 { | |
786 memset(&bda,0,sizeof(bes_da_t)); | |
787 if(vo_vaa.query_bes_da) | |
788 use_dr = vo_vaa.query_bes_da(&bda) ? 0 : 1; | |
789 if(!vaa_use_dr) use_dr = 0; | |
790 } | |
791 | |
1422 | 792 #ifdef USE_LIBVO2 |
793 int decode_video(vo2_handle_t *video_out,sh_video_t *sh_video,unsigned char *start,int in_size,int drop_frame){ | |
794 #else | |
1294 | 795 int decode_video(vo_functions_t *video_out,sh_video_t *sh_video,unsigned char *start,int in_size,int drop_frame){ |
1422 | 796 #endif |
4188 | 797 |
798 mp_image_t *mpi=sh_video->image; | |
799 unsigned int out_fmt=mpi->imgfmt; //sh_video->codec->outfmt[sh_video->outfmtidx]; | |
800 int planar=(mpi->flags&MP_IMGFLAG_PLANAR)!=0; //(out_fmt==IMGFMT_YV12||out_fmt==IMGFMT_IYUV||out_fmt==IMGFMT_I420); | |
1294 | 801 int blit_frame=0; |
4460 | 802 void *vmem; |
803 int painted; | |
804 static int double_buff_num = 0; | |
1294 | 805 |
4188 | 806 //uint8_t* planes_[3]; |
807 //uint8_t** planes=planes_; | |
808 //int stride_[3]; | |
809 //int* stride=stride_; | |
1360 | 810 |
811 unsigned int t=GetTimer(); | |
812 unsigned int t2; | |
813 | |
4515 | 814 painted = 0; |
4188 | 815 #ifdef USE_MP_IMAGE |
816 if(mpi->type!=MP_IMGTYPE_EXPORT) | |
817 if( !(mpi->flags&MP_IMGFLAG_ALLOCATED) && !(mpi->flags&MP_IMGFLAG_DIRECT) ){ | |
818 // allocate image buffer: | |
819 sh_video->our_out_buffer = (char *)memalign(64, mpi->width*mpi->height*mpi->bpp/8); | |
820 if((mpi->flags|MP_IMGFLAG_PLANAR) && (mpi->flags|MP_IMGFLAG_YUV)){ | |
821 // planar YUV | |
822 mpi->stride[0]=mpi->width; | |
823 mpi->stride[1]=mpi->stride[2]=mpi->width/2; | |
824 mpi->planes[0]=sh_video->our_out_buffer; | |
825 mpi->planes[1]=mpi->planes[0]+mpi->stride[0]*mpi->height; | |
826 mpi->planes[2]=mpi->planes[1]+mpi->stride[0]*mpi->height/4; | |
827 } else { | |
828 // packed YUV / RGB | |
829 mpi->stride[0]=mpi->width*mpi->bpp; | |
830 mpi->planes[0]=sh_video->our_out_buffer; | |
831 } | |
832 mpi->flags|=MP_IMGFLAG_ALLOCATED; | |
833 mp_msg(MSGT_DECVIDEO,MSGL_INFO,"mp_image: allocated %d bytes for %dx%dx%d [0x%X] image\n", | |
834 mpi->width*mpi->height*mpi->bpp/8, mpi->width, mpi->height, mpi->bpp, mpi->imgfmt); | |
835 } | |
836 #endif | |
837 | |
2794 | 838 //printf("decode_frame(start: %p, size: %d, w: %d, h: %d)\n", |
839 // start, in_size, sh_video->disp_w, sh_video->disp_h); | |
840 | |
1294 | 841 //-------------------- Decode a frame: ----------------------- |
842 switch(sh_video->codec->driver){ | |
3643
fb9fd7e2dd35
native opensourec Cinepak (CVID) codec by im Ferguson <timf@mail.csse.monash.edu.au>
arpi
parents:
3449
diff
changeset
|
843 case VFM_CINEPAK: |
4628
1504901deed8
Fixed FILM demuxer so that it now plays (my) FILM files
melanson
parents:
4615
diff
changeset
|
844 if (in_size == 0) |
1504901deed8
Fixed FILM demuxer so that it now plays (my) FILM files
melanson
parents:
4615
diff
changeset
|
845 blit_frame = 0; |
1504901deed8
Fixed FILM demuxer so that it now plays (my) FILM files
melanson
parents:
4615
diff
changeset
|
846 else |
1504901deed8
Fixed FILM demuxer so that it now plays (my) FILM files
melanson
parents:
4615
diff
changeset
|
847 { |
1504901deed8
Fixed FILM demuxer so that it now plays (my) FILM files
melanson
parents:
4615
diff
changeset
|
848 decode_cinepak(sh_video->context, start, in_size, sh_video->our_out_buffer, |
1504901deed8
Fixed FILM demuxer so that it now plays (my) FILM files
melanson
parents:
4615
diff
changeset
|
849 sh_video->disp_w, sh_video->disp_h, (out_fmt==IMGFMT_YUY2)?16:(out_fmt&255)); |
1504901deed8
Fixed FILM demuxer so that it now plays (my) FILM files
melanson
parents:
4615
diff
changeset
|
850 blit_frame = 3; |
1504901deed8
Fixed FILM demuxer so that it now plays (my) FILM files
melanson
parents:
4615
diff
changeset
|
851 } |
3643
fb9fd7e2dd35
native opensourec Cinepak (CVID) codec by im Ferguson <timf@mail.csse.monash.edu.au>
arpi
parents:
3449
diff
changeset
|
852 break; |
2378 | 853 #ifdef USE_XANIM |
854 case VFM_XANIM: { | |
2384 | 855 xacodec_image_t* image=xacodec_decode_frame(start,in_size,drop_frame?1:0); |
856 if(image){ | |
857 blit_frame=2; | |
4188 | 858 //planes=image->planes; |
859 //stride=image->stride; | |
860 mpi->planes[0]=image->planes[0]; | |
861 mpi->planes[1]=image->planes[1]; | |
862 mpi->planes[2]=image->planes[2]; | |
863 mpi->stride[0]=image->stride[0]; | |
864 mpi->stride[1]=image->stride[1]; | |
865 mpi->stride[2]=image->stride[2]; | |
2384 | 866 } |
2378 | 867 break; |
868 } | |
869 #endif | |
4489 | 870 #ifdef USE_DIVX |
1410
eda16e490ae7
using AFM_/VFM_ macros instead of hardcoded constants (idea by al3x)
arpi
parents:
1401
diff
changeset
|
871 case VFM_ODIVX: { |
1294 | 872 // OpenDivX |
873 DEC_FRAME dec_frame; | |
874 #ifdef NEW_DECORE | |
875 DEC_PICTURE dec_pic; | |
876 #endif | |
877 // let's decode | |
878 dec_frame.length = in_size; | |
879 dec_frame.bitstream = start; | |
1349 | 880 dec_frame.render_flag = drop_frame?0:1; |
881 | |
1294 | 882 #ifdef NEW_DECORE |
883 dec_frame.bmp=&dec_pic; | |
884 dec_pic.y=dec_pic.u=dec_pic.v=NULL; | |
1349 | 885 decore(0x123, (sh_video->format==mmioFOURCC('D','I','V','3'))?DEC_OPT_FRAME_311:DEC_OPT_FRAME, &dec_frame, NULL); |
886 #else | |
1360 | 887 opendivx_src[0]=NULL; |
1349 | 888 decore(0x123, 0, &dec_frame, NULL); |
1294 | 889 #endif |
1360 | 890 |
891 if(!drop_frame) | |
1294 | 892 |
1349 | 893 // let's display |
1294 | 894 #ifdef NEW_DECORE |
895 if(dec_pic.y){ | |
4188 | 896 mpi->planes[0]=dec_pic.y; |
897 mpi->planes[1]=dec_pic.u; | |
898 mpi->planes[2]=dec_pic.v; | |
899 mpi->stride[0]=dec_pic.stride_y; | |
900 mpi->stride[1]=mpi->stride[2]=dec_pic.stride_uv; | |
1360 | 901 blit_frame=2; |
1294 | 902 } |
903 #else | |
904 if(opendivx_src[0]){ | |
4188 | 905 // planes=opendivx_src; |
906 // stride=opendivx_stride; | |
907 mpi->planes[0]=opendivx_src[0]; | |
908 mpi->planes[1]=opendivx_src[1]; | |
909 mpi->planes[2]=opendivx_src[2]; | |
910 mpi->stride[0]=opendivx_stride[0]; | |
911 mpi->stride[1]=opendivx_stride[1]; | |
912 mpi->stride[2]=opendivx_stride[2]; | |
1360 | 913 blit_frame=2; |
1294 | 914 } |
915 #endif | |
916 | |
917 break; | |
918 } | |
4489 | 919 #endif |
1352
5ac130627602
fixed shmem size, and now compiles without divx4linux too :)
arpi
parents:
1349
diff
changeset
|
920 #ifdef NEW_DECORE |
1410
eda16e490ae7
using AFM_/VFM_ macros instead of hardcoded constants (idea by al3x)
arpi
parents:
1401
diff
changeset
|
921 case VFM_DIVX4: { |
1349 | 922 // DivX4Linux |
923 DEC_FRAME dec_frame; | |
924 // let's decode | |
925 dec_frame.length = in_size; | |
926 dec_frame.bitstream = start; | |
927 dec_frame.render_flag = drop_frame?0:1; | |
928 dec_frame.bmp=sh_video->our_out_buffer; | |
929 dec_frame.stride=sh_video->disp_w; | |
930 // printf("Decoding DivX4 frame\n"); | |
931 decore(0x123, (sh_video->format==mmioFOURCC('D','I','V','3'))?DEC_OPT_FRAME_311:DEC_OPT_FRAME, &dec_frame, NULL); | |
1360 | 932 if(!drop_frame) blit_frame=3; |
1349 | 933 break; |
934 } | |
1352
5ac130627602
fixed shmem size, and now compiles without divx4linux too :)
arpi
parents:
1349
diff
changeset
|
935 #endif |
1294 | 936 #ifdef USE_DIRECTSHOW |
1410
eda16e490ae7
using AFM_/VFM_ macros instead of hardcoded constants (idea by al3x)
arpi
parents:
1401
diff
changeset
|
937 case VFM_DSHOW: { // W32/DirectShow |
3062 | 938 if(drop_frame<2) |
4460 | 939 { |
940 /* FIXME: WILL WORK ONLY FOR PACKED FOURCC. BUT WHAT ABOUT PLANAR? */ | |
941 vmem = 0; | |
942 if(use_dr && bda.dest.pitch.y == 16) | |
943 { | |
944 vmem = bda.dga_addr + bda.offsets[0] + bda.offset.y; | |
945 if(vo_doublebuffering && bda.num_frames>1) | |
946 { | |
947 if(double_buff_num) vmem = bda.dga_addr + bda.offsets[1] + bda.offset.y; | |
948 else vmem = bda.dga_addr + bda.offsets[0] + bda.offset.y; | |
949 double_buff_num = double_buff_num ? 0 : 1; | |
950 } | |
951 } | |
952 DS_VideoDecoder_DecodeInternal(ds_vdec, start, in_size, 0, drop_frame ? 0 : vmem ? vmem : sh_video->our_out_buffer); | |
953 if(vmem) painted = 1; | |
954 } | |
1362
11673118f37f
Fix segfault in DShow video decoder. Using directshow, the
jkeil
parents:
1360
diff
changeset
|
955 if(!drop_frame && sh_video->our_out_buffer) blit_frame=3; |
1294 | 956 break; |
957 } | |
958 #endif | |
959 #ifdef USE_LIBAVCODEC | |
1410
eda16e490ae7
using AFM_/VFM_ macros instead of hardcoded constants (idea by al3x)
arpi
parents:
1401
diff
changeset
|
960 case VFM_FFMPEG: { // libavcodec |
1294 | 961 int got_picture=0; |
1567 | 962 mp_dbg(MSGT_DECVIDEO,MSGL_DBG2,"Calling ffmpeg...\n"); |
1294 | 963 if(drop_frame<2 && in_size>0){ |
964 int ret = avcodec_decode_video(&lavc_context, &lavc_picture, | |
965 &got_picture, start, in_size); | |
1489 | 966 if(verbose>1){ |
1462 | 967 unsigned char *x="???"; |
968 switch(lavc_context.pix_fmt){ | |
969 case PIX_FMT_YUV420P: x="YUV420P";break; | |
970 case PIX_FMT_YUV422: x="YUV422";break; | |
971 case PIX_FMT_RGB24: x="RGB24";break; | |
972 case PIX_FMT_BGR24: x="BGR24";break; | |
1465 | 973 #ifdef PIX_FMT_YUV422P |
1462 | 974 case PIX_FMT_YUV422P: x="YUV422P";break; |
975 case PIX_FMT_YUV444P: x="YUV444P";break; | |
1465 | 976 #endif |
1462 | 977 } |
1567 | 978 mp_dbg(MSGT_DECVIDEO,MSGL_DBG2,"DONE -> got_picture=%d format=0x%X (%s) \n",got_picture, |
1462 | 979 lavc_context.pix_fmt,x); |
980 } | |
1567 | 981 if(ret<0) mp_msg(MSGT_DECVIDEO,MSGL_WARN, "Error while decoding frame!\n"); |
1360 | 982 if(!drop_frame && got_picture){ |
1454
3e5b5be0b61d
temporary hack: YUV422P -> YUY2 converter (for ffmpeg MJPEG testing)
arpi
parents:
1431
diff
changeset
|
983 // if(!drop_frame){ |
3e5b5be0b61d
temporary hack: YUV422P -> YUY2 converter (for ffmpeg MJPEG testing)
arpi
parents:
1431
diff
changeset
|
984 if(planar){ |
2228 | 985 #ifdef FF_POSTPROCESS |
3745 | 986 #ifdef MBC |
2228 | 987 if(lavc_pp){ |
988 // postprocess | |
2291 | 989 int w=(sh_video->disp_w+15)&(~15); |
990 int h=(sh_video->disp_h+15)&(~15); | |
991 int xoff=0; //(w-sh_video->disp_w)/2; | |
992 int yoff=0; //(h-sh_video->disp_h)/2; | |
993 if(!sh_video->our_out_buffer){ | |
994 sh_video->our_out_buffer = (char*)memalign(64,w*h*3/2); | |
995 memset(sh_video->our_out_buffer,0,w*h*3/2); | |
996 } | |
4188 | 997 mpi->stride[0]=w; |
998 mpi->stride[1]=mpi->stride[2]=w/2; | |
999 mpi->planes[0]=sh_video->our_out_buffer+mpi->stride[0]*yoff+xoff; | |
1000 mpi->planes[2]=sh_video->our_out_buffer+w*h+mpi->stride[2]*(yoff>>1)+(xoff>>1); | |
1001 mpi->planes[1]=mpi->planes[2]+w*h/4; | |
2228 | 1002 postprocess(lavc_picture.data,lavc_picture.linesize[0], |
4188 | 1003 mpi->planes,mpi->stride[0], |
2228 | 1004 sh_video->disp_w,sh_video->disp_h, |
1005 &quant_store[0][0],MBC+1,lavc_pp); | |
1006 } else | |
1007 #endif | |
3745 | 1008 #endif |
2228 | 1009 { |
4188 | 1010 //planes=lavc_picture.data; |
1011 //stride=lavc_picture.linesize; | |
1012 mpi->planes[0]=lavc_picture.data[0]; | |
1013 mpi->planes[1]=lavc_picture.data[1]; | |
1014 mpi->planes[2]=lavc_picture.data[2]; | |
1015 mpi->stride[0]=lavc_picture.linesize[0]; | |
1016 mpi->stride[1]=lavc_picture.linesize[1]; | |
1017 mpi->stride[2]=lavc_picture.linesize[2]; | |
1018 | |
2228 | 1019 //stride[1]=stride[2]=0; |
1020 //stride[0]/=2; | |
1021 } | |
1022 blit_frame=2; | |
1454
3e5b5be0b61d
temporary hack: YUV422P -> YUY2 converter (for ffmpeg MJPEG testing)
arpi
parents:
1431
diff
changeset
|
1023 } else { |
3e5b5be0b61d
temporary hack: YUV422P -> YUY2 converter (for ffmpeg MJPEG testing)
arpi
parents:
1431
diff
changeset
|
1024 int y; |
3e5b5be0b61d
temporary hack: YUV422P -> YUY2 converter (for ffmpeg MJPEG testing)
arpi
parents:
1431
diff
changeset
|
1025 // temporary hack - FIXME |
3e5b5be0b61d
temporary hack: YUV422P -> YUY2 converter (for ffmpeg MJPEG testing)
arpi
parents:
1431
diff
changeset
|
1026 if(!sh_video->our_out_buffer) |
2049
df41903fd7d7
VfW stuff moved to dll_init, warnings fixed, using dll_init.h
arpi
parents:
2044
diff
changeset
|
1027 sh_video->our_out_buffer = (char*)memalign(64,sh_video->disp_w*sh_video->disp_h*2); |
1454
3e5b5be0b61d
temporary hack: YUV422P -> YUY2 converter (for ffmpeg MJPEG testing)
arpi
parents:
1431
diff
changeset
|
1028 for(y=0;y<sh_video->disp_h;y++){ |
3e5b5be0b61d
temporary hack: YUV422P -> YUY2 converter (for ffmpeg MJPEG testing)
arpi
parents:
1431
diff
changeset
|
1029 unsigned char *s0=lavc_picture.data[0]+lavc_picture.linesize[0]*y; |
3e5b5be0b61d
temporary hack: YUV422P -> YUY2 converter (for ffmpeg MJPEG testing)
arpi
parents:
1431
diff
changeset
|
1030 unsigned char *s1=lavc_picture.data[1]+lavc_picture.linesize[1]*y; |
3e5b5be0b61d
temporary hack: YUV422P -> YUY2 converter (for ffmpeg MJPEG testing)
arpi
parents:
1431
diff
changeset
|
1031 unsigned char *s2=lavc_picture.data[2]+lavc_picture.linesize[2]*y; |
3e5b5be0b61d
temporary hack: YUV422P -> YUY2 converter (for ffmpeg MJPEG testing)
arpi
parents:
1431
diff
changeset
|
1032 unsigned char *d=sh_video->our_out_buffer+y*2*sh_video->disp_w; |
3e5b5be0b61d
temporary hack: YUV422P -> YUY2 converter (for ffmpeg MJPEG testing)
arpi
parents:
1431
diff
changeset
|
1033 int x; |
3e5b5be0b61d
temporary hack: YUV422P -> YUY2 converter (for ffmpeg MJPEG testing)
arpi
parents:
1431
diff
changeset
|
1034 for(x=0;x<sh_video->disp_w/2;x++){ |
3e5b5be0b61d
temporary hack: YUV422P -> YUY2 converter (for ffmpeg MJPEG testing)
arpi
parents:
1431
diff
changeset
|
1035 d[4*x+0]=s0[2*x+0]; |
3e5b5be0b61d
temporary hack: YUV422P -> YUY2 converter (for ffmpeg MJPEG testing)
arpi
parents:
1431
diff
changeset
|
1036 d[4*x+1]=s1[x]; |
3e5b5be0b61d
temporary hack: YUV422P -> YUY2 converter (for ffmpeg MJPEG testing)
arpi
parents:
1431
diff
changeset
|
1037 d[4*x+2]=s0[2*x+1]; |
3e5b5be0b61d
temporary hack: YUV422P -> YUY2 converter (for ffmpeg MJPEG testing)
arpi
parents:
1431
diff
changeset
|
1038 d[4*x+3]=s2[x]; |
3e5b5be0b61d
temporary hack: YUV422P -> YUY2 converter (for ffmpeg MJPEG testing)
arpi
parents:
1431
diff
changeset
|
1039 } |
3e5b5be0b61d
temporary hack: YUV422P -> YUY2 converter (for ffmpeg MJPEG testing)
arpi
parents:
1431
diff
changeset
|
1040 } |
3e5b5be0b61d
temporary hack: YUV422P -> YUY2 converter (for ffmpeg MJPEG testing)
arpi
parents:
1431
diff
changeset
|
1041 blit_frame=3; |
3e5b5be0b61d
temporary hack: YUV422P -> YUY2 converter (for ffmpeg MJPEG testing)
arpi
parents:
1431
diff
changeset
|
1042 } |
3e5b5be0b61d
temporary hack: YUV422P -> YUY2 converter (for ffmpeg MJPEG testing)
arpi
parents:
1431
diff
changeset
|
1043 |
1360 | 1044 } |
1294 | 1045 } |
1046 break; | |
1047 } | |
1048 #endif | |
1517
0e9c29538a86
Use USE_WIN32DLL define instead of ARCH_X86 to decide whether or not to compile
jkeil
parents:
1496
diff
changeset
|
1049 #ifdef USE_WIN32DLL |
1410
eda16e490ae7
using AFM_/VFM_ macros instead of hardcoded constants (idea by al3x)
arpi
parents:
1401
diff
changeset
|
1050 case VFM_VFWEX: |
eda16e490ae7
using AFM_/VFM_ macros instead of hardcoded constants (idea by al3x)
arpi
parents:
1401
diff
changeset
|
1051 case VFM_VFW: |
1309
598e3047ce13
Add some preliminary support for non-x86 architectures to mplayer
jkeil
parents:
1297
diff
changeset
|
1052 { |
2049
df41903fd7d7
VfW stuff moved to dll_init, warnings fixed, using dll_init.h
arpi
parents:
2044
diff
changeset
|
1053 int ret; |
1360 | 1054 if(!in_size) break; |
4516 | 1055 /* FIXME: WILL WORK ONLY FOR PACKED FOURCC. BUT WHAT ABOUT PLANAR? */ |
1056 vmem = 0; | |
1057 if(use_dr && bda.dest.pitch.y == 16) | |
1058 { | |
1059 vmem = bda.dga_addr + bda.offsets[0] + bda.offset.y; | |
1060 if(vo_doublebuffering && bda.num_frames>1) | |
1061 { | |
1062 if(double_buff_num) vmem = bda.dga_addr + bda.offsets[1] + bda.offset.y; | |
1063 else vmem = bda.dga_addr + bda.offsets[0] + bda.offset.y; | |
1064 double_buff_num = double_buff_num ? 0 : 1; | |
1065 } | |
1066 sh_video->our_out_buffer = vmem; | |
1067 } | |
2049
df41903fd7d7
VfW stuff moved to dll_init, warnings fixed, using dll_init.h
arpi
parents:
2044
diff
changeset
|
1068 if((ret=vfw_decode_video(sh_video,start,in_size,drop_frame,(sh_video->codec->driver==VFM_VFWEX) ))){ |
df41903fd7d7
VfW stuff moved to dll_init, warnings fixed, using dll_init.h
arpi
parents:
2044
diff
changeset
|
1069 mp_msg(MSGT_DECVIDEO,MSGL_WARN,"Error decompressing frame, err=%d\n",ret); |
df41903fd7d7
VfW stuff moved to dll_init, warnings fixed, using dll_init.h
arpi
parents:
2044
diff
changeset
|
1070 break; |
df41903fd7d7
VfW stuff moved to dll_init, warnings fixed, using dll_init.h
arpi
parents:
2044
diff
changeset
|
1071 } |
4516 | 1072 if(vmem) painted=1; |
1360 | 1073 if(!drop_frame) blit_frame=3; |
1294 | 1074 break; |
1075 } | |
1309
598e3047ce13
Add some preliminary support for non-x86 architectures to mplayer
jkeil
parents:
1297
diff
changeset
|
1076 #endif |
1410
eda16e490ae7
using AFM_/VFM_ macros instead of hardcoded constants (idea by al3x)
arpi
parents:
1401
diff
changeset
|
1077 case VFM_MPEG: |
1873 | 1078 if(out_fmt==IMGFMT_MPEGPES){ |
1079 // hardware decoding: | |
1080 static vo_mpegpes_t packet; | |
1081 mpeg2_decode_data(video_out, start, start+in_size,3); // parse headers | |
1082 packet.data=start; | |
1083 packet.size=in_size-4; | |
1084 packet.timestamp=sh_video->timer*90000.0; | |
1085 packet.id=0x1E0; //+sh_video->ds->id; | |
4188 | 1086 mpi->planes[0]=(uint8_t*)(&packet); |
1873 | 1087 blit_frame=2; |
1088 } else { | |
1089 // software decoding: | |
2019
7de4eceac32f
mpeg2-interlaced patch by Ivan Kalvatchev <iive@yahoo.com>
arpi
parents:
2006
diff
changeset
|
1090 if( |
7de4eceac32f
mpeg2-interlaced patch by Ivan Kalvatchev <iive@yahoo.com>
arpi
parents:
2006
diff
changeset
|
1091 mpeg2_decode_data(video_out, start, start+in_size,drop_frame) > 0 // decode |
7de4eceac32f
mpeg2-interlaced patch by Ivan Kalvatchev <iive@yahoo.com>
arpi
parents:
2006
diff
changeset
|
1092 && (!drop_frame) |
7de4eceac32f
mpeg2-interlaced patch by Ivan Kalvatchev <iive@yahoo.com>
arpi
parents:
2006
diff
changeset
|
1093 ) blit_frame=1; |
1873 | 1094 } |
1294 | 1095 break; |
1488 | 1096 case VFM_RAW: |
2794 | 1097 // planes[0]=start; |
1098 // blit_frame=2; | |
1099 sh_video->our_out_buffer = start; | |
1100 blit_frame=3; | |
1488 | 1101 break; |
1948 | 1102 case VFM_RLE: |
1103 //void AVI_Decode_RLE8(char *image,char *delta,int tdsize, | |
1104 // unsigned int *map,int imagex,int imagey,unsigned char x11_bytes_pixel); | |
1105 AVI_Decode_RLE8(sh_video->our_out_buffer,start,in_size, | |
1106 (int*)(((char*)sh_video->bih)+40), | |
1107 sh_video->disp_w,sh_video->disp_h,((out_fmt&255)+7)/8); | |
1108 blit_frame=3; | |
1109 break; | |
2827
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
1110 case VFM_MSVIDC: |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
1111 if (sh_video->bih->biBitCount == 16) |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
1112 AVI_Decode_Video1_16( |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
1113 start, in_size, sh_video->our_out_buffer, |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
1114 sh_video->disp_w, sh_video->disp_h, |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
1115 ((out_fmt&255)+7)/8); |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
1116 else |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
1117 AVI_Decode_Video1_8( |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
1118 start, in_size, sh_video->our_out_buffer, |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
1119 sh_video->disp_w, sh_video->disp_h, |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
1120 (char *)sh_video->bih+40, ((out_fmt&255)+7)/8); |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
1121 blit_frame = 3; |
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
1122 break; |
3172 | 1123 case VFM_FLI: |
4687
2973e997c4a5
some obscure bug fixes to the FLI decoder, with many thanks to Roberto
melanson
parents:
4672
diff
changeset
|
1124 decode_fli_frame( |
3172 | 1125 start, in_size, sh_video->our_out_buffer, |
1126 sh_video->disp_w, sh_video->disp_h, | |
4687
2973e997c4a5
some obscure bug fixes to the FLI decoder, with many thanks to Roberto
melanson
parents:
4672
diff
changeset
|
1127 ((out_fmt&255)+7)/8, |
2973e997c4a5
some obscure bug fixes to the FLI decoder, with many thanks to Roberto
melanson
parents:
4672
diff
changeset
|
1128 sh_video->context); |
3172 | 1129 blit_frame = 3; |
1130 break; | |
3804
53ed66a4f0bf
NuppelVideo decoder added, based on Panagiotis Issaris' patch
alex
parents:
3745
diff
changeset
|
1131 case VFM_NUV: |
53ed66a4f0bf
NuppelVideo decoder added, based on Panagiotis Issaris' patch
alex
parents:
3745
diff
changeset
|
1132 decode_nuv( |
53ed66a4f0bf
NuppelVideo decoder added, based on Panagiotis Issaris' patch
alex
parents:
3745
diff
changeset
|
1133 start, in_size, sh_video->our_out_buffer, |
53ed66a4f0bf
NuppelVideo decoder added, based on Panagiotis Issaris' patch
alex
parents:
3745
diff
changeset
|
1134 sh_video->disp_w, sh_video->disp_h); |
53ed66a4f0bf
NuppelVideo decoder added, based on Panagiotis Issaris' patch
alex
parents:
3745
diff
changeset
|
1135 blit_frame = 3; |
53ed66a4f0bf
NuppelVideo decoder added, based on Panagiotis Issaris' patch
alex
parents:
3745
diff
changeset
|
1136 break; |
3687
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
1137 case VFM_QTRLE: |
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
1138 qt_decode_rle( |
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
1139 start, in_size, sh_video->our_out_buffer, |
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
1140 sh_video->disp_w, sh_video->disp_h, |
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
1141 sh_video->bih->biBitCount, |
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
1142 ((out_fmt&255)+7)/8); |
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
1143 blit_frame = 3; |
7fb817c9060b
This commit adds initial support for Quicktime Animation (RLE) video. It
melanson
parents:
3646
diff
changeset
|
1144 break; |
4227 | 1145 case VFM_QTSMC: |
1146 qt_decode_smc( | |
1147 start, in_size, sh_video->our_out_buffer, | |
1148 sh_video->disp_w, sh_video->disp_h, | |
4275
818be6ba8758
initial implementation of SMC codec; it almost works, too!
melanson
parents:
4227
diff
changeset
|
1149 (unsigned char *)sh_video->bih+40, |
4227 | 1150 ((out_fmt&255)+7)/8); |
1151 blit_frame = 3; | |
1152 break; | |
4301
8f43b10f387f
added skeleton for Duck Truemotion v1 decoder (doesn't do anything yet)
melanson
parents:
4275
diff
changeset
|
1153 case VFM_DUCKTM1: |
8f43b10f387f
added skeleton for Duck Truemotion v1 decoder (doesn't do anything yet)
melanson
parents:
4275
diff
changeset
|
1154 decode_duck_tm1( |
8f43b10f387f
added skeleton for Duck Truemotion v1 decoder (doesn't do anything yet)
melanson
parents:
4275
diff
changeset
|
1155 start, in_size, sh_video->our_out_buffer, |
8f43b10f387f
added skeleton for Duck Truemotion v1 decoder (doesn't do anything yet)
melanson
parents:
4275
diff
changeset
|
1156 sh_video->disp_w, sh_video->disp_h, |
8f43b10f387f
added skeleton for Duck Truemotion v1 decoder (doesn't do anything yet)
melanson
parents:
4275
diff
changeset
|
1157 ((out_fmt&255)+7)/8); |
8f43b10f387f
added skeleton for Duck Truemotion v1 decoder (doesn't do anything yet)
melanson
parents:
4275
diff
changeset
|
1158 blit_frame = 3; |
8f43b10f387f
added skeleton for Duck Truemotion v1 decoder (doesn't do anything yet)
melanson
parents:
4275
diff
changeset
|
1159 break; |
4656 | 1160 #ifdef HAVE_PNG |
1161 case VFM_MPNG: | |
1162 decode_mpng( | |
1163 start, in_size, sh_video->our_out_buffer, | |
1164 sh_video->disp_w,sh_video->disp_h, | |
4672 | 1165 ((out_fmt&255)+7)/8 |
4656 | 1166 ); |
1167 blit_frame = 3; | |
1168 break; | |
1169 #endif | |
3969 | 1170 case VFM_CYUV: |
1171 decode_cyuv(start, in_size, sh_video->our_out_buffer, | |
1172 sh_video->disp_w, sh_video->disp_h, (out_fmt==IMGFMT_YUY2)?16:(out_fmt&255)); | |
1173 blit_frame = 3; | |
1174 break; | |
4486 | 1175 case VFM_ROQVIDEO: |
1176 roq_decode_video(start, in_size, sh_video->our_out_buffer, | |
1177 sh_video->disp_w, sh_video->disp_h, sh_video->context); | |
1178 blit_frame = 3; | |
1179 break; | |
4615
b1fe5f58cd82
Added native codec support for QT RPZA data, courtesy of Roberto Togni
melanson
parents:
4516
diff
changeset
|
1180 case VFM_QTRPZA: |
b1fe5f58cd82
Added native codec support for QT RPZA data, courtesy of Roberto Togni
melanson
parents:
4516
diff
changeset
|
1181 qt_decode_rpza( |
b1fe5f58cd82
Added native codec support for QT RPZA data, courtesy of Roberto Togni
melanson
parents:
4516
diff
changeset
|
1182 start, in_size, sh_video->our_out_buffer, |
b1fe5f58cd82
Added native codec support for QT RPZA data, courtesy of Roberto Togni
melanson
parents:
4516
diff
changeset
|
1183 sh_video->disp_w, sh_video->disp_h, |
b1fe5f58cd82
Added native codec support for QT RPZA data, courtesy of Roberto Togni
melanson
parents:
4516
diff
changeset
|
1184 ((out_fmt&255)+7)/8); |
b1fe5f58cd82
Added native codec support for QT RPZA data, courtesy of Roberto Togni
melanson
parents:
4516
diff
changeset
|
1185 blit_frame = 3; |
b1fe5f58cd82
Added native codec support for QT RPZA data, courtesy of Roberto Togni
melanson
parents:
4516
diff
changeset
|
1186 break; |
1294 | 1187 } // switch |
1188 //------------------------ frame decoded. -------------------- | |
1189 | |
3160 | 1190 #ifdef ARCH_X86 |
1367 | 1191 // some codecs is broken, and doesn't restore MMX state :( |
1192 // it happens usually with broken/damaged files. | |
3144 | 1193 if(gCpuCaps.has3DNow){ |
1194 __asm __volatile ("femms\n\t":::"memory"); | |
1195 } | |
1196 else if(gCpuCaps.hasMMX){ | |
1197 __asm __volatile ("emms\n\t":::"memory"); | |
1198 } | |
3160 | 1199 #endif |
1367 | 1200 |
1360 | 1201 t2=GetTimer();t=t2-t;video_time_usage+=t*0.000001f; |
4460 | 1202 if(painted) return 1; |
1360 | 1203 switch(blit_frame){ |
1204 case 3: | |
1205 if(planar){ | |
4188 | 1206 mpi->stride[0]=sh_video->disp_w; |
1207 mpi->stride[1]=mpi->stride[2]=sh_video->disp_w/2; | |
1208 mpi->planes[0]=sh_video->our_out_buffer; | |
1209 mpi->planes[2]=mpi->planes[0]+sh_video->disp_w*sh_video->disp_h; | |
1210 mpi->planes[1]=mpi->planes[2]+sh_video->disp_w*sh_video->disp_h/4; | |
2716 | 1211 } else { |
4188 | 1212 mpi->planes[0]=sh_video->our_out_buffer; |
1213 mpi->stride[0]=sh_video->disp_w*mpi->bpp; | |
2716 | 1214 if(sh_video->bih && sh_video->bih->biSize==1064) |
4188 | 1215 mpi->planes[1]=&sh_video->bih[1]; // pointer to palette |
2716 | 1216 else |
4188 | 1217 mpi->planes[1]=NULL; |
2716 | 1218 } |
3073 | 1219 //#define VFM_RAW_POSTPROC |
1220 #ifdef VFM_RAW_POSTPROC | |
1221 if (sh_video->codec->driver == VFM_RAW) | |
1222 { | |
1223 mp_dbg(MSGT_DECVIDEO, MSGL_V, "Postprocessing raw %s!\n", | |
1224 vo_format_name(out_fmt)); | |
1225 switch(out_fmt) | |
1226 { | |
1227 case IMGFMT_YV12: | |
1228 postprocess(planes, stride[0], planes, stride[0], | |
1229 sh_video->disp_w, sh_video->disp_h, planes[0], | |
1230 0, /*0x20000*/divx_quality); | |
1231 break; | |
1232 // case IMGFMT_UYVY: | |
1233 // uyvytoyv12(start, planes[0], planes[1], planes[2], | |
1234 // sh_video->disp_w, sh_video->disp_h, stride[0], stride[1], | |
1235 // sh_video->disp_w*2); | |
1236 // postprocess(planes, stride[0], planes, stride[0], | |
1237 // sh_video->disp_w, sh_video->disp_h, planes[0], | |
1238 // 0, /*0x20000*/divx_quality); | |
1239 // break; | |
1240 default: | |
1241 mp_dbg(MSGT_DECVIDEO, MSGL_DBG2, "Unsuitable outformat (%s) for raw pp!\n", | |
1242 vo_format_name(out_fmt)); | |
1243 } | |
1244 } | |
1245 #endif | |
1360 | 1246 case 2: |
1422 | 1247 #ifdef USE_LIBVO2 |
1248 if(planar) | |
1249 vo2_draw_slice(video_out,planes,stride,sh_video->disp_w,sh_video->disp_h,0,0); | |
1250 else | |
1251 vo2_draw_frame(video_out,planes[0],sh_video->disp_w,sh_video->disp_w,sh_video->disp_h); | |
1252 #else | |
1360 | 1253 if(planar) |
4188 | 1254 video_out->draw_slice(mpi->planes,mpi->stride,sh_video->disp_w,sh_video->disp_h,0,0); |
1360 | 1255 else |
4188 | 1256 video_out->draw_frame(mpi->planes); |
1422 | 1257 #endif |
1360 | 1258 t2=GetTimer()-t2;vout_time_usage+=t2*0.000001f; |
1259 blit_frame=1; | |
1260 break; | |
1261 } | |
1262 | |
1294 | 1263 return blit_frame; |
1264 } | |
1375
dbcb5b5e1fae
file-format detection stuff moved out from mplayer.c to demuxer.c and dec_video.c
arpi
parents:
1367
diff
changeset
|
1265 |
2827
b4d46817f050
ms video1 (cram) codecs by Mike Melanson <melanson@pcisys.net>
arpi
parents:
2794
diff
changeset
|
1266 |