static void gavf_stream_free(gavf_stream_t * s) { if(s->asrc) gavl_audio_source_destroy(s->asrc); if(s->vsrc) gavl_video_source_destroy(s->vsrc); if(s->psrc) gavl_packet_source_destroy(s->psrc); if(s->asink) gavl_audio_sink_destroy(s->asink); if(s->vsink) gavl_video_sink_destroy(s->vsink); if(s->psink) gavl_packet_sink_destroy(s->psink); if(s->pb) gavf_packet_buffer_destroy(s->pb); if(s->aframe) { gavl_audio_frame_null(s->aframe); gavl_audio_frame_destroy(s->aframe); } if(s->vframe) { gavl_video_frame_null(s->vframe); gavl_video_frame_destroy(s->vframe); } }
void gavf_close(gavf_t * g) { int i; if(g->wr) { if(g->streams) { /* Flush packets if any */ gavf_flush_packets(g, NULL); /* Append final sync header */ write_sync_header(g, -1, NULL); } /* Write footer */ if(!gavf_footer_write(g)) return; } /* Free stuff */ if(g->streams) { for(i = 0; i < g->ph.num_streams; i++) gavf_stream_free(&g->streams[i]); free(g->streams); } gavf_sync_index_free(&g->si); gavf_packet_index_free(&g->pi); gavf_program_header_free(&g->ph); if(g->cl) gavl_chapter_list_destroy(g->cl); if(g->write_vframe) { gavl_video_frame_null(g->write_vframe); gavl_video_frame_destroy(g->write_vframe); } if(g->write_aframe) { gavl_audio_frame_null(g->write_aframe); gavl_audio_frame_destroy(g->write_aframe); } if(g->sync_pts) free(g->sync_pts); gavl_packet_free(&g->write_pkt); gavf_buffer_free(&g->pkt_buf); gavf_buffer_free(&g->meta_buf); gavl_metadata_free(&g->metadata); free(g); }
void gavl_video_scaler_destroy(gavl_video_scaler_t * s) { int i, j; gavl_video_frame_null(s->src); gavl_video_frame_null(s->dst); gavl_video_frame_destroy(s->src); gavl_video_frame_destroy(s->dst); for(i = 0; i < 3; i++) { for(j = 0; j < GAVL_MAX_PLANES; j++) { gavl_video_scale_context_cleanup(&s->contexts[i][j]); } } free(s); }
livido_deinit_f deinit_instance( livido_port_t *my_instance ) { scale0tilt_instance_t *inst = NULL; livido_property_get( my_instance, "PLUGIN_private", 0, &inst ); gavl_video_scaler_destroy(inst->video_scaler); gavl_video_frame_null( inst->frame_src ); gavl_video_frame_destroy( inst->frame_src ); gavl_video_frame_null( inst->frame_dst ); gavl_video_frame_destroy( inst->frame_dst ); gavl_video_frame_null( inst->temp ); gavl_video_frame_destroy( inst->temp ); gavl_video_frame_null( inst->temp_alpha ); gavl_video_frame_destroy( inst->temp_alpha ); free(inst); livido_property_set( my_instance, "PLUGIN_private", LIVIDO_ATOM_TYPE_VOIDPTR, 0, NULL ); return LIVIDO_NO_ERROR; }
static void close_schroedinger(bgav_stream_t * s) { schroedinger_priv_t * priv; priv = s->decoder_priv; if(priv->dec) schro_decoder_free(priv->dec); gavl_video_frame_null(priv->frame); gavl_video_frame_destroy(priv->frame); free(priv); }
static void destroy_swapfields(void * priv) { swapfields_priv_t * vp; vp = priv; if(vp->cpy_field) { gavl_video_frame_null(vp->cpy_field); gavl_video_frame_destroy(vp->cpy_field); } if(vp->fields[0]) gavl_video_frame_destroy(vp->fields[0]); if(vp->fields[1]) gavl_video_frame_destroy(vp->fields[1]); if(vp->out_src) gavl_video_source_destroy(vp->out_src); free(vp); }