1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00
Commit Graph

1362 Commits

Author SHA1 Message Date
Zhao Zhili
39a0c55347 fftools/ffplay: Fix output color_spaces of filter
The sdl_supported_color_spaces only meant for SDL builtin renderer.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-03-01 17:19:15 +08:00
Andreas Rheinhardt
906fc2b2e7 fftools/ffmpeg_mux: Fix use of uninitialized variable
Broken in a2fc86378a.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-25 13:41:56 +01:00
Andreas Rheinhardt
b31ee084a9 fftools/ffprobe: Use int64_t instead of long long int
This makes ffprobe match the rest of the codebase.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-25 02:19:18 +01:00
Andreas Rheinhardt
08328463d5 fftools/ffprobe: Simplify printing xml values
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-25 02:19:18 +01:00
Andreas Rheinhardt
ed5bf403d7 fftools/ffprobe: Constify printing section header
Allows to avoid casting const away.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-25 02:19:18 +01:00
Andreas Rheinhardt
0f20e48e3d fftools/ffprobe: Don't cast const away needlessly
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-25 02:19:18 +01:00
Anton Khirnov
c19c2078f3 fftools/ffmpeg_sched: remove a triggerable assert in send_to_enc_sq()
It can be triggered when send_to_enc_thread() returns AVERROR(ENOMEM).
Propagate the error to the caller instead.

Reported-by: Andreas Rheinhardt
2024-02-24 11:51:41 +01:00
Anton Khirnov
a00765fcbe fftools/ffmpeg_sched: simplify failure path in sch_dec_send() 2024-02-24 11:51:41 +01:00
Anton Khirnov
a2fc86378a fftools/ffmpeg: declare loop indices inside loops 2024-02-24 11:51:41 +01:00
Anton Khirnov
29e1b9d90c fftools/cmdutils: remove harmful variable shadowing
It causes write_option() to return 0 when calling func_arg() fails.
2024-02-24 11:51:21 +01:00
Anton Khirnov
a3f69cdec7 fftools/ffmpeg: cosmetics, vertically align structs 2024-02-21 10:33:20 +01:00
Anton Khirnov
6b6815b1c8 fftools/ffmpeg: move subtitle helpers to ffmpeg_dec, their only user 2024-02-21 10:31:27 +01:00
Anton Khirnov
826cfd9997 fftools/ffmpeg_filter: pass framerate through InputFilterOptions
Rather than read it directly from InputStream.

This is a step towards avoiding the assumption that filtergraph inputs
are always fed by demuxers.
2024-02-21 10:27:20 +01:00
Anton Khirnov
fef3052df3 fftools/ffmpeg_filter: pass autorotate/reinit flags through InputFilterOptions
Rather than read them directly from InputStream.

This is a step towards avoiding the assumption that filtergraph inputs
are always fed by demuxers.
2024-02-21 10:27:20 +01:00
Anton Khirnov
6315f78e0c fftools/ffmpeg_filter: pass sub2video canvas size through InputFilterOptions
Rather than read them directly from InputStream.

This is a step towards avoiding the assumption that filtergraph inputs
are always fed by demuxers.
2024-02-21 10:27:20 +01:00
Anton Khirnov
bd3c1c194b fftools/ffmpeg_filter: accept a name from its upstream input
Do not construct the name manually from input file/stream indices.

This is a step towards avoiding the assumption that filtergraph inputs
are always fed by demuxers.
2024-02-21 10:27:20 +01:00
Anton Khirnov
8f592eb35f fftools/ffmpeg_filter: compute input trim start/end in demuxer
The computation is based on demuxer properties, so that is the more
appropriate place for it. Filter code just receives the desired
start time/duration.
2024-02-21 10:27:20 +01:00
Anton Khirnov
09438d6529 fftools/ffmpeg_filter: stop taking display matrix from global side data
It should never be necessary now that decoders propagate global side
data to frames.
2024-02-21 10:27:20 +01:00
Andreas Rheinhardt
44620ade25 fftools/ffmpeg_mux_init: Fix attachment_filename use-after-free
The filename is freed with the OptionsContext and therefore
there will be a use-after-free when reporting the filename
in print_stream_maps(). So create a copy of the string.

