Mercurial > mplayer.hg
comparison dec_video.c @ 1567:5c7760aa4f94
printf->mp_msg/mp_dbg
author | arpi |
---|---|
date | Fri, 17 Aug 2001 00:40:25 +0000 |
parents | 4b0046db8e64 |
children | 09284c9c2b49 |
comparison
equal
deleted
inserted
replaced
1566:913c1ee56b4f | 1567:5c7760aa4f94 |
---|---|
2 #include <stdio.h> | 2 #include <stdio.h> |
3 #include <stdlib.h> | 3 #include <stdlib.h> |
4 #include <unistd.h> | 4 #include <unistd.h> |
5 | 5 |
6 #include "config.h" | 6 #include "config.h" |
7 #include "mp_msg.h" | |
7 | 8 |
8 extern int verbose; // defined in mplayer.c | 9 extern int verbose; // defined in mplayer.c |
9 extern int divx_quality; | 10 extern int divx_quality; |
10 | 11 |
11 extern double video_time_usage; | 12 extern double video_time_usage; |
150 if(!init_video_codec(sh_video,0)) { | 151 if(!init_video_codec(sh_video,0)) { |
151 // GUI_MSG( mplUnknowError ) | 152 // GUI_MSG( mplUnknowError ) |
152 // exit(1); | 153 // exit(1); |
153 return 0; | 154 return 0; |
154 } | 155 } |
155 if(verbose) printf("INFO: Win32 video codec init OK!\n"); | 156 mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: Win32 video codec init OK!\n"); |
156 break; | 157 break; |
157 } | 158 } |
158 case VFM_VFWEX: { | 159 case VFM_VFWEX: { |
159 if(!init_video_codec(sh_video,1)) { | 160 if(!init_video_codec(sh_video,1)) { |
160 // GUI_MSG( mplUnknowError ) | 161 // GUI_MSG( mplUnknowError ) |
161 // exit(1); | 162 // exit(1); |
162 return 0; | 163 return 0; |
163 } | 164 } |
164 if(verbose) printf("INFO: Win32Ex video codec init OK!\n"); | 165 mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: Win32Ex video codec init OK!\n"); |
165 break; | 166 break; |
166 } | 167 } |
167 case VFM_DSHOW: { // Win32/DirectShow | 168 case VFM_DSHOW: { // Win32/DirectShow |
168 #ifndef USE_DIRECTSHOW | 169 #ifndef USE_DIRECTSHOW |
169 fprintf(stderr,"MPlayer was compiled WITHOUT directshow support!\n"); | 170 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"MPlayer was compiled WITHOUT directshow support!\n"); |
170 return 0; | 171 return 0; |
171 // GUI_MSG( mplCompileWithoutDSSupport ) | 172 // GUI_MSG( mplCompileWithoutDSSupport ) |
172 // exit(1); | 173 // exit(1); |
173 #else | 174 #else |
174 int bpp; | 175 int bpp; |
175 if(DS_VideoDecoder_Open(sh_video->codec->dll,&sh_video->codec->guid, sh_video->bih, 0, &sh_video->our_out_buffer)){ | 176 if(DS_VideoDecoder_Open(sh_video->codec->dll,&sh_video->codec->guid, sh_video->bih, 0, &sh_video->our_out_buffer)){ |
176 // if(DS_VideoDecoder_Open(sh_video->codec->dll,&sh_video->codec->guid, sh_video->bih, 0, NULL)){ | 177 // if(DS_VideoDecoder_Open(sh_video->codec->dll,&sh_video->codec->guid, sh_video->bih, 0, NULL)){ |
177 printf("ERROR: Couldn't open required DirectShow codec: %s\n",sh_video->codec->dll); | 178 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"ERROR: Couldn't open required DirectShow codec: %s\n",sh_video->codec->dll); |
178 printf("Maybe you forget to upgrade your win32 codecs?? It's time to download the new\n"); | 179 mp_msg(MSGT_DECVIDEO,MSGL_HINT,"Maybe you forget to upgrade your win32 codecs?? It's time to download the new\n"); |
179 printf("package from: ftp://thot.banki.hu/esp-team/linux/MPlayer/w32codec.zip !\n"); | 180 mp_msg(MSGT_DECVIDEO,MSGL_HINT,"package from: ftp://mplayerhq.hu/MPlayer/releases/w32codec.zip !\n"); |
180 printf("Or you should disable DShow support: make distclean;make -f Makefile.No-DS\n"); | 181 // mp_msg(MSGT_DECVIDEO,MSGL_HINT,"Or you should disable DShow support: make distclean;make -f Makefile.No-DS\n"); |
181 return 0; | 182 return 0; |
182 // #ifdef HAVE_GUI | 183 // #ifdef HAVE_GUI |
183 // if ( !nogui ) | 184 // if ( !nogui ) |
184 // { | 185 // { |
185 // strcpy( mplShMem->items.videodata.codecdll,sh_video->codec->dll ); | 186 // strcpy( mplShMem->items.videodata.codecdll,sh_video->codec->dll ); |
211 | 212 |
212 DS_SetAttr_DivX("Quality",divx_quality); | 213 DS_SetAttr_DivX("Quality",divx_quality); |
213 // printf("DivX setting result = %d\n", DS_SetAttr_DivX("Quality",divx_quality) ); | 214 // printf("DivX setting result = %d\n", DS_SetAttr_DivX("Quality",divx_quality) ); |
214 // printf("DivX setting result = %d\n", DS_SetValue_DivX("Brightness",60) ); | 215 // printf("DivX setting result = %d\n", DS_SetValue_DivX("Brightness",60) ); |
215 | 216 |
216 if(verbose) printf("INFO: Win32/DShow video codec init OK!\n"); | 217 mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: Win32/DShow video codec init OK!\n"); |
217 break; | 218 break; |
218 #endif | 219 #endif |
219 } | 220 } |
220 #else /* !USE_WIN32DLL */ | 221 #else /* !USE_WIN32DLL */ |
221 case VFM_VFW: | 222 case VFM_VFW: |
222 case VFM_DSHOW: | 223 case VFM_DSHOW: |
223 case VFM_VFWEX: | 224 case VFM_VFWEX: |
224 fprintf(stderr,"Support for win32 codecs disabled, or unavailable on non-x86 platforms!\n"); | 225 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Support for win32 codecs disabled, or unavailable on non-x86 platforms!\n"); |
225 return 0; | 226 return 0; |
226 #endif /* !USE_WIN32DLL */ | 227 #endif /* !USE_WIN32DLL */ |
227 case VFM_ODIVX: { // OpenDivX | 228 case VFM_ODIVX: { // OpenDivX |
228 if(verbose) printf("OpenDivX video codec\n"); | 229 mp_msg(MSGT_DECVIDEO,MSGL_V,"OpenDivX video codec\n"); |
229 { DEC_PARAM dec_param; | 230 { DEC_PARAM dec_param; |
230 DEC_SET dec_set; | 231 DEC_SET dec_set; |
231 memset(&dec_param,0,sizeof(dec_param)); | 232 memset(&dec_param,0,sizeof(dec_param)); |
232 #ifdef NEW_DECORE | 233 #ifdef NEW_DECORE |
233 dec_param.output_format=DEC_USER; | 234 dec_param.output_format=DEC_USER; |
238 dec_param.y_dim = sh_video->bih->biHeight; | 239 dec_param.y_dim = sh_video->bih->biHeight; |
239 decore(0x123, DEC_OPT_INIT, &dec_param, NULL); | 240 decore(0x123, DEC_OPT_INIT, &dec_param, NULL); |
240 dec_set.postproc_level = divx_quality; | 241 dec_set.postproc_level = divx_quality; |
241 decore(0x123, DEC_OPT_SETPP, &dec_set, NULL); | 242 decore(0x123, DEC_OPT_SETPP, &dec_set, NULL); |
242 } | 243 } |
243 if(verbose) printf("INFO: OpenDivX video codec init OK!\n"); | 244 mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: OpenDivX video codec init OK!\n"); |
244 break; | 245 break; |
245 } | 246 } |
246 case VFM_DIVX4: { // DivX4Linux | 247 case VFM_DIVX4: { // DivX4Linux |
247 #ifndef NEW_DECORE | 248 #ifndef NEW_DECORE |
248 fprintf(stderr,"MPlayer was compiled WITHOUT DivX4Linux (libdivxdecore.so) support!\n"); | 249 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"MPlayer was compiled WITHOUT DivX4Linux (libdivxdecore.so) support!\n"); |
249 return 0; //exit(1); | 250 return 0; //exit(1); |
250 #else | 251 #else |
251 if(verbose) printf("DivX4Linux video codec\n"); | 252 mp_msg(MSGT_DECVIDEO,MSGL_V,"DivX4Linux video codec\n"); |
252 { DEC_PARAM dec_param; | 253 { DEC_PARAM dec_param; |
253 DEC_SET dec_set; | 254 DEC_SET dec_set; |
254 int bits=16; | 255 int bits=16; |
255 memset(&dec_param,0,sizeof(dec_param)); | 256 memset(&dec_param,0,sizeof(dec_param)); |
256 switch(out_fmt){ | 257 switch(out_fmt){ |
261 case IMGFMT_BGR15: dec_param.output_format=DEC_RGB555_INV;break; | 262 case IMGFMT_BGR15: dec_param.output_format=DEC_RGB555_INV;break; |
262 case IMGFMT_BGR16: dec_param.output_format=DEC_RGB565_INV;break; | 263 case IMGFMT_BGR16: dec_param.output_format=DEC_RGB565_INV;break; |
263 case IMGFMT_BGR24: dec_param.output_format=DEC_RGB24_INV;bits=24;break; | 264 case IMGFMT_BGR24: dec_param.output_format=DEC_RGB24_INV;bits=24;break; |
264 case IMGFMT_BGR32: dec_param.output_format=DEC_RGB32_INV;bits=32;break; | 265 case IMGFMT_BGR32: dec_param.output_format=DEC_RGB32_INV;bits=32;break; |
265 default: | 266 default: |
266 fprintf(stderr,"Unsupported out_fmt: 0x%X\n",out_fmt); | 267 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Unsupported out_fmt: 0x%X\n",out_fmt); |
267 return 0; | 268 return 0; |
268 } | 269 } |
269 dec_param.x_dim = sh_video->bih->biWidth; | 270 dec_param.x_dim = sh_video->bih->biWidth; |
270 dec_param.y_dim = sh_video->bih->biHeight; | 271 dec_param.y_dim = sh_video->bih->biHeight; |
271 decore(0x123, DEC_OPT_INIT, &dec_param, NULL); | 272 decore(0x123, DEC_OPT_INIT, &dec_param, NULL); |
272 dec_set.postproc_level = divx_quality; | 273 dec_set.postproc_level = divx_quality; |
273 decore(0x123, DEC_OPT_SETPP, &dec_set, NULL); | 274 decore(0x123, DEC_OPT_SETPP, &dec_set, NULL); |
274 sh_video->our_out_buffer = shmem_alloc(((bits*dec_param.x_dim+7)/8)*dec_param.y_dim); | 275 sh_video->our_out_buffer = shmem_alloc(((bits*dec_param.x_dim+7)/8)*dec_param.y_dim); |
275 // sh_video->our_out_buffer = shmem_alloc(dec_param.x_dim*dec_param.y_dim*5); | 276 // sh_video->our_out_buffer = shmem_alloc(dec_param.x_dim*dec_param.y_dim*5); |
276 } | 277 } |
277 if(verbose) printf("INFO: OpenDivX video codec init OK!\n"); | 278 mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: OpenDivX video codec init OK!\n"); |
278 break; | 279 break; |
279 #endif | 280 #endif |
280 } | 281 } |
281 case VFM_FFMPEG: { // FFmpeg's libavcodec | 282 case VFM_FFMPEG: { // FFmpeg's libavcodec |
282 #ifndef USE_LIBAVCODEC | 283 #ifndef USE_LIBAVCODEC |
283 fprintf(stderr,"MPlayer was compiled WITHOUT libavcodec support!\n"); | 284 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"MPlayer was compiled WITHOUT libavcodec support!\n"); |
284 return 0; //exit(1); | 285 return 0; //exit(1); |
285 #else | 286 #else |
286 if(verbose) printf("FFmpeg's libavcodec video codec\n"); | 287 mp_msg(MSGT_DECVIDEO,MSGL_V,"FFmpeg's libavcodec video codec\n"); |
287 avcodec_init(); | 288 avcodec_init(); |
288 avcodec_register_all(); | 289 avcodec_register_all(); |
289 lavc_codec = (AVCodec *)avcodec_find_decoder_by_name(sh_video->codec->dll); | 290 lavc_codec = (AVCodec *)avcodec_find_decoder_by_name(sh_video->codec->dll); |
290 if(!lavc_codec){ | 291 if(!lavc_codec){ |
291 fprintf(stderr,"Can't find codec '%s' in libavcodec...\n",sh_video->codec->dll); | 292 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Can't find codec '%s' in libavcodec...\n",sh_video->codec->dll); |
292 return 0; //exit(1); | 293 return 0; //exit(1); |
293 } | 294 } |
294 memset(&lavc_context, 0, sizeof(lavc_context)); | 295 memset(&lavc_context, 0, sizeof(lavc_context)); |
295 // sh_video->disp_h/=2; // !! | 296 // sh_video->disp_h/=2; // !! |
296 lavc_context.width=sh_video->disp_w; | 297 lavc_context.width=sh_video->disp_w; |
297 lavc_context.height=sh_video->disp_h; | 298 lavc_context.height=sh_video->disp_h; |
298 printf("libavcodec.size: %d x %d\n",lavc_context.width,lavc_context.height); | 299 mp_dbg(MSGT_DECVIDEO,MSGL_DBG2,"libavcodec.size: %d x %d\n",lavc_context.width,lavc_context.height); |
299 /* open it */ | 300 /* open it */ |
300 if (avcodec_open(&lavc_context, lavc_codec) < 0) { | 301 if (avcodec_open(&lavc_context, lavc_codec) < 0) { |
301 fprintf(stderr, "could not open codec\n"); | 302 mp_msg(MSGT_DECVIDEO,MSGL_ERR, "could not open codec\n"); |
302 return 0; //exit(1); | 303 return 0; //exit(1); |
303 } | 304 } |
304 | 305 |
305 if(verbose) printf("INFO: libavcodec init OK!\n"); | 306 mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: libavcodec init OK!\n"); |
306 break; | 307 break; |
307 #endif | 308 #endif |
308 } | 309 } |
309 | 310 |
310 case VFM_MPEG: { | 311 case VFM_MPEG: { |
311 // init libmpeg2: | 312 // init libmpeg2: |
312 #ifdef MPEG12_POSTPROC | 313 #ifdef MPEG12_POSTPROC |
313 picture->pp_options=divx_quality; | 314 picture->pp_options=divx_quality; |
314 #else | 315 #else |
315 if(divx_quality){ | 316 if(divx_quality){ |
316 printf("WARNING! You requested image postprocessing for an MPEG 1/2 video,\n"); | 317 mp_msg(MSGT_DECVIDEO,MSGL_HINT,"WARNING! You requested image postprocessing for an MPEG 1/2 video,\n"); |
317 printf(" but compiled MPlayer without MPEG 1/2 postprocessing support!\n"); | 318 mp_msg(MSGT_DECVIDEO,MSGL_HINT," but compiled MPlayer without MPEG 1/2 postprocessing support!\n"); |
318 printf(" #define MPEG12_POSTPROC in config.h, and recompile libmpeg2!\n"); | 319 mp_msg(MSGT_DECVIDEO,MSGL_HINT," #define MPEG12_POSTPROC in config.h, and recompile libmpeg2!\n"); |
319 } | 320 } |
320 #endif | 321 #endif |
321 mpeg2_allocate_image_buffers (picture); | 322 mpeg2_allocate_image_buffers (picture); |
322 break; | 323 break; |
323 } | 324 } |
413 } | 414 } |
414 #endif | 415 #endif |
415 #ifdef USE_LIBAVCODEC | 416 #ifdef USE_LIBAVCODEC |
416 case VFM_FFMPEG: { // libavcodec | 417 case VFM_FFMPEG: { // libavcodec |
417 int got_picture=0; | 418 int got_picture=0; |
418 if(verbose>1) printf("Calling ffmpeg...\n"); | 419 mp_dbg(MSGT_DECVIDEO,MSGL_DBG2,"Calling ffmpeg...\n"); |
419 if(drop_frame<2 && in_size>0){ | 420 if(drop_frame<2 && in_size>0){ |
420 int ret = avcodec_decode_video(&lavc_context, &lavc_picture, | 421 int ret = avcodec_decode_video(&lavc_context, &lavc_picture, |
421 &got_picture, start, in_size); | 422 &got_picture, start, in_size); |
422 if(verbose>1){ | 423 if(verbose>1){ |
423 unsigned char *x="???"; | 424 unsigned char *x="???"; |
429 #ifdef PIX_FMT_YUV422P | 430 #ifdef PIX_FMT_YUV422P |
430 case PIX_FMT_YUV422P: x="YUV422P";break; | 431 case PIX_FMT_YUV422P: x="YUV422P";break; |
431 case PIX_FMT_YUV444P: x="YUV444P";break; | 432 case PIX_FMT_YUV444P: x="YUV444P";break; |
432 #endif | 433 #endif |
433 } | 434 } |
434 printf("DONE -> got_picture=%d format=0x%X (%s) \n",got_picture, | 435 mp_dbg(MSGT_DECVIDEO,MSGL_DBG2,"DONE -> got_picture=%d format=0x%X (%s) \n",got_picture, |
435 lavc_context.pix_fmt,x); | 436 lavc_context.pix_fmt,x); |
436 } | 437 } |
437 if(ret<0) fprintf(stderr, "Error while decoding frame!\n"); | 438 if(ret<0) mp_msg(MSGT_DECVIDEO,MSGL_WARN, "Error while decoding frame!\n"); |
438 if(!drop_frame && got_picture){ | 439 if(!drop_frame && got_picture){ |
439 // if(!drop_frame){ | 440 // if(!drop_frame){ |
440 if(planar){ | 441 if(planar){ |
441 planes=lavc_picture.data; | 442 planes=lavc_picture.data; |
442 stride=lavc_picture.linesize; | 443 stride=lavc_picture.linesize; |
496 ( (drop_frame==2 && !(sh_video->ds->flags&1))?(ICDECOMPRESS_HURRYUP|ICDECOMPRESS_PREROL):0 ) , | 497 ( (drop_frame==2 && !(sh_video->ds->flags&1))?(ICDECOMPRESS_HURRYUP|ICDECOMPRESS_PREROL):0 ) , |
497 sh_video->bih, start, | 498 sh_video->bih, start, |
498 &sh_video->o_bih, | 499 &sh_video->o_bih, |
499 drop_frame ? 0 : sh_video->our_out_buffer); | 500 drop_frame ? 0 : sh_video->our_out_buffer); |
500 | 501 |
501 if(ret){ printf("Error decompressing frame, err=%d\n",(int)ret);break; } | 502 if(ret){ mp_msg(MSGT_DECVIDEO,MSGL_WARN,"Error decompressing frame, err=%d\n",(int)ret);break; } |
502 | 503 |
503 if(!drop_frame) blit_frame=3; | 504 if(!drop_frame) blit_frame=3; |
504 break; | 505 break; |
505 } | 506 } |
506 #endif | 507 #endif |
568 break; | 569 break; |
569 } | 570 } |
570 case DEMUXER_TYPE_MPEG_ES: | 571 case DEMUXER_TYPE_MPEG_ES: |
571 case DEMUXER_TYPE_MPEG_PS: { | 572 case DEMUXER_TYPE_MPEG_PS: { |
572 // Find sequence_header first: | 573 // Find sequence_header first: |
573 if(verbose) printf("Searching for sequence header... ");fflush(stdout); | 574 mp_msg(MSGT_DECVIDEO,MSGL_V,"Searching for sequence header... ");fflush(stdout); |
574 while(1){ | 575 while(1){ |
575 int i=sync_video_packet(d_video); | 576 int i=sync_video_packet(d_video); |
576 if(i==0x1B3) break; // found it! | 577 if(i==0x1B3) break; // found it! |
577 if(!i || !skip_video_packet(d_video)){ | 578 if(!i || !skip_video_packet(d_video)){ |
578 if(verbose) printf("NONE :(\n"); | 579 if(verbose) mp_msg(MSGT_DECVIDEO,MSGL_V,"NONE :(\n"); |
579 fprintf(stderr,"MPEG: FATAL: EOF while searching for sequence header\n"); | 580 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"MPEG: FATAL: EOF while searching for sequence header\n"); |
580 return 0; | 581 return 0; |
581 // GUI_MSG( mplMPEGErrorSeqHeaderSearch ) | 582 // GUI_MSG( mplMPEGErrorSeqHeaderSearch ) |
582 // exit(1); | 583 // exit(1); |
583 } | 584 } |
584 } | 585 } |
585 if(verbose) printf("OK!\n"); | 586 mp_msg(MSGT_DECVIDEO,MSGL_V,"OK!\n"); |
586 // sh_video=d_video->sh;sh_video->ds=d_video; | 587 // sh_video=d_video->sh;sh_video->ds=d_video; |
587 mpeg2_init(); | 588 mpeg2_init(); |
588 // ========= Read & process sequence header & extension ============ | 589 // ========= Read & process sequence header & extension ============ |
589 videobuffer=shmem_alloc(VIDEOBUFFER_SIZE); | 590 videobuffer=shmem_alloc(VIDEOBUFFER_SIZE); |
590 if(!videobuffer){ | 591 if(!videobuffer){ |
591 fprintf(stderr,"Cannot allocate shared memory\n"); | 592 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Cannot allocate shared memory\n"); |
592 return 0; | 593 return 0; |
593 // GUI_MSG( mplErrorShMemAlloc ) | 594 // GUI_MSG( mplErrorShMemAlloc ) |
594 // exit(0); | 595 // exit(0); |
595 } | 596 } |
596 videobuf_len=0; | 597 videobuf_len=0; |
597 if(!read_video_packet(d_video)){ | 598 if(!read_video_packet(d_video)){ |
598 fprintf(stderr,"FATAL: Cannot read sequence header!\n"); | 599 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"FATAL: Cannot read sequence header!\n"); |
599 return 0; | 600 return 0; |
600 // GUI_MSG( mplMPEGErrorCannotReadSeqHeader ) | 601 // GUI_MSG( mplMPEGErrorCannotReadSeqHeader ) |
601 // exit(1); | 602 // exit(1); |
602 } | 603 } |
603 if(header_process_sequence_header (picture, &videobuffer[4])) { | 604 if(header_process_sequence_header (picture, &videobuffer[4])) { |
604 printf ("bad sequence header!\n"); | 605 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"bad sequence header!\n"); |
605 return 0; | 606 return 0; |
606 // GUI_MSG( mplMPEGErrorBadSeqHeader ) | 607 // GUI_MSG( mplMPEGErrorBadSeqHeader ) |
607 // exit(1); | 608 // exit(1); |
608 } | 609 } |
609 if(sync_video_packet(d_video)==0x1B5){ // next packet is seq. ext. | 610 if(sync_video_packet(d_video)==0x1B5){ // next packet is seq. ext. |
610 // videobuf_len=0; | 611 // videobuf_len=0; |
611 int pos=videobuf_len; | 612 int pos=videobuf_len; |
612 if(!read_video_packet(d_video)){ | 613 if(!read_video_packet(d_video)){ |
613 fprintf(stderr,"FATAL: Cannot read sequence header extension!\n"); | 614 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"FATAL: Cannot read sequence header extension!\n"); |
614 return 0; | 615 return 0; |
615 // GUI_MSG( mplMPEGErrorCannotReadSeqHeaderExt ) | 616 // GUI_MSG( mplMPEGErrorCannotReadSeqHeaderExt ) |
616 // exit(1); | 617 // exit(1); |
617 } | 618 } |
618 if(header_process_extension (picture, &videobuffer[pos+4])) { | 619 if(header_process_extension (picture, &videobuffer[pos+4])) { |
619 printf ("bad sequence header extension!\n"); | 620 mp_msg(MSGT_DECVIDEO,MSGL_ERR,"bad sequence header extension!\n"); |
620 return 0; | 621 return 0; |
621 // GUI_MSG( mplMPEGErrorBadSeqHeaderExt ) | 622 // GUI_MSG( mplMPEGErrorBadSeqHeaderExt ) |
622 // exit(1); | 623 // exit(1); |
623 } | 624 } |
624 } | 625 } |
638 sh_video->disp_h=picture->display_picture_height; | 639 sh_video->disp_h=picture->display_picture_height; |
639 // bitrate: | 640 // bitrate: |
640 if(picture->bitrate!=0x3FFFF) // unspecified/VBR ? | 641 if(picture->bitrate!=0x3FFFF) // unspecified/VBR ? |
641 sh_video->i_bps=1000*picture->bitrate/16; | 642 sh_video->i_bps=1000*picture->bitrate/16; |
642 // info: | 643 // info: |
643 if(verbose) printf("mpeg bitrate: %d (%X)\n",picture->bitrate,picture->bitrate); | 644 mp_dbg(MSGT_DECVIDEO,MSGL_DBG2,"mpeg bitrate: %d (%X)\n",picture->bitrate,picture->bitrate); |
644 printf("VIDEO: %s %dx%d (aspect %d) %4.2f fps %5.1f kbps (%4.1f kbyte/s)\n", | 645 mp_msg(MSGT_DECVIDEO,MSGL_INFO,"VIDEO: %s %dx%d (aspect %d) %4.2f fps %5.1f kbps (%4.1f kbyte/s)\n", |
645 picture->mpeg1?"MPEG1":"MPEG2", | 646 picture->mpeg1?"MPEG1":"MPEG2", |
646 sh_video->disp_w,sh_video->disp_h, | 647 sh_video->disp_w,sh_video->disp_h, |
647 picture->aspect_ratio_information, | 648 picture->aspect_ratio_information, |
648 sh_video->fps, | 649 sh_video->fps, |
649 picture->bitrate*0.5f, | 650 picture->bitrate*0.5f, |