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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « content/renderer/DEPS ('k') | content/renderer/media/media_recorder_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_RECORDER_HANDLER_H_
6 #define CONTENT_RENDERER_MEDIA_MEDIA_RECORDER_HANDLER_H_
7
8 #include "base/memory/scoped_vector.h"
9 #include "base/memory/weak_ptr.h"
10 #include "base/threading/thread_checker.h"
11 #include "content/common/content_export.h"
12 #include "third_party/WebKit/public/platform/WebMediaRecorderHandler.h"
13 #include "third_party/WebKit/public/platform/WebMediaStream.h"
14 #include "third_party/WebKit/public/platform/WebString.h"
15
16 namespace media{
17 class WebmMuxer;
18 } // namespace media
19
20 namespace content {
21
22 class VideoTrackRecorder;
23
24 // TODO(mcasas): Implement audio recording.
25 // MediaRecorderHandler orchestrates the creation, lifetime mgmt and mapping
26 // between:
27 // - MediaStreamTrack(s) providing data,
28 // - {Audio,Video}TrackRecorders encoding that data,
29 // - class-internal resource(s) multiplexing and writing into a WebM container,
30 // and
31 // - a single recorder client receiving this contained data.
32 class CONTENT_EXPORT MediaRecorderHandler final
33 : NON_EXPORTED_BASE(public blink::WebMediaRecorderHandler) {
34 public:
35 MediaRecorderHandler();
36 ~MediaRecorderHandler();
37
38 // Implements blink::WebMediaRecorderHandler.
39 bool canSupportMimeType(const blink::WebString& mimeType);
40 bool initialize(blink::WebMediaRecorderHandlerClient* client,
41 const blink::WebMediaStream& media_stream,
42 const blink::WebString& mimeType) override;
43 bool start() override;
44 bool start(int timeslice) override;
45 void stop() override;
46 void pause() override;
47 void resume() override;
48
49 private:
50 // Bound to the main render thread.
51 base::ThreadChecker thread_checker_;
52
53 bool recording_;
54 blink::WebMediaStream media_stream_; // The MediaStream being recorded.
55
56 // |client_| is a weak pointer, and is valid for the lifetime of this object.
57 blink::WebMediaRecorderHandlerClient* client_;
58
59 ScopedVector<VideoTrackRecorder> video_recorders_;
60
61 // Worker class doing the actual Webm Muxing work.
62 scoped_ptr<media::WebmMuxer> webm_muxer_;
63
64 base::WeakPtrFactory<MediaRecorderHandler> weak_factory_;
65
66 DISALLOW_COPY_AND_ASSIGN(MediaRecorderHandler);
67 };
68
69 } // namespace content
70 #endif // CONTENT_RENDERER_MEDIA_MEDIA_RECORDER_HANDLER_H_
OLDNEW
« 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