mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
avformat/async,cache: Use more unique context names
Otherwise Doxygen thinks any text like "Context for foo" is a link to the async protocol's struct called "Context". Reported-by: Andrew Sayers <ffmpeg-devel@pileofstuff.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
edc235e076
commit
8e27bd025f
@ -53,7 +53,7 @@ typedef struct RingBuffer
|
|||||||
int read_pos;
|
int read_pos;
|
||||||
} RingBuffer;
|
} RingBuffer;
|
||||||
|
|
||||||
typedef struct Context {
|
typedef struct AsyncContext {
|
||||||
AVClass *class;
|
AVClass *class;
|
||||||
URLContext *inner;
|
URLContext *inner;
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ typedef struct Context {
|
|||||||
|
|
||||||
int abort_request;
|
int abort_request;
|
||||||
AVIOInterruptCB interrupt_callback;
|
AVIOInterruptCB interrupt_callback;
|
||||||
} Context;
|
} AsyncContext;
|
||||||
|
|
||||||
static int ring_init(RingBuffer *ring, unsigned int capacity, int read_back_capacity)
|
static int ring_init(RingBuffer *ring, unsigned int capacity, int read_back_capacity)
|
||||||
{
|
{
|
||||||
@ -132,7 +132,7 @@ static int ring_read(RingBuffer *ring, void *dest, int buf_size)
|
|||||||
static int wrapped_url_read(void *src, void *dst, size_t *size)
|
static int wrapped_url_read(void *src, void *dst, size_t *size)
|
||||||
{
|
{
|
||||||
URLContext *h = src;
|
URLContext *h = src;
|
||||||
Context *c = h->priv_data;
|
AsyncContext *c = h->priv_data;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = ffurl_read(c->inner, dst, *size);
|
ret = ffurl_read(c->inner, dst, *size);
|
||||||
@ -170,7 +170,7 @@ static int ring_drain(RingBuffer *ring, int offset)
|
|||||||
static int async_check_interrupt(void *arg)
|
static int async_check_interrupt(void *arg)
|
||||||
{
|
{
|
||||||
URLContext *h = arg;
|
URLContext *h = arg;
|
||||||
Context *c = h->priv_data;
|
AsyncContext *c = h->priv_data;
|
||||||
|
|
||||||
if (c->abort_request)
|
if (c->abort_request)
|
||||||
return 1;
|
return 1;
|
||||||
@ -184,7 +184,7 @@ static int async_check_interrupt(void *arg)
|
|||||||
static void *async_buffer_task(void *arg)
|
static void *async_buffer_task(void *arg)
|
||||||
{
|
{
|
||||||
URLContext *h = arg;
|
URLContext *h = arg;
|
||||||
Context *c = h->priv_data;
|
AsyncContext *c = h->priv_data;
|
||||||
RingBuffer *ring = &c->ring;
|
RingBuffer *ring = &c->ring;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int64_t seek_ret;
|
int64_t seek_ret;
|
||||||
@ -249,7 +249,7 @@ static void *async_buffer_task(void *arg)
|
|||||||
|
|
||||||
static int async_open(URLContext *h, const char *arg, int flags, AVDictionary **options)
|
static int async_open(URLContext *h, const char *arg, int flags, AVDictionary **options)
|
||||||
{
|
{
|
||||||
Context *c = h->priv_data;
|
AsyncContext *c = h->priv_data;
|
||||||
int ret;
|
int ret;
|
||||||
AVIOInterruptCB interrupt_callback = {.callback = async_check_interrupt, .opaque = h};
|
AVIOInterruptCB interrupt_callback = {.callback = async_check_interrupt, .opaque = h};
|
||||||
|
|
||||||
@ -316,7 +316,7 @@ fifo_fail:
|
|||||||
|
|
||||||
static int async_close(URLContext *h)
|
static int async_close(URLContext *h)
|
||||||
{
|
{
|
||||||
Context *c = h->priv_data;
|
AsyncContext *c = h->priv_data;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
pthread_mutex_lock(&c->mutex);
|
pthread_mutex_lock(&c->mutex);
|
||||||
@ -339,7 +339,7 @@ static int async_close(URLContext *h)
|
|||||||
|
|
||||||
static int async_read_internal(URLContext *h, void *dest, int size)
|
static int async_read_internal(URLContext *h, void *dest, int size)
|
||||||
{
|
{
|
||||||
Context *c = h->priv_data;
|
AsyncContext *c = h->priv_data;
|
||||||
RingBuffer *ring = &c->ring;
|
RingBuffer *ring = &c->ring;
|
||||||
int read_complete = !dest;
|
int read_complete = !dest;
|
||||||
int to_read = size;
|
int to_read = size;
|
||||||
@ -391,7 +391,7 @@ static int async_read(URLContext *h, unsigned char *buf, int size)
|
|||||||
|
|
||||||
static int64_t async_seek(URLContext *h, int64_t pos, int whence)
|
static int64_t async_seek(URLContext *h, int64_t pos, int whence)
|
||||||
{
|
{
|
||||||
Context *c = h->priv_data;
|
AsyncContext *c = h->priv_data;
|
||||||
RingBuffer *ring = &c->ring;
|
RingBuffer *ring = &c->ring;
|
||||||
int64_t ret;
|
int64_t ret;
|
||||||
int64_t new_logical_pos;
|
int64_t new_logical_pos;
|
||||||
@ -472,7 +472,7 @@ static int64_t async_seek(URLContext *h, int64_t pos, int whence)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define OFFSET(x) offsetof(Context, x)
|
#define OFFSET(x) offsetof(AsyncContext, x)
|
||||||
#define D AV_OPT_FLAG_DECODING_PARAM
|
#define D AV_OPT_FLAG_DECODING_PARAM
|
||||||
|
|
||||||
static const AVOption options[] = {
|
static const AVOption options[] = {
|
||||||
@ -495,7 +495,7 @@ const URLProtocol ff_async_protocol = {
|
|||||||
.url_read = async_read,
|
.url_read = async_read,
|
||||||
.url_seek = async_seek,
|
.url_seek = async_seek,
|
||||||
.url_close = async_close,
|
.url_close = async_close,
|
||||||
.priv_data_size = sizeof(Context),
|
.priv_data_size = sizeof(AsyncContext),
|
||||||
.priv_data_class = &async_context_class,
|
.priv_data_class = &async_context_class,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ typedef struct CacheEntry {
|
|||||||
int size;
|
int size;
|
||||||
} CacheEntry;
|
} CacheEntry;
|
||||||
|
|
||||||
typedef struct Context {
|
typedef struct CacheContext {
|
||||||
AVClass *class;
|
AVClass *class;
|
||||||
int fd;
|
int fd;
|
||||||
char *filename;
|
char *filename;
|
||||||
@ -65,7 +65,7 @@ typedef struct Context {
|
|||||||
URLContext *inner;
|
URLContext *inner;
|
||||||
int64_t cache_hit, cache_miss;
|
int64_t cache_hit, cache_miss;
|
||||||
int read_ahead_limit;
|
int read_ahead_limit;
|
||||||
} Context;
|
} CacheContext;
|
||||||
|
|
||||||
static int cmp(const void *key, const void *node)
|
static int cmp(const void *key, const void *node)
|
||||||
{
|
{
|
||||||
@ -74,9 +74,9 @@ static int cmp(const void *key, const void *node)
|
|||||||
|
|
||||||
static int cache_open(URLContext *h, const char *arg, int flags, AVDictionary **options)
|
static int cache_open(URLContext *h, const char *arg, int flags, AVDictionary **options)
|
||||||
{
|
{
|
||||||
|
CacheContext *c = h->priv_data;
|
||||||
int ret;
|
int ret;
|
||||||
char *buffername;
|
char *buffername;
|
||||||
Context *c= h->priv_data;
|
|
||||||
|
|
||||||
av_strstart(arg, "cache:", &arg);
|
av_strstart(arg, "cache:", &arg);
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ static int cache_open(URLContext *h, const char *arg, int flags, AVDictionary **
|
|||||||
|
|
||||||
static int add_entry(URLContext *h, const unsigned char *buf, int size)
|
static int add_entry(URLContext *h, const unsigned char *buf, int size)
|
||||||
{
|
{
|
||||||
Context *c= h->priv_data;
|
CacheContext *c = h->priv_data;
|
||||||
int64_t pos = -1;
|
int64_t pos = -1;
|
||||||
int ret;
|
int ret;
|
||||||
CacheEntry *entry = NULL, *next[2] = {NULL, NULL};
|
CacheEntry *entry = NULL, *next[2] = {NULL, NULL};
|
||||||
@ -162,7 +162,7 @@ fail:
|
|||||||
|
|
||||||
static int cache_read(URLContext *h, unsigned char *buf, int size)
|
static int cache_read(URLContext *h, unsigned char *buf, int size)
|
||||||
{
|
{
|
||||||
Context *c= h->priv_data;
|
CacheContext *c = h->priv_data;
|
||||||
CacheEntry *entry, *next[2] = {NULL, NULL};
|
CacheEntry *entry, *next[2] = {NULL, NULL};
|
||||||
int64_t r;
|
int64_t r;
|
||||||
|
|
||||||
@ -227,7 +227,7 @@ static int cache_read(URLContext *h, unsigned char *buf, int size)
|
|||||||
|
|
||||||
static int64_t cache_seek(URLContext *h, int64_t pos, int whence)
|
static int64_t cache_seek(URLContext *h, int64_t pos, int whence)
|
||||||
{
|
{
|
||||||
Context *c= h->priv_data;
|
CacheContext *c = h->priv_data;
|
||||||
int64_t ret;
|
int64_t ret;
|
||||||
|
|
||||||
if (whence == AVSEEK_SIZE) {
|
if (whence == AVSEEK_SIZE) {
|
||||||
@ -298,7 +298,7 @@ static int enu_free(void *opaque, void *elem)
|
|||||||
|
|
||||||
static int cache_close(URLContext *h)
|
static int cache_close(URLContext *h)
|
||||||
{
|
{
|
||||||
Context *c= h->priv_data;
|
CacheContext *c = h->priv_data;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
av_log(h, AV_LOG_INFO, "Statistics, cache hits:%"PRId64" cache misses:%"PRId64"\n",
|
av_log(h, AV_LOG_INFO, "Statistics, cache hits:%"PRId64" cache misses:%"PRId64"\n",
|
||||||
@ -318,7 +318,7 @@ static int cache_close(URLContext *h)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define OFFSET(x) offsetof(Context, x)
|
#define OFFSET(x) offsetof(CacheContext, x)
|
||||||
#define D AV_OPT_FLAG_DECODING_PARAM
|
#define D AV_OPT_FLAG_DECODING_PARAM
|
||||||
|
|
||||||
static const AVOption options[] = {
|
static const AVOption options[] = {
|
||||||
@ -339,6 +339,6 @@ const URLProtocol ff_cache_protocol = {
|
|||||||
.url_read = cache_read,
|
.url_read = cache_read,
|
||||||
.url_seek = cache_seek,
|
.url_seek = cache_seek,
|
||||||
.url_close = cache_close,
|
.url_close = cache_close,
|
||||||
.priv_data_size = sizeof(Context),
|
.priv_data_size = sizeof(CacheContext),
|
||||||
.priv_data_class = &cache_context_class,
|
.priv_data_class = &cache_context_class,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user