Commit Graph

1335 Commits

Author SHA1 Message Date
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