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

C++ GF_SAFEALLOC函数代码示例

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

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



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

示例1: GF_SAFEALLOC

GF_BaseDecoder *NewODDec()
{
    GF_SceneDecoder *tmp;
    ODPriv *priv;

    GF_SAFEALLOC(tmp, GF_SceneDecoder);
    if (!tmp) return NULL;
    GF_SAFEALLOC(priv, ODPriv);

    tmp->privateStack = priv;
    tmp->AttachStream = ODF_AttachStream;
    tmp->DetachStream = ODF_DetachStream;
    tmp->GetCapabilities = ODF_GetCapabilities;
    tmp->SetCapabilities = ODF_SetCapabilities;
    tmp->ProcessData = ODF_ProcessData;
    tmp->AttachScene = ODF_AttachScene;
    tmp->CanHandleStream = ODF_CanHandleStream;

    GF_REGISTER_MODULE_INTERFACE(tmp, GF_SCENE_DECODER_INTERFACE, "GPAC OD Decoder", "gpac distribution")
    return (GF_BaseDecoder *) tmp;
}
开发者ID:erelh,项目名称:gpac,代码行数:21,代码来源:odf_dec.c


示例2: InitMediaSensor

void InitMediaSensor(GF_Scene *scene, GF_Node *node)
{
	MediaSensorStack *st;
	GF_SAFEALLOC(st, MediaSensorStack);

	st->parent = scene;
	st->sensor = (M_MediaSensor *)node;
	st->seg = gf_list_new();
	gf_node_set_callback_function(node, RenderMediaSensor);
	gf_node_set_private(node, st);

}
开发者ID:JamesLinus,项目名称:gpac,代码行数:12,代码来源:media_sensor.c


示例3: GF_SAFEALLOC

GF_EXPORT
GF_Command *gf_sg_command_new(GF_SceneGraph *graph, u32 tag)
{
	GF_Command *ptr;
	GF_SAFEALLOC(ptr, GF_Command);
	if (!ptr) return NULL;
	ptr->tag = tag;
	ptr->in_scene = graph;
	ptr->command_fields = gf_list_new();
	if (tag < GF_SG_LAST_BIFS_COMMAND) ptr->new_proto_list = gf_list_new();
	return ptr;
}
开发者ID:bigbensk,项目名称:gpac,代码行数:12,代码来源:commands.c


示例4: compositor_init_untransform

void compositor_init_untransform(GF_Compositor *compositor, GF_Node *node)
{
	Untransform tr;
	if (Untransform_GetNode(node, &tr)) {
		UntransformStack *stack;
		GF_SAFEALLOC(stack, UntransformStack);
		gf_node_set_private(node, stack);
		gf_node_set_callback_function(node, TraverseUntransform);
		stack->untr = tr;
		gf_node_proto_set_grouping(node);
	}
}
开发者ID:dragonlucian,项目名称:gpac,代码行数:12,代码来源:hardcoded_protos.c


示例5: GF_SAFEALLOC

GF_BaseDecoder *NewLSRDec()
{
	LSRPriv *priv;
	GF_SceneDecoder *tmp;

	GF_SAFEALLOC(tmp, GF_SceneDecoder);
	if (!tmp) return NULL;
	GF_SAFEALLOC(priv, LSRPriv);
	priv->codec = NULL;
	tmp->privateStack = priv;
	tmp->AttachStream = LSR_AttachStream;
	tmp->DetachStream = LSR_DetachStream;
	tmp->GetCapabilities = LSR_GetCapabilities;
	tmp->SetCapabilities = LSR_SetCapabilities;
	tmp->ProcessData = LSR_ProcessData;
	tmp->AttachScene = LSR_AttachScene;
	tmp->CanHandleStream = LSR_CanHandleStream;
	tmp->ReleaseScene = LSR_ReleaseScene;
	GF_REGISTER_MODULE_INTERFACE(tmp, GF_SCENE_DECODER_INTERFACE, "GPAC LASeR Decoder", "gpac distribution")
	return (GF_BaseDecoder *) tmp;
}
开发者ID:jnorthrup,项目名称:gpac,代码行数:21,代码来源:laser_dec.c


示例6: compositor_init_layer2d

void compositor_init_layer2d(GF_Compositor *compositor, GF_Node *node)
{
	Layer2DStack *stack;
	GF_SAFEALLOC(stack, Layer2DStack);

	stack->backs = gf_list_new();
	stack->views = gf_list_new();
	stack->first = 1;

	gf_node_set_private(node, stack);
	gf_node_set_callback_function(node, TraverseLayer2D);
}
开发者ID:golgol7777,项目名称:gpac,代码行数:12,代码来源:mpeg4_layer_2d.c


示例7: GF_SAFEALLOC

GF_BaseDecoder *NewOSVCDec()
{
	GF_MediaDecoder *ifcd;
	OSVCDec *dec;
	
	GF_SAFEALLOC(ifcd, GF_MediaDecoder);
	GF_SAFEALLOC(dec, OSVCDec);
	GF_REGISTER_MODULE_INTERFACE(ifcd, GF_MEDIA_DECODER_INTERFACE, "OpenSVC Decoder", "gpac distribution")

	ifcd->privateStack = dec;

	/*setup our own interface*/	
	ifcd->AttachStream = OSVC_AttachStream;
	ifcd->DetachStream = OSVC_DetachStream;
	ifcd->GetCapabilities = OSVC_GetCapabilities;
	ifcd->SetCapabilities = OSVC_SetCapabilities;
	ifcd->GetName = OSVC_GetCodecName;
	ifcd->CanHandleStream = OSVC_CanHandleStream;
	ifcd->ProcessData = OSVC_ProcessData;
	return (GF_BaseDecoder *) ifcd;
}
开发者ID:noelove,项目名称:GPAC-old,代码行数:21,代码来源:opensvc_dec.c


示例8: GF_SAFEALLOC

GF_EXPORT
GF_SceneManager *gf_sm_new(GF_SceneGraph *graph)
{
	GF_SceneManager *tmp;

	if (!graph) return NULL;
	GF_SAFEALLOC(tmp, GF_SceneManager);
	if (!tmp) return NULL;
	tmp->streams = gf_list_new();
	tmp->scene_graph = graph;
	return tmp;
}
开发者ID:ARSekkat,项目名称:gpac,代码行数:12,代码来源:scene_manager.c


示例9: GF_SAFEALLOC

GF_BaseDecoder *NewFAADDec()
{
	GF_MediaDecoder *ifce;
	FAADDec *dec;

	GF_SAFEALLOC(ifce, GF_MediaDecoder);
	GF_SAFEALLOC(dec, FAADDec);
	GF_REGISTER_MODULE_INTERFACE(ifce, GF_MEDIA_DECODER_INTERFACE, "FAAD2 Decoder", "gpac distribution")

	ifce->privateStack = dec;

	/*setup our own interface*/
	ifce->AttachStream = FAAD_AttachStream;
	ifce->DetachStream = FAAD_DetachStream;
	ifce->GetCapabilities = FAAD_GetCapabilities;
	ifce->SetCapabilities = FAAD_SetCapabilities;
	ifce->ProcessData = FAAD_ProcessData;
	ifce->CanHandleStream = FAAD_CanHandleStream;
	ifce->GetName = FAAD_GetCodecName;
	return (GF_BaseDecoder *) ifce;
}
开发者ID:Acidburn0zzz,项目名称:gpac,代码行数:21,代码来源:faad_dec.c


示例10: GF_SAFEALLOC

GF_InputService *NewSAFReader()
{
	SAFIn *reader;
	GF_InputService *plug;
	GF_SAFEALLOC(plug, GF_InputService);
	GF_REGISTER_MODULE_INTERFACE(plug, GF_NET_CLIENT_INTERFACE, "GPAC SAF Reader", "gpac distribution")

	plug->RegisterMimeTypes = SAF_RegisterMimeTypes;
	plug->CanHandleURL = SAF_CanHandleURL;
	plug->ConnectService = SAF_ConnectService;
	plug->CloseService = SAF_CloseService;
	plug->GetServiceDescriptor = SAF_GetServiceDesc;
	plug->ConnectChannel = SAF_ConnectChannel;
	plug->DisconnectChannel = SAF_DisconnectChannel;
	plug->ServiceCommand = SAF_ServiceCommand;

	GF_SAFEALLOC(reader, SAFIn);
	reader->channels = gf_list_new();
	plug->priv = reader;
	return plug;
}
开发者ID:Bevara,项目名称:GPAC,代码行数:21,代码来源:saf_in.c


示例11: compositor_init_offscreen_group

void compositor_init_offscreen_group(GF_Compositor *compositor, GF_Node *node)
{
    OffscreenGroup og;
    if (OffscreenGroup_GetNode(node, &og)) {
        OffscreenGroupStack *stack;
        GF_SAFEALLOC(stack, OffscreenGroupStack);
        gf_node_set_private(node, stack);
        gf_node_set_callback_function(node, TraverseOffscreenGroup);
        stack->og = og;
        if (og.offscreen) stack->flags |= GROUP_IS_CACHED;
        gf_node_proto_set_grouping(node);
    }
}
开发者ID:jnorthrup,项目名称:gpac,代码行数:13,代码来源:hardcoded_protos.c


