|
Net::SDP::Media - Media Description in an SDP file |
Net::SDP::Media - Media Description in an SDP file
my $audio = $sdp->new_media_desc( 'audio' );
$audio->address('224.123.234.56');
$audio->port(5004);
$audio->attribute('quality', 5);
This class represents a single Media Description (m=) in an SDP 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 SDP file,
Net::SDP will create an instance of Net::SDP::Media for each media description.
New media descriptions can be created using the new_media_desc() method in Net::SDP.
Example:
$audio = $audio->title();
$audio->title( 'English' );
Example:
$addr = $audio->address();
$audio->address( '224.123.234.56' );
Example:
$addr = $audio->address_type();
$audio->address_type( 'IP6' );
Example:
$port = $audio->port();
$audio->port( 5004 );
Example:
$ttl = $audio->ttl();
$audio->ttl( 127 );
Example:
$media = $audio->media_type();
$audio->media_type( 'audio' );
Example:
$media = $audio->transport(); $audio->transport( 'UDP' );
Example:
$media = $audio->network_type();
$audio->network_type( 'IN' );
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 ARRAYREF. If an attribute does not require it, then the value parameter is optional - eg for 'recvonly' attribute.
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 ARRAYREF is returned.
Example:
$quality = $audio->attribute( 'quality' );
$video->attribute( 'framerate', 10 );
Example:
$hashref = $audio->attributes();
Example:
$audio->add_attribute( 'fmtp', '32 type=mpeg1');
Example:
$audio->remove_format_num( 0 );
Example:
$default = $audio->default_format_num();
$audio->default_format_num( 0 );
Example:
# eg audio/L16/44100/2
$default = $audio->default_format();
Example:
$fmt_list = $audio->format_num_list();
$audio->format_num_list( [0, 8, 10] );
Example:
$audio->add_format( 96, 'audio/L16/22500/1' );
Nicholas J Humfrey, njh@cpan.org
Copyright (C) 2004 University of Southampton
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.
|
Net::SDP::Media - Media Description in an SDP file |