1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-02 03:06:28 +02:00
Commit Graph

102400 Commits

Author SHA1 Message Date
Andreas Rheinhardt
db09d3ed17 avcodec/roqaudioenc: Mark encoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-05-02 02:30:49 +02:00
Andreas Rheinhardt
d0639af58e avcodec/rl2: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-05-02 02:29:47 +02:00
Andreas Rheinhardt
543a2c3784 avcodec/ralf: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-05-02 02:27:40 +02:00
Andreas Rheinhardt
51e38d8e15 avcodec/ra144enc: Mark encoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-05-02 02:26:21 +02:00
Andreas Rheinhardt
b7a0850101 avcodec/ra144dec: Mark decoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-05-02 02:23:48 +02:00
Andreas Rheinhardt
71ace22d93 avcodec/r210enc: Mark encoders as init-threadsafe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-05-02 02:21:37 +02:00
Andreas Rheinhardt
6c18957445 avcodec/sunrastenc: Mark encoder as init-threadsafe
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-05-02 02:19:54 +02:00
Limin Wang
c7c138e411 avfilter/vf_identity: fix typo
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-05-01 08:45:30 +08:00
Limin Wang
d150a9eb44 avfilter/vf_identity: remove unnecessary check
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-05-01 08:45:30 +08:00
Limin Wang
8410000f17 avfilter/vf_psnr: remove unnecessary check
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-05-01 08:45:30 +08:00
Limin Wang
fd3dabe68e avfilter/vf_ssim: remove unnecessary check
For the pointer have been checked in the previous few lines of code

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-05-01 08:45:30 +08:00
James Almer
92769f260d avfilter/vf_scale: store the offset in a local variable before adding it
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-30 19:35:56 -03:00
James Almer
fb5e2d7112 avcodec/mjpegdec: fix SOF check in EOI
For frames decoded with skip_frame == AVDISCARD_ALL, a picture is not allocated
and got_picture is never set to 1 even if a SOF and SOS were parsed.
The existing check in EOI only cares if a SOF was parsed, not if a picture
allocated, so change it and add a new check to explicitly ensure a picture was
allocated when skip_frame != AVDISCARD_ALL.

Fixes probing and decoding when skip_frame is AVDISCARD_ALL.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-30 10:09:30 -03:00
Andreas Rheinhardt
8b83a4a885 avutil/mem: Also poison new av_realloc-allocated blocks
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-30 10:24:32 +02:00
Andreas Rheinhardt
4796ec5d4e avformat/dump: Remove remnants of codec timebase
Fixes Coverity issue #1477414.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-30 10:21:29 +02:00
James Almer
036bb53ccc configure: fix vulkan dep for libglslang based filters
Temporary fix until the filters are updated.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-29 21:58:32 -03:00
Lynne
49e3a844ba
configure: add -lvulkan to libglslang's lib flags
Since libavutil no longer links to libvulkan but libavfilter's Vulkan
code wasn't ported yet to dynamically open the functions, do this
temporarily.
2021-04-30 00:52:43 +02:00
Lynne
cf17e2323f hwcontext_vulkan: dlopen libvulkan
While Vulkan itself went more or less the way it was expected to go,
libvulkan didn't quite solve all of the opengl loader issues. It's multi-vendor,
yes, but unfortunately, the code is Google/Khronos QUALITY, so suffers from
big static linking issues (static linking on anything but OSX is unsupported),
has bugs, and due to the prefix system used, there are 3 or so ways to type out
functions.

Just solve all of those problems by dlopening it. We even have nice emulation
for it on Windows.
2021-04-30 00:08:37 +02:00
Lynne
4a6581e968 hwcontext_vulkan: dynamically load functions
This patch allows for alternative loader implementations.
2021-04-30 00:08:37 +02:00
James Almer
ffeeff4fbc avutil/hwcontext_vulkan: fix format specifiers for some printed variables
VkPhysicalDeviceLimits.optimalBufferCopyRowPitchAlignment and
VkPhysicalDeviceExternalMemoryHostPropertiesEXT.minImportedHostPointerAlignment are of type
VkDeviceSize (a typedef uint64_t).
VkPhysicalDeviceLimits.minMemoryMapAlignment is of type size_t.

