资源简介
TS解析源代码,比较详细,经典,适合入门开发者参考

代码片段和文件信息
#include “TSHeader.h“
#include “TSPacket.h“
#include
unsigned char g_TestData[ TEST_DATA_SIZE ];
unsigned char g_PacOutBuf[ TS_PACKET_OUT_SIZE ];
unsigned char g_UnPacOutBuf[ TS_UNPACKET_OUT_SIZE ];
int main(void)
{
int i = 0;
int m = 0;
//int iInSize = 1024;
int iPacOutSize = 0;
int iUnPacOutSize = 0;
unsigned char Head[ TS_PACKET_HEADER_SIZE ];
for(i = 0; i < TEST_DATA_SIZE; i++)
{
g_TestData[ i ] = 0xAA;
}
InitTSHdr( Head );
#if 0
for( i = 0 ; i < TS_PACKET_HEADER_SIZE; i++)
{
printf(“%X\n“Head[i]);
}
#endif
iPacOutSize = TS_Packetize( Head g_TestData TEST_DATA_SIZE g_PacOutBuf iPacOutSize );
if( iPacOutSize == ERROR )
{
printf(“pucTSHdr is NULL!“);
return -1;
}
if( iPacOutSize == OVERFLOW )
{
printf(“PacOutBuf OVERFLOW!“);
return -1;
}
#if 0
for( i = 0 ; i < TEST_DATA_SIZE; i++)
{
printf(“%X “g_TestData[i]);
m++;
if(m % 10 == 0 )
{
printf(“\n“);
}
}
printf(“\n“);
for(i = 0m = 0; i < iPacOutSize; i++)
{
printf(“%X “g_PacOutBuf[i]);
m++;
if(m % 10 == 0 )
{
printf(“\n“);
}
}
#endif
InitTSHdr( Head );
iUnPacOutSize = TS_Unpacketize( Head g_PacOutBuf iPacOutSize g_UnPacOutBuf iUnPacOutSize );
if( iUnPacOutSize == ERROR )
{
printf(“pucTSHdr is NULL!“);
return -1;
}
if( iUnPacOutSize == OVERFLOW )
{
printf(“UnPacOutBuf OVERFLOW!“);
return -1;
}
#if 0
printf(“upsize %d\n“iUnPacOutSize);
printf(“\n“);
//for(i=0;i //printf(“%X “g_UnPacBuf[i]);
for(i = 0m = 0; i < iUnPacOutSize; i++)
{
printf(“%X “g_UnPacOutBuf[ i ] );
m++;
if(m % 10 == 0 )
{
printf(“\n“);
}
}
#endif
for( i = 0; i < iUnPacOutSize ; i++)
{
if( g_TestData [ i ] != g_UnPacOutBuf[ i ] )
{
printf(“Error!\n“);
return -1;
}
}
printf(“Seccuss\n“);
return 0;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2114 2006-11-13 16:57 TS\test.c
文件 8213 2006-11-14 16:23 TS\TS
文件 1597 2006-11-14 15:06 TS\TSHeader.c
文件 1580 2006-11-13 16:57 TS\TSHeader.h
文件 3665 2006-11-13 16:57 TS\TSPacket.c
文件 1326 2006-11-13 14:01 TS\TSPacket.h
文件 2455 2006-11-13 16:57 TS\TSUnpacket.c
文件 1507 2006-11-12 09:37 TS\TSUnpacket.h
目录 0 2006-11-13 16:57 TS
----------- --------- ---------- ----- ----
22457 9
相关资源
- TSCC.exe
- Reparatory Effects of Nicotine on NMDA Recepto
- 连续hopfield神经网络解决TSP问题
- tsai经典两步法 很不错的
- OPC插件OPC Core Components 2.00 SDK 2.20
- 基于J2EE物资出入库管理系统
- Design of Analog CMOS Integrated Circuits 拉扎
- 易语言Bootstrap类模块2.13源码
- TSUMV56RBET液晶电视芯片介绍
- 基于比较基因组学的玉米ESTs定位方法
- Effects of the cultured Cordyceps exopolysacch
- Research on pharmacological effects of lycorin
- Element_Components_v2.1.0.rplib
- 全自动采集getshell工具
- web开发舔狗日记 框架bootstrap
- OdooHotelManagementSystem 基于Odoo的酒店管
- bootstrap demo 源码大全
- 用8位spi实现16位spi
- 美松打印机SDK MsPrintSDK-Demo-DLL-CShare-
- ts格式视频
- LCSTS高质量中文短文本摘要数据集
- 30分钟读懂ITIL4
- Can EC-MPS reduce gastrointestinal side effect
- BOSON模拟器NetSim V5.31破解版附注册机
- eCharts全国及各省、市、县地图层jso
- dive into design patterns(Alexander Shvets)
- TSP问题城市数据及最优解
- Convex Analysis and Optimization (Bertsekas
- Investigation of the Absorption Mechanism of G
- Laboratory investigation of the effects of str
评论
共有 条评论