Browse Source

win-dshow: Add reactivation callback

jpark37 3 years ago
parent
commit
3eb85c548f
1 changed files with 8 additions and 0 deletions
  1. 8 0
      plugins/win-dshow/win-dshow.cpp

+ 8 - 0
plugins/win-dshow/win-dshow.cpp

@@ -278,6 +278,7 @@ struct DShowInput {
 	void OnEncodedAudioData(enum AVCodecID id, unsigned char *data,
 				size_t size, long long ts);
 
+	void OnReactivate();
 	void OnVideoData(const VideoConfig &config, unsigned char *data,
 			 size_t size, long long startTime, long long endTime,
 			 long rotation);
@@ -522,6 +523,11 @@ void DShowInput::OnEncodedVideoData(enum AVCodecID id, unsigned char *data,
 	}
 }
 
+void DShowInput::OnReactivate()
+{
+	SetActive(true);
+}
+
 void DShowInput::OnVideoData(const VideoConfig &config, unsigned char *data,
 			     size_t size, long long startTime,
 			     long long endTime, long rotation)
@@ -958,6 +964,8 @@ bool DShowInput::UpdateVideoConfig(obs_data_t *settings)
 					 placeholders::_1, placeholders::_2,
 					 placeholders::_3, placeholders::_4,
 					 placeholders::_5, placeholders::_6);
+	videoConfig.reactivateCallback =
+		std::bind(&DShowInput::OnReactivate, this);
 
 	videoConfig.format = videoConfig.internalFormat;