OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 bool GetBestCaptureFormat(const VideoFormat& desired, | 54 bool GetBestCaptureFormat(const VideoFormat& desired, |
55 VideoFormat* best_format) override; | 55 VideoFormat* best_format) override; |
56 CaptureState Start(const VideoFormat& capture_format) override; | 56 CaptureState Start(const VideoFormat& capture_format) override; |
57 void Stop() override; | 57 void Stop() override; |
58 bool IsRunning() override; | 58 bool IsRunning() override; |
59 bool IsScreencast() const override { return false; } | 59 bool IsScreencast() const override { return false; } |
60 | 60 |
61 protected: | 61 protected: |
62 void OnSinkWantsChanged(const rtc::VideoSinkWants& wants) override; | 62 void OnSinkWantsChanged(const rtc::VideoSinkWants& wants) override; |
63 // Override virtual methods of the parent class VideoCapturer. | 63 // Override virtual methods of the parent class VideoCapturer. |
64 bool GetPreferredFourccs(std::vector<uint32_t>* fourccs) override; | 64 virtual bool GetPreferredFourccs(std::vector<uint32_t>* fourccs); |
65 | 65 |
66 private: | 66 private: |
67 // Callback when a frame is captured by camera. | 67 // Callback when a frame is captured by camera. |
68 void OnIncomingCapturedFrame(const int32_t id, | 68 virtual void OnIncomingCapturedFrame(const int32_t id, |
69 const webrtc::VideoFrame& frame) override; | 69 const webrtc::VideoFrame& frame); |
70 void OnCaptureDelayChanged(const int32_t id, | 70 virtual void OnCaptureDelayChanged(const int32_t id, |
71 const int32_t delay) override; | 71 const int32_t delay); |
72 | 72 |
73 // Used to signal captured frames on the same thread as invoked Start(). | 73 // Used to signal captured frames on the same thread as invoked Start(). |
74 // With WebRTC's current VideoCapturer implementations, this will mean a | 74 // With WebRTC's current VideoCapturer implementations, this will mean a |
75 // thread hop, but in other implementations (e.g. Chrome) it will be called | 75 // thread hop, but in other implementations (e.g. Chrome) it will be called |
76 // directly from OnIncomingCapturedFrame. | 76 // directly from OnIncomingCapturedFrame. |
77 // TODO(tommi): Remove this workaround when we've updated the WebRTC capturers | 77 // TODO(tommi): Remove this workaround when we've updated the WebRTC capturers |
78 // to follow the same contract. | 78 // to follow the same contract. |
79 void SignalFrameCapturedOnStartThread(const webrtc::VideoFrame& frame); | 79 void SignalFrameCapturedOnStartThread(const webrtc::VideoFrame& frame); |
80 | 80 |
81 std::unique_ptr<WebRtcVcmFactoryInterface> factory_; | 81 std::unique_ptr<WebRtcVcmFactoryInterface> factory_; |
82 rtc::scoped_refptr<webrtc::VideoCaptureModule> module_; | 82 rtc::scoped_refptr<webrtc::VideoCaptureModule> module_; |
83 int captured_frames_; | 83 int captured_frames_; |
84 std::vector<uint8_t> capture_buffer_; | 84 std::vector<uint8_t> capture_buffer_; |
85 rtc::Thread* start_thread_; // Set in Start(), unset in Stop(); | 85 rtc::Thread* start_thread_; // Set in Start(), unset in Stop(); |
86 | 86 |
87 std::unique_ptr<rtc::AsyncInvoker> async_invoker_; | 87 std::unique_ptr<rtc::AsyncInvoker> async_invoker_; |
88 }; | 88 }; |
89 | 89 |
90 struct WebRtcCapturedFrame : public CapturedFrame { | 90 struct WebRtcCapturedFrame : public CapturedFrame { |
91 public: | 91 public: |
92 WebRtcCapturedFrame(const webrtc::VideoFrame& frame, | 92 WebRtcCapturedFrame(const webrtc::VideoFrame& frame, |
93 void* buffer, | 93 void* buffer, |
94 size_t length); | 94 size_t length); |
95 }; | 95 }; |
96 | 96 |
97 } // namespace cricket | 97 } // namespace cricket |
98 | 98 |
99 #endif // WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEOCAPTURER_H_ | 99 #endif // WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEOCAPTURER_H_ |
OLD | NEW |