• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ da_push_back函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ep_process_sampler_dep

static inline bool ep_process_sampler_dep(struct effect_parser *ep,
		struct ep_func *func)
{
	struct ep_sampler *val = ep_getsampler_strref(ep,
			&ep->cfp.cur_token->str);
	if (val)
		da_push_back(func->sampler_deps, &val->name);
	return val != NULL;
}
开发者ID:ArnoldSchiller,项目名称:obs-studio,代码行数:9,代码来源:effect-parser.c


示例2: gs_texcoord2v

void gs_texcoord2v(const struct vec2 *v, int unit)
{
	graphics_t graphics = thread_graphics;
	if (!validvertsize(graphics, graphics->texverts[unit].num,
				"gs_texcoord"))
		return;

	da_push_back(graphics->texverts[unit], v);
}
开发者ID:GamingAtheist,项目名称:obs-studio,代码行数:9,代码来源:graphics.c


示例3: obs_encoder_add_output

void obs_encoder_add_output(struct obs_encoder *encoder,
                            struct obs_output *output)
{
    if (!encoder) return;

    pthread_mutex_lock(&encoder->outputs_mutex);
    da_push_back(encoder->outputs, &output);
    pthread_mutex_unlock(&encoder->outputs_mutex);
}
开发者ID:skaramicke,项目名称:obs-studio,代码行数:9,代码来源:obs-encoder.c


示例4: gs_matrix_push

void gs_matrix_push(void)
{
	graphics_t graphics = thread_graphics;
	struct matrix3 mat, *top_mat = top_matrix(graphics);

	memcpy(&mat, top_mat, sizeof(struct matrix3));
	da_push_back(graphics->matrix_stack, &mat);
	graphics->cur_matrix++;
}
开发者ID:Alucard014,项目名称:obs-studio,代码行数:9,代码来源:graphics.c


示例5: ep_parse_technique

static void ep_parse_technique(struct effect_parser *ep)
{
	struct ep_technique ept;
	ep_technique_init(&ept);

	if (cf_next_name(&ep->cfp, &ept.name, "name", ";") != PARSE_SUCCESS)
		goto error;
	if (cf_next_token_should_be(&ep->cfp, "{", ";", NULL) != PARSE_SUCCESS)
		goto error;

	if (!cf_next_valid_token(&ep->cfp))
		goto error;

	while (!cf_token_is(&ep->cfp, "}")) {
		struct ep_pass pass;
		ep_pass_init(&pass);

		switch (ep_parse_pass(ep, &pass)) {
		case PARSE_UNEXPECTED_CONTINUE:
			ep_pass_free(&pass);
			if (!cf_go_to_token(&ep->cfp, "}", NULL))
				goto error;
			continue;
		case PARSE_EOF:
			ep_pass_free(&pass);
			goto error;
		}

		da_push_back(ept.passes, &pass);

		if (!cf_next_valid_token(&ep->cfp))
			goto error;
	}

	/* pass the current token (which is '}') if we reached here */
	cf_next_token(&ep->cfp);

	da_push_back(ep->techniques, &ept);
	return;

error:
	cf_next_token(&ep->cfp);
	ep_technique_free(&ept);
}
开发者ID:ArnoldSchiller,项目名称:obs-studio,代码行数:44,代码来源:effect-parser.c


示例6: obs_add_module_path

void obs_add_module_path(const char *bin, const char *data)
{
	struct obs_module_path omp;

	if (!obs || !bin || !data) return;

	omp.bin  = bstrdup(bin);
	omp.data = bstrdup(data);
	da_push_back(obs->module_paths, &omp);
}
开发者ID:AhmedAbdulSalam5,项目名称:obs-studio,代码行数:10,代码来源:obs-module.c


示例7: build_font_path_info

