mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
videoscale: improve handling of navigation events
Only make the navigation event writable when we need to change it.
This commit is contained in:
parent
d186109e71
commit
280e504ae5
1 changed files with 13 additions and 10 deletions
|
@ -1412,17 +1412,20 @@ gst_video_scale_src_event (GstBaseTransform * trans, GstEvent * event)
|
||||||
|
|
||||||
switch (GST_EVENT_TYPE (event)) {
|
switch (GST_EVENT_TYPE (event)) {
|
||||||
case GST_EVENT_NAVIGATION:
|
case GST_EVENT_NAVIGATION:
|
||||||
event =
|
if (filter->in_info.width != filter->out_info.width ||
|
||||||
GST_EVENT (gst_mini_object_make_writable (GST_MINI_OBJECT (event)));
|
filter->in_info.height != filter->out_info.height) {
|
||||||
|
event =
|
||||||
|
GST_EVENT (gst_mini_object_make_writable (GST_MINI_OBJECT (event)));
|
||||||
|
|
||||||
structure = (GstStructure *) gst_event_get_structure (event);
|
structure = (GstStructure *) gst_event_get_structure (event);
|
||||||
if (gst_structure_get_double (structure, "pointer_x", &a)) {
|
if (gst_structure_get_double (structure, "pointer_x", &a)) {
|
||||||
gst_structure_set (structure, "pointer_x", G_TYPE_DOUBLE,
|
gst_structure_set (structure, "pointer_x", G_TYPE_DOUBLE,
|
||||||
a * filter->in_info.width / filter->out_info.width, NULL);
|
a * filter->in_info.width / filter->out_info.width, NULL);
|
||||||
}
|
}
|
||||||
if (gst_structure_get_double (structure, "pointer_y", &a)) {
|
if (gst_structure_get_double (structure, "pointer_y", &a)) {
|
||||||
gst_structure_set (structure, "pointer_y", G_TYPE_DOUBLE,
|
gst_structure_set (structure, "pointer_y", G_TYPE_DOUBLE,
|
||||||
a * filter->in_info.height / filter->out_info.height, NULL);
|
a * filter->in_info.height / filter->out_info.height, NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue