Commit Graph

9165 Commits

Author SHA1 Message Date
Justin Ruggles f24b0b1b6c mmf: set channel layout 2012-11-12 10:33:20 -05:00
Justin Ruggles 87199d34db mm: set channel layout 2012-11-12 10:33:20 -05:00
Justin Ruggles ef1b23ad21 jvdec: set channel layout 2012-11-12 10:33:20 -05:00
Justin Ruggles 4371131283 iss: set channel layout 2012-11-12 10:33:20 -05:00
Justin Ruggles 41a2d9590d ipmovie: set channel layout 2012-11-12 10:33:19 -05:00
Justin Ruggles 024e03701c iff: set channel layout 2012-11-12 10:33:19 -05:00
Justin Ruggles 73e2007f3d idroqdec: set channel layout 2012-11-12 10:33:19 -05:00
Justin Ruggles f6c3adde41 gxfdec: set channel layout when applicable 2012-11-12 10:33:19 -05:00
Justin Ruggles d4a105ae5c gsmdec: set channel layout 2012-11-12 10:33:19 -05:00
Justin Ruggles 644d8d2e5a flvdec: set channel layout 2012-11-12 10:33:19 -05:00
Justin Ruggles d5ca70b103 dv: set channel layout 2012-11-12 10:33:19 -05:00
Justin Ruggles 49e7af06f2 dsicin: set channel layout 2012-11-12 10:33:19 -05:00
Justin Ruggles a05a63785c daud: set channel layout
Update FATE reference due to WAVE channel mask now being set correctly.
2012-11-12 10:33:18 -05:00
Justin Ruggles 0d09a5848f cdxl: set channel layout 2012-11-12 10:33:18 -05:00
Justin Ruggles e8088d6e4b bmv: set channel layout 2012-11-12 10:33:18 -05:00
Justin Ruggles 2fe804f316 bink: set channel layout 2012-11-12 10:33:18 -05:00
Justin Ruggles ff50d27a63 bfi: set channel layout 2012-11-12 10:33:18 -05:00
Justin Ruggles b5d1a15d1b bethsoftvid: set channel layout 2012-11-12 10:33:18 -05:00
Justin Ruggles 39f0e9b8c6 apc: set channel layout 2012-11-12 10:33:18 -05:00
Justin Ruggles 5595368bcc amr: set channel_layout 2012-11-12 10:33:18 -05:00
Justin Ruggles a903f8f087 Include libavutil/channel_layout.h instead of libavutil/audioconvert.h
Also reorder some other #include when applicable.
2012-11-11 13:35:12 -05:00
Luca Abeni e004d175fe rtpenc_aac: Fix calculation of the header size
Previously the high end byte was always set to zero. Also get
rid of an unnecessary multiplication (which in practice couldn't
overflow) before shifting.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-11-08 19:48:32 +02:00
Diego Biurrun 92fec47d69 build: The A64 muxer depends on rawenc.o for ff_raw_write_packet() 2012-11-05 20:48:50 +01:00
Martin Storsjö d578f94746 rtmp: Use av_strlcat instead of strncat
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-11-05 15:37:09 +02:00
Anton Khirnov 34871beb5e matroskadec: do not use avpacket internals 2012-11-02 18:28:56 +01:00
Anton Khirnov 9221efef79 lavf: fix av_interleaved_write_frame() doxy.
A sentence was mistakenly inserted in the middle of another sentence.
2012-11-02 18:28:56 +01:00
Anton Khirnov 717a450993 lavf: clarify the lifetime of demuxed packets. 2012-11-02 18:28:56 +01:00
Martin Storsjö 2b831a59d9 rtpdec_vp8: Don't parse fields that aren't used
This avoids warnings about unused variables.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-11-02 10:59:17 +02:00
Anton Khirnov fdc8672886 audiointerleave: deobfuscate a function call.
right above there is if (pkt) {<do stuff>; pkt = NULL}, so pkt is just a
fancy name for NULL at this point.
2012-11-02 07:58:38 +01:00
Anton Khirnov 179a5c37e0 rtpdec: factorize identical code used in several handlers 2012-11-02 07:58:37 +01:00
Anton Khirnov f70381ab9d a64: remove interleaved mode.
It has been disabled since it was added two years ago.
2012-11-02 07:58:37 +01:00
Luca Barbato 7658295ba3 pixfmt: support more yuva formats
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-10-30 12:02:42 +01:00
Anton Khirnov ede4cedf47 dv: fix indentation 2012-10-29 21:35:09 +01:00
Anton Khirnov 14f031d7ec dv: use AVStream.index instead of abusing AVStream.id 2012-10-29 21:34:05 +01:00
Martin Storsjö f21d5c905d rtsp: Avoid a cast when calling strtol
This gets rid of this warning:

libavformat/rtsp.c: In function ‘rtsp_parse_transport’:
libavformat/rtsp.c:794: warning: cast discards qualifiers from pointer target type

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-29 17:47:25 +02:00
Luca Barbato d4bff9f1ab nut: support textual data
Plain text (utf8 encoded) data can be muxed and demuxed in nut.
2012-10-29 12:03:28 +01:00
Luca Barbato 07585ffa62 nutenc: verbosely report unsupported negative pts
Additionally use the correct error number.
2012-10-29 10:52:13 +01:00
Martin Storsjö 48f01398ba rtpdec: Cosmetic cleanup
Mainly clean up the RTP statistics code, plus a few other obviously
misindentend lines.

Remove some useless comments, de-doxygenize some comments,
add spacing around operators and fix a typo.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-28 20:50:01 +02:00
Luca Barbato 424b1e7642 yuv4mpeg: reject unsupported codecs
The muxer already rejects unsupported pixel formats, reject also
unsupported codecs to prevent dangerous misuses.
2012-10-28 05:07:55 +01:00
Luca Barbato fce4450dec nutenc: K&R formatting cosmetics 2012-10-28 05:07:55 +01:00
Mans Rullgard 4cbae57cef assdec: fix qsort() callback signature
This changes the event_cmp() function to the correct signature,
avoiding an ugly cast.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-27 18:26:28 +01:00
Mans Rullgard 4521645b1a avio: fix pointer type mismatches in avio_enum_protocols()
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-27 13:43:44 +01:00
Mans Rullgard be2efe0c7b udp: use socklen_t where appropriate
getsockname() takes a pointer to socklen_t which is not necessarily
int.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-27 13:11:46 +01:00
Mans Rullgard 9efbfe57e0 network: use HAVE_THREADS instead of local hack
HAVE_THREADS is set in config.h if pthreads or w32threads is
available, which presumably the proper condition here.

