24564
|
1 /*
|
|
2 * Copyright (C) 2007 Alessandro Molina <amol.wrk@gmail.com>
|
|
3 * based on previous RTSP support from Benjamin Zores.
|
|
4 *
|
|
5 * MPlayer is free software; you can redistribute it and/or modify
|
|
6 * it under the terms of the GNU General Public License as published by
|
|
7 * the Free Software Foundation; either version 2 of the License, or
|
|
8 * (at your option) any later version.
|
|
9 *
|
|
10 * MPlayer 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
|
|
13 * GNU General Public License for more details.
|
|
14 *
|
|
15 * You should have received a copy of the GNU General Public License
|
|
16 * along with MPlayer; if not, write to the Free Software Foundation,
|
|
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
18 */
|
|
19
|
|
20 #define HAVE_STRUCT_SOCKADDR_STORAGE
|
|
21
|
|
22 #include <stdlib.h>
|
|
23 #include <string.h>
|
|
24 #include <stdlib.h>
|
|
25 #include <stdio.h>
|
|
26 #include <ctype.h>
|
|
27 #include "config.h"
|
|
28
|
|
29 #include "nemesi/rtsp.h"
|
|
30 #include "libmpdemux/demux_nemesi.h"
|
|
31
|
|
32 #include <errno.h>
|
|
33
|
|
34 #include "stream.h"
|
|
35 #include "tcp.h"
|
|
36
|
|
37 extern int network_bandwidth;
|
|
38 char *rtsp_destination = NULL;
|
|
39
|
|
40 static int rtsp_streaming_seek(int fd, off_t pos,
|
|
41 streaming_ctrl_t* streaming_ctrl) {
|
|
42 return -1;
|
|
43 }
|
|
44
|
|
45 static int rtsp_streaming_open (stream_t *stream, int mode, void *opts,
|
|
46 int *file_format)
|
|
47 {
|
|
48 rtsp_ctrl * ctl;
|
|
49 URL_t *url;
|
|
50 stream->fd = -1;
|
|
51
|
|
52 mp_msg (MSGT_OPEN, MSGL_V, "STREAM_RTSP, URL: %s\n", stream->url);
|
|
53 stream->streaming_ctrl = streaming_ctrl_new ();
|
|
54 if (!stream->streaming_ctrl)
|
|
55 return STREAM_ERROR;
|
|
56
|
|
57 stream->streaming_ctrl->bandwidth = network_bandwidth;
|
|
58 url = url_new(stream->url);
|
|
59 stream->streaming_ctrl->url = check4proxies(url);
|
|
60 stream->streaming_ctrl->streaming_seek = rtsp_streaming_seek;
|
|
61
|
|
62 *file_format = DEMUXER_TYPE_RTP;
|
|
63 stream->type = STREAMTYPE_STREAM;
|
|
64 return STREAM_OK;
|
|
65 }
|
|
66
|
|
67 stream_info_t stream_info_rtsp = {
|
|
68 "RTSP streaming",
|
|
69 "rtsp",
|
|
70 "Alessandro Molina",
|
|
71 "implemented over libnemesi",
|
|
72 rtsp_streaming_open,
|
|
73 {"rtsp", NULL},
|
|
74 NULL,
|
|
75 0 /* Urls are an option string */
|
|
76 };
|
|
77
|