xmpp-parsers: Convert jingle_rtp_hdrext to xso
This commit is contained in:
parent
0b92061433
commit
5b5df16ac9
1 changed files with 20 additions and 14 deletions
|
|
@ -4,6 +4,10 @@
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
|
use xso::{AsXml, FromXml};
|
||||||
|
|
||||||
|
use crate::ns;
|
||||||
|
|
||||||
generate_attribute!(
|
generate_attribute!(
|
||||||
/// Which party is allowed to send the negotiated RTP Header Extensions.
|
/// Which party is allowed to send the negotiated RTP Header Extensions.
|
||||||
Senders, "senders", {
|
Senders, "senders", {
|
||||||
|
|
@ -18,22 +22,24 @@ generate_attribute!(
|
||||||
}, Default = Both
|
}, Default = Both
|
||||||
);
|
);
|
||||||
|
|
||||||
generate_element!(
|
/// Header extensions to be used in a RTP description.
|
||||||
/// Header extensions to be used in a RTP description.
|
#[derive(FromXml, AsXml, PartialEq, Debug, Clone)]
|
||||||
RtpHdrext, "rtp-hdrext", JINGLE_RTP_HDREXT,
|
#[xml(namespace = ns::JINGLE_RTP_HDREXT, name = "rtp-hdrext")]
|
||||||
attributes: [
|
pub struct RtpHdrext {
|
||||||
/// The ID of the extensions. The allowed values are only in the 1-256, 4096-4351 ranges,
|
/// The ID of the extensions. The allowed values are only in the 1-256, 4096-4351 ranges,
|
||||||
/// this isn’t enforced by xmpp-parsers yet!
|
/// this isn’t enforced by xmpp-parsers yet!
|
||||||
// TODO: make it so.
|
// TODO: make it so.
|
||||||
id: Required<u16> = "id",
|
#[xml(attribute)]
|
||||||
|
pub id: u16,
|
||||||
|
|
||||||
/// The URI that defines the extension.
|
/// The URI that defines the extension.
|
||||||
uri: Required<String> = "uri",
|
#[xml(attribute)]
|
||||||
|
pub uri: String,
|
||||||
|
|
||||||
/// Which party is allowed to send the negotiated RTP Header Extensions.
|
/// Which party is allowed to send the negotiated RTP Header Extensions.
|
||||||
senders: Default<Senders> = "senders",
|
#[xml(attribute(default))]
|
||||||
]
|
pub senders: Senders,
|
||||||
);
|
}
|
||||||
|
|
||||||
impl RtpHdrext {
|
impl RtpHdrext {
|
||||||
/// Create a new RTP header extension element.
|
/// Create a new RTP header extension element.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue