/* using SDL2.0 with GTk */
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <iostream.h>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include <SDL2/SDL.h>
//#include <SDL2/SDL_Video.h>
#include <SDL2/SDL_thread.h>
#include <SDL2/SDL_syswm.h>
#include <SDL2/SDL_version.h>
#define WINSIZEX 320
#define WINSIZEY 200
/* The main display surface */
static GtkWidget *mainwin;
static GtkWidget* status_controls_hbox;
static GtkWidget *btnGtk;
static GtkWidget *hbox;
static GtkWidget *video_output;
SDL_Window *screen = NULL;
SDL_Texture *texture = NULL;
SDL_Renderer *renderer = NULL;
Uint32 g_winid = 0;
#define SDL_CUSTOM_EVENT (SDL_USEREVENT + 1)
int sdl_thread_custom_event(void *){
int i