gstreamer-app: Assert that GStreamer is initialized before creating instances

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1184>
This commit is contained in:
Sebastian Dröge 2023-01-05 16:39:56 +02:00
parent 8d30bcbf4b
commit 7b279b9d6c
2 changed files with 2 additions and 0 deletions

View file

@ -271,6 +271,7 @@ impl AppSink {
///
/// This method returns an instance of [`AppSinkBuilder`](crate::builders::AppSinkBuilder) which can be used to create [`AppSink`] objects.
pub fn builder() -> AppSinkBuilder {
assert_initialized_main_thread!();
AppSinkBuilder::default()
}

View file

@ -216,6 +216,7 @@ impl AppSrc {
///
/// This method returns an instance of [`AppSrcBuilder`](crate::builders::AppSrcBuilder) which can be used to create [`AppSrc`] objects.
pub fn builder() -> AppSrcBuilder {
assert_initialized_main_thread!();
AppSrcBuilder::default()
}