mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-23 08:06:18 +00:00
whepsrc: Fix incorrect default caps
add-transceiver needs application/x-rtp caps and not raw caps. We were providing raw caps which is incorrect. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1756>
This commit is contained in:
parent
11e5262adb
commit
988c58de43
2 changed files with 33 additions and 18 deletions
|
@ -12848,7 +12848,7 @@
|
||||||
"construct": false,
|
"construct": false,
|
||||||
"construct-only": false,
|
"construct-only": false,
|
||||||
"controllable": false,
|
"controllable": false,
|
||||||
"default": "audio/x-opus",
|
"default": "application/x-rtp, media=(string)audio, encoding-name=(string)OPUS, payload=(int)96, clock-rate=(int)48000",
|
||||||
"mutable": "null",
|
"mutable": "null",
|
||||||
"readable": true,
|
"readable": true,
|
||||||
"type": "GstCaps",
|
"type": "GstCaps",
|
||||||
|
@ -12934,7 +12934,7 @@
|
||||||
"construct": false,
|
"construct": false,
|
||||||
"construct-only": false,
|
"construct-only": false,
|
||||||
"controllable": false,
|
"controllable": false,
|
||||||
"default": "video/x-vp8; video/x-h264; video/x-vp9; video/x-h265; video/x-av1",
|
"default": "application/x-rtp, media=(string)video, payload=(int)101, encoding-name=(string)VP8, clock-rate=(int)90000; application/x-rtp, media=(string)video, payload=(int)102, encoding-name=(string)VP9, clock-rate=(int)90000; application/x-rtp, media=(string)video, payload=(int)103, encoding-name=(string)H264, clock-rate=(int)90000; application/x-rtp, media=(string)video, payload=(int)104, encoding-name=(string)H265, clock-rate=(int)90000; application/x-rtp, media=(string)video, payload=(int)105, encoding-name=(string)AV1, clock-rate=(int)90000",
|
||||||
"mutable": "null",
|
"mutable": "null",
|
||||||
"readable": true,
|
"readable": true,
|
||||||
"type": "GstCaps",
|
"type": "GstCaps",
|
||||||
|
|
|
@ -50,23 +50,38 @@ struct Settings {
|
||||||
#[allow(clippy::derivable_impls)]
|
#[allow(clippy::derivable_impls)]
|
||||||
impl Default for Settings {
|
impl Default for Settings {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
let video_caps = Some(
|
let video_caps = {
|
||||||
[
|
let video = [
|
||||||
"video/x-vp8",
|
("VP8", 101),
|
||||||
"video/x-h264",
|
("VP9", 102),
|
||||||
"video/x-vp9",
|
("H264", 103),
|
||||||
"video/x-h265",
|
("H265", 104),
|
||||||
"video/x-av1",
|
("AV1", 105),
|
||||||
]
|
];
|
||||||
.into_iter()
|
|
||||||
.map(gst::Structure::new_empty)
|
let mut video_caps = gst::Caps::new_empty();
|
||||||
.collect::<gst::Caps>(),
|
let caps = video_caps.get_mut().unwrap();
|
||||||
);
|
|
||||||
|
for (encoding, pt) in video {
|
||||||
|
let s = gst::Structure::builder("application/x-rtp")
|
||||||
|
.field("media", "video")
|
||||||
|
.field("payload", pt)
|
||||||
|
.field("encoding-name", encoding)
|
||||||
|
.field("clock-rate", 90000)
|
||||||
|
.build();
|
||||||
|
caps.append_structure(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
Some(video_caps)
|
||||||
|
};
|
||||||
|
|
||||||
let audio_caps = Some(
|
let audio_caps = Some(
|
||||||
["audio/x-opus"]
|
gst::Caps::builder("application/x-rtp")
|
||||||
.into_iter()
|
.field("media", "audio")
|
||||||
.map(gst::Structure::new_empty)
|
.field("encoding-name", "OPUS")
|
||||||
.collect::<gst::Caps>(),
|
.field("payload", 96)
|
||||||
|
.field("clock-rate", 48000)
|
||||||
|
.build(),
|
||||||
);
|
);
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
|
|
Loading…
Reference in a new issue