mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 00:31:13 +00:00
gst-libs/gst/interfaces/mixer.c: De-cruft and fix message type assertions (NULL is not a really valid mixer message t...
Original commit message from CVS: * gst-libs/gst/interfaces/mixer.c: (GST_MIXER_MESSAGE_HAS_TYPE), (gst_mixer_message_parse_mute_toggled), (gst_mixer_message_parse_record_toggled), (gst_mixer_message_parse_volume_changed), (gst_mixer_message_parse_option_changed): De-cruft and fix message type assertions (NULL is not a really valid mixer message type string).
This commit is contained in:
parent
bdf20026e8
commit
ca1b8db04a
3 changed files with 22 additions and 17 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2008-02-29 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
|
* gst-libs/gst/interfaces/mixer.c: (GST_MIXER_MESSAGE_HAS_TYPE),
|
||||||
|
(gst_mixer_message_parse_mute_toggled),
|
||||||
|
(gst_mixer_message_parse_record_toggled),
|
||||||
|
(gst_mixer_message_parse_volume_changed),
|
||||||
|
(gst_mixer_message_parse_option_changed):
|
||||||
|
De-cruft and fix message type assertions (NULL is not a really
|
||||||
|
valid mixer message type string).
|
||||||
|
|
||||||
2008-02-29 Wim Taymans <wim.taymans@collabora.co.uk>
|
2008-02-29 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
* ext/libvisual/visual.c: (gst_vis_src_negotiate):
|
* ext/libvisual/visual.c: (gst_vis_src_negotiate):
|
||||||
|
|
2
common
2
common
|
@ -1 +1 @@
|
||||||
Subproject commit e746d20ef536a73aea9964666c7d5f6d5c9465df
|
Subproject commit 4fa1159996900100f3a1cd3b43d7f0f027310cdb
|
|
@ -549,6 +549,9 @@ gst_mixer_message_get_type (GstMessage * message)
|
||||||
return GST_MIXER_MESSAGE_INVALID;
|
return GST_MIXER_MESSAGE_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define GST_MIXER_MESSAGE_HAS_TYPE(msg,msg_type) \
|
||||||
|
(gst_mixer_message_get_type (msg) == GST_MIXER_MESSAGE_ ## msg_type)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_mixer_message_parse_mute_toggled:
|
* gst_mixer_message_parse_mute_toggled:
|
||||||
* @message: A mute-toggled change notification message.
|
* @message: A mute-toggled change notification message.
|
||||||
|
@ -568,13 +571,11 @@ gst_mixer_message_parse_mute_toggled (GstMessage * message,
|
||||||
GstMixerTrack ** track, gboolean * mute)
|
GstMixerTrack ** track, gboolean * mute)
|
||||||
{
|
{
|
||||||
const GstStructure *s;
|
const GstStructure *s;
|
||||||
const gchar *m_type;
|
|
||||||
|
|
||||||
g_return_if_fail (gst_mixer_message_is_mixer_message (message));
|
g_return_if_fail (gst_mixer_message_is_mixer_message (message));
|
||||||
s = gst_message_get_structure (message);
|
g_return_if_fail (GST_MIXER_MESSAGE_HAS_TYPE (message, MUTE_TOGGLED));
|
||||||
|
|
||||||
m_type = gst_structure_get_string (s, "type");
|
s = gst_message_get_structure (message);
|
||||||
g_return_if_fail (m_type == NULL || g_str_equal (m_type, "mute-toggled"));
|
|
||||||
|
|
||||||
if (track) {
|
if (track) {
|
||||||
const GValue *v = gst_structure_get_value (s, "track");
|
const GValue *v = gst_structure_get_value (s, "track");
|
||||||
|
@ -607,13 +608,11 @@ gst_mixer_message_parse_record_toggled (GstMessage * message,
|
||||||
GstMixerTrack ** track, gboolean * record)
|
GstMixerTrack ** track, gboolean * record)
|
||||||
{
|
{
|
||||||
const GstStructure *s;
|
const GstStructure *s;
|
||||||
const gchar *m_type;
|
|
||||||
|
|
||||||
g_return_if_fail (gst_mixer_message_is_mixer_message (message));
|
g_return_if_fail (gst_mixer_message_is_mixer_message (message));
|
||||||
s = gst_message_get_structure (message);
|
g_return_if_fail (GST_MIXER_MESSAGE_HAS_TYPE (message, RECORD_TOGGLED));
|
||||||
|
|
||||||
m_type = gst_structure_get_string (s, "type");
|
s = gst_message_get_structure (message);
|
||||||
g_return_if_fail (m_type == NULL || g_str_equal (m_type, "record-toggled"));
|
|
||||||
|
|
||||||
if (track) {
|
if (track) {
|
||||||
const GValue *v = gst_structure_get_value (s, "track");
|
const GValue *v = gst_structure_get_value (s, "track");
|
||||||
|
@ -649,13 +648,11 @@ gst_mixer_message_parse_volume_changed (GstMessage * message,
|
||||||
GstMixerTrack ** track, gint ** volumes, gint * num_channels)
|
GstMixerTrack ** track, gint ** volumes, gint * num_channels)
|
||||||
{
|
{
|
||||||
const GstStructure *s;
|
const GstStructure *s;
|
||||||
const gchar *m_type;
|
|
||||||
|
|
||||||
g_return_if_fail (gst_mixer_message_is_mixer_message (message));
|
g_return_if_fail (gst_mixer_message_is_mixer_message (message));
|
||||||
s = gst_message_get_structure (message);
|
g_return_if_fail (GST_MIXER_MESSAGE_HAS_TYPE (message, VOLUME_CHANGED));
|
||||||
|
|
||||||
m_type = gst_structure_get_string (s, "type");
|
s = gst_message_get_structure (message);
|
||||||
g_return_if_fail (m_type == NULL || g_str_equal (m_type, "volume-changed"));
|
|
||||||
|
|
||||||
if (track) {
|
if (track) {
|
||||||
const GValue *v = gst_structure_get_value (s, "track");
|
const GValue *v = gst_structure_get_value (s, "track");
|
||||||
|
@ -706,13 +703,11 @@ gst_mixer_message_parse_option_changed (GstMessage * message,
|
||||||
GstMixerOptions ** options, const gchar ** value)
|
GstMixerOptions ** options, const gchar ** value)
|
||||||
{
|
{
|
||||||
const GstStructure *s;
|
const GstStructure *s;
|
||||||
const gchar *m_type;
|
|
||||||
|
|
||||||
g_return_if_fail (gst_mixer_message_is_mixer_message (message));
|
g_return_if_fail (gst_mixer_message_is_mixer_message (message));
|
||||||
s = gst_message_get_structure (message);
|
g_return_if_fail (GST_MIXER_MESSAGE_HAS_TYPE (message, OPTION_CHANGED));
|
||||||
|
|
||||||
m_type = gst_structure_get_string (s, "type");
|
s = gst_message_get_structure (message);
|
||||||
g_return_if_fail (m_type == NULL || g_str_equal (m_type, "option-changed"));
|
|
||||||
|
|
||||||
if (options) {
|
if (options) {
|
||||||
const GValue *v = gst_structure_get_value (s, "options");
|
const GValue *v = gst_structure_get_value (s, "options");
|
||||||
|
|
Loading…
Reference in a new issue