The camera manager is responsible for the discovery of cameras and it allows you easy access to the default camera for a camera position. More...
Public Member Functions | |
void | AddDiscovery (CameraDiscovery discovery) |
Camera | GetCamera (CameraIdentifier identifier) |
Returns the camera for the given identifier. Nil is returned if no such camera exists. More... | |
Camera | GetDefaultCamera (CameraPosition position, bool depthable=false) |
Returns the default camera. The default camera is the camera that an application should pick by default. E.g. a built-in camera that is guaranteed to exist and that produces good results. Nil is returned if the discovery has no concept of a default camera. More... | |
async Task | TriggerDiscovery () |
Triggers a new round of camera discovery. Listen to the discovery start and end notifications to learn when discovery has ended. More... | |
Camera | AddCamera (CameraType type, string name, Uri uri) |
Adds camera of type with name / uri. More... | |
void | RemoveCamera (CameraIdentifier identifier) |
Removes the camera with the given camera identifier. Does nothing if no such camera exists. More... | |
string | ExternalizedCameras () |
Creates an externalized list of all cameras and their configurations. You may store this information persistently. More... | |
void | InternalizeCameras (string data) |
Takes an externalized camera list and applies it to the camera manager: More... | |
CameraCredentials? | GetCredentials (CameraIdentifier identifier) |
Returns the credentials for the camera identified by the given camera identifier. Returns nil if the camera manager has no persisted credentials for this camera. More... | |
void | SaveCredentials (CameraCredentials credentials, CameraIdentifier identifier) |
Saves the given credentials for the camera identified by 'identifier'. More... | |
Properties | |
static CameraManager | Shared [get] |
The shared camera manager. More... | |
List< Camera > | AvailableCameras [get] |
Returns all available cameras. More... | |
Camera | DefaultCamera [get] |
Returns the default camera as specified by the OS. This may be a front- or back-facing camera. More... | |
Events | |
EventHandler | WillBeginDiscovery |
Event which is fired when camera discovery starts. More... | |
EventHandler | DidEndDiscovery |
Event which is fired when camera discovery has ended. More... | |
The camera manager is responsible for the discovery of cameras and it allows you easy access to the default camera for a camera position.
You trigger camera discovery by invoking the TriggerDiscovery function. Camera discovery operates asynchronously. You should invoke this function at least once at application startup and you may invoke it at additional times. Generically this function should invoked any time that the list of available cameras may change. For example, every time your application becomes the active application.
You should register an event handler with the DidEndDiscovery property. The camera manager will invoke this event handler every time a camera discovery session has completed. This event handler is invoked with the list of all the cameras that are known to the camera manager at this moment in time. So this list includes both newly and previously discovered cameras.
The camera manager allows you to look up a camera by its unqiue identifier and it allows you to get the default camera for a camera position. A camera position indicates where a camera is located relative to the user. For example there is a camera position for the "front camera" and another one for the "back camera". A front camera is a camera which typically faces the user while a back camera is a camera which faces away from the user.
Camera RealNetworks.CameraKit.CameraManager.AddCamera | ( | CameraType | type, |
string | name, | ||
Uri | uri | ||
) |
Adds camera of type with name / uri.
void RealNetworks.CameraKit.CameraManager.AddDiscovery | ( | CameraDiscovery | discovery | ) |
string RealNetworks.CameraKit.CameraManager.ExternalizedCameras | ( | ) |
Creates an externalized list of all cameras and their configurations. You may store this information persistently.
Camera RealNetworks.CameraKit.CameraManager.GetCamera | ( | CameraIdentifier | identifier | ) |
Returns the camera for the given identifier. Nil is returned if no such camera exists.
identifier | the camera identifier |
CameraCredentials? RealNetworks.CameraKit.CameraManager.GetCredentials | ( | CameraIdentifier | identifier | ) |
Returns the credentials for the camera identified by the given camera identifier. Returns nil if the camera manager has no persisted credentials for this camera.
identifier | the camera identifier |
Camera RealNetworks.CameraKit.CameraManager.GetDefaultCamera | ( | CameraPosition | position, |
bool | depthable = false |
||
) |
Returns the default camera. The default camera is the camera that an application should pick by default. E.g. a built-in camera that is guaranteed to exist and that produces good results. Nil is returned if the discovery has no concept of a default camera.
position | the desired camera position |
depthable | true if the camera should be able to capture depth data |
void RealNetworks.CameraKit.CameraManager.InternalizeCameras | ( | string | data | ) |
Takes an externalized camera list and applies it to the camera manager:
data | the new camera manager configuration |
void RealNetworks.CameraKit.CameraManager.RemoveCamera | ( | CameraIdentifier | identifier | ) |
Removes the camera with the given camera identifier. Does nothing if no such camera exists.
identifier | the camera identifier |
void RealNetworks.CameraKit.CameraManager.SaveCredentials | ( | CameraCredentials | credentials, |
CameraIdentifier | identifier | ||
) |
Saves the given credentials for the camera identified by 'identifier'.
credentials | the camera credentials |
identifier | the camera identifier |
async Task RealNetworks.CameraKit.CameraManager.TriggerDiscovery | ( | ) |
Triggers a new round of camera discovery. Listen to the discovery start and end notifications to learn when discovery has ended.
|
get |
Returns all available cameras.
|
get |
Returns the default camera as specified by the OS. This may be a front- or back-facing camera.
|
staticget |
The shared camera manager.
EventHandler RealNetworks.CameraKit.CameraManager.DidEndDiscovery |
Event which is fired when camera discovery has ended.
EventHandler RealNetworks.CameraKit.CameraManager.WillBeginDiscovery |
Event which is fired when camera discovery starts.