Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1814641
  • 博文数量: 274
  • 博客积分: 2366
  • 博客等级: 大尉
  • 技术积分: 1880
  • 用 户 组: 普通用户
  • 注册时间: 2007-04-22 09:37
文章分类

全部博文(274)

文章存档

2022年(1)

2020年(10)

2019年(7)

2018年(18)

2017年(26)

2016年(32)

2015年(43)

2014年(30)

2013年(44)

2012年(36)

2011年(17)

2010年(10)

分类: 其他平台

2014-02-10 15:01:20

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


阅读(3827) | 评论(0) | 转发(0) |
0

上一篇:同步方法

下一篇:郭得钢家训

给主人留下些什么吧!~~