Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
019ac05a
Commit
019ac05a
authored
Jul 17, 2003
by
Fabrice Bellard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added primitive aborting system
Originally committed as revision 2058 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
d5809b0a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletion
+32
-1
avio.c
libavformat/avio.c
+22
-0
avio.h
libavformat/avio.h
+10
-1
No files found.
libavformat/avio.c
View file @
019ac05a
...
@@ -19,7 +19,10 @@
...
@@ -19,7 +19,10 @@
#include "avformat.h"
#include "avformat.h"
#include <ctype.h>
#include <ctype.h>
static
int
default_interrupt_cb
(
void
);
URLProtocol
*
first_protocol
=
NULL
;
URLProtocol
*
first_protocol
=
NULL
;
URLInterruptCB
*
url_interrupt_cb
=
default_interrupt_cb
;
int
register_protocol
(
URLProtocol
*
protocol
)
int
register_protocol
(
URLProtocol
*
protocol
)
{
{
...
@@ -165,3 +168,22 @@ void url_get_filename(URLContext *h, char *buf, int buf_size)
...
@@ -165,3 +168,22 @@ void url_get_filename(URLContext *h, char *buf, int buf_size)
{
{
pstrcpy
(
buf
,
buf_size
,
h
->
filename
);
pstrcpy
(
buf
,
buf_size
,
h
->
filename
);
}
}
static
int
default_interrupt_cb
(
void
)
{
return
0
;
}
/**
* The callback is called in blocking functions to test regulary if
* asynchronous interruption is needed. -EINTR is returned in this
* case by the interrupted function. 'NULL' means no interrupt
* callback is given.
*/
void
url_set_interrupt_cb
(
URLInterruptCB
*
interrupt_cb
)
{
if
(
!
interrupt_cb
)
interrupt_cb
=
default_interrupt_cb
;
url_interrupt_cb
=
interrupt_cb
;
}
libavformat/avio.h
View file @
019ac05a
...
@@ -28,6 +28,8 @@ typedef struct URLPollEntry {
...
@@ -28,6 +28,8 @@ typedef struct URLPollEntry {
#define URL_WRONLY 1
#define URL_WRONLY 1
#define URL_RDWR 2
#define URL_RDWR 2
typedef
int
URLInterruptCB
(
void
);
int
url_open
(
URLContext
**
h
,
const
char
*
filename
,
int
flags
);
int
url_open
(
URLContext
**
h
,
const
char
*
filename
,
int
flags
);
int
url_read
(
URLContext
*
h
,
unsigned
char
*
buf
,
int
size
);
int
url_read
(
URLContext
*
h
,
unsigned
char
*
buf
,
int
size
);
int
url_write
(
URLContext
*
h
,
unsigned
char
*
buf
,
int
size
);
int
url_write
(
URLContext
*
h
,
unsigned
char
*
buf
,
int
size
);
...
@@ -38,6 +40,12 @@ offset_t url_filesize(URLContext *h);
...
@@ -38,6 +40,12 @@ offset_t url_filesize(URLContext *h);
int
url_get_max_packet_size
(
URLContext
*
h
);
int
url_get_max_packet_size
(
URLContext
*
h
);
void
url_get_filename
(
URLContext
*
h
,
char
*
buf
,
int
buf_size
);
void
url_get_filename
(
URLContext
*
h
,
char
*
buf
,
int
buf_size
);
/* the callback is called in blocking functions to test regulary if
asynchronous interruption is needed. -EINTR is returned in this
case by the interrupted function. 'NULL' means no interrupt
callback is given. */
void
url_set_interrupt_cb
(
URLInterruptCB
*
interrupt_cb
);
/* not implemented */
/* not implemented */
int
url_poll
(
URLPollEntry
*
poll_table
,
int
n
,
int
timeout
);
int
url_poll
(
URLPollEntry
*
poll_table
,
int
n
,
int
timeout
);
...
@@ -52,6 +60,7 @@ typedef struct URLProtocol {
...
@@ -52,6 +60,7 @@ typedef struct URLProtocol {
}
URLProtocol
;
}
URLProtocol
;
extern
URLProtocol
*
first_protocol
;
extern
URLProtocol
*
first_protocol
;
extern
URLInterruptCB
*
url_interrupt_cb
;
int
register_protocol
(
URLProtocol
*
protocol
);
int
register_protocol
(
URLProtocol
*
protocol
);
...
@@ -100,7 +109,7 @@ int url_feof(ByteIOContext *s);
...
@@ -100,7 +109,7 @@ int url_feof(ByteIOContext *s);
#define URL_EOF (-1)
#define URL_EOF (-1)
int
url_fgetc
(
ByteIOContext
*
s
);
int
url_fgetc
(
ByteIOContext
*
s
);
int
url_fprintf
(
ByteIOContext
*
s
,
const
char
*
fmt
,
...);
int
url_fprintf
(
ByteIOContext
*
s
,
const
char
*
fmt
,
...)
__attribute__
((
format
(
printf
,
2
,
3
)))
;
char
*
url_fgets
(
ByteIOContext
*
s
,
char
*
buf
,
int
buf_size
);
char
*
url_fgets
(
ByteIOContext
*
s
,
char
*
buf
,
int
buf_size
);
void
put_flush_packet
(
ByteIOContext
*
s
);
void
put_flush_packet
(
ByteIOContext
*
s
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment