From 7b279b9d6cb9191eb460a91cd5da2c1d9f624d7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 5 Jan 2023 16:39:56 +0200 Subject: [PATCH] gstreamer-app: Assert that GStreamer is initialized before creating instances Part-of: --- gstreamer-app/src/app_sink.rs | 1 + gstreamer-app/src/app_src.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/gstreamer-app/src/app_sink.rs b/gstreamer-app/src/app_sink.rs index 4c4e38f9f..b81e5138a 100644 --- a/gstreamer-app/src/app_sink.rs +++ b/gstreamer-app/src/app_sink.rs @@ -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() } diff --git a/gstreamer-app/src/app_src.rs b/gstreamer-app/src/app_src.rs index 2b04f179c..fd9e0fded 100644 --- a/gstreamer-app/src/app_src.rs +++ b/gstreamer-app/src/app_src.rs @@ -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() }