当前位置: 首页>>代码示例>>C++>>正文


C++ da_free函数代码示例

本文整理汇总了C++中da_free函数的典型用法代码示例。如果您正苦于以下问题:C++ da_free函数的具体用法?C++ da_free怎么用?C++ da_free使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了da_free函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: obs_source_destroy

static void obs_source_destroy(obs_source_t source)
{
	size_t i;

	if (source->filter_parent)
		obs_source_filter_remove(source->filter_parent, source);

	for (i = 0; i < source->filters.num; i++)
		obs_source_release(source->filters.array[i]);

	for (i = 0; i < source->audio_wait_buffer.num; i++)
		audiobuf_free(source->audio_wait_buffer.array+i);
	for (i = 0; i < source->video_frames.num; i++)
		source_frame_destroy(source->video_frames.array[i]);

	gs_entercontext(obs->video.graphics);
	texture_destroy(source->output_texture);
	gs_leavecontext();

	if (source->data)
		source->callbacks.destroy(source->data);

	bfree(source->audio_data.data);
	audio_line_destroy(source->audio_line);
	audio_resampler_destroy(source->resampler);

	da_free(source->video_frames);
	da_free(source->audio_wait_buffer);
	da_free(source->filters);
	pthread_mutex_destroy(&source->filter_mutex);
	pthread_mutex_destroy(&source->audio_mutex);
	pthread_mutex_destroy(&source->video_mutex);
	dstr_free(&source->settings);
	bfree(source);
}
开发者ID:Alucard014,项目名称:obs-studio,代码行数:35,代码来源:obs-source.c

示例2: gs_vertexbuffer_destroy

void gs_vertexbuffer_destroy(gs_vertbuffer_t *vb)
{
    if (vb) {
        if (vb->vertex_buffer)
            gl_delete_buffers(1, &vb->vertex_buffer);
        if (vb->normal_buffer)
            gl_delete_buffers(1, &vb->normal_buffer);
        if (vb->tangent_buffer)
            gl_delete_buffers(1, &vb->tangent_buffer);
        if (vb->color_buffer)
            gl_delete_buffers(1, &vb->color_buffer);
        if (vb->uv_buffers.num)
            gl_delete_buffers((GLsizei)vb->uv_buffers.num,
                              vb->uv_buffers.array);

        if (vb->vao)
            gl_delete_vertex_arrays(1, &vb->vao);

        da_free(vb->uv_sizes);
        da_free(vb->uv_buffers);
        gs_vbdata_destroy(vb->data);

        bfree(vb);
    }
}
开发者ID:cmaines,项目名称:obs-studio,代码行数:25,代码来源:gl-vertexbuffer.c

示例3: audio_output_close

void audio_output_close(audio_t audio)
{
	void *thread_ret;
	struct audio_line *line;

	if (!audio)
		return;

	if (audio->initialized) {
		os_event_signal(audio->stop_event);
		pthread_join(audio->thread, &thread_ret);
	}

	line = audio->first_line;
	while (line) {
		struct audio_line *next = line->next;
		audio_line_destroy_data(line);
		line = next;
	}

	for (size_t i = 0; i < audio->inputs.num; i++)
		audio_input_free(audio->inputs.array+i);

	for (size_t i = 0; i < MAX_AV_PLANES; i++)
		da_free(audio->mix_buffers[i]);

	da_free(audio->inputs);
	os_event_destroy(audio->stop_event);
	pthread_mutex_destroy(&audio->line_mutex);
	bfree(audio);
}
开发者ID:ArnoldSchiller,项目名称:obs-studio,代码行数:31,代码来源:audio-io.c

示例4: obs_encoder_actually_destroy

static void obs_encoder_actually_destroy(obs_encoder_t *encoder)
{
	if (encoder) {
		pthread_mutex_lock(&encoder->outputs_mutex);
		for (size_t i = 0; i < encoder->outputs.num; i++) {
			struct obs_output *output = encoder->outputs.array[i];
			obs_output_remove_encoder(output, encoder);
		}
		da_free(encoder->outputs);
		pthread_mutex_unlock(&encoder->outputs_mutex);

		blog(LOG_INFO, "encoder '%s' destroyed", encoder->context.name);

		free_audio_buffers(encoder);

		if (encoder->context.data)
			encoder->info.destroy(encoder->context.data);
		da_free(encoder->callbacks);
		pthread_mutex_destroy(&encoder->init_mutex);
		pthread_mutex_destroy(&encoder->callbacks_mutex);
		pthread_mutex_destroy(&encoder->outputs_mutex);
		obs_context_data_free(&encoder->context);
		if (encoder->owns_info_id)
			bfree((void*)encoder->info.id);
		bfree(encoder);
	}
}
开发者ID:AhmedAbdulSalam5,项目名称:obs-studio,代码行数:27,代码来源:obs-encoder.c

示例5: gs_renderstop

void gs_renderstop(enum gs_draw_mode mode)
{
	graphics_t graphics = thread_graphics;
	size_t i, num = graphics->verts.num;

	if (!num) {
		if (!graphics->using_immediate) {
			da_free(graphics->verts);
			da_free(graphics->norms);
			da_free(graphics->colors);
			for (i = 0; i < 16; i++)
				da_free(graphics->texverts[i]);
			vbdata_destroy(graphics->vbd);
		}

		return;
	}

	if (graphics->norms.num &&
	    (graphics->norms.num != graphics->verts.num)) {
		blog(LOG_WARNING, "gs_renderstop: normal count does "
		                  "not match vertex count");
		num = min_size(num, graphics->norms.num);
	}

	if (graphics->colors.num &&
	    (graphics->colors.num != graphics->verts.num)) {
		blog(LOG_WARNING, "gs_renderstop: color count does "
		                  "not match vertex count");
		num = min_size(num, graphics->colors.num);
	}

	if (graphics->texverts[0].num &&
	    (graphics->texverts[0].num  != graphics->verts.num)) {
		blog(LOG_WARNING, "gs_renderstop: texture vertex count does "
		                  "not match vertex count");
		num = min_size(num, graphics->texverts[0].num);
	}

	if (graphics->using_immediate) {
		vertexbuffer_flush(graphics->immediate_vertbuffer, false);

		gs_load_vertexbuffer(graphics->immediate_vertbuffer);
		gs_load_indexbuffer(NULL);
		gs_draw(mode, 0, (uint32_t)num);

		reset_immediate_arrays(graphics);
	} else {
		vertbuffer_t vb = gs_rendersave();

		gs_load_vertexbuffer(vb);
		gs_load_indexbuffer(NULL);
		gs_draw(mode, 0, 0);

		vertexbuffer_destroy(vb);
	}

	graphics->vbd = NULL;
}
开发者ID:BraginWoW,项目名称:obs-studio,代码行数:59,代码来源:graphics.c

示例6: obs_shutdown

void obs_shutdown(void)
{
	if (!obs)
		return;

	da_free(obs->input_types);
	da_free(obs->filter_types);
	da_free(obs->encoder_types);
	da_free(obs->transition_types);
	da_free(obs->output_types);
	da_free(obs->service_types);
	da_free(obs->modal_ui_callbacks);
	da_free(obs->modeless_ui_callbacks);

	stop_video();

	obs_free_data();
	obs_free_video();
	obs_free_graphics();
	obs_free_audio();
	proc_handler_destroy(obs->procs);
	signal_handler_destroy(obs->signals);

	for (size_t i = 0; i < obs->modules.num; i++)
		free_module(obs->modules.array+i);
	da_free(obs->modules);

	bfree(obs->locale);
	bfree(obs);
	obs = NULL;
}
开发者ID:kmdtukl,项目名称:obs-studio,代码行数:31,代码来源:obs.c

示例7: free_servparm

