Commit Graph

16307 Commits

Author SHA1 Message Date
Michael Niedermayer
21ff626ce0 Merge commit '01eac895ab350027467ffbe7278740f89ae8be75'
* commit '01eac895ab350027467ffbe7278740f89ae8be75':
  rtmpproto: Only prepend @setDataFrame for onMetaData and |RtmpSampleAccess

Conflicts:
	libavformat/rtmpproto.c

See: 60fd790f38
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-28 12:31:59 +01:00
Michael Niedermayer
900fff89c9 Merge commit '44127b157e9f8acb837d4bb3a094f56b40da3ef5'
* commit '44127b157e9f8acb837d4bb3a094f56b40da3ef5':
  rtmppkt: Make pkt->data reallocable

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-28 12:14:26 +01:00
Michael Niedermayer
42a095d095 Merge commit '3c3b8003a13d9c3668c0bb6d79d2376da3b2b352'
* commit '3c3b8003a13d9c3668c0bb6d79d2376da3b2b352':
  rtmpproto: Simplify code for copying data into the output packet

Conflicts:
	libavformat/rtmpproto.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-28 11:57:33 +01:00
Michael Niedermayer
a105c1f204 Merge commit '857e6667f9061ae261c0b951113e4efc4329b05e'
* commit '857e6667f9061ae261c0b951113e4efc4329b05e':
  rtmpproto: Clarify a comment

Conflicts:
	libavformat/rtmpproto.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-28 11:35:08 +01:00
Martin Storsjö
01eac895ab rtmpproto: Only prepend @setDataFrame for onMetaData and |RtmpSampleAccess
Currently, when streaming to an RTMP server, any time a packet of type
RTMP_PT_NOTIFY is encountered, the packet is prepended with @setDataFrame
before it gets sent to the server. This is incorrect; only packets for
onMetaData and |RtmpSampleAccess should invoke @setDataFrame on the RTMP
server. Specifically, the current bug manifests itself when trying to
stream onTextData or onCuePoint invocations.

This fix addresses that problem and ensures that the @setDataFrame is
only prepended for onMetaData and |RtmpSampleAccess.

Since data is fed to the rtmp_write function in smaller pieces (depending
on the calling IO buffer size), we can't generally assume that the
whole packet (or even the whole command string) is available at once,
therefore we can only check the command string once the full packet
has been transferred to us for sending.

Based on a patch by Jeffrey Wescott.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-28 09:59:29 +02:00
Martin Storsjö
44127b157e rtmppkt: Make pkt->data reallocable
We try to avoid mixing av_malloc with av_realloc, since av_malloc
may be implemented with functions that can't (formally) be mixed
with the functions used in av_realloc.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-28 09:59:28 +02:00
Martin Storsjö
3c3b8003a1 rtmpproto: Simplify code for copying data into the output packet
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-28 09:59:27 +02:00
Martin Storsjö
857e6667f9 rtmpproto: Clarify a comment
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-28 09:59:25 +02:00
Lukasz Marek
500d608861 lavf/ffmenc: store recommended encoder configuration
ffmenc will store recommended encoder configuration if present.
This will allow the user to base on local defaults and
apply only explicitly set options.

If recommended encoder configuration is not present, then
non-default context's options are stored.

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2014-11-27 23:19:41 +01:00
Lukasz Marek
568853b8f5 lavf/ffmdec: add common options to recommended encoder configuration
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2014-11-27 23:19:20 +01:00
Vincent Bernat
d0f8b94b43 avformat/rtpproto: Allow to specify DSCP class
By appending `?dscp=26` to the URL, IP packets will be classified as
AF31 (assured forwarding for multimedia flows with low probability of
loss). On congested network, this allows a user to assign priorities to
flows.

Signed-off-by: Vincent Bernat <vincent@bernat.im>
2014-11-27 19:53:09 +01:00
Vincent Bernat
5269cef408 avformat/udp: Allow to specify DSCP class
By appending `?dscp=26` to the URL, IP packets will be classified as
AF31 (assured forwarding for multimedia flows with low probability of
loss). On congested network, this allows a user to assign priorities to
flows.

