[Live-devel] doGetNextFrame() timing in mpeg2ts context
Horst Weglanz
weglanz12 at yahoo.com
Wed Nov 19 07:22:14 PST 2008
Hi,
I investigated this issue further and it confirms everything is okay, as long as my second source doesn't have any data yet. The instance the data is extracted and the call to finish the frame from this source:
nextTask() = envir().taskScheduler().scheduleDelayedTask(0,(TaskFunc*)FramedSource::afterGetting, this);
is scheduled and written to nextTask(), no more calls from the first source (ByteStreamFileSource or a similar own implementation):
nextTask() = envir().taskScheduler().scheduleDelayedTask(0,(TaskFunc*)FramedSource::afterGetting, this);
will get executed. As I said it seems the other "afterGetting(this)" call overwrites the existing call already in the scheduler, but these are different objects.
Thank you very much,
HW
----- Original Message ----
From: Horst Weglanz <weglanz12 at yahoo.com>
To: LIVE555 Streaming Media - development & use <live-devel at ns.live555.com>
Sent: Friday, November 14, 2008 3:47:28 PM
Subject: Re: [Live-devel] doGetNextFrame() timing in mpeg2ts context
Thank you,
I added a static hook to schedule another *doGetNextFrame()* call and it's working as expected. Except for one thing which seems to be an issue with my usage of the TaskScheduler. I added a ByteStreamFileSource to the output video and the funny thing is: scheduled events from the ByteStreamFileSource immediately stop being executed when the first data is available in MySource. These are different objects and in in MySource I do the following:
every time data available:
nextTask() = envir().taskScheduler().scheduleDelayedTask(0,(TaskFunc*)FramedSource::afterGetting, this);
every time no data available:
nextTask() = envir().taskScheduler().scheduleDelayedTask(100,(TaskFunc*)MySource::doGetNextFrameStatic, this);
and in the ByteStreamFileSource there is also this frequent call:
nextTask() = envir().taskScheduler().scheduleDelayedTask(0,(TaskFunc*)FramedSource::afterGetting, this);
Both sources do work alone and there is nothing wrong with the FileSource, the problems occurs only when two video sources being read in parallel. When I start my application usually data in MySource isn't instantly available so every time there is *no data* -> so it schedules doGetNextFrameStatic(). At the same time data from the ByteFileSource is being read. After it has read it's frame, it schedules the next frame to *FramedSource::afterGetting(this)* which is being called. The problems occurs the moment data in MySource is available and this object also schedules a call to *FramedSource::afterGetting(this)* -- it seams it somehow overwrites the call from ByteStreamFileSource to read the next frame; of course the function pointer is probably the same but the *this* parameter is different and *nextTask()* should point to a different TaskToken since they are both different objects.
What is going wrong here? Do I have to handle things differently when adding multiple video streams or where lies my mistake?
Thank you very much,
HW
More information about the live-devel
mailing list