OSDN Git Service

android-x86/external-ffmpeg.git
9 years agolavc: add Intel libmfx-based H.264 encoder
Anton Khirnov [Fri, 13 Mar 2015 09:20:31 +0000 (10:20 +0100)]
lavc: add Intel libmfx-based H.264 encoder

9 years agoqsvdec: add 'decode' to the non-static function names
Anton Khirnov [Fri, 13 Mar 2015 07:21:38 +0000 (08:21 +0100)]
qsvdec: add 'decode' to the non-static function names

9 years agoqsvdec: split off some code that will be shared with the encoder
Anton Khirnov [Fri, 13 Mar 2015 07:13:00 +0000 (08:13 +0100)]
qsvdec: split off some code that will be shared with the encoder

9 years agoqsv: rename to qsvdec
Anton Khirnov [Fri, 13 Mar 2015 06:55:53 +0000 (07:55 +0100)]
qsv: rename to qsvdec

This is to avoid conflicts with the upcoming QSV encoding support.

9 years agoavisynth: update documentation about the avisynth_c.h header
Stephen Hutchinson [Fri, 13 Mar 2015 02:52:30 +0000 (22:52 -0400)]
avisynth: update documentation about the avisynth_c.h header

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years agoavisynth: Fix compilation against current 2.6 header(s).
Stephen Hutchinson [Fri, 13 Mar 2015 02:52:29 +0000 (22:52 -0400)]
avisynth: Fix compilation against current 2.6 header(s).

AviSynth 2.6 (and by extension, AviSynth+) moves these functions
into AVSC_API. This requires both adjusting their normal use,
and for AvxSynth, adjusting the position/use of the USING_AVISYNTH
ifdefs.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years agovaapi_h264: fix slice data offset
Hendrik Leppkes [Mon, 23 Mar 2015 13:16:45 +0000 (14:16 +0100)]
vaapi_h264: fix slice data offset

9 years agodxva2_h264: fix slice offset in long slice structs
Hendrik Leppkes [Mon, 23 Mar 2015 13:16:44 +0000 (14:16 +0100)]
dxva2_h264: fix slice offset in long slice structs

9 years agolavc: Prefer x264 over openh264 if both libraries are available
Michael Niedermayer [Tue, 17 Mar 2015 14:16:58 +0000 (14:16 +0000)]
lavc: Prefer x264 over openh264 if both libraries are available

9 years agopixfmt: Update documentation with prefixed pixel formats
Vittorio Giovara [Wed, 18 Mar 2015 11:10:40 +0000 (11:10 +0000)]
pixfmt: Update documentation with prefixed pixel formats

9 years agopixdesc: Replace a few leftover instances of non AV-prefixed flags
Vittorio Giovara [Wed, 18 Mar 2015 11:10:39 +0000 (11:10 +0000)]
pixdesc: Replace a few leftover instances of non AV-prefixed flags

9 years agofate: Add test for tscc2 in mov
Vittorio Giovara [Wed, 18 Mar 2015 00:48:18 +0000 (00:48 +0000)]
fate: Add test for tscc2 in mov

Rename the existing tscc2 test.

9 years agomov: Write the display matrix in order
Vittorio Giovara [Tue, 17 Mar 2015 17:38:48 +0000 (17:38 +0000)]
mov: Write the display matrix in order

This will allow to copy the matrix as is and it is just cleaner to keep
the matrix in the same order specified by the mov standard (which is
also explicitly described in the documentation).

In order to preserve compatibility, flip the angle sign in the display API
av_display_rotation_set() and av_display_rotation_get(), and improve the
documentation mentioning the rotation direction.

9 years agomovenc: Write the make and model metadata keys for mov style files
Martin Storsjö [Fri, 21 Nov 2014 22:53:42 +0000 (00:53 +0200)]
movenc: Write the make and model metadata keys for mov style files

These are essential allowing QuickTime to keep detecting content
as slow-motion - this allows preserving them on stream copy.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agoavfilter: Document avfilter_graph_alloc return value
Federico Tomassetti [Sat, 21 Mar 2015 10:44:57 +0000 (10:44 +0000)]
avfilter: Document avfilter_graph_alloc return value

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years agooggdec: Check memory allocation
Federico Tomassetti [Sat, 21 Mar 2015 10:44:59 +0000 (10:44 +0000)]
oggdec: Check memory allocation

Bug-Id: CID 1257798 / CID 1257805

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years agomms: Check memory allocation
Federico Tomassetti [Sat, 21 Mar 2015 10:44:58 +0000 (10:44 +0000)]
mms: Check memory allocation

Bug-Id: CID 1258462

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years agoavplay: Check memory allocation
Federico Tomassetti [Sat, 21 Mar 2015 10:44:56 +0000 (10:44 +0000)]
avplay: Check memory allocation

Bug-Id: CID 1288294

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years agormenc: Check memory allocation
Federico Tomassetti [Sat, 21 Mar 2015 10:45:00 +0000 (10:45 +0000)]
rmenc: Check memory allocation

Bug-Id: CID 1257832

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years agoswscale: Check memory allocation
Federico Tomassetti [Sat, 21 Mar 2015 10:45:01 +0000 (10:45 +0000)]
swscale: Check memory allocation

Bug-Id: CID 1267890
CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years agoh264: move [uv]linesize to the per-slice context
Anton Khirnov [Thu, 29 Jan 2015 12:06:25 +0000 (13:06 +0100)]
h264: move [uv]linesize to the per-slice context

While it is a per-frame variable, it is only really used in the
low-level decoding code, so it is more efficient to store it in the
slice context.

9 years agoh264_cabac: remove now unnecessary H264Context function parameters
Anton Khirnov [Thu, 29 Jan 2015 10:28:54 +0000 (11:28 +0100)]
h264_cabac: remove now unnecessary H264Context function parameters

9 years agoh264: use a smaller struct for the ref lists
Anton Khirnov [Thu, 29 Jan 2015 07:42:14 +0000 (08:42 +0100)]
h264: use a smaller struct for the ref lists

There is no need to store a whole H264Picture, with a full AVFrame
embedded in it. This should allow getting rid of the embedded AVFrame
later.

9 years agoh264_mb: remove an unused function parameter
Anton Khirnov [Wed, 28 Jan 2015 18:49:50 +0000 (19:49 +0100)]
h264_mb: remove an unused function parameter

9 years agoh264: drop some mpegvideo remnants from draw_horiz_band()
Anton Khirnov [Wed, 28 Jan 2015 18:36:21 +0000 (19:36 +0100)]
h264: drop some mpegvideo remnants from draw_horiz_band()

This code makes no sense for h.264.

9 years agoh264: drop the now unused per-slice H264Contexts
Anton Khirnov [Wed, 28 Jan 2015 18:28:18 +0000 (19:28 +0100)]
h264: drop the now unused per-slice H264Contexts

9 years agoh264: use the main H264Context as the parent for all slice contexts
Anton Khirnov [Wed, 28 Jan 2015 12:26:24 +0000 (13:26 +0100)]
h264: use the main H264Context as the parent for all slice contexts

There is now no need to have per-slice copies of the H264Context.

9 years agoh264_slice: constify all the uses of H264Context during slice decoding
Anton Khirnov [Wed, 28 Jan 2015 12:24:32 +0000 (13:24 +0100)]
h264_slice: constify all the uses of H264Context during slice decoding

All the variables modified by this code are either per-MB arrays or have
been moved to the per-slice context

9 years agoh264: move rbsp_buffer into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move rbsp_buffer into the per-slice context

9 years agoh264: move remaining ER stuff into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move remaining ER stuff into the per-slice context

9 years agoerror_resilience: do not require mbintra/skip tables
Anton Khirnov [Wed, 28 Jan 2015 11:38:57 +0000 (12:38 +0100)]
error_resilience: do not require mbintra/skip tables

h264dec does not use them at all and only allocates them for ER.

9 years agoh264: move top_borders into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move top_borders into the per-slice context

Also change the method for allocating to the same one as used by
edge_emu_buffer.

9 years agoh264: move the scratch buffers into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move the scratch buffers into the per-slice context

Also change the method for allocating them. Instead of two possible
alloc calls from different places, just ensure they are allocated at the
start of each slice. This should be simpler and less bug-prone than the
previous method.

9 years agoh264_loopfilter: constify all uses of H264Context
Anton Khirnov [Tue, 27 Jan 2015 14:53:33 +0000 (15:53 +0100)]
h264_loopfilter: constify all uses of H264Context

All the variables modified by this code are either per-MB arrays or have
been moved to the per-slice context

9 years agoh264_cavlc: constify all uses of H264Context
Anton Khirnov [Tue, 27 Jan 2015 14:53:33 +0000 (15:53 +0100)]
h264_cavlc: constify all uses of H264Context

All the variables modified by this code are either per-MB arrays or have
been moved to the per-slice context

9 years agoh264_cabac: constify all uses of H264Context
Anton Khirnov [Tue, 27 Jan 2015 14:53:33 +0000 (15:53 +0100)]
h264_cabac: constify all uses of H264Context

All the variables modified by this code are either per-MB arrays or have
been moved to the per-slice context

9 years agoh264.c: constify all uses of H264Context in slice and lower-level functions
Anton Khirnov [Tue, 27 Jan 2015 14:53:33 +0000 (15:53 +0100)]
h264.c: constify all uses of H264Context in slice and lower-level functions

All the variables modified by this code are either per-MB arrays or have
been moved to the per-slice context

9 years agoh264: move mb_mbaff into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move mb_mbaff into the per-slice context

9 years agoh264: move mb_field_decoding_flag into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move mb_field_decoding_flag into the per-slice context

9 years agoh264_mb: constify all uses of H264Context
Anton Khirnov [Tue, 27 Jan 2015 14:53:33 +0000 (15:53 +0100)]
h264_mb: constify all uses of H264Context

All the variables modified by this code are either per-MB arrays or have
been moved to the per-slice context

9 years agoh264_mb: constify block_offset
Anton Khirnov [Tue, 27 Jan 2015 15:05:31 +0000 (16:05 +0100)]
h264_mb: constify block_offset

It is read-only in this code.

9 years agoh264_mvpred: constify all uses of H264Context
Anton Khirnov [Tue, 27 Jan 2015 14:53:33 +0000 (15:53 +0100)]
h264_mvpred: constify all uses of H264Context

All the variables modified by this code are either per-MB arrays or have
been moved to the per-slice context

9 years agoh264.h: constify all uses of H264Context
Anton Khirnov [Tue, 27 Jan 2015 14:53:33 +0000 (15:53 +0100)]
h264.h: constify all uses of H264Context

All the variables modified by this code are either per-MB arrays or have
been moved to the per-slice context

9 years agoh264_direct: constify all uses of H264Context
Anton Khirnov [Tue, 27 Jan 2015 14:53:33 +0000 (15:53 +0100)]
h264_direct: constify all uses of H264Context

All the variables modified by this code are either per-MB arrays or have
been moved to the per-slice context

9 years agoh264: use a separate GetBitContext for slice data
Anton Khirnov [Tue, 27 Jan 2015 13:39:06 +0000 (14:39 +0100)]
h264: use a separate GetBitContext for slice data

9 years agoh264: do not abuse the context as a temporary storage in get_last_needed_nal()
Anton Khirnov [Tue, 27 Jan 2015 13:25:01 +0000 (14:25 +0100)]
h264: do not abuse the context as a temporary storage in get_last_needed_nal()

Use a local variable instead.

9 years agoh264: remove some remnants of data partitioning
Anton Khirnov [Tue, 27 Jan 2015 13:21:09 +0000 (14:21 +0100)]
h264: remove some remnants of data partitioning

9 years agoh264: move resync_mb_{x,y} into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move resync_mb_{x,y} into the per-slice context

9 years agoh264: move mb_{x,y} into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move mb_{x,y} into the per-slice context

9 years agoh264: move mb_xy into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move mb_xy into the per-slice context

9 years agoh264: move is_complex into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move is_complex into the per-slice context

9 years agoh264: move mb_skip_run into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move mb_skip_run into the per-slice context

9 years agoh264: move redundant_pic_count into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move redundant_pic_count into the per-slice context

9 years agoh264: move cabac_init_idc into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move cabac_init_idc into the per-slice context

9 years agoh264: move loopfilter parameters into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move loopfilter parameters into the per-slice context

9 years agoh264: move direct_cache into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move direct_cache into the per-slice context

9 years agoh264: move mvd_cache into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move mvd_cache into the per-slice context

9 years agoh264: move mvd_table into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move mvd_table into the per-slice context

9 years agoh264: move last_qscale_diff into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move last_qscale_diff into the per-slice context

9 years agoh264: move [{top,left}_]cbp into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move [{top,left}_]cbp into the per-slice context

9 years agoh264: move cabac[_state] into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move cabac[_state] into the per-slice context

9 years agoh264: move mb[_{padding,luma_dc}] into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move mb[_{padding,luma_dc}] into the per-slice context

9 years agoh264: move intra_pcm_ptr into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move intra_pcm_ptr into the per-slice context

9 years agoh264: move the ref lists variables into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move the ref lists variables into the per-slice context

9 years agoh264: move map_col_to_list0[_field] into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move map_col_to_list0[_field] into the per-slice context

