From 3a720de8420b5e073dac52c09e80c5f9d2ded4f6 Mon Sep 17 00:00:00 2001 From: clint Date: Mon, 17 Jan 2022 16:02:52 -0500 Subject: [PATCH] Added getSeekFinishedSignal() to GstPlayer. --- include/cinder/linux/GstPlayer.h | 4 ++++ include/cinder/linux/Movie.h | 2 ++ src/cinder/linux/GstPlayer.cpp | 1 + src/cinder/linux/Movie.cpp | 5 +++++ 4 files changed, 12 insertions(+) diff --git a/include/cinder/linux/GstPlayer.h b/include/cinder/linux/GstPlayer.h index e0499b8ecc..8362d03cdc 100644 --- a/include/cinder/linux/GstPlayer.h +++ b/include/cinder/linux/GstPlayer.h @@ -176,6 +176,8 @@ class GstPlayer { ci::gl::Texture2dRef getVideoTexture(); + ci::signals::Signal& getSeekFinishedSignal() { return mSignalSeekFinished; } + private: bool initializeGStreamer(); @@ -234,6 +236,8 @@ class GstPlayer { GLint getTextureID( GstBuffer* newBuffer ); std::atomic mNewFrame; + + ci::signals::Signal mSignalSeekFinished; }; }} // namespace gst::video diff --git a/include/cinder/linux/Movie.h b/include/cinder/linux/Movie.h index f527e08586..f2b866e6a8 100644 --- a/include/cinder/linux/Movie.h +++ b/include/cinder/linux/Movie.h @@ -133,6 +133,8 @@ class MovieBase { signals::Signal& getJumpedSignal() { return mSignalJumped; } signals::Signal& getOutputWasFlushedSignal() { return mSignalOutputWasFlushed; } + signals::Signal& getSeekFinishedSignal(); + protected: MovieBase(); void init(); diff --git a/src/cinder/linux/GstPlayer.cpp b/src/cinder/linux/GstPlayer.cpp index 007e3c5e03..cf2b86b0e0 100644 --- a/src/cinder/linux/GstPlayer.cpp +++ b/src/cinder/linux/GstPlayer.cpp @@ -289,6 +289,7 @@ gboolean checkBusMessagesAsync( GstBus* bus, GstMessage* message, gpointer userD } else { data.isSeeking = false; + data.player->getSeekFinishedSignal().emit(); } } } diff --git a/src/cinder/linux/Movie.cpp b/src/cinder/linux/Movie.cpp index 9965beb056..acc1b53da5 100644 --- a/src/cinder/linux/Movie.cpp +++ b/src/cinder/linux/Movie.cpp @@ -228,6 +228,11 @@ void MovieBase::stop() mGstPlayer->stop(); } +signals::Signal& MovieBase::getSeekFinishedSignal() +{ + return mGstPlayer->getSeekFinishedSignal(); +} + //! \class MovieGl //! //!