22 std::lock_guard<std::mutex>
lock(
_mtx);
32 std::lock_guard<std::mutex>
lock(
_mtx);
41 std::lock_guard<std::mutex>
lock(
_mtx);
48 std::lock_guard<std::mutex>
lock(
_mtx);
51 throw std::runtime_error(
"Configuring both device from file, and record to file is unsupported");
60 std::lock_guard<std::mutex>
lock(
_mtx);
63 throw std::runtime_error(
"Configuring both device from file, and record to file is unsupported");
71 std::lock_guard<std::mutex>
lock(
_mtx);
77 std::lock_guard<std::mutex>
lock(
_mtx);
84 if (itr->first.first ==
stream && (
index == -1 || itr->first.second ==
index))
98 std::lock_guard<std::mutex>
lock(
_mtx);
117 if (
st.first ==
p->get_stream_type())
119 if (
st.second !=
p->get_stream_index())
128 config.
enable_stream(vp->get_stream_type(), vp->get_stream_index(), vp->get_width(), vp->get_height(), vp->get_format(), vp->get_framerate());
150 for (
size_t i = 0;
i <
dev->get_sensors_count(); ++
i)
152 auto&& sub =
dev->get_sensor(
i);
175 if (
st.first ==
r.stream)
177 if (
st.second > 0 &&
st.second !=
r.index)
break;
190 std::lock_guard<std::mutex>
lock(
_mtx);
195 if (requested_device !=
nullptr)
203 for (
auto dev_info : devs)
207 auto dev = dev_info->create_device();
211 catch (
const std::exception&
e)
213 LOG_DEBUG(
"Iterate available devices - config can not be resolved. " <<
e.what());
225 throw std::runtime_error(
"Failed to resolve request. No device found that satisfies all requirements");
237 catch (
const std::exception&
e)
239 LOG_DEBUG(
"Config can not be resolved. " <<
e.what());
254 auto pdev = std::dynamic_pointer_cast< playback_device_info >(
d );
255 if( pdev && pdev->get_filename() == file )
256 return pdev->create_device();
259 auto dev_info = std::make_shared< playback_device_info >(
ctx, file );
260 ctx->add_device( dev_info );
261 return dev_info->create_device();
269 std::shared_ptr<device_interface>
dev;
274 catch (
const std::exception&
e)
277 <<
"Failed to resolve request. Request to enable_device_from_file(\""
286 <<
"Failed to resolve request. "
287 "Conflic between enable_device_from_file(\""
291 "File does not contain a device with such serial" );
299 <<
"Failed to resolve request. "
300 "Conflic between enable_device_from_file(\""
304 "File contains device with different serial number ("
324 for (
unsigned int i = 0;
i <
dev->get_sensors_count();
i++)
331 return default_profiles;