2020-03-22 18:00:50 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 2020 Igalia, S.L.
|
|
|
|
* Author: Víctor Jáquez <vjaquez@igalia.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
2021-05-13 08:27:49 +00:00
|
|
|
/**
|
|
|
|
* SECTION:gstvadisplay
|
|
|
|
* @title: GstVaDisplay
|
|
|
|
* @short_description: Generic VADisplay wrapper.
|
|
|
|
* @sources:
|
2022-02-07 16:34:57 +00:00
|
|
|
* - gstva.h
|
2021-05-13 08:27:49 +00:00
|
|
|
* - gstvadisplay.h
|
|
|
|
*
|
|
|
|
* It is a generic wrapper for VADisplay. To create new instances
|
|
|
|
* subclasses are required, depending on the display type to use
|
|
|
|
* (v.gr. DRM, X11, Wayland, etc.).
|
|
|
|
*
|
|
|
|
* The purpose of this class is to be shared among pipelines via
|
|
|
|
* #GstContext so all the VA processing elements will use the same
|
|
|
|
* display entry. Application developers can create their own
|
|
|
|
* subclass, based on their display, and shared it via the synced bus
|
|
|
|
* message for the application.
|
|
|
|
*/
|
|
|
|
|
2020-03-22 18:00:50 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "gstvadisplay.h"
|
2022-03-25 14:56:01 +00:00
|
|
|
|
2023-12-11 19:34:30 +00:00
|
|
|
#include <stdio.h> /* sscanf */
|
2021-05-06 10:23:23 +00:00
|
|
|
#include <va/va.h>
|
2020-03-22 18:00:50 +00:00
|
|
|
|
|
|
|
GST_DEBUG_CATEGORY (gst_va_display_debug);
|
|
|
|
#define GST_CAT_DEFAULT gst_va_display_debug
|
|
|
|
|
|
|
|
typedef struct _GstVaDisplayPrivate GstVaDisplayPrivate;
|
|
|
|
struct _GstVaDisplayPrivate
|
|
|
|
{
|
|
|
|
VADisplay display;
|
|
|
|
|
|
|
|
gboolean foreign;
|
|
|
|
gboolean init;
|
2021-01-04 20:02:35 +00:00
|
|
|
GstVaImplementation impl;
|
2022-03-29 17:49:40 +00:00
|
|
|
gchar *vendor_desc;
|
2023-12-11 19:34:30 +00:00
|
|
|
|
|
|
|
guint driver_major;
|
|
|
|
guint driver_minor;
|
2020-03-22 18:00:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define gst_va_display_parent_class parent_class
|
|
|
|
G_DEFINE_TYPE_WITH_CODE (GstVaDisplay, gst_va_display, GST_TYPE_OBJECT,
|
|
|
|
G_ADD_PRIVATE (GstVaDisplay);
|
|
|
|
GST_DEBUG_CATEGORY_INIT (gst_va_display_debug, "vadisplay", 0,
|
|
|
|
"VA Display"));
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_VA_DISPLAY = 1,
|
2022-03-29 17:49:40 +00:00
|
|
|
PROP_DESC,
|
2020-03-22 18:00:50 +00:00
|
|
|
N_PROPERTIES
|
|
|
|
};
|
|
|
|
|
|
|
|
static GParamSpec *g_properties[N_PROPERTIES];
|
|
|
|
|
|
|
|
#define GET_PRIV(obj) gst_va_display_get_instance_private (GST_VA_DISPLAY (obj))
|
|
|
|
|
2021-01-04 20:02:35 +00:00
|
|
|
static GstVaImplementation
|
|
|
|
_get_implementation (const char *vendor)
|
|
|
|
{
|
|
|
|
if (g_str_has_prefix (vendor, "Mesa Gallium driver"))
|
|
|
|
return GST_VA_IMPLEMENTATION_MESA_GALLIUM;
|
|
|
|
else if (g_str_has_prefix (vendor, "Intel i965 driver"))
|
|
|
|
return GST_VA_IMPLEMENTATION_INTEL_I965;
|
|
|
|
else if (g_str_has_prefix (vendor, "Intel iHD driver"))
|
|
|
|
return GST_VA_IMPLEMENTATION_INTEL_IHD;
|
|
|
|
|
|
|
|
return GST_VA_IMPLEMENTATION_OTHER;
|
|
|
|
}
|
|
|
|
|
2023-03-16 16:50:39 +00:00
|
|
|
static char *
|
|
|
|
_get_desc (const char *vendor, GstVaImplementation impl)
|
|
|
|
{
|
|
|
|
char *end, *start;
|
|
|
|
char desc[1024];
|
|
|
|
size_t size;
|
|
|
|
|
|
|
|
if (impl == GST_VA_IMPLEMENTATION_OTHER)
|
|
|
|
return g_strdup (vendor);
|
|
|
|
|
|
|
|
start = strstr (vendor, "for ");
|
|
|
|
if (!start)
|
|
|
|
return g_strdup (vendor);
|
|
|
|
start += 4;
|
|
|
|
|
|
|
|
switch (impl) {
|
|
|
|
case GST_VA_IMPLEMENTATION_MESA_GALLIUM:
|
|
|
|
end = strchr (start, '(');
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
end = strstr (start, "- ");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!end)
|
|
|
|
return g_strdup (vendor);
|
|
|
|
end -= 1;
|
|
|
|
|
|
|
|
size = MIN (1024, end - start);
|
|
|
|
memcpy (desc, start, size);
|
|
|
|
desc[size] = '\0';
|
|
|
|
return g_strdup (desc);
|
|
|
|
}
|
|
|
|
|
2023-12-11 19:34:30 +00:00
|
|
|
static gboolean
|
|
|
|
_get_driver_version (const char *vendor, GstVaImplementation impl,
|
|
|
|
guint * major, guint * minor)
|
|
|
|
{
|
|
|
|
guint maj, min;
|
|
|
|
|
|
|
|
if (!vendor)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
switch (impl) {
|
|
|
|
case GST_VA_IMPLEMENTATION_MESA_GALLIUM:
|
|
|
|
if (sscanf (vendor, "Mesa Gallium driver %d.%d.", &maj, &min) == 2) {
|
|
|
|
*major = maj;
|
|
|
|
*minor = min;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GST_VA_IMPLEMENTATION_INTEL_IHD:
|
|
|
|
case GST_VA_IMPLEMENTATION_INTEL_I965:{
|
|
|
|
char *end = strstr (vendor, " - ");
|
|
|
|
if (end && sscanf (end, " - %d.%d.", &maj, &min) == 2) {
|
|
|
|
*major = maj;
|
|
|
|
*minor = min;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2020-03-22 18:00:50 +00:00
|
|
|
static gboolean
|
2021-01-04 20:02:35 +00:00
|
|
|
_gst_va_display_filter_driver (GstVaDisplay * self, gpointer foreign_display)
|
2020-03-22 18:00:50 +00:00
|
|
|
{
|
2021-01-04 20:02:35 +00:00
|
|
|
GstVaDisplayPrivate *priv = GET_PRIV (self);
|
|
|
|
VADisplay dpy;
|
|
|
|
const char *vendor;
|
2023-11-07 10:56:20 +00:00
|
|
|
GstVaImplementation impl;
|
2023-12-11 19:34:30 +00:00
|
|
|
guint major, minor;
|
2020-03-22 18:00:50 +00:00
|
|
|
|
2021-01-04 20:02:35 +00:00
|
|
|
g_assert ((foreign_display != NULL) ^ (priv->display != NULL));
|
|
|
|
dpy = foreign_display ? foreign_display : priv->display;
|
|
|
|
|
|
|
|
vendor = vaQueryVendorString (dpy);
|
2020-03-22 18:00:50 +00:00
|
|
|
GST_INFO ("VA-API driver vendor: %s", vendor);
|
|
|
|
|
2023-11-07 10:56:20 +00:00
|
|
|
impl = _get_implementation (vendor);
|
2021-01-04 20:02:35 +00:00
|
|
|
|
|
|
|
if (foreign_display) {
|
|
|
|
priv->display = foreign_display;
|
|
|
|
priv->foreign = TRUE;
|
2023-11-07 10:56:20 +00:00
|
|
|
} else {
|
|
|
|
if (g_getenv ("GST_VA_ALL_DRIVERS") == NULL
|
|
|
|
&& impl == GST_VA_IMPLEMENTATION_OTHER) {
|
|
|
|
GST_WARNING_OBJECT (self, "Unsupported driver: %s", vendor);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2021-01-04 20:02:35 +00:00
|
|
|
}
|
2023-11-07 10:56:20 +00:00
|
|
|
priv->impl = impl;
|
2023-03-16 16:50:39 +00:00
|
|
|
priv->vendor_desc = _get_desc (vendor, priv->impl);
|
2023-12-11 19:34:30 +00:00
|
|
|
if (_get_driver_version (vendor, priv->impl, &major, &minor)) {
|
|
|
|
priv->driver_major = major;
|
|
|
|
priv->driver_minor = minor;
|
|
|
|
}
|
2020-03-22 18:00:50 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_va_display_set_display (GstVaDisplay * self, gpointer display)
|
|
|
|
{
|
|
|
|
GstVaDisplayPrivate *priv = GET_PRIV (self);
|
|
|
|
|
|
|
|
if (!display)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (vaDisplayIsValid (display) == 0) {
|
|
|
|
GST_WARNING_OBJECT (self,
|
|
|
|
"User's VA display is invalid. An internal one will be tried.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* assume driver is already initialized */
|
|
|
|
priv->init = TRUE;
|
2021-01-04 20:02:35 +00:00
|
|
|
|
2023-11-07 10:56:20 +00:00
|
|
|
/* assumed that user knows what's doing so all drivers are allowed */
|
2021-01-04 20:02:35 +00:00
|
|
|
_gst_va_display_filter_driver (self, display);
|
2020-03-22 18:00:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_va_display_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstVaDisplay *self = GST_VA_DISPLAY (object);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case PROP_VA_DISPLAY:{
|
|
|
|
gpointer display = g_value_get_pointer (value);
|
|
|
|
gst_va_display_set_display (self, display);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_va_display_get_property (GObject * object, guint prop_id, GValue * value,
|
|
|
|
GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstVaDisplayPrivate *priv = GET_PRIV (object);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case PROP_VA_DISPLAY:
|
|
|
|
g_value_set_pointer (value, priv->display);
|
|
|
|
break;
|
2022-03-29 17:49:40 +00:00
|
|
|
case PROP_DESC:
|
|
|
|
g_value_set_string (value, priv->vendor_desc);
|
|
|
|
break;
|
2020-03-22 18:00:50 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_va_display_constructed (GObject * object)
|
|
|
|
{
|
|
|
|
GstVaDisplay *self = GST_VA_DISPLAY (object);
|
|
|
|
GstVaDisplayPrivate *priv = GET_PRIV (object);
|
|
|
|
GstVaDisplayClass *klass = GST_VA_DISPLAY_GET_CLASS (object);
|
|
|
|
|
|
|
|
if (!priv->display && klass->create_va_display)
|
|
|
|
priv->display = klass->create_va_display (self);
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->constructed (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_va_display_dispose (GObject * object)
|
|
|
|
{
|
|
|
|
GstVaDisplayPrivate *priv = GET_PRIV (object);
|
|
|
|
|
|
|
|
if (priv->display && !priv->foreign)
|
|
|
|
vaTerminate (priv->display);
|
|
|
|
priv->display = NULL;
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->dispose (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_va_display_finalize (GObject * object)
|
|
|
|
{
|
2022-03-29 17:49:40 +00:00
|
|
|
GstVaDisplayPrivate *priv = GET_PRIV (object);
|
|
|
|
|
|
|
|
g_free (priv->vendor_desc);
|
|
|
|
|
2020-03-22 18:00:50 +00:00
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_va_display_class_init (GstVaDisplayClass * klass)
|
|
|
|
{
|
|
|
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
|
|
|
|
|
|
|
gobject_class->set_property = gst_va_display_set_property;
|
|
|
|
gobject_class->get_property = gst_va_display_get_property;
|
|
|
|
gobject_class->constructed = gst_va_display_constructed;
|
|
|
|
gobject_class->dispose = gst_va_display_dispose;
|
|
|
|
gobject_class->finalize = gst_va_display_finalize;
|
|
|
|
|
|
|
|
g_properties[PROP_VA_DISPLAY] =
|
|
|
|
g_param_spec_pointer ("va-display", "VADisplay", "VA Display handler",
|
|
|
|
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
|
|
|
|
|
2022-03-29 17:49:40 +00:00
|
|
|
g_properties[PROP_DESC] =
|
|
|
|
g_param_spec_string ("description", "Description",
|
|
|
|
"Vendor specific VA implementation description", NULL,
|
|
|
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
|
|
|
|
2020-03-22 18:00:50 +00:00
|
|
|
g_object_class_install_properties (gobject_class, N_PROPERTIES, g_properties);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_va_display_init (GstVaDisplay * self)
|
|
|
|
{
|
|
|
|
GstVaDisplayPrivate *priv = GET_PRIV (self);
|
|
|
|
|
2021-01-04 20:02:35 +00:00
|
|
|
priv->impl = GST_VA_IMPLEMENTATION_INVALID;
|
2020-03-22 18:00:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifndef GST_DISABLE_GST_DEBUG
|
|
|
|
static gchar *
|
|
|
|
_strip_msg (const char *message)
|
|
|
|
{
|
|
|
|
gchar *msg = g_strdup (message);
|
|
|
|
if (!msg)
|
|
|
|
return NULL;
|
|
|
|
return g_strstrip (msg);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_va_warning (gpointer object, const char *message)
|
|
|
|
{
|
|
|
|
GstVaDisplay *self = GST_VA_DISPLAY (object);
|
|
|
|
gchar *msg;
|
|
|
|
|
|
|
|
if ((msg = _strip_msg (message))) {
|
|
|
|
GST_WARNING_OBJECT (self, "VA error: %s", msg);
|
|
|
|
g_free (msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_va_info (gpointer object, const char *message)
|
|
|
|
{
|
|
|
|
GstVaDisplay *self = GST_VA_DISPLAY (object);
|
|
|
|
gchar *msg;
|
|
|
|
|
|
|
|
if ((msg = _strip_msg (message))) {
|
|
|
|
GST_INFO_OBJECT (self, "VA info: %s", msg);
|
|
|
|
g_free (msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_va_display_initialize:
|
|
|
|
* @self: a #GstVaDisplay
|
|
|
|
*
|
|
|
|
* If the display is set by the user (foreign) it is assumed that the
|
|
|
|
* driver is already initialized, thus this function is noop.
|
|
|
|
*
|
|
|
|
* If the display is opened internally, this function will initialize
|
|
|
|
* the driver and it will set driver's message callbacks.
|
|
|
|
*
|
|
|
|
* NOTE: this function is supposed to be private, only used by
|
|
|
|
* GstVaDisplay descendants.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if the VA driver can be initialized; %FALSE
|
|
|
|
* otherwise
|
2021-05-06 10:23:23 +00:00
|
|
|
*
|
|
|
|
* Since: 1.20
|
2020-03-22 18:00:50 +00:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gst_va_display_initialize (GstVaDisplay * self)
|
|
|
|
{
|
|
|
|
GstVaDisplayPrivate *priv;
|
|
|
|
VAStatus status;
|
|
|
|
int major_version = -1, minor_version = -1;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GST_IS_VA_DISPLAY (self), FALSE);
|
|
|
|
|
|
|
|
priv = GET_PRIV (self);
|
|
|
|
|
|
|
|
if (priv->init)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
if (!priv->display)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
#ifndef GST_DISABLE_GST_DEBUG
|
|
|
|
vaSetErrorCallback (priv->display, _va_warning, self);
|
|
|
|
vaSetInfoCallback (priv->display, _va_info, self);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
status = vaInitialize (priv->display, &major_version, &minor_version);
|
|
|
|
if (status != VA_STATUS_SUCCESS) {
|
2022-01-21 09:53:21 +00:00
|
|
|
GST_WARNING_OBJECT (self, "vaInitialize: %s", vaErrorStr (status));
|
2020-03-22 18:00:50 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_INFO_OBJECT (self, "VA-API version %d.%d", major_version, minor_version);
|
|
|
|
|
|
|
|
priv->init = TRUE;
|
|
|
|
|
2021-01-04 20:02:35 +00:00
|
|
|
if (!_gst_va_display_filter_driver (self, NULL))
|
2020-03-22 18:00:50 +00:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2021-05-06 10:23:23 +00:00
|
|
|
/**
|
|
|
|
* gst_va_display_get_va_dpy:
|
|
|
|
* @self: a #GstVaDisplay type display.
|
|
|
|
*
|
|
|
|
* Get the VA display handle of the @self.
|
|
|
|
*
|
|
|
|
* Returns: the VA display handle.
|
|
|
|
*
|
|
|
|
* Since: 1.20
|
|
|
|
*/
|
|
|
|
gpointer
|
2020-03-22 18:00:50 +00:00
|
|
|
gst_va_display_get_va_dpy (GstVaDisplay * self)
|
|
|
|
{
|
|
|
|
VADisplay dpy;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GST_IS_VA_DISPLAY (self), NULL);
|
|
|
|
|
2021-05-06 10:23:23 +00:00
|
|
|
g_object_get (self, "va-display", &dpy, NULL);
|
|
|
|
return dpy;
|
2020-07-27 09:14:02 +00:00
|
|
|
}
|
2021-01-04 20:02:35 +00:00
|
|
|
|
2021-05-06 10:23:23 +00:00
|
|
|
/**
|
|
|
|
* gst_va_display_get_implementation:
|
|
|
|
* @self: a #GstVaDisplay type display.
|
|
|
|
*
|
|
|
|
* Get the the #GstVaImplementation type of @self.
|
|
|
|
*
|
|
|
|
* Returns: #GstVaImplementation.
|
|
|
|
*
|
|
|
|
* Since: 1.20
|
|
|
|
*/
|
2021-01-04 20:02:35 +00:00
|
|
|
GstVaImplementation
|
2021-04-22 15:07:28 +00:00
|
|
|
gst_va_display_get_implementation (GstVaDisplay * self)
|
2021-01-04 20:02:35 +00:00
|
|
|
{
|
|
|
|
GstVaDisplayPrivate *priv;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GST_IS_VA_DISPLAY (self),
|
|
|
|
GST_VA_IMPLEMENTATION_INVALID);
|
|
|
|
|
|
|
|
priv = GET_PRIV (self);
|
|
|
|
return priv->impl;
|
|
|
|
}
|
2023-12-11 19:34:30 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_va_display_check_version:
|
|
|
|
* @self: a #GstVaDisplay
|
|
|
|
* @major: major version to check
|
|
|
|
* @minor: minor version to check
|
|
|
|
*
|
|
|
|
* Returns: whether driver version is equal or greater than @major.@minor
|
|
|
|
*
|
|
|
|
* Since: 1.24
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gst_va_display_check_version (GstVaDisplay * self, guint major, guint minor)
|
|
|
|
{
|
|
|
|
GstVaDisplayPrivate *priv;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GST_IS_VA_DISPLAY (self), FALSE);
|
|
|
|
|
|
|
|
priv = GET_PRIV (self);
|
|
|
|
|
|
|
|
/* if cannot parse the version, all it's valid */
|
|
|
|
if (priv->driver_major == 0 && priv->driver_minor == 0)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
if (priv->driver_major < major)
|
|
|
|
return FALSE;
|
|
|
|
if (priv->driver_minor < minor)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|