예제 #1
0
static void
kms_sdp_media_handler_get_property (GObject * object, guint prop_id,
    GValue * value, GParamSpec * pspec)
{
  KmsSdpMediaHandler *self = KMS_SDP_MEDIA_HANDLER (object);

  switch (prop_id) {
    case PROP_ID:
      g_value_set_int (value, self->priv->id);
      break;
    case PROP_INDEX:{
      gint ret = -1;

      if (self->priv->id >= 0 && self->priv->parent != NULL) {
        ret = kms_sdp_agent_get_handler_index (self->priv->parent,
            self->priv->id);
      }

      g_value_set_int (value, ret);
      break;
    }
    case PROP_PROTO:
      g_value_set_string (value, self->priv->proto);
      break;
    case PROP_ADDR:
      g_value_set_string (value, self->priv->addr);
      break;
    case PROP_ADDR_TYPE:
      g_value_set_string (value, self->priv->addr_type);
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
      break;
  }
}
예제 #2
0
/* Media handler management begin */
static void
kms_rtp_endpoint_create_media_handler (KmsBaseSdpEndpoint * base_sdp,
    const gchar * media, KmsSdpMediaHandler ** handler)
{
  if (g_strcmp0 (media, "audio") == 0 || g_strcmp0 (media, "video") == 0) {
    *handler = KMS_SDP_MEDIA_HANDLER (kms_sdp_rtp_avpf_media_handler_new ());
  }

  /* Chain up */
  KMS_BASE_SDP_ENDPOINT_CLASS
      (kms_rtp_endpoint_parent_class)->create_media_handler (base_sdp, media,
      handler);
}
예제 #3
0
static void
kms_sdp_media_handler_finalize (GObject * object)
{
  KmsSdpMediaHandler *self = KMS_SDP_MEDIA_HANDLER (object);

  GST_DEBUG_OBJECT (self, "finalize");

  g_free (self->priv->proto);
  g_free (self->priv->addr);
  g_free (self->priv->addr_type);

  g_array_free (self->priv->bwtypes, TRUE);
  g_slist_free_full (self->priv->extensions, g_object_unref);

  G_OBJECT_CLASS (parent_class)->finalize (object);
}
예제 #4
0
static void
kms_sdp_media_handler_set_property (GObject * object, guint prop_id,
    const GValue * value, GParamSpec * pspec)
{
  KmsSdpMediaHandler *self = KMS_SDP_MEDIA_HANDLER (object);

  switch (prop_id) {
    case PROP_PROTO:
      g_free (self->priv->proto);
      self->priv->proto = g_value_dup_string (value);
      break;
    case PROP_ADDR:
      g_free (self->priv->addr);
      self->priv->addr = g_value_dup_string (value);
      break;
    case PROP_ADDR_TYPE:
      g_free (self->priv->addr_type);
      self->priv->addr_type = g_value_dup_string (value);
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
      break;
  }
}