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
1cff66d5
Commit
1cff66d5
authored
Apr 18, 2011
by
Sebastian Dröge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
base{sink,src}: Don't try to fixate ANY caps
parent
5020738a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
17 deletions
+23
-17
libs/gst/base/gstbasesink.c
libs/gst/base/gstbasesink.c
+14
-10
libs/gst/base/gstbasesrc.c
libs/gst/base/gstbasesrc.c
+9
-7
No files found.
libs/gst/base/gstbasesink.c
View file @
1cff66d5
...
...
@@ -4313,10 +4313,8 @@ gst_base_sink_negotiate_pull (GstBaseSink * basesink)
caps
=
gst_caps_make_writable
(
caps
);
/* get the first (prefered) format */
gst_caps_truncate
(
caps
);
/* try to fixate */
gst_pad_fixate_caps
(
GST_BASE_SINK_PAD
(
basesink
),
caps
);
GST_DEBUG_OBJECT
(
basesink
,
"
fixated to
: %"
GST_PTR_FORMAT
,
caps
);
GST_DEBUG_OBJECT
(
basesink
,
"
have caps
: %"
GST_PTR_FORMAT
,
caps
);
if
(
gst_caps_is_any
(
caps
))
{
GST_DEBUG_OBJECT
(
basesink
,
"caps were ANY after fixating, "
...
...
@@ -4324,15 +4322,21 @@ gst_base_sink_negotiate_pull (GstBaseSink * basesink)
/* neither side has template caps in this case, so they are prepared for
pull() without setcaps() */
result
=
TRUE
;
}
else
if
(
gst_caps_is_fixed
(
caps
))
{
if
(
!
gst_pad_set_caps
(
GST_BASE_SINK_PAD
(
basesink
),
caps
))
goto
could_not_set_caps
;
}
else
{
/* try to fixate */
gst_pad_fixate_caps
(
GST_BASE_SINK_PAD
(
basesink
),
caps
);
GST_DEBUG_OBJECT
(
basesink
,
"fixated to: %"
GST_PTR_FORMAT
,
caps
);
GST_OBJECT_LOCK
(
basesink
);
gst_caps_replace
(
&
basesink
->
priv
->
pull_caps
,
caps
)
;
GST_OBJECT_UNLOCK
(
basesink
)
;
if
(
gst_caps_is_fixed
(
caps
))
{
if
(
!
gst_pad_set_caps
(
GST_BASE_SINK_PAD
(
basesink
)
,
caps
)
)
goto
could_not_set_caps
;
result
=
TRUE
;
GST_OBJECT_LOCK
(
basesink
);
gst_caps_replace
(
&
basesink
->
priv
->
pull_caps
,
caps
);
GST_OBJECT_UNLOCK
(
basesink
);
result
=
TRUE
;
}
}
gst_caps_unref
(
caps
);
...
...
libs/gst/base/gstbasesrc.c
View file @
1cff66d5
...
...
@@ -2632,17 +2632,19 @@ gst_base_src_default_negotiate (GstBaseSrc * basesrc)
/* now fixate */
if
(
!
gst_caps_is_empty
(
caps
))
{
gst_pad_fixate_caps
(
GST_BASE_SRC_PAD
(
basesrc
),
caps
);
GST_DEBUG_OBJECT
(
basesrc
,
"fixated to: %"
GST_PTR_FORMAT
,
caps
);
GST_DEBUG_OBJECT
(
basesrc
,
"have caps: %"
GST_PTR_FORMAT
,
caps
);
if
(
gst_caps_is_any
(
caps
))
{
/* hmm, still anything, so element can do anything and
* nego is not needed */
result
=
TRUE
;
}
else
if
(
gst_caps_is_fixed
(
caps
))
{
/* yay, fixed caps, use those then, it's possible that the subclass does
* not accept this caps after all and we have to fail. */
result
=
gst_pad_set_caps
(
GST_BASE_SRC_PAD
(
basesrc
),
caps
);
}
else
{
gst_pad_fixate_caps
(
GST_BASE_SRC_PAD
(
basesrc
),
caps
);
GST_DEBUG_OBJECT
(
basesrc
,
"fixated to: %"
GST_PTR_FORMAT
,
caps
);
if
(
gst_caps_is_fixed
(
caps
))
{
/* yay, fixed caps, use those then, it's possible that the subclass does
* not accept this caps after all and we have to fail. */
result
=
gst_pad_set_caps
(
GST_BASE_SRC_PAD
(
basesrc
),
caps
);
}
}
}
gst_caps_unref
(
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