]> git.sesse.net Git - ffmpeg/commitdiff
Merge commit '67afcefb35932b420998f6f3fda46c7c85848a3f'
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 11 May 2014 23:57:02 +0000 (01:57 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 11 May 2014 23:57:02 +0000 (01:57 +0200)
* commit '67afcefb35932b420998f6f3fda46c7c85848a3f':
  lavc: Add new VDA hwaccel

Conflicts:
configure
libavcodec/vda.h
libavcodec/vda_h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
configure
libavcodec/Makefile
libavcodec/allcodecs.c
libavcodec/h264_slice.c
libavcodec/vda.c
libavcodec/vda.h
libavcodec/vda_h264.c
libavcodec/vda_internal.h

diff --cc configure
index 9394f7a003fd4b46f7a6c246b552709c1a6d735a,da77f694cc52e35ec616db43c19c9b64bb41ee9c..7f4ce399664683d165aa05a85c1203191a194314
+++ b/configure
@@@ -2192,25 -1894,14 +2192,27 @@@ h264_dxva2_hwaccel_deps="dxva2
  h264_dxva2_hwaccel_select="h264_decoder"
  h264_vaapi_hwaccel_deps="vaapi"
  h264_vaapi_hwaccel_select="h264_decoder"
 +h264_vda_decoder_deps="vda"
 +h264_vda_decoder_select="h264_decoder"
  h264_vda_hwaccel_deps="vda"
  h264_vda_hwaccel_select="h264_decoder"
+ h264_vda_old_hwaccel_deps="vda"
+ h264_vda_old_hwaccel_select="h264_decoder"
 +h264_vdpau_decoder_deps="vdpau"
 +h264_vdpau_decoder_select="h264_decoder"
  h264_vdpau_hwaccel_deps="vdpau"
  h264_vdpau_hwaccel_select="h264_decoder"
 +mpeg_vdpau_decoder_deps="vdpau"
 +mpeg_vdpau_decoder_select="mpeg2video_decoder"
 +mpeg_xvmc_hwaccel_deps="xvmc"
 +mpeg_xvmc_hwaccel_select="mpeg2video_decoder"
 +mpeg1_vdpau_decoder_deps="vdpau"
 +mpeg1_vdpau_decoder_select="mpeg1video_decoder"
  mpeg1_vdpau_hwaccel_deps="vdpau"
  mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
 +mpeg1_xvmc_hwaccel_deps="xvmc"
 +mpeg1_xvmc_hwaccel_select="mpeg1video_decoder"
 +mpeg2_crystalhd_decoder_select="crystalhd"
  mpeg2_dxva2_hwaccel_deps="dxva2"
  mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
  mpeg2_vaapi_hwaccel_deps="vaapi"
Simple merge
index a1cd44e9831a69d6d067ee8187d33e773b82855a,9f4fd2531e290e59056367c41697edda5f08ca06..e8c6ab7f39913d568e32c71d6252249d3a60a03c
@@@ -79,10 -79,9 +79,11 @@@ void avcodec_register_all(void
      REGISTER_HWACCEL(H264_DXVA2,        h264_dxva2);
      REGISTER_HWACCEL(H264_VAAPI,        h264_vaapi);
      REGISTER_HWACCEL(H264_VDA,          h264_vda);
+     REGISTER_HWACCEL(H264_VDA_OLD,      h264_vda_old);
      REGISTER_HWACCEL(H264_VDPAU,        h264_vdpau);
 +    REGISTER_HWACCEL(MPEG1_XVMC,        mpeg1_xvmc);
      REGISTER_HWACCEL(MPEG1_VDPAU,       mpeg1_vdpau);
 +    REGISTER_HWACCEL(MPEG2_XVMC,        mpeg2_xvmc);
      REGISTER_HWACCEL(MPEG2_DXVA2,       mpeg2_dxva2);
      REGISTER_HWACCEL(MPEG2_VAAPI,       mpeg2_vaapi);
      REGISTER_HWACCEL(MPEG2_VDPAU,       mpeg2_vdpau);
Simple merge
index 0000000000000000000000000000000000000000,f71fb164885e5d79af4e8479b55af70560191ad4..170580f16abfc80301fc5d834f505ec8045dddfd
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,72 +1,72 @@@
 - * This file is part of Libav.
+ /*
 - * Libav is free software; you can redistribute it and/or
++ * This file is part of FFmpeg.
+  *
 - * Libav is distributed in the hope that it will be useful,
++ * FFmpeg is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU Lesser General Public
+  * License as published by the Free Software Foundation; either
+  * version 2.1 of the License, or (at your option) any later version.
+  *
 - * License along with Libav; if not, write to the Free Software
++ * FFmpeg is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
++ * License along with FFmpeg; if not, write to the Free Software
+  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+  */
+ #include "config.h"
+ #include "libavutil/mem.h"
+ #include "vda.h"
+ #include "vda_internal.h"
+ #if CONFIG_H264_VDA_HWACCEL
+ AVVDAContext *av_vda_alloc_context(void)
+ {
+     AVVDAContext *ret = av_mallocz(sizeof(*ret));
+     if (ret)
+         ret->output_callback = ff_vda_output_callback;
+     return ret;
+ }
+ int av_vda_default_init(AVCodecContext *avctx)
+ {
+     avctx->hwaccel_context = av_vda_alloc_context();
+     if (!avctx->hwaccel_context)
+         return AVERROR(ENOMEM);
+     return ff_vda_default_init(avctx);
+ }
+ void av_vda_default_free(AVCodecContext *avctx)
+ {
+     ff_vda_default_free(avctx);
+     av_freep(&avctx->hwaccel_context);
+ }
+ void ff_vda_default_free(AVCodecContext *avctx)
+ {
+     AVVDAContext *vda = avctx->hwaccel_context;
+     if (vda && vda->decoder)
+         VDADecoderDestroy(vda->decoder);
+ }
+ #else
+ AVVDAContext *av_vda_alloc_context(void)
+ {
+     return NULL;
+ }
+ int av_vda_default_init(AVCodecContext *avctx)
+ {
+     return AVERROR(ENOSYS);
+ }
+ void av_vda_default_free(AVCodecContext *ctx)
+ {
+ }
+ #endif
index 89059bdf00329076c3605627010ed54e4a4b5fd0,9aa5d297fb768ac17ba8e2d07b2160c35cf5f4f5..12330aa36376b2132cae353f3320b51a93090404
@@@ -29,6 -29,9 +29,8 @@@
   * Public libavcodec VDA header.
   */
  
 -#include "libavcodec/version.h"
+ #include "libavcodec/avcodec.h"
  #include <stdint.h>
  
  // emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes
index 745b3da734119a9577a6143bb683f2612dbd6b32,c7f6a7432e9f4eb411598a8f1eb753984ad102ca..2bb45c317e3c4bff9463dfb09f082a567ad00004
   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
 +#include <CoreFoundation/CFDictionary.h>
  #include <CoreFoundation/CFNumber.h>
  #include <CoreFoundation/CFData.h>
 -#include <CoreFoundation/CFString.h>
  
 +#include "vda.h"
  #include "libavutil/avutil.h"
  #include "h264.h"
 -#include "vda.h"
 +
 +struct vda_buffer {
 +    CVPixelBufferRef cv_buffer;
 +};
+ #include "internal.h"
+ #include "vda_internal.h"
  
  typedef struct VDAContext {
      // The current bitstream buffer.
  
      // The reference size used for fast reallocation.
      int                  allocated_size;
+     CVImageBufferRef frame;
  } VDAContext;
  
 -/* Decoder callback that adds the VDA frame to the queue in display order. */
 +/* Decoder callback that adds the vda frame to the queue in display order. */
  static void vda_decoder_callback(void *vda_hw_ctx,
                                   CFDictionaryRef user_info,
                                   OSStatus status,
@@@ -127,14 -124,7 +131,14 @@@ static int vda_old_h264_decode_slice(AV
      return 0;
  }
  
- static int vda_h264_end_frame(AVCodecContext *avctx)
 +static void vda_h264_release_buffer(void *opaque, uint8_t *data)
 +{
 +    struct vda_buffer *context = opaque;
 +    CVPixelBufferRelease(context->cv_buffer);
 +    av_free(context);
 +}
 +
+ static int vda_old_h264_end_frame(AVCodecContext *avctx)
  {
      H264Context *h                      = avctx->priv_data;
      VDAContext *vda                     = avctx->internal->hwaccel_priv_data;
index 0000000000000000000000000000000000000000,9d0ed807bf3455f746f42715bbdcbdbcbb0788f9..457916b05885430b97dd02de3b80d0b74ab6c02c
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,33 +1,33 @@@
 - * This file is part of Libav.
+ /*
 - * Libav is free software; you can redistribute it and/or
++ * This file is part of FFmpeg.
+  *
 - * Libav is distributed in the hope that it will be useful,
++ * FFmpeg is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU Lesser General Public
+  * License as published by the Free Software Foundation; either
+  * version 2.1 of the License, or (at your option) any later version.
+  *
 - * License along with Libav; if not, write to the Free Software
++ * FFmpeg is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
++ * License along with FFmpeg; if not, write to the Free Software
+  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+  */
+ #ifndef AVCODEC_VDA_INTERNAL_H
+ #define AVCODEC_VDA_INTERNAL_H
+ #include "vda.h"
+ void ff_vda_output_callback(void *vda_hw_ctx,
+                             CFDictionaryRef user_info,
+                             OSStatus status,
+                             uint32_t infoFlags,
+                             CVImageBufferRef image_buffer);
+ int ff_vda_default_init(AVCodecContext *avctx);
+ void ff_vda_default_free(AVCodecContext *avctx);
+ #endif /* AVCODEC_VDA_INTERNAL_H */