Re: [FFmpeg-devel] [PATCH] libavformat: add librist protocol

2020-12-24 Thread Nicolas George
Paul B Mahol (12020-12-24):
> This work is sponsored by Open Broadcast Systems.
> 
> Signed-off-by: Paul B Mahol 
> ---
>  configure   |   5 +
>  doc/protocols.texi  |  32 ++
>  libavformat/Makefile|   1 +
>  libavformat/librist.c   | 233 
>  libavformat/protocols.c |   1 +
>  5 files changed, 272 insertions(+)
>  create mode 100644 libavformat/librist.c
> 
> diff --git a/configure b/configure
> index 90914752f1..462f2dcf64 100755
> --- a/configure
> +++ b/configure
> @@ -259,6 +259,7 @@ External library support:
>--enable-libpulseenable Pulseaudio input via libpulse [no]
>--enable-librabbitmq enable RabbitMQ library [no]
>--enable-librav1eenable AV1 encoding via rav1e [no]
> +  --enable-librist enable RIST via librist [no]
>--enable-librsvg enable SVG rasterization via librsvg [no]
>--enable-librubberband   enable rubberband needed for rubberband filter 
> [no]
>--enable-librtmp enable RTMP[E] support via librtmp [no]
> @@ -1797,6 +1798,7 @@ EXTERNAL_LIBRARY_LIST="
>  libpulse
>  librabbitmq
>  librav1e
> +librist
>  librsvg
>  librtmp
>  libshine
> @@ -3488,6 +3490,8 @@ unix_protocol_select="network"
>  # external library protocols
>  libamqp_protocol_deps="librabbitmq"
>  libamqp_protocol_select="network"
> +librist_protocol_deps="librist"
> +librist_protocol_select="network"
>  librtmp_protocol_deps="librtmp"
>  librtmpe_protocol_deps="librtmp"
>  librtmps_protocol_deps="librtmp"
> @@ -6404,6 +6408,7 @@ enabled libopus   && {
>  enabled libpulse  && require_pkg_config libpulse libpulse 
> pulse/pulseaudio.h pa_context_new
>  enabled librabbitmq   && require_pkg_config librabbitmq "librabbitmq >= 
> 0.7.1" amqp.h amqp_new_connection
>  enabled librav1e  && require_pkg_config librav1e "rav1e >= 0.1.0" 
> rav1e.h rav1e_context_new
> +enabled librist   && require_pkg_config librist "librist >= 0.2" 
> librist/librist.h rist_receiver_create
>  enabled librsvg   && require_pkg_config librsvg librsvg-2.0 
> librsvg-2.0/librsvg/rsvg.h rsvg_handle_render_cairo
>  enabled librtmp   && require_pkg_config librtmp librtmp 
> librtmp/rtmp.h RTMP_Socket
>  enabled librubberband && require_pkg_config librubberband "rubberband >= 
> 1.8.1" rubberband/rubberband-c.h rubberband_new -lstdc++ && append 
> librubberband_extralibs "-lstdc++"
> diff --git a/doc/protocols.texi b/doc/protocols.texi
> index de377a9546..aa682f1586 100644
> --- a/doc/protocols.texi
> +++ b/doc/protocols.texi
> @@ -673,6 +673,38 @@ Example usage:
>  -f rtp_mpegts -fec prompeg=l=8:d=4 rtp://@var{hostname}:@var{port}
>  @end example
>  
> +@section rist
> +
> +Reliable Internet Streaming Transport protocol
> +
> +The accepted options are:
> +@table @option
> +@item rist_profile
> +Supported values:
> +@table @samp
> +@item simple
> +@item main
> +This one is default.
> +@item advanced
> +@end table
> +
> +@item buffer_size
> +Set internal RIST buffer size for retransmission of data.
> +
> +@item pkt_size
> +Set internal RIST buffer size for receiving and sending data.
> +
> +@item log_level
> +Set loglevel for RIST logging messages.
> +
> +@item secret
> +Set override of encryption secret, by default is unset.
> +
> +@item encryption
> +Set encryption type, by default is disabled.
> +Acceptable values are 128 and 256.
> +@end table
> +
>  @section rtmp
>  
>  Real-Time Messaging Protocol.
> diff --git a/libavformat/Makefile b/libavformat/Makefile
> index 97d868081b..799e16c59e 100644
> --- a/libavformat/Makefile
> +++ b/libavformat/Makefile
> @@ -652,6 +652,7 @@ OBJS-$(CONFIG_UNIX_PROTOCOL) += unix.o
>  
>  # external library protocols
>  OBJS-$(CONFIG_LIBAMQP_PROTOCOL)  += libamqp.o
> +OBJS-$(CONFIG_LIBRIST_PROTOCOL)  += librist.o
>  OBJS-$(CONFIG_LIBRTMP_PROTOCOL)  += librtmp.o
>  OBJS-$(CONFIG_LIBRTMPE_PROTOCOL) += librtmp.o
>  OBJS-$(CONFIG_LIBRTMPS_PROTOCOL) += librtmp.o
> diff --git a/libavformat/librist.c b/libavformat/librist.c
> new file mode 100644
> index 00..dacdd4a859
> --- /dev/null
> +++ b/libavformat/librist.c
> @@ -0,0 +1,233 @@
> +/*
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 

Re: [FFmpeg-devel] [PATCH 1/2] avcodec/cfhd: only increase s->level if transform is known

2020-12-24 Thread Paul B Mahol
On Wed, Dec 23, 2020 at 4:04 PM Michael Niedermayer 
wrote:

> On Wed, Dec 23, 2020 at 12:35:38PM +0100, Paul B Mahol wrote:
> > Signed-off-by: Paul B Mahol 
> > ---
> >  libavcodec/cfhd.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
> > index a2b9c7c76a..a4f4cb4b3c 100644
> > --- a/libavcodec/cfhd.c
> > +++ b/libavcodec/cfhd.c
> > @@ -436,7 +436,7 @@ static int cfhd_decode(AVCodecContext *avctx, void
> *data, int *got_frame,
> >  }
> >  init_plane_defaults(s);
> >  } else if (tag == SubbandNumber) {
> > -if (s->subband_num != 0 && data == 1)  // hack
> > +if (s->subband_num != 0 && data == 1 && s->transform_type
> >= 0)  // hack
> >  s->level++;
> >  av_log(avctx, AV_LOG_DEBUG, "Subband number %"PRIu16"\n",
> data);
> >  s->subband_num = data;
>
> What about all the other places which use transform_type ?
> If its allowed never to set transform_type or to set it between several
> uses
> of transform_type.
> Is that always safe ?
>
> Iam asking because that should not be possible with enforced order and a
> mandatory
> transform_type element. But that is not enforced with your solution.
>

Transform type in always mandatory to be set in each packet.


> Thanks
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> If you fake or manipulate statistics in a paper in physics you will never
> get a job again.
> If you fake or manipulate statistics in a paper in medicin you will get
> a job for life at the pharma industry.
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] libavformat: add librist protocol

2020-12-24 Thread Paul B Mahol
This work is sponsored by Open Broadcast Systems.

Signed-off-by: Paul B Mahol 
---
 configure   |   5 +
 doc/protocols.texi  |  32 ++
 libavformat/Makefile|   1 +
 libavformat/librist.c   | 242 
 libavformat/protocols.c |   1 +
 5 files changed, 281 insertions(+)
 create mode 100644 libavformat/librist.c

diff --git a/configure b/configure
index 90914752f1..462f2dcf64 100755
--- a/configure
+++ b/configure
@@ -259,6 +259,7 @@ External library support:
   --enable-libpulseenable Pulseaudio input via libpulse [no]
   --enable-librabbitmq enable RabbitMQ library [no]
   --enable-librav1eenable AV1 encoding via rav1e [no]
+  --enable-librist enable RIST via librist [no]
   --enable-librsvg enable SVG rasterization via librsvg [no]
   --enable-librubberband   enable rubberband needed for rubberband filter [no]
   --enable-librtmp enable RTMP[E] support via librtmp [no]
@@ -1797,6 +1798,7 @@ EXTERNAL_LIBRARY_LIST="
 libpulse
 librabbitmq
 librav1e
+librist
 librsvg
 librtmp
 libshine
@@ -3488,6 +3490,8 @@ unix_protocol_select="network"
 # external library protocols
 libamqp_protocol_deps="librabbitmq"
 libamqp_protocol_select="network"
+librist_protocol_deps="librist"
+librist_protocol_select="network"
 librtmp_protocol_deps="librtmp"
 librtmpe_protocol_deps="librtmp"
 librtmps_protocol_deps="librtmp"
@@ -6404,6 +6408,7 @@ enabled libopus   && {
 enabled libpulse  && require_pkg_config libpulse libpulse 
pulse/pulseaudio.h pa_context_new
 enabled librabbitmq   && require_pkg_config librabbitmq "librabbitmq >= 
0.7.1" amqp.h amqp_new_connection
 enabled librav1e  && require_pkg_config librav1e "rav1e >= 0.1.0" 
rav1e.h rav1e_context_new
+enabled librist   && require_pkg_config librist "librist >= 0.2" 
librist/librist.h rist_receiver_create
 enabled librsvg   && require_pkg_config librsvg librsvg-2.0 
librsvg-2.0/librsvg/rsvg.h rsvg_handle_render_cairo
 enabled librtmp   && require_pkg_config librtmp librtmp librtmp/rtmp.h 
RTMP_Socket
 enabled librubberband && require_pkg_config librubberband "rubberband >= 
1.8.1" rubberband/rubberband-c.h rubberband_new -lstdc++ && append 
librubberband_extralibs "-lstdc++"
diff --git a/doc/protocols.texi b/doc/protocols.texi
index de377a9546..aa682f1586 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -673,6 +673,38 @@ Example usage:
 -f rtp_mpegts -fec prompeg=l=8:d=4 rtp://@var{hostname}:@var{port}
 @end example
 
+@section rist
+
+Reliable Internet Streaming Transport protocol
+
+The accepted options are:
+@table @option
+@item rist_profile
+Supported values:
+@table @samp
+@item simple
+@item main
+This one is default.
+@item advanced
+@end table
+
+@item buffer_size
+Set internal RIST buffer size for retransmission of data.
+
+@item pkt_size
+Set internal RIST buffer size for receiving and sending data.
+
+@item log_level
+Set loglevel for RIST logging messages.
+
+@item secret
+Set override of encryption secret, by default is unset.
+
+@item encryption
+Set encryption type, by default is disabled.
+Acceptable values are 128 and 256.
+@end table
+
 @section rtmp
 
 Real-Time Messaging Protocol.
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 97d868081b..799e16c59e 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -652,6 +652,7 @@ OBJS-$(CONFIG_UNIX_PROTOCOL) += unix.o
 
 # external library protocols
 OBJS-$(CONFIG_LIBAMQP_PROTOCOL)  += libamqp.o
+OBJS-$(CONFIG_LIBRIST_PROTOCOL)  += librist.o
 OBJS-$(CONFIG_LIBRTMP_PROTOCOL)  += librtmp.o
 OBJS-$(CONFIG_LIBRTMPE_PROTOCOL) += librtmp.o
 OBJS-$(CONFIG_LIBRTMPS_PROTOCOL) += librtmp.o
diff --git a/libavformat/librist.c b/libavformat/librist.c
new file mode 100644
index 00..9aa9e02a58
--- /dev/null
+++ b/libavformat/librist.c
@@ -0,0 +1,242 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Reliable Internet Streaming Transport protocol
+ */
+
+#include "libavutil/avassert.h"
+#include "libavutil/opt.h"
+#include "libavutil/parseutils.h"
+#include "libavutil/time.h"
+
+#include "avformat.h"
+#include 

Re: [FFmpeg-devel] [PATCH]lavd/decklink_dec: Use correct case for codec point / fourcc v210

2020-12-24 Thread Carl Eugen Hoyos
Am Mo., 21. Dez. 2020 um 01:18 Uhr schrieb Marton Balint :

> >>> Attached patch fixes ticket #9005.
> >>
> >> Why are the codec_tags set at all? Can't we simply remove setting of all
> >> the codec tags in decklink? They hold no additional information to
> >> codec id and pixel format. This should also fix the issue IMHO.
> >
> > Alternative patch attached, completely untested.
>
> I have tested it and it fixes the ticket. Patch LGTM.

Thank you, patch applied.

Merry Christmas, Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] libavformat: add librist protocol

