Hi,
I'm trying to write a DirectShow(DS acronyms) Source Filter that will
send the test.m4e (from live tests) over RTSP to VLC player.
In my CRTSPFilter::Run DS method of my DirectShow filter I'm creating a
new thread that follows testOnDemandRTSPServer.cpp
Except it addSubsession my MPEG4VideoLiveServerMediaSubsession
subsession
char const* streamName = "mpeg4ESVideoTest";
ServerMediaSession* sms = ServerMediaSession::createNew(*env,
streamName, streamName, descriptionString);
MPEG4VideoLiveServerMediaSubsession* mP4LiveSms =
MPEG4VideoLiveServerMediaSubsession::createNew(*env, streamName,
reuseFirstSource);
sms->addSubsession(mP4LiveSms);
rtspServer->addServerMediaSession(sms);
announceStreamLive(rtspServer, sms, streamName);
also instead of env->taskScheduler().doEventLoop(); // does not return
Tried to use the fWatchVariable the synchronized between 2 threads(1) DS
Graph,2) My testOnDemandRTSPServer ) when I'm getting new data
(IMediaSample) from the DS Filter I'm setting WatchVariable=1.
Question #1: How should Notify MPEG4LiveSource::doGetNextFrame ?
while(true)
{
fWatchVariable = 0;
dummyTask(NULL); // 100 ms to awake a sleeping server.
env->taskScheduler().doEventLoop(&fWatchVariable);
if (fWatchVariable =1)
{
// How to Invoke MPEG4LiveSource::doGetNextFrame?
printf("\nEventThrown=%d,",fWatchVariable);
}
}
Following live FAQ and testOnDemandRTSPServer I subclass the following
classes:
MPEG4LiveServerMediaSubsession : public OnDemandServerMediaSubsession
and MPEG4LiveSource : public FramedSource.
Observing MPEG4VideoFileServerMediaSubsession I Implement
createNewStreamSource :
FramedSource
<http://www.live555.com/liveMedia/doxygen/html/classFramedSource.html> *
MPEG4VideoFileServerMediaSubsession
<http://www.live555.com/liveMedia/doxygen/html/classMPEG4VideoFileServer
MediaSubsession.html#dea3048c120932abeac4c9ffd7fc2fa4>
::createNewStreamSource
<http://www.live555.com/liveMedia/doxygen/html/classMPEG4VideoFileServer
MediaSubsession.html#dea3048c120932abeac4c9ffd7fc2fa4> (unsigned
/*clientSessionId*/, unsigned& estBitrate)
{
estBitrate = 500; // kbps, estimate
DeviceParamters *params = new DeviceParamters(); // Empty not uses
// Create the video source:
MPEG4LiveSource * mpeg4LiveSource = MPEG4LiveSource::createNew
<http://www.live555.com/liveMedia/doxygen/html/classByteStreamFileSource
.html#56c59cbcdf5c0bda78ece747037c6ff0> (envir
<http://www.live555.com/liveMedia/doxygen/html/classMedium.html#df197ac4
3716f54ffaa5c30c282cf767> (),params);
if (mpeg4LiveSource == NULL
<http://www.live555.com/liveMedia/doxygen/html/UsageEnvironment_8hh.html
#070d2ce7b6bb7e5c05602aa8c308d0c4> ) return NULL
<http://www.live555.com/liveMedia/doxygen/html/UsageEnvironment_8hh.html
#070d2ce7b6bb7e5c05602aa8c308d0c4> ;
// fFileSize
<http://www.live555.com/liveMedia/doxygen/html/classFileServerMediaSubse
ssion.html#cb1211712e0a6328f2acad830d898bf6> = fileSource->fileSize
<http://www.live555.com/liveMedia/doxygen/html/classByteStreamFileSource
.html#bca441959007427a78e9d802e3bf2d16> (); Not used getting frames
from DS filter
// Create a framer for the Video Elementary Stream:
return MPEG4VideoStreamFramer::createNew
<http://www.live555.com/liveMedia/doxygen/html/classMPEG4VideoStreamFram
er.html#d9e0d387596bc7c94591b9c0b25a2b06> (envir
<http://www.live555.com/liveMedia/doxygen/html/classMedium.html#df197ac4
3716f54ffaa5c30c282cf767> (),mpeg4LiveSource);
}
Is the same in MPEG4VideoFileServerMediaSubsession:
RTPSink*
MPEG4VideoLiveServerMediaSubsession::createNewRTPSink(Groupsock*
rtpGroupsock,
unsigned char
rtpPayloadTypeIfDynamic,
FramedSource* /*inputSource*/) {
return MPEG4ESVideoRTPSink::createNew(envir(), rtpGroupsock,
rtpPayloadTypeIfDynamic);
}
Question #2: Is It ok to use MPEG4VideoStreamFramer or should I use
MPEG4VideoStreamDiscreteFramer in order to parse test.m4e file.?
void MPEG4LiveSource::doGetNextFrame() {
if (!isCurrentlyAwaitingData())
return; // we're not ready for the
data yet
// WaitForSingleObject( hEvent, INFINITE ); // Question
#3: Try to sync both thread Ignoring TaskScheduler::doEventLoop()
<http://www.live555.com/liveMedia/doxygen/html/classTaskScheduler.html>
, is that recommendable?
if (lGActualDataLength < fMaxSize) {
memcpy(fTo,pbGReadBuffer,lGActualDataLength);
}
else {
fNumTruncatedBytes = lGActualDataLength
- fMaxSize;
}
fFrameSize = lGActualDataLength;
gettimeofday(&fPresentationTime,NULL);
fDurationInMicroseconds = 1000000 / 25; // 25 fps
nextTask() =
envir().taskScheduler().scheduleDelayedTask(0,(TaskFunc*)FramedSource::a
fterGetting, this); // Question #4: Is that good to call suitable
here?
}
Question #5: Run over the Mailing list I could not found any example of
streaming from DirectShopw filter, Is there a problem with that
approach?
Thanks,
Shveky Eyal
Software Engineer at Aeronautics
E-Mail: ey...@aeronautics-sys.com <mailto:ey...@aeronautics-sys.com>
Ext: +972-8-9433600 #731
**********************************************************************************************
LEGAL NOTICE - Unless expressly stated otherwise, this message, its annexes,
attachments, appendixes,
any subsequent correspondence, and any document, data, sketches, plans and/or
other material that is
hereby attached, are proprietary. confidential and may be legally privileged.
Nothing in this e-mail is intended to conclude a contract on behalf of
Aeronautics or
make it subject to any other legally binding commitments, unless the e-mail
contains an express statement to the contrary or incorporates a formal Purchase
Order.
This transmission is intended for the named addressee only. Unless you are the
named addressee (or
authorised to receive it for the addressee) you may not copy or use it, or
disclose it to anyone else, any
disclosure or copying of the contents of this e-mail or any action taken (or
not taken) in reliance on it is
unauthorised and may be unlawful. If you are not an addressee, please inform
the sender immediately.
IMPORTANT: The contents of this email and any attachments are confidential.
They are intended for the
named recipient(s) only.
If you have received this email in error, please notify the system manager or
the sender immediately and do
not disclose the contents to anyone or make copies thereof.
*** eSafe scanned this email for viruses, vandals, and malicious content. ***
**********************************************************************************************
_______________________________________________
live-devel mailing list
live-devel@lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel