Setting the "videoscale" element's "method" property using gstreamer-java

822 views
Skip to first unread message

Matt Hurne

unread,
Sep 9, 2011, 12:32:10 PM9/9/11
to gstream...@googlegroups.com
I would like to set the "videoscale" element's "method" property to GST_VIDEO_SCALE_NEAREST, which is not the default. How can I do so using gstreamer-java?  Will the following work?

videoscaleElement.set("method", "GST_VIDEO_SCALE_NEAREST");

Note that in native gstreamer, GST_VIDEO_SCALE_NEAREST is an enum value, not a string.

System.out.println(videoscaleElement.get("method"));

Gives me:

1

So perhaps I need to use the following?

videoscaleElement.set("method", 2);

I'd hate to rely on an int value for fear of it changing in the underlying code down the road, but I suppose it wouldn't be the end of the world.

Farkas Levente

unread,
Sep 9, 2011, 2:37:43 PM9/9/11
to gstream...@googlegroups.com, Matt Hurne

just check
gst-inspect videoscale
...
method : method
flags: readable, writable
Enum "GstVideoScaleMethod" Default: 1,
"bilinear" Current: 1, "bilinear"
(0): nearest-neighbour - Nearest Neighbour
(1): bilinear - Bilinear
(2): 4-tap - 4-tap

so it's clear that this is the right call:
videoscaleElement.set("method", 2);

--
Levente "Si vis pacem para bellum!"

Farkas Levente

unread,
Sep 9, 2011, 2:38:30 PM9/9/11
to gstream...@googlegroups.com, Matt Hurne

i mean videoscaleElement.set("method", 0);

Matt Hurne

unread,
Sep 9, 2011, 2:41:40 PM9/9/11
to Farkas Levente, gstream...@googlegroups.com

Makes sense, thanks! I had been relying on the Reference Manual at
http://gstreamer.freedesktop.org, which doesn't explicitly provide the
int values the way gst-inspect does. Very useful.

Reply all
Reply to author
Forward
0 new messages