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