[FFmpeg-devel] [PATCH] Private options for url protocols
Michael Niedermayer
michaelni at gmx.at
Tue Nov 22 21:25:51 CET 2011
On Sat, Nov 19, 2011 at 11:09:32PM +0100, Michael Niedermayer wrote:
> On Sat, Nov 19, 2011 at 10:44:18PM +0100, Stefano Sabatini wrote:
> > On date Saturday 2011-11-19 21:36:48 +0100, Michael Niedermayer encoded:
> > > On Tue, Nov 15, 2011 at 02:43:24PM +0100, Michael Niedermayer wrote:
> > > > On Tue, Nov 15, 2011 at 01:42:46AM +0100, Stefano Sabatini wrote:
> > > > > On date Thursday 2011-11-10 17:56:11 +0100, Michael Niedermayer encoded:
> > > > > > Hi
> > > > > >
> > > > > > Attached patchset implemets subj
> > > > > > Comments welcome, ill probably push it tomorrow if there are no
> > > > > > objections
> > > > > >
> > > > > > An example of how useage would look is:
> > > > > > ffplay http,user-agent=JustTesting://samples.multimedia.cx/MPEG2/test422.m2v
> > > > > >
> > > > > > the syntax would also work for nested protocols ...
> > > > > >
> > > > > > --
> > > > > > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> > > > > >
> > > > > > No human being will ever know the Truth, for even if they happen to say it
> > > > > > by chance, they would not even known they had done so. -- Xenophanes
> > > > >
> > > > > > From d300a9c6a787827dbe2d86a1b330b8aba830bcc7 Mon Sep 17 00:00:00 2001
> > > > > > From: Michael Niedermayer <michaelni at gmx.at>
> > > > > > Date: Thu, 10 Nov 2011 17:02:02 +0100
> > > > > > Subject: [PATCH 1/2] avio: allow any chars in protocols
> > > > > >
> > > > > > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > > > > > ---
> > > > > > libavformat/avio.c | 6 +++---
> > > > > > 1 files changed, 3 insertions(+), 3 deletions(-)
> > > > > >
> > > > > > diff --git a/libavformat/avio.c b/libavformat/avio.c
> > > > > > index 47b2d51..f08cbab 100644
> > > > > > --- a/libavformat/avio.c
> > > > > > +++ b/libavformat/avio.c
> > > > > > @@ -221,17 +221,17 @@ int ffurl_alloc(URLContext **puc, const char *filename, int flags)
> > > > > > {
> > > > > > URLProtocol *up;
> > > > > > char proto_str[128], proto_nested[128], *ptr;
> > > > > > - size_t proto_len = strspn(filename, URL_SCHEME_CHARS);
> > > > > > + const char *proto_end = strchr(filename, ':');
> > > > >
> > > > > uhmm... what if you have ":" in the options? e.g.:
> > > > > ffplay http,user-agent=::the_bloody_user_agent::://samples.multimedia.cx/MPEG2/test422.m2v
> > > > >
> > > > > I still find the lack of defined namespaces for the options a big
> > > > > issue, but I can't say what would be a good way of setting this,
> > > > > maybe:
> > > > > -proto_opts=user_agent=... http://...
> > > > >
> > > > > yes that would be inconsistent...
> > > >
> > > > also theres the problem that protocols can be nested like
> > > > applehttp+http:...
> > > > we should be able to transfer options specifically to one
> >
> > > are you ok if i commit the code with the unchanged syntax ?
> > > This way of passing options is mostly just relevant until the next
> > > ABI bump anyway. And i dont see a easy way to pass arbitrary strings
> > > nor do i see much need for it ...
> >
> > Not being able of specifying arbitrary strings containing escaping
> > characters looks like a serious limitation to me, but if you say this
> > is just temporary I won't object in case you commit this.
>
> If you want to write a implementation that can pass arbitrary strings
> that surely is welcome. ?
ive commited a variant that should support arbitrary chars, the way it
works is that you just specify the seperator character:
ffplay http,:user-agent:JustTesting::://samples.multimedia.cx/MPEG2/test422.m2v
ffplay http,Xuser-agentXJust/,:TestingXX://samples.multimedia.cx/MPEG2/test422.m2v
improvments welcome of course
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I have often repented speaking, but never of holding my tongue.
-- Xenocrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111122/55beff42/attachment.asc>
More information about the ffmpeg-devel
mailing list