mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 03:00:35 +00:00
parent
c7b195740e
commit
0390f0d765
1 changed files with 28 additions and 8 deletions
|
@ -417,6 +417,9 @@ gst_dshow_new_video_caps (GstVideoFormat video_format, const gchar * name,
|
|||
{
|
||||
GstCaps *video_caps = NULL;
|
||||
GstStructure *video_structure = NULL;
|
||||
gint min_w, max_w;
|
||||
gint min_h, max_h;
|
||||
gint min_fr, max_fr;
|
||||
|
||||
/* raw video format */
|
||||
switch (video_format) {
|
||||
|
@ -462,14 +465,31 @@ gst_dshow_new_video_caps (GstVideoFormat video_format, const gchar * name,
|
|||
/* "The IAMStreamConfig::SetFormat method will set the frame rate to the closest */
|
||||
/* value that the filter supports" as it said in the VIDEO_STREAM_CONFIG_CAPS dshwo doc */
|
||||
|
||||
gst_structure_set (video_structure,
|
||||
"width", GST_TYPE_INT_RANGE, pin_mediatype->vscc.MinOutputSize.cx,
|
||||
pin_mediatype->vscc.MaxOutputSize.cx, "height", GST_TYPE_INT_RANGE,
|
||||
pin_mediatype->vscc.MinOutputSize.cy,
|
||||
pin_mediatype->vscc.MaxOutputSize.cy, "framerate",
|
||||
GST_TYPE_FRACTION_RANGE,
|
||||
(gint) (10000000 / pin_mediatype->vscc.MaxFrameInterval), 1,
|
||||
(gint) (10000000 / pin_mediatype->vscc.MinFrameInterval), 1, NULL);
|
||||
min_w = pin_mediatype->vscc.MinOutputSize.cx;
|
||||
max_w = pin_mediatype->vscc.MaxOutputSize.cx;
|
||||
min_h = pin_mediatype->vscc.MinOutputSize.cy;
|
||||
max_h = pin_mediatype->vscc.MaxOutputSize.cy;
|
||||
min_fr = (gint) (10000000 / pin_mediatype->vscc.MaxFrameInterval);
|
||||
max_fr = (gint)(10000000 / pin_mediatype->vscc.MinFrameInterval);
|
||||
|
||||
if (min_w == max_w)
|
||||
gst_structure_set (video_structure, "width", G_TYPE_INT, min_w, NULL);
|
||||
else
|
||||
gst_structure_set (video_structure,
|
||||
"width", GST_TYPE_INT_RANGE, min_w, max_w, NULL);
|
||||
|
||||
if (min_h == max_h)
|
||||
gst_structure_set (video_structure, "height", G_TYPE_INT, min_h, NULL);
|
||||
else
|
||||
gst_structure_set (video_structure,
|
||||
"height", GST_TYPE_INT_RANGE, min_h, max_h, NULL);
|
||||
|
||||
if (min_fr == max_fr)
|
||||
gst_structure_set (video_structure, "framerate",
|
||||
GST_TYPE_FRACTION, min_fr, 1, NULL);
|
||||
else
|
||||
gst_structure_set (video_structure, "framerate",
|
||||
GST_TYPE_FRACTION_RANGE, min_fr, 1, max_fr, 1, NULL);
|
||||
|
||||
return video_caps;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue