Mercurial > mplayer.hg
comparison libmpdemux/tv.c @ 7408:0c6948b8100f
stream layer cleanup part 2
STREAMTYPE_TV removed, use STREAMTYPE_DUMMY instead. tv init moved to demux_open
author | arpi |
---|---|
date | Sun, 15 Sep 2002 20:51:55 +0000 |
parents | 9129781e5939 |
children | c4434bdf6e51 |
comparison
equal
deleted
inserted
replaced
7407:8780415baa87 | 7408:0c6948b8100f |
---|---|
73 */ | 73 */ |
74 /* fill demux->video and demux->audio */ | 74 /* fill demux->video and demux->audio */ |
75 | 75 |
76 int demux_tv_fill_buffer(demuxer_t *demux, demux_stream_t *ds) | 76 int demux_tv_fill_buffer(demuxer_t *demux, demux_stream_t *ds) |
77 { | 77 { |
78 tvi_handle_t *tvh=(tvi_handle_t*)(demux->stream->priv); | 78 tvi_handle_t *tvh=(tvi_handle_t*)(demux->priv); |
79 demux_packet_t* dp; | 79 demux_packet_t* dp; |
80 | 80 |
81 sh_video_t *sh_video = demux->video->sh; | 81 sh_video_t *sh_video = demux->video->sh; |
82 u_int len; | 82 u_int len; |
83 int aframeswaiting; | 83 int aframeswaiting; |
109 } | 109 } |
110 | 110 |
111 return 1; | 111 return 1; |
112 } | 112 } |
113 | 113 |
114 int stream_open_tv(stream_t *stream, tvi_handle_t *tvh) | 114 static int open_tv(tvi_handle_t *tvh) |
115 { | 115 { |
116 int i; | 116 int i; |
117 tvi_functions_t *funcs = tvh->functions; | 117 tvi_functions_t *funcs = tvh->functions; |
118 int picture_format = 0; | 118 int picture_format = 0; |
119 | 119 |
255 return 1; | 255 return 1; |
256 } | 256 } |
257 | 257 |
258 int demux_open_tv(demuxer_t *demuxer) | 258 int demux_open_tv(demuxer_t *demuxer) |
259 { | 259 { |
260 tvi_handle_t *tvh=(tvi_handle_t*)(demuxer->stream->priv); | 260 tvi_handle_t *tvh; |
261 sh_video_t *sh_video = NULL; | 261 sh_video_t *sh_video; |
262 sh_audio_t *sh_audio = NULL; | 262 sh_audio_t *sh_audio = NULL; |
263 tvi_functions_t *funcs = tvh->functions; | 263 tvi_functions_t *funcs; |
264 | |
265 if(!(tvh=tv_begin())) return 0; | |
266 if (!tv_init(tvh)) return 0; | |
267 if (!open_tv(tvh)){ | |
268 tv_uninit(tvh); | |
269 return 0; | |
270 } | |
271 funcs = tvh->functions; | |
272 demuxer->priv=tvh; | |
264 | 273 |
265 sh_video = new_sh_video(demuxer, 0); | 274 sh_video = new_sh_video(demuxer, 0); |
266 | 275 |
267 /* get IMAGE FORMAT */ | 276 /* get IMAGE FORMAT */ |
268 funcs->control(tvh->priv, TVI_CONTROL_VID_GET_FORMAT, &sh_video->format); | 277 funcs->control(tvh->priv, TVI_CONTROL_VID_GET_FORMAT, &sh_video->format); |
385 } | 394 } |
386 | 395 |
387 #if defined(USE_TV) && defined(HAVE_TV_V4L) | 396 #if defined(USE_TV) && defined(HAVE_TV_V4L) |
388 int demux_close_tv(demuxer_t *demuxer) | 397 int demux_close_tv(demuxer_t *demuxer) |
389 { | 398 { |
390 tvi_handle_t *tvh=(tvi_handle_t*)(demuxer->stream->priv); | 399 tvi_handle_t *tvh=(tvi_handle_t*)(demuxer->priv); |
391 return(tvh->functions->uninit(tvh->priv)); | 400 return(tvh->functions->uninit(tvh->priv)); |
392 } | 401 } |
393 #endif | 402 #endif |
394 | 403 |
395 /* ================== STREAM_TV ===================== */ | 404 /* ================== STREAM_TV ===================== */ |