Răsfoiți Sursa

libobs,UI: Swap red/blue render/output channels

Don't need to unswizzle channels for DeckLink output in the future.
jpark37 3 ani în urmă
părinte
comite
a34fae0327
3 a modificat fișierele cu 13 adăugiri și 13 ștergeri
  1. 1 1
      UI/window-basic-main.cpp
  2. 1 1
      libobs/obs-video.c
  3. 11 11
      libobs/obs.c

+ 1 - 1
UI/window-basic-main.cpp

@@ -4346,7 +4346,7 @@ static inline enum video_format GetVideoFormatFromName(const char *name)
 		return VIDEO_FORMAT_UYVY;
 #endif
 	else
-		return VIDEO_FORMAT_RGBA;
+		return VIDEO_FORMAT_BGRA;
 }
 
 static inline enum video_colorspace GetVideoColorSpaceFromName(const char *name)

+ 1 - 1
libobs/obs-video.c

@@ -230,7 +230,7 @@ render_output_texture(struct obs_core_video_mix *mix)
 	gs_effect_t *effect = get_scale_effect(mix, width, height);
 	gs_technique_t *tech;
 
-	if (video_output_get_format(mix->video) == VIDEO_FORMAT_RGBA) {
+	if (video_output_get_format(mix->video) == VIDEO_FORMAT_BGRA) {
 		tech = gs_effect_get_technique(effect, "DrawAlphaDivide");
 	} else {
 		if ((width == video->base_width) &&

+ 11 - 11
libobs/obs.c

@@ -337,6 +337,16 @@ static bool obs_init_textures(struct obs_core_video_mix *video)
 
 	bool success = true;
 
+	enum gs_color_format format = GS_BGRA;
+	switch (info->format) {
+	case VIDEO_FORMAT_I010:
+	case VIDEO_FORMAT_P010:
+	case VIDEO_FORMAT_I210:
+	case VIDEO_FORMAT_I412:
+	case VIDEO_FORMAT_YA2L:
+		format = GS_RGBA16F;
+	}
+
 	for (size_t i = 0; i < NUM_TEXTURES; i++) {
 #ifdef _WIN32
 		if (video->using_nv12_tex) {
@@ -365,7 +375,7 @@ static bool obs_init_textures(struct obs_core_video_mix *video)
 			}
 		} else {
 			video->copy_surfaces[i][0] = gs_stagesurface_create(
-				info->width, info->height, GS_RGBA);
+				info->width, info->height, format);
 			if (!video->copy_surfaces[i][0]) {
 				success = false;
 				break;
@@ -373,16 +383,6 @@ static bool obs_init_textures(struct obs_core_video_mix *video)
 		}
 	}
 
-	enum gs_color_format format = GS_RGBA;
-	switch (info->format) {
-	case VIDEO_FORMAT_I010:
-	case VIDEO_FORMAT_P010:
-	case VIDEO_FORMAT_I210:
-	case VIDEO_FORMAT_I412:
-	case VIDEO_FORMAT_YA2L:
-		format = GS_RGBA16F;
-	}
-
 	enum gs_color_space space = GS_CS_SRGB;
 	switch (info->colorspace) {
 	case VIDEO_CS_2100_PQ: