From: <wt...@ke...> - 2006-03-29 13:45:31
|
CVS Root: /cvs/gstreamer Module: gstreamer Changes by: wtay Date: Wed Mar 29 2006 13:45:27 UTC Log message: * docs/design/part-qos.txt: * gst/gstclock.c: Small documentation updates and additions. Modified files: . : ChangeLog docs/design : part-qos.txt gst : gstclock.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.2403&r2=1.2404 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/docs/design/part-qos.txt.diff?r1=1.1&r2=1.2 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstclock.c.diff?r1=1.90&r2=1.91 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.2403 retrieving revision 1.2404 diff -u -d -r1.2403 -r1.2404 --- ChangeLog 29 Mar 2006 13:39:05 -0000 1.2403 +++ ChangeLog 29 Mar 2006 13:45:15 -0000 1.2404 @@ -1,5 +1,11 @@ 2006-03-29 Wim Taymans <wi...@fl...> + * docs/design/part-qos.txt: + * gst/gstclock.c: + Small documentation updates and additions. + +2006-03-29 Wim Taymans <wi...@fl...> * libs/gst/base/gstbasesrc.c: (gst_base_src_finalize), (gst_base_src_send_event), (gst_base_src_loop), (gst_base_src_change_state): Index: part-qos.txt RCS file: /cvs/gstreamer/gstreamer/docs/design/part-qos.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- part-qos.txt 27 Mar 2006 18:38:49 -0000 1.1 +++ part-qos.txt 29 Mar 2006 13:45:15 -0000 1.2 @@ -17,6 +17,13 @@ - long term rate corrections based on trends observed in the sinks. +Sources of quality problems +--------------------------- + - High CPU load + - QoS event --------- @@ -38,13 +45,19 @@ A buffer with timestamp B1 arrives in the sink at time T1. The buffer timestamp is then synchronized against the clock which yields a jitter J1 -return value from the clock. +return value from the clock. The jitter J1 is simply calculated as -If the jitter is positive, the entry arrived in time and can be rendered. + J1 = B1 - CT +Where CT is the clock time when the entry arrives in the sink. This value +is calculated inside the clock when we perform gst_clock_entry_wait(). +If the jitter is positive, the entry arrived in time and can be rendered +after waiting for the clock to reach time B1 (which is also CT + J1). If the jitter is negative however, the entry arrived too late in the sink and should therefore be dropped. A dropped buffer should generate a QoS -event upstream. +event upstream. J1 is the amount of time the entry was late. Using the jitter we can calculate the time when the buffer arrived in the sink: @@ -53,7 +66,7 @@ The time the buffer leaves the sink after synchronisation is measured as: - T2 = B1 - (J1 < 0 : J1 : 0) (2) + T2 = B1 - (J1 < 0 ? J1 : 0) (2) For buffers that arrive in time (J1 >= 0) the buffer leaves after synchronisation which is exactly B1. Late buffers (J1 < 0) leave the sink when they arrive, @@ -62,7 +75,7 @@ Using a previous T0 and a new T1, we can calculate the time it took for upstream to generate a buffer with timestamp B1. - PT1 = T0 - T1 (3) + PT1 = T1 - T0 (3) We call PT1 the processing time needed to generate buffer with timestamp B1. @@ -149,7 +162,7 @@ Receivers of the QoS message should permanently reduce their datarate as given by the proportion member. Failure to do so will certainly lead to -dropped frames and worse a QoS. +more dropped frames and a generally worse QoS. QoS strategies @@ -160,6 +173,7 @@ - switch to a lower decoding/encoding quality - switch to a lower quality source QoS implementations ------------------- Index: gstclock.c RCS file: /cvs/gstreamer/gstreamer/gst/gstclock.c,v retrieving revision 1.90 retrieving revision 1.91 diff -u -d -r1.90 -r1.91 --- gstclock.c 21 Mar 2006 14:14:49 -0000 1.90 +++ gstclock.c 29 Mar 2006 13:45:15 -0000 1.91 @@ -339,9 +339,10 @@ * If the @jitter argument is not NULL and this function returns #GST_CLOCK_OK * or #GST_CLOCK_EARLY, it will contain the difference * against the clock and the time of @id when this method was - * called. Negative values means @id was scheduled too late (and this - * function will return #GST_CLOCK_EARLY). Positive values indicate how - * early @id was scheduled. + * called. Negative values indicate how late @id was relative to the clock + * (in which case this function will return #GST_CLOCK_EARLY). + * Positive values indicate how much time was spent waiting on the clock + * before this function returned. * * Returns: the result of the blocking wait. #GST_CLOCK_EARLY will be returned * if the current clock time is past the time of @id, #GST_CLOCK_OK if |