8 #ifndef META_OCEAN_SYSTEM_USB_VIDEO_VS_DESCRIPTOR_H
9 #define META_OCEAN_SYSTEM_USB_VIDEO_VS_DESCRIPTOR_H
78 template <
typename TDescriptor>
113 inline uint8_t endpointAddress()
const;
130 uint8_t bLength_ = 0u;
133 uint8_t bDescriptorType_ = 0u;
136 uint8_t bDescriptorSubtype_ = 0u;
141 uint8_t bNumFormats_ = 0u;
144 uint16_t wTotalLength_ = 0u;
154 uint8_t bEndpointAddress_ = 0u;
161 uint8_t bmInfo_ = 0u;
164 uint8_t bTerminalLink_ = 0u;
173 uint8_t bStillCaptureMethod_ = 0u;
180 uint8_t bTriggerSupport_= 0u;
187 uint8_t bTriggerUsage_ = 0u;
192 uint8_t bControlSize_ = 0u;
277 uint8_t bLength_ = 0u;
280 uint8_t bDescriptorType_ = 0u;
283 uint8_t bDescriptorSubtype_ = 0u;
288 uint8_t bFormatIndex_ = 0u;
291 uint8_t bNumFrameDescriptors_ = 0u;
294 uint8_t guidFormat_[16] = {};
297 uint8_t bBitsPerPixel_ = 0u;
300 uint8_t bDefaultFrameIndex_ = 0u;
303 uint8_t bAspectRatioX_ = 0u;
306 uint8_t bAspectRatioY_ = 0u;
323 uint8_t bmInterlaceFlags_ = 0u;
326 uint8_t bCopyProtect_ = 0u;
392 uint8_t bLength_ = 0u;
395 uint8_t bDescriptorType_ = 0u;
398 uint8_t bDescriptorSubtype_ = 0u;
403 uint8_t bFrameIndex_ = 0u;
411 uint8_t bmCapabilities_ = 0u;
414 uint16_t wWidth_ = 0u;
417 uint16_t wHeight_ = 0u;
420 uint32_t dwMinBitRate_ = 0u;
423 uint32_t dwMaxBitRate_ = 0u;
432 uint32_t dwMaxVideoFrameBufferSize_ = 0u;
435 uint32_t dwDefaultFrameInterval_ = 0u;
438 uint8_t bFrameIntervalType_ = 0u;
444 uint32_t dwMinFrameInterval_ = 0u;
450 uint32_t dwMaxFrameInterval_ = 0u;
456 uint32_t dwFrameIntervalStep_ = 0u;
556 uint8_t bLength_ = 0u;
559 uint8_t bDescriptorType_ = 0u;
562 uint8_t bDescriptorSubtype_ = 0u;
567 uint8_t bFormatIndex_ = 0u;
570 uint8_t bNumFrameDescriptors_ = 0u;
573 uint8_t guidFormat_[16] = {};
576 uint8_t bBitsPerPixel_ = 0u;
579 uint8_t bDefaultFrameIndex_ = 0u;
582 uint8_t bAspectRatioX_ = 0u;
585 uint8_t bAspectRatioY_ = 0u;
602 uint8_t bmInterlaceFlags_ = 0u;
609 uint8_t bCopyProtect_ = 0u;
617 uint8_t bVariableSize_ = 0u;
683 uint8_t bLength_ = 0u;
686 uint8_t bDescriptorType_ = 0u;
689 uint8_t bDescriptorSubtype_ = 0u;
694 uint8_t bFrameIndex_ = 0u;
697 uint8_t bmCapabilities_ = 0u;
700 uint16_t wWidth_ = 0u;
703 uint16_t wHeight_ = 0u;
706 uint32_t dwMinBitRate_ = 0u;
709 uint32_t dwMaxBitRate_ = 0u;
712 uint32_t dwDefaultFrameInterval_ = 0u;
715 uint8_t bFrameIntervalType_ = 0u;
721 uint32_t dwBytesPerLine_ = 0u;
724 uint32_t dwMinFrameInterval_ = 0u;
727 uint32_t dwMaxFrameInterval_ = 0u;
730 uint32_t dwFrameIntervalStep_ = 0u;
790 uint8_t bLength_ = 0u;
793 uint8_t bDescriptorType_ = 0u;
796 uint8_t bDescriptorSubtype_ = 0u;
810 uint8_t bColorPrimaries_ = 0u;
824 uint8_t bTransferCharacteristics_ = 0u;
836 uint8_t bMatrixCoefficients_ = 0u;
893 uint8_t bLength_ = 0u;
896 uint8_t bDescriptorType_ = 0u;
899 uint8_t bDescriptorSubtype_ = 0u;
904 uint8_t bFormatIndex_ = 0u;
907 uint8_t bNumFrameDescriptors_ = 0u;
914 uint8_t bmFlags_ = 0u;
917 uint8_t bDefaultFrameIndex_ = 0u;
920 uint8_t bAspectRatioX_ = 0u;
923 uint8_t bAspectRatioY_ = 0u;
939 uint8_t bmInterlaceFlags_ = 0u;
946 uint8_t bCopyProtect_ = 0u;
1012 uint8_t bLength_ = 0u;
1015 uint8_t bDescriptorType_ = 0u;
1018 uint8_t bDescriptorSubtype_ = 0u;
1023 uint8_t bFrameIndex_ = 0u;
1033 uint8_t bmCapabilities_ = 0u;
1036 uint16_t wWidth_ = 0u;
1039 uint16_t wHeight_ = 0u;
1042 uint32_t dwMinBitRate_ = 0u;
1045 uint32_t dwMaxBitRate_ = 0u;
1055 uint32_t dwMaxVideoFrameBufferSize_ = 0u;
1058 uint32_t dwDefaultFrameInterval_ = 0u;
1065 uint8_t bFrameIntervalType_ = 0u;
1071 uint32_t dwMinFrameInterval_ = 0u;
1077 uint32_t dwMaxFrameInterval_ = 0u;
1083 uint32_t dwFrameIntervalStep_ = 0u;
1094 template <
typename TDescriptor>
1097 if (frameRates !=
nullptr)
1099 frameRates->clear();
1102 if (!descriptor.isValid())
1109 if (descriptor.bFrameIntervalType_ == 0u)
1115 for (
unsigned int frameInterval = descriptor.dwMinFrameInterval_; frameInterval <= descriptor.dwMaxFrameInterval_; frameInterval += descriptor.dwFrameIntervalStep_)
1117 result.emplace_back(frameInterval);
1124 result = descriptor.dwFrameInterval_;
1127 if (frameRates !=
nullptr)
1129 frameRates->reserve(result.size());
1131 for (
const uint32_t frameInterval : result)
PixelFormat
Definition of all pixel formats available in the Ocean framework.
Definition: Frame.h:183
@ FORMAT_UNDEFINED
Undefined pixel format.
Definition: Frame.h:187
This class implements the base class for all interface descriptors.
Definition: system/usb/Descriptor.h:29
static double interval2frequency(const uint32_t timeInterval)
Converts a time interval (in 100ns) to frequency in Hz.
Color Matching Descriptor (VS_COLORFORMAT).
Definition: VSDescriptor.h:760
VSColorMatchingDescriptor(const void *buffer, const size_t size)
Creates a new color matching descriptor from memory.
VSColorMatchingDescriptor()=default
Default constructor creating an invalid descriptor.
std::string toString() const
Returns the content of this descriptor as string.
bool isValid() const
Returns whether this object holds valid descriptor information.
This class implements the base class for all video streaming descriptors.
Definition: VSDescriptor.h:36
VideoStreamingInterfaceTypes
Definition of individual video streaming interfaces types.
Definition: VSDescriptor.h:44
@ VS_FRAME_MJPEG
Image descriptor for MJPEG stream.
Definition: VSDescriptor.h:60
@ VS_STILL_FRAME
Descriptor for still images.
Definition: VSDescriptor.h:52
@ VS_COLORFORMAT
Color format descriptor for any stream.
Definition: VSDescriptor.h:62
@ VS_FORMAT_FRAME_BASED
Format descriptor for frame-based streams.
Definition: VSDescriptor.h:64
@ VS_OUTPUT_HEADER
The Output Header descriptor for VS interfaces that contain an OUT endpoint for streaming video data.
Definition: VSDescriptor.h:50
@ VS_INPUT_HEADER
The Input Header descriptor is used for VS interfaces that contain an IN endpoint for streaming video...
Definition: VSDescriptor.h:48
@ VS_FORMAT_UNCOMPRESSED
Format descriptor for uncompressed streams.
Definition: VSDescriptor.h:54
@ VS_UNDEFINED
Undefined descriptor.
Definition: VSDescriptor.h:46
@ VS_FRAME_FRAME_BASED
Image descriptor for frame-based stream.
Definition: VSDescriptor.h:66
@ VS_FRAME_UNCOMPRESSED
Image descriptor for uncompressed stream.
Definition: VSDescriptor.h:56
@ VS_FORMAT_MJPEG
Format descriptor for MJPEG streams.
Definition: VSDescriptor.h:58
static Indices32 frameIntervals(const TDescriptor &descriptor, std::vector< double > *frameRates=nullptr)
Returns the frame intervals of a given descriptor.
Definition: VSDescriptor.h:1095
Frame Based Payload Frame Descriptor (VS_FRAME_FRAME_BASED).
Definition: VSDescriptor.h:644
Indices32 frameIntervals(std::vector< double > *frameRates=nullptr) const
Returns the frame intervals of this descriptor.
VSFrameBasedFrameDescriptor(const void *buffer, const size_t size)
Creates a new frame descriptor from memory.
Indices32 dwFrameInterval_
For discrete Frame Intervals First entry: Shortest frame interval supported (at highest frame rate),...
Definition: VSDescriptor.h:738
VSFrameBasedFrameDescriptor()=default
Default constructor creating an invalid descriptor.
std::string toString() const
Returns the content of this descriptor as string.
bool isValid() const
Returns whether this object holds valid descriptor information.
MJPEG Video Frame Descriptors (VS_FRAME_MJPEG).
Definition: VSDescriptor.h:970
VSMJPEGVideoFrameDescriptor()=default
Default constructor creating an invalid descriptor.
std::string toString() const
Returns the content of this descriptor as string.
Indices32 frameIntervals(std::vector< double > *frameRates=nullptr) const
Returns the frame intervals of this descriptor.
bool isValid() const
Returns whether this object holds valid descriptor information.
VSMJPEGVideoFrameDescriptor(const void *buffer, const size_t size)
Creates a new frame descriptor from memory.
Indices32 dwFrameInterval_
For discrete Frame Intervals First entry: Shortest frame interval supported (at highest frame rate),...
Definition: VSDescriptor.h:1091
Uncompressed Frame Descriptor (VS_FRAME_UNCOMPRESSED).
Definition: VSDescriptor.h:350
std::string toString() const
Returns the content of this descriptor as string.
VSUncompressedVideoFrameDescriptor()=default
Default constructor creating an invalid descriptor.
Indices32 dwFrameInterval_
For discrete Frame Intervals First entry: Shortest frame interval supported (at highest frame rate),...
Definition: VSDescriptor.h:464
bool isValid() const
Returns whether this object holds valid descriptor information.
Indices32 frameIntervals(std::vector< double > *frameRates=nullptr) const
Returns the frame intervals of this descriptor.
VSUncompressedVideoFrameDescriptor(const uint8_t *buffer, const size_t size)
Creates a new frame descriptor from memory.
std::vector< Index32 > Indices32
Definition of a vector holding 32 bit index values.
Definition: Base.h:96
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15