[Mplayer-cvslog] CVS: main mplayer.c,1.12,1.13

GEREOFFY arpi_esp at users.sourceforge.net
Fri Mar 16 00:21:42 CET 2001


Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv18781

Modified Files:
	mplayer.c 
Log Message:
using setjmp/longjmp to handle sig11 in libmpeg2

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** mplayer.c	2001/03/15 19:38:34	1.12
--- mplayer.c	2001/03/15 23:21:40	1.13
***************
*** 131,134 ****
--- 131,136 ----
  
  //**************************************************************************//
+ //             Input media streaming & demultiplexer:
+ //**************************************************************************//
  
  #include "stream.c"
***************
*** 144,147 ****
--- 146,153 ----
  #include "parse_es.c"
  
+ //**************************************************************************//
+ //             Audio codecs:
+ //**************************************************************************//
+ 
  //int mp3_read(char *buf,int size){
  int mplayer_audio_read(char *buf,int size){
***************
*** 164,176 ****
  #include "xa/xa_gsm.h"
  
  unsigned char *opendivx_src[3];
  int opendivx_stride[3];
  
  void convert_linux(unsigned char *puc_y, int stride_y,
  	unsigned char *puc_u, unsigned char *puc_v, int stride_uv,
  	unsigned char *bmp, int width_y, int height_y){
  
- //    vo_functions_t *video_out=(vo_functions_t *) bmp;
- 
  //    printf("convert_yuv called  %dx%d  stride: %d,%d\n",width_y,height_y,stride_y,stride_uv);
  
--- 170,185 ----
  #include "xa/xa_gsm.h"
  
+ //**************************************************************************//
+ //             The OpenDivX stuff:
+ //**************************************************************************//
+ 
  unsigned char *opendivx_src[3];
  int opendivx_stride[3];
  
+ // callback, the opendivx decoder calls this for each frame:
  void convert_linux(unsigned char *puc_y, int stride_y,
  	unsigned char *puc_u, unsigned char *puc_v, int stride_uv,
  	unsigned char *bmp, int width_y, int height_y){
  
  //    printf("convert_yuv called  %dx%d  stride: %d,%d\n",width_y,height_y,stride_y,stride_uv);
  
***************
*** 983,986 ****
--- 992,996 ----
     mpeg2_allocate_image_buffers (picture);
     if(verbose) printf("INFO: mpeg2_init_video() OK!\n");
+ #ifdef HAVE_CODECCTRL
     // ====== Init MPEG codec process ============
     make_pipe(&control_fifo,&control_fifo2);
***************
*** 990,993 ****
--- 1000,1004 ----
       mpeg_codec_controller(video_out); // this one is running in a new process!!!!
     signal(SIGPIPE,SIG_IGN);  // Ignore "Broken pipe" signal (codec restarts)
+ #endif
  }
  
***************
*** 1483,1486 ****
--- 1494,1561 ----
    }
    case 1: {
+ #ifndef HAVE_CODECCTRL
+ 
+         int in_frame=0;
+         videobuf_len=0;
+         while(videobuf_len<VIDEOBUFFER_SIZE-MAX_VIDEO_PACKET_SIZE){
+           int i=sync_video_packet(d_video);
+           if(in_frame){
+             if(i<0x101 || i>=0x1B0){  // not slice code -> end of frame
+               // send END OF FRAME code:
+ #if 1
+               videobuffer[videobuf_len+0]=0;
+               videobuffer[videobuf_len+1]=0;
+               videobuffer[videobuf_len+2]=1;
+               videobuffer[videobuf_len+3]=0xFF;
+               videobuf_len+=4;
+ #endif
+               if(!i) eof=1; // EOF
+               break;
+             }
+           } else {
+             //if(i==0x100) in_frame=1; // picture startcode
+             if(i>=0x101 && i<0x1B0) in_frame=1; // picture startcode
+             else if(!i){ eof=1; break;} // EOF
+           }
+ 	  if(grab_frames==2 && (i==0x1B3 || i==0x1B8)) grab_frames=1;
+           if(!read_video_packet(d_video)){ eof=1; break;} // EOF
+           //printf("read packet 0x%X, len=%d\n",i,videobuf_len);
+         }
+         
+         if(videobuf_len>max_framesize) max_framesize=videobuf_len; // debug
+         //printf("--- SEND %d bytes\n",videobuf_len);
+ 	if(grab_frames==1){
+ 	      FILE *f=fopen("grab.mpg","ab");
+ 	      fwrite(videobuffer,videobuf_len-4,1,f);
+ 	      fclose(f);
+ 	}
+         ++dbg_es_sent;
+         //if(videobuf_len>4) 
+         //my_write(data_fifo,(char*) &videobuf_len,4);
+         
+         { int t=0;
+           int x;
+           float l;
+           t-=GetTimer();
+           mpeg2_decode_data(video_out, videobuffer, videobuffer+videobuf_len);
+           t+=GetTimer();
+           //*** CMD=0 : Frame completed ***
+           //send_cmd(control_fifo2,0); // FRAME_COMPLETED command
+           x=frameratecode2framerate[picture->frame_rate_code]; //fps
+           ++dbg_es_rcvd;
+           l=(100+picture->repeat_count)*0.01f;
+           num_frames+=l;
+           picture->repeat_count=0;
+           video_time_usage+=t*0.000001;
+           if(x && !force_fps) default_fps=x*0.0001f;
+           if(!force_redraw){
+             // increase video timers:
+             v_frame+=l/default_fps;
+             v_pts+=l/default_fps;
+           }
+         }
+         //if(eof) break;
+ 
+ #else
      while(1){
        int x;
***************
*** 1567,1570 ****
--- 1642,1646 ----
          printf("invalid cmd: 0x%X\n",x);
      }
+ #endif
      break;
    }


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list