summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
...
* rtpdec_asf: Don't free the payload context in the .close functionMartin Storsjö2015-03-04
| | | | | | This was missed in bb4a310bb. This fixes a double free on close. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec_mpa_robust: Fix incrementing split_posMartin Storsjö2015-03-04
| | | | | | | | | This fixes an oversight in 96084251, in a refactoring done on top of Gilles' original patch. Pointed out by Gilles Chanteperdrix. Signed-off-by: Martin Storsjö <martin@martin.st>
* asf: do not export XMP metadata by defaultVittorio Giovara2015-03-03
| | | | | | | | | | | Similarly to what has been done for MOV, display XMP metadata only when users explicitly require it. The Extensible Metadata Platform tag can contain various kind of data which are not strictly related to the video file, such as history of edits and saves from the project file. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* dashenc: Simplify code by using a local variableMartin Storsjö2015-03-02
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* Revert "mov: Change DTS-based seek into CTS-based seek."Martin Storsjö2015-03-02
| | | | | | | | | | | This reverts commit 4abfa387b8234736f6e0e541951e3d5eb60eb843. This commit broke playback of fragmented mp4 files with b-frames. While investigating this, it turned out that the general framework isn't ready for a PTS-based index yet. Revert this change until a better thought out solution is in place. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpenc: Don't set max_frames_per_packet based on the packet frame size or ↵Martin Storsjö2015-02-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | frame rate Instead check the timestamps while muxing, to avoid buffering a too long timestamp range into one single packet. This makes the AMR and AAC packetization slightly less efficient, since we set a possibly unnecessarily high max_frames_per_packet. (These packetizers end up doing a memmove of the TOC bytes if sending a packet before max_frames_per_packet is achieved, and we end up setting max_frames_per_packet to a value that should be high enough for most uses.) All packetizers that use max_frames_per_packet now set it either to a default value, or to a value calculated based on other parameters, so none of them rely on the previous default setting. For iLBC, copy one frame at a time, to allow checking the timestamp range for each of them - basically doing potentially multiple loops to simplify the code instead of trying to calculate the number of frames to buffer while honoring s1->max_delay. This is in preparation for reducing the coupling between libavformat and libavcodec, by not having the muxers use the encoder field frame_size (which may not be available during e.g. stream copy). Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpenc: Restructure if statements in packetizers to simplify adding more ↵Martin Storsjö2015-02-28
| | | | | | | | | | conditions Factorize out the s->num_frames check at the start of the if statements, simplifying adding more alternative causes for sending the buffered frames. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpenc: Skip redundant initializationMartin Storsjö2015-02-28
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpenc: Always do the default initialization regardless of codecsMartin Storsjö2015-02-28
| | | | | | | | This avoids having to jump to the defaultcase in the switch. Manually override the stream time base back to 90 kHz for the few audio codecs that don't use the sample rate as time base (mp2, mp3). Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpenc_xiph: Don't exclude headers from max_payload_sizeMartin Storsjö2015-02-28
| | | | | | | This makes things more consistent by using the variable in the same way as in all other packetizers. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpenc_xiph: Use AV_WB16 instead of manual bitshiftsMartin Storsjö2015-02-28
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpenc_aac: Use AV_WB16 instead of manual bitshiftsMartin Storsjö2015-02-28
| | | | | | This makes the code slightly more readable and understandable. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpenc_aac: Merge a definition with a declarationMartin Storsjö2015-02-28
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpenc: Write conditional statements on separate linesMartin Storsjö2015-02-28
| | | | | | | Intentionally keeping some conditional statements on single lines in rtpenc_h263.c. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpenc_aac: Set a default value for max_frames_per_packet at initMartin Storsjö2015-02-28
| | | | | | | This avoids having to conditionally set the default within the packetizer function. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpenc_amr: Use s->num_frames instead of s->buf_ptr - s->bufMartin Storsjö2015-02-28
| | | | | | | This doesn't fix any bug, but makes the code simpler for later patches, and more straightforward to read as is. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpenc_aac: Fix sending fragmented framesMartin Storsjö2015-02-28
| | | | | | | | | | | | After sending a fragmented frame, len (s->buf_ptr - s->buf) isn't zero, while s->num_frames is zero as intended. Using s->num_frames makes it work as intended, and is less convoluted than keeping track of (resetting) s->buf_ptr. This avoids sending stray data after sending a fragmented aac packet. CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* tls: Pass AVOptions dictionaries through to the chained protocolMartin Storsjö2015-02-28
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* tcp: Clarify the units for the timeout avoptionsMartin Storsjö2015-02-28
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* avio: Rename avclass symbols relating to avioMartin Storsjö2015-02-28
| | | | | | | Don't prefix them ffio_url, which is misleading, sounding too much like the urlprotocol layer (like ffurl_*). Signed-off-by: Martin Storsjö <martin@martin.st>
* matroskaenc: Allow writing track "forced" flagJohn Stebbins2015-02-24
| | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* rtpdec: Rename the free method to closeMartin Storsjö2015-02-24
| | | | | | | | | Many of these functions were named foo_free_context, and since the functions no longer should free the context itself, only allocated elements within it, the previous naming was slightly misleading. Signed-off-by: Martin Storsjö <martin@martin.st>
* libavformat: Use ffio_free_dyn_buf where applicableMartin Storsjö2015-02-24
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Use ffio_free_dyn_bufMartin Storsjö2015-02-24
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* avio: Add an internal utility function for freeing dynamic buffersMartin Storsjö2015-02-24
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Free depacketizers if the init function failedMartin Storsjö2015-02-24
| | | | | | | | | | | | | | This is different from how it is handled in codecs/demuxers/muxers though (where the close function isn't called if the open function failed), but since the number of depacketizers that have an .init function is quite limited, this is easy to change. The main point is that if the init function failed, we shouldn't try to use that depacketizer at all - this makes sure that the parse function doesn't need to check for the things that were initialized in the init function. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Don't free the payload context in the .free functionMartin Storsjö2015-02-24
| | | | | | | | | | | | | | This makes it more consistent with depacketizers that don't have any .free function at all, where the payload context is freed by the surrounding framework. Always free the context in the surrounding framework, having the individual depacketizers only free any data they've specifically allocated themselves. This is similar to how this works for demuxer/muxers/codecs - a component shouldn't free the priv_data that the framework has allocated for it. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Remove the now unused .alloc fieldMartin Storsjö2015-02-24
| | | | | | Always use the .priv_data_size field instead. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Use .init instead of .alloc to set default valuesMartin Storsjö2015-02-24
| | | | | | The ugly error handling in rdt gets improved in a later commit. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Remove unnecessary inline attributesMartin Storsjö2015-02-24
| | | | | | | These functions are far from performance critical, so there's no point in marking them as inline. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Don't pass non-const pointers to fmtp attribute parsing functionsMartin Storsjö2015-02-24
| | | | | | | This makes it clear that the individual parsing functions can't touch the parsed out value. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Add const to string parameters in internal fmtp parsing functionsMartin Storsjö2015-02-24
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Remove unnecessary checksMartin Storsjö2015-02-24
| | | | | | The free function of a depacketizer won't be called if data is NULL. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpenc: Merge the h264 and hevc packetizersMartin Storsjö2015-02-24
| | | | | | | | | | | They share a great deal of common structure; only a few minor bits in the headers differ. This also fixes an off-by-one in sending of the last fragment of large HEVC nals (where it previously sent len+2 bytes, even if it should have been len+RTP_HEVC_HEADERS_SIZE aka len+3). Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec_hevc: Share the implementation of fragmented packets with h264Martin Storsjö2015-02-24
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec_hevc: Reduce indentation level by returning early on errorsMartin Storsjö2015-02-24
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec_hevc: Share the implementation of parsing a=framesize with h264Martin Storsjö2015-02-24
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec_hevc: Add asterisks at the start of each long comment lineMartin Storsjö2015-02-24
| | | | | | This is the common style for such comments. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Get rid of all trivial .alloc/.free functionsMartin Storsjö2015-02-24
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Allow allocating and freeing the private data without explicit functionsMartin Storsjö2015-02-24
| | | | | | This can reduce the amount of boilerplate in simple depacketizers. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Set need_parsing via a handler fieldMartin Storsjö2015-02-24
| | | | | | | This avoids implementing a full function just to set this one field. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Allow setting the need_parsing field in RTPDynamicProtocolHandlerMartin Storsjö2015-02-24
| | | | | | | | | | This allows getting rid of quite a bit of boilerplate in depacketizers. The default value (initializing need_parsing to 0, aka AVSTREAM_PARSE_NONE) is the same as it is initialized to by default in AVStream. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec_mpa_robust: Move .enc_name to the start of the structMartin Storsjö2015-02-24
| | | | | | This makes it match the other depacketizers. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Remove unnecessary _if_needed suffixes on functionsMartin Storsjö2015-02-24
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Change enc_name to a pointer instead of a fixed-size bufferMartin Storsjö2015-02-24
| | | | | | | This avoids allocating space for a too large buffer for all the name strings. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec_h264: Remove an unnecessary includeMartin Storsjö2015-02-24
| | | | | | Nothing in this file use any network functions. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec_h264: Remove unnecessary struct paddingMartin Storsjö2015-02-24
| | | | | | | There's no point in adding padding in the allocation of a depacketizer specific context struct. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec_amr: Use the common indentation styleMartin Storsjö2015-02-24
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtsp: Fix the indentation of a linewrapped statementMartin Storsjö2015-02-24
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Add missing trailing commasMartin Storsjö2015-02-24
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>