@@ -57,7 +57,7 @@ URLProtocol *av_protocol_next(URLProtocol *p)
57
57
else return first_protocol ;
58
58
}
59
59
60
- int av_register_protocol2 (URLProtocol * protocol , int size )
60
+ int ffurl_register_protocol (URLProtocol * protocol , int size )
61
61
{
62
62
URLProtocol * * p ;
63
63
if (size < sizeof (URLProtocol )) {
@@ -86,12 +86,12 @@ struct URLProtocol_compat {
86
86
87
87
int av_register_protocol (URLProtocol * protocol )
88
88
{
89
- return av_register_protocol2 (protocol , sizeof (struct URLProtocol_compat ));
89
+ return ffurl_register_protocol (protocol , sizeof (struct URLProtocol_compat ));
90
90
}
91
91
92
92
int register_protocol (URLProtocol * protocol )
93
93
{
94
- return av_register_protocol2 (protocol , sizeof (struct URLProtocol_compat ));
94
+ return ffurl_register_protocol (protocol , sizeof (struct URLProtocol_compat ));
95
95
}
96
96
#endif
97
97
@@ -144,7 +144,7 @@ int ffurl_connect(URLContext* uc)
144
144
return err ;
145
145
uc -> is_connected = 1 ;
146
146
//We must be careful here as ffurl_seek() could be slow, for example for http
147
- if ( (uc -> flags & (URL_WRONLY | URL_RDWR ))
147
+ if ( (uc -> flags & (AVIO_WRONLY | AVIO_RDWR ))
148
148
|| !strcmp (uc -> prot -> name , "file" ))
149
149
if (!uc -> is_streamed && ffurl_seek (uc , 0 , SEEK_SET ) < 0 )
150
150
uc -> is_streamed = 1 ;
@@ -216,6 +216,14 @@ void url_get_filename(URLContext *h, char *buf, int buf_size)
216
216
{
217
217
av_strlcpy (buf , h -> filename , buf_size );
218
218
}
219
+ void url_set_interrupt_cb (URLInterruptCB * interrupt_cb )
220
+ {
221
+ avio_set_interrupt_cb (interrupt_cb );
222
+ }
223
+ int av_register_protocol2 (URLProtocol * protocol , int size )
224
+ {
225
+ return ffurl_register_protocol (protocol , size );
226
+ }
219
227
#endif
220
228
221
229
#define URL_SCHEME_CHARS \
@@ -275,7 +283,7 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int
275
283
ret = transfer_func (h , buf + len , size - len );
276
284
if (ret == AVERROR (EINTR ))
277
285
continue ;
278
- if (h -> flags & URL_FLAG_NONBLOCK )
286
+ if (h -> flags & AVIO_FLAG_NONBLOCK )
279
287
return ret ;
280
288
if (ret == AVERROR (EAGAIN )) {
281
289
ret = 0 ;
@@ -296,21 +304,21 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int
296
304
297
305
int ffurl_read (URLContext * h , unsigned char * buf , int size )
298
306
{
299
- if (h -> flags & URL_WRONLY )
307
+ if (h -> flags & AVIO_WRONLY )
300
308
return AVERROR (EIO );
301
309
return retry_transfer_wrapper (h , buf , size , 1 , h -> prot -> url_read );
302
310
}
303
311
304
312
int ffurl_read_complete (URLContext * h , unsigned char * buf , int size )
305
313
{
306
- if (h -> flags & URL_WRONLY )
314
+ if (h -> flags & AVIO_WRONLY )
307
315
return AVERROR (EIO );
308
316
return retry_transfer_wrapper (h , buf , size , size , h -> prot -> url_read );
309
317
}
310
318
311
319
int ffurl_write (URLContext * h , const unsigned char * buf , int size )
312
320
{
313
- if (!(h -> flags & (URL_WRONLY | URL_RDWR )))
321
+ if (!(h -> flags & (AVIO_WRONLY | AVIO_RDWR )))
314
322
return AVERROR (EIO );
315
323
/* avoid sending too big packets */
316
324
if (h -> max_packet_size && size > h -> max_packet_size )
@@ -348,7 +356,7 @@ int ffurl_close(URLContext *h)
348
356
int url_exist (const char * filename )
349
357
{
350
358
URLContext * h ;
351
- if (ffurl_open (& h , filename , URL_RDONLY ) < 0 )
359
+ if (ffurl_open (& h , filename , AVIO_RDONLY ) < 0 )
352
360
return 0 ;
353
361
ffurl_close (h );
354
362
return 1 ;
@@ -381,7 +389,7 @@ static int default_interrupt_cb(void)
381
389
return 0 ;
382
390
}
383
391
384
- void url_set_interrupt_cb (URLInterruptCB * interrupt_cb )
392
+ void avio_set_interrupt_cb (URLInterruptCB * interrupt_cb )
385
393
{
386
394
if (!interrupt_cb )
387
395
interrupt_cb = default_interrupt_cb ;
0 commit comments