1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-09-06 08:08:58 +02:00
Commit Graph

1456 Commits

Author SHA1 Message Date
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
James Almer
3fafde6cbe lavc: Add seek_preroll to AVCodecParameters
Signed-off-by: James Almer <jamrial@gmail.com>
2016-03-31 21:20:39 +01:00
Derek Buitenhuis
e6053b3b19 Merge commit 'a8068346e48e123f8d3bdf4d64464d81e53e5fc7'
* commit 'a8068346e48e123f8d3bdf4d64464d81e53e5fc7':
  lavc: add a variant of av_get_audio_frame_duration working with AVCodecParameters

Fixes from jamrial incorporated.

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-03-31 21:20:02 +01:00
Derek Buitenhuis
f9b1cf15c2 Merge commit '998e1b8f521b73e1ed3a13caaabcf79eb401cf0d'
* commit '998e1b8f521b73e1ed3a13caaabcf79eb401cf0d':
  lavc: add codec parameters API

  Fixes added in:
    - bit_rate has been made int64_t to match.
    - profile and level are properly initialize.

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-03-31 21:19:03 +01:00
Marton Balint
99f2a59c2f avcodec/utils: fix packet duration of frames with discarded paddings
Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-03-28 23:40:12 +02:00
wm4
05f66706d1 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.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-03-23 19:31:23 +01:00
Clément Bœsch
2b7a61cbd8 lavc/utils: fix extra ASS sanity check in convert_sub_to_old_ass_form() 2016-03-07 21:48:55 +01:00