Commit Graph

87 Commits

Author SHA1 Message Date
Andreas Rheinhardt 790f793844 avutil/common: Don't auto-include mem.h
There are lots of files that don't need it: The number of object
files that actually need it went down from 2011 to 884 here.

Keep it for external users in order to not cause breakages.

Also improve the other headers a bit while just at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
Marton Balint 7251f90972 fftools/ffplay: use correct buffersink channel layout parameters
Regression since 0995e1f1b3.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-03-19 20:48:22 +01:00
Anton Khirnov e2e2ee7711 fftools/ffplay: stop printing non-public AVCodecContext fields
They are documented as not intended for caller use.
2024-03-04 15:56:48 +01:00
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
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
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 67529ad8a4 fftools/cmdutils: drop alt_flags parameter from show_help_options()
No user sets it to more than one flag, so it is redundant with
req_flags.
2024-01-20 10:37:32 +01:00
Anton Khirnov fcddd233fe fftools/ffplay: make option strings dynamically allocated
Do not store the supplied arg pointer directly. While that is valid for
now, it will become ephemeral in the future commits.
2024-01-20 10:23:24 +01:00
Zhao Zhili 38aca1dc9a fftools/ffplay: fix missing hw_frames_ctx when config avfilter
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-01-12 10:49:46 +08:00
xufuji456 6caf34dbe0 fftool/ffplay: avoid same name in local variable
There is a warning in XCode:"Declaration shadows a local variable"

Signed-off-by: xufuji456 <839789740@qq.com>
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2024-01-05 02:11:21 +08:00
Anton Khirnov 5b1b132072 fftools/cmdutils: rename HAS_ARG to OPT_FUNC_ARG
For consistent namespacing with other option flags. Also, document and
enforce that it can only be set for func-type options.
2023-12-22 11:39:57 +01:00
Anton Khirnov d2e479a429 fftools: split off option types from other flags
These values are not actually flags, as only one of them can be
meaningfully set.
2023-12-22 11:39:57 +01:00
Anton Khirnov b472c46a70 fftools/cmdutils: simplify handling of the HAS_ARG option flag
This option flag only carries nontrivial information for options that
call a function, in all other cases its presence can be inferred from
the option type (bool options do not have arguments, all other types do)
and is thus nothing but useless clutter.

Change the option parsing code to infer its value when it can, and drop
the flag from options where it's not needed.
2023-12-22 11:39:57 +01:00
Zhao Zhili a1a6a328f0 fftools/ffplay: add hwaccel decoding support
Add vulkan renderer via libplacebo.

Simple usage:
$ ffplay -hwaccel vulkan foo.mp4

Use cuda to vulkan map:
$ ffplay -hwaccel cuda foo.mp4

Create vulkan instance by libplacebo, and enable debug:
$ ffplay -hwaccel vulkan \
	-vulkan_params create_by_placebo=1:debug=1 foo.mp4

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-11-15 01:20:11 +08:00
James Almer 27fcc8dd9f fftools/ffplay: stop injecting stream side data in packets
This is no longer needed as the side data is available for decoders in the
AVCodecContext.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-10-06 10:11:19 -03:00
James Almer 235a66a143 fftools/ffplay: stop using AVStream.side_data
Signed-off-by: James Almer <jamrial@gmail.com>
2023-10-06 10:11:18 -03:00
Lynne 4acd08be6c
ffplay: port to lavu/tx 2023-09-01 23:59:11 +02:00
Anton Khirnov 78699923ac fftools/ffplay: replace report_and_exit() with returning an error code 2023-07-20 20:47:46 +02:00
Anton Khirnov eda1fac27a fftools/cmdutils: return AVERROR_EXIT for OPT_EXIT options instead of aborting() 2023-07-20 20:47:46 +02:00
Anton Khirnov 87f0333af1 fftools/cmdutils: add error handling to filter_codec_opts() 2023-07-20 20:47:46 +02:00
Anton Khirnov 39d5104332 fftools: handle errors in parse_options() 2023-07-20 20:47:46 +02:00
Anton Khirnov 49ac7fc485 fftools: remove parse_time_or_die()
Replace it with calling av_parse_time() directly, which provides
graceful error handling and more accurate error messages.
2023-07-20 20:47:46 +02:00
Anton Khirnov 9cb47c78d6 fftools: return errors from parse_number_or_die() instead of aborting
Rename the function to just parse_number().
2023-07-20 20:47:40 +02:00
Anton Khirnov 2e6afa799e fftools/cmdutils: add error handling to GROW_ARRAY() 2023-07-20 20:40:26 +02:00
Anton Khirnov 37abb3a419 fftools/cmdutils: return error codes from setup_find_stream_info_opts() instead of aborting 2023-07-20 20:40:26 +02:00
QiTong Li 79f41a0760 fftools/ffplay: fix typo in frame_queue_destory
Not sure if the function naming frame_queue_destory is intended because
"destory" is not really a word. Changing it to "destroy" makes more sense.

Signed-off-by: QiTong Li <liqitong@163.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2023-07-06 21:24:47 +02:00
James Almer 50f34172e0 fftools/ffplay: remove usage of internal AVInputFormat.read_seek field
It's an internal field, so it should not be touched.

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-07-02 19:04:25 -03:00
Anton Khirnov 2fb3ee1787 fftools/ffplay: stop using AVFrame.pkt_pos
This field is ad-hoc and will be deprecated. Use the recently-added
AV_CODEC_FLAG_COPY_OPAQUE to pass arbitrary user data from packets to
frames.
2023-03-20 10:42:09 +01:00
Anton Khirnov c29e5ab5c1 fftools/ffplay: depend on avfilter
Making lavfi optional adds a lot of complexity for very questionable
gain.
2023-03-20 10:42:09 +01:00
Anton Khirnov 9141c0cfd8 fftools/ffplay: drop an unused function argument 2023-03-20 10:42:09 +01:00
Zhao Zhili c926140558 fftools/ffplay: prefer fd over pipe for seek support
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:50:36 +08:00
Marvin Scholz f1907faab4 fftools: use av_dict_iterate
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-12-01 11:21:14 +01:00
Wang Yaqiang 3f0fac9303 fftools/ffplay: fix rotation incorrect when frame contains the displaymatrix
For example, if the jpeg contains exif information
and the rotation direction is included in the exif,
the displaymatrix will be set on the side_data of the frame when decoding.
However, when ffplay is used to play the image,
only the side data in the stream will be determined.
It does not check whether the frame also contains rotation information,
causing it to play in the wrong direction

Reviewed-by: Zhao Zhili <zhilizhao@tencent.com>
Signed-off-by: Wang Yaqiang <wangyaqiang03@kuaishou.com>
2022-09-15 16:16:16 +08:00
Niklas Haas a526f0cc3a fftools/ffplay: fix YUV conversion mode
GL and Metal cache the state at time of texture creation. GLES2 and
Direct3D 11 use the state at time of the render copy call.

So the only way we can get the correct behavior consistently is by
making sure the state is set for both the upload *and* the draw call.
This probably isn't our bug to fix (upstream should make itself behave
consistently and also document its functions), but as it stands,
`ffplay` is misrendering BT.709 as BT.601 on my stock Linux system, and
that leaves a bad taste in my mouth.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-06-27 12:17:59 +02:00
Anton Khirnov bd0cbebf3e fftools: drop the fake "default" option from ffplay/ffprobe
It tries to process any unhandled options as AVOptions. Handle this
directly in cmdutils.c, without resorting to a confusing fake option
definition (which is currently visible to the users in -help output).
2022-03-22 18:49:43 +01:00
Anton Khirnov 6fd1cd6053 fftools/ffplay: drop options deprecated since 2011 2022-03-22 18:49:43 +01:00
Anton Khirnov a545cb2b9d fftools/cmdutils: split common option handlers into their own file 2022-03-22 18:49:43 +01:00
Zhao Zhili 117672c814 ffplay: don't shadow global variable
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-03-21 00:48:30 +01:00
Zhao Zhili 269ed0a413 ffplay: check AVFMT_NO_BYTE_SEEK flag for seek_by_bytes
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-03-21 00:48:30 +01:00
Martin Storsjö a78f136f3f configure: Use a separate config_components.h header for $ALL_COMPONENTS
This avoids unnecessary rebuilds of most source files if only the
list of enabled components has changed, but not the other properties
of the build, set in config.h.

Signed-off-by: Martin Storsjö <martin@martin.st>
2022-03-16 14:12:49 +02:00
James Almer 0995e1f1b3 ffplay: convert to new channel layout-API
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-15 09:42:46 -03:00
Anton Khirnov bdf9ed41fe ffplay: switch to new FIFO API 2022-02-07 00:31:23 +01:00
Chad Fraleigh a185b526a9 fftools: Constify values from av_dict_get()
Treat values returned from av_dict_get() as const, since they are
internal to AVDictionary.

Signed-off-by: Chad Fraleigh <chadf@triularity.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-11-18 19:43:32 +01:00
Zane van Iperen 783935de18
fftools/ffplay: don't disable x11 compositing
Prevents desktop stutters caused by the change (specifically on KDE).
We're not a game, we don't actually need it disabled.

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-10-29 12:17:41 +10:00
James Almer 535a835e51 ffmpeg: use display matrix frame side data for autorotation
And give it priority over stream side data when present.
Fixes part of ticket #6945.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-16 12:46:07 -03:00
Linjie Fu 5b0e6b0d82 fftools: Don't set default swscale flags in ffmpeg/ffprobe/ffplay
Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com>
2021-08-05 22:23:49 +08:00
Andreas Rheinhardt 2934a4b9a5 Remove unnecessary avassert.h inclusions
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 15:02:30 +02:00
Andreas Rheinhardt 1be3d8a0cb avcodec/avcodec: Stop including channel_layout.h in avcodec.h
Also include channel_layout.h directly wherever used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 11:14:31 +02:00
Valerii Zapodovnikov 3249b96342 fftools/ffplay: 240M matrix is not the same as BT.601
Signed-off-by: Valerii Zapodovnikov <val.zapod.vz@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-06-08 21:55:14 +02:00
Andreas Rheinhardt 56450a0ee4 avformat: Constify the API wrt AV(In|Out)putFormat
Also constify AVProbeData.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:08 -03:00