avformat: remove deprecated FF_API_AVIO_WRITE_NONCONST

Signed-off-by: James Almer <jamrial@gmail.com>
release/7.0
James Almer 10 months ago
parent d6799ee0e4
commit 02aea61d69
  1. 4
      libavformat/avio.c
  2. 13
      libavformat/avio.h
  3. 4
      libavformat/avio_internal.h
  4. 28
      libavformat/aviobuf.c
  5. 4
      libavformat/hdsenc.c
  6. 4
      libavformat/smoothstreamingenc.c
  7. 8
      libavformat/url.h
  8. 1
      libavformat/version_major.h

@ -560,11 +560,7 @@ int ffurl_read_complete(URLContext *h, unsigned char *buf, int size)
return retry_transfer_wrapper(h, buf, NULL, size, size, 1);
}
#if FF_API_AVIO_WRITE_NONCONST
int ffurl_write2(void *urlcontext, uint8_t *buf, int size)
#else
int ffurl_write2(void *urlcontext, const uint8_t *buf, int size)
#endif
{
URLContext *h = urlcontext;

@ -232,11 +232,7 @@ typedef struct AVIOContext {
void *opaque; /**< A private pointer, passed to the read/write/seek/...
functions. */
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
#if FF_API_AVIO_WRITE_NONCONST
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
#else
int (*write_packet)(void *opaque, const uint8_t *buf, int buf_size);
#endif
int64_t (*seek)(void *opaque, int64_t offset, int whence);
int64_t pos; /**< position in the file of the current buffer */
int eof_reached; /**< true if was unable to read due to error or eof */
@ -284,13 +280,8 @@ typedef struct AVIOContext {
/**
* A callback that is used instead of write_packet.
*/
#if FF_API_AVIO_WRITE_NONCONST
int (*write_data_type)(void *opaque, uint8_t *buf, int buf_size,
enum AVIODataMarkerType type, int64_t time);
#else
int (*write_data_type)(void *opaque, const uint8_t *buf, int buf_size,
enum AVIODataMarkerType type, int64_t time);
#endif
/**
* If set, don't call write_data_type separately for AVIO_DATA_MARKER_BOUNDARY_POINT,
* but ignore them and treat them as AVIO_DATA_MARKER_UNKNOWN (to avoid needlessly
@ -410,11 +401,7 @@ AVIOContext *avio_alloc_context(
int write_flag,
void *opaque,
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
#if FF_API_AVIO_WRITE_NONCONST
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
#else
int (*write_packet)(void *opaque, const uint8_t *buf, int buf_size),
#endif
int64_t (*seek)(void *opaque, int64_t offset, int whence));
/**

@ -89,11 +89,7 @@ void ffio_init_context(FFIOContext *s,
int write_flag,
void *opaque,
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
#if FF_API_AVIO_WRITE_NONCONST
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
#else
int (*write_packet)(void *opaque, const uint8_t *buf, int buf_size),
#endif
int64_t (*seek)(void *opaque, int64_t offset, int whence));
/**

@ -52,11 +52,7 @@ void ffio_init_context(FFIOContext *ctx,
int write_flag,
void *opaque,
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
#if FF_API_AVIO_WRITE_NONCONST
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
#else
int (*write_packet)(void *opaque, const uint8_t *buf, int buf_size),
#endif
int64_t (*seek)(void *opaque, int64_t offset, int whence))
{
AVIOContext *const s = &ctx->pub;
@ -115,11 +111,7 @@ AVIOContext *avio_alloc_context(
int write_flag,
void *opaque,
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
#if FF_API_AVIO_WRITE_NONCONST
int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
#else
int (*write_packet)(void *opaque, const uint8_t *buf, int buf_size),
#endif
int64_t (*seek)(void *opaque, int64_t offset, int whence))
{
FFIOContext *s = av_malloc(sizeof(*s));
@ -141,20 +133,12 @@ static void writeout(AVIOContext *s, const uint8_t *data, int len)
if (!s->error) {
int ret = 0;
if (s->write_data_type)
#if FF_API_AVIO_WRITE_NONCONST
ret = s->write_data_type(s->opaque, (uint8_t *)data,
#else
ret = s->write_data_type(s->opaque, data,
#endif
len,
ctx->current_type,
ctx->last_time);
else if (s->write_packet)
#if FF_API_AVIO_WRITE_NONCONST
ret = s->write_packet(s->opaque, (uint8_t *)data, len);
#else
ret = s->write_packet(s->opaque, data, len);
#endif
if (ret < 0) {
s->error = ret;
} else {
@ -1290,11 +1274,7 @@ typedef struct DynBuffer {
uint8_t io_buffer[1];
} DynBuffer;
#if FF_API_AVIO_WRITE_NONCONST
static int dyn_buf_write(void *opaque, uint8_t *buf, int buf_size)
#else
static int dyn_buf_write(void *opaque, const uint8_t *buf, int buf_size)
#endif
{
DynBuffer *d = opaque;
unsigned new_size;
@ -1326,11 +1306,7 @@ static int dyn_buf_write(void *opaque, const uint8_t *buf, int buf_size)
return buf_size;
}
#if FF_API_AVIO_WRITE_NONCONST
static int dyn_packet_buf_write(void *opaque, uint8_t *buf, int buf_size)
#else
static int dyn_packet_buf_write(void *opaque, const uint8_t *buf, int buf_size)
#endif
{
unsigned char buf1[4];
int ret;
@ -1467,11 +1443,7 @@ void ffio_free_dyn_buf(AVIOContext **s)
avio_context_free(s);
}
#if FF_API_AVIO_WRITE_NONCONST
static int null_buf_write(void *opaque, uint8_t *buf, int buf_size)
#else
static int null_buf_write(void *opaque, const uint8_t *buf, int buf_size)
#endif
{
DynBuffer *d = opaque;

@ -112,11 +112,7 @@ static int parse_header(OutputStream *os, const uint8_t *buf, int buf_size)
return 0;
}
#if FF_API_AVIO_WRITE_NONCONST
static int hds_write(void *opaque, uint8_t *buf, int buf_size)
#else
static int hds_write(void *opaque, const uint8_t *buf, int buf_size)
#endif
{
OutputStream *os = opaque;
if (os->out) {

@ -75,11 +75,7 @@ typedef struct SmoothStreamingContext {
int nb_fragments;
} SmoothStreamingContext;
#if FF_API_AVIO_WRITE_NONCONST
static int ism_write(void *opaque, uint8_t *buf, int buf_size)
#else
static int ism_write(void *opaque, const uint8_t *buf, int buf_size)
#endif
{
OutputStream *os = opaque;
if (os->out)

@ -192,11 +192,7 @@ static inline int ffurl_read(URLContext *h, uint8_t *buf, int size)
*/
int ffurl_read_complete(URLContext *h, unsigned char *buf, int size);
#if FF_API_AVIO_WRITE_NONCONST
int ffurl_write2(void *urlcontext, uint8_t *buf, int size);
#else
int ffurl_write2(void *urlcontext, const uint8_t *buf, int size);
#endif
/**
* Write size bytes from buf to the resource accessed by h.
*
@ -205,11 +201,7 @@ int ffurl_write2(void *urlcontext, const uint8_t *buf, int size);
*/
static inline int ffurl_write(URLContext *h, const uint8_t *buf, int size)
{
#if FF_API_AVIO_WRITE_NONCONST
return ffurl_write2(h, (uint8_t*)buf, size);
#else
return ffurl_write2(h, buf, size);
#endif
}
int64_t ffurl_seek2(void *urlcontext, int64_t pos, int whence);

@ -42,7 +42,6 @@
*
*/
#define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 61)
#define FF_API_AVIO_WRITE_NONCONST (LIBAVFORMAT_VERSION_MAJOR < 61)
#define FF_API_LAVF_SHORTEST (LIBAVFORMAT_VERSION_MAJOR < 61)
#define FF_API_ALLOW_FLUSH (LIBAVFORMAT_VERSION_MAJOR < 61)
#define FF_API_AVSTREAM_SIDE_DATA (LIBAVFORMAT_VERSION_MAJOR < 61)

Loading…
Cancel
Save