summaryrefslogtreecommitdiff
path: root/libavcodec/utils.c
Commit message (Collapse)AuthorAge
* lavc: make avcodec_open2() fail when the timebase is not set for encodingAnton Khirnov2016-05-16
| | | | | Many encoders use it. There is also a divide by the timebase lower in this function, which would crash when it is not set.
* lavc: introduce a new decoding/encoding API with decoupled input/outputwm42016-03-23
| | | | | | | | | | | | | | | | Until now, the decoding API was restricted to outputting 0 or 1 frames per input packet. It also enforces a somewhat rigid dataflow in general. This new API seeks to relax these restrictions by decoupling input and output. Instead of doing a single call on each decode step, which may consume the packet and may produce output, the new API requires the user to send input first, and then ask for output. For now, there are no codecs supporting this API. The API can work with codecs using the old API, and most code added here is to make them interoperate. The reverse is not possible, although for audio it might. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavc: factor apply_param_change() AV_EF_EXPLODE handlingwm42016-03-05
| | | | | | Remove the duplicated code for handling failure of apply_param_change(). Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavc: add a variant of av_get_audio_frame_duration working with ↵Anton Khirnov2016-02-23
| | | | AVCodecParameters
* lavc: add codec parameters APIAnton Khirnov2016-02-23
| | | | | | This API is intended to allow passing around codec parameters without using full AVCodecContext (which also contains codec options and encoder/decoder state).
* lavc: add a field for passing AVHWFramesContext to encodersAnton Khirnov2016-02-14
|
* lavc: Make sure that the effective timebase would not overflowArttu Ylä-Outinen2016-01-19
| | | | | | | In the unlikely situation the user decides to set ticks_per_frame and timebase to a value large enough to overflow. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* lavc: get the profile name through the codec descriptor in avcodec_string()Anton Khirnov2015-12-12
|
* lavc: add profiles to AVCodecDescriptorAnton Khirnov2015-12-12
| | | | | The profiles are a property of the codec, so it makes sense to export them through AVCodecDescriptors, not just the codec implementations.
* lavc: print the name of the codec, not its implementation, in avcodec_stringAnton Khirnov2015-12-12
|
* libopenh264enc: export CPB props side dataAnton Khirnov2015-12-06
|
* lavc: add a packet side data type for VBV-like parametersAnton Khirnov2015-12-06
|
* lavc: add stream-global packet side dataAnton Khirnov2015-12-06
| | | | This is similar to what is done for AVStream.
* avpacket: Replace av_free_packet with av_packet_unrefLuca Barbato2015-10-26
| | | | | | | `av_packet_unref` matches the AVFrame ref-counted API and can be used as a drop in replacement. Deprecate `av_free_packet`.
* utils: Use data buffers directly instead of an AVPictureVittorio Giovara2015-10-22
| | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* lavc: Add data and linesize to AVSubtitleRectVittorio Giovara2015-10-21
| | | | | | | | | | | | Use the new fields directly instead of the ones from AVPicture. This removes a layer of indirection which serves no pratical purpose whatsoever, and will help in removing AVPicture structure completely later. Every subtitle encoder/decoder seamlessly points to the new arrays, so it is possible to deprecate AVSubtitleRect.pict. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* avcodec: Do not lock during init if there is no init functionDerek Buitenhuis2015-10-13
| | | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* avcodec: Do not lock during open for codecs marked as having threadsafe initDerek Buitenhuis2015-10-04
| | | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* lavc: reimplement avcodec_get_type() using codec descriptorswm42015-09-28
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavc: allow asynchronous decoders to return correct pkt_dts valueswm42015-09-12
| | | | | | | | | | | | | | | The generic code in utils.c sets the AVFrame.pkt_dts field from the packet it was supposedly decoded. This does not have to be true for a fully asynchronous decoder like mmaldec. It could be overwritten with an incorrect value. Even if the decoder doesn't determine the DTS (but sets it to AV_NOPTS_VALUE), it's impossible to determine a correct value in utils.c. Decoders can now be marked with FF_CODEC_CAP_SETS_PKT_DTS, in which case utils.c won't overwrite the field. The decoders are expected to set this field (even if they only set it to AV_NOPTS_VALUE). Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* lavu: Drop deprecated duplicated AVFrame/AVCodecContext parametersVittorio Giovara2015-08-28
| | | | Deprecated in 10/2012.
* lavc: Drop deprecated get_buffer related functionsVittorio Giovara2015-08-28
| | | | Deprecated in 11/2012.
* lavc: Drop deprecated destruct_packet related functionsVittorio Giovara2015-08-28
| | | | Deprecated in 10/2012.
* lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-27
| | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* lavc: AV-prefix all codec capabilitiesVittorio Giovara2015-07-27
| | | | | | Express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* lavc: AV-prefix all codec flagsVittorio Giovara2015-07-27
| | | | | | Convert doxygen to multiline and express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* Deprecate avctx.coded_frameVittorio Giovara2015-07-20
| | | | | | | | | | | | | | | | | The rationale is that coded_frame was only used to communicate key_frame, pict_type and quality to the caller, as well as a few other random fields, in a non predictable, let alone consistent way. There was agreement that there was no use case for coded_frame, as it is a full-sized AVFrame container used for just 2-3 int-sized properties, which shouldn't even belong into the AVCodecContext in the first place. The appropriate AVPacket flag can be used instead of key_frame, while quality is exported with the new AVPacketSideData quality factor. There is no replacement for the other fields as they were unreliable, mishandled or just not used at all. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* Gather all coded_frame allocations and free functions to a single placeVittorio Giovara2015-07-20
| | | | | | | | | | | | | | Allocating coded_frame is what most encoders do anyway, so it makes sense to always allocate and free it in a single place. Moreover a lot of encoders freed the frame with av_freep() instead of the correct API av_frame_free(). This bring uniformity to encoder behaviour and prevents applications from erroneusly accessing this field when not allocated. Additionally this helps isolating encoders that export information with coded_frame, and heavily simplifies its deprecation. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* PCM signed 16-bit big-endian planar decoderPaul B Mahol2015-06-24
| | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avcodec: Free the default avoptions on init failureLuca Barbato2015-04-22
|
* avcodec: Unref the dummy buffer on the fail pathLuca Barbato2015-04-22
|
* lavc: Introduce AVCodec internal capabilitiesVittorio Giovara2015-03-13
| | | | | | | This field is designed for marking codec properties useful to lavc internals. Two internal capabilities are added: - FF_CODEC_CAP_INIT_THREADSAFE: codec can be opened without locks; - FF_CODEC_CAP_INIT_CLEANUP: codec frees memory if initialization fails.
* lavc: Improve thread locking error messageVittorio Giovara2015-03-13
|
* avcodec/utils: use correct printf specifier in ff_set_sarAndreas Cadhalpun2015-02-28
| | | | | Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavc: support extracting audio service type from side dataAnton Khirnov2015-01-27
|
* Add a side data type for audio service type.Anton Khirnov2015-01-27
| | | | | Currently, audio service type is a field in AVCodecContext. However, side data is more appropriate for this kind of information.
* lavc: add GBRAP to avcodec_align_dimensions2Paul B Mahol2015-01-14
|
* avcodec: add AVCodecContext.sw_pix_fmtRémi Denis-Courmont2014-12-25
| | | | | | | | This carries the pixel format that would be used if it were not for hardware acceleration. This is equal to AVCodecContext.pix_fmt if hardware acceleration is not in use. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavc: Compact the side-data passthroughLuca Barbato2014-11-09
|
* hwaccel: Deinitialize hardware acceleration early enoughRémi Denis-Courmont2014-11-04
| | | | | | | | | | | The application will destroy the underlying hardware handles when get_format() gets called again. Also this ensures the deinitialization takes place if the get_format callback returns an error. Regression from 1c80c9d7ef809180042257200c7b5f6b81d0b0e2. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* dump: display codec tags when availableVittorio Giovara2014-10-17
| | | | For both audio and video.
* lavc: deprecate the use of AVCodecContext.time_base for decodingAnton Khirnov2014-10-15
| | | | | | | | | | | When decoding, this field holds the inverse of the framerate that can be written in the headers for some codecs. Using a field called 'time_base' for this is very misleading, as there are no timestamps associated with it. Furthermore, this field is used for a very different purpose during encoding. Add a new field, called 'framerate', to replace the use of time_base for decoding.
* lavc: use a separate field for exporting audio encoder paddingAnton Khirnov2014-10-13
| | | | | | | | | | | | | | Currently, the amount of padding inserted at the beginning by some audio encoders, is exported through AVCodecContext.delay. However - the term 'delay' is heavily overloaded and can have multiple different meanings even in the case of audio encoding. - this field has entirely different meanings, depending on whether the codec context is used for encoding or decoding (and has yet another different meaning for video), preventing generic handling of the codec context. Therefore, add a new field -- AVCodecContext.initial_padding. It could conceivably be used for decoding as well at a later point.
* dump: print the original coded dimensions when availableVittorio Giovara2014-10-08
|
* dump: print detailed color space informationVittorio Giovara2014-10-08
|
* dump: split audio and video probing on multiple linesVittorio Giovara2014-10-08
| | | | Also always report pixel format.
* avcodec: make sure color_range is properly initializedVittorio Giovara2014-10-08
|
* ff_get_format: fix infinite loopRémi Denis-Courmont2014-10-06
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavc: specify the behavior of av_lockmgr_register on failure.Manfred Georg2014-10-06
| | | | | | | | | | | The register function now specifies that the user callback should leave things in the same state that it found them on failure but that failure to destroy is ignored by the library. The register function is now explicit about its behavior on failure (it unregisters the previous callback and destroys all mutex). Signed-off-by: Manfred Georg <mgeorg@google.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* hwaccel: Call ->get_format again if hwaccel init failsRémi Denis-Courmont2014-09-26
| | | | | | | This allows the application to fall back on another hwaccel or, more likely, software decoding. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>