1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-08-11 03:45:05 +02:00
Commit Graph

16 Commits

Author SHA1 Message Date
Clément Bœsch
15b26e88cb Merge commit '9df889a5f116c1ee78c2f239e0ba599c492431aa'
* commit '9df889a5f116c1ee78c2f239e0ba599c492431aa':
  h264: rename h264.[ch] to h264dec.[ch]

Merged-by: Clément Bœsch <u@pkh.me>
2016-07-29 11:01:36 +02:00
Matthieu Bouron
df3484f87c lavc/videotoolbox: fix avcC extradata creation
Fixes properly ticket #5638.

Since 772ad7142d PPS and SPS contain the
nal type byte.

This reverts commit b8d754c5d0.
This reverts commit 8e47a99f57.
2016-06-22 10:03:45 +02:00
Dan Dennedy
b8d754c5d0 lavc/videotoolbox: Fix videotoolbox compile error on OS X 10.8.
Fixes error:
libavcodec/videotoolbox.c:511:18: error: implicit declaration of function
'CMVideoFormatDescriptionCreateFromH264ParameterSets' is invalid in C99

This was added in 10.9:
https://developer.apple.com/reference/coremedia/1489818-cmvideoformatdescriptioncreatefr?language=objc
2016-06-19 21:52:56 -04:00
Clément Bœsch
6cb550e933 lavc/videotoolbox: remove config_info maximum capacity
In case of extradata, config_info will contain two entries instead of
one.
2016-06-17 17:46:19 +02:00
Clément Bœsch
6fd58eba1c lavc/videotoolbox: CFRelease() session
"When you are done with a decompression session you created, call
VTDecompressionSessionInvalidate to tear it down and then CFRelease to
release your object reference."
2016-06-17 17:46:19 +02:00
Rick Kern
8e47a99f57 lavc/videotoolbox: fix H.264 hwaccel init issue
Fixes VTDecompressionSessionCreate() error.

Signed-off-by: Rick Kern <kernrj@gmail.com>
2016-06-16 21:06:45 -04:00
Clément Bœsch
aafdad1b45 lavc/videotoolbox: fix sps/pps mistake introduced in 1534ef87 2016-06-12 20:53:57 +02:00
Clément Bœsch
4df944920c lavc/videotoolbox: fixes compilation after 1534ef87 2016-06-12 20:53:57 +02:00
Clément Bœsch
1534ef87c7 Merge commit '3176217c60ca7828712985092d9102d331ea4f3d'
* commit '3176217c60ca7828712985092d9102d331ea4f3d':
  h264: decouple h264_ps from the h264 decoder

Main changes:

- a local GetBitContext is created for the various
  ff_h264_decode_seq_parameter_set() attempts

- just like the old code, remove_sps() is adjusted so it doesn't remove
  the pps.

  Fixes decode with Ticket #631
  http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20111108/dae58f17/attachment.mp4
  but see next point as well.

- ff_h264_update_thread_context() is updated to work even when SPS
  isn't set as it breaks current skip_frame code. This makes sure we
  can still decode the sample from ticket #631 without the need for
  -flags2 +chunks. (Thanks to Michael)

- keep {sps,pps}_ref pointers that stay alive even when the active
  pps/sps get removed from the available lists (patch by michaelni with
  additionnal frees in ff_h264_free_context() from mateo)

- added a check on sps in avpriv_h264_has_num_reorder_frames() to fix
  crashes with mpegts_with_dvbsubs.ts from Ticket #4074
  http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket4074/mpegts_with_dvbsubs.ts

- in h264_parser.c:h264_parse(), after the ff_h264_decode_extradata() is
  called, the pps and sps from the local parser context are updated with
  the pps and sps from the used h264context. This fixes fate-flv-demux.

- in h264_slice.c, "PPS changed between slices" error is not triggered
  anymore in one condition as it makes fate-h264-xavc-4389 fails with
  THREADS=N (Thanks to Michael)

Merged-by: Clément Bœsch <clement@stupeflix.com>
Merged-by: Michael Niedermayer <michael@niedermayer.cc>
Merged-by: Matthieu Bouron <matthieu.bouron@stupeflix.com>
2016-06-12 13:26:52 +02:00
wm4
9747219958 avcodec/h264, videotoolbox: do not return invalid frames on failure
If videotoolbox_common_end_frame failed, then the AVFrame was returned
to the API user with the dummy buffer (in AVFrame.buf[0]) still set, and
the decode call indicating success.

These "half-set" AVFrames with dummy buffer are a videotoolbox specific
hack, because the decoder requires an allocated AVFrame for its internal
logic. Videotoolbox on the other hand allocates its frame itself
internally, and outputs it only on end_frame. At this point, the dummy
buffer is replaced with the real frame (unless decoding fails).
2015-11-20 11:30:18 +01:00
wm4
16aac9a359 avcodec/videotoolbox: fix decoding of some h264 bitstreams
This affects Annex B streams (such as demuxed from .ts and others). It
also handles the format change in reinit-large_420_8-to-small_420_8.h264
correctly.

Instead of passing through the extradata, create it on the fly it from
the currently active SPS and PPS. Since reconstructing the PPS and SPS
NALs would be very complicated and verbose, we use the NALs as they
originally appeared in the bitstream.

The code for writing the extradata is somewhat derived from
libavformat/avc.c, but it's small and different enough that sharing it
is not really worth it.
2015-10-02 19:09:16 +02:00
Stefano Pigozzi
78cc19f15e videotoolbox: require hardware acceleration
VideoToolbox also implements a software decoder for h264, and will fallback to
using it if the file cannot be decoded on the GPU. In these cases though,
we want the hwaccel to fail so that we can use the libavcodec software decoder
instead of the Apple one.

Signed-off-by: wm4 <nfxjfg@googlemail.com>
2015-09-29 23:55:11 +02:00
Ganesh Ajjanagadde
b3066be0e4 avcodec/videotoolbox: fix -Wunused-but-set-variable
pix_fmt was declared presumably to shorten the argument passed to the function.
However, it is currently not being used for such a purpose.
This patch simply removes it instead.
This fixes -Wunused-but-set-variable reported at e.g:
http://fate.ffmpeg.org/log.cgi?time=20150919194249&log=compile&slot=x86_64-darwin-gcc-4.9.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-29 04:50:03 +02:00
Michael Niedermayer
8bdd0dbd60 avcodec/videotoolbox: Add missing AV_ prefix to CODEC_ID in comment
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-03 14:47:11 +02:00
Michael Niedermayer
6b0fa73b4d avcodec/videotoolbox: Fix bistream typo
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-03 14:46:24 +02:00
Sebastien Zwickert
11d923d414 avcodec: add new Videotoolbox hwaccel. 2015-08-03 10:12:10 +02:00