mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 19:42:26 +00:00
decklinkvideosink: Don't require the same framerate in the input as the mode's framerate
We only really care about the timestamps for the sink.
This commit is contained in:
parent
f8137dd8a6
commit
62f25894a5
1 changed files with 17 additions and 0 deletions
|
@ -152,6 +152,16 @@ gst_decklink_video_sink_start_scheduled_playback (GstElement * element);
|
|||
G_DEFINE_TYPE (GstDecklinkVideoSink, gst_decklink_video_sink,
|
||||
GST_TYPE_BASE_SINK);
|
||||
|
||||
static gboolean
|
||||
reset_framerate (GstCapsFeatures * features, GstStructure * structure,
|
||||
gpointer user_data)
|
||||
{
|
||||
gst_structure_set (structure, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1,
|
||||
G_MAXINT, 1, NULL);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_decklink_video_sink_class_init (GstDecklinkVideoSinkClass * klass)
|
||||
{
|
||||
|
@ -195,6 +205,9 @@ gst_decklink_video_sink_class_init (GstDecklinkVideoSinkClass * klass)
|
|||
G_PARAM_CONSTRUCT)));
|
||||
|
||||
templ_caps = gst_decklink_mode_get_template_caps ();
|
||||
templ_caps = gst_caps_make_writable (templ_caps);
|
||||
/* For output we support any framerate and only really care about timestamps */
|
||||
gst_caps_map_in_place (templ_caps, reset_framerate, NULL);
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, templ_caps));
|
||||
gst_caps_unref (templ_caps);
|
||||
|
@ -305,6 +318,10 @@ gst_decklink_video_sink_get_caps (GstBaseSink * bsink, GstCaps * filter)
|
|||
GstCaps *mode_caps, *caps;
|
||||
|
||||
mode_caps = gst_decklink_mode_get_caps (self->mode);
|
||||
mode_caps = gst_caps_make_writable (mode_caps);
|
||||
/* For output we support any framerate and only really care about timestamps */
|
||||
gst_caps_map_in_place (mode_caps, reset_framerate, NULL);
|
||||
|
||||
if (filter) {
|
||||
caps =
|
||||
gst_caps_intersect_full (filter, mode_caps, GST_CAPS_INTERSECT_FIRST);
|
||||
|
|
Loading…
Reference in a new issue