// // Desctructor // GF_Err gf_odf_del_qos(GF_QoS_Descriptor *qos) { if (!qos) return GF_BAD_PARAM; while (gf_list_count(qos->QoS_Qualifiers)) { GF_QoS_Default *tmp = (GF_QoS_Default*)gf_list_get(qos->QoS_Qualifiers, 0); gf_odf_delete_qos_qual(tmp); gf_list_rem(qos->QoS_Qualifiers, 0); } gf_list_del(qos->QoS_Qualifiers); return GF_OK; }
static void DestroyBackground2D(GF_Node *node) { Background2DStack *stack = (Background2DStack *) gf_node_get_private(node); PreDestroyBindable(node, stack->reg_stacks); gf_list_del(stack->reg_stacks); while (gf_list_count(stack->status_stack)) { BackgroundStatus *status = (BackgroundStatus *)gf_list_get(stack->status_stack, 0); gf_list_rem(stack->status_stack, 0); gf_free(status); } gf_list_del(stack->status_stack); drawable_del(stack->drawable); gf_sc_texture_destroy(&stack->txh); #ifndef GPAC_DISABLE_3D if (stack->mesh) mesh_free(stack->mesh); #endif gf_free(stack); }
GF_EXPORT void gf_xml_sax_del(GF_SAXParser *parser) { xml_sax_reset(parser); gf_list_del(parser->entities); #ifdef NO_GZIP if (parser->f_in) fclose(parser->f_in); #else if (parser->gz_in) gzclose(parser->gz_in); #endif gf_free(parser); }
GPAC_MediaRenderer::~GPAC_MediaRenderer() { if (m_mediaHistoryList) { /* empty mediaHistoryList */ while (gf_list_count(m_mediaHistoryList) > 0) { char * last = (char*)gf_list_last(m_mediaHistoryList); gf_list_rem_last(m_mediaHistoryList); gf_free(last); } gf_list_del(m_mediaHistoryList); } }
static void composite_traverse(GF_Node *node, void *rs, Bool is_destroy) { if (is_destroy) { u32 i=0; GF_VisualManager *a_visual; CompositeTextureStack *st = (CompositeTextureStack *) gf_node_get_private(node); /*unregister visual*/ gf_sc_visual_unregister(st->visual->compositor, st->visual); /*We must make sure we don't keep pointers to this composite in the different visuals. - we must track Appearance nodes at the compositor level to undo the textureTransform while picking - but we clearly don't want to track destruction of all appearance nodes just to solve this texture delete => remove the entire compositeTexture appearance state - this may lead to small bugs in interaction logics, however they should not be too damageable */ st->visual->compositor->hit_appear = NULL; st->visual->compositor->prev_hit_appear = NULL; while ( (a_visual = gf_list_enum(st->visual->compositor->visuals, &i))) { if (a_visual->offscreen) { CompositeTextureStack *a_st = (CompositeTextureStack *) gf_node_get_private(a_visual->offscreen); a_st->prev_hit_appear = NULL; } } visual_del(st->visual); if (st->txh.data) gf_free(st->txh.data); /*destroy texture*/ gf_sc_texture_destroy(&st->txh); #ifdef GPAC_USE_TINYGL if (st->tgl_ctx) ostgl_delete_context(st->tgl_ctx); #endif gf_list_del(st->sensors); gf_list_del(st->previous_sensors); gf_free(st); } else { gf_node_traverse_children(node, rs); } }
/*render : setup media sensor and update timing in case of inline scenes*/ void RenderMediaSensor(GF_Node *node, void *rs, Bool is_destroy) { GF_TraverseState *tr_state = (GF_TraverseState *)rs; GF_Clock *ck; Bool do_update_clock = 1; MediaSensorStack *st = (MediaSensorStack *)gf_node_get_private(node); if (is_destroy) { /*unlink from OD*/ if (st->stream && st->stream->odm) gf_list_del_item(st->stream->odm->ms_stack, st); gf_list_del(st->seg); gf_free(st); return; } //we need to disable culling otherwise we may never be called back again ... tr_state->disable_cull = 1; if (!st->stream) st->stream = gf_mo_register(node, &st->sensor->url, 0, 0); if (!st->stream || !st->stream->odm) return; if (!st->is_init) { gf_list_add(st->stream->odm->ms_stack, st); gf_odm_init_segments(st->stream->odm, st->seg, &st->sensor->url); st->is_init = 1; st->active_seg = 0; } /*media sensor bound to natural media (audio, video) is updated when fetching the stream data for rendering.*/ ck = NULL; /*check inline scenes - if the scene is set to restart DON'T MODIFY SENSOR: since we need a 2 render passes to restart inline, scene is considered as not running*/ if (st->stream->odm->subscene && !st->stream->odm->subscene->needs_restart) { if (st->stream->odm->subscene->scene_codec) ck = st->stream->odm->subscene->scene_codec->ck; /*dynamic scene*/ else ck = st->stream->odm->subscene->dyn_ck; if (st->stream->odm->subscene->is_dynamic_scene) do_update_clock = 0; } /*check anim streams*/ else if (st->stream->odm->codec && (st->stream->odm->codec->type==GF_STREAM_SCENE)) ck = st->stream->odm->codec->ck; /*check OCR streams*/ else if (st->stream->odm->ocr_codec) ck = st->stream->odm->ocr_codec->ck; if (ck && gf_clock_is_started(ck) ) { if (do_update_clock) st->stream->odm->media_current_time = gf_clock_media_time(ck); mediasensor_update_timing(st->stream->odm, 0); } }
void gf_font_predestroy(GF_Font *font) { if (font->spans) { while (gf_list_count(font->spans)) { GF_TextSpan *ts = gf_list_get(font->spans, 0); gf_list_rem(font->spans, 0); gf_node_dirty_set(ts->user, 0, 0); ts->user=NULL; } gf_list_del(font->spans); font->spans = NULL; } }
void iinf_del(GF_Box *s) { u32 count, i; GF_ItemInfoBox *ptr = (GF_ItemInfoBox *)s; if (ptr == NULL) return; count = gf_list_count(ptr->item_infos); for (i = 0; i < count; i++) { GF_Box *a = (GF_Box *)gf_list_get(ptr->item_infos, i); gf_isom_box_del(a); } gf_list_del(ptr->item_infos); gf_free(ptr); }
GPAC_MODULE_EXPORT void ShutdownInterface(GF_BaseInterface *bi) { GF_InputService *ifcn = (GF_InputService*)bi; if (ifcn->InterfaceType==GF_NET_CLIENT_INTERFACE) { DCReader *read = (DCReader*)ifcn->priv; assert(!gf_list_count(read->channels)); gf_list_del(read->channels); if( read->url) gf_free(read->url); gf_free(read); gf_free(bi); } }
void ipro_del(GF_Box *s) { u32 count, i; GF_ItemProtectionBox *ptr = (GF_ItemProtectionBox *)s; if (ptr == NULL) return; count = gf_list_count(ptr->protection_information); for (i = 0; i < count; i++) { GF_Box *a = (GF_Box *)gf_list_get(ptr->protection_information, i); gf_isom_box_del(a); } gf_list_del(ptr->protection_information); gf_free(ptr); }
GF_Err cleanup_list_of_elements(GF_List * list) { GF_Err result = GF_OK; if (list == NULL) return result; while (gf_list_count(list)) { PlaylistElement * pl = (PlaylistElement *) gf_list_get(list, 0); if (pl) result |= playlist_element_del(pl); gf_list_rem(list, 0); } gf_list_del(list); return result; }
static void DestroyComposite2D(GF_Node *node, void *rs, Bool is_destroy) { if (is_destroy) { Composite2DStack *st = (Composite2DStack *) gf_node_get_private(node); /*unregister surface*/ R2D_UnregisterSurface(st->surf->render, st->surf); DeleteVisualSurface2D(st->surf); gf_list_del(st->sensors); /*destroy texture*/ gf_sr_texture_destroy(&st->txh); free(st); } }
GF_EXPORT void gf_sm_del(GF_SceneManager *ctx) { u32 count; while ( (count = gf_list_count(ctx->streams)) ) { GF_StreamContext *sc = (GF_StreamContext *)gf_list_get(ctx->streams, count-1); gf_list_rem(ctx->streams, count-1); gf_sm_delete_stream(sc); } gf_list_del(ctx->streams); if (ctx->root_od) gf_odf_desc_del((GF_Descriptor *) ctx->root_od); gf_free(ctx); }
void iloc_del(GF_Box *s) { u32 i, item_count; GF_ItemLocationBox *ptr = (GF_ItemLocationBox *)s; if (ptr == NULL) return; item_count = gf_list_count(ptr->location_entries); for (i = 0; i < item_count; i++) { GF_ItemLocationEntry *location = (GF_ItemLocationEntry *)gf_list_get(ptr->location_entries, i); iloc_entry_del(location); } gf_list_del(ptr->location_entries); gf_free(ptr); }
static GF_Err swf_svg_show_frame(SWFReader *read) { u32 i; u32 len; GF_List *sdl = gf_list_new(); // sorted display list /* sorting the display list */ while (gf_list_count(read->display_list)) { Bool inserted = 0; DispShape *s; s = (DispShape *)gf_list_get(read->display_list, 0); gf_list_rem(read->display_list, 0); for (i = 0; i < gf_list_count(sdl); i++) { DispShape *s2 = (DispShape *)gf_list_get(sdl, i); if (s->depth < s2->depth) { gf_list_insert(sdl, s, i); inserted = 1; break; } } if (!inserted) { gf_list_add(sdl, s); } } gf_list_del(read->display_list); read->display_list = sdl; /* dumping the display list */ len = gf_list_count(read->display_list); for (i=0; i<len; i++) { DispShape *s; s = (DispShape *)gf_list_get(read->display_list, i); fprintf(read->svg_output, "<use xlink:href=\"#S%d\" z-index=\"%d\" ", s->char_id, s->depth); swf_svg_print_matrix(read, &s->mat); fprintf(read->svg_output, "/>\n"); } fprintf(read->svg_output, "</g>\n"); fprintf(read->svg_output, "<g id=\"frame%d\" display=\"none\">\n",read->current_frame+1); fprintf(read->svg_output, "<animate attributeName=\"display\" to=\"inline\" begin=\"%f\" end=\"%f\" fill=\"%s\" restart=\"never\"/>\n", 1.0*(read->current_frame+1)/read->frame_rate, 1.0*(read->current_frame+2)/read->frame_rate, (((read->current_frame+1) <= (read->frame_count-1)) ? "remove" : "freeze")); return GF_OK; }
GF_Err gf_isom_remove_samp_group_box(GF_ISOFile *the_file, u32 trackNumber) { u32 i; GF_SampleTableBox *stbl; GF_TrackBox *trak = gf_isom_get_track_from_file(the_file, trackNumber); if (!trak) return GF_BAD_PARAM; stbl = trak->Media->information->sampleTable; if (!stbl) return GF_BAD_PARAM; for (i = 0; i < gf_list_count(stbl->sampleGroupsDescription); i++) { GF_SampleGroupDescriptionBox *a = (GF_SampleGroupDescriptionBox *)gf_list_get(stbl->sampleGroupsDescription, i); if (a->grouping_type == GF_4CC( 's', 'e', 'i', 'g' )) { gf_list_rem(stbl->sampleGroupsDescription, i); sgpd_del((GF_Box *) a); i--; } } if (!gf_list_count(stbl->sampleGroupsDescription)) { gf_list_del(stbl->sampleGroupsDescription); stbl->sampleGroupsDescription = NULL; } for (i = 0; i < gf_list_count(stbl->sampleGroups); i++) { GF_SampleGroupBox *a = (GF_SampleGroupBox *)gf_list_get(stbl->sampleGroups, i); if (a->grouping_type == GF_4CC( 's', 'e', 'i', 'g' )) { gf_list_rem(stbl->sampleGroups, i); sbgp_del((GF_Box *) a); i--; } } if (!gf_list_count(stbl->sampleGroups)) { gf_list_del(stbl->sampleGroups); stbl->sampleGroups = NULL; } return GF_OK; }
void gf_isom_hint_rtp_del(GF_RTPPacket *ptr) { GF_GenericDTE *p; //the DTE while (gf_list_count(ptr->DataTable)) { p = (GF_GenericDTE *)gf_list_get(ptr->DataTable, 0); DelDTE(p); gf_list_rem(ptr->DataTable, 0); } gf_list_del(ptr->DataTable); //the TLV gf_isom_box_array_del(ptr->TLV); gf_free(ptr); }
GF_EXPORT void gf_oci_codec_del(OCICodec *codec) { OCIEvent *ev; if (!codec) return; while (gf_list_count(codec->OCIEvents)) { ev = (OCIEvent *)gf_list_get(codec->OCIEvents, 0); gf_oci_event_del(ev); gf_list_rem(codec->OCIEvents, 0); } gf_list_del(codec->OCIEvents); free(codec); }
GF_EXPORT void gf_oci_event_del(OCIEvent *event) { GF_Descriptor *desc; if (!event) return; while (gf_list_count(event->OCIDescriptors)) { desc = (GF_Descriptor *)gf_list_get(event->OCIDescriptors, 0); gf_list_rem(event->OCIDescriptors, 0); gf_odf_delete_descriptor(desc); } gf_list_del(event->OCIDescriptors); free(event); }
void gf_isom_hint_sample_del(GF_HintSample *ptr) { GF_HintPacket *pck; while (gf_list_count(ptr->packetTable)) { pck = (GF_HintPacket *)gf_list_get(ptr->packetTable, 0); gf_isom_hint_pck_del(ptr->HintType, pck); gf_list_rem(ptr->packetTable, 0); } gf_list_del(ptr->packetTable); if (ptr->AdditionalData) gf_free(ptr->AdditionalData); if (ptr->sample_cache) { while (gf_list_count(ptr->sample_cache)) { GF_HintDataCache *hdc = (GF_HintDataCache *)gf_list_get(ptr->sample_cache, 0); gf_list_rem(ptr->sample_cache, 0); if (hdc->samp) gf_isom_sample_del(&hdc->samp); gf_free(hdc); } gf_list_del(ptr->sample_cache); } gf_free(ptr); }
GPAC_MediaController::~GPAC_MediaController() { delete m_MediaController; m_MediaController=NULL; delete m_MediaBrowser; m_MediaBrowser=NULL; while (gf_list_count(m_MediaServers)) { GPAC_MediaServerItem*ms = (GPAC_MediaServerItem*)gf_list_get(m_MediaServers, 0); gf_list_rem(m_MediaServers, 0); delete ms; } gf_list_del(m_MediaServers); while (gf_list_count(m_MediaRenderers)) { GPAC_MediaRendererItem *ms = (GPAC_MediaRendererItem *)gf_list_get(m_MediaRenderers, 0); gf_list_rem(m_MediaRenderers, 0); delete ms; } gf_list_del(m_MediaRenderers); gf_mx_del(m_ControlPointLock); }
void ft_delete(GF_BaseInterface *ifce) { GF_FontReader *dr = (GF_FontReader *) ifce; FTBuilder *ftpriv = dr->udta; while (gf_list_count(ftpriv->font_dirs)) { char *font = gf_list_pop_back(ftpriv->font_dirs); if (font) gf_free(font); } gf_list_del(ftpriv->font_dirs); if (ftpriv->font_serif) gf_free(ftpriv->font_serif); if (ftpriv->font_sans) gf_free(ftpriv->font_sans); if (ftpriv->font_fixed) gf_free(ftpriv->font_fixed); assert(!gf_list_count(ftpriv->loaded_fonts) ); gf_list_del(ftpriv->loaded_fonts); gf_free(dr->udta); gf_free(dr); }
GF_Err variant_playlist_del (VariantPlaylist * playlist) { if (playlist == NULL) return GF_OK; assert( playlist->programs); while (gf_list_count(playlist->programs)) { Program * p = gf_list_get(playlist->programs, 0); assert(p); while (gf_list_count( p->bitrates )) { PlaylistElement * pl = gf_list_get(p->bitrates, 0); assert( pl ); playlist_element_del(pl); gf_list_rem(p->bitrates, 0); } gf_list_del(p->bitrates); p->bitrates = NULL; program_del(p); gf_list_rem(playlist->programs, 0); } gf_list_del(playlist->programs); playlist->programs = NULL; gf_free(playlist); return GF_OK; }
void BindableStackDelete(GF_List *stack) { while (gf_list_count(stack)) { GF_List *bind_stack_list; GF_Node *bindable = (GF_Node*)gf_list_get(stack, 0); gf_list_rem(stack, 0); bind_stack_list = Bindable_GetStack(bindable); if (bind_stack_list) { gf_list_del_item(bind_stack_list, stack); assert(gf_list_find(bind_stack_list, stack)<0); } } gf_list_del(stack); }
GF_EXPORT void gf_odf_codec_del(GF_ODCodec *codec) { if (!codec) return; while (gf_list_count(codec->CommandList)) { GF_ODCom *com = (GF_ODCom *)gf_list_get(codec->CommandList, 0); gf_odf_delete_command(com); gf_list_rem(codec->CommandList, 0); } gf_list_del(codec->CommandList); if (codec->bs) gf_bs_del(codec->bs); gf_free(codec); }
void iref_del(GF_Box *s) { u32 count, i; GF_ItemReferenceBox *ptr = (GF_ItemReferenceBox *)s; if (ptr == NULL) return; count = gf_list_count(ptr->references); for (i = 0; i < count; i++) { GF_Box *a = (GF_Box *)gf_list_get(ptr->references, i); gf_isom_box_del(a); } gf_list_del(ptr->references); ptr->references = NULL; gf_free(ptr); }
GF_EXPORT void gf_modules_del(GF_ModuleManager *pm) { ModuleInstance *inst; if (!pm) return; /*unload all modules*/ while (gf_list_count(pm->plug_list)) { inst = (ModuleInstance *) gf_list_get(pm->plug_list, 0); gf_modules_free_module(inst); gf_list_rem(pm->plug_list, 0); } gf_list_del(pm->plug_list); gf_free(pm); }
static void saf_stream_del(GF_SAFStream *str) { if (str->mime_type) gf_free(str->mime_type); if (str->remote_url) gf_free(str->remote_url); if (str->dsi) gf_free(str->dsi); while (gf_list_count(str->aus)) { GF_SAFSample *au = (GF_SAFSample *)gf_list_last(str->aus); gf_list_rem_last(str->aus); if (au->data) gf_free(au->data); gf_free(au); } gf_list_del(str->aus); gf_free(str); }
void live_session_shutdown(LiveSession *livesess) { gf_seng_terminate(livesess->seng); if (livesess->streams) { while (gf_list_count(livesess->streams)) { RTPChannel *rtpch = gf_list_get(livesess->streams, 0); gf_list_rem(livesess->streams, 0); gf_rtp_streamer_del(rtpch->rtp); if (rtpch->carousel_data) gf_free(rtpch->carousel_data); gf_free(rtpch); } gf_list_del(livesess->streams); } }
/*delete all interfaces loaded on object*/ void gf_modules_free_module(ModuleInstance *inst) { void *objinterface; while (gf_list_count(inst->interfaces)) { objinterface = gf_list_get(inst->interfaces, 0); gf_list_rem(inst->interfaces, 0); inst->destroy_func(objinterface); } if (inst->lib_handle) { RLibrary* pLibrary = (RLibrary *) inst->lib_handle; pLibrary->Close(); } gf_list_del(inst->interfaces); gf_free(inst); }