示例12: compositor_init_hc_flashshape

void compositor_init_hc_flashshape(GF_Compositor *compositor, GF_Node *node)
{
	FSStack *stack;

	GF_SAFEALLOC(stack, FSStack);
	stack->drawable = drawable_new();
	stack->drawable->node = node;
	stack->drawable->flags = DRAWABLE_USE_TRAVERSE_DRAW;
	stack->items = gf_list_new();

	gf_node_set_private(node, stack);
	gf_node_set_callback_function(node, fs_traverse);
}
开发者ID:bigbensk,项目名称:gpac,代码行数:13,代码来源:hc_flash_shape.c


示例13: compositor_init_animationstream

void compositor_init_animationstream(GF_Compositor *compositor, GF_Node *node)
{
    AnimationStreamStack *st;
    GF_SAFEALLOC(st, AnimationStreamStack);
    st->compositor = compositor;
    st->time_handle.UpdateTimeNode = animationstream_update_time;
    st->time_handle.udta = node;

    gf_node_set_private(node, st);
    gf_node_set_callback_function(node, animationstream_destroy);

    gf_sc_register_time_node(compositor, &st->time_handle);
}
开发者ID:HungMingWu,项目名称:gpac,代码行数:13,代码来源:mpeg4_animstream.c


示例14: evg_surface_new

GF_SURFACE evg_surface_new(GF_Raster2D *_dr, Bool center_coords)
{
	EVGSurface *_this;
	GF_SAFEALLOC(_this, EVGSurface);
	if (_this) {
		_this->center_coords = center_coords;
		_this->texture_filter = GF_TEXTURE_FILTER_DEFAULT;
		_this->ftparams.source = &_this->ftoutline;
		_this->ftparams.user = _this;
		_this->raster = evg_raster_new();
	}
	return _this;
}
开发者ID:golgol7777,项目名称:gpac,代码行数:13,代码来源:surface.c


示例15: GF_SAFEALLOC

void *NewAudioFilter()
{
	FilterContext *ctx;
	GF_AudioFilter *mod;
	GF_SAFEALLOC(ctx, FilterContext);
	if(!ctx) return NULL;

	GF_SAFEALLOC(mod, GF_AudioFilter);
	if(!mod) {
		gf_free(ctx);
		return NULL;
	}
	mod->udta = ctx;
	mod->SetFilter = SetFilter;
	mod->Configure = Configure;
	mod->Process = ProcessIdentity;
	mod->SetOption = SetOption;
	mod->Reset = Reset;

	GF_REGISTER_MODULE_INTERFACE(mod, GF_AUDIO_FILTER_INTERFACE, "Sample Audio Filter", "gpac distribution");
	return mod;
}
开发者ID:DmitrySigaev,项目名称:gpac-sf,代码行数:22,代码来源:audio_filter.c


示例16: GF_SAFEALLOC

GF_EXPORT
GF_SDPMedia *gf_sdp_media_new()
{
	GF_SDPMedia *tmp;
	GF_SAFEALLOC(tmp, GF_SDPMedia);
	tmp->FMTP = gf_list_new();
	tmp->RTPMaps = gf_list_new();
	tmp->Attributes = gf_list_new();
	tmp->Connections = gf_list_new();
	tmp->Bandwidths = gf_list_new();
	tmp->Quality = -1;
	return tmp;
}
开发者ID:golgol7777,项目名称:gpac,代码行数:13,代码来源:sdp.c


示例17: memset

GF_TermExt *validator_new()
{
	GF_TermExt *dr;
	GF_Validator *validator;
	dr = (GF_TermExt*)gf_malloc(sizeof(GF_TermExt));
	memset(dr, 0, sizeof(GF_TermExt));
	GF_REGISTER_MODULE_INTERFACE(dr, GF_TERM_EXT_INTERFACE, "GPAC Test Validator", "gpac distribution");

	GF_SAFEALLOC(validator, GF_Validator);
	dr->process = validator_process;
	dr->udta = validator;
	return dr;
}
开发者ID:DmitrySigaev,项目名称:gpac-sf,代码行数:13,代码来源:validator.c


示例18: memset

