summaryrefslogtreecommitdiff
path: root/sys/d3d11
diff options
context:
space:
mode:
authorSeungha Yang <seungha@centricular.com>2021-07-31 01:05:47 +0900
committerSeungha Yang <seungha@centricular.com>2021-08-02 16:40:19 +0900
commit185d8d1951607b4bb6448f126a4e5d2bd90403a8 (patch)
treef6b6a794ff2172902d8fb001de7e70b8c4e6d35e /sys/d3d11
parent2a7ecf17f9285cdde4b2da57b819a9bb82490c60 (diff)
downloadgstreamer-plugins-bad-185d8d1951607b4bb6448f126a4e5d2bd90403a8.tar.gz
d3d11videosink: Forward navigation event without modification
Current implementation for translating native coordinate and video coordinate is very wrong because d3d11videosink doesn't understand native HWND's coordinate. That should be handled by GstD3D11Window implementation as an enhancement. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2450>
Diffstat (limited to 'sys/d3d11')
-rw-r--r--sys/d3d11/gstd3d11videosink.cpp49
1 files changed, 5 insertions, 44 deletions
diff --git a/sys/d3d11/gstd3d11videosink.cpp b/sys/d3d11/gstd3d11videosink.cpp
index dee6b0fad..0a7615dbc 100644
--- a/sys/d3d11/gstd3d11videosink.cpp
+++ b/sys/d3d11/gstd3d11videosink.cpp
@@ -1270,52 +1270,13 @@ gst_d3d11_video_sink_navigation_send_event (GstNavigation * navigation,
GstStructure * structure)
{
GstD3D11VideoSink *self = GST_D3D11_VIDEO_SINK (navigation);
- gboolean handled = FALSE;
- GstEvent *event = NULL;
- GstVideoRectangle src = { 0, };
- GstVideoRectangle dst = { 0, };
- GstVideoRectangle result;
- gdouble x, y, xscale = 1.0, yscale = 1.0;
+ GstEvent *event = gst_event_new_navigation (structure);
- if (!self->window) {
- gst_structure_free (structure);
- return;
- }
-
- if (self->force_aspect_ratio) {
- /* We get the frame position using the calculated geometry from _setcaps
- that respect pixel aspect ratios */
- src.w = GST_VIDEO_SINK_WIDTH (self);
- src.h = GST_VIDEO_SINK_HEIGHT (self);
- dst.w = self->render_rect.w;
- dst.h = self->render_rect.h;
-
- gst_video_sink_center_rect (src, dst, &result, TRUE);
- result.x += self->render_rect.x;
- result.y += self->render_rect.y;
- } else {
- memcpy (&result, &self->render_rect, sizeof (GstVideoRectangle));
- }
-
- xscale = (gdouble) GST_VIDEO_INFO_WIDTH (&self->info) / result.w;
- yscale = (gdouble) GST_VIDEO_INFO_HEIGHT (&self->info) / result.h;
-
- /* Converting pointer coordinates to the non scaled geometry */
- if (gst_structure_get_double (structure, "pointer_x", &x)) {
- x = MIN (x, result.x + result.w);
- x = MAX (x - result.x, 0);
- gst_structure_set (structure, "pointer_x", G_TYPE_DOUBLE,
- (gdouble) x * xscale, NULL);
- }
- if (gst_structure_get_double (structure, "pointer_y", &y)) {
- y = MIN (y, result.y + result.h);
- y = MAX (y - result.y, 0);
- gst_structure_set (structure, "pointer_y", G_TYPE_DOUBLE,
- (gdouble) y * yscale, NULL);
- }
-
- event = gst_event_new_navigation (structure);
+ /* TODO: add support for translating native coordinate and video coordinate
+ * when force-aspect-ratio is set */
if (event) {
+ gboolean handled;
+
gst_event_ref (event);
handled = gst_pad_push_event (GST_VIDEO_SINK_PAD (self), event);