Re: [FFmpeg-devel] [PATCH] avformat: Add a protocol blacklisting API

2016-03-04 Thread Michael Niedermayer
On Fri, Mar 04, 2016 at 01:34:55PM +, Derek Buitenhuis wrote:
> On 3/3/2016 7:50 PM, Michael Niedermayer wrote:
> > The io_open/close callbacks afterwards seem direct access IIUC
> > so its not possible to remove or add any fields prior
> > 
> > though maybe they have been added so recently that its ok to move
> > them above all "no direct access" fields
> > or maybe iam missing something
> 
> Crap. I must have screwed up when merging those callbacks. I can move
> the be blacklist entry under them, or I can break ABI and move both,
> since I don't think there is release.

i thought it was post 3.0 but it seems, it was in 3.0

git grep io_close release/3.0:libavformat/avformat.h
release/3.0:libavformat/avformat.h:#define AVFMT_FLAG_CUSTOM_IO0x0080 ///< 
The caller has supplied a custom AVIOContext, don't avio_close() it.
release/3.0:libavformat/avformat.h: * @deprecated Use io_open and io_close.
release/3.0:libavformat/avformat.h:void (*io_close)(struct AVFormatContext 
*s, AVIOContext *pb);



> 
> Which do people prefer? They're both kinda meh.
> 
> - Derek
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Modern terrorism, a quick summary: Need oil, start war with country that
has oil, kill hundread thousands in war. Let country fall into chaos,
be surprised about raise of fundamantalists. Drop more bombs, kill more
people, be surprised about them taking revenge and drop even more bombs
and strip your own citizens of their rights and freedoms. to be continued


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat: Add a protocol blacklisting API

2016-03-04 Thread Derek Buitenhuis
On 3/4/2016 3:02 PM, James Almer wrote:
> ry to non break ABI just yet, leave it as last resort. We did it not even
> half a year ago, and we'd have to push every single scheduled deprecation.
> If this can be resolved moving only the new entries then that's preferable.

OK I did it this way.

- Derek
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat: Add a protocol blacklisting API

2016-03-04 Thread James Almer
On 3/4/2016 10:34 AM, Derek Buitenhuis wrote:
> On 3/3/2016 7:50 PM, Michael Niedermayer wrote:
>> The io_open/close callbacks afterwards seem direct access IIUC
>> so its not possible to remove or add any fields prior
>>
>> though maybe they have been added so recently that its ok to move
>> them above all "no direct access" fields
>> or maybe iam missing something
> 
> Crap. I must have screwed up when merging those callbacks. I can move
> the be blacklist entry under them, or I can break ABI and move both,
> since I don't think there is release.

Try to non break ABI just yet, leave it as last resort. We did it not even
half a year ago, and we'd have to push every single scheduled deprecation.
If this can be resolved moving only the new entries then that's preferable.

> 
> Which do people prefer? They're both kinda meh.
> 
> - Derek
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat: Add a protocol blacklisting API

2016-03-04 Thread Derek Buitenhuis
On 3/3/2016 7:50 PM, Michael Niedermayer wrote:
> The io_open/close callbacks afterwards seem direct access IIUC
> so its not possible to remove or add any fields prior
> 
> though maybe they have been added so recently that its ok to move
> them above all "no direct access" fields
> or maybe iam missing something

Crap. I must have screwed up when merging those callbacks. I can move
the be blacklist entry under them, or I can break ABI and move both,
since I don't think there is release.

Which do people prefer? They're both kinda meh.

- Derek
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat: Add a protocol blacklisting API

