Explorar o código

linux-pipewire: Support colour format GS_R10G10B10A2

PipeWire supports 10bit colour formats with little endian order.

Adding two new formats required increasing the buffer size for building
PipeWire buffers.

This formats are supported since PipeWire 0.3.41. To allow building
against
older PipeWire versions we will hide those formats. Complications when
running on a host with an older PipeWire version are not expected, since
format negotiation is only done via the numerical values.
columbarius %!s(int64=4) %!d(string=hai) anos
pai
achega
155fb8ad8f
Modificáronse 1 ficheiros con 20 adicións e 2 borrados
  1. 20 2
      plugins/linux-pipewire/pipewire.c

+ 20 - 2
plugins/linux-pipewire/pipewire.c

@@ -291,6 +291,24 @@ static const struct {
 		true,
 		"XBGR8888",
 	},
+#if PW_CHECK_VERSION(0, 3, 41)
+	{
+		SPA_VIDEO_FORMAT_ABGR_210LE,
+		DRM_FORMAT_ABGR2101010,
+		GS_R10G10B10A2,
+		false,
+		"ABGR2101010",
+
+	},
+	{
+		SPA_VIDEO_FORMAT_xBGR_210LE,
+		DRM_FORMAT_XBGR2101010,
+		GS_R10G10B10A2,
+		false,
+		"XBGR2101010",
+
+	},
+#endif
 };
 
 #define N_SUPPORTED_FORMATS \
@@ -526,7 +544,7 @@ static void renegotiate_format(void *data, uint64_t expirations)
 
 	pw_thread_loop_lock(obs_pw->thread_loop);
 
-	uint8_t params_buffer[2048];
+	uint8_t params_buffer[4096];
 	struct spa_pod_builder pod_builder =
 		SPA_POD_BUILDER_INIT(params_buffer, sizeof(params_buffer));
 	uint32_t n_params;
@@ -980,7 +998,7 @@ void obs_pipewire_connect_stream(obs_pipewire *obs_pw, int pipewire_node,
 	struct spa_pod_builder pod_builder;
 	const struct spa_pod **params = NULL;
 	uint32_t n_params;
-	uint8_t params_buffer[2048];
+	uint8_t params_buffer[4096];
 
 	pw_thread_loop_lock(obs_pw->thread_loop);