5 #include "../backend.h" 9 #include <mfreadwrite.h> 10 #include <atlcomcli.h> 14 #include <unordered_map> 18 #ifndef KSCATEGORY_SENSOR_CAMERA 20 #define KSCATEGORY_SENSOR_CAMERA DEFINE_GUIDNAMED(KSCATEGORY_SENSOR_CAMERA) 21 #endif // !KSCATEGORY_SENSOR_CAMERA 24 static const std::vector<std::vector<std::pair<GUID, GUID>>> attributes_params = {
26 { MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE, MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_GUID },
30 { MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE, MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_GUID }
46 typedef std::function<void(const uvc_device_info&, IMFActivate*)>
63 std::vector<stream_profile>
get_profiles()
const override;
77 void lock()
const override { _systemwide_lock.
lock(); }
86 void stop_stream_cleanup(
const stream_profile& profile, std::vector<profile_and_callback>::iterator& elem);
87 void flush(
int sIndex);
88 void check_connection()
const;
90 std::vector<std::pair<stream_profile, int>> get_stream_profiles_and_indexes()
const;
91 int get_stream_index_by_profile(
const stream_profile& profile)
const;
96 CComPtr<source_reader_callback> _callback =
nullptr;
97 CComPtr<IMFSourceReader> _reader =
nullptr;
98 CComPtr<IMFMediaSource> _source =
nullptr;
99 CComPtr<IMFActivate> _activate =
nullptr;
100 CComPtr<IMFAttributes> _device_attrs =
nullptr;
101 CComPtr<IMFAttributes> _reader_attrs =
nullptr;
103 CComPtr<IAMCameraControl> _camera_control =
nullptr;
104 CComPtr<IAMVideoProcAmp> _video_proc =
nullptr;
105 std::unordered_map<int, CComPtr<IKsControl>> _ks_controls;
109 HRESULT _readsample_result = S_OK;
111 std::vector<profile_and_callback> _streams;
112 std::mutex _streams_mutex;
114 std::shared_ptr<const wmf_backend> _backend;
117 std::string _location;
118 std::vector<stream_profile> _profiles;
119 std::vector<frame_callback> _frame_callbacks;
120 bool _streaming =
false;
121 std::atomic<bool> _is_started =
false;
138 IMFSample *sample)
override;
139 STDMETHODIMP
OnEvent(DWORD , IMFMediaEvent* )
override;
140 STDMETHODIMP
OnFlush(DWORD)
override;
142 std::weak_ptr<wmf_uvc_device> _owner;
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls...
Definition: rs_option.h:22
#define KSCATEGORY_SENSOR_CAMERA
Definition: win-uvc.h:20
DEFINE_GUIDSTRUCT("24E552D7-6523-47F7-A647-D3465BF1F5CA", KSCATEGORY_SENSOR_CAMERA)