Commit Graph

1510 Commits

Author SHA1 Message Date
Michael Niedermayer
fe65923ad1 doc/APIchanges: Fill in missing values
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-06-08 22:40:48 +02:00
James Almer
ec39c2276a avutil/buffer: use the default allocator if none is provided to av_buffer_pool_init2()
Signed-off-by: James Almer <jamrial@gmail.com>
2020-06-05 10:07:04 -03:00
Anton Khirnov
ba6cada92e avcodec.h: split AVCodec API into its own header 2020-05-27 10:22:17 +02:00
Anton Khirnov
383c03ee0f doc/APIchanges: fix typo in version number 2020-05-27 10:22:17 +02:00
Anton Khirnov
064b875e89 h264dec: support exporting QP tables through the AVVideoEncParams API 2020-05-25 11:59:42 +02:00
Lynne
2e08b39444
hwcontext: add av_hwdevice_ctx_create_derived_opts
This allows for users who derive devices to set options for the
new device context they derive.
The main use case of this is to allow users to enable extensions
(such as surface drawing extensions) in Vulkan while deriving from
the device their frames are on. That way, users don't need to write
any initialization code themselves, since the Vulkan spec invalidates
mixing instances, physical devices and active devices.
Apart from Vulkan, other hwcontexts ignore the opts argument since they
don't support options at all (or in VAAPI and OpenCL's case, options are
currently only used for device selection, which device_derive overrides).
2020-05-23 19:07:26 +01:00
Nicolas George
6b65c4ec54 lavu: add av_gcd_q(). 2020-05-23 15:51:44 +02:00
Marton Balint
af9e622776 avutil/opt: add AV_OPT_FLAG_CHILD_CONSTS
This will be used for AVCodecContext->profile. By specifying constants in the
encoders we won't have to use the common AVCodecContext options table and
different encoders can use the same profile name even with different values.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-05-22 22:16:52 +02:00
Anton Khirnov
bdd6aa25c1 avcodec.h: split bitstream filters API into its own header 2020-05-22 14:38:57 +02:00
Anton Khirnov
9d443c3e68 avcodec.h: split AVCodecParameters API into its own header 2020-05-22 14:38:57 +02:00
James Almer
13b1bbff0b avcodec: deprecate Lossless and Intra Only encoder capabilites
Both are codec properties and not encoder capabilities. The relevant
AVCodecDescriptor.props flags exist for this purpose.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-05-21 12:32:15 -03:00
James Almer
84af196c65 avutil: bump version after addition of av_sat_add64 and av_sat_sub64
Signed-off-by: James Almer <jamrial@gmail.com>
2020-05-17 16:05:15 -03:00
Anton Khirnov
c584409643 lavc: add a flag for exporting AVVideoEncParams from decoders 2020-05-12 09:37:47 +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
Lynne
dccd07f66d
hwcontext_vulkan: expose enabled device and instance extensions
This solves a huge oversight - it lets users reliably use their own
AVVulkanDeviceContext. Otherwise, the extensions supplied and enabled
are not discoverable by anything outside of hwcontext_vulkan.
Also clarifies that any user-supplied VkInstance must be at least 1.1.
2020-05-10 23:20:48 +01:00
Jun Zhao
5a2a199031 lavu/version: bump minor version for DOVI sidedata
bump minor version for DOVI sidedata, because added the dovi_meta.h
as lavu API part. Also update APIchanges.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2020-04-25 09:40:52 +08:00
Jun Zhao
54f100272a doc/APIChanges: add AV_PKT_DATA_DOVI_CONF entry
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2020-04-23 08:06:42 +08:00
Philip Langdale
22b25b3ea5 avcodec: Add explicit capability flag for encoder flushing
Previously, there was no way to flush an encoder such that after
draining, the encoder could be used again. We generally suggested
that clients teardown and replace the encoder instance in these
situations. However, for at least some hardware encoders, the cost of
this tear down/replace cycle is very high, which can get in the way of
some use-cases - for example: segmented encoding with nvenc.

To help address that use case, we added support for calling
avcodec_flush_buffers() to nvenc and things worked in practice,
although it was not clearly documented as to whether this should work
or not. There was only one previous example of an encoder implementing
the flush callback (audiotoolboxenc) and it's unclear if that was
intentional or not. However, it was clear that calling
avocdec_flush_buffers() on any other encoder would leave the encoder in
an undefined state, and that's not great.

As part of cleaning this up, this change introduces a formal capability
flag for encoders that support flushing and ensures a flush call is a
no-op for any other encoder. This allows client code to check if it is
meaningful to call flush on an encoder before actually doing it.