void build_font_path_info(FT_Face face, FT_Long idx, const char *path)
{
	FT_UInt num_names = FT_Get_Sfnt_Name_Count(face);
	DARRAY(char*) family_names;

	da_init(family_names);
	da_push_back(family_names, &face->family_name);

	for (FT_UInt i = 0; i < num_names; i++) {
		FT_SfntName name;
		char        *family;
		FT_Error    ret = FT_Get_Sfnt_Name(face, i, &name);

		if (ret != 0 || name.name_id != TT_NAME_ID_FONT_FAMILY)
			continue;

		family = sfnt_name_to_utf8(&name);
		if (!family)
			continue;

		for (size_t i = 0; i < family_names.num; i++) {
			if (astrcmpi(family_names.array[i], family) == 0) {
				bfree(family);
				family = NULL;
				break;
			}
		}

		if (family)
			da_push_back(family_names, &family);
	}

	for (size_t i = 0; i < family_names.num; i++) {
		add_font_path(face, idx, family_names.array[i],
				face->style_name, path);

		/* first item isn't our allocation */
		if (i > 0)
			bfree(family_names.array[i]);
	}

	da_free(family_names);
}
开发者ID:AlexNe,项目名称:obs-studio,代码行数:43,代码来源:find-font.c


示例8: obs_context_data_setname

void obs_context_data_setname(struct obs_context_data *context,
		const char *name)
{
	pthread_mutex_lock(&context->rename_cache_mutex);

	if (context->name)
		da_push_back(context->rename_cache, &context->name);
	context->name = dup_name(name);

	pthread_mutex_unlock(&context->rename_cache_mutex);
}
开发者ID:Lexsus,项目名称:obs-studio,代码行数:11,代码来源:obs.c


示例9: gl_add_sampler

static inline void gl_add_sampler(struct gs_shader *shader,
		struct shader_sampler *sampler)
{
	samplerstate_t new_sampler;
	struct gs_sampler_info info;

	shader_sampler_convert(sampler, &info);
	new_sampler = device_create_samplerstate(shader->device, &info);

	da_push_back(shader->samplers, &new_sampler);
}
开发者ID:GamingAtheist,项目名称:obs-studio,代码行数:11,代码来源:gl-shader.c


示例10: audio_output_createline

audio_line_t audio_output_createline(audio_t audio)
{
	struct audio_line *line = bmalloc(sizeof(struct audio_line));
	memset(line, 0, sizeof(struct audio_line));
	line->alive = true;

	pthread_mutex_lock(&audio->line_mutex);
	da_push_back(audio->lines, &line);
	pthread_mutex_unlock(&audio->line_mutex);
	return line;
}
开发者ID:Alucard014,项目名称:obs-studio,代码行数:11,代码来源:audio-io.c


示例11: push_audio_tree

static void push_audio_tree(obs_source_t *parent, obs_source_t *source, void *p)
{
	struct obs_core_audio *audio = p;

	if (da_find(audio->render_order, &source, 0) == DARRAY_INVALID) {
		obs_source_addref(source);
		da_push_back(audio->render_order, &source);
	}

	UNUSED_PARAMETER(parent);
}
开发者ID:ab22,项目名称:obs-studio,代码行数:11,代码来源:obs-audio.c


示例12: obs_display_add_draw_callback

void obs_display_add_draw_callback(obs_display_t display,
		void (*draw)(void *param, uint32_t cx, uint32_t cy),
		void *param)
{
	if (!display) return;

	struct draw_callback data = {draw, param};

	pthread_mutex_lock(&display->draw_callbacks_mutex);
	da_push_back(display->draw_callbacks, &data);
	pthread_mutex_unlock(&display->draw_callbacks_mutex);
}
开发者ID:GamingAtheist,项目名称:obs-studio,代码行数:12,代码来源:obs-display.c


示例13: ep_parse_func_param

static inline int ep_parse_func_param(struct effect_parser *ep,
		struct ep_func *func, struct ep_var *var)
{
	int code;

	if (!cf_next_valid_token(&ep->cfp))
		return PARSE_EOF;

	code = ep_check_for_keyword(ep, "uniform", &var->uniform);
	if (code == PARSE_EOF)
		return PARSE_EOF;

	code = cf_get_name(&ep->cfp, &var->type, "type", ")");
	if (code != PARSE_SUCCESS)
		return code;

	code = cf_next_name(&ep->cfp, &var->name, "name", ")");
	if (code != PARSE_SUCCESS)
		return code;

	if (!cf_next_valid_token(&ep->cfp))
		return PARSE_EOF;

	if (cf_token_is(&ep->cfp, ":")) {
		code = cf_next_name(&ep->cfp, &var->mapping,
				"mapping specifier", ")");
		if (code != PARSE_SUCCESS)
			return code;

		if (!cf_next_valid_token(&ep->cfp))
			return PARSE_EOF;
	}

	if (ep_getstruct(ep, var->type) != NULL)
		da_push_back(func->struct_deps, &var->type);
	else if (ep_getsampler(ep, var->type) != NULL)
		da_push_back(func->sampler_deps, &var->type);

	return PARSE_SUCCESS;
}
开发者ID:ArnoldSchiller,项目名称:obs-studio,代码行数:40,代码来源:effect-parser.c


示例14: ep_parse_sampler_state_item

static int ep_parse_sampler_state_item(struct effect_parser *ep,
		struct ep_sampler *eps)
{
	int ret;
	char *state = NULL;
	struct dstr value = {0};

	ret = cf_next_name(&ep->cfp, &state, "state name", ";");
	if (ret != PARSE_SUCCESS) goto fail;

	ret = cf_next_token_should_be(&ep->cfp, "=", ";", NULL);
	if (ret != PARSE_SUCCESS) goto fail;

	for (;;) {
		const char *cur_str;

		if (!cf_next_valid_token(&ep->cfp))
			return PARSE_EOF;

		cur_str = ep->cfp.cur_token->str.array;
		if (*cur_str == ';')
			break;

		dstr_ncat(&value, cur_str, ep->cfp.cur_token->str.len);
	}

	if (value.len) {
		da_push_back(eps->states, &state);
		da_push_back(eps->values, &value.array);
	}

	return ret;

fail:
	bfree(state);
	dstr_free(&value);
	return ret;
}
开发者ID:Dead133,项目名称:obs-studio,代码行数:38,代码来源:effect-parser.c


示例15: cf_preprocess

bool cf_preprocess(struct cf_preprocessor *pp, struct cf_lexer *lex,
		struct error_data *ed)
{
	struct cf_token *token = cf_lexer_gettokens(lex);
	if (!token)
		return false;

	pp->ed = ed;
	pp->lex = lex;
	cf_preprocess_tokens(pp, false, &token);
	da_push_back(pp->tokens, token);

	return !lex->unexpected_eof;
}
开发者ID:Alucard014,项目名称:obs-studio,代码行数:14,代码来源:cf-lexer.c


示例16: add_font_path

static void add_font_path(FT_Face face,
		FT_Long idx,
		const char *family_in,
		const char *style_in,
		const char *path)
{
	struct dstr face_and_style = {0};
	struct font_path_info info;

	if (!family_in || !path)
		return;

	dstr_copy(&face_and_style, family_in);
	if (face->style_name) {
		struct dstr style = {0};

		dstr_copy(&style, style_in);
		dstr_replace(&style, "Bold", "");
		dstr_replace(&style, "Italic", "");
		dstr_replace(&style, "  ", " ");
		dstr_depad(&style);

		if (!dstr_is_empty(&style)) {
			dstr_cat(&face_and_style, " ");
			dstr_cat_dstr(&face_and_style, &style);
		}

		dstr_free(&style);
	}

	info.face_and_style = face_and_style.array;
	info.full_len       = face_and_style.len;
	info.face_len       = strlen(family_in);

	info.is_bitmap      = !!(face->face_flags  & FT_FACE_FLAG_FIXED_SIZES);
	info.bold           = !!(face->style_flags & FT_STYLE_FLAG_BOLD);
	info.italic         = !!(face->style_flags & FT_STYLE_FLAG_ITALIC);
	info.index          = idx;

	info.path           = bstrdup(path);

	create_bitmap_sizes(&info, face);
	da_push_back(font_list, &info);

	/*blog(LOG_DEBUG, "name: %s\n\tstyle: %s\n\tpath: %s\n",
			family_in,
			style_in,
			path);*/
}
开发者ID:AlexNe,项目名称:obs-studio,代码行数:49,代码来源:find-font.c


