guint cached_height;
D3D11DesktopDupObject *dupl_obj;
+ IDXGIOutput *output;
HMONITOR monitor_handle;
RECT desktop_coordinates;
g_object_get (self->device, "adapter-luid", &self->adapter_luid, nullptr);
+ self->output = output.Detach ();
+
ret = TRUE;
out:
{
GstD3D11ScreenCapture *self = GST_D3D11_SCREEN_CAPTURE (object);
+ GST_D3D11_CLEAR_COM (self->output);
+
if (self->dupl_obj) {
delete self->dupl_obj;
self->dupl_obj = nullptr;
return TRUE;
}
+gboolean
+gst_d3d11_screen_capture_get_colorimetry (GstD3D11ScreenCapture * capture,
+ GstVideoColorimetry * colorimetry)
+{
+ DXGI_COLOR_SPACE_TYPE dxgi_cs;
+
+ g_return_val_if_fail (GST_IS_D3D11_SCREEN_CAPTURE (capture), FALSE);
+ g_return_val_if_fail (colorimetry != nullptr, FALSE);
+
+ dxgi_cs = DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709;
+
+ if (capture->output) {
+ ComPtr < IDXGIOutput6 > output;
+ HRESULT hr;
+ DXGI_OUTPUT_DESC1 desc;
+
+ hr = capture->output->QueryInterface (IID_PPV_ARGS (&output));
+ if (SUCCEEDED (hr))
+ hr = output->GetDesc1 (&desc);
+
+ if (SUCCEEDED (hr))
+ dxgi_cs = desc.ColorSpace;
+ }
+
+ return gst_d3d11_colorimetry_from_dxgi_color_space (dxgi_cs, colorimetry);
+}
+
GstFlowReturn
gst_d3d11_screen_capture_do_capture (GstD3D11ScreenCapture * capture,
GstD3D11Device * device, ID3D11Texture2D * texture,
guint * width,
guint * height);
+gboolean gst_d3d11_screen_capture_get_colorimetry (GstD3D11ScreenCapture * capture,
+ GstVideoColorimetry * colorimetry);
+
GstFlowReturn gst_d3d11_screen_capture_do_capture (GstD3D11ScreenCapture * capture,
GstD3D11Device * device,
ID3D11Texture2D * texture,
GstD3D11ScreenCaptureSrc *self = GST_D3D11_SCREEN_CAPTURE_SRC (bsrc);
GstCaps *caps = NULL;
guint width, height;
+ GstVideoColorimetry color;
if (!self->capture) {
GST_DEBUG_OBJECT (self, "Duplication object is not configured yet");
gst_caps_set_simple (caps, "width", G_TYPE_INT, width, "height",
G_TYPE_INT, height, nullptr);
+ if (gst_d3d11_screen_capture_get_colorimetry (self->capture, &color)) {
+ gchar *color_str = gst_video_colorimetry_to_string (&color);
+
+ if (color_str) {
+ gst_caps_set_simple (caps, "colorimetry", G_TYPE_STRING, color_str,
+ nullptr);
+ g_free (color_str);
+ }
+ }
+
if (filter) {
GstCaps *tmp =
gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST);