Commit Graph

183 Commits

Author SHA1 Message Date
Guo, Yejun
f1bf465aa0 lavu: add side data AV_FRAME_DATA_DETECTION_BBOXES for object detection/classification 2021-04-17 17:27:02 +08:00
Andreas Rheinhardt
416cc012f6 avutil/frame: Return 0 on success in av_frame_ref()
av_frame_copy() is allowed to return values >= 0 on success, whereas
the documentation of av_frame_ref() states that the return value is 0 on
success. Ergo the latter must not just return the former's return value.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-05 18:36:51 +02:00
Andreas Rheinhardt
a77beea6c8 avutil/frame: Deprecate av_get_colorspace_name()
Contrary to av_color_space_name() it doesn't even support newer
colorspaces.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-03-24 08:00:57 +01:00
James Almer
dbd47b7990 avutil/frame: change av_frame_new_side_data() size parameter type to size_t
Signed-off-by: James Almer <jamrial@gmail.com>
2021-03-10 20:26:36 -03:00
Lynne
4f9ee87253
libavutil: introduce AVFilmGrainParams side data
This patch introduces a new frame side data type AVFilmGrainParams for use
with video codecs which support it.

It can save a lot of memory used for duplicate processed reference frames and
reduce copies when applying film grain during presentation.
2020-11-25 23:06:33 +01:00
Gil Pedersen
7ac1dc2364 avutil/frame: fix potential leaks in av_frame_ref()
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-11-19 10:12:58 -03:00
Gil Pedersen
2b6b19dd9b avutil/frame: use av_buffer_replace() to simplify code
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Gil Pedersen <git@gpost.dk>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-11-19 10:09:47 -03:00
Brian Kim
fccbd1245f libavutil/frame: avoid UB when getting plane sizes
This uses av_image_fill_plane_sizes instead of av_image_fill_pointers
when we are getting plane sizes to avoid UB from adding offsets to NULL.

Signed-off-by: Brian Kim <bkkim@google.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-07-22 11:42:54 -03:00
Limin Wang
bc8ab084fb avutil: add AV_FRAME_DATA_SEI_UNREGISTERED side data type
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-06-11 13:06:31 +08:00
Anton Khirnov
f30a41a608 Stop hardcoding align=32 in av_frame_get_buffer() calls.
Use 0, which selects the alignment automatically.
2020-05-22 14:38:57 +02:00
Juan De León
991d417692 libavutil: add API for exporting video frame quantizers
This is intended to replace the deprecated the AV_FRAME_DATA_QP_TABLE*
API and extend it to a wider range of codecs.

In the future, it may also be extended to support other encoding
parameters such as motion vectors.

Additional changes by Anton Khirnov <anton@khirnov.net> with suggestions
by Lynne <dev@lynne.ee>.

Signed-off-by: Juan De León <juandl@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2020-05-12 09:37:47 +02:00
Timo Rothenpieler
77d5ea1c7c avutil/frame: make frame copy functions hwframe aware 2020-03-28 17:59:32 +01:00
Zhao Zhili
20c5f4d835 avutil/frame: fix remove_side_data
remove_side_data is supposed to remove a single instance by design.
Since new_side_data() doesn't forbid add multiple instances of the
same type, remove_side_data should deal with that.

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-11-11 22:15:45 +01:00
Guo, Yejun
1ef4828276 avutil: add ROI (Region Of Interest) data struct and bump version
The encoders such as libx264 support different QPs offset for different MBs,
it makes possible for ROI-based encoding. It makes sense to add support
within ffmpeg to generate/accept ROI infos and pass into encoders.

Typical usage: After AVFrame is decoded, a ffmpeg filter or user's code
generates ROI info for that frame, and the encoder finally does the
ROI-based encoding.

