On Nov 11, 2011, at 10:25 AM, Diego Biurrun wrote: > From: Sebastien Zwickert <[email protected]> > > Signed-off-by: Diego Biurrun <[email protected]> > --- > This iteration is updated to apply against HEAD, checks a malloc, eliminates > many suspicious casts and does a few more cosmetic changes. It's completely > untested as I have no access to a suitable testing environment. Compilation > and runtime tests highly appreciated. Please use this as base for changes.
The removing of casts in CFDictionaryCreate generates compiler warnings.
The compilation fails cause of the def/undef workaround is necessary.
The compilation fails with gcc-4.2.1 because the emmintrin.h workaround has
been removed.
I do some tests with VLC and I experienced invalid free when opening or closing
the stream. It looks like to be a conflict between ffmpeg-hw and ffmpeg-threads.
Otherwise video playback plays fine through the vda decoder.
Moreover, I put destination image buffer attributes in the vda_context struct in
order to the client is able to choose its preferred output pixel format for
image buffers.
> [...]
> +/* 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,
> + uint32_t infoFlags,
> + CVImageBufferRef image_buffer)
> +{
> + struct vda_context *vda_ctx = vda_hw_ctx;
> + vda_frame *new_frame;
> + vda_frame *queue_walker;
> +
> + if (!image_buffer)
> + return;
> +
> + if (kCVPixelFormatType_422YpCbCr8 !=
> CVPixelBufferGetPixelFormatType(image_buffer))
> + return;
> +
> + if (!(new_frame = av_mallocz(sizeof(vda_frame)));
> + return AVERROR_ENOMEM;
I removed AVERROR_ENOMEM.
> [...]
> +
> +#ifndef AVCODEC_VDA_H
> +#define AVCODEC_VDA_H
> +
> +#include <pthread.h>
> +#include <stdint.h>
> +#include <VideoDecodeAcceleration/VDADecoder.h>
I added again emmintrin and def/undef Picture workarounds.
> [...]
> +static int end_frame(AVCodecContext *avctx)
> +{
> + H264Context *h = avctx->priv_data;
> + struct vda_context *vda_ctx = avctx->hwaccel_context;
> + struct vda_picture_context *pic_ctx =
> h->s.current_picture_ptr->f.hwaccel_picture_private;
> + AVFrame *frame = &h->s.current_picture_ptr.f;
This line fails to compile i changed it with the following line
AVFrame *frame = &h->s.current_picture_ptr->f;
> […]
Patch updated in attachment.
Best regards,
Sebastien
0001-hwaccel-OS-X-Video-Decoder-Acceleration-VDA-support.patch
Description: Binary data
_______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
