Bug 1494675 - Remove MediaEngineSource::RequiresSharing. r=padenot
authorAndreas Pehrson <apehrson@mozilla.com>
Wed, 27 Mar 2019 14:10:27 +0000
changeset 525605 9e7832fee028f5de447c95bc0d88ddea5b09ab37
parent 525604 1f79ed91a20bbe91ced53c1fe3c70fafd6272fd5
child 525606 20543d03a4cda05c785011a25079aa42aec8b2ba
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1494675
milestone68.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 1494675 - Remove MediaEngineSource::RequiresSharing. r=padenot Sources are no longer shared. Differential Revision: https://phabricator.services.mozilla.com/D24900
dom/media/webrtc/MediaEngineSource.cpp
dom/media/webrtc/MediaEngineSource.h
dom/media/webrtc/MediaEngineWebRTCAudio.h
--- a/dom/media/webrtc/MediaEngineSource.cpp
+++ b/dom/media/webrtc/MediaEngineSource.cpp
@@ -32,18 +32,16 @@ bool MediaEngineSource::IsVideo(MediaSou
     case MediaSourceEnum::Other:
       return false;
     default:
       MOZ_ASSERT_UNREACHABLE("Unknown type");
       return false;
   }
 }
 
-bool MediaEngineSource::RequiresSharing() const { return false; }
-
 bool MediaEngineSource::IsFake() const { return false; }
 
 bool MediaEngineSource::GetScary() const { return false; }
 
 nsresult MediaEngineSource::FocusOnSelectedSource(
     const RefPtr<const AllocationHandle>& aHandle) {
   return NS_ERROR_NOT_AVAILABLE;
 }
--- a/dom/media/webrtc/MediaEngineSource.h
+++ b/dom/media/webrtc/MediaEngineSource.h
@@ -64,36 +64,16 @@ enum MediaEngineSourceState {
 /**
  * The pure interface of a MediaEngineSource.
  *
  * Most sources are helped by the defaults implemented in MediaEngineSource.
  */
 class MediaEngineSourceInterface {
  public:
   /**
-   * Returns true if this source requires sharing to support multiple
-   * allocations.
-   *
-   * If this returns true, the MediaEngine is expected to do subsequent
-   * allocations on the first instance of this source.
-   *
-   * If this returns false, the MediaEngine is expected to instantiate one
-   * source instance per allocation.
-   *
-   * Sharing means that the source gets multiple simultaneous calls to
-   * Allocate(), Start(), Stop(), Deallocate(), etc. These are all keyed off
-   * the AllocationHandle returned by Allocate() so the source can keep
-   * allocations apart.
-   *
-   * A source typically requires sharing when the underlying hardware doesn't
-   * allow multiple users, or when having multiple users would be inefficient.
-   */
-  virtual bool RequiresSharing() const = 0;
-
-  /**
    * Return true if this is a fake source. I.e., if it is generating media
    * itself rather than being an interface to underlying hardware.
    */
   virtual bool IsFake() const = 0;
 
   /**
    * Gets the human readable name of this device.
    */
@@ -285,19 +265,16 @@ class MediaEngineSource : public MediaEn
 
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaEngineSource)
   NS_DECL_OWNINGTHREAD
 
   void AssertIsOnOwningThread() const {
     NS_ASSERT_OWNINGTHREAD(MediaEngineSource);
   }
 
-  // No sharing required by default.
-  bool RequiresSharing() const override;
-
   // Not fake by default.
   bool IsFake() const override;
 
   // Not scary by default.
   bool GetScary() const override;
 
   // Returns NS_ERROR_NOT_AVAILABLE by default.
   nsresult FocusOnSelectedSource(
--- a/dom/media/webrtc/MediaEngineWebRTCAudio.h
+++ b/dom/media/webrtc/MediaEngineWebRTCAudio.h
@@ -31,18 +31,16 @@ class MediaEngineWebRTCMicrophoneSource 
  public:
   MediaEngineWebRTCMicrophoneSource(RefPtr<AudioDeviceInfo> aInfo,
                                     const nsString& aDeviceName,
                                     const nsCString& aDeviceUUID,
                                     const nsString& aDeviceGroup,
                                     uint32_t aMaxChannelCount,
                                     bool aDelayAgnostic, bool aExtendedFilter);
 
-  bool RequiresSharing() const override { return false; }
-
   nsString GetName() const override;
   nsCString GetUUID() const override;
   nsString GetGroupId() const override;
 
   nsresult Allocate(const dom::MediaTrackConstraints& aConstraints,
                     const MediaEnginePrefs& aPrefs, const nsString& aDeviceId,
                     const ipc::PrincipalInfo& aPrincipalInfo,
                     AllocationHandle** aOutHandle,