本文整理汇总了C++中Globals::setStream方法的典型用法代码示例。如果您正苦于以下问题:C++ Globals::setStream方法的具体用法?C++ Globals::setStream怎么用?C++ Globals::setStream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Globals
的用法示例。
在下文中一共展示了Globals::setStream方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main( int ac, char** av )
{
ControllerPi* controller = nullptr;
Stream* stream = nullptr;
Link* controller_link = nullptr;
Link* stream_link = nullptr;
if ( ac <= 1 ) {
gDebug() << "FATAL ERROR : No config file specified !\n";
return -1;
}
bcm_host_init();
signal( SIGSEGV, segv_handler );
Instance* instance = Instance::Create( "flight::control", 1, true, "framebuffer" );
Font* font = new Font( "data/FreeMonoBold.ttf", 28 );
Font* font_hud = new Font( "data/RobotoCondensed-Bold.ttf", 28, 0xFF000000 );
Config* config = new Config( av[1] );
config->Reload();
Globals* globals = new Globals( instance, font );
if ( config->string( "controller.link.link_type" ) == "Socket" ) {
controller_link = new ::Socket( config->string( "controller.link.address", "192.168.32.1" ), config->integer( "controller.link.port", 2020 ) );
} else if ( config->string( "controller.link.link_type" ) == "RawWifi" ) {
controller_link = new RawWifi( config->string( "controller.link.device", "wlan0" ), config->integer( "controller.link.output_port", 0 ), config->integer( "controller.link.input_port", 1 ) );
}
if ( config->string( "stream.link.link_type" ) == "Socket" ) {
stream_link = new ::Socket( config->string( "stream.link.address", "192.168.32.1" ), config->integer( "stream.link.port", 2020 ) );
} else if ( config->string( "stream.link.link_type" ) == "RawWifi" ) {
stream_link = new RawWifi( config->string( "stream.link.device", "wlan0" ), config->integer( "stream.link.output_port", 10 ), config->integer( "stream.link.input_port", 11 ) );
dynamic_cast< RawWifi* >( stream_link )->setBlocking( config->boolean( "stream.link.blocking", true ) );
dynamic_cast< RawWifi* >( stream_link )->setCECMode( config->string( "stream.link.cec_mode", "none" ) );
}
if ( controller_link ) {
controller = new ControllerPi( controller_link );
}
if ( stream_link ) {
stream = new Stream( controller, font_hud, stream_link, config->integer( "stream.width", 1920 ), config->integer( "stream.height", 1080 ), config->boolean( "stream.stereo", true ) );
stream->setStereo( config->boolean( "stream.stereo", true ) );
stream->setRenderHUD( config->boolean( "stream.hud", true ) );
}
globals->setStream( stream );
globals->setController( controller );
if ( config->boolean( "touchscreen.enabled", true ) ) {
globals->setCurrentPage( "PageMain" );
globals->Run();
} else {
while ( 1 ) {
usleep( 1000 * 1000 );
}
}
gDebug() << "Exiting\n";
globals->instance()->Exit( 0 );
return 0;
}