[Live-devel] AMR timestamps

David Betrand bidibulle at operamail.com
Mon Mar 5 06:49:47 PST 2007


Hello Ross,

I am experiencing a timestamp problem when I use AMRAudioRTPSource 
and when I receive several AMR frames in a sinle RTP packet.

In RawAMRRTPSource:hasBeenSynchronizedUsingRTCP() : the method 
waits at least a complete interleave cycle of synchronized packets 
before returning true. So in this case some frames are not reported 
"synchronized" even if these frames are actually coming from a 
"synchronized" RTP packet.

My problem is that I need exactly to know if a frame is coming from 
a "synchronized" or not "synchronized" RTP packet. It is crucial 
when there is a large gap between streamer and receiver clocks. In 
this case it could lead to huge discontinutity of timestamps, in 
the past or in the future.

I solved this problem storing the "synchronization" info for each 
AMRDeinterleaverBuffer object. A boolean value is also stored in 
RawAMRRTPSource (actually fInputSource from AMRDeinterleaver point 
of view) and updated by reference at each time we call 
retreiveFrame method. By this mechanism the method 
hasBeenSynchronizedUsingRTCP() simply returns the new boolean.

I attached my patch for consideration to this email. Are changes in 
the code suitable?
Of course another suggestion to solve my problem will be welcome.

Thanks a lot in advance for your help.

David


-- 
_______________________________________________
Surf the Web in a faster, safer and easier way:
Download Opera 9 at http://www.opera.com

Powered by Outblaze
-------------- next part --------------
47,48d46
<   Boolean fIsSynchronized;
< 
101c99
<   RawAMRRTPSource* fInputSource;
---
>   FramedSource* fInputSource;
104d101
<   
220c217
<     fNumSuccessiveSyncedPackets(0), fIsSynchronized(false) {
---
>   fNumSuccessiveSyncedPackets(0) {
318c315
<   return fIsWideband ? "audio/AMR-WB" : "audio/AMR-NB";
---
>   return fIsWideband ? "audio/AMR-WB" : "audio/AMR-WB";
322,326d318
< 
<   return fIsSynchronized;
< 
<   // LIVE MEDIA VERSION
<   /*
336d327
<   */
413,414c404
< 			struct timeval& resultPresentationTime, 
< 			Boolean& resultIsSynchronized);
---
> 			struct timeval& resultPresentationTime);
431,432d420
<     
<     Boolean fIsSynchronized;
454c442,443
<   return new AMRDeinterleaver(env, isWideband, numChannels, maxInterleaveGroupSize, inputSource);
---
>   return new AMRDeinterleaver(env, isWideband, numChannels, maxInterleaveGroupSize,
> 			      inputSource);
475d463
< 
479,481c467
< 					   fLastFrameHeader, fPresentationTime, 
< 					   fInputSource->fIsSynchronized)) {
< 
---
> 					   fLastFrameHeader, fPresentationTime)) {
519d504
< 
560d544
< 
616d599
<   inBin.fIsSynchronized = (RTPSource*)source->RTPSource::hasBeenSynchronizedUsingRTCP();
630,632c613
< 		struct timeval& resultPresentationTime,
< 		Boolean& resultIsSynchronized) {
< 
---
> 		struct timeval& resultPresentationTime) {
636d616
< 
640d619
<   resultIsSynchronized = outBin.fIsSynchronized;


More information about the live-devel mailing list