OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_RECORDER_HANDLER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_RECORDER_HANDLER_H_ |
6 #define CONTENT_RENDERER_MEDIA_MEDIA_RECORDER_HANDLER_H_ | 6 #define CONTENT_RENDERER_MEDIA_MEDIA_RECORDER_HANDLER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 const blink::WebString& mimeType) override; | 51 const blink::WebString& mimeType) override; |
52 bool start() override; | 52 bool start() override; |
53 bool start(int timeslice) override; | 53 bool start(int timeslice) override; |
54 void stop() override; | 54 void stop() override; |
55 void pause() override; | 55 void pause() override; |
56 void resume() override; | 56 void resume() override; |
57 | 57 |
58 private: | 58 private: |
59 friend class MediaRecorderHandlerTest; | 59 friend class MediaRecorderHandlerTest; |
60 | 60 |
61 void OnEncodedVideo(const scoped_refptr<media::VideoFrame>& video_frame, | |
62 scoped_ptr<std::string> encoded_data, | |
63 base::TimeTicks timestamp, | |
64 bool is_key_frame); | |
65 void WriteData(base::StringPiece data); | 61 void WriteData(base::StringPiece data); |
66 | 62 |
67 void OnVideoFrameForTesting(const scoped_refptr<media::VideoFrame>& frame, | 63 void OnVideoFrameForTesting(const scoped_refptr<media::VideoFrame>& frame, |
68 const base::TimeTicks& timestamp); | 64 const base::TimeTicks& timestamp); |
69 | 65 |
70 // Bound to the main render thread. | 66 // Bound to the main render thread. |
71 base::ThreadChecker main_render_thread_checker_; | 67 base::ThreadChecker main_render_thread_checker_; |
72 | 68 |
73 bool recording_; | 69 bool recording_; |
74 blink::WebMediaStream media_stream_; // The MediaStream being recorded. | 70 blink::WebMediaStream media_stream_; // The MediaStream being recorded. |
75 | 71 |
76 // |client_| is a weak pointer, and is valid for the lifetime of this object. | 72 // |client_| is a weak pointer, and is valid for the lifetime of this object. |
77 blink::WebMediaRecorderHandlerClient* client_; | 73 blink::WebMediaRecorderHandlerClient* client_; |
78 | 74 |
79 ScopedVector<VideoTrackRecorder> video_recorders_; | 75 ScopedVector<VideoTrackRecorder> video_recorders_; |
80 | 76 |
81 // Worker class doing the actual Webm Muxing work. | 77 // Worker class doing the actual Webm Muxing work. |
82 scoped_ptr<media::WebmMuxer> webm_muxer_; | 78 scoped_ptr<media::WebmMuxer> webm_muxer_; |
83 | 79 |
84 base::WeakPtrFactory<MediaRecorderHandler> weak_factory_; | 80 base::WeakPtrFactory<MediaRecorderHandler> weak_factory_; |
85 | 81 |
86 DISALLOW_COPY_AND_ASSIGN(MediaRecorderHandler); | 82 DISALLOW_COPY_AND_ASSIGN(MediaRecorderHandler); |
87 }; | 83 }; |
88 | 84 |
89 } // namespace content | 85 } // namespace content |
90 #endif // CONTENT_RENDERER_MEDIA_MEDIA_RECORDER_HANDLER_H_ | 86 #endif // CONTENT_RENDERER_MEDIA_MEDIA_RECORDER_HANDLER_H_ |
OLD | NEW |