SDL提供了针对YUV格式数据的直接写屏操作。废话不多说,直接上代码吧
/**
* file showyuv.c
* author: rare
* date: 2009/12/06
* email: dux003#163.com
*/
#include <stdlib.h>
#include "SDL.h"
int main(int argc , char* argv[])
{
int i = 1;
int x, y;
int w = 176;
int h = 144;
char c = 'n';
FILE* fp;
char filename[64];
unsigned char* pY;
unsigned char* pU;
unsigned char* pV;
SDL_Rect rect;
if (SDL_Init(SDL_INIT_VIDEO) < 0)
{
fprintf(stderr, "can not initialize SDL:%s/n", SDL_GetError());
exit(1);
}
atexit(SDL_Quit);
使用SDL播放YUV图像数据
最新推荐文章于 2024-04-28 22:32:03 发布