Ejemplo n.º 1
0
static void close_file( void *private_stuff )
{
    dummy_handler_t *hp = (dummy_handler_t *)private_stuff;
    if( !hp )
        return;
    lw_free( hp->dummy_data );
    lw_free( hp );
}
Ejemplo n.º 2
0
/* Deallocate the handler of this plugin. */
static void free_handler
(
    lwlibav_handler_t **hpp
)
{
    if( !hpp || !*hpp )
        return;
    lwlibav_handler_t *hp = *hpp;
    lw_free( lwlibav_video_get_preferred_decoder_names( hp->vdhp ) );
    lwlibav_video_free_decode_handler( hp->vdhp );
    lwlibav_video_free_output_handler( hp->vohp );
    lwlibav_audio_free_decode_handler( hp->adhp );
    lwlibav_audio_free_output_handler( hp->aohp );
    lw_free( hp->lwh.file_path );
    lw_free( hp );
}
Ejemplo n.º 3
0
/* Deallocate the handler of this plugin. */
static void free_handler
(
    lsmas_handler_t **hpp
)
{
    if( !hpp || !*hpp )
        return;
    lsmas_handler_t *hp = *hpp;
    lsmash_root_t *root = libavsmash_video_get_root( hp->vdhp );
    lw_free( libavsmash_video_get_preferred_decoder_names( hp->vdhp ) );
    libavsmash_video_free_decode_handler( hp->vdhp );
    libavsmash_video_free_output_handler( hp->vohp );
    avformat_close_input( &hp->format_ctx );
    lsmash_close_file( &hp->file_param );
    lsmash_destroy_root( root );
    lw_free( hp );
}
Ejemplo n.º 4
0
static void close_file( void *private_stuff )
{
    avs_handler_t *hp = (avs_handler_t *)private_stuff;
    if( !hp )
        return;
    if( hp->library )
        close_avisynth_dll( hp );
    lw_free( hp );
}
Ejemplo n.º 5
0
void libavsmash_video_free_output_handler
(
    libavsmash_video_output_handler_t *vohp
)
{
    if( !vohp )
        return;
    lw_cleanup_video_output_handler( vohp );
    lw_free( vohp );
}
Ejemplo n.º 6
0
void lwlibav_audio_free_output_handler
(
    lwlibav_audio_output_handler_t *aohp
)
{
    if( !aohp )
        return;
    lw_cleanup_audio_output_handler( aohp );
    lw_free( aohp );
}
void libavsmash_audio_free_decode_handler
(
    libavsmash_audio_decode_handler_t *adhp
)
{
    if( !adhp )
        return;
    av_frame_free( &adhp->frame_buffer );
    cleanup_configuration( &adhp->config );
    lw_free( adhp );
}
Ejemplo n.º 8
0
static void vs_free_video_output_handler
(
    void *private_handler
)
{
    vs_video_output_handler_t *vs_vohp = (vs_video_output_handler_t *)private_handler;
    if( !vs_vohp )
        return;
    if( vs_vohp->vsapi && vs_vohp->vsapi->freeFrame && vs_vohp->background_frame )
        vs_vohp->vsapi->freeFrame( vs_vohp->background_frame );
    lw_free( vs_vohp );
}
Ejemplo n.º 9
0
void libavsmash_video_free_decode_handler
(
    libavsmash_video_decode_handler_t *vdhp
)
{
    if( !vdhp )
        return;
    lw_freep( &vdhp->keyframe_list );
    lw_freep( &vdhp->order_converter );
    av_frame_free( &vdhp->frame_buffer );
    av_frame_free( &vdhp->first_valid_frame );
    cleanup_configuration( &vdhp->config );
    lw_free( vdhp );
}
Ejemplo n.º 10
0
void lwlibav_audio_free_decode_handler
(
    lwlibav_audio_decode_handler_t *adhp
)
{
    if( !adhp )
        return;
    lwlibav_extradata_handler_t *exhp = &adhp->exh;
    if( exhp->entries )
    {
        for( int i = 0; i < exhp->entry_count; i++ )
            if( exhp->entries[i].extradata )
                av_free( exhp->entries[i].extradata );
        lw_free( exhp->entries );
    }
    av_packet_unref( &adhp->packet );
    lw_free( adhp->frame_list );
    av_free( adhp->index_entries );
    av_frame_free( &adhp->frame_buffer );
    avcodec_free_context( &adhp->ctx );
    if( adhp->format )
        lavf_close_file( &adhp->format );
    lw_free( adhp );
}
Ejemplo n.º 11
0
static void *open_file( char *file_name, reader_option_t *opt )
{
    /* Check file extension. */
    if( lw_check_file_extension( file_name, "avs" ) < 0 )
        return NULL;
    /* Try to open the file as avisynth script. */
    avs_handler_t *hp = lw_malloc_zero( sizeof(avs_handler_t) );
    if( !hp )
        return NULL;
    AVS_Value res = initialize_avisynth( hp, file_name );
    if( !avs_is_clip( res ) )
    {
        if( hp->library )
            close_avisynth_dll( hp );
        lw_free( hp );
        return NULL;
    }
    hp->func.avs_release_value( res );
    return hp;
}