| 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_VIDEO_TRACK_RECORDER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_VIDEO_TRACK_RECORDER_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_VIDEO_TRACK_RECORDER_H_ | 6 #define CONTENT_RENDERER_MEDIA_VIDEO_TRACK_RECORDER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
| 14 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
| 15 #include "content/public/common/features.h" | 15 #include "content/public/common/features.h" |
| 16 #include "content/public/renderer/media_stream_video_sink.h" | 16 #include "content/public/renderer/media_stream_video_sink.h" |
| 17 #include "media/muxers/webm_muxer.h" |
| 17 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 18 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
| 18 | 19 |
| 19 namespace media { | 20 namespace media { |
| 20 class VideoFrame; | 21 class VideoFrame; |
| 21 } // namespace media | 22 } // namespace media |
| 22 | 23 |
| 23 namespace video_track_recorder { | 24 namespace video_track_recorder { |
| 24 const int kVEAEncoderMinResolutionWidth = 640; | 25 const int kVEAEncoderMinResolutionWidth = 640; |
| 25 const int kVEAEncoderMinResolutionHeight = 480; | 26 const int kVEAEncoderMinResolutionHeight = 480; |
| 26 } // namespace video_track_recorder | 27 } // namespace video_track_recorder |
| (...skipping 10 matching lines...) Expand all Loading... |
| 37 : NON_EXPORTED_BASE(public MediaStreamVideoSink) { | 38 : NON_EXPORTED_BASE(public MediaStreamVideoSink) { |
| 38 public: | 39 public: |
| 39 enum class CodecId { | 40 enum class CodecId { |
| 40 VP8, | 41 VP8, |
| 41 VP9, | 42 VP9, |
| 42 H264, | 43 H264, |
| 43 }; | 44 }; |
| 44 class Encoder; | 45 class Encoder; |
| 45 | 46 |
| 46 using OnEncodedVideoCB = | 47 using OnEncodedVideoCB = |
| 47 base::Callback<void(const scoped_refptr<media::VideoFrame>& video_frame, | 48 base::Callback<void(const media::WebmMuxer::VideoParameters& params, |
| 48 std::unique_ptr<std::string> encoded_data, | 49 std::unique_ptr<std::string> encoded_data, |
| 49 base::TimeTicks capture_timestamp, | 50 base::TimeTicks capture_timestamp, |
| 50 bool is_key_frame)>; | 51 bool is_key_frame)>; |
| 51 | 52 |
| 52 VideoTrackRecorder(CodecId codec, | 53 VideoTrackRecorder(CodecId codec, |
| 53 const blink::WebMediaStreamTrack& track, | 54 const blink::WebMediaStreamTrack& track, |
| 54 const OnEncodedVideoCB& on_encoded_video_cb, | 55 const OnEncodedVideoCB& on_encoded_video_cb, |
| 55 int32_t bits_per_second); | 56 int32_t bits_per_second); |
| 56 ~VideoTrackRecorder() override; | 57 ~VideoTrackRecorder() override; |
| 57 | 58 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 85 // Used to track the paused state during the initialization process. | 86 // Used to track the paused state during the initialization process. |
| 86 bool paused_before_init_; | 87 bool paused_before_init_; |
| 87 | 88 |
| 88 base::WeakPtrFactory<VideoTrackRecorder> weak_ptr_factory_; | 89 base::WeakPtrFactory<VideoTrackRecorder> weak_ptr_factory_; |
| 89 | 90 |
| 90 DISALLOW_COPY_AND_ASSIGN(VideoTrackRecorder); | 91 DISALLOW_COPY_AND_ASSIGN(VideoTrackRecorder); |
| 91 }; | 92 }; |
| 92 | 93 |
| 93 } // namespace content | 94 } // namespace content |
| 94 #endif // CONTENT_RENDERER_MEDIA_VIDEO_TRACK_RECORDER_H_ | 95 #endif // CONTENT_RENDERER_MEDIA_VIDEO_TRACK_RECORDER_H_ |
| OLD | NEW |