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
d6b9da11
Commit
d6b9da11
authored
Aug 17, 2012
by
Jordi Ortiz
Committed by
Martin Storsjö
Aug 17, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avio: add (ff)url_get_multi_file_handle() for getting more than one fd
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
2e8f3cbc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
8 deletions
+46
-8
avio.c
libavformat/avio.c
+15
-0
rtpproto.c
libavformat/rtpproto.c
+22
-8
url.h
libavformat/url.h
+9
-0
No files found.
libavformat/avio.c
View file @
d6b9da11
...
@@ -344,6 +344,21 @@ int ffurl_get_file_handle(URLContext *h)
...
@@ -344,6 +344,21 @@ int ffurl_get_file_handle(URLContext *h)
return
h
->
prot
->
url_get_file_handle
(
h
);
return
h
->
prot
->
url_get_file_handle
(
h
);
}
}
int
ffurl_get_multi_file_handle
(
URLContext
*
h
,
int
**
handles
,
int
*
numhandles
)
{
if
(
!
h
->
prot
->
url_get_multi_file_handle
)
{
if
(
!
h
->
prot
->
url_get_file_handle
)
return
AVERROR
(
ENOSYS
);
*
handles
=
av_malloc
(
sizeof
(
*
handles
));
if
(
!*
handles
)
return
AVERROR
(
ENOMEM
);
*
numhandles
=
1
;
*
handles
[
0
]
=
h
->
prot
->
url_get_file_handle
(
h
);
return
0
;
}
return
h
->
prot
->
url_get_multi_file_handle
(
h
,
handles
,
numhandles
);
}
int
ffurl_shutdown
(
URLContext
*
h
,
int
flags
)
int
ffurl_shutdown
(
URLContext
*
h
,
int
flags
)
{
{
if
(
!
h
->
prot
->
url_shutdown
)
if
(
!
h
->
prot
->
url_shutdown
)
...
...
libavformat/rtpproto.c
View file @
d6b9da11
...
@@ -320,13 +320,27 @@ int ff_rtp_get_rtcp_file_handle(URLContext *h) {
...
@@ -320,13 +320,27 @@ int ff_rtp_get_rtcp_file_handle(URLContext *h) {
return
s
->
rtcp_fd
;
return
s
->
rtcp_fd
;
}
}
static
int
rtp_get_multi_file_handle
(
URLContext
*
h
,
int
**
handles
,
int
*
numhandles
)
{
RTPContext
*
s
=
h
->
priv_data
;
int
*
hs
=
*
handles
=
av_malloc
(
sizeof
(
**
handles
)
*
2
);
if
(
!
hs
)
return
AVERROR
(
ENOMEM
);
hs
[
0
]
=
s
->
rtp_fd
;
hs
[
1
]
=
s
->
rtcp_fd
;
*
numhandles
=
2
;
return
0
;
}
URLProtocol
ff_rtp_protocol
=
{
URLProtocol
ff_rtp_protocol
=
{
.
name
=
"rtp"
,
.
name
=
"rtp"
,
.
url_open
=
rtp_open
,
.
url_open
=
rtp_open
,
.
url_read
=
rtp_read
,
.
url_read
=
rtp_read
,
.
url_write
=
rtp_write
,
.
url_write
=
rtp_write
,
.
url_close
=
rtp_close
,
.
url_close
=
rtp_close
,
.
url_get_file_handle
=
rtp_get_file_handle
,
.
url_get_file_handle
=
rtp_get_file_handle
,
.
priv_data_size
=
sizeof
(
RTPContext
),
.
url_get_multi_file_handle
=
rtp_get_multi_file_handle
,
.
flags
=
URL_PROTOCOL_FLAG_NETWORK
,
.
priv_data_size
=
sizeof
(
RTPContext
),
.
flags
=
URL_PROTOCOL_FLAG_NETWORK
,
};
};
libavformat/url.h
View file @
d6b9da11
...
@@ -81,6 +81,8 @@ typedef struct URLProtocol {
...
@@ -81,6 +81,8 @@ typedef struct URLProtocol {
int64_t
(
*
url_read_seek
)(
URLContext
*
h
,
int
stream_index
,
int64_t
(
*
url_read_seek
)(
URLContext
*
h
,
int
stream_index
,
int64_t
timestamp
,
int
flags
);
int64_t
timestamp
,
int
flags
);
int
(
*
url_get_file_handle
)(
URLContext
*
h
);
int
(
*
url_get_file_handle
)(
URLContext
*
h
);
int
(
*
url_get_multi_file_handle
)(
URLContext
*
h
,
int
**
handles
,
int
*
numhandles
);
int
(
*
url_shutdown
)(
URLContext
*
h
,
int
flags
);
int
(
*
url_shutdown
)(
URLContext
*
h
,
int
flags
);
int
priv_data_size
;
int
priv_data_size
;
const
AVClass
*
priv_data_class
;
const
AVClass
*
priv_data_class
;
...
@@ -201,6 +203,13 @@ int64_t ffurl_size(URLContext *h);
...
@@ -201,6 +203,13 @@ int64_t ffurl_size(URLContext *h);
*/
*/
int
ffurl_get_file_handle
(
URLContext
*
h
);
int
ffurl_get_file_handle
(
URLContext
*
h
);
/**
* Return the file descriptors associated with this URL.
*
* @return 0 on success or <0 on error.
*/
int
ffurl_get_multi_file_handle
(
URLContext
*
h
,
int
**
handles
,
int
*
numhandles
);
/**
/**
* Signal the URLContext that we are done reading or writing the stream.
* Signal the URLContext that we are done reading or writing the stream.
*
*
...
...
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