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
b5ef693e
Commit
b5ef693e
authored
Aug 25, 2011
by
Wim Taymans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
buffer: always copy all buffer flags when asked
Don't try to be smart and copy only a subset of buffer flag
parent
96ecd616
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
48 deletions
+18
-48
gst/gstbuffer.c
gst/gstbuffer.c
+2
-8
libs/gst/base/gstbasetransform.c
libs/gst/base/gstbasetransform.c
+16
-40
No files found.
gst/gstbuffer.c
View file @
b5ef693e
...
...
@@ -270,14 +270,8 @@ gst_buffer_copy_into (GstBuffer * dest, GstBuffer * src,
bufsize
);
if
(
flags
&
GST_BUFFER_COPY_FLAGS
)
{
guint
mask
;
/* copy relevant flags */
mask
=
GST_BUFFER_FLAG_LIVE
|
GST_BUFFER_FLAG_IN_CAPS
|
GST_BUFFER_FLAG_DELTA_UNIT
|
GST_BUFFER_FLAG_DISCONT
|
GST_BUFFER_FLAG_GAP
|
GST_BUFFER_FLAG_MEDIA1
|
GST_BUFFER_FLAG_MEDIA2
|
GST_BUFFER_FLAG_MEDIA3
;
GST_MINI_OBJECT_FLAGS
(
dest
)
|=
GST_MINI_OBJECT_FLAGS
(
src
)
&
mask
;
/* copy flags */
GST_MINI_OBJECT_FLAGS
(
dest
)
=
GST_MINI_OBJECT_FLAGS
(
src
);
}
if
(
flags
&
GST_BUFFER_COPY_TIMESTAMPS
)
{
...
...
libs/gst/base/gstbasetransform.c
View file @
b5ef693e
...
...
@@ -1457,48 +1457,24 @@ static gboolean
default_copy_metadata
(
GstBaseTransform
*
trans
,
GstBuffer
*
inbuf
,
GstBuffer
*
outbuf
)
{
GstBaseTransformPrivate
*
priv
;
gboolean
copymeta
;
guint
mask
;
priv
=
trans
->
priv
;
GstBaseTransformPrivate
*
priv
=
trans
->
priv
;
/* now copy the metadata */
mask
=
GST_BUFFER_FLAG_LIVE
|
GST_BUFFER_FLAG_IN_CAPS
|
GST_BUFFER_FLAG_DELTA_UNIT
|
GST_BUFFER_FLAG_DISCONT
|
GST_BUFFER_FLAG_GAP
|
GST_BUFFER_FLAG_MEDIA1
|
GST_BUFFER_FLAG_MEDIA2
|
GST_BUFFER_FLAG_MEDIA3
;
/* see if the flags and timestamps match */
copymeta
=
(
GST_MINI_OBJECT_FLAGS
(
outbuf
)
&
mask
)
!=
(
GST_MINI_OBJECT_FLAGS
(
inbuf
)
&
mask
);
copymeta
|=
GST_BUFFER_TIMESTAMP
(
outbuf
)
!=
GST_BUFFER_TIMESTAMP
(
inbuf
)
||
GST_BUFFER_DURATION
(
outbuf
)
!=
GST_BUFFER_DURATION
(
inbuf
)
||
GST_BUFFER_OFFSET
(
outbuf
)
!=
GST_BUFFER_OFFSET
(
inbuf
)
||
GST_BUFFER_OFFSET_END
(
outbuf
)
!=
GST_BUFFER_OFFSET_END
(
inbuf
);
/* we need to modify the metadata when the element is not gap aware,
* passthrough is not used and the gap flag is set */
copymeta
|=
!
priv
->
gap_aware
&&
!
trans
->
passthrough
&&
(
GST_MINI_OBJECT_FLAGS
(
outbuf
)
&
GST_BUFFER_FLAG_GAP
);
if
(
copymeta
)
{
GST_DEBUG_OBJECT
(
trans
,
"copying metadata"
);
/* this should not happen, buffers allocated from a pool or with
* new_allocate should always be writable. */
if
(
!
gst_buffer_is_writable
(
outbuf
))
goto
not_writable
;
/* when we get here, the metadata should be writable */
gst_buffer_copy_into
(
outbuf
,
inbuf
,
GST_BUFFER_COPY_FLAGS
|
GST_BUFFER_COPY_TIMESTAMPS
,
0
,
-
1
);
/* clear the GAP flag when the subclass does not understand it */
if
(
!
priv
->
gap_aware
)
GST_BUFFER_FLAG_UNSET
(
outbuf
,
GST_BUFFER_FLAG_GAP
);
}
GST_DEBUG_OBJECT
(
trans
,
"copying metadata"
);
/* this should not happen, buffers allocated from a pool or with
* new_allocate should always be writable. */
if
(
!
gst_buffer_is_writable
(
outbuf
))
goto
not_writable
;
/* when we get here, the metadata should be writable */
gst_buffer_copy_into
(
outbuf
,
inbuf
,
GST_BUFFER_COPY_FLAGS
|
GST_BUFFER_COPY_TIMESTAMPS
,
0
,
-
1
);
/* clear the GAP flag when the subclass does not understand it */
if
(
!
priv
->
gap_aware
)
GST_BUFFER_FLAG_UNSET
(
outbuf
,
GST_BUFFER_FLAG_GAP
);
return
TRUE
;
/* ERRORS */
...
...
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