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 00032 #include <pthread.h> 00033 #include <stdint.h> 00034 00035 // emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes 00036 // http://openradar.appspot.com/8026390 00037 #undef __GNUC_STDC_INLINE__ 00038 00039 #define Picture QuickdrawPicture 00040 #include <VideoDecodeAcceleration/VDADecoder.h> 00041 #undef Picture 00042 00053 typedef struct { 00060 int64_t pts; 00061 00068 CVPixelBufferRef cv_buffer; 00069 00076 struct vda_frame *next_frame; 00077 } vda_frame; 00078 00085 struct vda_context { 00092 VDADecoder decoder; 00093 00100 vda_frame *queue; 00101 00108 pthread_mutex_t queue_mutex; 00109 00116 int width; 00117 00124 int height; 00125 00132 int format; 00133 00140 OSType cv_pix_fmt_type; 00141 00148 uint8_t *bitstream; 00149 00156 int bitstream_size; 00157 00164 int ref_size; 00165 }; 00166 00168 int ff_vda_create_decoder(struct vda_context *vda_ctx, 00169 uint8_t *extradata, 00170 int extradata_size); 00171 00173 int ff_vda_destroy_decoder(struct vda_context *vda_ctx); 00174 00176 vda_frame *ff_vda_queue_pop(struct vda_context *vda_ctx); 00177 00179 void ff_vda_release_vda_frame(vda_frame *frame); 00180 00185 #endif /* AVCODEC_VDA_H */