[Live-devel] problems with New FramedSource creation

anand meher kvmsanand at gmail.com
Wed Dec 3 07:35:23 PST 2008


Dear Ross,
      I am relatively new using the live555 libraries and sorry if my
questions are too trivial. I read the FAQ especially the question which says
how to modify test*Streamer application to read from a live audio or video.
I wanted to modify testMPEG2TransportStreamer so that it can read from my
buffers instead of a file.

I have tried piping and using files as mentioned in the FAQ but i dont have
cotrol over the syncronization.

             I intended to  implement something like below....

 NewDeviceSource (which reads from the buffer containing *TS ) -->
TransportStreamFramer --> sink( a simple RTP sink)

*TS = (MPEG2 Transport Stream 188 byte packets)

     One question which i have is whether i have to also write a new Filter
for TransportStreamFramer . I already have the MPEG2 transport stream
packets in my buffer so i thought i need not write a new filter but instead
use the exising TransportStreamFramer.

Also i have a doubt in the way i need to signal the arrival of new data to
the event loop and i explain it below.

I used the watchVariable of the doEventloop and when ever its set i call
videoSink->startPlaying (  ).and i am not calling
newDeviceSource->doGetNextFrame()  because it needs to be framed by the
TransportStreamFramer.

I dont know wether calling videoSink->startPlaying() is the correct way of
signalling the new data.

 i can clarify some of the points if its not clear.

best regards
Anand Meher.








On Wed, Dec 3, 2008 at 2:46 PM, anand meher <kvmsanand at gmail.com> wrote:

> Hi everyone,
>                    I am developing software which is a multithreaded
> program and one thread requires the transport stream packets to be streamed
> from my data structures. I should also take care of mutual exclusion to the
> access of the data structure .I have created a new Device Source and
> implemented the doGetNextFrame() and deliverFrame() functions.
>
> the doGetNextFrame() function reads from the data strcutres and calls the
> deliver frame function.
> the deliverFrame function copies the data to fTo and then deletes the
> respective bytes from the data strucutre.
>
> //I have modelled the actual thread which streams along the lines of
> testMPEG2TransportStreamer.cpp
>
>
>
>
> in the play() function i do the following steps
>
> vectorSource = VectorDeviceSource::createNew(*env, g_packets_outputvector,
> g_packets_outputvectorlock,signal_vector);
>
> //where vectorSource is the new Device Source i have created.
>
> videoSource = MPEG2TransportStreamFramer::createNew(*env, vectorSource);
>  //then i create a videoSource for Framer and i pass theVectorSource
> object.
>
> then i call
>
> videoSink->startPlaying(*videoSource, afterPlaying, videoSink);
>
>
>
>
> BUT my program some how does not work properly...
>
> firslty it gets stuck in the deliverFrame() function always ....and uses
> lot of CPU and causes the other threads running to slow down as well.....
>
> I read some of the posts of live555 and feared that may be the program is
> going to a infinite loop..so i tried using the watchVariable in the event
> loop , but even that did not work .....
>
>
> 1) it would be great if some can help me in what i am missing .....
>
>
> i can claify if something is missing .........
>
> Regards
> Anand.
>
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20081203/a36bfeaa/attachment-0001.html>


More information about the live-devel mailing list