Also fixes undefined behaviour in preprocessor directives.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-27 13:11:17 +01:00
Luca Barbato 254056c4ab pcm: change references to raw to pcm 2012-10-25 17:08:58 +02:00
Janne Grunau dcdfb8ede3 pcmdec: change default of channels parameter to 1
This was previously implicitly done in ff_raw_read_header().
Fixes fate tests with pcm input.
2012-10-25 15:14:40 +02:00
Luca Barbato 587874ef1c rawdec: remove ff_raw_read_header
It is not used anymore and is a kludge.
2012-10-25 14:05:13 +02:00
Luca Barbato 2ef4d586d6 pcmdec: remove dependency from rawdec
The code shared is not actually shared with anything else.
2012-10-25 14:05:13 +02:00
Luca Barbato 5f0e161dd6 g722: refactor out of rawdec.c 2012-10-25 14:05:05 +02:00
Luca Barbato 42c26a4864 rawvideo: use a specific read_header
ff_raw_read_header is used only for this demuxer for video.
2012-10-25 14:04:18 +02:00
Diego Biurrun 2a91ada828 avutil: Make LZO decoder code configure-time selectable 2012-10-25 11:49:49 +02:00
Martin Storsjö c44cef978b smoothstreamingenc: Don't assume streams start from timestamp 0
Also use dts instead of pts for deciding where to split fragments.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-24 14:46:08 +03:00
Anton Khirnov 292a08cbab asfdec: cosmetics, reformat ff_asf_parse_packet() 2012-10-24 08:46:45 +02:00
Diego Biurrun c2dac8ac7a rtmppkt: Avoid unescaped backslash in Doxygen comment 2012-10-23 13:36:58 +02:00
Mans Rullgard 4ebc6a7410 build: Plan 9 support
This adds support for building on Plan 9 x86-32.  The compat/plan9
directory contains these items:

- replacements for the 'head' and 'printf' shell commands
- wrapper for main() to disable FPU exceptions

Larger required changes to the system are described in the
documentation.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-23 12:01:18 +01:00
Mans Rullgard c3e73100af network: use getservbyport() only if available
The absence of this function will only give a less informative
string back from our fallback implementation of getnameinfo().

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-23 12:00:21 +01:00
Mans Rullgard da0d0ae9a4 network: add fallbacks for INADDR_LOOPBACK and INET_ADDRSTRLEN
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-23 12:00:21 +01:00
Diego Biurrun 8f4c414df6 Improve wording and spelling of av_log_missing_feature messages. 2012-10-23 10:28:40 +02:00
Anton Khirnov 6173a8fe5d riff: remove a write-only variable 2012-10-22 08:49:58 +02:00
Martin Storsjö c3e15f7b39 rtpdec: Don't pass a non-AVClass pointer as log context
The log context is assumed to start with an AVClass pointer.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-22 01:46:33 +03:00
Martin Storsjö e0d5ac6ae3 rtsp: Update a comment to the current filename scheme
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-22 01:46:10 +03:00
Martin Storsjö 2f41eaa9c6 rtsp: Make sure the ret variable is initialized in ff_rtsp_fetch_packet
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-20 01:59:06 +03:00
Martin Storsjö 3f055f8f5f rtsp: Allow setting the reordering buffer size via an AVOption
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-18 23:10:48 +03:00
Martin Storsjö 1c37744963 rtsp: Vertically align a constant definition
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-18 23:10:42 +03:00
Martin Storsjö 0de9380be5 rtp: Update the check for distinguishing between RTP and RTCP
Also add enums for more RTCP packet types, according to the IANA
list of registered types.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-18 23:10:20 +03:00
Diego Biurrun 7b2121e7e2 riff: Move functions around to be covered by appropriate #ifdefs
This fixes compilation with --disable-muxers.
2012-10-18 16:12:45 +02:00
Martin Storsjö 0af1fe845a avformat: Fix references to the removed function av_write_header in comments
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-18 16:33:48 +03:00
Martin Storsjö fc085c5b33 gxf: Add a local copy of the relevant parts of the frame rate table
This avoids having to share this table across the library
boundaries.

This shared table used to be problematic, if always declaring
all exported data symbols with the dllimport attribute (even
while building that same library), since it needs to be a
link-time constant when it is used in AVCodec declarations
(in mpeg12enc.c).

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-18 14:26:13 +03:00
Martin Storsjö b760ffdd07 aviobuf: Remove a senseless ifdef in avio_seek
This seemed to assume that one never used writing avio unless
muxers or networking was enabled.

This ifdef is a remnant since 8fa641f8.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-18 01:44:05 +03:00
Anton Khirnov a43283b6f4 wavdec: check size before reading the data, not after. 2012-10-16 18:52:21 +02:00
Anton Khirnov 79922d7237 wav: do not fail on empty INFO tags
Fixes Bug 379

