<div dir="ltr">To create a custom AVIOContext, I looked at:<div><br></div><div><div>
<p class="inbox-inbox-p1">AVIOContext *avio_alloc_context(</p>
<p class="inbox-inbox-p1"><span class="inbox-inbox-Apple-converted-space"> </span><span class="inbox-inbox-s1">unsigned</span> <span class="inbox-inbox-s1">char</span> *buffer,</p>
<p class="inbox-inbox-p1"><span class="inbox-inbox-Apple-converted-space"> </span><span class="inbox-inbox-s1">int</span> buffer_size,</p>
<p class="inbox-inbox-p1"><span class="inbox-inbox-Apple-converted-space"> </span><span class="inbox-inbox-s1">int</span> write_flag,</p>
<p class="inbox-inbox-p1"><span class="inbox-inbox-Apple-converted-space"> </span><span class="inbox-inbox-s1">void</span> *opaque,</p>
<p class="inbox-inbox-p1"><span class="inbox-inbox-Apple-converted-space"> </span><span class="inbox-inbox-s1">int</span> (*read_packet)(<span class="inbox-inbox-s1">void</span> *opaque, uint8_t *buf, <span class="inbox-inbox-s1">int</span> buf_size),</p>
<p class="inbox-inbox-p1"><span class="inbox-inbox-Apple-converted-space"> </span><span class="inbox-inbox-s1">int</span> (*write_packet)(<span class="inbox-inbox-s1">void</span> *opaque, uint8_t *buf, <span class="inbox-inbox-s1">int</span> buf_size),</p>
<p class="inbox-inbox-p1"><span class="inbox-inbox-Apple-converted-space"> </span>int64_t (*seek)(<span class="inbox-inbox-s1">void</span> *opaque, int64_t offset, <span class="inbox-inbox-s1">int</span> whence));</p><p class="inbox-inbox-p1">There are a bunch of parameters that I don't have access to such as buffer, buffer_size. Also I don't see any handlers for open and close.</p><p class="inbox-inbox-p1">Is there a better way to map ffurl_register_protocol parameters to a context?</p><p class="inbox-inbox-p1"><br></p>What I am trying to replace is:</div><div class="gmail_quote"><div dir="ltr"><br> <a href="http://cache1_protocol.name">cache1_protocol.name</a> = CACHE1_PROTO;<br><br> cache1_protocol.url_open = cache1_open;<br><br> cache1_protocol.url_open2 = 0;<br><br> cache1_protocol.url_read = cache1_read;<br><br> cache1_protocol.url_write = cache1_write;<br><br> cache1_protocol.url_seek = cache1_seek;<br><br> cache1_protocol.url_close = cache1_close;<br><br> ffurl_register_protocol(&cache1_protocol);<br><br>Thanks!<br><br> <br>On Tue, Oct 3, 2017 at 7:16 PM Mahboud Zabetian <<a href="mailto:mzabetian@tunein.com" target="_blank">mzabetian@tunein.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thank you both!<br><div class="gmail_quote"><div dir="ltr">On Tue, Oct 3, 2017 at 3:55 PM Hendrik Leppkes <<a href="mailto:h.leppkes@gmail.com" target="_blank">h.leppkes@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, Oct 3, 2017 at 10:39 PM, Mahboud Zabetian <<a href="mailto:mzabetian@tunein.com" target="_blank">mzabetian@tunein.com</a>> wrote:<br>
> Hi. I have old code that calls ffurl_register_protocol(), and linked with<br>
> FFMPEG 3.0.2.<br>
><br>
> I'm upgrading to FFMPEG 3.3. It looks like ffurl_register_protocol()n has<br>
> been deprecated, although there is not a whole lot of mention of what<br>
> replaced it. Google finds only few mentions, such as this one, where someone<br>
> is trying to export ffurl_register_protocol() to continue using it.<br>
><br>
> Any advice how I should proceed? How can I replace<br>
> ffurl_register_protocol()? Or do I look to export it in the latest FFMPEG?<br>
><br>
<br>
Use a custom avio context with read/write callbacks. Registering<br>
protocols externally is not supported, and the ffurl function was<br>
always an internal function that was errorneously available in a few<br>
versions.<br>
<br>
- Hendrik<br>
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
</blockquote></div></blockquote></div></div></div>