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


C++ GF_SAFEALLOC函数代码示例

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


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


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