void free_servparm(servparm_t *serv)
{
	free(serv->uptest_cmd);
	free(serv->query_test_name);
	free(serv->label);
	da_free(serv->atup_a);
	free_slist_array(serv->alist);
	da_free(serv->reject_a4);
#if ALLOW_LOCAL_AAAA
	da_free(serv->reject_a6);
#endif
}
开发者ID:Leon1108,项目名称:shadowsocks-android,代码行数:12,代码来源:conff.c

示例8: rb_trie_read

/*
 * call-seq:
 *   read(filename_base) -> Trie
 *
 * Returns a new trie with data as read from disk.
 */
static VALUE rb_trie_read(VALUE self, VALUE filename_base) {
	VALUE da_filename = rb_str_dup(filename_base);
	VALUE tail_filename = rb_str_dup(filename_base);
	rb_str_concat(da_filename, rb_str_new2(".da"));
	rb_str_concat(tail_filename, rb_str_new2(".tail"));
	StringValue(tail_filename);
    StringValue(da_filename);
	Trie *trie = trie_new();

	VALUE obj;
	obj = Data_Wrap_Struct(self, 0, trie_free, trie);

	DArray *old_da = trie->da;
	Tail *old_tail = trie->tail;

	FILE *da_file = fopen(RSTRING_PTR(da_filename), "r");
	if (da_file == NULL)
		raise_ioerror("Error reading .da file.");

	trie->da = da_read(da_file);
	fclose(da_file);

	FILE *tail_file = fopen(RSTRING_PTR(tail_filename), "r");
	if (tail_file == NULL)
		raise_ioerror("Error reading .tail file.");

	trie->tail = tail_read(tail_file);
	fclose(tail_file);

	da_free(old_da);
	tail_free(old_tail);

	return obj;
}
开发者ID:witgo,项目名称:fast_trie,代码行数:40,代码来源:trie.c

示例9: trie_new

/**
 * @brief Create a new trie
 *
 * @param   alpha_map   : the alphabet set for the trie
 *
 * @return a pointer to the newly created trie, NULL on failure
 *
 * Create a new empty trie object based on the given @a alpha_map alphabet
 * set. The trie contents can then be added and deleted with trie_store() and
 * trie_delete() respectively.
 *
 * The created object must be freed with trie_free().
 */
Trie *
trie_new (const AlphaMap *alpha_map)
{
    Trie *trie;

    trie = (Trie *) malloc (sizeof (Trie));
    if (!trie)
        return NULL;

    trie->alpha_map = alpha_map_clone (alpha_map);
    if (!trie->alpha_map)
        goto exit_trie_created;

    trie->da = da_new ();
    if (!trie->da)
        goto exit_alpha_map_created;

    trie->tail = tail_new ();
    if (!trie->tail)
        goto exit_da_created;

    trie->is_dirty = TRUE;
    return trie;

exit_da_created:
    da_free (trie->da);
exit_alpha_map_created:
    alpha_map_free (trie->alpha_map);
exit_trie_created:
    free (trie);
    return NULL;
}
开发者ID:svn2github,项目名称:datrie,代码行数:45,代码来源:trie.c

示例10: trie_new_from_file

/**
 * @brief Create a new trie by loading from a file
 *
 * @param path  : the path to the file
 *
 * @return a pointer to the created trie, NULL on failure
 *
 * Create a new trie and initialize its contents by loading from the file at
 * given @a path.
 *
 * The created object must be freed with trie_free().
 */
Trie *
trie_new_from_file (const char *path)
{
    Trie       *trie;
    FILE       *trie_file;

    trie_file = fopen (path, "r");
    if (!trie_file)
        return NULL;

    trie = (Trie *) malloc (sizeof (Trie));
    if (!trie)
        goto exit_file_openned;

    if (NULL == (trie->alpha_map = alpha_map_read_bin (trie_file)))
        goto exit_trie_created;
    if (NULL == (trie->da   = da_read (trie_file)))
        goto exit_alpha_map_created;
    if (NULL == (trie->tail = tail_read (trie_file)))
        goto exit_da_created;

    fclose (trie_file);
    trie->is_dirty = FALSE;
    return trie;

exit_da_created:
    da_free (trie->da);
exit_alpha_map_created:
    alpha_map_free (trie->alpha_map);
exit_trie_created:
    free (trie);
exit_file_openned:
    fclose (trie_file);
    return NULL;
}
开发者ID:svn2github,项目名称:datrie,代码行数:47,代码来源:trie.c

示例11: remove_all_items

static void remove_all_items(struct obs_scene *scene)
{
	struct obs_scene_item *item;
	DARRAY(struct obs_scene_item*) items;

	da_init(items);

	full_lock(scene);

	item = scene->first_item;

	while (item) {
		struct obs_scene_item *del_item = item;
		item = item->next;

		remove_without_release(del_item);
		da_push_back(items, &del_item);
	}

	full_unlock(scene);

	for (size_t i = 0; i < items.num; i++)
		obs_sceneitem_release(items.array[i]);
	da_free(items);
}
开发者ID:AnthonySuper,项目名称:obs-studio,代码行数:25,代码来源:obs-scene.c

示例12: free_server_data

static void free_server_data(servparm_array sa)
{
	int i,n=DA_NEL(sa);
	for(i=0;i<n;++i)
		free_servparm(&DA_INDEX(sa,i));
	da_free(sa);
}
开发者ID:Leon1108,项目名称:shadowsocks-android,代码行数:7,代码来源:conff.c

示例13: trie_fread

/**
 * @brief Create a new trie by reading from an open file
 *
 * @param file  : the handle of the open file
 *
 * @return a pointer to the created trie, NULL on failure
 *
 * Create a new trie and initialize its contents by reading from the open
 * @a file. After reading, the file pointer is left at the end of the trie data.
 * This can be useful for reading embedded trie index as part of a file data.
 *
 * The created object must be freed with trie_free().
 *
 * Available since: 0.2.4
 */
Trie *
trie_fread (FILE *file)
{
    Trie       *trie;

    trie = (Trie *) malloc (sizeof (Trie));
    if (!trie)
        return NULL;

    if (NULL == (trie->alpha_map = alpha_map_fread_bin (file)))
        goto exit_trie_created;
    if (NULL == (trie->da   = da_fread (file)))
        goto exit_alpha_map_created;
    if (NULL == (trie->tail = tail_fread (file)))
        goto exit_da_created;

    trie->is_dirty = FALSE;
    return trie;

exit_da_created:
    da_free (trie->da);
exit_alpha_map_created:
    alpha_map_free (trie->alpha_map);
exit_trie_created:
    free (trie);
    return NULL;
}
开发者ID:svn2github,项目名称:datrie,代码行数:42,代码来源:trie.c

示例14: update_info_destroy

void update_info_destroy(struct update_info *info)
{
	if (!info)
		return;

	if (info->thread_created)
		pthread_join(info->thread, NULL);

	da_free(info->file_data);
	bfree(info->log_prefix);
	bfree(info->user_agent);
	bfree(info->temp);
	bfree(info->cache);
	bfree(info->local);
	bfree(info->url);

	if (info->header)
		curl_slist_free_all(info->header);
	if (info->curl)
		curl_easy_cleanup(info->curl);
	if (info->local_package)
		obs_data_release(info->local_package);
	if (info->cache_package)
		obs_data_release(info->cache_package);
	if (info->remote_package)
		obs_data_release(info->remote_package);
	bfree(info);
}
开发者ID:LouisRenWeiWei,项目名称:obs-studio,代码行数:28,代码来源:file-updater.c

示例15: device_destroy

void device_destroy(device_t device)
{
	if (device) {
		size_t i;
		for (i = 0; i < device->fbos.num; i++)
			fbo_info_destroy(device->fbos.array[i]);

		if (device->pipeline)
			glDeleteProgramPipelines(1, &device->pipeline);

		da_free(device->proj_stack);
		da_free(device->fbos);
		gl_platform_destroy(device->plat);
		bfree(device);
	}
}
开发者ID:Tyrrr,项目名称:obs-studio,代码行数:16,代码来源:gl-subsystem.c


注:本文中的da_free函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。