videolevels: more correct transform_caps
This commit is contained in:
parent
fb20b019a7
commit
b18610763c
@ -366,8 +366,9 @@ gst_videolevels_transform_caps (GstBaseTransform * trans,
|
|||||||
{
|
{
|
||||||
GstVideoLevels *videolevels = GST_VIDEOLEVELS (trans);
|
GstVideoLevels *videolevels = GST_VIDEOLEVELS (trans);
|
||||||
GstCaps *other_caps;
|
GstCaps *other_caps;
|
||||||
GstStructure *st;
|
GstStructure *st, *newst;
|
||||||
gint i, n;
|
gint i, n;
|
||||||
|
const GValue *value;
|
||||||
|
|
||||||
videolevels = GST_VIDEOLEVELS (trans);
|
videolevels = GST_VIDEOLEVELS (trans);
|
||||||
|
|
||||||
@ -382,10 +383,23 @@ gst_videolevels_transform_caps (GstBaseTransform * trans,
|
|||||||
if (gst_caps_is_subset_structure (other_caps, st))
|
if (gst_caps_is_subset_structure (other_caps, st))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
st = gst_structure_copy (st);
|
if (direction == GST_PAD_SRC) {
|
||||||
gst_structure_remove_fields (st, "format", "bpp", NULL);
|
newst = gst_structure_from_string (
|
||||||
|
"video/x-raw,format={GRAY16_LE,GRAY16_BE}", NULL);
|
||||||
|
} else {
|
||||||
|
newst = gst_structure_from_string ("video/x-raw,format=GRAY8", NULL);
|
||||||
|
}
|
||||||
|
|
||||||
gst_caps_append_structure (other_caps, st);
|
value = gst_structure_get_value (st, "width");
|
||||||
|
gst_structure_set_value (newst, "width", value);
|
||||||
|
|
||||||
|
value = gst_structure_get_value (st, "height");
|
||||||
|
gst_structure_set_value (newst, "height", value);
|
||||||
|
|
||||||
|
value = gst_structure_get_value (st, "framerate");
|
||||||
|
gst_structure_set_value (newst, "framerate", value);
|
||||||
|
|
||||||
|
gst_caps_append_structure (other_caps, newst);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gst_caps_is_empty (other_caps) && filter_caps) {
|
if (!gst_caps_is_empty (other_caps) && filter_caps) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user