History

avformat: remove deprecated FF_API_AVIO_WRITE_NONCONST

James Almer committed 2 years ago

Commit 02aea611 parent d6799ee8 files · +0 −66Browse files

Showing the changes to libavformat (8 of 8 files). Show all

Unified · Split

8 files
  1. libavformat/avio.c +0 −4
  2. libavformat/avio.h +0 −13
  3. libavformat/avio_internal.h +0 −4
  4. libavformat/aviobuf.c +0 −28
  5. libavformat/hdsenc.c +0 −4
  6. libavformat/smoothstreamingenc.c +0 −4
  7. libavformat/url.h +0 −8
  8. libavformat/version_major.h +0 −1
libavformat/avio.c+0−4
@@ -560,11 +560,7 @@ int ffurl_read_complete(URLContext *h, unsigned char *buf, int size) · 559 unmodified lines
560560 return retry_transfer_wrapper(h, buf, NULL, size, size, 1);
561561 }
562562
563−#if FF_API_AVIO_WRITE_NONCONST
564−int ffurl_write2(void *urlcontext, uint8_t *buf, int size)
565−#else
566563 int ffurl_write2(void *urlcontext, const uint8_t *buf, int size)
567−#endif
568564 {
569565 URLContext *h = urlcontext;
570566
libavformat/avio.h+0−13
@@ -232,11 +232,7 @@ typedef struct AVIOContext { · 231 unmodified lines
232232 void *opaque; /**< A private pointer, passed to the read/write/seek/...
233233 functions. */
234234 int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
235−#if FF_API_AVIO_WRITE_NONCONST
236− int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
237−#else
238235 int (*write_packet)(void *opaque, const uint8_t *buf, int buf_size);
239−#endif
240236 int64_t (*seek)(void *opaque, int64_t offset, int whence);
241237 int64_t pos; /**< position in the file of the current buffer */
242238 int eof_reached; /**< true if was unable to read due to error or eof */
@@ -284,13 +280,8 @@ typedef struct AVIOContext { · 41 unmodified lines
284280 /**
285281 * A callback that is used instead of write_packet.
286282 */
287−#if FF_API_AVIO_WRITE_NONCONST
288− int (*write_data_type)(void *opaque, uint8_t *buf, int buf_size,
289− enum AVIODataMarkerType type, int64_t time);
290−#else
291283 int (*write_data_type)(void *opaque, const uint8_t *buf, int buf_size,
292284 enum AVIODataMarkerType type, int64_t time);
293−#endif
294285 /**
295286 * If set, don't call write_data_type separately for AVIO_DATA_MARKER_BOUNDARY_POINT,
296287 * but ignore them and treat them as AVIO_DATA_MARKER_UNKNOWN (to avoid needlessly
@@ -410,11 +401,7 @@ AVIOContext *avio_alloc_context( · 113 unmodified lines
410401 int write_flag,
411402 void *opaque,
412403 int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
413−#if FF_API_AVIO_WRITE_NONCONST
414− int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
415−#else
416404 int (*write_packet)(void *opaque, const uint8_t *buf, int buf_size),
417−#endif
418405 int64_t (*seek)(void *opaque, int64_t offset, int whence));
419406
420407 /**
libavformat/avio_internal.h+0−4
@@ -89,11 +89,7 @@ void ffio_init_context(FFIOContext *s, · 88 unmodified lines
8989 int write_flag,
9090 void *opaque,
9191 int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
92−#if FF_API_AVIO_WRITE_NONCONST
93− int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
94−#else
9592 int (*write_packet)(void *opaque, const uint8_t *buf, int buf_size),
96−#endif
9793 int64_t (*seek)(void *opaque, int64_t offset, int whence));
9894
9995 /**
libavformat/aviobuf.c+0−28
@@ -52,11 +52,7 @@ void ffio_init_context(FFIOContext *ctx, · 51 unmodified lines
5252 int write_flag,
5353 void *opaque,
5454 int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
55−#if FF_API_AVIO_WRITE_NONCONST
56− int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
57−#else
5855 int (*write_packet)(void *opaque, const uint8_t *buf, int buf_size),
59−#endif
6056 int64_t (*seek)(void *opaque, int64_t offset, int whence))
6157 {
6258 AVIOContext *const s = &ctx->pub;
@@ -115,11 +111,7 @@ AVIOContext *avio_alloc_context( · 52 unmodified lines
115111 int write_flag,
116112 void *opaque,
117113 int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
118−#if FF_API_AVIO_WRITE_NONCONST
119− int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
120−#else
121114 int (*write_packet)(void *opaque, const uint8_t *buf, int buf_size),
122−#endif
123115 int64_t (*seek)(void *opaque, int64_t offset, int whence))
124116 {
125117 FFIOContext *s = av_malloc(sizeof(*s));
@@ -141,20 +133,12 @@ static void writeout(AVIOContext *s, const uint8_t *data, int len) · 15 unmodified lines
141133 if (!s->error) {
142134 int ret = 0;
143135 if (s->write_data_type)
144−#if FF_API_AVIO_WRITE_NONCONST
145− ret = s->write_data_type(s->opaque, (uint8_t *)data,
146−#else
147136 ret = s->write_data_type(s->opaque, data,
148−#endif
149137 len,
150138 ctx->current_type,
151139 ctx->last_time);
152140 else if (s->write_packet)
153−#if FF_API_AVIO_WRITE_NONCONST
154− ret = s->write_packet(s->opaque, (uint8_t *)data, len);
155−#else
156141 ret = s->write_packet(s->opaque, data, len);
157−#endif
158142 if (ret < 0) {
159143 s->error = ret;
160144 } else {
@@ -1290,11 +1274,7 @@ typedef struct DynBuffer { · 1129 unmodified lines
12901274 uint8_t io_buffer[1];
12911275 } DynBuffer;
12921276
1293−#if FF_API_AVIO_WRITE_NONCONST
1294−static int dyn_buf_write(void *opaque, uint8_t *buf, int buf_size)
1295−#else
12961277 static int dyn_buf_write(void *opaque, const uint8_t *buf, int buf_size)
1297−#endif
12981278 {
12991279 DynBuffer *d = opaque;
13001280 unsigned new_size;
@@ -1326,11 +1306,7 @@ static int dyn_buf_write(void *opaque, const uint8_t *buf, int buf_size) · 25 unmodified lines
13261306 return buf_size;
13271307 }
13281308
1329−#if FF_API_AVIO_WRITE_NONCONST
1330−static int dyn_packet_buf_write(void *opaque, uint8_t *buf, int buf_size)
1331−#else
13321309 static int dyn_packet_buf_write(void *opaque, const uint8_t *buf, int buf_size)
1333−#endif
13341310 {
13351311 unsigned char buf1[4];
13361312 int ret;
@@ -1467,11 +1443,7 @@ void ffio_free_dyn_buf(AVIOContext **s) · 130 unmodified lines
14671443 avio_context_free(s);
14681444 }
14691445
1470−#if FF_API_AVIO_WRITE_NONCONST
1471−static int null_buf_write(void *opaque, uint8_t *buf, int buf_size)
1472−#else
14731446 static int null_buf_write(void *opaque, const uint8_t *buf, int buf_size)
1474−#endif
14751447 {
14761448 DynBuffer *d = opaque;
14771449
libavformat/hdsenc.c+0−4
@@ -112,11 +112,7 @@ static int parse_header(OutputStream *os, const uint8_t *buf, int buf_size) · 111 unmodified lines
112112 return 0;
113113 }
114114
115−#if FF_API_AVIO_WRITE_NONCONST
116−static int hds_write(void *opaque, uint8_t *buf, int buf_size)
117−#else
118115 static int hds_write(void *opaque, const uint8_t *buf, int buf_size)
119−#endif
120116 {
121117 OutputStream *os = opaque;
122118 if (os->out) {
libavformat/smoothstreamingenc.c+0−4
@@ -75,11 +75,7 @@ typedef struct SmoothStreamingContext { · 74 unmodified lines
7575 int nb_fragments;
7676 } SmoothStreamingContext;
7777
78−#if FF_API_AVIO_WRITE_NONCONST
79−static int ism_write(void *opaque, uint8_t *buf, int buf_size)
80−#else
8178 static int ism_write(void *opaque, const uint8_t *buf, int buf_size)
82−#endif
8379 {
8480 OutputStream *os = opaque;
8581 if (os->out)
libavformat/url.h+0−8
@@ -192,11 +192,7 @@ static inline int ffurl_read(URLContext *h, uint8_t *buf, int size) · 191 unmodified lines
192192 */
193193 int ffurl_read_complete(URLContext *h, unsigned char *buf, int size);
194194
195−#if FF_API_AVIO_WRITE_NONCONST
196−int ffurl_write2(void *urlcontext, uint8_t *buf, int size);
197−#else
198195 int ffurl_write2(void *urlcontext, const uint8_t *buf, int size);
199−#endif
200196 /**
201197 * Write size bytes from buf to the resource accessed by h.
202198 *
@@ -205,11 +201,7 @@ int ffurl_write2(void *urlcontext, const uint8_t *buf, int size); · 2 unmodified lines
205201 */
206202 static inline int ffurl_write(URLContext *h, const uint8_t *buf, int size)
207203 {
208−#if FF_API_AVIO_WRITE_NONCONST
209− return ffurl_write2(h, (uint8_t*)buf, size);
210−#else
211204 return ffurl_write2(h, buf, size);
212−#endif
213205 }
214206
215207 int64_t ffurl_seek2(void *urlcontext, int64_t pos, int whence);
libavformat/version_major.h+0−1
@@ -42,7 +42,6 @@ · 41 unmodified lines
4242 *
4343 */
4444 #define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 61)
45−#define FF_API_AVIO_WRITE_NONCONST (LIBAVFORMAT_VERSION_MAJOR < 61)
4645 #define FF_API_LAVF_SHORTEST (LIBAVFORMAT_VERSION_MAJOR < 61)
4746 #define FF_API_ALLOW_FLUSH (LIBAVFORMAT_VERSION_MAJOR < 61)
4847 #define FF_API_AVSTREAM_SIDE_DATA (LIBAVFORMAT_VERSION_MAJOR < 61)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t