Пример #1
0
static void stream(PSERVER_DATA server, PCONFIGURATION config, enum platform system) {
  int appId = get_app_id(server, config->app);
  if (appId<0) {
    fprintf(stderr, "Can't find app %s\n", config->app);
    exit(-1);
  }

  gs_start_app(server, &config->stream, appId, config->sops, config->localaudio);

  void *context = NULL;
  #ifdef HAVE_SDL
  if (system == SDL)
    context = sdl_window;
  #endif

  LiStartConnection(server->address, &config->stream, &connection_callbacks, platform_get_video(system), platform_get_audio(system), context, 0, server->serverMajorVersion);

  if (IS_EMBEDDED(system)) {
    evdev_start();
    loop_main();
    evdev_stop();
  }
  #ifdef HAVE_SDL
  else if (system == SDL)
    sdl_loop();
  #endif

  LiStopConnection();
}
Пример #2
0
static void stream(PSERVER_DATA server, PCONFIGURATION config, enum platform system) {
    int appId = get_app_id(server, config->app);
    if (appId<0) {
        fprintf(stderr, "Can't find app %s\n", config->app);
        exit(-1);
    }

    int ret = gs_start_app(server, &config->stream, appId, config->sops, config->localaudio);
    if (ret < 0) {
        if (ret == GS_NOT_SUPPORTED_4K)
            fprintf(stderr, "Server doesn't support 4K\n");
        else
            fprintf(stderr, "Errorcode starting app: %d\n", err);
        exit(-1);
    }

    int drFlags = 0;
    if (config->fullscreen)
        drFlags |= DISPLAY_FULLSCREEN;

    if (config->forcehw)
        drFlags |= FORCE_HARDWARE_ACCELERATION;

    printf("Stream %d x %d, %d fps, %d kbps\n", config->stream.width, config->stream.height, config->stream.fps, config->stream.bitrate);
    LiStartConnection(server->address, &config->stream, &connection_callbacks, platform_get_video(system), platform_get_audio(system), NULL, drFlags, server->serverMajorVersion);

    if (IS_EMBEDDED(system)) {
        evdev_start();
        loop_main();
        evdev_stop();
    }
#ifdef HAVE_SDL
    else if (system == SDL)
        sdl_loop();
#endif

    LiStopConnection();
}