mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-22 10:23:47 +00:00
gst/videorate/gstvideorate.c: If videorate changes caps, we can no longer use the old buffer (which may have a differ...
Original commit message from CVS: * gst/videorate/gstvideorate.c: (gst_video_rate_setcaps), (gst_video_rate_reset), (gst_video_rate_chain): If videorate changes caps, we can no longer use the old buffer (which may have a different size, incompatible with our caps). So don't do that; just duplicate the new frame more times.
This commit is contained in:
parent
9cbead077e
commit
b3827533a7
2 changed files with 18 additions and 4 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2007-03-23 Michael Smith <msmith@fluendo.com>
|
||||||
|
|
||||||
|
* gst/videorate/gstvideorate.c: (gst_video_rate_setcaps),
|
||||||
|
(gst_video_rate_reset), (gst_video_rate_chain):
|
||||||
|
If videorate changes caps, we can no longer use the old buffer
|
||||||
|
(which may have a different size, incompatible with our caps).
|
||||||
|
So don't do that; just duplicate the new frame more times.
|
||||||
|
|
||||||
2007-03-22 Jan Schmidt <thaytan@mad.scientist.com>
|
2007-03-22 Jan Schmidt <thaytan@mad.scientist.com>
|
||||||
|
|
||||||
* gst/playback/gstplaybin.c: (gst_play_bin_class_init):
|
* gst/playback/gstplaybin.c: (gst_play_bin_class_init):
|
||||||
|
|
|
@ -360,6 +360,10 @@ gst_video_rate_setcaps (GstPad * pad, GstCaps * caps)
|
||||||
gst_object_unref (opeer);
|
gst_object_unref (opeer);
|
||||||
}
|
}
|
||||||
done:
|
done:
|
||||||
|
/* After a setcaps, our caps may have changed. In that case, we can't use
|
||||||
|
* the old buffer, if there was one (it might have different dimensions) */
|
||||||
|
gst_video_rate_swap_prev (videorate, NULL, 0);
|
||||||
|
|
||||||
gst_object_unref (videorate);
|
gst_object_unref (videorate);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -385,7 +389,7 @@ gst_video_rate_reset (GstVideoRate * videorate)
|
||||||
videorate->out = 0;
|
videorate->out = 0;
|
||||||
videorate->drop = 0;
|
videorate->drop = 0;
|
||||||
videorate->dup = 0;
|
videorate->dup = 0;
|
||||||
videorate->next_ts = G_GINT64_CONSTANT (0);
|
videorate->next_ts = GST_CLOCK_TIME_NONE;
|
||||||
gst_video_rate_swap_prev (videorate, NULL, 0);
|
gst_video_rate_swap_prev (videorate, NULL, 0);
|
||||||
|
|
||||||
gst_segment_init (&videorate->segment, GST_FORMAT_TIME);
|
gst_segment_init (&videorate->segment, GST_FORMAT_TIME);
|
||||||
|
@ -570,9 +574,11 @@ gst_video_rate_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
if (videorate->prevbuf == NULL) {
|
if (videorate->prevbuf == NULL) {
|
||||||
gst_video_rate_swap_prev (videorate, buffer, intime);
|
gst_video_rate_swap_prev (videorate, buffer, intime);
|
||||||
videorate->in++;
|
videorate->in++;
|
||||||
|
if (!GST_CLOCK_TIME_IS_VALID (videorate->next_ts)) {
|
||||||
/* new buffer, we expect to output a buffer that matches the first
|
/* new buffer, we expect to output a buffer that matches the first
|
||||||
* timestamp in the segment */
|
* timestamp in the segment */
|
||||||
videorate->next_ts = videorate->segment.start;
|
videorate->next_ts = videorate->segment.start;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
GstClockTime prevtime;
|
GstClockTime prevtime;
|
||||||
gint count = 0;
|
gint count = 0;
|
||||||
|
|
Loading…
Reference in a new issue