Ok, after some hours of tinkering this (non-working) bit of code is what I have come up with:<br>*********************<br>int pipeFile[2]; // Pipe file descriptors<br>FILE* fdFile;<br>....<br>if (pipe(pipeFile) == -1) // create the pipe
<br> { perror ("pipe");<br> exit(1);<br> }<br>if ((fdFile = fdopen(pipeFile[0], "r")) == NULL) //open the read end of our pipe as a FILE<br> { perror ("fdopen");<br> exit(1);
<br> }<br>...<br>while (1) {<br> // Grab to our unix pipe<br> m_grabx(hin_, &cfInBuf_[0], ngot_); // this fills the buffer cfInBuf_<br> if (ngot_ > 0) {<br> // Send out the packet to Unix pipe
<br> write(pipeFile[1], &cfInBuf_[0], ngot_*sizeof(real_4)); // write to our pipe<br> }<br> }<br>...<br>and then,<br>ByteStreamFileSource* fileSource =<br> ByteStreamFileSource::createNew(*env, fdFile, deleteFidOnClose, inputDataChunkSize);
<br>and so on. <br><br>However, I am getting the error<br>BasicTaskScheduler::SingleStep(): select() fails: Bad file descriptor<br><br>Does anything look awry offhand? I would have like to have just passed createNew my pipe file descriptor, but I had to convert to the FILE struct to fit the createNew prototype. Thanks!
<br><br>Russell<br><br><br><br><br><div><span class="gmail_quote">On 6/20/07, <b class="gmail_sendername">Russell Brennan</b> <<a href="mailto:rjbrennn@gmail.com">rjbrennn@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>Well, I have been experimenting with piping and I can get file descriptors for pipes using the pipe() call, but it seems that I need a FILE sctruct rather than a file descriptor. Any ideas how to convert one to the other?
</div><span class="sg">
<div> </div>
<div>Russell<br><br> </div></span><div><span class="e" id="q_1134ac1fce18a7ef_2">
<div><span class="gmail_quote">On 6/20/07, <b class="gmail_sendername">Russell Brennan</b> <<a href="mailto:rjbrennn@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rjbrennn@gmail.com
</a>> wrote:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
<div>Yes, I'm on RedHat 5... Piping it sounds liek a great idea to me, I'm going to try to put something together and I'll post some code snippets for future reference when I get things running smoothly. Thanks,
</div>
<div> </div>
<div>Russell<br><br> </div>
<div><span>
<div><span class="gmail_quote">On 6/19/07, <b class="gmail_sendername">Ross Finlayson</b> <<a href="mailto:finlayson@live555.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">finlayson@live555.com
</a>> wrote:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">>I am trying to take a buffer of MPEG2-TS data which is constantly<br>>written to, and hook it up to live555 for output via RTP.
<br><br>The best way to do this is to make your buffer an OS pipe, and then<br>just have your LIVE555-based application read from this. For<br>example, if you write your MPEG-2 TS data to standard output (in one<br>process), and then pipe this to your LIVE-555-based application (in
<br>another process), that reads from "stdin" (see below).<br><br>If you do this, then you won't have to modify any existing code<br>(except the name of the input file in "testMPEG2TransportStreamer").
<br><br>> I am currently basing my work on the testMEPG2TransportStreamer<br>>code, but obviously this was designed to stream a file.<br><br>Yes - however, the special file name "stdin" can be used to read from
<br>standard input.<br><br>(I'm assuming that you're running a Unix system (including Linux).<br>If instead you're running Windows, then I don't know what you'd do<br>(although I think Windows has 'named pipes').)
<br>--<br><br>Ross Finlayson<br>Live Networks, Inc.<br><a href="http://www.live555.com/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.live555.com/</a><br>_______________________________________________
<br>live-devel mailing list<br><a href="mailto:live-devel@lists.live555.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">live-devel@lists.live555.com</a><br><a href="http://lists.live555.com/mailman/listinfo/live-devel" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://lists.live555.com/mailman/listinfo/live-devel</a><br></blockquote></div><br><br clear="all"><br></span></div><span>-- <br>Russell Brennan <br><a href="mailto:RJBrennn@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
RJBrennn@gmail.com</a><br>(708) 699-7314 </span></blockquote></div><br><br clear="all"><br>-- <br>Russell Brennan<br><a href="mailto:RJBrennn@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
RJBrennn@gmail.com</a><br>(708) 699-7314
</span></div></blockquote></div><br><br clear="all"><br>-- <br>Russell Brennan<br><a href="mailto:RJBrennn@gmail.com">RJBrennn@gmail.com</a><br>(708) 699-7314