Compare commits
19 Commits
path-strok
...
vulkan-err
Author | SHA1 | Date | |
---|---|---|---|
|
805f3bb123 | ||
|
0fcf01ddd5 | ||
|
1119a74ff0 | ||
|
18ea60e235 | ||
|
d752828977 | ||
|
1034271d9a | ||
|
f013d3b5d6 | ||
|
5f41d26abc | ||
|
7d5826ccf7 | ||
|
daded2bc86 | ||
|
bc7619abaf | ||
|
459d6e1349 | ||
|
6e108d310a | ||
|
cf20cfd31e | ||
|
6bd0dc3e78 | ||
|
4f0c920a8e | ||
|
b0b793dd94 | ||
|
efbb649eee | ||
|
90dfb5e138 |
@@ -95,143 +95,7 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GdkVulkanContext, gdk_vulkan_context, GDK_TYPE
|
||||
const char *
|
||||
gdk_vulkan_strerror (VkResult result)
|
||||
{
|
||||
/* If your compiler brought you here with a warning about missing
|
||||
* enumeration values, you're running a newer Vulkan version than
|
||||
* the GTK developers (or you are a GTK developer) and have
|
||||
* encountered a newly added Vulkan error message.
|
||||
* You want to add it to this enum now.
|
||||
*
|
||||
* Because the Vulkan people don't make adding this too easy, here's
|
||||
* the process to manage it:
|
||||
* 1. go to
|
||||
* https://github.com/KhronosGroup/Vulkan-Headers/blob/master/include/vulkan/vulkan_core.h
|
||||
* 2. Find the line where this enum value was added.
|
||||
* 3. Click the commit that added this line.
|
||||
* 4. The commit you're looking at now should also change
|
||||
* VK_HEADER_VERSION, find that number.
|
||||
* 5. Use that number in the #ifdef when adding the enum value to
|
||||
* this enum.
|
||||
* 6. For the error message, look at the specification (the one
|
||||
* that includes all extensions) at
|
||||
* https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkResult
|
||||
* 7. If this value has not been added to the specification yet,
|
||||
* search for the error message in the text of specification.
|
||||
* Often it will have a description that can be used as an error
|
||||
* message.
|
||||
* 8. If that didn't lead to one (or you are lazy), just use the
|
||||
* literal string of the enum value as the error message. A
|
||||
* GTK developer will add the correct one once it's added to the
|
||||
* specification.
|
||||
*/
|
||||
switch (result)
|
||||
{
|
||||
case VK_SUCCESS:
|
||||
return "Command successfully completed.";
|
||||
case VK_NOT_READY:
|
||||
return "A fence or query has not yet completed.";
|
||||
case VK_TIMEOUT:
|
||||
return "A wait operation has not completed in the specified time.";
|
||||
case VK_EVENT_SET:
|
||||
return "An event is signaled.";
|
||||
case VK_EVENT_RESET:
|
||||
return "An event is unsignaled.";
|
||||
case VK_INCOMPLETE:
|
||||
return "A return array was too small for the result.";
|
||||
case VK_SUBOPTIMAL_KHR:
|
||||
return "A swapchain no longer matches the surface properties exactly, but can still be used to present to the surface successfully.";
|
||||
case VK_ERROR_OUT_OF_HOST_MEMORY:
|
||||
return "A host memory allocation has failed.";
|
||||
case VK_ERROR_OUT_OF_DEVICE_MEMORY:
|
||||
return "A device memory allocation has failed.";
|
||||
case VK_ERROR_INITIALIZATION_FAILED:
|
||||
return "Initialization of an object could not be completed for implementation-specific reasons.";
|
||||
case VK_ERROR_DEVICE_LOST:
|
||||
return "The logical or physical device has been lost.";
|
||||
case VK_ERROR_MEMORY_MAP_FAILED:
|
||||
return "Mapping of a memory object has failed.";
|
||||
case VK_ERROR_LAYER_NOT_PRESENT:
|
||||
return "A requested layer is not present or could not be loaded.";
|
||||
case VK_ERROR_EXTENSION_NOT_PRESENT:
|
||||
return "A requested extension is not supported.";
|
||||
case VK_ERROR_FEATURE_NOT_PRESENT:
|
||||
return "A requested feature is not supported.";
|
||||
case VK_ERROR_INCOMPATIBLE_DRIVER:
|
||||
return "The requested version of Vulkan is not supported by the driver or is otherwise incompatible for implementation-specific reasons.";
|
||||
case VK_ERROR_TOO_MANY_OBJECTS:
|
||||
return "Too many objects of the type have already been created.";
|
||||
case VK_ERROR_FORMAT_NOT_SUPPORTED:
|
||||
return "A requested format is not supported on this device.";
|
||||
#if VK_HEADER_VERSION >= 24
|
||||
case VK_ERROR_FRAGMENTED_POOL:
|
||||
return "A requested pool allocation has failed due to fragmentation of the pool’s memory.";
|
||||
#endif
|
||||
case VK_ERROR_SURFACE_LOST_KHR:
|
||||
return "A surface is no longer available.";
|
||||
case VK_ERROR_NATIVE_WINDOW_IN_USE_KHR:
|
||||
return "The requested window is already in use by Vulkan or another API in a manner which prevents it from being used again.";
|
||||
case VK_ERROR_OUT_OF_DATE_KHR:
|
||||
return "A surface has changed in such a way that it is no longer compatible with the swapchain.";
|
||||
case VK_ERROR_INCOMPATIBLE_DISPLAY_KHR:
|
||||
return "The display used by a swapchain does not use the same presentable image layout, or is incompatible in a way that prevents sharing an image.";
|
||||
case VK_ERROR_VALIDATION_FAILED_EXT:
|
||||
return "The application caused the validation layer to fail.";
|
||||
case VK_ERROR_INVALID_SHADER_NV:
|
||||
return "One or more shaders failed to compile or link.";
|
||||
#if VK_HEADER_VERSION >= 39
|
||||
case VK_ERROR_OUT_OF_POOL_MEMORY_KHR:
|
||||
return "A pool memory allocation has failed.";
|
||||
#endif
|
||||
#if VK_HEADER_VERSION >= 54
|
||||
case VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR:
|
||||
return "An external handle is not a valid handle of the specified type.";
|
||||
#endif
|
||||
#if VK_HEADER_VERSION >= 64
|
||||
case VK_ERROR_NOT_PERMITTED_EXT:
|
||||
return "The caller does not have sufficient privileges.";
|
||||
#endif
|
||||
#if VK_HEADER_VERSION >= 72
|
||||
case VK_ERROR_FRAGMENTATION_EXT:
|
||||
return "A descriptor pool creation has failed due to fragmentation";
|
||||
#endif
|
||||
#if VK_HEADER_VERSION >= 89
|
||||
case VK_ERROR_INVALID_DRM_FORMAT_MODIFIER_PLANE_LAYOUT_EXT:
|
||||
return "Invalid DRM format modifier plane layout";
|
||||
#endif
|
||||
#if VK_HEADER_VERSION >= 97
|
||||
case VK_ERROR_INVALID_DEVICE_ADDRESS_EXT:
|
||||
return "Invalid device address";
|
||||
#endif
|
||||
#if VK_HEADER_VERSION >= 105
|
||||
case VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT:
|
||||
return "An operation on a swapchain created with VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT failed as it did not have exclusive full-screen access.";
|
||||
#endif
|
||||
#if VK_HEADER_VERSION >= 131
|
||||
case VK_ERROR_UNKNOWN:
|
||||
return "An unknown error has occurred; either the application has provided invalid input, or an implementation failure has occurred.";
|
||||
#endif
|
||||
#if VK_HEADER_VERSION >= 135
|
||||
#if VK_HEADER_VERSION < 162
|
||||
case VK_ERROR_INCOMPATIBLE_VERSION_KHR:
|
||||
return "This error was removed by the Vulkan gods.";
|
||||
#endif
|
||||
case VK_THREAD_IDLE_KHR:
|
||||
return "A deferred operation is not complete but there is currently no work for this thread to do at the time of this call.";
|
||||
case VK_THREAD_DONE_KHR:
|
||||
return "A deferred operation is not complete but there is no work remaining to assign to additional threads.";
|
||||
case VK_OPERATION_DEFERRED_KHR:
|
||||
return "A deferred operation was requested and at least some of the work was deferred.";
|
||||
case VK_OPERATION_NOT_DEFERRED_KHR:
|
||||
return "A deferred operation was requested and no operations were deferred.";
|
||||
case VK_ERROR_PIPELINE_COMPILE_REQUIRED_EXT:
|
||||
return "A requested pipeline creation would have required compilation, but the application requested compilation to not be performed.";
|
||||
#endif
|
||||
#if VK_HEADER_VERSION < 142
|
||||
case VK_RESULT_RANGE_SIZE:
|
||||
#endif
|
||||
case VK_RESULT_MAX_ENUM:
|
||||
default:
|
||||
return "Unknown Vulkan error.";
|
||||
}
|
||||
return "Unknown Vulkan error.";
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -306,7 +170,7 @@ gdk_vulkan_context_check_swapchain (GdkVulkanContext *context,
|
||||
if (res != VK_SUCCESS)
|
||||
{
|
||||
g_set_error (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_NOT_AVAILABLE,
|
||||
"Could not query surface capabilities: %s", gdk_vulkan_strerror (res));
|
||||
"Could not query surface capabilities: %d", res);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -403,7 +267,7 @@ gdk_vulkan_context_check_swapchain (GdkVulkanContext *context,
|
||||
else
|
||||
{
|
||||
g_set_error (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_NOT_AVAILABLE,
|
||||
"Could not create swapchain for this surface: %s", gdk_vulkan_strerror (res));
|
||||
"Could not create swapchain for this surface: %d", res);
|
||||
priv->swapchain = VK_NULL_HANDLE;
|
||||
return FALSE;
|
||||
}
|
||||
@@ -579,7 +443,7 @@ gdk_vulkan_context_real_init (GInitable *initable,
|
||||
if (res != VK_SUCCESS)
|
||||
{
|
||||
g_set_error (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_NOT_AVAILABLE,
|
||||
"Could not create surface for this surface: %s", gdk_vulkan_strerror (res));
|
||||
"Could not create surface for this surface: %d", res);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -590,7 +454,7 @@ gdk_vulkan_context_real_init (GInitable *initable,
|
||||
if (res != VK_SUCCESS)
|
||||
{
|
||||
g_set_error (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_NOT_AVAILABLE,
|
||||
"Could not check if queue family supports this surface: %s", gdk_vulkan_strerror (res));
|
||||
"Could not check if queue family supports this surface: %d", res);
|
||||
}
|
||||
else if (!supported)
|
||||
{
|
||||
@@ -1118,7 +982,7 @@ gdk_display_create_vulkan_instance (GdkDisplay *display,
|
||||
if (res != VK_SUCCESS)
|
||||
{
|
||||
g_set_error (error, GDK_VULKAN_ERROR, GDK_VULKAN_ERROR_UNSUPPORTED,
|
||||
"Could not create a Vulkan instance: %s", gdk_vulkan_strerror (res));
|
||||
"Could not create a Vulkan instance: %d", res);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@@ -52,7 +52,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellRendererText, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellRendererToggle, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellView, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCheckButton, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkClipboard, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkColorButton, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkColorChooser, g_object_unref)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkColorChooserDialog, g_object_unref)
|
||||
|
@@ -58,8 +58,15 @@
|
||||
*
|
||||
* # CSS nodes
|
||||
*
|
||||
* GtkColorButton has a single CSS node with name button. To differentiate
|
||||
* it from a plain #GtkButton, it gets the .color style class.
|
||||
* |[<!-- language="plain" -->
|
||||
* colorbutton
|
||||
* ╰── button.color
|
||||
* ╰── [content]
|
||||
*]|
|
||||
*
|
||||
* GtkColorButton has a single CSS node with name colorbutton which
|
||||
* contains a button node. To differentiate it from a plain #GtkButton,
|
||||
* it gets the .color style class.
|
||||
*/
|
||||
|
||||
typedef struct _GtkColorButtonClass GtkColorButtonClass;
|
||||
|
@@ -59,7 +59,14 @@
|
||||
*
|
||||
* # CSS nodes
|
||||
*
|
||||
* GtkFontButton has a single CSS node with name fontbutton.
|
||||
* |[<!-- language="plain" -->
|
||||
* fontbutton
|
||||
* ╰── button.font
|
||||
* ╰── [content]
|
||||
*]|
|
||||
*
|
||||
* GtkFontButton has a single CSS node with name fontbutton which
|
||||
* contains a button node with the .font style class.
|
||||
*/
|
||||
|
||||
typedef struct _GtkFontButtonClass GtkFontButtonClass;
|
||||
|
@@ -35,6 +35,7 @@
|
||||
#include "gtkintl.h"
|
||||
#include "gtkmarshalers.h"
|
||||
#include "gtkmain.h"
|
||||
#include "gtknative.h"
|
||||
|
||||
G_DEFINE_TYPE (GtkGestureStylus, gtk_gesture_stylus, GTK_TYPE_GESTURE_SINGLE)
|
||||
|
||||
@@ -319,6 +320,8 @@ gtk_gesture_stylus_get_backlog (GtkGestureStylus *gesture,
|
||||
GArray *backlog_array;
|
||||
GdkTimeCoord *history = NULL;
|
||||
guint n_coords = 0, i;
|
||||
double surf_x, surf_y;
|
||||
GtkNative *native;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_GESTURE_STYLUS (gesture), FALSE);
|
||||
g_return_val_if_fail (backlog != NULL && n_elems != NULL, FALSE);
|
||||
@@ -331,6 +334,9 @@ gtk_gesture_stylus_get_backlog (GtkGestureStylus *gesture,
|
||||
if (!history)
|
||||
return FALSE;
|
||||
|
||||
native = gtk_widget_get_native (gtk_get_event_widget (event));
|
||||
gtk_native_get_surface_transform (native, &surf_x, &surf_y);
|
||||
|
||||
backlog_array = g_array_new (FALSE, FALSE, sizeof (GdkTimeCoord));
|
||||
for (i = 0; i < n_coords; i++)
|
||||
{
|
||||
@@ -339,10 +345,11 @@ gtk_gesture_stylus_get_backlog (GtkGestureStylus *gesture,
|
||||
|
||||
g_array_append_val (backlog_array, *time_coord);
|
||||
time_coord = &g_array_index (backlog_array, GdkTimeCoord, backlog_array->len - 1);
|
||||
if (gtk_widget_compute_point (gtk_get_event_widget (event),
|
||||
|
||||
if (gtk_widget_compute_point (GTK_WIDGET (native),
|
||||
gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (gesture)),
|
||||
&GRAPHENE_POINT_INIT (time_coord->axes[GDK_AXIS_X],
|
||||
time_coord->axes[GDK_AXIS_Y]),
|
||||
&GRAPHENE_POINT_INIT (time_coord->axes[GDK_AXIS_X] - surf_x,
|
||||
time_coord->axes[GDK_AXIS_Y] - surf_y),
|
||||
&p))
|
||||
{
|
||||
time_coord->axes[GDK_AXIS_X] = p.x;
|
||||
|
@@ -104,8 +104,14 @@
|
||||
*
|
||||
* # CSS nodes
|
||||
*
|
||||
* GtkMenuButton has a single CSS node with name button. To differentiate
|
||||
* it from a plain #GtkButton, it gets the .popup style class.
|
||||
* |[<!-- language="plain" -->
|
||||
* menubutton
|
||||
* ╰── button.toggle
|
||||
* ╰── [content]
|
||||
*]|
|
||||
*
|
||||
* GtkMenuButton has a single CSS node with name menubutton
|
||||
* which contains a toggle button node.
|
||||
*
|
||||
* # Accessibility
|
||||
*
|
||||
|
@@ -489,7 +489,7 @@ update_node_name (GtkModelButton *self)
|
||||
{
|
||||
case GTK_BUTTON_ROLE_TITLE:
|
||||
start_name = "arrow";
|
||||
end_name = NULL;
|
||||
end_name = "";
|
||||
break;
|
||||
case GTK_BUTTON_ROLE_NORMAL:
|
||||
start_name = NULL;
|
||||
|
@@ -37,7 +37,6 @@ typedef struct _GtkAdjustment GtkAdjustment;
|
||||
typedef struct _GtkBitset GtkBitset;
|
||||
typedef struct _GtkBuilder GtkBuilder;
|
||||
typedef struct _GtkBuilderScope GtkBuilderScope;
|
||||
typedef struct _GtkClipboard GtkClipboard;
|
||||
typedef struct _GtkCssStyleChange GtkCssStyleChange;
|
||||
typedef struct _GtkEventController GtkEventController;
|
||||
typedef struct _GtkGesture GtkGesture;
|
||||
|
@@ -723,7 +723,7 @@ if cairogobj_pkg_found
|
||||
endif
|
||||
|
||||
if vulkan_pkg_found
|
||||
gdk_packages += 'vulkan'
|
||||
gdk_packages += ' vulkan'
|
||||
endif
|
||||
|
||||
pkgconf.set('GDK_PACKAGES', gdk_packages)
|
||||
|
@@ -25,11 +25,14 @@
|
||||
|
||||
#include <gst/player/gstplayer-video-renderer.h>
|
||||
|
||||
#include <math.h>
|
||||
|
||||
struct _GtkGstPaintable
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
GdkPaintable *image;
|
||||
double pixel_aspect_ratio;
|
||||
};
|
||||
|
||||
struct _GtkGstPaintableClass
|
||||
@@ -66,7 +69,8 @@ gtk_gst_paintable_paintable_get_intrinsic_width (GdkPaintable *paintable)
|
||||
GtkGstPaintable *self = GTK_GST_PAINTABLE (paintable);
|
||||
|
||||
if (self->image)
|
||||
return gdk_paintable_get_intrinsic_width (self->image);
|
||||
return round (self->pixel_aspect_ratio *
|
||||
gdk_paintable_get_intrinsic_width (self->image));
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -88,7 +92,8 @@ gtk_gst_paintable_paintable_get_intrinsic_aspect_ratio (GdkPaintable *paintable)
|
||||
GtkGstPaintable *self = GTK_GST_PAINTABLE (paintable);
|
||||
|
||||
if (self->image)
|
||||
return gdk_paintable_get_intrinsic_aspect_ratio (self->image);
|
||||
return self->pixel_aspect_ratio *
|
||||
gdk_paintable_get_intrinsic_aspect_ratio (self->image);
|
||||
|
||||
return 0.0;
|
||||
};
|
||||
@@ -157,7 +162,8 @@ gtk_gst_paintable_new (void)
|
||||
|
||||
static void
|
||||
gtk_gst_paintable_set_paintable (GtkGstPaintable *self,
|
||||
GdkPaintable *paintable)
|
||||
GdkPaintable *paintable,
|
||||
double pixel_aspect_ratio)
|
||||
{
|
||||
gboolean size_changed;
|
||||
|
||||
@@ -165,7 +171,8 @@ gtk_gst_paintable_set_paintable (GtkGstPaintable *self,
|
||||
return;
|
||||
|
||||
if (self->image == NULL ||
|
||||
gdk_paintable_get_intrinsic_width (self->image) != gdk_paintable_get_intrinsic_width (paintable) ||
|
||||
self->pixel_aspect_ratio * gdk_paintable_get_intrinsic_width (self->image) !=
|
||||
pixel_aspect_ratio * gdk_paintable_get_intrinsic_width (paintable) ||
|
||||
gdk_paintable_get_intrinsic_height (self->image) != gdk_paintable_get_intrinsic_height (paintable) ||
|
||||
gdk_paintable_get_intrinsic_aspect_ratio (self->image) != gdk_paintable_get_intrinsic_aspect_ratio (paintable))
|
||||
size_changed = TRUE;
|
||||
@@ -173,6 +180,7 @@ gtk_gst_paintable_set_paintable (GtkGstPaintable *self,
|
||||
size_changed = FALSE;
|
||||
|
||||
g_set_object (&self->image, paintable);
|
||||
self->pixel_aspect_ratio = pixel_aspect_ratio;
|
||||
|
||||
if (size_changed)
|
||||
gdk_paintable_invalidate_size (GDK_PAINTABLE (self));
|
||||
@@ -185,6 +193,7 @@ typedef struct _SetTextureInvocation SetTextureInvocation;
|
||||
struct _SetTextureInvocation {
|
||||
GtkGstPaintable *paintable;
|
||||
GdkTexture *texture;
|
||||
double pixel_aspect_ratio;
|
||||
};
|
||||
|
||||
static void
|
||||
@@ -202,20 +211,23 @@ gtk_gst_paintable_set_texture_invoke (gpointer data)
|
||||
SetTextureInvocation *invoke = data;
|
||||
|
||||
gtk_gst_paintable_set_paintable (invoke->paintable,
|
||||
GDK_PAINTABLE (invoke->texture));
|
||||
GDK_PAINTABLE (invoke->texture),
|
||||
invoke->pixel_aspect_ratio);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_gst_paintable_queue_set_texture (GtkGstPaintable *self,
|
||||
GdkTexture *texture)
|
||||
GdkTexture *texture,
|
||||
double pixel_aspect_ratio)
|
||||
{
|
||||
SetTextureInvocation *invoke;
|
||||
|
||||
invoke = g_slice_new0 (SetTextureInvocation);
|
||||
invoke->paintable = g_object_ref (self);
|
||||
invoke->texture = g_object_ref (texture);
|
||||
invoke->pixel_aspect_ratio = pixel_aspect_ratio;
|
||||
|
||||
g_main_context_invoke_full (NULL,
|
||||
G_PRIORITY_DEFAULT,
|
||||
|
@@ -31,7 +31,8 @@ G_DECLARE_FINAL_TYPE (GtkGstPaintable, gtk_gst_paintable, GTK, GST_PAINTABLE, GO
|
||||
GdkPaintable * gtk_gst_paintable_new (void);
|
||||
|
||||
void gtk_gst_paintable_queue_set_texture (GtkGstPaintable *self,
|
||||
GdkTexture *texture);
|
||||
GdkTexture *texture,
|
||||
double pixel_aspect_ratio);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@@ -111,9 +111,17 @@ gtk_gst_memory_format_from_video (GstVideoFormat format)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
video_frame_free (GstVideoFrame *frame)
|
||||
{
|
||||
gst_video_frame_unmap (frame);
|
||||
g_free (frame);
|
||||
}
|
||||
|
||||
static GdkTexture *
|
||||
gtk_gst_sink_texture_from_buffer (GtkGstSink *self,
|
||||
GstBuffer *buffer)
|
||||
GstBuffer *buffer,
|
||||
double *pixel_aspect_ratio)
|
||||
{
|
||||
GstVideoFrame frame;
|
||||
GdkTexture *texture;
|
||||
@@ -124,15 +132,16 @@ gtk_gst_sink_texture_from_buffer (GtkGstSink *self,
|
||||
|
||||
bytes = g_bytes_new_with_free_func (frame.data[0],
|
||||
frame.info.width * frame.info.stride[0],
|
||||
(GDestroyNotify) gst_buffer_unref,
|
||||
gst_buffer_ref (buffer));
|
||||
(GDestroyNotify) video_frame_free,
|
||||
g_memdup (&frame, sizeof (frame)));
|
||||
texture = gdk_memory_texture_new (frame.info.width,
|
||||
frame.info.height,
|
||||
gtk_gst_memory_format_from_video (GST_VIDEO_FRAME_FORMAT (&frame)),
|
||||
bytes,
|
||||
frame.info.stride[0]);
|
||||
g_bytes_unref (bytes);
|
||||
gst_video_frame_unmap (&frame);
|
||||
|
||||
*pixel_aspect_ratio = ((double) frame.info.par_n) / ((double) frame.info.par_d);
|
||||
|
||||
return texture;
|
||||
}
|
||||
@@ -142,6 +151,7 @@ gtk_gst_sink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
|
||||
{
|
||||
GtkGstSink *self;
|
||||
GdkTexture *texture;
|
||||
double pixel_aspect_ratio;
|
||||
|
||||
GST_TRACE ("rendering buffer:%p", buf);
|
||||
|
||||
@@ -149,10 +159,10 @@ gtk_gst_sink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
|
||||
|
||||
GST_OBJECT_LOCK (self);
|
||||
|
||||
texture = gtk_gst_sink_texture_from_buffer (self, buf);
|
||||
texture = gtk_gst_sink_texture_from_buffer (self, buf, &pixel_aspect_ratio);
|
||||
if (texture)
|
||||
{
|
||||
gtk_gst_paintable_queue_set_texture (self->paintable, texture);
|
||||
gtk_gst_paintable_queue_set_texture (self->paintable, texture, pixel_aspect_ratio);
|
||||
g_object_unref (texture);
|
||||
}
|
||||
|
||||
|
@@ -52,7 +52,7 @@ if gstplayer_dep.found()
|
||||
'gtkgstsink.c',
|
||||
],
|
||||
c_args: extra_c_args,
|
||||
dependencies: [ libgtk_dep, gstplayer_dep ],
|
||||
dependencies: [ libm, libgtk_dep, gstplayer_dep ],
|
||||
install_dir: media_install_dir,
|
||||
install: true,
|
||||
)
|
||||
|
2612
po-properties/gl.po
2612
po-properties/gl.po
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user