ffmpeg.git
4 years agoAdd DXVA2 HEVC HWAccel
Hendrik Leppkes [Sun, 25 Jan 2015 11:58:50 +0000 (12:58 +0100)]
Add DXVA2 HEVC HWAccel

Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agohevc: reindent after previous commit
Hendrik Leppkes [Sun, 25 Jan 2015 11:58:49 +0000 (12:58 +0100)]
hevc: reindent after previous commit

Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agohevc: add hwaccel hooks
Hendrik Leppkes [Sun, 25 Jan 2015 11:58:48 +0000 (12:58 +0100)]
hevc: add hwaccel hooks

Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agohevc: store the short term rps flag and size in the context
Hendrik Leppkes [Sun, 25 Jan 2015 11:58:47 +0000 (12:58 +0100)]
hevc: store the short term rps flag and size in the context

For future use by hardware accelerators.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agohevc: store the escaped/raw bitstream in HEVCNAL
Hendrik Leppkes [Sun, 25 Jan 2015 11:58:46 +0000 (12:58 +0100)]
hevc: store the escaped/raw bitstream in HEVCNAL

Hardware Accelerators require access to the escaped bitstream.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agohevc: pass the full HEVCNAL struct to decode_nal_unit
Hendrik Leppkes [Sun, 25 Jan 2015 11:58:45 +0000 (12:58 +0100)]
hevc: pass the full HEVCNAL struct to decode_nal_unit

This enables decode_nal_unit to access additional fields added in
subsequent commits.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agoexamples/transcode_aac: generate proper PTS and set the muxer timebase
Andreas Unterweger [Tue, 27 Jan 2015 08:03:08 +0000 (09:03 +0100)]
examples/transcode_aac: generate proper PTS and set the muxer timebase

Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agoexamples/transcode_aac: fix a typo
Andreas Unterweger [Tue, 27 Jan 2015 08:00:23 +0000 (09:00 +0100)]
examples/transcode_aac: fix a typo

Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agoexamples/transcode_aac: properly select the output sample format
Andreas Unterweger [Tue, 27 Jan 2015 07:58:47 +0000 (08:58 +0100)]
examples/transcode_aac: properly select the output sample format

Makes the example work with all the supported AAC encoders.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agohevc: unref the current frame if frame_start() fails
Anton Khirnov [Thu, 20 Nov 2014 08:41:56 +0000 (09:41 +0100)]
hevc: unref the current frame if frame_start() fails

Prevents DPB from filling up with damaged input.

4 years agohevc: clear unused refs on failure
Anton Khirnov [Thu, 20 Nov 2014 08:26:35 +0000 (09:26 +0100)]
hevc: clear unused refs on failure

4 years agoh264: simplify code in flush_dpb()
Anton Khirnov [Thu, 20 Nov 2014 06:40:34 +0000 (07:40 +0100)]
h264: simplify code in flush_dpb()

There is no point in clearing reference explicitly, since that will be
done as a part of ff_h264_unref_picture() right below.

4 years agosegment: Check av_get_frame_filename() return value
Vittorio Giovara [Thu, 22 Jan 2015 20:13:45 +0000 (20:13 +0000)]
segment: Check av_get_frame_filename() return value

CC: libav-stable@libav.org
Bug-Id: CID 1265713

4 years agohlsproto: Properly close avio buffer in case of error
Vittorio Giovara [Thu, 22 Jan 2015 20:13:44 +0000 (20:13 +0000)]
hlsproto: Properly close avio buffer in case of error

Fix a memory leak.

CC: libav-stable@libav.org
Bug-Id: CID 717999

4 years agomov: Do not compute negative SAR values
Vittorio Giovara [Thu, 22 Jan 2015 19:10:27 +0000 (19:10 +0000)]
mov: Do not compute negative SAR values

This partially reverts cf70ba37ba74089a18295b29e77dead0a3222c9e, since
it didn't take into account when rotation is 0, but there is another
valid operation (eg. translation) in the matrix.

Found-by: Michael Niedermayer <michaelni@gmx.at>
4 years agompegvideo_enc: Draw edges on input for non-multiple of 16 resolutions
Michael Niedermayer [Sat, 16 Feb 2013 09:44:38 +0000 (10:44 +0100)]
mpegvideo_enc: Draw edges on input for non-multiple of 16 resolutions

This improves motion estimation and avoids using uninitialized data
for resolutions that aren't a multiple of 16.

Prior to d2a25c40, the edges used to be initialized so that encoding
was deterministic, but after that commit it started using uninitialized
data (for non multiple of 16 resolutions).

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agortspdec: Consistently use rtsp_hd_out for writing
Martin Storsjö [Wed, 21 Jan 2015 13:23:50 +0000 (14:23 +0100)]
rtspdec: Consistently use rtsp_hd_out for writing

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agolibx265: Pass through user-set frame type
Derek Buitenhuis [Wed, 21 Jan 2015 15:16:18 +0000 (15:16 +0000)]
libx265: Pass through user-set frame type

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
4 years agodashenc: Use inttypes.h macros for format strings instead of %lld
Martin Storsjö [Wed, 21 Jan 2015 15:45:29 +0000 (16:45 +0100)]
dashenc: Use inttypes.h macros for format strings instead of %lld

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agodashenc: Fix format string generation
Rodger Combs [Wed, 21 Jan 2015 15:36:53 +0000 (09:36 -0600)]
dashenc: Fix format string generation

Previously this always used the "lld" format for all parameters,
not only time parameters.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agodoc/platform: Reference only MSYS2 and MinGW-w64
Derek Buitenhuis [Mon, 19 Jan 2015 18:47:20 +0000 (18:47 +0000)]
doc/platform: Reference only MSYS2 and MinGW-w64

It's better to steer users at these, since they are both better
and more alive than the mingw.org versions.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
4 years agolibopenh264enc: Move a declaration of a variable into an ifdef
Martin Storsjö [Wed, 7 Jan 2015 22:03:36 +0000 (00:03 +0200)]
libopenh264enc: Move a declaration of a variable into an ifdef

This avoids needing an attribute for silencing warnings about
it being unused.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agolibopenh264enc: Remove a workaround for silencing warnings about unused variables...
Martin Storsjö [Thu, 8 Jan 2015 11:50:58 +0000 (13:50 +0200)]
libopenh264enc: Remove a workaround for silencing warnings about unused variables in the OpenH264 header

The 1.3 release branch of OpenH264 (as well as the master branch)
have been updated so that GCC no longer warns about this variable
as being unused.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agosmoothstreamingenc: Add a missing "goto fail"
Michael Niedermayer [Tue, 13 Jan 2015 23:17:52 +0000 (00:17 +0100)]
smoothstreamingenc: Add a missing "goto fail"

This goto wasn't necessary originally, but it should have been
added when the write_manifest call was added in 8e276378.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoaea: Return proper error code on invalid header
Nidhi Makhijani [Thu, 15 Jan 2015 12:50:03 +0000 (18:20 +0530)]
aea: Return proper error code on invalid header

4 years agoswscale: fix gbrap to gbrap alpha scaling
Vittorio Giovara [Thu, 15 Jan 2015 14:15:22 +0000 (15:15 +0100)]
swscale: fix gbrap to gbrap alpha scaling

4 years agoswscale: fix warning about incompatible function pointer type
Vittorio Giovara [Thu, 15 Jan 2015 14:15:21 +0000 (15:15 +0100)]
swscale: fix warning about incompatible function pointer type

4 years agortmppkt: Repeat the full 32 bit timestamp for chunking continuation packets
Martin Storsjö [Wed, 14 Jan 2015 21:09:06 +0000 (23:09 +0200)]
rtmppkt: Repeat the full 32 bit timestamp for chunking continuation packets

This fixes sending chunked packets (packets larger than the output
chunk size, which often can be e.g. 4096 bytes) with a timestamp delta
(or absolute timstamp, if it's a timestamp step backwards, or the
first packet of the stream) larger than 0xffffffff.

The RTMP spec explicitly says (in section 5.3.1.3.) that packets of
type 3 (continuation packets) should include this field, if the
previous non-continuation packet had it included.

The receiving code handles these packets correctly.

Pointed out by Cheolho Park.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoh264_cabac: Break infinite loops
Michael Niedermayer [Thu, 31 Jan 2013 03:20:24 +0000 (04:20 +0100)]
h264_cabac: Break infinite loops

This fixes out of array reads and/or infinite loops.

30 is the maximum number of bits that can be read into
coeff_abs below.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoopus_parser: drop unused variable
Vittorio Giovara [Wed, 14 Jan 2015 16:46:07 +0000 (17:46 +0100)]
opus_parser: drop unused variable

4 years agobsf: check memory allocations
Vittorio Giovara [Thu, 18 Dec 2014 19:26:56 +0000 (20:26 +0100)]
bsf: check memory allocations

4 years agovp8: improve memory allocation checks
Vittorio Giovara [Wed, 17 Dec 2014 15:02:08 +0000 (16:02 +0100)]
vp8: improve memory allocation checks

Check memory earlier, check one more allocation and clean up on error.

CC: libav-stable@libav.org
Bug-Id: CID 1257773

4 years agoid3v2: fix reading v2.2 attached pictures
Anton Khirnov [Sat, 10 Jan 2015 08:39:34 +0000 (09:39 +0100)]
id3v2: fix reading v2.2 attached pictures

In v2.2, the picture type is not a zero-terminated string, but has a
constant size of 3 bytes.

4 years agoid3v2: add names to the parameters of ID3v2EMFunc.read
Anton Khirnov [Sat, 10 Jan 2015 08:39:33 +0000 (09:39 +0100)]
id3v2: add names to the parameters of ID3v2EMFunc.read

Some of them are not immediately obvious.

4 years agoid3v2: constify the 'tag' parameter to special metadata parsing callback
Anton Khirnov [Sat, 10 Jan 2015 08:39:32 +0000 (09:39 +0100)]
id3v2: constify the 'tag' parameter to special metadata parsing callback

Those functions should not ever modify it.

4 years agotiff: support decoding GBRP and GBRAP formats
Paul B Mahol [Wed, 17 Dec 2014 13:54:44 +0000 (14:54 +0100)]
tiff: support decoding GBRP and GBRAP formats

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
4 years agolibswscale: GBRAP input & output and GBRAP16 input support
Paul B Mahol [Wed, 17 Dec 2014 13:54:43 +0000 (14:54 +0100)]
libswscale: GBRAP input & output and GBRAP16 input support

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
4 years agolavc: add GBRAP to avcodec_align_dimensions2
Paul B Mahol [Wed, 17 Dec 2014 13:54:42 +0000 (14:54 +0100)]
lavc: add GBRAP to avcodec_align_dimensions2

4 years agolavu: add planar 16 bit and 8 bit rgb with alpha
Paul B Mahol [Wed, 17 Dec 2014 13:54:41 +0000 (14:54 +0100)]
lavu: add planar 16 bit and 8 bit rgb with alpha

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
4 years agoimgutils: create misc functions for dealing with buffers
Stefano Sabatini [Wed, 10 Dec 2014 12:20:49 +0000 (12:20 +0000)]
imgutils: create misc functions for dealing with buffers

Move the lavc/imgconvert functions and rename them as follows:
  avpicture_get_size -> av_image_get_buffer_size()
  avpicture_fill     -> av_image_fill_arrays()
  avpicture_layout   -> av_image_copy_to_buffer()

The new functions have an align parameter, which allows to define the
linesize alignment assumed in the buffer (which is set or read).

The names of the functions are consistent with the lavu/samples API
(av_samples_get_buffer_size(), av_samples_fill_arrays()).

A redundant check has been dropped from av_image_fill_arrays().

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
4 years agomov: Check angle rather than full matrix when updating SAR
Vittorio Giovara [Fri, 9 Jan 2015 10:24:22 +0000 (11:24 +0100)]
mov: Check angle rather than full matrix when updating SAR

When the display matrix is not the identity one, but the rotation angle
is zero, there is no need to update the sample aspect ratio.

Otherwise, it is possible to obtain negative values which interferes
with transcoding in later stages. This kind of behaviour is reproducible
on mov files with "major_brand: MSNV".

CC: libav-stable@libav.org
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
4 years agopng: improve signature check
Vittorio Giovara [Mon, 12 Jan 2015 22:55:45 +0000 (23:55 +0100)]
png: improve signature check

Return proper error code, print an error message and add missing
parentheses.

4 years agoimg2dec: correctly use the parsed value from -start_number
Vittorio Giovara [Tue, 6 Jan 2015 15:47:18 +0000 (16:47 +0100)]
img2dec: correctly use the parsed value from -start_number

Previously the image sequence was always starting from the minimum
number rather than the requested one.

CC: libav-stable@libav.org
4 years agomatroskaenc: refuse to write AAC without valid extradata
Anton Khirnov [Thu, 1 Jan 2015 17:22:46 +0000 (18:22 +0100)]
matroskaenc: refuse to write AAC without valid extradata

4 years agompeg4audio: check the init_get_bits() return value
Anton Khirnov [Thu, 1 Jan 2015 16:56:56 +0000 (17:56 +0100)]
mpeg4audio: check the init_get_bits() return value

Fixes possible invalid reads.

CC:libav-stable@libav.org

4 years agolibfdk-aacdec: Make sure decoding doesn't add any extra delay in the latest version...
Martin Storsjö [Wed, 7 Jan 2015 21:49:41 +0000 (23:49 +0200)]
libfdk-aacdec: Make sure decoding doesn't add any extra delay in the latest version of fdk-aac

The latest version added support for a new option for enabling
a signal level limiter, which adds some extra delay. In fdk-aac, this
is enabled by default, but disable it by default here since we'd rather
have zero-delay decoding.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agolibopenh264enc: Fix a typo and some nitpicks
Martin Storsjö [Wed, 7 Jan 2015 22:03:09 +0000 (00:03 +0200)]
libopenh264enc: Fix a typo and some nitpicks

Also move the .long_name entry to below the .name entry.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agodoc: Add initial documentation about the OpenH264 encoder wrapper
Martin Storsjö [Wed, 7 Jan 2015 22:02:05 +0000 (00:02 +0200)]
doc: Add initial documentation about the OpenH264 encoder wrapper

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoxsub: Support DXSA subtitles
Alexandre Colucci [Wed, 7 Jan 2015 11:18:08 +0000 (12:18 +0100)]
xsub: Support DXSA subtitles

These have a DXSA tag and contain alpha in addition to
color values for palette.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
4 years agompeg: Remove unused field
Luca Barbato [Tue, 30 Dec 2014 22:17:17 +0000 (23:17 +0100)]
mpeg: Remove unused field

4 years agosegment: Fix the failure paths
Luca Barbato [Mon, 5 Jan 2015 09:40:41 +0000 (10:40 +0100)]
segment: Fix the failure paths

A failure in segment_end() or segment_start() would lead to freeing
a dangling pointer and in general further calls to seg_write_packet()
or to seg_write_trailer() would have the same faulty behaviour.

CC: libav-stable@libav.org
Reported-By: luodalongde@gmail.com
4 years agolibavcodec: Add an OpenH264 encoder wrapper
Martin Storsjö [Thu, 12 Dec 2013 15:13:55 +0000 (17:13 +0200)]
libavcodec: Add an OpenH264 encoder wrapper

Compared to existing, common opensource H264 encoders, this can be
useful since it has got a different license (BSD instead of GPL).

Performance- and qualitywise it is comparable to x264 in ultrafast
mode.

Hooking it up as an encoder in libavcodec also simplifies comparing
it against other common encoders.

This requires OpenH264 1.3 or newer. Since the OpenH264 API and ABI
changes frequently, only releases are supported.

To take advantage of the OpenH264 patent offer, the OpenH264 library
must not be redistributed, but downloaded at runtime at the end-user's
system.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agomovenc: Fix a typo in a comment
Martin Storsjö [Mon, 5 Jan 2015 13:13:48 +0000 (15:13 +0200)]
movenc: Fix a typo in a comment

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agomovenc: Readd an accidentally removed condition
Martin Storsjö [Mon, 5 Jan 2015 13:07:01 +0000 (15:07 +0200)]
movenc: Readd an accidentally removed condition

