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

1462 Commits

Author SHA1 Message Date
Michael Niedermayer
2080bc3371 avcodec/utils: correct align value for interplay
Fixes out of array access
Fixes: 452/fuzz-1-ffmpeg_VIDEO_AV_CODEC_ID_INTERPLAY_VIDEO_fuzzer

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-01-25 00:56:37 +01:00
Paul B Mahol
95fb9e0205 avcodec: add pcm_f16le and pcm_f24le decoder
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-12-22 10:30:21 +01:00
Pavel Koshevoy
6b517a194d lavc: Fix ticket 6024, truncated mode decoding
The assumption that avcodec_send_packet makes regarding decoders
consuming the entire packet is not true if the codec supports
truncated decoding mode and the truncated flag is turned on.

Steps to reproduce:
./ffmpeg_g -flags truncated \
-i "http://samples.ffmpeg.org/MPEG2/test-ebu-422.40000.pakets.ts" \
-c:v ffv1 -c:a copy -y /tmp/truncated.nut

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-17 18:41:18 +01:00
Michael Niedermayer
2f07830e69 avcodec: Add max_pixels options
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-10 22:24:10 +01:00
Vittorio Giovara
e7a6f8c972 lavc: Add spherical packet side data API
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-12-07 14:40:06 -05:00
Sasi Inguva
18108f3618 lavc/utils.c: Make sure skip_samples never goes negative.
Signed-off-by: Sasi Inguva <isasi@google.com>
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-10 17:44:47 +01:00
Rodger Combs
ba53504e57
lavc/utils: avcodec_string: dump field order when known 2016-10-24 01:24:22 -05:00
Michael Niedermayer
966c5c7bb8 avcodec/utils: Move emms_c() before memory allocation functions in avcodec_encode_video2()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-22 13:46:10 +02:00
Michael Niedermayer
4f96f9d111 avcodec/utils: Clear MMX state before returning from avcodec_default_execute*()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-10-21 14:17:50 +02:00
James Almer
4b0f37dadb avcodec/utils: print Chroma Location string in verbose log level
It's container level information on some formats (Matroska, MXF, yuv4mpeg), so
it should be printed at higher log levels than debug.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-16 12:18:39 -03:00
Hendrik Leppkes
3f9137c57d Merge commit '32c8359093d1ff4f45ed19518b449b3ac3769d27'
* commit '32c8359093d1ff4f45ed19518b449b3ac3769d27':
  lavc: export the timestamps when decoding in AVFrame.pts

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-10-07 13:03:36 +02:00
wm4
40fbf32042 lavc: set best effort timestamp if unset when using new decode API
Some API users (in particular ffmpeg.c) check the best effort timestamp
only.
2016-10-05 11:35:54 +02:00
Marton Balint
2face3e7b5 lavc/utils: disallow zero sized packets with data set in avcodec_send_packet
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-10-03 21:15:26 +02:00
wm4
b2fea2fdee ffmpeg: move subframe warning to libavcodec
With the new decode API, doing this in ffmpeg.c is impractical. There
was resistance against removing the warning, so put it into libavcodec.

Not bothering with reducing the warning to verbose log level for
subsequent wanrings. The warning should be rare, and only happen when
developing new codecs for the old API.

Includes a change suggested by Michael Niedermayer.
2016-10-01 17:22:02 +02:00
Sasi Inguva
7e0235bdb1 lavc/utils.c: Subtract skip_samples when frame is DISCARDed.
Signed-off-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-29 02:25:41 +02:00
James Almer
32c25f06b7 Merge commit 'e85f6f7f8d037c0af0f294000718d9ba22753baa'
* commit 'e85f6f7f8d037c0af0f294000718d9ba22753baa':
  lavc: allow using AVCodecContext.hw_frames_ctx for decoding

Conflicts:
    doc/APIchanges
    libavcodec/version.h

Merged-by: James Almer <jamrial@gmail.com>
2016-09-28 13:22:00 -03:00
Sasi Inguva
a53201879c avcodec/utils: If using discard frame flag, ignore skip_samples set by the decoder
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-19 19:51:13 +02:00
Sasi Inguva
2dbedc20ce lavc: Add a flag in AVPacket to discard packet after decoding. Discard frames after decoding based on the flag.
Signed-off-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-19 19:51:13 +02:00
James Almer
d2e74315e5 avcodec/utils: print only the padding values that are set
Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-09-03 11:57:23 -03:00
James Almer
4fed4aca0c avcodec/utils: print initial and trailing paddings only in verbose levels
Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-09-03 11:57:18 -03:00
Paul B Mahol
fc600eff63 avcodec: add 64-bit signed pcm codec 2016-08-18 15:30:05 +02:00
Jon Toohill
c3c4c72665 lavc: add trailing_padding to AVCodecContext to match AVCodecParameters.
Shows encoder delay/padding in the stream summary if they are set.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-16 12:30:37 +02:00
Aman Gupta
b5f30fe8fe avcodec/utils: only warn when passed invalid lowres value
This makes it easier to use the lowres option when dealing with input
files in different codecs. If the codec doesn't support lowres=1 for
instance, it will throw a warning and use lowres=0 instead of erroring
out completely.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-12 16:34:20 +02:00
Clément Bœsch
d4b1b3b06c Merge commit 'e62ff72fc1052273deb708ba715f73e5187281d4'
* commit 'e62ff72fc1052273deb708ba715f73e5187281d4':
  lavc: make avcodec_open2() fail when the timebase is not set for encoding

Merged-by: Clément Bœsch <u@pkh.me>
2016-06-22 19:29:56 +02:00
Anton Khirnov
32c8359093 lavc: export the timestamps when decoding in AVFrame.pts
Currently it's exported as AVFrame.pkt_pts, which is also the only use
for that field. The reason it is done like this is that lavc used to
export various codec-specific "timing" information in AVFrame.pts, which
is not done anymore.

Since it is confusing to the callers to have a separate field which is
used only for decoder timestamps and nothing else, deprecate pkt_pts and
use just AVFrame.pts everywhere.
2016-06-21 19:54:42 +02:00
Anton Khirnov
e85f6f7f8d lavc: allow using AVCodecContext.hw_frames_ctx for decoding
For now it will only be used by the default get_buffer2 callback for
allocating hw frames.
2016-06-21 19:52:17 +02:00
Andrey Turkin
63adb3602d libavcodec: factor out SEI generation for A53 captions
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-19 02:11:20 +02:00
Michael Niedermayer
153ab83bd3 avcodec/utils: check skip_samples signedness
Fixes Ticket5528

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-07 04:31:39 +02:00
Michael Niedermayer
d953b2857b avcodec/utils: initialize delay in avcodec_parameters_to_context()
Fixes lost codec delayy
Should fix Ticket5509

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-04 20:46:16 +02:00
Paul B Mahol
8c17eea46f avcodec: add adpcm MTAF decoder
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-05-21 18:49:45 +02:00
Michael Niedermayer
b24fffeb94 avcodec/utils: Move avctx->codec check before its use
Fixes CID1361954

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-05-20 04:32:57 +02:00
Anton Khirnov
e62ff72fc1 lavc: make avcodec_open2() fail when the timebase is not set for encoding
Many encoders use it. There is also a divide by the timebase lower in
this function, which would crash when it is not set.
2016-05-16 10:30:57 +02:00
Peter Ross
86e493a6ff avcodec: add Direct Stream Transfer (DST) decoder
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-05-15 01:01:45 +02:00
Derek Buitenhuis
96d616052b Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13'
* commit 'd12b5b2f135aade4099f4b26b0fe678656158c13':
  build: Split test programs off into separate files

Some conversions done by: James Almer <jamrial@gmail.com>
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-11 19:13:03 +01:00
Clément Bœsch
bbf02f7d28 lavc: override decode return value only in case of error
Fixes Ticket #5350

