Revision 5652bb94

View differences:

libavformat/avio.c
29 29
#if CONFIG_NETWORK
30 30
#include "network.h"
31 31
#endif
32
#include "url.h"
32 33

  
33 34
#if FF_API_URL_CLASS
34 35
/** @name Logging context. */
......
167 168
    *puc = NULL;
168 169
    return ret;
169 170
}
171
int url_alloc(URLContext **puc, const char *filename, int flags)
172
{
173
    return ffurl_alloc(puc, filename, flags);
174
}
170 175
#endif
171 176

  
172 177
#define URL_SCHEME_CHARS                        \
......
174 179
    "ABCDEFGHIJKLMNOPQRSTUVWXYZ"                \
175 180
    "0123456789+-."
176 181

  
177
int url_alloc(URLContext **puc, const char *filename, int flags)
182
int ffurl_alloc(URLContext **puc, const char *filename, int flags)
178 183
{
179 184
    URLProtocol *up;
180 185
    char proto_str[128], proto_nested[128], *ptr;
......
204 209

  
205 210
int url_open(URLContext **puc, const char *filename, int flags)
206 211
{
207
    int ret = url_alloc(puc, filename, flags);
212
    int ret = ffurl_alloc(puc, filename, flags);
208 213
    if (ret)
209 214
        return ret;
210 215
    ret = url_connect(*puc);
libavformat/avio.h
102 102
 */
103 103
attribute_deprecated int url_open_protocol (URLContext **puc, struct URLProtocol *up,
104 104
                                            const char *url, int flags);
105
attribute_deprecated int url_alloc(URLContext **h, const char *url, int flags);
105 106
#endif
106 107

  
107 108
/**
108
 * Create a URLContext for accessing to the resource indicated by
109
 * url, but do not initiate the connection yet.
110
 *
111
 * @param puc pointer to the location where, in case of success, the
112
 * function puts the pointer to the created URLContext
113
 * @param flags flags which control how the resource indicated by url
114
 * is to be opened
115
 * @return 0 in case of success, a negative value corresponding to an
116
 * AVERROR code in case of failure
117
 */
118
int url_alloc(URLContext **h, const char *url, int flags);
119

  
120
/**
121 109
 * Connect an URLContext that has been allocated by url_alloc
122 110
 */
123 111
int url_connect(URLContext *h);
libavformat/mmsh.c
32 32
#include "mms.h"
33 33
#include "asf.h"
34 34
#include "http.h"
35
#include "url.h"
35 36

  
36 37
#define CHUNK_HEADER_LENGTH 4   // 2bytes chunk type and 2bytes chunk length.
37 38
#define EXT_HEADER_LENGTH   8   // 4bytes sequence, 2bytes useless and 2bytes chunk length.
......
232 233
        port = 80; // default mmsh protocol port
233 234
    ff_url_join(httpname, sizeof(httpname), "http", NULL, host, port, path);
234 235

  
235
    if (url_alloc(&mms->mms_hd, httpname, URL_RDONLY) < 0) {
236
    if (ffurl_alloc(&mms->mms_hd, httpname, URL_RDONLY) < 0) {
236 237
        return AVERROR(EIO);
237 238
    }
238 239

  
......
260 261
    // close the socket and then reopen it for sending the second play request.
261 262
    url_close(mms->mms_hd);
262 263
    memset(headers, 0, sizeof(headers));
263
    if (url_alloc(&mms->mms_hd, httpname, URL_RDONLY) < 0) {
264
    if (ffurl_alloc(&mms->mms_hd, httpname, URL_RDONLY) < 0) {
264 265
        return AVERROR(EIO);
265 266
    }
266 267
    stream_selection = av_mallocz(mms->stream_num * 19 + 1);
libavformat/rtsp.c
42 42
#include "rdt.h"
43 43
#include "rtpdec_formats.h"
44 44
#include "rtpenc_chain.h"
45
#include "url.h"
45 46

  
46 47
//#define DEBUG
47 48
//#define DEBUG_RTP_TCP
......
1395 1396
                 av_get_random_seed(), av_get_random_seed());
1396 1397

  
1397 1398
        /* GET requests */
1398
        if (url_alloc(&rt->rtsp_hd, httpname, URL_RDONLY) < 0) {
1399
        if (ffurl_alloc(&rt->rtsp_hd, httpname, URL_RDONLY) < 0) {
1399 1400
            err = AVERROR(EIO);
1400 1401
            goto fail;
1401 1402
        }
......
1416 1417
        }
1417 1418

  
1418 1419
        /* POST requests */
1419
        if (url_alloc(&rt->rtsp_hd_out, httpname, URL_WRONLY) < 0 ) {
1420
        if (ffurl_alloc(&rt->rtsp_hd_out, httpname, URL_WRONLY) < 0 ) {
1420 1421
            err = AVERROR(EIO);
1421 1422
            goto fail;
1422 1423
        }
libavformat/url.h
1
/*
2
 *
3
 * This file is part of Libav.
4
 *
5
 * Libav is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU Lesser General Public
7
 * License as published by the Free Software Foundation; either
8
 * version 2.1 of the License, or (at your option) any later version.
9
 *
10
 * Libav is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
 * Lesser General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU Lesser General Public
16
 * License along with Libav; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
 */
19

  
20
/**
21
 * @file
22
 * unbuffered private I/O API
23
 */
24

  
25
#ifndef AVFORMAT_URL_H
26
#define AVFORMAT_URL_H
27

  
28
#include "avio.h"
29

  
30
/**
31
 * Create a URLContext for accessing to the resource indicated by
32
 * url, but do not initiate the connection yet.
33
 *
34
 * @param puc pointer to the location where, in case of success, the
35
 * function puts the pointer to the created URLContext
36
 * @param flags flags which control how the resource indicated by url
37
 * is to be opened
38
 * @return 0 in case of success, a negative value corresponding to an
39
 * AVERROR code in case of failure
40
 */
41
int ffurl_alloc(URLContext **h, const char *url, int flags);
42

  
43
#endif //AVFORMAT_URL_H

Also available in: Unified diff