Michael Niedermayer wrote: [...]
Ok. Looking at the rest of the code, I suspect a good solution would be something like rtsp://localhost:5454?tcp/test1-rtsp.mpg... And we will have to overwrite s->filename for removing the "?..." options that are between port number and path. or just add a field to AVFormatContext specifying the preferred protocol Yes, that would work too. And it would be simpler. But... Is it a good idea to add a new field to AVFormatContext every time that a format requires some new information, which is not used by other formats? Just trying to evaluate all the possible advantages and disadvantages...
Is rt(s)p really the only thing that has a tcp/udp switch need? Couldnt mms benefit from it too? And maybe others ... Double thinking about it, yes, this field can be useful to mms and maybe other protocols (I was under the impression that mms, mmsh, mmsu, and similar are considered as different protocols, but using an AVFormatContext field to select the correct protocol makes sense).
[...]
Or maybe we can use a new AVFormatContext's flag? (this would avoid changing AVFormatContext).
A flag is tricky for the current TCP/UDP/UDP_MULTICAST.
I was thinking about a flag for TCP vs UDP and a flag for unicast vs multicast (ok, that would create the problem with the impossible multicast-tcp combination). Anyway, in the next days I'll work on a patch for adding a flag to AVFormatContext and using it for selecting the transport protocol. Thanks, Luca