Regression since 2941282124.
2016-05-01 14:53:53 +02:00
wm4
66dd21d50b avcodec/utils: split side-data in new decode API too
The deprecated avcodec_decode_video2() and avcodec_decode_audio4()
functions called av_packet_split_side_data() on the input packets. This
is required for packets produced by libavformat with the
AVFMT_FLAG_KEEP_SIDE_DATA flag unset (which is unfortunately the
default).

The new API didn't do this yet, although it didn't matter as no decoder
supports the new API yet. The emulation layer for the old API calls the
old API functions, which took care of the splitting. Add this code to
the new API codec entrypoints too, because we shouldn't send essentially
corrupted data to decoders.
2016-04-29 10:35:00 +02:00
Michael Niedermayer
38433345e5 avcodec/utils: Assert that the number of consumed bytes in avcodec_decode_audio4() is <= the input size
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-23 17:23:59 +02:00
wm4
27adf9f9cd avcodec/utils: fix minor memory leaks on avcodec_open2() failure 2016-04-22 19:29:48 +02:00
wm4
7fc329e2dd lavc: introduce a new decoding/encoding API with decoupled input/output
Until now, the decoding API was restricted to outputting 0 or 1 frames
per input packet. It also enforces a somewhat rigid dataflow in general.

This new API seeks to relax these restrictions by decoupling input and
output. Instead of doing a single call on each decode step, which may
consume the packet and may produce output, the new API requires the user
to send input first, and then ask for output.

For now, there are no codecs supporting this API. The API can work with
codecs using the old API, and most code added here is to make them
interoperate. The reverse is not possible, although for audio it might.

From Libav commit 05f66706d1.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-04-21 14:23:36 +02:00
Michael Niedermayer
0de99ab06f avcodec: Add avpriv_codec_get_cap_skip_frame_fill_param()
With this the use of the caps_internal from libavformat can be avoided

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-21 13:49:32 +02:00
Michael Niedermayer
bcf936eaea avcodec/utils: Add braces to framecount computation
Suggestes-by: ubitux
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-15 15:48:02 +02:00
Michael Niedermayer
a7fa1e38ca avcodec/utils: Fix duration of ATRAC3 packets
Fixes ticket1680

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-15 15:03:27 +02:00
Michael Niedermayer
21acc4db5f avcodec: Add bits_per_raw_sample to AVCodecParameters
The bits_per_raw_sample represents the number of bits of precision per sample.

The field is added at the logical place, not at the end as the code was just
recently added

This fixes the regression about losing the audio sample precision information

The change in the fate test checksum un-does the change from the merge

Previous version reviewed by: wm4 <nfxjfg@googlemail.com>
Previous version reviewed by: Dominik 'Rathann' Mierzejewski <dominik@greysector.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-15 00:33:55 +02:00
Paul B Mahol
8a4c3f5258 avcodec: add adpcm dat4 decoder
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-04-05 10:48:59 +02:00
Hendrik Leppkes
994412fb9b avcodec: properly initialize AVCodecParameters profile/level
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-02 22:48:03 +01:00
Clément Bœsch
ffd1c3eeb7 lavc/utils: use pkt_timebase for legacy subtitles timing code
This is consistent with other AVSubtitle timing adjustments.
2016-04-02 19:03:06 +02:00
wm4
a5f5b8b96a lavc: factor apply_param_change() AV_EF_EXPLODE handling
Remove the duplicated code for handling failure of apply_param_change().
2016-04-01 12:52:56 +02:00
Clément Bœsch
be8d98c1ad lavc/utils: transfer width/height for subs in codecpar
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-03-31 21:20:39 +01:00
Derek Buitenhuis
dd77dad4e6 codecpar: Add video delay field
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-03-31 21:20:39 +01:00
Hendrik Leppkes
5b4f8af2f1 Add frame_size to AVCodecParameters
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-03-31 21:20:39 +01:00