Commit Graph

20352 Commits

Author SHA1 Message Date
Luca Barbato a9a6010637 avpacket: Provide an alloc and a free function for the struct
Pave the way for having the size of the AVPacket struct not part
of the ABI.
2015-10-26 18:00:55 +01:00
Luca Barbato 9b56d5c114 avpacket: Deprecate av_dup_packet
As documented, `av_dup_packet` is broken by design, `av_packet_ref`
matches the AVFrame ref-counted API and can be safely used instead.
2015-10-26 18:00:55 +01:00
Luca Barbato ce70f28a17 avpacket: Replace av_free_packet with av_packet_unref
`av_packet_unref` matches the AVFrame ref-counted API and can be used as
a drop in replacement.

Deprecate `av_free_packet`.
2015-10-26 18:00:55 +01:00
Hendrik Leppkes 9cbae3a7d5 roqvideodec: use av_frame_copy
CC: libav-stable@libav.org
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-26 12:55:40 +01:00
Tom Butterworth 9f5d6f460c hap: Set avctx.bits_per_coded_sample
Fixes an issue where alpha is ignored in some players.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-25 22:48:04 +01:00
Vittorio Giovara 3c5cf2a31b screenpresso: Drop parameter change check
Size can never change, allowing us to use ff_reget_buffer, and to
simplify the code a little.
2015-10-25 22:44:21 +01:00
Alexis Ballier 447b5b278c mpegvideo_enc: Fix encoding videos with less frames than the delay of the encoder
When the encoder is fed with less frames than its delay, the picture list
looks like { NULL, NULL, ..., frame, frame, frame }. When flushing the
encoder (input frame == NULL), we need to ensure the picture list is
shifted enough so that we do not return an empty packet, which would
mean the encoder has finished, while it has not encoded any frame.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-25 22:43:30 +01:00
Michael Niedermayer 27eeee76b2 mpegvideo_enc: Merge ifs with identical conditions
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-25 22:24:13 +01:00
Michael Niedermayer f0a88d4d2a mpegvideo_enc: Factor new_picture unref out
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-25 22:23:51 +01:00
Vittorio Giovara 533a619850 innoHeim/Rsupport Screen Capture Codec decoder
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-23 14:56:43 +02:00
Arttu Ylä-Outinen 233d2fa044 kvazaar: Add libkvazaar HEVC encoder
Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-23 11:59:27 +02:00
Luca Barbato 1ec72c6c68 libx264: Make sure the extradata are padded 2015-10-23 11:13:35 +02:00
Vittorio Giovara dca23ffbc7 lavc: Deprecate AVPicture structure and related functions
This structure served as a bridge between data pointers and frames,
but it suffers from several limitations:
- it is not refcounted and data must be copied to every time
- it cannot be expanded without ABI break due to being used on the stack
- its functions are just wrappers to imgutils which add a layer of
  unneeded indirection, and maintenance burden
- it allows hacks like embedding uncompressed data in packets
- its use is often confusing to our users

AVFrame provides a much better API, and, if a full blown frame is not
needed, it is just as simple and more straightfoward to use data and
linesize arrays directly.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-22 13:32:15 +02:00
Vittorio Giovara 3ee2c60cc2 utils: Use data buffers directly instead of an AVPicture
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-22 13:31:58 +02:00
Vittorio Giovara a17a766190 lavc: Add data and linesize to AVSubtitleRect
Use the new fields directly instead of the ones from AVPicture.
This removes a layer of indirection which serves no pratical purpose
whatsoever, and will help in removing AVPicture structure completely
later.

Every subtitle encoder/decoder seamlessly points to the new arrays,
so it is possible to deprecate AVSubtitleRect.pict.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-21 12:02:29 +02:00
Vittorio Giovara f890677d05 Replace any remaining avpicture function with imgutils
avpicture_get_size() -> av_image_get_buffer_size()

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-21 11:59:59 +02:00
Vittorio Giovara 13bddab7de nuv: Replace avpicture functions with imgutils
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-21 11:59:54 +02:00
Vittorio Giovara 48c0638683 dpx: Replace avpicture functions with imgutils
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-21 11:59:46 +02:00
Vittorio Giovara f0a106578d roqvideodec: Replace avpicture functions with imgutils
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-21 11:59:38 +02:00
Luca Barbato ef3a3519c1 rawdec: Replace avpicture functions with imgutils
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-21 11:59:33 +02:00
Luca Barbato fcc1280acb rawenc: Replace avpicture functions with imgutils
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-21 11:59:07 +02:00
Vittorio Giovara 3496cec433 msrle: Use AVFrame instead of AVPicture
Callers always use a frame and cast it to AVPicture, change
ff_msrle_decode() to accept an AVFrame directly instead.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-21 11:51:07 +02:00
Anton Khirnov dc923bc23b qsvenc: add an API for allocating opaque surfaces 2015-10-16 20:00:40 +02:00
Anton Khirnov 2ec96b6bd5 qsvenc: cosmetics, reindent 2015-10-16 20:00:17 +02:00
Anton Khirnov f6f32fc93d qsvenc: set the timestamp for PIX_FMT_QSV frames as well 2015-10-16 20:00:12 +02:00
Anton Khirnov 772c87c5a6 qsvenc: support passing arbitrary external buffers to the encoder 2015-10-16 20:00:02 +02:00
Luca Barbato b52307933b wrapped_avframe: Drop a now-unused variable 2015-10-16 17:45:09 +02:00
Luca Barbato 49d7fcd774 mpeg12: Unbreak building stale code
Broken in 2d59159508
2015-10-16 17:45:09 +02:00
Derek Buitenhuis 504e3f75bf aac: Make codec init run under ff_thread_once
This makes AAC init threadsafe.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2015-10-15 14:00:24 -04:00
Vittorio Giovara 2d59159508 lavc: AV-prefix a few left out capabilities 2015-10-15 15:47:16 +02:00
Derek Buitenhuis d15368ee39 h264: Run VLC init under pthread_once
This makes the h.264 decoder threadsafe to initialize.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-14 14:35:34 +02:00
Luca Barbato 08377f9c3b dxva: Include last the internal header
It redefines _WIN32_WINNT, possibly causing problems with the
w32pthreads.h header.
2015-10-14 14:35:34 +02:00
wm4 6a23a34274 mimic: drop AVPicture usage
Work on the AVFrame references directly.

Instead of setting up a flipped/swapped "view" on the pictures,
flip/swap them when returning decoded frames to the API user.
2015-10-14 11:25:53 +02:00
Vittorio Giovara 6fdd4c678a libschroedinger: Properly use AVFrame API
Rather than copying data buffers around, allocate a proper frame, and
use the standard AVFrame functions. This effectively makes the decoder
capable of direct rendering.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-14 11:24:55 +02:00
Vittorio Giovara 901f9c0a32 qtrle: Properly use AVFrame API
Rather than copying data buffers around, just add a reference to
the current frame.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-14 11:24:24 +02:00
Derek Buitenhuis 17e41cf361 avcodec: Do not lock during init if there is no init function
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-13 13:43:29 +02:00
Luca Barbato 00332e0a06 wrapped_avframe: Initial implementation 2015-10-10 14:50:34 +02:00
Mario Gasparoni c3e5c47bda libopenh264enc: Added max_nal_size option
Also added dynamic slice_mode option, needed for the max_nal_size.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-09 16:53:44 +02:00
Anton Khirnov a8956eca1f cabac: Make CABAC states hardcoded
There is not much reason to generate such a small table at runtime.

Signed-off-by: Derek Buitenhuis <derekb@vimeo.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-08 21:55:31 +02:00
Alexandra Khirnova 58b42345b3 dcadec: reorganise context data
place primary audio coding header data into DCAAudioHeader
structure to make DCAContext clearer
and move channel related data to DCAChan structure to make
them easier to use by extensions

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-07 18:45:49 +02:00
Vittorio Giovara 3a4d369ea4 g2m: Relax resolution change constraints
Do not fail when original resolution is smaller than current one,
as the frame buffer is resized automatically.

Signed-off-by: Vittorio Giovara <vittorio.giovara at gmail.com>
2015-10-07 18:45:49 +02:00
wm4 39f01e346c mmaldec: be more tolerant against MMAL not returning decoded output
In some situations, MMAL won't return a decoded frame for certain input
frames. This can happen if a frame fails to decode, or if a packet does
not actually contain a complete frame. In these situations, we would
deadlock (or actually timeout) waiting for an expected output frame,
which is not ideal. On the other hand, there are situations where we
definitely have to block to avoid deadlocks. (This mess is a
consequence of trying to map MMAL's asynchronous and flexible
dataflow to libavcodec, which is more static and rigid.)

Solve this by doing a blocking wait only if the amount of buffered data
is too big. The whole purpose of the blocking wait is to avoid excessive
buffering of input data, so we can skip it if it appears to be low. The
consequence is that libavcodec can gracefully return no frame to the
API user.

We want to track the number of full packets to make our heuristic work.
But MMAL buffers are fixed-size, requiring splitting large packets. This
is why the previous commit is needed. We use the ..._FRAME_END flag to
remember packet boundaries, but MMAL does not preserve these buffer
flags when returning buffers to the user.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-04 19:34:04 +02:00
wm4 65db4899fa mmaldec: refactor to have more context per MMAL input buffer
The next commit needs 1 bit of additional information per MMAL buffer
sent to the MMAL input port. This information will be needed when the
buffer is recycled (i.e. returned by the input port's callback).
Normally, we could use MMAL_BUFFER_HEADER_FLAG_USER0, but that is
unexpectedly not preserved.

Do this by storing a pointer to FFBufferEntry in the MMAL buffer's
user data, instead of an AVBufferRef. This also changes the lifetime
of FFBufferEntry.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-04 19:34:04 +02:00
Derek Buitenhuis eae58428bd avcodec: Do not lock during open for codecs marked as having threadsafe init
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-04 13:21:16 +02:00
Vittorio Giovara abe9adfb31 rangecoder: Use AV_RB16 instead of bytestream_get_be16
Silence an incompatible-pointer-types-discards-qualifiers warning from clang.
rangecoder.c:58:34: warning: passing
      'uint8_t **' (aka 'unsigned char **') to parameter of type
      'const uint8_t **' (aka 'const unsigned char **') discards qualifiers in
      nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
2015-10-04 13:09:08 +02:00
Vittorio Giovara b8b13acd70 hevc: Simplify logical check
The intended meaning is "if this block is the first block in a slice then
its left boundary is a slice boundary". Silence a logical-not-parentheses
warning from gcc.
2015-10-04 13:08:58 +02:00
Vittorio Giovara 10aa6f9db4 h264: Use the correct argument context in debug log 2015-10-04 13:07:12 +02:00
Vittorio Giovara 4628443ca3 h263: Drop uninitialized variable use from log message 2015-10-04 13:07:12 +02:00
Vittorio Giovara 1da2a20763 dvbsubdec: Fix function return type 2015-10-04 13:07:12 +02:00
Vittorio Giovara cab63a8b59 dv: Mark internal frame reference as const
Silence a warning due to frame assignment in dvenc. All uses of the
reference in dvdec are read only, except the ones in the main decoding
function, so use the frame pointer directly there.
2015-10-04 13:06:34 +02:00