annotate libmpdemux/demux_nemesi.c @ 31645:9666dd193544

Fix calculation of global_sub_size.
author reimar
date Sun, 11 Jul 2010 17:53:44 +0000
parents cd81fce1f010
children 319657dba8e1
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 /*
26742
0c1db5fd3f79 Use standard license headers with standard formatting.
diego
parents: 25965
diff changeset
2 * Copyright (C) 2007 Alessandro Molina <amol.wrk@gmail.com>
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
3 *
26742
0c1db5fd3f79 Use standard license headers with standard formatting.
diego
parents: 25965
diff changeset
4 * This file is part of MPlayer.
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
5 *
26742
0c1db5fd3f79 Use standard license headers with standard formatting.
diego
parents: 25965
diff changeset
6 * MPlayer is free software; you can redistribute it and/or modify
0c1db5fd3f79 Use standard license headers with standard formatting.
diego
parents: 25965
diff changeset
7 * it under the terms of the GNU General Public License as published by
0c1db5fd3f79 Use standard license headers with standard formatting.
diego
parents: 25965
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
0c1db5fd3f79 Use standard license headers with standard formatting.
diego
parents: 25965
diff changeset
9 * (at your option) any later version.
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
10 *
26742
0c1db5fd3f79 Use standard license headers with standard formatting.
diego
parents: 25965
diff changeset
11 * MPlayer is distributed in the hope that it will be useful,
0c1db5fd3f79 Use standard license headers with standard formatting.
diego
parents: 25965
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0c1db5fd3f79 Use standard license headers with standard formatting.
diego
parents: 25965
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0c1db5fd3f79 Use standard license headers with standard formatting.
diego
parents: 25965
diff changeset
14 * GNU General Public License for more details.
0c1db5fd3f79 Use standard license headers with standard formatting.
diego
parents: 25965
diff changeset
15 *
0c1db5fd3f79 Use standard license headers with standard formatting.
diego
parents: 25965
diff changeset
16 * You should have received a copy of the GNU General Public License along
0c1db5fd3f79 Use standard license headers with standard formatting.
diego
parents: 25965
diff changeset
17 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
0c1db5fd3f79 Use standard license headers with standard formatting.
diego
parents: 25965
diff changeset
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
19 */
25267
f7fa01fe18c8 Remove non necessary header
lu_zero
parents: 25266
diff changeset
20 #include <stdlib.h>
f7fa01fe18c8 Remove non necessary header
lu_zero
parents: 25266
diff changeset
21 #include <stdio.h>
f7fa01fe18c8 Remove non necessary header
lu_zero
parents: 25266
diff changeset
22 #include "stream/stream.h"
f7fa01fe18c8 Remove non necessary header
lu_zero
parents: 25266
diff changeset
23 #include "demuxer.h"
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
24 #include "stheader.h"
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
25 #define HAVE_STRUCT_SOCKADDR_STORAGE
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
26 #include "nemesi/rtsp.h"
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
27 #include "nemesi/rtp.h"
24856
4365a0d7a4b8 Fix fps guessing
lu_zero
parents: 24855
diff changeset
28 #include <sched.h>
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
29
31282
adf1dc3600b0 Fix compilation with nemesi and live555.
cehoyos
parents: 30644
diff changeset
30 int rtsp_transport_http = 0;
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
31 int rtsp_transport_tcp = 0;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
32 int rtsp_transport_sctp = 0;
25156
512f2958dc1b Enable -rtsp-port for nemesi
lu_zero
parents: 25116
diff changeset
33 int rtsp_port = 0;
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
34
25103
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
35 typedef struct {
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
36 char * mime;
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
37 unsigned int fourcc;
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
38 } MIMEto4CC;
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
39
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
40 #define NMS_MAX_FORMATS 16
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
41
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
42 MIMEto4CC supported_audio[NMS_MAX_FORMATS] = {
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27023
diff changeset
43 {"MPA", 0x55},
25103
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
44 {"vorbis", mmioFOURCC('v','r','b','s')},
25104
a92bd4a7c213 AAC support (aac-hbr only)
lu_zero
parents: 25103
diff changeset
45 {"mpeg4-generic", mmioFOURCC('M','P','4','A')},
25103
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
46 {NULL, 0},
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
47 };
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
48
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
49 MIMEto4CC supported_video[NMS_MAX_FORMATS] = {
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
50 {"MPV", mmioFOURCC('M','P','E','G')},
25116
1e76bb01331f Enable Theora support
lu_zero
parents: 25104
diff changeset
51 {"theora",mmioFOURCC('t','h','e','o')},
25103
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
52 {"H264", mmioFOURCC('H','2','6','4')},
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
53 {"H263-1998", mmioFOURCC('H','2','6','3')},
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
54 {"MP4V-ES", mmioFOURCC('M','P','4','V')},
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
55 {NULL, 0},
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
56 };
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
57
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
58 typedef enum { NEMESI_SESSION_VIDEO,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
59 NEMESI_SESSION_AUDIO } Nemesi_SessionType;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
60
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
61 typedef struct {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
62 rtsp_ctrl * rtsp;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
63 rtp_session * session[2];
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
64 rtp_frame first_pkt[2];
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
65 double time[2];
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
66 double seek;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
67 } Nemesi_DemuxerStreamData;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
68
24997
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
69
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
70 #define STYPE_TO_DS(demuxer, stype) \
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
71 ((stype) == NEMESI_SESSION_VIDEO ? (demuxer)->video : (demuxer)->audio)
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
72
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
73 #define DS_TO_STYPE(demuxer, ds) \
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
74 ((ds) == (demuxer)->video ? NEMESI_SESSION_VIDEO : NEMESI_SESSION_AUDIO)
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
75
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
76 #define INVERT_STYPE(stype) ((stype + 1) % 2)
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
77
25103
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
78 static unsigned int get4CC(MIMEto4CC * supported_formats, char const * format)
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
79 {
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
80 unsigned i;
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
81
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
82 for(i = 0; i < NMS_MAX_FORMATS; ++i) {
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
83 if (!supported_formats[i].mime)
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
84 return 0;
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
85 else if ( strcmp(supported_formats[i].mime, format) == 0 )
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
86 return supported_formats[i].fourcc;
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
87 }
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
88
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
89 return 0;
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
90 }
24997
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
91
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
92 static rtp_ssrc *wait_for_packets(Nemesi_DemuxerStreamData * ndsd, Nemesi_SessionType stype)
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
93 {
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
94 rtp_ssrc *ssrc = NULL;
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
95
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
96 /* Wait for prebuffering (prebuffering must be enabled in nemesi) */
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
97 int terminated = rtp_fill_buffers(rtsp_get_rtp_th(ndsd->rtsp));
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
98
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
99 /* Wait for the ssrc to be registered, if prebuffering is on in nemesi
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
100 this will just get immediatly the correct ssrc */
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
101 if (!terminated) {
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
102 while ( !(ssrc = rtp_session_get_ssrc(ndsd->session[stype], ndsd->rtsp)) )
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
103 sched_yield();
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
104 }
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
105
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
106 return ssrc;
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
107 }
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
108
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
109 static void link_session_and_fetch_conf(Nemesi_DemuxerStreamData * ndsd,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
110 Nemesi_SessionType stype,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
111 rtp_session * sess,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
112 rtp_buff * buff, unsigned int * fps)
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
113 {
25965
4cd12675cfbb Change force_fps and force_ofps to double
reimar
parents: 25707
diff changeset
114 extern double force_fps;
24855
2c790baff42c Update to use newer libnemesi, should fix desync, fps guessing may fail now
lu_zero
parents: 24625
diff changeset
115 rtp_ssrc *ssrc = NULL;
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
116 rtp_frame * fr = &ndsd->first_pkt[stype];
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
117 rtp_buff trash_buff;
25010
9a4d15a28d12 fetch metadata for audio (from amol)
lu_zero
parents: 25009
diff changeset
118 int must_prefetch = ((fps != NULL) || (buff != NULL)) ? 1 : 0;
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
119
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
120 ndsd->session[stype] = sess;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
121
24997
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
122 ssrc = wait_for_packets(ndsd, stype);
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
123
25010
9a4d15a28d12 fetch metadata for audio (from amol)
lu_zero
parents: 25009
diff changeset
124 if ( ((ssrc) && (must_prefetch)) ) {
24997
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
125 if (buff == NULL)
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
126 buff = &trash_buff;
24856
4365a0d7a4b8 Fix fps guessing
lu_zero
parents: 24855
diff changeset
127
4365a0d7a4b8 Fix fps guessing
lu_zero
parents: 24855
diff changeset
128 rtp_fill_buffer(ssrc, fr, buff); //Prefetch the first packet
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
129
24998
c6aaf2165751 fix forcefps (from amol)
lu_zero
parents: 24997
diff changeset
130 /* Packet prefecthing must be done anyway or we won't be
c6aaf2165751 fix forcefps (from amol)
lu_zero
parents: 24997
diff changeset
131 able to get the metadata, but fps calculation happens
c6aaf2165751 fix forcefps (from amol)
lu_zero
parents: 24997
diff changeset
132 only if the user didn't specify the FPS */
25010
9a4d15a28d12 fetch metadata for audio (from amol)
lu_zero
parents: 25009
diff changeset
133 if ( ((!force_fps) && (fps != NULL)) ) {
24998
c6aaf2165751 fix forcefps (from amol)
lu_zero
parents: 24997
diff changeset
134 while ( *fps <= 0 ) {
c6aaf2165751 fix forcefps (from amol)
lu_zero
parents: 24997
diff changeset
135 //Wait more pkts to calculate FPS and try again
c6aaf2165751 fix forcefps (from amol)
lu_zero
parents: 24997
diff changeset
136 sched_yield();
c6aaf2165751 fix forcefps (from amol)
lu_zero
parents: 24997
diff changeset
137 *fps = rtp_get_fps(ssrc);
c6aaf2165751 fix forcefps (from amol)
lu_zero
parents: 24997
diff changeset
138 }
c6aaf2165751 fix forcefps (from amol)
lu_zero
parents: 24997
diff changeset
139 }
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
140 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
141 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
142
25267
f7fa01fe18c8 Remove non necessary header
lu_zero
parents: 25266
diff changeset
143 static demuxer_t* demux_open_rtp(demuxer_t* demuxer)
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
144 {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
145 nms_rtsp_hints hints;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
146 char * url = demuxer->stream->streaming_ctrl->url->url;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
147 rtsp_ctrl * ctl;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
148 RTSP_Error reply;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
149 rtsp_medium * media;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
150 Nemesi_DemuxerStreamData * ndsd = calloc(1, sizeof(Nemesi_DemuxerStreamData));
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
151
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
152 memset(&hints,0,sizeof(hints));
25156
512f2958dc1b Enable -rtsp-port for nemesi
lu_zero
parents: 25116
diff changeset
153 if (rtsp_port) hints.first_rtp_port = rtsp_port;
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
154 if (rtsp_transport_tcp) {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
155 hints.pref_rtsp_proto = TCP;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
156 hints.pref_rtp_proto = TCP;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
157 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
158 if (rtsp_transport_sctp) {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
159 hints.pref_rtsp_proto = SCTP;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
160 hints.pref_rtp_proto = SCTP;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
161 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
162
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
163 mp_msg(MSGT_DEMUX, MSGL_INFO, "Initializing libNemesi\n");
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
164 if ((ctl = rtsp_init(&hints)) == NULL) {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
165 free(ndsd);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
166 return STREAM_ERROR;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
167 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
168
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
169 ndsd->rtsp = ctl;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
170 demuxer->priv = ndsd;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
171 //nms_verbosity_set(1);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
172
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
173 mp_msg(MSGT_DEMUX, MSGL_INFO, "Opening: %s\n", url);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
174 if (rtsp_open(ctl, url)) {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
175 mp_msg(MSGT_DEMUX, MSGL_ERR, "rtsp_open failed.\n");
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
176 return demuxer;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
177 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
178
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
179 reply = rtsp_wait(ctl);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
180 if (reply.got_error) {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
181 mp_msg(MSGT_DEMUX, MSGL_ERR,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
182 "OPEN Error from the server: %s\n",
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
183 reply.message.reply_str);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
184 return demuxer;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
185 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
186
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
187 rtsp_play(ctl, 0, 0);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
188 reply = rtsp_wait(ctl);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
189 if (reply.got_error) {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
190 mp_msg(MSGT_DEMUX, MSGL_ERR,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
191 "PLAY Error from the server: %s\n",
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
192 reply.message.reply_str);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
193 return demuxer;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
194 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
195
25490
556413e73e17 Make sure we have an rtsp session
lu_zero
parents: 25270
diff changeset
196 if (!ctl->rtsp_queue)
556413e73e17 Make sure we have an rtsp session
lu_zero
parents: 25270
diff changeset
197 return demuxer;
556413e73e17 Make sure we have an rtsp session
lu_zero
parents: 25270
diff changeset
198
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
199 media = ctl->rtsp_queue->media_queue;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
200 for (; media; media=media->next) {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
201 sdp_medium_info * info = media->medium_info;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
202 rtp_session * sess = media->rtp_sess;
25011
39b7d358106a support extradata for audio streams
lu_zero
parents: 25010
diff changeset
203 rtp_buff buff;
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
204
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
205 int media_format = atoi(info->fmts);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
206 rtp_pt * ptinfo = rtp_get_pt_info(sess, media_format);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
207 char const * format_name = ptinfo ? ptinfo->name : NULL;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
208
25011
39b7d358106a support extradata for audio streams
lu_zero
parents: 25010
diff changeset
209 memset(&buff, 0, sizeof(rtp_buff));
39b7d358106a support extradata for audio streams
lu_zero
parents: 25010
diff changeset
210
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
211 if (sess->parsers[media_format] == NULL) {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
212 mp_msg(MSGT_DEMUX, MSGL_ERR,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
213 "libNemesi unsupported media format: %s\n",
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
214 format_name ? format_name : info->fmts);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
215 continue;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
216 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
217 else {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
218 mp_msg(MSGT_DEMUX, MSGL_INFO,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
219 "libNemesi supported media: %s\n",
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
220 format_name);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
221 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
222
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
223 if (ptinfo->type == AU) {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
224 if (ndsd->session[NEMESI_SESSION_AUDIO] == NULL) {
31609
cd81fce1f010 Make the stream language an argument to the stream creation function
reimar
parents: 31282
diff changeset
225 sh_audio_t* sh_audio = new_sh_audio(demuxer,0, NULL);
25011
39b7d358106a support extradata for audio streams
lu_zero
parents: 25010
diff changeset
226 WAVEFORMATEX* wf;
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
227 demux_stream_t* d_audio = demuxer->audio;
27023
7b85373802b7 Unbreak audio, thanks to Uoti for the insight
lu_zero
parents: 26742
diff changeset
228 demuxer->audio->id = 0;
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
229
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
230 mp_msg(MSGT_DEMUX, MSGL_INFO, "Detected as AUDIO stream...\n");
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
231
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
232 link_session_and_fetch_conf(ndsd, NEMESI_SESSION_AUDIO,
25011
39b7d358106a support extradata for audio streams
lu_zero
parents: 25010
diff changeset
233 sess, &buff, NULL);
39b7d358106a support extradata for audio streams
lu_zero
parents: 25010
diff changeset
234
39b7d358106a support extradata for audio streams
lu_zero
parents: 25010
diff changeset
235 if (buff.len) {
39b7d358106a support extradata for audio streams
lu_zero
parents: 25010
diff changeset
236 wf = calloc(1,sizeof(WAVEFORMATEX)+buff.len);
39b7d358106a support extradata for audio streams
lu_zero
parents: 25010
diff changeset
237 wf->cbSize = buff.len;
39b7d358106a support extradata for audio streams
lu_zero
parents: 25010
diff changeset
238 memcpy(wf+1, buff.data, buff.len);
39b7d358106a support extradata for audio streams
lu_zero
parents: 25010
diff changeset
239 } else {
39b7d358106a support extradata for audio streams
lu_zero
parents: 25010
diff changeset
240 wf = calloc(1,sizeof(WAVEFORMATEX));
39b7d358106a support extradata for audio streams
lu_zero
parents: 25010
diff changeset
241 }
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
242
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
243 sh_audio->wf = wf;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
244 d_audio->sh = sh_audio;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
245 sh_audio->ds = d_audio;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
246 wf->nSamplesPerSec = 0;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
247
25103
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
248 wf->wFormatTag =
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
249 sh_audio->format = get4CC(supported_audio, format_name);
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
250 if ( !(wf->wFormatTag) )
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
251 mp_msg(MSGT_DEMUX, MSGL_WARN,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
252 "Unknown MPlayer format code for MIME"
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
253 " type \"audio/%s\"\n", format_name);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
254 } else {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
255 mp_msg(MSGT_DEMUX, MSGL_ERR,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
256 "There is already an audio session registered,"
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
257 " ignoring...\n");
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
258 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
259 } else if (ptinfo->type == VI) {
25012
e800e0905050 10l video != audio
lu_zero
parents: 25011
diff changeset
260 if (ndsd->session[NEMESI_SESSION_VIDEO] == NULL) {
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
261 sh_video_t* sh_video;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
262 BITMAPINFOHEADER* bih;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
263 demux_stream_t* d_video;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
264 int fps = 0;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
265
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
266 mp_msg(MSGT_DEMUX, MSGL_INFO, "Detected as VIDEO stream...\n");
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
267
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
268 link_session_and_fetch_conf(ndsd, NEMESI_SESSION_VIDEO,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
269 sess, &buff, &fps);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
270
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
271 if (buff.len) {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
272 bih = calloc(1,sizeof(BITMAPINFOHEADER)+buff.len);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
273 bih->biSize = sizeof(BITMAPINFOHEADER)+buff.len;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
274 memcpy(bih+1, buff.data, buff.len);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
275 } else {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
276 bih = calloc(1,sizeof(BITMAPINFOHEADER));
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
277 bih->biSize = sizeof(BITMAPINFOHEADER);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
278 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
279
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
280 sh_video = new_sh_video(demuxer,0);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
281 sh_video->bih = bih;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
282 d_video = demuxer->video;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
283 d_video->sh = sh_video;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
284 sh_video->ds = d_video;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
285
24856
4365a0d7a4b8 Fix fps guessing
lu_zero
parents: 24855
diff changeset
286 if (fps) {
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
287 sh_video->fps = fps;
24856
4365a0d7a4b8 Fix fps guessing
lu_zero
parents: 24855
diff changeset
288 sh_video->frametime = 1.0/fps;
4365a0d7a4b8 Fix fps guessing
lu_zero
parents: 24855
diff changeset
289 }
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
290
25103
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
291 bih->biCompression =
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
292 sh_video->format = get4CC(supported_video, format_name);
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
293 if ( !(bih->biCompression) ) {
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
294 mp_msg(MSGT_DEMUX, MSGL_WARN,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
295 "Unknown MPlayer format code for MIME"
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
296 " type \"video/%s\"\n", format_name);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
297 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
298 } else {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
299 mp_msg(MSGT_DEMUX, MSGL_ERR,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
300 "There is already a video session registered,"
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
301 " ignoring...\n");
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
302 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
303 } else {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
304 mp_msg(MSGT_DEMUX, MSGL_ERR, "Unsupported media type\n");
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
305 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
306 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
307
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
308 demuxer->stream->eof = 0;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
309
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
310 return demuxer;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
311 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
312
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
313 static int get_data_for_session(Nemesi_DemuxerStreamData * ndsd,
24997
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
314 Nemesi_SessionType stype, rtp_ssrc * ssrc,
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
315 rtp_frame * fr)
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
316 {
24997
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
317 if (ndsd->first_pkt[stype].len != 0) {
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
318 fr->data = ndsd->first_pkt[stype].data;
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
319 fr->time_sec = ndsd->first_pkt[stype].time_sec;
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
320 fr->len = ndsd->first_pkt[stype].len;
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
321 ndsd->first_pkt[stype].len = 0;
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
322 return RTP_FILL_OK;
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
323 } else {
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
324 rtp_buff buff;
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
325 return rtp_fill_buffer(ssrc, fr, &buff);
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
326 }
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
327 }
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
328
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 27023
diff changeset
329 static void stream_add_packet(Nemesi_DemuxerStreamData * ndsd,
24997
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
330 Nemesi_SessionType stype,
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
331 demux_stream_t* ds, rtp_frame * fr)
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
332 {
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
333 demux_packet_t* dp = new_demux_packet(fr->len);
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
334 memcpy(dp->buffer, fr->data, fr->len);
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
335
24997
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
336 fr->time_sec += ndsd->seek;
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
337 ndsd->time[stype] = dp->pts = fr->time_sec;
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
338
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
339 ds_add_packet(ds, dp);
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
340 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
341
25267
f7fa01fe18c8 Remove non necessary header
lu_zero
parents: 25266
diff changeset
342 static int demux_rtp_fill_buffer(demuxer_t* demuxer, demux_stream_t* ds)
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
343 {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
344 Nemesi_DemuxerStreamData * ndsd = demuxer->priv;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
345 Nemesi_SessionType stype;
24997
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
346 rtp_ssrc * ssrc;
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
347 rtp_frame fr;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
348
24997
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
349 if ( (!ndsd->rtsp->rtsp_queue) || (demuxer->stream->eof) ) {
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
350 mp_msg(MSGT_DEMUX, MSGL_INFO, "End of Stream...\n");
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
351 demuxer->stream->eof = 1;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
352 return 0;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
353 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
354
25103
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
355 memset(&fr, 0, sizeof(fr));
588a415dd65d Media Format to fourcc conversion (from amol)
lu_zero
parents: 25013
diff changeset
356
24997
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
357 stype = DS_TO_STYPE(demuxer, ds);
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
358 if ( (ssrc = wait_for_packets(ndsd, stype)) == NULL ) {
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
359 mp_msg(MSGT_DEMUX, MSGL_INFO, "Bye...\n");
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
360 demuxer->stream->eof = 1;
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
361 return 0;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
362 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
363
24997
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
364 if(!get_data_for_session(ndsd, stype, ssrc, &fr))
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
365 stream_add_packet(ndsd, stype, ds, &fr);
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
366 else {
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
367 stype = INVERT_STYPE(stype);
25013
dc6b7ad240db Check for second stream presence, fixes single stream playback (from amol)
lu_zero
parents: 25012
diff changeset
368
dc6b7ad240db Check for second stream presence, fixes single stream playback (from amol)
lu_zero
parents: 25012
diff changeset
369 //Must check if we actually have a stream of the other type
dc6b7ad240db Check for second stream presence, fixes single stream playback (from amol)
lu_zero
parents: 25012
diff changeset
370 if (!ndsd->session[stype])
dc6b7ad240db Check for second stream presence, fixes single stream playback (from amol)
lu_zero
parents: 25012
diff changeset
371 return 1;
dc6b7ad240db Check for second stream presence, fixes single stream playback (from amol)
lu_zero
parents: 25012
diff changeset
372
24997
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
373 ds = STYPE_TO_DS(demuxer, stype);
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
374 ssrc = wait_for_packets(ndsd, stype);
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
375
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
376 if(!get_data_for_session(ndsd, stype, ssrc, &fr))
e429129fa02b Refactor demux_nemesi (from amol)
lu_zero
parents: 24856
diff changeset
377 stream_add_packet(ndsd, stype, ds, &fr);
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
378 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
379
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
380 return 1;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
381 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
382
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
383
25267
f7fa01fe18c8 Remove non necessary header
lu_zero
parents: 25266
diff changeset
384 static void demux_close_rtp(demuxer_t* demuxer)
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
385 {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
386 Nemesi_DemuxerStreamData * ndsd = demuxer->priv;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
387 rtsp_ctrl * ctl = ndsd->rtsp;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
388 RTSP_Error err;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
389
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
390 mp_msg(MSGT_DEMUX, MSGL_INFO, "Closing libNemesi RTSP Stream...\n");
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
391
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
392 if (ndsd == NULL)
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
393 return;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
394
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
395 free(ndsd);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
396
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
397 if (rtsp_close(ctl)) {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
398 err = rtsp_wait(ctl);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
399 if (err.got_error)
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
400 mp_msg(MSGT_DEMUX, MSGL_ERR,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
401 "Error Closing Stream: %s\n",
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
402 err.message.reply_str);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
403 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
404
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
405 rtsp_uninit(ctl);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
406 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
407
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
408 static void demux_seek_rtp(demuxer_t *demuxer, float rel_seek_secs,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
409 float audio_delay, int flags)
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
410 {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
411 Nemesi_DemuxerStreamData * ndsd = demuxer->priv;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
412 rtsp_ctrl * ctl = ndsd->rtsp;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
413 sdp_attr * r_attr = NULL;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
414 sdp_range r = {0, 0};
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
415 double time = ndsd->time[NEMESI_SESSION_VIDEO] ?
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
416 ndsd->time[NEMESI_SESSION_VIDEO] :
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
417 ndsd->time[NEMESI_SESSION_AUDIO];
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
418
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
419 if (!ctl->rtsp_queue)
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
420 return;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
421
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
422 r_attr = sdp_get_attr(ctl->rtsp_queue->info->attr_list, "range");
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
423 if (r_attr)
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
424 r = sdp_parse_range(r_attr->value);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
425
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
426 //flags & 1 -> absolute seek
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
427 //flags & 2 -> percent seek
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
428 if (flags == 0) {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
429 time += rel_seek_secs;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
430 if (time < r.begin)
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
431 time = r.begin;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
432 else if (time > r.end)
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
433 time = r.end;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
434 ndsd->seek = time;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
435
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
436 mp_msg(MSGT_DEMUX,MSGL_WARN,"libNemesi SEEK %f on %f - %f)\n",
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
437 time, r.begin, r.end);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
438
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
439 if (!rtsp_seek(ctl, time, 0)) {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
440 RTSP_Error err = rtsp_wait(ctl);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
441 if (err.got_error) {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
442 mp_msg(MSGT_DEMUX, MSGL_ERR,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
443 "Error Performing Seek: %s\n",
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
444 err.message.reply_str);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
445 demuxer->stream->eof = 1;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
446 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
447 else
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
448 mp_msg(MSGT_DEMUX, MSGL_INFO, "Seek, performed\n");
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
449 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
450 else {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
451 mp_msg(MSGT_DEMUX, MSGL_ERR, "Unable to pause stream to perform seek\n");
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
452 demuxer->stream->eof = 1;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
453 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
454 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
455 else
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
456 mp_msg(MSGT_DEMUX, MSGL_ERR, "Unsupported seek type\n");
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
457 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
458
30644
390c8d36d463 Drop weird and unnecessary _s/_st suffixes from demuxer struct names.
diego
parents: 29263
diff changeset
459 static int demux_rtp_control(struct demuxer *demuxer, int cmd, void *arg)
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
460 {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
461 Nemesi_DemuxerStreamData * ndsd = demuxer->priv;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
462 rtsp_ctrl * ctl = ndsd->rtsp;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
463 sdp_attr * r_attr = NULL;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
464 sdp_range r = {0, 0};
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
465 double time = ndsd->time[NEMESI_SESSION_VIDEO] ?
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
466 ndsd->time[NEMESI_SESSION_VIDEO] :
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
467 ndsd->time[NEMESI_SESSION_AUDIO];
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
468
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
469 if (!ctl->rtsp_queue)
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
470 return DEMUXER_CTRL_DONTKNOW;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
471
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
472 r_attr = sdp_get_attr(ctl->rtsp_queue->info->attr_list, "range");
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
473 if (r_attr)
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
474 r = sdp_parse_range(r_attr->value);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
475
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
476 switch (cmd) {
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
477 case DEMUXER_CTRL_GET_TIME_LENGTH:
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
478 if (r.end == 0)
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
479 return DEMUXER_CTRL_DONTKNOW;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
480
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
481 *((double *)arg) = ((double)r.end) - ((double)r.begin);
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
482 return DEMUXER_CTRL_OK;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
483
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
484 case DEMUXER_CTRL_GET_PERCENT_POS:
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
485 if (r.end == 0)
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
486 return DEMUXER_CTRL_DONTKNOW;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
487
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
488 *((int *)arg) = (int)( time * 100 / (r.end - r.begin) );
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
489 return DEMUXER_CTRL_OK;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
490 default:
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
491 return DEMUXER_CTRL_DONTKNOW;
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
492 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
493 }
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
494
25707
d4fe6e23283e Make all demuxer_desc_t const, thus moving them to .rodata
reimar
parents: 25490
diff changeset
495 const demuxer_desc_t demuxer_desc_rtp_nemesi = {
25270
f2a95277b9cf Rename demuxer tags to clarify
lu_zero
parents: 25267
diff changeset
496 "libnemesi RTP demuxer",
f2a95277b9cf Rename demuxer tags to clarify
lu_zero
parents: 25267
diff changeset
497 "nemesi",
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
498 "",
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
499 "Alessandro Molina",
25270
f2a95277b9cf Rename demuxer tags to clarify
lu_zero
parents: 25267
diff changeset
500 "requires libnemesi",
25266
239330301b33 Make libnemesi use specific struct and DEMUXER_TYPE
lu_zero
parents: 25156
diff changeset
501 DEMUXER_TYPE_RTP_NEMESI,
24564
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
502 0, // no autodetect
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
503 NULL,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
504 demux_rtp_fill_buffer,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
505 demux_open_rtp,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
506 demux_close_rtp,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
507 demux_seek_rtp,
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
508 demux_rtp_control
e4a38a7cdb81 libnemesi support, yet another rtsp/rtp library...
lu_zero
parents:
diff changeset
509 };