diff options
author | Daniel Caujolle-Bert <f1rmb@users.sourceforge.net> | 2002-08-30 14:19:48 +0000 |
---|---|---|
committer | Daniel Caujolle-Bert <f1rmb@users.sourceforge.net> | 2002-08-30 14:19:48 +0000 |
commit | baf143202f8271a0d642431b2c0c74f35d6d99a1 (patch) | |
tree | 6a817227e10728a3ed648b35f12664a562c541ff | |
parent | 5ce182a1f7ea129790559637b00adf235e0ae635 (diff) | |
download | xine-lib-baf143202f8271a0d642431b2c0c74f35d6d99a1.tar.gz xine-lib-baf143202f8271a0d642431b2c0c74f35d6d99a1.tar.bz2 |
Add two new xine events: inform UI when vo output is needed or not (it's the
job of demuxers to send this NO_VIDEO event, and mpgaudio is the only one which
implement that yet).
CVS patchset: 2563
CVS date: 2002/08/30 14:19:48
-rw-r--r-- | src/demuxers/demux_mpgaudio.c | 13 | ||||
-rw-r--r-- | src/xine-engine/buffer.h | 3 | ||||
-rw-r--r-- | src/xine-engine/events.h | 3 | ||||
-rw-r--r-- | src/xine-engine/video_decoder.c | 44 |
4 files changed, 42 insertions, 21 deletions
diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c index 8298976ed..407c90602 100644 --- a/src/demuxers/demux_mpgaudio.c +++ b/src/demuxers/demux_mpgaudio.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_mpgaudio.c,v 1.57 2002/08/25 11:15:10 tmattern Exp $ + * $Id: demux_mpgaudio.c,v 1.58 2002/08/30 14:19:48 f1rmb Exp $ * * demultiplexer for mpeg audio (i.e. mp3) streams * @@ -156,7 +156,7 @@ static void read_id3_tags (demux_mpgaudio_t *this) { pos = this->input->get_length(this->input) - 128; this->input->seek (this->input, pos, SEEK_SET); - len = this->input->read (this->input, &tag, 128); + len = this->input->read (this->input, (char *)&tag, 128); if (len>0) { @@ -313,8 +313,15 @@ static int demux_mpgaudio_next (demux_mpgaudio_t *this) { static void *demux_mpgaudio_loop (void *this_gen) { demux_mpgaudio_t *this = (demux_mpgaudio_t *) this_gen; + buf_element_t *buf; pthread_mutex_lock( &this->mutex ); + + buf = this->video_fifo->buffer_pool_alloc(this->video_fifo); + buf->type = BUF_CONTROL_NOP; + buf->decoder_flags = BUF_FLAG_NO_VIDEO; + this->video_fifo->put(this->video_fifo, buf); + /* do-while needed to seek after demux finished */ do { @@ -478,7 +485,7 @@ static int demux_mpgaudio_start (demux_plugin_t *this_gen, if( !this->thread_running ) { xine_demux_control_start(this->xine); - + /* * now start demuxing */ diff --git a/src/xine-engine/buffer.h b/src/xine-engine/buffer.h index 5ed7c3c53..aaeec218f 100644 --- a/src/xine-engine/buffer.h +++ b/src/xine-engine/buffer.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: buffer.h,v 1.65 2002/08/29 06:06:03 tmmm Exp $ + * $Id: buffer.h,v 1.66 2002/08/30 14:19:48 f1rmb Exp $ * * * contents: @@ -210,6 +210,7 @@ struct buf_element_s { #define BUF_FLAG_FRAMERATE 0x0080 #define BUF_FLAG_SEEK 0x0100 #define BUF_FLAG_SPECIAL 0x0200 +#define BUF_FLAG_NO_VIDEO 0x0400 /* these are the types of special buffers */ /* diff --git a/src/xine-engine/events.h b/src/xine-engine/events.h index 36518921a..b96416694 100644 --- a/src/xine-engine/events.h +++ b/src/xine-engine/events.h @@ -79,7 +79,8 @@ extern "C" { #define XINE_EVENT_INPUT_NUMBER_10_ADD 40 #define XINE_EVENT_ASPECT_CHANGE 41 /* Generally should be viewed as a hint to the GUI */ - +#define XINE_EVENT_OUTPUT_VIDEO 42 +#define XINE_EVENT_OUTPUT_NO_VIDEO 43 /* diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c index bd62be3d2..f8292515c 100644 --- a/src/xine-engine/video_decoder.c +++ b/src/xine-engine/video_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_decoder.c,v 1.92 2002/07/14 20:55:17 miguelfreitas Exp $ + * $Id: video_decoder.c,v 1.93 2002/08/30 14:19:48 f1rmb Exp $ * */ @@ -97,25 +97,24 @@ void *video_decoder_loop (void *this_gen) { switch (buf->type & 0xffff0000) { case BUF_CONTROL_START: - + if (this->cur_video_decoder_plugin) { this->cur_video_decoder_plugin->close (this->cur_video_decoder_plugin); this->cur_video_decoder_plugin = NULL; } - + if (this->cur_spu_decoder_plugin) { this->cur_spu_decoder_plugin->close (this->cur_spu_decoder_plugin); this->cur_spu_decoder_plugin = NULL; } - + pthread_mutex_lock (&this->finished_lock); this->video_finished = 0; this->spu_finished = 0; - + pthread_mutex_unlock (&this->finished_lock); - + this->metronom->handle_video_discontinuity (this->metronom, DISC_STREAMSTART, 0); - break; case BUF_SPU_SUBP_CONTROL: @@ -219,18 +218,18 @@ void *video_decoder_loop (void *this_gen) { case BUF_CONTROL_NEWPTS: printf ("video_decoder: new pts %lld\n", buf->disc_off); - + this->video_in_discontinuity = 1; - + if (buf->decoder_flags && BUF_FLAG_SEEK) { - this->metronom->handle_video_discontinuity (this->metronom, DISC_STREAMSEEK, buf->disc_off); + this->metronom->handle_video_discontinuity (this->metronom, DISC_STREAMSEEK, buf->disc_off); } else { - this->metronom->handle_video_discontinuity (this->metronom, DISC_ABSOLUTE, buf->disc_off); + this->metronom->handle_video_discontinuity (this->metronom, DISC_ABSOLUTE, buf->disc_off); } - this->video_in_discontinuity = 0; + break; - + case BUF_CONTROL_AUDIO_CHANNEL: { xine_ui_event_t ui_event; @@ -242,8 +241,16 @@ void *video_decoder_loop (void *this_gen) { break; case BUF_CONTROL_NOP: + /* Inform UI of NO_VIDEO usage */ + if(buf->decoder_flags & BUF_FLAG_NO_VIDEO) { + xine_ui_event_t ui_event; + + ui_event.event.type = XINE_EVENT_OUTPUT_NO_VIDEO; + ui_event.data = this->cur_mrl; + xine_send_event(this, &ui_event.event); + } break; - + default: xine_profiler_start_count (prof_video_decode); @@ -259,8 +266,9 @@ void *video_decoder_loop (void *this_gen) { decoder = this->video_decoder_plugins [streamtype]; if (decoder) { - + if (this->cur_video_decoder_plugin != decoder) { + xine_ui_event_t ui_event; if (this->cur_video_decoder_plugin) { this->cur_video_decoder_plugin->close (this->cur_video_decoder_plugin); @@ -278,10 +286,14 @@ void *video_decoder_loop (void *this_gen) { xine_report_codec( this, XINE_CODEC_VIDEO, 0, buf->type, 1); + ui_event.event.type = XINE_EVENT_OUTPUT_VIDEO; + ui_event.data = this->cur_mrl; + xine_send_event(this, &ui_event.event); + } decoder->decode_data (this->cur_video_decoder_plugin, buf); - + } else if( buf->type != buftype_unknown ) { xine_log (this, XINE_LOG_MSG, "video_decoder: no plugin available to handle '%s'\n", buf_video_name( buf->type ) ); |