- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
STORE.C
资源名称:VC++视频传输.rar [点击查看]
上传用户:hxb_1234
上传日期:2010-03-30
资源大小:8328k
文件大小:1k
源码类别:
VC书籍
开发平台:
Visual C++
- #include <stdlib.h>
- #include <stdio.h>
- #include <fcntl.h>
- #include "mp4_vars.h"
- #include "debug.h"
- #include "store.h"
- /**
- *
- **/
- static void store_yuv (char *name, unsigned char *src, int offset, int incr, int width, int height);
- static void putbyte (int c);
- /**/
- FILE * outfile;
- int create_flag = 1;
- const char mode_create[] = "wb";
- const char mode_open[] = "ab";
- /***/
- void storeframe (unsigned char *src[], int width, int height)
- {
- int offset = 0;
- int hor_size = mp4_state->horizontal_size;
- store_yuv (mp4_state->outputname, src[0], offset, width, hor_size, height);
- offset >>= 1;
- width >>= 1;
- height >>= 1;
- hor_size >>= 1;
- store_yuv (mp4_state->outputname, src[1], offset, width, hor_size, height);
- store_yuv (mp4_state->outputname, src[2], offset, width, hor_size, height);
- }
- /***/
- static void store_yuv (char *name, unsigned char *src, int offset,
- int incr, int width, int height)
- {
- int i;
- unsigned char *p;
- const char * mode = create_flag ? mode_create : mode_open;
- if (create_flag)
- create_flag = 0;
- if ((outfile = fopen (name, mode)) == NULL)
- {
- _Print ("Error: Couldn't append to %sn", name);
- exit(0);
- }
- for (i = 0; i < height; i++)
- {
- p = src + offset + incr * i;
- fwrite(p, width, 1, outfile);
- }
- fclose (outfile);
- }