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 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*)>
80 void start_callbacks()
override;
81 void stop_callbacks()
override;
85 std::vector<stream_profile> get_profiles()
const override;
96 bool set_pu(
rs2_option opt,
int value)
override;
99 void lock()
const override { _systemwide_lock.lock(); }
100 void unlock()
const override { _systemwide_lock.unlock(); }
104 IAMVideoProcAmp* get_video_proc()
const;
105 IAMCameraControl* get_camera_control()
const;
111 void stop_stream_cleanup(
const stream_profile& profile, std::vector<profile_and_callback>::iterator& elem);
112 void flush(
int sIndex);
113 void check_connection()
const;
116 CComPtr<IMFAttributes> create_device_attrs();
117 CComPtr<IMFAttributes> create_reader_attrs();
118 void foreach_profile(std::function<
void(
const mf_profile& profile, CComPtr<IMFMediaType> media_type,
bool& quit)> action)
const;
129 CComPtr<IMFSourceReader> _reader =
nullptr;
130 CComPtr<IMFMediaSource> _source =
nullptr;
131 CComPtr<IMFAttributes> _device_attrs =
nullptr;
132 CComPtr<IMFAttributes> _reader_attrs =
nullptr;
134 CComPtr<IAMCameraControl> _camera_control =
nullptr;
135 CComPtr<IAMVideoProcAmp> _video_proc =
nullptr;
140 HRESULT _readsample_result = S_OK;
152 bool _streaming =
false;
153 std::atomic<bool> _is_started =
false;
164 STDMETHODIMP QueryInterface(REFIID iid,
void** ppv)
override;
167 STDMETHODIMP OnReadSample(HRESULT ,
171 IMFSample *
sample)
override;
172 STDMETHODIMP OnEvent(DWORD , IMFMediaEvent* )
override;
173 STDMETHODIMP OnFlush(DWORD)
override;
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls...
DEFINE_GUIDSTRUCT("24E552D7-6523-47F7-A647-D3465BF1F5CA", KSCATEGORY_SENSOR_CAMERA)
GLsizei const GLchar *const * string
def info(name, value, persistent=False)
#define KSCATEGORY_SENSOR_CAMERA
static const std::vector< std::vector< std::pair< GUID, GUID > > > attributes_params