Bug 1406941 - Remove unused fields from AudioCodecConfig; r=padenot
authorDan Minor <dminor@mozilla.com>
Mon, 19 Nov 2018 17:01:33 +0000
changeset 503469 4a979a79984c0d57b4139c9d965f2da9cb5b585d
parent 503468 97613730a99f6156f256d351b5b7767b1d80a2b6
child 503470 d08645c751752d0601a660bf491959dc3e2efe1e
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1406941
milestone65.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 1406941 - Remove unused fields from AudioCodecConfig; r=padenot With the branch 64 update we no longer configure packet size and rate ourselves. Instead, we use the defaults provided in acm_codec_database.cc. This removes the unused fields from AudioCodecConfig, the next commit does the same thing for JsepAudioCodecDescription. Differential Revision: https://phabricator.services.mozilla.com/D12012
media/webrtc/signaling/gtest/mediaconduit_unittests.cpp
media/webrtc/signaling/gtest/mediapipeline_unittest.cpp
media/webrtc/signaling/src/media-conduit/CodecConfig.h
media/webrtc/signaling/src/peerconnection/TransceiverImpl.cpp
--- a/media/webrtc/signaling/gtest/mediaconduit_unittests.cpp
+++ b/media/webrtc/signaling/gtest/mediaconduit_unittests.cpp
@@ -402,19 +402,19 @@ class TransportConduitTest : public ::te
 
     // attach the transport to audio-conduit
     err = mAudioSession->SetTransmitterTransport(mAudioTransport);
     ASSERT_EQ(mozilla::kMediaConduitNoError, err);
     err = mAudioSession2->SetReceiverTransport(mAudioTransport);
     ASSERT_EQ(mozilla::kMediaConduitNoError, err);
 
     //configure send and recv codecs on the audio-conduit
-    //mozilla::AudioCodecConfig cinst1(124, "PCMU", 8000, 80, 1, 64000, false);
-    mozilla::AudioCodecConfig cinst1(124, "opus", 48000, 960, 1, 64000, false);
-    mozilla::AudioCodecConfig cinst2(125, "L16", 16000, 320, 1, 256000, false);
+    //mozilla::AudioCodecConfig cinst1(124, "PCMU", 8000, 1, false);
+    mozilla::AudioCodecConfig cinst1(124, "opus", 48000, 1, false);
+    mozilla::AudioCodecConfig cinst2(125, "L16", 16000, 1, false);
 
     std::vector<UniquePtr<mozilla::AudioCodecConfig>> rcvCodecList;
     rcvCodecList.emplace_back(new mozilla::AudioCodecConfig(cinst1));
     rcvCodecList.emplace_back(new mozilla::AudioCodecConfig(cinst2));
 
     err = mAudioSession->ConfigureSendMediaCodec(&cinst1);
     ASSERT_EQ(mozilla::kMediaConduitNoError, err);
     err = mAudioSession->StartTransmitting();
--- a/media/webrtc/signaling/gtest/mediapipeline_unittest.cpp
+++ b/media/webrtc/signaling/gtest/mediapipeline_unittest.cpp
@@ -230,17 +230,17 @@ private:
   RefPtr<MediaTransportBase> peer_;
   std::map<std::string, TransportLayer::State> mRtpStates;
   std::map<std::string, TransportLayer::State> mRtcpStates;
 };
 
 class TestAgent {
  public:
   TestAgent() :
-      audio_config_(109, "opus", 48000, 960, 2, 64000, false),
+      audio_config_(109, "opus", 48000, 2, false),
       audio_conduit_(mozilla::AudioSessionConduit::Create(
         WebRtcCallWrapper::Create(),
         test_utils->sts_target())),
       audio_pipeline_(),
       transport_(new LoopbackTransport) {
   }
 
   static void Connect(TestAgent *client, TestAgent *server) {
--- a/media/webrtc/signaling/src/media-conduit/CodecConfig.h
+++ b/media/webrtc/signaling/src/media-conduit/CodecConfig.h
@@ -20,41 +20,33 @@ struct AudioCodecConfig
 {
   /*
    * The data-types for these properties mimic the
    * corresponding webrtc::CodecInst data-types.
    */
   int mType;
   std::string mName;
   int mFreq;
-  int mPacSize;
   int mChannels;
-  int mRate;
 
   bool mFECEnabled;
   bool mDtmfEnabled;
 
   // OPUS-specific
   int mMaxPlaybackRate;
 
-  /* Default constructor is not provided since as a consumer, we
-   * can't decide the default configuration for the codec
-   */
-  explicit AudioCodecConfig(int type, std::string name,
-                            int freq, int pacSize,
-                            int channels, int rate, bool FECEnabled)
-                                                   : mType(type),
-                                                     mName(name),
-                                                     mFreq(freq),
-                                                     mPacSize(pacSize),
-                                                     mChannels(channels),
-                                                     mRate(rate),
-                                                     mFECEnabled(FECEnabled),
-                                                     mDtmfEnabled(false),
-                                                     mMaxPlaybackRate(0)
+  AudioCodecConfig(int type, std::string name, int freq, int channels,
+                   bool FECEnabled)
+    : mType(type)
+    , mName(name)
+    , mFreq(freq)
+    , mChannels(channels)
+    , mFECEnabled(FECEnabled)
+    , mDtmfEnabled(false)
+    , mMaxPlaybackRate(0)
   {
   }
 };
 
 /*
  * Minimalistic video codec configuration
  * More to be added later depending on the use-case
  */
--- a/media/webrtc/signaling/src/peerconnection/TransceiverImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/TransceiverImpl.cpp
@@ -677,19 +677,17 @@ JsepCodecDescToAudioCodecConfig(const Js
   if (!desc.GetPtAsInt(&pt)) {
     MOZ_MTLOG(ML_ERROR, "Invalid payload type: " << desc.mDefaultPt);
     return NS_ERROR_INVALID_ARG;
   }
 
   aConfig->reset(new AudioCodecConfig(pt,
                                   desc.mName,
                                   desc.mClock,
-                                  desc.mPacketSize,
                                   desc.mForceMono ? 1 : desc.mChannels,
-                                  desc.mBitrate,
                                   desc.mFECEnabled));
   (*aConfig)->mMaxPlaybackRate = desc.mMaxPlaybackRate;
   (*aConfig)->mDtmfEnabled = desc.mDtmfEnabled;
 
   return NS_OK;
 }
 
 static nsresult