The ROI info is maintained as side data of AVFrame.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2019-01-17 21:47:11 +00:00
Mohammad Izadi
2744d6b364 Add HDR dynamic metadata struct (for SMPTE 2094-40) to libavutil
The dynamic metadata contains data for color volume transform -
application 4 of SMPTE 2094-40:2016 standard. The data comes from
HEVC in the SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2018-12-21 17:52:00 +01:00
Jun Zhao
f3bcb9c16a lavu/frame: Add error report if av_image_fill_pointers fail.
Add error handle if av_image_fill_pointers fail.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
2018-10-30 13:17:09 +08:00
Devin Heitmueller
4241e44a3c lavc/h264: create AVFrame side data from H.264 timecodes
Create SMPTE ST 12-1 timecodes based on H.264 SEI picture timing
info.

For framerates > 30 FPS, the field flag is used in conjunction with
pairs of frames which contain the same frame timestamp in S12M.
Ensure the field is properly set per the spec.
2018-10-23 15:46:30 +01:00
Jun Zhao
04cbaae2aa lavu/frame: Add missing conversions from side data enum to name
Add missing conversions from side data enum to name.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2018-09-21 18:09:26 +08:00
James Almer
8822e2b954 Merge commit 'f89ec87afaf0d1abb6d450253b0b348fd554533b'
* commit 'f89ec87afaf0d1abb6d450253b0b348fd554533b':
  frame: Simplify the video allocation

Merged-by: James Almer <jamrial@gmail.com>
Padding-Remixed-by: Michael Niedermayer <michael@niedermayer.cc>
2018-09-11 13:08:50 -03:00
Luca Barbato
f89ec87afa frame: Simplify the video allocation 2018-08-05 22:45:08 +02:00
Vittorio Giovara
c9fcdac118 Use the same name for stereo3d frame/packet side data 2018-06-05 21:47:59 -04:00
wm4
d6fc031caf avutil/pixdesc: deprecate AV_PIX_FMT_FLAG_PSEUDOPAL
PSEUDOPAL pixel formats are not paletted, but carried a palette with the
intention of allowing code to treat unpaletted formats as paletted. The
palette simply mapped the byte values to the resulting RGB values,
making it some sort of LUT for RGB conversion.

It was used for 1 byte formats only: RGB4_BYTE, BGR4_BYTE, RGB8, BGR8,
GRAY8. The first 4 are awfully obscure, used only by some ancient bitmap
formats. The last one, GRAY8, is more common, but its treatment is
grossly incorrect. It considers full range GRAY8 only, so GRAY8 coming
from typical Y video planes was not mapped to the correct RGB values.
This cannot be fixed, because AVFrame.color_range can be freely changed
at runtime, and there is nothing to ensure the pseudo palette is
updated.

Also, nothing actually used the PSEUDOPAL palette data, except xwdenc
(trivially changed in the previous commit). All other code had to treat
it as a special case, just to ignore or to propagate palette data.

In conclusion, this was just a very strange old mechnaism that has no
real justification to exist anymore (although it may have been nice and
useful in the past). Now it's an artifact that makes the API harder to
use: API users who allocate their own pixel data have to be aware that
they need to allocate the palette, or FFmpeg will crash on them in
_some_ situations. On top of this, there was no API to allocate the
pseuo palette outside of av_frame_get_buffer().

This patch not only deprecates AV_PIX_FMT_FLAG_PSEUDOPAL, but also makes
the pseudo palette optional. Nothing accesses it anymore, though if it's
set, it's propagated. It's still allocated and initialized for
compatibility with API users that rely on this feature. But new API
users do not need to allocate it. This was an explicit goal of this
patch.

Most changes replace AV_PIX_FMT_FLAG_PSEUDOPAL with FF_PSEUDOPAL. I
first tried #ifdefing all code, but it was a mess. The FF_PSEUDOPAL
macro reduces the mess, and still allows defining FF_API_PSEUDOPAL to 0.

