annotate stream/stream_nemesi.c @ 24744:d81eef9beb1b

DirectShow based tv:// driver for win32 Teletext is also supported (but 625 system parameters are hardcoded). pthreads is required for teletext. Code is still experimental.
author voroshil
date Sat, 13 Oct 2007 17:14:39 +0000
parents e4a38a7cdb81
children 5ff44f300c95
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
1 /*
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
2 * Copyright (C) 2007 Alessandro Molina <amol.wrk@gmail.com>
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
3 * based on previous RTSP support from Benjamin Zores.
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
4 *
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
5 * MPlayer is free software; you can redistribute it and/or modify
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
7 * the Free Software Foundation; either version 2 of the License, or
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
8 * (at your option) any later version.
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
9 *
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
10 * MPlayer is distributed in the hope that it will be useful,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
13 * GNU General Public License for more details.
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
14 *
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
16 * along with MPlayer; if not, write to the Free Software Foundation,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
18 */
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
19
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
20 #define HAVE_STRUCT_SOCKADDR_STORAGE
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
21
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
22 #include <stdlib.h>
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
23 #include <string.h>
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
24 #include <stdlib.h>
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
25 #include <stdio.h>
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
26 #include <ctype.h>
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
27 #include "config.h"
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
28
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
29 #include "nemesi/rtsp.h"
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
30 #include "libmpdemux/demux_nemesi.h"
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
31
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
32 #include <errno.h>
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
33
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
34 #include "stream.h"
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
35 #include "tcp.h"
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
36
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
37 extern int network_bandwidth;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
38 int rtsp_port = 0;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
39 char *rtsp_destination = NULL;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
40
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
41 static int rtsp_streaming_seek(int fd, off_t pos,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
42 streaming_ctrl_t* streaming_ctrl) {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
43 return -1;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
44 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
45
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
46 static int rtsp_streaming_open (stream_t *stream, int mode, void *opts,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
47 int *file_format)
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
48 {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
49 rtsp_ctrl * ctl;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
50 extern int index_mode;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
51 URL_t *url;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
52 stream->fd = -1;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
53
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
54 mp_msg (MSGT_OPEN, MSGL_V, "STREAM_RTSP, URL: %s\n", stream->url);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
55 stream->streaming_ctrl = streaming_ctrl_new ();
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
56 if (!stream->streaming_ctrl)
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
57 return STREAM_ERROR;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
58
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
59 stream->streaming_ctrl->bandwidth = network_bandwidth;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
60 url = url_new(stream->url);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
61 stream->streaming_ctrl->url = check4proxies(url);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
62 stream->streaming_ctrl->streaming_seek = rtsp_streaming_seek;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
63
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
64 *file_format = DEMUXER_TYPE_RTP;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
65 stream->type = STREAMTYPE_STREAM;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
66 return STREAM_OK;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
67 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
68
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
69 stream_info_t stream_info_rtsp = {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
70 "RTSP streaming",
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
71 "rtsp",
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
72 "Alessandro Molina",
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
73 "implemented over libnemesi",
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
74 rtsp_streaming_open,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
75 {"rtsp", NULL},
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
76 NULL,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
77 0 /* Urls are an option string */
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
78 };
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
79