Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
gstreamer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
luzpaz
gstreamer
Commits
70be8d8d
Commit
70be8d8d
authored
Nov 02, 2010
by
Wim Taymans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve type registration
parent
cdde34f0
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
27 additions
and
46 deletions
+27
-46
gst/gst.c
gst/gst.c
+2
-1
gst/gst_private.h
gst/gst_private.h
+1
-0
gst/gstbuffer.c
gst/gstbuffer.c
+5
-16
gst/gstbuffer.h
gst/gstbuffer.h
+3
-3
gst/gstbufferlist.c
gst/gstbufferlist.c
+4
-13
gst/gstbufferlist.h
gst/gstbufferlist.h
+3
-3
gst/gstcaps.c
gst/gstcaps.c
+4
-6
gst/gstcaps.h
gst/gstcaps.h
+3
-2
plugins/elements/gsttypefindelement.c
plugins/elements/gsttypefindelement.c
+2
-2
No files found.
gst/gst.c
View file @
70be8d8d
...
...
@@ -667,6 +667,8 @@ init_post (GOptionContext * context, GOptionGroup * group, gpointer data,
_priv_gst_quarks_initialize
();
_gst_format_initialize
();
_gst_query_initialize
();
_gst_caps_initialize
();
g_type_class_ref
(
gst_object_get_type
());
g_type_class_ref
(
gst_pad_get_type
());
g_type_class_ref
(
gst_element_factory_get_type
());
...
...
@@ -751,7 +753,6 @@ init_post (GOptionContext * context, GOptionGroup * group, gpointer data,
gst_structure_get_type
();
_gst_value_initialize
();
g_type_class_ref
(
gst_param_spec_fraction_get_type
());
gst_caps_get_type
();
_gst_event_initialize
();
_gst_buffer_initialize
();
_gst_buffer_list_initialize
();
...
...
gst/gst_private.h
View file @
70be8d8d
...
...
@@ -98,6 +98,7 @@ void _priv_gst_quarks_initialize (void);
* we want enterprise edition packagers dancing on our heads) */
void
_gst_buffer_initialize
(
void
);
void
_gst_buffer_list_initialize
(
void
);
void
_gst_caps_initialize
(
void
);
void
_gst_event_initialize
(
void
);
void
_gst_format_initialize
(
void
);
void
_gst_message_initialize
(
void
);
...
...
gst/gstbuffer.c
View file @
70be8d8d
...
...
@@ -128,16 +128,7 @@
#include "gstminiobject.h"
#include "gstversion.h"
static
GType
_gst_buffer_type
=
0
;
GType
gst_buffer_get_type
(
void
)
{
if
(
G_UNLIKELY
(
_gst_buffer_type
==
0
))
{
_gst_buffer_type
=
gst_mini_object_register
(
"GstBuffer"
);
}
return
_gst_buffer_type
;
}
GType
_gst_buffer_type
=
0
;
/* buffer alignment in bytes
* an alignment of 8 would be the same as malloc() guarantees
...
...
@@ -167,15 +158,14 @@ aligned_malloc (gpointer * memptr, guint size)
void
_gst_buffer_initialize
(
void
)
{
/* the GstMiniObject types need to be class_ref'd once before it can be
* done from multiple threads;
* see http://bugzilla.gnome.org/show_bug.cgi?id=304551 */
gst_buffer_get_type
();
if
(
G_LIKELY
(
_gst_buffer_type
==
0
))
{
_gst_buffer_type
=
gst_mini_object_register
(
"GstBuffer"
);
#ifdef HAVE_GETPAGESIZE
#ifdef BUFFER_ALIGNMENT_PAGESIZE
_gst_buffer_data_alignment
=
getpagesize
();
_gst_buffer_data_alignment
=
getpagesize
();
#endif
#endif
}
}
/**
...
...
@@ -337,7 +327,6 @@ gst_buffer_new (void)
* gst_buffer_try_new_and_alloc() if you want to handle this case
* gracefully or have gotten the size to allocate from an untrusted
* source such as a media stream.
*
*
* Note that when @size == 0, the buffer data pointer will be NULL.
*
...
...
gst/gstbuffer.h
View file @
70be8d8d
...
...
@@ -32,6 +32,8 @@ G_BEGIN_DECLS
typedef
struct
_GstBuffer
GstBuffer
;
extern
GType
_gst_buffer_type
;
/**
* GST_BUFFER_TRACE_NAME:
*
...
...
@@ -39,7 +41,7 @@ typedef struct _GstBuffer GstBuffer;
*/
#define GST_BUFFER_TRACE_NAME "GstBuffer"
#define GST_TYPE_BUFFER (
gst_buffer_get_type()
)
#define GST_TYPE_BUFFER (
_gst_buffer_type
)
#define GST_IS_BUFFER(obj) (GST_IS_MINI_OBJECT_TYPE(obj, GST_TYPE_BUFFER))
#define GST_BUFFER_CAST(obj) ((GstBuffer *)(obj))
#define GST_BUFFER(obj) (GST_BUFFER_CAST(obj))
...
...
@@ -287,8 +289,6 @@ struct _GstBuffer {
gpointer
_gst_reserved
[
GST_PADDING
];
};
GType
gst_buffer_get_type
(
void
);
/* allocation */
GstBuffer
*
gst_buffer_new
(
void
);
GstBuffer
*
gst_buffer_new_and_alloc
(
guint
size
);
...
...
gst/gstbufferlist.c
View file @
70be8d8d
...
...
@@ -159,14 +159,14 @@ struct _GstBufferListIterator
GList
*
last_returned
;
};
static
GType
_gst_buffer_list_type
=
0
;
GType
_gst_buffer_list_type
=
0
;
void
_gst_buffer_list_initialize
(
void
)
{
GType
type
=
gst_buffer_list_get_type
();
_gst_buffer_list_type
=
type
;
if
(
G_LIKELY
(
_gst_buffer_list_type
==
0
))
{
_gst_buffer_list_type
=
gst_mini_object_register
(
"GstBufferList"
);
}
}
static
GstBufferList
*
...
...
@@ -401,15 +401,6 @@ gst_buffer_list_get (GstBufferList * list, guint group, guint idx)
return
NULL
;
}
GType
gst_buffer_list_get_type
(
void
)
{
if
(
G_UNLIKELY
(
_gst_buffer_list_type
==
0
))
{
_gst_buffer_list_type
=
gst_mini_object_register
(
"GstBufferList"
);
}
return
_gst_buffer_list_type
;
}
/**
* gst_buffer_list_iterate:
* @list: a #GstBufferList
...
...
gst/gstbufferlist.h
View file @
70be8d8d
...
...
@@ -27,7 +27,9 @@
G_BEGIN_DECLS
#define GST_TYPE_BUFFER_LIST (gst_buffer_list_get_type ())
extern
GType
_gst_buffer_list_type
;
#define GST_TYPE_BUFFER_LIST (_gst_buffer_list_type)
#define GST_IS_BUFFER_LIST(obj) (GST_IS_MINI_OBJECT_TYPE(obj, GST_TYPE_BUFFER_LIST))
#define GST_BUFFER_LIST_CAST(obj) ((GstBufferList *)obj)
#define GST_BUFFER_LIST(obj) (GST_BUFFER_LIST_CAST(obj))
...
...
@@ -104,8 +106,6 @@ typedef GstBufferListItem (*GstBufferListFunc) (GstBuffer **buffer, guint grou
gpointer
user_data
);
GType
gst_buffer_list_get_type
(
void
);
/* allocation */
GstBufferList
*
gst_buffer_list_new
(
void
);
...
...
gst/gstcaps.c
View file @
70be8d8d
...
...
@@ -122,19 +122,17 @@ static void gst_caps_transform_to_string (const GValue * src_value,
static
gboolean
gst_caps_from_string_inplace
(
GstCaps
*
caps
,
const
gchar
*
string
);
static
GType
_gst_caps_type
=
0
;
GType
_gst_caps_type
=
0
;
GType
gst_caps_get_typ
e
(
void
)
void
_gst_caps_initializ
e
(
void
)
{
if
(
G_
UN
LIKELY
(
_gst_caps_type
==
0
))
{
if
(
G_LIKELY
(
_gst_caps_type
==
0
))
{
_gst_caps_type
=
gst_mini_object_register
(
"GstCaps"
);
g_value_register_transform_func
(
_gst_caps_type
,
G_TYPE_STRING
,
gst_caps_transform_to_string
);
}
return
_gst_caps_type
;
}
static
GstCaps
*
...
...
gst/gstcaps.h
View file @
70be8d8d
...
...
@@ -27,7 +27,9 @@
G_BEGIN_DECLS
#define GST_TYPE_CAPS (gst_caps_get_type())
extern
GType
_gst_caps_type
;
#define GST_TYPE_CAPS (_gst_caps_type)
#define GST_CAPS(object) ((GstCaps*)object)
#define GST_IS_CAPS(object) (GST_IS_MINI_OBJECT_TYPE(object, GST_TYPE_CAPS))
...
...
@@ -254,7 +256,6 @@ struct _GstStaticCaps {
gpointer
_gst_reserved
[
GST_PADDING
];
};
GType
gst_caps_get_type
(
void
);
GstCaps
*
gst_caps_new_empty
(
void
);
GstCaps
*
gst_caps_new_any
(
void
);
GstCaps
*
gst_caps_new_simple
(
const
char
*
media_type
,
...
...
plugins/elements/gsttypefindelement.c
View file @
70be8d8d
...
...
@@ -216,7 +216,7 @@ gst_type_find_element_class_init (GstTypeFindElementClass * typefind_class)
g_object_class_install_property
(
gobject_class
,
PROP_CAPS
,
g_param_spec_boxed
(
"caps"
,
_
(
"caps"
),
_
(
"detected capabilities in stream"
),
gst_caps_get_type
()
,
_
(
"detected capabilities in stream"
),
GST_TYPE_CAPS
,
G_PARAM_READABLE
|
G_PARAM_STATIC_STRINGS
));
g_object_class_install_property
(
gobject_class
,
PROP_MINIMUM
,
g_param_spec_uint
(
"minimum"
,
_
(
"minimum"
),
...
...
@@ -230,7 +230,7 @@ gst_type_find_element_class_init (GstTypeFindElementClass * typefind_class)
G_PARAM_READWRITE
|
G_PARAM_STATIC_STRINGS
));
g_object_class_install_property
(
gobject_class
,
PROP_FORCE_CAPS
,
g_param_spec_boxed
(
"force-caps"
,
_
(
"force caps"
),
_
(
"force caps without doing a typefind"
),
gst_caps_get_type
()
,
_
(
"force caps without doing a typefind"
),
GST_TYPE_CAPS
,
G_PARAM_READWRITE
|
G_PARAM_STATIC_STRINGS
));
/**
* GstTypeFindElement::have-type:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment