Пример #1
0
GF_Err BM_ParseIndexValueReplace(GF_BifsDecoder *codec, GF_BitStream *bs, GF_List *com_list)
{
	u32 NodeID, ind, field_ind, NumBits;
	s32 type, pos;
	GF_Command *com;
	GF_Node *node;
	GF_Err e;
	GF_FieldInfo field, sffield;
	GF_CommandField *inf;

	/*get the node*/
	NodeID = 1 + gf_bs_read_int(bs, codec->info->config.NodeIDBits);

	node = gf_sg_find_node(codec->current_graph, NodeID);
	if (!node) return GF_NON_COMPLIANT_BITSTREAM;
	NumBits = gf_get_bit_size(gf_node_get_num_fields_in_mode(node, GF_SG_FIELD_CODING_IN)-1);
	ind = gf_bs_read_int(bs, NumBits);
	e = gf_bifs_get_field_index(node, ind, GF_SG_FIELD_CODING_IN, &field_ind);
	if (e) return e;

	e = gf_node_get_field(node, field_ind, &field);
	if (gf_sg_vrml_is_sf_field(field.fieldType)) return GF_NON_COMPLIANT_BITSTREAM;

	type = gf_bs_read_int(bs, 2);
	switch (type) {
	case 0:
		pos = gf_bs_read_int(bs, 16);
		break;
	case 2:
		pos = 0;
		break;
	case 3:
		pos = ((GenMFField *) field.far_ptr)->count - 1;
		break;
	default:
		return GF_NON_COMPLIANT_BITSTREAM;
	}
	
	com = gf_sg_command_new(codec->current_graph, GF_SG_INDEXED_REPLACE);
	BM_SetCommandNode(com, node);
	inf = gf_sg_command_field_new(com);
	inf->fieldIndex = field.fieldIndex;
	inf->pos = pos;

	if (field.fieldType == GF_SG_VRML_MFNODE) {
		inf->fieldType = GF_SG_VRML_SFNODE;
		inf->new_node = gf_bifs_dec_node(codec, bs, field.NDTtype);
		inf->field_ptr = &inf->new_node;
		if (inf->new_node) gf_node_register(inf->new_node, NULL);
	} else {
		memcpy(&sffield, &field, sizeof(GF_FieldInfo));
		sffield.fieldType = gf_sg_vrml_get_sf_type(field.fieldType);
		inf->fieldType = sffield.fieldType;
		sffield.far_ptr = inf->field_ptr = gf_sg_vrml_field_pointer_new(sffield.fieldType);
		codec->LastError = gf_bifs_dec_sf_field(codec, bs, node, &sffield, 1);
	}
	gf_list_add(com_list, com);
	return codec->LastError;
}
Пример #2
0
static void l3d_CheckBindables(GF_Node *n, GF_TraverseState *tr_state, Bool force_traverse)
{
	GF_Node *btop;
	u32 mode;
	M_Layer3D *l3d;
	l3d = (M_Layer3D *)n;

	mode = tr_state->traversing_mode;
	tr_state->traversing_mode = TRAVERSE_GET_BOUNDS;

	if (force_traverse) gf_node_traverse(l3d->background, tr_state);
	btop = (GF_Node*)gf_list_get(tr_state->backgrounds, 0);
	if (btop != l3d->background) { 
		gf_node_unregister(l3d->background, n);
		gf_node_register(btop, n); 
		l3d->background = btop;
		gf_node_event_out_str(n, "background");
	}
	if (force_traverse) gf_node_traverse(l3d->viewpoint, tr_state);
	btop = (GF_Node*)gf_list_get(tr_state->viewpoints, 0);
	if (btop != l3d->viewpoint) { 
		gf_node_unregister(l3d->viewpoint, n);
		gf_node_register(btop, n); 
		l3d->viewpoint = btop;
		gf_node_event_out_str(n, "viewpoint");
	}
	if (force_traverse) gf_node_traverse(l3d->navigationInfo, tr_state);
	btop = (GF_Node*)gf_list_get(tr_state->navigations, 0);
	if (btop != l3d->navigationInfo) { 
		gf_node_unregister(l3d->navigationInfo, n);
		gf_node_register(btop, n); 
		l3d->navigationInfo = btop;
		gf_node_event_out_str(n, "navigationInfo");
	}
	if (force_traverse) gf_node_traverse(l3d->fog, tr_state);
	btop = (GF_Node*)gf_list_get(tr_state->fogs, 0);
	if (btop != l3d->fog) { 
		gf_node_unregister(l3d->fog, n);
		gf_node_register(btop, n); 
		l3d->fog = btop;
		gf_node_event_out_str(n, "fog");
	}
	tr_state->traversing_mode = mode;
}
Пример #3
0
void V4StudioFrame::OnNewShape(wxCommandEvent &event)
{
	if (!m_pV4sm) return;
	GF_Node *shape = m_pV4sm->NewNode(TAG_MPEG4_Shape);
	gf_node_insert_child(m_selection, shape, -1);
	gf_node_register( shape, m_selection);
	m_parentSelection = m_selection;
	m_selection = (GF_Node *)shape;
	Update();
}
Пример #4
0
void V4StudioFrame::OnNewBackground2D(wxCommandEvent &event)
{
	if (!m_pV4sm) return;
	GF_Node *b2d = m_pV4sm->NewNode(TAG_MPEG4_Background2D);
	gf_node_insert_child(m_selection, b2d, -1);
	gf_node_register(b2d, m_selection);
	m_parentSelection = m_selection;
	m_selection = b2d;
	Update();
}
Пример #5
0
void V4StudioFrame::OnNewColorTransform(wxCommandEvent &event)
{
	if (!m_pV4sm) return;
	GF_Node *ct = m_pV4sm->NewNode(TAG_MPEG4_ColorTransform);
	if (!m_selection) m_selection = m_pV4sm->GetRootNode();
	gf_node_insert_child(m_selection, ct, -1);
	gf_node_register(ct, m_selection);
	m_parentSelection = m_selection;
	m_selection = ct;
	Update();
}
Пример #6
0
void V4StudioFrame::OnNewRect(wxCommandEvent &event) 
{
	if (!m_pV4sm) return;
	GF_Node *rect = m_pV4sm->NewNode(TAG_MPEG4_Rectangle);
	M_Shape *shape = (M_Shape *)m_selection;
	shape->geometry = rect;
	gf_node_register(rect, m_selection);
	m_parentSelection = m_selection;
	m_selection = rect;
	Update();
}
Пример #7
0
void V4StudioFrame::OnNewFontStyle(wxCommandEvent &event) 
{
	if (!m_pV4sm) return;
	GF_Node *fs = m_pV4sm->NewNode(TAG_MPEG4_FontStyle);
	M_Text *text = (M_Text *)m_selection;
	text->fontStyle = fs;
	gf_node_register(fs, m_selection);
	m_selection = fs;
	m_parentSelection = (GF_Node *)text;
	Update();
}
Пример #8
0
void V4StudioFrame::OnNewText(wxCommandEvent &event) 
{
	if (!m_pV4sm) return;
	GF_Node *text = m_pV4sm->NewNode(TAG_MPEG4_Text);
	M_Shape *shape = (M_Shape *)m_selection;
	shape->geometry = text;
	gf_node_register(text, m_selection);
	m_parentSelection = m_selection;
	m_selection = text;
	Update();
}
Пример #9
0
void V4StudioFrame::OnNewTransformMatrix2D(wxCommandEvent &event)
{
	if (!m_pV4sm) return;
	GF_Node *tm2d = m_pV4sm->NewNode(TAG_MPEG4_TransformMatrix2D);
	if (!m_selection) m_selection = m_pV4sm->GetRootNode();
	gf_node_insert_child(m_selection, tm2d, -1);
	gf_node_register(tm2d, m_selection);
	m_parentSelection = m_selection;
	m_selection = (GF_Node *)tm2d;
	Update();
}
Пример #10
0
GF_Node *V4SceneGraph::CopyNode(GF_Node *node, GF_Node *parent, bool copy) 
{
	if (copy) return CloneNodeForEditing(m_pSg, node);
	u32 nodeID = gf_node_get_id(node);
	if (!nodeID) {
		nodeID = gf_sg_get_next_available_node_id(m_pSg);
		gf_node_set_id(node, nodeID, NULL);
		gf_node_register(node, parent);
	}
	return node;
}
Пример #11
0
void V4StudioFrame::OnNewAppearance(wxCommandEvent &event) 
{
	if (!m_pV4sm) return;
	GF_Node *app = m_pV4sm->NewNode(TAG_MPEG4_Appearance);
	M_Shape *shape = (M_Shape *)m_selection;
	shape->appearance = app;
	gf_node_register(app, m_selection);
	m_parentSelection = m_selection;
	m_selection = app;
	Update();
}
Пример #12
0
void V4StudioFrame::OnNewXLineProps(wxCommandEvent &event)
{
	if (!m_pV4sm) return;
	GF_Node *lp = m_pV4sm->NewNode(TAG_MPEG4_XLineProperties);
	M_Material2D *mat2d= (M_Material2D *)m_selection;
	mat2d->lineProps = lp;
	gf_node_register(lp, m_selection);
	m_parentSelection = m_selection;
	m_selection = lp;
	Update();
}
Пример #13
0
void V4StudioFrame::OnNewMovieTexture(wxCommandEvent &event)
{
	if (!m_pV4sm) return;
	GF_Node *mt = m_pV4sm->NewNode(TAG_MPEG4_MovieTexture);
	M_Appearance *app = (M_Appearance *)m_selection;
	app->texture = mt;
	gf_node_register(mt, m_selection);
	m_parentSelection = m_selection;
	m_selection = mt;
	Update();
}
Пример #14
0
void V4StudioFrame::OnNewRadialGradient(wxCommandEvent &event)
{
	if (!m_pV4sm) return;
	GF_Node *rg = m_pV4sm->NewNode(TAG_MPEG4_RadialGradient);
	M_Appearance *app = (M_Appearance *)m_selection;
	app->texture = rg;
	gf_node_register(rg, m_selection);
	m_parentSelection = m_selection;
	m_selection = rg;
	Update();
}
Пример #15
0
static GFINLINE GF_Node *create_node(GF_OSD *osd, u32 tag, GF_Node *par)
{
	GF_Node *n = gf_node_new(osd->odm->subscene->graph, tag);
	if (n) {
		gf_node_init(n);
		if (par) {
			gf_node_list_add_child( & ((GF_ParentNode *)par)->children, n);
			gf_node_register(n, par);
		}
	}
	return n;
}
Пример #16
0
void V4StudioFrame::OnNewMaterial2D(wxCommandEvent &event)
{
	if (!m_pV4sm) return;
	GF_Node *mat2d = m_pV4sm->NewNode(TAG_MPEG4_Material2D);
	M_Appearance *app = (M_Appearance *)m_selection;
	app->material = mat2d;
	gf_node_register(mat2d, m_selection);
	m_parentSelection = m_selection;

	m_selection = mat2d;
	Update();
}
Пример #17
0
void V4StudioFrame::OnNewCircle(wxCommandEvent &event) 
{
	if (!m_pV4sm) return;
	GF_Node *circle = m_pV4sm->NewNode(TAG_MPEG4_Circle);
	M_Shape *shape = (M_Shape *)m_selection;
	shape->geometry = circle;
	gf_node_register(circle, m_selection);
	((M_Circle *) circle)->radius = 75;
	m_parentSelection = m_selection;
	m_selection = circle;
	Update();
}
Пример #18
0
static void l2d_CheckBindables(GF_Node *n, GF_TraverseState *tr_state, Bool force_traverse)
{
	GF_Node *btop;
	M_Layer2D *l2d;
	l2d = (M_Layer2D *)n;
	if (force_traverse) gf_node_traverse(l2d->background, tr_state);
	btop = (GF_Node*)gf_list_get(tr_state->backgrounds, 0);
	if (btop != l2d->background) { 
		gf_node_unregister(l2d->background, n);
		gf_node_register(btop, n); 
		l2d->background = btop;
		gf_node_event_out_str(n, "background");
	}
	if (force_traverse) gf_node_traverse(l2d->viewport, tr_state);
	btop = (GF_Node*)gf_list_get(tr_state->viewpoints, 0);
	if (btop != l2d->viewport) { 
		gf_node_unregister(l2d->viewport, n);
		gf_node_register(btop, n); 
		l2d->viewport = btop;
		gf_node_event_out_str(n, "viewport");
	}
}
Пример #19
0
static Bool gf_smil_discard(SMIL_Timing_RTI *rti, Fixed scene_time)
{
	u32 nb_inst;
	SMIL_Time *begin;
	SMILTimingAttributesPointers *timingp = rti->timingp;
	GF_Node *target;
	u32 tag = gf_node_get_tag(rti->timed_elt);

	if (!timingp) return 0;
	
	if ((tag>=GF_NODE_RANGE_FIRST_SVG) && (tag<=GF_NODE_RANGE_LAST_SVG)) {
		target = ((SVGTimedAnimBaseElement *)rti->timed_elt)->xlinkp->href->target;
	} 
#ifdef GPAC_ENABLE_SVG_SA
	else if ((tag>=GF_NODE_RANGE_FIRST_SVG_SA) && (tag<=GF_NODE_RANGE_LAST_SVG_SA)) {
		target = ((SVG_SA_Element *)rti->timed_elt)->xlinkp->href->target;
	} 
#endif
#ifdef GPAC_ENABLE_SVG_SANI
	else if ((tag>=GF_NODE_RANGE_FIRST_SVG_SANI) && (tag<=GF_NODE_RANGE_LAST_SVG_SANI)) {
		target = ((SVG_SANI_Element *)rti->timed_elt)->xlinkp->href->target;
	}
#endif
	else {
		return 0;
	}
	
	begin = (timingp->begin ? (SMIL_Time *)gf_list_get(*timingp->begin, 0) : NULL);

	if (!begin) return 0;
	if (!GF_SMIL_TIME_IS_CLOCK(begin->type) ) return 0;
	if (!target) return 0;

	if (begin->clock > scene_time) return 0;

	GF_LOG(GF_LOG_DEBUG, GF_LOG_COMPOSE, ("[SVG Composer] discarding element %s at time %f\n", gf_node_get_name(target), scene_time));
	
	/*this takes care of cases where discard is a child of its target*/
	gf_node_register(rti->timed_elt, NULL);
	nb_inst = gf_node_get_num_instances(rti->timed_elt);
	gf_node_replace(target, NULL, 0);
	if (nb_inst == gf_node_get_num_instances(rti->timed_elt)) {
		gf_node_unregister(rti->timed_elt, NULL);
		/*after this the stack may be free'd*/
		gf_node_replace(rti->timed_elt, NULL, 0);
	} else {
		gf_node_unregister(rti->timed_elt, NULL);
	}
	return 1;
}
Пример #20
0
static GF_Err BM_ParseMultipleIndexedReplace(GF_BifsDecoder *codec, GF_BitStream *bs, GF_List *com_list)
{
	u32 ID, ind, field_ind, NumBits, lenpos, lennum, count;
	GF_Node *node;
	GF_Err e;
	GF_Command *com;
	GF_CommandField *inf;
	GF_FieldInfo field;

	ID = 1 + gf_bs_read_int(bs, codec->info->config.NodeIDBits);
	node = gf_sg_find_node(codec->current_graph, ID);
	if (!node) return GF_NON_COMPLIANT_BITSTREAM;
	NumBits = gf_get_bit_size(gf_node_get_num_fields_in_mode(node, GF_SG_FIELD_CODING_IN)-1);
	ind = gf_bs_read_int(bs, NumBits);
	e = gf_bifs_get_field_index(node, ind, GF_SG_FIELD_CODING_IN, &field_ind);
	if (e) return e;
	e = gf_node_get_field(node, field_ind, &field);
	if (gf_sg_vrml_is_sf_field(field.fieldType)) return GF_NON_COMPLIANT_BITSTREAM;

	lenpos = gf_bs_read_int(bs, 5);
	lennum = gf_bs_read_int(bs, 5);
	count = gf_bs_read_int(bs, lennum);

	com = gf_sg_command_new(codec->current_graph, GF_SG_MULTIPLE_INDEXED_REPLACE);
	BM_SetCommandNode(com, node);
	field.fieldType = gf_sg_vrml_get_sf_type(field.fieldType);

	while (count) {
		inf = gf_sg_command_field_new(com);
		inf->pos = gf_bs_read_int(bs, lenpos);
		inf->fieldIndex = field.fieldIndex;
		inf->fieldType = field.fieldType;

		if (field.fieldType==GF_SG_VRML_SFNODE) {
			inf->new_node = gf_bifs_dec_node(codec, bs, field.NDTtype);
			if (codec->LastError) goto err;
			inf->field_ptr = &inf->new_node;
			gf_node_register(inf->new_node, NULL);
		} else {
			field.far_ptr = inf->field_ptr = gf_sg_vrml_field_pointer_new(inf->fieldType);
			e = gf_bifs_dec_sf_field(codec, bs, node, &field, 1);
			if (e) goto err;
		}
		count--;
	}
err:
	if (e) gf_sg_command_del(com);
	else gf_list_add(com_list, com);
	return e;
}
Пример #21
0
// Add gen -- adds any element which can be a children of a switch node
void V4SceneManager::AddGen(GF_Node * node) {

  // retrieves the chain of children (field number 0 named "choice")
  GF_FieldInfo field;
  GF_List * list;

  gf_node_get_field(dictionnary, 0, &field);
  list = *( (GF_List **) field.far_ptr);

  // adds a reference to that node in the dictionnary
  gf_list_add(list, node);
  gf_node_register(node, dictionnary);

}
Пример #22
0
void V4StudioFrame::OnEditPasteUse(wxCommandEvent &WXUNUSED(event))
{
	if (!m_pV4sm) return;
	if (m_clipboardNode == NULL) return;

	GF_Node *copy = m_pV4sm->CopyNode(m_clipboardNode, m_parentSelection, false);
	gf_node_register(copy, m_selection);
	gf_node_insert_child(m_selection, copy, -1);
	m_pMainToolbar->EnableTool(TOOL_EDIT_CUT, true);
	m_pMainToolbar->EnableTool(TOOL_EDIT_COPY, true);
	m_pMainToolbar->EnableTool(TOOL_EDIT_PASTE, true);
	m_pMainToolbar->EnableTool(TOOL_EDIT_PASTE_USE, false);
	m_pMainToolbar->EnableTool(TOOL_EDIT_DELETE, false);

	Update();
}
Пример #23
0
static GF_Node *add_transform_matrix(SVG2BIFS_Converter *converter, GF_Node *node)
{
    M_TransformMatrix2D *tr = (M_TransformMatrix2D*)gf_node_new(converter->bifs_sg, TAG_MPEG4_TransformMatrix2D);
    gf_node_register((GF_Node *)tr, node);
    gf_node_list_add_child(&((GF_ParentNode*)node)->children, (GF_Node *)tr);
    if (converter->all_atts.transform) {
        SVG_Transform *svg_tr = converter->all_atts.transform;
        tr->mxx = svg_tr->mat.m[0];
        tr->mxy = svg_tr->mat.m[1];
        tr->tx  = svg_tr->mat.m[2];
        tr->myx = svg_tr->mat.m[3];
        tr->myy = svg_tr->mat.m[4];
        tr->ty  = svg_tr->mat.m[5];
    }
    return (GF_Node *)tr;

}
Пример #24
0
void V4StudioFrame::OnNewLayer2D(wxCommandEvent &event) 
{
	if (!m_pV4sm) return;
	GF_Node *top = m_pV4sm->GetRootNode();
	if (!top) {
		top = m_pV4sm->SetTopNode(TAG_MPEG4_Layer2D);
		m_selection = top;
		m_parentSelection = NULL;
	} else {
		GF_Node *l2d = m_pV4sm->NewNode(TAG_MPEG4_Layer2D);
		gf_node_insert_child(m_selection, l2d, -1);
    gf_node_register(l2d, m_selection);
		m_parentSelection = m_selection;
		m_selection = l2d;
	}
	Update();
}
Пример #25
0
void V4StudioFrame::OnNewOrderedGroup(wxCommandEvent &event) 
{
	if (!m_pV4sm) return;
	GF_Node *top = m_pV4sm->GetRootNode();
	if (!top) {
		top = m_pV4sm->SetTopNode(TAG_MPEG4_OrderedGroup);
		m_selection = top;
		m_parentSelection = NULL;
	} else {
		GF_Node *og = m_pV4sm->NewNode(TAG_MPEG4_OrderedGroup);
		gf_node_insert_child(m_selection, og, -1);
		gf_node_register(og, m_selection);
		m_parentSelection = m_selection;
		m_selection = og;
	}
	Update();
}
Пример #26
0
// MakeChild -- Sets the first node as a child of the second using the given field
void V4SceneManager::MakeChild(GF_Node * child, GF_Node * parent, const u32 fieldIndex) {
  // get the field where we have to add the new child
  GF_FieldInfo field;
  gf_node_get_field(parent, fieldIndex, &field);

  // keeps the count of uses up to date
  gf_node_register(child, parent);

  // if the field is single valued
  if (field.fieldType == GF_SG_VRML_SFNODE) {
    *((GF_Node **) field.far_ptr) = child;
  }

  // if the field is multi valued
  if (field.fieldType == GF_SG_VRML_MFNODE)
    gf_node_list_add_child((GF_ChildNodeItem **)field.far_ptr, child );

}
Пример #27
0
// CreateDictionnary -- Create the root node of the dictionnary and populates it
void V4SceneManager::CreateDictionnary() {
  GF_Node * root = gf_sg_get_root_node(m_pIs->graph);
  dictionnary = NewNode(TAG_MPEG4_Switch);

  // Insert the dictionnary in the scene and gives it a name
  gf_node_insert_child(root, dictionnary, 0);
  gf_node_register(dictionnary, root);
  gf_node_set_id(dictionnary, gf_sg_get_next_available_node_id(m_pIs->graph), DICTNAME);

  // makes the dictionnary invisible
  // the number 1 field is the "whichChoice", setting it to -1 makes it display nothing
  GF_FieldInfo field;
  gf_node_get_field(dictionnary, 1, &field);
  frame->GetFieldView()->SetFieldValue(field, &wxString("-1"), -1);  // TODO : maybe put the method SetFieldValue somewhere more accessible

  // populates dictionnary with the root node of the scene
  AddToDictionnary(root);
}
Пример #28
0
/*inserts a node in a container (node.children)*/
GF_Err BM_ParseNodeInsert(GF_BifsDecoder *codec, GF_BitStream *bs, GF_List *com_list)
{
	u32 NodeID, NDT;
	GF_Command *com;
	GF_CommandField *inf;
	s32 type, pos;
	GF_Node *node, *def;

	NodeID = 1 + gf_bs_read_int(bs, codec->info->config.NodeIDBits);
	def = gf_sg_find_node(codec->current_graph, NodeID);
	if (!def) return GF_NON_COMPLIANT_BITSTREAM;
	NDT = gf_bifs_get_child_table(def);
	if (!NDT) return GF_NON_COMPLIANT_BITSTREAM;

	type = gf_bs_read_int(bs, 2);
	switch (type) {
	case 0:
		pos = gf_bs_read_int(bs, 8);
		break;
	case 2:
		pos = 0;
		break;
	case 3:
		/*-1 means append*/
		pos = -1;
		break;
	default:
		return GF_NON_COMPLIANT_BITSTREAM;
	}
	node = gf_bifs_dec_node(codec, bs, NDT);
	if (!codec->LastError) {
		com = gf_sg_command_new(codec->current_graph, GF_SG_NODE_INSERT);
		BM_SetCommandNode(com, def);
		inf = gf_sg_command_field_new(com);
		inf->pos = pos;
		inf->new_node = node;
		inf->field_ptr = &inf->new_node;
		inf->fieldType = GF_SG_VRML_SFNODE;
		gf_list_add(com_list, com);
		/*register*/
		gf_node_register(node, NULL);
	}
	return codec->LastError;
}
Пример #29
0
V4SceneManager::~V4SceneManager()
{
	GF_SceneGraph *tmp = m_pIs->graph;

	/* Deletion of the SceneManager 
	   This is done before deleting the GF_InlineScene in the GF_Terminal in the GPAC Panel
	   but for that we need to register the root node one more time to avoid the deletion of the scene graph 
	   But this is temporary, this register of the root node should be done at loading time.
	*/
	if (m_pSm) {
		gf_node_register(m_pSm->scene_graph->RootNode, NULL);
		gf_sm_del(m_pSm);
		m_pSm = NULL;
	}

	/* Destruction of the GPAC panel and of the associated service and terminal */
	delete m_gpac_panel;
	m_gpac_panel = NULL;
	
}
Пример #30
0
GF_Node *V4SceneManager::SetTopNode(u32 tag) 
{
	GF_Node *root = NewNode(tag);
	gf_sg_set_root_node(m_pIs->graph, root);
	GF_StreamContext *sc = (GF_StreamContext *) gf_list_get(m_pSm->streams,0);
	if (sc->streamType == 3) {
		GF_AUContext *au = (GF_AUContext *) gf_list_get(sc->AUs,0);
		GF_Command *c = (GF_Command *) gf_list_get(au->commands,0);
		/* This is a patch to solve the save pb:
		    When ApplyCommand is made on a Scene Replace Command
		    The command node is set to NULL
		    When we save a BIFS stream whose first command is of this kind,
		    the file saver thinks the bifs commands should come from an NHNT file 
		   This is a temporary patch */
		if (c->tag == GF_SG_SCENE_REPLACE) { 
			c->node = m_pIs->graph->RootNode; 
			gf_node_register(m_pIs->graph->RootNode, NULL);
		}
	}
	return root;
}