[Live-devel] Design question: transferring control of sending RTP packets to source

Ralf Globisch RGlobisch at csir.co.za
Tue Dec 11 07:02:26 PST 2007


Hi Ross,
Thanks for your previous feedback, it's helped me get up and running quickly ;)
Following your advice  I've managed to do the following:
I've written an RTP server and client based on the testMp3Streamer examples in which I'm just streaming a bunch of random data from the server to the client.
On the server side I've written these classes 
- class MyTestRTPSource: public FramedSource 
- class MyTestVideoRTPSink: public VideoRTPSink
On the client side:
- class MyTestVideoRTPSource: public MultiFramedRTPSource
- class MyCustomSink : public MediaSink
Everything works as it should and all data transmitted from the server is received at the client ;)

The next thing I would like to do is integrate the library into a DirectShow RTP filter server-side (I'll worry about the client side later).
However I'm unsure how to change the overall design structure of the code in order to integrate it into a DirectShow pipeline without hacking it too much.

Please correct me if I'm wrong: 
As far as I can see, all processing (sending of RTP data) occurs server side because of the task scheduler's event loop once the first packet has been scheduled by calling the sink's startPlaying() method:
        sessionState.sink->startPlaying(*sessionState.source, afterPlaying, NULL);
        env->taskScheduler().doEventLoop();
Structurally the MultiFramedRTPSink::sendPacketIfNecessary() is calling the following line right at the end 
        nextTask() = envir().taskScheduler().scheduleDelayedTask(uSecondsToGo, (TaskFunc*)sendNext, this);
This is causing the whole process to loop if I'm not mistaken: In a sense the sending of one packet schedules the sending of the next one?

How would I transfer control of the sending of messages to the DirectShow pipeline i.e. every time a frame arrives in my DirectShow filter I want to send an RTP packet instead of the letting the aforementioned event loop of the live library schedule events?
Do I need to write my own version of the MultiFramedRTPSink to transfer RTP control to the DirectShow pipeline and then call a method on my "FramedSource" subclass, which schedules another send every time I receive a frame in the DirectShow filter? 

Apologies if this post sounds messy, I'm finding it difficult to communicate my problem. 

Thanks,
Ralf



-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.



More information about the live-devel mailing list