If we try to reuse a thread right after we made it stop, we end up using a
stopped thread. Catch this case and only reuse threads that are not stopping.
Don't authorize on methods anymore but on the resources that we
try to access, this is more flexible.
Move the authorization checks to where they are needed and let the
check return the response on error.
Avoid passing GstStructure in the add_role method, use varargs instead
to construct the structure behind the scenes. We can then also use the
structure name as the role and simplify some more logic.
Move handling of the unauthorized response to the auth module, it can add
the appropriate headers to request authorization for the required method
much better than the client.
Start the media pipeline in the provided context (or our default one
when NULL). This makes sure that we run the bus thread in this context and that
all media threads are children of this context.
Add a simply miniobject that contains the authorizations. The object contains a
GstStructure that hold all authorization fields. When a user is authenticated,
the auth module will create a Token for the user. The token is then used to
check what operations the user is allowed to do and various other configuration
values.
Remove the auth object from media and factory. We want to have the RTSPClient
authenticate and authorize resources, there is no need to place another auth
manager on the media/factory.
Make it possible to add multiple basic authorisation tokens to one authorization
object. Associate with each token an authorization group that will define what
capabilities are allowed.
Cache the media in DESCRIBE based on the longest matching path with the uri
that we can find in the mount points.
Rework the setup request a little to get the media from the session or from
the longest matching path, this way we can derive the control string as
everything after the path instead of hardcoding it.
Find the stream based on the control string and only open a session when all
this can be done.