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
4e16347b
Commit
4e16347b
authored
Mar 17, 2011
by
Sebastian Dröge
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 0.11
Conflicts: gst/gstbufferlist.c
parents
f0e3902a
b8d83f4e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
88 additions
and
40 deletions
+88
-40
gst/gstbufferlist.c
gst/gstbufferlist.c
+46
-31
gst/gstghostpad.c
gst/gstghostpad.c
+5
-4
gst/gstpad.c
gst/gstpad.c
+15
-0
gst/gstutils.c
gst/gstutils.c
+12
-2
tests/check/gst/gstbufferlist.c
tests/check/gst/gstbufferlist.c
+8
-1
win32/common/libgstreamer.def
win32/common/libgstreamer.def
+2
-2
No files found.
gst/gstbufferlist.c
View file @
4e16347b
...
...
@@ -142,7 +142,7 @@ struct _GstBufferList
{
GstMiniObject
mini_object
;
G
List
*
buffers
;
G
Queue
*
buffers
;
};
/**
...
...
@@ -173,17 +173,16 @@ static GstBufferList *
_gst_buffer_list_copy
(
GstBufferList
*
list
)
{
GstBufferList
*
list_copy
;
GQueue
*
buffers_copy
;
GList
*
tmp
;
g_return_val_if_fail
(
list
!=
NULL
,
NULL
);
list_copy
=
gst_buffer_list_new
();
/* shallow copy of list and pointers */
list_copy
->
buffers
=
g_list
_copy
(
list
->
buffers
);
buffers_copy
=
g_queue
_copy
(
list
->
buffers
);
/* ref all buffers in the list */
tmp
=
list
_copy
->
buffers
;
tmp
=
list
->
buffers
->
head
;
while
(
tmp
)
{
if
(
tmp
->
data
!=
GROUP_START
&&
tmp
->
data
!=
STOLEN
)
{
tmp
->
data
=
gst_buffer_ref
(
GST_BUFFER_CAST
(
tmp
->
data
));
...
...
@@ -191,6 +190,10 @@ _gst_buffer_list_copy (GstBufferList * list)
tmp
=
g_list_next
(
tmp
);
}
list_copy
=
gst_buffer_list_new
();
g_queue_free
(
list_copy
->
buffers
);
list_copy
->
buffers
=
buffers_copy
;
return
list_copy
;
}
...
...
@@ -203,14 +206,14 @@ _gst_buffer_list_free (GstBufferList * list)
GST_LOG
(
"free %p"
,
list
);
tmp
=
list
->
buffers
;
tmp
=
list
->
buffers
->
head
;
while
(
tmp
)
{
if
(
tmp
->
data
!=
GROUP_START
&&
tmp
->
data
!=
STOLEN
)
{
gst_buffer_unref
(
GST_BUFFER_CAST
(
tmp
->
data
));
}
tmp
=
tmp
->
next
;
}
g_
list
_free
(
list
->
buffers
);
g_
queue
_free
(
list
->
buffers
);
g_slice_free1
(
GST_MINI_OBJECT_SIZE
(
list
),
list
);
}
...
...
@@ -223,6 +226,10 @@ gst_buffer_list_init (GstBufferList * list, gsize size)
list
->
mini_object
.
copy
=
(
GstMiniObjectCopyFunction
)
_gst_buffer_list_copy
;
list
->
mini_object
.
free
=
(
GstMiniObjectFreeFunction
)
_gst_buffer_list_free
;
list
->
buffers
=
g_queue_new
();
GST_LOG
(
"init %p"
,
list
);
}
/**
...
...
@@ -270,7 +277,7 @@ gst_buffer_list_n_groups (GstBufferList * list)
g_return_val_if_fail
(
list
!=
NULL
,
0
);
tmp
=
list
->
buffers
;
tmp
=
list
->
buffers
->
head
;
n
=
0
;
while
(
tmp
)
{
if
(
tmp
->
data
==
GROUP_START
)
{
...
...
@@ -307,7 +314,7 @@ gst_buffer_list_foreach (GstBufferList * list, GstBufferListFunc func,
g_return_if_fail
(
list
!=
NULL
);
g_return_if_fail
(
func
!=
NULL
);
next
=
list
->
buffers
;
next
=
list
->
buffers
->
head
;
group
=
idx
=
0
;
while
(
next
)
{
GstBuffer
*
buffer
;
...
...
@@ -333,7 +340,7 @@ gst_buffer_list_foreach (GstBufferList * list, GstBufferListFunc func,
/* the function changed the buffer */
if
(
buffer
==
NULL
)
{
/* we were asked to remove the item */
list
->
buffers
=
g_list
_delete_link
(
list
->
buffers
,
tmp
);
g_queue
_delete_link
(
list
->
buffers
,
tmp
);
idx
--
;
}
else
{
/* change the buffer */
...
...
@@ -378,7 +385,7 @@ gst_buffer_list_get (GstBufferList * list, guint group, guint idx)
g_return_val_if_fail
(
list
!=
NULL
,
NULL
);
tmp
=
list
->
buffers
;
tmp
=
list
->
buffers
->
head
;
cgroup
=
0
;
while
(
tmp
)
{
if
(
tmp
->
data
==
GROUP_START
)
{
...
...
@@ -430,7 +437,7 @@ gst_buffer_list_iterate (GstBufferList * list)
it
=
g_slice_new
(
GstBufferListIterator
);
it
->
list
=
list
;
it
->
next
=
list
->
buffers
;
it
->
next
=
list
->
buffers
->
head
;
it
->
last_returned
=
NULL
;
return
it
;
...
...
@@ -509,11 +516,14 @@ gst_buffer_list_iterator_add (GstBufferListIterator * it, GstBuffer * buffer)
g_return_if_fail
(
buffer
!=
NULL
);
/* adding before the first group start is not allowed */
g_return_if_fail
(
it
->
next
!=
it
->
list
->
buffers
);
g_return_if_fail
(
it
->
next
!=
it
->
list
->
buffers
->
head
);
/* cheap insert into the GList */
it
->
list
->
buffers
=
g_list_insert_before
(
it
->
list
->
buffers
,
it
->
next
,
buffer
);
/* cheap insert into the GQueue */
if
(
it
->
next
!=
NULL
)
{
g_queue_insert_before
(
it
->
list
->
buffers
,
it
->
next
,
buffer
);
}
else
{
g_queue_push_tail
(
it
->
list
->
buffers
,
buffer
);
}
}
/**
...
...
@@ -535,31 +545,33 @@ void
gst_buffer_list_iterator_add_list
(
GstBufferListIterator
*
it
,
GList
*
list
)
{
GList
*
last
;
guint
len
;
g_return_if_fail
(
it
!=
NULL
);
g_return_if_fail
(
it
->
next
!=
it
->
list
->
buffers
);
g_return_if_fail
(
it
->
next
!=
it
->
list
->
buffers
->
head
);
if
(
list
==
NULL
)
return
;
if
(
it
->
next
)
{
last
=
list
;
while
(
last
->
next
)
last
=
last
->
next
;
last
=
list
;
len
=
1
;
while
(
last
->
next
)
{
last
=
last
->
next
;
len
++
;
}
if
(
it
->
next
)
{
last
->
next
=
it
->
next
;
list
->
prev
=
it
->
next
->
prev
;
it
->
next
->
prev
=
last
;
if
(
list
->
prev
)
list
->
prev
->
next
=
list
;
}
else
{
last
=
it
->
list
->
buffers
;
while
(
last
->
next
)
last
=
last
->
next
;
last
->
next
=
list
;
list
->
prev
=
last
;
it
->
list
->
buffers
->
tail
->
next
=
list
;
list
->
prev
=
it
->
list
->
buffers
->
tail
;
it
->
list
->
buffers
->
tail
=
last
;
}
it
->
list
->
buffers
->
length
+=
len
;
}
/**
...
...
@@ -584,9 +596,12 @@ gst_buffer_list_iterator_add_group (GstBufferListIterator * it)
it
->
next
=
g_list_next
(
it
->
next
);
}
/* cheap insert of a group start into the GList */
it
->
list
->
buffers
=
g_list_insert_before
(
it
->
list
->
buffers
,
it
->
next
,
GROUP_START
);
/* cheap insert of a group start into the GQueue */
if
(
it
->
next
!=
NULL
)
{
g_queue_insert_before
(
it
->
list
->
buffers
,
it
->
next
,
GROUP_START
);
}
else
{
g_queue_push_tail
(
it
->
list
->
buffers
,
GROUP_START
);
}
}
/**
...
...
@@ -691,7 +706,7 @@ gst_buffer_list_iterator_remove (GstBufferListIterator * it)
if
(
it
->
last_returned
->
data
!=
STOLEN
)
{
gst_buffer_unref
(
it
->
last_returned
->
data
);
}
it
->
list
->
buffers
=
g_list
_delete_link
(
it
->
list
->
buffers
,
it
->
last_returned
);
g_queue
_delete_link
(
it
->
list
->
buffers
,
it
->
last_returned
);
it
->
last_returned
=
NULL
;
}
...
...
gst/gstghostpad.c
View file @
4e16347b
...
...
@@ -124,11 +124,12 @@ static GstIterator *
gst_proxy_pad_do_iterate_internal_links
(
GstPad
*
pad
)
{
GstIterator
*
res
=
NULL
;
GstPad
*
target
=
gst_proxy_pad_get_target
(
pad
);
GstPad
*
internal
=
GST_PROXY_PAD_INTERNAL
(
pad
);
if
(
target
)
{
res
=
gst_pad_iterate_internal_links
(
target
);
gst_object_unref
(
target
);
if
(
internal
)
{
res
=
gst_iterator_new_single
(
GST_TYPE_PAD
,
internal
,
(
GstCopyFunction
)
gst_object_ref
,
(
GFreeFunc
)
gst_object_unref
);
}
return
res
;
...
...
gst/gstpad.c
View file @
4e16347b
...
...
@@ -991,6 +991,11 @@ gst_pad_is_active (GstPad * pad)
* You can pass NULL as the callback to make this call block. Be careful with
* this blocking call as it might not return for reasons stated above.
*
* <note>
* Pad block handlers are only called for source pads in push mode
* and sink pads in pull mode.
* </note>
*
* Returns: TRUE if the pad could be blocked. This function can fail if the
* wrong parameters were passed or the pad was already in the requested state.
*
...
...
@@ -1085,6 +1090,11 @@ had_right_state:
* take an indeterminate amount of time.
* You can pass NULL as the callback to make this call block. Be careful with
* this blocking call as it might not return for reasons stated above.
*
* <note>
* Pad block handlers are only called for source pads in push mode
* and sink pads in pull mode.
* </note>
*
* Returns: TRUE if the pad could be blocked. This function can fail if the
* wrong parameters were passed or the pad was already in the requested state.
...
...
@@ -1108,6 +1118,11 @@ gst_pad_set_blocked_async (GstPad * pad, gboolean blocked,
* a shortcut for gst_pad_set_blocked_async() with a NULL
* callback.
*
* <note>
* Pad blocks are only possible for source pads in push mode
* and sink pads in pull mode.
* </note>
*
* Returns: TRUE if the pad could be blocked. This function can fail if the
* wrong parameters were passed or the pad was already in the requested state.
*
...
...
gst/gstutils.c
View file @
4e16347b
...
...
@@ -1321,7 +1321,6 @@ gst_element_factory_can_accept_any_caps_in_direction (GstElementFactory *
return
FALSE
;
}
#ifndef GST_DISABLE_DEPRECATED
/**
* gst_element_factory_can_src_caps:
* @factory: factory to query
...
...
@@ -1333,6 +1332,11 @@ gst_element_factory_can_accept_any_caps_in_direction (GstElementFactory *
*
* Deprecated: use gst_element_factory_can_src_all_caps() instead.
*/
#ifndef GST_REMOVE_DEPRECATED
#ifdef GST_DISABLE_DEPRECATED
gboolean
gst_element_factory_can_src_caps
(
GstElementFactory
*
factory
,
const
GstCaps
*
caps
);
#endif
gboolean
gst_element_factory_can_src_caps
(
GstElementFactory
*
factory
,
const
GstCaps
*
caps
)
...
...
@@ -1340,6 +1344,7 @@ gst_element_factory_can_src_caps (GstElementFactory * factory,
return
gst_element_factory_can_accept_all_caps_in_direction
(
factory
,
caps
,
GST_PAD_SRC
);
}
#endif
/* GST_REMOVE_DEPRECATED */
/**
* gst_element_factory_can_sink_caps:
...
...
@@ -1352,6 +1357,11 @@ gst_element_factory_can_src_caps (GstElementFactory * factory,
*
* Deprecated: use gst_element_factory_can_sink_all_caps() instead.
*/
#ifndef GST_REMOVE_DEPRECATED
#ifdef GST_DISABLE_DEPRECATED
gboolean
gst_element_factory_can_sink_caps
(
GstElementFactory
*
factory
,
const
GstCaps
*
caps
);
#endif
gboolean
gst_element_factory_can_sink_caps
(
GstElementFactory
*
factory
,
const
GstCaps
*
caps
)
...
...
@@ -1359,7 +1369,7 @@ gst_element_factory_can_sink_caps (GstElementFactory * factory,
return
gst_element_factory_can_accept_all_caps_in_direction
(
factory
,
caps
,
GST_PAD_SINK
);
}
#endif
/* GST_
DISABL
E_DEPRECATED */
#endif
/* GST_
REMOV
E_DEPRECATED */
/**
* gst_element_factory_can_sink_all_caps:
...
...
tests/check/gst/gstbufferlist.c
View file @
4e16347b
...
...
@@ -783,7 +783,14 @@ GST_START_TEST (test_list)
gst_buffer_list_iterator_add_group
(
it
);
gst_buffer_list_iterator_add_list
(
it
,
l
);
for
(
i
=
0
;
i
<
10
;
i
++
)
{
/* add a buffer */
gst_buffer_list_iterator_add
(
it
,
buffer_from_string
(
"10"
));
/* add another list */
l
=
g_list_append
(
NULL
,
buffer_from_string
(
"11"
));
gst_buffer_list_iterator_add_list
(
it
,
l
);
for
(
i
=
0
;
i
<
12
;
i
++
)
{
GstBuffer
*
buf
;
gchar
name
[
10
];
...
...
win32/common/libgstreamer.def
View file @
4e16347b
...
...
@@ -303,12 +303,12 @@ EXPORTS
gst_element_class_set_metadata
gst_element_continue_state
gst_element_create_all_pads
gst_element_factory_can_sink_caps
gst_element_factory_can_src_caps
gst_element_factory_can_sink_all_caps
gst_element_factory_can_sink_any_caps
gst_element_factory_can_sink_caps
gst_element_factory_can_src_all_caps
gst_element_factory_can_src_any_caps
gst_element_factory_can_src_caps
gst_element_factory_create
gst_element_factory_find
gst_element_factory_get_element_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