smhd.c
资源名称:NETVIDEO.rar [点击查看]
上传用户:sun1608
上传日期:2007-02-02
资源大小:6116k
文件大小:1k
源码类别:
流媒体/Mpeg4/MP4
开发平台:
Visual C++
- #include "quicktime.h"
- int quicktime_smhd_init(quicktime_smhd_t *smhd)
- {
- smhd->version = 0;
- smhd->flags = 0;
- smhd->balance = 0;
- smhd->reserved = 0;
- }
- int quicktime_smhd_delete(quicktime_smhd_t *smhd)
- {
- }
- int quicktime_smhd_dump(quicktime_smhd_t *smhd)
- {
- printf(" sound media headern");
- printf(" version %dn", smhd->version);
- printf(" flags %dn", smhd->flags);
- printf(" balance %dn", smhd->balance);
- printf(" reserved %dn", smhd->reserved);
- }
- int quicktime_read_smhd(quicktime_t *file, quicktime_smhd_t *smhd)
- {
- smhd->version = quicktime_read_char(file);
- smhd->flags = quicktime_read_int24(file);
- smhd->balance = quicktime_read_int16(file);
- smhd->reserved = quicktime_read_int16(file);
- }
- int quicktime_write_smhd(quicktime_t *file, quicktime_smhd_t *smhd)
- {
- quicktime_atom_t atom;
- quicktime_atom_write_header(file, &atom, "smhd");
- quicktime_write_char(file, smhd->version);
- quicktime_write_int24(file, smhd->flags);
- if (file->use_mp4) {
- quicktime_write_int32(file, 0x00000000);
- } else {
- quicktime_write_int16(file, smhd->balance);
- quicktime_write_int16(file, smhd->reserved);
- }
- quicktime_atom_write_footer(file, &atom);
- }