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
d805f0f0
Commit
d805f0f0
authored
Nov 15, 2011
by
Wim Taymans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pad: _get_caps() -> _query_caps()
parent
28b14092
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
40 additions
and
41 deletions
+40
-41
docs/gst/gstreamer-sections.txt
docs/gst/gstreamer-sections.txt
+1
-2
docs/manual/advanced-autoplugging.xml
docs/manual/advanced-autoplugging.xml
+3
-3
docs/manual/highlevel-components.xml
docs/manual/highlevel-components.xml
+1
-1
gst/gstpad.c
gst/gstpad.c
+11
-11
gst/gstpad.h
gst/gstpad.h
+2
-2
gst/gstutils.c
gst/gstutils.c
+4
-4
gst/gstutils.h
gst/gstutils.h
+3
-3
libs/gst/base/gstbasesrc.c
libs/gst/base/gstbasesrc.c
+1
-1
libs/gst/base/gstbasetransform.c
libs/gst/base/gstbasetransform.c
+4
-4
tests/check/elements/selector.c
tests/check/elements/selector.c
+1
-1
tests/check/elements/valve.c
tests/check/elements/valve.c
+2
-2
tests/check/gst/gstghostpad.c
tests/check/gst/gstghostpad.c
+4
-4
tests/check/gst/gstutils.c
tests/check/gst/gstutils.c
+3
-3
No files found.
docs/gst/gstreamer-sections.txt
View file @
d805f0f0
...
...
@@ -1589,8 +1589,7 @@ gst_pad_unlink
gst_pad_is_linked
gst_pad_can_link
gst_pad_get_caps
gst_pad_get_caps_reffed
gst_pad_query_caps
gst_pad_get_allowed_caps
gst_pad_get_current_caps
gst_pad_get_pad_template_caps
...
...
docs/manual/advanced-autoplugging.xml
View file @
d805f0f0
...
...
@@ -344,7 +344,7 @@ cb_newpad (GstElement *element,
{
GstCaps *caps;
caps = gst_pad_
get
_caps (pad, NULL);
caps = gst_pad_
query
_caps (pad, NULL);
try_to_plug (pad, caps);
gst_caps_unref (caps);
}
...
...
@@ -389,7 +389,7 @@ close_link (GstPad *srcpad,
switch (templ->presence) {
case GST_PAD_ALWAYS: {
GstPad *pad = gst_element_get_static_pad (sinkelement, templ->name_template);
GstCaps *caps = gst_pad_
get
_caps (pad, NULL);
GstCaps *caps = gst_pad_
query
_caps (pad, NULL);
/* link */
try_to_plug (pad, caps);
...
...
@@ -436,7 +436,7 @@ try_to_plug (GstPad *pad,
}
/* can it link to the audiopad? */
audiocaps = gst_pad_
get
_caps (gst_element_get_static_pad (audiosink, "sink"),
audiocaps = gst_pad_
query
_caps (gst_element_get_static_pad (audiosink, "sink"),
NULL);
res = gst_caps_intersect (caps, audiocaps);
if (res
&&
!gst_caps_is_empty (res)) {
...
...
docs/manual/highlevel-components.xml
View file @
d805f0f0
...
...
@@ -253,7 +253,7 @@ cb_newpad (GstElement *decodebin,
}
/* check media type */
caps = gst_pad_
get
_caps (pad, NULL);
caps = gst_pad_
query
_caps (pad, NULL);
str = gst_caps_get_structure (caps, 0);
if (!g_strrstr (gst_structure_get_name (str), "audio")) {
gst_caps_unref (caps);
...
...
gst/gstpad.c
View file @
d805f0f0
...
...
@@ -36,7 +36,7 @@
* gst_pad_new_from_template().
*
* Pads have #GstCaps attached to it to describe the media type they are
* capable of dealing with. gst_pad_
get
_caps() and gst_pad_set_caps() are
* capable of dealing with. gst_pad_
query
_caps() and gst_pad_set_caps() are
* used to manipulate the caps of the pads.
* Pads created from a pad template cannot set capabilities that are
* incompatible with the pad template capabilities.
...
...
@@ -1643,10 +1643,10 @@ gst_pad_link_check_compatible_unlocked (GstPad * src, GstPad * sink,
/* Doing the expensive caps checking takes priority over only checking the template caps */
if
(
flags
&
GST_PAD_LINK_CHECK_CAPS
)
{
GST_OBJECT_UNLOCK
(
src
);
srccaps
=
gst_pad_
get
_caps
(
src
,
NULL
);
srccaps
=
gst_pad_
query
_caps
(
src
,
NULL
);
GST_OBJECT_LOCK
(
src
);
GST_OBJECT_UNLOCK
(
sink
);
sinkcaps
=
gst_pad_
get
_caps
(
sink
,
NULL
);
sinkcaps
=
gst_pad_
query
_caps
(
sink
,
NULL
);
GST_OBJECT_LOCK
(
sink
);
}
else
{
/* If one of the two pads doesn't have a template, consider the intersection
...
...
@@ -2107,14 +2107,14 @@ gst_pad_get_current_caps (GstPad * pad)
}
/**
* gst_pad_
get
_caps:
* gst_pad_
query
_caps:
* @pad: a #GstPad to get the capabilities of.
* @filter: suggested #GstCaps.
*
* Gets the capabilities this pad can produce or consume.
* Note that this method doesn't necessarily return the caps set by
* gst_pad_set_caps() - use gst_pad_get_current_caps() for that instead.
* gst_pad_
get
_caps returns all possible caps a pad can operate with, using
* gst_pad_
query
_caps returns all possible caps a pad can operate with, using
* the pad's CAPS query function, If the query fails, this function will return
* @filter, if not #NULL, otherwise ANY.
*
...
...
@@ -2130,7 +2130,7 @@ gst_pad_get_current_caps (GstPad * pad)
* Returns: (transfer full): the caps of the pad with incremented ref-count.
*/
GstCaps
*
gst_pad_
get
_caps
(
GstPad
*
pad
,
GstCaps
*
filter
)
gst_pad_
query
_caps
(
GstPad
*
pad
,
GstCaps
*
filter
)
{
GstCaps
*
result
=
NULL
;
GstQuery
*
query
;
...
...
@@ -2162,7 +2162,7 @@ gst_pad_get_caps (GstPad * pad, GstCaps * filter)
* @filter: a #GstCaps filter.
*
* Gets the capabilities of the peer connected to this pad. Similar to
* gst_pad_
get
_caps().
* gst_pad_
query
_caps().
*
* When called on srcpads @filter contains the caps that
* upstream could produce in the order preferred by upstream. When
...
...
@@ -2462,7 +2462,7 @@ gst_pad_get_peer (GstPad * pad)
* @pad and its peer.
*
* The allowed capabilities is calculated as the intersection of the results of
* calling gst_pad_
get
_caps() on @pad and its peer. The caller owns a reference
* calling gst_pad_
query
_caps() on @pad and its peer. The caller owns a reference
* on the resulting caps.
*
* Returns: (transfer full): the allowed #GstCaps of the pad link. Unref the
...
...
@@ -2490,9 +2490,9 @@ gst_pad_get_allowed_caps (GstPad * pad)
gst_object_ref
(
peer
);
GST_OBJECT_UNLOCK
(
pad
);
mycaps
=
gst_pad_
get
_caps
(
pad
,
NULL
);
mycaps
=
gst_pad_
query
_caps
(
pad
,
NULL
);
peercaps
=
gst_pad_
get
_caps
(
peer
,
NULL
);
peercaps
=
gst_pad_
query
_caps
(
peer
,
NULL
);
gst_object_unref
(
peer
);
caps
=
gst_caps_intersect
(
mycaps
,
peercaps
);
...
...
@@ -2790,7 +2790,7 @@ gst_pad_query_accept_caps_default (GstPad * pad, GstQuery * query)
}
}
allowed
=
gst_pad_
get
_caps
(
pad
,
NULL
);
allowed
=
gst_pad_
query
_caps
(
pad
,
NULL
);
gst_query_parse_accept_caps
(
query
,
&
caps
);
if
(
allowed
)
{
...
...
gst/gstpad.h
View file @
d805f0f0
...
...
@@ -178,7 +178,7 @@ GQuark gst_flow_to_quark (GstFlowReturn ret);
* their template caps. This is much faster than @GST_PAD_LINK_CHECK_CAPS, but
* would be unsafe e.g. if one pad has %GST_CAPS_ANY.
* @GST_PAD_LINK_CHECK_CAPS: Check if the pads are compatible by comparing the
* caps returned by gst_pad_
get
_caps().
* caps returned by gst_pad_
query
_caps().
*
* The amount of checking to be done when linking pads. @GST_PAD_LINK_CHECK_CAPS
* and @GST_PAD_LINK_CHECK_TEMPLATE_CAPS are mutually exclusive. If both are
...
...
@@ -834,7 +834,7 @@ GstCaps* gst_pad_get_pad_template_caps (GstPad *pad);
/* capsnego function for linked/unlinked pads */
GstCaps
*
gst_pad_get_current_caps
(
GstPad
*
pad
);
gboolean
gst_pad_has_current_caps
(
GstPad
*
pad
);
GstCaps
*
gst_pad_
get
_caps
(
GstPad
*
pad
,
GstCaps
*
filter
);
GstCaps
*
gst_pad_
query
_caps
(
GstPad
*
pad
,
GstCaps
*
filter
);
gboolean
gst_pad_accept_caps
(
GstPad
*
pad
,
GstCaps
*
caps
);
gboolean
gst_pad_set_caps
(
GstPad
*
pad
,
GstCaps
*
caps
);
...
...
gst/gstutils.c
View file @
d805f0f0
...
...
@@ -1140,7 +1140,7 @@ gst_element_get_compatible_pad (GstElement * element, GstPad * pad,
gboolean
compatible
;
/* Now check if the two pads' caps are compatible */
temp
=
gst_pad_
get
_caps
(
pad
,
NULL
);
temp
=
gst_pad_
query
_caps
(
pad
,
NULL
);
if
(
caps
)
{
intersection
=
gst_caps_intersect
(
temp
,
caps
);
gst_caps_unref
(
temp
);
...
...
@@ -1148,7 +1148,7 @@ gst_element_get_compatible_pad (GstElement * element, GstPad * pad,
intersection
=
temp
;
}
temp
=
gst_pad_
get
_caps
(
current
,
NULL
);
temp
=
gst_pad_
query
_caps
(
current
,
NULL
);
compatible
=
gst_caps_can_intersect
(
temp
,
intersection
);
gst_caps_unref
(
temp
);
gst_caps_unref
(
intersection
);
...
...
@@ -1198,7 +1198,7 @@ gst_element_get_compatible_pad (GstElement * element, GstPad * pad,
/* try to create a new one */
/* requesting is a little crazy, we need a template. Let's create one */
/* FIXME: why not gst_pad_get_pad_template (pad); */
templcaps
=
gst_pad_
get
_caps
(
pad
,
NULL
);
templcaps
=
gst_pad_
query
_caps
(
pad
,
NULL
);
templ
=
gst_pad_template_new
((
gchar
*
)
GST_PAD_NAME
(
pad
),
GST_PAD_DIRECTION
(
pad
),
GST_PAD_ALWAYS
,
templcaps
);
gst_caps_unref
(
templcaps
);
...
...
@@ -2798,7 +2798,7 @@ query_caps_func (GstPad * pad, QueryCapsData * data)
* @pad: a #GstPad to proxy.
* @query: a CAPS #GstQuery.
*
* Calls gst_pad_
get
_caps() for all internally linked pads fof @pad and returns
* Calls gst_pad_
query
_caps() for all internally linked pads fof @pad and returns
* the intersection of the results.
*
* This function is useful as a default caps query function for an element
...
...
gst/gstutils.h
View file @
d805f0f0
...
...
@@ -891,12 +891,12 @@ void gst_element_class_install_std_props (GstElementClass * k
/* pad functions */
void
gst_pad_use_fixed_caps
(
GstPad
*
pad
);
gboolean
gst_pad_proxy_query_accept_caps
(
GstPad
*
pad
,
GstQuery
*
query
);
gboolean
gst_pad_proxy_query_caps
(
GstPad
*
pad
,
GstQuery
*
query
);
GstElement
*
gst_pad_get_parent_element
(
GstPad
*
pad
);
/* util query functions */
gboolean
gst_pad_proxy_query_accept_caps
(
GstPad
*
pad
,
GstQuery
*
query
);
gboolean
gst_pad_proxy_query_caps
(
GstPad
*
pad
,
GstQuery
*
query
);
gboolean
gst_pad_query_position
(
GstPad
*
pad
,
GstFormat
format
,
gint64
*
cur
);
gboolean
gst_pad_query_duration
(
GstPad
*
pad
,
GstFormat
format
,
gint64
*
duration
);
gboolean
gst_pad_query_convert
(
GstPad
*
pad
,
GstFormat
src_format
,
gint64
src_val
,
...
...
libs/gst/base/gstbasesrc.c
View file @
d805f0f0
...
...
@@ -2750,7 +2750,7 @@ gst_base_src_default_negotiate (GstBaseSrc * basesrc)
gboolean
result
=
FALSE
;
/* first see what is possible on our source pad */
thiscaps
=
gst_pad_
get
_caps
(
GST_BASE_SRC_PAD
(
basesrc
),
NULL
);
thiscaps
=
gst_pad_
query
_caps
(
GST_BASE_SRC_PAD
(
basesrc
),
NULL
);
GST_DEBUG_OBJECT
(
basesrc
,
"caps of src: %"
GST_PTR_FORMAT
,
thiscaps
);
/* nothing or anything is allowed, we're done */
if
(
thiscaps
==
NULL
||
gst_caps_is_any
(
thiscaps
))
...
...
libs/gst/base/gstbasetransform.c
View file @
d805f0f0
...
...
@@ -997,7 +997,7 @@ gst_base_transform_find_transform (GstBaseTransform * trans, GstPad * pad,
GST_DEBUG_OBJECT
(
trans
,
"Checking peer caps with filter %"
GST_PTR_FORMAT
,
othercaps
);
peercaps
=
gst_pad_
get
_caps
(
otherpeer
,
othercaps
);
peercaps
=
gst_pad_
query
_caps
(
otherpeer
,
othercaps
);
GST_DEBUG_OBJECT
(
trans
,
"Resulted in %"
GST_PTR_FORMAT
,
peercaps
);
templ_caps
=
gst_pad_get_pad_template_caps
(
otherpad
);
...
...
@@ -1126,12 +1126,12 @@ gst_base_transform_acceptcaps_default (GstBaseTransform * trans,
/* get all the formats we can handle on this pad */
if
(
direction
==
GST_PAD_SRC
)
allowed
=
gst_pad_
get
_caps
(
trans
->
srcpad
,
NULL
);
allowed
=
gst_pad_
query
_caps
(
trans
->
srcpad
,
NULL
);
else
allowed
=
gst_pad_
get
_caps
(
trans
->
sinkpad
,
NULL
);
allowed
=
gst_pad_
query
_caps
(
trans
->
sinkpad
,
NULL
);
if
(
!
allowed
)
{
GST_DEBUG_OBJECT
(
trans
,
"gst_pad_
get
_caps() failed"
);
GST_DEBUG_OBJECT
(
trans
,
"gst_pad_
query
_caps() failed"
);
goto
no_transform_possible
;
}
...
...
tests/check/elements/selector.c
View file @
d805f0f0
...
...
@@ -397,7 +397,7 @@ GST_START_TEST (test_output_selector_no_srcpad_negotiation);
* setcaps should accept any caps when there are no srcpads */
g_object_set
(
sel
,
"pad-negotiation-mode"
,
i
,
NULL
);
caps
=
gst_pad_
get
_caps
(
pad
,
NULL
);
caps
=
gst_pad_
query
_caps
(
pad
,
NULL
);
fail_unless
(
gst_caps_is_any
(
caps
));
gst_caps_unref
(
caps
);
...
...
tests/check/elements/valve.c
View file @
d805f0f0
...
...
@@ -70,7 +70,7 @@ GST_START_TEST (test_valve_basic)
fail_unless
(
gst_pad_push
(
src
,
gst_buffer_new
())
==
GST_FLOW_OK
);
fail_unless
(
gst_pad_push
(
src
,
gst_buffer_new
())
==
GST_FLOW_OK
);
fail_unless
(
g_list_length
(
buffers
)
==
2
);
caps
=
gst_pad_
get
_caps
(
src
,
NULL
);
caps
=
gst_pad_
query
_caps
(
src
,
NULL
);
templ_caps
=
gst_pad_get_pad_template_caps
(
src
);
fail_unless
(
caps
&&
gst_caps_is_equal
(
caps
,
templ_caps
));
gst_caps_unref
(
templ_caps
);
...
...
@@ -85,7 +85,7 @@ GST_START_TEST (test_valve_basic)
fail_unless
(
gst_pad_push
(
src
,
gst_buffer_new
())
==
GST_FLOW_OK
);
fail_unless
(
gst_pad_push
(
src
,
gst_buffer_new
())
==
GST_FLOW_OK
);
fail_unless
(
buffers
==
NULL
);
caps
=
gst_pad_
get
_caps
(
src
,
NULL
);
caps
=
gst_pad_
query
_caps
(
src
,
NULL
);
templ_caps
=
gst_pad_get_pad_template_caps
(
src
);
fail_unless
(
caps
&&
gst_caps_is_equal
(
caps
,
templ_caps
));
gst_caps_unref
(
templ_caps
);
...
...
tests/check/gst/gstghostpad.c
View file @
d805f0f0
...
...
@@ -190,7 +190,7 @@ GST_START_TEST (test_ghost_pads_notarget)
/* check caps, untargetted pad should return ANY or the padtemplate caps
* when it was created from a template */
caps
=
gst_pad_
get
_caps
(
srcpad
,
NULL
);
caps
=
gst_pad_
query
_caps
(
srcpad
,
NULL
);
fail_unless
(
gst_caps_is_any
(
caps
));
gst_caps_unref
(
caps
);
...
...
@@ -602,7 +602,7 @@ GST_START_TEST (test_ghost_pads_new_from_template)
fail_unless
(
GST_PAD_PAD_TEMPLATE
(
ghostpad
)
==
ghosttempl
);
/* check ghostpad caps are from the sinkpad */
newcaps
=
gst_pad_
get
_caps
(
ghostpad
,
NULL
);
newcaps
=
gst_pad_
query
_caps
(
ghostpad
,
NULL
);
fail_unless
(
newcaps
!=
NULL
);
fail_unless
(
gst_caps_is_equal
(
newcaps
,
padcaps
));
gst_caps_unref
(
newcaps
);
...
...
@@ -645,7 +645,7 @@ GST_START_TEST (test_ghost_pads_new_no_target_from_template)
fail_unless
(
GST_PAD_PAD_TEMPLATE
(
ghostpad
)
==
ghosttempl
);
/* check ghostpad caps are from the ghostpad template */
newcaps
=
gst_pad_
get
_caps
(
ghostpad
,
NULL
);
newcaps
=
gst_pad_
query
_caps
(
ghostpad
,
NULL
);
fail_unless
(
newcaps
!=
NULL
);
fail_unless
(
gst_caps_is_equal
(
newcaps
,
ghostcaps
));
gst_caps_unref
(
newcaps
);
...
...
@@ -653,7 +653,7 @@ GST_START_TEST (test_ghost_pads_new_no_target_from_template)
fail_unless
(
gst_ghost_pad_set_target
((
GstGhostPad
*
)
ghostpad
,
sinkpad
));
/* check ghostpad caps are now from the target pad */
newcaps
=
gst_pad_
get
_caps
(
ghostpad
,
NULL
);
newcaps
=
gst_pad_
query
_caps
(
ghostpad
,
NULL
);
fail_unless
(
newcaps
!=
NULL
);
fail_unless
(
gst_caps_is_equal
(
newcaps
,
padcaps
));
gst_caps_unref
(
newcaps
);
...
...
tests/check/gst/gstutils.c
View file @
d805f0f0
...
...
@@ -1000,7 +1000,7 @@ GST_START_TEST (test_pad_proxy_query_caps_aggregation)
gst_element_set_state
(
tee
,
GST_STATE_PAUSED
);
/* by default, ANY caps should intersect to ANY */
caps
=
gst_pad_
get
_caps
(
tee_sink
,
NULL
);
caps
=
gst_pad_
query
_caps
(
tee_sink
,
NULL
);
GST_INFO
(
"got caps: %"
GST_PTR_FORMAT
,
caps
);
fail_unless
(
caps
!=
NULL
);
fail_unless
(
gst_caps_is_any
(
caps
));
...
...
@@ -1017,7 +1017,7 @@ GST_START_TEST (test_pad_proxy_query_caps_aggregation)
gst_pad_use_fixed_caps
(
sink2_sink
);
gst_caps_unref
(
caps
);
caps
=
gst_pad_
get
_caps
(
tee_sink
,
NULL
);
caps
=
gst_pad_
query
_caps
(
tee_sink
,
NULL
);
GST_INFO
(
"got caps: %"
GST_PTR_FORMAT
,
caps
);
fail_unless
(
caps
!=
NULL
);
fail_unless
(
gst_caps_is_empty
(
caps
));
...
...
@@ -1029,7 +1029,7 @@ GST_START_TEST (test_pad_proxy_query_caps_aggregation)
gst_pad_use_fixed_caps
(
sink2_sink
);
gst_caps_unref
(
caps
);
caps
=
gst_pad_
get
_caps
(
tee_sink
,
NULL
);
caps
=
gst_pad_
query
_caps
(
tee_sink
,
NULL
);
GST_INFO
(
"got caps: %"
GST_PTR_FORMAT
,
caps
);
fail_unless
(
caps
!=
NULL
);
fail_if
(
gst_caps_is_empty
(
caps
));
...
...
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