From olivier.crete at collabora.com Tue Jun 28 14:30:28 2022 From: olivier.crete at collabora.com (Olivier =?ISO-8859-1?Q?Cr=EAte?=) Date: Tue, 28 Jun 2022 10:30:28 -0400 Subject: TURN relay in python - nice transmitter In-Reply-To: References: <46c260cffab66c4c9c6df7d0fd0ec7188af6a586.camel@collabora.com> Message-ID: <354c79bdc61d5c0db23d8c9e8a2c23d10c265d73.camel@collabora.com> Hi, The GLib.PtrArray should just be translated from a Python list (a []). That said, I'm not sure we can create this thing from Python. It feels like I need to add an second property that is more introspection friendly... Olivier On Mon, 2021-11-08 at 16:17 +0100, Skorpeo Skorpeo wrote: > Hello, > > 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:/? > > When I do stream.set_transmitter_ht('nice', {'relay-info': > [relay_structure]}) I get error: > > gi.repository.GLib.Error: fs-error: Invalid type of argument relay- > info for transmitter nice (100) > > I confirm that this is what I am passing in: > {'relay-info': [ 0x7f9d58741bd0)>]} > > I was able to get the function to accept the following: > > {'relay-info': GLib.PtrArray()}? > {'relay-info': GObject.Value(GLib.PtrArray)} > > both of which are meaningless because I haven't figured out a way of > putting values in there. > > {'relay-info': relay_structure} also doesn't work > > I also tried various things like: > > value = GObject.Value(GLib.PtrArray) > value.set_value([relay_structure]) #also doesn't work > > value = GObject.Value(GLib.PtrArray) > value.set_instance([relay_structure]) #also doesn't work > > I also tried other things none of which got me to the promised land.? > > 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? > > Your input is greatly appreciated > Many thanks > > On Mon, Nov 8, 2021 at 3:19 PM Olivier Cr?te > wrote: > > Hi, > > > > I believe you need to put it in an array in a dict. So something > > like > > > > stream.set_transmitter_ht(trans, {'relay-info', [relay_structure]}) > > > > You can put other parametes inside the dict. > > You can also put multiple relays inside the array. > > > > Olivier > > > > > > On Mon, 2021-11-08 at 00:01 +0100, Skorpeo Skorpeo wrote: > > > Hi, > > > > > > How can I add TURN server info for a nice transmitter in python > > > for > > > Farstream?? I have tried different things but to no avail.? I am > > > not > > > sure how to get a hold of the transmitter itself or to pass it > > > parameters initially.? Right now local candidates generated are > > > only > > > of type "host". > > > > > > I use the function stream.set_transmitter("nice") which appears > > > to > > > also allow for a parameter argument.? I can get as far as: > > > > > > relay_structure = Gst.Structure.new_empty("relay-info") > > > relay_structure.set_value("ip", "123.45.678.999") > > > relay_structure.set_value("port", 3478) > > > relay_structure.set_value("username", "user1") > > > relay_structure.set_value("password", "user1pwd") > > > relay_structure.set_value("relay-type", "udp") > > > > > > but I am not sure how to pass this parameter to > > > stream.set_transmitter() or stream.set_transmitter_ht(). > > > > > > I also see the function nice_agent_set_relay_info in the source > > > but I > > > am not sure how to use it or access it in python. > > > > > > I would also like to add STUN but just trying to figure out TURN > > > first... > > > > > > Any help would be massively appreciated! > > > > > > Thanks! > > > > > > > > -- Olivier Cr?te olivier.crete at collabora.com From skorpeo11 at gmail.com Tue Jun 28 17:43:47 2022 From: skorpeo11 at gmail.com (Skorpeo Skorpeo) Date: Tue, 28 Jun 2022 12:43:47 -0500 Subject: TURN relay in python - nice transmitter In-Reply-To: <354c79bdc61d5c0db23d8c9e8a2c23d10c265d73.camel@collabora.com> References: <46c260cffab66c4c9c6df7d0fd0ec7188af6a586.camel@collabora.com> <354c79bdc61d5c0db23d8c9e8a2c23d10c265d73.camel@collabora.com> Message-ID: Hi, Thank you for the reply. I haven't had success in using TURN, although it would be great.., however I am able to use it with stun :). I am completely in the dark on the c side of things otherwise I would have tried to solve it... Thanks again! On Tue, Jun 28, 2022 at 9:30 AM Olivier Cr?te wrote: > Hi, > > The GLib.PtrArray should just be translated from a Python list (a []). > > That said, I'm not sure we can create this thing from Python. It feels > like I need to add an second property that is more introspection > friendly... > > Olivier > > On Mon, 2021-11-08 at 16:17 +0100, Skorpeo Skorpeo wrote: > > Hello, > > > > 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:/ > > > > When I do stream.set_transmitter_ht('nice', {'relay-info': > > [relay_structure]}) I get error: > > > > gi.repository.GLib.Error: fs-error: Invalid type of argument relay- > > info for transmitter nice (100) > > > > I confirm that this is what I am passing in: > > {'relay-info': [ > 0x7f9d58741bd0)>]} > > > > I was able to get the function to accept the following: > > > > {'relay-info': GLib.PtrArray()} > > {'relay-info': GObject.Value(GLib.PtrArray)} > > > > both of which are meaningless because I haven't figured out a way of > > putting values in there. > > > > {'relay-info': relay_structure} also doesn't work > > > > I also tried various things like: > > > > value = GObject.Value(GLib.PtrArray) > > value.set_value([relay_structure]) #also doesn't work > > > > value = GObject.Value(GLib.PtrArray) > > value.set_instance([relay_structure]) #also doesn't work > > > > I also tried other things none of which got me to the promised land. > > > > 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? > > > > Your input is greatly appreciated > > Many thanks > > > > On Mon, Nov 8, 2021 at 3:19 PM Olivier Cr?te > > wrote: > > > Hi, > > > > > > I believe you need to put it in an array in a dict. So something > > > like > > > > > > stream.set_transmitter_ht(trans, {'relay-info', [relay_structure]}) > > > > > > You can put other parametes inside the dict. > > > You can also put multiple relays inside the array. > > > > > > Olivier > > > > > > > > > On Mon, 2021-11-08 at 00:01 +0100, Skorpeo Skorpeo wrote: > > > > Hi, > > > > > > > > How can I add TURN server info for a nice transmitter in python > > > > for > > > > Farstream? I have tried different things but to no avail. I am > > > > not > > > > sure how to get a hold of the transmitter itself or to pass it > > > > parameters initially. Right now local candidates generated are > > > > only > > > > of type "host". > > > > > > > > I use the function stream.set_transmitter("nice") which appears > > > > to > > > > also allow for a parameter argument. I can get as far as: > > > > > > > > relay_structure = Gst.Structure.new_empty("relay-info") > > > > relay_structure.set_value("ip", "123.45.678.999") > > > > relay_structure.set_value("port", 3478) > > > > relay_structure.set_value("username", "user1") > > > > relay_structure.set_value("password", "user1pwd") > > > > relay_structure.set_value("relay-type", "udp") > > > > > > > > but I am not sure how to pass this parameter to > > > > stream.set_transmitter() or stream.set_transmitter_ht(). > > > > > > > > I also see the function nice_agent_set_relay_info in the source > > > > but I > > > > am not sure how to use it or access it in python. > > > > > > > > I would also like to add STUN but just trying to figure out TURN > > > > first... > > > > > > > > Any help would be massively appreciated! > > > > > > > > Thanks! > > > > > > > > > > > > > -- > Olivier Cr?te > olivier.crete at collabora.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: