Enumerating Stream Configurations

Top  Previous  Next

Each stream may have multiple configurations (color format, resolution and frame rate). Use the QueryStreamProfileSet function to enumerate the stream configurations on a single stream or on multiple streams.

There are usually constraints on multiple stream configurations. For example, the configuration of an inferred stream may be tied to the corresponding depth stream. When enumerating multiple stream configurations, the QueryStreamProfileSet function returns the unique combinations of all valid stream configurations.

Use the IsStreamProfileSetValid function to validate certain stream configuration.

Example 38 shows how to enumerate the stream configurations.

C++ Example 38: Enumerate the Stream Configurations

// device is a PXCCapture::Device instance

PXCCapture::StreamType streams=PXCCapture::STREAM_TYPE_COLOR|PXCCapture::STREAM_TYPE_DEPTH;

 

for (int p=0;;p++) {

   PXCCapture::Device::StreamProfileSet profiles={};

   pxcStatus sts=device->QueryStreamProfileSet(streams, p, &profiles);

   if (sts<PXC_STATUS_NO_ERROR) break;

 

   wprintf_s(L"color[%d]: %dx%d\n", p, profiles.color.imageInfo.width, profiles.color.imageInfo.height);

   wprintf_s(L"depth[%d]: %dx%d\n", p, profiles.depth.imageInfo.width, profiles.depth.imageInfo.height);

}

C# Example 38: Enumerate the Stream Configurations

// device is a PXCMCapture.Device instance

PXCMCapture.StreamType streams=PXCMCapture.StreamType.STREAM_TYPE_COLOR|PXCCapture.StreamType.STREAM_TYPE_DEPTH;

 

for (int p=0;;p++) {

   PXCMCapture.Device.StreamProfileSet profiles;

   pxcmStatus sts=device.QueryStreamProfileSet(streams, p, out profiles);

   if (sts<pxcmStatus.PXCM_STATUS_NO_ERROR) break;

 

   Console.WriteLn("color[{0}]: {1}x{2}", p, profiles.color.imageInfo.width, profiles.color.imageInfo.height);

   Console.WriteLn("color[{0}]: {1}x{2}", p, profiles.color.imageInfo.width, profiles.color.imageInfo.height);

}

Java Example 38: Enumerate the Stream Configurations

// device is a PXCMCapture.Device instance

EnumSet<PXCMCapture.StreamType> streams=EnumSet.of(PXCMCapture.StreamType.STREAM_TYPE_COLOR,PXCCapture.StreamType.STREAM_TYPE_DEPTH);

 

for (int p=0;;p++) {

   PXCMCapture.Device.StreamProfileSet profiles=new PXCMCapture.Device.StreamProfileSet();

   pxcmStatus sts=device.QueryStreamProfileSet(streams, p, profiles);

   if (sts<pxcmStatus.PXCM_STATUS_NO_ERROR) break;

 

   System.out.printf("color[%d]: %dx%d%n", p, profiles.color.imageInfo.width, profiles.color.imageInfo.height);

   System.out.printf("color[%d]: %dx%d%n", p, profiles.color.imageInfo.width, profiles.color.imageInfo.height);

}