| 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" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // single thread, namely the main Render thread. This mirrors the other | 25 // single thread, namely the main Render thread. This mirrors the other |
| 26 // MediaStreamVideo* classes that are constructed/configured on Main Render | 26 // MediaStreamVideo* classes that are constructed/configured on Main Render |
| 27 // thread but that pass frames on Render IO thread. It has an internal Encoder | 27 // thread but that pass frames on Render IO thread. It has an internal Encoder |
| 28 // with its own threading subtleties, see the implementation file. | 28 // with its own threading subtleties, see the implementation file. |
| 29 class CONTENT_EXPORT VideoTrackRecorder | 29 class CONTENT_EXPORT VideoTrackRecorder |
| 30 : NON_EXPORTED_BASE(public MediaStreamVideoSink) { | 30 : NON_EXPORTED_BASE(public MediaStreamVideoSink) { |
| 31 public: | 31 public: |
| 32 enum class CodecId { | 32 enum class CodecId { |
| 33 VP8, | 33 VP8, |
| 34 VP9, | 34 VP9, |
| 35 #if BUILDFLAG(RTC_USE_H264) | |
| 36 H264, | 35 H264, |
| 37 #endif | |
| 38 }; | 36 }; |
| 39 class Encoder; | 37 class Encoder; |
| 40 | 38 |
| 41 using OnEncodedVideoCB = | 39 using OnEncodedVideoCB = |
| 42 base::Callback<void(const scoped_refptr<media::VideoFrame>& video_frame, | 40 base::Callback<void(const scoped_refptr<media::VideoFrame>& video_frame, |
| 43 std::unique_ptr<std::string> encoded_data, | 41 std::unique_ptr<std::string> encoded_data, |
| 44 base::TimeTicks capture_timestamp, | 42 base::TimeTicks capture_timestamp, |
| 45 bool is_key_frame)>; | 43 bool is_key_frame)>; |
| 46 | 44 |
| 47 VideoTrackRecorder(CodecId codec, | 45 VideoTrackRecorder(CodecId codec, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 65 blink::WebMediaStreamTrack track_; | 63 blink::WebMediaStreamTrack track_; |
| 66 | 64 |
| 67 // Inner class to encode using whichever codec is configured. | 65 // Inner class to encode using whichever codec is configured. |
| 68 scoped_refptr<Encoder> encoder_; | 66 scoped_refptr<Encoder> encoder_; |
| 69 | 67 |
| 70 DISALLOW_COPY_AND_ASSIGN(VideoTrackRecorder); | 68 DISALLOW_COPY_AND_ASSIGN(VideoTrackRecorder); |
| 71 }; | 69 }; |
| 72 | 70 |
| 73 } // namespace content | 71 } // namespace content |
| 74 #endif // CONTENT_RENDERER_MEDIA_VIDEO_TRACK_RECORDER_H_ | 72 #endif // CONTENT_RENDERER_MEDIA_VIDEO_TRACK_RECORDER_H_ |
| OLD | NEW |