FFmpeg git repo
Go to file
Aman Gupta 8f146b526f avcodec/videotoolbox: fix decoding of some HEVC videos
In a normal hwaccel, the AVHWFramesContext sets AVFrame.hw_frames_ctx
when it initializes a new AVFrame in av_hwframe_get_buffer().

But the VT hwaccel doesn't know what hw_frames_ctx to assign when
the AVFrame is first created, because it depends on the format of
the pixbuf that the decoder eventually decides to return. Thus
newly created AVFrames always have a NULL hw_frames_ctx, and the
hwaccel would only assign the ctx once a frame was done decoding.
This worked fine with the H264 decoder, but with the HEVC decoder
the frame's data may be moved to another empty AVFrame. Since the
empty AVFrame never had hw_frames_ctx set, a frame with a NULL
ctx could be returned to the API user.

This patch works around the issue by moving the derived
hw_frames_ctx from the AVFrame to a new VTHWFrame which now holds
both the CVPixelBufferRef and the AVBuffer. The hw_frames_ctx
is only copied to the AVFrame right before it is about to be
returned to the user in videotoolbox_postproc_frame() (since
in the case of VT, the hw_frames_ctx is only there for the API
user anyway).

Fixes playback on macOS and iOS of some hevc videos like
https://s3.amazonaws.com/tmm1/videotoolbox/germany-hevc-zdf.ts

Signed-off-by: Aman Gupta <aman@tmm1.net>
2018-05-18 12:38:51 -07:00
compat compat: remove in-tree NVidia headers 2018-02-27 16:22:12 +01:00
doc avformat/mpegts: add skip_unknown_pmt option 2018-05-18 12:04:57 -07:00
ffbuild Merge commit '17b6c7efb471e8ff1b8a7271f6531ba1d52bf69c' 2017-11-12 01:02:02 -03:00
fftools ffprobe: fix SEGV when new streams are added 2018-05-09 12:30:17 -07:00
libavcodec avcodec/videotoolbox: fix decoding of some HEVC videos 2018-05-18 12:38:51 -07:00
libavdevice lavd/v4l2: Add ARGB and XRGB packed pixel formats 2018-05-10 22:40:57 +02:00
libavfilter avfilter/vsrc_testsrc: add pal75bars and pal100bars video filter sources 2018-05-18 15:39:54 +02:00
libavformat avformat/mpegts: add skip_unknown_pmt option 2018-05-18 12:04:57 -07:00
libavresample avresample: remove deprecated attribute from the AVAudioResampleContext struct 2018-01-09 10:56:53 -03:00
libavutil lavu/Makefile: Fix alignment and ordering 2018-05-15 22:16:03 +01:00
libpostproc Bump minor versions after release/4.0 branching 2018-04-16 12:35:12 +02:00
libswresample swresample/arm: rename labels to fix xcode build error 2018-04-28 18:08:52 +02:00
libswscale swscale: add gray14 support 2018-05-05 21:35:31 +02:00
presets
tests tests/checkasm/nlmeans: fix invalid read/write on ii buffer 2018-05-18 19:12:11 +02:00
tools avcodec: Disable new iterate API for ossfuzz 2018-05-16 00:39:52 +02:00
.gitattributes
.gitignore Remove the ffserver program 2018-01-06 18:31:37 +00:00
.travis.yml Merge commit '4809781586d1c956005f72946a2aab5915eab350' 2017-10-28 15:08:31 -03:00
Changelog avfilter/vsrc_testsrc: add pal75bars and pal100bars video filter sources 2018-05-18 15:39:54 +02:00
configure configure: error out on unsupported MSVC versions 2018-05-18 02:22:57 +01:00
CONTRIBUTING.md
COPYING.GPLv2
COPYING.GPLv3
COPYING.LGPLv2.1
COPYING.LGPLv3
CREDITS
INSTALL.md
LICENSE.md
MAINTAINERS Add IRC nicknames 2018-05-14 11:36:40 +02:00
Makefile Revert "lavd: add new API for iterating input and output devices" 2018-03-31 23:26:31 +01:00
README.md Remove the ffserver program 2018-01-06 18:31:37 +00:00
RELEASE RELEASE: update for git after 3.4 branchpoint 2017-10-11 02:46:23 +02:00

FFmpeg README

FFmpeg is a collection of libraries and tools to process multimedia content such as audio, video, subtitles and related metadata.

Libraries

  • libavcodec provides implementation of a wider range of codecs.
  • libavformat implements streaming protocols, container formats and basic I/O access.
  • libavutil includes hashers, decompressors and miscellaneous utility functions.
  • libavfilter provides a mean to alter decoded Audio and Video through chain of filters.
  • libavdevice provides an abstraction to access capture and playback devices.
  • libswresample implements audio mixing and resampling routines.
  • libswscale implements color conversion and scaling routines.

Tools

  • ffmpeg is a command line toolbox to manipulate, convert and stream multimedia content.
  • ffplay is a minimalistic multimedia player.
  • ffprobe is a simple analysis tool to inspect multimedia content.
  • Additional small tools such as aviocat, ismindex and qt-faststart.

Documentation

The offline documentation is available in the doc/ directory.

The online documentation is available in the main website and in the wiki.

Examples

Coding examples are available in the doc/examples directory.

License

FFmpeg codebase is mainly LGPL-licensed with optional components licensed under GPL. Please refer to the LICENSE file for detailed information.

Contributing

Patches should be submitted to the ffmpeg-devel mailing list using git format-patch or git send-email. Github pull requests should be avoided because they are not part of our review process and will be ignored.