This was removed accidentally as part of 847bf598. This could cause
groundless warning logging.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoisom: add 'mp1v' fourcc
Justin Ruggles [Tue, 4 Feb 2014 20:40:32 +0000 (15:40 -0500)]
isom: add 'mp1v' fourcc

As referenced in the CoreMedia API docs.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
4 years agomsmpeg4: check memory allocations and propagate errors
Vittorio Giovara [Wed, 17 Dec 2014 15:02:10 +0000 (16:02 +0100)]
msmpeg4: check memory allocations and propagate errors

Bug-Id: CID 1257781

4 years agoulti: invert the order of parameters of ulti_decode_frame()
Vittorio Giovara [Thu, 18 Dec 2014 19:26:58 +0000 (20:26 +0100)]
ulti: invert the order of parameters of ulti_decode_frame()

This is the order that the caller uses in the rest of the file.
Variables are modified to reflect the order above too and their
initialization is merged with their declarationt. No behavioral
change.

Bug-Id: CID 732286

4 years agovf_interlace: remove the warning tag in the message
Vittorio Giovara [Tue, 2 Dec 2014 14:58:42 +0000 (14:58 +0000)]
vf_interlace: remove the warning tag in the message

The log level is already a warning.

4 years agovf_interlace: merge FIELD_LOWER check
Vittorio Giovara [Tue, 2 Dec 2014 14:58:41 +0000 (14:58 +0000)]
vf_interlace: merge FIELD_LOWER check

4 years agovf_interlace: also assert for height
Vittorio Giovara [Tue, 2 Dec 2014 14:58:39 +0000 (14:58 +0000)]
vf_interlace: also assert for height

4 years agovf_interlace: use image width rather than linesize
Vittorio Giovara [Tue, 2 Dec 2014 14:58:38 +0000 (14:58 +0000)]
vf_interlace: use image width rather than linesize

Based on a patch by Michael Niedermayer <michaelni@gmx.at>.

4 years agobuild: Use -Werror=format-security
Agostino Sarubbo [Sun, 21 Dec 2014 13:38:57 +0000 (14:38 +0100)]
build: Use -Werror=format-security

Reduce the chance of introducing a class of bugs quite hard to track.

4 years agovda: error out if decoded CVPixelBuffer is empty
Stefano Pigozzi [Mon, 29 Dec 2014 20:28:50 +0000 (21:28 +0100)]
vda: error out if decoded CVPixelBuffer is empty

On some video samples, VDA silently fails to decode frames and returns
kVDADecoderNoErr. Error out in these cases to avoid producing AVFrames with
empty planes.

Signed-off-by: Stefano Pigozzi <stefano.pigozzi@gmail.com>
4 years agoffv1: const correctness for encode_rgb_frame()
Diego Biurrun [Thu, 18 Dec 2014 19:07:29 +0000 (20:07 +0100)]
ffv1: const correctness for encode_rgb_frame()

libavcodec/ffv1enc.c:922:53: warning: passing argument 5 of ‘encode_rgb_frame’ discards ‘const’ qualifier from pointer target type

4 years agoffv1: Drop unnecessary casts and const qualifiers to match function signatures
Diego Biurrun [Thu, 18 Dec 2014 19:07:28 +0000 (20:07 +0100)]
ffv1: Drop unnecessary casts and const qualifiers to match function signatures

libavcodec/ffv1dec.c:898:36: warning: cast discards ‘const’ qualifier from pointer target type

4 years agoswscale: check memory allocations
Vittorio Giovara [Wed, 17 Dec 2014 15:02:07 +0000 (16:02 +0100)]
swscale: check memory allocations

CC: libav-stable@libav.org
Bug-Id: CID 1257779

4 years agoopt: check memory allocation
Vittorio Giovara [Thu, 18 Dec 2014 19:26:57 +0000 (20:26 +0100)]
opt: check memory allocation

CC: libav-stable@libav.org
Bug-Id: CID 1257771

4 years agomovenc: Enable editlists by default if delay_moov is enabled
Martin Storsjö [Fri, 2 Jan 2015 23:44:38 +0000 (01:44 +0200)]
movenc: Enable editlists by default if delay_moov is enabled

Being able to write editlists properly is one of the main points
in the delay_moov flag.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agolibavformat: Check for malloc failures in avformat_new_stream
Martin Storsjö [Sat, 3 Jan 2015 19:27:21 +0000 (21:27 +0200)]
libavformat: Check for malloc failures in avformat_new_stream

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agolibavformat: Remove a misleading/incorrect comment
Martin Storsjö [Sat, 3 Jan 2015 19:22:31 +0000 (21:22 +0200)]
libavformat: Remove a misleading/incorrect comment

This comment can be traced back to the initial commit from 2001,
and it seemed to be misleading/incorect already back then. (It
was used for normal, non-raw file formats already then.)

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoconfigure: Remap -L to -libpath for msvc
Martin Storsjö [Fri, 2 Jan 2015 21:29:27 +0000 (23:29 +0200)]
configure: Remap -L to -libpath for msvc

This allows using libraries that are detected via pkg-config with
msvc. (The libraries themselves may have to be built with MSVC
though.)

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agocmdutils: update copyright year to 2015.
Johan Andersson [Sat, 3 Jan 2015 16:31:36 +0000 (17:31 +0100)]
cmdutils: update copyright year to 2015.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoavisynth: Use RTLD_LOCAL instead of RTLD_GLOBAL
Martin Storsjö [Wed, 31 Dec 2014 22:58:06 +0000 (00:58 +0200)]
avisynth: Use RTLD_LOCAL instead of RTLD_GLOBAL

There shouldn't be any need to add the loaded libraries to the global
symbol namespace.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agosidxindex: Remove parsing that isn't necessary any longer
Martin Storsjö [Fri, 28 Nov 2014 07:42:53 +0000 (09:42 +0200)]
sidxindex: Remove parsing that isn't necessary any longer

When we don't adjust the Period start time, we don't need to
parse the earliest_presentation_time from the sidx boxes either.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agosidxindex: Don't adjust the Period start time depending on the track start time
Martin Storsjö [Fri, 28 Nov 2014 07:40:31 +0000 (09:40 +0200)]
sidxindex: Don't adjust the Period start time depending on the track start time

This was only necessary to get playback to start with dash.js 1.2.0,
it has been fixed in the git version.

The previous behaviour was incorrect - the Period's start time
is irrespective of the actual first timestamp of the contents
within the period. The Period start time only says when, within the
global timeline, this particular piece should start to be played
back.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agodashenc: Use pts for MPD timeline timestamps
Martin Storsjö [Mon, 17 Nov 2014 12:34:46 +0000 (14:34 +0200)]
dashenc: Use pts for MPD timeline timestamps

This should be more correct. This also should give more sensible
switching between video streams with different amount of b-frame
delay.

The current dash.js release (1.2.0) fails to start playback of
such files from the start (if the start pts is > 0), but this has
been fixed in the current git version of dash.js.

Also enable the use of edit lists, so that streams in many cases
start at pts=0.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agodashenc: Use delay_moov
Martin Storsjö [Mon, 3 Nov 2014 19:42:09 +0000 (21:42 +0200)]
dashenc: Use delay_moov

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agomovenc: Get rid of a hack for updating the dvc1 atom
Martin Storsjö [Mon, 29 Dec 2014 11:32:21 +0000 (13:32 +0200)]
movenc: Get rid of a hack for updating the dvc1 atom

Use the more generic approach with the delay_moov flag, instead of
having a update mechanism specific to this one single atom.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agomovenc: Add an option for delaying writing the moov with empty_moov
Martin Storsjö [Mon, 3 Nov 2014 14:09:15 +0000 (16:09 +0200)]
movenc: Add an option for delaying writing the moov with empty_moov

This delays writing the moov until the first fragment is written,
or can be flushed by the caller explicitly when wanted. If the first
sample in all streams is available at this point, we can write
a proper editlist at this point, allowing streams to start at
something else than dts=0. For AC3 and DNXHD, a packet is
needed in order to write the moov header properly.

This isn't added to the normal behaviour for empty_moov, since
the behaviour that ftyp+moov is written during avformat_write_header
would be changed. Callers that split the output stream into header+segments
(either by flushing manually, with the custom_frag flag set, or by
just differentiating between data written during avformat_write_header
and the rest) will need to be adjusted to take this option into use.

For handling streams that start at something else than dts=0, an
alternative would be to use different kinds of heuristics for
guessing the start dts (using AVCodecContext delay or has_b_frames
together with the frame rate), but this is not reliable and doesn't
necessarily work well with stream copy, and wouldn't work for getting
the right initialization data for AC3 or DNXHD either.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agomovenc: Use start_dts/cts instead of cluster[0] for writing edit lists
Martin Storsjö [Mon, 3 Nov 2014 18:34:27 +0000 (20:34 +0200)]
movenc: Use start_dts/cts instead of cluster[0] for writing edit lists

This allows writing edit lists even when track->entry == 0, if
the start times have been set.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agomovenc: Remove an unnecessary condition when flushing fragments
Martin Storsjö [Thu, 18 Dec 2014 21:59:27 +0000 (23:59 +0200)]
movenc: Remove an unnecessary condition when flushing fragments

If fragments == 0 it means we haven't written any moov atom yet.
If the empty_moov flag is set, we already have written an empty moov
atom at startup. Thus, the check for empty_moov is redundant.

This is in preparation for allowing writing the moov atom later,
even when using the empty moov flag.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agomovenc: Factorize writing ftyp and other identification tags to a separate function
Martin Storsjö [Thu, 18 Dec 2014 21:52:42 +0000 (23:52 +0200)]
movenc: Factorize writing ftyp and other identification tags to a separate function

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agodashenc: Remove some stray double spaces
Martin Storsjö [Mon, 29 Dec 2014 12:57:05 +0000 (14:57 +0200)]
dashenc: Remove some stray double spaces

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agodashenc: Fix writing of timelines that don't start at t=0
Martin Storsjö [Mon, 29 Dec 2014 13:39:23 +0000 (15:39 +0200)]
dashenc: Fix writing of timelines that don't start at t=0

When writing an explicit time, reset the cur_time variable to this
value as well. This avoids writing excessive time attributes for each
segment in the timeline, as long as the segments are continuous.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agofate: Use bitexact conversions in the dpxparser test
Martin Storsjö [Sun, 28 Dec 2014 22:20:08 +0000 (00:20 +0200)]
fate: Use bitexact conversions in the dpxparser test

This fixes fate on e.g. ppc.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoh264: restore a block mistakenly removed in e10fd08a
Anton Khirnov [Thu, 25 Dec 2014 21:46:39 +0000 (22:46 +0100)]
h264: restore a block mistakenly removed in e10fd08a

CC: libav-stable@libav.org
Bug-ID: 781

4 years agovdpau: add support for the H.264 High 4:4:4 Predictive profile
Rémi Denis-Courmont [Fri, 19 Dec 2014 17:15:05 +0000 (19:15 +0200)]
vdpau: add support for the H.264 High 4:4:4 Predictive profile

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agoavconv_vdpau: allocate video surface of VDPAU-specified size
Rémi Denis-Courmont [Fri, 19 Dec 2014 17:15:11 +0000 (19:15 +0200)]
avconv_vdpau: allocate video surface of VDPAU-specified size

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agovdpau: add support for 4:2:2 and 4:4:4 chroma sampling
Rémi Denis-Courmont [Fri, 19 Dec 2014 17:15:10 +0000 (19:15 +0200)]
vdpau: add support for 4:2:2 and 4:4:4 chroma sampling

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agovdpau: add helper for surface chroma type and size
Rémi Denis-Courmont [Fri, 19 Dec 2014 17:15:09 +0000 (19:15 +0200)]
vdpau: add helper for surface chroma type and size

Since the VDPAU pixel format does not distinguish between different
VDPAU video surface chroma types, we need another way to pass this
data to the application.

Originally VDPAU in libavcodec only supported decoding to 8-bits YUV
with 4:2:0 chroma sampling. Correspondingly, applications assumed that
libavcodec expected VDP_CHROMA_TYPE_420 video surfaces for output.
However some of the new HEVC profiles proposed for addition to VDPAU
would require different depth and/or sampling:
http://lists.freedesktop.org/archives/vdpau/2014-July/000167.html
...as would lossless AVC profiles:
http://lists.freedesktop.org/archives/vdpau/2014-November/000241.html

To preserve backward binary compatibility with existing applications,
a new av_vdpau_bind_context() flag is introduced in a further change.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agolibavcodec: add AV_HWACCEL_ALLOW_HIGH_DEPTH flag
Rémi Denis-Courmont [Fri, 19 Dec 2014 17:15:08 +0000 (19:15 +0200)]
libavcodec: add AV_HWACCEL_ALLOW_HIGH_DEPTH flag

This can be used by the application to signal its ability to cope with
video surface of types other than 8-bits YUV 4:2:0.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agoavcodec: add AVCodecContext.sw_pix_fmt
Rémi Denis-Courmont [Fri, 19 Dec 2014 17:15:07 +0000 (19:15 +0200)]
avcodec: add AVCodecContext.sw_pix_fmt

This carries the pixel format that would be used if it were not for
hardware acceleration. This is equal to AVCodecContext.pix_fmt if
hardware acceleration is not in use.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agoh264: factor hwaccel pixel formats list
Rémi Denis-Courmont [Fri, 19 Dec 2014 17:15:06 +0000 (19:15 +0200)]
h264: factor hwaccel pixel formats list

This is to avoid proliferation of similar tables in following changes.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agompegts: add support for Opus
Kieran Kunhya [Fri, 17 Oct 2014 23:25:16 +0000 (00:25 +0100)]
mpegts: add support for Opus

Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agolibavformat: Only use MoveFileExA when targeting the desktop API subset
Martin Storsjö [Mon, 15 Dec 2014 21:55:30 +0000 (23:55 +0200)]
libavformat: Only use MoveFileExA when targeting the desktop API subset

The MoveFileExA is available in the headers regardless which API
subset is targeted, but it is missing in the Windows Phone link
libraries. When targeting Windows Store apps, the function is
available both in the headers and in the link libraries, and thus
there is no indication for the build system that this function
should be avoided - such an indication is only given by the
Windows App Certification Kit, which forbids using the MoveFileExA
function.

Therefore check the WINAPI_FAMILY defines instead, to figure out
which API subset is targeted.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agortpenc_mpegts: Call write_trailer for the mpegts muxer even if no output buffer exists
Martin Storsjö [Fri, 19 Dec 2014 13:26:23 +0000 (15:26 +0200)]
rtpenc_mpegts: Call write_trailer for the mpegts muxer even if no output buffer exists

Since the mpegts muxer now can handle being called with a NULL
AVIOContext, we don't need to try to allocate one before calling
write_trailer.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agompegts: Support running the write_trailer function without an AVIOContext
Martin Storsjö [Fri, 19 Dec 2014 13:23:06 +0000 (15:23 +0200)]
mpegts: Support running the write_trailer function without an AVIOContext

If opening and closing dynamic buffers as AVIOContext, we may
not have any AVIOContext available when wanting to close and
deallocate the muxer. Allow calling write_trailer despite this.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agolibavformat: Allow calling av_write_trailer with a NULL AVIOContext
Martin Storsjö [Fri, 19 Dec 2014 13:40:02 +0000 (15:40 +0200)]
libavformat: Allow calling av_write_trailer with a NULL AVIOContext

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoon2avc: check number of channels
Michael Niedermayer [Sat, 4 Oct 2014 20:15:07 +0000 (22:15 +0200)]
on2avc: check number of channels

Fixes invalid memory access.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8549
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>
4 years agosmc: fix the bounds check
Michael Niedermayer [Fri, 3 Oct 2014 20:50:45 +0000 (22:50 +0200)]
smc: fix the bounds check

Fixes invalid writes when there are more blocks in a run than total
remaining blocks.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8548
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Anton Khirnov <anton@khirnov.net>