static gboolean
gst_d3d11_dxgi_capture_get_size (GstD3D11ScreenCapture * capture,
guint * width, guint * height);
-static gboolean
-gst_d3d11_dxgi_capture_get_colorimetry (GstD3D11ScreenCapture * capture,
- GstVideoColorimetry * colorimetry);
static GstFlowReturn
gst_d3d11_dxgi_capture_do_capture (GstD3D11ScreenCapture * capture,
GstD3D11Device * device, ID3D11Texture2D * texture,
capture_class->prepare = GST_DEBUG_FUNCPTR (gst_d3d11_dxgi_capture_prepare);
capture_class->get_size = GST_DEBUG_FUNCPTR (gst_d3d11_dxgi_capture_get_size);
- capture_class->get_colorimetry =
- GST_DEBUG_FUNCPTR (gst_d3d11_dxgi_capture_get_colorimetry);
capture_class->do_capture =
GST_DEBUG_FUNCPTR (gst_d3d11_dxgi_capture_do_capture);
}
return gst_d3d11_dxgi_capture_get_size_unlocked (self, width, height);
}
-static gboolean
-gst_d3d11_dxgi_capture_get_colorimetry (GstD3D11ScreenCapture * capture,
- GstVideoColorimetry * colorimetry)
-{
- GstD3D11DxgiCapture *self = GST_D3D11_DXGI_CAPTURE (capture);
- DXGI_COLOR_SPACE_TYPE dxgi_cs;
- GstVideoInfo info;
-
- dxgi_cs = DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709;
-
- if (self->output) {
- ComPtr < IDXGIOutput6 > output;
- HRESULT hr;
- DXGI_OUTPUT_DESC1 desc;
-
- hr = self->output->QueryInterface (IID_PPV_ARGS (&output));
- if (SUCCEEDED (hr))
- hr = output->GetDesc1 (&desc);
-
- if (SUCCEEDED (hr))
- dxgi_cs = desc.ColorSpace;
- }
-
- gst_video_info_set_format (&info, GST_VIDEO_FORMAT_BGRA, 16, 16);
- if (gst_video_info_apply_dxgi_color_space (dxgi_cs, &info)) {
- *colorimetry = info.colorimetry;
- return TRUE;
- }
-
- return FALSE;
-}
-
static GstFlowReturn
gst_d3d11_dxgi_capture_do_capture (GstD3D11ScreenCapture * capture,
GstD3D11Device * device, ID3D11Texture2D * texture,
return klass->get_size (capture, width, height);
}
-gboolean
-gst_d3d11_screen_capture_get_colorimetry (GstD3D11ScreenCapture * capture,
- GstVideoColorimetry * colorimetry)
-{
- GstD3D11ScreenCaptureClass *klass;
-
- g_return_val_if_fail (GST_IS_D3D11_SCREEN_CAPTURE (capture), FALSE);
- g_return_val_if_fail (colorimetry != nullptr, FALSE);
-
- klass = GST_D3D11_SCREEN_CAPTURE_GET_CLASS (capture);
- g_assert (klass->get_colorimetry);
-
- return klass->get_colorimetry (capture, colorimetry);
-}
-
gboolean
gst_d3d11_screen_capture_unlock (GstD3D11ScreenCapture * capture)
{
guint * width,
guint * height);
- gboolean (*get_colorimetry) (GstD3D11ScreenCapture * capture,
- GstVideoColorimetry * colorimetry);
-
gboolean (*unlock) (GstD3D11ScreenCapture * capture);
gboolean (*unlock_stop) (GstD3D11ScreenCapture * capture);
guint * width,
guint * height);
-gboolean gst_d3d11_screen_capture_get_colorimetry (GstD3D11ScreenCapture * capture,
- GstVideoColorimetry * colorimetry);
-
gboolean gst_d3d11_screen_capture_unlock (GstD3D11ScreenCapture * capture);
gboolean gst_d3d11_screen_capture_unlock_stop (GstD3D11ScreenCapture * capture);
static GstStaticCaps template_caps =
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES
- (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, "BGRA") ", pixel-aspect-ratio = 1/1;"
- GST_VIDEO_CAPS_MAKE ("BGRA") ", pixel-aspect-ratio = 1/1");
+ (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
+ "BGRA") ", pixel-aspect-ratio = 1/1, colorimetry = (string) sRGB; "
+ GST_VIDEO_CAPS_MAKE ("BGRA") ", pixel-aspect-ratio = 1/1, "
+ "colorimetry = (string) sRGB");
enum
{
static GstStaticCaps template_caps =
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES
- (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, "BGRA") ", pixel-aspect-ratio = 1/1;"
- GST_VIDEO_CAPS_MAKE ("BGRA") ", pixel-aspect-ratio = 1/1");
+ (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY,
+ "BGRA") ", pixel-aspect-ratio = 1/1, colorimetry = (string) sRGB; "
+ GST_VIDEO_CAPS_MAKE ("BGRA") ", pixel-aspect-ratio = 1/1, "
+ "colorimetry = (string) sRGB");
struct _GstD3D11ScreenCaptureSrc
{
GstD3D11ScreenCaptureSrc *self = GST_D3D11_SCREEN_CAPTURE_SRC (bsrc);
GstCaps *caps = NULL;
guint width, height;
- GstVideoColorimetry color;
if (!self->capture) {
GST_DEBUG_OBJECT (self, "capture 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);
gst_d3d11_winrt_capture_get_size (GstD3D11ScreenCapture * capture,
guint * width, guint * height);
static gboolean
-gst_d3d11_winrt_capture_get_colorimetry (GstD3D11ScreenCapture * capture,
- GstVideoColorimetry * colorimetry);
-static gboolean
gst_d3d11_winrt_capture_unlock (GstD3D11ScreenCapture * capture);
static gboolean
gst_d3d11_winrt_capture_unlock_stop (GstD3D11ScreenCapture * capture);
capture_class->prepare = GST_DEBUG_FUNCPTR (gst_d3d11_winrt_capture_prepare);
capture_class->get_size =
GST_DEBUG_FUNCPTR (gst_d3d11_winrt_capture_get_size);
- capture_class->get_colorimetry =
- GST_DEBUG_FUNCPTR (gst_d3d11_winrt_capture_get_colorimetry);
capture_class->unlock = GST_DEBUG_FUNCPTR (gst_d3d11_winrt_capture_unlock);
capture_class->unlock_stop =
GST_DEBUG_FUNCPTR (gst_d3d11_winrt_capture_unlock_stop);
return TRUE;
}
-static gboolean
-gst_d3d11_winrt_capture_get_colorimetry (GstD3D11ScreenCapture * capture,
- GstVideoColorimetry * colorimetry)
-{
- return FALSE;
-}
-
static gboolean
gst_d3d11_winrt_capture_unlock (GstD3D11ScreenCapture * capture)
{