<div>Hi Ross,</div>I have been playing with the FramedFilter class for a while, and created a simple filter that will just deliver its input to its output. However, it is not working for some reason. Can you point me to the point that I'm missing?<div>
<br></div><div><div>HistoryFilter::HistoryFilter(UsageEnvironment& env,</div><div><span class="Apple-tab-span" style="white-space:pre">                       </span>   FramedSource* inputSource)</div><div>  : FramedFilter(env, inputSource) {</div>
<div>}</div><div><br></div><div>HistoryFilter::~HistoryFilter() {</div><div>  Medium::close(fInputSource);</div><div>}</div><div><br></div><div>HistoryFilter* HistoryFilter::createNew(UsageEnvironment& env, FramedSource* inputSource, char const* fileName)</div>
<div>{</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>return new HistoryFilter(env, inputSource);</div><div>}</div><div><br></div><div>void HistoryFilter::doGetNextFrame()</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>fFrameSize=0;</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>fInputSource->getNextFrame(fTo, fMaxSize, afterGettingFrame, this, FramedSource::handleClosure, this);</div><div>}</div><div><br></div><div>void HistoryFilter::afterGettingFrame(void* clientData, unsigned  </div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>frameSize,<span class="Apple-tab-span" style="white-space:pre">  </span>unsigned /*numTruncatedBytes*/,<span class="Apple-tab-span" style="white-space:pre">     </span>struct timeval  </div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>presentationTime, unsigned /*durationInMicroseconds*/)</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre">       </span>HistoryFilter* filter = (HistoryFilter*)clientData;</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>filter->afterGettingFrame1(frameSize, presentationTime);</div><div>}</div><div><br></div><div>void HistoryFilter::afterGettingFrame1(unsigned frameSize, struct timeval presentationTime)</div>
<div>{</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>fFrameSize = frameSize;</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>fPresentationTime = presentationTime;</div><div>
<span class="Apple-tab-span" style="white-space:pre"> </span>afterGetting(this);</div><div>}</div><div><br></div>In my main server play() function, I put in this code:</div><div><br></div><div><div>FramedSource* videoES = fileSource;</div>
<div>// Create a framer for the Video Elementary Stream:</div><div>videoSource = MPEG4VideoStreamFramer::createNew(*env, videoES);</div><div>historyFilter = HistoryFilter::createNew(*env, videoSource, "history.mp4");</div>
<div>// Finally, start playing:</div><div>*env << "Beginning to read from file...\n";</div><div>videoSink->startPlaying(*historyFilter, afterPlaying, videoSink);</div></div><div><br></div><div>Thank you for your time and patience.<br>
<div class="gmail_quote">On Fri, Dec 9, 2011 at 2:41 AM, Ross Finlayson <span dir="ltr"><<a href="mailto:finlayson@live555.com">finlayson@live555.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><div class="im"><blockquote type="cite">I'm currently doing a live camera streaming project that needs a history function. I've done some search and come to the solution of creating a custom sink that is the combination of MPEG4ESVideoRTPSink and FileSink, which will stream to both a local file and the network.</blockquote>
<div><br></div></div>A simpler solution would be to write a new 'filter' class (i.e., a subclass of "FramedFilter") that simply delivers its input to its output, but also writes to a file.  Then, add an object of this class to the end of your data stream (i.e., before you feed it into a sink).  That way, you won't need to create (or modify) any "MediaSink" class at all.</div>
<span class="HOEnZb"><font color="#888888"><br><br><div>
<span style="border-collapse:separate;color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><span style="border-collapse:separate;color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium">Ross Finlayson<br>
Live Networks, Inc.<br><a href="http://www.live555.com/" target="_blank">http://www.live555.com/</a></span></span>
</div>
<br></font></span></div><br>_______________________________________________<br>
live-devel mailing list<br>
<a href="mailto:live-devel@lists.live555.com">live-devel@lists.live555.com</a><br>
<a href="http://lists.live555.com/mailman/listinfo/live-devel" target="_blank">http://lists.live555.com/mailman/listinfo/live-devel</a><br>
<br></blockquote></div><br></div>