9 years agoh264: move dist_scale_factor[_field] into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move dist_scale_factor[_field] into the per-slice context

9 years agoh264: move col_{parity,fieldoff} into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move col_{parity,fieldoff} into the per-slice context

9 years agoh264: move direct_spatial_mv_pred into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move direct_spatial_mv_pred into the per-slice context

9 years agoh264: move sub_mb_type into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move sub_mb_type into the per-slice context

9 years agoh264: move the slice type variables into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move the slice type variables into the per-slice context

9 years agoh264: move mb_[uv]linesize into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move mb_[uv]linesize into the per-slice context

9 years agoh264: move neighbor_transform_size into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move neighbor_transform_size into the per-slice context

9 years agoh264: move {mv,ref}_cache into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move {mv,ref}_cache into the per-slice context

9 years agoh264: move non_zero_count_cache into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move non_zero_count_cache into the per-slice context

9 years agoh264: move *_samples_available into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move *_samples_available into the per-slice context

9 years agoh264: move intra4x4_pred_mode[_cache] into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move intra4x4_pred_mode[_cache] into the per-slice context

9 years agoh264: move some neighbour information into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move some neighbour information into the per-slice context

9 years agoh264: move {chroma,intra16x16}_pred_mode into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move {chroma,intra16x16}_pred_mode into the per-slice context

9 years agoh264: move {prev,next}_mb_skipped into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move {prev,next}_mb_skipped into the per-slice context

9 years agoh264: move qp_thresh into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move qp_thresh into the per-slice context

9 years agoh264: move the quantizers into the per-slice context
Anton Khirnov [Sat, 17 Jan 2015 21:28:46 +0000 (22:28 +0100)]
h264: move the quantizers into the per-slice context

9 years agoh264: do not copy qscale when updating per-thread contexts
Anton Khirnov [Sat, 17 Jan 2015 20:51:40 +0000 (21:51 +0100)]
h264: do not copy qscale when updating per-thread contexts

It's a per-slice quantity constructed when parsing the slice header.

9 years agoh264: split weighted pred-related vars into per-slice context
Anton Khirnov [Sat, 17 Jan 2015 17:45:29 +0000 (18:45 +0100)]
h264: split weighted pred-related vars into per-slice context

9 years agoh264_ps: properly check cropping parameters against overflow
Anton Khirnov [Fri, 20 Mar 2015 20:49:23 +0000 (21:49 +0100)]
h264_ps: properly check cropping parameters against overflow

CC: libav-stable@libav.org
9 years agohevc: zero the correct variables on invalid crop parameters
Anton Khirnov [Fri, 20 Mar 2015 20:30:29 +0000 (21:30 +0100)]
hevc: zero the correct variables on invalid crop parameters

It's the output_window that is applied to the output frame, not
pic_conf_win

9 years agohevc: make the crop sizes unsigned
Anton Khirnov [Fri, 20 Mar 2015 20:28:34 +0000 (21:28 +0100)]
hevc: make the crop sizes unsigned

9 years agoavconv: Print the avfilter errors
Luca Barbato [Wed, 11 Mar 2015 00:44:47 +0000 (01:44 +0100)]
avconv: Print the avfilter errors

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years agocmdutils: Add a stream specifier to map usable streams
Luca Barbato [Wed, 18 Mar 2015 12:40:12 +0000 (13:40 +0100)]
cmdutils: Add a stream specifier to map usable streams

It drops everything that cannot be used for re-encoding and/or
streamcopy.

9 years agowebp: ensure that each transform is only used once
Andreas Cadhalpun [Thu, 5 Mar 2015 21:48:28 +0000 (22:48 +0100)]
webp: ensure that each transform is only used once

According to the WebP Lossless Bitstream Specification
"each transform is allowed to be used only once".

If a transform is more than once this can lead to memory
corruption.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agomovenc: write the display transform matrix
Anton Khirnov [Thu, 12 Mar 2015 22:14:08 +0000 (23:14 +0100)]
movenc: write the display transform matrix

9 years agoismindex: Calculate the pts duration of trun atoms, not the dts duration
Martin Storsjö [Sun, 15 Mar 2015 22:18:37 +0000 (00:18 +0200)]
ismindex: Calculate the pts duration of trun atoms, not the dts duration

Since the duration is compared to the tfra durations/intervals which
are expressed in pts, calculate that here as well.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agomovenc: Don't assume that fragment durations in pts is equal to duration in dts
Martin Storsjö [Sun, 15 Mar 2015 21:57:06 +0000 (23:57 +0200)]
movenc: Don't assume that fragment durations in pts is equal to duration in dts

For strict CFR, they should be pretty much equal, but if the stream
is VFR, there can be a sometimes significant difference.

Calculate the pts duration separately, used in sidx atoms and for
tfrf/tfxd boxes in smooth streaming ismv files.

Also make sure to reduce the duration of sidx entries according to
edit lists.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agomovenc: Move sidx edit list timestamp adjustment into a block
Martin Storsjö [Mon, 16 Mar 2015 13:08:49 +0000 (15:08 +0200)]
movenc: Move sidx edit list timestamp adjustment into a block

When reading these values from track->frag_info, the same adjustment
has already been done.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agomovenc: Only adjust the cts offset at the start of fragments if necessary
Martin Storsjö [Sun, 15 Mar 2015 21:40:06 +0000 (23:40 +0200)]
movenc: Only adjust the cts offset at the start of fragments if necessary

Adjusting it is only necessary when a sidx/tfrf/tfxd atom already has
been written for the previous fragment (since the sidx/tfrf/tfxd atoms
include the duration between the first pts of the previous fragment, to
the first pts of the new fragment).

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agomovenc: Write pts timestamps in tfxd, instead of dts timestamps
Martin Storsjö [Mon, 16 Mar 2015 11:02:59 +0000 (13:02 +0200)]
movenc: Write pts timestamps in tfxd, instead of dts timestamps

This matches what we write in tfra and tfrf since 9cbf70fa0e.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agomovenc: Set the last packet duration based on the next packet when autoflushing
Martin Storsjö [Mon, 9 Mar 2015 09:47:54 +0000 (11:47 +0200)]
movenc: Set the last packet duration based on the next packet when autoflushing

When automatically flushing fragments based on set conditions
(fragmentation on keyframes, after some interval or byte size),
we already have the next packet for one stream - use this for setting
the duration of the last packet in the flushed fragment correctly.

This avoids having to adjust the timestamp of the first packet in
the new fragment since the last duration was unknown.

Unfortunately, this only works for automatic flushing (not for
caller-triggered flushing, like in the dash muxer), and only for the
one single track that triggered the flushing. The duration of the
last sample in all other tracks still is dependent on AVPacket
duration (or heuristics).

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agodashenc: Heuristically fill in the duration of packets that need it
Martin Storsjö [Fri, 6 Mar 2015 20:30:31 +0000 (22:30 +0200)]
dashenc: Heuristically fill in the duration of packets that need it

This avoids that the mp4 muxer does a similar heuristic, adjusting
the timestamps in a way that the dash muxer doesn't know the actual
timestamps written to the file in the end. By making sure that the
mp4 muxer internal heuristic isn't applied, we know the exact
timestamps written to file, so that the timestamps in manifest match
the files.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agomovenc: Heuristically set the duration of the last sample in a fragment if not set
Martin Storsjö [Fri, 6 Mar 2015 13:45:50 +0000 (15:45 +0200)]
movenc: Heuristically set the duration of the last sample in a fragment if not set

Even if this is a guess, it is way better than writing a zero duration
of the last sample in a fragment (because if the duration is zero,
the first sample of the next fragment will have the same timestamp
as the last sample in the previous one).

Since we normally don't require libavformat muxer users to set
the duration field in AVPacket, we probably can't strictly require
it here either, so don't log this as a strict warning, only as info.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agoudp: Fix crashes after adding AVOptions
Martin Storsjö [Thu, 19 Mar 2015 07:28:25 +0000 (09:28 +0200)]
udp: Fix crashes after adding AVOptions

Add a missing AVClass member, check whether localaddr is null.
(Previously, localaddr was always a local stack buffer, while it
now also can be an avoption string which can be null.)

This fixes crashes when not passing any localaddr parameter, since
66028b7ba.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agomov: Add option to keep exact packet sequence after seeking
Derek Buitenhuis [Mon, 16 Mar 2015 20:08:35 +0000 (20:08 +0000)]
mov: Add option to keep exact packet sequence after seeking

The current behavior may produce a different sequence of packets
after seeking, compared to demuxing linearly from the beginning.
This is because the MOV demuxer seeks in each stream individually,
based on timestamp, which may set each stream at a slightly different
position than if the file would have been read sequentially.

This makes implementing certain operations, such as segmenting,
quite hard, and slower than need be.

Therefore, add an option which retains the same packet sequence
after seeking, as when a file is demuxed linearly.