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
5652bb94
Commit
5652bb94
authored
Mar 31, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avio: make url_alloc internal.
parent
0d8a33b1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
19 deletions
+57
-19
avio.c
libavformat/avio.c
+7
-2
avio.h
libavformat/avio.h
+1
-13
mmsh.c
libavformat/mmsh.c
+3
-2
rtsp.c
libavformat/rtsp.c
+3
-2
url.h
libavformat/url.h
+43
-0
No files found.
libavformat/avio.c
View file @
5652bb94
...
...
@@ -29,6 +29,7 @@
#if CONFIG_NETWORK
#include "network.h"
#endif
#include "url.h"
#if FF_API_URL_CLASS
/** @name Logging context. */
...
...
@@ -167,6 +168,10 @@ int url_open_protocol (URLContext **puc, struct URLProtocol *up,
*
puc
=
NULL
;
return
ret
;
}
int
url_alloc
(
URLContext
**
puc
,
const
char
*
filename
,
int
flags
)
{
return
ffurl_alloc
(
puc
,
filename
,
flags
);
}
#endif
#define URL_SCHEME_CHARS \
...
...
@@ -174,7 +179,7 @@ int url_open_protocol (URLContext **puc, struct URLProtocol *up,
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" \
"0123456789+-."
int
url_alloc
(
URLContext
**
puc
,
const
char
*
filename
,
int
flags
)
int
ff
url_alloc
(
URLContext
**
puc
,
const
char
*
filename
,
int
flags
)
{
URLProtocol
*
up
;
char
proto_str
[
128
],
proto_nested
[
128
],
*
ptr
;
...
...
@@ -204,7 +209,7 @@ int url_alloc(URLContext **puc, const char *filename, int flags)
int
url_open
(
URLContext
**
puc
,
const
char
*
filename
,
int
flags
)
{
int
ret
=
url_alloc
(
puc
,
filename
,
flags
);
int
ret
=
ff
url_alloc
(
puc
,
filename
,
flags
);
if
(
ret
)
return
ret
;
ret
=
url_connect
(
*
puc
);
...
...
libavformat/avio.h
View file @
5652bb94
...
...
@@ -102,21 +102,9 @@ typedef int URLInterruptCB(void);
*/
attribute_deprecated
int
url_open_protocol
(
URLContext
**
puc
,
struct
URLProtocol
*
up
,
const
char
*
url
,
int
flags
);
attribute_deprecated
int
url_alloc
(
URLContext
**
h
,
const
char
*
url
,
int
flags
);
#endif
/**
* Create a URLContext for accessing to the resource indicated by
* url, but do not initiate the connection yet.
*
* @param puc pointer to the location where, in case of success, the
* function puts the pointer to the created URLContext
* @param flags flags which control how the resource indicated by url
* is to be opened
* @return 0 in case of success, a negative value corresponding to an
* AVERROR code in case of failure
*/
int
url_alloc
(
URLContext
**
h
,
const
char
*
url
,
int
flags
);
/**
* Connect an URLContext that has been allocated by url_alloc
*/
...
...
libavformat/mmsh.c
View file @
5652bb94
...
...
@@ -32,6 +32,7 @@
#include "mms.h"
#include "asf.h"
#include "http.h"
#include "url.h"
#define CHUNK_HEADER_LENGTH 4 // 2bytes chunk type and 2bytes chunk length.
#define EXT_HEADER_LENGTH 8 // 4bytes sequence, 2bytes useless and 2bytes chunk length.
...
...
@@ -232,7 +233,7 @@ static int mmsh_open(URLContext *h, const char *uri, int flags)
port
=
80
;
// default mmsh protocol port
ff_url_join
(
httpname
,
sizeof
(
httpname
),
"http"
,
NULL
,
host
,
port
,
path
);
if
(
url_alloc
(
&
mms
->
mms_hd
,
httpname
,
URL_RDONLY
)
<
0
)
{
if
(
ff
url_alloc
(
&
mms
->
mms_hd
,
httpname
,
URL_RDONLY
)
<
0
)
{
return
AVERROR
(
EIO
);
}
...
...
@@ -260,7 +261,7 @@ static int mmsh_open(URLContext *h, const char *uri, int flags)
// close the socket and then reopen it for sending the second play request.
url_close
(
mms
->
mms_hd
);
memset
(
headers
,
0
,
sizeof
(
headers
));
if
(
url_alloc
(
&
mms
->
mms_hd
,
httpname
,
URL_RDONLY
)
<
0
)
{
if
(
ff
url_alloc
(
&
mms
->
mms_hd
,
httpname
,
URL_RDONLY
)
<
0
)
{
return
AVERROR
(
EIO
);
}
stream_selection
=
av_mallocz
(
mms
->
stream_num
*
19
+
1
);
...
...
libavformat/rtsp.c
View file @
5652bb94
...
...
@@ -42,6 +42,7 @@
#include "rdt.h"
#include "rtpdec_formats.h"
#include "rtpenc_chain.h"
#include "url.h"
//#define DEBUG
//#define DEBUG_RTP_TCP
...
...
@@ -1395,7 +1396,7 @@ redirect:
av_get_random_seed
(),
av_get_random_seed
());
/* GET requests */
if
(
url_alloc
(
&
rt
->
rtsp_hd
,
httpname
,
URL_RDONLY
)
<
0
)
{
if
(
ff
url_alloc
(
&
rt
->
rtsp_hd
,
httpname
,
URL_RDONLY
)
<
0
)
{
err
=
AVERROR
(
EIO
);
goto
fail
;
}
...
...
@@ -1416,7 +1417,7 @@ redirect:
}
/* POST requests */
if
(
url_alloc
(
&
rt
->
rtsp_hd_out
,
httpname
,
URL_WRONLY
)
<
0
)
{
if
(
ff
url_alloc
(
&
rt
->
rtsp_hd_out
,
httpname
,
URL_WRONLY
)
<
0
)
{
err
=
AVERROR
(
EIO
);
goto
fail
;
}
...
...
libavformat/url.h
0 → 100644
View file @
5652bb94
/*
*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* unbuffered private I/O API
*/
#ifndef AVFORMAT_URL_H
#define AVFORMAT_URL_H
#include "avio.h"
/**
* Create a URLContext for accessing to the resource indicated by
* url, but do not initiate the connection yet.
*
* @param puc pointer to the location where, in case of success, the
* function puts the pointer to the created URLContext
* @param flags flags which control how the resource indicated by url
* is to be opened
* @return 0 in case of success, a negative value corresponding to an
* AVERROR code in case of failure
*/
int
ffurl_alloc
(
URLContext
**
h
,
const
char
*
url
,
int
flags
);
#endif //AVFORMAT_URL_H
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