• 大小: 11KB
    文件类型: .cpp
    金币: 1
    下载: 0 次
    发布日期: 2021-06-06
  • 语言: C/C++
  • 标签: yuv  播放器  

资源简介

yuv播放器,yuv播放器,cif格式,c语言,简单播放yuyv文件

资源截图

代码片段和文件信息


#include
#include
#include“stdio.h“
int maintest();
#pragma comment(lib“ws2_32.lib“)

#define SERVER_PORT 1111
#define WM_SOCKET (WM_USER+1)
#define MEDIA_WIDTH 352
#define MEDIA_HEIGHT 288
#define MAX_BUF MEDIA_WIDTH*MEDIA_HEIGHT*2 //文件大小
#define RGB_BUF MAX_BUF*2
#define SCREEN_X 600
#define SCREEN_Y 450
#define SLEEP_TIME 40
#define FLAGE 300
#define max(ab)        (((a) > (b)) ? (a) : (b))
#define ID_RED                  1
#define ID_RED1                  2
#define ID_RED2                 3
bool play();
FILE *fp;
BYTE *test;
static HWND hwnd;
static HWND sLoad;
static HWND sPlay; //button hwnd
static HWND sCancel;
static HWND chilren_hwnd;

HINSTANCE g_hInstance = NULL;
HANDLE g_hFile = NULL;
BOOL   g_stop = false;

bool ToPlayMedia();
LRESULT CALLBACK WndProc ( HWND hwnd  
   UINT message 
   WPARAM wParam 
   LPARAM lParam );

int WINAPI WinMain( HINSTANCE hInstance
                    HINSTANCE hPrevInstance
                    PSTR      szCmdLine
                    int       iCmdShow )
{

MSG msg;
static TCHAR szAppName[] = TEXT(“empty_window“);
g_hInstance = hInstance;
WNDCLASS wndclass;

wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = WndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hInstance;
wndclass.hIcon = LoadIcon( NULLIDI_APPLICATION );
wndclass.hCursor = LoadCursor( NULLIDC_ARROW );
wndclass.hbrBackground = ( HBRUSH )GetStockobject( WHITE_BRUSH );
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = szAppName;

if( !RegisterClass( &wndclass ) ){
MessageBox( NULLTEXT(“register error“)szAppNameMB_IConerror );
return false;
}


hwnd = CreateWindow( szAppName // window class name       
 TEXT (“yuyv“) // window caption       
 WS_OVERLAPPED     | \
                         WS_CAPTION        | \
                         WS_SYSMENU        | \
                         WS_THICKframe // window style       
 250 // initial x position       
 200 // initial y position        
 SCREEN_X // initial x size      
 SCREEN_Y // initial y size      
 NULL  // parent window handle        
 NULL // window menu handle
 hInstance // program instance handle
 NULL ) ; // creation parameters

ShowWindow( hwndSW_SHOW );
UpdateWindow( hwnd );

while( GetMessage( &msgNULL00 ) ){
TranslateMessage ( &msg );
DispatchMessage ( &msg );
}
return msg.wParam;
}

LRESULT CALLBACK WndProc ( HWND hwnd 
   UINT message 
   WPARAM wParam 
   LPARAM lParam )
{
HDC hdc;
PAINTSTRUCT ps ;
    HINSTANCE hInstance;
static HWND hwndReceiveEdit hwndSendEdit;

WSADATA WSAData;
static struct sockaddr_in serverfrom;
static SOCKET local_server local_listen;

评论

共有 条评论