Exemplo n.º 1
0
static void Close( vlc_va_t *p_external )
{
    vlc_va_vda_t *p_va = vlc_va_vda_Get( p_external );

    ff_vda_destroy_decoder( &p_va->hw_ctx ) ;

    if( p_va->top_frame )
        ff_vda_release_vda_frame( p_va->top_frame );

    if( p_va->hw_ctx.cv_pix_fmt_type == kCVPixelFormatType_420YpCbCr8Planar )
        CopyCleanCache( &p_va->image_cache );

    free( p_va );
}
Exemplo n.º 2
0
/* Removes and releases all frames from the queue. */
static void vda_clear_queue(struct vda_context *vda_ctx)
{
    vda_frame *top_frame;

    pthread_mutex_lock(&vda_ctx->queue_mutex);

    while (vda_ctx->queue) {
        top_frame = vda_ctx->queue;
        vda_ctx->queue = top_frame->next_frame;
        ff_vda_release_vda_frame(top_frame);
    }

    pthread_mutex_unlock(&vda_ctx->queue_mutex);
}
Exemplo n.º 3
0
static int Get( vlc_va_t *p_external, AVFrame *p_ff )
{
    vlc_va_vda_t *p_va = vlc_va_vda_Get( p_external );

    if( p_va->top_frame )
        ff_vda_release_vda_frame( p_va->top_frame );

    p_va->top_frame = ff_vda_queue_pop( &p_va->hw_ctx );

    /* */
    for( int i = 0; i < 4; i++ )
    {
        p_ff->data[i] = NULL;
        p_ff->linesize[i] = 0;

        if( i == 0 || i == 3 )
        p_ff->data[i] = 1; // dummy
    }

    return VLC_SUCCESS;
}