diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2002-06-07 04:15:45 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2002-06-07 04:15:45 +0000 |
commit | b70b50fb22d4a78b0a67d517c9da700a705a5921 (patch) | |
tree | 75e619f7b04e6a8510be22240b3fbf154db9fb90 /src/xine-engine/xine.c | |
parent | 15891af86f77397a56b6a2b6e28cac2cf8ca4713 (diff) | |
download | xine-lib-b70b50fb22d4a78b0a67d517c9da700a705a5921.tar.gz xine-lib-b70b50fb22d4a78b0a67d517c9da700a705a5921.tar.bz2 |
codec reporting api
CVS patchset: 2030
CVS date: 2002/06/07 04:15:45
Diffstat (limited to 'src/xine-engine/xine.c')
-rw-r--r-- | src/xine-engine/xine.c | 34 |
1 files changed, 32 insertions, 2 deletions
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 |