Lines Matching defs:vda_ctx
66 static void vda_clear_queue(struct vda_context *vda_ctx)
70 pthread_mutex_lock(&vda_ctx->queue_mutex);
72 while (vda_ctx->queue) {
73 top_frame = vda_ctx->queue;
74 vda_ctx->queue = top_frame->next_frame;
78 pthread_mutex_unlock(&vda_ctx->queue_mutex);
88 struct vda_context *vda_ctx = vda_hw_ctx;
95 if (vda_ctx->cv_pix_fmt_type != CVPixelBufferGetPixelFormatType(image_buffer))
104 pthread_mutex_lock(&vda_ctx->queue_mutex);
106 queue_walker = vda_ctx->queue;
111 vda_ctx->queue = new_frame;
126 pthread_mutex_unlock(&vda_ctx->queue_mutex);
129 int ff_vda_create_decoder(struct vda_context *vda_ctx,
143 pthread_mutex_init(&vda_ctx->queue_mutex, NULL);
150 height = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &vda_ctx->height);
151 width = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &vda_ctx->width);
152 format = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &vda_ctx->format);
170 &vda_ctx->cv_pix_fmt_type);
181 vda_ctx,
182 &vda_ctx->decoder);
199 int ff_vda_destroy_decoder(struct vda_context *vda_ctx)
203 if (vda_ctx->decoder)
204 status = VDADecoderDestroy(vda_ctx->decoder);
206 vda_clear_queue(vda_ctx);
208 pthread_mutex_destroy(&vda_ctx->queue_mutex);
216 vda_frame *ff_vda_queue_pop(struct vda_context *vda_ctx)
220 if (!vda_ctx->queue)
223 pthread_mutex_lock(&vda_ctx->queue_mutex);
224 top_frame = vda_ctx->queue;
225 vda_ctx->queue = top_frame->next_frame;
226 pthread_mutex_unlock(&vda_ctx->queue_mutex);
239 int ff_vda_decoder_decode(struct vda_context *vda_ctx,
250 status = VDADecoderDecode(vda_ctx->decoder, 0, coded_frame, user_info);