AiCPlayer
Interface of aic vm - for rendering aspect, sensors, video records
Macros | Functions | Variables
main.c File Reference

Main loop and graphical rendering. More...

#include <SDL2/SDL.h>
#include <SDL2/SDL_error.h>
#include <SDL2/SDL_events.h>
#include <SDL2/SDL_keyboard.h>
#include <SDL2/SDL_mouse.h>
#include <SDL2/SDL_render.h>
#include <SDL2/SDL_surface.h>
#include <SDL2/SDL_syswm.h>
#include <SDL2/SDL_version.h>
#include <SDL2/SDL_video.h>
#include <X11/Xlib.h>
#include <pthread.h>
#include <signal.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "buffer_sizes.h"
#include "config_env.h"
#include "dump_trace.h"
#include "grabber.h"
#include "host_gl.h"
#include "logger.h"
#include "render_api.h"
#include "sdl_events.h"
#include "sensors.h"
#include "socket.h"
Include dependency graph for main.c:

Go to the source code of this file.

Macros

#define LOG_TAG   "main"
 
#define USER_EVENT_ROTATION   1
 
#define USER_EVENT_NEWCLIENT   2
 
#define INPUT_PORT   22469
 

Functions

int main ()
 

Variables

int g_height
 Global variable for the window height. More...
 
int g_width
 Global variable for the window width. More...
 
float g_rotation = 0.0
 
void * g_window_id = NULL
 Global variable for the X window id. More...
 

Detailed Description

Main loop and graphical rendering.

Author
Alexandre BRUXELLE for ZENIKA

The main will start the opengl proxy thread, initialize the AOSP rendering libs on the port 22468, run the SDL input translator that connects to the VM on port 22469 that will send raw uinput events; and finally runs the sdl event loop.

Libs required to run the OpenGL remote rendering:

Definition in file main.c.

Macro Definition Documentation

#define INPUT_PORT   22469

Port used by the AiC VM for virtual input

Definition at line 76 of file main.c.

#define LOG_TAG   "main"

Definition at line 69 of file main.c.

#define USER_EVENT_NEWCLIENT   2

Custom SDL Event: new input daemon connection

Definition at line 73 of file main.c.

#define USER_EVENT_ROTATION   1

Custom SDL Event: Rotation event from the VM

Definition at line 71 of file main.c.

Function Documentation

int main ( )

Definition at line 306 of file main.c.

Here is the call graph for this function:

Variable Documentation

int g_height

Global variable for the window height.

Height of the window (can be resized at runtime)

Shared with the grabber.

Definition at line 87 of file main.c.

float g_rotation = 0.0

Rotation angle of the VM

Shared width sdl events

Definition at line 100 of file main.c.

int g_width

Global variable for the window width.

Width of the window (can be resized at runtime)

Shared with the grabber.

Definition at line 93 of file main.c.

void* g_window_id = NULL

Global variable for the X window id.

X Window ID

Definition at line 103 of file main.c.