00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #include "stdafx.h"
00036 #include ".\fishskeleton.h"
00037
00038 FishSkeleton::FishSkeleton(void)
00039 {
00040 }
00041
00042 FishSkeleton::~FishSkeleton(void)
00043 {
00044 }
00045 OggPage* FishSkeleton::makeFishHeadBOS_3_0 ( unsigned long inSerialNo
00046 , unsigned short inVersionMajor
00047 , unsigned short inVersionMinor
00048 , unsigned __int64 inTimebaseNum
00049 , unsigned __int64 inTimebaseDenom
00050 , const unsigned char* inUTC
00051
00052 )
00053 {
00054 unsigned char* locBuff = NULL;
00055 StampedOggPacket* locPack = NULL;
00056 OggPage* retPage = NULL;
00057 unsigned char* locSegTable = NULL;
00058 switch (inVersionMajor) {
00059 case 2:
00060 locBuff = new unsigned char[FishSkeleton::FISHEAD_3_0_PACKET_SIZE];
00061
00062
00063
00064
00065
00066
00067
00068 locBuff[0] = 'f';
00069 locBuff[1] = 'i';
00070 locBuff[2] = 's';
00071 locBuff[3] = 'h';
00072 locBuff[4] = 'e';
00073 locBuff[5] = 'a';
00074 locBuff[6] = 'd';
00075 locBuff[7] = 0;
00076 iLE_Math::UShortToCharArr(inVersionMajor, locBuff + 8);
00077 iLE_Math::UShortToCharArr(inVersionMinor, locBuff + 10);
00078 iLE_Math::Int64ToCharArr(inTimebaseNum, locBuff + 12);
00079 iLE_Math::Int64ToCharArr(inTimebaseDenom, locBuff + 20);
00080 for (int i = 0; i < 20; i++) {
00081 locBuff[28 + i] = inUTC[i];
00082 }
00083
00084 locPack = new StampedOggPacket(locBuff, FishSkeleton::FISHEAD_3_0_PACKET_SIZE, false, false, 0, 0, StampedOggPacket::OGG_END_ONLY);
00085
00086 retPage = new OggPage;
00087 retPage->header()->setHeaderFlags(2);
00088 retPage->header()->setGranulePos((__int64)0);
00089 retPage->header()->setNumPageSegments( 1);
00090 locSegTable = new unsigned char[1];
00091 locSegTable[0] = FishSkeleton::FISHEAD_3_0_PACKET_SIZE;
00092 retPage->header()->setSegmentTable(locSegTable, 1);
00093 retPage->header()->setHeaderSize(28);
00094 retPage->header()->setDataSize(FishSkeleton::FISHEAD_3_0_PACKET_SIZE);
00095
00096 retPage->header()->setStreamSerialNo(inSerialNo);
00097 retPage->addPacket(locPack);
00098
00099 return retPage;
00100
00101 default:
00102 return NULL;
00103
00104
00105 }
00106 }
00107
00108 StampedOggPacket* FishSkeleton::makeFishBone_3_0 ( unsigned __int64 inGranuleRateNum
00109 , unsigned __int64 inGranuleDenom
00110 , unsigned long inNumSecHeaders
00111 , unsigned short inGranuleShift
00112 , vector<string> inMessageHeaders
00113 )
00114 {
00115 return NULL;
00116 }