Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2359)

Unified Diff: content/renderer/media/video_track_recorder.h

Issue 1313603004: MediaRecorderHandler (video part) and unittests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved DCHECK_EQ() Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/video_track_recorder.h
diff --git a/content/renderer/media/video_track_recorder.h b/content/renderer/media/video_track_recorder.h
index 99a6acbd17770d0772f68fd0e46b8b03ddfda004..bc877d6a9b02f64e244a44aad84cc281d0a4516a 100644
--- a/content/renderer/media/video_track_recorder.h
+++ b/content/renderer/media/video_track_recorder.h
@@ -7,7 +7,6 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/weak_ptr.h"
#include "base/strings/string_piece.h"
#include "base/threading/thread_checker.h"
#include "content/public/renderer/media_stream_video_sink.h"
@@ -23,7 +22,9 @@ namespace content {
// VideoTrackRecorder is a MediaStreamVideoSink that encodes the video frames
// received from a Stream Video Track. The class is constructed and used on a
// single thread, namely the main Render thread. It has an internal VpxEncoder
-// that uses a worker thread for encoding.
+// with its own threading subtleties, see the implementation file. This mirrors
+// the other MediaStreamVideo* classes that are constructed/configured on Main
+// Render thread but that pass frames on Render IO thread.
class CONTENT_EXPORT VideoTrackRecorder
: NON_EXPORTED_BASE(public MediaStreamVideoSink) {
public:
@@ -37,8 +38,8 @@ class CONTENT_EXPORT VideoTrackRecorder
const OnEncodedVideoCB& on_encoded_video_cb);
~VideoTrackRecorder() override;
- void OnVideoFrame(const scoped_refptr<media::VideoFrame>& frame,
- base::TimeTicks capture_time);
+ void OnVideoFrameForTesting(const scoped_refptr<media::VideoFrame>& frame,
+ base::TimeTicks capture_time);
private:
friend class VideoTrackRecorderTest;
@@ -51,9 +52,7 @@ class CONTENT_EXPORT VideoTrackRecorder
// Forward declaration and member of an inner class to encode using VPx.
class VpxEncoder;
- const scoped_ptr<VpxEncoder> encoder_;
-
- base::WeakPtrFactory<VideoTrackRecorder> weak_factory_;
+ const scoped_refptr<VpxEncoder> encoder_;
DISALLOW_COPY_AND_ASSIGN(VideoTrackRecorder);
};
« no previous file with comments | « content/renderer/media/media_recorder_handler_unittest.cc ('k') | content/renderer/media/video_track_recorder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698