[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gstreamer-devel
Subject:    Re: newby help
From:       James <jam () tigger ! ws>
Date:       2021-03-31 7:13:33
Message-ID: 551E6370-9362-4304-8D92-CC801D4A9A51 () tigger ! ws
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On 31 Mar 2021, at 7:20 am, James <jam@tigger.ws> wrote:
> 
> 
> 
> > On 30 Mar 2021, at 10:23 pm, gotsring <gotsring@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


[Attachment #5 (unknown)]

<html><head><meta http-equiv="Content-Type" content="text/html; \
charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: \
space; line-break: after-white-space;" class=""><br class=""><div><br \
class=""><blockquote type="cite" class=""><div class="">On 31 Mar 2021, at 7:20 am, \
James &lt;<a href="mailto:jam@tigger.ws" class="">jam@tigger.ws</a>&gt; \
wrote:</div><br class="Apple-interchange-newline"><div class=""><br \
style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 24px; \
font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: \
normal; text-align: start; text-indent: 0px; text-transform: none; white-space: \
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" \
class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: \
24px; font-style: normal; font-variant-caps: normal; font-weight: normal; \
letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; \
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; \
text-decoration: none;" class=""><blockquote type="cite" style="font-family: \
Helvetica; font-size: 24px; font-style: normal; font-variant-caps: normal; \
font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; \
text-indent: 0px; text-transform: none; white-space: normal; widows: auto; \
word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; \
text-decoration: none;" class="">On 30 Mar 2021, at 10:23 pm, gotsring &lt;<a \
href="mailto:gotsring@live.com" class="">gotsring@live.com</a>&gt; wrote:<br \
class=""><br class="">In this case, I don't think you need to iterate over all the \
elements<br class="">manually. You're just trying to grab references to the \
xvimagesink, correct?<br class="">If so, use gst_bin_get_by_name(), which returns a \
reference to the element<br class="">in question (or NULL). You can name your \
elements in gst_parse_launch to<br class="">make them easier to find.<br class=""><br \
class="">Something like:<br class="">// Name the xvimagesinks in the parse string \
(just add "name=custom_name")<br class="">char cmdline[1024];<br \
class="">snprintf(<br class="">&nbsp;cmdline, 1024,<br class="">&nbsp;"v4l2src \
device=%s ! tee name=t "<br class="">&nbsp;"t. ! queue ! videoscale ! \
video/x-raw,width=768,height=576 ! "<br class="">&nbsp;"videoconvert ! xvimagesink \
name=sink1 force-aspect-ratio=false "<br class="">&nbsp;"t. ! queue ! videoscale ! \
video/x-raw,width=768,height=576 ! "<br class="">&nbsp;"videoconvert ! xvimagesink \
name=sink2 force-aspect-ratio=false",<br class="">&nbsp;argv[1]<br class="">);<br \
class="">pipeline = gst_parse_launch(cmdline, NULL);<br class=""><br class="">// Get \
references to the xvimagesink elements, we called them sink1 and<br class="">sink2<br \
class="">GstElement* sink1 = gst_bin_get_by_name(GST_BIN(pipeline), "sink1");<br \
class="">GstElement* sink2 = gst_bin_get_by_name(GST_BIN(pipeline), "sink2");<br \
class=""></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; \
font-size: 24px; font-style: normal; font-variant-caps: normal; font-weight: normal; \
letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; \
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; \
text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: \
Helvetica; font-size: 24px; font-style: normal; font-variant-caps: normal; \
font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; \
text-transform: none; white-space: normal; word-spacing: 0px; \
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline \
!important;" class="">Thank you lots</span><br style="caret-color: rgb(0, 0, 0); \
font-family: Helvetica; font-size: 24px; font-style: normal; font-variant-caps: \
normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: \
0px; text-transform: none; white-space: normal; word-spacing: 0px; \
-webkit-text-stroke-width: 0px; text-decoration: none;" \
class=""></div></blockquote></div><br class=""><div class="">I want to re-parent a \
window.</div><div class="">The only gooled results I can find are old and use \
depreciated apis.</div><div class=""><br class=""></div><div class="">I \
tried</div><div class=""><br class=""></div><div class=""><div class="">&nbsp; &nbsp; \
GstVideoOverlay* ov1 = (GstVideoOverlay*) sink1;</div><div class="">&nbsp; &nbsp; \
GstVideoOverlay* ov2 = (GstVideoOverlay*) sink2;</div><div class=""><br \
class=""></div><div class="">&nbsp; &nbsp; gst_video_overlay_set_window_handle (ov1, \
(guintptr) &nbsp;preview1Wid);</div><div class=""><br class=""></div></div><div \
class="">based on</div><div class=""><br class=""></div><div class=""><a \
href="https://gstreamer.freedesktop.org/documentation/video/gstvideooverlay.html?gi-language=c#gst_video_overlay_set_window_handle" \
class="">https://gstreamer.freedesktop.org/documentation/video/gstvideooverlay.html?gi-language=c#gst_video_overlay_set_window_handle</a></div><div \
class=""><br class=""></div><div class="">but was rewarded with</div><div \
class=""><br class=""></div><div class=""><div class="">gcc myalt.c -o myalt \
`pkg-config --cflags --libs gstreamer-1.0`</div><div \
class="">/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: \
/tmp/ccT1P5wY.o: in function `main':</div><div class="">myalt.c:(.text+0x316): \
undefined reference to `gst_video_overlay_set_window_handle'</div><div \
class="">collect2: error: ld returned 1 exit status</div><div class="">make: *** \
[Makefile:9: myalt] Error 1</div></div><div class=""><br class=""></div><div \
class="">Anybody please</div><div class="">James</div></body></html>



_______________________________________________
gstreamer-devel mailing list
gstreamer-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic