Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable platform camera for pipeline - will work only with intel cameras #2600

Merged
merged 1 commit into from
Oct 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/model-views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6628,7 +6628,7 @@ namespace rs2

device_changes::device_changes(rs2::context& ctx)
{
_changes.emplace(rs2::device_list{}, ctx.query_devices());
_changes.emplace(rs2::device_list{}, ctx.query_devices(RS2_PRODUCT_LINE_ANY));
ctx.set_devices_changed_callback([&](event_information& info)
{
add_changes(info);
Expand Down
2 changes: 1 addition & 1 deletion common/ux-window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ namespace rs2
bool do_200ms = every_200ms;
if (_query_devices && do_200ms)
{
_missing_device = rs2::context().query_devices().size() == 0;
_missing_device = rs2::context().query_devices(RS2_PRODUCT_LINE_ANY).size() == 0;
_hourglass_index = (_hourglass_index + 1) % 5;

if (!_missing_device)
Expand Down
6 changes: 3 additions & 3 deletions src/device_hub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ namespace librealsense
return result;
}

device_hub::device_hub(std::shared_ptr<librealsense::context> ctx, int vid,
device_hub::device_hub(std::shared_ptr<librealsense::context> ctx, int mask, int vid,
bool register_device_notifications)
: _ctx(ctx), _vid(vid),
_register_device_notifications(register_device_notifications)
{
_device_list = filter_by_vid(_ctx->query_devices(RS2_PRODUCT_LINE_ANY), _vid);
_device_list = filter_by_vid(_ctx->query_devices(mask), _vid);

auto cb = new hub_devices_changed_callback([&](rs2::event_information& info)
{
std::unique_lock<std::mutex> lock(_mutex);

_device_list = filter_by_vid(_ctx->query_devices(RS2_PRODUCT_LINE_ANY), _vid);
_device_list = filter_by_vid(_ctx->query_devices(mask), _vid);

// Current device will point to the first available device
_camera_index = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/device_hub.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace librealsense
class device_hub
{
public:
explicit device_hub(std::shared_ptr<librealsense::context> ctx, int vid = 0, bool register_device_notifications = true);
explicit device_hub(std::shared_ptr<librealsense::context> ctx, int mask = RS2_PRODUCT_LINE_ANY, int vid = 0, bool register_device_notifications = true);

/**
* The function implements both blocking and non-blocking device generation functionality based on the input parameters:
Expand Down
4 changes: 2 additions & 2 deletions src/pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ namespace librealsense
}

//Look for satisfy device in case the user did not specify one.
auto devs = pipe->get_context()->query_devices(RS2_PRODUCT_LINE_ANY);
auto devs = pipe->get_context()->query_devices(RS2_PRODUCT_LINE_ANY_INTEL);
for (auto dev_info : devs)
{
try
Expand Down Expand Up @@ -352,7 +352,7 @@ namespace librealsense
*/

pipeline::pipeline(std::shared_ptr<librealsense::context> ctx)
:_ctx(ctx), _hub(ctx), _dispatcher(10)
:_ctx(ctx), _hub(ctx, RS2_PRODUCT_LINE_ANY_INTEL), _dispatcher(10)
{}

pipeline::~pipeline()
Expand Down