Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Receivers and threads (was: Re: Re: Streamdev 0.0.2 problem)



On Tue, 6 May 2003, Klaus Schmidinger wrote:

>Any cReceiver attached to a cDevice is expected to accept the data
>provided in the Receive() call *IMMEDIATELY* and with as little delay as
>possible. If one cReceiver takes too long here it will slow down the
>whole process and eventually cause the data stream to break for others,
>too. There is no way VDR can buffer this, it's up to the individual
>cReceiver to buffer the data if it can't handle it immediately.

So the solution is to use a cThread for this as the plugin manual
suggests. But what about the data that the cReceiver gets? This snippet
from the plugin manual:

void cMyReceiver::Receive(uchar *Data, int Length)
{
  // buffer the data for processing in a separate thread
}

Should the receiver copy the data or can it just buffer the Data pointer
for later processing by the thread?


As for threads, what is the recommended way to start a thread? The
alternatives as far I can see are:

	cThread::StartThread(myThread)
and
	myThread->Start();

And then override cThread::Action() to start the actual data processing in
the thread?

Any hints? Is there a simplistic plugin that uses threads that I could
have a look at?

	Chakie

--
   Crowley was in Hell's bad books. Not that Hell has any other kind.
                           -- Terry Pratchett & Neil Gaiman, Good Omens
			   



-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index