2016-03-03 Thread Michael Niedermayer
On Thu, Mar 03, 2016 at 05:18:03PM +, Derek Buitenhuis wrote:
> Signed-off-by: Derek Buitenhuis 
> ---
> This matches API with Libav, in a forthcoming merge, using our
> exisiting infastructure code.
> 
> CC'd Michael, since he wrote the whitelisting code.
> 
> This has been tested with FATE.
> ---
>  Changelog |  1 +
>  doc/APIchanges|  3 +++
>  libavformat/async.c   |  2 +-
>  libavformat/avformat.h|  7 +++
>  libavformat/avidec.c  |  2 +-
>  libavformat/avio.c| 22 --
>  libavformat/avio.h|  5 +
>  libavformat/avio_internal.h   |  2 +-
>  libavformat/aviobuf.c | 13 +
>  libavformat/cache.c   |  2 +-
>  libavformat/concat.c  |  2 +-
>  libavformat/concatdec.c   |  2 +-
>  libavformat/crypto.c  |  2 +-
>  libavformat/ftp.c |  4 ++--
>  libavformat/gopher.c  |  2 +-
>  libavformat/hls.c |  2 +-
>  libavformat/hlsproto.c|  4 ++--
>  libavformat/http.c|  6 +++---
>  libavformat/icecast.c |  2 +-
>  libavformat/internal.h|  2 +-
>  libavformat/md5proto.c|  2 +-
>  libavformat/mmst.c|  2 +-
>  libavformat/mpeg.c|  2 +-
>  libavformat/options.c |  2 +-
>  libavformat/options_table.h   |  1 +
>  libavformat/rdt.c |  2 +-
>  libavformat/rtmpcrypt.c   |  2 +-
>  libavformat/rtmpproto.c   |  4 ++--
>  libavformat/rtpdec_asf.c  |  2 +-
>  libavformat/rtpproto.c|  6 +++---
>  libavformat/rtsp.c| 10 +-
>  libavformat/rtspdec.c |  4 ++--
>  libavformat/sapdec.c  |  4 ++--
>  libavformat/sapenc.c  |  4 ++--
>  libavformat/smoothstreamingenc.c  |  8 
>  libavformat/srtpproto.c   |  2 +-
>  libavformat/subfile.c |  2 +-
>  libavformat/tls.c |  2 +-
>  libavformat/tls_securetransport.c |  2 +-
>  libavformat/url.h |  3 ++-
>  libavformat/utils.c   | 19 +++
>  libavformat/version.h |  4 ++--
>  42 files changed, 114 insertions(+), 62 deletions(-)
> 
> diff --git a/Changelog b/Changelog
> index d6459a8..0e70724 100644
> --- a/Changelog
> +++ b/Changelog
> @@ -10,6 +10,7 @@ version :
>  - datascope filter
>  - bench and abench filters
>  - ciescope filter
> +- protocol blacklisting API
>  
>  
>  version 3.0:
> diff --git a/doc/APIchanges b/doc/APIchanges
> index a75f346..2fc6a71 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -15,6 +15,9 @@ libavutil: 2015-08-28
>  
>  API changes, most recent first:
>  
> +2016-XX-XX - xxx - lavf 57.28.100
> +  Add protocol blacklisting API
> +
>  2016-02-28 - xxx - lavc 57.27.101
>Validate AVFrame returned by get_buffer2 to have required
>planes not NULL and unused planes set to NULL as crashes
> diff --git a/libavformat/async.c b/libavformat/async.c
> index a835292..0cc6fb0 100644
> --- a/libavformat/async.c
> +++ b/libavformat/async.c
> @@ -251,7 +251,7 @@ static int async_open(URLContext *h, const char *arg, int 
> flags, AVDictionary **
>  
>  /* wrap interrupt callback */
>  c->interrupt_callback = h->interrupt_callback;
> -ret = ffurl_open_whitelist(>inner, arg, flags, _callback, 
> options, h->protocol_whitelist);
> +ret = ffurl_open_whitelist(>inner, arg, flags, _callback, 
> options, h->protocol_whitelist, h->protocol_blacklist);
>  if (ret != 0) {
>  av_log(h, AV_LOG_ERROR, "ffurl_open failed : %s, %s\n", 
> av_err2str(ret), arg);
>  goto url_fail;

> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> index b843a4b..b133575 100644
> --- a/libavformat/avformat.h
> +++ b/libavformat/avformat.h
> @@ -1838,6 +1838,13 @@ typedef struct AVFormatContext {
>   */
>  char *protocol_whitelist;
>  
> +/**
> + * ',' separated list of disallowed protocols.
> + * - encoding: unused
> + * - decoding: set by user through AVOptions (NO direct access)
> + */
> +char *protocol_blacklist;
> +
>  /*
>   * A callback for opening new IO streams.
>   *

The io_open/close callbacks afterwards seem direct access IIUC
so its not possible to remove or add any fields prior

though maybe they have been added so recently that its ok to move
them above all "no direct access" fields
or maybe iam missing something

otherwise no objections from me



[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There will always be a question for which you do not know the correct answer.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org

[FFmpeg-devel] [PATCH] avformat: Add a protocol blacklisting API

2016-03-03 Thread Derek Buitenhuis
Signed-off-by: Derek Buitenhuis 
---
This matches API with Libav, in a forthcoming merge, using our
exisiting infastructure code.

CC'd Michael, since he wrote the whitelisting code.

This has been tested with FATE.
---
 Changelog |  1 +
 doc/APIchanges|  3 +++
 libavformat/async.c   |  2 +-
 libavformat/avformat.h|  7 +++
 libavformat/avidec.c  |  2 +-
 libavformat/avio.c| 22 --
 libavformat/avio.h|  5 +
 libavformat/avio_internal.h   |  2 +-
 libavformat/aviobuf.c | 13 +
 libavformat/cache.c   |  2 +-
 libavformat/concat.c  |  2 +-
 libavformat/concatdec.c   |  2 +-
 libavformat/crypto.c  |  2 +-
 libavformat/ftp.c |  4 ++--
 libavformat/gopher.c  |  2 +-
 libavformat/hls.c |  2 +-
 libavformat/hlsproto.c|  4 ++--
 libavformat/http.c|  6 +++---
 libavformat/icecast.c |  2 +-
 libavformat/internal.h|  2 +-
 libavformat/md5proto.c|  2 +-
 libavformat/mmst.c|  2 +-
 libavformat/mpeg.c|  2 +-
 libavformat/options.c |  2 +-
 libavformat/options_table.h   |  1 +
 libavformat/rdt.c |  2 +-
 libavformat/rtmpcrypt.c   |  2 +-
 libavformat/rtmpproto.c   |  4 ++--
 libavformat/rtpdec_asf.c  |  2 +-
 libavformat/rtpproto.c|  6 +++---
 libavformat/rtsp.c| 10 +-
 libavformat/rtspdec.c |  4 ++--
 libavformat/sapdec.c  |  4 ++--
 libavformat/sapenc.c  |  4 ++--
 libavformat/smoothstreamingenc.c  |  8 
 libavformat/srtpproto.c   |  2 +-
 libavformat/subfile.c |  2 +-
 libavformat/tls.c |  2 +-
 libavformat/tls_securetransport.c |  2 +-
 libavformat/url.h |  3 ++-
 libavformat/utils.c   | 19 +++
 libavformat/version.h |  4 ++--
 42 files changed, 114 insertions(+), 62 deletions(-)

diff --git a/Changelog b/Changelog
index d6459a8..0e70724 100644
--- a/Changelog
+++ b/Changelog
@@ -10,6 +10,7 @@ version :
 - datascope filter
 - bench and abench filters
 - ciescope filter
+- protocol blacklisting API
 
 
 version 3.0:
diff --git a/doc/APIchanges b/doc/APIchanges
index a75f346..2fc6a71 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2015-08-28
 
 API changes, most recent first:
 
+2016-XX-XX - xxx - lavf 57.28.100
+  Add protocol blacklisting API
+
 2016-02-28 - xxx - lavc 57.27.101
   Validate AVFrame returned by get_buffer2 to have required
   planes not NULL and unused planes set to NULL as crashes
diff --git a/libavformat/async.c b/libavformat/async.c
index a835292..0cc6fb0 100644
--- a/libavformat/async.c
+++ b/libavformat/async.c
@@ -251,7 +251,7 @@ static int async_open(URLContext *h, const char *arg, int 
flags, AVDictionary **
 
 /* wrap interrupt callback */
 c->interrupt_callback = h->interrupt_callback;
-ret = ffurl_open_whitelist(>inner, arg, flags, _callback, 
options, h->protocol_whitelist);
+ret = ffurl_open_whitelist(>inner, arg, flags, _callback, 
options, h->protocol_whitelist, h->protocol_blacklist);
 if (ret != 0) {
 av_log(h, AV_LOG_ERROR, "ffurl_open failed : %s, %s\n", 
av_err2str(ret), arg);
 goto url_fail;
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index b843a4b..b133575 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1838,6 +1838,13 @@ typedef struct AVFormatContext {
  */
 char *protocol_whitelist;
 
+/**
+ * ',' separated list of disallowed protocols.
+ * - encoding: unused
+ * - decoding: set by user through AVOptions (NO direct access)
+ */
+char *protocol_blacklist;
+
 /*
  * A callback for opening new IO streams.
  *
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 3859810..eaf8421 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -1089,7 +1089,7 @@ static int read_gab2_sub(AVFormatContext *s, AVStream 
*st, AVPacket *pkt)
 
 ast->sub_ctx->pb = pb;
 
-if (ff_copy_whitelists(ast->sub_ctx, s) < 0)
+if (ff_copy_whiteblacklists(ast->sub_ctx, s) < 0)
 goto error;
 
 if (!avformat_open_input(>sub_ctx, "", sub_demuxer, NULL)) {
diff --git a/libavformat/avio.c b/libavformat/avio.c
index 69b6eaa..0be820b 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -55,6 +55,7 @@ static void *urlcontext_child_next(void *obj, void *prev)
 #define D AV_OPT_FLAG_DECODING_PARAM
 static const AVOption options[] = {
 {"protocol_whitelist", "List of protocols that are allowed to be used", 
OFFSET(protocol_whitelist), AV_OPT_TYPE_STRING, { .str = NULL },  CHAR_MIN, 
CHAR_MAX, D },