[Linphone-users] [linphone-develpers]questions on mediastreamer rfc 2190
From:
tian yun
Subject:
[Linphone-users] [linphone-develpers]questions on mediastreamer rfc 2190 generated packets
Date:
Wed, 20 May 2009 14:13:06 +0800
Hi
I'm now studying the RTP packetlization for H.263-1995 frame in linphone. I saw mediastreamer use the mode A in rfc2190 to split the frame, which means that the bitstream will be packetlized on a GOB boundary or a picture boundary. In the function get_gbsc(), the following code is used to split the frame:
for (i = 2; i < len-4; i++) { buf = *((uint32_t *)(psc+i)); for (j = 0; j < 8; j++) { if (((buf >> j) & 0x00FCFFFF) == 0x00800000) {/*PSC*/ printf("-------%s: PSC, i=%d, j=%d, buf=%x\n", __func__, i, j, buf);
i += 2; k=i; break; } else if (((buf >> j) & 0x0080FFFF) == 0x00800000) {/*GBSC*/ printf("-------%s: GBSC,i=%d, j=%d, buf=%x\n", __func__, i, j, buf);
i += 2; k = i; break; } } }
I know the picture start code of H.263 is 0000 0000 0000 0000 100000 in 22 bits and GSBC start code is 0000 0000 0000 0000 1 in 17 bit, why do get_gbsc() use the mask 0x00FCFFFF and 0x0080FFFF here to pick out the PSC and GSBC header? How does it identify?