mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:26:14 +00:00
Don't try to add NULL psepcs
Original commit message from CVS: Don't try to add NULL psepcs
This commit is contained in:
parent
413a70a342
commit
d2477f425f
1 changed files with 87 additions and 100 deletions
187
gst/gstelement.c
187
gst/gstelement.c
|
@ -1303,97 +1303,88 @@ gst_element_statename (GstElementState state)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_element_populate_std_props (GObjectClass *klass,
|
gst_element_populate_std_props (GObjectClass * klass,
|
||||||
const char *prop_name,
|
const char *prop_name, guint arg_id, GParamFlags flags)
|
||||||
guint arg_id,
|
|
||||||
GParamFlags flags)
|
|
||||||
{
|
{
|
||||||
GQuark prop_id = g_quark_from_string (prop_name);
|
GQuark prop_id = g_quark_from_string (prop_name);
|
||||||
GParamSpec *pspec;
|
GParamSpec *pspec = NULL;
|
||||||
|
|
||||||
static GQuark fd_id = 0;
|
static GQuark fd_id = 0;
|
||||||
static GQuark blocksize_id;
|
static GQuark blocksize_id;
|
||||||
static GQuark bytesperread_id;
|
static GQuark bytesperread_id;
|
||||||
static GQuark dump_id;
|
static GQuark dump_id;
|
||||||
static GQuark filesize_id;
|
static GQuark filesize_id;
|
||||||
static GQuark mmapsize_id;
|
static GQuark mmapsize_id;
|
||||||
static GQuark location_id;
|
static GQuark location_id;
|
||||||
static GQuark offset_id;
|
static GQuark offset_id;
|
||||||
static GQuark silent_id;
|
static GQuark silent_id;
|
||||||
static GQuark touch_id;
|
static GQuark touch_id;
|
||||||
|
|
||||||
if (!fd_id) {
|
|
||||||
fd_id = g_quark_from_static_string ("fd");
|
|
||||||
blocksize_id = g_quark_from_static_string ("blocksize");
|
|
||||||
bytesperread_id = g_quark_from_static_string ("bytesperread");
|
|
||||||
dump_id = g_quark_from_static_string ("dump");
|
|
||||||
filesize_id = g_quark_from_static_string ("filesize");
|
|
||||||
mmapsize_id = g_quark_from_static_string ("mmapsize");
|
|
||||||
location_id = g_quark_from_static_string ("location");
|
|
||||||
offset_id = g_quark_from_static_string ("offset");
|
|
||||||
silent_id = g_quark_from_static_string ("silent");
|
|
||||||
touch_id = g_quark_from_static_string ("touch");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (prop_id == fd_id) {
|
if (!fd_id) {
|
||||||
g_param_spec_int (
|
fd_id = g_quark_from_static_string ("fd");
|
||||||
"fd", "File-descriptor",
|
blocksize_id = g_quark_from_static_string ("blocksize");
|
||||||
"File-descriptor for the file being read",
|
bytesperread_id = g_quark_from_static_string ("bytesperread");
|
||||||
0, G_MAXINT, 0, flags);
|
dump_id = g_quark_from_static_string ("dump");
|
||||||
|
filesize_id = g_quark_from_static_string ("filesize");
|
||||||
|
mmapsize_id = g_quark_from_static_string ("mmapsize");
|
||||||
|
location_id = g_quark_from_static_string ("location");
|
||||||
|
offset_id = g_quark_from_static_string ("offset");
|
||||||
|
silent_id = g_quark_from_static_string ("silent");
|
||||||
|
touch_id = g_quark_from_static_string ("touch");
|
||||||
|
}
|
||||||
|
|
||||||
} else if (prop_id == blocksize_id) {
|
if (prop_id == fd_id) {
|
||||||
pspec = g_param_spec_ulong (
|
g_param_spec_int ("fd", "File-descriptor",
|
||||||
"blocksize", "Block Size",
|
"File-descriptor for the file being read", 0, G_MAXINT, 0, flags);
|
||||||
"Block size to read per buffer",
|
|
||||||
0, G_MAXULONG, 4096, flags);
|
|
||||||
|
|
||||||
} else if (prop_id == bytesperread_id) {
|
|
||||||
pspec = g_param_spec_int (
|
|
||||||
"bytesperread", "bytesperread", "bytesperread",
|
|
||||||
G_MININT, G_MAXINT, 0, flags);
|
|
||||||
|
|
||||||
} else if (prop_id == dump_id) {
|
}
|
||||||
pspec = g_param_spec_boolean (
|
else if (prop_id == blocksize_id) {
|
||||||
"dump", "dump", "dump",
|
pspec = g_param_spec_ulong ("blocksize", "Block Size",
|
||||||
FALSE, flags);
|
"Block size to read per buffer", 0, G_MAXULONG, 4096, flags);
|
||||||
|
|
||||||
} else if (prop_id == filesize_id) {
|
}
|
||||||
pspec = g_param_spec_int64 (
|
else if (prop_id == bytesperread_id) {
|
||||||
"filesize", "File Size",
|
pspec = g_param_spec_int ("bytesperread", "bytesperread", "bytesperread",
|
||||||
"Size of the file being read",
|
G_MININT, G_MAXINT, 0, flags);
|
||||||
0, G_MAXINT64, 0, flags);
|
|
||||||
|
|
||||||
} else if (prop_id == mmapsize_id) {
|
|
||||||
pspec = g_param_spec_ulong (
|
|
||||||
"mmapsize", "mmap() Block Size",
|
|
||||||
"Size in bytes of mmap()d regions",
|
|
||||||
0, G_MAXULONG, 4 * 1048576, flags);
|
|
||||||
|
|
||||||
} else if (prop_id == location_id) {
|
|
||||||
pspec = g_param_spec_string (
|
|
||||||
"location", "File Location",
|
|
||||||
"Location of the file to read",
|
|
||||||
NULL, flags);
|
|
||||||
|
|
||||||
} else if (prop_id == offset_id) {
|
|
||||||
pspec = g_param_spec_int64 (
|
|
||||||
"offset", "File Offset",
|
|
||||||
"Byte offset of current read pointer",
|
|
||||||
0, G_MAXINT64, 0, flags);
|
|
||||||
|
|
||||||
} else if (prop_id == silent_id) {
|
}
|
||||||
pspec = g_param_spec_boolean (
|
else if (prop_id == dump_id) {
|
||||||
"silent", "silent", "silent",
|
pspec = g_param_spec_boolean ("dump", "dump", "dump", FALSE, flags);
|
||||||
FALSE, flags);
|
|
||||||
|
|
||||||
} else if (prop_id == touch_id) {
|
}
|
||||||
pspec = g_param_spec_boolean (
|
else if (prop_id == filesize_id) {
|
||||||
"touch", "Touch read data",
|
pspec = g_param_spec_int64 ("filesize", "File Size",
|
||||||
"Touch data to force disk read before push ()",
|
"Size of the file being read", 0, G_MAXINT64, 0, flags);
|
||||||
TRUE, flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_object_class_install_property (klass, arg_id, pspec);
|
}
|
||||||
|
else if (prop_id == mmapsize_id) {
|
||||||
|
pspec = g_param_spec_ulong ("mmapsize", "mmap() Block Size",
|
||||||
|
"Size in bytes of mmap()d regions",
|
||||||
|
0, G_MAXULONG, 4 * 1048576, flags);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (prop_id == location_id) {
|
||||||
|
pspec = g_param_spec_string ("location", "File Location",
|
||||||
|
"Location of the file to read", NULL, flags);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (prop_id == offset_id) {
|
||||||
|
pspec = g_param_spec_int64 ("offset", "File Offset",
|
||||||
|
"Byte offset of current read pointer", 0, G_MAXINT64, 0, flags);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (prop_id == silent_id) {
|
||||||
|
pspec = g_param_spec_boolean ("silent", "silent", "silent", FALSE, flags);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (prop_id == touch_id) {
|
||||||
|
pspec = g_param_spec_boolean ("touch", "Touch read data",
|
||||||
|
"Touch data to force disk read before push ()", TRUE, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pspec) {
|
||||||
|
g_object_class_install_property (klass, arg_id, pspec);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1407,30 +1398,26 @@ gst_element_populate_std_props (GObjectClass *klass,
|
||||||
* the flags determine readability / writeability.
|
* the flags determine readability / writeability.
|
||||||
**/
|
**/
|
||||||
void
|
void
|
||||||
gst_element_install_std_props (GstElementClass *klass,
|
gst_element_install_std_props (GstElementClass * klass, const char *first_name, ...)
|
||||||
const char *first_name,
|
|
||||||
...)
|
|
||||||
{
|
{
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
g_return_if_fail (GST_IS_ELEMENT_CLASS (klass));
|
g_return_if_fail (GST_IS_ELEMENT_CLASS (klass));
|
||||||
|
|
||||||
va_start (args, first_name);
|
va_start (args, first_name);
|
||||||
|
|
||||||
name = first_name;
|
name = first_name;
|
||||||
|
|
||||||
while (name) {
|
while (name) {
|
||||||
int arg_id = va_arg (args, int);
|
int arg_id = va_arg (args, int);
|
||||||
int flags = va_arg (args, int);
|
int flags = va_arg (args, int);
|
||||||
|
|
||||||
gst_element_populate_std_props (
|
gst_element_populate_std_props ((GObjectClass *) klass, name, arg_id, flags);
|
||||||
(GObjectClass *) klass, name, arg_id, flags);
|
|
||||||
|
|
||||||
name = va_arg (args, char *);
|
|
||||||
}
|
|
||||||
|
|
||||||
va_end (args);
|
name = va_arg (args, char *);
|
||||||
|
}
|
||||||
|
|
||||||
|
va_end (args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue