mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
libavformat/avio: Utility function to return URLContext
This commit is contained in:
parent
c5fd57f483
commit
62f63b24bf
@ -132,6 +132,14 @@ int ffio_open_dyn_packet_buf(AVIOContext **s, int max_packet_size);
|
||||
*/
|
||||
int ffio_fdopen(AVIOContext **s, URLContext *h);
|
||||
|
||||
/**
|
||||
* Return the URLContext associated with the AVIOContext
|
||||
*
|
||||
* @param s IO context
|
||||
* @return pointer to URLContext or NULL.
|
||||
*/
|
||||
URLContext *ffio_geturlcontext(AVIOContext *s);
|
||||
|
||||
/**
|
||||
* Open a write-only fake memory stream. The written data is not stored
|
||||
* anywhere - this is only used for measuring the amount of data
|
||||
|
@ -980,6 +980,19 @@ fail:
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
URLContext* ffio_geturlcontext(AVIOContext *s)
|
||||
{
|
||||
AVIOInternal *internal;
|
||||
if (!s)
|
||||
return NULL;
|
||||
|
||||
internal = s->opaque;
|
||||
if (internal && s->read_packet == io_read_packet)
|
||||
return internal->h;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size)
|
||||
{
|
||||
uint8_t *buffer;
|
||||
|
Loading…
Reference in New Issue
Block a user