示例17: obs_source_output_video

void obs_source_output_video(obs_source_t source,
                             const struct source_frame *frame)
{
    struct source_frame *output = cache_video(source, frame);

    pthread_mutex_lock(&source->filter_mutex);
    output = filter_async_video(source, output);
    pthread_mutex_unlock(&source->filter_mutex);

    if (output) {
        pthread_mutex_lock(&source->video_mutex);
        da_push_back(source->video_frames, &output);
        pthread_mutex_unlock(&source->video_mutex);
    }
}
开发者ID:BraginWoW,项目名称:obs-studio,代码行数:15,代码来源:obs-source.c


示例18: obs_add_source

bool obs_add_source(obs_source_t source)
{
	struct calldata params = {0};

	pthread_mutex_lock(&obs->data.sources_mutex);
	da_push_back(obs->data.sources, &source);
	obs_source_addref(source);
	pthread_mutex_unlock(&obs->data.sources_mutex);

	calldata_setptr(&params, "source", source);
	signal_handler_signal(obs->signals, "source-add", &params);
	calldata_free(&params);

	return true;
}
开发者ID:Ceropean,项目名称:obs-studio,代码行数:15,代码来源:obs.c


示例19: cf_preprocess_define

static void cf_preprocess_define(struct cf_preprocessor *pp,
		struct cf_token **p_cur_token)
{
	struct cf_token *cur_token = *p_cur_token;
	struct cf_def def;

	if (pp->ignore_state) {
		go_to_newline(p_cur_token);
		return;
	}

	cf_def_init(&def);

	next_token(&cur_token, true);
	if (cur_token->type != CFTOKEN_NAME) {
		cf_adderror_expecting(pp, cur_token, "identifier");
		go_to_newline(&cur_token);
		goto exit;
	}

	append_space(pp, &def.tokens.da, NULL);
	cf_token_copy(&def.name, cur_token);

	if (!next_token(&cur_token, true))
		goto complete;

	/* process macro */
	if (*cur_token->str.array == '(') {
		if (!cf_preprocess_macro_params(pp, &def, &cur_token))
			goto error;
	}

	while (cur_token->type != CFTOKEN_NEWLINE &&
	       cur_token->type != CFTOKEN_NONE)
		cf_def_addtoken(&def, cur_token++);

complete:
	append_end_token(&def.tokens.da);
	append_space(pp, &def.tokens.da, NULL);
	da_push_back(pp->defines, &def);
	goto exit;

error:
	cf_def_free(&def);

exit:
	*p_cur_token = cur_token;
}
开发者ID:Alucard014,项目名称:obs-studio,代码行数:48,代码来源:cf-lexer.c


示例20: scene_video_render

static void scene_video_render(void *data, gs_effect_t *effect)
{
	DARRAY(struct obs_scene_item*) remove_items;
	struct obs_scene *scene = data;
	struct obs_scene_item *item;

	da_init(remove_items);

	video_lock(scene);
	item = scene->first_item;

	gs_blend_state_push();
	gs_reset_blend_state();

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

			remove_without_release(del_item);
			da_push_back(remove_items, &del_item);
			continue;
		}

		if (source_size_changed(item))
			update_item_transform(item);

		if (item->user_visible) {
			gs_matrix_push();
			gs_matrix_mul(&item->draw_transform);
			obs_source_video_render(item->source);
			gs_matrix_pop();
		}

		item = item->next;
	}

	gs_blend_state_pop();

	video_unlock(scene);

	for (size_t i = 0; i < remove_items.num; i++)
		obs_sceneitem_release(remove_items.array[i]);
	da_free(remove_items);

	UNUSED_PARAMETER(effect);
}
开发者ID:ab22,项目名称:obs-studio,代码行数:47,代码来源:obs-scene.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ dabs函数代码示例发布时间:2022-05-30
下一篇:
C++ da_free函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap