.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Net::RTP::Packet 3" .TH Net::RTP::Packet 3 "2008-01-13" "perl v5.8.8" "User Contributed Perl Documentation" .SH "NAME" Net::RTP::Packet \- RTP Packet object (RFC3550) .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Net::RTP::Packet; .Ve .PP .Vb 6 \& my $packet = new Net::RTP::Packet(); \& $packet->payload_type( 10 ); \& $packet->seq_num( 6789 ); \& $packet->timestamp( 76303 ); \& $packet->payload( $audio ); \& $binary = $packet->encode(); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Net::RTP::Packet implements \s-1RTP\s0 packet header encoding and decoding. .IP "$packet = new Net::RTP::Packet( [$binary] )" 4 .IX Item "$packet = new Net::RTP::Packet( [$binary] )" The \fInew()\fR method is the constructor for the \f(CW\*(C`Net::RTP::Packet\*(C'\fR class. The \s-1RTP\s0 version number is initialized to 2. The sequence number, timestamp and \s-1SSRC\s0 are all randomized. .Sp The \f(CW$binary\fR parameter is optional, and is passed to \f(CW\*(C`decode()\*(C'\fR if present. .IP "$packet\->version( [$value] )" 4 .IX Item "$packet->version( [$value] )" Get or set the version number of the \s-1RTP\s0 packet. Only version 2 is currently supported. .IP "$packet\->padding( [$value] )" 4 .IX Item "$packet->padding( [$value] )" Get or set the number of bytes of padding at the end of the \s-1RTP\s0 packet. .IP "$packet\->\fIextension()\fR" 4 .IX Item "$packet->extension()" Returns true if there was an \s-1RTP\s0 header extension present in the packet. It isn't currently possible to get the data of that extension. .IP "$packet\->marker( [$value] )" 4 .IX Item "$packet->marker( [$value] )" Get or set the value of the marker flag in the header. If true, it usually means that this \s-1RTP\s0 packet is the start of a frame boundary. .IP "$packet\->payload_type( [$value] )" 4 .IX Item "$packet->payload_type( [$value] )" Get or set the payload type of the packet. See \f(CW\*(C`http://www.iana.org/assignments/rtp\-parameters\*(C'\fR for the Payload Type values. .IP "$packet\->seq_num( [$value] )" 4 .IX Item "$packet->seq_num( [$value] )" Get or set the sequence number of the packet. The sequence number increments by one for each \s-1RTP\s0 data packet sent, and may be used by the receiver to detect packet loss and to restore packet sequence. .IP "$packet\->seq_num_increment( [$amount] )" 4 .IX Item "$packet->seq_num_increment( [$amount] )" Increment the packet's sequence number by \f(CW$amount\fR. If no amount is specified, then the sequence number is incremented by 1. Returns the packet's new sequence number if successful. .IP "$packet\->timestamp( [$value] )" 4 .IX Item "$packet->timestamp( [$value] )" Get or set the timestamp of the packet. The timestamp reflects the sampling instant of the first octet in the \s-1RTP\s0 data packet. .IP "$packet\->timestamp_increment( [$amount] )" 4 .IX Item "$packet->timestamp_increment( [$amount] )" Increment the packet's timestamp by \f(CW$amount\fR. If no amount is specified, then the timestamp is incremented by 1. Returns the packet's new timestamp if successful. .IP "$packet\->ssrc( [$value] )" 4 .IX Item "$packet->ssrc( [$value] )" Get or set the 32\-bit source identifier of the packet. .IP "$packet\->csrc( [$value] )" 4 .IX Item "$packet->csrc( [$value] )" Get or set an \s-1ARRAYREF\s0 of contributing source identifiers for the packet. .IP "$packet\->payload( [$value] )" 4 .IX Item "$packet->payload( [$value] )" Get or set the payload data for the packet. .IP "$packet\->\fIpayload_size()\fR" 4 .IX Item "$packet->payload_size()" Return the length (in bytes) of the packet's payload. .IP "$packet\->\fIsource_ip()\fR" 4 .IX Item "$packet->source_ip()" Return the source \s-1IP\s0 address of the packet (as an \s-1ASCII\s0 string). If the source \s-1IP\s0 is not known, the value is undefined. .IP "$packet\->\fIsource_port()\fR" 4 .IX Item "$packet->source_port()" Return the source port of the packet (as an \s-1ASCII\s0 string). If the source port is not known, the value is undefined. .IP "$packet\->\fIsize()\fR" 4 .IX Item "$packet->size()" Return the length (in bytes) of the binary \s-1RTP\s0 packet. .Sp Note: The size of the packet is only calculated during \fIencode()\fR and \fIdecode()\fR. .ie n .IP "$packet\->decode( $binary )" 4 .el .IP "$packet\->decode( \f(CW$binary\fR )" 4 .IX Item "$packet->decode( $binary )" Decodes binary \s-1RTP\s0 packet header into the packet object. .ie n .IP "$data = $packet\fR\->\fIendcode()" 4 .el .IP "$data = \f(CW$packet\fR\->\fIendcode()\fR" 4 .IX Item "$data = $packet->endcode()" Encode a packet object into a binary \s-1RTP\s0 packet. .SH "SEE ALSO" .IX Header "SEE ALSO" Net::RTP .PP .SH "BUGS" .IX Header "BUGS" Please report any bugs or feature requests to \&\f(CW\*(C`bug\-net\-rtp@rt.cpan.org\*(C'\fR, or through the web interface at . I will be notified, and then you will automatically be notified of progress on your bug as I make changes. .SH "AUTHOR" .IX Header "AUTHOR" Nicholas J Humfrey, njh@cpan.org .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2006 University of Southampton .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.005 or, at your option, any later version of Perl 5 you may have available.