示例#1
0
live_node_info*
JackClient::_LiveNodes(int32* live_count)
{
	BMediaRoster* roster = BMediaRoster::Roster();

	// TODO set autodeleter to live_nodes
	live_node_info* live_nodes = (live_node_info*) malloc(100);
	int32 count;

	media_format outFormat;
	memset(&outFormat, 0, sizeof(outFormat));
	outFormat.type = B_MEDIA_RAW_AUDIO;

	media_format inFormat;
	memset(&inFormat, 0, sizeof(inFormat));
	inFormat.type = B_MEDIA_RAW_AUDIO;

	status_t err = roster->GetLiveNodes(live_nodes, &count,
		&inFormat, &outFormat, NULL, 0);

	if (err != B_OK)
		return NULL;

	*live_count = count;
	return live_nodes;
}