I have not attempted to separate the steps taken inside
avcodec_flush_buffers() because it's not doing anything that's wrong
for an encoder. But I did add a sanity check to reject attempts to
flush a frame threaded encoder because I couldn't wrap my head around
whether that code path was actually safe or not. As this combination
doesn't exist today, we'll deal with it if it ever comes up.
2020-04-15 14:54:42 -07:00
Anton Khirnov
672946c7fe avcodec.h: split AVCodecDescriptor API into its own header 2020-04-10 14:15:14 +02:00
Anton Khirnov
c6978418b8 avcodec.h: split codec IDs into their own header 2020-04-10 13:57:21 +02:00
Anton Khirnov
9875fd24ce avcodec.h: split AVPacket API into its own header 2020-04-10 13:54:03 +02:00
Andreas Rheinhardt
4cb0dda555 avformat/avformat: Update av_read_frame() documentation
This commit updates the documentation of av_read_frame() to match its
actual behaviour in several ways:

1. On success, av_read_frame() always returns refcounted packets.
2. It can handle uninitialized packets.
3. On error, it always returns blank packets.

This will allow callers to not initialize or unref unnecessarily.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-29 03:58:30 +02:00
Andreas Rheinhardt
c52ec0367d avcodec/avcodec, avpacket: Return blank packet on av_packet_ref() failure
Up until now, it was completely unspecified what the content of the
destination packet dst was on error. Depending upon where the error
happened calling av_packet_unref() on dst might be dangerous.

This commit changes this by making sure that dst is blank on error, so
unreferencing it again is safe (and still pointless). This behaviour is
documented.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-28 03:59:15 +01:00
vectronic
05d27f342b API: add AV_PKT_DATA_ICC_PROFILE to AVPacketSideDataType
Signed-off-by: vectronic <hello.vectronic@gmail.com>
2020-03-10 15:10:06 +00:00
James Almer
d005a7cdfd avcodec: add an AVCodecContext flag to export PRFT side data on demand
Signed-off-by: James Almer <jamrial@gmail.com>
2020-02-22 23:19:07 -03:00
James Almer
c666689491 avcodec: add an AVCodecContext field to signal types of packet, frame, and coded stream side data to export
Add an initial mvs flag to is, analog to the export_mvs flags2 one.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-02-22 23:19:07 -03:00
Lynne
e8f054b095 lavu/tx: implement 32 bit fixed point FFT and MDCT
Required minimal changes to the code so made sense to implement.
FFT and MDCT tested, the output of both was properly rounded.
Fun fact: the non-power-of-two fixed-point FFT and MDCT are the fastest ever
non-power-of-two fixed-point FFT and MDCT written.
This can replace the power of two integer MDCTs in aac and ac3 if the
MIPS optimizations are ported across.
Unfortunately the ac3 encoder uses a 16-bit fixed point forward transform,
unlike the encoder which uses a 32bit inverse transform, so some modifications
might be required there.

The 3-point FFT is somewhat less accurate than it otherwise could be,
having minor rounding errors with bigger transforms. However, this
could be improved later, and the way its currently written is the way one
would write assembly for it.
Similar rounding errors can also be found throughout the power of two FFTs
as well, though those are more difficult to correct.
Despite this, the integer transforms are more than accurate enough.
2020-02-13 17:10:34 +00:00
Michael Niedermayer
3182114f88 avutil/log: Add av_log_once() for printing a message just once with a high log level
Compared to ad-hoc if(printed) ... code this allows the user to disable
it by adjusting the log level

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-02-12 10:25:25 +01:00
Lynne
9b9f441ab3 doc/APIchanges: fix vulkan hwcontext date 2020-02-08 23:32:46 +00:00
Lynne
ee81713fe3 doc/APIchanges: update with Vulkan commit info 2020-02-04 23:51:55 +00:00
Lynne
a88449ffb2 lavu: add Vulkan hwcontext code
This commit adds the necessary code to initialize and use a Vulkan device
within the hwcontext libavutil framework.
Currently direct mapping to VAAPI and DRM frames is functional, and
transfers to CUDA and native frames are supported.

Lets hope the future Vulkan video decode extension fits well within this
framework.
2020-02-04 23:19:48 +00:00
Steven Liu
27529eeb27 avformat/avio: add avio_protocol_get_class
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Suggested-by: Hendrik Leppkes <h.leppkes@gmail.com>
Suggested-by: Nicolas George <george@nsup.org>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2020-01-30 17:10:12 +08:00
James Almer
717b2074ec avcodec: add a Producer Reference Time AVPacketSideData type
Signed-off-by: James Almer <jamrial@gmail.com>
2020-01-15 23:33:41 -03:00
Michael Niedermayer
45259a0ee4 avutil/eval: Add av_expr_count_func() similar to av_expr_count_vars()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-12-28 11:20:48 +01:00
Marton Balint
16685114d5 avutil/buffer: add av_buffer_pool_buffer_get_opaque
In order to access the original opaque parameter of a buffer in the buffer
pool. (The buffer pool implementation overrides the normal opaque parameter but
also saves it so it is accessible).

