示例#1
0
bool
CodyCam::QuitRequested()
{
	_TearDownNodes();
	snooze(100000);

	return true;
}
示例#2
0
status_t
NodeManager::FormatChanged(BRect videoBounds, float videoFrameRate,
	color_space preferredVideoFormat, float audioFrameRate,
	uint32 audioChannels, uint32 enabledNodes, bool useOverlays, bool force)
{
	TRACE("NodeManager::FormatChanged()\n");

	if (!force && videoBounds == VideoBounds()
		&& videoFrameRate == FramesPerSecond()) {
		TRACE("   -> reusing existing nodes\n");
		// TODO: if enabledNodes would indicate that audio or video
		// is no longer needed, or, worse yet, suddenly needed when
		// it wasn't before, then we should not return here!
		PlaybackManager::Init(videoFrameRate, false, LoopMode(),
			IsLoopingEnabled(), Speed(), MODE_PLAYING_PAUSED_FORWARD,
			CurrentFrame());
		return B_OK;
	}

	_StopNodes();
	_TearDownNodes();

	PlaybackManager::Init(videoFrameRate, true, LoopMode(), IsLoopingEnabled(),
		Speed(), MODE_PLAYING_PAUSED_FORWARD, CurrentFrame());

	SetVideoBounds(videoBounds);

	status_t ret = _SetUpNodes(preferredVideoFormat, enabledNodes,
		useOverlays, audioFrameRate, audioChannels);
	if (ret == B_OK)
		_StartNodes();
	else
		fprintf(stderr, "unable to setup nodes: %s\n", strerror(ret));

	return ret;
}
示例#3
0
NodeManager::~NodeManager()
{
	_StopNodes();
	_TearDownNodes();
}
示例#4
0
status_t
NodeManager::CleanupNodes()
{
	_StopNodes();
	return _TearDownNodes(false);
}