membraneframework / membrane_core

The core of the Membrane Framework, multimedia processing framework written in Elixir
https://membrane.stream
Apache License 2.0
1.31k stars 39 forks source link

Issue with membrane rtsp after v0.7.2 #863

Closed gBillal closed 1 month ago

gBillal commented 1 month ago

Since v0.7.2 where the tcp socket is set to active mode. This causes issues when someone want full control of the underlying tcp socket.

In my case I get the socket and set active to false, so once I try to :gen_tcp.recv and the socket try to send a message in another process, I get the error {:error, :einval} (because the socket is set to active mode)

Noarkhh commented 1 month ago

Hi, I see the issue. In https://github.com/membraneframework/membrane_rtsp/pull/44 the behavior changes (after transferring control the session no longer tries to receive from that socket). Would it be okay if it's fixed there?

gBillal commented 1 month ago

That's great, I'll wait for 0.10.0 release

Noarkhh commented 1 month ago

I just released v0.10.0, give it a try :) Also https://github.com/gBillal/membrane_rtsp_plugin/pull/12 is now ready for review

gBillal commented 1 month ago

unfortunately this is still not fixing my issue. The fact that the rtsp session update the active mode of the socket creates a problem. Since I have another process that always using recv to read from the socket which fails when the socket is in active mode.

Noarkhh commented 1 month ago

are you calling RTSP.transfer_socket_control/2 before that? Calling this function should stop the process from changing the socket's options

gBillal commented 1 month ago

Made a mistake, forgot to set the socket to non-active mode. It works fine now, thanks