.\" 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::SDP::Media 3" .TH Net::SDP::Media 3 "2008-01-13" "perl v5.8.8" "User Contributed Perl Documentation" .SH "NAME" Net::SDP::Media \- Media Description in an SDP file .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& my $audio = $sdp->new_media_desc( 'audio' ); .Ve .PP .Vb 3 \& $audio->address('224.123.234.56'); \& $audio->port(5004); \& $audio->attribute('quality', 5); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This class represents a single Media Description (m=) in an \s-1SDP\s0 file. As well as the m= line, it also contains the information about all the following lines that make up that media description. When parsing an \s-1SDP\s0 file, \&\f(CW\*(C`Net::SDP\*(C'\fR will create an instance of \f(CW\*(C`Net::SDP::Media\*(C'\fR for each media description. New media descriptions can be created using the \f(CW\*(C`new_media_desc()\*(C'\fR method in \f(CW\*(C`Net::SDP\*(C'\fR. .Sh "\s-1METHODS\s0" .IX Subsection "METHODS" .IP "\fB\f(BItitle()\fB\fR" 4 .IX Item "title()" Get or Set the title for this media description. \fB[i=]\fR .Sp Example: .Sp .Vb 2 \& $audio = $audio->title(); \& $audio->title( 'English' ); .Ve .IP "\fB\f(BIaddress()\fB\fR" 4 .IX Item "address()" Get or Set the connection address for this media description. \fB[c=]\fR .Sp Example: .Sp .Vb 2 \& $addr = $audio->address(); \& $audio->address( '224.123.234.56' ); .Ve .IP "\fB\f(BIaddress_type()\fB\fR" 4 .IX Item "address_type()" Get or Set the connection address type for this media description. Default is \s-1IP4\s0. \fB[c=]\fR .Sp Example: .Sp .Vb 2 \& $addr = $audio->address_type(); \& $audio->address_type( 'IP6' ); .Ve .IP "\fB\f(BIport()\fB\fR" 4 .IX Item "port()" Get or Set the connection port type for this media description. \fB[m=]\fR .Sp Example: .Sp .Vb 2 \& $port = $audio->port(); \& $audio->port( 5004 ); .Ve .IP "\fB\f(BIttl()\fB\fR" 4 .IX Item "ttl()" Get or Set the Time to Live for packets in this media description. \fB[c=]\fR To not specify a \s-1TTL\s0, then set to 0. .Sp Example: .Sp .Vb 2 \& $ttl = $audio->ttl(); \& $audio->ttl( 127 ); .Ve .IP "\fB\f(BImedia_type()\fB\fR" 4 .IX Item "media_type()" Get or Set the media type this media description \- eg audio, video etc. \fB[m=]\fR .Sp Example: .Sp .Vb 2 \& $media = $audio->media_type(); \& $audio->media_type( 'audio' ); .Ve .IP "\fB\f(BItransport()\fB\fR" 4 .IX Item "transport()" Get or Set the transport method for this media description. Default is \s-1RTP/AVP\s0. \fB[m=]\fR .Sp Example: .Sp .Vb 2 \& $media = $audio->transport(); \& $audio->transport( 'UDP' ); .Ve .IP "\fB\f(BInetwork_type()\fB\fR" 4 .IX Item "network_type()" Get or Set the network type for this media description. Default is '\s-1IN\s0' \- Internet. \fB[c=]\fR .Sp Example: .Sp .Vb 2 \& $media = $audio->network_type(); \& $audio->network_type( 'IN' ); .Ve .IP "\fBattribute( name, [value] )\fR" 4 .IX Item "attribute( name, [value] )" Get or Set an attribute for this media description. \fB[a=]\fR .Sp When setting an attribute, if you pass in a scalar, then all attributes with the same name will be replaced. Alternively an attribute may be set to multiple values by passing an \s-1ARRAYREF\s0. If an attribute does not require it, then the value parameter is optional \- eg for 'recvonly' attribute. .Sp When getting an attribute that has no value, then '' is returned, or if the attribute does not exists then undef is returned. If the attribute has a single value, then that value is returned, or if it has more than one value then an \s-1ARRAYREF\s0 is returned. .Sp Example: .Sp .Vb 2 \& $quality = $audio->attribute( 'quality' ); \& $video->attribute( 'framerate', 10 ); .Ve .IP "\fB\f(BIattributes()\fB\fR" 4 .IX Item "attributes()" Get a \s-1HASHREF\s0 of all the attributes associated with this media description \fB[a=]\fR .Sp Example: .Sp .Vb 1 \& $hashref = $audio->attributes(); .Ve .IP "\fBadd_attribute( name, [value] )\fR" 4 .IX Item "add_attribute( name, [value] )" Add a value for sepecified attribute. This method is intended to be used with attributes with multiple values \- ie rtpmap and fmtp \fB[a=]\fR .Sp Example: .Sp .Vb 1 \& $audio->add_attribute( 'fmtp', '32 type=mpeg1'); .Ve .IP "\fBremove_format_num( num )\fR" 4 .IX Item "remove_format_num( num )" Removes the specified format number from the list of payload IDs/formats that are allowed for this media description. \fB[m=]\fR .Sp Example: .Sp .Vb 1 \& $audio->remove_format_num( 0 ); .Ve .IP "\fBdefault_format_num( num )\fR" 4 .IX Item "default_format_num( num )" Gets or Set the default format number/payload \s-1ID\s0 in the list of formats. The format number doesn't need to already be in the list of formats. \fB[m=]\fR .Sp Example: .Sp .Vb 2 \& $default = $audio->default_format_num(); \& $audio->default_format_num( 0 ); .Ve .IP "\fB\f(BIdefault_format()\fB\fR" 4 .IX Item "default_format()" Returns the default format for this media description as a \s-1MIME\s0 type. .Sp Example: .Sp .Vb 2 \& # eg audio/L16/44100/2 \& $default = $audio->default_format(); .Ve .IP "\fB\f(BIformat_num_list()\fB\fR" 4 .IX Item "format_num_list()" Get or Set an \s-1ARRAYREF\s0 containing a list of the format numbers/payload IDs for this media description. \fB[m=]\fR .Sp Example: .Sp .Vb 2 \& $fmt_list = $audio->format_num_list(); \& $audio->format_num_list( [0, 8, 10] ); .Ve .IP "\fB\f(BIformat_list()\fB\fR" 4 .IX Item "format_list()" Returns a \s-1HASHREF\s0 containing format numbers as keys and \s-1MIME\s0 types as values for all the formats allowed by this media description. .IP "\fBadd_format( format_num, [mime_type] )\fR" 4 .IX Item "add_format( format_num, [mime_type] )" Add a format to the list of formats allowed in this media description. The first parameter is the format number/payload \s-1ID\s0 and the second (optional) parameter is the \s-1MIME\s0 type for that format. .Sp Example: .Sp .Vb 1 \& $audio->add_format( 96, 'audio/L16/22500/1' ); .Ve .IP "\fB\f(BIas_string()\fB\fR" 4 .IX Item "as_string()" Returns a textual representation/summary of the media description. .SH "AUTHOR" .IX Header "AUTHOR" Nicholas J Humfrey, njh@cpan.org .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2004 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.