Commit Graph

107880 Commits

Author SHA1 Message Date
Anton Khirnov
61d9f34c70 fftools/ffmpeg_demux: do not store demux packet in the context
Its use is local to input_thread().
2022-08-08 16:20:58 +02:00
Anton Khirnov
de9fb9fba7 fftools/ffmpeg_demux: factorize signalling end of demuxing 2022-08-08 16:20:58 +02:00
Anton Khirnov
aae9de0cb2 fftools/ffmpeg: move -stream_loop handling to the demuxer thread
-stream_loop is currently handled by destroying the demuxer thread,
seeking, then recreating it anew. This is very messy and conflicts with
the future goal of moving each major ffmpeg component into its own
thread.

Handle -stream_loop directly in the demuxer thread. Looping requires the
demuxer to know the duration of the file, which takes into account the
duration of the last decoded audio frame (if any). Use a thread message
queue to communicate this information from the main thread to the
demuxer thread.
2022-08-08 16:20:58 +02:00
Anton Khirnov
b99462cd27 fftools/ffmpeg: move seek_to_start() to ffmpeg_demux.c
Reduces the diff in the following commit.
2022-08-08 16:20:58 +02:00
Anton Khirnov
57d75ca031 fftools/ffmpeg: move get_input_packet() to ffmpeg_demux.c
Also rename it to use the ifile_* namespace.
2022-08-08 16:20:58 +02:00
Anton Khirnov
07da07ddb0 fftools/ffmpeg: report new streams from the input thread
This avoids a potential race with the demuxer adding new streams. It is
also more efficient, since we no longer do inter-thread transfers of
packets that will be just discarded.
2022-08-08 16:20:58 +02:00
Anton Khirnov
9c16310fe5 fftools/ffmpeg: handle dumping input packets in input_thread()
This is a more appropriate place for this.
2022-08-08 16:20:58 +02:00
Anton Khirnov
b1f24afe7e fftools/ffmpeg: drop the 'h' key handling
This undocumented feature runtime-enables dumping input packets. I can
think of no reasonable real-world use case that cannot also be
accomplished in a different way. Keeping this functionality would
interfere with the following commit moving it to the input thread (then
setting the variable would require locking or atomics, which would be
unnecessarily complicated for a feature that probably nobody uses).
2022-08-08 16:20:58 +02:00
Anton Khirnov
7b6622705e fftools/ffmpeg: move the input thread into its own file
It will contain more demuxing-specific code in the future.
2022-08-08 16:20:58 +02:00
Anton Khirnov
c3b8d59d2f fftools/ffmpeg: drop a write-only variable 2022-08-08 16:20:58 +02:00
Anton Khirnov
d8bf53710f fftools/ffmpeg: always read input in a thread
This will be required by the following architecture changes.
2022-08-08 16:20:58 +02:00
Anton Khirnov
cc2b7f4625 fftools/ffmpeg: store the input file index in InputFile
Use it to simplify some code and fix two off-by-one errors.

Similar to what was previously done for OutputFile.
2022-08-08 16:20:58 +02:00
Anton Khirnov
9139ea4c8d fftools/ffmpeg: drop a superfluous stack variable 2022-08-08 16:20:58 +02:00
Anton Khirnov
889b4b2f60 doc/ffmpeg: update -map documentation
Make it match reality (current text was not updated for stream
specifiers), extend and clarify the text.
2022-08-08 16:20:58 +02:00
Anton Khirnov
fee249b30a fftools/ffmpeg: deprecate specifying a sync stream with -map
It has not had any effect whatsoever for over 10 years.
2022-08-08 16:20:58 +02:00
Anton Khirnov
49123dd058 fftools/ffmpeg: remove OutputStream.sync_ist
It is not actually used for anything.
2022-08-08 16:20:58 +02:00
Anton Khirnov
8e092c3eac fftools/ffmpeg: remove OutputStream.encoding_needed
It is unnecessary, as it is always exactly equivalent to !!ost->enc_ctx
2022-08-08 16:20:58 +02:00
Anton Khirnov
80e7feb48b fftools/ffmpeg: remove OutputStream.stream_copy
There are currently three possible modes for an output stream:
1) The stream is produced by encoding output from some filtergraph. This
   is true when ost->enc_ctx != NULL, or equivalently when
   ost->encoding_needed != 0.
