<div dir="ltr"><div dir="ltr"><div>Hello,</div><div><br></div><div>Thank you for the quick response! I spent more time this morning and got a little further and I had also tried that but it didn't work:/ <br></div><div><br></div><div>
When I do stream.set_transmitter_ht('nice', {'relay-info': [relay_structure]}) I get error:<br></div><div><br></div><div>gi.repository.GLib.Error: fs-error: Invalid type of argument relay-info for transmitter nice (100)</div><div><br></div><div>I confirm that this is what I am passing in:<br></div><div>{'relay-info': [<Gst.Structure object at 0x111fb5b80 (GstStructure at 0x7f9d58741bd0)>]}</div><div><br></div><div>I was able to get the function to accept the following:</div><div><br></div><div>{'relay-info': GLib.PtrArray()} <br></div><div>{'relay-info': GObject.Value(GLib.PtrArray)} <br></div><div><br></div><div>both of which are meaningless because I haven't figured out a way of putting values in there.</div><div><br></div><div>{'relay-info': relay_structure} also doesn't work</div><div><br></div><div>I also tried various things like:</div><div><br></div><div>value = GObject.Value(GLib.PtrArray)<br>value.set_value([relay_structure]) #also doesn't work</div><div><br></div><div>value = GObject.Value(GLib.PtrArray)<br>value.set_instance([relay_structure]) #also doesn't work</div><div><br></div><div>I also tried other things none of which got me to the promised land. <br></div><div><br></div><div>It seems I have to somehow instantiate a GLib.PtrArray in python but there appears to be no facility for that and the function doesn't seem to accept a python list as equivalent?</div><div><br></div><div>Your input is greatly appreciated<br></div><div>Many thanks<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 8, 2021 at 3:19 PM Olivier Crête <<a href="mailto:olivier.crete@collabora.com">olivier.crete@collabora.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
I believe you need to put it in an array in a dict. So something like<br>
<br>
stream.set_transmitter_ht(trans, {'relay-info', [relay_structure]})<br>
<br>
You can put other parametes inside the dict.<br>
You can also put multiple relays inside the array.<br>
<br>
Olivier<br>
<br>
<br>
On Mon, 2021-11-08 at 00:01 +0100, Skorpeo Skorpeo wrote:<br>
> Hi,<br>
> <br>
> How can I add TURN server info for a nice transmitter in python for<br>
> Farstream? I have tried different things but to no avail. I am not<br>
> sure how to get a hold of the transmitter itself or to pass it<br>
> parameters initially. Right now local candidates generated are only<br>
> of type "host".<br>
> <br>
> I use the function stream.set_transmitter("nice") which appears to<br>
> also allow for a parameter argument. I can get as far as:<br>
> <br>
> relay_structure = Gst.Structure.new_empty("relay-info") <br>
> relay_structure.set_value("ip", "123.45.678.999")<br>
> relay_structure.set_value("port", 3478)<br>
> relay_structure.set_value("username", "user1")<br>
> relay_structure.set_value("password", "user1pwd")<br>
> relay_structure.set_value("relay-type", "udp")<br>
> <br>
> but I am not sure how to pass this parameter to<br>
> stream.set_transmitter() or stream.set_transmitter_ht().<br>
> <br>
> I also see the function nice_agent_set_relay_info in the source but I<br>
> am not sure how to use it or access it in python.<br>
> <br>
> I would also like to add STUN but just trying to figure out TURN<br>
> first...<br>
> <br>
> Any help would be massively appreciated!<br>
> <br>
> Thanks!<br>
> <br>
> <br>
<br>
-- <br>
Olivier Crête<br>
<a href="mailto:olivier.crete@collabora.com" target="_blank">olivier.crete@collabora.com</a><br>
</blockquote></div></div>