Skip to content

TSdlCameraID

This is a unique ID for a camera device for the time it is connected to the system, and is never reused for the lifetime of the application.

If the device is disconnected and reconnected, it will get a new ID.

The value 0 is an invalid ID.

Definition

Unit: Neslib.Sdl3.Video

type TSdlCameraID = record ... end;

See Also

Properties

Name Description
Cameras A list of currently connected camera devices.
Name The human-readable device name for the camera.
Position The position of the camera in relation to the system.
SupportedFormats The list of native formats/sizes the camera supports.

Operators

Name Description
Equal(TSdlCameraID, TSdlCameraID) Used to compare against another TSdlCameraID.
Equal(TSdlCameraID, Cardinal) Used to compare against 0.
Implicit Used to set the value to 0.
NotEqual(TSdlCameraID, TSdlCameraID) Used to compare against another TSdlCameraID.
NotEqual(TSdlCameraID, Cardinal) Used to compare against 0.

Property Descriptions

Cameras

A list of currently connected camera devices.

class property Cameras: TArray<TSdlCameraID> read GetCameras

Type: TArray<TSdlCameraID>

Exceptions

ESdlError: Raised on failure.

See Also

Remarks

It is safe to use this property from any thread


Name

The human-readable device name for the camera.

property Name: String read GetName

Type: String

Exceptions

ESdlError: Raised on failure.

See Also

Remarks

It is safe to use this property from any thread


Position

The position of the camera in relation to the system.

Most platforms will report Unknown, but mobile devices, like phones, can often make a distinction between cameras on the front of the device (that points towards the user, for taking "selfies") and cameras on the back (for filming in the direction the user is facing).

property Position: TSdlCameraPosition read GetPosition

Type: TSdlCameraPosition

See Also

Remarks

It is safe to use this property from any thread


SupportedFormats

The list of native formats/sizes the camera supports.

This returns a list of all formats and frame sizes that a specific camera can offer. This is useful if your app can accept a variety of image formats and sizes and so want to find the optimal spec that doesn't require conversion.

This property isn't strictly required; if you call TSdlCamera.Open with a nil spec, SDL will choose a native format for you, and if you instead specify a desired format, it will transparently convert to the requested format on your behalf.

Note that it's legal for a camera to supply an empty list.

property SupportedFormats: TArray<TSdlCameraSpec> read GetSupportedFormats

Type: TArray<TSdlCameraSpec>

Exceptions

ESdlError: Raised on failure.

See Also

Remarks

It is safe to use this property from any thread


Operator Descriptions

Equal(TSdlCameraID, TSdlCameraID)

Used to compare against another TSdlCameraID.

class operator Equal(const ALeft, ARight: TSdlCameraID): Boolean; inline; static

Parameters

ALeft: TSdlCameraID

ARight: TSdlCameraID

Returns

Boolean


Equal(TSdlCameraID, Cardinal)

Used to compare against 0.

class operator Equal(const ALeft: TSdlCameraID; const ARight: Cardinal): Boolean; inline; static

Parameters

ALeft: TSdlCameraID

ARight: Cardinal

Returns

Boolean


Implicit(Cardinal)

Used to set the value to 0.

class operator Implicit(const AValue: Cardinal): TSdlCameraID; inline; static

Parameters

AValue: Cardinal

Returns

TSdlCameraID


NotEqual(TSdlCameraID, TSdlCameraID)

Used to compare against another TSdlCameraID.

class operator NotEqual(const ALeft, ARight: TSdlCameraID): Boolean; inline; static

Parameters

ALeft: TSdlCameraID

ARight: TSdlCameraID

Returns

Boolean


NotEqual(TSdlCameraID, Cardinal)

Used to compare against 0.

class operator NotEqual(const ALeft: TSdlCameraID; const ARight: Cardinal): Boolean; inline; static

Parameters

ALeft: TSdlCameraID

ARight: Cardinal

Returns

Boolean