Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions libs/openFrameworks/video/ofGstUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,12 @@ void ofGstUtils::setLoopState(ofLoopType state){
void ofGstUtils::setSpeed(float _speed){
if(_speed == speed) return;

if (updated_in_frame) {
ofLogVerbose("ofGstUtils") << "setSpeed(): prevented multiple changes within a frame";
return;
}
updated_in_frame = true;

GstFormat format = GST_FORMAT_TIME;
GstSeekFlags flags = (GstSeekFlags) (GST_SEEK_FLAG_ACCURATE | GST_SEEK_FLAG_FLUSH);

Expand Down Expand Up @@ -910,6 +916,7 @@ ofTexture * ofGstVideoUtils::getTexture(){

void ofGstVideoUtils::update(){
if (isLoaded()){
updated_in_frame = false;
if(!isFrameByFrame()){
std::unique_lock<std::mutex> lock(mutex);
bHavePixelsChanged = bBackPixelsChanged;
Expand Down
3 changes: 3 additions & 0 deletions libs/openFrameworks/video/ofGstUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ class ofGstUtils{

void setSinkListener(ofGstAppSink * appsink);

bool updated_in_frame { false };

// callbacks to get called from gstreamer
#if GST_VERSION_MAJOR==0
virtual GstFlowReturn preroll_cb(std::shared_ptr<GstBuffer> buffer);
Expand Down Expand Up @@ -112,6 +114,7 @@ class ofGstUtils{
std::mutex eosMutex;
guint busWatchID;


class ofGstMainLoopThread: public ofThread{
public:
ofGstMainLoopThread()
Expand Down