]> git.sesse.net Git - ffmpeg/log
ffmpeg
9 years agoavpicture: Deprecate the single fields
Luca Barbato [Tue, 27 Oct 2015 20:53:26 +0000 (21:53 +0100)]
avpicture: Deprecate the single fields

Silence pointless warnings from gcc.

9 years agoavconv: support infinite loop for the loop option
Alexandra Hájková [Wed, 21 Oct 2015 10:03:58 +0000 (12:03 +0200)]
avconv: support infinite loop for the loop option

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years agoavpacket: Provide an alloc and a free function for the struct
Luca Barbato [Fri, 23 Oct 2015 09:11:34 +0000 (11:11 +0200)]
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.

9 years agoavpacket: Deprecate av_dup_packet
Luca Barbato [Fri, 23 Oct 2015 09:11:33 +0000 (11:11 +0200)]
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.

9 years agoavformat: Rework add_to_pktbuf
Luca Barbato [Fri, 23 Oct 2015 09:11:32 +0000 (11:11 +0200)]
avformat: Rework add_to_pktbuf

Make it return an error and check its return value when it is used.
Simplify the usage by calling `av_packet_ref` internally when needed.

9 years agoavpacket: Replace av_free_packet with av_packet_unref
Luca Barbato [Fri, 23 Oct 2015 09:11:31 +0000 (11:11 +0200)]
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`.

9 years agoavformat: Always return ref-counted AVPacket
Luca Barbato [Fri, 23 Oct 2015 09:11:30 +0000 (11:11 +0200)]
avformat: Always return ref-counted AVPacket

And drop the av_dup_packet from the input_thread.

9 years agoavprobe: Unref the packet once it is used
Luca Barbato [Fri, 23 Oct 2015 09:11:29 +0000 (11:11 +0200)]
avprobe: Unref the packet once it is used

Make sure it does not leak packets.

CC: libav-stable@libav.org
9 years agoroqvideodec: use av_frame_copy
Hendrik Leppkes [Fri, 23 Oct 2015 13:24:11 +0000 (15:24 +0200)]
roqvideodec: use av_frame_copy

CC: libav-stable@libav.org
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agohap: Set avctx.bits_per_coded_sample
Tom Butterworth [Fri, 23 Oct 2015 12:40:16 +0000 (14:40 +0200)]
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>
9 years agocmdutils: Check for and report the correct codec capability
Vittorio Giovara [Mon, 19 Oct 2015 11:57:22 +0000 (13:57 +0200)]
cmdutils: Check for and report the correct codec capability

9 years agoscreenpresso: Drop parameter change check
Vittorio Giovara [Mon, 19 Oct 2015 12:34:09 +0000 (14:34 +0200)]
screenpresso: Drop parameter change check

Size can never change, allowing us to use ff_reget_buffer, and to
simplify the code a little.

9 years agompegvideo_enc: Fix encoding videos with less frames than the delay of the encoder
Alexis Ballier [Fri, 23 Oct 2015 13:23:43 +0000 (15:23 +0200)]
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>
9 years agompegvideo_enc: Merge ifs with identical conditions
Michael Niedermayer [Fri, 23 Oct 2015 13:23:42 +0000 (15:23 +0200)]
mpegvideo_enc: Merge ifs with identical conditions

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years agompegvideo_enc: Factor new_picture unref out
Michael Niedermayer [Fri, 23 Oct 2015 13:23:41 +0000 (15:23 +0200)]
mpegvideo_enc: Factor new_picture unref out

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years agoinnoHeim/Rsupport Screen Capture Codec decoder
Vittorio Giovara [Mon, 19 Oct 2015 12:23:43 +0000 (14:23 +0200)]
innoHeim/Rsupport Screen Capture Codec decoder

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agokvazaar: Add libkvazaar HEVC encoder
Arttu Ylä-Outinen [Tue, 25 Aug 2015 08:33:19 +0000 (11:33 +0300)]
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>
9 years agompjpeg: Cope with multipart lacking the initial CRLF
Luca Barbato [Thu, 22 Oct 2015 03:07:05 +0000 (05:07 +0200)]
mpjpeg: Cope with multipart lacking the initial CRLF

Some server in the wild do not put the boundary at a newline
as rfc1347 7.2.1 states.
Cope with that by reading a line and if it is not empty reading
a second one.

Reported-By: bitingsock
9 years agoimg2enc: Make sure the images are atomically written
Luca Barbato [Tue, 20 Oct 2015 17:49:13 +0000 (19:49 +0200)]
img2enc: Make sure the images are atomically written

Users that want to generate a live-preview and serve it
would otherwise get partial images.

9 years agolibx264: Make sure the extradata are padded
Luca Barbato [Tue, 20 Oct 2015 19:12:30 +0000 (21:12 +0200)]
libx264: Make sure the extradata are padded

9 years agomovenc: Honor flush requests with delay_moov, when some tracks lack samples
Martin Storsjö [Tue, 20 Oct 2015 19:30:03 +0000 (22:30 +0300)]
movenc: Honor flush requests with delay_moov, when some tracks lack samples

This also makes sure that a fragmented file without the empty_moov
flag (i.e. with a non-empty initial moov fragment) actually gets
written, if some of the tracks turn out to not have any samples.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agortsp: Allow $ as interleaved packet indicator before a complete response header
Martin Storsjö [Wed, 21 Oct 2015 08:56:36 +0000 (11:56 +0300)]
rtsp: Allow $ as interleaved packet indicator before a complete response header

Some RTSP servers ("HiIpcam/V100R003 VodServer/1.0.0") respond to
our keepalive GET_PARAMETER request by a truncated RTSP header
(lacking the final empty line to indicate a complete response
header). Prior to 764ec70149, this worked just fine since we
reacted to the $ as interleaved packet indicator anywhere.

Since $ is a valid character within the response header lines,
764ec70149 changed it to be ignored there. But to keep
compatibility with such broken servers, we need to at least
allow reacting to it at the start of lines.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agolavc: Deprecate AVPicture structure and related functions
Vittorio Giovara [Wed, 14 Oct 2015 09:33:28 +0000 (11:33 +0200)]
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>
9 years agoutils: Use data buffers directly instead of an AVPicture
Vittorio Giovara [Wed, 14 Oct 2015 09:33:27 +0000 (11:33 +0200)]
utils: Use data buffers directly instead of an AVPicture

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agoavplay: Replace avpicture functions with imgutils
Vittorio Giovara [Wed, 14 Oct 2015 09:33:26 +0000 (11:33 +0200)]
avplay: Replace avpicture functions with imgutils

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agolavc: Add data and linesize to AVSubtitleRect
Vittorio Giovara [Wed, 14 Oct 2015 09:33:25 +0000 (11:33 +0200)]
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>
9 years agoReplace any remaining avpicture function with imgutils
Vittorio Giovara [Wed, 14 Oct 2015 09:33:24 +0000 (11:33 +0200)]
Replace any remaining avpicture function with imgutils

avpicture_get_size() -> av_image_get_buffer_size()

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agonuv: Replace avpicture functions with imgutils
Vittorio Giovara [Wed, 14 Oct 2015 09:33:23 +0000 (11:33 +0200)]
nuv: Replace avpicture functions with imgutils

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agodpx: Replace avpicture functions with imgutils
Vittorio Giovara [Wed, 14 Oct 2015 09:33:22 +0000 (11:33 +0200)]
dpx: Replace avpicture functions with imgutils

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agoroqvideodec: Replace avpicture functions with imgutils
Vittorio Giovara [Wed, 14 Oct 2015 09:33:21 +0000 (11:33 +0200)]
roqvideodec: Replace avpicture functions with imgutils

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agorawdec: Replace avpicture functions with imgutils
Luca Barbato [Wed, 14 Oct 2015 09:33:20 +0000 (11:33 +0200)]
rawdec: Replace avpicture functions with imgutils

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agorawenc: Replace avpicture functions with imgutils
Luca Barbato [Wed, 14 Oct 2015 09:33:19 +0000 (11:33 +0200)]
rawenc: Replace avpicture functions with imgutils

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agomsrle: Use AVFrame instead of AVPicture
Vittorio Giovara [Wed, 14 Oct 2015 09:33:18 +0000 (11:33 +0200)]
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>
9 years agoAPIchanges: Fill in missing dates and hashes
Vittorio Giovara [Wed, 14 Oct 2015 13:17:41 +0000 (15:17 +0200)]
APIchanges: Fill in missing dates and hashes

9 years agoavconv: add support for Intel QSV-accelerated transcoding
Anton Khirnov [Tue, 13 Oct 2015 12:11:35 +0000 (14:11 +0200)]
avconv: add support for Intel QSV-accelerated transcoding

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years agoqsvenc: add an API for allocating opaque surfaces
Anton Khirnov [Sun, 11 Oct 2015 20:02:26 +0000 (22:02 +0200)]
qsvenc: add an API for allocating opaque surfaces

9 years agoqsvenc: cosmetics, reindent
Anton Khirnov [Thu, 1 Oct 2015 17:42:33 +0000 (19:42 +0200)]
qsvenc: cosmetics, reindent

9 years agoqsvenc: set the timestamp for PIX_FMT_QSV frames as well
Anton Khirnov [Thu, 1 Oct 2015 17:41:56 +0000 (19:41 +0200)]
qsvenc: set the timestamp for PIX_FMT_QSV frames as well

9 years agoqsvenc: support passing arbitrary external buffers to the encoder
Anton Khirnov [Wed, 5 Aug 2015 13:22:34 +0000 (15:22 +0200)]
qsvenc: support passing arbitrary external buffers to the encoder

9 years agow32pthreads: fix mingw build on x86 with -msse2 or higher
Hendrik Leppkes [Wed, 14 Oct 2015 21:18:17 +0000 (23:18 +0200)]
w32pthreads: fix mingw build on x86 with -msse2 or higher

When SSE2 or higher compiler optimizations are used, mingw uses
the _mm_mfence intrinsic for MemoryBarrier, however it doesn't include
the appropriate headers automatically.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years agowrapped_avframe: Drop a now-unused variable
Luca Barbato [Fri, 16 Oct 2015 12:45:45 +0000 (14:45 +0200)]
wrapped_avframe: Drop a now-unused variable

9 years agompeg12: Unbreak building stale code
Luca Barbato [Fri, 16 Oct 2015 06:45:04 +0000 (08:45 +0200)]
mpeg12: Unbreak building stale code

Broken in 2d59159508c5c1830cc5da907a9454e229077320

9 years agoaac: Make codec init run under ff_thread_once
Derek Buitenhuis [Wed, 14 Oct 2015 18:24:35 +0000 (14:24 -0400)]
aac: Make codec init run under ff_thread_once

This makes AAC init threadsafe.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
9 years agofate: Move screenpresso to the appropriate screen capture file
Vittorio Giovara [Wed, 14 Oct 2015 13:13:11 +0000 (15:13 +0200)]
fate: Move screenpresso to the appropriate screen capture file

9 years agolavc: AV-prefix a few left out capabilities
Vittorio Giovara [Wed, 14 Oct 2015 13:08:49 +0000 (15:08 +0200)]
lavc: AV-prefix a few left out capabilities

9 years agocmdutils: Print general codec capabilities
Vittorio Giovara [Wed, 14 Oct 2015 13:07:10 +0000 (15:07 +0200)]
cmdutils: Print general codec capabilities

9 years agocmdutils: Add auto to threading capabilities report
Vittorio Giovara [Wed, 14 Oct 2015 13:07:09 +0000 (15:07 +0200)]
cmdutils: Add auto to threading capabilities report

And use 'none' when such capabilities are not set.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agoh264: Run VLC init under pthread_once
Derek Buitenhuis [Wed, 7 Oct 2015 16:33:01 +0000 (12:33 -0400)]
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>
9 years agothread: Provide no-op variants for pthread_once
Luca Barbato [Wed, 7 Oct 2015 20:43:38 +0000 (22:43 +0200)]
thread: Provide no-op variants for pthread_once

9 years agodxva: Include last the internal header
Luca Barbato [Tue, 13 Oct 2015 21:20:33 +0000 (23:20 +0200)]
dxva: Include last the internal header

It redefines _WIN32_WINNT, possibly causing problems with the
w32pthreads.h header.

9 years agohttpauth: Add space after commas in HTTP/RTSP auth header
Andrey Utkin [Tue, 13 Oct 2015 09:44:37 +0000 (12:44 +0300)]
httpauth: Add space after commas in HTTP/RTSP auth header

This fixes access to Grandstream cameras, which return 401 otherwise.
VLC sends Authorization: header with spaces between parameters, and it
is known to work with Grandstream devices and broad range of other HTTP
and RTSP servers, so author considers switching to such behaviour safe.

See RFC 2617 (HTTP Auth).

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years agortmpproto: Write correct flv packet sizes at the end of packets
Michael Niedermayer [Tue, 13 Oct 2015 09:17:24 +0000 (12:17 +0300)]
rtmpproto: Write correct flv packet sizes at the end of packets

In one case it was written as zero, one case left it uninitialized,
missed the 11 bytes for the flv header.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years agomimic: drop AVPicture usage
wm4 [Tue, 13 Oct 2015 12:48:55 +0000 (14:48 +0200)]
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.

9 years agolibschroedinger: Properly use AVFrame API
Vittorio Giovara [Mon, 12 Oct 2015 16:54:52 +0000 (18:54 +0200)]
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>
9 years agoqtrle: Properly use AVFrame API
Vittorio Giovara [Mon, 12 Oct 2015 17:00:31 +0000 (19:00 +0200)]
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>
9 years agoavcodec: Do not lock during init if there is no init function
Derek Buitenhuis [Mon, 12 Oct 2015 14:32:28 +0000 (10:32 -0400)]
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>
9 years agoavformat: Do not use AVFMT_RAWPICTURE
Luca Barbato [Mon, 12 Oct 2015 14:06:07 +0000 (16:06 +0200)]
avformat: Do not use AVFMT_RAWPICTURE

There are no formats supporting it anymore and it is deprecated.
Update the documentation accordingly.

9 years agoavconv: Add loop option.
Alexandra Hájková [Fri, 9 Oct 2015 20:11:56 +0000 (22:11 +0200)]
avconv: Add loop option.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agodict: Change return type of av_dict_copy()
Vittorio Giovara [Sun, 4 Oct 2015 11:27:15 +0000 (13:27 +0200)]
dict: Change return type of av_dict_copy()

av_dict_set() could return an error, so forward it appropriately.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agobuild: add Solaris symbol versioning
Sean McGovern [Wed, 7 Oct 2015 21:39:37 +0000 (17:39 -0400)]
build: add Solaris symbol versioning

The versioning facility in the Solaris linker differs from Linux in 3 ways:

1. It does not support globs in linker scripts for
symbol versioning -- this is a GNU extension.

2. The linker argument is '-M', instead of '--version-script'.

3. It is picky about line endings.
Each symbol or directive must be on a line of it's own.

Let's use make_sunver.pl from GCC to generate a version script that works
correctly with the Solaris linker. It's function is to correctly expand the
globs in the original generated version script.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years agonullenc: Use the wrapped avframe pseudo-encoder
Luca Barbato [Fri, 9 Oct 2015 14:24:05 +0000 (16:24 +0200)]
nullenc: Use the wrapped avframe pseudo-encoder

9 years agoyuv4mpeg: Use the wrapped avframe pseudo-encoder
Luca Barbato [Fri, 9 Oct 2015 14:22:42 +0000 (16:22 +0200)]
yuv4mpeg: Use the wrapped avframe pseudo-encoder

9 years agowrapped_avframe: Initial implementation
Luca Barbato [Fri, 9 Oct 2015 12:12:04 +0000 (14:12 +0200)]
wrapped_avframe: Initial implementation

9 years agolibopenh264enc: Added max_nal_size option
Mario Gasparoni [Thu, 8 Oct 2015 17:28:55 +0000 (14:28 -0300)]
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>
9 years agoasfdec: do not skip padding if offset is above packet size - padding
Alexandra Hájková [Tue, 28 Jul 2015 08:17:16 +0000 (10:17 +0200)]
asfdec: do not skip padding if offset is above packet size - padding

Sample-Id: https://samples.libav.org/asf-wmv/demux-asf-assert-failed.wmv

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years agocabac: Make CABAC states hardcoded
Anton Khirnov [Wed, 7 Oct 2015 16:33:00 +0000 (12:33 -0400)]
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>
9 years agow32pthreads: Load dynamically loaded functions on demand
Hendrik Leppkes [Wed, 7 Oct 2015 13:15:14 +0000 (15:15 +0200)]
w32pthreads: Load dynamically loaded functions on demand

This removes the requirement of calling w32thread_init before being
able to use the threading primitives.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years agow32pthreads: Add pthread_once emulation
Hendrik Leppkes [Wed, 7 Oct 2015 13:10:59 +0000 (15:10 +0200)]
w32pthreads: Add pthread_once emulation

The emulation uses native InitOnce* APIs on Windows Vista+, and a
lock-free/allocation-free approach using atomics and spinning for
Windows XP.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years agoavconv: Do not try to configure filter outputs without streams
Luca Barbato [Mon, 5 Oct 2015 18:49:55 +0000 (20:49 +0200)]
avconv: Do not try to configure filter outputs without streams

Prevent a NULL-dereference.

CC: libav-stable@libav.org
9 years agoconfigure: When disabling a library disable all the related components
Luca Barbato [Mon, 5 Oct 2015 01:41:41 +0000 (03:41 +0200)]
configure: When disabling a library disable all the related components

This way is sufficient to use the component specific configure variable
and not guard against the global library configure variable in code
that is outside it (e.g. checkasm).

9 years agodcadec: reorganise context data
Alexandra Khirnova [Fri, 2 Oct 2015 15:53:26 +0000 (17:53 +0200)]
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>
9 years agog2m: Relax resolution change constraints
Vittorio Giovara [Wed, 7 Oct 2015 13:16:44 +0000 (15:16 +0200)]
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>
9 years agommaldec: be more tolerant against MMAL not returning decoded output
wm4 [Wed, 23 Sep 2015 18:27:25 +0000 (20:27 +0200)]
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>
9 years agommaldec: refactor to have more context per MMAL input buffer
wm4 [Wed, 23 Sep 2015 18:27:24 +0000 (20:27 +0200)]
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>
9 years agoavcodec: Do not lock during open for codecs marked as having threadsafe init
Derek Buitenhuis [Thu, 1 Oct 2015 14:36:56 +0000 (15:36 +0100)]
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>
9 years agorangecoder: Use AV_RB16 instead of bytestream_get_be16
Vittorio Giovara [Fri, 2 Oct 2015 10:43:42 +0000 (12:43 +0200)]
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]

9 years agohevc: Simplify logical check
Vittorio Giovara [Fri, 2 Oct 2015 10:43:48 +0000 (12:43 +0200)]
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.

9 years agoh264: Use the correct argument context in debug log
Vittorio Giovara [Fri, 2 Oct 2015 10:43:41 +0000 (12:43 +0200)]
h264: Use the correct argument context in debug log

9 years agoh263: Drop uninitialized variable use from log message
Vittorio Giovara [Fri, 2 Oct 2015 13:16:46 +0000 (15:16 +0200)]
h263: Drop uninitialized variable use from log message

9 years agodvbsubdec: Fix function return type
Vittorio Giovara [Fri, 2 Oct 2015 10:43:40 +0000 (12:43 +0200)]
dvbsubdec: Fix function return type

9 years agodv: Mark internal frame reference as const
Vittorio Giovara [Fri, 2 Oct 2015 10:43:39 +0000 (12:43 +0200)]
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.

9 years agodcadec: Always initialize return variable
Vittorio Giovara [Fri, 2 Oct 2015 10:43:44 +0000 (12:43 +0200)]
dcadec: Always initialize return variable

Silence an uninitialized warning from clang.

9 years agod3d11va: make av_d3d11va_alloc_context() available at all times
Anton Khirnov [Sun, 27 Sep 2015 18:54:01 +0000 (20:54 +0200)]
d3d11va: make av_d3d11va_alloc_context() available at all times

The public API should not depend on the build configuration.

9 years agod3d11va: check for malloc failure
Anton Khirnov [Sun, 27 Sep 2015 18:47:23 +0000 (20:47 +0200)]
d3d11va: check for malloc failure

9 years agoavutil/avstring: Inline some tiny functions
Henrik Gramner [Sat, 26 Sep 2015 20:27:36 +0000 (22:27 +0200)]
avutil/avstring: Inline some tiny functions

They're short enough that inlining them actually reduces code size due to
all the overhead associated with making a function call.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agomatroskaenc: Don't write a track language tag
John Stebbins [Fri, 25 Sep 2015 15:36:30 +0000 (08:36 -0700)]
matroskaenc: Don't write a track language tag

"language" is not an offical matroska tag.
Track languages are specified with the MATROSKA_ID_TRACKLANGUAGE ebml.
Writing the tag overrides the ebml specified language during playback with
libav and some other players.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agocheckasm: Fix the function name sorting algorithm
Henrik Gramner [Mon, 28 Sep 2015 14:50:31 +0000 (16:50 +0200)]
checkasm: Fix the function name sorting algorithm

The previous implementation was behaving incorrectly in some corner cases.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agodnxhddata: Deduplicate cid 1256 chroma table
Christophe Gisquet [Thu, 1 Oct 2015 14:54:57 +0000 (16:54 +0200)]
dnxhddata: Deduplicate cid 1256 chroma table

CID 1256 is specified as using the same table for luma and chroma,
which is the same as CID 1235 luma table. This is consistent with
the format supposedly being RGB, although most sequences seem to
actually be YCbCr-encoded.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agodnxhddata: Deduplicate dnx100 tables
Jeremy James [Thu, 1 Oct 2015 14:54:56 +0000 (16:54 +0200)]
dnxhddata: Deduplicate dnx100 tables

Tables 1258 and 1259 were not zigzagged when added, so it was not
possible to notice the equivalence.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agodnxhddata: Fix cid 1260 luma and chroma tables
Jeremy James [Thu, 1 Oct 2015 14:54:55 +0000 (16:54 +0200)]
dnxhddata: Fix cid 1260 luma and chroma tables

These table was not zigzagged when added.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agodnxhddata: Fix 10-bit DNxHD quant matrices
Joseph Artsimovich [Thu, 1 Oct 2015 15:06:26 +0000 (17:06 +0200)]
dnxhddata: Fix 10-bit DNxHD quant matrices

Convert them to zigzag order, as the rest of them are.

When I was adding support for 10-bit DNxHD, I just copy-pasted the
missing quant matrices from the spec. Now it turns out the existing
matrices in dnxhddata.c were in zigzag order. This resulted in wrong
quantization for 10-bit DNxHD. The attached patch fixes the problem by
converting 10-bit quant matrices to zigzag order.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agox264: Add option to force IDR frames
Derek Buitenhuis [Mon, 31 Aug 2015 13:34:54 +0000 (15:34 +0200)]
x264: Add option to force IDR frames

When forwarding the frame type information, by default x264 can
decide which kind of keyframe output, add an option to force it
to output IDR frames in to support use-cases such as preparing
the content for segmented streams formats.

9 years agox264: Expose the NV21 input support
Yu Xiaolei [Fri, 31 Jul 2015 22:42:15 +0000 (06:42 +0800)]
x264: Expose the NV21 input support

x264 build 147 adds the native support for NV21.

Useful to avoid additional pixel format conversion when encoding
from a wide range of capture devices, Android among those.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years agohls: Check av_opt_set_dict return value as well
Luca Barbato [Wed, 30 Sep 2015 23:34:35 +0000 (01:34 +0200)]
hls: Check av_opt_set_dict return value as well

Bug-Id: CID 1320426

9 years agodcadec: make a number of samples per subband per subsubframe a named constant
Alexandra Khirnova [Fri, 18 Sep 2015 11:34:20 +0000 (13:34 +0200)]
dcadec: make a number of samples per subband per subsubframe a named constant

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years agobuild: Add support for known custom allocators
Luca Barbato [Thu, 3 Sep 2015 09:55:48 +0000 (11:55 +0200)]
build: Add support for known custom allocators

Makes slightly easier to use jemalloc and tcmalloc.

The two are quite common choices for profiling and debugging.

9 years agoScreenpresso SPV1 decoder
Vittorio Giovara [Thu, 24 Sep 2015 22:36:50 +0000 (00:36 +0200)]
Screenpresso SPV1 decoder

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agolavu: Deprecate AVFrame.error[]
Vittorio Giovara [Mon, 28 Sep 2015 09:40:09 +0000 (11:40 +0200)]
lavu: Deprecate AVFrame.error[]

These field are difficult to interpret, and are provided by a single
encoder (mpegvideoenc). In general they do not belong to a structure
containing raw data only, so remove them from AVFrame.

Mpegvideoenc now uses a private field in Picture for its internal
computations.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years agoconfigure: address a copy-paste typo
Vicente Olivert Riera [Tue, 29 Sep 2015 16:28:33 +0000 (17:28 +0100)]
configure: address a copy-paste typo

The correct instruction for mips32r1 is addi.

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years agotiny_psnr: Use the correct abs() version
Vittorio Giovara [Tue, 22 Sep 2015 11:56:48 +0000 (13:56 +0200)]
tiny_psnr: Use the correct abs() version