Signed-off-by: James Almer <jamrial@gmail.com>
Reviewed-by: Lynne <dev@lynne.ee>
2021-04-29 14:04:02 -03:00
Zane van Iperen
ab38a48c48
fate: add adpcm_ima_ws test in a VQA v3 file
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-04-29 23:52:46 +10:00
Limin Wang
829d7bb518 doc/filters: Documentation to add sess_config option for tensorflow backend
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-04-29 20:57:52 +08:00
Limin Wang
f183d6555e avfilter/dnn/dnn_backend_tf: simplify the code with ff_hex_to_data
please use tools/python/tf_sess_config.py to get the sess_config after that.
note the byte order of session config is in normal order.
bump the MICRO version for the config change.

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-04-29 20:02:29 +08:00
Andreas Rheinhardt
4e8d22478b avcodec/zmbvenc: Simplify setting keyframe flag
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-29 02:44:14 +02:00
zheng qian
86a71d897f avformat/mpegtsenc: Fix indentation inside if-clause in mpegts_write_pes()
Fix indentation caused by the added stream_id check.

Signed-off-by: zheng qian <xqq@xqq.im>
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-04-28 21:35:46 +02:00
zheng qian
6ad61e30a1 avformat/mpegtsenc: Fix mpegts_write_pes() for private_stream_2 and other types
According to the PES packet definition defined in Table 2-17 of ISO_IEC_13818-1
specification, some fields like PTS/DTS or pes_extension could only appears if
the stream_id meets the condition:

if (stream_id != 0xBC &&  // program_stream_map
    stream_id != 0xBE &&  // padding_stream
    stream_id != 0xBF &&  // private_stream_2
    stream_id != 0xF0 &&  // ECM
    stream_id != 0xF1 &&  // EMM
    stream_id != 0xFF &&  // program_stream_directory
    stream_id != 0xF2 &&  // DSMCC_stream
    stream_id != 0xF8)    // ITU-T Rec. H.222.1 type E stream

And the following stream_id types don't have fields like PTS/DTS:

else if ( stream_id == program_stream_map
|| stream_id == private_stream_2
|| stream_id == ECM
|| stream_id == EMM
|| stream_id == program_stream_directory
|| stream_id == DSMCC_stream
|| stream_id == ITU-T Rec. H.222.1 type E stream ) {
    for (i = 0; i < PES_packet_length; i++) {
        PES_packet_data_byte
    }
}

Current implementation skipped the check of stream_id causing some kind of
streams like private_stream_2 to be incorrectly written with actually a
private_stream_1-like PES header with PTS/DTS field. For example, Japan DTV
transmits news and alerts through ARIB superimpose that utilizes
private_stream_2 still could not be remuxed correctly for now.

This patch set fixes the remuxing for private_stream_2 and
other stream_id types.

Signed-off-by: zheng qian <xqq@xqq.im>
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-04-28 21:32:22 +02:00
zheng qian
f01286957e avformat/mpegts: Fix indentation for stream_id constants
Signed-off-by: zheng qian <xqq@xqq.im>
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-04-28 21:24:45 +02:00
zheng qian
f4df5039a7 avformat/mpegts: Add missing constants for MPEG-TS stream_id definitions
Signed-off-by: zheng qian <xqq@xqq.im>
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-04-28 21:24:45 +02:00
Marton Balint
3f27021143 avformat/mpegtsenc: factorize determining pes stream id
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-04-28 21:24:44 +02:00
Marton Balint
b9fff6e15e avformat/mpegtsenc: move is_dvb_subtitle/is_dvb_teletext initialization upwards
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-04-28 21:24:44 +02:00
Lynne
3a3e8c35b6
hwcontext_vulkan: reorder structure fields and add spaces in between
We're in the middle of an ABI unstable period, so we're allowed to.
2021-04-28 18:18:05 +02:00
Andreas Rheinhardt
2606c48391 avcodec/flacenc: Remove always-true check
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-28 17:42:37 +02:00
Andreas Rheinhardt
1c7f252783 avcodec: Remove redundant freeing of extradata of encoders
AVCodecContext.extradata is freed generically by libavcodec for
encoders, so it is unnecessary for an encoder to do it on its own.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-28 16:56:40 +02:00
Zane van Iperen
1ab74bc193
avcodec/adpcm_ima_apm: cosmetics
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-04-28 11:13:50 +10:00
Zane van Iperen
a859e57424
avcodec/adpcm_ima_apm: remove old extradata format
Was added in error very early on, passing in only the required fields.
Later, the muxer and demuxer were changed to pass the entire APMState
struct as extradata.

Technically a breaking change, but this was only around for a *very* short
time before it was updated,

Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-04-28 11:13:43 +10:00
Andreas Rheinhardt
9e13df3776 avcodec/avcodec: Use avcodec_close() on avcodec_open2() failure
Compared to the earlier behaviour the following changes:
a) AVCodecInternal.byte_buffer is freed.
b) The last_pkt_props FIFO is emptied before freeing it.
c) If set AVCodecContext.hwaccel is uninitialized and its private data
is freed; hw_frames_ctx and hw_device_ctx are also unreferenced.
d) coded_side_data is freed.
e) active_thread_type is reset.
a), b), d) should be no-ops as the buffer/fifo should be empty and
no coded_side_data should exist at any point of avcodec_open2().
e) is obviously not bad.
c) is in accordance with the documentation of hw_(frames|device)_ctx
which states that libacodec takes over ownership of these references.
At least in the case of VC-1 it is possible for the hw acceleration to
be set during init and in this case freeing it actually fixes a memleak.

avcodec_close() needed only minor adjustments to make it work with
a potentially not fully initialized codec.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-28 02:19:22 +02:00
Andreas Rheinhardt
29f5c1e51b avcodec/avcodec: Store whether AVCodec->close needs to be called
Right now all AVCodecContexts except those using frame-threaded decoding
call the codec's init function and expect its close function to be
called. In order to make sure that the close function is not called for
frame-threaded decoding ff_frame_thread_free() resets
AVCodecContext.codec (and because of this it has to free the private
AVOptions of the main AVCodecContext itself). This is not obvious and
potentially fragile. Instead add a field to AVCodecInternal that
indicates whether close should be called for this AVCodecContext.
It is always zero when using frame-threaded decoding, so that resetting
the codec is no longer necessary and has been removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-28 02:03:15 +02:00
Andreas Rheinhardt
d07534b5f5 avcodec/avcodec: Free frame_thread_encoder on avcodec_open2() error
The frame_thread_encoder has so far not been freed in case an error
happened in avcodec_open2() after ff_frame_thread_encoder_init().
This commit changes this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-28 01:50:40 +02:00
Andreas Rheinhardt
83b6471dcb avcodec/avcodec: Remove unnecessary forward declaration
Forgotten in ba6cada92e.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-28 01:50:39 +02:00
Andreas Rheinhardt
4be1714b12 avcodec/Makefile: Remove obsolete dependency of eatqi dec on rl.o
Unnecessary since 6e8fcd9c56.

Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-28 01:46:53 +02:00
James Almer
0814610ee3 avcodec/packet_internal: move the next pointer in PacketList to the top of the struct
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 19:20:37 -03:00
James Almer
bd96c54fe4 doc/APIchanges: add hashes and version numbers for recent entries
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 18:42:25 -03:00
Andreas Rheinhardt
bc70684e74 avformat: Constify all muxer/demuxers
This is possible now that the next-API is gone.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 11:48:06 -03:00
Andreas Rheinhardt
d92f38c179 avdevice: Constify all devices
This is possible now that the next-API is gone.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 11:48:05 -03:00
Andreas Rheinhardt
a04ad248a0 avfilter: Constify all AVFilters
This is possible now that the next-API is gone.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 11:48:05 -03:00
Anton Khirnov
85ba17f36d Bump major versions of all libraries.
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-27 11:48:05 -03:00
James Almer
fe95a37144 avcodec: postpone removal of deprecated libopenh264 wrapper options
They were deprecated only a year ago

Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 11:48:05 -03:00
James Almer
cb9dbc60db avcodec: postpone removal of deprecated codec caps
This was deprecated only a year ago

Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 11:48:05 -03:00
James Almer
90262f3fb4 avfilter/buffersrc: postpone removal of sws_param
It was depreacted less than two years ago

Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 11:48:04 -03:00
James Almer
0bf3a7361d avutil: remove deprecated AVClass.child_class_next
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 11:48:04 -03:00