Bug 1144962 - Part 3: Remove more unused code, and some outdated comments. r=mt
authorByron Campen [:bwc] <docfaraday@gmail.com>
Thu, 19 Mar 2015 14:05:44 -0700
changeset 263917 badfefdddfc97d6128a23f347322464e7cfbbfb3
parent 263916 c5c158a9728d82cfa868f9079410dfe108f1f29b
child 263918 32f1bd690587c12bf1d26dac96a237619ac695a7
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmt
bugs1144962
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1144962 - Part 3: Remove more unused code, and some outdated comments. r=mt
media/webrtc/signaling/src/sdp/sipcc/ccsdp.h
media/webrtc/signaling/src/sdp/sipcc/sdp.h
media/webrtc/signaling/src/sdp/sipcc/sdp_access.c
media/webrtc/signaling/src/sdp/sipcc/sdp_attr_access.c
media/webrtc/signaling/src/sdp/sipcc/sdp_services_unix.c
media/webrtc/signaling/src/sdp/sipcc/sdp_services_win32.c
--- a/media/webrtc/signaling/src/sdp/sipcc/ccsdp.h
+++ b/media/webrtc/signaling/src/sdp/sipcc/ccsdp.h
@@ -1,53 +1,12 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-/**
- *  Skip this file if not doing video on the device.
- *
- *  The ccsdp_xxx api's provide a means to query and populate the SDP attributes
- *  for video m lines. These Api are not needed if we are not supporting video on
- *  the platform. For audio the stack will populate the appropriate attributes
- *
- *
- *  These API's can be invoked from the vcmCheckAttrs() and vcmPopulateAttrs()
- *  methods to populate or extract the value of specific attributes in the video SDP.
- *  These api require an handle to the SDP that is passed in the above methods.
- * <pre>
- * sdp_handle     The SDP handle
- * level       The level the attribute is defined.  Can be either
- *             SDP_SESSION_LEVEL or 0-n specifying a media line level.
- * inst_num    The instance number of the attribute.  Multiple instances
- *             of a particular attribute may exist at each level and so
- *             the inst_num determines the particular attribute at that
- *             level that should be accessed.  Note that this is the
- *             instance number of the specified type of attribute, not the
- *             overall attribute number at the level.  Also note that the
- *             instance number is 1-based.  For example:
- *             v=0
- *             o=mhandley 2890844526 2890842807 IN IP4 126.16.64.4
- *             s=SDP Seminar
- *             c=IN IP4 10.1.0.2
- *             t=0 0
- *             m=audio 1234 RTP/AVP 0 101 102
- *             a=foo 1
- *             a=foo 2
- *             a=bar 1   # This is instance 1 of attribute bar.
- *             a=foo 3   # This is instance 3 of attribute foo.
- * cap_num     Almost all of the attributes may be defined as X-cpar
- *             parameters (with the exception of X-sqn, X-cap, and X-cpar).
- *             If the cap_num is set to zero, then the attribute is not
- *             an X-cpar parameter attribute.  If the cap_num is any other
- *             value, it specifies the capability number that the X-cpar
- *             attribute is specified for.
- * </pre>
- */
-
 #ifndef __CCSDP_H__
 #define __CCSDP_H__
 
 #include "cpr_types.h"
 #include "ccsdp_rtcp_fb.h"
 
 #define SIPSDP_ILBC_MODE20 20
 
@@ -80,48 +39,16 @@ typedef enum rtp_ptype_
     RTP_ILBC         = 116, /* used only to make an offer */
     RTP_OPUS         = 109,
     RTP_VP8          = 120,
     RTP_VP9          = 121,
     RTP_I420         = 124,
     RTP_ISAC         = 124
 } rtp_ptype;
 