This is a regression since 8aed3911fc.
fate-lavf-mkv_attachment exhibits it (and reports a random nonsense
filename here), but this does not make the test fail (not even with
valgrind; only with ASAN, as it aborts on use-after-free).

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-18 18:09:33 +01:00
Anton Khirnov
1e7d2007c3 all: use designated initializers for AVOption.unit
Makes it robust against adding fields before it, which will be useful in
following commits.

Majority of the patch generated by the following Coccinelle script:

@@
typedef AVOption;
identifier arr_name;
initializer list il;
initializer list[8] il1;
expression tail;
@@
AVOption arr_name[] = { il, { il1,
- tail
+ .unit = tail
}, ...  };

with some manual changes, as the script:
* has trouble with options defined inside macros
* sometimes does not handle options under an #else branch
* sometimes swallows whitespace
2024-02-14 14:53:41 +01:00
Niklas Haas
c619d20906 fftools/ffplay: constrain supported YUV color spaces
SDL supports only these three matrices. Actually, it only supports these
three combinations: BT.601+JPEG, BT.601+MPEG, BT.709+MPEG, but we have
no way to restrict the specific *combination* of YUV range and YUV
colorspace with the current filter design.

See-Also: https://trac.ffmpeg.org/ticket/10839

Instead of an incorrect conversion result, trying to play a YCgCo file
with ffplay will simply error out with a "No conversion possible" error.
2024-02-09 21:02:08 +01:00
Anton Khirnov
05fc6d3ce7 fftools/ffmpeg_demux: set stream index right before sending packet to scheduler
This avoids assuming that it survives unchanged through bitstream
filters, if present.
2024-02-09 16:14:24 +01:00
Andreas Rheinhardt
8c2e86ca28 fftools/cmdutils: Don't cast const away
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-02-09 12:22:21 +01:00
Anton Khirnov
931192226b fftools/ffmpeg_mux: fix terminating muxer on streamcopy with -t
Reported-by: Andreas Rheinhardt
2024-02-05 11:55:12 +01:00
Damiano Galassi
45697e6a51 avcodec: add ambient viewing environment packet side data. 2024-02-04 13:36:21 -03:00
王昊然
344ec7a3f7 fftools/ffmpeg: use correct unit prefix symbol for binary scaled byte values
Fix bug #10501

Signed-off-by: WHR <msl0000023508@gmail.com>
2024-02-03 12:50:42 +01:00
Niklas Haas
f7b1017d73 fftools/ffmpeg_filter: simplify buffersrc arg printing
There's no need to go through full string expansion here.
2024-02-02 13:24:27 +01:00
Niklas Haas
dcc7263b0e fftools/ffplay: add missing YUV metadata to buffersrc
This commit lets ffplay properly propagate YUV metadata into the filter
graph, avoiding such issues as e.g. accidentally passing YCgCo into a
filter that can't support it. Also fixes an error related to this
missing metadata from buffersrc (since commit 2d555dc82d)

See-Also: https://trac.ffmpeg.org/ticket/10839
2024-02-02 13:22:42 +01:00
Anton Khirnov
093be1fb06 fftools/ffmpeg: cosmetics, vertically align Input{File,Stream} 2024-01-30 09:52:00 +01:00
Anton Khirnov
f4b76a1d6a fftools/ffmpeg: make InputStream.decoder_opts private to demuxer
It is no longer used outside of ffmpeg_demux.
2024-01-30 09:52:00 +01:00
Anton Khirnov
01c71b78eb fftools/ffmpeg: make InputStream.decoding_needed private to demuxer
It is no longer used outside of ffmpeg_demux.
2024-01-30 09:52:00 +01:00
Anton Khirnov
0d00e2e2f7 fftools/ffmpeg_dec: eliminate all remaining InputStream uses
Previously, the demuxer would register decoder with the scheduler, using
InputStream as opaque, and pass the scheduling index to the decoder.

Now the registration is done by the decoder itself, using DecoderPriv as
opaque, and the scheduling index is returned to demuxer from dec_open().

decoder_thread() then no longer needs to be accessed from outside of
ffmpeg_dec and can be made static.
2024-01-30 09:52:00 +01:00
Anton Khirnov
fe3be6f78f fftools/ffmpeg_dec: stop passing InputStream to dec_open() 2024-01-30 09:52:00 +01:00
Anton Khirnov
a0ca99ccb7 fftools/ffmpeg_dec: remove unnecessary InputStream arguments 2024-01-30 09:52:00 +01:00
Anton Khirnov
1b2c539a0f fftools/ffmpeg_dec: pass AVCodecParameters through DecoderOpts
Do not retrieve it from InputStream directly.