CC: libav-stable@libav.org
2012-10-16 18:52:14 +02:00
Anton Khirnov 31c54711cc lavf: split wav muxer and demuxer into separate files. 2012-10-16 18:52:07 +02:00
Victor Vasiliev 58b619c8a2 wav muxer: write metadata
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-10-16 18:51:56 +02:00
Victor Vasiliev 0bca0283cc riff: do not write empty INFO tags
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-10-16 18:51:16 +02:00
Victor Vasiliev 71e92414bf lavf: move RIFF INFO tag writing from avienc to riff
It will be useful in the wav muxer.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-10-16 18:50:36 +02:00
Mans Rullgard 1fbaabefc4 network: #include stdint.h in network.h
This header uses various types provided by stdint.h without
explicitly including it.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-16 14:45:29 +01:00
Luca Barbato 21de6ba5c1 nut: export codec_tag provided by rawvideo
Raw audio does not provide valid audio tags while rawvideo does.
The fate refs have to be updated because it undoes the previous tag
change.
2012-10-16 15:26:31 +02:00
Mans Rullgard 3b20eb25e7 avserver: move avserver-specific code from ffmdec.c to avserver.c
This way avserver only depends on the data structures of the ffm
demuxer, which it already does, and not also on private functions
being exported by the library.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-16 14:20:05 +01:00
Diego Biurrun 7e68c91e24 rmdec: Move SIPR code shared with Matroska demuxer to a separate file 2012-10-15 13:34:07 +02:00
Luca Barbato 92281850a2 nut: support pcm codecs not mapped in avi
The native tags will be used when available.
2012-10-13 12:33:18 +02:00
Luca Barbato 1bd442c276 nut: prioritize native tags
Use native tags instead of avi ones, simplifies a lot raw video codecs
handling.
2012-10-13 12:33:18 +02:00
Mans Rullgard 0a7005bebd rtpdec_xiph: fix function return type
parse_packed_headers() returns either zero or a negative error code
so its return type must be signed.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-12 22:21:10 +01:00
Mans Rullgard 366484fff1 smjpeg: fix type of 'ret' variable in smjpeg_read_packet()
The 'ret' variable is used for negative error codes so it should
be a signed type.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-12 22:21:10 +01:00
Diego Biurrun 717addecad Use proper return values in case of missing features 2012-10-12 20:56:54 +02:00
Diego Biurrun 930c9d4373 avutil: Duplicate ff_log2_tab instead of sharing it across libs
The table is so small that the space gain is not worth the
performance overhead of cross-library access.
2012-10-12 20:39:17 +02:00
Martin Storsjö 5a2cb78219 rtspdec: Set the default port for listen mode, if none is specified
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-12 18:17:24 +03:00
Michael Niedermayer 2f1b2ff934 rtmpproto: Fix an out of array write
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-12 18:16:59 +03:00
Michael Niedermayer eae35eadc0 rtspdec: Fix use of uninitialized byte
ffurl_read_complete can return 0 as well as negative error codes.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-12 18:16:57 +03:00
Martin Storsjö da18e918a4 md5: Allocate a normal private context for the opaque md5 context pointer
This avoids having to overestimate the md5 context size, which
isn't known beforehand, allowing us to use the new allocate functions
instead.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-11 23:35:29 +03:00
Martin Storsjö e002e3291e Use the new aes/md5/sha/tree allocation functions
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-11 23:35:28 +03:00
Janne Grunau bd141f5ec9 mxfdec: return error if no segments are available in mxf_get_sorted_table_segments
Fixes CID732275.
2012-10-10 21:24:32 +02:00
Luca Barbato 26db9100b2 segment: support applehttp style list 2012-10-10 18:56:55 +02:00
Luca Barbato b522000e9b avio: introduce avio_closep 2012-10-10 18:56:55 +02:00
Luca Barbato 82569b01a1 mpegtsenc: set muxing type notification to verbose 2012-10-10 18:56:54 +02:00
Janne Grunau d5ef9354ce rtspdec: use av_strlcpy for writing into fixed size buffer
Fixes CID231347.
2012-10-09 21:05:15 +02:00
Janne Grunau 4a7c0c4555 http: use av_strlcpy instead of strcpy() without size checks
Fixes CID700730.
2012-10-09 21:05:14 +02:00
Janne Grunau 4ffbe3f3a5 matroskaenc: check cue point validity before reallocation
Prevents memory leak and possible access to freed memory.
Fixes CID605744.
2012-10-09 15:39:05 +02:00
Janne Grunau 53e122dd4a swfenc: error out for more than 1 audio or video stream
Prevents CID602000.
2012-10-09 15:39:05 +02:00
Janne Grunau 8dd0650fe6 rtpdec_mpeg4: au_headers is a single array, simple av_free is enough
Fixes CID700204.
2012-10-09 14:24:36 +02:00
Martin Storsjö 7bc433b36d fate: Add tests of the ff_make_absolute_url function
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-09 14:16:34 +03:00
Duncan Salerno 33893e6abc url: Handle relative urls starting with two slashes
This is defined by RFC 3986 section 5.4.1 to be handled this way.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-09 14:16:33 +03:00
Duncan Salerno eea003814c url: Handle relative urls being just a new query string
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-09 14:16:32 +03:00
Duncan Salerno a6363e3d89 url: Don't treat slashes in query parameters as directory separators
Strip off query parameters from the original url before
applying the new relative path.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-09 14:16:31 +03:00
Diego Biurrun f75f4194d1 Restructure av_log_missing_feature message
Some invocations include a verb in the log message, others do not.  Yet
av_log_missing_feature expects callers to provide a verb.  Change the
function to include a verb instead and update the callers accordingly.
The result is a more natural function API and correct English in the
function invocations.
2012-10-09 11:39:26 +02:00
Martin Storsjö c136a813d7 rtp: Support packetization/depacketization of opus
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-09 11:57:11 +03:00
Yusuke Nakamura e04826c34e file: Set the return value type for lseek to int64_t.
This fixes a regression in 4ed5ac5.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-09 11:27:12 +03:00
Martin Storsjö c9b10cc4db rtpenc_vp8: Update the packetizer to the latest spec version
Tested to work with the gstreamer depacketizer.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-08 23:55:53 +03:00
Martin Storsjö 66d652cbf3 rtpdec_vp8: Make the depacketizer implement the latest spec draft
Not all details are implemented, but it's enough for proper
playback as long as there is no packet loss.

Tested to work with the packetizer in gstreamer (which although
uses a different codec name, to clarify that it is still a spec
draft).

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-08 23:55:52 +03:00
Luca Barbato 0826d8513d segment: drop global headers setting
avconv provides an option to set it externally and there isn't a way for
the outer demuxer to report the inner demuxer flag.

Solves a bad interaction between mpegts and x264, but requires
additional setting for the user.
2012-10-08 11:22:42 +02:00
Anton Khirnov 716d413c13 Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat 2012-10-08 07:13:26 +02:00
Martin Storsjö e67b0f9952 gxf: Include the right header for the avpriv_frame_rate_tab declaration
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-07 14:14:37 +03:00
Justin Ruggles 11dcddb97b ffm: do not write or read the audio sample format 2012-10-06 12:21:54 -04:00
Martin Storsjö cde26748ae smoothstreamingenc: Add a more verbose error message
This helps tracking down the cause if this happens to be an issue.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-06 13:05:35 +03:00
Martin Storsjö fadd3a6821 smoothstreamingenc: Ignore the return value from mkdir
We don't need to return an error if the directory already existed.
We make sure that the directory actually is properly writeable later
within ism_write_header by writing a manifest anyway.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-06 13:05:34 +03:00
Martin Storsjö 8e2763786d smoothstreamingenc: Try writing a manifest when opening the muxer
This allows failing cleaner and earlier if unable to write to
the output directory.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-06 13:05:33 +03:00
Martin Storsjö 3ea06ac59e smoothstreamingenc: Move the output_chunk_list and write_manifest functions up
This allows calling write_manifest from ism_write_header without
a forward declaration.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-06 13:05:32 +03:00
Martin Storsjö 5fa43f76aa smoothstreamingenc: Properly return errors from ism_flush to the caller
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-06 13:05:31 +03:00
Martin Storsjö eb2f391018 smoothstreamingenc: Check the output UrlContext before accessing it
This code can be called with a NULL UrlContext if writing of the
trailer involves seeking.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-06 13:05:30 +03:00
Anton Khirnov d3a72becc6 yuv4mpeg: return proper error codes.
Fixes Bug 373.

CC:libav-stable@libav.org
2012-10-06 10:42:39 +02:00
Diego Biurrun e4cbf7529b Give all anonymously typedeffed structs in headers a name
Anonymous structs cannot be forward declared and have no benefit.
2012-10-06 09:27:11 +02:00
Martin Storsjö 91c1567beb segment: Add comments about calls that only are relevant for some muxers
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-04 18:22:47 +03:00
Martin Storsjö c864c3968a segment: Add an option for omitting the first header and final trailer
This allows writing totally bare segments, without any header/trailer
included anywhere.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-04 13:52:09 +03:00
Martin Storsjö a854362b40 segment: Flush buffered data before finishing a segment
This makes sure any buffered data is written to the segment, for
muxers that buffer up data internally (e.g. fragmented mp4).

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-04 13:52:09 +03:00
Martin Storsjö f7b240434c segment: Set the resend_headers flag for each segment
This makes sure new inline headers are emitted when the next
packet is written. This allows segmenting mpegts without calling
write_header/write_trailer (nor freeing/reiniting the muxer)
for each segment.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-04 13:52:09 +03:00
Martin Storsjö 378a6315b7 segment: Add an option for disabling writing of a header/trailer to each segment
Some segmented formats (such as fragmented mp4) are "bare", as in,
the segment files do not have the same headers/trailers as full normal
files of that format have.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-04 13:52:09 +03:00
Martin Storsjö eb447d5159 segment: Free and reinit the muxer before calling avformat_write_header
This makes sure the muxers are set up in the way they expect
with no data left around from the previous run (which could
cause various issues including memory leaks, depending on the chaine
muxer).

