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

Unified Diff: content/renderer/media/media_recorder_handler.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
« no previous file with comments | « content/renderer/DEPS ('k') | content/renderer/media/media_recorder_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_recorder_handler.h
diff --git a/content/renderer/media/media_recorder_handler.h b/content/renderer/media/media_recorder_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..dd54206db229536d37c257715aa128a32dc379fa
--- /dev/null
+++ b/content/renderer/media/media_recorder_handler.h
@@ -0,0 +1,70 @@
+// 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_MEDIA_RECORDER_HANDLER_H_
+#define CONTENT_RENDERER_MEDIA_MEDIA_RECORDER_HANDLER_H_
+
+#include "base/memory/scoped_vector.h"
+#include "base/memory/weak_ptr.h"
+#include "base/threading/thread_checker.h"
+#include "content/common/content_export.h"
+#include "third_party/WebKit/public/platform/WebMediaRecorderHandler.h"
+#include "third_party/WebKit/public/platform/WebMediaStream.h"
+#include "third_party/WebKit/public/platform/WebString.h"
+
+namespace media{
+class WebmMuxer;
+} // namespace media
+
+namespace content {
+
+class VideoTrackRecorder;
+
+// TODO(mcasas): Implement audio recording.
+// MediaRecorderHandler orchestrates the creation, lifetime mgmt and mapping
+// between:
+// - MediaStreamTrack(s) providing data,
+// - {Audio,Video}TrackRecorders encoding that data,
+// - class-internal resource(s) multiplexing and writing into a WebM container,
+// and
+// - a single recorder client receiving this contained data.
+class CONTENT_EXPORT MediaRecorderHandler final
+ : NON_EXPORTED_BASE(public blink::WebMediaRecorderHandler) {
+ public:
+ MediaRecorderHandler();
+ ~MediaRecorderHandler();
+
+ // Implements blink::WebMediaRecorderHandler.
+ bool canSupportMimeType(const blink::WebString& mimeType);
+ bool initialize(blink::WebMediaRecorderHandlerClient* client,
+ const blink::WebMediaStream& media_stream,
+ const blink::WebString& mimeType) override;
+ bool start() override;
+ bool start(int timeslice) override;
+ void stop() override;
+ void pause() override;
+ void resume() override;
+
+ private:
+ // Bound to the main render thread.
+ base::ThreadChecker thread_checker_;
+
+ bool recording_;
+ blink::WebMediaStream media_stream_; // The MediaStream being recorded.
+
+ // |client_| is a weak pointer, and is valid for the lifetime of this object.
+ blink::WebMediaRecorderHandlerClient* client_;
+
+ ScopedVector<VideoTrackRecorder> video_recorders_;
+
+ // Worker class doing the actual Webm Muxing work.
+ scoped_ptr<media::WebmMuxer> webm_muxer_;
+
+ base::WeakPtrFactory<MediaRecorderHandler> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(MediaRecorderHandler);
+};
+
+} // namespace content
+#endif // CONTENT_RENDERER_MEDIA_MEDIA_RECORDER_HANDLER_H_
« no previous file with comments | « content/renderer/DEPS ('k') | content/renderer/media/media_recorder_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698