<div dir="auto">Ahhh I think I see, so then how do you go about emitting that signal without using it from playbin for these action signals</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 17 Dec 2020, 14:04 Michael Johnson, <<a href="mailto:liquidmikerrs@gmail.com">liquidmikerrs@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Regardless, if you want to press a button to change audio stream surely you emit when the button is pressed, which then causes the callback to run <div dir="auto"><br></div><div dir="auto">Without that it only emits on startup and close. And that's not helpful </div><div dir="auto"><br></div><div dir="auto">Thank you for all your help so far, it's been highly appreciated</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 17 Dec 2020, 13:50 Michael Johnson, <<a href="mailto:liquidmikerrs@gmail.com" target="_blank" rel="noreferrer">liquidmikerrs@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Oh wait I see what you mean about the first point. My eyes can't see a minus sign apparently :P<div dir="auto"><br></div><div dir="auto"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 17 Dec 2020, 13:49 Michael Johnson, <<a href="mailto:liquidmikerrs@gmail.com" rel="noreferrer noreferrer" target="_blank">liquidmikerrs@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">All those warnings are related to not handling the None type, I didn't think that would have any bearing. <div dir="auto"><br></div><div dir="auto">Wait. You're not supposed to use emit? Then why does it exist? Surely you emit a signal to then be caught by the connect. By the logic of setting the value of 2 every them then current audio should go -1,-1,2 not -1,-1,-1. It yields 2 on exit. Which was my point</div><div dir="auto"><br>What is the alternative to using emit then, and why does the alternative still relate to connect? </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 17 Dec 2020, 13:36 Sebastian Dröge, <<a href="mailto:sebastian@centricular.com" rel="noreferrer noreferrer noreferrer" target="_blank">sebastian@centricular.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>On Thu, 2020-12-17 at 12:28 +0000, Michael Johnson wrote:</div><blockquote type="cite" style="margin:0 0 0 .8ex;border-left:2px #729fcf solid;padding-left:1ex"><div dir="auto">As requested a toy example,<div dir="auto">Here we see that the audio-changed emit never activates the connect, maybe because it emits before the video has began playing?</div><div dir="auto"><br></div><div dir="auto">I'm probably doing something very wrong </div></div></blockquote><div><br></div><div>Yeah, you're ignoring compiler warnings here that tell you that you're ignoring potential errors :)</div><div><br></div><div>Make sure to at least `unwrap()` `Result`s instead of ignoring them, then you immediately know if you did something wrong there.</div><div>In this case the emitting of the "audio-changed" signal fails because of the wrong number of arguments.</div><div><br></div><div>But that also doesn't matter here: that signal is supposed to be emitted by playbin whenever something changes, not by you.</div><div><br></div><div>After removing that line what I get is</div><div><br></div><div><font face="monospace">current audio track is -1</font></div><div><font face="monospace">number of audio tracks is 1</font></div><div><font face="monospace">current audio track is -1</font></div><div><font face="monospace">number of audio tracks is 2</font></div><div><font face="monospace">current audio track is -1</font></div><div><font face="monospace">number of audio tracks is 3</font></div><div><br></div><div>That looks as expected. Every signal emission you're setting the current audio track to 2, but only the last time there actually is a 3rd (0, 1, 2) audio track available.</div><div>So in the end it should use the 3rd audio track.</div><div><br></div><div>If you change it for example to set it to 1 then you'll see that during the last signal emission the current audio track is 1.</div><div><br></div><div><br></div><div>For getting state into the signal handler closure, take a look at the <a href="http://overlay-composition.rs" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">overlay-composition.rs</a> example and what it does with the DrawingContext inside the Arc<Mutex<_>> there.</div><div><br></div><div><span><pre>-- <br></pre><div style="width:71ch">Sebastian Dröge, Centricular Ltd · <a href="http://www.centricular.com" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">https://www.centricular.com</a></div><div style="width:71ch"><br></div></span></div></div>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>