This fixes memory leaks with the mpegts and flv muxers. It also
makes the usage of chained muxers correct.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-04 13:52:09 +03:00
Martin Storsjö 73871dc96f segment: Use the public av_write_header/av_write_trailer functions
With this change, the segmenter muxer doesn't rely on anything
not available/supported to libavformat external users, making
the segmenter muxer do things just like a normal segmenter
application using libavformat would do.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-04 13:52:09 +03:00
Martin Storsjö 0edae4e628 segment: Properly create new AVStreams for the chained muxer
Before, the chained muxer reused the AVStreams array from
the outer muxer, which made it impossible to use the proper
public functions (such as av_write_frame) when calling the
chained muxer.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-04 13:52:09 +03:00
Martin Storsjö aa9f128b7c segment: Add a missing space
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-04 13:52:08 +03:00
Michael Niedermayer 769ed3057e h264probe: Don't error out on bits that no longer are reserved
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-04 00:59:34 +03:00
Martin Storsjö 4edb34f6cc segment: Pass the interrupt callback on to the chained AVFormatContext, too
This might not be needed at the moment, but it's good practice to
pass it to all chained AVFormatContexts, if it would happen to be
used there at a later point.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-02 22:14:07 +02:00
Luca Barbato 72d30b2792 nut: add do {} while (0) to GET_V
Make it consistent with the other function-like macros.
2012-10-02 12:16:47 +02:00
Luca Barbato 1e46c63eb7 avformat: refactor avformat_write_header
Split away option settings, sanity checks and general setup.
2012-10-01 19:57:57 +02:00
Luca Barbato 86bbdf865e avformat: refactor avformat_write_header
Mostly cosmetic changes adding some intermediate to shorten the lines.
2012-10-01 19:57:57 +02:00
Luca Barbato 55f9037f38 avformat: split muxing functions from util.c 2012-10-01 19:57:57 +02:00
Diego Biurrun 15d35bee83 mpegts: Drop pointless casting of hex_dump_debug arguments 2012-10-01 13:18:28 +02:00
Diego Biurrun d3c40a7d1d avformat: const correctness for av_hex_dump / av_hex_dump_log 2012-10-01 13:18:28 +02:00
Diego Biurrun 72eaba5e4f avformat: Convert some commented-out printf/av_log instances to av_dlog 2012-10-01 10:24:28 +02:00
Diego Biurrun 11d4e92ed9 avformat: Remove non-compiling and/or silly commented-out printf/av_log statements 2012-10-01 10:24:28 +02:00
Anton Khirnov 0af49a63c7 avidec: use actually read size instead of requested size
Fixes CVE-2012-2788
2012-09-29 09:27:59 +02:00
Anton Khirnov eeade678f0 avidec: return 0, not packet size from read_packet(). 2012-09-29 09:27:51 +02:00
Duncan Salerno 8bd324e9e4 http: Increase buffer sizes to cope with longer URIs
Use the MAX_URL_SIZE define where applicable. Increase buffer
sizes for all buffers that need to fit a long pathname - buffers
that need to fit only the hostname (and other short strings, but
not the pathname - such as "headers" in http_connect) are kept
at 1024 bytes for now.

Also increase the max line length in http_read_header, since it
might need to contain a full url for Location: redirects.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-28 00:09:38 +03:00
Diego Biurrun bc66827fb1 nutenc: const correctness for ff_put_v_trace/put_s_trace function arguments 2012-09-27 19:32:47 +02:00
Diego Biurrun 83655442fa nutdec: Remove unused and broken debug function stub 2012-09-27 12:02:33 +02:00
Nathan Caldwell bcc1f7caeb Add Opus support to the Ogg muxer.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-09-27 10:48:35 +02:00
Dale Curtis 0575772fa0 avformat: Identify anonymous AVIO typedef structs.
Anonymous typedef structs prevent forward declaration, this
change gives the AVIOContext and AVIOInterruptCB structures
a name.  These structures are now in line with other common
structures such as AVFormatContext and AVCodecContext.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-09-27 09:14:22 +02:00
Diego Biurrun 93e81ee81c nutdec: const correctness for get_v_trace/get_s_trace function arguments 2012-09-26 19:10:13 +02:00
Martin Storsjö 69673138c5 rtpdec: Remove a useless ff_ prefix from a static symbol
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-26 19:05:18 +03:00
Dmitry Samonenko b6bf1490da rtpdec: Support depacketizing speex
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-26 19:05:10 +03:00
Dmitry Samonenko 490ae95aa8 rtpenc: Add support for packetizing speex
This packetization scheme simply places the full packets into the
RTP packet without any extra header bytes.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-26 19:04:57 +03:00
Luca Barbato 0336dea2ef oggparsetheora: make it more robust 2012-09-24 22:35:29 +02:00
Michael Niedermayer bb146bb57b ogg: prevent NULL pointer deference in theora gptopts
Additional safety in case a special ogg stream is crafted
with the proper number of

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-24 22:35:29 +02:00
Luca Barbato d1f05dd183 ogg: calculate the start position once all the headers are parsed
The fisbone packets can be muxed in any order as long the last one
comes before the first data packet.
2012-09-24 22:35:29 +02:00
Luca Barbato 7751e4693d ogg: check that the expected number of headers had been parsed
Not having the header for a codec is a tell-tale of a broken file.
2012-09-24 22:35:29 +02:00
Anton Khirnov 11d1ca4b2c Use avcodec_free_frame() to free AVFrames. 2012-09-24 12:31:25 +02:00
Anton Khirnov 9eb296572e lavf: use a malloced AVFrame in try_decode_frame().
This allows using avcodec_free_frame() to free it properly.
2012-09-24 12:31:24 +02:00
Samuel Pitoiset cee1950bbb rtp: Packetization of JPEG (RFC 2435) 2012-09-23 21:58:41 +03:00
Martin Storsjö 71908f0838 smoothstreamingenc: Copy the SAR on the AVStreams as well
This is required in chained muxers, if the SAR happens to be set.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-23 21:28:58 +03:00
Anton Khirnov 87b017a298 matroskadec: fix a sanity check. 2012-09-21 09:15:07 +02:00
Anton Khirnov bdb939ad73 matroskadec: only return corrupt packets that actually contain data
Fixes bug 372.
2012-09-21 09:15:01 +02:00
Anton Khirnov 1cc569ddda lavf: zero data/size of the packet passed to read_packet(). 2012-09-21 09:14:37 +02:00
Janne Grunau 6746cd7f61 lavf probe: prevent codec probe with no data at all seen
This occurs with fuzzed mpeg-ts files. set_codec_from_probe_data() is
called with a zeroed AVProbeData since no packet made through for
specific stream.
2012-09-20 14:50:06 +02:00
Anton Khirnov 50d1f4437b mp3dec: read Xing frame TOC index 2012-09-19 20:59:45 +02:00
Anton Khirnov 2d1a1a7f62 mp3dec: use named constants for Xing header flags 2012-09-19 20:59:44 +02:00
Yusuke Nakamura d17d0ec8c2 mov: support random access point grouping
Frames described by this grouping are the starter of a closed or
an open GOP.
This is useful for open GOP of H.264 stream which is not described
by sync sample atom.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-09-19 20:34:15 +02:00
Luca Barbato 7d8431004a matroskadec: properly support BlockDuration 2012-09-19 20:34:14 +02:00
Luca Barbato c831ebf616 matroskadec: split frame parsing 2012-09-19 20:34:14 +02:00
Luca Barbato 2d0e7713f9 matroskadec: split laces parsing 2012-09-19 20:34:14 +02:00
Luca Barbato 117d8c6d1f matroska: implement support for ProRes
Support Matroska native formatting.

On demuxing prepend a Frame container atom (32bit big endian encoded
frame size and 'icpf' string).
On muxing remove it.
2012-09-19 20:34:14 +02:00
Moritz Bunkus 8071dca3d5 matroska: implement support for ALAC
Support Matroska native formatting.

On demuxing reconstruct the 36-bytes QuickTime atom that the ALAC
decoder expects by prepending the "atom size", "tag" and
"tag version" fields missing from the Matroska's CodecPrivate
element.

On muxing remove the initial 12 bytes

Sample files are available:
http://www.bunkus.org/videotools/mkvtoolnix/samples/alac/alac-in-matroska.mka
and the CoreAudio file it was created from with today's mkvmerge:
http://www.bunkus.org/videotools/mkvtoolnix/samples/alac/alac-in-matroska-source.caf

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-09-19 20:34:14 +02:00
Luca Barbato 870e75524a matroskadec: validate lace_size when parsed
Stricter validation, explicitly exit on misparsing and some error
forwarding from the ebml parsing functions used.
2012-09-19 20:34:14 +02:00
Luca Barbato c9a39cec70 matroskadec: return meaningful errors in matroska_decode_buffer 2012-09-19 20:34:14 +02:00
Dale Curtis df1d84121b matroskadec: fix incorrect unsigned->signed conversion 2012-09-19 20:34:14 +02:00
Luca Barbato 8d4dd55c37 matroskadec: refactor matroska_decode_buffer
Make MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP behave like
the other encodings and spare few lines of boilerplate code.
2012-09-19 20:34:14 +02:00
Luca Barbato 581281e242 matroskadec: check realloc in lzo encoding
Make all the compression encodings behave the same way.
2012-09-19 20:34:13 +02:00
Luca Barbato cd4739c4f2 matroska: honor error_recognition on unknown doctypes 2012-09-19 20:34:13 +02:00
Martin Storsjö 84cc314e40 smoothstreaming: Export the mp4 codec tags
This fixes stream copy from a format that already has incompatible
codec tags set. The chained ismv muxer exports this same codec tag
list, so set it on this one as well, to allow the caller (and
lavf common code) to set them correctly.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-18 17:59:57 +03:00
Luca Barbato 9888ffb1ce mov: check for EOF in long lasting loops
A quite widespread pattern in the demuxer is read a 32bit unsigned
integer and then loop till this value is reached.

Checking for EOF prevents pathological situations.
2012-09-18 15:32:52 +02:00
Benjamin Larsson 6a08955c10 flvenc: silence bogus warning
The compiler fails to figure out that enc->codec_type can only
have 3 different values.
Thus when an if/else is encountered it triggers on the possibility
of the else case has not initialized the flags variable.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-09-18 10:31:04 +02:00
Clément Bœsch 049ce4facb id3v2: strdup the genre name explicitly.
It would have been done anyway in the av_dict_set() call.

This simplifies the code and avoid a warning because of assigning a
const string from ff_id3v1_genre_str to a non-const variable.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-17 15:48:20 +02:00
Clément Bœsch ffdd2e9144 lavf/id3v2: do not export empty fields.
This also avoids a memleak.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-17 15:48:20 +02:00
Michael Niedermayer a5ea623b36 mov: stsd entries must be at least 16 byte
Fix near infinite loop in stsd parsing.
Bug found by: Diana Elena Muscalu

The size is unsigned according the specification.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-09-16 16:53:06 +02:00
Michael Niedermayer 9db67bedf0 mov: detect EOF in mov_read_dref()
Avoid a near infinite loop.
Issue discovered by cosminamironesei.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-09-16 16:31:03 +02:00
Luca Barbato 4ed5ac50d3 file: return proper error on seek failures 2012-09-16 15:37:14 +02:00
Luca Barbato 3f7fd59d15 avformat: fix typo in avformat_close_input
The condition should not be &&.
2012-09-15 20:23:39 +02:00
Anton Khirnov 7040c9fac2 mp3enc: write Xing TOC
Based on the code by:
Peter Belkner <pbelkner@snafu.de>,
Michael Niedermayer <michaelni@gmx.at>,
Clément Bœsch <clement.boesch@smartjog.com>,
Reimar Döffinger <Reimar.Doeffinger@gmx.de>, and
Tobias Rapp <t.rapp@noa-audio.com>
Alex Converse <alex.converse@gmail.com>

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-09-15 18:25:34 +02:00
Clément Bœsch ca8e39dd0d mp3enc: support MPEG-2 and MPEG-2.5 in Xing header. 2012-09-15 18:25:22 +02:00
Reimar Döffinger 6365e4db79 mp3enc: downgrade some errors in writing Xing frame to warnings
Also clarify the meaning of the log message.
2012-09-15 18:25:15 +02:00
Anton Khirnov 3b4bb19e63 lavf: flush the output AVIOContext in av_write_trailer().
This is consistent with stdio and is what we want to do in all cases.

Fixes a bug in the voc muxer which didn't flush in write_trailer()
previously. This is the cause of the change in the test results.
2012-09-15 18:25:07 +02:00
Anton Khirnov 0c270239c2 lavf: cosmetics, reformat av_write_trailer(). 2012-09-15 18:24:59 +02:00
Stefano Sabatini 5d1203f063 avio: flush the internal buffer in avio_close()
This is consistent with stdio, and thus what people would naturally
expect.
2012-09-15 18:24:49 +02:00
Derek Buitenhuis 1c56cdad33 riff: Add SVQ3 fourcc
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-09-14 14:12:52 -04:00
Luca Barbato 44272c1ccc avformat: refactor avformat_close_input
Do not crash if the input format is not allocated yet.
2012-09-14 14:26:27 +02:00
Luca Barbato 4d1f443c3d avformat: simplify avformat_close_input
avio_close checks by itself for NULL condition.
2012-09-14 14:26:27 +02:00
Martin Storsjö ca6b544ac9 os_support: Choose between direct.h and io.h using a configure check
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-13 14:56:54 +03:00
Martin Storsjö 7b07fab567 os_support: Include io.h instead of direct.h on mingw32ce
Windows CE doesn't have neither mkdir nor _mkdir officially (only
CreateDirectoryW), but mingw32ce has compat wrappers with these names
(declared in io.h since direct.h is unavailable).

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-13 13:52:50 +03:00
Christian Schmidt 07584eaf4a mpegts: check substreams before discarding
Allow to extract the AC3 core from TrueHD with the "copy" codec.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-09-12 23:43:53 +02:00
Martin Storsjö 62c9ae11a7 Add a smooth streaming segmenter muxer
This muxer splits the output from the ismv muxer into individual
files, in realtime.

