[Libav-user] What to replace ffurl_register_protocol with?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[Libav-user] What to replace ffurl_register_protocol with?

Mahboud Zabetian
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?

Thanks!


_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: What to replace ffurl_register_protocol with?

Carl Eugen Hoyos-2
2017-10-03 22:39 GMT+02:00 Mahboud Zabetian <[hidden email]>:
> Hi.  I have old code that calls ffurl_register_protocol(), and linked with
> FFMPEG 3.0.2.

I don't think ffurl_register_protocol() was ever part of an installed
header, the name also indicates it was never meant to be
exported.

Carl Eugen
_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: What to replace ffurl_register_protocol with?

Hendrik Leppkes
In reply to this post by Mahboud Zabetian
On Tue, Oct 3, 2017 at 10:39 PM, Mahboud Zabetian <[hidden email]> 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
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: What to replace ffurl_register_protocol with?

Mahboud Zabetian
Thank you both!
On Tue, Oct 3, 2017 at 3:55 PM Hendrik Leppkes <[hidden email]> wrote:
On Tue, Oct 3, 2017 at 10:39 PM, Mahboud Zabetian <[hidden email]> 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
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user

_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: What to replace ffurl_register_protocol with?

Mahboud Zabetian
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 <[hidden email]> wrote:
Thank you both!
On Tue, Oct 3, 2017 at 3:55 PM Hendrik Leppkes <[hidden email]> wrote:
On Tue, Oct 3, 2017 at 10:39 PM, Mahboud Zabetian <[hidden email]> 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
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user

_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user