Camera is an abstract base class which represents a camera device and its properties. There are concrete subclasses for specific types of cameras: USB cameras, IP cameras and ONVIF cameras. More...
Public Member Functions | |
Camera (CameraIdentifier identifier) | |
IVideoProfile | GetProfile (string token) |
Returns the profile for the given token or nil if no such profile is known to the camera. More... | |
abstract List< IDepthProfile > | GetDepthProfiles (IVideoProfile vp) |
The depth profiles that are available for the given video profile. More... | |
IDepthProfile | GetBestDepthProfile (IVideoProfile vp) |
Returns the highest quality depth profile that is available for the given video profile. More... | |
abstract void | Authenticate (CameraCredentials creds, CameraConnectCompletion completion) |
Authenticates the camera. This means that the camera will store the provided account and use it to get the current state of the physical camera which requires authentication to access it. E.g. it will fetch the available media profiles. More... | |
abstract CaptureSession | CreateCaptureSession (IVideoProfile video, IDepthProfile depth=null, Accelerator accelerator=null) |
Create a new capture session with the given video profile. More... | |
Protected Member Functions | |
void | OnConfigurationDidChange (bool restartCaptureSession=false) |
Saves the current camera state and posts a didChange notification. Does nothing if the key paths array is empty. More... | |
Properties | |
CameraIdentifier | Identifier [get] |
Returns the globally unique camera identifier. More... | |
CameraType | CameraType [get] |
Returns the type of the camera. More... | |
abstract string | LocalizedName [get, set] |
Returns the localized camera name. More... | |
abstract CameraPosition | Position [get] |
Returns the position of the camera. More... | |
abstract bool | CanCaptureDepthData [get] |
Returns true if the camera is able to deliver depth data in addition to video data. More... | |
virtual string?? | UserSource [get, set] |
The user source override. The global default user source will be used if the camera doesn't have its own user source. More... | |
virtual bool | MirroringEnabled [get, set] |
Returns true if the video frames are mirrored about the Y axis; false otherwise. More... | |
virtual int | Rotation [get, set] |
Returns the value by which video frames are rotated clockwise after mirroring. More... | |
abstract bool | CanAdjustGainExposure [get] |
Returns true if the camera supports adjusting gain and exposure. More... | |
abstract Range< float > | GainRange [get] |
Returns the range of supported gain values. An empty range is returned if gain adjustment is not supported More... | |
abstract float | Gain [get, set] |
The current camera sensor gain value. More... | |
abstract Range< float > | ExposureRange [get] |
Returns the range of supported exposure values. Exposure is measured in milliseconds. An empty range is returned if exposure adjustments are not supported. More... | |
abstract float | Exposure [get, set] |
The current exposure value in milliseconds. Exposure is typically half the frame rate. Exposure time is capped by the frame rate (it can not be longer than the time of a single frame). More... | |
abstract bool | IsAutoGainExposureEnabled [get, set] |
Controls whether the camera itself should automatically adjust gain and exposure as needed. More... | |
bool | CanCrop = true [get, protected set] |
Is cropping supported. More... | |
virtual bool | CroppingEnabled [get, set] |
Is cropping enabled. More... | |
virtual ? RectangleF | CropRectangle [get, set] |
The video crop rectangle in a normalized coordinate system from 0-1 with the origin in the top left corner. The video frame is cropped from the native resolution to this rectangle. If this is nil no cropping will occur. More... | |
float | FrameRateReduction [get, set] |
Frame rate reduciton ratio (1.0 - no reduction). More... | |
abstract CameraConfiguration | Configuration [get, set] |
Returns the camera configuration. More... | |
virtual bool | ContrastEnhancementEnable [get, set] |
Enables / disables contrast enhancement. More... | |
virtual double | LowLightThreshold [get, set] |
Contrast enhancement low light threshold. More... | |
virtual double | ExposureBoost [get, set] |
Contrast enhanement exposure boost. More... | |
virtual bool | DetectionOnlyContrastEnhancement [get, set] |
Enables / disables deferring of contrast enhancement from the camera side to the face detector side. More... | |
abstract List< IVideoProfile > | Profiles [get, protected set] |
The available profiles. More... | |
abstract IVideoProfile | DefaultProfile [get] |
Returns the default profile. This is a profile that should be used for capturing if you don't have any specific profile selection criteria. Nil is returned if the camera has no suitable profiles available. More... | |
bool | IsConnected [get] |
Returns true if the camera is connected and false if it got disconnected / removed. More... | |
abstract ? CameraCredentials | Credentials [get] |
The credentials to use for authentication. More... | |
abstract bool | RequiresAuthentication [get] |
Returns true if the camera requires authentication in order to access its video profile information and to stream from it. More... | |
abstract bool | IsAuthenticated [get] |
Returns true if the camera has been successfully authenticated; false otherwise. More... | |
virtual int | MetadataPort [get, set] |
The metadata ip port. More... | |
bool | ShouldRestartCaptureSession = false [get, set] |
The metadata ip port. More... | |
DirectionOfTravelDescriptor | DirectionOfTravelDescriptor [get, set] |
Unauthorized direction configuration. More... | |
Events | |
EventHandler< DidChangeConfigurationEventArgs > | DidChangeConfiguration |
Configuration change event handler. More... | |
Camera is an abstract base class which represents a camera device and its properties. There are concrete subclasses for specific types of cameras: USB cameras, IP cameras and ONVIF cameras.
An IP camera is a camera which makes a video stream available which can be connected to via a public (an usually unsecured) HTTP or RTSP URL. An ONVIF camera is a camera which implements the ONVIF camera discovery and control standard. The CameraManager uses the ONVIF protocol to discover ONVIF cameras and the OnvifCamera class uses the ONVIF protocol to acquire information about the camera and to initiate a video stream.
You acquire camera objects by asking teh CameraManager for them. The CameraManager knows how to discover and manage cameras.
A camera has properties like a name and the set of available video formats. Some of those properties may be setable for some types of cameras and read-only for other types. For example, the name of a camera is settable for IP cameras but read-only for ONVIF cameras because the name of the camera in this case is only settable via the web-UI provided by the camera software.
Every camera has a globally unique identifier. This identifier is guaranteed to remain stable and may be persisted. You can use this identifier to associate sour own configuration information with a camera.
You create a video stream from a camera by asking the camera for a capture session via the CreateCaptureSession() function. This function takes a video profile which specifies the video resolution and frames per second that the video stream should have. Note that some cameras may allow you to create more than one capture session for a given video profile and some may allow only one active capture session per video profile.
Use the DefaultProfile property to get the default video profile of a camera. The default profile is usually a 1080p profile or close to it. Use the Profiles property to get the full list of available profile. You can iterate through this list of profiles to find one that matches most closely what you are looking for. Then create a capture session with this profile.
Once you've create a capture session you should register event handlers on the capture session object to receive video frames and errors. Then start the capture session by setting its Capturing property to true. You can pause / stop capturing at any time by setting Capturing to false.
RealNetworks.CameraKit.Camera.Camera | ( | CameraIdentifier | identifier | ) |
|
pure virtual |
Authenticates the camera. This means that the camera will store the provided account and use it to get the current state of the physical camera which requires authentication to access it. E.g. it will fetch the available media profiles.
creds | the camera credentials |
completion | the completion handler to invoke |
Implemented in RealNetworks.CameraKit.XimeaCamera, RealNetworks.CameraKit.USBCamera, RealNetworks.CameraKit.IntelRealsenseCamera, and RealNetworks.CameraKit.OnvifCamera.
|
pure virtual |
Create a new capture session with the given video profile.
video | the desired video profile |
depth | the desired depth profile (optional) |
accelerator | the accelerator that should be used for video decoding. Null means use the primary display accelerator |
Implemented in RealNetworks.CameraKit.OnvifCamera, RealNetworks.CameraKit.XimeaCamera, RealNetworks.CameraKit.USBCamera, and RealNetworks.CameraKit.IntelRealsenseCamera.
IDepthProfile RealNetworks.CameraKit.Camera.GetBestDepthProfile | ( | IVideoProfile | vp | ) |
Returns the highest quality depth profile that is available for the given video profile.
vp | the video profile |
|
pure virtual |
The depth profiles that are available for the given video profile.
vp | the video profile |
Implemented in RealNetworks.CameraKit.OnvifCamera, RealNetworks.CameraKit.XimeaCamera, RealNetworks.CameraKit.USBCamera, and RealNetworks.CameraKit.IntelRealsenseCamera.
IVideoProfile RealNetworks.CameraKit.Camera.GetProfile | ( | string | token | ) |
Returns the profile for the given token or nil if no such profile is known to the camera.
token | the video profile token |
|
protected |
Saves the current camera state and posts a didChange notification. Does nothing if the key paths array is empty.
|
get |
Returns the type of the camera.
|
get |
Returns true if the camera supports adjusting gain and exposure.
|
get |
Returns true if the camera is able to deliver depth data in addition to video data.
|
getprotected set |
Is cropping supported.
|
getset |
Returns the camera configuration.
|
getset |
Enables / disables contrast enhancement.
|
get |
The credentials to use for authentication.
|
getset |
Is cropping enabled.
|
getset |
The video crop rectangle in a normalized coordinate system from 0-1 with the origin in the top left corner. The video frame is cropped from the native resolution to this rectangle. If this is nil no cropping will occur.
|
get |
Returns the default profile. This is a profile that should be used for capturing if you don't have any specific profile selection criteria. Nil is returned if the camera has no suitable profiles available.
|
getset |
Enables / disables deferring of contrast enhancement from the camera side to the face detector side.
|
getset |
Unauthorized direction configuration.
|
getset |
The current exposure value in milliseconds. Exposure is typically half the frame rate. Exposure time is capped by the frame rate (it can not be longer than the time of a single frame).
|
getset |
Contrast enhanement exposure boost.
|
get |
Returns the range of supported exposure values. Exposure is measured in milliseconds. An empty range is returned if exposure adjustments are not supported.
|
getset |
Frame rate reduciton ratio (1.0 - no reduction).
|
getset |
The current camera sensor gain value.
|
get |
Returns the range of supported gain values. An empty range is returned if gain adjustment is not supported
|
get |
Returns the globally unique camera identifier.
|
get |
Returns true if the camera has been successfully authenticated; false otherwise.
|
getset |
Controls whether the camera itself should automatically adjust gain and exposure as needed.
|
get |
Returns true if the camera is connected and false if it got disconnected / removed.
|
getset |
Returns the localized camera name.
|
getset |
Contrast enhancement low light threshold.
|
getset |
The metadata ip port.
|
getset |
Returns true if the video frames are mirrored about the Y axis; false otherwise.
|
get |
Returns the position of the camera.
|
getprotected set |
The available profiles.
|
get |
Returns true if the camera requires authentication in order to access its video profile information and to stream from it.
|
getset |
Returns the value by which video frames are rotated clockwise after mirroring.
|
getset |
The metadata ip port.
|
getset |
The user source override. The global default user source will be used if the camera doesn't have its own user source.
EventHandler<DidChangeConfigurationEventArgs> RealNetworks.CameraKit.Camera.DidChangeConfiguration |
Configuration change event handler.