2020-12-24 Thread Nicolas George
Paul B Mahol (12020-12-24):
> This work is sponsored by Open Broadcast Systems.
> 
> Signed-off-by: Paul B Mahol 
> ---
>  configure   |   5 +
>  doc/protocols.texi  |  32 ++
>  libavformat/Makefile|   1 +
>  libavformat/librist.c   | 242 
>  libavformat/protocols.c |   1 +
>  5 files changed, 281 insertions(+)
>  create mode 100644 libavformat/librist.c

NAK. AVIO_FLAG_READ_WRITE not handled, incorrect timeout, payload
possibly silently discarded. All already pointed.

-- 
  Nicolas George


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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] libavformat: add librist protocol

2020-12-24 Thread Paul B Mahol
On Thu, Dec 24, 2020 at 12:32 PM Nicolas George  wrote:

> Paul B Mahol (12020-12-24):
> > This work is sponsored by Open Broadcast Systems.
> >
> > Signed-off-by: Paul B Mahol 
> > ---
> >  configure   |   5 +
> >  doc/protocols.texi  |  32 ++
> >  libavformat/Makefile|   1 +
> >  libavformat/librist.c   | 242 
> >  libavformat/protocols.c |   1 +
> >  5 files changed, 281 insertions(+)
> >  create mode 100644 libavformat/librist.c
>
> NAK. AVIO_FLAG_READ_WRITE not handled, incorrect timeout, payload
> possibly silently discarded. All already pointed.
>