Signed-off-by: Vincent Bernat <vincent@bernat.im>
2014-11-27 19:53:09 +01:00
Clément Bœsch
92fa1d9231 avformat/mov: change conjugation for "Duplicate" 2014-11-27 18:13:57 +01:00
Clément Bœsch
5ab882d728 avformat/mov: strengthen some table allocations 2014-11-27 18:12:40 +01:00
Matthew Oliver
0167fa0060 msvc: Fix compilation errors due to header include order.
Ensures that the header include order is such that winsock2.h is always
included before windows.h or that windows.h does not include winsock.h.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-27 12:40:18 +01:00
Michael Niedermayer
4ae1d6021b Merge commit '675ac56b7ee0f204963fde55295197c5df80aa91'
* commit '675ac56b7ee0f204963fde55295197c5df80aa91':
  Revert "lavf: Don't try to update files atomically with renames on windows"

Conflicts:
	libavformat/dashenc.c
	libavformat/hdsenc.c
	libavformat/internal.h
	libavformat/smoothstreamingenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-27 11:52:33 +01:00
Michael Niedermayer
cc663bd13a Merge commit '79fd186a5035cf16fc0ab288d8f59da8b1ba2c0e'
* commit '79fd186a5035cf16fc0ab288d8f59da8b1ba2c0e':
  lavf: Use MoveFileEx instead of rename/_wrename on windows

Conflicts:
	configure

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-27 11:35:54 +01:00
Michael Niedermayer
097de4d1d6 Merge commit '9326d64ed1baadd7af60df6bbcc59cf1fefede48'
* commit '9326d64ed1baadd7af60df6bbcc59cf1fefede48':
  Share the utf8 to wchar conversion routine between lavf and lavu

Conflicts:
	libavformat/os_support.h
	libavutil/file_open.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-27 11:10:26 +01:00
Martin Storsjö
675ac56b7e Revert "lavf: Don't try to update files atomically with renames on windows"
This reverts commit b9d08c77a4.

After taking MoveFileEx into use, we can replace files with renames
on windows as well.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-27 09:29:47 +02:00
Martin Storsjö
79fd186a50 lavf: Use MoveFileEx instead of rename/_wrename on windows
This allows getting the normal unix semantics, where a rename
allows replacing an existing file.

Based on a suggestion by Reimar Döffinger.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-27 09:29:29 +02:00
Martin Storsjö
9326d64ed1 Share the utf8 to wchar conversion routine between lavf and lavu
This doesn't add any dependency on library internals, since this
only is a static inline function that gets built into each of the
calling functions - this is only to reduce the code duplication.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-27 09:29:17 +02:00
Benoit Fouet
e2b8b4caf6 avformat/apngdec: validate frame dimensions.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-26 23:51:07 +01:00
Michael Niedermayer
1b5d112406 avformat/mov: Fix memleaks for duplicate STCO/CO64/STSC atoms
Also see [FFmpeg-devel] [PATCH] avformat/mov: strengthen some table allocations
which contains more fixes but is unfinished

Fixes: signal_sigabrt_7ffff6ac7bb9_3484_cov_1830000177_starfox2.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-26 18:36:17 +01:00
Benoit Fouet
8b8cb30d11 avformat/apngdec: use packet pts and duration instead of altering stream framerate.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-26 12:41:56 +01:00
Michael Niedermayer
0df95fa327 Merge commit '234fb81e3145e9c9aec4ec16266676fab7dc21fa'
* commit '234fb81e3145e9c9aec4ec16266676fab7dc21fa':
  movenc: Expose the fragment index as an avoption

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-26 12:27:01 +01:00
Michael Niedermayer
b78074fd13 Merge commit 'ee37620b6ae4783cda637408422044b2d14a688c'
* commit 'ee37620b6ae4783cda637408422044b2d14a688c':
  movenc: Add a flag for indicating a discontinuous fragment