GF_TermExt *uir_new()
{
	GF_TermExt *dr;
	GF_UIRecord *uir;
	dr = (GF_TermExt*)gf_malloc(sizeof(GF_TermExt));
	memset(dr, 0, sizeof(GF_TermExt));
	GF_REGISTER_MODULE_INTERFACE(dr, GF_TERM_EXT_INTERFACE, "GPAC UI Recorder", "gpac distribution");

	GF_SAFEALLOC(uir, GF_UIRecord);
	dr->process = uir_process;
	dr->udta = uir;
	return dr;
}
开发者ID:golgol7777,项目名称:gpac,代码行数:13,代码来源:ui_rec.c


示例19: while

GF_EXPORT
GF_AUContext *gf_sm_stream_au_new(GF_StreamContext *stream, u64 timing, Double time_sec, Bool isRap)
{
    u32 i;
    GF_AUContext *tmp;
    u64 tmp_timing;

    tmp_timing = timing ? timing : (u64) (time_sec*1000);
    if (stream->imp_exp_time >= tmp_timing) {
        /*look for existing AU*/
        i=0;
        while ((tmp = (GF_AUContext *)gf_list_enum(stream->AUs, &i))) {
            if (timing && (tmp->timing==timing)) return tmp;
            else if (time_sec && (tmp->timing_sec == time_sec)) return tmp;
            else if (!time_sec && !timing && !tmp->timing && !tmp->timing_sec) return tmp;
            /*insert AU*/
            else if ((time_sec && time_sec<tmp->timing_sec) || (timing && timing<tmp->timing)) {
                GF_SAFEALLOC(tmp, GF_AUContext);
                tmp->commands = gf_list_new();
                if (isRap) tmp->flags = GF_SM_AU_RAP;
                tmp->timing = timing;
                tmp->timing_sec = time_sec;
                tmp->owner = stream;
                gf_list_insert(stream->AUs, tmp, i-1);
                return tmp;
            }
        }
    }
    GF_SAFEALLOC(tmp, GF_AUContext);
    tmp->commands = gf_list_new();
    if (isRap) tmp->flags = GF_SM_AU_RAP;
    tmp->timing = timing;
    tmp->timing_sec = time_sec;
    tmp->owner = stream;
    if (stream->disable_aggregation) tmp->flags |= GF_SM_AU_NOT_AGGREGATED;
    gf_list_add(stream->AUs, tmp);
    stream->imp_exp_time = tmp_timing;
    return tmp;
}
开发者ID:Bevara,项目名称:GPAC,代码行数:39,代码来源:scene_manager.c


示例20: StatNode

static void StatNode(GF_SceneStatistics *stat, GF_Node *n, Bool isUsed, Bool isDelete, GF_Node *prev)
{
	u32 i;
	GF_NodeStats *ptr = NULL;
	if (!stat) return;

	if (n->sgprivate->tag == TAG_ProtoNode) {
#ifndef GPAC_DISABLE_VRML
		GF_ProtoInstance *pr = (GF_ProtoInstance *)n;
		i=0;
		while ((ptr = (GF_NodeStats *)gf_list_enum(stat->proto_stats, &i))) {
			if (pr->proto_interface->ID == ptr->tag) break;
			ptr = NULL;
		}
		if (!ptr) {
			GF_SAFEALLOC(ptr, GF_NodeStats);
			ptr->tag = pr->proto_interface->ID;
			ptr->name = gf_sg_proto_get_class_name(pr->proto_interface);
			gf_list_add(stat->proto_stats, ptr);
		}
#endif
	} else {
		i=0;
		while ((ptr = (GF_NodeStats *)gf_list_enum(stat->node_stats, &i))) {
			if (n->sgprivate->tag == ptr->tag) break;
			ptr = NULL;
		}
		if (!ptr) {
			GF_SAFEALLOC(ptr, GF_NodeStats);
			ptr->tag = n->sgprivate->tag;
			ptr->name = gf_node_get_class_name(n);
			gf_list_add(stat->node_stats, ptr);
		}
	}
	if (isDelete) ptr->nb_del += n->sgprivate->num_instances;
	else if (isUsed) ptr->nb_used += 1;
	/*this is because the node passes twice in the stat, once on DumpNode and once in replaceALL*/
	else ptr->nb_created += prev ? (prev->sgprivate->num_instances - 1) : 1;
}
开发者ID:bigbensk,项目名称:gpac,代码行数:39,代码来源:scene_stats.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GGadgetGetWindow函数代码示例发布时间:2022-05-30
下一篇:
C++ GF_REGISTER_MODULE_INTERFACE函数代码示例发布时间: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