Setting the RTSPContext auth token from Python

Chris Wiggins chris at wiggins.nz
Sun Apr 12 00:42:37 UTC 2020


I’m trying to override the authentication method by subclassing GstRtspServer.RTSPAuth, and then writing a do_authenticate to suit.

Once I’ve verified the user’s credentials, I can’t set the token as I get the following error:

Traceback (most recent call last):
  File "test.py", line 60, in do_authenticate
    context.token = token
RuntimeError: unable to set value for field



Auth class:

class Auth(GstRtspServer.RTSPAuth):
  def __init__(self):
    GstRtspServer.RTSPAuth.__init__(self)
    self.set_supported_methods(GstRtsp.RTSPAuthMethod.BASIC)

    anonymous = GstRtspServer.RTSPToken()
    anonymous.set_string(GstRtspServer.RTSP_TOKEN_MEDIA_FACTORY_ROLE, "anonymous")

    self.set_default_token(anonymous)


  def do_authenticate(self, context):
    # Verify credentials, then when OK, try to set the token:
    token = GstRtspServer.RTSPToken.new()
     context.token = token



Is there another way I can set the token in the RTSP Context struct or have I hit a bug with the bindings? Happy to try and fix this myself and submit a MR but not sure where to look.

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20200412/824c8bf6/attachment-0001.htm>


More information about the gstreamer-devel mailing list