Exemplo n.º 1
0
/*check only URL changes*/
void InputSensorModified(GF_Node *node)
{
#if GPAC_HTK_DEMO
	GF_ObjectManager *odm;
	ISPriv *is_dec;
#endif
	GF_MediaObject *mo;
	ISStack *st = (ISStack *)gf_node_get_private(node);

	mo = gf_mo_find(node, &st->is->url, 0);
	if ((mo!=st->mo) || !st->registered){
		if (mo!=st->mo) {
			if (st->mo) IS_Unregister(st);
			st->mo = mo;
		}
		if (st->is->enabled) 
			IS_Register(node);
		else
			return;
	} else if (!st->is->enabled) {
		IS_Unregister(st);
		st->mo = NULL;
		return;
	}

#if GPAC_HTK_DEMO
	/*turn audio analyse on/off*/
	if (!st->is_dec || !st->is_dec->od_man) return;
	odm = st->is_dec->od_man;
	assert(odm->codec && (odm->codec->type == GF_STREAM_INTERACT));
	/*get IS dec*/
	is_dec = odm->codec->decio->privateStack;
	StartHTK(is_dec);
#endif
}
Exemplo n.º 2
0
void DestroyInputSensor(SFNode *node)
{
	ISStack *st = Node_GetPrivate(node);
	if (st->registered) IS_Unregister(st);
	VRML_MF_Reset(&st->url, FT_MFURL);
	free(st);
}
Exemplo n.º 3
0
/*check only URL changes*/
void InputSensorModified(GF_Node *node)
{
	GF_MediaObject *mo;
	ISStack *st = (ISStack *)gf_node_get_private(node);

	mo = gf_mo_register(node, &st->is->url, 0, 0);
	if ((mo!=st->mo) || !st->registered){
		if (mo!=st->mo) {
			if (st->mo) IS_Unregister(node, st);
			st->mo = mo;
		}
		if (st->is->enabled) 
			IS_Register(node);
		else
			return;
	} else if (!st->is->enabled) {
		IS_Unregister(node, st);
		return;
	}
}
Exemplo n.º 4
0
static void TraverseInputSensor(GF_Node *node, void *rs, Bool is_destroy)
{
	ISStack *st = (ISStack*)gf_node_get_private(node);
	M_InputSensor *is = (M_InputSensor *)node;

	if (is_destroy) {
		GF_Scene *scene;
		if (st->registered) IS_Unregister(node, st);
		scene = (GF_Scene*)gf_sg_get_private(gf_node_get_graph(node));
		gf_term_unqueue_node_traverse(scene->root_od->term, node);
		gf_free(st);
	} else {
		/*get decoder object */
		if (!st->mo) st->mo = gf_mo_register(node, &is->url, 0, 0);
		/*register with decoder*/
		if (st->mo && !st->registered) IS_Register(node);
	}
}
Exemplo n.º 5
0
static void RenderInputSensor(GF_Node *node, void *rs, Bool is_destroy)
{
	ISStack *st = (ISStack*)gf_node_get_private(node);
	M_InputSensor *is = (M_InputSensor *)node;

	if (is_destroy) {
		GF_InlineScene *is;
		if (st->registered) IS_Unregister(st);
		is = (GF_InlineScene*)gf_sg_get_private(gf_node_get_graph(node));
		gf_term_rem_render_node(is->root_od->term, node);
		free(st);
	} else {
		/*get decoder object */
		if (!st->mo) st->mo = gf_mo_find(node, &is->url, 0);
		/*register with decoder*/
		if (st->mo && !st->registered) IS_Register(node);
	}
}
Exemplo n.º 6
0
/*check only URL changes*/
void InputSensorModified(SFNode *node)
{
#if M4_HTK_DEMO
	ODManager *odm;
	ISPriv *is_dec;
#endif
	ISStack *st = Node_GetPrivate(node);
	if (!st->is_dec) return;

#if M4_HTK_DEMO
	/*turn audio analyse on/off*/
	if (!st->is_dec || !st->is_dec->od_man) return;
	odm = st->is_dec->od_man;
	assert(odm->codec && (odm->codec->type == M4ST_INTERACT));
	/*get IS dec*/
	is_dec = odm->codec->decio->privateStack;
	StartHTK(is_dec);
#endif

	if (! MO_UrlChanged(st->is_dec, &st->url)) return;
	/*unregister*/
	IS_Unregister(st);
}