From d35f4efe671a33e6fd8be05cd908fecc90cb72ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 23 Feb 2007 18:49:29 +0000 Subject: [PATCH] gst/playback/gstplaybin.c: Improve docs: point out that the application needs to assist playbin with buffering. Original commit message from CVS: * gst/playback/gstplaybin.c: Improve docs: point out that the application needs to assist playbin with buffering. --- ChangeLog | 6 ++++++ gst/playback/gstplaybin.c | 23 ++++++++++++++--------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 84803d6788..a754c31f3a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-02-23 Tim-Philipp Müller + + * gst/playback/gstplaybin.c: + Improve docs: point out that the application needs to assist playbin + with buffering. + 2007-02-23 Tim-Philipp Müller * gst-libs/gst/utils/install-plugins.c: diff --git a/gst/playback/gstplaybin.c b/gst/playback/gstplaybin.c index 78b1b136b1..a8b73b4f0e 100644 --- a/gst/playback/gstplaybin.c +++ b/gst/playback/gstplaybin.c @@ -161,28 +161,33 @@ * new_state=PAUSED), since before that the list might not be complete yet or * not contain all available information (like language-codes). * - * Buffering status + * Buffering * - * Playbin handles buffering automatically. When playbin is buffering, it - * will post BUFFERING messages on the bus with a percentage value that - * shows the progress of the buffering. Applications may want to show this - * information to the user in some form or another. Here is how to extract - * the percentage information from the message: + * Playbin handles buffering automatically for the most part, but applications + * need to handle parts of the buffering process as well. Whenever playbin is + * buffering, it will post BUFFERING messages on the bus with a percentage + * value that shows the progress of the buffering process. Applications need + * to set playbin to PLAYING or PAUSED state in response to these messages. + * They may also want to convey the buffering progress to the user in some + * way. Here is how to extract the percentage information from the message + * (requires GStreamer >= 0.10.11): * * * * switch (GST_MESSAGE_TYPE (msg)) { * case GST_MESSAGE_BUFFERING: { * gint percent = 0; - * gst_structure_get_int (msg->structure, "buffer-percent", &percent); + * gst_message_parse_buffering (msg, &percent); * g_print ("Buffering (%%u percent done)", percent); * break; * } * ... * } * - * Note that application should keep the pipeline in the PAUSED state when a - * GST_MESSAGE_BUFFERING message is received with a buffer-percent < 100. + * Note that applications should keep/set the pipeline in the PAUSED state when + * a BUFFERING message is received with a buffer percent value < 100 and set + * the pipeline back to PLAYING state when a BUFFERING message with a value + * of 100 percent is received (if PLAYING is the desired state, that is). * * Embedding the video window in your application *