-/**
- * IANA-registered static payload types for the RTP/AVP profile.
- * See http://www.iana.org/assignments/rtp-parameters/rtp-parameters.xml
- */
-typedef enum static_rtp_ptype_
-{
-    STATIC_RTP_AVP_PCMU_8000_1          = 0,
-    STATIC_RTP_AVP_GSM_8000_1           = 3,
-    STATIC_RTP_AVP_G723_8000_1          = 4,
-    STATIC_RTP_AVP_DVI4_8000_1          = 5,
-    STATIC_RTP_AVP_DVI4_16000_1         = 6,
-    STATIC_RTP_AVP_LPC_8000_1           = 7,
-    STATIC_RTP_AVP_PCMA_8000_1          = 8,
-    STATIC_RTP_AVP_G722_8000_1          = 9,
-    STATIC_RTP_AVP_L16_44100_2          = 10,
-    STATIC_RTP_AVP_L16_44100_1          = 11,
-    STATIC_RTP_AVP_QCELP_8000_1         = 12,
-    STATIC_RTP_AVP_CN_8000_1            = 13,
-    STATIC_RTP_AVP_MPA_90000_1          = 14,
-    STATIC_RTP_AVP_G728_8000_1          = 15,
-    STATIC_RTP_AVP_DVI4_11025_1         = 16,
-    STATIC_RTP_AVP_DVI4_22050_1         = 17,
-    STATIC_RTP_AVP_G729_8000_1          = 18,
-    STATIC_RTP_AVP_CELB_90000_1         = 25,
-    STATIC_RTP_AVP_JPEG_90000_1         = 26,
-    STATIC_RTP_AVP_NV_90000_1           = 28,
-    STATIC_RTP_AVP_H261_90000_1         = 31,
-    STATIC_RTP_AVP_MPV_90000_1          = 32,
-    STATIC_RTP_AVP_MP2T_90000_1         = 33,
-    STATIC_RTP_AVP_H263_90000_1         = 34
-} static_rtp_ptype;
-
 typedef struct {
     const char *name;
     int         value;
 } ccsdp_key_table_entry_t;
 
 typedef enum max_coded_audio_bandwidth_ {
     opus_nb  = 0,    /* Narrowband */
     opus_mb  = 1,    /* Mediumband */
@@ -255,17 +182,17 @@ typedef enum {
     SDP_ATTR_MSID_SEMANTIC,
     SDP_ATTR_BUNDLE_ONLY,
     SDP_ATTR_END_OF_CANDIDATES,
     SDP_ATTR_ICE_OPTIONS,
     SDP_ATTR_SSRC,
     SDP_MAX_ATTR_TYPES,
     SDP_ATTR_INVALID
 } sdp_attr_e;
-/* This is here so that it can be used in the VcmSIPCCBinding interface */
+
 typedef enum {
     SDP_SETUP_NOT_FOUND = -1,
     SDP_SETUP_ACTIVE = 0,
     SDP_SETUP_PASSIVE,
     SDP_SETUP_ACTPASS,
     SDP_SETUP_HOLDCONN,
     SDP_MAX_SETUP,
     SDP_SETUP_UNKNOWN
--- a/media/webrtc/signaling/src/sdp/sipcc/sdp.h
+++ b/media/webrtc/signaling/src/sdp/sipcc/sdp.h
@@ -1230,17 +1230,16 @@ extern uint16_t sdp_get_media_profile_nu
 extern rtp_ptype sdp_get_known_payload_type(sdp_t *sdp_p,
                                             uint16_t level,
                                             uint16_t payload_type_raw);
 extern uint32_t sdp_get_media_payload_type(sdp_t *sdp_p, uint16_t level,
                                 uint16_t payload_num, sdp_payload_ind_e *indicator);
 extern uint32_t sdp_get_media_profile_payload_type(sdp_t *sdp_p, uint16_t level,
                   uint16_t prof_num, uint16_t payload_num, sdp_payload_ind_e *indicator);
 extern sdp_result_e sdp_insert_media_line(sdp_t *sdp_p, uint16_t level);
-extern void sdp_delete_media_line(sdp_t *sdp_p, uint16_t level);
 extern sdp_result_e sdp_set_media_type(sdp_t *sdp_p, uint16_t level,
                                        sdp_media_e media);
 extern sdp_result_e sdp_set_media_portnum(sdp_t *sdp_p, uint16_t level,
                                           int32_t portnum, int32_t sctpport);
 extern int32_t sdp_get_media_sctp_port(sdp_t *sdp_p, uint16_t level);
 extern sdp_result_e sdp_set_media_transport(sdp_t *sdp_p, uint16_t level,
                                             sdp_transport_e transport);
 extern sdp_result_e sdp_add_media_profile(sdp_t *sdp_p, uint16_t level,
@@ -1563,28 +1562,24 @@ extern sdp_silencesupp_siduse_e sdp_attr
                                                                 uint16_t inst_num);
 extern uint8_t sdp_attr_get_silencesupp_fxnslevel(sdp_t *sdp_p, uint16_t level,
                                              uint8_t cap_num, uint16_t inst_num,
                                              tinybool *null_ind);
 extern sdp_mediadir_role_e sdp_attr_get_comediadir_role(sdp_t *sdp_p,
                                                         uint16_t level, uint8_t cap_num,
                                                         uint16_t inst_num);
 
-extern sdp_result_e sdp_delete_all_media_direction_attrs (sdp_t *sdp_p,
-                                                          uint16_t level);
-
 extern uint16_t sdp_attr_get_mptime_num_intervals(
     sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num);
 extern uint16_t sdp_attr_get_mptime_interval(
     sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num, uint16_t interval_num);
 extern sdp_result_e sdp_attr_add_mptime_interval(
     sdp_t *sdp_p, uint16_t level, uint8_t cap_num, uint16_t inst_num, uint16_t interval);
 
 
-extern sdp_result_e sdp_delete_bw_line (sdp_t *sdp_p, uint16_t level, uint16_t inst_num);
 extern sdp_result_e sdp_copy_all_bw_lines(sdp_t *src_sdp_ptr, sdp_t *dst_sdp_ptr,
                                           uint16_t src_level, uint16_t dst_level);
 extern sdp_bw_modifier_e sdp_get_bw_modifier(sdp_t *sdp_p, uint16_t level,
                                              uint16_t inst_num);
 extern const char *sdp_get_bw_modifier_name(sdp_bw_modifier_e bw_modifier);
 extern int32_t sdp_get_bw_value(sdp_t *sdp_p, uint16_t level, uint16_t inst_num);
 extern int32_t sdp_get_num_bw_lines (sdp_t *sdp_p, uint16_t level);
 
--- a/media/webrtc/signaling/src/sdp/sipcc/sdp_access.c
+++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_access.c
@@ -1513,76 +1513,16 @@ sdp_result_e sdp_insert_media_line (sdp_
         new_mca_p->next_p = mca_p->next_p;
         mca_p->next_p = new_mca_p;
     }
 
     sdp_p->mca_count++;
     return (SDP_SUCCESS);
 }
 
-/* Function:    sdp_delete_media_line
- * Description: Delete the media line at the level specified for the
- *              given SDP.
- * Parameters:  sdp_p     The SDP handle returned by sdp_init_description.
- *              level       The media level to delete.  Will be 1-n.
- * Returns:     SDP_SUCCESS, SDP_NO_RESOURCE, or SDP_INVALID_PARAMETER
- */
-void sdp_delete_media_line (sdp_t *sdp_p, uint16_t level)
-{
-    sdp_mca_t  *mca_p;
-    sdp_mca_t  *prev_mca_p = NULL;
-    sdp_attr_t *attr_p;
-    sdp_attr_t *next_attr_p;
-    sdp_bw_t        *bw_p;
-    sdp_bw_data_t   *bw_data_p;
-
-    /* If we're not deleting media line 1, then we need a pointer
-     * to the previous media line so we can relink. */
-    if (level == 1) {
-        mca_p = sdp_find_media_level(sdp_p, level);
-    } else {
-        prev_mca_p = sdp_find_media_level(sdp_p, (uint16_t)(level-1));
-        if (prev_mca_p == NULL) {
-            sdp_p->conf_p->num_invalid_param++;
-            return;
-        }
-        mca_p = prev_mca_p->next_p;
-    }
-    if (mca_p == NULL) {
-        sdp_p->conf_p->num_invalid_param++;
-        return;
-    }
-
-    /* Delete all attributes from this level. */
-    for (attr_p = mca_p->media_attrs_p; attr_p != NULL;) {
-        next_attr_p = attr_p->next_p;
-        sdp_free_attr(attr_p);
-        attr_p = next_attr_p;
-    }
-
-     /* Delete bw line */
-     bw_p = &(mca_p->bw);
-     bw_data_p = bw_p->bw_data_list;
-     while (bw_data_p != NULL) {
-         bw_p->bw_data_list = bw_data_p->next_p;
-         SDP_FREE(bw_data_p);
-         bw_data_p = bw_p->bw_data_list;
-     }
-
-    /* Now relink the media levels and delete the specified one. */
-    if (prev_mca_p == NULL) {
-        sdp_p->mca_p = mca_p->next_p;
-    } else {
-        prev_mca_p->next_p = mca_p->next_p;
-    }
-    SDP_FREE(mca_p);
-    sdp_p->mca_count--;
-    return;
-}
-
 /* Function:    sdp_set_media_type
  * Description: Sets the value of the media type parameter for the m=
  *              media token line.
  * Parameters:  sdp_p     The SDP handle returned by sdp_init_description.
  *              level       The media level to set the param.  Will be 1-n.
  *              media       Media type for the media line.
  * Returns:     SDP_SUCCESS or SDP_INVALID_PARAMETER
  */
@@ -2106,75 +2046,16 @@ sdp_result_e sdp_add_new_bw_line (sdp_t 
 
         bw_data_p->next_p = new_bw_data_p;
     }
     *inst_num = ++bw_p->bw_data_count;
 
     return (SDP_SUCCESS);
 }
 
