mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 10:25:33 +00:00
move common code out of if
Original commit message from CVS: move common code out of if
This commit is contained in:
parent
eca486f83b
commit
43b6b750c6
2 changed files with 6 additions and 10 deletions
|
@ -575,19 +575,14 @@ gst_videotestsrc_get (GstPad * pad)
|
||||||
videotestsrc->make_image (videotestsrc, (void *) GST_BUFFER_DATA (buf),
|
videotestsrc->make_image (videotestsrc, (void *) GST_BUFFER_DATA (buf),
|
||||||
videotestsrc->width, videotestsrc->height);
|
videotestsrc->width, videotestsrc->height);
|
||||||
|
|
||||||
if (videotestsrc->sync) {
|
|
||||||
GST_BUFFER_TIMESTAMP (buf) = videotestsrc->timestamp_offset +
|
GST_BUFFER_TIMESTAMP (buf) = videotestsrc->timestamp_offset +
|
||||||
(videotestsrc->n_frames * GST_SECOND) / (double) videotestsrc->rate;
|
(videotestsrc->n_frames * GST_SECOND) / (double) videotestsrc->rate;
|
||||||
videotestsrc->n_frames++;
|
videotestsrc->n_frames++;
|
||||||
|
if (videotestsrc->sync) {
|
||||||
/* FIXME this is not correct if we do QoS */
|
/* FIXME this is not correct if we do QoS */
|
||||||
if (videotestsrc->clock) {
|
if (videotestsrc->clock) {
|
||||||
gst_element_wait (GST_ELEMENT (videotestsrc), GST_BUFFER_TIMESTAMP (buf));
|
gst_element_wait (GST_ELEMENT (videotestsrc), GST_BUFFER_TIMESTAMP (buf));
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
GST_BUFFER_TIMESTAMP (buf) = videotestsrc->timestamp_offset +
|
|
||||||
(videotestsrc->n_frames * GST_SECOND) / (double) videotestsrc->rate;
|
|
||||||
videotestsrc->n_frames++;
|
|
||||||
}
|
}
|
||||||
GST_BUFFER_DURATION (buf) = GST_SECOND / (double) videotestsrc->rate;
|
GST_BUFFER_DURATION (buf) = GST_SECOND / (double) videotestsrc->rate;
|
||||||
|
|
||||||
|
|
|
@ -60,8 +60,9 @@ struct _GstVideotestsrc {
|
||||||
struct fourcc_list_struct *fourcc;
|
struct fourcc_list_struct *fourcc;
|
||||||
|
|
||||||
/* private */
|
/* private */
|
||||||
gint64 timestamp_offset;
|
gint64 timestamp_offset; /* base offset */
|
||||||
gint64 n_frames;
|
GstClockTime running_time; /* total running time */
|
||||||
|
gint64 n_frames; /* total frames sent */
|
||||||
gint bpp;
|
gint bpp;
|
||||||
gdouble rate;
|
gdouble rate;
|
||||||
int type;
|
int type;
|
||||||
|
|
Loading…
Reference in a new issue