This is a step towards decoupling Decoder and InputStream.
2024-01-30 09:52:00 +01:00
Anton Khirnov
b3d1916ba0 fftools/ffmpeg_dec: pass AVCodec through DecoderOpts
Do not retrieve it from InputStream directly.

This is a step towards decoupling Decoder and InputStream.
2024-01-30 09:52:00 +01:00
Anton Khirnov
d5f9ef766b fftools/ffmpeg_dec: eliminate InputStream use in hw_device_setup_for_decode()
The same information can also be obtained from the decoder itself.

This is a step towards decoupling Decoder and InputStream.
2024-01-30 09:52:00 +01:00
Anton Khirnov
097f9ddbe9 fftools/ffmpeg_dec: pass decoder name through DecoderOpts
Do not build it from InputStream values.

This is a step towards decoupling Decoder and InputStream.
2024-01-30 09:52:00 +01:00
Anton Khirnov
9ba4bc87e6 fftools/ffmpeg_dec: pass top_field_first through DecoderOpts
Do not read it from InputStream directly.

This is a step towards decoupling Decoder and InputStream.
2024-01-30 09:52:00 +01:00
Anton Khirnov
9702817662 fftools/ffmpeg_dec: pass input timebase through DecoderOpts
Do not read it from AVStream directly.

This is a step towards decoupling Decoder and InputStream.
2024-01-30 09:52:00 +01:00
Anton Khirnov
b27de18e4f fftools/ffmpeg_dec: move setting compute_edt to demuxer
It is done based on demuxer information, so that is the more appropriate
place for this code.

This is a step towards decoupling Decoder and InputStream.
2024-01-30 09:52:00 +01:00
Anton Khirnov
052c83e356 fftools/ffmpeg_dec: pass forced/estimated framerate though DecoderOpts
Stop reading them from InputStream.

This is a step towards decoupling Decoder and InputStream.
2024-01-30 09:52:00 +01:00
Anton Khirnov
e0a6cb07b2 fftools/ffmpeg_dec: move flags to DecoderOpts
Will be useful in the following commit.
2024-01-30 09:52:00 +01:00
Anton Khirnov
4bdffec814 fftools/ffmpeg_dec: pass hwaccel options to the decoder in a separate struct
Stop reading them from InputStream.

This is a step towards decoupling Decoder and InputStream.
2024-01-30 09:52:00 +01:00
Anton Khirnov
a3a9c4ae66 fftools/ffmpeg: move hwaccel_retrieve_data() from ffmpeg_hw to ffmpeg_dec
This function is decoding-only and has no interaction with the rest of
ffmpeg_hw. It thus belongs more properly in ffmpeg_dec.
2024-01-30 09:52:00 +01:00
Anton Khirnov
ebb8a58c8f fftools/ffmpeg_dec: replace InputFile.format_nots with a decoder flag
Reduces the need to access InputFile from decoding.

This is a step towards decoupling Decoder and InputStream.
2024-01-30 09:52:00 +01:00
Anton Khirnov
a938f47916 fftools/ffmpeg: refactor disabling decoder threading for attached pictures
* as this decision is based on demuxing information, move it from the
  decoder to the demuxer
* as the issue being addressed is latency added by frame threading, we
  only need to disable frame threading, not all threading
2024-01-30 09:52:00 +01:00
Anton Khirnov
474ca6c71e fftools/ffmpeg_dec: stop accesing InputStream.fix_sub_duration
Pass this information to dec_open() instead.

This is a step towards decoupling Decoder and InputStream.
2024-01-30 09:52:00 +01:00
Anton Khirnov
924a6f3cc7 fftools/ffmpeg_dec: override video SAR with AVCodecParameters value
Rather than access the AVStream one.

This is a step towards decoupling Decoder and InputStream.
2024-01-30 09:52:00 +01:00
Anton Khirnov
b2a0a2e6f5 fftools/ffmpeg: move decoder existence check to a more appropriate place 2024-01-30 09:52:00 +01:00