On Wed, Nov 09, 2011 at 12:17:16PM -0800, Luca Barbato wrote:
> 
> --- a/configure
> +++ b/configure
> @@ -2988,6 +2992,13 @@ check_func XOpenDisplay -lX11           &&
>  
> +# check for VDA header
> +if ! disabled vda; then
> +    if check_header VideoDecodeAcceleration/VDADecoder.h; then
> +        enable vda && add_ldflags -framework CoreFoundation -framework 
> VideoDecodeAcceleration -framework QuartzCore
> +    fi
> +fi

if ! disabled vda && check_header VideoDecodeAcceleration/VDADecoder.h; then

> --- /dev/null
> +++ b/libavcodec/vda.c
> @@ -0,0 +1,266 @@
> +
> +#include <CoreFoundation/CFDictionary.h>
> +#include <CoreFoundation/CFNumber.h>
> +#include <CoreFoundation/CFData.h>
> +#include <CoreFoundation/CFString.h>
> +
> +#include <pthread.h>
> +#include "vda_internal.h"
> +#include "libavutil/avutil.h"
> +/**
> + * @addtogroup VDA_Decoding
> + *
> + * @{
> + */


  #include <CoreFoundation/CFDictionary.h>
  #include <CoreFoundation/CFNumber.h>
  #include <CoreFoundation/CFData.h>
  #include <CoreFoundation/CFString.h>
  #include <pthread.h>

  #include "libavutil/avutil.h"
  #include "vda_internal.h"

  /**
   * @addtogroup VDA_Decoding
   *
   * @{
   */

> +/* helper to create a dictionary according to the given pts */
> +static CFDictionaryRef vda_dictionary_with_pts(int64_t i_pts)
> +{
> +    CFStringRef key           = CFSTR("FF_VDA_DECODER_PTS_KEY");
> +    CFNumberRef value         = CFNumberCreate(kCFAllocatorDefault,
> +                                               kCFNumberSInt64Type, &i_pts);
> +    CFDictionaryRef user_info = CFDictionaryCreate(kCFAllocatorDefault,
> +                                                   (const void **)&key,
> +                                                   (const void **)&value,
> +                                                   1,
> +                                                   
> &kCFTypeDictionaryKeyCallBacks,
> +                                                   
> &kCFTypeDictionaryValueCallBacks);

I'd still like to know if these casts are necessary.

> +int ff_vda_create_decoder(struct vda_context *vda_ctx,
> +                          uint8_t *extradata,
> +                          int extradata_size)
> +{
> +    buffer_attributes = (CFDictionaryCreateMutable(kCFAllocatorDefault,
> +                                                   2,
> +                                                   
> &kCFTypeDictionaryKeyCallBacks,
> +                                                   
> &kCFTypeDictionaryValueCallBacks));
> +    io_surface_properties = (CFDictionaryCreateMutable(kCFAllocatorDefault,
> +                                                       0,
> +                                                       
> &kCFTypeDictionaryKeyCallBacks,
> +                                                       
> &kCFTypeDictionaryValueCallBacks));

pointless ()

> +    cv_pix_fmt_type = kCVPixelFormatType_422YpCbCr8;
> +    cv_pix_fmt  = CFNumberCreate(kCFAllocatorDefault,
> +                                              kCFNumberSInt32Type, 
> &cv_pix_fmt_type);

Indentation is off.

> +    status = VDADecoderCreate(config_info,
> +                              buffer_attributes,
> +                              (VDADecoderOutputCallback 
> *)vda_decoder_callback,
> +                              (void *)vda_ctx,
> +                              &vda_ctx->decoder );

doubtful cast

> --- /dev/null
> +++ b/libavcodec/vda.h
> @@ -0,0 +1,131 @@
> +
> +#ifndef AVCODEC_VDA_H
> +#define AVCODEC_VDA_H
> +
> +#include <stdint.h>
> +
> +#define Picture QuickdrawPicture
> +#include <VideoDecodeAcceleration/VDADecoder.h>
> +#undef Picture

The #define/#undef hack should now be unnecessary.

> +struct vda_context {
> +
> +    pthread_mutex_t     queue_mutex;

This requires a pthread.h #include.

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to