Bug 1395819 - Remove unused method MediaEngineSource::Shutdown. r=jib

Differential Revision: https://phabricator.services.mozilla.com/D109944
This commit is contained in:
Andreas Pehrson 2021-04-06 14:54:02 +00:00
Родитель 5af8f11c55
Коммит 91a2eec7e9
6 изменённых файлов: 1 добавлений и 64 удалений

Просмотреть файл

@ -120,28 +120,6 @@ void MediaEngineRemoteVideoSource::Init() {
SetName(NS_ConvertUTF8toUTF16(deviceName));
mUniqueId = uniqueId;
mInitDone = true;
}
void MediaEngineRemoteVideoSource::Shutdown() {
LOG("%s", __PRETTY_FUNCTION__);
AssertIsOnOwningThread();
if (!mInitDone) {
// Already shut down
return;
}
if (mState == kStarted) {
Stop();
}
if (mState == kAllocated || mState == kStopped) {
Deallocate();
}
MOZ_ASSERT(mState == kReleased);
mInitDone = false;
}
void MediaEngineRemoteVideoSource::SetName(nsString aName) {
@ -199,11 +177,6 @@ nsresult MediaEngineRemoteVideoSource::Allocate(
MOZ_ASSERT(mState == kReleased);
if (!mInitDone) {
LOG("Init not done");
return NS_ERROR_FAILURE;
}
NormalizedConstraints constraints(aConstraints);
webrtc::CaptureCapability newCapability;
LOG("ChooseCapability(kFitness) for mCapability (Allocate) ++");
@ -290,7 +263,6 @@ nsresult MediaEngineRemoteVideoSource::Start() {
AssertIsOnOwningThread();
MOZ_ASSERT(mState == kAllocated || mState == kStopped);
MOZ_ASSERT(mInitDone);
MOZ_ASSERT(mTrack);
{
@ -377,8 +349,6 @@ nsresult MediaEngineRemoteVideoSource::Reconfigure(
LOG("%s", __PRETTY_FUNCTION__);
AssertIsOnOwningThread();
MOZ_ASSERT(mInitDone);
NormalizedConstraints constraints(aConstraints);
webrtc::CaptureCapability newCapability;
LOG("ChooseCapability(kFitness) for mTargetCapability (Reconfigure) ++");

Просмотреть файл

@ -128,8 +128,6 @@ class MediaEngineRemoteVideoSource : public MediaEngineSource,
void Refresh(int aIndex);
void Shutdown() override;
nsString GetName() const override;
void SetName(nsString aName);
@ -245,11 +243,6 @@ class MediaEngineRemoteVideoSource : public MediaEngineSource,
nsString mDeviceName;
nsCString mUniqueId;
Maybe<nsString> mFacingMode;
// Whether init has successfully completed.
// Set in Init(), reset in Shutdown().
// Owning thread only.
bool mInitDone = false;
};
} // namespace mozilla

Просмотреть файл

@ -62,8 +62,6 @@ nsresult MediaEngineSource::FocusOnSelectedSource() {
return NS_ERROR_NOT_AVAILABLE;
}
void MediaEngineSource::Shutdown() {}
nsresult MediaEngineSource::TakePhoto(MediaEnginePhotoCallback* aCallback) {
return NS_ERROR_NOT_IMPLEMENTED;
}

Просмотреть файл

@ -176,12 +176,6 @@ class MediaEngineSourceInterface {
*/
virtual nsresult Deallocate() = 0;
/**
* Called by MediaEngine when it knows this MediaEngineSource won't be used
* anymore. Use it to clean up anything that needs to be cleaned up.
*/
virtual void Shutdown() = 0;
/**
* If implementation of MediaEngineSource supports TakePhoto(), the picture
* should be returned via aCallback object. Otherwise, it returns
@ -256,9 +250,6 @@ class MediaEngineSource : public MediaEngineSourceInterface {
// Returns NS_ERROR_NOT_AVAILABLE by default.
nsresult FocusOnSelectedSource() override;
// Shutdown does nothing by default.
void Shutdown() override;
// TakePhoto returns NS_ERROR_NOT_IMPLEMENTED by default,
// to tell the caller to fallback to other methods.
nsresult TakePhoto(MediaEnginePhotoCallback* aCallback) override;

Просмотреть файл

@ -633,19 +633,6 @@ void AudioInputProcessing::Disconnect(MediaTrackGraphImpl* aGraph) {
MOZ_ASSERT(aGraph->OnGraphThread());
}
void MediaEngineWebRTCMicrophoneSource::Shutdown() {
AssertIsOnOwningThread();
if (mState == kStarted) {
Stop();
MOZ_ASSERT(mState == kStopped);
}
MOZ_ASSERT(mState == kAllocated || mState == kStopped);
Deallocate();
MOZ_ASSERT(mState == kReleased);
}
bool AudioInputProcessing::PassThrough(MediaTrackGraphImpl* aGraph) const {
MOZ_ASSERT(aGraph->OnGraphThread());
return mSkipProcessing;
@ -1148,7 +1135,7 @@ void AudioInputProcessing::NotifyInputStopped(MediaTrackGraphImpl* aGraph) {
}
// Called back on GraphDriver thread!
// Note this can be called back after ::Shutdown()
// Note this can be called back after ::Stop()
void AudioInputProcessing::NotifyInputData(MediaTrackGraphImpl* aGraph,
const AudioDataValue* aBuffer,
size_t aFrames, TrackRate aRate,

Просмотреть файл

@ -66,8 +66,6 @@ class MediaEngineWebRTCMicrophoneSource : public MediaEngineSource {
return NS_ERROR_NOT_IMPLEMENTED;
}
void Shutdown() override;
protected:
~MediaEngineWebRTCMicrophoneSource() = default;