[FFmpeg-devel] [PATCH 2/2] avformat: add protocol_whitelist

Clément Bœsch u at pkh.me
Sun Jan 24 14:00:14 CET 2016


On Sun, Jan 24, 2016 at 01:57:05PM +0100, wm4 wrote:
> On Sun, 24 Jan 2016 13:43:40 +0100
> Clément Bœsch <u at pkh.me> wrote:
> 
> > On Sun, Jan 24, 2016 at 12:47:59PM +0100, Nicolas George wrote:
> > > Le quintidi 5 pluviôse, an CCXXIV, Michael Niedermayer a écrit :  
> > > > --- a/libavformat/avio.h
> > > > +++ b/libavformat/avio.h
> > > > @@ -595,6 +595,10 @@ int avio_open(AVIOContext **s, const char *url, int flags);
> > > >  int avio_open2(AVIOContext **s, const char *url, int flags,
> > > >                 const AVIOInterruptCB *int_cb, AVDictionary **options);
> > > >  
> > > > +int avio_open_whitelist(AVIOContext **s, const char *url, int flags,
> > > > +                         const AVIOInterruptCB *int_cb, AVDictionary **options,
> > > > +                         const char *whitelist);
> > > > +  
> > > 
> > > Please no! Adding new arguments to a function that already has too many and
> > > using a string as a structured data structure: two things that are already
> > > present way too much in the code base and should be avoided for future
> > > design.
> > > 
> > > I suggest to put it in a structure, maybe AVIOSettings (or directly
> > > AVGlobalSettings), as an array of protocols, and with int_cb while we are at
> > > it:
> > > 
> > > typedef struct AVIOSettings {
> > >     AVIOInterruptCB *int_cb;
> > >     struct URLProtocol **protocols;
> > >     unsigned nb_protocols;
> > > }
> > > 
> > > Then, if someone really like strings for user interface, they can do:
> > > 
> > > int avio_settings_set_protocols_whitelist_string(AVIOSettings *settings,
> > >                                                  const char *whitelist);
> > >   
> > 
> > Why not an entry in the AVDictionary options?
> > 
> 
> Can AVDictionary store pointers?

The patch seems to be about adding a white list as a string, so
key:"whitelist" → value:"file,http".

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160124/07872451/attachment.sig>


More information about the ffmpeg-devel mailing list