SkyWay Linux SDK
読み取り中…
検索中…
一致する文字列を見つけられません
v4l2_capturer_video_source.hpp
1//
2// © NTT DOCOMO BUSINESS, Inc. All Rights Reserved.
3//
4
5#ifndef SKYWAY_MEDIA_V4L2_CAPTURER_VIDEO_SOURCE_HPP_
6#define SKYWAY_MEDIA_V4L2_CAPTURER_VIDEO_SOURCE_HPP_
7
8#include <api/video/video_sink_interface.h>
9#include <modules/video_capture/video_capture.h>
10
11#include "skyway/media/interface/capturer_video_source.hpp"
12
13namespace skyway {
14namespace media {
15
17
18class V4l2CapturerVideoSource : public interface::InternalCapturerVideoSource {
19public:
20 class VideoSinkCallback : public rtc::VideoSinkInterface<webrtc::VideoFrame> {
21 public:
22 VideoSinkCallback(V4l2CapturerVideoSource* source) : source_(source){};
23 // rtc::VideoSinkInterface
24 void OnFrame(const webrtc::VideoFrame& frame) { source_->OnFrame(frame); }
25
26 private:
27 V4l2CapturerVideoSource* source_ = nullptr;
28 };
29 ~V4l2CapturerVideoSource();
30
31 static rtc::scoped_refptr<V4l2CapturerVideoSource> Create(
32 const std::string& device_unique_id, webrtc::VideoCaptureCapability device_capability);
33
34 // rtc::VideoSourceInterface
35 bool is_screencast() const override;
36 absl::optional<bool> needs_denoising() const override;
37 webrtc::MediaSourceInterface::SourceState state() const override;
38 bool remote() const override;
39
40protected:
41 V4l2CapturerVideoSource();
42
43private:
44 bool Init(const std::string& device_unique_id,
45 webrtc::VideoCaptureCapability device_capability);
46 void Destroy();
47 rtc::scoped_refptr<webrtc::VideoCaptureModule> vcm_ = nullptr;
48 std::unique_ptr<VideoSinkCallback> video_sink_callback_ = nullptr;
49};
51
52} // namespace media
53} // namespace skyway
54
55#endif /* SKYWAY_MEDIA_CAPTURER_VIDEO_SOURCE_ */