Re: [FFmpeg-devel] [PATCH v2] tests: add test for ffmpeg's fix_sub_duration feature

2021-12-21 Thread Andreas Rheinhardt
Jan Ekström: > From: Jan Ekström > > Signed-off-by: Jan Ekström > --- > tests/fate/ffmpeg.mak | 11 + > tests/ref/fate/ffmpeg-fix_sub_duration | 31 ++ > 2 files changed, 42 insertions(+) > create mode 100644 tests/ref/fate/ffmpeg-fix_sub_durati

Re: [FFmpeg-devel] [PATCH 1/2] avformat/mxf: support MCA audio information

2021-12-21 Thread Marc-Antoine ARNAUD
Le ven. 17 déc. 2021 à 19:12, Marton Balint a écrit : > > > On Fri, 17 Dec 2021, Marc-Antoine ARNAUD wrote: > > > Hi all, > > > > Can I have an update on this patch submission ? > > Is something required to be done before it can be merged ? > > New channel layout API is on its way, which makes in

Re: [FFmpeg-devel] [PATCH] configure: autodetect vulkan

2021-12-21 Thread Lynne
21 Dec 2021, 08:05 by quinkbl...@foxmail.com: > > >> On Dec 21, 2021, at 1:45 AM, Lynne wrote: >> >> >> Thanks for testing, V2 attached, just changes require_cpp to check_cpp, >> since autodetecting is not a hard-require unlike enabling libraries. >> > > >> diff --git a/configure b/configure >> i

Re: [FFmpeg-devel] [PATCH v5 10/13] avdevice/dshow: add media type info to get_device_list

2021-12-21 Thread Diederick C. Niehorster
Hi Andreas, On Mon, Dec 20, 2021 at 9:01 AM Diederick C. Niehorster wrote: > > On Mon, Dec 20, 2021 at 2:04 AM Andreas Rheinhardt > wrote: > > > > Diederick Niehorster: > > > // store to device_list output > > > if (av_reallocp_array(&(*device_list)->devices, >

[FFmpeg-devel] [PATCH v6 00/12] dshow enhancements

2021-12-21 Thread Diederick Niehorster
This series solves some outstanding bugs in the dshow device, implements get_device_list so that `ffmpeg -sources dshow` works and adds logic to select a video format with extended color information (color range, space, etc) if exposed by the device. v6 adresses the review comments from Andreas re

[FFmpeg-devel] [PATCH v6 01/12] avdevice/dshow: prevent NULL access

