<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class="">Ok, I think I've found the issue. The culprit here is the StreamReplica class which is <br class="">a FrameSource, but it is not a JPEG video source, i.e. it does not return True for:<br class=""><br class="">virtual Boolean isJPEGVideoSource();<br class=""></div></blockquote><div><br class=""></div>OK, so yes - that’s the problem.</div><div><br class=""></div><div>The data that you feed to “JPEGVideoRTPSink” MUST BE a subclass of “JPEGVideoSource”. It can’t just redefine “isJPEGVideoSource()” to return True (or just do some type casting hack). The reason for this is that “JPEGVideoRTPSink” needs to know the “type”, “qFactor”, “width”, and “height” of the frames that it receives (so it can pack these values into the appropriate fields of the outgoing RTP packet).</div><div><br class=""></div><div>So, you’ll need to define your own subclass of “JPEGVideoSource” - e.g., called “ReplicaJPEGVideoSource”. This must take as input another “FramedSource” object (a “StreamReplica”, in your case), and must implement the following (pure) virtual functions: “doGetNextFrame()”, “type()”, “qFactor()”, “width()”, “height()”.</div><div><br class=""></div><div>Implementing “doGetNextFrame()” is easy; just call “getNextFrame()” on the input (“StreamReplica”) object.</div><div><br class=""></div><div>To implement the other virtual functions (“type()”, “qFactor()”, “width()”, “height()”), you’ll need to have these four parameters added to each frame of data somehow. I.e., you’ll need to modify your original JPEG video source object - i.e., the one that you feed into the “StreamReplicator” - to add a header at the start (or at the end) that contains these four values.</div><div><br class=""></div><div>These four values will presumably also be useful to the other replica - the one that you feed into a “FileSink”.</div><div><br class=""></div><div>Your “ReplicaJPEGVideoSource” class should also make sure that its destructor calls “Medium::close()” on the input source (a “StreamReplica”), and should also reimplement the “doStopGettingFrames()” virtual function to call “stopGettingFrames()” on the input source. (Note the implementation of “FramedFilter”, which does the same thing. In fact, you *might* try having your “ReplicaJPEGVideoSource” class inherit from both “JPEGVideoSource” and “FramedFilter”, but I’m not sure whether or not that will work. (I’m wary of multiple inheritance in C++, and haven’t used it at all in any of the LIVE555 code so far.))</div><div><br class=""></div><div>Finally, you’ll need to modify your implementation of “createNewStreamSource()” to not just return a new “StreamReplica”, but instead to feed this “StreamReplica” into a new “ReplicaJPEGVideoSource” object, and then return a pointer to this new “ReplicaJPEGVideoSource” object.</div><br class=""><br class=""><div apple-content-edited="true" class="">
<span class="Apple-style-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; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-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; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">Ross Finlayson<br class="">Live Networks, Inc.<br class=""><a href="http://www.live555.com/" class="">http://www.live555.com/</a></span></span>
</div>
<br class=""></body></html>