summaryrefslogtreecommitdiff
path: root/libavformat/rtpenc.c
Commit message (Collapse)AuthorAgeFilesLines
* avformat/avformat: Move AVOutputFormat internals out of public headerAndreas Rheinhardt2023-02-091-7/+8
| | | | | | | | | | | | | | This commit does for AVOutputFormat what commit 20f972701806be20a77f808db332d9489343bb78 did for AVCodec: It adds a new type FFOutputFormat, moves all the internals of AVOutputFormat to it and adds a now reduced AVOutputFormat as first member. This does not affect/improve extensibility of both public or private fields for muxers (it is still a mess due to lavd). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* rtp: convert to new channel layout APIVittorio Giovara2022-03-151-7/+7
| | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/rtpenc_rfc4175: support for interlace formatLimin Wang2022-01-121-2/+7
| | | | | | | | | | | | | | | | | Below are steps how to test on your local host: wget --no-check-certificate https://samples.ffmpeg.org/MPEG2/interlaced/burosch1.mpg 1. interlace format: ffmpeg -re -i ./burosch1.mpg -c:v bitpacked -pix_fmt yuv422p10 -f rtp rtp://239.255.0.1:6000 copy and create sdp file test.sdp ffplay -buffer_size 671088640 -protocol_whitelist "file,rtp,udp" test.sdp 2. progressive format: ffmpeg -re -i ./burosch1.mpg -vf yadif -c:v bitpacked -pix_fmt yuv422p10 -f rtp rtp://239.255.0.1:6000 copy and create sdp file test.sdp ffplay -buffer_size 671088640 -protocol_whitelist "file,rtp,udp" test.sdp Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat: suppport YUV 4:2:2 10-bit for rfc4175Limin Wang2021-11-251-0/+2
| | | | | Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/rtpenc: adds partial support for the RFC 4175Limin Wang2021-11-251-0/+4
| | | | | Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat: Constify all muxer/demuxersAndreas Rheinhardt2021-04-271-1/+1
| | | | | | | This is possible now that the next-API is gone. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/buffer: Switch AVBuffer API to size_tAndreas Rheinhardt2021-04-271-1/+1
| | | | | | | Announced in 14040a1d913794d9a3fd6406a6d8c2f0e37e0062. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: use the buffer_size_t typedef where requiredJames Almer2021-03-101-1/+1
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec, avformat: Remove unnecessary initializations of side data sizeAndreas Rheinhardt2020-06-221-1/+1
| | | | | Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* Revert "avformat/utils: make ff_ntp_time() accept a timestamp as input argument"James Almer2020-01-161-4/+4
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/utils: make ff_ntp_time() accept a timestamp as input argumentJames Almer2020-01-151-4/+4
| | | | | | Will be needed by the next patch. Signed-off-by: James Almer <jamrial@gmail.com>
* lavf/rtpenc: Add support for 24 bit pcm encoding as defined by RFC 3190.Carl Eugen Hoyos2017-10-291-0/+3
| | | | Fixes ticket #6770.
* lavf/rtpenc: Add support for little-endian G.726.Carl Eugen Hoyos2017-10-071-0/+2
|
* Fix all -Wformat warnings raised by DJGPPClément Bœsch2017-03-291-1/+1
|
* Merge commit '1263b2039eb5aaf1522e9de9f07c787ab30a5f50'Clément Bœsch2017-03-241-1/+1
|\ | | | | | | | | | | | | * commit '1263b2039eb5aaf1522e9de9f07c787ab30a5f50': Adjust printf conversion specifiers to match variable signedness Merged-by: Clément Bœsch <u@pkh.me>
| * Adjust printf conversion specifiers to match variable signednessDiego Biurrun2016-10-281-1/+1
| |
* | Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'Clément Bœsch2016-06-211-2/+2
|\ \ | |/ | | | | | | | | | | * commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb': cosmetics: Fix spelling mistakes Merged-by: Clément Bœsch <u@pkh.me>
| * cosmetics: Fix spelling mistakesVittorio Giovara2016-05-041-2/+2
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | rtpenc: packetizer for VP9 RTP payload format (draft v2)Thomas Volkert2016-06-131-0/+14
| |
* | rtpenc: packetizer for VC-2 HQ RTP payload format (draft v1)Thomas Volkert2016-05-031-0/+15
| |
* | Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-101-22/+22
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '9200514ad8717c63f82101dc394f4378854325bf': lavf: replace AVStream.codec with AVStream.codecpar This has been a HUGE effort from: - Derek Buitenhuis <derek.buitenhuis@gmail.com> - Hendrik Leppkes <h.leppkes@gmail.com> - wm4 <nfxjfg@googlemail.com> - Clément Bœsch <clement@stupeflix.com> - James Almer <jamrial@gmail.com> - Michael Niedermayer <michael@niedermayer.cc> - Rostislav Pehlivanov <atomnuker@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavf: replace AVStream.codec with AVStream.codecparAnton Khirnov2016-02-231-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, AVStream contains an embedded AVCodecContext instance, which is used by demuxers to export stream parameters to the caller and by muxers to receive stream parameters from the caller. It is also used internally as the codec context that is passed to parsers. In addition, it is also widely used by the callers as the decoding (when demuxer) or encoding (when muxing) context, though this has been officially discouraged since Libav 11. There are multiple important problems with this approach: - the fields in AVCodecContext are in general one of * stream parameters * codec options * codec state However, it's not clear which ones are which. It is consequently unclear which fields are a demuxer allowed to set or a muxer allowed to read. This leads to erratic behaviour depending on whether decoding or encoding is being performed or not (and whether it uses the AVStream embedded codec context). - various synchronization issues arising from the fact that the same context is used by several different APIs (muxers/demuxers, parsers, bitstream filters and encoders/decoders) simultaneously, with there being no clear rules for who can modify what and the different processes being typically delayed with respect to each other. - avformat_find_stream_info() making it necessary to support opening and closing a single codec context multiple times, thus complicating the semantics of freeing various allocated objects in the codec context. Those problems are resolved by replacing the AVStream embedded codec context with a newly added AVCodecParameters instance, which stores only the stream parameters exported by the demuxers or read by the muxers.
* | avformat/rtpenc: Fix integer overflow in NTP_TO_RTP_FORMATBoris Nagels2016-03-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | RTCP synchronization packet was broken since commit in ffmpeg version > 2.8.3 (commit: e04b039b1528f4c7df5c2b93865651bfea168a19) Since this commit (2e814d0329aded98c811d0502839618f08642685) "rtpenc: Simplify code by introducing a macro for rescaling NTP timestamps", NTP_TO_RTP_FORMAT uses av_rescale_rnd() function to add the data to the packet. This causes an overflow in the av_rescale_rnd() function and it will return INT64_MIN. Causing the NTP stamp in the RTCP packet to have an invalid value. Github: Closes #182 Reverting commit '2e814d0329aded98c811d0502839618f08642685' solves the problem.
* | Revert "avformat/rtpenc: check av_packet_get_side_data() return, fix null ↵Michael Niedermayer2015-06-031-4/+0
| | | | | | | | | | | | | | | | | | ptr dereference" This was simply wrong Found-by: Martin Storsjö This reverts commit 5d8e4f6da03c0342157e6ac7fab1a8ac3a87a8b0.
* | Merge commit '1a3eb042c704dea190c644def5b32c9cee8832b8'Michael Niedermayer2015-04-201-3/+3
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '1a3eb042c704dea190c644def5b32c9cee8832b8': Replace av_dlog with normal av_log at trace level Conflicts: ffplay.c libavdevice/fbdev_dec.c libavfilter/avfilter.c libavfilter/internal.h libavfilter/setpts.c libavfilter/src_movie.c libavfilter/vf_crop.c libavfilter/vf_drawtext.c libavfilter/vf_fieldorder.c libavformat/assdec.c libavformat/avidec.c libavformat/flvdec.c libavformat/http.c libavformat/ipmovie.c libavformat/isom.c libavformat/mov.c libavformat/mpegenc.c libavformat/mpegts.c libavformat/mpegtsenc.c libavformat/mux.c libavformat/mxfdec.c libavformat/nsvdec.c libavformat/oggdec.c libavformat/r3d.c libavformat/rtspdec.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Replace av_dlog with normal av_log at trace levelVittorio Giovara2015-04-191-3/+3
| | | | | | | | This applies to every library where performance is not critical.
* | Merge commit '4f6cd883f06f7893a2b60a41e7a4f8ae633dac2f'Michael Niedermayer2015-03-011-45/+16
|\ \ | |/ | | | | | | | | | | * commit '4f6cd883f06f7893a2b60a41e7a4f8ae633dac2f': rtpenc: Don't set max_frames_per_packet based on the packet frame size or frame rate Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtpenc: Don't set max_frames_per_packet based on the packet frame size or ↵Martin Storsjö2015-02-281-45/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge commit 'd4c7fc02f9f59e721e76debf4a595df529707545'Michael Niedermayer2015-03-011-4/+0
|\ \ | |/ | | | | | | | | | | * commit 'd4c7fc02f9f59e721e76debf4a595df529707545': rtpenc: Skip redundant initialization Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtpenc: Skip redundant initializationMartin Storsjö2015-02-281-4/+0
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'f8c01257f93ceda3e03bc4e540a51022d1e2bff2'Michael Niedermayer2015-03-011-10/+11
|\ \ | |/ | | | | | | | | | | * commit 'f8c01257f93ceda3e03bc4e540a51022d1e2bff2': rtpenc: Always do the default initialization regardless of codecs Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtpenc: Always do the default initialization regardless of codecsMartin Storsjö2015-02-281-10/+11
| | | | | | | | | | | | | | | | 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>
* | Merge commit '11edeaea3293c41ecf577a330422eabba35f76a2'Michael Niedermayer2015-03-011-1/+0
|\ \ | |/ | | | | | | | | | | * commit '11edeaea3293c41ecf577a330422eabba35f76a2': rtpenc_xiph: Don't exclude headers from max_payload_size Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtpenc_xiph: Don't exclude headers from max_payload_sizeMartin Storsjö2015-02-281-1/+0
| | | | | | | | | | | | | | 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>
* | Merge commit '1fc64e2e07787bbca82a72c146588e850e6d098a'Michael Niedermayer2015-03-011-1/+2
|\ \ | |/ | | | | | | | | | | * commit '1fc64e2e07787bbca82a72c146588e850e6d098a': rtpenc: Write conditional statements on separate lines Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtpenc: Write conditional statements on separate linesMartin Storsjö2015-02-281-1/+2
| | | | | | | | | | | | | | Intentionally keeping some conditional statements on single lines in rtpenc_h263.c. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '0662440b991361fdb5e732712d997a73e4692e34'Michael Niedermayer2015-03-011-0/+2
|\ \ | |/ | | | | | | | | | | * commit '0662440b991361fdb5e732712d997a73e4692e34': rtpenc_aac: Set a default value for max_frames_per_packet at init Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtpenc_aac: Set a default value for max_frames_per_packet at initMartin Storsjö2015-02-281-0/+2
| | | | | | | | | | | | | | This avoids having to conditionally set the default within the packetizer function. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'c82bf15dca00f67a701d126e47ea9075fc9459cb'Michael Niedermayer2015-02-241-2/+2
|\ \ | |/ | | | | | | | | | | | | | | | | * commit 'c82bf15dca00f67a701d126e47ea9075fc9459cb': rtpenc: Merge the h264 and hevc packetizers Conflicts: libavformat/rtpenc_hevc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtpenc: Merge the h264 and hevc packetizersMartin Storsjö2015-02-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge commit 'a505c0d7373336a4cc5aa2022111c46bdd388b1f'Michael Niedermayer2014-12-191-2/+13
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'a505c0d7373336a4cc5aa2022111c46bdd388b1f': rtp: Initial H.261 support Conflicts: Changelog libavformat/rtpdec_h261.c libavformat/rtpenc_h261.c libavformat/sdp.c libavformat/version.h See: 50a4d5cfc6749932347ee38c25b5040aea4b13a0 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtp: Initial H.261 supportThomas Volkert2014-12-181-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The packetizer only supports splitting at GOB headers - if such aren't available frequently enough, it splits at any random byte offset (not at a macroblock boundary either, which would be allowed by the spec) and sends a payload header pretend that it starts with a GOB header. As long as a receiver doesn't try to handle such cases cleverly but just drops broken frames, this shouldn't matter too much in practice. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'adc214e6797750285a5e62634b8521db521162ad'Michael Niedermayer2014-12-191-0/+3
|\ \ | |/ | | | | | | | | | | * commit 'adc214e6797750285a5e62634b8521db521162ad': rtpenc: Avoid brittle switch fallthroughs Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtpenc: Avoid brittle switch fallthroughsMartin Storsjö2014-12-181-0/+3
| | | | | | | | | | | | | | | | | | Instead explicitly jump to the default case in the cases where it is wanted, and avoid fallthrough between different codecs, which could easily introduce bugs if people editing the code aren't careful. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '42181740a3972e17d0097d28fabc9a1a60322d47'Michael Niedermayer2014-12-181-0/+1
|\ \ | |/ | | | | | | | | | | * commit '42181740a3972e17d0097d28fabc9a1a60322d47': rtpenc: Set the AVFMT_TS_NONSTRICT flag Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtpenc: Set the AVFMT_TS_NONSTRICT flagMartin Storsjö2014-12-181-0/+1
| | | | | | | | | | | | | | | | In particular, when packetizing mpegts into rtp, the input packet timestamp may come from more than one stream, which could cause multiple packets be written with the same timestamp. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '01f251c44d83eedc819625d2caac9ff9697a085d'Michael Niedermayer2014-12-181-0/+1
|\ \ | |/ | | | | | | | | | | * commit '01f251c44d83eedc819625d2caac9ff9697a085d': rtpenc: Set the timestamp properly when sending mpegts data, too Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtpenc: Set the timestamp properly when sending mpegts data, tooMartin Storsjö2014-12-181-0/+1
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit 'ddf5fb71ee9c8b2d9a23c0f661a84896cd7050fc'Michael Niedermayer2014-09-251-3/+5
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | * commit 'ddf5fb71ee9c8b2d9a23c0f661a84896cd7050fc': rtpenc: HEVC/H.265 support Conflicts: Changelog libavformat/rtpenc.c libavformat/rtpenc_hevc.c libavformat/version.h See: 6821a5a4adcb40c458356e8bb90416dd8f5dd6b2 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rtpenc: HEVC/H.265 supportThomas Volkert2014-09-241-0/+13
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>