Passes FATE with FF_API_PSEUDOPAL enabled and disabled. In addition,
FATE passes with FF_API_PSEUDOPAL set to 1, but with allocation
functions manually changed to not allocating a palette.
2018-04-03 17:53:00 +02:00
wm4
4b86ac27a0 lavu/frame: add QP side data
This adds a way for an API user to transfer QP data and metadata without
having to keep the reference to AVFrame, and without having to
explicitly care about QP APIs. It might also provide a way to finally
remove the deprecated QP related fields. In the end, the QP table should
be handled in a very similar way to e.g. AV_FRAME_DATA_MOTION_VECTORS.

There are two side data types, because I didn't care about having to
repack the QP data so the table and the metadata are in a single
AVBufferRef. Otherwise it would have either required a copy on decoding
(extra slowdown for something as obscure as the QP data), or would have
required making intrusive changes to the codecs which support export of
this data.

The new side data types are added under deprecation guards, because I
don't intend to change the status of the QP export as being deprecated
(as it was before this patch too).
2018-03-18 12:36:24 +01:00
wm4
36855abc0e lavu/frame: fix inconsistent qp_table_buf deprecation
Everything related to the QP data is deprecated, with qp_table_buf being
an inconsistent exception. Some parts were under the deprecation guards,
some not. It probably didn't even compile.
2018-03-18 12:36:24 +01:00
Rostislav Pehlivanov
6731f60598 frame: add an av_frame_new_side_data_from_buf function
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2018-03-01 20:37:18 +00:00
Michael Niedermayer
1fa3a9a31d avutil/frame: Add private_ref to AVFrame
This gives FFmpeg libs a field that they can freely and safely use.
Avoiding the need of wrapping of a users opaque_ref field and its issues.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-11-10 16:44:17 +01:00
James Almer
7df37dd319 avutil/frame: deprecate getters and setters for AVFrame fields
The fields can be accessed directly, so these are not needed anymore.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-10-29 10:16:44 -03:00
James Almer
8c2b829123 avutil/frame: remove unneccessary metadata pointer getter
Signed-off-by: James Almer <jamrial@gmail.com>
2017-10-23 10:58:00 -03:00
James Almer
7aa6b8a68f Merge commit '4de220d2e3751c459f8739a08ac6ca52e63eba30'
* commit '4de220d2e3751c459f8739a08ac6ca52e63eba30':
  frame: allow align=0 (meaning automatic) for av_frame_get_buffer()

See https://ffmpeg.org/pipermail/ffmpeg-devel/2017-September/215834.html

Merged-by: James Almer <jamrial@gmail.com>
2017-09-27 23:31:53 -03:00
wm4
caa12027ba lavc, lavu: move frame cropping to a convenience function
Signed-off-by: Anton Khirnov <anton@khirnov.net>

Merged from Libav commit 47399ccdfd.
2017-08-08 13:35:09 +02:00
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
James Almer
4cebf0fc45 avutil/frame: add ICC Profile to av_frame_side_data_name
Reviwed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-07-26 11:31:17 -03:00
James Almer
a47bd5d77e Merge commit '52627248e49e58eb4b78e4fcda90a64f4c476ea3'
* commit '52627248e49e58eb4b78e4fcda90a64f4c476ea3':
  frame: add a cropping rectangle to AVFrame

Merged-by: James Almer <jamrial@gmail.com>
2017-05-08 13:08:02 -03:00
Steve Lhomme
b378f5bd64 lavu: add support for Content Light Level side metadata
As found in HEVC.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-04-06 11:26:25 -03:00
Michael Niedermayer
55196e5d10 Revert "avutil/frame: Disallow zero sized frame side data"
Found a case where we use size==0, the other related commits
remain needed, and should be sufficient to fix the original issue

This reverts commit 7e4f32f4e4.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-03-03 01:03:29 +01:00
Michael Niedermayer
7e4f32f4e4 avutil/frame: Disallow zero sized frame side data
There should be no case that needs this and its a potential for
creating corner cases

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-25 22:02:23 +01:00
Michael Niedermayer
5804201cba avutil/frame: Reimplement av_frame_new_side_data() without size=0 special case
The size 0 special case causes side data to be created which is
different and a special case if for any reasons size = 0 is passed

