Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
STORE.C
Package: Visual C++视频音频开发实用工程案例精选.rar [view]
Upload User: tuheem
Upload Date: 2007-05-01
Package Size: 21889k
Code Size: 1k
Category:
Multimedia Develop
Development Platform:
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);
- }