newby help
James
jam at tigger.ws
Wed Mar 31 07:13:33 UTC 2021
> On 31 Mar 2021, at 7:20 am, James <jam at tigger.ws> wrote:
>
>
>
>> On 30 Mar 2021, at 10:23 pm, gotsring <gotsring at live.com> wrote:
>>
>> In this case, I don't think you need to iterate over all the elements
>> manually. You're just trying to grab references to the xvimagesink, correct?
>> If so, use gst_bin_get_by_name(), which returns a reference to the element
>> in question (or NULL). You can name your elements in gst_parse_launch to
>> make them easier to find.
>>
>> Something like:
>> // Name the xvimagesinks in the parse string (just add "name=custom_name")
>> char cmdline[1024];
>> snprintf(
>> cmdline, 1024,
>> "v4l2src device=%s ! tee name=t "
>> "t. ! queue ! videoscale ! video/x-raw,width=768,height=576 ! "
>> "videoconvert ! xvimagesink name=sink1 force-aspect-ratio=false "
>> "t. ! queue ! videoscale ! video/x-raw,width=768,height=576 ! "
>> "videoconvert ! xvimagesink name=sink2 force-aspect-ratio=false",
>> argv[1]
>> );
>> pipeline = gst_parse_launch(cmdline, NULL);
>>
>> // Get references to the xvimagesink elements, we called them sink1 and
>> sink2
>> GstElement* sink1 = gst_bin_get_by_name(GST_BIN(pipeline), "sink1");
>> GstElement* sink2 = gst_bin_get_by_name(GST_BIN(pipeline), "sink2");
>
> Thank you lots
I want to re-parent a window.
The only gooled results I can find are old and use depreciated apis.
I tried
GstVideoOverlay* ov1 = (GstVideoOverlay*) sink1;
GstVideoOverlay* ov2 = (GstVideoOverlay*) sink2;
gst_video_overlay_set_window_handle (ov1, (guintptr) preview1Wid);
based on
https://gstreamer.freedesktop.org/documentation/video/gstvideooverlay.html?gi-language=c#gst_video_overlay_set_window_handle <https://gstreamer.freedesktop.org/documentation/video/gstvideooverlay.html?gi-language=c#gst_video_overlay_set_window_handle>
but was rewarded with
gcc myalt.c -o myalt `pkg-config --cflags --libs gstreamer-1.0`
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /tmp/ccT1P5wY.o: in function `main':
myalt.c:(.text+0x316): undefined reference to `gst_video_overlay_set_window_handle'
collect2: error: ld returned 1 exit status
make: *** [Makefile:9: myalt] Error 1
Anybody please
James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20210331/3181e88e/attachment.htm>
More information about the gstreamer-devel
mailing list