d3d11screencapturesrc: Specify PAR 1/1 to template caps
authorSeungha Yang <seungha@centricular.com>
Tue, 8 Nov 2022 10:26:39 +0000 (19:26 +0900)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 9 Nov 2022 11:22:06 +0000 (11:22 +0000)
... otherwise PAR can be wrongly signalled during the negotiation

Fixing below pipeline when desktop resolution is not 640x480
gst-launch-1.0.exe \
  d3d11screencapturesrc ! videoscale !
  video/x-raw,width=640,height=480,pixel-aspect-ratio=1/1 ! d3d11videosink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3360>

subprojects/gst-plugins-bad/sys/d3d11/gstd3d11screencapturedevice.cpp
subprojects/gst-plugins-bad/sys/d3d11/gstd3d11screencapturesrc.cpp

index ba3d63b..01a87b2 100644 (file)
@@ -39,8 +39,8 @@ GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_screen_capture_device_debug);
 
 static GstStaticCaps template_caps =
     GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES
-    (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, "BGRA") ";"
-    GST_VIDEO_CAPS_MAKE ("BGRA"));
+    (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, "BGRA") ", pixel-aspect-ratio = 1/1;"
+    GST_VIDEO_CAPS_MAKE ("BGRA") ", pixel-aspect-ratio = 1/1");
 
 enum
 {
index fbeeda2..d1f13d6 100644 (file)
@@ -119,8 +119,8 @@ gst_d3d11_screen_capture_api_get_type (void)
 
 static GstStaticCaps template_caps =
     GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES
-    (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, "BGRA") ";"
-    GST_VIDEO_CAPS_MAKE ("BGRA"));
+    (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, "BGRA") ", pixel-aspect-ratio = 1/1;"
+    GST_VIDEO_CAPS_MAKE ("BGRA") ", pixel-aspect-ratio = 1/1");
 
 struct _GstD3D11ScreenCaptureSrc
 {