Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
luzpaz
gstreamer
Commits
b11ede59
Commit
b11ede59
authored
Mar 04, 2011
by
Wim Taymans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bufferpool: add more debug info
parent
52a3fa93
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
gst/gstbuffer.c
gst/gstbuffer.c
+3
-1
gst/gstbufferpool.c
gst/gstbufferpool.c
+13
-1
No files found.
gst/gstbuffer.c
View file @
b11ede59
...
...
@@ -298,6 +298,7 @@ _gst_buffer_dispose (GstBuffer * buffer)
/* keep the buffer alive */
gst_buffer_ref
(
buffer
);
/* return the buffer to the pool */
GST_CAT_LOG
(
GST_CAT_BUFFER
,
"release %p to pool %p"
,
buffer
,
pool
);
gst_buffer_pool_release_buffer
(
pool
,
buffer
);
}
}
...
...
@@ -844,7 +845,8 @@ gst_buffer_add_meta (GstBuffer * buffer, const GstMetaInfo * info,
g_return_val_if_fail
(
info
!=
NULL
,
NULL
);
/* create a new slice */
GST_DEBUG
(
"alloc metadata of size %"
G_GSIZE_FORMAT
,
info
->
size
);
GST_CAT_DEBUG
(
GST_CAT_BUFFER
,
"alloc metadata of size %"
G_GSIZE_FORMAT
,
info
->
size
);
size
=
ITEM_SIZE
(
info
);
item
=
g_slice_alloc
(
size
);
...
...
gst/gstbufferpool.c
View file @
b11ede59
...
...
@@ -562,13 +562,14 @@ default_acquire_buffer (GstBufferPool * pool, GstBuffer ** buffer,
while
(
TRUE
)
{
if
(
G_UNLIKELY
(
g_atomic_int_get
(
&
pool
->
flushing
)))
return
GST_FLOW_WRONG_STATE
;
goto
flushing
;
/* try to get a buffer from the queue */
*
buffer
=
gst_atomic_queue_pop
(
pool
->
queue
);
if
(
G_LIKELY
(
*
buffer
))
{
gst_poll_read_control
(
pool
->
poll
);
result
=
GST_FLOW_OK
;
GST_LOG_OBJECT
(
pool
,
"acquired buffer %p"
,
*
buffer
);
break
;
}
...
...
@@ -579,20 +580,30 @@ default_acquire_buffer (GstBufferPool * pool, GstBuffer ** buffer,
result
=
pclass
->
alloc_buffer
(
pool
,
buffer
,
params
);
}
else
result
=
GST_FLOW_NOT_SUPPORTED
;
GST_LOG_OBJECT
(
pool
,
"alloc buffer %p"
,
*
buffer
);
break
;
}
/* check if we need to wait */
if
(
params
&&
!
(
params
->
flags
&
GST_BUFFER_POOL_FLAG_WAIT
))
{
GST_LOG_OBJECT
(
pool
,
"no more buffers"
);
result
=
GST_FLOW_UNEXPECTED
;
break
;
}
/* now wait */
GST_LOG_OBJECT
(
pool
,
"waiting for free buffers"
);
gst_poll_wait
(
pool
->
poll
,
GST_CLOCK_TIME_NONE
);
}
return
result
;
/* ERRORS */
flushing:
{
GST_DEBUG_OBJECT
(
pool
,
"we are flushing"
);
return
GST_FLOW_WRONG_STATE
;
}
}
static
inline
void
...
...
@@ -663,6 +674,7 @@ static void
default_release_buffer
(
GstBufferPool
*
pool
,
GstBuffer
*
buffer
)
{
/* keep it around in our queue */
GST_LOG_OBJECT
(
pool
,
"released buffer %p"
,
buffer
);
gst_atomic_queue_push
(
pool
->
queue
,
buffer
);
gst_poll_write_control
(
pool
->
poll
);
}
...
...
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