Skip to content

Commit 2ecf9ec

Browse files
committed
Fix StillImage not refreshing when loading a different image.
1 parent a646b18 commit 2ecf9ec

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

SerialPrograms/Source/CommonFramework/VideoPipeline/VideoSession.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ void VideoSession::set_source(const std::shared_ptr<VideoSourceDescriptor>& devi
123123
m_logger.log("Changing video...", COLOR_GREEN);
124124
dispatch_to_main_thread([this, device]{
125125
std::lock_guard<std::mutex> lg0(m_reset_lock);
126-
if (*m_descriptor == *device){
126+
if (*m_descriptor == *device && !m_descriptor->should_reload()){
127127
return;
128128
}
129129

SerialPrograms/Source/CommonFramework/VideoPipeline/VideoSourceDescriptor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class VideoSourceDescriptor{
3838
virtual ~VideoSourceDescriptor() = default;
3939

4040
public:
41+
virtual bool should_reload() const{ return false; }
4142
virtual bool operator==(const VideoSourceDescriptor& x) const = 0;
4243
virtual std::string display_name() const = 0;
4344

SerialPrograms/Source/CommonFramework/VideoPipeline/VideoSources/VideoSource_StillImage.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class VideoSourceDescriptor_StillImage : public VideoSourceDescriptor{
3636
// Otherwise, return 0.
3737
size_t source_image_height() const{return m_source_image_height;}
3838

39+
virtual bool should_reload() const override{ return true; }
3940
virtual bool operator==(const VideoSourceDescriptor& x) const override;
4041
virtual std::string display_name() const override{
4142
return "Display Image";

0 commit comments

Comments
 (0)