2021-12-21 Thread Diederick Niehorster
list_options true would crash when both a video and an audio device were specified as input. Crash would occur on line 784 because ctx->device_unique_name[otherDevType] would be NULL Signed-off-by: Diederick Niehorster --- libavdevice/dshow.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(

[FFmpeg-devel] [PATCH v6 02/12] avdevice/dshow: implement option to use device video timestamps

2021-12-21 Thread Diederick Niehorster
The dshow avdevice ignores timestamps for video frames provided by the DirectShow device, instead using wallclock time, apparently because the implementer of this code had a device that provided unreliable timestamps. Me (and others) would like to use the device's timestamps. The new use_video_devi

[FFmpeg-devel] [PATCH v6 03/12] avdevice/dshow: query graph and sample time only once

2021-12-21 Thread Diederick Niehorster
No need to query twice, use value we've already unconditionally got. Improve variable names Signed-off-by: Diederick Niehorster --- libavdevice/dshow_pin.c | 28 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/libavdevice/dshow_pin.c b/libavdevice/dsh

[FFmpeg-devel] [PATCH v6 04/12] avdevice/dshow: handle unknown sample time

2021-12-21 Thread Diederick Niehorster
GetTime may return an error indication that the sample has not timestamps, or may return a NULL start time. In those cases, fall back to graph time. Emit log when that happens. Improve logging in the frame receive function: now logged against correct avclass instead of NULL. Better debug message in

[FFmpeg-devel] [PATCH v6 05/12] avdevice/dshow: set no-seek flags

2021-12-21 Thread Diederick Niehorster
avdevice/dshow is a realtime device and as such does not support seeking. Therefore, its demuxer format should define the AVFMT_NOBINSEARCH, AVFMT_NOGENSEARCH and AVFMT_NO_BYTE_SEEK flags. With these flags set, attempting to seek (with, e.g., avformat_seek_file()) correctly yields -1 (operation not

[FFmpeg-devel] [PATCH v6 06/12] avdevice/dshow: implement get_device_list

2021-12-21 Thread Diederick Niehorster
Needed to enable programmatic discovery of DirectShow devices Signed-off-by: Diederick Niehorster --- libavdevice/dshow.c | 96 ++--- 1 file changed, 81 insertions(+), 15 deletions(-) diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c index 0ef3b3d13e

[FFmpeg-devel] [PATCH v6 07/12] avdevice/dshow: list_devices: show media type(s) per device

2021-12-21 Thread Diederick Niehorster
the list_devices option of dshow didn't indicate whether a specific device provides audio or video output. This patch iterates through all media formats of all pins exposed by the device to see what types it provides for capture, and prints this to the console for each device. Importantly, this now

[FFmpeg-devel] [PATCH v6 08/12] avdevice: add info about media types(s) to AVDeviceInfo

2021-12-21 Thread Diederick Niehorster
An avdevice, regardless of whether its category says its an audio or video device, may provide access to devices providing different media types, or even single devices providing multiple media types. Also, some devices may provide no media types. dshow is an example encompassing all of these cases

[FFmpeg-devel] [PATCH v6 09/12] avdevice/dshow: add media type info to get_device_list

2021-12-21 Thread Diederick Niehorster
The list returned by get_device_list now contains info about what media type(s), if any, can be provided by each device. Signed-off-by: Diederick Niehorster --- libavdevice/dshow.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c index 8dba04a7

[FFmpeg-devel] [PATCH v6 10/12] fftools: provide media type info for devices

2021-12-21 Thread Diederick Niehorster
fftools now print info about what media type(s), if any, are provided by sink and source avdevices. Signed-off-by: Diederick Niehorster --- fftools/cmdutils.c | 34 -- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/fftools/cmdutils.c b/fftools/cmd

[FFmpeg-devel] [PATCH v6 11/12] avdevice/dshow: discover source color range/space/etc

2021-12-21 Thread Diederick Niehorster
Enabled discovering a DirectShow device's color range, space, primaries, transfer characteristics and chroma location, if the device exposes that information. Sets them in the stream's codecpars. Co-authored-by: Valerii Zapodovnikov Signed-off-by: Diederick Niehorster --- libavdevice/dshow.c |

[FFmpeg-devel] [PATCH v6 12/12] avdevice/dshow: select format with extended color info

2021-12-21 Thread Diederick Niehorster
Some DirectShow devices (Logitech C920 webcam) expose each DirectShow format they support twice, once without and once with extended color information. During format selection, both match, this patch ensures that the format with extended color information is selected if it is available, else it fal

Re: [FFmpeg-devel] [PATCH v6 11/12] avdevice/dshow: discover source color range/space/etc

2021-12-21 Thread Hendrik Leppkes
On Tue, Dec 21, 2021 at 1:15 PM Diederick Niehorster wrote: > > Enabled discovering a DirectShow device's color range, space, primaries, > transfer characteristics and chroma location, if the device exposes that > information. Sets them in the stream's codecpars. > > Co-authored-by: Valerii Zapodo

Re: [FFmpeg-devel] [PATCH v6 11/12] avdevice/dshow: discover source color range/space/etc

2021-12-21 Thread Diederick C. Niehorster
Hi Hendrik, Thanks for the review! Comments/questions below: On Tue, Dec 21, 2021 at 1:35 PM Hendrik Leppkes wrote: > > On Tue, Dec 21, 2021 at 1:15 PM Diederick Niehorster > wrote: > > > > Enabled discovering a DirectShow device's color range, space, primaries, > > transfer characteristics an

Re: [FFmpeg-devel] [PATCH] avformat: add bitpacked demuxer

2021-12-21 Thread lance . lmwang
On Tue, Dec 14, 2021 at 10:35:13PM +0800, lance.lmw...@gmail.com wrote: > From: Limin Wang > > Allows user can playback bitpacked pixel format directly: > ffplay -video_size 1280x720 test.bitpacked > ffplay -f bitpacked -video_size 1280x720 -pixel_format uyvy422 test.yuv > > Signed-off-by: Limin

Re: [FFmpeg-devel] [PATCH] avformat: add bitpacked demuxer

2021-12-21 Thread Andreas Rheinhardt
lance.lmw...@gmail.com: > From: Limin Wang > > Allows user can playback bitpacked pixel format directly: > ffplay -video_size 1280x720 test.bitpacked > ffplay -f bitpacked -video_size 1280x720 -pixel_format uyvy422 test.yuv > > Signed-off-by: Limin Wang > --- > libavformat/Makefile | 1

Re: [FFmpeg-devel] [PATCH] avformat: add bitpacked demuxer

2021-12-21 Thread lance . lmwang
On Tue, Dec 21, 2021 at 02:20:31PM +0100, Andreas Rheinhardt wrote: > lance.lmw...@gmail.com: > > From: Limin Wang > > > > Allows user can playback bitpacked pixel format directly: > > ffplay -video_size 1280x720 test.bitpacked > > ffplay -f bitpacked -video_size 1280x720 -pixel_format uyvy422 te

Re: [FFmpeg-devel] [PATCH v6 11/12] avdevice/dshow: discover source color range/space/etc

2021-12-21 Thread Hendrik Leppkes
On Tue, Dec 21, 2021 at 2:11 PM Diederick C. Niehorster wrote: > > Hi Hendrik, > > Thanks for the review! Comments/questions below: > > On Tue, Dec 21, 2021 at 1:35 PM Hendrik Leppkes wrote: > > > > On Tue, Dec 21, 2021 at 1:15 PM Diederick Niehorster > > wrote: > > > > > > Enabled discovering

Re: [FFmpeg-devel] [PATCH v6 11/12] avdevice/dshow: discover source color range/space/etc

2021-12-21 Thread Diederick C. Niehorster
Hi Hendrik, On Tue, Dec 21, 2021 at 2:35 PM Hendrik Leppkes wrote: > > On Tue, Dec 21, 2021 at 2:11 PM Diederick C. Niehorster > wrote: > > > > Hi Hendrik, > > > > Thanks for the review! Comments/questions below: > > > > On Tue, Dec 21, 2021 at 1:35 PM Hendrik Leppkes wrote: > > > > > > On Tue,

Re: [FFmpeg-devel] [PATCH 13/15] avformat/mux, mxfenc: Don't use sizeof(AVPacket)

2021-12-21 Thread Tomas Härdin
tor 2021-12-16 klockan 02:29 +0100 skrev Andreas Rheinhardt: > This removes the last usage of sizeof(AVPacket) in the generic > muxing code. > > Signed-off-by: Andreas Rheinhardt > --- >  libavformat/mux.c    | 8 +--- >  libavformat/mxfenc.c | 8 ++-- >  2 files changed, 3 insertions(+), 1

[FFmpeg-devel] [PATCH v7 00/12] dshow enhancements

2021-12-21 Thread Diederick Niehorster
This series solves some outstanding bugs in the dshow device, implements get_device_list so that `ffmpeg -sources dshow` works and adds logic to select a video format with extended color information (color range, space, etc) if exposed by the device. v7 adresses review comments from Hendrik on pat

Re: [FFmpeg-devel] [PATCH 1/2] avformat/mxf: support MCA audio information

2021-12-21 Thread Tomas Härdin
tis 2021-12-21 klockan 11:44 +0100 skrev Marc-Antoine ARNAUD: > Le ven. 17 déc. 2021 à 19:12, Marton Balint a écrit : > > > > > > > On Fri, 17 Dec 2021, Marc-Antoine ARNAUD wrote: > > > > > Hi all, > > > > > > Can I have an update on this patch submission ? > > > Is something required to be d

[FFmpeg-devel] [PATCH v7 01/12] avdevice/dshow: prevent NULL access

2021-12-21 Thread Diederick Niehorster
list_options true would crash when both a video and an audio device were specified as input. Crash would occur on line 784 because ctx->device_unique_name[otherDevType] would be NULL Signed-off-by: Diederick Niehorster --- libavdevice/dshow.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(

[FFmpeg-devel] [PATCH v7 02/12] avdevice/dshow: implement option to use device video timestamps

2021-12-21 Thread Diederick Niehorster
The dshow avdevice ignores timestamps for video frames provided by the DirectShow device, instead using wallclock time, apparently because the implementer of this code had a device that provided unreliable timestamps. Me (and others) would like to use the device's timestamps. The new use_video_devi

[FFmpeg-devel] [PATCH v7 03/12] avdevice/dshow: query graph and sample time only once

2021-12-21 Thread Diederick Niehorster
No need to query twice, use value we've already unconditionally got. Improve variable names Signed-off-by: Diederick Niehorster --- libavdevice/dshow_pin.c | 28 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/libavdevice/dshow_pin.c b/libavdevice/dsh

[FFmpeg-devel] [PATCH v7 04/12] avdevice/dshow: handle unknown sample time

2021-12-21 Thread Diederick Niehorster
GetTime may return an error indication that the sample has not timestamps, or may return a NULL start time. In those cases, fall back to graph time. Emit log when that happens. Improve logging in the frame receive function: now logged against correct avclass instead of NULL. Better debug message in

[FFmpeg-devel] [PATCH v7 05/12] avdevice/dshow: set no-seek flags

2021-12-21 Thread Diederick Niehorster
avdevice/dshow is a realtime device and as such does not support seeking. Therefore, its demuxer format should define the AVFMT_NOBINSEARCH, AVFMT_NOGENSEARCH and AVFMT_NO_BYTE_SEEK flags. With these flags set, attempting to seek (with, e.g., avformat_seek_file()) correctly yields -1 (operation not

[FFmpeg-devel] [PATCH v7 06/12] avdevice/dshow: implement get_device_list

2021-12-21 Thread Diederick Niehorster
Needed to enable programmatic discovery of DirectShow devices Signed-off-by: Diederick Niehorster --- libavdevice/dshow.c | 96 ++--- 1 file changed, 81 insertions(+), 15 deletions(-) diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c index 0ef3b3d13e

[FFmpeg-devel] [PATCH v7 07/12] avdevice/dshow: list_devices: show media type(s) per device

2021-12-21 Thread Diederick Niehorster
the list_devices option of dshow didn't indicate whether a specific device provides audio or video output. This patch iterates through all media formats of all pins exposed by the device to see what types it provides for capture, and prints this to the console for each device. Importantly, this now

[FFmpeg-devel] [PATCH v7 08/12] avdevice: add info about media types(s) to AVDeviceInfo

2021-12-21 Thread Diederick Niehorster
An avdevice, regardless of whether its category says its an audio or video device, may provide access to devices providing different media types, or even single devices providing multiple media types. Also, some devices may provide no media types. dshow is an example encompassing all of these cases

[FFmpeg-devel] [PATCH v7 09/12] avdevice/dshow: add media type info to get_device_list

2021-12-21 Thread Diederick Niehorster
The list returned by get_device_list now contains info about what media type(s), if any, can be provided by each device. Signed-off-by: Diederick Niehorster --- libavdevice/dshow.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c index 8dba04a7

[FFmpeg-devel] [PATCH v7 10/12] fftools: provide media type info for devices

2021-12-21 Thread Diederick Niehorster
fftools now print info about what media type(s), if any, are provided by sink and source avdevices. Signed-off-by: Diederick Niehorster --- fftools/cmdutils.c | 34 -- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/fftools/cmdutils.c b/fftools/cmd

[FFmpeg-devel] [PATCH v7 11/12] avdevice/dshow: discover source color range/space/etc

2021-12-21 Thread Diederick Niehorster
Enabled discovering a DirectShow device's color range, space, primaries, transfer characteristics and chroma location, if the device exposes that information. Sets them in the stream's codecpars. Co-authored-by: Valerii Zapodovnikov Signed-off-by: Diederick Niehorster --- libavdevice/dshow.c |

[FFmpeg-devel] [PATCH v7 12/12] avdevice/dshow: select format with extended color info

2021-12-21 Thread Diederick Niehorster
Some DirectShow devices (Logitech C920 webcam) expose each DirectShow format they support twice, once without and once with extended color information. During format selection, both match, this patch ensures that the format with extended color information is selected if it is available, else it fal

[FFmpeg-devel] [PATCH v3] tests: add test for ffmpeg's fix_sub_duration feature

2021-12-21 Thread Jan Ekström
From: Jan Ekström This long-existing feature calculates subtitle durations by keeping it around until the following subtitle is decoded, and then utilizes the following subtitle's pts as the end point of the previous one. Signed-off-by: Jan Ekström --- tests/fate/ffmpeg.mak |

[FFmpeg-devel] [PATCH 1/2] lavc/qsvenc: specify codec name when print profile

2021-12-21 Thread Zhong Li
It is more clear and easily to detect the issues similar to commit 3857ecbe70e81cb6ad7a7f155c311e8522b93b3e Signed-off-by: Zhong Li --- libavcodec/qsvenc.c | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/libavcodec/qsvenc.c b/libavcode

[FFmpeg-devel] [PATCH 2/2] lavc/qsvenc: enable lookahead for hevc encoding

2021-12-21 Thread Zhong Li
Update version based on the patch: https://patchwork.ffmpeg.org/project/ffmpeg/patch/20211009015949.1510-1-haihao.xi...@intel.com/ Signed-off-by: Daniel Socek Signed-off-by: Haihao Xiang Signed-off-by: Zhong Li --- libavcodec/qsvenc.c | 10 ++ libavcodec/qsvenc_hevc.c | 3 +++ 2

Re: [FFmpeg-devel] commits ecee6af8bd and 4ac869ca2a break build for macOS

2021-12-21 Thread Christopher Degawa
On Tue, Dec 21, 2021 at 1:40 AM Ridley Combs wrote: > Huh, TIL that the metal compiler doesn't exist without Xcode, but the > metal framework does! Wacky. Anyway, this patch oughtta fix that (does more > or less as you suggested); if this is all fine on your end, I'll go ahead > and split this up

Re: [FFmpeg-devel] Politics

2021-12-21 Thread Michael Niedermayer
On Mon, Dec 20, 2021 at 11:20:38PM +, Soft Works wrote: [...] > > Enlightened by this, let's go back to to your example. The EU frame has a > > > duration of 40ms, the US frame 33.3ms. The US frame start 0.02ms later and > > > is fully included in the duration of the EU frame. > > > > Seem

[FFmpeg-devel] [PATCH v14 1/2] avformat/imf: Demuxer

2021-12-21 Thread pal
From: Pierre-Anthony Lemieux Signed-off-by: Pierre-Anthony Lemieux --- Notes: The IMF demuxer accepts as input an IMF CPL. The assets referenced by the CPL can be contained in multiple deliveries, each defined by an ASSETMAP file: ffmpeg -assetmaps ,,... -i If -asset

[FFmpeg-devel] [PATCH v14 2/2] avformat/imf: Tests

2021-12-21 Thread pal
From: Pierre-Anthony Lemieux Signed-off-by: Pierre-Anthony Lemieux --- Notes: Tests for the IMF demuxer. libavformat/Makefile | 1 + libavformat/tests/imf.c| 526 + tests/fate/libavformat.mak | 4 + tests/ref/fate/imf | 54 4

[FFmpeg-devel] swscale: fix style issues and check malloc in ff_shuffle_filter_coefficients

2021-12-21 Thread Lynne
Google's net worth for 2021:   1 000 000 000 000 USD. Google's revenue for 2021:   204 000 000 000 USD. Average annual salary for a Google engineer: 135 000 USD. The greatest, most powerful beacon of capitalism on the planet sends a patch

Re: [FFmpeg-devel] [PATCH v13 1/2] avformat/imf: Demuxer

2021-12-21 Thread Pierre-Anthony Lemieux
On Mon, Dec 20, 2021 at 12:29 PM Lynne wrote: > > 20 Dec 2021, 20:48 by p...@sandflow.com: > > > On Mon, Dec 20, 2021 at 11:19 AM Lynne wrote: > > > >> > >> 20 Dec 2021, 19:57 by p...@sandflow.com: > >> > >> > From: Pierre-Anthony Lemieux > >> > > >> > Signed-off-by: Pierre-Anthony Lemieux > >>

Re: [FFmpeg-devel] swscale: fix style issues and check malloc in ff_shuffle_filter_coefficients

2021-12-21 Thread Andreas Rheinhardt
Lynne: > > +if (filterSize > 4) { > +int16_t *tmp2 = av_malloc(dstW * filterSize * 2); > +if (!tmp2) > +return AVERROR(ENOMEM); > + > +memcpy(tmp2, filter, dstW * filterSize * 2); Could use av_memdup(). - Andreas ___

[FFmpeg-devel] [PATCH 1/2] libavutil/cpu: Add AV_CPU_FLAG_SLOW_GATHER.

2021-12-21 Thread Alan Kelly
This flag is set on Haswell and earlier and all AMD cpus. --- Checks for family for Haswell. All checks are done where AVX2 flag is set as this is clearer. libavutil/cpu.h | 1 + libavutil/x86/cpu.c | 15 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/libavut

Re: [FFmpeg-devel] [PATCH 1/2] avformat/mxf: support MCA audio information

2021-12-21 Thread Marton Balint
On Tue, 21 Dec 2021, Tomas Härdin wrote: tis 2021-12-21 klockan 11:44 +0100 skrev Marc-Antoine ARNAUD: Le ven. 17 déc. 2021 à 19:12, Marton Balint a écrit : > > > On Fri, 17 Dec 2021, Marc-Antoine ARNAUD wrote: > > > Hi all, > > > > Can I have an update on this patch submission ? > > I

Re: [FFmpeg-devel] [PATCH 1/2] libavutil/cpu: Add AV_CPU_FLAG_SLOW_GATHER.

2021-12-21 Thread Lynne
21 Dec 2021, 20:56 by alankelly-at-google@ffmpeg.org: > This flag is set on Haswell and earlier and all AMD cpus. > --- > Checks for family for Haswell. All checks are done where AVX2 flag is > set as this is clearer. > libavutil/cpu.h | 1 + > libavutil/x86/cpu.c | 15 ++-

Re: [FFmpeg-devel] swscale: fix style issues and check malloc in ff_shuffle_filter_coefficients

2021-12-21 Thread Lynne
21 Dec 2021, 20:18 by andreas.rheinha...@outlook.com: > Lynne: > >> >> +if (filterSize > 4) { >> +int16_t *tmp2 = av_malloc(dstW * filterSize * 2); >> +if (!tmp2) >> +return AVERROR(ENOMEM); >> + >> +memcpy(tmp2, filter, dstW * filterSize

[FFmpeg-devel] [PATCH] libavformat/segment: strftime date sub-directories

2021-12-21 Thread James Dutton
Automatically create sub-directories if needed based on date. E.g. ffmpeg ... -timelimit 2147483647 -f segment -strftime 1 -segment_time 10 "%Y/%m/%d/%Y-%m-%d_%H-%M-%S.mkv" Signed-off-by: James Courtier-Dutton --- libavformat/segment.c | 15 +++ 1 file changed, 15 insertions(+) diff

Re: [FFmpeg-devel] [PATCH] libavformat/segment: strftime date sub-directories

2021-12-21 Thread James Dutton
Hi, This is a follow on from: https://patchwork.ffmpeg.org/project/ffmpeg/patch/caamvbhg9qsksxfuzrt3resrr89j5scyd84ec6olearqx4cu...@mail.gmail.com/ On Tue, 21 Dec 2021 at 21:39, James Dutton wrote: > > Automatically create sub-directories if needed based on date. > E.g. > ffmpeg ... -timelimit

Re: [FFmpeg-devel] [PATCH 7/7] lavfi/metal: fix build with pre-10.11 deployment targets

2021-12-21 Thread Aman Karmani
On Tue, Dec 21, 2021 at 4:15 PM rcombs wrote: > - Ensure the yadif .metal compiles when targeting any Metal runtime version > - Use some preprocessor awkwardness to ensure Core Video's Metal-specific > functionality is exposed regardless of our deployment target (this works > around what seem

[FFmpeg-devel] [PATCH 01/14] avcodec/mjpegenc: Use custom close function directly

2021-12-21 Thread Andreas Rheinhardt
Currently, ff_mpv_encode_end() is the close function of the two MJPEG-based encoders; it calls ff_mjpeg_encode_close() for them which adds a check to the generic code. This commit reverses the order of this relationship: The MJPEG encoders directly use a custom close function which in turn calls ff

[FFmpeg-devel] [PATCH 02/14] avcodec/mjpegenc: Avoid allocation of MJpegContext

2021-12-21 Thread Andreas Rheinhardt
This is possible by allocating it together with the MpegEncContext. Signed-off-by: Andreas Rheinhardt --- libavcodec/mjpegenc.c| 31 +-- libavcodec/mjpegenc_common.c | 2 +- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/libavcodec/mjpegenc.

[FFmpeg-devel] [PATCH 03/14] avcodec/mpegvideo_enc: Move MJPEG init checks to mjpegenc.c

2021-12-21 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/mjpegenc.c | 10 ++ libavcodec/mpegvideo_enc.c | 12 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c index 1652087948..8b51058f5d 100644 --- a/libavcodec/mjpeg

[FFmpeg-devel] [PATCH 05/14] avcodec/mjpegenc: Add wrapper for ff_mjpeg_encode_picture_header()

2021-12-21 Thread Andreas Rheinhardt
This factors the translation from MpegEncContext out and will enable further optimizations in the next commits. Signed-off-by: Andreas Rheinhardt --- libavcodec/mjpegenc.c | 16 ++-- libavcodec/mjpegenc.h | 1 + libavcodec/mpegvideo_enc.c | 5 + 3 files changed, 16 in

[FFmpeg-devel] [PATCH 04/14] avcodec/mpegvideo_enc: Remove redundant checks for multithreading

2021-12-21 Thread Andreas Rheinhardt
The generic code ensures that only codecs with the FF_CODEC_CAP_AUTO_THREADS internal cap ever have to handle the case avctx->thread_count == 0 themselves; moreover, it is also ensured generically that only codecs that support some form of threading have thread_count set to something else than one.

[FFmpeg-devel] [PATCH 06/14] avcodec/mjpegenc_common: Move code for MJPEG/AMV to mjpegenc

2021-12-21 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/mjpegenc.c| 4 libavcodec/mjpegenc_common.c | 14 ++ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c index b682036f87..c1b759f7a8 100644 --- a/libavcodec/mjpege

[FFmpeg-devel] [PATCH 08/14] avcodec/mpegvideo: Move MJPEG/AMV-only fields to MJpegContext

2021-12-21 Thread Andreas Rheinhardt
This is possible now that MJpegContext is allocated jointly with MpegEncContext as part of the AVCodecContext's private data. Signed-off-by: Andreas Rheinhardt --- libavcodec/mjpegenc.c| 18 ++ libavcodec/mjpegenc.h| 3 +++ libavcodec/mjpegenc_common.c | 4 ++--

[FFmpeg-devel] [PATCH 09/14] avcodec/mjpegenc: Deprecate unused prediction type

2021-12-21 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/mjpegenc.c| 6 -- libavcodec/mjpegenc_common.c | 2 +- libavcodec/mpegvideo.h | 3 +-- libavcodec/version.h | 3 ++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegen

[FFmpeg-devel] [PATCH 07/14] avcodec/mjpegenc_common: Fix intendation

2021-12-21 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/mjpegenc_common.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/libavcodec/mjpegenc_common.c b/libavcodec/mjpegenc_common.c index 8046e4b8f7..b9df32ad15 100644 --- a/libavcodec/mjpegenc_common.c +++ b/

[FFmpeg-devel] [PATCH 10/14] avcodec/mjpegenc_common: Pass MJpegContext for writing picture header

2021-12-21 Thread Andreas Rheinhardt
It is the structure that is actually used. Signed-off-by: Andreas Rheinhardt --- libavcodec/ljpegenc.c| 2 +- libavcodec/mjpegenc.c| 5 +++-- libavcodec/mjpegenc_common.c | 36 +--- libavcodec/mjpegenc_common.h | 3 +++ 4 files changed, 24 inser

[FFmpeg-devel] [PATCH 11/14] avcodec/mjpegenc_common: Don't call function unnecessarily

2021-12-21 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/mjpegenc_common.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libavcodec/mjpegenc_common.c b/libavcodec/mjpegenc_common.c index 70d5fddfd5..ecc21da1b8 100644 --- a/libavcodec/mjpegenc_common.c +++ b/libavcodec/mjpegen

[FFmpeg-devel] [PATCH 12/14] avcodec/mjpegenc_common: Use AVCodecContext.codec_id directly

2021-12-21 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/mjpegenc_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mjpegenc_common.c b/libavcodec/mjpegenc_common.c index ecc21da1b8..e385ea20ed 100644 --- a/libavcodec/mjpegenc_common.c +++ b/libavcodec/mjpegenc_commo

[FFmpeg-devel] [PATCH 13/14] avcodec/mpegvideo: Remove unnecessary headers

2021-12-21 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/eatqi.c| 1 + libavcodec/mdec.c | 1 + libavcodec/mpegvideo.c| 3 --- libavcodec/mpegvideo.h| 3 +-- libavcodec/mpegvideo_enc.c| 1 + libavcodec/mpegvideo_parser.c | 1 + libavcodec/speedhqenc.c | 1

[FFmpeg-devel] [PATCH 14/14] avcodec/mpegvideo_enc: Remove impossible branch

2021-12-21 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegvideo_enc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 4ee7666c78..79f67ca01b 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@