72 lines
1.2 KiB
C
72 lines
1.2 KiB
C
|
#ifndef _SHADERYUV_TO_RGB_H_
|
||
|
#define _SHADERYUV_TO_RGB_H_
|
||
|
|
||
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <assert.h>
|
||
|
#include <stdarg.h>
|
||
|
#include <string.h>
|
||
|
#include <math.h>
|
||
|
|
||
|
#include <GLES2/gl2.h>
|
||
|
#include <EGL/egl.h>
|
||
|
#include <EGL/fbdev_window.h>
|
||
|
|
||
|
#include <time.h>
|
||
|
#include <sys/time.h>
|
||
|
|
||
|
/*YUV*/
|
||
|
static GLuint g_texYId;
|
||
|
static GLuint g_texUId;
|
||
|
static GLuint g_texVId;
|
||
|
static GLuint simpleProgram;
|
||
|
|
||
|
GLuint shaderHandle;
|
||
|
/*EGL*/
|
||
|
static EGLDisplay dpy;
|
||
|
static EGLSurface surface;
|
||
|
static EGLContext context;
|
||
|
fbdev_window Ewin;
|
||
|
|
||
|
static char * g_buffer = NULL;
|
||
|
static int g_width = 0;
|
||
|
static int g_height = 0;
|
||
|
static char * mgbuf = NULL;
|
||
|
typedef unsigned short index_t;
|
||
|
|
||
|
enum {
|
||
|
ATTRIB_VERTEX,
|
||
|
ATTRIB_TEXTURE,
|
||
|
};
|
||
|
typedef struct
|
||
|
{
|
||
|
unsigned int window_height;
|
||
|
unsigned int window_width;
|
||
|
unsigned int depth;
|
||
|
unsigned int fsaa;
|
||
|
} mmark_context;
|
||
|
|
||
|
typedef struct
|
||
|
{
|
||
|
int scr_width;
|
||
|
int scr_height;
|
||
|
}SCRresource;
|
||
|
|
||
|
typedef struct
|
||
|
{
|
||
|
int x;
|
||
|
int y;
|
||
|
int width;
|
||
|
int height;
|
||
|
}Position;
|
||
|
|
||
|
typedef struct
|
||
|
{
|
||
|
int yuv_width;
|
||
|
int yuv_height;
|
||
|
int yuv_size;
|
||
|
}YuvResource;
|
||
|
|
||
|
char *ShaderYUVtoRGB(const char *yuv_path, SCRresource * scr_resource, YuvResource * yuv_resource, Position *position);
|
||
|
#endif
|