avdtpsrc: Fix transport-volume write

If properties are proxied through GBinding this can work only if the
proxied property keeps it's own value. The previous implementation will
read the original value if the proxied property signals a change and
thus nothing will happen.
This commit is contained in:
Jochen Henneberg 2018-11-09 15:16:46 +00:00 committed by Sebastian Dröge
parent f401f4ca32
commit bac0e14eae
2 changed files with 8 additions and 4 deletions

View file

@ -36,6 +36,8 @@
GST_DEBUG_CATEGORY_STATIC (avdtpsrc_debug);
#define GST_CAT_DEFAULT (avdtpsrc_debug)
#define DEFAULT_VOLUME 127
enum
{
PROP_0,
@ -106,7 +108,7 @@ gst_avdtp_src_class_init (GstAvdtpSrcClass * klass)
g_param_spec_uint ("transport-volume",
"Transport volume",
"Volume of the transport (only valid if transport is acquired)",
0, 127, 127, G_PARAM_READWRITE));
0, 127, DEFAULT_VOLUME, G_PARAM_READWRITE));
gst_element_class_set_static_metadata (element_class,
"Bluetooth AVDTP Source",
@ -127,6 +129,7 @@ gst_avdtp_src_init (GstAvdtpSrc * avdtpsrc)
avdtpsrc->poll = gst_poll_new (TRUE);
avdtpsrc->duration = GST_CLOCK_TIME_NONE;
avdtpsrc->transport_volume = DEFAULT_VOLUME;
gst_base_src_set_format (GST_BASE_SRC (avdtpsrc), GST_FORMAT_TIME);
gst_base_src_set_live (GST_BASE_SRC (avdtpsrc), TRUE);
@ -157,8 +160,7 @@ gst_avdtp_src_get_property (GObject * object, guint prop_id,
break;
case PROP_TRANSPORT_VOLUME:
g_value_set_uint (value,
gst_avdtp_connection_get_volume (&avdtpsrc->conn));
g_value_set_uint (value, avdtpsrc->transport_volume);
break;
default:
@ -180,7 +182,7 @@ gst_avdtp_src_set_property (GObject * object, guint prop_id,
break;
case PROP_TRANSPORT_VOLUME:
/* This is no-op because setting is handled via a GBinding */
avdtpsrc->transport_volume = g_value_get_uint (value);
break;
default:

View file

@ -62,6 +62,8 @@ struct _GstAvdtpSrc
volatile gint unlocked;
GstClockTime duration;
guint transport_volume;
};
GType gst_avdtp_src_get_type (void);