00001 /* 00002 * VDA HW acceleration 00003 * 00004 * copyright (c) 2011 Sebastien Zwickert 00005 * 00006 * This file is part of FFmpeg. 00007 * 00008 * FFmpeg is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Lesser General Public 00010 * License as published by the Free Software Foundation; either 00011 * version 2.1 of the License, or (at your option) any later version. 00012 * 00013 * FFmpeg is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License along with FFmpeg; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00021 */ 00022 00023 #ifndef AVCODEC_VDA_H 00024 #define AVCODEC_VDA_H 00025 00026 #include <stdint.h> 00027 00028 // emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes 00029 // http://openradar.appspot.com/8026390 00030 #undef __GNUC_STDC_INLINE__ 00031 00032 #define Picture QuickdrawPicture 00033 #include <VideoDecodeAcceleration/VDADecoder.h> 00034 #undef Picture 00035 00039 typedef struct { 00046 int64_t pts; 00047 00054 CVPixelBufferRef cv_buffer; 00055 00062 struct vda_frame *next_frame; 00063 00064 } vda_frame; 00065 00072 struct vda_context { 00079 VDADecoder decoder; 00080 00087 vda_frame *queue; 00088 00095 void *queue_mutex; 00096 00103 int width; 00104 00111 int height; 00112 00119 int format; 00120 00127 OSType cv_pix_fmt_type; 00128 00135 uint8_t *bitstream; 00136 00143 int bitstream_size; 00144 00151 int ref_size; 00152 }; 00153 00155 int ff_vda_create_decoder(struct vda_context *vda_ctx, 00156 uint8_t *extradata, 00157 int extradata_size); 00158 00160 int ff_vda_destroy_decoder(struct vda_context *vda_ctx); 00161 00163 vda_frame *ff_vda_queue_pop(struct vda_context *vda_ctx); 00164 00166 void ff_vda_release_vda_frame(vda_frame *frame); 00167 00168 #endif /* AVCODEC_VDA_H */