Mercurial > mplayer.hg
changeset 9901:233802490b0e
Add a null streamv Currently used for tv and mf. Could be used to
implement /dev/zero on system how don't have it.
author | albeu |
---|---|
date | Thu, 10 Apr 2003 10:59:12 +0000 |
parents | f36b9dda3082 |
children | ca072c661b44 |
files | libmpdemux/Makefile libmpdemux/open.c libmpdemux/stream.c libmpdemux/stream_null.c |
diffstat | 4 files changed, 48 insertions(+), 43 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpdemux/Makefile Thu Apr 10 10:55:18 2003 +0000 +++ b/libmpdemux/Makefile Thu Apr 10 10:59:12 2003 +0000 @@ -3,7 +3,7 @@ include ../config.mak -SRCS = mp3_hdr.c video.c mpeg_hdr.c cache2.c asfheader.c aviheader.c aviprint.c muxer.c muxer_avi.c muxer_mpeg.c demux_asf.c demux_avi.c demux_mov.c parse_mp4.c demux_mpg.c demux_pva.c demux_viv.c demuxer.c dvdauth.c dvdnav_stream.c open.c parse_es.c stream.c stream_file.c stream_netstream.c stream_vcd.c tv.c tvi_dummy.c tvi_v4l.c tvi_bsdbt848.c frequencies.c demux_fli.c demux_real.c demux_y4m.c yuv4mpeg.c yuv4mpeg_ratio.c demux_nuv.c demux_film.c demux_roq.c mf.c demux_mf.c demux_audio.c demux_demuxers.c demux_ogg.c demux_bmp.c cdda.c demux_rawaudio.c demux_rawvideo.c cddb.c cdinfo.c demux_rawdv.c ai_alsa.c ai_oss.c audio_in.c demux_smjpeg.c cue_read.c extension.c demux_gif.c demux_ts.c +SRCS = mp3_hdr.c video.c mpeg_hdr.c cache2.c asfheader.c aviheader.c aviprint.c muxer.c muxer_avi.c muxer_mpeg.c demux_asf.c demux_avi.c demux_mov.c parse_mp4.c demux_mpg.c demux_pva.c demux_viv.c demuxer.c dvdauth.c dvdnav_stream.c open.c parse_es.c stream.c stream_file.c stream_netstream.c stream_vcd.c stream_null.c tv.c tvi_dummy.c tvi_v4l.c tvi_bsdbt848.c frequencies.c demux_fli.c demux_real.c demux_y4m.c yuv4mpeg.c yuv4mpeg_ratio.c demux_nuv.c demux_film.c demux_roq.c mf.c demux_mf.c demux_audio.c demux_demuxers.c demux_ogg.c demux_bmp.c cdda.c demux_rawaudio.c demux_rawvideo.c cddb.c cdinfo.c demux_rawdv.c ai_alsa.c ai_oss.c audio_in.c demux_smjpeg.c cue_read.c extension.c demux_gif.c demux_ts.c ifeq ($(XMMS_PLUGINS),yes) SRCS += demux_xmms.c endif
--- a/libmpdemux/open.c Thu Apr 10 10:55:18 2003 +0000 +++ b/libmpdemux/open.c Thu Apr 10 10:59:12 2003 +0000 @@ -69,28 +69,14 @@ { "unknown", "stereo", "unknown", "unknown", "unknown", "5.1" }; #endif -extern int vcd_get_track_end(int fd,int track); - #include "cue_read.h" -#ifdef USE_TV -#include "tv.h" -extern char* tv_param_channel; -#endif - #ifdef HAS_DVBIN_SUPPORT #include "dvbin.h" #endif -#ifdef HAVE_CDDA -stream_t* open_cdda(char* dev,char* track); -#ifdef STREAMING -stream_t* cddb_open(char* dev,char* track); -#endif -#endif - // Define function about auth the libsmbclient library // FIXME: I really do not not is this function is properly working @@ -135,9 +121,6 @@ stream_t* stream=NULL; int f=-1; off_t len; -#ifdef __FreeBSD__ -int bsize = VCD_SECTOR_SIZE; -#endif *file_format = DEMUXER_TYPE_UNKNOWN; if(!filename) { mp_msg(MSGT_OPEN,MSGL_ERR,"NULL filename, report this bug\n"); @@ -483,31 +466,6 @@ } #endif - - - -//============ Check for TV-input or multi-file input ==== - if( (strncmp("mf://",filename,5) == 0) -#ifdef USE_TV - || (strncmp("tv://",filename,5) == 0) -#endif - ){ - /* create stream */ - stream = new_stream(-1, STREAMTYPE_DUMMY); - if (!stream) return(NULL); - if(strncmp("mf://",filename,5) == 0) { - *file_format = DEMUXER_TYPE_MF; -#ifdef USE_TV - } else { - *file_format = DEMUXER_TYPE_TV; - if(filename[5] != '\0') - tv_param_channel = strdup(filename + 5); -#endif - } - stream->url= filename[5] != '\0' ? strdup(filename + 5) : NULL; - return(stream); - } - #ifdef STREAMING #ifdef STREAMING_LIVE_DOT_COM // Check for a SDP file:
--- a/libmpdemux/stream.c Thu Apr 10 10:55:18 2003 +0000 +++ b/libmpdemux/stream.c Thu Apr 10 10:59:12 2003 +0000 @@ -50,6 +50,7 @@ #ifdef STREAMING extern stream_info_t stream_info_netstream; #endif +extern stream_info_t stream_info_null; extern stream_info_t stream_info_file; stream_info_t* auto_open_streams[] = { @@ -62,6 +63,7 @@ #ifdef STREAMING &stream_info_netstream, #endif + &stream_info_null, &stream_info_file, NULL };
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libmpdemux/stream_null.c Thu Apr 10 10:59:12 2003 +0000 @@ -0,0 +1,45 @@ + +#include "config.h" + +#include <stdlib.h> +#include <string.h> + +#include "stream.h" +#include "demuxer.h" + +#ifdef USE_TV +extern char* tv_param_channel; +#endif + + +static int open_s(stream_t *stream,int mode, void* opts, int* file_format) { + stream->type = STREAMTYPE_DUMMY; + + if(strncmp("mf://",stream->url,5) == 0) { + *file_format = DEMUXER_TYPE_MF; + } +#ifdef USE_TV + else if (strncmp("tv://",stream->url,5) == 0) { + *file_format = DEMUXER_TYPE_TV; + if(stream->url[5] != '\0') + tv_param_channel = strdup(stream->url + 5); + } +#endif + return 1; +} + + +stream_info_t stream_info_null = { + "Null stream", + "null", + "Albeu", + "", + open_s, + { +#ifdef USE_TV +"tv", +#endif +"mf", "null", NULL }, + NULL, + 0 // Urls are an option string +};