v2: add assertion check before dereferencing the BufferPoolEntry.

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-12-26 00:47:24 +01:00
Gyan Doshi
b741a84a15 doc/APIchanges: update for av_expr_count_vars 2019-11-17 11:09:13 +05:30
James Almer
5c3d521a94 doc/APIchanges: add missing entry for the new runtime param AVOption flag
Signed-off-by: James Almer <jamrial@gmail.com>
2019-10-14 12:05:01 -03:00
Michael Niedermayer
f8406ab4b9 avcodec: add max_samples
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-25 17:18:37 +02:00
Aman Gupta
f30fb5ef62 avutil/version: bump for hwcontext_videotoolbox api change
av_map_videotoolbox_format_from_pixfmt2() added in previous
commit to support full-range pixel formats.

Signed-off-by: Aman Gupta <aman@tmm1.net>
2019-09-04 12:56:25 -07:00
Raphaël Zumer
8821d1f56e avutil/pixfmt: Add EBU Tech. 3213-E AVColorPrimaries value
This is an alias for JEDEC P22.

The name associated with the value is also changed
from jedec-p22 to ebu3213 to match ITU-T H.273.

Signed-off-by: Raphaël Zumer <rzumer@tebako.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-09-01 19:56:05 -03:00
Marton Balint
95fa73a2b4 avformat/avio: remove 4k limit from avio_printf
We do this by switching to AVBPrint.

v2: Also set IO context error flag in case of ENOMEM.

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-08-17 18:39:49 +02:00
Marton Balint
a82f8f2f10 avformat/avio: add avio_print_string_array and avio_print
These functions can be used to print a variable number of strings consecutively
to the IO context. Unlike av_bprintf, no temporary buffer is necessary.

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-08-17 18:39:49 +02:00
Lynne
42e2319ba9 lavu/tx: add support for double precision FFT and MDCT
Simply moves and templates the actual transforms to support an
additional data type.
Unlike the float version, which is equal or better than libfftw3f,
double precision output is bit identical with libfftw3.
2019-08-02 01:19:52 +01:00
Michael Niedermayer
d4cb9b8f24 doc/APIchanges: Fill in missing Fields, add 4.2 cut marker
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-07-21 18:24:41 +02:00
Amir Pauker
a30e44098a avutil: add FF_DECODE_ERROR_DECODE_SLICES for AVFrame.decode_error_flags
Signed-off-by: Amir Pauker <amir@livelyvideo.tv>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-06-29 19:22:19 +02:00
Amir Pauker
edfced8c04 avutil: add FF_DECODE_ERROR_CONCEALMENT_ACTIVE flag for AVFrame.decode_error_flags
FF_DECODE_ERROR_CONCEALMENT_ACTIVE is set when the decoded frame has error(s) but the returned value from
avcodec_receive_frame is zero i.e. concealed errors

Signed-off-by: Amir Pauker <amir@livelyvideo.tv>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-06-16 09:56:43 +02:00
Lynne
87ee9d580c lavu: bump minor and update APIchanges for the new transform API 2019-05-16 00:02:15 +01:00
Gyan Doshi
3a07aec827 doc/APIchanges: update for 3153a6502a
Entry for added avcodec flag AV_CODEC_FLAG_DROPCHANGED
2019-04-20 10:47:48 +05:30
Jun Zhao
d93e44332f lavf: bump version/add APIchanges entry when cleanup applehttp
commit abfeba9 "lavf/hls: Cleanup the applehttp" missed
the version bump and APIchanges entry.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-04-20 07:26:58 +08:00
Michael Niedermayer
5bcefceec8 avcodec: Add discard_sample_percentage
Suggested-by: BBB
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-01-28 01:09:38 +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
James Almer
53d3a1c514 APIChanges: add missing entry for SMPTE2094-40 HDR Dynamic metadata API
Signed-off-by: James Almer <jamrial@gmail.com>
2018-12-21 21:24:00 -03:00
Michael Niedermayer
acf4fbddf3 doc/APIchanges: Update for 4.1
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-11-01 23:54:26 +01:00
Michael Niedermayer
718044dc19 avutil/pixdesc: Add av_write_image_line2(), av_read_image_line2()
This is needed because of 32bit float formats (which are difficult to
store in 16bits)

This also fixes undefined behavior found by fate

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-10-27 22:39:27 +02:00
James Almer
78f04843bf doc/APIchanges: add entry for AV_FRAME_DATA_S12M_TIMECODE
Signed-off-by: James Almer <jamrial@gmail.com>
2018-10-24 14:57:25 -03:00
Aman Gupta
f6d48b618a avcodec/mediacodec: add av_mediacodec_render_buffer_at_time()
The existing av_mediacodec_release_buffer allows the user to render
or discard the Surface-backed frame. This new method allows the user
to control exactly when the frame will be rendered to its SurfaceView.

Available since Android API 21.

Signed-off-by: Aman Gupta <aman@tmm1.net>
2018-10-11 20:51:14 -07:00
Devin Heitmueller
35498c124a avcodec: add AV_PKT_DATA_AFD to allow AFD data to be embedded in AVPacket
Create a new AVPacket side data type for Active Format Description,
which mirrors the side data type found in AVFrame.  The primary
use case for this is ensuring AFD gets preserved in the V210
encoder, so that the decklink libavdevice can output AFD.

Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2018-09-09 22:42:26 +02:00
James Almer
b33f5299a5 avcodec/bsf: add a flushing mechanism to AVBSFContext
Meant to reset the internal bsf state without the need to reinitialize it.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-16 23:43:10 -03:00
Aman Gupta
fc2daf36f9 doc: remove AVStream private fields from APIchanges
Signed-off-by: Aman Gupta <aman@tmm1.net>
2018-05-21 12:13:14 -07:00
Aman Gupta
2b2f2f65f3 avformat: add fields to AVProgram/AVStream for PMT change tracking
These fields will allow the mpegts demuxer to expose details about
the PMT/program which created the AVProgram and its AVStreams.

In mpegts, a PMT which advertises streams has a version number
which can be incremented at any time. When the version changes,
the pids which correspond to each of it's streams can also change.

Since ffmpeg creates a new AVStream per pid by default, an API user
needs the ability to (a) detect when the PMT changed, and (b) tell
which AVStream were added to replace earlier streams.

This has been a long-standing issue with ffmpeg's handling of mpegts
streams with PMT changes, and I found two related patches in the wild
that attempt to solve the same problem:

The first is in MythTV's ffmpeg fork, where they added a
void (*streams_changed)(void*); to AVFormatContext and call it from
their fork of the mpegts demuxer whenever the PMT changes.

The second was proposed by XBMC in
https://ffmpeg.org/pipermail/ffmpeg-devel/2012-December/135036.html,
where they created a new AVMEDIA_TYPE_DATA stream with id=0 and
attempted to send packets to it whenever the PMT changed.

Signed-off-by: Aman Gupta <aman@tmm1.net>
2018-05-18 19:00:29 -07:00
Aman Gupta
5dfeb7f081 avformat/mpegts: tag video streams with still images
Parses the video_stream_descriptor (H.222 2.6.2) to look
for the still_picture_flag. This is exposed to the user
via a new AV_DISPOSITION_STILL_IMAGE.

See for example https://tmm1.s3.amazonaws.com/music-choice.ts,
whose video stream only updates every ~6 seconds.

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-05-17 12:03:22 -07:00
Timo Rothenpieler
c855683427 avutil/hwcontext_cuda: add CUstream in cuda hwctx 2018-05-10 00:34:22 +02:00
Marton Balint
56b081da57 avutil/pixdesc: add AV_PIX_FMT_FLAG_ALPHA to AV_PIX_FMT_PAL8
Signed-off-by: Marton Balint <cus@passwd.hu>
2018-04-30 21:51:31 +02:00
Clément Bœsch
5be0410cb3 lavu/opt: add AV_OPT_FLAG_DEPRECATED 2018-04-26 19:50:29 +02:00
Clément Bœsch
71fa82bed6 lavu/threadmessage: add av_thread_message_queue_nb_elems() 2018-04-26 19:41:19 +02:00
Michael Niedermayer
ec8a5262b0 doc/APIchanges: Fix typos in hashes
Thanks-to: Moritz Barsnick <barsnick@gmx.net> for finding the correct ones

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-16 19:24:31 +02:00
Michael Niedermayer
1b7b7c6a62 doc/APIchanges: Add 4.0 cut point
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-16 12:35:12 +02:00
Michael Niedermayer
e8be46dfe0 doc/APIchanges: Fill in missing stuff
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-16 12:35:12 +02: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
James Almer
860086ee16 avcodec/avpacket: add av_packet_make_refcounted()
It works as a drop in replacement for the deprecated av_dup_packet(),
to ensure a packet is reference counted.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-01 23:40:41 -03:00
James Almer
f1805d160d avfilter: bump version for the latest API change
And fix the entry in doc/APIchanges

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-01 23:22:18 -03:00
Josh de Kock
d8ae40611b Revert "lavd: add new API for iterating input and output devices"
This reverts commit 0fd475704e.

Revert "lavd: fix iterating of input and output devices"

This reverts commit ce1d77a5e7.

Signed-off-by: Josh de Kock <josh@itanimul.li>
2018-03-31 23:26:31 +01:00
Josh de Kock
8f1382f80e lavfi: add new iteration API
Signed-off-by: Josh de Kock <josh@itanimul.li>
2018-03-31 23:26:30 +01:00
James Almer
95e33ea565 doc/APIchanges: fix lavu version for the AVEncryptionInfo addition
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-27 14:58:36 -03:00
wm4
b7d0d912ef avcodec: add a subcharenc mode that disables UTF-8 check
This is for applications which want to explicitly check for invalid
UTF-8 manually, and take actions that are better than dropping invalid
subtitles silently. (It's pretty much silent because sporadic avcodec
error messages are so common that you can't reasonably display them in a
prominent and meaningful way in a application GUI.)
2018-03-25 19:27:02 +02:00
Jacob Trimble
db2a7c947e avcodec/avcodec.h: Add encryption info side data.
This new side-data will contain info on how a packet is encrypted.
This allows the app to handle packet decryption.

Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-03-24 03:11:08 +01:00
James Almer
f14ca60001 avcodec/avpacket: add av_packet_make_writable()
Useful as well to quickly make a packet reference counted when it
isn't already so.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-21 22:17:40 -03: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
James Almer
7af2336598 avutil: bump version after the latest AVOption flag addition
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-16 00:19:45 -03:00
James Almer
950170bd3b avutil: add missing version bump for AV_CRC_8_EBU
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-10 01:15:05 -03:00
Aman Gupta
2a0eb86857 avcodec/mediacodecdec: add delay_flush option
The default behavior of the mediacodec decoder before this commit
was to delay flushes until all pending hardware frames were
returned to the decoder. This was useful for certain types of
applications, but was unexpected behavior for others.

The new default behavior with this commit is now to execute
flushes immediately to invalidate all pending frames. The old
behavior can be enabled by setting delay_flush=1.

With the new behavior, video players implementing seek can simply
call flush on the decoder without having to worry about whether
they have one or more mediacodec frames still buffered in their
rendering pipeline. Previously, all these frames had to be
explictly freed (or rendered) before the seek/flush would execute.

The new behavior matches the behavior of all other lavc decoders,
reducing the amount of special casing required when using the
mediacodec decoder.

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2018-03-07 16:22:47 -08: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
James Almer
8a8d0b319a avutil/crypto: change length parameter to size_t on the remaining modules
See 651ee93461
fcc4ed1efa

Signed-off-by: James Almer <jamrial@gmail.com>
2018-02-15 11:21:28 -03:00
Mark Thompson
bcab11a1a2 Merge commit '6d86cef06ba36c0ed591e14a2382e9630059fc5d'
* commit '6d86cef06ba36c0ed591e14a2382e9630059fc5d':
  lavfi: Add support for increasing hardware frame pool sizes

Merged-by: Mark Thompson <sw@jkqxz.net>
2018-02-12 22:28:12 +00:00
Mark Thompson
d23fff0d8a Merge commit '5b145290df2998a9836a93eb925289c6c8b63af0'
* commit '5b145290df2998a9836a93eb925289c6c8b63af0':
  lavc: Add support for increasing hardware frame pool sizes

Merged-by: Mark Thompson <sw@jkqxz.net>
2018-02-12 22:19:38 +00:00
Mark Thompson
6d86cef06b lavfi: Add support for increasing hardware frame pool sizes
AVFilterContext.extra_hw_frames functions identically to the field of
the same name in AVCodecContext.
2018-02-11 22:11:06 +00:00
Mark Thompson
5b145290df lavc: Add support for increasing hardware frame pool sizes
AVCodecContext.extra_hw_frames is added to the size of hardware frame
pools created by libavcodec for APIs which require fixed-size pools.
This allows the user to keep references to a greater number of frames
after decode, which may be necessary for some use-cases.

It is also added to the initial_pool_size value returned by
avcodec_get_hw_frames_parameters() if a fixed-size pool is required.
2018-02-11 22:00:33 +00:00
James Almer
3f0a41367e doc/APIchanges: mention a few more recently introduced and deprecated functions
Signed-off-by: James Almer <jamrial@gmail.com>
2018-02-07 17:06:04 -03:00
James Almer
9d8fb095e6 doc/APIchanges: fix a recent depreacted function name
Signed-off-by: James Almer <jamrial@gmail.com>
2018-02-07 16:56:47 -03:00
James Almer
e8323c42c1 doc/APIChanges: fix lavu version numbers in a few recent entries
Signed-off-by: James Almer <jamrial@gmail.com>
2018-02-06 23:49:13 -03:00
James Almer
36c85d6e77 api: add missing version bumps and APIChanges entries
avcodec bump missed in 7e8eba2d87
avformat bump missed in ff46124b0d and
0694d87024
avdevice bump missed in 0fd475704e

Signed-off-by: James Almer <jamrial@gmail.com>
2018-02-06 23:43:01 -03:00
Josh de Kock
0694d87024 lavf: add new API for iterating muxers and demuxers 2018-02-06 18:57:42 +00:00
Josh de Kock
7e8eba2d87 lavc: add new API for iterating codecs and codec parsers
Based on an unfinished patch by atomnuker.
2018-02-06 18:50:27 +00:00
wm4
ff46124b0d rtsp: rename certain options after a deprecation period
The "timeout" option name inherently clashes with the meaning of the
HTTP libavformat protocol option with the same name. Rename it after a
deprecation period to make it compatible with the HTTP one.
2018-02-04 15:08:48 +01:00
Marton Balint
fa8308d3d4 avformat: deprecate AVFormatContext filename field
Signed-off-by: Marton Balint <cus@passwd.hu>
2018-01-28 23:06:43 +01:00
Marton Balint
ea3672b7d6 avformat: add url field to AVFormatContext
This will replace the 1024 character limited filename field. Compatiblity for
output contexts are provided by copying filename field to URL if URL is unset
and by providing an internal function for muxers to set both url and filename
at once.

