Not clear how to implement custom SET_PARAMETER request handling
I wanted to add support for a custom SET_PARAMETER request to my RTSP server. The documentation makes it look like it should be possible, documenting a GstRTSPClient::set-parameter-request
signal, and I found the following mailing list post with some pointers:
https://lists.freedesktop.org/archives/gstreamer-devel/2019-September/072856.html
I managed to cobble something together by connecting to the GstRTSPServer::client-created
signal, then connecting to each client's set-parameter-request
signal. I could now see the requests coming in, but they always result in an error response:
$ telnet localhost 8554
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
SET_PARAMETER rtsp://localhost:8554/test RTSP/2.0
CSeq: 42
Connection: close
Content-Type: text/parameters
Content-Length: 7
foo=bar
RTSP/2.0 451 Parameter Not Understood
CSeq: 42
Server: GStreamer RTSP server
Date: Wed, 17 Mar 2021 03:27:38 GMT
Looking at the handle_set_param_request
source code, it looks like it generates the response before emitting the signal. Reading through that function, I see it calls a params_set
virtual method to handle the request. That sent me down a second implementation attempt:
- create a GstRTSPClient subclass that overrides params_set to handle my parameters.
- create a GstRTSPServer subclass that overrides create_client to return my GstRTSPClient subclass.
(2) turned out to be a problem, as the default implementation of create_client
does substantially more than just create a new client instance. And the additional setup it performs makes use of private GstRTSPServer API not available outside of the library.
So how is this supposed to work? Would it be possible to provide an example demonstrating how the API should be used?