summaryrefslogtreecommitdiff
path: root/libavformat/oggenc.c
Commit message (Collapse)AuthorAge
* lavf: replace AVStream.codec with AVStream.codecparAnton Khirnov2016-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* ogg: check memory allocationsFederico Tomassetti2015-02-15
| | | | | | | Bug-Id: CID 1257795 CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* avformat: Don't anonymously typedef structsDiego Biurrun2015-02-14
|
* ogg: Provide an option to offset the serial numberLuca Barbato2015-02-01
| | | | | The ogg serial number doubles as codec id and sequence value for concatenated samples.
* oggenc: accept only STREAMINFO extradataAnton Khirnov2014-11-06
| | | | | The reasoning is the same as for 0097cbea695e534fce39958ccd103af2fbf65831.
* oggenc: remove unneeded null checkMichael Niedermayer2014-10-29
| | | | | | | The code would have segfaulted before if oggstream were NULL. CC: libav-stable@libav.org Bug-Id: CID 732218
* lavf: use initial_padding instead of deprecated delayAnton Khirnov2014-10-13
|
* ogg: Use separate classes for the aliasesLuca Barbato2014-08-23
| | | | Unbreak 051aadeed104ecbe8ee4850ec2d7e5394f5e1ccd
* ogg: Provide aliases for Speex, Opus and audio-only oggLuca Barbato2014-08-22
| | | | Since they are aliases for ogg enabling any of them enables ogg as well.
* lavf: switch to AVStream.time_base as the hint for the muxer timebaseAnton Khirnov2014-06-18
| | | | | | | | | | | | Previously, AVStream.codec.time_base was used for that purpose, which was quite confusing for the callers. This change also opens the path for removing AVStream.codec. The change in the lavf-mkv test is due to the native timebase (1/1000) being used instead of the default one (1/90000), so the packets are now sent to the crc muxer in the same order in which they are demuxed (previously some of them got reordered because of inexact timestamp conversion).
* oggenc: Set the right AVOption size for the pref_duration optionMartin Storsjö2014-06-06
| | | | | | | | | | | | | | | On big endian machines, the default value set via the faulty AVOption ended up as 2^32 times too big. This fixes the fate-lavf-ogg test which currently is broken on big endian machines, broken since 3831362. Since that commit, a final zero-sized packet is written to the ogg muxer in that test, which caused different flushing behaviour on little and big endian depending on whether the pref_duration option was handled as it should or not. CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* oggenc: Support flushing the muxerMartin Storsjö2014-06-04
| | | | | | | | | This allows the caller to write all buffered data to disk, allowing the caller to know at what byte position in the file a certain packet starts (any packet written after the flush will be located after that byte position). Signed-off-by: Martin Storsjö <martin@martin.st>
* oggenc: Fix the EOS flagMichael Niedermayer2014-05-28
| | | | | | | | | | | This corrects the bug that caused the checksums to change in 9767d7c092c890ecc5953452e8a951fd902dd67b. It caused the EOS flag to be set incorrectly; the ogg spec does not allow it to be set in the middle of a logical bitstream. Signed-off-by: Andrew Kelley <superjoe30@gmail.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* vorbiscomment: simplify API by using av_dict_count()Anton Khirnov2014-05-28
|
* oggenc: Flush after writing headersAndrew Kelley2014-05-27
| | | | | | | | | | | | | Before, header information for ogg format files was sent with the first encoded packet. This patch makes it so that it is possible for API users to differentiate between headers and encoded audio. This is useful, for example, when creating an audio stream where you want to send one set of headers for every client that connects and then the encoded stream of audio. Signed-off-by: Martin Storsjö <martin@martin.st>
* oggenc: Move ogg_write_pages up above ogg_write_headerAndrew Kelley2014-05-27
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: add AVFMT_FLAG_BITEXACT.Anton Khirnov2014-05-15
| | | | | | | | Use it instead of checking CODEC_FLAG_BITEXACT in the first stream's codec context. Using codec options inside lavf is fragile and can easily break when the muxing codec context is not the encoding context.
* lavf: default .ogg audio to libvorbis if we canAndrew Kelley2014-02-09
| | | | | | | | | | | | Since 2007, the Xiph.org Foundation recommends that .ogg only be used for Ogg Vorbis audio files. Source: http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions However we only do it if we have libvorbis available because the built in vorbis encoder is not as good. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* Add missing #includes for *INT64_MAX and *INT64_CDiego Biurrun2013-11-23
|
* lavf: introduce AVFMT_TS_NEGATIVELuca Barbato2013-04-25
| | | | | | | | | | Most formats do not support negative timestamps, shift them to avoid unexpected behaviour and a number of bad crashes. CC:libav-stable@libav.org Signed-off-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* oggenc: add a page_duration option and deprecate the pagesize optionJustin Ruggles2013-01-08
| | | | | | | | | | | This uses page duration instead of byte size to determine when to buffer the page. Also, it tries to avoid continued pages by buffering the current page if there are already packets in the page and adding the next packet would require it to be continued on a new page. This can improve seeking performance. The default page duration is 1 second, which is much saner than filling all page segments by default.
* Add Opus support to the Ogg muxer.Nathan Caldwell2012-09-27
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* avopt: Store defaults for AV_OPT_TYPE_INT in the i64 union memberMartin Storsjö2012-09-04
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* Replace all CODEC_ID_* with AV_CODEC_ID_*Anton Khirnov2012-08-07
|
* oggenc: fix condition when not to flush due to keyframe granule.Reimar Döffinger2012-03-30
| | | | | | | | | | | | | | The previous condition of 0 page size was wrong, that would disable the mechanism for all frames at a start of a page, thus some keyframes still would not get their own granule. The real problem is that header packets must not be flushed, but they have (and must have) 0 granule and thus would be detected as keyframes. Add a separate parameter to mark header packets. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de> Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
* oggenc: add pagesize option to set preferred page sizeAndres Gonzalez2012-03-30
| | | | | | | | When set, if an Ogg stream buffer has enough data, a page is made instead of filling maximum-size pages. Using smaller pages results smaller seek intervals at the expense of higher container overhead. Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
* oggenc: free comment header for all codecsJustin Ruggles2012-02-24
| | | | | | fixes a memleak for Vorbis and Theora, where the comment header from avpriv_split_xiph_headers() is replaced by a buffer that must be freed separately.
* lavf: make av_set_pts_info private.Anton Khirnov2011-11-30
| | | | It's supposed to be called only from (de)muxers.
* Replace vendor string in Ogg and FLAC muxers.Diego Biurrun2011-11-02
|
* lavc: use avpriv_ prefix for ff_split_xiph_headers.Anton Khirnov2011-10-20
| | | | It's used in lavf.
* lavc: use avpriv_ prefix for some flac symbols used in lavf.Anton Khirnov2011-10-20
| | | | | Specifically, ff_flac_parse_streaminfo, ff_flac_is_extradata_valid and ff_flac_parse_block_header
* lavf: use designated initialisers for all (de)muxers.Anton Khirnov2011-07-17
| | | | It's more readable and less prone to breakage.
* Do not include mathematics.h in avutil.hMans Rullgard2011-07-03
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* Remove all uses of now deprecated metadata functions.Anton Khirnov2011-06-08
|
* avio: avio_ prefix for url_close_dyn_bufAnton Khirnov2011-04-03
|
* avio: avio_ prefix for url_open_dyn_bufAnton Khirnov2011-04-03
|
* avio: make get_checksum() internal.Anton Khirnov2011-03-30
|
* avio: make init_checksum() internal.Anton Khirnov2011-03-30
|
* Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-19
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* avio: rename put_flush_packet -> avio_flushAnton Khirnov2011-03-16
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* avio: add avio_tell macro as a replacement for url_ftellAnton Khirnov2011-03-04
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* avio: avio_ prefix for url_fseekAnton Khirnov2011-03-01
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* lavf: use a new ffio_wfourcc macro instead of put_tag() where possibleAnton Khirnov2011-02-25
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* avio: avio: avio_ prefixes for put_* functionsAnton Khirnov2011-02-21
| | | | | | | | | | | | In the name of consistency: put_byte -> avio_w8 put_<type> -> avio_w<type> put_buffer -> avio_write put_nbyte will be made private put_tag will be merged with avio_put_str Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* avio: rename ByteIOContext to AVIOContext.Anton Khirnov2011-02-20
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* Prefix all _demuxer, _muxer, _protocol from libavformat and libavdevice.Diego Elio Pettenò2011-01-26
| | | | | This also lists the objects from those two libraries as internal (by adding the ff_ prefix) so that they can then be hidden via linker scripts.
* In ogg muxer, correctly mux VFR streams, fix issue #2398Baptiste Coudurier2011-01-05
| | | | Originally committed as revision 26229 to svn://svn.ffmpeg.org/ffmpeg/trunk
* vorbiscomment: convert metadata before computing the header's lengthAnton Khirnov2010-10-27
| | | | Originally committed as revision 25586 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Export metadata in the generic format. Deprecate old conversion API.Anton Khirnov2010-10-15
| | | | | | patch by Anton Khirnov anton _at_ khirnov _dot_ net Originally committed as revision 25493 to svn://svn.ffmpeg.org/ffmpeg/trunk
* vorbiscomment: change ff_vorbiscomment_write to take an AVMetadata**Anton Khirnov2010-10-14
| | | | | | patch by Anton Khirnov anton _at_ khirnov _dot_ net Originally committed as revision 25473 to svn://svn.ffmpeg.org/ffmpeg/trunk