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
4bc7ff8e
Commit
4bc7ff8e
authored
Dec 22, 2011
by
Wim Taymans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
meta: add metadata flags
Add metadata flags so that we can set extra properties of the metadata
parent
ff59f3a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
3 deletions
+59
-3
gst/gstbuffer.c
gst/gstbuffer.c
+5
-3
gst/gstmeta.h
gst/gstmeta.h
+54
-0
No files found.
gst/gstbuffer.c
View file @
4bc7ff8e
...
...
@@ -1514,13 +1514,15 @@ gst_buffer_add_meta (GstBuffer * buffer, const GstMetaInfo * info,
g_return_val_if_fail
(
info
!=
NULL
,
NULL
);
/* create a new slice */
GST_CAT_DEBUG
(
GST_CAT_BUFFER
,
"alloc metadata %s of size %"
G_GSIZE_FORMAT
,
g_type_name
(
info
->
type
),
info
->
size
);
size
=
ITEM_SIZE
(
info
);
item
=
g_slice_alloc
(
size
);
result
=
&
item
->
meta
;
result
->
info
=
info
;
result
->
flags
=
GST_META_FLAG_NONE
;
GST_CAT_DEBUG
(
GST_CAT_BUFFER
,
"alloc metadata %p (%s) of size %"
G_GSIZE_FORMAT
,
result
,
g_type_name
(
info
->
type
),
info
->
size
);
/* call the init_func when needed */
if
(
info
->
init_func
)
...
...
gst/gstmeta.h
View file @
4bc7ff8e
...
...
@@ -28,14 +28,68 @@ G_BEGIN_DECLS
typedef
struct
_GstMeta
GstMeta
;
typedef
struct
_GstMetaInfo
GstMetaInfo
;
#define GST_META_CAST(meta) ((GstMeta *)(meta))
/**
* GstMetaFlags:
* @GST_META_FLAG_NONE: no flags
* @GST_META_FLAG_READONLY: metadata should not be modified
* @GST_META_FLAG_POOLED: metadata is managed by a bufferpool and should not
* be removed
* @GST_META_FLAG_LAST: additional flags can be added starting from this flag.
*
* Extra metadata flags.
*/
typedef
enum
{
GST_META_FLAG_NONE
=
0
,
GST_META_FLAG_READONLY
=
(
1
<<
0
),
GST_META_FLAG_POOLED
=
(
1
<<
1
),
GST_META_FLAG_LAST
=
(
1
<<
16
)
}
GstMetaFlags
;
/**
* GST_META_FLAGS:
* @meta: a #GstMeta.
*
* A flags word containing #GstMetaFlag flags set on @meta
*/
#define GST_META_FLAGS(meta) (GST_META_CAST (meta)->flags)
/**
* GST_META_FLAG_IS_SET:
* @meta: a #GstMeta.
* @flag: the #GstMetaFlag to check.
*
* Gives the status of a specific flag on a metadata.
*/
#define GST_META_FLAG_IS_SET(meta,flag) !!(GST_META_FLAGS (meta) & (flag))
/**
* GST_META_FLAG_SET:
* @meta: a #GstMeta.
* @flag: the #GstMetaFlag to set.
*
* Sets a metadata flag on a metadata.
*/
#define GST_META_FLAG_SET(meta,flag) (GST_META_FLAGS (meta) |= (flag))
/**
* GST_META_FLAG_UNSET:
* @meta: a #GstMeta.
* @flag: the #GstMetaFlag to clear.
*
* Clears a metadata flag.
*/
#define GST_META_FLAG_UNSET(meta,flag) (GST_META_FLAGS (meta) &= ~(flag))
/**
* GstMeta:
* @flags: extra flags for the metadata
* @info: pointer to the #GstMetaInfo
*
* Base structure for metadata. Custom metadata will put this structure
* as the first member of their structure.
*/
struct
_GstMeta
{
GstMetaFlags
flags
;
const
GstMetaInfo
*
info
;
};
...
...
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