1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

90561 Commits

Author SHA1 Message Date
James Almer
f14ca60001 avcodec/avpacket: add av_packet_make_writable()
Useful as well to quickly make a packet reference counted when it
isn't already so.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-21 22:17:40 -03:00
Jun Zhao
28aaed7737 lavc/remove_extradata_bsf: support dump options.
support dump bit stream filter options

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-21 22:00:36 -03:00
Jun Zhao
b8e406c01a lavc/noise_bsf: support dump options.
support dump bit stream filter options.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-21 22:00:32 -03:00
Jun Zhao
a4726288f8 lavc/dump_extradata_bsf: support dump options.
support dump bit stream filter options

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-21 22:00:28 -03:00
Bela Bodecs
1b45e6db22 avformat/unix: fix handling of EOF in case of SOCK_STREAM.
When recv() returns 0 in case of SOCK_STREAM type, it means EOF and with
this patch returns value accordingly.

Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
2018-03-21 19:02:06 +01:00
Paul B Mahol
36cf3eb76a avfilter/vf_waveform: add orange graticule
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2018-03-21 12:21:42 +01:00
Paul B Mahol
caef95737e avfilter/vf_waveform: add xflat mode
Also use macros for xflat and aflat mode.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2018-03-21 12:21:42 +01:00
Ruiling Song
86499771d1 qsv: align surface width/height to 16.
Per MediaSDK documentation, it requires width/height to 16 alignment.
Without this patch, hwupload pipeline may fail if 16 alignment is
not met. Although this patch also apply 16 alignment to qsv encoder/decoder,
it will not bring any side-effect to them as they are already aligned.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2018-03-21 08:42:47 +01:00
James Almer
7e0dc7210b avcodec/vp9_superframe_split: fix memory leak in case of output packet creation failure
Some function calls may fail after the output packet is initialized.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-21 01:38:34 -03:00
James Almer
72bb955625 avutil/integer: move the test to the corresponding subdirectory
And actually enable it.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-20 23:27:58 -03:00
Aman Gupta
2ddc6b4392 avcodec/mediacodecdec: propagate SAR to h/w frames
Allows consumers who are converting hardware buffers
to OpenGL textures to render the frames at the intended
display resolution.

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2018-03-20 15:52:23 -07:00
Michael Niedermayer
9e67447a4f avformat/mov: Check STSC and remove invalid entries
Fixes assertion failure
Fixes: crbug 822547, crbug 822666 and crbug 823009

Affects: aark15sd_9A62E2FA.mp4

Found-by: ClusterFuzz
Reviewed-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-03-20 22:59:40 +01:00
Jörn Heusipp
f6ea397d0a avformat/libopenmpt: Probe file format from file data if possible
When building with libopenmpt 0.3, use the libopenmpt file header
probing functions for probing. libopenmpt probing functions are
allocation-free and designed to be as fast as possible.

For libopenmpt 0.2, or when libopenmpt 0.3 file header probing cannot
probe successfully due to too small probe buffer, test the filename
against the file extensions supported by the libopenmpt library that
is actually linked, instead of relying on a hard-coded file extension
list. File extension testing is also allocation-free and designed to
be fast in libopenmpt. Avoiding a hard-coded file extension list is
useful because later libopenmpt versions will likely add support for
more module file formats.

libopenmpt file header probing is tested regularly against the FATE
suite and other diverse file collections by libopenmpt upstream in
order to avoid false positives.

FATE passes with './configure --enable-libopenmpt' as well as with
'./configure --enable-libopenmpt --enable-libmodplug'.

libopenmpt probing adds about 5%..10% cpu time (depending on precise
usage pattern and host CPU and compiler version used for libopenmpt)
compared to all current internal FFmpeg probing functions combined in
tools/probetest for all of its module formats combined (currently 41
modules formats in libopenmpt 0.3.4 and 234 file formats in FFmpeg).

Signed-off-by: Jörn Heusipp <osmanx@problemloesungsmaschine.de>
Reviewed-by: Josh de Kock <josh@itanimul.li>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-03-20 22:59:40 +01:00
Jörn Heusipp
81b0d591d6 avformat/libopenmpt: Update file extensions list for libopenmpt 0.3
Signed-off-by: Jörn Heusipp <osmanx@problemloesungsmaschine.de>
Reviewed-by: Josh de Kock <josh@itanimul.li>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-03-20 22:59:40 +01:00
Gyan Doshi
8ad83044b4 ffmpeg.c - drain all decoded frames during stream_loop flush
When a decoded stream is being looped, after each post-EOF rewind,
decoders are flushed in seek_to_start(). This only drains 1 frame, and
thus the output has a few frames missing at the tail of each iteration
except the last.

With this patch, process_input is looped till process_input_packet
reaches EOF.

Fixes #7081

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-03-20 22:59:40 +01:00
James Almer
2aac5ad2f7 avcodec/mpeg2_metadata: unref output packet on failure
Move the check and unref call to the end to be consistent with other
bsfs.

Reviewed-by: jkqxz
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-20 18:26:38 -03:00
James Almer
ae36d6cdde avcodec/h265_metadata: fix memory leak in case of output packet creation failure
Some function calls may fail after the output packet is initialized.

Reviewed-by: jkqxz
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-20 18:20:29 -03:00
James Almer
039be6a23f avcodec/h264_metadata: fix memory leak in case of output packet creation failure
Some function calls may fail after the output packet is initialized.

Reviewed-by: jkqxz
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-20 18:19:20 -03:00
James Almer
bd60116794 avcodec/mpeg4_unpack_bframes: reduce code duplication
Also fixes one potential leak of side data in out if
the av_packet_from_data() call fails.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-20 17:39:04 -03:00
James Almer
f18f973469 avcodec/mp3_header_decompress: don't free the user provided packet on error
It's owned by the caller.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-20 17:39:00 -03:00
James Almer
e4eaaf7bf6 avcodec/vp9_superframe_split: move the reference in the bsf internal buffer
There's no need to allocate a new packet for it.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-19 22:26:54 -03:00
Carl Eugen Hoyos
cbbefc05b1 lavfi/deshake: Check alignment before calling asm init function.
Do this for every frame to make sure dynamic filters do not
cause crashes.

Fixes ticket #7078.
2018-03-20 01:09:23 +01:00
Mark Thompson
1c49365c62 h264_metadata: Fix memory leak on multiple display orientation messages
Fixes CID #1430176.
2018-03-19 23:12:01 +00:00
Yingming Fan
e5b4cd4c4a checkasm/hevc_idct : update test bit depth from 8 9 and 10 to 8 10 and 12
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-19 00:56:01 -03:00
James Almer
d8ca7a7e70 configure: add const_nan dependency to h264_metadata_bsf
Fixes compilation with some compilers.

Reviewed-by: jkqxz
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-18 19:51:22 -03:00
Jun Zhao
dd21f02a04 lavc/mpeg2_metadata_bsf: support dump options.
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2018-03-18 20:32:45 +00:00
Jun Zhao
2a103e12ba lavc/h265_metadata_bsf: support dump options.
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2018-03-18 20:32:45 +00:00
Jun Zhao
840f5b3e5b lavc/h264_metadata_bsf: support dump options.
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2018-03-18 20:32:45 +00:00
James Almer
a094e7f16a avcodec/aac_adtstoasc: move the reference in the bsf internal buffer
There's no need to allocate a new packet for it.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-18 17:30:59 -03:00
Mark Thompson
0f3d1c69b5 hwcontext_vaapi: Always include DRM hwcontext header
Fixes building with VAAPI but not libdrm, which was broken by
389f4c3e0d.  Just unconditionally include
the header, since it doesn't depend on libdrm being present.
2018-03-18 18:34:38 +00:00
Mark Thompson
c99f837dde lavc: Add filter_units bitstream filter
This can remove units with types in or not in a given set from a stream.
For example, it can be used to remove all non-VCL NAL units from an H.264 or
H.265 stream.
2018-03-18 18:23:18 +00:00
Mark Thompson
389f4c3e0d hwcontext_vaapi: Fix condition for DRM device derivation
vaGetDisplayDRM() is required for this code to work, libdrm is not.
2018-03-18 17:55:00 +00:00
Mark Thompson
84bb8327f5 cbs: Add a table of all supported codec IDs
Use it as the set of codec IDs supported by the trace_headers BSF.
2018-03-18 17:55:00 +00:00
Mark Thompson
94d42cb4cc h264_metadata: Remove unused fields
The SEI NAL is unused since 69062d0f9b,
while the AUD NAL is small and would more sensibly be on the stack.
2018-03-18 17:55:00 +00:00
Mark Thompson
84c3c766d8 h264_metadata: Add support for display orientation SEI messages 2018-03-18 17:55:00 +00:00
Mark Thompson
c4eeea7633 cbs_h265: Use helper macro for maximum values of fixed-width elements
Apply the same logic as the previous patch to H.265.  There are no cases
which currently overflow here, but this is still more consistent.
2018-03-18 17:55:00 +00:00
Mark Thompson
0e782661d6 cbs_h264: Fix overflow in shifts
The type of the result of a shift operation is unaffected by the type of
the right operand, so some existing code overflows with undefined behaviour
when the element length is 32.  Add a helper macro to calculate the maximum
value correctly and then use it everywhere this pattern appears.

Found-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com>
2018-03-18 17:54:55 +00:00
Felix Matouschek
ce1d77a5e7 lavd: fix iterating of input and output devices
In the previous implementation the first input or output device
was skipped when device_next was called with prev = NULL

Signed-off-by: Felix Matouschek <felix@matouschek.org>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2018-03-18 17:45:20 +01:00
Martin Vignali
3e7fa34d3b avfilter/vf_premultiply : fix unpremultiply_offset for rgb input 2018-03-18 13:45:04 +01:00
Martin Vignali
b2bb1cb68b fate/hapqa_extract : add test for hapqa_extract bsf
test extract color and alpha
with the three main kind of hap frame :
- no snappy compression
- snappy compression and one chunk
- snappy compression and several chunks (16 here)

like the bsf filter need to be used with vtag and encoder edition
also test the information of the target mov for color and alpha
2018-03-18 13:43:39 +01:00
wm4
b7d842c554 http: fix potentially dangerous whitespace skipping code
If the string consists entirely of whitespace, this could in theory
continue to write '\0' before the start of the memory allocation. In
practice, it didn't really happen: the generic HTTP header parsing code
already skips leading whitespaces, so the string is either empty, or
consists a non-whitespace. (The generic code and the cookie code
actually have different ideas about what bytes are whitespace: the
former uses av_isspace(), the latter uses WHITESPACES. Fortunately,
av_isspace() is a super set of the http.c specific WHITESPACES, so
there's probably no case where the above assumption could have been
broken.)
2018-03-18 12:36:24 +01:00
wm4
c0687acbf6 http: avoid out of bound accesses on broken Set-Cookie headers
It's trivial to craft a HTTP response that will make the code for
skipping trailing whitespace access and possibly overwrite bytes outside
of the memory allocation. Why this can happen is blindingly obvious: it
accesses cstr[strlen(cstr)-1] without checking whether the string is
empty.
2018-03-18 12:36:24 +01:00
wm4
39c1d170a3 http: do not print a warning message for expired cookies
libavformat prints a warning that the cookie couldn't be parsed (see
callers of parse_cookie()). This is obviously not true - it could be
parsed, but was simply ignored. Don't return an error to avoid the
warning.
2018-03-18 12:36:24 +01:00
wm4
4b86ac27a0 lavu/frame: add QP side data
This adds a way for an API user to transfer QP data and metadata without
having to keep the reference to AVFrame, and without having to
explicitly care about QP APIs. It might also provide a way to finally
remove the deprecated QP related fields. In the end, the QP table should
be handled in a very similar way to e.g. AV_FRAME_DATA_MOTION_VECTORS.

There are two side data types, because I didn't care about having to
repack the QP data so the table and the metadata are in a single
AVBufferRef. Otherwise it would have either required a copy on decoding
(extra slowdown for something as obscure as the QP data), or would have
required making intrusive changes to the codecs which support export of
this data.

The new side data types are added under deprecation guards, because I
don't intend to change the status of the QP export as being deprecated
(as it was before this patch too).
2018-03-18 12:36:24 +01:00
wm4
36855abc0e lavu/frame: fix inconsistent qp_table_buf deprecation
Everything related to the QP data is deprecated, with qp_table_buf being
an inconsistent exception. Some parts were under the deprecation guards,
some not. It probably didn't even compile.
2018-03-18 12:36:24 +01:00
Steven Liu
f19b0c6aee avformat/hlsenc: reindent after previous commits
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2018-03-18 19:05:17 +08:00
Steven Liu
c8f625f529 avformat/hlsenc: fix fmp4 single init file problem
fix ticket: #7021

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2018-03-18 19:05:17 +08:00
Steven Liu
c608669264 avformat/hlsenc: fix memleak problem about fmp4_init_filename
move fmp4_init_filename init in if else for first fmp4_init_filename set
value operation.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2018-03-18 19:05:17 +08:00
Steven Liu
10a0436dca avformat/hlsenc: reindent after previous commits
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2018-03-18 19:05:09 +08:00
Steven Liu
a92ca3c07c avformat/hlsenc: fix write wrong init file URI string problem
fmp4_init_filename should append after base_output_dirname

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2018-03-18 19:05:05 +08:00