From b738ccc61b05e4848c0e8d0400a8aee770f591a2 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Wed, 22 Apr 2020 02:32:20 +0000 Subject: Issue #80 - De-unify dom/media part 1 (updated reland) This de-unifies up to and including dom/media/platforms with the exception of dom/media/platforms/wmf, because that one throws weird errors in the Win SDK which don't have a clear cause (yet) --- dom/media/imagecapture/CaptureTask.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'dom/media/imagecapture/CaptureTask.h') diff --git a/dom/media/imagecapture/CaptureTask.h b/dom/media/imagecapture/CaptureTask.h index 2b4f0a04c..f9c810158 100644 --- a/dom/media/imagecapture/CaptureTask.h +++ b/dom/media/imagecapture/CaptureTask.h @@ -86,6 +86,24 @@ protected: bool mPrincipalChanged; }; +class CaptureTask::MediaStreamEventListener : public MediaStreamTrackListener +{ +public: + explicit MediaStreamEventListener(CaptureTask* aCaptureTask) + : mCaptureTask(aCaptureTask) {}; + + // MediaStreamListener methods. + void NotifyEnded() override + { + if(!mCaptureTask->mImageGrabbedOrTrackEnd) { + mCaptureTask->PostTrackEndEvent(); + } + } + +private: + CaptureTask* mCaptureTask; +}; + } // namespace mozilla #endif // CAPTURETASK_H -- cgit v1.2.3