The same can also be done by the standalone tool ismindex, but this
muxer is needed for doing it in realtime (especially for live
streams that need extra handling for updating the lookahead fields
in the fragment headers).

Using this muxer, one can deliver live smooth streaming from a
normal static file web server. (Using ismindex, one can deliver
premade smooth streaming files from a static file web server,
or prepare files for serving with IIS.)

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 23:42:16 +03:00
Martin Storsjö 29a9b12b10 file: Add an avoption for disabling truncating existing files on open
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 23:42:09 +03:00
Tomas Härdin 5e3572893d img2dec: always close AVIOContexts
Zero sized files would cause the contexts to leak away.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-09-12 14:31:09 +02:00
Martin Storsjö c3bcd22ed3 rtpdec_jpeg: Error out on other unsupported type values as well
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 12:10:56 +03:00
Martin Storsjö 1743938df1 rtpdec_jpeg: Disallow using the reserved q values
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 12:10:45 +03:00
Martin Storsjö 1de9317bd0 rtpdec_jpeg: Fold the default qtables case into an existing if statement
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 12:10:32 +03:00
Martin Storsjö a218deb856 rtpdec_jpeg: Store and reuse old qtables for q values 128-254
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 12:10:05 +03:00
Martin Storsjö a252649059 rtpdec_jpeg: Simplify the calculation of the number of qtables
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 12:09:57 +03:00
Martin Storsjö cbaa9eeda3 rtpdec_jpeg: Add more comments about the fields in the SOF0 section
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 12:09:30 +03:00
Martin Storsjö 31adff08a1 rtpdec_jpeg: Clarify where the subsampling magic numbers come from
Write out the numbers the way they are constructed, not just the
final values.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 12:09:21 +03:00
Martin Storsjö c64d2a63df rtpdec_jpeg: Don't use a bitstream writer for the EOI marker
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 12:09:02 +03:00
Martin Storsjö 20f325f320 rtpdec_jpeg: Don't needlessly use a bitstream writer for the header
Everything written with this bitstream writer is 8/16 bit units
(except for a pair of 4 bit values), so using a bitstream writer
isn't necessary.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 12:08:33 +03:00
Martin Storsjö 43957fcc71 rtpdec_jpeg: Simplify writing of the jpeg header
Generalize writing of any number of qtables. Don't manually write
16 bit values in two separate calls.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 12:08:09 +03:00
Martin Storsjö 932d8300d3 rtpdec_jpeg: Merge two if statements
This makes the code more readable and robust.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 12:07:57 +03:00
Martin Storsjö 7ef4323405 rtpdec_jpeg: Write the DHT section properly
Currently the size header of the generated DHT section is
incorrect, making the mjpeg decoder just skip it. Since the
written huffman tables are the default ones, this failure had
gone undetected.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 12:07:29 +03:00
Samuel Pitoiset 55e778bebd rtpdec_jpeg: Add support for default quantizers
Generate quantization tables when they are not present in the
first chunk.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-11 11:53:08 +03:00
Anton Khirnov ee0dadc109 flvdec: always set AVFMTCTX_NOHEADER.
New streams may be created at any time, e.g. on codec change.
2012-09-11 09:13:29 +02:00
Martin Storsjö 0697d81269 file: Use a normal private context for storing the file descriptor
Previously the file descriptor was stored in the priv_data pointer.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-10 19:49:41 +03:00
Samuel Pitoiset 3c19815416 rtp: Depacketization of JPEG (RFC 2435)
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-09 22:22:21 +03:00
Martin Storsjö 7b699d8136 mov_chan: Only set the channel_layout if setting it to a nonzero value
If regularly parsing new chan atoms (as in rtpdec_qt), but the
chan atoms don't actually contain any channel layout, don't reset
the value that the caller has filled in (by guessing).

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-08 01:30:44 +03:00
Martin Storsjö 5f72bc02f8 mov_chan: Reindent an incorrectly indented line
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-08 01:30:43 +03:00
Carl Eugen Hoyos 407eeb3474 mp2 muxer: mark as AVFMT_NOTIMESTAMPS.
Signed-off-by: Alex Converse <alex.converse@gmail.com>
2012-09-07 14:20:14 -07:00
Samuel Pitoiset 9afb7061f9 mov_chan: Pass a separate AVIOContext for reading
This fixes crashes when called from rtpdec_qt, where
AVFormatContext->pb is null, a crash present since 3bab7cd128.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-07 10:49:35 +03:00
Martin Storsjö e6153f173a avopt: Store defaults for AV_OPT_TYPE_INT in the i64 union member
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-04 23:13:44 +03:00
Martin Storsjö d58dd4b5b5 avopt: Store defaults for AV_OPT_TYPE_FLAGS in the i64 union member
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-04 23:13:38 +03:00
Martin Storsjö 124134e424 avopt: Store defaults for AV_OPT_TYPE_CONST in the i64 union member
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-04 23:13:32 +03:00
Luca Barbato 3093939077 avio: make avio_close NULL the freed buffer 2012-09-04 15:04:46 +02:00
Martin Storsjö 12c8912de2 crypto: Remove a stray double space
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-31 23:27:27 +02:00
Alberto Delmás ee769c6a7c MSS2 decoder
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-08-31 07:37:16 +02:00
Mans Rullgard 8db73c61a7 build: allow non-standard variations of linker -l/-L flags
This enables replacing the -l and -L flags used to specify the
just-built libraries when linking the tools and shared libs with
non-standard syntaxes.  System library flags are already handled
by the filtering mechanism in configure.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-29 14:16:54 +01:00
Martin Storsjö d4bba93f4d sdp: Use static const char arrays instead of pointers to strings
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-28 22:35:17 +03:00
Martin Storsjö 06b5246c84 sdp: Include profile-level-id for H264
This is required for playback with the Stagefright RTSP framework
on Android.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-28 19:32:19 +03:00
Samuel Pitoiset 6af2480aa6 rtpdec_h264: Don't set the pixel format
There is no need for this depacketizer to set the pixel format,
the decoder can do that just fine.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-28 18:16:00 +03:00
Martin Storsjö 125c6c0752 rtsp: Free the rtpdec context properly
The condition for calling the rtpdec cleanup was broken in
df8cf076c8.

This fixes a memory leak.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-27 12:29:47 +03:00
Samuel Pitoiset 7011a42b1a rtmp: support strict rtmp servers
In order to send or receive a stream FCPublish, FCSubscribe and _checkbw
are completely optional and often not implemented. releaseStream over a
non-existen stream might report an error instead of being silent.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-08-22 17:55:17 +02:00
Mans Rullgard edb5238ccb libavformat: add const to AVCodec pointers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-18 14:20:57 +01:00
Anton Khirnov 15c71dfd03 swf(dec): replace CODEC_ID with AV_CODEC_ID 2012-08-18 08:48:30 +02:00
Anton Khirnov e0aa5e772b dvenc: don't use deprecated AVCODEC_MAX_AUDIO_FRAME_SIZE 2012-08-18 08:48:30 +02:00
Samuel Pitoiset 8337b5db96 rtmpdh: Do not generate the same private key every time when using libnettle
Replace mpz_random by mpz_urandomb with a random state initialization in
order to improve the randomness.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-17 23:51:53 +03:00
Jordi Ortiz a2dd4f7780 rtp: remove ff_rtp_get_rtcp_file_handle().
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-17 22:15:56 +03:00
Jordi Ortiz e7993ece9b rtsp.c: use ffurl_get_multi_file_handle() instead of ff_rtp_get_rtcp_file_handle()
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-17 22:15:46 +03:00
Jordi Ortiz d6b9da1178 avio: add (ff)url_get_multi_file_handle() for getting more than one fd
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-17 22:14:30 +03:00
Martin Storsjö cb5ab02a88 rtmp: Use int instead of ssize_t
Not all compilers support ssize_t (MSVC doesn't), and none of these
variables need to be larger than 32 bit.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-16 23:02:26 +03:00
Jordi Ortiz e5f2731c73 rtmp: Add support for receiving incoming streams
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-16 18:13:41 +03:00
Martin Storsjö 70766c2182 Add some more missing includes after removing the implicit common.h
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-15 23:48:48 +03:00
Samuel Pitoiset 93f257db6b rtmp: Automatically compute the hash for SWFVerification
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-15 22:05:36 +03:00
Samuel Pitoiset 635ac8e1be rtmp: Add support for SWFVerification
Specifies how the server verifies client SWF files before allowing the
files to connect to an application. Verifying SWF files is a security
measure that prevents someone from creating their own SWF files that can
attempt to stream your resources.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-15 10:37:34 +03:00
Samuel Pitoiset fb7e78089b rtmp: Gracefully ignore _checkbw errors by tracking them
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-14 22:36:35 +03:00
Samuel Pitoiset 8b6a5a7923 rtmp: Do not send _checkbw calls as notifications
The _checkbw calls were changed to use transactionId 0 in commit
82613564 so that servers would not return _result/_error about it.
While this is the strict interpretation of the spec, there are
servers that return _error about it, even if transactionId was 0.

The latest version of EvoStream Media Server (the commercial version
of crtmpserver) behaves properly as described, i.e. returning an
_error normally but not returning anything when using transactionId
0. The latest version of crtmpserver (right now at least) doesn't
behave like this though, it returns an error even if transactionId
was 0.

There are also other servers that return errors even if transactionId
is set to 0. Therefore set a proper transaction id so that the invoke
can be tracked and the error properly ignored instead.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-14 22:31:53 +03:00
Luca Barbato fb96c1c5fe rtmp: handle bytes read reports
0x03 (bytes read report) is a known type and should be safely ignored
beside in debug situations.
2012-08-13 21:03:59 +02:00
Martin Storsjö bdefe22b8e lavf: Detect discontinuities in timestamps for framerate/analyzeduration calculation
If the dts difference is more than 1000 times the average dts
difference, restart the analysis.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-12 12:39:49 +03:00
Martin Storsjö 30c26c2442 lavf: Initialize the stream info timestamps in avformat_new_stream
These are normally initialized to AV_NOPTS_VALUE at the start
of avformat_find_stream_info, but if a new stream is found while
this function is running (e.g. like in mpegts), the newly added
AVStreams didn't have these values properly initalized, leading
to avformat_find_stream_info terminating too soon (when the
first timestamps are far from 0).

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-12 12:39:47 +03:00
Mohammad Alsaleh 6e9bbc6525 id3v2: Match PIC mimetype/format case-insensitively
Some files' embedded art seems to have the mimetype 'image/JPG' instead
of 'image/jpg'. Libav fails to parse those because it matches
case-sensitively.

Use av_strncasecmp() to fix this behaviour.

Signed-off-by: Mohammad Alsaleh <msal@tormail.org>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-08-12 11:00:19 +02:00
Jordi Ortiz f5ce90f2de rtmp: split chunk_size var into in_chunk_size and out_chunk_size
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-11 15:49:37 +03:00
Samuel Pitoiset a8103503b3 rtmp: Factorize the code by adding find_tracked_method
Also fix the bytestream reader size parameter to take the
offset into account.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-11 15:15:51 +03:00
Anton Khirnov 885da7b082 lavf: simplify is_intra_only() by using codec descriptors. 2012-08-11 11:34:24 +02:00
Mans Rullgard 987170cb9d dict: add av_dict_count()
This adds a function to retrieve the number of entries in a
dictionary and updates the places directly accessing what should
be an opaque struct to use this new function instead.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-10 15:15:00 +01:00
Samuel Pitoiset 3eebc1e174 rtmp: Factorize the code by adding handle_invoke_error
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-08-09 22:44:30 +02:00
Samuel Pitoiset 71036a3a5e rtmp: Factorize the code by adding handle_invoke_status
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-08-09 22:44:30 +02:00
Samuel Pitoiset 5e6001db8f rtmp: Factorize the code by adding handle_invoke_result
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-08-09 22:44:29 +02:00
Mans Rullgard 6d3783d160 ffmenc: replace if/abort with assert()
The condition is trivially true, but keeping the assert() is
sensible to avoid FFM_HEADER_SIZE ever getting out of sync with
the actual code.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-08-09 20:52:39 +01:00
Diego Biurrun 90f7e61769 swf: Move shared table out of the header file 2012-08-09 20:05:54 +02:00
Diego Biurrun 2804ba6a3b swf: Move swf_audio_codec_tags table to the only place it is used 2012-08-09 20:05:53 +02:00
Samuel Pitoiset f89584ca44 rtmp: Add message tracking
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-09 00:32:29 +03:00
Martin Storsjö 1243c72251 rtsp: Support mpegts in raw udp packets
This is basically the same way as mpegts packets are parsed in
rtpdec.c.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-09 00:25:57 +03:00
Martin Storsjö df8cf076c8 rtsp: Support receiving plain data over UDP without any RTP encapsulation
EvoStream Media Server can serve data in this format, and
VLC/live555 already supports it.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-09 00:25:15 +03:00
Martin Storsjö c864e461d2 rtpdec: Remove an unused include
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-09 00:25:11 +03:00
Martin Storsjö bfb82fcddf rtpenc: Remove an av_abort() that depends on user-supplied data
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-09 00:24:41 +03:00
Luca Barbato 82613564cf rtmp: send check_bw as notification
Set the transactionId to 0 to signal the server a return _result/_error
is not expected.

Solves the problems experienced with strict rtmp servers.
2012-08-08 14:22:34 +02:00
Mohammad Alsaleh 385ec296f1 id3v2: Support v2.2 PIC
id3 v2.2 uses image format ("JPG","PNG") instead of mimetypes.

Currently, the attached picture is skipped because the format string
does not match a known picture mimetype.

This patch fixes this behaviour.

Signed-off-by: Mohammad Alsaleh <msal@tormail.org>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-08-08 11:20:45 +02:00
Samuel Pitoiset 00cb52c65c rtmp: Add a new option 'rtmp_subscribe'
This option specifies the name of live stream to subscribe.
Defaults to rtmp_playpath.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-07 23:35:39 +03:00
Samuel Pitoiset f9e77c1762 rtmp: Add support for subscribing live streams
When streaming live streams using the Akamai, Edgecast or Limelight CDN,
players cannot simply connect to the live stream. Instead, they have to
subscribe to it, by sending an FC Subscribe call to the server.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-07 23:35:39 +03:00
Samuel Pitoiset 12127b65b0 rtmp: Factorize simultaneous URLProtocol / AVClass declarations with a macro
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-07 23:35:39 +03:00
Anton Khirnov 36ef5369ee Replace all CODEC_ID_* with AV_CODEC_ID_* 2012-08-07 16:00:24 +02:00
Justin Ruggles 2fa57c9daf mpc8: set packet duration and stream start time instead of tracking frames
Fixes mpc8 timestamps.
2012-08-06 14:39:21 -04:00
Martin Storsjö 6c071a2b38 lavf: Declare an AVRational struct without a struct literal
At this place, the normal way of initializing a struct works
fine, there's no need for a struct literal.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-06 00:48:58 +03:00
Alex Rønne Petersen 150adea6da rtmppkt: Add missing libavcodec/bytestream.h include.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-08-02 13:32:02 -04:00
Jordi Ortiz 50468f93e3 rtmp: add functions for reading AMF values
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-08-02 14:06:44 +02:00
Derek Buitenhuis 45eaac02cb Canopus Lossless decoder
At the moment it only does BGR24, but I plan to add the rest after.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-08-01 22:06:16 -04:00
Diego Biurrun 19cf7163c1 dca: Switch dca_sample_rates to avpriv_ prefix; it is used across libs 2012-08-01 11:43:31 +02:00
Diego Biurrun 9e4bca16f8 dca: Move tables used outside of dcadec.c to a separate file. 2012-08-01 00:17:17 +02:00
Anton Khirnov 921063877e apetag: change a forgotten return to return 0 2012-07-31 21:32:25 +02:00
Anton Khirnov f2ed006c90 mpc8: return more meaningful error codes. 2012-07-31 20:54:22 +02:00
Anton Khirnov 263dbe9d95 mpc: return more meaningful error codes. 2012-07-31 20:54:17 +02:00
Anton Khirnov 782e64fbe1 wv,mpc8: don't return apetag data in packets. 2012-07-31 20:53:54 +02:00
Samuel Pitoiset 9c9c21eaa1 rtmp: do not warn about receiving metadata packets
They are managed in get_packet()

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-07-31 14:52:25 +02:00
Diego Biurrun 0177b7d23a Improve descriptiveness of a number of codec and container long names 2012-07-30 20:46:55 +02:00
Diego Biurrun 6774247a9d avformat: Drop pointless "format" from container long names 2012-07-30 13:59:06 +02:00
Anton Khirnov 29d70274ec wv: K&R formatting cosmetics 2012-07-30 00:42:20 +02:00
Luca Barbato 41f43202cf flvdec: remove spurious use of stream id
We match streams by codec id now.
2012-07-29 17:18:03 +02:00
Anton Khirnov aba232cfa9 lavf: deprecate r_frame_rate.
According to its description, it is supposed to be the LCM of all the
frame durations. The usability of such a thing is vanishingly small,
especially since we cannot determine it with any amount of reliability.
Therefore get rid of it after the next bump.

Replace it with the average framerate where it makes sense.

FATE results for the wtv and xmv demux tests change. In the wtv case
this is caused by the file being corrupted (or possibly badly cut) and
containing invalid timestamps. This results in lavf estimating the
framerate wrong and making up wrong frame durations.
In the xmv case the file contains pts jumps, so again the estimated
framerate is far from anything sane and lavf again makes up different
frame durations.

In some other tests lavf starts making up frame durations from different
frame.
2012-07-29 08:06:30 +02:00
Anton Khirnov f66eeff1c8 lavf: round estimated average fps to a "standard" fps. 2012-07-29 08:05:46 +02:00
Anton Khirnov fe1c1198e6 lavf: use dts difference instead of AVPacket.duration in find_stream_info()
AVPacket.duration is mostly made up and thus completely useless, this is
especially true for video streams.
Therefore use dts difference for framerate estimation and
the max_analyze_duration check.

The asyncts test now needs -analyzeduration, because the default is 5
seconds and the audio stream in the sample appears at ~10 seconds.
2012-07-29 08:04:42 +02:00
Luca Barbato 681ed00099 avf: introduce nobuffer option
Useful in cases where a significant analyzeduration is
still needed, while minimizing buffering before output.

An example is processing low-latency streams where all
media types won't necessarily come in if the
analyzeduration is small.

Additional changes by Josh Allmann <joshua.allmann@gmail.com>

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-07-29 07:58:00 +02:00
Anton Khirnov c1d865d563 wv: return meaningful error codes. 2012-07-28 14:37:16 +02:00
Anton Khirnov ccc10acb5b wv: return AVERROR_EOF on EOF, not EIO. 2012-07-28 14:37:12 +02:00
Anton Khirnov f73e3938ac mp3dec: forward errors for av_get_packet().
Don't invent a bogus EIO error.

The code now doesn't check for ret == 0, but that check is redundant,
av_get_packet() never returns 0.
2012-07-28 14:37:00 +02:00
Anton Khirnov 67b1156fe8 mp3dec: remove a pointless local variable. 2012-07-28 14:36:55 +02:00
Anton Khirnov 61f8bb74f3 mp3dec: remove commented out cruft. 2012-07-28 14:36:51 +02:00
Anton Khirnov efd34918ba lavf: remove commented out cruft in avformat_find_stream_info() 2012-07-28 10:00:38 +02:00
Anton Khirnov c4ef6a3e4b Add missing libavutil/time.h includes. 2012-07-28 09:02:07 +02:00
Martin Storsjö 8ebacfb598 hls: Proceed to the next segment at any error code
Previously, we returned any error code except AVERROR_EOF to the
caller - only if AVERROR_EOF or 0 was returned, we proceeded to
the next segment.

With some setups of web servers, using Connection: close in https
and GnuTLS, we don't get a clean error code at the end of segments.
In those cases, just proceed to the next segment.

Tested-by: Antti Seppälä <a.seppala@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-28 01:21:32 +03:00
Martin Storsjö 41ecbbc7aa tls: Return AVERROR_EOF if the TLS_read/write functions return 0
OpenSSL returns 0 when the peer has closed the connection. GnuTLS
doesn't return that though, but returns
GNUTLS_E_UNEXPECTED_PACKET_LENGTH if the connection simply is closed
without a clean close notify packet.

Tested-by: Antti Seppälä <a.seppala@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-07-28 01:21:16 +03:00