diff --git a/src/jingle_rtp.rs b/src/jingle_rtp.rs index 5e686ca9..7e5557b2 100644 --- a/src/jingle_rtp.rs +++ b/src/jingle_rtp.rs @@ -24,6 +24,17 @@ generate_element!( ] ); +impl Description { + /// Create a new RTP description. + pub fn new(media: String) -> Description { + Description { + media, + ssrc: None, + payload_types: Vec::new(), + } + } +} + generate_attribute!( /// The number of channels. Channels, "channels", u8, Default = 1 @@ -59,6 +70,21 @@ generate_element!( ] ); +impl PayloadType { + /// Create a new RTP payload-type. + pub fn new(id: u8, name: String) -> PayloadType { + PayloadType { + channels: Default::default(), + clockrate: None, + id, + maxptime: None, + name: Some(name), + ptime: None, + parameters: Vec::new(), + } + } +} + generate_element!( /// Parameter related to a payload. Parameter, "parameter", JINGLE_RTP,