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

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

Issue 1211973012: [Experimental] MediaStreamRecorder playground (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed FFmpegMuxer, using instead libwebm::IMkvMuxer, which is partially added Created 5 years, 5 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
new file mode 100644
index 0000000000000000000000000000000000000000..bac506351a6d709202f90450359ed187fcda3efd
--- /dev/null
+++ b/content/renderer/media/video_track_recorder.h
@@ -0,0 +1,43 @@
+// Copyright 2015 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_TRACK_RECORDER_H_
+#define CONTENT_RENDERER_MEDIA_VIDEO_TRACK_RECORDER_H_
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/threading/thread_checker.h"
+#include "content/public/renderer/media_stream_video_sink.h"
+#include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
+#include "ui/gfx/geometry/size.h"
+
+namespace content {
+
+class VideoTrackRecorder final : public MediaStreamVideoSink {
+ public:
+ typedef base::Callback<void(const std::string& data,
+ const base::TimeTicks& timestamp,
+ bool keyframe,
+ const gfx::Size& frame_size,
+ double frame_rate)>
+ VideoEncoderCB;
+
+ VideoTrackRecorder(const blink::WebMediaStreamTrack& track,
+ const VideoEncoderCB& callback);
+ ~VideoTrackRecorder() override;
+
+ private:
+ // Used to DCHECK that we are called on the correct thread.
+ base::ThreadChecker thread_checker_;
+
+ // Reference to the Track the Recorder is hanging from, to remove on dtor.
+ blink::WebMediaStreamTrack web_track_;
+
+ class Encoder;
+ scoped_refptr<Encoder> encoder_;
+ DISALLOW_COPY_AND_ASSIGN(VideoTrackRecorder);
+};
+
+} // namespace content
+#endif // CONTENT_RENDERER_MEDIA_VIDEO_TRACK_RECORDER_H_
« no previous file with comments | « content/renderer/media/media_stream_renderer_factory_impl.cc ('k') | content/renderer/media/video_track_recorder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698