Conflicts:
	libavformat/movenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-26 11:27:17 +01:00
Martin Storsjö
234fb81e31 movenc: Expose the fragment index as an avoption
This allows setting the right fragment number if doing
random-access writing of fragments, and also allows reading the
current sequence number.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-26 09:58:13 +02:00
Martin Storsjö
ee37620b6a movenc: Add a flag for indicating a discontinuous fragment
This allows creating a later mp4 fragment without sequentially
writing the earlier ones before (when called from a segmenter).

Normally when writing a fragmented mp4 file sequentially, the
first timestamps of a fragment are adjusted to match the
end of the previous fragment, to make sure the timestamp is the
same, even if it is calculated as the sum of previous fragment
durations. (And for the first packet in a file, the offset of
the first packet is written using an edit list.)

When writing an individual mp4 fragment discontinuously like this
(with potentially writing the earlier fragments separately later),
there's a risk of getting a gap in the timeline if the duration
field of the last packet in the previous fragment doesn't match up
with the start time of the next fragment.

Using this requires setting -avoid_negative_ts make_non_negative
(or -avoid_negative_ts 0).

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-26 09:56:56 +02:00
Michael Niedermayer
2ad38c6e02 avformat/mxfdec: dont ask for samples with field dominance 0 anymore
Based on discussion and patch from
"[FFmpeg-devel] [PATCH]Do not ask for mxf samples with unknown field dominance"

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-26 02:07:57 +01:00
Benoit Fouet
4acefd2521 avformat/apngdec: account for blend and dispose operations.
When the dimensions are the entire frame ones, and the dispose operation
is to reset to background, or the new frame overwrites the new one, then
consider the frame as a key one.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-26 00:59:45 +01:00
Carl Eugen Hoyos
5badcdf20d Rename sync() functions in libavformat.
Fixes compilation on Android where the sync() definition in
unistd.h interferes with the static definitions in libavformat.
2014-11-25 23:49:58 +01:00
Yu Xiaolei
bc3d02fa88 lavf/avio: clarify the buffer parameter of avio_alloc_context
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-25 18:19:00 +01:00
Michael Niedermayer
d0879a93ea avformat/os_support: try to fix build when included from a c++ file like libavdevice/decklink*cpp
Found-by: Zeranoe
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-25 17:07:02 +01:00
Michael Niedermayer
8cd80b5fcb avformat/jacosubdec: Cleanup when avpriv_bprint_to_extradata() fails
Fixes memleaks
Fixes: asan_heap-oob_4d2250_814_cov_2745172097_JACOsub_capability_tester.jss
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-25 15:20:54 +01:00
Michael Niedermayer
ecfafc5f2b Merge commit '960aff379da46dcaff61504a57714d4d4e758e41'
* commit '960aff379da46dcaff61504a57714d4d4e758e41':
  lavf: Use wchar functions for filenames on windows for mkdir/rmdir/rename/unlink

Conflicts:
	libavformat/os_support.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-25 02:52:54 +01:00
Michael Niedermayer
71ecfcf2d3 Merge commit 'b9d08c77a44390b0848c06f20bc0e9e951ba6a3c'
* commit 'b9d08c77a44390b0848c06f20bc0e9e951ba6a3c':
  lavf: Don't try to update files atomically with renames on windows

Conflicts:
	libavformat/dashenc.c
	libavformat/hdsenc.c
	libavformat/internal.h
	libavformat/smoothstreamingenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-25 02:14:15 +01:00
Michael Niedermayer
b83beb131f Merge commit '40665d27e38e6a2f65037878202bd1a398c7683e'
* commit '40665d27e38e6a2f65037878202bd1a398c7683e':
  flvdec: Document how the duration is retrieved at the end of the file

Conflicts:
	libavformat/flvdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-25 01:56:05 +01:00
Martin Storsjö
960aff379d lavf: Use wchar functions for filenames on windows for mkdir/rmdir/rename/unlink
This makes sure that the internal utf8 path names are handled
properly - the normal file handling functions assume path names
are in the native codepage, which isn't utf8.

This assumes that the tools outside of lavf don't use the mkdir
definition. (The tools don't do the same reading of command line
parameters as wchar either - they probably won't handle all possible
unicode file parameters properly, but at least work more predictably
if no utf8/wchar conversion is involved.)

This is moved further down in os_support.h, since windows.h shouldn't
be included before winsock2.h, while io.h needs to be included before
the manual defines for lseek functions.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-24 23:36:29 +02:00
Martin Storsjö
b9d08c77a4 lavf: Don't try to update files atomically with renames on windows
On windows, rename(2) will fail if the target file exists. On
unix this trick is used to make sure that people reading the file
either will get the full previous file, or the full new version
of the file, but no intermediate version.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-24 23:34:44 +02:00
Uwe L. Korn
40665d27e3 flvdec: Document how the duration is retrieved at the end of the file
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-24 23:34:30 +02:00
Benoit Fouet
9e1cfbd38a avformat/apngdec: transmit all the chunks between consecutive fcTL ones.
In order to support multiple IDAT of fdAT chunks following an fcTL one,
transmit all the chunks between two fcTL ones (or between fcTL and IEND
one).

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-24 21:10:03 +01:00
wm4
f41cf2e09e avformat/rawdec: raw formats have no timestamps
Some raw demuxers already had AVFMT_NOTIMESTAMPS set. Add it for all the
others.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-24 19:58:26 +01:00
Michael Niedermayer
1d242f9816 avformat/mpegenc: assert that premux_packet is non null
Based on: 065923b078
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-24 16:54:06 +01:00
Michael Niedermayer
9a57309665 Merge commit 'fe42f94ce1023f9c2f7e86404c60afcee5b078a9'
* commit 'fe42f94ce1023f9c2f7e86404c60afcee5b078a9':
  dashenc: Don't segment all video streams when one stream gets a keyframe

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-24 14:07:35 +01:00
Michael Niedermayer
4fecf170d7 Merge commit '30b8eb0f87b0eaefdc115ef38f8ad87dd3a6e50b'
* commit '30b8eb0f87b0eaefdc115ef38f8ad87dd3a6e50b':
  sol: simplify sol_codec_id()

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-24 13:10:16 +01:00
Martin Storsjö
fe42f94ce1 dashenc: Don't segment all video streams when one stream gets a keyframe
This makes sure that segments actually start at a keyframe (and
makes sure we don't split segments twice in a row, with one segment
consisting of only a handful of packets), when one stream uses b-frames
while another one doesn't.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-24 11:09:40 +02:00
Vittorio Giovara
30b8eb0f87 sol: simplify sol_codec_id()
Bug-Id: CID 1238993
2014-11-24 01:30:15 +00:00
Vittorio Giovara
065923b078 mpegenc: prevent a NULL pointer dereference
CC: libav-stable@libav.org
Bug-Id: CID 29261
2014-11-24 01:30:14 +00:00
Jeffrey Wescott
60fd790f38 avformat/rtmpproto: only prepend @setMetaData for onMetaData and |RtmpSampleAccess
In current versions of ffmpeg, when streaming to an RTMP server, anytime a packet of type
RTMP_PT_NOTIFY is encountered, the packet is prepended with @setDataFrame before it gets sent
to the server. This is incorrect; only packets for onMetaData and |RtmpSampleAccess should
invoke @setDataFrame on the RTMP server. Specifically, the current bug manifests
itself when trying to stream onTextData or onCuePoint invocations.

This fix addresses that problem and ensures that the @setDataFrame is only prepended
for onMetaData and |RtmpSampleAccess.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-24 00:15:48 +01:00
James Almer
305b03097d lavf/apngdec: print currently unsupported in-stream tags in a more readable form
Also use length and not stream position

Reviewed-by: Benoit Fouet <benoit.fouet@free.fr>
Signed-off-by: James Almer <jamrial@gmail.com>
2014-11-23 13:01:26 -03:00