-/*
- * sdp_delete_bw_line
- *
- * Deletes the bw line instance at the specified level.
- *
- * sdp_p     The SDP handle returned by sdp_init_description.
- * level       The level to delete the bw line.
- * inst_num   The instance of the bw line to delete.
- */
-sdp_result_e sdp_delete_bw_line (sdp_t *sdp_p, uint16_t level, uint16_t inst_num)
-{
-    sdp_bw_t            *bw_p;
-    sdp_mca_t           *mca_p;
-    sdp_bw_data_t       *bw_data_p = NULL;
-    sdp_bw_data_t       *prev_bw_data_p = NULL;
-    int                 bw_data_count = 0;
-
-    if (level == SDP_SESSION_LEVEL) {
-        bw_p = &(sdp_p->bw);
-    } else {
-        mca_p = sdp_find_media_level(sdp_p, level);
-        if (mca_p == NULL) {
-            sdp_p->conf_p->num_invalid_param++;
-            return (SDP_INVALID_PARAMETER);
-        }
-        bw_p = &(mca_p->bw);
-    }
-
-    bw_data_p = bw_p->bw_data_list;
-    while (bw_data_p != NULL) {
-        bw_data_count++;
-        if (bw_data_count == inst_num) {
-            break;
-        }
-
-        prev_bw_data_p = bw_data_p;
-        bw_data_p = bw_data_p->next_p;
-    }
-
-    if (bw_data_p == NULL) {
-        if (sdp_p->debug_flag[SDP_DEBUG_ERRORS]) {
-            CSFLogError(logTag, "%s bw line instance %u not found.",
-                      sdp_p->debug_str, (unsigned)inst_num);
-        }
-        sdp_p->conf_p->num_invalid_param++;
-        return (SDP_INVALID_PARAMETER);
-    }
-
-    if (prev_bw_data_p == NULL) {
-        bw_p->bw_data_list = bw_data_p->next_p;
-    } else {
-        prev_bw_data_p->next_p = bw_data_p->next_p;
-    }
-    bw_p->bw_data_count--;
-
-    SDP_FREE(bw_data_p);
-    return (SDP_SUCCESS);
-}
-
 /* Function:    sdp_get_mid_value
  * Description: Returns the mid value parameter from the a= mid: line.
  * Parameters:  sdp_p     The SDP handle returned by sdp_init_description.
  *              level       SDP_MEDIA_LEVEL
  * Returns:     mid value.
  */
 int32_t sdp_get_mid_value (sdp_t *sdp_p, uint16_t level)
 {
--- a/media/webrtc/signaling/src/sdp/sipcc/sdp_attr_access.c
+++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_attr_access.c
@@ -495,17 +495,17 @@ int sdp_find_fmtp_inst (sdp_t *sdp_p, ui
  * Description: Find the specified attribute in an SDP structure.
  *              Note: This is not an API for the application but an internal
  *              routine used by the SDP library.
  * Parameters:  sdp_p     The SDP handle returned by sdp_init_description.
  *              level       The level to check for the attribute.
  *              cap_num     The capability number associated with the
  *                          attribute if any.  If none, should be zero.
  *              attr_type   The type of attribute to find.
- *              inst_num    The instance num of the attribute to delete.
+ *              inst_num    The instance num of the attribute to find.
  *                          Range should be (1 - max num insts of this
  *                          particular type of attribute at this level).
  * Returns:     Pointer to the attribute or NULL if not found.
  */
 sdp_attr_t *sdp_find_attr (sdp_t *sdp_p, uint16_t level, uint8_t cap_num,
                            sdp_attr_e attr_type, uint16_t inst_num)
 {
     uint16_t          attr_count=0;
@@ -992,95 +992,16 @@ sdp_direction_e sdp_get_media_direction 
             CSFLogDebug(logTag, "%s Warning: Invalid cap_num for media direction.",
                      sdp_p->debug_str);
         }
     }
 
     return (direction);
 }
 
-/*
- * sdp_delete_all_media_direction_attrs
- *
- * Deletes all the media direction attributes from a given SDP level.
- * Media direction attributes include:
- * a=sendonly
- * a=recvonly
- * a=sendrecv
- * a=inactive
- *
- * This function can be used in conjunction with sdp_add_new_attr, to ensure
- * that there is only one direction attribute per level.
- * It can also be used to delete all attributes when the client wants to
- * advertise the default direction, i.e. a=sendrecv.
- */
-sdp_result_e sdp_delete_all_media_direction_attrs (sdp_t *sdp_p, uint16_t level)
-{
-    sdp_mca_t   *mca_p;
-    sdp_attr_t  *attr_p;
-    sdp_attr_t  *prev_attr_p = NULL;
-    sdp_attr_t  *tmp_attr_p = NULL;
-
-    /* Find the pointer to the attr list for this level. */
-    if (level == SDP_SESSION_LEVEL) {
-        attr_p = sdp_p->sess_attrs_p;
-        while (attr_p != NULL) {
-            if ((attr_p->type == SDP_ATTR_INACTIVE) ||
-                (attr_p->type == SDP_ATTR_SENDONLY) ||
-                (attr_p->type == SDP_ATTR_RECVONLY) ||
-                (attr_p->type == SDP_ATTR_SENDRECV)) {
-
-                tmp_attr_p = attr_p;
-
-                if (prev_attr_p == NULL) {
-                    sdp_p->sess_attrs_p = attr_p->next_p;
-                } else {
-                    prev_attr_p->next_p = attr_p->next_p;
-                }
-                attr_p = attr_p->next_p;
-
-                sdp_free_attr(tmp_attr_p);
-            } else {
-                prev_attr_p = attr_p;
-                attr_p = attr_p->next_p;
-            }
-        }
-    } else {  /* Attr is at a media level */
-        mca_p = sdp_find_media_level(sdp_p, level);
-        if (mca_p == NULL) {
-            return (SDP_INVALID_MEDIA_LEVEL);
-        }
-
-        attr_p = mca_p->media_attrs_p;
-        while (attr_p != NULL) {
-            if ((attr_p->type == SDP_ATTR_INACTIVE) ||
-                (attr_p->type == SDP_ATTR_SENDONLY) ||
-                (attr_p->type == SDP_ATTR_RECVONLY) ||
-                (attr_p->type == SDP_ATTR_SENDRECV)) {
-
-                tmp_attr_p = attr_p;
-
-                if (prev_attr_p == NULL) {
-                    mca_p->media_attrs_p = attr_p->next_p;
-                } else {
-                    prev_attr_p->next_p = attr_p->next_p;
-                }
-                attr_p = attr_p->next_p;
-
-                sdp_free_attr(tmp_attr_p);
-            } else {
-                prev_attr_p = attr_p;
-                attr_p = attr_p->next_p;
-            }
-        }
-    }
-
-    return (SDP_SUCCESS);
-}
-
 /* Since there are four different attribute names which all have the same
  * qos parameters, all of these attributes are accessed through this same
  * set of APIs.  To distinguish between specific attributes, the application
  * must also pass the attribute type.  The attribute must be one of:
  * SDP_ATTR_QOS, SDP_ATTR_SECURE, SDP_ATTR_X_PC_QOS, and SDP_ATTR_X_QOS.
  */
 tinybool sdp_validate_qos_attr (sdp_attr_e qos_attr)
 {
--- a/media/webrtc/signaling/src/sdp/sipcc/sdp_services_unix.c
+++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_services_unix.c
@@ -11,39 +11,16 @@
 /******************************************************************/
 /*  Required Platform Routines                                    */
 /*                                                                */
 /*     These routines are called from the common SDP code.        */
 /*     They must be provided for each platform.                   */
 /*                                                                */
 /******************************************************************/
 
-#if 0
-void sdp_log_errmsg (sdp_errmsg_e errmsg, char *str)
-{
-    switch (errmsg) {
-
-    case SDP_ERR_INVALID_CONF_PTR:
-        SDP_ERROR("\nSDP: Invalid Config pointer (%s).", str);
-        break;
-
-    case SDP_ERR_INVALID_SDP_PTR:
-        SDP_ERROR("\nSDP: Invalid SDP pointer (%s).", str);
-        break;
-
-    case SDP_ERR_INTERNAL:
-        SDP_ERROR("\nSDP: Internal error (%s).", str);
-        break;
-
-    default:
-        break;
-    }
-}
-#endif
-
 /*
  * sdp_dump_buffer
  *
  * Utility to send _size_bytes of data from the string
  * pointed to by _ptr to the buginf function. This may make
  * multiple buginf calls if the buffer is too large for buginf.
  */
 void sdp_dump_buffer (char * _ptr, int _size_bytes)
--- a/media/webrtc/signaling/src/sdp/sipcc/sdp_services_win32.c
+++ b/media/webrtc/signaling/src/sdp/sipcc/sdp_services_win32.c
@@ -10,39 +10,16 @@
 /******************************************************************/
 /*  Required Platform Routines                                    */
 /*                                                                */
 /*     These routines are called from the common SDP code.        */
 /*     They must be provided for each platform.                   */
 /*                                                                */
 /******************************************************************/
 
-#if 0
-void sdp_log_errmsg (sdp_errmsg_e errmsg, char *str)
-{
-    switch (errmsg) {
-
-    case SDP_ERR_INVALID_CONF_PTR:
-        SDP_ERROR("\nSDP: Invalid Config pointer (%s).", str);
-        break;
-
-    case SDP_ERR_INVALID_SDP_PTR:
-        SDP_ERROR("\nSDP: Invalid SDP pointer (%s).", str);
-        break;
-
-    case SDP_ERR_INTERNAL:
-        SDP_ERROR("\nSDP: Internal error (%s).", str);
-        break;
-
-    default:
-        break;
-    }
-}
-#endif
-
 /*
  * sdp_dump_buffer
  *
  * Utility to send _size_bytes of data from the string
  * pointed to by _ptr to the buginf function. This may make
  * multiple buginf calls if the buffer is too large for buginf.
  */
 void sdp_dump_buffer (char * _ptr, int _size_bytes)