[MPlayer-dev-eng] A minor patch to the RTP streaming code

Arpi arpi at thot.banki.hu
Fri Aug 9 19:40:03 CEST 2002


Hi,

>  	  sh_video_t* sh_video = new_sh_video(demuxer,0);
> +	  BITMAPINFOHEADER* bih
> +	    = (BITMAPINFOHEADER*)calloc(1,sizeof(BITMAPINFOHEADER));
> +	  bih->biSize = sizeof(BITMAPINFOHEADER);
> +	  sh_video->bih = bih;
>  	  demux_stream_t* d_video = demuxer->video;
>  	  d_video->sh = sh_video; sh_video->ds = d_video;
>  
> -	  // Map known video MIME types to the format code that this prog uses:
> +	  // Map known video MIME types to the BITMAPINFOHEADER parameters
> +	  // that this program uses.  (Note that not all types need all
> +	  // of the parameters to be set.)

you should fill every field of BITMAPINFOHEADER, but at least width, height,
set depth to 24, planes to 1, imagesize to 3*width*height

>  	  if (strcmp(subsession->codecName(), "MPA") == 0 ||
>  	      strcmp(subsession->codecName(), "MPA-ROBUST") == 0 ||
>  	      strcmp(subsession->codecName(), "X-MP3-DRAFT-00") == 0) {
> -	    sh_audio->format = 0x50;
> +	    wf->wFormatTag = sh_audio->format = 0x50;
> +	    wf->nSamplesPerSec = 0; // sample rate is deduced from the data

0x50 is mpeg audio layer 1/2
0x55 is mp3 aka mpeg audio layer-3

>  	  } else if (strcmp(subsession->codecName(), "PCMU") == 0) {
> -	    sh_audio->format = 0x7;
> +	    wf->wFormatTag = sh_audio->format = 0x7;
> +	    wf->nChannels = 1;

you should set blockalign to 1 and avgbytepersec to the right value,
otherwise a-v sync issues may come up

and i'm still waiting an rtp:// fallback/emulation or enabling the old code


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu



More information about the MPlayer-dev-eng mailing list