8 #ifndef META_OCEAN_SYSTEM_USB_VIDEO_VIDEO_DEVICE_H
9 #define META_OCEAN_SYSTEM_USB_VIDEO_VIDEO_DEVICE_H
73 class OCEAN_SYSTEM_USB_VIDEO_EXPORT
Sample
91 explicit Sample(
const size_t capacity,
const uint8_t descriptorFormatIndex,
const uint8_t descriptorFrameIndex,
const uint32_t dwClockFrequency);
97 inline uint8_t descriptorFormatIndex()
const;
103 inline uint8_t descriptorFrameIndex()
const;
115 inline const void* data()
const;
121 inline size_t size()
const;
127 inline bool mayContainError()
const;
175 size_t position_ = 0;
178 bool mayContainError_ =
false;
181 uint64_t captureDeviceTime_ = uint64_t(-1);
184 uint64_t payloadDeviceTimes_[2] = {uint64_t(-1), uint64_t(-1)};
190 size_t nextDeviceTimeIndex_ = 0;
193 bool allowToResize_ =
false;
196 uint8_t descriptorFormatIndex_ = 0u;
199 uint8_t descriptorFrameIndex_ = 0u;
202 uint32_t dwClockFrequency_ = 0u;
221 static constexpr
size_t maximalSampleQueueSize_ = 10;
236 inline bool isValid()
const;
250 VideoControlInterface(
const libusb_interface_descriptor& interfaceDescriptor, libusb_device_handle* usbDeviceHandle);
270 uint8_t bInterfaceIndex_ = 0u;
273 uint8_t bEndpointAddress_ = 0u;
276 bool isValid_ =
false;
404 inline bool isValid()
const;
429 template <
typename T>
430 static float determineResolutionFactor(
const T& frameDescriptor,
const unsigned int preferredWidth,
const unsigned int preferredHeight,
const unsigned int defaultPixels = 1280u * 720u);
441 template <
typename T>
442 static float determineFrameRateFactor(
const T& frameDescriptor,
const double preferredFrameRate, uint32_t& frameInterval,
const double defaultFrameRate);
459 uint8_t bInterfaceIndex_ = 0u;
462 uint8_t bEndpointAddress_ = 0u;
468 static constexpr
size_t sampleMaxPayloadSize_ = 1024 * 1024 * 10;
476 SC_UNDEFINED = 0x00u,
478 SC_VIDEOCONTROL = 0x01u,
480 SC_VIDEOSTREAMING = 0x02u,
482 SC_VIDEO_INTERFACE_COLLECTION = 0x03u
487 VS_CONTROL_UNDEFINED = 0x00u,
489 VS_PROBE_CONTROL = 0x01u,
491 VS_COMMIT_CONTROL = 0x02u,
492 VS_STILL_PROBE_CONTROL = 0x03u,
493 VS_STILL_COMMIT_CONTROL = 0x04u,
494 VS_STILL_IMAGE_TRIGGER_CONTROL = 0x05u,
495 VS_STREAM_ERROR_CODE_CONTROL = 0x06u,
496 VS_GENERATE_KEY_FRAME_CONTROL = 0x07u,
497 VS_UPDATE_FRAME_SEGMENT_CONTROL = 0x08u,
498 VS_SYNCH_DELAY_CONTROL = 0x09u
546 static bool executeControl(libusb_device_handle* usbDeviceHandle,
const uint8_t bmRequestType,
const uint8_t bRequest,
const uint16_t wValue,
const uint16_t wIndex,
void* buffer,
const size_t size);
582 static bool executeVideoControlCommit(libusb_device_handle* usbDeviceHandle,
const uint8_t interfaceIndex,
const VideoControl& videoControl,
const size_t videoControlSize,
const uint8_t bRequest = RC_SET_CUR);
593 static bool executeVideoControlProbe(libusb_device_handle* usbDeviceHandle,
const uint8_t interfaceIndex,
VideoControl& videoControl,
const size_t videoControlSize,
const uint8_t bRequest = RC_GET_CUR);
611 uint16_t bmHint_ = 0u;
621 uint8_t bFormatIndex_ = 0u;
634 uint8_t bFrameIndex_ = 0u;
649 uint32_t dwFrameInterval_ = 0u;
666 uint16_t wKeyFrameRate_ = 0u;
684 uint16_t wPFrameRate_ = 0u;
701 uint16_t wCompQuality_ = 0u;
721 uint16_t wCompWindowSize_ = 0u;
730 uint16_t wDelay_ = 0u;
745 uint32_t dwMaxVideoFrameSize_ = 0u;
753 uint32_t dwMaxPayloadTransferSize_ = 0u;
761 uint32_t dwClockFrequency_ = 0u;
781 uint8_t bmFramingInfo_ = 0u;
796 uint8_t bPreferedVersion_ = 0u;
804 uint8_t bMinVersion_ = 0u;
812 uint8_t bMaxVersion_ = 0u;
831 static bool getFocusAuto(libusb_device_handle* usbDeviceHandle,
const uint8_t terminalId,
const uint8_t interfaceIndex,
const RequestCode requestCode,
bool& value);
841 static bool setFocusAuto(libusb_device_handle* usbDeviceHandle,
const uint8_t terminalId,
const uint8_t interfaceIndex,
const bool value);
852 static bool getFocusAbsolute(libusb_device_handle* usbDeviceHandle,
const uint8_t terminalId,
const uint8_t interfaceIndex,
const RequestCode requestCode, uint16_t& value);
862 static bool setFocusAbsolute(libusb_device_handle* usbDeviceHandle,
const uint8_t terminalId,
const uint8_t interfaceIndex,
const uint16_t value);
881 static bool getAutoExposureMode(libusb_device_handle* usbDeviceHandle,
const uint8_t terminalId,
const uint8_t interfaceIndex,
const RequestCode requestCode, uint8_t& value);
899 static bool setAutoExposureMode(libusb_device_handle* usbDeviceHandle,
const uint8_t terminalId,
const uint8_t interfaceIndex,
const uint8_t value);
910 static bool getExposureAbsolute(libusb_device_handle* usbDeviceHandle,
const uint8_t terminalId,
const uint8_t interfaceIndex,
const RequestCode requestCode, uint32_t& value);
920 static bool setExposureAbsolute(libusb_device_handle* usbDeviceHandle,
const uint8_t terminalId,
const uint8_t interfaceIndex,
const uint32_t value);
925 static_assert(
sizeof(
VideoControl) == 34,
"Invalid struct size!");
950 inline uint8_t toggledFrameId()
const;
956 inline bool isEndOfFrame()
const;
962 inline bool hasPresentationTime()
const;
968 inline bool hasSourceClockReference()
const;
973 inline bool isStillImage()
const;
979 inline bool hasError()
const;
985 inline bool isEndOfHeader()
const;
991 inline uint32_t sourceTimeClock()
const;
997 inline uint16_t busFrameCounter()
const;
1004 uint8_t bHeaderLength_ = 0u;
1038 uint8_t bmHeaderInfo_ = 0u;
1047 uint32_t dwPresentationTime_ = 0u;
1073 uint8_t scrSourceClock_[6];
1229 inline bool isStarted()
const;
1235 inline bool isValid()
const;
1328 bool initializeControlInterfaceInitialized_ =
false;
1331 libusb_config_descriptor* usbConfigDescriptor_ =
nullptr;
1334 uint8_t activeDescriptorFormatIndex_ = 0u;
1337 uint8_t activeDescriptorFrameIndex_ = 0u;
1340 uint32_t activeClockFrequency_ = 0u;
1343 size_t maximalSampleSize_ = 0;
1361 bool isStarted_ =
false;
1364 bool isStopping_ =
false;
1393 constexpr uint8_t checkBit = (1u << 0u);
1400 constexpr uint8_t checkBit = (1u << 1u);
1402 return (bmHeaderInfo_ & checkBit) != 0u;
1407 constexpr uint8_t checkBit = (1u << 2u);
1409 return (bmHeaderInfo_ & checkBit) != 0u;
1414 constexpr uint8_t checkBit = (1u << 3u);
1416 return (bmHeaderInfo_ & checkBit) != 0u;
1421 constexpr uint8_t checkBit = (1u << 5u);
1423 return (bmHeaderInfo_ & checkBit) != 0u;
1428 constexpr uint8_t checkBit = (1u << 6u);
1430 return (bmHeaderInfo_ & checkBit) != 0u;
1435 constexpr uint8_t checkBit = (1u << 7u);
1437 return (bmHeaderInfo_ & checkBit) != 0u;
1442 ocean_assert(hasSourceClockReference());
1445 memcpy(&result, scrSourceClock_,
sizeof(uint32_t));
1452 ocean_assert(hasSourceClockReference());
1455 memcpy(&result, scrSourceClock_ + 4,
sizeof(uint16_t));
1457 return result & uint16_t(0x07FFu);
1462 return descriptorFormatIndex_;
1467 return descriptorFrameIndex_;
1472 return buffer_.data();
1482 return mayContainError_;
1494 return uncompressedVideoStreams_;
1501 return frameBasedVideoStreams_;
1508 return mjpegVideoStreams_;
1513 return vsInputHeaderDescriptor_.isValid();
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 a recursive lock object.
Definition: Lock.h:31
This class implements a scoped lock object for recursive lock objects.
Definition: Lock.h:135
This class wraps an unmanaged object (or reference) which needs to be released after usage.
Definition: ScopedObject.h:166
This class implements a subscription object which can be used unique subscriptions to e....
Definition: ScopedSubscription.h:28
This class wraps a libusb device.
Definition: system/usb/Device.h:49
bool isValid() const
Returns whether this device is valid.
Definition: system/usb/Device.h:377
Lock lock_
The device's lock.
Definition: system/usb/Device.h:350
std::vector< BufferPointer > BufferPointers
Definition of a vector holding buffer pointers.
Definition: system/usb/Device.h:72
Color Matching Descriptor (VS_COLORFORMAT).
Definition: VSDescriptor.h:760
This class implements functions for a Camera Control terminal.
Definition: VideoDevice.h:819
static bool getFocusAbsolute(libusb_device_handle *usbDeviceHandle, const uint8_t terminalId, const uint8_t interfaceIndex, const RequestCode requestCode, uint16_t &value)
Executes a probe request for an absolute focus interface.
static bool getFocusAuto(libusb_device_handle *usbDeviceHandle, const uint8_t terminalId, const uint8_t interfaceIndex, const RequestCode requestCode, bool &value)
Executes a probe request for an auto focus interface.
static bool setFocusAbsolute(libusb_device_handle *usbDeviceHandle, const uint8_t terminalId, const uint8_t interfaceIndex, const uint16_t value)
Executes a commit request for an auto focus interface.
static bool getAutoExposureMode(libusb_device_handle *usbDeviceHandle, const uint8_t terminalId, const uint8_t interfaceIndex, const RequestCode requestCode, uint8_t &value)
Executes a probe request for an auto exposure interface.
static bool setAutoExposureMode(libusb_device_handle *usbDeviceHandle, const uint8_t terminalId, const uint8_t interfaceIndex, const uint8_t value)
Executes a commit request for an auto exposure interface.
static bool getExposureAbsolute(libusb_device_handle *usbDeviceHandle, const uint8_t terminalId, const uint8_t interfaceIndex, const RequestCode requestCode, uint32_t &value)
Executes a probe request for an absolute exposure interface.
static bool setFocusAuto(libusb_device_handle *usbDeviceHandle, const uint8_t terminalId, const uint8_t interfaceIndex, const bool value)
Executes a commit request for an auto focus interface.
static bool setExposureAbsolute(libusb_device_handle *usbDeviceHandle, const uint8_t terminalId, const uint8_t interfaceIndex, const uint32_t value)
Executes a commit request for an absolute exposure interface.
Definition: VideoDevice.h:505
RequestCode
Definition of the individual Video Class-Specific Request Codes.
Definition: VideoDevice.h:512
static bool executeControl(libusb_device_handle *usbDeviceHandle, const uint8_t bmRequestType, const uint8_t bRequest, const uint16_t wValue, const uint16_t wIndex, void *buffer, const size_t size)
Executes a control commit or probe request.
This class holds the data of a media sample.
Definition: VideoDevice.h:74
Sample()=default
Default constructor creating an invalid sample object.
std::string toString() const
Returns a string with the relevant information of this sample.
static uint64_t earlierTimestamp(const uint64_t timestampA, const uint64_t timestampB)
Returns the earlier timestamp of the two given timestamps while both timestamps are wrapped around 2^...
std::vector< uint8_t > buffer_
The payload buffer which can be appended with payload packets.
Definition: VideoDevice.h:172
bool mayContainError() const
Returns whether this sample may contain errors (e.g., because there was a transmission error).
Definition: VideoDevice.h:1480
void reset()
Resets the sample so that it can be reused.
Sample(const size_t capacity, const uint8_t descriptorFormatIndex, const uint8_t descriptorFrameIndex, const uint32_t dwClockFrequency)
Creates a new sample associated with a specific stream configuration.
bool append(const PayloadHeader &payloadHeader, const void *data, const size_t size)
Appends a payload packet to the sample.
uint8_t descriptorFormatIndex() const
Returns the video format index specifying the format descriptor of the stream delivering this sample.
Definition: VideoDevice.h:1460
size_t size() const
Returns the size of the sample.
Definition: VideoDevice.h:1475
const void * data() const
Returns the buffer of this sample.
Definition: VideoDevice.h:1470
Timestamp determineCaptureTimestamp() const
Determines the timestamp the sample was captured.
uint8_t descriptorFrameIndex() const
Returns the video frame index specifying the frame descriptor of the stream delivering this sample,...
Definition: VideoDevice.h:1465
static int unwrapTimestamps(uint64_t ×tampA, uint64_t ×tampB)
Unwraps two timestamps while both are wrapped around 2^32.
Video Probe and Commit Controls.
Definition: VideoDevice.h:564
static bool executeVideoControlProbe(libusb_device_handle *usbDeviceHandle, const uint8_t interfaceIndex, VideoControl &videoControl, const size_t videoControlSize, const uint8_t bRequest=RC_GET_CUR)
Executes a video probe control request.
std::string toString() const
Returns a string with the content of this object.
static bool executeVideoControlCommit(libusb_device_handle *usbDeviceHandle, const uint8_t interfaceIndex, const VideoControl &videoControl, const size_t videoControlSize, const uint8_t bRequest=RC_SET_CUR)
Executes a video commit control request.
This class combines the video control interface functionality.
Definition: VideoDevice.h:227
std::vector< VCSelectorUnitDescriptor > vcSelectorUnitDescriptors_
The selector unit descriptors.
Definition: VideoDevice.h:261
VideoControlInterface(const libusb_interface_descriptor &interfaceDescriptor, libusb_device_handle *usbDeviceHandle)
Creates a new video control interface based on a given interface descriptor.
bool isValid() const
Returns whether this interface object is valid.
Definition: VideoDevice.h:1485
std::vector< VCProcessingUnitDescriptor > vcProcessingUnitDescriptors_
The processing unit descriptors.
Definition: VideoDevice.h:264
std::vector< VCExtensionUnitDescriptor > vcExtensionUnitDescriptors_
The extension unit descriptors.
Definition: VideoDevice.h:267
VCHeaderDescriptor vcHeaderDescriptor_
The descriptor of the header interface.
Definition: VideoDevice.h:255
std::vector< VCInputTerminalDescriptor > vcInputTerminalDescriptors_
The input terminal descriptors.
Definition: VideoDevice.h:258
VideoControlInterface()=default
Default constructor creating an invalid interface.
This class implements a frame-based video stream.
Definition: VideoDevice.h:329
VSFrameBasedVideoFormatDescriptor vsFrameBasedVideoFormatDescriptor_
The format descriptor of the frame-based stream.
Definition: VideoDevice.h:333
std::vector< VSFrameBasedFrameDescriptor > vsFrameBasedFrameDescriptors_
The frame descriptors of the frame-based stream.
Definition: VideoDevice.h:336
This class implements a Mjpeg video stream.
Definition: VideoDevice.h:343
std::vector< VSMJPEGVideoFrameDescriptor > vsMJPEGVideoFrameDescriptors_
The frame descriptors of the Mjpeg stream.
Definition: VideoDevice.h:350
VSMJPEGVideoFormatDescriptor vsMJPEGVideoFormatDescriptor_
The format descriptor of the Mjpeg stream.
Definition: VideoDevice.h:347
This class implements an uncompressed video stream.
Definition: VideoDevice.h:315
VSUncompressedVideoFormatDescriptor vsUncompressedVideoFormatDescriptor_
The format descriptor of the uncompressed stream.
Definition: VideoDevice.h:319
std::vector< VSUncompressedVideoFrameDescriptor > vsUncompressedVideoFrameDescriptors_
The frame descriptors of the uncompressed stream.
Definition: VideoDevice.h:322
This class implements the base class for all video streams.
Definition: VideoDevice.h:304
VSColorMatchingDescriptor vsColorMatchingDescriptor_
The color matching descriptor of the stream.
Definition: VideoDevice.h:308
This class combines the video streaming interface functionality.
Definition: VideoDevice.h:283
static float determineResolutionFactor(const T &frameDescriptor, const unsigned int preferredWidth, const unsigned int preferredHeight, const unsigned int defaultPixels=1280u *720u)
Returns a factor describing how well the resolution of a descriptor matches a preferred image resolut...
std::vector< UncompressedVideoStream > UncompressedVideoStreams
Definition of a vector holding UncompressedVideoStream objects.
Definition: VideoDevice.h:356
std::vector< MJPEGVideoStream > MJPEGVideoStreams
Definition of a vector holding MJPEGVideoStream objects.
Definition: VideoDevice.h:366
VSInputHeaderDescriptor vsInputHeaderDescriptor_
The descriptor of the input header interface.
Definition: VideoDevice.h:447
const UncompressedVideoStreams & uncompressedVideoStreams() const
Returns the available uncompressed video streams.
Definition: VideoDevice.h:1490
const FrameBasedVideoStreams & frameBasedVideoStreams() const
Returns the available frame-based video streams.
Definition: VideoDevice.h:1497
bool parseAdditionalInterface(const libusb_interface_descriptor &interfaceDescriptor, libusb_device_handle *usbDeviceHandle)
Parses an additional interface and adds it to this streaming interface object.
std::map< float, PriorityTriple > PriorityMap
Definition of an ordered map mapping priorities to triples combining formats, frames,...
Definition: VideoDevice.h:296
MJPEGVideoStreams mjpegVideoStreams_
The Mjpeg-based video streams.
Definition: VideoDevice.h:456
FrameBasedVideoStreams frameBasedVideoStreams_
The frame-based video streams.
Definition: VideoDevice.h:453
VideoStreamingInterface()=default
Creates an invalid interface object.
PriorityMap findBestMatchingStream(const unsigned int preferredWidth, const unsigned int preferredHeight, const double preferredFrameRate, const DeviceStreamType deviceStreamType=DST_INVALID, const FrameType::PixelFormat pixelFormat=FrameType::FORMAT_UNDEFINED, VSFrameBasedVideoFormatDescriptor::EncodingFormat encodingFormat=VSFrameBasedVideoFormatDescriptor::EF_INVALID)
Returns a priority map with best matching stream configurations.
std::vector< FrameBasedVideoStream > FrameBasedVideoStreams
Definition of a vector holding FrameBasedVideoStream objects.
Definition: VideoDevice.h:361
UncompressedVideoStreams uncompressedVideoStreams_
The uncompressed video streams.
Definition: VideoDevice.h:450
bool isValid() const
Returns whether this interface object is valid.
Definition: VideoDevice.h:1511
static float determineFrameRateFactor(const T &frameDescriptor, const double preferredFrameRate, uint32_t &frameInterval, const double defaultFrameRate)
Returns a factor describing how well one of the frame rates of a descriptor matches a preferred frame...
const MJPEGVideoStreams & mjpegVideoStreams() const
Returns the available Mjpeg video streams.
Definition: VideoDevice.h:1504
This class implements a USB video device.
Definition: VideoDevice.h:47
VideoStreamingInterface videoStreamingInterface_
The video streaming interface of this device.
Definition: VideoDevice.h:1325
std::vector< Memory > streamingTransferMemories_
The memory for the individual streaming transfer objects.
Definition: VideoDevice.h:1355
VideoControlInterface videoControlInterface_
The video control interface of this device.
Definition: VideoDevice.h:1322
static std::string translateDeviceStreamType(const DeviceStreamType deviceStreamType)
Translates a device stream type to a string.
DeviceStreamType
Definition of individual USB UVC device stream types.
Definition: VideoDevice.h:59
@ DST_UNCOMPRESSED
A stream composed of uncompressed video frames.
Definition: VideoDevice.h:63
@ DST_MJPEG
A stream based on MJpeg.
Definition: VideoDevice.h:65
VideoInterfaceSubclass
Definition of USB UVC Video Interface Subclass Codes.
Definition: VideoDevice.h:474
Lock transferLock_
The lock for the stream and interrupt transfers.
Definition: VideoDevice.h:1358
ScopedSubscription claimedVideoStreamInterfaceSubscription_
The subscription for the claimed video stream interface.
Definition: VideoDevice.h:1388
~VideoDevice() override
Destructs this video device and releases all associated resources.
bool autoFocus(bool &value)
Returns whether auto focus is activated or deactivated.
bool parseInterfaces()
Parses all interfaces of this device.
VideoDevice & operator=(const VideoDevice &)=delete
Disabled copy operator.
VideoDevice(Device &&device)
Creates a new video device based on a valid device.
VideoDevice(VideoDevice &&)=delete
Disabled move constructor.
bool setAutoExposureMode(const uint8_t value)
Sets the auto exposure mode.
bool isStarted_
True, if the video device has an active stream which has been started.
Definition: VideoDevice.h:1361
ScopedSubscription claimedVideoControlInterfaceSubscription_
The subscription for the claimed video control interface.
Definition: VideoDevice.h:1385
bool absoluteExposure(double *minValue, double *currentValue, double *maxValue)
Returns the absolute exposure duration of this device.
bool stop()
Stops the video device.
bool setAutoFocus(const bool value)
Activate or deactivate the auto focus of this device.
BufferPointers reusableBufferPointers_
Reusable buffer pointers to extract buffers from USB transfers.
Definition: VideoDevice.h:1379
bool supportedAutoExposureModes(uint8_t &value) const
Returns the supported auto exposure modes.
Lock samplesLock_
The lock for the samples.
Definition: VideoDevice.h:1376
VideoDevice(const VideoDevice &)=delete
Disabled copy constructor.
DeviceStreamType extractStreamProperties(const uint8_t descriptorFormatIndex, const uint8_t descriptorFrameIndex, unsigned int &width, unsigned int &height, FrameType::PixelFormat &pixelFormat, VSFrameBasedVideoFormatDescriptor::EncodingFormat &encodingFormat) const
Extracts the relevant properties for a specific stream this device supports.
bool parseVideoInterface(const libusb_interface_descriptor &interfaceDescriptor)
Parses a video interface of this device.
static void LIBUSB_CALL libStatusCallback(libusb_transfer *usbTransfer)
Static libusb status transfer callback function.
void processPayload(const BufferPointers &bufferPointers)
Processes the payload which has been received from the device via a USB transfer.
bool setAbsoluteExposure(const double value)
Sets the absolute exposure duration of this device.
bool isStarted() const
Returns whether this video device has an active stream.
Definition: VideoDevice.h:1521
static void LIBUSB_CALL libusbStreamCallback(libusb_transfer *usbTransfer)
Static libusb stream transfer callback function.
ScopedSubscription detachedKernelDriverSubscription_
The subscription for the detached kernel driver (if necessary/possible).
Definition: VideoDevice.h:1382
SharedSample activeSample_
The currently active sample which is receiving sample data from the device (but not yet filled).
Definition: VideoDevice.h:1367
VideoDevice & operator=(VideoDevice &&)=delete
Disabled move operator.
bool libStatusCallback(libusb_transfer &usbTransfer)
Libusb status transfer callback function.
const VideoStreamingInterface & videoStreamingInterface() const
Returns the video streaming interface functionality of this device.
Definition: VideoDevice.h:1516
bool setAbsoluteFocus(const float value)
Sets the absolute focus of this device.
bool absoluteFocus(float *minValue, float *currentValue, float *maxValue)
Returns the device's absolute focus.
bool isValid() const
Returns whether this video device is valid and ready to be used.
Definition: VideoDevice.h:1528
bool start(const unsigned int preferredWidth=0u, const unsigned int preferredHeight=0u, const double preferredFrameRate=0.0, const DeviceStreamType preferredDeviceStreamType=DST_INVALID, const FrameType::PixelFormat preferredPixelFormat=FrameType::FORMAT_UNDEFINED, const VSFrameBasedVideoFormatDescriptor::EncodingFormat preferredEncodingFormat=VSFrameBasedVideoFormatDescriptor::EF_INVALID)
Starts the video device.
void giveSampleBack(SharedSample &&sample)
Gives a sample back to this device so that it can be reused by the device.
ControlSelectors
Definition: VideoDevice.h:486
bool initializeControlInterfaceInitialized_
True, if the control interface has been initialized.
Definition: VideoDevice.h:1328
std::queue< SharedSample > SampleQueue
Definition of a queue holding samples.
Definition: VideoDevice.h:218
VideoDevice()=default
Default constructor creating an invalid video device.
bool autoExposureMode(uint8_t &value) const
Returns the current auto exposure mode.
SampleQueue sampleQueue_
The queue with all processed samples waiting to be grabbed by an external entity.
Definition: VideoDevice.h:1370
Samples reusableSamples_
The reusable samples which waiting to be filled.
Definition: VideoDevice.h:1373
TransferIndexMap transferIndexMap_
The map mapping transfer pointers to indices.
Definition: VideoDevice.h:1352
ScopedTransfers streamingTransfers_
The streaming transfer objects.
Definition: VideoDevice.h:1349
bool libusbStreamCallback(libusb_transfer &usbTransfer)
Libusb stream transfer callback function.
ScopedTransfer interruptTransfer_
The transfer object for interrupts.
Definition: VideoDevice.h:1346
bool initializeControlInterface()
Initializes the control interface.
SharedSample nextSample(size_t *pendingSamples=nullptr)
Returns the next sample from this device.
std::vector< SharedSample > Samples
Definition of a vector holding samples.
Definition: VideoDevice.h:213
std::shared_ptr< Sample > SharedSample
Definition of a shared pointer holding a Sample.
Definition: VideoDevice.h:208
This class implements a timestamp.
Definition: Timestamp.h:36
This class implements a triple object able to hold three individual elements.
Definition: Triple.h:28
std::vector< ScopedTransfer > ScopedTransfers
Definition of a vector holding scoped libusb transfer objects.
Definition: system/usb/USB.h:68
std::shared_ptr< VideoDevice > SharedVideoDevice
Definition of a shared pointer holding a VideoDevice.
Definition: VideoDevice.h:39
std::unordered_map< libusb_transfer *, size_t > TransferIndexMap
Definition of an unordered map mapping libusb transfer points to indices.
Definition: system/usb/USB.h:73
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15