Signed-off-by: Marton Balint <cus@passwd.hu>
2018-01-28 23:06:43 +01:00
wm4
6194d7e564 avformat, hls: add a flag to signal unavailability of seeking
The seek function can just return an error if seeking is unavailable,
but often this is too late. Add a flag that signals that the stream is
unseekable, and use it in HLS.
2018-01-27 04:10:52 +01:00
Jacob Trimble
9f07cf7c00 avutil/aes_ctr: Add method to set 16-byte IV.
Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-01-23 21:48:31 +01:00
wm4
631c56a8e4 avformat: make avformat_network_init() explicitly optional
It was sort of optional before - if you didn't call it, networking was
initialized on demand, and an ugly warning was logged. Also, the doxygen
comments threatened that it would be made strictly required one day.

Make it explicitly optional. I would prefer to deprecate it fully, but
there might still be legitimate reasons to use this. But the average
user won't need it.

This is needed only for two reasons: to initialize TLS libraries like
OpenSSL and GnuTLS, and winsock.

OpenSSL and GnuTLS were already silently initialized on demand if the
global network init function was not called. They also have various
thread-safety acrobatics, which make concurrent initialization within
libavformat safe. In addition, the libraries are moving towards making
their global init functions safe, which removes all need for central
global init. In particular, GnuTLS 3.5.16 and OpenSSL 1.1.0g have been
found to have safe init functions. In all cases, they use internal
reference counters to avoid that the global uninit functions interfere
with concurrent uses of the library by other API users who called global
init.

winsock should be thread-safe as well, and maintains an internal
reference counter as well.

Since we still support ancient TLS libraries, which do not have this
fixed, and since it's unknown whether winsock and GnuTLS
reinitialization is costly in any way, don't deprecate the libavformat
functions yet.
2018-01-16 12:57:04 +01:00
wm4
6512ff72f9 avformat: deprecate another ffserver API leftover 2018-01-16 12:54:53 +01:00
James Almer
b2c42fc6dc avfilter: deprecate avfilter_link_get_channels()
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-01-06 11:01:16 -03:00
James Almer
da5b05c833 Revert "avfilter: deprecate avfilter_link_get_channels()"
This reverts commit 798dcf2432.

It was applied by accident before it could be reviewed.
2018-01-05 22:13:28 -03:00
James Almer
798dcf2432 avfilter: deprecate avfilter_link_get_channels()
And move the channels field to the public section of the struct.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-01-05 17:49:09 -03:00
Rostislav Pehlivanov
c29038f304 lavr: deprecate the entire library
Deprecate the entire library. Merged years ago to provide compatibility
with Libav, it remained unmaintained by the FFmpeg project and duplicated
functionality provided by libswresample.

In order to improve consistency and reduce attack surface, as well as to ease
burden on maintainers, it has been deprecated. Users of this library are asked
to migrate to libswresample, which, as well as providing more functionality,
is faster and has higher accuracy.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2018-01-04 01:38:22 +00:00
wm4
a04c2c707d lavc: replace and deprecate the lock manager
Use static mutexes instead of requiring a lock manager. The behavior
should be roughly the same before and after this change for API users
which did not set the lock manager at all (except that a minor memory
leak disappears).
2017-12-26 02:50:00 +01:00
James Darnley
8b81eabe57 avutil: add AVX-512 flags 2017-12-24 22:02:41 +01:00
Mark Thompson
2117725dc5 lavc: Mark all AVHWAccel structures as const 2017-12-19 23:24:24 +00:00
Mark Thompson
e2d575543c lavc: Deprecate av_hwaccel_next() and av_register_hwaccel() 2017-12-19 23:22:31 +00:00
Mark Thompson
720cf4e6e7 lavc: Add codec metadata to indicate hardware support 2017-12-19 23:21:53 +00:00
Aman Gupta
8bf4e6d3ce lavc/mediacodec: use AVMediaCodecDeviceContext hw_device_ctx if set
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2017-12-16 00:52:27 +01:00
Aman Gupta
e4d9f05ca7 lavu/hwcontext: add AV_HWDEVICE_TYPE_MEDIACODEC
Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2017-12-16 00:52:00 +01:00
wm4
b945fed629 avcodec: add metadata to identify wrappers and hardware decoders
Explicitly identify decoder/encoder wrappers with a common name. This
saves API users from guessing by the name suffix. For example, they
don't have to guess that "h264_qsv" is the h264 QSV implementation, and
instead they can just check the AVCodec .codec and .wrapper_name fields.

Explicitly mark AVCodec entries that are hardware decoders or most
likely hardware decoders with new AV_CODEC_CAPs. The purpose is allowing
API users listing hardware decoders in a more generic way. The proposed
AVCodecHWConfig does not provide this information fully, because it's
concerned with decoder configuration, not information about the fact
whether the hardware is used or not.

AV_CODEC_CAP_HYBRID exists specifically for QSV, which can have software
implementations in case the hardware is not capable.

Based on a patch by Philip Langdale <philipl@overt.org>.

