<div>Hi All!</div><div><br></div><div>I have a question related to demuxing of incoming rtp stream by means of libavformat.</div><div><br></div><div>1) My program has it own event loop (libevent) and I can't easily integrate libavformat routines to reading from udp and tcp sockets straightforwardly</div>
<div>2) I already wrote custom IO routines and RTSP protocol negotiator (communicates with other side and requests streaming from RTSP server to local udp ports)</div><div><br></div><div>What I tried to do:</div><div><br>
</div><div> ioBuffer_ = (unsigned char *)av_mallocz(_IO_BUFFER_SIZE </div><div>                                                + FF_INPUT_BUFFER_PADDING_SIZE);</div><div>  </div><div> ioContext_ = avio_alloc_context(ioBuffer_, _IO_BUFFER_SIZE,</div>
<div>           0, ptr, my_read, NULL, NULL); </div><div><br></div><div><br></div><div> formatCtx_ = avformat_alloc_context();</div><div> formatCtx_->flags |= AVFMT_FLAG_CUSTOM_IO | AVFMT_FLAG_NONBLOCK;</div><div> formatCtx_->pb = ioContext_;</div>
<div> res = avformat_open_input(&formatCtx_, "spf-avs", NULL, NULL);</div><div><br></div><div><br></div><div>my_read() - reads incoming raw RTP stream packets</div><div><br></div><div>Unfortunately constantly returns AVERROR(EAGAIN) </div>
<div><br></div><div>I just want to feed raw RTP data to libavformat for demuxing  purposes and just get the pure videodata back for further processing</div><div><br></div><div>What should I do for to get it done?</div><div>
<br></div><div>Thanks in advance!</div><div><br></div>-- <br>Be happy,<div>Best regards,<br><div>Dmitry Volyntsev</div></div><br>