| 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 20 matching lines...) Expand all Loading... |
| 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 // |use_vp9| forces using VP9, otherwise VP8 will be used by default. | 35 // |use_vp9| forces using VP9, otherwise VP8 will be used by default. |
| 36 VideoTrackRecorder(bool use_vp9, | 36 VideoTrackRecorder(bool use_vp9, |
| 37 const blink::WebMediaStreamTrack& track, | 37 const blink::WebMediaStreamTrack& track, |
| 38 const OnEncodedVideoCB& on_encoded_video_cb); | 38 const OnEncodedVideoCB& on_encoded_video_cb); |
| 39 ~VideoTrackRecorder() override; | 39 ~VideoTrackRecorder() override; |
| 40 | 40 |
| 41 void Pause(); |
| 42 void Resume(); |
| 43 |
| 41 void OnVideoFrameForTesting(const scoped_refptr<media::VideoFrame>& frame, | 44 void OnVideoFrameForTesting(const scoped_refptr<media::VideoFrame>& frame, |
| 42 base::TimeTicks capture_time); | 45 base::TimeTicks capture_time); |
| 43 | |
| 44 private: | 46 private: |
| 45 friend class VideoTrackRecorderTest; | 47 friend class VideoTrackRecorderTest; |
| 46 | 48 |
| 47 // Used to check that we are destroyed on the same thread we were created. | 49 // Used to check that we are destroyed on the same thread we were created. |
| 48 base::ThreadChecker main_render_thread_checker_; | 50 base::ThreadChecker main_render_thread_checker_; |
| 49 | 51 |
| 50 // We need to hold on to the Blink track to remove ourselves on dtor. | 52 // We need to hold on to the Blink track to remove ourselves on dtor. |
| 51 blink::WebMediaStreamTrack track_; | 53 blink::WebMediaStreamTrack track_; |
| 52 | 54 |
| 53 // Forward declaration and member of an inner class to encode using VPx. | 55 // Forward declaration and member of an inner class to encode using VPx. |
| 54 class VpxEncoder; | 56 class VpxEncoder; |
| 55 const scoped_refptr<VpxEncoder> encoder_; | 57 const scoped_refptr<VpxEncoder> encoder_; |
| 56 | 58 |
| 57 DISALLOW_COPY_AND_ASSIGN(VideoTrackRecorder); | 59 DISALLOW_COPY_AND_ASSIGN(VideoTrackRecorder); |
| 58 }; | 60 }; |
| 59 | 61 |
| 60 } // namespace content | 62 } // namespace content |
| 61 #endif // CONTENT_RENDERER_MEDIA_VIDEO_TRACK_RECORDER_H_ | 63 #endif // CONTENT_RENDERER_MEDIA_VIDEO_TRACK_RECORDER_H_ |
| OLD | NEW |