diff options
Diffstat (limited to 'dom/media/imagecapture/CaptureTask.h')
-rw-r--r-- | dom/media/imagecapture/CaptureTask.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/dom/media/imagecapture/CaptureTask.h b/dom/media/imagecapture/CaptureTask.h index 2b4f0a04ce..f9c810158c 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 |