]> git.sesse.net Git - vlc/blob - modules/access/udp.c
Remove useless #define
[vlc] / modules / access / udp.c
1 /*****************************************************************************
2  * udp.c: raw UDP & RTP input module
3  *****************************************************************************
4  * Copyright (C) 2001-2005 the VideoLAN team
5  * Copyright (C) 2007 Remi Denis-Courmont
6  * $Id$
7  *
8  * Authors: Christophe Massiot <massiot@via.ecp.fr>
9  *          Tristan Leteurtre <tooney@via.ecp.fr>
10  *          Laurent Aimar <fenrir@via.ecp.fr>
11  *          Jean-Paul Saman <jpsaman #_at_# m2x dot nl>
12  *          Remi Denis-Courmont
13  *
14  * Reviewed: 23 October 2003, Jean-Paul Saman <jpsaman _at_ videolan _dot_ org>
15  *
16  * This program is free software; you can redistribute it and/or modify
17  * it under the terms of the GNU General Public License as published by
18  * the Free Software Foundation; either version 2 of the License, or
19  * (at your option) any later version.
20  *
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24  * GNU General Public License for more details.
25  *
26  * You should have received a copy of the GNU General Public License
27  * along with this program; if not, write to the Free Software
28  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
29  *****************************************************************************/
30
31 /*****************************************************************************
32  * Preamble
33  *****************************************************************************/
34
35 #include <vlc/vlc.h>
36 #include <vlc_access.h>
37 #include <vlc_network.h>
38
39 #ifndef SOCK_DCCP /* provisional API */
40 # ifdef __linux__
41 #  define SOCK_DCCP 6
42 # endif
43 #endif
44
45 #ifndef IPPROTO_DCCP
46 # define IPPROTO_DCCP 33 /* IANA */
47 #endif
48
49 #ifndef IPPROTO_UDPLITE
50 # define IPPROTO_UDPLITE 136 /* from IANA */
51 #endif
52
53 #define MTU 65535
54
55 /*****************************************************************************
56  * Module descriptor
57  *****************************************************************************/
58 #define CACHING_TEXT N_("Caching value in ms")
59 #define CACHING_LONGTEXT N_( \
60     "Caching value for UDP streams. This " \
61     "value should be set in milliseconds." )
62
63 #define RTP_LATE_TEXT N_("RTP reordering timeout in ms")
64 #define RTP_LATE_LONGTEXT N_( \
65     "VLC reorders RTP packets. The input will wait for late packets at most "\
66     "the time specified here (in milliseconds)." )
67
68 static int  Open ( vlc_object_t * );
69 static void Close( vlc_object_t * );
70
71 vlc_module_begin();
72     set_shortname( _("UDP/RTP" ) );
73     set_description( _("UDP/RTP input") );
74     set_category( CAT_INPUT );
75     set_subcategory( SUBCAT_INPUT_ACCESS );
76
77     add_integer( "udp-caching", DEFAULT_PTS_DELAY / 1000, NULL, CACHING_TEXT,
78                  CACHING_LONGTEXT, VLC_TRUE );
79     add_integer( "rtp-late", 100, NULL, RTP_LATE_TEXT, RTP_LATE_LONGTEXT, VLC_TRUE );
80     add_obsolete_bool( "udp-auto-mtu" );
81
82     set_capability( "access2", 0 );
83     add_shortcut( "udp" );
84     add_shortcut( "udpstream" );
85     add_shortcut( "udp4" );
86     add_shortcut( "udp6" );
87     add_shortcut( "rtp" );
88     add_shortcut( "rtp4" );
89     add_shortcut( "rtp6" );
90     add_shortcut( "udplite" );
91     add_shortcut( "rtptcp" );
92     add_shortcut( "dccp" );
93
94     set_callbacks( Open, Close );
95 vlc_module_end();
96
97 /*****************************************************************************
98  * Local prototypes
99  *****************************************************************************/
100 #define RTP_HEADER_LEN 12
101
102 static block_t *BlockUDP( access_t * );
103 static block_t *BlockTCP( access_t * );
104 static block_t *BlockRTP( access_t * );
105 static block_t *BlockChoose( access_t * );
106 static int Control( access_t *, int, va_list );
107
108 struct access_sys_t
109 {
110     int fd;
111
112     vlc_bool_t b_framed_rtp;
113
114     /* reorder rtp packets when out-of-sequence */
115     uint16_t i_last_seqno;
116     mtime_t i_rtp_late;
117     block_t *p_list;
118     block_t *p_end;
119     block_t *p_partial_frame; /* Partial Framed RTP packet */
120 };
121
122 /*****************************************************************************
123  * Open: open the socket
124  *****************************************************************************/
125 static int Open( vlc_object_t *p_this )
126 {
127     access_t     *p_access = (access_t*)p_this;
128     access_sys_t *p_sys;
129
130     char *psz_name = strdup( p_access->psz_path );
131     char *psz_parser;
132     const char *psz_server_addr, *psz_bind_addr = "";
133     int  i_bind_port, i_server_port = 0;
134     int fam = AF_UNSPEC, proto = IPPROTO_UDP;
135
136     if (strlen (p_access->psz_access) >= 3)
137     {
138         switch (p_access->psz_access[3])
139         {
140             case '4':
141                 fam = AF_INET;
142                 break;
143
144             case '6':
145                 fam = AF_INET6;
146                 break;
147         }
148         if (strcmp (p_access->psz_access + 3, "lite") == 0)
149             proto = IPPROTO_UDPLITE;
150         else
151         if (strcmp (p_access->psz_access + 3, "tcp") == 0)
152             proto = IPPROTO_TCP;
153         else
154         if (strcmp (p_access->psz_access, "dccp") == 0)
155             proto = IPPROTO_DCCP;
156     }
157
158     i_bind_port = var_CreateGetInteger( p_access, "server-port" );
159
160     /* Parse psz_name syntax :
161      * [serveraddr[:serverport]][@[bindaddr]:[bindport]] */
162     psz_parser = strchr( psz_name, '@' );
163     if( psz_parser != NULL )
164     {
165         /* Found bind address and/or bind port */
166         *psz_parser++ = '\0';
167         psz_bind_addr = psz_parser;
168
169         if( psz_bind_addr[0] == '[' )
170             /* skips bracket'd IPv6 address */
171             psz_parser = strchr( psz_parser, ']' );
172
173         if( psz_parser != NULL )
174         {
175             psz_parser = strchr( psz_parser, ':' );
176             if( psz_parser != NULL )
177             {
178                 *psz_parser++ = '\0';
179                 i_bind_port = atoi( psz_parser );
180             }
181         }
182     }
183
184     psz_server_addr = psz_name;
185     psz_parser = ( psz_server_addr[0] == '[' )
186         ? strchr( psz_name, ']' ) /* skips bracket'd IPv6 address */
187         : psz_name;
188
189     if( psz_parser != NULL )
190     {
191         psz_parser = strchr( psz_parser, ':' );
192         if( psz_parser != NULL )
193         {
194             *psz_parser++ = '\0';
195             i_server_port = atoi( psz_parser );
196         }
197     }
198
199     msg_Dbg( p_access, "opening server=%s:%d local=%s:%d",
200              psz_server_addr, i_server_port, psz_bind_addr, i_bind_port );
201
202     /* Set up p_access */
203     access_InitFields( p_access );
204     ACCESS_SET_CALLBACKS( NULL, BlockChoose, Control, NULL );
205     p_access->info.b_prebuffered = VLC_FALSE;
206     MALLOC_ERR( p_access->p_sys, access_sys_t ); p_sys = p_access->p_sys;
207     memset (p_sys, 0, sizeof (*p_sys));
208
209     switch (proto)
210     {
211         case IPPROTO_UDP:
212         case IPPROTO_UDPLITE:
213             p_sys->fd = net_OpenDgram( p_access, psz_bind_addr, i_bind_port,
214                                        psz_server_addr, i_server_port, fam,
215                                        proto );
216             break;
217
218         case IPPROTO_TCP:
219             p_sys->fd = net_ConnectTCP( p_access, psz_server_addr, i_server_port );
220             p_sys->b_framed_rtp = VLC_TRUE;
221             break;
222
223         case IPPROTO_DCCP:
224 #ifdef SOCK_DCCP
225             p_sys->fd = net_Connect( p_access, psz_server_addr, i_server_port,
226                                      SOCK_DCCP, IPPROTO_DCCP );
227 #else
228             p_sys->fd = -1;
229             msg_Err( p_access, "DCCP support not compiled-in!" );
230 #endif
231             break;
232     }
233     free (psz_name);
234     if( p_sys->fd == -1 )
235     {
236         msg_Err( p_access, "cannot open socket" );
237         free( p_sys );
238         return VLC_EGENERIC;
239     }
240
241     shutdown( p_sys->fd, SHUT_WR );
242
243     net_SetCSCov (p_sys->fd, -1, 12);
244
245     if (p_sys->b_framed_rtp)
246     {
247         /* We don't do autodetection and prebuffering in case of framing */
248         p_access->pf_block = BlockRTP;
249     }
250
251     /* Update default_pts to a suitable value for udp access */
252     var_Create( p_access, "udp-caching", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
253
254     /* RTP reordering for out-of-sequence packets */
255     p_sys->i_rtp_late = var_CreateGetInteger( p_access, "rtp-late" ) * 1000;
256     p_sys->i_last_seqno = 0;
257     p_sys->p_list = NULL;
258     p_sys->p_end = NULL;
259     return VLC_SUCCESS;
260 }
261
262 /*****************************************************************************
263  * Close: free unused data structures
264  *****************************************************************************/
265 static void Close( vlc_object_t *p_this )
266 {
267     access_t     *p_access = (access_t*)p_this;
268     access_sys_t *p_sys = p_access->p_sys;
269
270     block_ChainRelease( p_sys->p_list );
271     net_Close( p_sys->fd );
272     free( p_sys );
273 }
274
275 /*****************************************************************************
276  * Control:
277  *****************************************************************************/
278 static int Control( access_t *p_access, int i_query, va_list args )
279 {
280     vlc_bool_t   *pb_bool;
281     int          *pi_int;
282     int64_t      *pi_64;
283
284     switch( i_query )
285     {
286         /* */
287         case ACCESS_CAN_SEEK:
288         case ACCESS_CAN_FASTSEEK:
289         case ACCESS_CAN_PAUSE:
290         case ACCESS_CAN_CONTROL_PACE:
291             pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t* );
292             *pb_bool = VLC_FALSE;
293             break;
294         /* */
295         case ACCESS_GET_MTU:
296             pi_int = (int*)va_arg( args, int * );
297             *pi_int = MTU;
298             break;
299
300         case ACCESS_GET_PTS_DELAY:
301             pi_64 = (int64_t*)va_arg( args, int64_t * );
302             *pi_64 = var_GetInteger( p_access, "udp-caching" ) * 1000;
303             break;
304
305         /* */
306         case ACCESS_SET_PAUSE_STATE:
307         case ACCESS_GET_TITLE_INFO:
308         case ACCESS_SET_TITLE:
309         case ACCESS_SET_SEEKPOINT:
310         case ACCESS_SET_PRIVATE_ID_STATE:
311             return VLC_EGENERIC;
312
313         default:
314             msg_Warn( p_access, "unimplemented query in control" );
315             return VLC_EGENERIC;
316
317     }
318     return VLC_SUCCESS;
319 }
320
321 /*****************************************************************************
322  * BlockUDP:
323  *****************************************************************************/
324 static block_t *BlockUDP( access_t *p_access )
325 {
326     access_sys_t *p_sys = p_access->p_sys;
327     block_t      *p_block;
328
329     /* Read data */
330     p_block = block_New( p_access, MTU );
331     p_block->i_buffer = net_Read( p_access, p_sys->fd, NULL,
332                                   p_block->p_buffer, MTU, VLC_FALSE );
333     if( p_block->i_buffer < 0 )
334     {
335         block_Release( p_block );
336         return NULL;
337     }
338
339     return block_Realloc( p_block, 0, p_block->i_buffer );
340 }
341
342 /*****************************************************************************
343  * BlockTCP: Framed RTP/AVP packet reception for COMEDIA (see RFC4571)
344  *****************************************************************************/
345 static block_t *BlockTCP( access_t *p_access )
346 {
347     access_sys_t *p_sys = p_access->p_sys;
348     block_t      *p_block = p_sys->p_partial_frame;
349
350     if( p_access->info.b_eof )
351         return NULL;
352
353     if( p_block == NULL )
354     {
355         /* MTU should always be 65535 in this case */
356         p_sys->p_partial_frame = p_block = block_New( p_access, 2 + MTU );
357         if (p_block == NULL)
358             return NULL;
359     }
360
361     /* Read RTP framing */
362     if (p_block->i_buffer < 2)
363     {
364         /* FIXME: not very efficient */
365         int i_read = net_Read( p_access, p_sys->fd, NULL,
366                                p_block->p_buffer + p_block->i_buffer,
367                                2 - p_block->i_buffer, VLC_FALSE );
368         if( i_read <= 0 )
369             goto error;
370
371         p_block->i_buffer += i_read;
372         if (p_block->i_buffer < 2)
373             return NULL;
374     }
375
376     uint16_t framelen = GetWLE( p_block->p_buffer );
377     /* Read RTP frame */
378     if( framelen > 0 )
379     {
380         int i_read = net_Read( p_access, p_sys->fd, NULL,
381                                p_block->p_buffer + p_block->i_buffer,
382                                2 + framelen - p_block->i_buffer, VLC_FALSE );
383         if( i_read <= 0 )
384             goto error;
385
386         p_block->i_buffer += i_read;
387     }
388
389     if( p_block->i_buffer < (2 + framelen) )
390         return NULL; // incomplete frame
391
392     /* Hide framing from RTP layer */
393     p_block->p_buffer += 2;
394     p_block->i_buffer -= 2;
395     p_sys->p_partial_frame = NULL;
396     return p_block;
397
398 error:
399     p_access->info.b_eof = VLC_TRUE;
400     block_Release( p_block );
401     p_sys->p_partial_frame = NULL;
402     return NULL;
403 }
404
405
406 /*
407  * rtp_ChainInsert - insert a p_block in the chain and
408  * look at the sequence numbers.
409  */
410 static inline vlc_bool_t rtp_ChainInsert( access_t *p_access, block_t *p_block )
411 {
412     access_sys_t *p_sys = (access_sys_t *) p_access->p_sys;
413     block_t *p_prev = NULL;
414     block_t *p = p_sys->p_end;
415     uint16_t i_new = (uint16_t) p_block->i_dts;
416     uint16_t i_tmp = 0;
417
418     if( !p_sys->p_list )
419     {
420         p_sys->p_list = p_block;
421         p_sys->p_end = p_block;
422         return VLC_TRUE;
423     }
424     /* walk through the queue from top down since the new packet is in
425     most cases just appended to the end */
426
427     for( ;; )
428     {
429         i_tmp = i_new - (uint16_t) p->i_dts;
430
431         if( !i_tmp )   /* trash duplicate */
432             break;
433
434         if ( i_tmp < 32768 )
435         {   /* insert after this block ( i_new > p->i_dts ) */
436             p_block->p_next = p->p_next;
437             p->p_next = p_block;
438             p_block->p_prev = p;
439             if (p_prev)
440             {
441                 p_prev->p_prev = p_block;
442                 msg_Dbg(p_access, "RTP reordering: insert after %d, new %d",
443                         (uint16_t) p->i_dts, i_new );
444             }
445             else
446             {
447                 p_sys->p_end = p_block;
448             }
449             return VLC_TRUE;
450         }
451         if( p == p_sys->p_list )
452         {   /* we've reached bottom of chain */
453             i_tmp = p_sys->i_last_seqno - i_new;
454             if( !p_access->info.b_prebuffered || (i_tmp > 32767) )
455             {
456                 msg_Dbg(p_access, "RTP reordering: prepend %d before %d",
457                         i_new, (uint16_t) p->i_dts );
458                 p_block->p_next = p;
459                 p->p_prev = p_block;
460                 p_sys->p_list = p_block;
461                 return VLC_TRUE;
462             }
463
464             if( !i_tmp )   /* trash duplicate */
465                 break;
466
467             /* reordering failed - append the packet to the end of queue */
468             msg_Dbg(p_access, "RTP: sequence changed (or buffer too small) "
469                     "new: %d, buffer %d...%d", i_new, (uint16_t) p->i_dts,
470                 (uint16_t) p_sys->p_end->i_dts);
471             p_sys->p_end->p_next = p_block;
472             p_block->p_prev = p_sys->p_end;
473             p_sys->p_end = p_block;
474             return VLC_TRUE;
475         }
476         p_prev = p;
477         p = p->p_prev;
478     }
479     block_Release( p_block );
480     return VLC_FALSE;
481 }
482
483 /*****************************************************************************
484  * BlockParseRTP/BlockRTP:
485  *****************************************************************************/
486 static block_t *BlockParseRTP( access_t *p_access, block_t *p_block )
487 {
488     int      i_payload_type;
489     size_t   i_skip = RTP_HEADER_LEN;
490
491     if( p_block == NULL )
492         return NULL;
493
494     if( p_block->i_buffer < RTP_HEADER_LEN )
495     {
496         msg_Dbg( p_access, "short RTP packet received" );
497         goto trash;
498     }
499
500     /* Parse the header and make some verifications.
501      * See RFC 3550. */
502     // Version number:
503     if( ( p_block->p_buffer[0] >> 6 ) != 2)
504     {
505         msg_Dbg( p_access, "RTP version is %u instead of 2",
506                  p_block->p_buffer[0] >> 6 );
507         goto trash;
508     }
509     // Padding bit:
510     uint8_t pad = (p_block->p_buffer[0] & 0x20)
511                     ? p_block->p_buffer[p_block->i_buffer - 1] : 0;
512     // CSRC count:
513     i_skip += (p_block->p_buffer[0] & 0x0F) * 4;
514     // Extension header:
515     if (p_block->p_buffer[0] & 0x10) /* Extension header */
516     {
517         i_skip += 4;
518         if ((size_t)p_block->i_buffer < i_skip)
519             goto trash;
520
521         i_skip += 4 * GetWBE( p_block->p_buffer + i_skip - 2 );
522     }
523
524     i_payload_type    = p_block->p_buffer[1] & 0x7F;
525
526     /* Remember sequence number in i_dts */
527     p_block->i_pts = mdate();
528     p_block->i_dts = (mtime_t) GetWBE( p_block->p_buffer + 2 );
529
530     /* FIXME: use rtpmap */
531     switch( i_payload_type )
532     {
533         case 14: // MPA: MPEG Audio (RFC2250, §3.4)
534             i_skip += 4; // 32 bits RTP/MPA header
535             break;
536
537         case 32: // MPV: MPEG Video (RFC2250, §3.5)
538             i_skip += 4; // 32 bits RTP/MPV header
539             if( (size_t)p_block->i_buffer < i_skip )
540                 goto trash;
541             if( p_block->p_buffer[i_skip - 3] & 0x4 )
542             {
543                 /* MPEG2 Video extension header */
544                 /* TODO: shouldn't we skip this too ? */
545             }
546             break;
547
548         case 33: // MP2: MPEG TS (RFC2250, §2)
549             /* plain TS over RTP */
550             break;
551
552         default:
553             msg_Dbg( p_access, "unsupported RTP payload type: %u", i_payload_type );
554             goto trash;
555     }
556
557     if( (size_t)p_block->i_buffer < (i_skip + pad) )
558         goto trash;
559
560     /* Remove the RTP header */
561     p_block->i_buffer -= i_skip;
562     p_block->p_buffer += i_skip;
563
564     /* This is the place for deciphering and authentication */
565
566     /* Remove padding (at the end) */
567     p_block->i_buffer -= pad;
568
569 #if 0
570     /* Emulate packet loss */
571     if ( (i_sequence_number % 4000) == 0)
572     {
573         msg_Warn( p_access, "Emulating packet drop" );
574         block_Release( p_block );
575         return NULL;
576     }
577 #endif
578
579     return p_block;
580
581 trash:
582     block_Release( p_block );
583     return NULL;
584 }
585
586 static block_t *BlockPrebufferRTP( access_t *p_access, block_t *p_block )
587 {
588     access_sys_t *p_sys = p_access->p_sys;
589     mtime_t   i_first = mdate();
590     int       i_count = 0;
591     block_t   *p = p_block;
592
593     for( ;; )
594     {
595         mtime_t i_date = mdate();
596
597         if( p && rtp_ChainInsert( p_access, p ))
598             i_count++;
599
600         /* Require at least 2 packets in the buffer */
601         if( i_count > 2 && (i_date - i_first) > p_sys->i_rtp_late )
602             break;
603
604         p = BlockParseRTP( p_access, BlockUDP( p_access ) );
605         if( !p && (i_date - i_first) > p_sys->i_rtp_late )
606         {
607             msg_Err( p_access, "error in RTP prebuffering!" );
608             break;
609         }
610     }
611
612     msg_Dbg( p_access, "RTP: prebuffered %d packets", i_count - 1 );
613     p_access->info.b_prebuffered = VLC_TRUE;
614     p = p_sys->p_list;
615     p_sys->p_list = p_sys->p_list->p_next;
616     p_sys->i_last_seqno = (uint16_t) p->i_dts;
617     p->p_next = NULL;
618     return p;
619 }
620
621 static block_t *BlockRTP( access_t *p_access )
622 {
623     access_sys_t *p_sys = p_access->p_sys;
624     block_t *p;
625
626     while ( !p_sys->p_list ||
627              ( mdate() - p_sys->p_list->i_pts ) < p_sys->i_rtp_late )
628     {
629         p = BlockParseRTP( p_access,
630                            p_sys->b_framed_rtp ? BlockTCP( p_access )
631                                                : BlockUDP( p_access ) );
632         if ( !p )
633             return NULL;
634
635         rtp_ChainInsert( p_access, p );
636     }
637
638     p = p_sys->p_list;
639     p_sys->p_list = p_sys->p_list->p_next;
640     p_sys->i_last_seqno++;
641     if( p_sys->i_last_seqno != (uint16_t) p->i_dts )
642     {
643         msg_Dbg( p_access, "RTP: packet(s) lost, expected %d, got %d",
644                  p_sys->i_last_seqno, (uint16_t) p->i_dts );
645         p_sys->i_last_seqno = (uint16_t) p->i_dts;
646     }
647     p->p_next = NULL;
648     return p;
649 }
650
651 /*****************************************************************************
652  * BlockChoose: decide between RTP and UDP
653  *****************************************************************************/
654 static block_t *BlockChoose( access_t *p_access )
655 {
656     block_t *p_block;
657     int     i_rtp_version;
658     int     i_payload_type;
659
660     if( ( p_block = BlockUDP( p_access ) ) == NULL )
661         return NULL;
662
663     if( p_block->p_buffer[0] == 0x47 )
664     {
665         msg_Dbg( p_access, "detected TS over raw UDP" );
666         p_access->pf_block = BlockUDP;
667         p_access->info.b_prebuffered = VLC_TRUE;
668         return p_block;
669     }
670
671     if( p_block->i_buffer < RTP_HEADER_LEN )
672         return p_block;
673
674     /* Parse the header and make some verifications.
675      * See RFC 3550. */
676
677     i_rtp_version  = p_block->p_buffer[0] >> 6;
678     i_payload_type = ( p_block->p_buffer[1] & 0x7F );
679
680     if( i_rtp_version != 2 )
681     {
682         msg_Dbg( p_access, "no supported RTP header detected" );
683         p_access->pf_block = BlockUDP;
684         p_access->info.b_prebuffered = VLC_TRUE;
685         return p_block;
686     }
687
688     switch( i_payload_type )
689     {
690         case 33:
691             msg_Dbg( p_access, "detected MPEG2 TS over RTP" );
692             p_access->psz_demux = strdup( "ts" );
693             break;
694
695         case 14:
696             msg_Dbg( p_access, "detected MPEG Audio over RTP" );
697             p_access->psz_demux = strdup( "mpga" );
698             break;
699
700         case 32:
701             msg_Dbg( p_access, "detected MPEG Video over RTP" );
702             p_access->psz_demux = strdup( "mpgv" );
703             break;
704
705         default:
706             msg_Dbg( p_access, "no RTP header detected" );
707             p_access->pf_block = BlockUDP;
708             p_access->info.b_prebuffered = VLC_TRUE;
709             return p_block;
710     }
711
712     if( !BlockParseRTP( p_access, p_block )) return NULL;
713
714     p_access->pf_block = BlockRTP;
715
716     return BlockPrebufferRTP( p_access, p_block );
717 }