Fixes: multiple runtime error: null pointer passed as argument 1, which is declared to never be null
Fixes: 653/clusterfuzz-testcase-5773837415219200

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-25 22:02:23 +01:00
wm4
e3af49b14b 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>

Merges Libav commit 04f3bd3496.
2017-02-13 08:01:20 +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
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
Marton Balint
d25769555b avutil/frame: fix av_frame_copy for unknown layouts
I wonder how unknown layouts ever worked without this?

Reviewed-by: Nicolas George <george@nsup.org>
Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2017-01-31 00:29:49 +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
Michael Niedermayer
721c90f0f9 avutil/frame: fix indention after last commit
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-16 21:25:45 +01:00
Michael Niedermayer
2acee08a4a avutil/frame: Copy size=0 side data in ff_init_buffer_info()
Fixes null pointer dereference
Fixes: 189/FOO

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-16 21:25:45 +01:00
Hendrik Leppkes
3f9137c57d Merge commit '32c8359093d1ff4f45ed19518b449b3ac3769d27'
* commit '32c8359093d1ff4f45ed19518b449b3ac3769d27':
  lavc: export the timestamps when decoding in AVFrame.pts

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-10-07 13:03:36 +02:00
Sasi Inguva
3cb400c11a avutil/frame: Add a flag to discard frame after decode.
Signed-off-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-19 19:51:13 +02:00
James Almer
fb91850fe1 avutil/frame: access avframe fields directly in get_frame_defaults()
The accessors are needed only from outside libavutil.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-07-25 17:37:18 -03: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
Michael Niedermayer
13aae86a2b avutil/frame: Assert that width/height/channels is 0 for the destination of av_frame*_ref()
This should detect caes where these functions are called in unclean destinations
2016-06-05 17:12:35 +02:00
Derek Buitenhuis
1a12eb4a73 Merge commit '29c2d06d67724e994980045afa055c6c34611b30'
* commit '29c2d06d67724e994980045afa055c6c34611b30':
  cosmetics: Drop empty comment lines

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-24 17:31:44 +00:00
Diego Biurrun
29c2d06d67 cosmetics: Drop empty comment lines 2016-02-18 15:35:30 +01:00
Derek Buitenhuis
1a708780f3 Merge commit '89923e418b494e337683442ab896d754bc07341a'
* commit '89923e418b494e337683442ab896d754bc07341a':
  lavu: add a framework for handling hwaccel frames

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-17 16:12:25 +00:00
Anton Khirnov
89923e418b lavu: add a framework for handling hwaccel frames 2016-02-14 21:36:59 +01:00
Michael Niedermayer
4099e4a77d avutil/frame: Free destination qp_table_buf in frame_copy_props()
Fixes memleak
Fixes: Ticket4899

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-13 20:57:26 +01:00
Derek Buitenhuis
66e9d2f44e avutil: Add GOP timecode frame side data
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-01 18:18:17 +00:00
Derek Buitenhuis
21f9468402 avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPAT
Libav, for some reason, merged this as a public API function. This will
aid in future merges.

A define is left for backwards compat, just in case some person
used it, since it is in a public header.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-27 16:36:46 +00:00
Neil Birkbeck
17399f6a9f Add missing conversions from side data enum to name
Add names for recently added enums to av_frame_side_data_name.