I have zero respect about your disrespectful and extremely rude reviews.

Why such flag should be handled? It does not make sense.
timeout is correct.
payload is never silently discarded, it is make sure that it is never
bigger than max packet size, its just your imagination.



>
> --
>   Nicolas George
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] libavformat: add librist protocol

2020-12-24 Thread Nicolas George
Paul B Mahol (12020-12-24):
> I have zero respect about your disrespectful and extremely rude reviews.
> 
> Why such flag should be handled? It does not make sense.
> timeout is correct.
> payload is never silently discarded, it is make sure that it is never
> bigger than max packet size, its just your imagination.

Patch still blocked until you're ready to discuss this cordially.

-- 
  Nicolas George


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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] libavformat: add librist protocol

2020-12-24 Thread James Almer

On 12/24/2020 8:08 AM, Paul B Mahol wrote:

+typedef struct RISTContext {
+const AVClass *class;
+
+int profile;
+int buffer_size;
+int packet_size;
+int log_level;
+int encryption;
+char *secret;
+
+struct rist_logging_settings logging_settings;
+struct rist_peer_config peer_config;
+
+struct rist_peer *peer;
+struct rist_ctx *rist_ctx;
+} RISTContext;


[...]


+static int librist_open(URLContext *h, const char *uri, int flags)
+{
+RISTContext *s = h->priv_data;
+struct rist_logging_settings *logging_settings = &s->logging_settings;
+struct rist_peer_config *peer_config = &s->peer_config;
+int ret;
+
+ret = rist_logging_set(&logging_settings, s->log_level, log_cb, h, NULL, 
NULL);
+if (ret < 0)
+return risterr2ret(ret);
+
+if (flags & AVIO_FLAG_WRITE) {
+ret = rist_sender_create(&s->rist_ctx, s->profile, 0, 
logging_settings);
+} else {
+ret = rist_receiver_create(&s->rist_ctx, s->profile, logging_settings);
+}
+if (ret < 0)
+goto err;
+
+ret = rist_parse_address(uri, (const struct rist_peer_config 
**)&peer_config);
+if (ret < 0)
+goto err;


Look at 
https://code.videolan.org/rist/librist/-/blob/4fd217662cee398f4706c815958a1efe48b2093f/src/rist.c#L637
rist_parse_address() does not fill peer_config with default values if it 
doesn't allocate it itself. It assumes it was allocated during a 
previous call and not by the caller.


Unless the library provides a defaults()/reset() kind of function, it 
doesn't look like you can really use your own rist_peer_config struct.
Can you talk with the devs about it? Or even just submit a PR yourself. 
It should be very trivial to implement.

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] libavformat: add librist protocol

2020-12-24 Thread Paul B Mahol
Look guys I will apply this patch soon.

Your reviews are very bad!

Why your reviews are extremely bad?

You really have no skills or experience to say anything useful in this
patch.

Simple proof is that I posted one variant where you objected about
allocation and than
your are not happy how I resolved it. Instead you object how librist is
implemented.

[auto-censored entries]

You are just very rude and disrespectfully developers and community overall.

Good ridance!


On Thu, Dec 24, 2020 at 2:10 PM James Almer  wrote:

> On 12/24/2020 8:08 AM, Paul B Mahol wrote:
> > +typedef struct RISTContext {
> > +const AVClass *class;
> > +
> > +int profile;
> > +int buffer_size;
> > +int packet_size;
> > +int log_level;
> > +int encryption;
> > +char *secret;
> > +
> > +struct rist_logging_settings logging_settings;
> > +struct rist_peer_config peer_config;
> > +
> > +struct rist_peer *peer;
> > +struct rist_ctx *rist_ctx;
> > +} RISTContext;
>
> [...]
>
> > +static int librist_open(URLContext *h, const char *uri, int flags)
> > +{
> > +RISTContext *s = h->priv_data;
> > +struct rist_logging_settings *logging_settings =
> &s->logging_settings;
> > +struct rist_peer_config *peer_config = &s->peer_config;
> > +int ret;
> > +
> > +ret = rist_logging_set(&logging_settings, s->log_level, log_cb, h,
> NULL, NULL);
> > +if (ret < 0)
> > +return risterr2ret(ret);
> > +
> > +if (flags & AVIO_FLAG_WRITE) {
> > +ret = rist_sender_create(&s->rist_ctx, s->profile, 0,
> logging_settings);
> > +} else {
> > +ret = rist_receiver_create(&s->rist_ctx, s->profile,
> logging_settings);
> > +}
> > +if (ret < 0)
> > +goto err;
> > +
> > +ret = rist_parse_address(uri, (const struct rist_peer_config
> **)&peer_config);
> > +if (ret < 0)
> > +goto err;
>
> Look at
>
> https://code.videolan.org/rist/librist/-/blob/4fd217662cee398f4706c815958a1efe48b2093f/src/rist.c#L637
> rist_parse_address() does not fill peer_config with default values if it
> doesn't allocate it itself. It assumes it was allocated during a
> previous call and not by the caller.
>
> Unless the library provides a defaults()/reset() kind of function, it
> doesn't look like you can really use your own rist_peer_config struct.
> Can you talk with the devs about it? Or even just submit a PR yourself.
> It should be very trivial to implement.
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] tools/target_dec_fuzzer: Adjust maxpixels for G2M

