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
stco.c
Package: NETVIDEO.rar [view]
Upload User: sun1608
Upload Date: 2007-02-02
Package Size: 6116k
Code Size: 2k
Category:
Streaming_Mpeg4
Development Platform:
Visual C++
- #include "quicktime.h"
- int quicktime_stco_init(quicktime_stco_t *stco)
- {
- stco->version = 0;
- stco->flags = 0;
- stco->total_entries = 0;
- stco->entries_allocated = 0;
- }
- int quicktime_stco_delete(quicktime_stco_t *stco)
- {
- if(stco->total_entries) free(stco->table);
- stco->total_entries = 0;
- stco->entries_allocated = 0;
- }
- int quicktime_stco_init_common(quicktime_t *file, quicktime_stco_t *stco)
- {
- if(!stco->entries_allocated)
- {
- stco->entries_allocated = 2000;
- stco->total_entries = 0;
- stco->table = (quicktime_stco_table_t*)malloc(sizeof(quicktime_stco_table_t) * stco->entries_allocated);
- /*printf("quicktime_stco_init_common %xn", stco->table); */
- }
- }
- int quicktime_stco_dump(quicktime_stco_t *stco)
- {
- int i;
- printf(" chunk offsetn");
- printf(" version %dn", stco->version);
- printf(" flags %dn", stco->flags);
- printf(" total_entries %dn", stco->total_entries);
- for(i = 0; i < stco->total_entries; i++)
- {
- printf(" offset %d %xn", i, stco->table[i].offset);
- }
- }
- int quicktime_read_stco(quicktime_t *file, quicktime_stco_t *stco)
- {
- int i;
- stco->version = quicktime_read_char(file);
- stco->flags = quicktime_read_int24(file);
- stco->total_entries = quicktime_read_int32(file);
- /*printf("stco->total_entries %d %xn", stco->total_entries, stco); */
- stco->entries_allocated = stco->total_entries;
- stco->table = (quicktime_stco_table_t*)malloc(sizeof(quicktime_stco_table_t) * stco->entries_allocated);
- for(i = 0; i < stco->total_entries; i++)
- {
- stco->table[i].offset = quicktime_read_int32(file);
- }
- }
- int quicktime_write_stco(quicktime_t *file, quicktime_stco_t *stco)
- {
- int i;
- quicktime_atom_t atom;
- quicktime_atom_write_header(file, &atom, "stco");
- quicktime_write_char(file, stco->version);
- quicktime_write_int24(file, stco->flags);
- quicktime_write_int32(file, stco->total_entries);
- for(i = 0; i < stco->total_entries; i++)
- {
- quicktime_write_int32(file, stco->table[i].offset);
- }
- quicktime_atom_write_footer(file, &atom);
- }
- int quicktime_update_stco(quicktime_stco_t *stco, long chunk, long offset)
- {
- quicktime_stco_table_t *new_table;
- long i;
- if(chunk > stco->entries_allocated)
- {
- stco->entries_allocated = chunk * 2;
- stco->table = (quicktime_stco_table_t*)realloc(stco->table,
- sizeof(quicktime_stco_table_t) * stco->entries_allocated);
- }
- stco->table[chunk - 1].offset = offset;
- if(chunk > stco->total_entries)
- stco->total_entries = chunk;
- }