[Libav-user] What to replace ffurl_register_protocol with?

Mahboud Zabetian mzabetian at tunein.com
Wed Oct 4 23:29:19 EEST 2017


To create a custom AVIOContext, I looked at:

AVIOContext *avio_alloc_context(

                  unsigned char *buffer,

                  int buffer_size,

                  int write_flag,

                  void *opaque,

                  int (*read_packet)(void *opaque, uint8_t *buf, int
buf_size),

                  int (*write_packet)(void *opaque, uint8_t *buf, int
buf_size),

                  int64_t (*seek)(void *opaque, int64_t offset, int
whence));

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.

Is there a better way to map ffurl_register_protocol parameters to a
context?


What I am trying to replace is:

cache1_protocol.name = CACHE1_PROTO;

cache1_protocol.url_open = cache1_open;

cache1_protocol.url_open2 = 0;

cache1_protocol.url_read = cache1_read;

cache1_protocol.url_write = cache1_write;

cache1_protocol.url_seek = cache1_seek;

cache1_protocol.url_close = cache1_close;

ffurl_register_protocol(&cache1_protocol);

Thanks!


On Tue, Oct 3, 2017 at 7:16 PM Mahboud Zabetian <mzabetian at tunein.com>
wrote:

> Thank you both!
> On Tue, Oct 3, 2017 at 3:55 PM Hendrik Leppkes <h.leppkes at gmail.com>
> wrote:
>
>> On Tue, Oct 3, 2017 at 10:39 PM, Mahboud Zabetian <mzabetian at tunein.com>
>> wrote:
>> > Hi.  I have old code that calls ffurl_register_protocol(), and linked
>> with
>> > FFMPEG 3.0.2.
>> >
>> > I'm upgrading to FFMPEG 3.3. It looks like ffurl_register_protocol()n
>> has
>> > been deprecated, although there is not a whole lot of mention of what
>> > replaced it. Google finds only few mentions, such as this one, where
>> someone
>> > is trying to export ffurl_register_protocol() to continue using it.
>> >
>> > Any advice how I should proceed? How can I replace
>> > ffurl_register_protocol()? Or do I look to export it in the latest
>> FFMPEG?
>> >
>>
>> Use a custom avio context with read/write callbacks. Registering
>> protocols externally is not supported, and the ffurl function was
>> always an internal function that was errorneously available in a few
>> versions.
>>
>> - Hendrik
>> _______________________________________________
>> Libav-user mailing list
>> Libav-user at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/libav-user
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20171004/ec433d1e/attachment.html>


More information about the Libav-user mailing list