mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
gst/playback/gstdecodebin.c: Fix typo in a debug statement.
Original commit message from CVS: * gst/playback/gstdecodebin.c: (close_pad_link): Fix typo in a debug statement. * gst/playback/gstplaybasebin.c: (probe_triggered), (new_decoded_pad_full), (new_decoded_pad), (subs_new_decoded_pad), (gen_source_element), (source_new_pad), (analyse_source), (setup_source): When handling no_more_pads in new_decoded_pad, make sure to treat subtitle pads correctly. Fixes playback with subtitle files. Move a recurring message to LOG level. * sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support): The maximum value for the Xv colorkey on this Radeon is 0xFFFFFFFF, which ends up as -1 when cast to an int. Make the logic handle the max value as an unsigned mask and only change the colorkey when it's a value we recognise.
This commit is contained in:
parent
306ab03865
commit
e2a039a53e
4 changed files with 83 additions and 23 deletions
20
ChangeLog
20
ChangeLog
|
@ -1,3 +1,23 @@
|
||||||
|
2006-09-30 Jan Schmidt <thaytan@mad.scientist.com>
|
||||||
|
|
||||||
|
* gst/playback/gstdecodebin.c: (close_pad_link):
|
||||||
|
Fix typo in a debug statement.
|
||||||
|
|
||||||
|
* gst/playback/gstplaybasebin.c: (probe_triggered),
|
||||||
|
(new_decoded_pad_full), (new_decoded_pad), (subs_new_decoded_pad),
|
||||||
|
(gen_source_element), (source_new_pad), (analyse_source),
|
||||||
|
(setup_source):
|
||||||
|
When handling no_more_pads in new_decoded_pad, make sure to treat
|
||||||
|
subtitle pads correctly. Fixes playback with subtitle files.
|
||||||
|
|
||||||
|
Move a recurring message to LOG level.
|
||||||
|
|
||||||
|
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support):
|
||||||
|
The maximum value for the Xv colorkey on this Radeon is 0xFFFFFFFF,
|
||||||
|
which ends up as -1 when cast to an int. Make the logic handle the
|
||||||
|
max value as an unsigned mask and only change the colorkey when it's
|
||||||
|
a value we recognise.
|
||||||
|
|
||||||
2006-09-29 Philippe Kalaf <philippe.kalaf@collabora.co.uk>
|
2006-09-29 Philippe Kalaf <philippe.kalaf@collabora.co.uk>
|
||||||
|
|
||||||
* gst-libs/gst/rtp/gstbasertpaudiopayload.c:
|
* gst-libs/gst/rtp/gstbasertpaudiopayload.c:
|
||||||
|
|
|
@ -736,7 +736,7 @@ close_pad_link (GstElement * element, GstPad * pad, GstCaps * caps,
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
unknown_type:
|
unknown_type:
|
||||||
{
|
{
|
||||||
GST_LOG_OBJECT (pad, "unkown type found, fire signal");
|
GST_LOG_OBJECT (pad, "unknown type found, fire signal");
|
||||||
g_signal_emit (G_OBJECT (decode_bin),
|
g_signal_emit (G_OBJECT (decode_bin),
|
||||||
gst_decode_bin_signals[SIGNAL_UNKNOWN_TYPE], 0, pad, caps);
|
gst_decode_bin_signals[SIGNAL_UNKNOWN_TYPE], 0, pad, caps);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -993,7 +993,7 @@ probe_triggered (GstPad * pad, GstEvent * event, gpointer user_data)
|
||||||
|
|
||||||
type = GST_EVENT_TYPE (event);
|
type = GST_EVENT_TYPE (event);
|
||||||
|
|
||||||
GST_DEBUG ("probe triggered, (%d) %s", type, gst_event_type_get_name (type));
|
GST_LOG ("probe triggered, (%d) %s", type, gst_event_type_get_name (type));
|
||||||
|
|
||||||
/* we only care about EOS */
|
/* we only care about EOS */
|
||||||
if (type != GST_EVENT_EOS)
|
if (type != GST_EVENT_EOS)
|
||||||
|
@ -1135,12 +1135,13 @@ silence_stream (GstPad * pad, GstMiniObject * data, gpointer user_data)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* signal fired when decodebin has found a new raw pad. We create
|
/* Called by the signal handlers when a decodebin (main or subtitle) has
|
||||||
* a preroll element if needed and the appropriate streaminfo.
|
* found a new raw pad. We create a preroll element if needed and the
|
||||||
*/
|
* appropriate streaminfo. Commits the group if there will be no more pads
|
||||||
|
* from decodebin */
|
||||||
static void
|
static void
|
||||||
new_decoded_pad (GstElement * element, GstPad * pad, gboolean last,
|
new_decoded_pad_full (GstElement * element, GstPad * pad, gboolean last,
|
||||||
GstPlayBaseBin * play_base_bin)
|
GstPlayBaseBin * play_base_bin, gboolean is_subs)
|
||||||
{
|
{
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
const gchar *mimetype;
|
const gchar *mimetype;
|
||||||
|
@ -1152,7 +1153,7 @@ new_decoded_pad (GstElement * element, GstPad * pad, gboolean last,
|
||||||
guint sig;
|
guint sig;
|
||||||
GstObject *parent;
|
GstObject *parent;
|
||||||
|
|
||||||
GST_DEBUG ("play base: new decoded pad %d", last);
|
GST_DEBUG ("play base: new decoded pad. Last: %d", last);
|
||||||
|
|
||||||
/* first see if this pad has interesting caps */
|
/* first see if this pad has interesting caps */
|
||||||
caps = gst_pad_get_caps (pad);
|
caps = gst_pad_get_caps (pad);
|
||||||
|
@ -1227,7 +1228,7 @@ new_decoded_pad (GstElement * element, GstPad * pad, gboolean last,
|
||||||
|
|
||||||
/* signal the no more pads after adding the stream */
|
/* signal the no more pads after adding the stream */
|
||||||
if (last)
|
if (last)
|
||||||
no_more_pads (element, play_base_bin);
|
no_more_pads_full (element, is_subs, play_base_bin);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1241,6 +1242,20 @@ no_type:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
new_decoded_pad (GstElement * element, GstPad * pad, gboolean last,
|
||||||
|
GstPlayBaseBin * play_base_bin)
|
||||||
|
{
|
||||||
|
new_decoded_pad_full (element, pad, last, play_base_bin, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
subs_new_decoded_pad (GstElement * element, GstPad * pad, gboolean last,
|
||||||
|
GstPlayBaseBin * play_base_bin)
|
||||||
|
{
|
||||||
|
new_decoded_pad_full (element, pad, last, play_base_bin, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_encoding_element (GstElement * element, gchar * encoding)
|
set_encoding_element (GstElement * element, gchar * encoding)
|
||||||
{
|
{
|
||||||
|
@ -1392,6 +1407,8 @@ gen_source_element (GstPlayBaseBin * play_base_bin, GstElement ** subbin)
|
||||||
goto uri_blacklisted;
|
goto uri_blacklisted;
|
||||||
|
|
||||||
if (play_base_bin->suburi) {
|
if (play_base_bin->suburi) {
|
||||||
|
GST_LOG_OBJECT (play_base_bin, "Creating decoder for subtitles URI %s",
|
||||||
|
play_base_bin->suburi);
|
||||||
/* subtitle specified */
|
/* subtitle specified */
|
||||||
*subbin = setup_subtitle (play_base_bin, play_base_bin->suburi);
|
*subbin = setup_subtitle (play_base_bin, play_base_bin->suburi);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1464,7 +1481,7 @@ source_new_pad (GstElement * element, GstPad * pad, GstPlayBaseBin * bin)
|
||||||
/* if this is a pad with all raw caps, we can expose it */
|
/* if this is a pad with all raw caps, we can expose it */
|
||||||
if (has_all_raw_caps (pad, &is_raw) && is_raw) {
|
if (has_all_raw_caps (pad, &is_raw) && is_raw) {
|
||||||
/* it's all raw, create output pads. */
|
/* it's all raw, create output pads. */
|
||||||
new_decoded_pad (element, pad, FALSE, bin);
|
new_decoded_pad_full (element, pad, FALSE, bin, FALSE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1655,7 +1672,8 @@ analyse_source (GstPlayBaseBin * play_base_bin, gboolean * is_raw,
|
||||||
|
|
||||||
/* caps on source pad are all raw, we can add the pad */
|
/* caps on source pad are all raw, we can add the pad */
|
||||||
if (*is_raw)
|
if (*is_raw)
|
||||||
new_decoded_pad (play_base_bin->source, pad, FALSE, play_base_bin);
|
new_decoded_pad_full (play_base_bin->source, pad, FALSE,
|
||||||
|
play_base_bin, FALSE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1806,7 +1824,7 @@ setup_source (GstPlayBaseBin * play_base_bin, gchar ** new_location)
|
||||||
|
|
||||||
/* do type detection, without adding (so no preroll) */
|
/* do type detection, without adding (so no preroll) */
|
||||||
g_signal_connect (G_OBJECT (db), "new-decoded-pad",
|
g_signal_connect (G_OBJECT (db), "new-decoded-pad",
|
||||||
G_CALLBACK (new_decoded_pad), play_base_bin);
|
G_CALLBACK (subs_new_decoded_pad), play_base_bin);
|
||||||
g_signal_connect (G_OBJECT (db), "no-more-pads",
|
g_signal_connect (G_OBJECT (db), "no-more-pads",
|
||||||
G_CALLBACK (sub_no_more_pads), play_base_bin);
|
G_CALLBACK (sub_no_more_pads), play_base_bin);
|
||||||
g_signal_connect (G_OBJECT (db), "unknown-type",
|
g_signal_connect (G_OBJECT (db), "unknown-type",
|
||||||
|
|
|
@ -1191,21 +1191,43 @@ gst_xvimagesink_get_xv_support (GstXvImageSink * xvimagesink,
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
if (!strcmp (attr[i].name, colorkey)) {
|
if (!strcmp (attr[i].name, colorkey)) {
|
||||||
const Atom atom = XInternAtom (xcontext->disp, colorkey, False);
|
const Atom atom = XInternAtom (xcontext->disp, colorkey, False);
|
||||||
int ckey;
|
guint32 ckey;
|
||||||
|
guint32 keymask;
|
||||||
|
gint bits;
|
||||||
|
gboolean set_attr = TRUE;
|
||||||
|
|
||||||
|
/* Count the bits in the colorkey mask 'max' value */
|
||||||
|
bits = 0;
|
||||||
|
for (keymask = (guint32) (attr[i].max_value);
|
||||||
|
keymask != 0; keymask >>= 1)
|
||||||
|
bits++;
|
||||||
|
|
||||||
/* set a colorkey in the right format RGB565/RGB888
|
/* set a colorkey in the right format RGB565/RGB888
|
||||||
* note that the colorkey is independent from the display depth (xcontext->depth)
|
* note that the colorkey is independent from the display
|
||||||
*/
|
* depth (xcontext->depth). We only handle these 2 cases, because
|
||||||
ckey =
|
* they're the only types of devices we've encountered. If we don't
|
||||||
attr[i].max_value <=
|
* recognise it, leave it alone */
|
||||||
0xffff ? ((1 << 10) | (2 << 5) | 3) : ((1 << 16) | (2 << 8) | 3);
|
if (bits == 16)
|
||||||
ckey = CLAMP (ckey, attr[i].min_value, attr[i].max_value);
|
ckey = (1 << 10) | (2 << 5) | 3;
|
||||||
|
else if (bits == 24 || bits == 32)
|
||||||
|
ckey = (1 << 16) | (2 << 8) | 3;
|
||||||
|
else
|
||||||
|
set_attr = FALSE;
|
||||||
|
|
||||||
|
|
||||||
|
if (set_attr) {
|
||||||
|
ckey = CLAMP (ckey, (guint32) attr[i].min_value,
|
||||||
|
(guint32) attr[i].max_value);
|
||||||
GST_LOG_OBJECT (xvimagesink,
|
GST_LOG_OBJECT (xvimagesink,
|
||||||
"Setting color key for display depth %d to 0x%x",
|
"Setting color key for display depth %d to 0x%x",
|
||||||
xcontext->depth, ckey);
|
xcontext->depth, ckey);
|
||||||
|
|
||||||
XvSetPortAttribute (xcontext->disp, xcontext->xv_port_id, atom, ckey);
|
XvSetPortAttribute (xcontext->disp, xcontext->xv_port_id, atom,
|
||||||
|
(gint) ckey);
|
||||||
|
} else {
|
||||||
|
GST_LOG_OBJECT (xvimagesink,
|
||||||
|
"Unknown bit depth for Xv Colorkey - not adjusting ");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue