本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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);
}
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}