Class Camera2Source
Inheritance
Implements
Inherited Members
Namespace: FM.LiveSwitch.Android
Assembly: FM.LiveSwitch.Android.dll
Syntax
public class Camera2Source : CameraSourceBase, IVideoOutput, IMediaOutput<IVideoOutput, IVideoInput, VideoFrame, VideoBuffer, VideoBufferCollection, VideoFormat>, IOutput<IVideoOutput, IVideoInput, VideoFrame, VideoBuffer, VideoBufferCollection, VideoFormat>, IVideoElement, IMediaElement, IElement
Constructors
Camera2Source(CameraPreview, VideoConfig)
Initializes a new instance of the Camera2Source class.
Declaration
public Camera2Source(CameraPreview preview, VideoConfig targetConfig)
Parameters
| Type | Name | Description |
|---|---|---|
| CameraPreview | preview | The Android camera preview. |
| VideoConfig | targetConfig | The video config. |
Properties
BackInput
Gets the back camera input id and name. Use the Id to set the source input of the camera you want.
Declaration
public SourceInput BackInput { get; }
Property Value
| Type | Description |
|---|---|
| SourceInput |
ExternalInput
Gets the external camera input id and name. Use the Id to set the source input of the camera you want.
Declaration
public SourceInput ExternalInput { get; }
Property Value
| Type | Description |
|---|---|
| SourceInput |
FrontInput
Gets the front camera input id and name. Use the Id to set the source input of the camera you want.
Declaration
public SourceInput FrontInput { get; }
Property Value
| Type | Description |
|---|---|
| SourceInput |
Label
Gets a label that identifies this class.
Declaration
public override string Label { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Overrides
MirrorPreview
Returns if the preview is mirrored. set to True for mirrored, false for not mirrored.
Declaration
public bool MirrorPreview { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Preview
Gets the Android camera preview.
Declaration
public CameraPreview Preview { get; }
Property Value
| Type | Description |
|---|---|
| CameraPreview |
Methods
DoStart()
Starts the Camera2 Source
Declaration
protected override Future<object> DoStart()
Returns
| Type | Description |
|---|---|
| Future<System.Object> |
Overrides
DoStop()
Stops the Camera2 Source
Declaration
protected override Future<object> DoStop()
Returns
| Type | Description |
|---|---|
| Future<System.Object> |
Overrides
GetCamera()
Gets the underlying Android camera instance.
Declaration
public CameraDevice GetCamera()
Returns
| Type | Description |
|---|---|
| Android.Hardware.Camera2.CameraDevice |
GetCameraId()
Value represents the current cameras id.
Declaration
public string GetCameraId()
Returns
| Type | Description |
|---|---|
| System.String |
GetImageSizes()
Get the available image sizes. It's populated once the camera has been started.
Declaration
public Size[] GetImageSizes()
Returns
| Type | Description |
|---|---|
| Size[] |
GetInputs()
Gets the available inputs.
Declaration
public Future<SourceInput[]> GetInputs()
Returns
| Type | Description |
|---|---|
| Future<SourceInput[]> |
GetSelectedSize()
Once the camera is initialized. This value was the closest supported resolution to the user provided default.
Declaration
public Size GetSelectedSize()
Returns
| Type | Description |
|---|---|
| Size |
GetVideoSizes()
Gets the available video sizes. It's populated once the camera has been started.
Declaration
public Size[] GetVideoSizes()
Returns
| Type | Description |
|---|---|
| Size[] |
SetListener(ICamera2SourceListener)
Set the Camera 2 Event Listener
Declaration
public void SetListener(ICamera2SourceListener listener)
Parameters
| Type | Name | Description |
|---|---|---|
| ICamera2SourceListener | listener |
SetPreviewTexture(SurfaceTexture)
Declaration
public void SetPreviewTexture(SurfaceTexture texture)
Parameters
| Type | Name | Description |
|---|---|---|
| Android.Graphics.SurfaceTexture | texture |
SetRotation(Display)
Sets the NativeImageBuffer Orientation to use in the VideoBuffer when raising frames.
Declaration
public bool SetRotation(Display display)
Parameters
| Type | Name | Description |
|---|---|---|
| Android.Views.Display | display |
Returns
| Type | Description |
|---|---|
| System.Boolean |