2) The stream is produced by copying some input stream's packets. This
   is true when ost->enc_ctx == NULL && ost->source_index >= 0.
3) The stream is produced by attaching some file directly. This is true
   when ost->enc_ctx == NULL && ost->source_index < 0.

OutputStream.stream_copy is currently used to identify case 2), and
sometimes to confusingly (or even incorrectly) identify case 1). Remove
it, replacing its usage with checking enc_ctx/source_index values.
2022-08-08 16:20:58 +02:00
Anton Khirnov
4f2b946c19 fftools/ffmpeg_opt: drop redundant decoder selection
A decoder is already selected above, in choose_decoder().
2022-08-08 16:20:58 +02:00
Anton Khirnov
a1da77bd71 fftools/ffmpeg: stop accessing the decoder context unnecessarily
The same information is available from AVStream.codecpar. This will
allow to stop allocating a decoder unless decoding is actually
performed.
2022-08-08 16:20:58 +02:00
Anton Khirnov
04b340e6b8 fftools/ffmpeg_hw: stop logging to the decoder context
Only the decoder itself should do that. Use NULL as is done by all other
logging code in ffmpeg.
2022-08-08 16:20:58 +02:00
Anton Khirnov
20ba49c1a4 fftools/ffmpeg_opt: move adding metadata out of open_output_file() 2022-08-08 16:20:58 +02:00
Anton Khirnov
7cafea59bc fftools/ffmpeg_opt: move adding programs out of open_output_file() 2022-08-08 16:20:58 +02:00
Anton Khirnov
aad68ab0e0 fftools/ffmpeg_opt: move adding attachments out of open_output_file() 2022-08-08 16:20:58 +02:00
Martijn van Beurden
ed07ba641a avformat/movenc: Remove experimental status of flac-in-MP4 muxing
The fLaC and dfLa box IDs have been registered with the MP4 RA
(they are now listed at https://mp4ra.org/#/codecs) and support
for muxing FLAC in MP4 has been experimental in ffmpeg for
6 years now, since Nov 21, 2016

This patch removes the experimental status and removes the MP4
object type, as none has been registered for FLAC as it was not
deemed necessary.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2022-08-08 16:19:38 +02:00
Ruben Gonzalez
2d8d7f8592 avformat: allow .ec3 as extension for raw E-AC-3 stream
In addition to .eac3, .ec3 is also commonly used by people to name raw
E-AC-3 streams. Enables automatic recognition of the eac3 format for
the .ac3 extension.

For instance Dolby Digital Plus software only support files with
.ec3. Files with .eac3 are not supported. Check issue #18 in the
public dlb_mp4base repository from DolbyLaboratories.

Signed-off-by: Ruben Gonzalez <rgonzalez@fluendo.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2022-08-08 16:19:38 +02:00
James Almer
68e017c487 swscale/output: fix reading chroma values when generating vuya output
Signed-off-by: James Almer <jamrial@gmail.com>
2022-08-08 09:39:33 -03:00
Andreas Rheinhardt
56973eb687 avcodec/nvdec: Use av_buffer_replace() where appropriate
Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-08 11:42:28 +02:00
Andreas Rheinhardt
d3730acca3 avcodec/nvdec: Check av_buffer_ref()
It (unfortunately) involves an allocation and can therefore fail.

Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-08 11:41:52 +02:00
Andreas Rheinhardt
eb608fd0b0 avcodec/libspeexdec: Fix use of uninitialized value
Regression since 97d9a32938.
Fixes Coverity issue #1503072.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-08 11:37:14 +02:00
Andreas Rheinhardt
0d408f4013 avcodec/cbs_h2645: Remove always-false check
The functions to replace parameter sets are only called
after the respective parameter set has just been read or
has just been written; all of these functions check
that the id field is within the appropriate range.
So the checks in the replace-functions can be removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-08 11:29:34 +02:00
Andreas Rheinhardt
2ba04bafb4 avcodec/cbs: Remove ff_cbs_alloc_unit_content
It is no longer used.
Also rename ff_cbs_alloc_unit_content2 to ff_cbs_alloc_unit_content.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-08 11:29:33 +02:00
Andreas Rheinhardt
2d722b6638 avcodec/cbs_jpeg: Use table-based alloc/free
cbs_jpeg was the last user of CBS that didn't use
CodedBitstreamUnitTypeDescriptors.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-08 11:29:33 +02:00
Andreas Rheinhardt
9638f5b1a2 avcodec/cbs_internal: Use unions to shrink size of descriptors
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-08 11:29:33 +02:00
Andreas Rheinhardt
b37805ddbd avcodec/cbs_internal, cbs_h2645: Add and use new descriptor macros
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-08 11:29:33 +02:00
Andreas Rheinhardt
715d3286bc avcodec/cbs: Use smaller scope for variables, add const
And also avoid an unnecessary indirection for src_buf.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-08 11:29:33 +02:00
Andreas Rheinhardt
e35b8b848c avcodec/cbs: Remove redundant assignment
The code just creates new references without allocating
new buffers for the subobjects; therefore the actual data pointer
stays valid and need not be updated.

Also remove an assert that ensured that the calculation
for updating the pointer makes sense.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-08 11:29:33 +02:00
Andreas Rheinhardt
33f33beead avcodec/cbs: Avoid code duplication for making unit refcounted/writable
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-08 11:29:33 +02:00
Andreas Rheinhardt
9d0c71a81c avcodec/error_resilience: Avoid overhead of AVBuffer API
These buffers are not shared in any way.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-08 11:29:33 +02:00
Zhao Zhili
fc13803323 avutil/hwcontext_videotoolbox: add missing include for AVFrame
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2022-08-08 11:08:55 +08:00
Stephen Hutchinson
765fc3b943 avformat/avisynth: cosmetics after nb_channels change
Signed-off-by: James Almer <jamrial@gmail.com>
2022-08-07 22:42:27 -03:00
Stephen Hutchinson
dc9843d829 avformat/avisynth: use ch_layout.nb_channels for channel count
Fixes deprecation warning

Signed-off-by: James Almer <jamrial@gmail.com>
2022-08-07 22:41:57 -03:00
Michael Niedermayer
26180e8855 MAINTAINERS: Split project server admin list
This updates the list closer to reality.
Iam not a professional server admin, iam happy to help maintain the box as i have
done in the past. But iam not qualified nor volunteering to fix sudden problems
nor do i do major upgrades (i lack the experience to recover the box remotely if
something goes wrong) and also iam not maintaining backups ATM (our backup system
had a RAID-5 failure, raz is working on setting a new one up)

Maybe this should be signaled in a different way than spliting the lines but ATM
people ping me if something is wrong and what i do is mainly mail/ping raz
and try to find another root admin so raz is not the only active & professional
admin on the team. It would be more efficient if people contact raz and others
directly instead of depending on my waking up and forwarding a "ffmpeg.org" is down note

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-08-07 22:01:21 +02:00
Michael Niedermayer
e6bbaa1d49 avformat/mxfdec: SMPTE RDD 48:2018 Amd 1:2022 support
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-08-07 22:01:21 +02:00
caleb
6a0cec5315 avcodec/jpeg2000: Fast fail if HTJ2K codeblocks are present.
Reviewed-by: Pierre-Anthony Lemieux <pal@sandflow.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-08-07 22:01:21 +02:00
James Almer
13b3becc7b fate: fix reference file for fate-pixfmt_best
Missed in 85c59bd6de

Signed-off-by: James Almer <jamrial@gmail.com>
2022-08-07 15:15:45 -03:00
James Almer
f8c62e32b2 avformat/riff: map AYUV fourcc to RAWVIDEO decoder
There's no need to keep using a custom decoder for this pixel format.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-08-07 09:33:16 -03:00
James Almer
85c59bd6de avutil/test/pixfmt_best: test the VUYA pixel format
Signed-off-by: James Almer <jamrial@gmail.com>
2022-08-07 09:33:16 -03:00
James Almer
1974813261 swscale/output: add VUYA output support
Signed-off-by: James Almer <jamrial@gmail.com>
2022-08-07 09:33:16 -03:00
Peter Ross
23758380d0 avcodec: WBMP (Wireless Application Protocol Bitmap) image format
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Peter Ross <pross@xvid.org>
2022-08-07 19:18:18 +10:00