summaryrefslogtreecommitdiffstats
path: root/dom/media/imagecapture/CaptureTask.h
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media/imagecapture/CaptureTask.h')
-rw-r--r--dom/media/imagecapture/CaptureTask.h18
1 files changed, 18 insertions, 0 deletions
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