mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
gst/: Use utility method for scaling clocktime for fractional framerates.
Original commit message from CVS: * gst/videorate/gstvideorate.c: (gst_videorate_chain): * gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_create): Use utility method for scaling clocktime for fractional framerates.
This commit is contained in:
parent
0e82871285
commit
deaee40dab
3 changed files with 19 additions and 10 deletions
|
@ -1,3 +1,9 @@
|
|||
2005-11-22 Michael Smith <msmith@fluendo.com>
|
||||
|
||||
* gst/videorate/gstvideorate.c: (gst_videorate_chain):
|
||||
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_create):
|
||||
Use utility method for scaling clocktime for fractional framerates.
|
||||
|
||||
2005-11-22 Jan Schmidt <thaytan@mad.scientist.com>
|
||||
|
||||
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
|
||||
|
@ -39,6 +45,7 @@
|
|||
* gst-libs/gst/audio/audio.h:
|
||||
remove some deprecated functions
|
||||
|
||||
>>>>>>> 1.2127
|
||||
2005-11-22 Andy Wingo <wingo@pobox.com>
|
||||
|
||||
* Update for gst_tag_setter API changes.
|
||||
|
|
|
@ -507,12 +507,14 @@ gst_videorate_chain (GstPad * pad, GstBuffer * buffer)
|
|||
GST_BUFFER_SIZE (videorate->prevbuf));
|
||||
GST_BUFFER_TIMESTAMP (outbuf) = videorate->next_ts;
|
||||
videorate->out++;
|
||||
videorate->next_ts =
|
||||
videorate->first_ts +
|
||||
(videorate->out * GST_SECOND *
|
||||
videorate->to_rate_denominator / videorate->to_rate_numerator);
|
||||
GST_BUFFER_DURATION (outbuf) =
|
||||
videorate->next_ts - GST_BUFFER_TIMESTAMP (outbuf);
|
||||
if (videorate->to_rate_numerator) {
|
||||
videorate->next_ts =
|
||||
videorate->first_ts +
|
||||
gst_util_clocktime_scale (videorate->out * GST_SECOND,
|
||||
videorate->to_rate_denominator, videorate->to_rate_numerator);
|
||||
GST_BUFFER_DURATION (outbuf) =
|
||||
videorate->next_ts - GST_BUFFER_TIMESTAMP (outbuf);
|
||||
}
|
||||
/* adapt for looping */
|
||||
GST_BUFFER_TIMESTAMP (outbuf) -= videorate->segment_accum;
|
||||
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (videorate->srcpad));
|
||||
|
|
|
@ -459,14 +459,14 @@ gst_videotestsrc_create (GstPushSrc * psrc, GstBuffer ** buffer)
|
|||
|
||||
GST_BUFFER_TIMESTAMP (outbuf) = src->timestamp_offset + src->running_time;
|
||||
if (src->rate_numerator != 0) {
|
||||
GST_BUFFER_DURATION (outbuf) = GST_SECOND * src->rate_denominator /
|
||||
src->rate_numerator;
|
||||
GST_BUFFER_DURATION (outbuf) = gst_utils_clocktime_scale (GST_SECOND,
|
||||
src->rate_denominator, src->rate_numerator);
|
||||
}
|
||||
|
||||
src->n_frames++;
|
||||
if (src->rate_numerator != 0) {
|
||||
src->running_time = src->n_frames * GST_SECOND * src->rate_denominator /
|
||||
src->rate_numerator;
|
||||
src->running_time = gst_utils_clocktime_scale (src->n_frames * GST_SECOND,
|
||||
src->rate_denominator, src->rate_numerator);
|
||||
}
|
||||
|
||||
*buffer = outbuf;
|
||||
|
|
Loading…
Reference in a new issue