Structs.h
资源名称:p2p_vod.rar [点击查看]
上传用户:liguizhu
上传日期:2015-11-01
资源大小:2422k
文件大小:2k
源码类别:
P2P编程
开发平台:
Visual C++
- /*
- * Openmysee
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- */
- #pragma once
- enum {
- MD5_LEN = 32, // MD5值的长度
- BLOCK_SIZE = 16384, // 默认分块大小
- };
- // 数据传输的相关信息,目前大小32字节
- class TransferInfo {
- public:
- TransferInfo() { memset(this, 0, sizeof(TransferInfo)); };
- LONGLONG totalDownBytes; // 总共下载字节
- LONGLONG totalUpBytes; // 总共上传字节
- float currDownSpeed; // 当前下载速度
- float currUpSpeed; // 当前上传速度
- float avgDownSpeed; // 平均下载速度
- float avgUpSpeed; // 平均上传速度
- };
- // DirectShow初始化需要的媒体类型数据,大小56字节
- struct TVMEDIATYPESECTION {
- GUID majortype;
- GUID subtype;
- GUID formattype;
- ULONG lSampleSize;
- unsigned bFixedSizeSamples:1;
- unsigned bTemporalCompression:1;
- unsigned bThisPinOnly:1;
- unsigned cbFormat:16;
- unsigned :13;
- };
- // Sample头的大小,共16字节
- struct SampleHeader {
- unsigned size:28; // 此Sample大小
- unsigned bDiscontinuity:1; // Sample属性
- unsigned bPreroll:1; // Sample属性
- unsigned bSyncPoint:1; // 是否关键帧
- unsigned bAudioSample:1; // 是否音频Sample
- UINT length; // 时间跨度
- LONGLONG start; // 起始时间
- };