Merges Libav commit 47687a2f8a.
2017-12-14 19:37:56 +01:00
James Almer
d268094f88 Merge commit '99e9697e3a12ab4a6638a36b95edafd6a98f9eaa'
* commit '99e9697e3a12ab4a6638a36b95edafd6a98f9eaa':
  stereo3d: Support view type for frame sequence type

Merged-by: James Almer <jamrial@gmail.com>
2017-11-29 21:06:49 -03:00
Vittorio Giovara
99e9697e3a stereo3d: Support view type for frame sequence type
Implement detection in h264 and hevc and insertion in framepack filter.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-11-28 14:56:51 -05:00
Mark Thompson
3a71bcc213 lavc: Mark all AVHWAccel structures as const 2017-11-26 21:41:19 +00:00
Mark Thompson
3536a3efb9 lavc: Deprecate av_hwaccel_next() and av_register_hwaccel() 2017-11-26 21:36:31 +00:00
Mark Thompson
24cc0a53e9 lavc: Add codec metadata to indicate hardware support 2017-11-26 21:35:49 +00:00
Mark Thompson
8921689575 doc/APIchanges: Fix lavu versions for OpenCL changes
Also fix a typo and fill hashes and dates.
2017-11-25 15:13:15 +00:00
Mark Thompson
3650cb2dfa lavu,lavfi,ffmpeg: Remove experimental OpenCL API
This was added in early 2013 and abandoned several months later; as far as
I can tell, there are no external users.  Future OpenCL use will be via
hwcontext, which requires neither special OpenCL-only API nor global state
in libavutil.

All internal users are also deleted - this is just the unsharp filter
(replaced by unsharp_opencl, which is more flexible) and the deshake filter
(no replacement).
2017-11-22 23:20:39 +00:00
Mark Thompson
b25d8ef0a7 lavu: OpenCL hwcontext implementation 2017-11-22 23:02:29 +00:00
Mark Thompson
a050f56c09 lavu: Add OpenCL hardware pixfmt 2017-11-22 23:01:29 +00:00
James Almer
48e4eda11d Merge commit 'b46a77f19ddc4b2b5fa3187835ceb602a5244e24'
* commit 'b46a77f19ddc4b2b5fa3187835ceb602a5244e24':
  lavc: external hardware frame pool initialization

Includes the fix from e724bdfffb

Merged-by: James Almer <jamrial@gmail.com>
2017-11-11 20:33:26 -03:00
James Almer
a60fb1f88f Merge commit '083ea8768121ee800893e124b08483011b798919'
* commit '083ea8768121ee800893e124b08483011b798919':
  APIchanges: Update bump dates

Merged-by: James Almer <jamrial@gmail.com>
2017-10-23 19:17:31 -03:00
wm4
b46a77f19d lavc: external hardware frame pool initialization
This adds a new API, which allows the API user to query the required
AVHWFramesContext parameters. This also reduces code duplication across
the hwaccels by introducing ff_decode_get_hw_frames_ctx(), which uses
the new API function. It takes care of initializing the hw_frames_ctx
if needed, and does additional error handling and API usage checking.

Support for VDA and Cuvid missing.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2017-10-19 17:10:59 +02:00
Michael Niedermayer
92ae4ab56d doc/APIchanges: Add 3.4 cut point
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-11 01:23:49 +02:00
Michael Niedermayer
ed8ff608b2 doc/APIchanges: Update
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-10-11 00:16:15 +02:00
Karthick J
b6cf66ae1c avdevice/decklink_dec: Added Closed caption decode from VANC
Signed-off-by: Karthick J <kjeyapal@akamai.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2017-09-28 21:06:12 +02: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
James Almer
522f877086 Merge commit 'e6bff23f1e11aefb16a2b5d6ee72bf7469c5a66e'
* commit 'e6bff23f1e11aefb16a2b5d6ee72bf7469c5a66e':
  cpu: add a function for querying maximum required data alignment

Adapted to work with the arbitrary runtime cpuflag changes av_force_cpu_flags()
can generate.

Merged-by: James Almer <jamrial@gmail.com>
2017-09-27 23:03:57 -03:00
James Almer
b1cf151c4d Merge commit '577326d430593a25456393a75212b95d1cd94131'
* commit '577326d430593a25456393a75212b95d1cd94131':
  lavc: deprecate refcounted_frames field

Merged-by: James Almer <jamrial@gmail.com>
2017-09-26 16:42:18 -03:00
Vittorio Giovara
6f15f1cdc8 pixdesc: Add API to map color property names to enum values
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-09-21 13:33:29 +02:00
Vittorio Giovara
2b50847e0f pixdesc: Add API to map color property names to enum values
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-09-21 13:23:21 +02:00
Mark Thompson
82342cead1 lavc: Add flag to mark packets containing trusted input 2017-09-13 22:25:29 +01:00
Mark Thompson
9cb23cd9fe lavu: Add DRM hwcontext 2017-09-13 22:03:27 +01:00
Nicolas George
5ba2aef6ec lavfi/buffersrc: add av_buffersrc_close(). 2017-09-08 10:31:01 +02:00
James Almer
6cadbb16e9 avcodec: add AV_HWACCEL_CODEC_CAP_EXPERIMENTAL flag
This flag replaces the deprecated, non-prefixed HWACCEL_CODEC_CAP_EXPERIMENTAL
one.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-04 17:48:41 -03:00
wm4
5d76674756 lavf: make avio_read_partial() public
Main use-case is proxying avio through a foreign I/O layer and a custom
AVIO context, without losing latency and performance characteristics.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Merged from Libav commit 173b56218f.
2017-09-01 17:56:33 +02:00
Anton Khirnov
b12e4d3bb8 avio: add a destructor for AVIOContext
Before this commit, AVIOContext is to be freed with a plain av_free(),
which prevents us from adding any deeper structure to it.

(cherry picked from commit 99684f3ae7)
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-01 01:51:15 -03:00
wm4
173b56218f lavf: make avio_read_partial() public
Main use-case is proxying avio through a foreign I/O layer and a custom
AVIO context, without losing latency and performance characteristics.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-08-30 14:29:14 +02:00
Vittorio Giovara
1460408703 Add single precision planar RGB pixel formats
Add a pixel format flag to identify this family.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-08-15 15:26:20 +02:00
wm4
463b81de2b imgutils: add function to clear an image to black
Black isn't always just memset(ptr, 0, size). Limited YUV in particular
requires relatively non-obvious values, and filling a frame with
repeating 0 bytes is disallowed in some contexts. With component sizes
larger than 8 or packed YUV, this can become relatively complicated. So
having a generic function for this seems helpful.

In order to handle the complex cases in a generic way without destroying
performance, this code attempts to compute a black pixel, and then uses
that value to clear the image data quickly by using a function like
memset.

Common cases like yuv410p10 or rgba can't be handled with a simple
memset, so there is some code to fill memory with 2/4/8 byte patterns.
For the remaining cases, a generic slow fallback is used.

Signed-off-by: Anton Khirnov <anton@khirnov.net>

Merged from Libav commit 45df7adc1d.
2017-08-08 13:37:37 +02: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
James Almer
9f449227a3 doc/APIChanges: add missing entry for ICC Profile side data type. 2017-07-27 14:21:41 -03:00
wm4
45df7adc1d imgutils: add function to clear an image to black
Black isn't always just memset(ptr, 0, size). Limited YUV in particular
requires relatively non-obvious values, and filling a frame with
repeating 0 bytes is disallowed in some contexts. With component sizes
larger than 8 or packed YUV, this can become relatively complicated. So
having a generic function for this seems helpful.

In order to handle the complex cases in a generic way without destroying
performance, this code attempts to compute a black pixel, and then uses
that value to clear the image data quickly by using a function like
memset.

Common cases like yuv410p10 or rgba can't be handled with a simple
memset, so there is some code to fill memory with 2/4/8 byte patterns.
For the remaining cases, a generic slow fallback is used.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2017-07-26 23:21:26 +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
wm4
70143a3954 dxva: add support for new dxva2 and d3d11 hwaccel APIs
This also adds support to avconv (which is trivial due to the new
hwaccel API being generic enough).

The new decoder setup code in dxva2.c is significantly based on work by
Steve Lhomme <robux4@gmail.com>, but with heavy changes/rewrites.

Merges Libav commit f9e7a2f95a.
Also adds untested VP9 support.
The check for DXVA2 COBJs is removed. Just update your MinGW to
something newer than a 5 year old release.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2017-06-27 18:05:02 +02:00
wm4
3303511f33 lavu: add new D3D11 pixfmt and hwcontext
To be used with the new d3d11 hwaccel decode API.

With the new hwaccel API, we don't want surfaces to depend on the
decoder (other than the required dimension and format). The old D3D11VA
pixfmt uses ID3D11VideoDecoderOutputView pointers, which include the
decoder configuration, and thus is incompatible with the new hwaccel
API. This patch introduces AV_PIX_FMT_D3D11, which uses ID3D11Texture2D
and an index. It's simpler and compatible with the new hwaccel API.

The introduced hwcontext supports only the new pixfmt.

Frame upload code untested.

Significantly based on work by Steve Lhomme <robux4@gmail.com>, but with
heavy changes/rewrites.

Merges Libav commit fff90422d1.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2017-06-27 18:05:02 +02:00
Marton Balint
09891c5391 avformat/aviobuf: add support for specifying minimum packet size and marking flush points
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2017-06-24 18:51:29 +02:00
Mark Thompson
d59c6a3aeb hwcontext: Improve allocation in derived contexts
Use the flags argument of av_hwframe_ctx_create_derived() to pass the
mapping flags which will be used on allocation.  Also, set the format
and hardware context on the allocated frame automatically - the user
should not be required to do this themselves.

(cherry picked from commit c5714b51aa)
2017-06-14 22:27:32 +01:00
Mark Thompson
49ae8a5e87 lavc: Add flag to allow profile mismatch with hardware decoding
(cherry picked from commit 64a5260c69)
2017-06-14 22:27:04 +01:00