diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2021-04-21 15:54:14 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.com> | 2021-05-13 15:05:00 -0400 |
commit | 4c3270409d956793fa3c85f11a4fffacbc6f3176 (patch) | |
tree | ce2aa0b511c0a081017ac71afa0a99e76491f36e /gst-libs/gst | |
parent | 97a78a903ac913b90c8f45ce4e86def7d1047e0d (diff) | |
download | gstreamer-plugins-bad-4c3270409d956793fa3c85f11a4fffacbc6f3176.tar.gz |
webrtc rtptransceiver: Implement "codec-preferences" property
This allows safer access to the internals of the codec-preferences
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2183>
Diffstat (limited to 'gst-libs/gst')
-rw-r--r-- | gst-libs/gst/webrtc/rtptransceiver.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gst-libs/gst/webrtc/rtptransceiver.c b/gst-libs/gst/webrtc/rtptransceiver.c index 6864d5f87..60c4143b5 100644 --- a/gst-libs/gst/webrtc/rtptransceiver.c +++ b/gst-libs/gst/webrtc/rtptransceiver.c @@ -58,6 +58,7 @@ enum PROP_MID, PROP_CURRENT_DIRECTION, PROP_KIND, + PROP_CODEC_PREFERENCES, PROP_STOPPED, // FIXME }; @@ -82,6 +83,9 @@ gst_webrtc_rtp_transceiver_set_property (GObject * object, guint prop_id, case PROP_DIRECTION: webrtc->direction = g_value_get_enum (value); break; + case PROP_CODEC_PREFERENCES: + gst_caps_replace (&webrtc->codec_preferences, g_value_get_boxed (value)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -116,6 +120,9 @@ gst_webrtc_rtp_transceiver_get_property (GObject * object, guint prop_id, case PROP_KIND: g_value_set_enum (value, webrtc->kind); break; + case PROP_CODEC_PREFERENCES: + gst_value_set_caps (value, webrtc->codec_preferences); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -264,6 +271,19 @@ gst_webrtc_rtp_transceiver_class_init (GstWebRTCRTPTransceiverClass * klass) "Kind of media this transceiver transports", GST_TYPE_WEBRTC_KIND, GST_WEBRTC_KIND_UNKNOWN, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + /** + * GstWebRTCRTPTransceiver:codec-preferences: + * + * Caps representing the codec preferences. + * + * Since: 1.20 + **/ + g_object_class_install_property (gobject_class, + PROP_CODEC_PREFERENCES, + g_param_spec_boxed ("codec-preferences", "Codec Preferences", + "Caps representing the codec preferences.", + GST_TYPE_CAPS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); } static void |