2020-12-24 Thread Michael Niedermayer
On Tue, Nov 17, 2020 at 07:15:47PM +0100, Michael Niedermayer wrote:
> Fixes: Timeout (50sec -> 3sec)
> Fixes: 
> 27383/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G2M_fuzzer-5196953666977792
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  tools/target_dec_fuzzer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

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

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway


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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 1/3] avformat/cafdec: clip sample rate

2020-12-24 Thread Michael Niedermayer
On Wed, Nov 18, 2020 at 10:08:16PM +0100, Michael Niedermayer wrote:
> Fixes: 1.21126e+111 is outside the range of representable values of type 'int'
> Fixes: 
> 27398/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-5412960339755008
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/cafdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply patchset

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

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus


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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] libswscale: avoid UB nullptr-with-offset.

2020-12-24 Thread Michael Niedermayer
On Thu, Dec 24, 2020 at 04:27:19AM +, Jeremy Leconte wrote:
> Great news that the patch is accepted.
> Just updated the author is this version.
> Thanks!
> ---
>  libswscale/slice.c| 12 
>  libswscale/swscale_unscaled.c |  4 +---
>  2 files changed, 5 insertions(+), 11 deletions(-)

will apply

thx

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

"Nothing to hide" only works if the folks in power share the values of
you and everyone you know entirely and always will -- Tom Scott



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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] libavformat: add librist protocol

2020-12-24 Thread Marton Balint



On Thu, 24 Dec 2020, Nicolas George wrote:


+static int librist_read(URLContext *h, uint8_t *buf, int size)
+{
+RISTContext *s = h->priv_data;
+const struct rist_data_block *data_block;
+int ret;
+



+ret = rist_receiver_data_read(s->rist_ctx, &data_block, 5);


Already mentioned: the 5 millisecond timeout not acceptable. Set it to 0
in non-blocking mode and as large as possible in blocking mode.


Actually it should be POLLING_TIME as defined in libavformat/network.h for 
blocking mode if you want behaviour to be consistent with other protocols. 
The function cannot block indefinitely even in blocking mode to be able 
allow generic code in libavformat/avio.c:retry_transfer_wrapper to abort a 
blocking wait.


Other protocols are directly using poll/select to wait for data with 
POLLING_TIME timeout, but since librist does not provide a way to poll for 
data, this is the best we can do (and return EAGAIN even in blocking mode 
if the POLLING_TIME elapses, because retry_transfer_wrapper will retry in 
that case anyway)


Regards,
Marton
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 1/4] avformat/mpc8: Check size before implicitly converting to int

2020-12-24 Thread Michael Niedermayer
Fixes: Timeout
Fixes: 
28551/clusterfuzz-testcase-minimized-ffmpeg_dem_MPC8_fuzzer-6229183210586112

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavformat/mpc8.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c
index 447a8d4fdf..ff7da2ef55 100644
--- a/libavformat/mpc8.c
+++ b/libavformat/mpc8.c
@@ -292,7 +292,7 @@ static int mpc8_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 return AVERROR_EOF;
 
 mpc8_get_chunk_header(s->pb, &tag, &size);
-if (size < 0)
+if (size < 0 || size > INT_MAX)
 return -1;
 if(tag == TAG_AUDIOPACKET){
 if ((ret = av_get_packet(s->pb, pkt, size)) < 0)
-- 
2.17.1

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 4/4] avcodec/siren: Increase noise category 5 and 6

2020-12-24 Thread Michael Niedermayer
The entry read is not used in subsequent computation, thus its
value is not important.

Fixes: out of array read
Fixes: 
28578/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SIREN_fuzzer-6332019122503680

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/siren.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/siren.c b/libavcodec/siren.c
index 1f37305bd1..7c2800d108 100644
--- a/libavcodec/siren.c
+++ b/libavcodec/siren.c
@@ -341,12 +341,12 @@ static const float mlt_quant[7][14] = {
 { 0.0f, 1.964f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 
0.0f, 0.0f, 0.0f }
 };
 
-static const float noise_category5[20] = {
+static const float noise_category5[21] = {
 0.70711f, 0.6179f, 0.5005f, 0.3220f, 0.17678f, 0.17678f, 0.17678f, 
0.17678f, 0.17678f, 0.17678f, 0.17678f,
 0.17678f, 0.17678f, 0.17678f, 0.17678f, 0.17678f, 0.17678f, 0.17678f, 
0.17678f, 0.17678f
 };
 
-static const float noise_category6[20] = {
+static const float noise_category6[21] = {
 0.70711f, 0.5686f, 0.3563f, 0.25f, 0.25f, 0.25f, 0.25f, 0.25f, 0.25f, 
0.25f, 0.25f, 0.25f,
 0.25f, 0.25f, 0.25f, 0.25f, 0.25f, 0.25f, 0.25f, 0.25f
 };
-- 
2.17.1

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 2/4] avcodec/siren: remove constant region_size

2020-12-24 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 libavcodec/siren.c | 13 ++---
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/libavcodec/siren.c b/libavcodec/siren.c
index b1b4944562..0713ef25e7 100644
--- a/libavcodec/siren.c
+++ b/libavcodec/siren.c
@@ -352,6 +352,7 @@ static const float noise_category6[20] = {
 };
 
 #define FRAME_SIZE 320
+#define REGION_SIZE 20
 
 typedef struct SirenContext {
 GetBitContext gb;
@@ -361,7 +362,6 @@ typedef struct SirenContext {
 int number_of_regions;
 int scale_factor;
 int sample_rate_bits;
-int region_size;
 
 unsigned dw1, dw2, dw3, dw4;
 
@@ -402,7 +402,6 @@ static av_cold int siren_init(AVCodecContext *avctx)
 s->esf_adjustment = 7;
 s->number_of_regions = 14;
 s->scale_factor = 22;
-s->region_size = 20;
 s->dw1 = s->dw2 = s->dw3 = s->dw4 = 1;
 
 for (i = 0; i < 64; i++) {
@@ -574,7 +573,7 @@ static int decode_vector(SirenContext *s, int 
number_of_regions,
 
 for (region = 0; region < number_of_regions; region++) {
 category = power_categories[region];
-coefs_ptr = coefs + (region * s->region_size);
+coefs_ptr = coefs + (region * REGION_SIZE);
 
 if (category >= 0 && category < 7) {
 decoder_tree = decoder_tables[category];
@@ -623,11 +622,11 @@ static int decode_vector(SirenContext *s, int 
number_of_regions,
 }
 }
 
-coefs_ptr = coefs + (region * s->region_size);
+coefs_ptr = coefs + (region * REGION_SIZE);
 
 if (category == 5) {
 i = 0;
-for (j = 0; j < s->region_size; j++) {
+for (j = 0; j < REGION_SIZE; j++) {
 if (*coefs_ptr != 0)
 i++;
 coefs_ptr++;
@@ -636,7 +635,7 @@ static int decode_vector(SirenContext *s, int 
number_of_regions,
 noise = decoder_standard_deviation[region] * noise_category5[i];
 } else if (category == 6) {
 i = 0;
-for (j = 0; j < s->region_size; j++) {
+for (j = 0; j < REGION_SIZE; j++) {
 if (*coefs_ptr++ != 0)
 i++;
 }
@@ -648,7 +647,7 @@ static int decode_vector(SirenContext *s, int 
number_of_regions,
 noise = 0;
 }
 
-coefs_ptr = coefs + (region * s->region_size);
+coefs_ptr = coefs + (region * REGION_SIZE);
 
 if (category == 5 || category == 6 || category == 7) {
 dw1 = get_dw(s);
-- 
2.17.1

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 3/4] avcodec/siren: Factorize category 5 and 6 noise computation

2020-12-24 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 libavcodec/siren.c | 15 +--
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/libavcodec/siren.c b/libavcodec/siren.c
index 0713ef25e7..1f37305bd1 100644
--- a/libavcodec/siren.c
+++ b/libavcodec/siren.c
@@ -624,7 +624,7 @@ static int decode_vector(SirenContext *s, int 
number_of_regions,
 
 coefs_ptr = coefs + (region * REGION_SIZE);
 
-if (category == 5) {
+if (category == 5 || category == 6) {
 i = 0;
 for (j = 0; j < REGION_SIZE; j++) {
 if (*coefs_ptr != 0)
@@ -632,15 +632,10 @@ static int decode_vector(SirenContext *s, int 
number_of_regions,
 coefs_ptr++;
 }
 
-noise = decoder_standard_deviation[region] * noise_category5[i];
-} else if (category == 6) {
-i = 0;
-for (j = 0; j < REGION_SIZE; j++) {
-if (*coefs_ptr++ != 0)
-i++;
-}
-
-noise = decoder_standard_deviation[region] * noise_category6[i];
+if (category == 5) {
+noise = decoder_standard_deviation[region] * 
noise_category5[i];
+} else
+noise = decoder_standard_deviation[region] * 
noise_category6[i];
 } else if (category == 7) {
 noise = decoder_standard_deviation[region] * 0.70711f;
 } else {
-- 
2.17.1

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH V2] libavcodec/qsvenc: add low latency P-pyramid support for qsv

2020-12-24 Thread wenbin . chen
From: Wenbinc-Bin 

Add low latency P-pyramid support for qsv, and it relates to a new
command line parameter "-p_strategy". To enable this flag, user also
need to set "-bf" to -1 or 0.

Signed-off-by Wenbin Chen 
---
 libavcodec/qsvenc.c | 23 +++
 libavcodec/qsvenc.h |  2 ++
 2 files changed, 25 insertions(+)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 0d20d1968f..8cb0ecff89 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -268,6 +268,14 @@ static void dump_video_param(AVCodecContext *avctx, 
QSVEncContext *q,
 case MFX_B_REF_PYRAMID: av_log(avctx, AV_LOG_VERBOSE, "pyramid");   break;
 default:av_log(avctx, AV_LOG_VERBOSE, "auto");  break;
 }
+
+av_log(avctx, AV_LOG_VERBOSE, "; PRefType: ");
+switch(co3->PRefType){
+case MFX_P_REF_DEFAULT: av_log(avctx, AV_LOG_VERBOSE, "default");   
break;
+case MFX_P_REF_SIMPLE:  av_log(avctx, AV_LOG_VERBOSE, "simple");   
break;
+case MFX_P_REF_PYRAMID: av_log(avctx, AV_LOG_VERBOSE, "pyramid");   
break;
+default:break;
+}
 av_log(avctx, AV_LOG_VERBOSE, "\n");
 #endif
 
@@ -781,6 +789,21 @@ FF_ENABLE_DEPRECATION_WARNINGS
 #if QSV_HAVE_CO3
 q->extco3.Header.BufferId  = MFX_EXTBUFF_CODING_OPTION3;
 q->extco3.Header.BufferSz  = sizeof(q->extco3);
+switch(q->p_strategy){
+case 0:
+q->extco3.PRefType = MFX_P_REF_DEFAULT;
+break;
+case 1:
+q->extco3.PRefType = MFX_P_REF_SIMPLE;
+break;
+case 2:
+q->extco3.PRefType = MFX_P_REF_PYRAMID;
+break;
+default:
+q->extco3.PRefType = MFX_P_REF_DEFAULT;
+av_log(avctx, AV_LOG_VERBOSE, "invalid p_strategy, set to 
default\n");
+break;
+}
 #if QSV_HAVE_GPB
 if (avctx->codec_id == AV_CODEC_ID_HEVC)
 q->extco3.GPB  = q->gpb ? MFX_CODINGOPTION_ON : 
MFX_CODINGOPTION_OFF;
diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h
index 3720320789..a074561ca8 100644
--- a/libavcodec/qsvenc.h
+++ b/libavcodec/qsvenc.h
@@ -96,6 +96,7 @@
 { "adaptive_i", "Adaptive I-frame placement", 
OFFSET(qsv.adaptive_i), AV_OPT_TYPE_INT, { .i64 = -1 }, -1,  1, VE 
}, \
 { "adaptive_b", "Adaptive B-frame placement", 
OFFSET(qsv.adaptive_b), AV_OPT_TYPE_INT, { .i64 = -1 }, -1,  1, VE 
}, \
 { "b_strategy", "Strategy to choose between I/P/B-frames", 
OFFSET(qsv.b_strategy),AV_OPT_TYPE_INT, { .i64 = -1 }, -1,  1, VE 
}, \
+{ "p_strategy", "enable P-pyramid 0-default 1-simple 2-pyramid",
OFFSET(qsv.p_strategy), AV_OPT_TYPE_INT,{ .i64 = 0}, 0,2, VE }, 
\
 { "forced_idr", "Forcing I frames as IDR frames", 
OFFSET(qsv.forced_idr), AV_OPT_TYPE_BOOL,{ .i64 = 0  },  0,  1, VE 
}, \
 { "low_power", "enable low power mode(experimental: many limitations by mfx 
version, BRC modes, etc.)", OFFSET(qsv.low_power), AV_OPT_TYPE_BOOL, { .i64 = 
0}, 0, 1, VE},\
 { "dblk_idc", "value of DisableDeblockingIdc (default is 0), in range [0,2]",  
 OFFSET(qsv.dblk_idc),   AV_OPT_TYPE_INT,{ .i64 = 0 },   0,  2,  VE},\
@@ -185,6 +186,7 @@ typedef struct QSVEncContext {
 int adaptive_i;
 int adaptive_b;
 int b_strategy;
+int p_strategy;
 int cavlc;
 
 int int_ref_type;
-- 
2.25.1

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH V2] libavcodec/qsvenc: add low latency P-pyramid support for qsv

2020-12-24 Thread myp...@gmail.com
On Fri, Dec 25, 2020 at 12:55 PM  wrote:
>
> From: Wenbinc-Bin 
>
> Add low latency P-pyramid support for qsv, and it relates to a new
> command line parameter "-p_strategy". To enable this flag, user also
> need to set "-bf" to -1 or 0.
>
> Signed-off-by Wenbin Chen 
> ---
>  libavcodec/qsvenc.c | 23 +++
>  libavcodec/qsvenc.h |  2 ++
>  2 files changed, 25 insertions(+)
>
> diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
> index 0d20d1968f..8cb0ecff89 100644
> --- a/libavcodec/qsvenc.c
> +++ b/libavcodec/qsvenc.c
> @@ -268,6 +268,14 @@ static void dump_video_param(AVCodecContext *avctx, 
> QSVEncContext *q,
>  case MFX_B_REF_PYRAMID: av_log(avctx, AV_LOG_VERBOSE, "pyramid");   
> break;
>  default:av_log(avctx, AV_LOG_VERBOSE, "auto");  
> break;
>  }
> +
> +av_log(avctx, AV_LOG_VERBOSE, "; PRefType: ");
> +switch(co3->PRefType){
Please follow the coding style, thx
> +case MFX_P_REF_DEFAULT: av_log(avctx, AV_LOG_VERBOSE, "default");   
> break;
> +case MFX_P_REF_SIMPLE:  av_log(avctx, AV_LOG_VERBOSE, "simple");   
> break;
> +case MFX_P_REF_PYRAMID: av_log(avctx, AV_LOG_VERBOSE, "pyramid");   
> break;
> +default:break;
> +}
>  av_log(avctx, AV_LOG_VERBOSE, "\n");
>  #endif
>
> @@ -781,6 +789,21 @@ FF_ENABLE_DEPRECATION_WARNINGS
>  #if QSV_HAVE_CO3
>  q->extco3.Header.BufferId  = MFX_EXTBUFF_CODING_OPTION3;
>  q->extco3.Header.BufferSz  = sizeof(q->extco3);
> +switch(q->p_strategy){
Same as above
> +case 0:
And this
> +q->extco3.PRefType = MFX_P_REF_DEFAULT;
> +break;
> +case 1:
> +q->extco3.PRefType = MFX_P_REF_SIMPLE;
> +break;
> +case 2:
> +q->extco3.PRefType = MFX_P_REF_PYRAMID;
> +break;
> +default:
> +q->extco3.PRefType = MFX_P_REF_DEFAULT;
> +av_log(avctx, AV_LOG_VERBOSE, "invalid p_strategy, set to 
> default\n");
> +break;
> +}
>  #if QSV_HAVE_GPB
>  if (avctx->codec_id == AV_CODEC_ID_HEVC)
>  q->extco3.GPB  = q->gpb ? MFX_CODINGOPTION_ON : 
> MFX_CODINGOPTION_OFF;
> diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h
> index 3720320789..a074561ca8 100644
> --- a/libavcodec/qsvenc.h
> +++ b/libavcodec/qsvenc.h
> @@ -96,6 +96,7 @@
>  { "adaptive_i", "Adaptive I-frame placement", 
> OFFSET(qsv.adaptive_i), AV_OPT_TYPE_INT, { .i64 = -1 }, -1,  1, 
> VE }, \
>  { "adaptive_b", "Adaptive B-frame placement", 
> OFFSET(qsv.adaptive_b), AV_OPT_TYPE_INT, { .i64 = -1 }, -1,  1, 
> VE }, \
>  { "b_strategy", "Strategy to choose between I/P/B-frames", 
> OFFSET(qsv.b_strategy),AV_OPT_TYPE_INT, { .i64 = -1 }, -1,  1, VE 
> }, \
> +{ "p_strategy", "enable P-pyramid 0-default 1-simple 2-pyramid",
> OFFSET(qsv.p_strategy), AV_OPT_TYPE_INT,{ .i64 = 0}, 0,2, VE },   
>   \
>  { "forced_idr", "Forcing I frames as IDR frames", 
> OFFSET(qsv.forced_idr), AV_OPT_TYPE_BOOL,{ .i64 = 0  },  0,  1, 
> VE }, \
>  { "low_power", "enable low power mode(experimental: many limitations by mfx 
> version, BRC modes, etc.)", OFFSET(qsv.low_power), AV_OPT_TYPE_BOOL, { .i64 = 
> 0}, 0, 1, VE},\
>  { "dblk_idc", "value of DisableDeblockingIdc (default is 0), in range 
> [0,2]",   OFFSET(qsv.dblk_idc),   AV_OPT_TYPE_INT,{ .i64 = 0 },   0,  2,  
> VE},\
> @@ -185,6 +186,7 @@ typedef struct QSVEncContext {
>  int adaptive_i;
>  int adaptive_b;
>  int b_strategy;
> +int p_strategy;
>  int cavlc;
>
>  int int_ref_type;
> --
> 2.25.1
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".



-- 
===
Jun zhao/赵军
+++
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".