From 289b5e385d114d002654ee3188bcfb43deb26aee Mon Sep 17 00:00:00 2001 From: Frank Enderle Date: Sun, 11 Apr 2010 13:03:25 +0200 Subject: Report NBC buffer stats to the application using new event XINE_EVENT_NBC_STATS This event reports the buffer status for network streams (NBC) back to the application, providing a way to measure if the stream delivers data fast enough. This enables the application to slow down the stream playback to get the buffers filling more quickly. (This is only a sample application of the event.) The event reports all vital data like fill percentage, remaining buffer in seconds and discontinuity, separately for audio and video, whether the nbc layer is actually buffering, the operation type (put or get) and also if the buffering is enabled at all. In essence, it's the output you get from nbc if you run xine-lib in verbose mode on the console, but in raw data. --- include/xine.h.in | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'include') diff --git a/include/xine.h.in b/include/xine.h.in index a8d8ddd5b..9cde0593e 100644 --- a/include/xine.h.in +++ b/include/xine.h.in @@ -1721,6 +1721,7 @@ void xine_config_reset (xine_t *self) XINE_PROTECTED; #define XINE_EVENT_DROPPED_FRAMES 12 /* number of dropped frames is too high */ #define XINE_EVENT_MRL_REFERENCE_EXT 13 /* demuxer->frontend: MRL reference(s) for the real stream */ #define XINE_EVENT_AUDIO_AMP_LEVEL 14 /* report current audio amp level (l/r/mute) */ +#define XINE_EVENT_NBC_STATS 15 /* nbc buffer status */ /* input events coming from frontend */ @@ -1904,6 +1905,23 @@ typedef struct { int percent; } xine_progress_data_t; +/* + * nbc buffer status + */ +typedef struct { + int v_percent; /* fill of video buffer */ + int64_t v_remaining; /* remaining time in ms till underrun */ + int64_t v_bitrate; /* current bitrate */ + int v_in_disc; /* in discontinuity */ + int a_percent; /* like video, but for audio */ + int64_t a_remaining; + int64_t a_bitrate; + int a_in_disc; + int buffering; /* currently filling buffer */ + int enabled; /* buffer disabled by engine */ + int type; /* 0=buffer put, 1=buffer get */ +} xine_nbc_stats_data_t; + /* * mrl reference data is sent by demuxers when a reference stream is found. * this stream just contains pointers (urls) to the real data, which are -- cgit v1.2.3