]> git.sesse.net Git - vlc/blob - modules/stream_out/rtsp.c
Basic support for RTP-Info
[vlc] / modules / stream_out / rtsp.c
1 /*****************************************************************************
2  * rtsp.c: RTSP support for RTP stream output module
3  *****************************************************************************
4  * Copyright (C) 2003-2004 the VideoLAN team
5  * Copyright © 2007 Rémi Denis-Courmont
6  *
7  * $Id: rtp.c 21407 2007-08-22 20:10:41Z courmisch $
8  *
9  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24  *****************************************************************************/
25
26 /*****************************************************************************
27  * Preamble
28  *****************************************************************************/
29 #include <vlc/vlc.h>
30 #include <vlc_sout.h>
31
32 #include <vlc_httpd.h>
33 #include <vlc_url.h>
34 #include <vlc_network.h>
35 #include <vlc_rand.h>
36 #include <assert.h>
37 #include <errno.h>
38 #include <stdlib.h>
39
40 #include "rtp.h"
41
42 typedef struct rtsp_session_t rtsp_session_t;
43
44 struct rtsp_stream_t
45 {
46     vlc_mutex_t     lock;
47     sout_stream_t  *owner;
48     httpd_host_t   *host;
49     httpd_url_t    *url;
50     char           *psz_path;
51     const char     *track_fmt;
52     unsigned        port;
53
54     int             sessionc;
55     rtsp_session_t **sessionv;
56 };
57
58
59 static int  RtspCallback( httpd_callback_sys_t *p_args,
60                           httpd_client_t *cl, httpd_message_t *answer,
61                           const httpd_message_t *query );
62 static int  RtspCallbackId( httpd_callback_sys_t *p_args,
63                             httpd_client_t *cl, httpd_message_t *answer,
64                             const httpd_message_t *query );
65 static void RtspClientDel( rtsp_stream_t *rtsp, rtsp_session_t *session );
66
67 rtsp_stream_t *RtspSetup( sout_stream_t *p_stream, const vlc_url_t *url )
68 {
69     rtsp_stream_t *rtsp = malloc( sizeof( *rtsp ) );
70
71     if( rtsp == NULL || ( url->i_port > 99999 ) )
72     {
73         free( rtsp );
74         return NULL;
75     }
76
77     rtsp->owner = p_stream;
78     rtsp->sessionc = 0;
79     rtsp->sessionv = NULL;
80     rtsp->host = NULL;
81     rtsp->url = NULL;
82     rtsp->psz_path = NULL;
83     vlc_mutex_init( p_stream, &rtsp->lock );
84
85     rtsp->port = (url->i_port > 0) ? url->i_port : 554;
86     rtsp->psz_path = strdup( ( url->psz_path != NULL ) ? url->psz_path : "/" );
87     if( rtsp->psz_path == NULL )
88         goto error;
89
90     assert( strlen( rtsp->psz_path ) > 0 );
91     if( rtsp->psz_path[strlen( rtsp->psz_path ) - 1] == '/' )
92         rtsp->track_fmt = "%strackID=%u";
93     else
94         rtsp->track_fmt = "%s/trackID=%u";
95
96     msg_Dbg( p_stream, "RTSP stream: host %s port %d at %s",
97              url->psz_host, rtsp->port, rtsp->psz_path );
98
99     rtsp->host = httpd_HostNew( VLC_OBJECT(p_stream), url->psz_host,
100                                 rtsp->port );
101     if( rtsp->host == NULL )
102         goto error;
103
104     rtsp->url = httpd_UrlNewUnique( rtsp->host, rtsp->psz_path,
105                                     NULL, NULL, NULL );
106     if( rtsp->url == NULL )
107         goto error;
108
109     httpd_UrlCatch( rtsp->url, HTTPD_MSG_DESCRIBE, RtspCallback, (void*)rtsp );
110     httpd_UrlCatch( rtsp->url, HTTPD_MSG_SETUP,    RtspCallback, (void*)rtsp );
111     httpd_UrlCatch( rtsp->url, HTTPD_MSG_PLAY,     RtspCallback, (void*)rtsp );
112     httpd_UrlCatch( rtsp->url, HTTPD_MSG_PAUSE,    RtspCallback, (void*)rtsp );
113     httpd_UrlCatch( rtsp->url, HTTPD_MSG_GETPARAMETER, RtspCallback,
114                     (void*)rtsp );
115     httpd_UrlCatch( rtsp->url, HTTPD_MSG_TEARDOWN, RtspCallback, (void*)rtsp );
116     return rtsp;
117
118 error:
119     RtspUnsetup( rtsp );
120     return NULL;
121 }
122
123
124 void RtspUnsetup( rtsp_stream_t *rtsp )
125 {
126     while( rtsp->sessionc > 0 )
127         RtspClientDel( rtsp, rtsp->sessionv[0] );
128
129     if( rtsp->url )
130         httpd_UrlDelete( rtsp->url );
131
132     if( rtsp->host )
133         httpd_HostDelete( rtsp->host );
134
135     free( rtsp->psz_path );
136     vlc_mutex_destroy( &rtsp->lock );
137 }
138
139
140 struct rtsp_stream_id_t
141 {
142     rtsp_stream_t    *stream;
143     sout_stream_id_t *sout_id;
144     httpd_url_t      *url;
145     const char       *dst;
146     int               ttl;
147     unsigned          loport, hiport;
148 };
149
150
151 typedef struct rtsp_strack_t rtsp_strack_t;
152
153 /* For unicast streaming */
154 struct rtsp_session_t
155 {
156     rtsp_stream_t *stream;
157     uint64_t       id;
158
159     /* output (id-access) */
160     int            trackc;
161     rtsp_strack_t *trackv;
162 };
163
164
165 /* Unicast session track */
166 struct rtsp_strack_t
167 {
168     sout_stream_id_t  *id;
169     int                fd;
170     vlc_bool_t         playing;
171 };
172
173
174 rtsp_stream_id_t *RtspAddId( rtsp_stream_t *rtsp, sout_stream_id_t *sid,
175                              unsigned num,
176                              /* Multicast stuff - TODO: cleanup */
177                              const char *dst, int ttl,
178                              unsigned loport, unsigned hiport )
179 {
180     char urlbuf[sizeof( "/trackID=123" ) + strlen( rtsp->psz_path )];
181     rtsp_stream_id_t *id = malloc( sizeof( *id ) );
182     httpd_url_t *url;
183
184     if( id == NULL )
185         return NULL;
186
187     id->stream = rtsp;
188     id->sout_id = sid;
189     /* TODO: can we assume that this need not be strdup'd? */
190     id->dst = dst;
191     if( id->dst != NULL )
192     {
193         id->ttl = ttl;
194         id->loport = loport;
195         id->hiport = hiport;
196     }
197
198     /* FIXME: num screws up if any ES has been removed and re-added */
199     snprintf( urlbuf, sizeof( urlbuf ), rtsp->track_fmt, rtsp->psz_path,
200               num );
201     msg_Dbg( rtsp->owner, "RTSP: adding %s", urlbuf );
202     url = id->url = httpd_UrlNewUnique( rtsp->host, urlbuf, NULL, NULL, NULL );
203
204     if( url == NULL )
205     {
206         free( id );
207         return NULL;
208     }
209
210     httpd_UrlCatch( url, HTTPD_MSG_DESCRIBE, RtspCallbackId, (void *)id );
211     httpd_UrlCatch( url, HTTPD_MSG_SETUP,    RtspCallbackId, (void *)id );
212     httpd_UrlCatch( url, HTTPD_MSG_PLAY,     RtspCallbackId, (void *)id );
213     httpd_UrlCatch( url, HTTPD_MSG_PAUSE,    RtspCallbackId, (void *)id );
214     httpd_UrlCatch( url, HTTPD_MSG_GETPARAMETER, RtspCallbackId, (void *)id );
215     httpd_UrlCatch( url, HTTPD_MSG_TEARDOWN, RtspCallbackId, (void *)id );
216
217     return id;
218 }
219
220
221 void RtspDelId( rtsp_stream_t *rtsp, rtsp_stream_id_t *id )
222 {
223     vlc_mutex_lock( &rtsp->lock );
224     for( int i = 0; i < rtsp->sessionc; i++ )
225     {
226         rtsp_session_t *ses = rtsp->sessionv[i];
227
228         for( int j = 0; j < ses->trackc; j++ )
229         {
230             if( ses->trackv[j].id == id->sout_id )
231             {
232                 rtsp_strack_t *tr = ses->trackv + j;
233                 net_Close( tr->fd );
234                 REMOVE_ELEM( ses->trackv, ses->trackc, j );
235             }
236         }
237     }
238
239     vlc_mutex_unlock( &rtsp->lock );
240     httpd_UrlDelete( id->url );
241     free( id );
242 }
243
244
245 /** rtsp must be locked */
246 static
247 rtsp_session_t *RtspClientNew( rtsp_stream_t *rtsp )
248 {
249     rtsp_session_t *s = malloc( sizeof( *s ) );
250     if( s == NULL )
251         return NULL;
252
253     s->stream = rtsp;
254     vlc_rand_bytes (&s->id, sizeof (s->id));
255     s->trackc = 0;
256     s->trackv = NULL;
257
258     TAB_APPEND( rtsp->sessionc, rtsp->sessionv, s );
259
260     return s;
261 }
262
263
264 /** rtsp must be locked */
265 static
266 rtsp_session_t *RtspClientGet( rtsp_stream_t *rtsp, const char *name )
267 {
268     char *end;
269     uint64_t id;
270     int i;
271
272     if( name == NULL )
273         return NULL;
274
275     errno = 0;
276     id = strtoull( name, &end, 0x10 );
277     if( errno || *end )
278         return NULL;
279
280     /* FIXME: use a hash/dictionary */
281     for( i = 0; i < rtsp->sessionc; i++ )
282     {
283         if( rtsp->sessionv[i]->id == id )
284             return rtsp->sessionv[i];
285     }
286     return NULL;
287 }
288
289
290 /** rtsp must be locked */
291 static
292 void RtspClientDel( rtsp_stream_t *rtsp, rtsp_session_t *session )
293 {
294     int i;
295     TAB_REMOVE( rtsp->sessionc, rtsp->sessionv, session );
296
297     for( i = 0; i < session->trackc; i++ )
298         rtp_del_sink( session->trackv[i].id, session->trackv[i].fd );
299
300     free( session->trackv );
301     free( session );
302 }
303
304
305 /** Finds the next transport choice */
306 static inline const char *transport_next( const char *str )
307 {
308     /* Looks for comma */
309     str = strchr( str, ',' );
310     if( str == NULL )
311         return NULL; /* No more transport options */
312
313     str++; /* skips comma */
314     while( strchr( "\r\n\t ", *str ) )
315         str++;
316
317     return (*str) ? str : NULL;
318 }
319
320
321 /** Finds the next transport parameter */
322 static inline const char *parameter_next( const char *str )
323 {
324     while( strchr( ",;", *str ) == NULL )
325         str++;
326
327     return (*str == ';') ? (str + 1) : NULL;
328 }
329
330
331 /** RTSP requests handler
332  * @param id selected track for non-aggregate URLs,
333  *           NULL for aggregate URLs
334  */
335 static int RtspHandler( rtsp_stream_t *rtsp, rtsp_stream_id_t *id,
336                         httpd_client_t *cl,
337                         httpd_message_t *answer,
338                         const httpd_message_t *query )
339 {
340     sout_stream_t *p_stream = rtsp->owner;
341     char psz_sesbuf[17];
342     const char *psz_session = NULL, *psz;
343     char control[sizeof("rtsp://[]:12345") + NI_MAXNUMERICHOST
344                   + strlen( rtsp->psz_path )];
345
346     if( answer == NULL || query == NULL || cl == NULL )
347         return VLC_SUCCESS;
348     else
349     {
350         /* Build self-referential control URL */
351         char ip[NI_MAXNUMERICHOST], *ptr;
352
353         httpd_ServerIP( cl, ip );
354         ptr = strchr( ip, '%' );
355         if( ptr != NULL )
356             *ptr = '\0';
357
358         if( strchr( ip, ':' ) != NULL )
359             sprintf( control, "rtsp://[%s]:%u%s", ip, rtsp->port,
360                      rtsp->psz_path );
361         else
362             sprintf( control, "rtsp://%s:%u%s", ip, rtsp->port,
363                      rtsp->psz_path );
364     }
365
366     /* */
367     answer->i_proto = HTTPD_PROTO_RTSP;
368     answer->i_version= 0;
369     answer->i_type   = HTTPD_MSG_ANSWER;
370     answer->i_body = 0;
371     answer->p_body = NULL;
372
373     if( query->i_proto != HTTPD_PROTO_RTSP )
374     {
375         answer->i_status = 505;
376     }
377     else
378     if( httpd_MsgGet( query, "Require" ) != NULL )
379     {
380         answer->i_status = 551;
381         httpd_MsgAdd( answer, "Unsupported", "%s",
382                       httpd_MsgGet( query, "Require" ) );
383     }
384     else
385     switch( query->i_type )
386     {
387         case HTTPD_MSG_DESCRIBE:
388         {   /* Aggregate-only */
389             if( id != NULL )
390             {
391                 answer->i_status = 460;
392                 break;
393             }
394
395             answer->i_status = 200;
396             httpd_MsgAdd( answer, "Content-Type",  "%s", "application/sdp" );
397             httpd_MsgAdd( answer, "Content-Base",  "%s", control );
398             answer->p_body = (uint8_t *)SDPGenerate( rtsp->owner, control );
399             if( answer->p_body != NULL )
400                 answer->i_body = strlen( (char *)answer->p_body );
401             else
402                 answer->i_status = 500;
403             break;
404         }
405
406         case HTTPD_MSG_SETUP:
407             /* Non-aggregate-only */
408             if( id == NULL )
409             {
410                 answer->i_status = 459;
411                 break;
412             }
413
414             psz_session = httpd_MsgGet( query, "Session" );
415             answer->i_status = 461;
416
417             for( const char *tpt = httpd_MsgGet( query, "Transport" );
418                  tpt != NULL;
419                  tpt = transport_next( tpt ) )
420             {
421                 vlc_bool_t b_multicast = VLC_TRUE, b_unsupp = VLC_FALSE;
422                 unsigned loport = 5004, hiport = 5005; /* from RFC3551 */
423
424                 /* Check transport protocol. */
425                 /* Currently, we only support RTP/AVP over UDP */
426                 if( strncmp( tpt, "RTP/AVP", 7 ) )
427                     continue;
428                 tpt += 7;
429                 if( strncmp( tpt, "/UDP", 4 ) == 0 )
430                     tpt += 4;
431                 if( strchr( ";,", *tpt ) == NULL )
432                     continue;
433
434                 /* Parse transport options */
435                 for( const char *opt = parameter_next( tpt );
436                      opt != NULL;
437                      opt = parameter_next( opt ) )
438                 {
439                     if( strncmp( opt, "multicast", 9 ) == 0)
440                         b_multicast = VLC_TRUE;
441                     else
442                     if( strncmp( opt, "unicast", 7 ) == 0 )
443                         b_multicast = VLC_FALSE;
444                     else
445                     if( sscanf( opt, "client_port=%u-%u", &loport, &hiport )
446                                 == 2 )
447                         ;
448                     else
449                     if( strncmp( opt, "mode=", 5 ) == 0 )
450                     {
451                         if( strncasecmp( opt + 5, "play", 4 )
452                          && strncasecmp( opt + 5, "\"PLAY\"", 6 ) )
453                         {
454                             /* Not playing?! */
455                             b_unsupp = VLC_TRUE;
456                             break;
457                         }
458                     }
459                     else
460                     if( strncmp( opt,"destination=", 12 ) == 0 )
461                     {
462                         answer->i_status = 403;
463                         b_unsupp = VLC_TRUE;
464                     }
465                     else
466                     {
467                     /*
468                      * Every other option is unsupported:
469                      *
470                      * "source" and "append" are invalid (server-only);
471                      * "ssrc" also (as clarified per RFC2326bis).
472                      *
473                      * For multicast, "port", "layers", "ttl" are set by the
474                      * stream output configuration.
475                      *
476                      * For unicast, we want to decide "server_port" values.
477                      *
478                      * "interleaved" is not implemented.
479                      */
480                         b_unsupp = VLC_TRUE;
481                         break;
482                     }
483                 }
484
485                 if( b_unsupp )
486                     continue;
487
488                 if( b_multicast )
489                 {
490                     const char *dst = id->dst;
491                     if( dst == NULL )
492                         continue;
493
494                     if( psz_session == NULL )
495                     {
496                         /* Create a dummy session ID */
497                         snprintf( psz_sesbuf, sizeof( psz_sesbuf ), "%d",
498                                   rand() );
499                         psz_session = psz_sesbuf;
500                     }
501                     answer->i_status = 200;
502
503                     httpd_MsgAdd( answer, "Transport",
504                                   "RTP/AVP/UDP;destination=%s;port=%u-%u;"
505                                   "ttl=%d;mode=play",
506                                   dst, id->loport, id->hiport,
507                                   ( id->ttl > 0 ) ? id->ttl : 1 );
508                 }
509                 else
510                 {
511                     char ip[NI_MAXNUMERICHOST], src[NI_MAXNUMERICHOST];
512                     rtsp_session_t *ses = NULL;
513                     rtsp_strack_t track = { id->sout_id, -1, VLC_FALSE };
514                     int sport;
515
516                     if( httpd_ClientIP( cl, ip ) == NULL )
517                     {
518                         answer->i_status = 500;
519                         continue;
520                     }
521
522                     track.fd = net_ConnectDgram( p_stream, ip, loport, -1,
523                                                  IPPROTO_UDP );
524                     if( track.fd == -1 )
525                     {
526                         msg_Err( p_stream,
527                                  "cannot create RTP socket for %s port %u",
528                                  ip, loport );
529                         answer->i_status = 500;
530                         continue;
531                     }
532
533                     net_GetSockAddress( track.fd, src, &sport );
534
535                     vlc_mutex_lock( &rtsp->lock );
536                     if( psz_session == NULL )
537                     {
538                         ses = RtspClientNew( rtsp );
539                         snprintf( psz_sesbuf, sizeof( psz_sesbuf ), I64Fx,
540                                   ses->id );
541                         psz_session = psz_sesbuf;
542                     }
543                     else
544                     {
545                         /* FIXME: we probably need to remove an access out,
546                          * if there is already one for the same ID */
547                         ses = RtspClientGet( rtsp, psz_session );
548                         if( ses == NULL )
549                         {
550                             answer->i_status = 454;
551                             vlc_mutex_unlock( &rtsp->lock );
552                             continue;
553                         }
554                     }
555
556                     INSERT_ELEM( ses->trackv, ses->trackc, ses->trackc,
557                                  track );
558                     vlc_mutex_unlock( &rtsp->lock );
559
560                     httpd_ServerIP( cl, ip );
561
562                     if( strcmp( src, ip ) )
563                     {
564                         /* Specify source IP if it is different from the RTSP
565                          * control connection server address */
566                         char *ptr = strchr( src, '%' );
567                         if( ptr != NULL ) *ptr = '\0'; /* remove scope ID */
568
569                         httpd_MsgAdd( answer, "Transport",
570                                       "RTP/AVP/UDP;unicast;source=%s;"
571                                       "client_port=%u-%u;server_port=%u-%u;"
572                                       "mode=play",
573                                       src, loport, loport + 1, sport,
574                                       sport + 1 );
575                     }
576                     else
577                     {
578                         httpd_MsgAdd( answer, "Transport",
579                                       "RTP/AVP/UDP;unicast;"
580                                       "client_port=%u-%u;server_port=%u-%u;"
581                                       "mode=play",
582                                       loport, loport + 1, sport, sport + 1 );
583                     }
584
585                     answer->i_status = 200;
586                 }
587                 break;
588             }
589             break;
590
591         case HTTPD_MSG_PLAY:
592         {
593             rtsp_session_t *ses;
594             answer->i_status = 200;
595
596             psz_session = httpd_MsgGet( query, "Session" );
597             if( httpd_MsgGet( query, "Range" ) != NULL )
598             {
599                 answer->i_status = 456; /* cannot seek */
600                 break;
601             }
602
603             vlc_mutex_lock( &rtsp->lock );
604             ses = RtspClientGet( rtsp, psz_session );
605             if( ses != NULL )
606             {
607                 /* FIXME: we really need to limit the number of tracks... */
608                 char info[ses->trackc * ( strlen( control )
609                                   + sizeof("/trackID=123;seq=65535, ") ) + 1];
610                 size_t infolen = 0;
611
612                 for( int i = 0; i < ses->trackc; i++ )
613                 {
614                     rtsp_strack_t *tr = ses->trackv + i;
615                     if( ( id == NULL ) || ( tr->id == id->sout_id ) )
616                     {
617                         if( !tr->playing )
618                         {
619                             tr->playing = VLC_TRUE;
620                             rtp_add_sink( tr->id, tr->fd, VLC_FALSE );
621                         }
622                         infolen += sprintf( info + infolen,
623                                             "%s/trackID=%u;seq=%u, ", control,
624                                             rtp_get_num( tr->id ),
625                                             rtp_get_seq( tr->id ) );
626                     }
627                 }
628                 if( infolen > 0 )
629                 {
630                     info[infolen - 2] = '\0'; /* remove trailing ", " */
631                     httpd_MsgAdd( answer, "RTP-Info", "%s", info );
632                 }
633             }
634             vlc_mutex_unlock( &rtsp->lock );
635
636             if( httpd_MsgGet( query, "Scale" ) != NULL )
637                 httpd_MsgAdd( answer, "Scale", "1." );
638             break;
639         }
640
641         case HTTPD_MSG_PAUSE:
642             answer->i_status = 405;
643             httpd_MsgAdd( answer, "Allow",
644                           "%s, TEARDOWN, PLAY, GET_PARAMETER",
645                           ( id != NULL ) ? "SETUP" : "DESCRIBE" );
646             break;
647
648         case HTTPD_MSG_GETPARAMETER:
649             if( query->i_body > 0 )
650             {
651                 answer->i_status = 451;
652                 break;
653             }
654
655             psz_session = httpd_MsgGet( query, "Session" );
656             answer->i_status = 200;
657             break;
658
659         case HTTPD_MSG_TEARDOWN:
660         {
661             rtsp_session_t *ses;
662
663             answer->i_status = 200;
664
665             psz_session = httpd_MsgGet( query, "Session" );
666
667             vlc_mutex_lock( &rtsp->lock );
668             ses = RtspClientGet( rtsp, psz_session );
669             if( ses != NULL )
670             {
671                 if( id == NULL ) /* Delete the entire session */
672                     RtspClientDel( rtsp, ses );
673                 else /* Delete one track from the session */
674                 for( int i = 0; i < ses->trackc; i++ )
675                 {
676                     if( ses->trackv[i].id == id->sout_id )
677                     {
678                         rtp_del_sink( id->sout_id, ses->trackv[i].fd );
679                         REMOVE_ELEM( ses->trackv, ses->trackc, i );
680                     }
681                 }
682             }
683             vlc_mutex_unlock( &rtsp->lock );
684             break;
685         }
686
687         default:
688             return VLC_EGENERIC;
689     }
690
691     httpd_MsgAdd( answer, "Server", "%s", PACKAGE_STRING );
692     if( psz_session )
693         httpd_MsgAdd( answer, "Session", "%s"/*;timeout=5*/, psz_session );
694
695     httpd_MsgAdd( answer, "Content-Length", "%d", answer->i_body );
696     httpd_MsgAdd( answer, "Cache-Control", "no-cache" );
697
698     psz = httpd_MsgGet( query, "Cseq" );
699     if( psz != NULL )
700         httpd_MsgAdd( answer, "Cseq", "%s", psz );
701     psz = httpd_MsgGet( query, "Timestamp" );
702     if( psz != NULL )
703         httpd_MsgAdd( answer, "Timestamp", "%s", psz );
704
705     return VLC_SUCCESS;
706 }
707
708
709 /** Aggregate RTSP callback */
710 static int RtspCallback( httpd_callback_sys_t *p_args,
711                          httpd_client_t *cl,
712                          httpd_message_t *answer,
713                          const httpd_message_t *query )
714 {
715     return RtspHandler( (rtsp_stream_t *)p_args, NULL, cl, answer, query );
716 }
717
718
719 /** Non-aggregate RTSP callback */
720 static int RtspCallbackId( httpd_callback_sys_t *p_args,
721                            httpd_client_t *cl,
722                            httpd_message_t *answer,
723                            const httpd_message_t *query )
724 {
725     rtsp_stream_id_t *id = (rtsp_stream_id_t *)p_args;
726     return RtspHandler( id->stream, id, cl, answer, query );
727 }