[ previous ] [ next ] [ threads ]
 To :  Yate List <yate@v...>
 From :  Paul Chitescu <paulc@v...>
 Subject :  Changes in DataSource and DataConsumer
 Date :  Thu, 2 Jul 2009 12:41:43 +0300
Hi people!

SVN Rev. 2745 brings some API changes to allow more information to be 
forwarded with the in-call data (audio) packets.

In particular the DataConsumer class is no longer source compatible with the 
old version.

This can break compilation of custom modules if they derive from the 
DataConsumer class. Fortunately, this will not silently break the 
functionality, you will get a "class has pure virtuals" error at compile 

If you don't need the new functionality just change the Consume method 
declaration from:
	virtual void Consume(const DataBlock&, unsigned long)
	virtual unsigned long Consume(const DataBlock&, unsigned long, unsigned long)
and make sure you return either 0 or invalidStamp() from the method.

If your custom module implements a codec it would be nice to apply the changes 
to forward silence information similar to those found in, say, gsmcodec.

if (data.null() && (flags & DataSilent))
	return getTransSource()->Forward(data,tStamp,flags)

Of course, you should place that piece of code after the check that 
getTransSource() is not NULL!