Prechádzať zdrojové kódy

image-source: Add JXR HDR support to slide show

Only supported on Windows.
jpark37 3 rokov pred
rodič
commit
e583e86b35
1 zmenil súbory, kde vykonal 28 pridanie a 3 odobranie
  1. 28 3
      plugins/image-source/obs-slideshow.c

+ 28 - 3
plugins/image-source/obs-slideshow.c

@@ -241,7 +241,11 @@ static bool valid_extension(const char *ext)
 		return false;
 		return false;
 	return astrcmpi(ext, ".bmp") == 0 || astrcmpi(ext, ".tga") == 0 ||
 	return astrcmpi(ext, ".bmp") == 0 || astrcmpi(ext, ".tga") == 0 ||
 	       astrcmpi(ext, ".png") == 0 || astrcmpi(ext, ".jpeg") == 0 ||
 	       astrcmpi(ext, ".png") == 0 || astrcmpi(ext, ".jpeg") == 0 ||
-	       astrcmpi(ext, ".jpg") == 0 || astrcmpi(ext, ".gif") == 0;
+	       astrcmpi(ext, ".jpg") == 0 ||
+#ifdef _WIN32
+	       astrcmpi(ext, ".jxr") == 0 ||
+#endif
+	       astrcmpi(ext, ".gif") == 0;
 }
 }
 
 
 static inline bool item_valid(struct slideshow *ss)
 static inline bool item_valid(struct slideshow *ss)
@@ -845,8 +849,11 @@ static void ss_defaults(obs_data_t *settings)
 	obs_data_set_default_bool(settings, S_LOOP, true);
 	obs_data_set_default_bool(settings, S_LOOP, true);
 }
 }
 
 
-static const char *file_filter =
-	"Image files (*.bmp *.tga *.png *.jpeg *.jpg *.gif *.webp)";
+static const char *file_filter = "Image files (*.bmp *.tga *.png *.jpeg *.jpg"
+#ifdef _WIN32
+				 " *.jxr"
+#endif
+				 " *.gif *.webp)";
 
 
 static const char *aspects[] = {"16:9", "16:10", "4:3", "1:1"};
 static const char *aspects[] = {"16:9", "16:10", "4:3", "1:1"};
 
 
@@ -1026,6 +1033,23 @@ static obs_missing_files_t *ss_missingfiles(void *data)
 	return missing_files;
 	return missing_files;
 }
 }
 
 
+static enum gs_color_space
+ss_video_get_color_space(void *data, size_t count,
+			 const enum gs_color_space *preferred_spaces)
+{
+	enum gs_color_space space = GS_CS_SRGB;
+
+	struct slideshow *ss = data;
+	obs_source_t *transition = get_transition(ss);
+	if (transition) {
+		space = obs_source_get_color_space(transition, count,
+						   preferred_spaces);
+		obs_source_release(transition);
+	}
+
+	return space;
+}
+
 struct obs_source_info slideshow_info = {
 struct obs_source_info slideshow_info = {
 	.id = "slideshow",
 	.id = "slideshow",
 	.type = OBS_SOURCE_TYPE_INPUT,
 	.type = OBS_SOURCE_TYPE_INPUT,
@@ -1053,4 +1077,5 @@ struct obs_source_info slideshow_info = {
 	.media_next = ss_next_slide,
 	.media_next = ss_next_slide,
 	.media_previous = ss_previous_slide,
 	.media_previous = ss_previous_slide,
 	.media_get_state = ss_get_state,
 	.media_get_state = ss_get_state,
+	.video_get_color_space = ss_video_get_color_space,
 };
 };