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 "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/threading/thread_checker.h" | 10 #include "base/threading/thread_checker.h" |
(...skipping 15 matching lines...) Expand all Loading... | |
26 class CONTENT_EXPORT VideoTrackRecorder | 26 class CONTENT_EXPORT VideoTrackRecorder |
27 : NON_EXPORTED_BASE(public MediaStreamVideoSink) { | 27 : NON_EXPORTED_BASE(public MediaStreamVideoSink) { |
28 public: | 28 public: |
29 using OnEncodedVideoCB = | 29 using OnEncodedVideoCB = |
30 base::Callback<void(const scoped_refptr<media::VideoFrame>& video_frame, | 30 base::Callback<void(const scoped_refptr<media::VideoFrame>& video_frame, |
31 scoped_ptr<std::string> encoded_data, | 31 scoped_ptr<std::string> encoded_data, |
32 base::TimeTicks capture_timestamp, | 32 base::TimeTicks capture_timestamp, |
33 bool is_key_frame)>; | 33 bool is_key_frame)>; |
34 | 34 |
35 VideoTrackRecorder(const blink::WebMediaStreamTrack& track, | 35 VideoTrackRecorder(const blink::WebMediaStreamTrack& track, |
36 const OnEncodedVideoCB& on_encoded_video_cb); | 36 const OnEncodedVideoCB& on_encoded_video_cb, |
37 bool use_vp9); | |
miu
2015/10/07 18:16:35
style nit: Callback argument should be last.
mcasas
2015/10/07 21:01:14
Done.
| |
37 ~VideoTrackRecorder() override; | 38 ~VideoTrackRecorder() override; |
38 | 39 |
39 void OnVideoFrameForTesting(const scoped_refptr<media::VideoFrame>& frame, | 40 void OnVideoFrameForTesting(const scoped_refptr<media::VideoFrame>& frame, |
40 base::TimeTicks capture_time); | 41 base::TimeTicks capture_time); |
41 | 42 |
42 private: | 43 private: |
43 friend class VideoTrackRecorderTest; | 44 friend class VideoTrackRecorderTest; |
44 | 45 |
45 // Used to check that we are destroyed on the same thread we were created. | 46 // Used to check that we are destroyed on the same thread we were created. |
46 base::ThreadChecker main_render_thread_checker_; | 47 base::ThreadChecker main_render_thread_checker_; |
47 | 48 |
48 // We need to hold on to the Blink track to remove ourselves on dtor. | 49 // We need to hold on to the Blink track to remove ourselves on dtor. |
49 blink::WebMediaStreamTrack track_; | 50 blink::WebMediaStreamTrack track_; |
50 | 51 |
51 // Forward declaration and member of an inner class to encode using VPx. | 52 // Forward declaration and member of an inner class to encode using VPx. |
52 class VpxEncoder; | 53 class VpxEncoder; |
53 const scoped_refptr<VpxEncoder> encoder_; | 54 const scoped_refptr<VpxEncoder> encoder_; |
54 | 55 |
55 DISALLOW_COPY_AND_ASSIGN(VideoTrackRecorder); | 56 DISALLOW_COPY_AND_ASSIGN(VideoTrackRecorder); |
56 }; | 57 }; |
57 | 58 |
58 } // namespace content | 59 } // namespace content |
59 #endif // CONTENT_RENDERER_MEDIA_VIDEO_TRACK_RECORDER_H_ | 60 #endif // CONTENT_RENDERER_MEDIA_VIDEO_TRACK_RECORDER_H_ |
OLD | NEW |