Signed-off-by: Neil Birkbeck <neil.birkbeck@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-22 01:58: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
Clément Bœsch
503d8bf74a lavu/frame: use AVPALETTE_SIZE instead of 1024 2015-12-08 17:50:40 +01:00
Hendrik Leppkes
5fa5e73e81 Merge commit '1aa24df74c052a73175c43e57d35b4835e537ec8'
* commit '1aa24df74c052a73175c43e57d35b4835e537ec8':
  lavu: Deprecate AVFrame.error[]

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-03 09:52:39 +02: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
Hendrik Leppkes
a991526832 lavu/frame: put frame QP elements under a new version guard
These fields are still used, removal postponed until a replacement functionality is available.
2015-09-05 17:35:31 +02:00
Hendrik Leppkes
b9fd813351 Merge commit '8f12ef9860d0e164e4647fd5d5cebdb3cfb34a79'
* commit '8f12ef9860d0e164e4647fd5d5cebdb3cfb34a79':
  lavu: Drop deprecated duplicated AVFrame/AVCodecContext parameters

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 17:31:45 +02:00
Andreas Cadhalpun
095347ffe4 disable deprecation warnings in deprecated code
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-08-22 19:16:14 +02:00
Michael Niedermayer
feb6a94f74 avutil/frame: fix crash with av_frame_unref(NULL)
Fixes: af94b3a3d26586c08f557cafe8246251_signal_sigsegv_7ffff713351a_343_XFMode.ASF with 2097152 alloc limit

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-13 19:26:44 +02:00
Ronald S. Bultje
589a6042ea avutil: make AVFrameSideData buffers ref-counted.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-25 12:04:00 +01:00
Ronald S. Bultje
b8e36690e8 lavu/frame: move av_frame_copy_props() up in the file.
Preparation for following patch.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-25 12:03:53 +01:00
Michael Niedermayer
bce06eb059 Merge commit '5d839778b9f3edb682b7f71dde4f80f07c75b098'
* commit '5d839778b9f3edb682b7f71dde4f80f07c75b098':
  lavu: Refactor side data wiping

Conflicts:
	libavutil/frame.c

See: a400edbb6d
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-19 03:57:59 +01: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
wm4
a400edbb6d lavu/frame: fix malloc error path in av_frame_copy_props()
The error path frees all side data, but forgets to reset the side data
count. This can blow up later in av_frame_unref() and free_side_data().

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-15 04:46:30 +01:00
Reimar Döffinger
d9e2aceb7f Add missing "const" all over the place.
Only "./configure --enable-gpl" on x86 was tested.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2014-08-29 18:57:25 +02:00
Clément Bœsch
b0352b1997 avcodec: export motion vectors in frame side data on demand
The reasoning behind this addition is that various third party
applications are interested in getting some motion information out of a
video "for free" when it is available.

It was considered to export other information as well (such as the intra
information about the block, or the quantization) but the structure
might have ended up into a half full-generic, half full of codec
specific cruft. If more information is necessary, it should either be
added in the "flags" field of the AVMotionVector structure, or in
another side-data.

This commit also includes an example exporting them in a CSV stream.
2014-08-18 14:13:57 +02:00
Diego Biurrun
e070d0a5ca frame: Remove some FF_API_AVFRAME_COLORSPACE leftovers 2014-08-14 00:44:47 -07:00
Carl Eugen Hoyos
788cf6f0c6 Remove panscan information in av_frame_copy_props() if resolution changes.
Fixes ticket #3750.
2014-08-10 22:31:33 +02:00
Michael Niedermayer
287602f9d8 Merge commit '472f9ed312ec784f7c72876b77163f4741880d05'
* commit '472f9ed312ec784f7c72876b77163f4741880d05':
  Remove obsolete FF_API_AVFRAME_COLORSPACE cruft.

Conflicts:
	libavcodec/utils.c
	libavutil/frame.h
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-10 01:29:24 +02:00
Anton Khirnov
472f9ed312 Remove obsolete FF_API_AVFRAME_COLORSPACE cruft. 2014-08-09 16:59:13 +00:00
Michael Niedermayer
ba3e3311ef avutil/frame: add av_frame_side_data_name()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-30 19:19:22 +02:00
Michael Niedermayer
40c9d43086 Merge commit '44671b57866aab8dd36715ff010e985e25baaf19'
* commit '44671b57866aab8dd36715ff010e985e25baaf19':
  AVFrame: factor out freeing the side data

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-18 12:53:42 +02: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
Michael Niedermayer
6e8e9f1e51 Merge commit '8c02adc62d71dfbb079a04753d8c16152c49de88'
* commit '8c02adc62d71dfbb079a04753d8c16152c49de88':
  lavu: add all color-related enums to AVFrame

Conflicts:
	libavcodec/avcodec.h
	libavutil/frame.c
	libavutil/frame.h
	libavutil/version.h

The version check is changed so they are available with the current ABI
FFmpeg libs should have no problems with added fields, nor should any
application using the libs, and we regularly added fields in the past.
We also moved 2 of these fields to AVFrame already previously without issues.

See: a80e622924
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-01 13:18:32 +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
Michael Niedermayer
879aa062f9 avutil/frame: frame_copy_video: support copying from a smaller to a larger frame
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-31 17:16:44 +02:00
Michael Niedermayer
d9c4f61dab Merge commit 'a53551cba86bb67efcb6105fdc337a36c43132bd'
* commit 'a53551cba86bb67efcb6105fdc337a36c43132bd':
  frame: fix the error path in av_frame_copy_props()

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-29 12:35: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
Michael Niedermayer
4615ff0d61 avutil/frame: use av_malloc(z)_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-15 13:51:48 +02:00
Michael Niedermayer
3e1f24131a Merge commit 'd161ae0a37900cbd36c1390ca32a56b892c02ab5'
* commit 'd161ae0a37900cbd36c1390ca32a56b892c02ab5':
  frame: add a function for removing side data from a frame

Conflicts:
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-24 14:51:44 +01:00
Anton Khirnov
d161ae0a37 frame: add a function for removing side data from a frame 2014-03-24 06:07:51 +01:00
Michael Niedermayer
74bb1ca82c avutil/frame_copy_audio: also check that channels match
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-24 10:12:33 +01:00
Michael Niedermayer
fff5262301 Merge commit '1155fd02ae7bac215acab316e847c6bb25f74fc3'
* commit '1155fd02ae7bac215acab316e847c6bb25f74fc3':
  frame: add a convenience function for copying AVFrame data

Conflicts:
	doc/APIchanges
	libavutil/frame.c
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-24 09:38:32 +01:00
Anton Khirnov
1155fd02ae frame: add a convenience function for copying AVFrame data 2014-02-24 07:25:07 +01:00
Michael Niedermayer
833501657b avutil/frame: increase padding for frames
This matches what avcodec uses

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-28 19:10:45 +01:00
Michael Niedermayer
58f70f1701 Merge commit 'df7aba52b51007db50410abe15fe28391abd8757'
* commit 'df7aba52b51007db50410abe15fe28391abd8757':
  frame: cosmetics, reindent

Conflicts:
	libavutil/frame.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-09 18:16:35 +01:00
Michael Niedermayer
3f5f955c53 Merge commit 'c342132fa8a29692e28c98238e3a31da5c407e42'
* commit 'c342132fa8a29692e28c98238e3a31da5c407e42':
  frame: copy flags in av_frame_copy_props()

Conflicts:
	libavutil/frame.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-09 17:59:33 +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
Michael Niedermayer
60b099c371 get_audio_buffer: fix usage where channels are not set but layout is
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-27 10:52:26 +01:00
Michael Niedermayer
078dab551d Merge commit '529a9893d769f381b72785c500662be2020da5fe'
* commit '529a9893d769f381b72785c500662be2020da5fe':
  avframe: mark source frame const in _ref and _clone

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-28 10:28:47 +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
Michael Niedermayer
1225b67fc9 avutil/frame: suppress "comparison of unsigned expression < 0 is always false" warning
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-19 22:46:52 +02:00
Michael Niedermayer
9c8aeacf82 avutil: add av_get_colorspace_name()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-19 22:14:13 +02:00