void MPEG4GenericRTPSink
::doSpecialFrameHandling(unsigned fragmentationOffset,
unsigned char* frameStart,
unsigned numBytesInFrame,
struct timeval framePresentationTime,
unsigned numRemainingBytes) {
// Set the "AU Header Section". This is 4 bytes: 2 bytes for the
// initial "AU-headers-length" field, and 2 bytes for the first
// (and only) "AU Header":
unsigned fullFrameSize
= fragmentationOffset + numBytesInFrame + numRemainingBytes;
unsigned char headers[4];
headers[0] = 0; headers[1] = 16 /* bits */; // AU-headers-length
headers[2] = fullFrameSize >> 5; headers[3] = (fullFrameSize&0x1F)<<3;
setSpecialHeaderBytes(headers, sizeof headers);
if (numRemainingBytes == 0) {
// This packet contains the last (or only) fragment of the frame.
// Set the RTP 'M' ('marker') bit:
setMarkerBit();
}
// Important: Also call our base class's doSpecialFrameHandling(),
// to set the packet's timestamp:
MultiFramedRTPSink::doSpecialFrameHandling(fragmentationOffset,
frameStart, numBytesInFrame,
framePresentationTime,
numRemainingBytes);
}
参考rfc 3640
阅读(3866) | 评论(0) | 转发(0) |