本文来自:
http://blog.chinaunix.net/uid-23093301-id-86403.html
#ifndef __V4L2_DISPLAY_H_INCLUDES
#define __V4L2_DISPLAY_H_INCLUDES
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#include "decoder.h"
#define WINDOW_Caption "Video_Capture_By_Breeze"
#define YUV_WIDTH 320
#define YUV_HEIGHT 240
class CDisplay
{
private:
static int Display_WinProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam);
public:
enum
{
eWeight =320,
eHeight =240
};
public:
CDisplay();
~CDisplay();
int start();
int drow_img(void* img,size_t size);
private:
///////////////////////
Private Operation Field ///////////////////////
int hanlde_winpro(HWND hWnd, int message, WPARAM wParam, LPARAM lParam);
int init_window();
int handle_paint(HWND hWnd);
int handle_click(HWND hWnd, WPARAM wParam, LPARAM lParam);
int handle_timer(HWND hWnd);
////////// Show YuV OverDLay
void ShowYUVOverlay( HDC hdc);
private:
//////////////////////// config Private Field ////////////////////////
bool
m_started;
MAINWINCREATE m_CreateInfo;
HWND m_hMainWnd;
BITMAP m_bmp;
CDecoder
m_decoder;
GAL_Overlay *overlay;
void* m_img;
size_t m_size;
};
#endif