OLD | NEW |
(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_VIDEO_TRACK_RECORDER_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_VIDEO_TRACK_RECORDER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/threading/thread_checker.h" |
| 11 #include "content/public/renderer/media_stream_video_sink.h" |
| 12 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
| 13 #include "ui/gfx/geometry/size.h" |
| 14 |
| 15 namespace content { |
| 16 |
| 17 class VideoTrackRecorder final : public MediaStreamVideoSink { |
| 18 public: |
| 19 typedef base::Callback<void(const std::string& data, |
| 20 const base::TimeTicks& timestamp, |
| 21 bool keyframe, |
| 22 const gfx::Size& frame_size, |
| 23 double frame_rate)> |
| 24 VideoEncoderCB; |
| 25 |
| 26 VideoTrackRecorder(const blink::WebMediaStreamTrack& track, |
| 27 const VideoEncoderCB& callback); |
| 28 ~VideoTrackRecorder() override; |
| 29 |
| 30 private: |
| 31 // Used to DCHECK that we are called on the correct thread. |
| 32 base::ThreadChecker thread_checker_; |
| 33 |
| 34 // Reference to the Track the Recorder is hanging from, to remove on dtor. |
| 35 blink::WebMediaStreamTrack web_track_; |
| 36 |
| 37 class Encoder; |
| 38 scoped_refptr<Encoder> encoder_; |
| 39 DISALLOW_COPY_AND_ASSIGN(VideoTrackRecorder); |
| 40 }; |
| 41 |
| 42 } // namespace content |
| 43 #endif // CONTENT_RENDERER_MEDIA_VIDEO_TRACK_RECORDER_H_ |
OLD | NEW |