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_RECORDER_VIDEO_TRACK_RECORDER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_RECORDER_VIDEO_TRACK_RECORDER_H_ |
6 #define CONTENT_RENDERER_MEDIA_RECORDER_VIDEO_TRACK_RECORDER_H_ | 6 #define CONTENT_RENDERER_MEDIA_RECORDER_VIDEO_TRACK_RECORDER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 // Used to retrieve incoming opaque VideoFrames (i.e. VideoFrames backed by | 147 // Used to retrieve incoming opaque VideoFrames (i.e. VideoFrames backed by |
148 // textures). Created on-demand on |main_task_runner_|. | 148 // textures). Created on-demand on |main_task_runner_|. |
149 std::unique_ptr<media::SkCanvasVideoRenderer> video_renderer_; | 149 std::unique_ptr<media::SkCanvasVideoRenderer> video_renderer_; |
150 SkBitmap bitmap_; | 150 SkBitmap bitmap_; |
151 std::unique_ptr<cc::PaintCanvas> canvas_; | 151 std::unique_ptr<cc::PaintCanvas> canvas_; |
152 | 152 |
153 DISALLOW_COPY_AND_ASSIGN(Encoder); | 153 DISALLOW_COPY_AND_ASSIGN(Encoder); |
154 }; | 154 }; |
155 | 155 |
156 static CodecId GetPreferredCodecId(); | 156 static CodecId GetPreferredCodecId(); |
| 157 static bool CanUseAcceleratedEncoder(CodecId codec, |
| 158 size_t width, |
| 159 size_t height); |
157 | 160 |
158 VideoTrackRecorder(CodecId codec, | 161 VideoTrackRecorder(CodecId codec, |
159 const blink::WebMediaStreamTrack& track, | 162 const blink::WebMediaStreamTrack& track, |
160 const OnEncodedVideoCB& on_encoded_video_cb, | 163 const OnEncodedVideoCB& on_encoded_video_cb, |
161 int32_t bits_per_second); | 164 int32_t bits_per_second); |
162 ~VideoTrackRecorder() override; | 165 ~VideoTrackRecorder() override; |
163 | 166 |
164 void Pause(); | 167 void Pause(); |
165 void Resume(); | 168 void Resume(); |
166 | 169 |
(...skipping 27 matching lines...) Expand all Loading... |
194 // Used to track the paused state during the initialization process. | 197 // Used to track the paused state during the initialization process. |
195 bool paused_before_init_; | 198 bool paused_before_init_; |
196 | 199 |
197 base::WeakPtrFactory<VideoTrackRecorder> weak_ptr_factory_; | 200 base::WeakPtrFactory<VideoTrackRecorder> weak_ptr_factory_; |
198 | 201 |
199 DISALLOW_COPY_AND_ASSIGN(VideoTrackRecorder); | 202 DISALLOW_COPY_AND_ASSIGN(VideoTrackRecorder); |
200 }; | 203 }; |
201 | 204 |
202 } // namespace content | 205 } // namespace content |
203 #endif // CONTENT_RENDERER_MEDIA_RECORDER_VIDEO_TRACK_RECORDER_H_ | 206 #endif // CONTENT_RENDERER_MEDIA_RECORDER_VIDEO_TRACK_RECORDER_H_ |
OLD | NEW |