| 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 |
| 11 #ifndef WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOCAPTURER_H_ | 11 #ifndef WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOCAPTURER_H_ |
| 12 #define WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOCAPTURER_H_ | 12 #define WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOCAPTURER_H_ |
| 13 | 13 |
| 14 #include <memory> |
| 14 #include <string> | 15 #include <string> |
| 15 #include <vector> | 16 #include <vector> |
| 16 | 17 |
| 17 #include "webrtc/base/asyncinvoker.h" | 18 #include "webrtc/base/asyncinvoker.h" |
| 18 #include "webrtc/base/messagehandler.h" | 19 #include "webrtc/base/messagehandler.h" |
| 19 #include "webrtc/base/scoped_ptr.h" | |
| 20 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 20 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
| 21 #include "webrtc/media/base/videocapturer.h" | 21 #include "webrtc/media/base/videocapturer.h" |
| 22 #include "webrtc/media/engine/webrtcvideoframe.h" | 22 #include "webrtc/media/engine/webrtcvideoframe.h" |
| 23 #include "webrtc/modules/video_capture/video_capture.h" | 23 #include "webrtc/modules/video_capture/video_capture.h" |
| 24 | 24 |
| 25 namespace cricket { | 25 namespace cricket { |
| 26 | 26 |
| 27 // Factory to allow injection of a VCM impl into WebRtcVideoCapturer. | 27 // Factory to allow injection of a VCM impl into WebRtcVideoCapturer. |
| 28 // DeviceInfos do not have a Release() and therefore need an explicit Destroy(). | 28 // DeviceInfos do not have a Release() and therefore need an explicit Destroy(). |
| 29 class WebRtcVcmFactoryInterface { | 29 class WebRtcVcmFactoryInterface { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 const int32_t delay); | 68 const int32_t delay); |
| 69 | 69 |
| 70 // Used to signal captured frames on the same thread as invoked Start(). | 70 // Used to signal captured frames on the same thread as invoked Start(). |
| 71 // With WebRTC's current VideoCapturer implementations, this will mean a | 71 // With WebRTC's current VideoCapturer implementations, this will mean a |
| 72 // thread hop, but in other implementations (e.g. Chrome) it will be called | 72 // thread hop, but in other implementations (e.g. Chrome) it will be called |
| 73 // directly from OnIncomingCapturedFrame. | 73 // directly from OnIncomingCapturedFrame. |
| 74 // TODO(tommi): Remove this workaround when we've updated the WebRTC capturers | 74 // TODO(tommi): Remove this workaround when we've updated the WebRTC capturers |
| 75 // to follow the same contract. | 75 // to follow the same contract. |
| 76 void SignalFrameCapturedOnStartThread(const webrtc::VideoFrame& frame); | 76 void SignalFrameCapturedOnStartThread(const webrtc::VideoFrame& frame); |
| 77 | 77 |
| 78 rtc::scoped_ptr<WebRtcVcmFactoryInterface> factory_; | 78 std::unique_ptr<WebRtcVcmFactoryInterface> factory_; |
| 79 webrtc::VideoCaptureModule* module_; | 79 webrtc::VideoCaptureModule* module_; |
| 80 int captured_frames_; | 80 int captured_frames_; |
| 81 std::vector<uint8_t> capture_buffer_; | 81 std::vector<uint8_t> capture_buffer_; |
| 82 rtc::Thread* start_thread_; // Set in Start(), unset in Stop(); | 82 rtc::Thread* start_thread_; // Set in Start(), unset in Stop(); |
| 83 | 83 |
| 84 rtc::scoped_ptr<rtc::AsyncInvoker> async_invoker_; | 84 std::unique_ptr<rtc::AsyncInvoker> async_invoker_; |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 struct WebRtcCapturedFrame : public CapturedFrame { | 87 struct WebRtcCapturedFrame : public CapturedFrame { |
| 88 public: | 88 public: |
| 89 WebRtcCapturedFrame(const webrtc::VideoFrame& frame, | 89 WebRtcCapturedFrame(const webrtc::VideoFrame& frame, |
| 90 void* buffer, | 90 void* buffer, |
| 91 size_t length); | 91 size_t length); |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 } // namespace cricket | 94 } // namespace cricket |
| 95 | 95 |
| 96 #endif // WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEOCAPTURER_H_ | 96 #endif // WEBRTC_MEDIA_WEBRTC_WEBRTCVIDEOCAPTURER_H_ |
| OLD | NEW |