summaryrefslogtreecommitdiffstats
path: root/chromium/content/renderer/media/video_frame_deliverer.h
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-09-09 16:47:24 +0200
committerJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-09-10 12:22:20 +0200
commit7d9f85dc4a5c3474e7116abb26697cee280eca93 (patch)
tree8efb93902e33f1775989b172c36629fc276823da /chromium/content/renderer/media/video_frame_deliverer.h
parent8f5515e887f99194cad0a3b8bfe30c91b4466d10 (diff)
Update Chromium to stable version 37.0.2062.103
Change-Id: I172b552f0df8923d795a3c6f84c4fb4e1e780788 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'chromium/content/renderer/media/video_frame_deliverer.h')
-rw-r--r--chromium/content/renderer/media/video_frame_deliverer.h82
1 files changed, 0 insertions, 82 deletions
diff --git a/chromium/content/renderer/media/video_frame_deliverer.h b/chromium/content/renderer/media/video_frame_deliverer.h
deleted file mode 100644
index a1f4b9d4f6a..00000000000
--- a/chromium/content/renderer/media/video_frame_deliverer.h
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_RENDERER_MEDIA_VIDEO_FRAME_DELIVERER_H_
-#define CONTENT_RENDERER_MEDIA_VIDEO_FRAME_DELIVERER_H_
-
-#include <utility>
-#include <vector>
-
-#include "base/macros.h"
-#include "base/memory/ref_counted.h"
-#include "base/message_loop/message_loop_proxy.h"
-#include "base/threading/thread_checker.h"
-#include "content/common/media/video_capture.h"
-#include "content/public/renderer/media_stream_video_sink.h"
-#include "media/base/video_frame.h"
-
-namespace content {
-
-// VideoFrameDeliverer is a helper class used for registering
-// VideoCaptureDeliverFrameCB on the main render thread to receive video frames
-// on the IO-thread.
-// Its used by MediaStreamVideoTrack.
-class VideoFrameDeliverer
- : public base::RefCountedThreadSafe<VideoFrameDeliverer> {
- public:
- explicit VideoFrameDeliverer(
- const scoped_refptr<base::MessageLoopProxy>& io_message_loop);
-
- // Add |callback| to receive video frames on the IO-thread.
- // Must be called on the main render thread.
- void AddCallback(void* id, const VideoCaptureDeliverFrameCB& callback);
-
- // Removes |callback| associated with |id| from receiving video frames if |id|
- // has been added. It is ok to call RemoveCallback even if the |id| has not
- // been added. Note that the added callback will be reset on the main thread.
- // Must be called on the main render thread.
- void RemoveCallback(void* id);
-
- // Triggers all registered callbacks with |frame|, |format| and
- // |estimated_capture_time| as parameters. Must be called on the IO-thread.
- virtual void DeliverFrameOnIO(
- const scoped_refptr<media::VideoFrame>& frame,
- const media::VideoCaptureFormat& format,
- const base::TimeTicks& estimated_capture_time);
-
- const scoped_refptr<base::MessageLoopProxy>& io_message_loop() const {
- return io_message_loop_;
- }
-
- protected:
- void AddCallbackOnIO(void* id, const VideoCaptureDeliverFrameCB& callback);
-
- // Callback will be removed and then reset on the designated message loop.
- // It is ok to call RemoveCallback even if |id| has not been added.
- void RemoveCallbackOnIO(
- void* id, const scoped_refptr<base::MessageLoopProxy>& message_loop);
-
- protected:
- virtual ~VideoFrameDeliverer();
- const base::ThreadChecker& thread_checker() const {
- return thread_checker_;
- }
-
- private:
- friend class base::RefCountedThreadSafe<VideoFrameDeliverer>;
-
- // Used to DCHECK that AddCallback and RemoveCallback are called on the main
- // render thread.
- base::ThreadChecker thread_checker_;
- scoped_refptr<base::MessageLoopProxy> io_message_loop_;
-
- typedef std::pair<void*, VideoCaptureDeliverFrameCB> VideoIdCallbackPair;
- std::vector<VideoIdCallbackPair> callbacks_;
-
- DISALLOW_COPY_AND_ASSIGN(VideoFrameDeliverer);
-};
-
-} // namespace content
-
-#endif // CONTENT_RENDERER_MEDIA_VIDEO_FRAME_DELIVERER_H_