diff options
Diffstat (limited to 'src/xine-engine')
-rw-r--r-- | src/xine-engine/audio_decoder.c | 5 | ||||
-rw-r--r-- | src/xine-engine/buffer_types.c | 6 | ||||
-rw-r--r-- | src/xine-engine/video_decoder.c | 8 | ||||
-rw-r--r-- | src/xine-engine/xine.c | 34 | ||||
-rw-r--r-- | src/xine-engine/xine_internal.h | 22 |
5 files changed, 66 insertions, 9 deletions
diff --git a/src/xine-engine/audio_decoder.c b/src/xine-engine/audio_decoder.c index f498bfbe7..6bc566875 100644 --- a/src/xine-engine/audio_decoder.c +++ b/src/xine-engine/audio_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: audio_decoder.c,v 1.74 2002/06/03 20:36:26 miguelfreitas Exp $ + * $Id: audio_decoder.c,v 1.75 2002/06/07 04:15:46 miguelfreitas Exp $ * * * functions that implement audio decoding @@ -226,6 +226,7 @@ void *audio_decoder_loop (void *this_gen) { xine_log (this, XINE_LOG_FORMAT, "audio_decoder: using audio decoder plugin '%s'\n", decoder->get_identifier()); + xine_report_codec( this, XINE_CODEC_AUDIO, 0, buf->type, 1); this->cur_audio_decoder_plugin = decoder; this->cur_audio_decoder_plugin->init (this->cur_audio_decoder_plugin, this->audio_out); @@ -244,6 +245,7 @@ void *audio_decoder_loop (void *this_gen) { else if( buf->type != buftype_unknown ) { xine_log (this, XINE_LOG_MSG, "audio_decoder: no plugin available to handle '%s'\n", buf_audio_name( buf->type ) ); + xine_report_codec( this, XINE_CODEC_AUDIO, 0, buf->type, 0); buftype_unknown = buf->type; } } @@ -251,6 +253,7 @@ void *audio_decoder_loop (void *this_gen) { } else if( buf->type != buftype_unknown ) { xine_log (this, XINE_LOG_MSG, "audio_decoder: unknown buffer type: %08x\n", buf->type ); + xine_report_codec( this, XINE_CODEC_AUDIO, 0, buf->type, 0); buftype_unknown = buf->type; } diff --git a/src/xine-engine/buffer_types.c b/src/xine-engine/buffer_types.c index f6f4a9902..e482ddd94 100644 --- a/src/xine-engine/buffer_types.c +++ b/src/xine-engine/buffer_types.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: buffer_types.c,v 1.23 2002/06/07 02:40:47 miguelfreitas Exp $ + * $Id: buffer_types.c,v 1.24 2002/06/07 04:15:46 miguelfreitas Exp $ * * * contents: @@ -599,7 +599,7 @@ int i; } } - return "unknown"; + return ""; } uint32_t formattag_to_buf_audio( uint32_t formattag ) { @@ -633,7 +633,7 @@ int i; } } - return "unknow"; + return ""; } void xine_bmiheader_le2me( xine_bmiheader *bih ) { diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c index d061520a8..0c8524bb9 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.86 2002/06/03 20:36:26 miguelfreitas Exp $ + * $Id: video_decoder.c,v 1.87 2002/06/07 04:15:46 miguelfreitas Exp $ * */ @@ -257,19 +257,23 @@ void *video_decoder_loop (void *this_gen) { xine_log (this, XINE_LOG_FORMAT, "using video decoder plugin '%s'\n", decoder->get_identifier()); + + xine_report_codec( this, XINE_CODEC_VIDEO, 0, buf->type, 1); } 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", + xine_log (this, XINE_LOG_MSG, "video_decoder: no plugin available to handle '%s'\n", buf_video_name( buf->type ) ); + xine_report_codec( this, XINE_CODEC_VIDEO, 0, buf->type, 0); buftype_unknown = buf->type; } } else if( buf->type != buftype_unknown ) { xine_log (this, XINE_LOG_MSG, "video_decoder: unknown buffer type: %08x\n", buf->type ); + xine_report_codec( this, XINE_CODEC_VIDEO, 0, buf->type, 0); buftype_unknown = buf->type; } diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 21dd8ce7a..083bf2910 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.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: xine.c,v 1.135 2002/06/07 02:40:47 miguelfreitas Exp $ + * $Id: xine.c,v 1.136 2002/06/07 04:15:46 miguelfreitas Exp $ * * top-level xine functions * @@ -139,6 +139,35 @@ void xine_notify_stream_finished (xine_t *this) { } } +void xine_report_codec( xine_t *this, int codec_type, uint32_t fourcc, uint32_t buf_type, int handled ) { + + if( this->report_codec_cb ) { + if( codec_type == XINE_CODEC_VIDEO ) { + if( !buf_type ) + buf_type = fourcc_to_buf_video( fourcc ); + + this->report_codec_cb( this->report_codec_user_data, + codec_type, fourcc, + buf_video_name( buf_type ), handled ); + } else { + if( !buf_type ) + buf_type = formattag_to_buf_audio( fourcc ); + + this->report_codec_cb( this->report_codec_user_data, + codec_type, fourcc, + buf_audio_name( buf_type ), handled ); + } + } +} + +int xine_register_report_codec_cb(xine_t *this, xine_report_codec_t report_codec, + void *user_data) { + + this->report_codec_cb = report_codec; + this->report_codec_user_data = user_data; + return 0; +} + static void xine_internal_osd (xine_t *this, char *str, uint32_t start_time, uint32_t duration) { @@ -595,7 +624,8 @@ xine_t *xine_init (vo_driver_t *vo, this->num_event_listeners = 0; /* Initially there are none */ this->cur_input_plugin = NULL; /* In case the input plugin event handlers * are called too early. */ - this->cur_spu_decoder_plugin = NULL; + this->cur_spu_decoder_plugin = NULL; + this->report_codec_cb = NULL; /* * create a metronom diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h index f5def8794..0342acd2d 100644 --- a/src/xine-engine/xine_internal.h +++ b/src/xine-engine/xine_internal.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: xine_internal.h,v 1.86 2002/06/07 02:40:47 miguelfreitas Exp $ + * $Id: xine_internal.h,v 1.87 2002/06/07 04:15:46 miguelfreitas Exp $ * */ @@ -151,6 +151,12 @@ struct audio_decoder_s { typedef void (*xine_event_listener_t) (void *user_data, xine_event_t *); +#define XINE_CODEC_AUDIO 0 +#define XINE_CODEC_VIDEO 1 + +typedef void (*xine_report_codec_t) (void *user_data, int codec_type, + uint32_t fourcc, char *description, int handled); + struct xine_s { /* private : */ @@ -250,6 +256,9 @@ struct xine_s { pthread_t finished_thread; int finished_thread_running; + + xine_report_codec_t report_codec_cb; + void *report_codec_user_data; }; /* @@ -428,6 +437,7 @@ char **xine_get_autoplay_mrls (xine_t *this, char *plugin_id, int *num_mrls); */ void xine_notify_stream_finished (xine_t *this); +void xine_report_codec( xine_t *this, int codec_type, uint32_t fourcc, uint32_t buf_type, int handled ); /* * video decoder stuff @@ -588,6 +598,16 @@ int xine_remove_event_listener(xine_t *this, xine_event_listener_t listener); void xine_send_event(xine_t *this, xine_event_t *event); /* + * register an codec reporting callback. + * return 0 if ok + * obs: set to NULL to unregister + */ + +int xine_register_report_codec_cb(xine_t *this, xine_report_codec_t report_codec, + void *user_data); + + +/* * snapshot function * * returns: |