jingle_rtp: Add constructors.
This commit is contained in:
parent
5338cd6599
commit
d654b1bd30
1 changed files with 26 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue