Commit Graph

27 Commits

Author SHA1 Message Date
wm4 47399ccdfd lavc, lavu: move frame cropping to a convenience function
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2017-07-26 23:20:40 +02:00
wm4 04f3bd3496 AVFrame: add an opaque_ref field
This is an extended version of the AVFrame.opaque field, which can be
used to attach arbitrary user information to an AVFrame.

The usefulness of the opaque field is rather limited, because it can
store only up to 32 bits of information (or 64 bit on 64 bit systems).
It's not possible to set this field to a memory allocation, because
there is no way to deallocate it correctly.

The opaque_ref field circumvents this by letting the user set an
AVBuffer, which makes the user data refcounted.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2017-02-11 11:37:45 +01:00
Anton Khirnov 4de220d2e3 frame: allow align=0 (meaning automatic) for av_frame_get_buffer()
This will avoid every caller from hardcoding some specific alignment,
which may break in the future with new instruction sets.
2017-02-11 11:37:45 +01:00
Anton Khirnov 52627248e4 frame: add a cropping rectangle to AVFrame
Extend the width/height doxy to clarify that it should store coded
values.
2017-01-12 16:22:44 +01:00
Anton Khirnov 32c8359093 lavc: export the timestamps when decoding in AVFrame.pts
Currently it's exported as AVFrame.pkt_pts, which is also the only use
for that field. The reason it is done like this is that lavc used to
export various codec-specific "timing" information in AVFrame.pts, which
is not done anymore.

Since it is confusing to the callers to have a separate field which is
used only for decoder timestamps and nothing else, deprecate pkt_pts and
use just AVFrame.pts everywhere.
2016-06-21 19:54:42 +02:00
Diego Biurrun 29c2d06d67 cosmetics: Drop empty comment lines 2016-02-18 15:35:30 +01:00
Anton Khirnov 89923e418b lavu: add a framework for handling hwaccel frames 2016-02-14 21:36:59 +01:00
Clément Bœsch e8bc642202 lavu: add AV_CEIL_RSHIFT and use it in various places
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-01-11 15:32:56 -05:00
Vittorio Giovara 1aa24df74c lavu: Deprecate AVFrame.error[]
These field are difficult to interpret, and are provided by a single
encoder (mpegvideoenc). In general they do not belong to a structure
containing raw data only, so remove them from AVFrame.

Mpegvideoenc now uses a private field in Picture for its internal
computations.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-09-30 16:44:33 +02:00
Luca Barbato 5d839778b9 lavu: Refactor side data wiping
And make sure the nb_side_data field is reset as well.

Based on an initial patch from wm4 <nfxjfg@googlemail.com>.

CC: libav-stable@libav.org
2014-12-18 23:22:59 +01:00
Diego Biurrun e070d0a5ca frame: Remove some FF_API_AVFRAME_COLORSPACE leftovers 2014-08-14 00:44:47 -07:00
Anton Khirnov 472f9ed312 Remove obsolete FF_API_AVFRAME_COLORSPACE cruft. 2014-08-09 16:59:13 +00:00
Roman Savchenko 44671b5786 AVFrame: factor out freeing the side data
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-06-18 08:11:05 +02:00
wm4 8c02adc62d lavu: add all color-related enums to AVFrame
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-06-01 08:22:02 +02:00
Roman Savchenko a53551cba8 frame: fix the error path in av_frame_copy_props()
First free metadata, then the side data it is contained in.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-05-29 07:59:56 +02:00
Anton Khirnov d161ae0a37 frame: add a function for removing side data from a frame 2014-03-24 06:07:51 +01:00
Anton Khirnov 1155fd02ae frame: add a convenience function for copying AVFrame data 2014-02-24 07:25:07 +01:00
Anton Khirnov df7aba52b5 frame: cosmetics, reindent 2013-12-09 08:45:08 +01:00
Anton Khirnov c342132fa8 frame: copy flags in av_frame_copy_props()
Flags can be considered metadata (at least those that are defined now).
2013-12-09 08:45:01 +01:00
Vittorio Giovara 529a9893d7 avframe: mark source frame const in _ref and _clone
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-10-27 21:32:37 +01:00
Vittorio Giovara 3c8bff0740 avframe: have av_frame_get_side_data take const AVFrame*
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-08-01 09:41:45 +02:00
Anton Khirnov e6c4ac7b5f pixdesc: rename PIX_FMT_* flags to AV_PIX_FMT_FLAG_* 2013-05-15 07:46:51 +02:00
Hendrik Leppkes 1e8b9738fa avutil/frame: add all remaining frame properties to av_frame_copy_props
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-03-22 20:05:37 +01:00
Janne Grunau fc8406d01e avframe: copy reordered_opaque in copy_props
Fixes video playback in applications still using reordered_opaque.
2013-03-11 13:29:39 +01:00
Anton Khirnov 0651e892e1 Replace remaining includes of audioconvert.h with channel_layout.h 2013-03-08 07:42:13 +01:00
Anton Khirnov 77b2cd7b41 AVFrame: add side data. 2013-03-08 07:37:01 +01:00
Anton Khirnov 7ecc2d403c Move AVFrame from lavc to lavu.
Add AVBuffer-based reference counting API to it.
2013-03-08 07:36:15 +01:00