[farsight2/master] Remove useless proto_subtype and proto_profile fields in the candidates

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:20:27 PST 2008


---
 gst-libs/gst/farsight/fs-candidate.c               |   14 --------------
 gst-libs/gst/farsight/fs-candidate.h               |    8 --------
 tests/check/transmitter/rawudp.c                   |   11 -----------
 transmitters/rawudp/fs-rawudp-stream-transmitter.c |   15 ---------------
 4 files changed, 0 insertions(+), 48 deletions(-)

diff --git a/gst-libs/gst/farsight/fs-candidate.c b/gst-libs/gst/farsight/fs-candidate.c
index cb88d89..74e7904 100644
--- a/gst-libs/gst/farsight/fs-candidate.c
+++ b/gst-libs/gst/farsight/fs-candidate.c
@@ -82,10 +82,6 @@ fs_candidate_destroy (FsCandidate * cand)
     g_free ((gchar *)cand->ip);
   if (cand->base_ip)
     g_free ((gchar *)cand->base_ip);
-  if (cand->proto_subtype)
-    g_free ((gchar *)cand->proto_subtype);
-  if (cand->proto_profile)
-    g_free ((gchar *)cand->proto_profile);
   if (cand->username)
     g_free ((gchar *)cand->username);
   if (cand->password)
@@ -134,16 +130,6 @@ fs_candidate_copy (const FsCandidate * cand)
   else
     copy->base_ip = NULL;
 
-  if (cand->proto_subtype)
-    copy->proto_subtype = g_strdup (cand->proto_subtype);
-  else
-    copy->proto_subtype = NULL;
-
-  if (cand->proto_profile)
-    copy->proto_profile = g_strdup (cand->proto_profile);
-  else
-    copy->proto_profile = NULL;
-
   if (cand->username)
     copy->username = g_strdup (cand->username);
   else
diff --git a/gst-libs/gst/farsight/fs-candidate.h b/gst-libs/gst/farsight/fs-candidate.h
index 21decb4..4726e51 100644
--- a/gst-libs/gst/farsight/fs-candidate.h
+++ b/gst-libs/gst/farsight/fs-candidate.h
@@ -94,8 +94,6 @@ typedef struct _FsCandidate FsCandidate;
  * @base_ip: IP of base in dotted format as defined in ICE-19.
  * @base_port: Port of base as defined in ICE-19.
  * @proto: #FsNetworkProtocol for ip protocol to use as candidate
- * @proto_subtype: a string specifying subtype of this protocol type if needed
- * @proto_profile: a string specifying a profile type for this protocol, if applicable
  * @priority: Value between 0 and (2^31 - 1) representing the priority
  * @type: The #FsCandidateType of the candidate
  * @username: Username to use to connect to client if necessary,
@@ -107,10 +105,6 @@ typedef struct _FsCandidate FsCandidate;
  */
 struct _FsCandidate
 {
-  /* TODO We need some sort of way for the transmitter to know just from this
-   * structure what kind of element to create (RAW udp, STUN udp, ICE, etc).
-   * Maybe use FsNetworkProtocol if it is not required by ICE */
-  /* TODO Should this be made into a GstStructure? */
   const gchar *candidate_id;
   gchar *foundation;
   guint component_id;
@@ -119,8 +113,6 @@ struct _FsCandidate
   const gchar *base_ip;
   guint16 base_port;
   FsNetworkProtocol proto;
-  const gchar *proto_subtype;
-  const gchar *proto_profile;
   gint priority;
   FsCandidateType type;
   const gchar *username;
diff --git a/tests/check/transmitter/rawudp.c b/tests/check/transmitter/rawudp.c
index 7ed36fe..d0862c1 100644
--- a/tests/check/transmitter/rawudp.c
+++ b/tests/check/transmitter/rawudp.c
@@ -87,17 +87,6 @@ _new_local_candidate (FsStreamTransmitter *st, FsCandidate *candidate,
   fail_unless (candidate->proto == FS_NETWORK_PROTOCOL_UDP,
     "Protocol is not UDP");
 
-  if (candidate->component_id == FS_COMPONENT_RTP)
-    fail_unless (strcmp (candidate->proto_subtype, "RTP") == 0,
-      "Proto subtype %s does not match component %d", candidate->proto_subtype,
-      candidate->component_id);
-  else if (candidate->component_id == FS_COMPONENT_RTCP)
-    fail_unless (strcmp (candidate->proto_subtype, "RTCP") == 0,
-      "Proto subtype %s does not match component %d", candidate->proto_subtype,
-      candidate->component_id);
-  else
-    fail ("Invalid component %d", candidate->component_id);
-
   if (has_stun)
     fail_unless (candidate->type == FS_CANDIDATE_TYPE_SRFLX,
       "Has stun, but candidate is not server reflexive,"
diff --git a/transmitters/rawudp/fs-rawudp-stream-transmitter.c b/transmitters/rawudp/fs-rawudp-stream-transmitter.c
index ccfbc34..7c42c79 100644
--- a/transmitters/rawudp/fs-rawudp-stream-transmitter.c
+++ b/transmitters/rawudp/fs-rawudp-stream-transmitter.c
@@ -846,11 +846,6 @@ fs_rawudp_stream_transmitter_stun_recv_cb (GstPad *pad, GstBuffer *buffer,
           ((*attr)->address.ip & 0x000000ff));
       candidate->port = (*attr)->address.port;
       candidate->proto = FS_NETWORK_PROTOCOL_UDP;
-      if (component_id == FS_COMPONENT_RTP)
-        candidate->proto_subtype = g_strdup ("RTP");
-      else if (component_id == FS_COMPONENT_RTCP)
-        candidate->proto_subtype = g_strdup ("RTCP");
-      candidate->proto_profile = g_strdup ("AVP");
       candidate->type = FS_CANDIDATE_TYPE_SRFLX;
 
       g_debug ("Stun server says we are %u.%u.%u.%u %u\n",
@@ -1024,11 +1019,6 @@ fs_rawudp_stream_transmitter_build_forced_candidate (
   candidate->ip = g_strdup (ip);
   candidate->port = port;
   candidate->proto = FS_NETWORK_PROTOCOL_UDP;
-  if (component_id == FS_COMPONENT_RTP)
-    candidate->proto_subtype = g_strdup ("RTP");
-  else if (component_id == FS_COMPONENT_RTCP)
-    candidate->proto_subtype = g_strdup ("RTCP");
-  candidate->proto_profile = g_strdup ("AVP");
   candidate->type = FS_CANDIDATE_TYPE_HOST;
 
   return candidate;
@@ -1077,11 +1067,6 @@ fs_rawudp_stream_transmitter_emit_local_candidates (
     candidate->ip = g_strdup (current->data);
     candidate->port = port;
     candidate->proto = FS_NETWORK_PROTOCOL_UDP;
-    if (component_id == FS_COMPONENT_RTP)
-      candidate->proto_subtype = g_strdup ("RTP");
-    else if (component_id == FS_COMPONENT_RTCP)
-      candidate->proto_subtype = g_strdup ("RTCP");
-    candidate->proto_profile = g_strdup ("AVP");
     candidate->type = FS_CANDIDATE_TYPE_HOST;
 
     g_signal_emit_by_name (self, "new-local-candidate", candidate);
-- 
1.5.6.5




More information about the farsight-commits mailing list