Enumerating Streams

Top  Previous  Next

Each SDK device may have multiple streams. The stream information is part of the DeviceInfo structure. Use the QueryDeviceInfo function to retrieve the stream information. Example 37 shows how to enumerate the stream information.

C++ Example 37: Enumerate Device Streams

// device is a PXCCapture::Device instance

PXCCapture::DeviceInfo dinfo={};

device->QueryDeviceInfo(&dinfo);

 

if (dinfo.streams&PXCCapture::STREAM_TYPE_COLOR) {

   wprintf_s(L"COLOR STREAM\n");

}

 

if (dinfo.streams&PXCCapture::STREAM_TYPE_DEPTH) {

   wprintf_s(L"DEPTH STREAM\n");

}

C# Example 37: Enumerate Device Streams

// device is a PXCMCapture.Device instance

PXCMCapture.DeviceInfo dinfo;

device.QueryDeviceInfo(out dinfo);

 

if ((dinfo.streams&PXCMCapture.StreamType.STREAM_TYPE_COLOR)!=0) {

   Console.WriteLn("COLOR STREAM");

}

 

if ((dinfo.streams&PXCMCapture.StreamType.STREAM_TYPE_DEPTH)!=0) {

   Console.WriteLn("DEPTH STREAM");

}

Java Example 37: Enumerate Device Streams

// device is a PXCMCapture.Device instance

PXCMCapture.DeviceInfo dinfo=new PXCMCapture.DeviceInfo();

device.QueryDeviceInfo(dinfo);

 

if ((dinfo.streams.contains(PXCMCapture.StreamType.STREAM_TYPE_COLOR)) {

   System.out.printf("COLOR STREAM%n");

}

 

if ((dinfo.streams.contains(PXCMCapture.StreamType.STREAM_TYPE_DEPTH)) {

   System.out.printf("DEPTH STREAM%n");

}