mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-29 11:40:38 +00:00
validate: Update for g_type_class_add_private() deprecation in recent GLib
https://gitlab.gnome.org/GNOME/glib/merge_requests/7
This commit is contained in:
parent
6457690e1c
commit
955fc5fcce
11 changed files with 91 additions and 117 deletions
|
@ -39,12 +39,6 @@ typedef struct _SSimWindowCache
|
||||||
gfloat element_summ;
|
gfloat element_summ;
|
||||||
} SSimWindowCache;
|
} SSimWindowCache;
|
||||||
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
PROP_FIRST_PROP = 1,
|
|
||||||
N_PROPS
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _GssimPrivate
|
struct _GssimPrivate
|
||||||
{
|
{
|
||||||
gint width;
|
gint width;
|
||||||
|
@ -67,6 +61,12 @@ struct _GssimPrivate
|
||||||
G_DEFINE_TYPE_WITH_PRIVATE (Gssim, gssim, GST_TYPE_OBJECT)
|
G_DEFINE_TYPE_WITH_PRIVATE (Gssim, gssim, GST_TYPE_OBJECT)
|
||||||
/* *INDENT-ON* */
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
PROP_FIRST_PROP = 1,
|
||||||
|
N_PROPS
|
||||||
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gssim_calculate_mu (Gssim * self, guint8 * buf)
|
gssim_calculate_mu (Gssim * self, guint8 * buf)
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,9 +41,6 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
|
||||||
#define GENERAL_INPUT_ERROR g_quark_from_static_string ("ssim::general-file-error")
|
#define GENERAL_INPUT_ERROR g_quark_from_static_string ("ssim::general-file-error")
|
||||||
#define WRONG_FORMAT g_quark_from_static_string ("ssim::wrong-format")
|
#define WRONG_FORMAT g_quark_from_static_string ("ssim::wrong-format")
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (GstValidateSsim, gst_validate_ssim,
|
|
||||||
GST_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (GST_TYPE_VALIDATE_REPORTER, NULL));
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
PROP_FIRST_PROP = 1,
|
PROP_FIRST_PROP = 1,
|
||||||
|
@ -58,16 +55,7 @@ typedef struct
|
||||||
GstVideoInfo out_info;
|
GstVideoInfo out_info;
|
||||||
} SSimConverterInfo;
|
} SSimConverterInfo;
|
||||||
|
|
||||||
static void
|
struct _GstValidateSsimPrivate
|
||||||
ssim_convert_info_free (SSimConverterInfo * info)
|
|
||||||
{
|
|
||||||
if (info->converter)
|
|
||||||
gst_video_converter_free (info->converter);
|
|
||||||
|
|
||||||
g_slice_free (SSimConverterInfo, info);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct _GstValidateSsimPriv
|
|
||||||
{
|
{
|
||||||
gint width;
|
gint width;
|
||||||
gint height;
|
gint height;
|
||||||
|
@ -85,6 +73,18 @@ struct _GstValidateSsimPriv
|
||||||
GHashTable *ref_frames_cache;
|
GHashTable *ref_frames_cache;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
G_DEFINE_TYPE_WITH_CODE (GstValidateSsim, gst_validate_ssim,
|
||||||
|
GST_TYPE_OBJECT, G_ADD_PRIVATE (GstValidateSsim)
|
||||||
|
G_IMPLEMENT_INTERFACE (GST_TYPE_VALIDATE_REPORTER, NULL));
|
||||||
|
|
||||||
|
static void
|
||||||
|
ssim_convert_info_free (SSimConverterInfo * info)
|
||||||
|
{
|
||||||
|
if (info->converter)
|
||||||
|
gst_video_converter_free (info->converter);
|
||||||
|
|
||||||
|
g_slice_free (SSimConverterInfo, info);
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_validate_ssim_convert (GstValidateSsim * self, SSimConverterInfo * info,
|
gst_validate_ssim_convert (GstValidateSsim * self, SSimConverterInfo * info,
|
||||||
|
@ -945,8 +945,6 @@ gst_validate_ssim_class_init (GstValidateSsimClass * klass)
|
||||||
oclass->dispose = gst_validate_ssim_dispose;
|
oclass->dispose = gst_validate_ssim_dispose;
|
||||||
oclass->finalize = gst_validate_ssim_finalize;
|
oclass->finalize = gst_validate_ssim_finalize;
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (GstValidateSsimPriv));
|
|
||||||
|
|
||||||
g_once (&_once, _register_issues, NULL);
|
g_once (&_once, _register_issues, NULL);
|
||||||
|
|
||||||
g_object_class_install_property (oclass, PROP_RUNNER,
|
g_object_class_install_property (oclass, PROP_RUNNER,
|
||||||
|
@ -959,9 +957,7 @@ gst_validate_ssim_class_init (GstValidateSsimClass * klass)
|
||||||
static void
|
static void
|
||||||
gst_validate_ssim_init (GstValidateSsim * self)
|
gst_validate_ssim_init (GstValidateSsim * self)
|
||||||
{
|
{
|
||||||
self->priv =
|
self->priv = gst_validate_ssim_get_instance_private (self);
|
||||||
G_TYPE_INSTANCE_GET_PRIVATE (self, GST_VALIDATE_SSIM_TYPE,
|
|
||||||
GstValidateSsimPriv);
|
|
||||||
|
|
||||||
self->priv->ssim = gssim_new ();
|
self->priv->ssim = gssim_new ();
|
||||||
self->priv->ref_frames_cache = g_hash_table_new_full (g_str_hash,
|
self->priv->ref_frames_cache = g_hash_table_new_full (g_str_hash,
|
||||||
|
|
|
@ -35,12 +35,12 @@
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
typedef struct _GstValidateSsimPriv GstValidateSsimPriv;
|
typedef struct _GstValidateSsimPrivate GstValidateSsimPrivate;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
GstObject parent;
|
GstObject parent;
|
||||||
|
|
||||||
GstValidateSsimPriv *priv;
|
GstValidateSsimPrivate *priv;
|
||||||
} GstValidateSsim;
|
} GstValidateSsim;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -41,10 +41,7 @@
|
||||||
|
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (GstValidateOverride, gst_validate_override,
|
struct _GstValidateOverridePrivate
|
||||||
GST_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (GST_TYPE_VALIDATE_REPORTER, NULL))
|
|
||||||
|
|
||||||
struct _GstValidateOverridePriv
|
|
||||||
{
|
{
|
||||||
GHashTable *level_override;
|
GHashTable *level_override;
|
||||||
};
|
};
|
||||||
|
@ -56,6 +53,10 @@ enum
|
||||||
PROP_LAST
|
PROP_LAST
|
||||||
};
|
};
|
||||||
|
|
||||||
|
G_DEFINE_TYPE_WITH_CODE (GstValidateOverride, gst_validate_override,
|
||||||
|
GST_TYPE_OBJECT, G_ADD_PRIVATE (GstValidateOverride)
|
||||||
|
G_IMPLEMENT_INTERFACE (GST_TYPE_VALIDATE_REPORTER, NULL))
|
||||||
|
|
||||||
/* *INDENT-ON* */
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -108,8 +109,6 @@ gst_validate_override_class_init (GstValidateOverrideClass * klass)
|
||||||
|
|
||||||
oclass->finalize = gst_validate_override_finalize;
|
oclass->finalize = gst_validate_override_finalize;
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (GstValidateOverridePriv));
|
|
||||||
|
|
||||||
oclass->get_property = _get_property;
|
oclass->get_property = _get_property;
|
||||||
oclass->set_property = _set_property;
|
oclass->set_property = _set_property;
|
||||||
|
|
||||||
|
@ -123,8 +122,7 @@ gst_validate_override_class_init (GstValidateOverrideClass * klass)
|
||||||
static void
|
static void
|
||||||
gst_validate_override_init (GstValidateOverride * self)
|
gst_validate_override_init (GstValidateOverride * self)
|
||||||
{
|
{
|
||||||
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
|
self->priv = gst_validate_override_get_instance_private (self);
|
||||||
GST_TYPE_VALIDATE_OVERRIDE, GstValidateOverridePriv);
|
|
||||||
|
|
||||||
self->priv->level_override = g_hash_table_new (g_direct_hash, g_direct_equal);
|
self->priv->level_override = g_hash_table_new (g_direct_hash, g_direct_equal);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
typedef struct _GstValidateOverride GstValidateOverride;
|
typedef struct _GstValidateOverride GstValidateOverride;
|
||||||
typedef struct _GstValidateOverrideClass GstValidateOverrideClass;
|
typedef struct _GstValidateOverrideClass GstValidateOverrideClass;
|
||||||
typedef struct _GstValidateOverridePriv GstValidateOverridePriv;
|
typedef struct _GstValidateOverridePrivate GstValidateOverridePrivate;
|
||||||
|
|
||||||
|
|
||||||
#include <gst/validate/gst-validate-report.h>
|
#include <gst/validate/gst-validate-report.h>
|
||||||
|
@ -71,7 +71,7 @@ struct _GstValidateOverride
|
||||||
GstValidateOverrideElementAddedHandler element_added_handler;
|
GstValidateOverrideElementAddedHandler element_added_handler;
|
||||||
|
|
||||||
/*<private>*/
|
/*<private>*/
|
||||||
GstValidateOverridePriv *priv;
|
GstValidateOverridePrivate *priv;
|
||||||
};
|
};
|
||||||
|
|
||||||
GST_VALIDATE_API
|
GST_VALIDATE_API
|
||||||
|
|
|
@ -113,7 +113,8 @@ typedef struct _PatternLevel
|
||||||
} G_STMT_END
|
} G_STMT_END
|
||||||
|
|
||||||
#define gst_validate_runner_parent_class parent_class
|
#define gst_validate_runner_parent_class parent_class
|
||||||
G_DEFINE_TYPE (GstValidateRunner, gst_validate_runner, GST_TYPE_TRACER);
|
G_DEFINE_TYPE_WITH_PRIVATE (GstValidateRunner, gst_validate_runner,
|
||||||
|
GST_TYPE_TRACER);
|
||||||
|
|
||||||
/* signals */
|
/* signals */
|
||||||
enum
|
enum
|
||||||
|
@ -413,8 +414,6 @@ gst_validate_runner_class_init (GstValidateRunnerClass * klass)
|
||||||
gobject_class->get_property = gst_validate_runner_get_property;
|
gobject_class->get_property = gst_validate_runner_get_property;
|
||||||
gobject_class->constructor = gst_validate_runner_constructor;
|
gobject_class->constructor = gst_validate_runner_constructor;
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (GstValidateRunnerPrivate));
|
|
||||||
|
|
||||||
properties[PROP_PARAMS] =
|
properties[PROP_PARAMS] =
|
||||||
g_param_spec_string ("params", "Params", "Extra configuration parameters",
|
g_param_spec_string ("params", "Params", "Extra configuration parameters",
|
||||||
NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
|
NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
|
||||||
|
@ -437,9 +436,7 @@ gst_validate_runner_class_init (GstValidateRunnerClass * klass)
|
||||||
static void
|
static void
|
||||||
gst_validate_runner_init (GstValidateRunner * runner)
|
gst_validate_runner_init (GstValidateRunner * runner)
|
||||||
{
|
{
|
||||||
runner->priv = G_TYPE_INSTANCE_GET_PRIVATE (runner, GST_TYPE_VALIDATE_RUNNER,
|
runner->priv = gst_validate_runner_get_instance_private (runner);
|
||||||
GstValidateRunnerPrivate);
|
|
||||||
g_mutex_init (&runner->priv->mutex);
|
|
||||||
|
|
||||||
runner->priv->reports_by_type = g_hash_table_new (g_direct_hash,
|
runner->priv->reports_by_type = g_hash_table_new (g_direct_hash,
|
||||||
g_direct_equal);
|
g_direct_equal);
|
||||||
|
|
|
@ -55,9 +55,6 @@
|
||||||
#include <gst/validate/gst-validate-override-registry.h>
|
#include <gst/validate/gst-validate-override-registry.h>
|
||||||
#include <gst/validate/gst-validate-pipeline-monitor.h>
|
#include <gst/validate/gst-validate-pipeline-monitor.h>
|
||||||
|
|
||||||
#define GST_VALIDATE_SCENARIO_GET_PRIVATE(o) \
|
|
||||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GST_TYPE_VALIDATE_SCENARIO, GstValidateScenarioPrivate))
|
|
||||||
|
|
||||||
#define GST_VALIDATE_SCENARIO_SUFFIX ".scenario"
|
#define GST_VALIDATE_SCENARIO_SUFFIX ".scenario"
|
||||||
#define GST_VALIDATE_SCENARIO_DIRECTORY "scenarios"
|
#define GST_VALIDATE_SCENARIO_DIRECTORY "scenarios"
|
||||||
|
|
||||||
|
@ -222,8 +219,8 @@ _reporter_iface_init (GstValidateReporterInterface * iface)
|
||||||
}
|
}
|
||||||
|
|
||||||
G_DEFINE_TYPE_WITH_CODE (GstValidateScenario, gst_validate_scenario,
|
G_DEFINE_TYPE_WITH_CODE (GstValidateScenario, gst_validate_scenario,
|
||||||
GST_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (GST_TYPE_VALIDATE_REPORTER,
|
GST_TYPE_OBJECT, G_ADD_PRIVATE (GstValidateScenario)
|
||||||
_reporter_iface_init));
|
G_IMPLEMENT_INTERFACE (GST_TYPE_VALIDATE_REPORTER, _reporter_iface_init));
|
||||||
|
|
||||||
/* GstValidateAction implementation */
|
/* GstValidateAction implementation */
|
||||||
static GType _gst_validate_action_type = 0;
|
static GType _gst_validate_action_type = 0;
|
||||||
|
@ -3111,8 +3108,6 @@ gst_validate_scenario_class_init (GstValidateScenarioClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (GstValidateScenarioPrivate));
|
|
||||||
|
|
||||||
object_class->dispose = gst_validate_scenario_dispose;
|
object_class->dispose = gst_validate_scenario_dispose;
|
||||||
object_class->finalize = gst_validate_scenario_finalize;
|
object_class->finalize = gst_validate_scenario_finalize;
|
||||||
|
|
||||||
|
@ -3156,7 +3151,7 @@ static void
|
||||||
gst_validate_scenario_init (GstValidateScenario * scenario)
|
gst_validate_scenario_init (GstValidateScenario * scenario)
|
||||||
{
|
{
|
||||||
GstValidateScenarioPrivate *priv = scenario->priv =
|
GstValidateScenarioPrivate *priv = scenario->priv =
|
||||||
GST_VALIDATE_SCENARIO_GET_PRIVATE (scenario);
|
gst_validate_scenario_get_instance_private (scenario);
|
||||||
|
|
||||||
priv->seek_pos_tol = DEFAULT_SEEK_TOLERANCE;
|
priv->seek_pos_tol = DEFAULT_SEEK_TOLERANCE;
|
||||||
priv->segment_start = 0;
|
priv->segment_start = 0;
|
||||||
|
|
|
@ -22,16 +22,6 @@
|
||||||
#include "media-descriptor-parser.h"
|
#include "media-descriptor-parser.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
G_DEFINE_TYPE (GstValidateMediaDescriptorParser,
|
|
||||||
gst_validate_media_descriptor_parser, GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR);
|
|
||||||
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
PROP_0,
|
|
||||||
PROP_PATH,
|
|
||||||
N_PROPERTIES
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _GstValidateMediaDescriptorParserPrivate
|
struct _GstValidateMediaDescriptorParserPrivate
|
||||||
{
|
{
|
||||||
gchar *xmlpath;
|
gchar *xmlpath;
|
||||||
|
@ -41,6 +31,16 @@ struct _GstValidateMediaDescriptorParserPrivate
|
||||||
GMarkupParseContext *parsecontext;
|
GMarkupParseContext *parsecontext;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
G_DEFINE_TYPE_WITH_PRIVATE (GstValidateMediaDescriptorParser,
|
||||||
|
gst_validate_media_descriptor_parser, GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR);
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
PROP_0,
|
||||||
|
PROP_PATH,
|
||||||
|
N_PROPERTIES
|
||||||
|
};
|
||||||
|
|
||||||
/* Private methods and callbacks */
|
/* Private methods and callbacks */
|
||||||
static gint
|
static gint
|
||||||
compare_frames (GstValidateMediaFrameNode * frm,
|
compare_frames (GstValidateMediaFrameNode * frm,
|
||||||
|
@ -391,9 +391,8 @@ gst_validate_media_descriptor_parser_init (GstValidateMediaDescriptorParser *
|
||||||
{
|
{
|
||||||
GstValidateMediaDescriptorParserPrivate *priv;
|
GstValidateMediaDescriptorParserPrivate *priv;
|
||||||
|
|
||||||
parser->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (parser,
|
parser->priv = priv =
|
||||||
GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR_PARSER,
|
gst_validate_media_descriptor_parser_get_instance_private (parser);
|
||||||
GstValidateMediaDescriptorParserPrivate);
|
|
||||||
|
|
||||||
priv->xmlpath = NULL;
|
priv->xmlpath = NULL;
|
||||||
}
|
}
|
||||||
|
@ -404,8 +403,6 @@ static void
|
||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (self_class);
|
GObjectClass *object_class = G_OBJECT_CLASS (self_class);
|
||||||
|
|
||||||
g_type_class_add_private (self_class,
|
|
||||||
sizeof (GstValidateMediaDescriptorParserPrivate));
|
|
||||||
object_class->dispose = (void (*)(GObject * object)) dispose;
|
object_class->dispose = (void (*)(GObject * object)) dispose;
|
||||||
object_class->finalize = (void (*)(GObject * object)) finalize;
|
object_class->finalize = (void (*)(GObject * object)) finalize;
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
|
|
|
@ -23,7 +23,17 @@
|
||||||
#include "media-descriptor-writer.h"
|
#include "media-descriptor-writer.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
G_DEFINE_TYPE (GstValidateMediaDescriptorWriter,
|
struct _GstValidateMediaDescriptorWriterPrivate
|
||||||
|
{
|
||||||
|
GstElement *pipeline;
|
||||||
|
GstCaps *raw_caps;
|
||||||
|
GMainLoop *loop;
|
||||||
|
|
||||||
|
GList *parsers;
|
||||||
|
GstValidateMediaDescriptorWriterFlags flags;
|
||||||
|
};
|
||||||
|
|
||||||
|
G_DEFINE_TYPE_WITH_PRIVATE (GstValidateMediaDescriptorWriter,
|
||||||
gst_validate_media_descriptor_writer, GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR);
|
gst_validate_media_descriptor_writer, GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR);
|
||||||
|
|
||||||
#define STR_APPEND(arg, nb_white) \
|
#define STR_APPEND(arg, nb_white) \
|
||||||
|
@ -44,16 +54,6 @@ enum
|
||||||
N_PROPERTIES
|
N_PROPERTIES
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstValidateMediaDescriptorWriterPrivate
|
|
||||||
{
|
|
||||||
GstElement *pipeline;
|
|
||||||
GstCaps *raw_caps;
|
|
||||||
GMainLoop *loop;
|
|
||||||
|
|
||||||
GList *parsers;
|
|
||||||
GstValidateMediaDescriptorWriterFlags flags;
|
|
||||||
};
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
finalize (GstValidateMediaDescriptorWriter * writer)
|
finalize (GstValidateMediaDescriptorWriter * writer)
|
||||||
{
|
{
|
||||||
|
@ -95,9 +95,8 @@ gst_validate_media_descriptor_writer_init (GstValidateMediaDescriptorWriter *
|
||||||
GstValidateMediaDescriptorWriterPrivate *priv;
|
GstValidateMediaDescriptorWriterPrivate *priv;
|
||||||
|
|
||||||
|
|
||||||
writer->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (writer,
|
writer->priv = priv =
|
||||||
GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR_WRITER,
|
gst_validate_media_descriptor_writer_get_instance_private (writer);
|
||||||
GstValidateMediaDescriptorWriterPrivate);
|
|
||||||
|
|
||||||
writer->priv->parsers =
|
writer->priv->parsers =
|
||||||
gst_element_factory_list_get_elements (GST_ELEMENT_FACTORY_TYPE_PARSER,
|
gst_element_factory_list_get_elements (GST_ELEMENT_FACTORY_TYPE_PARSER,
|
||||||
|
@ -110,8 +109,6 @@ static void
|
||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (self_class);
|
GObjectClass *object_class = G_OBJECT_CLASS (self_class);
|
||||||
|
|
||||||
g_type_class_add_private (self_class,
|
|
||||||
sizeof (GstValidateMediaDescriptorWriterPrivate));
|
|
||||||
object_class->finalize = (void (*)(GObject * object)) finalize;
|
object_class->finalize = (void (*)(GObject * object)) finalize;
|
||||||
object_class->get_property = get_property;
|
object_class->get_property = get_property;
|
||||||
object_class->set_property = set_property;
|
object_class->set_property = set_property;
|
||||||
|
|
|
@ -23,13 +23,16 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "media-descriptor.h"
|
#include "media-descriptor.h"
|
||||||
|
|
||||||
|
struct _GstValidateMediaDescriptorPrivate
|
||||||
|
{
|
||||||
|
gpointer dummy;
|
||||||
|
};
|
||||||
|
|
||||||
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstValidateMediaDescriptor,
|
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstValidateMediaDescriptor,
|
||||||
gst_validate_media_descriptor, GST_TYPE_OBJECT,
|
gst_validate_media_descriptor, GST_TYPE_OBJECT,
|
||||||
|
G_ADD_PRIVATE (GstValidateMediaDescriptor)
|
||||||
G_IMPLEMENT_INTERFACE (GST_TYPE_VALIDATE_REPORTER, NULL));
|
G_IMPLEMENT_INTERFACE (GST_TYPE_VALIDATE_REPORTER, NULL));
|
||||||
|
|
||||||
#define GST_VALIDATE_MEDIA_DESCRIPTOR_GET_PRIVATE(o)\
|
|
||||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GST_TYPE_VALIDATE_MEDIA_DESCRIPTOR, GstValidateMediaDescriptorPrivate))
|
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
free_tagnode (GstValidateMediaTagNode * tagnode)
|
free_tagnode (GstValidateMediaTagNode * tagnode)
|
||||||
{
|
{
|
||||||
|
@ -125,11 +128,6 @@ gboolean
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct _GstValidateMediaDescriptorPrivate
|
|
||||||
{
|
|
||||||
gpointer dummy;
|
|
||||||
};
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
PROP_0,
|
PROP_0,
|
||||||
|
@ -199,8 +197,6 @@ gst_validate_media_descriptor_class_init (GstValidateMediaDescriptorClass *
|
||||||
{
|
{
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (self_class);
|
GObjectClass *object_class = G_OBJECT_CLASS (self_class);
|
||||||
|
|
||||||
g_type_class_add_private (self_class,
|
|
||||||
sizeof (GstValidateMediaDescriptorPrivate));
|
|
||||||
object_class->dispose =
|
object_class->dispose =
|
||||||
(void (*)(GObject * object)) gst_validate_media_descriptor_dispose;
|
(void (*)(GObject * object)) gst_validate_media_descriptor_dispose;
|
||||||
object_class->finalize =
|
object_class->finalize =
|
||||||
|
|
|
@ -125,13 +125,13 @@
|
||||||
#define SSIM_SAVING_ERROR g_quark_from_static_string ("validatessim::saving-error")
|
#define SSIM_SAVING_ERROR g_quark_from_static_string ("validatessim::saving-error")
|
||||||
#define MONITOR_DATA g_quark_from_static_string ("validate-ssim-monitor-data")
|
#define MONITOR_DATA g_quark_from_static_string ("validate-ssim-monitor-data")
|
||||||
|
|
||||||
typedef struct _ValidateSsimOverridePriv ValidateSsimOverridePriv;
|
typedef struct _ValidateSsimOverridePrivate ValidateSsimOverridePrivate;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
GstValidateOverride parent;
|
GstValidateOverride parent;
|
||||||
|
|
||||||
ValidateSsimOverridePriv *priv;
|
ValidateSsimOverridePrivate *priv;
|
||||||
|
|
||||||
} ValidateSsimOverride;
|
} ValidateSsimOverride;
|
||||||
|
|
||||||
|
@ -154,21 +154,7 @@ free_frame (Frame * frame)
|
||||||
g_free (frame->path);
|
g_free (frame->path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct _ValidateSsimOverridePrivate
|
||||||
static GType validate_ssim_override_get_type (void);
|
|
||||||
|
|
||||||
#define VALIDATE_SSIM_OVERRIDE_TYPE (validate_ssim_override_get_type ())
|
|
||||||
#define VALIDATE_SSIM_OVERRIDE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALIDATE_SSIM_OVERRIDE_TYPE, ValidateSsimOverride))
|
|
||||||
#define VALIDATE_SSIM_OVERRIDE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALIDATE_SSIM_OVERRIDE_TYPE, ValidateSsimOverrideClass))
|
|
||||||
#define IS_VALIDATE_SSIM_OVERRIDE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALIDATE_SSIM_OVERRIDE_TYPE))
|
|
||||||
#define IS_VALIDATE_SSIM_OVERRIDE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALIDATE_SSIM_OVERRIDE_TYPE))
|
|
||||||
#define VALIDATE_SSIM_OVERRIDE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALIDATE_SSIM_OVERRIDE_TYPE, ValidateSsimOverrideClass))
|
|
||||||
|
|
||||||
/* *INDENT-OFF* */
|
|
||||||
G_DEFINE_TYPE (ValidateSsimOverride, validate_ssim_override, GST_TYPE_VALIDATE_OVERRIDE)
|
|
||||||
/* *INDENT-ON* */
|
|
||||||
|
|
||||||
struct _ValidateSsimOverridePriv
|
|
||||||
{
|
{
|
||||||
gchar *outdir;
|
gchar *outdir;
|
||||||
gchar *result_outdir;
|
gchar *result_outdir;
|
||||||
|
@ -193,6 +179,22 @@ struct _ValidateSsimOverridePriv
|
||||||
const gchar *ref_ext;
|
const gchar *ref_ext;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static GType validate_ssim_override_get_type (void);
|
||||||
|
|
||||||
|
#define VALIDATE_SSIM_OVERRIDE_TYPE (validate_ssim_override_get_type ())
|
||||||
|
#define VALIDATE_SSIM_OVERRIDE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALIDATE_SSIM_OVERRIDE_TYPE, ValidateSsimOverride))
|
||||||
|
#define VALIDATE_SSIM_OVERRIDE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALIDATE_SSIM_OVERRIDE_TYPE, ValidateSsimOverrideClass))
|
||||||
|
#define IS_VALIDATE_SSIM_OVERRIDE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALIDATE_SSIM_OVERRIDE_TYPE))
|
||||||
|
#define IS_VALIDATE_SSIM_OVERRIDE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALIDATE_SSIM_OVERRIDE_TYPE))
|
||||||
|
#define VALIDATE_SSIM_OVERRIDE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALIDATE_SSIM_OVERRIDE_TYPE, ValidateSsimOverrideClass))
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
G_DEFINE_TYPE_WITH_PRIVATE (ValidateSsimOverride, validate_ssim_override,
|
||||||
|
GST_TYPE_VALIDATE_OVERRIDE)
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
runner_stopping (GstValidateRunner * runner, ValidateSsimOverride * self)
|
runner_stopping (GstValidateRunner * runner, ValidateSsimOverride * self)
|
||||||
{
|
{
|
||||||
|
@ -413,7 +415,7 @@ fail:
|
||||||
static void
|
static void
|
||||||
_finalize (GObject * object)
|
_finalize (GObject * object)
|
||||||
{
|
{
|
||||||
ValidateSsimOverridePriv *priv = VALIDATE_SSIM_OVERRIDE (object)->priv;
|
ValidateSsimOverridePrivate *priv = VALIDATE_SSIM_OVERRIDE (object)->priv;
|
||||||
|
|
||||||
if (priv->converter)
|
if (priv->converter)
|
||||||
gst_video_converter_free (priv->converter);
|
gst_video_converter_free (priv->converter);
|
||||||
|
@ -458,16 +460,12 @@ validate_ssim_override_class_init (ValidateSsimOverrideClass * klass)
|
||||||
"The ValidateSSim plugin could not save PNG file",
|
"The ValidateSSim plugin could not save PNG file",
|
||||||
"The ValidateSSim plugin could not save PNG file",
|
"The ValidateSSim plugin could not save PNG file",
|
||||||
GST_VALIDATE_REPORT_LEVEL_CRITICAL));
|
GST_VALIDATE_REPORT_LEVEL_CRITICAL));
|
||||||
|
|
||||||
g_type_class_add_private (klass, sizeof (ValidateSsimOverridePriv));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
validate_ssim_override_init (ValidateSsimOverride * self)
|
validate_ssim_override_init (ValidateSsimOverride * self)
|
||||||
{
|
{
|
||||||
self->priv =
|
self->priv = validate_ssim_override_get_instance_private (self);
|
||||||
G_TYPE_INSTANCE_GET_PRIVATE (self, VALIDATE_SSIM_OVERRIDE_TYPE,
|
|
||||||
ValidateSsimOverridePriv);
|
|
||||||
|
|
||||||
self->priv->needs_reconfigure = TRUE;
|
self->priv->needs_reconfigure = TRUE;
|
||||||
self->priv->frames = g_array_new (TRUE, TRUE, sizeof (Frame));
|
self->priv->frames = g_array_new (TRUE, TRUE, sizeof (Frame));
|
||||||
|
@ -480,7 +478,7 @@ _set_videoconvert (ValidateSsimOverride * o,
|
||||||
{
|
{
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
GstVideoFormat format;
|
GstVideoFormat format;
|
||||||
ValidateSsimOverridePriv *priv = o->priv;
|
ValidateSsimOverridePrivate *priv = o->priv;
|
||||||
GstPad *pad =
|
GstPad *pad =
|
||||||
GST_PAD (gst_validate_monitor_get_target (GST_VALIDATE_MONITOR
|
GST_PAD (gst_validate_monitor_get_target (GST_VALIDATE_MONITOR
|
||||||
(pad_monitor)));
|
(pad_monitor)));
|
||||||
|
@ -585,7 +583,7 @@ static gboolean
|
||||||
_should_dump_buffer (ValidateSsimOverride * self,
|
_should_dump_buffer (ValidateSsimOverride * self,
|
||||||
GstValidatePadMonitor * pad_monitor, GstClockTime position)
|
GstValidatePadMonitor * pad_monitor, GstClockTime position)
|
||||||
{
|
{
|
||||||
ValidateSsimOverridePriv *priv = self->priv;
|
ValidateSsimOverridePrivate *priv = self->priv;
|
||||||
|
|
||||||
if (!GST_CLOCK_TIME_IS_VALID (priv->recurrence))
|
if (!GST_CLOCK_TIME_IS_VALID (priv->recurrence))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -654,7 +652,7 @@ _handle_buffer (GstValidateOverride * override,
|
||||||
Frame iframe;
|
Frame iframe;
|
||||||
|
|
||||||
ValidateSsimOverride *o = VALIDATE_SSIM_OVERRIDE (override);
|
ValidateSsimOverride *o = VALIDATE_SSIM_OVERRIDE (override);
|
||||||
ValidateSsimOverridePriv *priv = o->priv;
|
ValidateSsimOverridePrivate *priv = o->priv;
|
||||||
|
|
||||||
GstClockTime running_time, position;
|
GstClockTime running_time, position;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue