mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-25 13:01:07 +00:00
uriplaylistbin: rely on new uridecodebin3 gapless logic
uridecodebin3 can now properly handle gapless switches so use that instead of our own very complicated logic. Fix #268 Fix #193 Depends on gst 1.23.90 as the plugin requires recent fixes to work properly. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1471>
This commit is contained in:
parent
1e88971ec8
commit
721b7e9c8c
4 changed files with 226 additions and 1262 deletions
13
meson.build
13
meson.build
|
@ -170,6 +170,7 @@ plugins = {
|
|||
'library': 'libgsturiplaylistbin',
|
||||
'examples': ['playlist'],
|
||||
'features': ['clap'],
|
||||
'gst-version': '>=1.23.90',
|
||||
},
|
||||
|
||||
'cdg': {'library': 'libgstcdg'},
|
||||
|
@ -397,6 +398,18 @@ foreach plugin_name, details: plugins
|
|||
endif
|
||||
endforeach
|
||||
endif
|
||||
if details.has_key('gst-version')
|
||||
# Check if we have the required GStreamer version
|
||||
gst_version = details.get('gst-version', '')
|
||||
dep = dependency('gstreamer-1.0', required: false, version: gst_version)
|
||||
if not dep.found()
|
||||
opt = get_option(plugin_name)
|
||||
if opt.enabled()
|
||||
error('Required GStreamer version not found to build ' + plugin_name)
|
||||
endif
|
||||
plugin_deps_found = false
|
||||
endif
|
||||
endif
|
||||
if plugin_deps_found
|
||||
packages += f'gst-plugin-@plugin_name@'
|
||||
features += plugin_features
|
||||
|
|
|
@ -9,7 +9,7 @@ description = "GStreamer Playlist Playback Plugin"
|
|||
rust-version.workspace = true
|
||||
|
||||
[dependencies]
|
||||
gst.workspace = true
|
||||
gst = { workspace = true, features = ["v1_24"] }
|
||||
anyhow = "1"
|
||||
clap = { version = "4", optional = true, features = ["derive"] }
|
||||
thiserror = "1"
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -135,9 +135,21 @@ fn test(
|
|||
break;
|
||||
}
|
||||
// check stream related messages
|
||||
MessageView::StreamCollection(_) | MessageView::StreamsSelected(_) => {
|
||||
MessageView::StreamCollection(sc) => {
|
||||
if let Some(prev) = events.last() {
|
||||
if let MessageView::StreamCollection(prev_sc) = prev.view() {
|
||||
if prev_sc.src() == sc.src()
|
||||
&& prev_sc.stream_collection() == sc.stream_collection()
|
||||
{
|
||||
// decodebin3 may send twice the same collection
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
events.push(msg.clone())
|
||||
}
|
||||
MessageView::StreamsSelected(_) => events.push(msg.clone()),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
@ -174,14 +186,17 @@ fn test(
|
|||
// check stream-collection and streams-selected message ordering
|
||||
let mut events = events.clone().into_iter();
|
||||
|
||||
for _ in 0..playlist_len {
|
||||
for i in 0..playlist_len {
|
||||
let decodebin = assert_stream_collection(events.next().unwrap(), n_streams as usize);
|
||||
if i == 0 {
|
||||
// decodebin3 sends StreamSelected only once, which is ok as the selected stream stays the same
|
||||
assert_eq!(
|
||||
assert_stream_selected(events.next().unwrap(), n_streams as usize),
|
||||
decodebin
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let current_iteration = playlist.property::<u32>("current-iteration");
|
||||
let current_uri_index = playlist.property::<u64>("current-uri-index");
|
||||
|
|
Loading…
Reference in a new issue