mirror of
https://github.com/mpv-player/mpv
synced 2025-02-25 01:37:21 +00:00
Add a null streamv Currently used for tv and mf. Could be used to
implement /dev/zero on system how don't have it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9902 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
e19c6d1784
commit
66ec24b3e7
@ -3,7 +3,7 @@ LIBNAME = libmpdemux.a
|
||||
|
||||
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
|
||||
|
@ -69,28 +69,14 @@ char * dvd_audio_stream_channels[6] =
|
||||
{ "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* open_stream(char* filename,char** options, int* file_format){
|
||||
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 @@ if(strncmp("dvbin://",filename,8) == 0)
|
||||
}
|
||||
#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:
|
||||
|
@ -50,6 +50,7 @@ extern stream_info_t stream_info_cdda;
|
||||
#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 @@ stream_info_t* auto_open_streams[] = {
|
||||
#ifdef STREAMING
|
||||
&stream_info_netstream,
|
||||
#endif
|
||||
&stream_info_null,
|
||||
&stream_info_file,
|
||||
NULL
|
||||
};
|
||||
|
45
libmpdemux/stream_null.c
Normal file
45
libmpdemux/stream_null.c
Normal file
@ -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
|
||||
};
|
Loading…
Reference in New Issue
Block a user