mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-06 07:28:53 +00:00
gst-libs/gst/play/gstplay.c: When analyzing the pads of an element the bin is mostly in READY state so no caps were n...
Original commit message from CVS: 2004-01-12 Julien MOUTTE <julien@moutte.net> * gst-libs/gst/play/gstplay.c: (gst_play_get_sink_element): When analyzing the pads of an element the bin is mostly in READY state so no caps were negotiated. This helper function needs to work with _get_caps directly then. I was not freeing them though, added that to fix the mem leak.
This commit is contained in:
parent
3031f4ae35
commit
10b53458ad
3 changed files with 18 additions and 6 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2004-01-12 Julien MOUTTE <julien@moutte.net>
|
||||||
|
|
||||||
|
* gst-libs/gst/play/gstplay.c: (gst_play_get_sink_element): When
|
||||||
|
analyzing the pads of an element the bin is mostly in READY state so
|
||||||
|
no caps were negotiated. This helper function needs to work with
|
||||||
|
_get_caps directly then. I was not freeing them though, added that to
|
||||||
|
fix the mem leak.
|
||||||
|
|
||||||
2004-01-12 Julien MOUTTE <julien@moutte.net>
|
2004-01-12 Julien MOUTTE <julien@moutte.net>
|
||||||
|
|
||||||
* sys/ximage/ximagesink.c: (gst_ximagesink_chain):
|
* sys/ximage/ximagesink.c: (gst_ximagesink_chain):
|
||||||
|
|
|
@ -923,14 +923,14 @@ gst_play_get_sink_element (GstPlay *play,
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* If not a src pad checking caps */
|
/* If not a src pad checking caps */
|
||||||
const GstCaps *caps;
|
GstCaps *caps;
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
gboolean has_video_cap = FALSE;
|
gboolean has_video_cap = FALSE;
|
||||||
gboolean has_audio_cap = FALSE;
|
gboolean has_audio_cap = FALSE;
|
||||||
|
|
||||||
caps = gst_pad_get_negotiated_caps (GST_PAD (pads->data));
|
caps = gst_pad_get_caps (GST_PAD (pads->data));
|
||||||
structure = gst_caps_get_structure (caps, 0);
|
structure = gst_caps_get_structure (caps, 0);
|
||||||
|
|
||||||
if (strcmp (gst_structure_get_name (structure),
|
if (strcmp (gst_structure_get_name (structure),
|
||||||
"audio/x-raw-int") == 0) {
|
"audio/x-raw-int") == 0) {
|
||||||
has_audio_cap = TRUE;
|
has_audio_cap = TRUE;
|
||||||
|
@ -943,6 +943,8 @@ gst_play_get_sink_element (GstPlay *play,
|
||||||
has_video_cap = TRUE;
|
has_video_cap = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gst_caps_free (caps);
|
||||||
|
|
||||||
switch (sink_type) {
|
switch (sink_type) {
|
||||||
case GST_PLAY_SINK_TYPE_AUDIO:
|
case GST_PLAY_SINK_TYPE_AUDIO:
|
||||||
if (has_audio_cap)
|
if (has_audio_cap)
|
||||||
|
|
|
@ -923,14 +923,14 @@ gst_play_get_sink_element (GstPlay *play,
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* If not a src pad checking caps */
|
/* If not a src pad checking caps */
|
||||||
const GstCaps *caps;
|
GstCaps *caps;
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
gboolean has_video_cap = FALSE;
|
gboolean has_video_cap = FALSE;
|
||||||
gboolean has_audio_cap = FALSE;
|
gboolean has_audio_cap = FALSE;
|
||||||
|
|
||||||
caps = gst_pad_get_negotiated_caps (GST_PAD (pads->data));
|
caps = gst_pad_get_caps (GST_PAD (pads->data));
|
||||||
structure = gst_caps_get_structure (caps, 0);
|
structure = gst_caps_get_structure (caps, 0);
|
||||||
|
|
||||||
if (strcmp (gst_structure_get_name (structure),
|
if (strcmp (gst_structure_get_name (structure),
|
||||||
"audio/x-raw-int") == 0) {
|
"audio/x-raw-int") == 0) {
|
||||||
has_audio_cap = TRUE;
|
has_audio_cap = TRUE;
|
||||||
|
@ -943,6 +943,8 @@ gst_play_get_sink_element (GstPlay *play,
|
||||||
has_video_cap = TRUE;
|
has_video_cap = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gst_caps_free (caps);
|
||||||
|
|
||||||
switch (sink_type) {
|
switch (sink_type) {
|
||||||
case GST_PLAY_SINK_TYPE_AUDIO:
|
case GST_PLAY_SINK_TYPE_AUDIO:
|
||||||
if (has_audio_cap)
|
if (has_audio_cap)
|
||||||
|
|
Loading…
Reference in a new issue