Mercurial > mplayer.hg
annotate stream/stream_nemesi.c @ 36682:68794f2fbf1e
Add support for default of multiple video tracks.
Some container formats like matroska support multiple video tracks, one
of which may be flagged the 'default' one which thus should be played by
default.
Works with the lavf demuxer.
author | ib |
---|---|
date | Sun, 02 Feb 2014 19:18:31 +0000 |
parents | 3389262720da |
children |
rev | line source |
---|---|
24564 | 1 /* |
26737
a26e50cae389
Use standard license headers with standard formatting.
diego
parents:
25268
diff
changeset
|
2 * based on previous RTSP support from Benjamin Zores. |
24564 | 3 * |
26737
a26e50cae389
Use standard license headers with standard formatting.
diego
parents:
25268
diff
changeset
|
4 * Copyright (C) 2007 Alessandro Molina <amol.wrk@gmail.com> |
a26e50cae389
Use standard license headers with standard formatting.
diego
parents:
25268
diff
changeset
|
5 * |
a26e50cae389
Use standard license headers with standard formatting.
diego
parents:
25268
diff
changeset
|
6 * This file is part of MPlayer. |
24564 | 7 * |
26737
a26e50cae389
Use standard license headers with standard formatting.
diego
parents:
25268
diff
changeset
|
8 * MPlayer is free software; you can redistribute it and/or modify |
a26e50cae389
Use standard license headers with standard formatting.
diego
parents:
25268
diff
changeset
|
9 * it under the terms of the GNU General Public License as published by |
a26e50cae389
Use standard license headers with standard formatting.
diego
parents:
25268
diff
changeset
|
10 * the Free Software Foundation; either version 2 of the License, or |
a26e50cae389
Use standard license headers with standard formatting.
diego
parents:
25268
diff
changeset
|
11 * (at your option) any later version. |
24564 | 12 * |
26737
a26e50cae389
Use standard license headers with standard formatting.
diego
parents:
25268
diff
changeset
|
13 * MPlayer is distributed in the hope that it will be useful, |
a26e50cae389
Use standard license headers with standard formatting.
diego
parents:
25268
diff
changeset
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
a26e50cae389
Use standard license headers with standard formatting.
diego
parents:
25268
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
a26e50cae389
Use standard license headers with standard formatting.
diego
parents:
25268
diff
changeset
|
16 * GNU General Public License for more details. |
a26e50cae389
Use standard license headers with standard formatting.
diego
parents:
25268
diff
changeset
|
17 * |
a26e50cae389
Use standard license headers with standard formatting.
diego
parents:
25268
diff
changeset
|
18 * You should have received a copy of the GNU General Public License along |
a26e50cae389
Use standard license headers with standard formatting.
diego
parents:
25268
diff
changeset
|
19 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
a26e50cae389
Use standard license headers with standard formatting.
diego
parents:
25268
diff
changeset
|
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
24564 | 21 */ |
22 | |
23 #include <stdlib.h> | |
24 #include <string.h> | |
25 #include <stdlib.h> | |
26 #include <stdio.h> | |
27 #include <ctype.h> | |
28 #include "config.h" | |
29 #include "nemesi/rtsp.h" | |
30 | |
31 #include <errno.h> | |
32 | |
34174
a93891202051
Add missing mp_msg.h #includes, remove some unnecessary ones.
diego
parents:
33858
diff
changeset
|
33 #include "mp_msg.h" |
31427
9494acd724a9
Remove duplicate network_bandwidth extern declarations.
diego
parents:
30633
diff
changeset
|
34 #include "network.h" |
24564 | 35 #include "stream.h" |
25268 | 36 #include "libmpdemux/demuxer.h" |
37 | |
24564 | 38 #include "tcp.h" |
39 | |
40 char *rtsp_destination = NULL; | |
41 | |
35885
3389262720da
Fix previous commit, off_t must be replaced by int64_t
reimar
parents:
35881
diff
changeset
|
42 static int rtsp_streaming_seek(int fd, int64_t pos, |
24564 | 43 streaming_ctrl_t* streaming_ctrl) { |
44 return -1; | |
45 } | |
46 | |
47 static int rtsp_streaming_open (stream_t *stream, int mode, void *opts, | |
48 int *file_format) | |
49 { | |
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; | |
35301
8f6d3f8ffa61
Add url_new_with_proxy function to reduce code duplication and memleaks.
reimar
parents:
34174
diff
changeset
|
58 stream->streaming_ctrl->url = url_new_with_proxy(stream->url); |
24564 | 59 stream->streaming_ctrl->streaming_seek = rtsp_streaming_seek; |
60 | |
25266
239330301b33
Make libnemesi use specific struct and DEMUXER_TYPE
lu_zero
parents:
25211
diff
changeset
|
61 *file_format = DEMUXER_TYPE_RTP_NEMESI; |
24564 | 62 stream->type = STREAMTYPE_STREAM; |
63 return STREAM_OK; | |
64 } | |
65 | |
25211 | 66 const stream_info_t stream_info_rtsp = { |
24564 | 67 "RTSP streaming", |
68 "rtsp", | |
69 "Alessandro Molina", | |
70 "implemented over libnemesi", | |
71 rtsp_streaming_open, | |
72 {"rtsp", NULL}, | |
73 NULL, | |
74 0 /* Urls are an option string */ | |
75 }; |