CameraServer
Server keeping track of different cameras accessible in Reckfell.
Server keeping track of different cameras accessible in Reckfell.
The CameraServer keeps track of different cameras accessible in Reckfell. These are external cameras such as webcams or the cameras on your phone.
It is notably used to provide AR modules with a video feed from the camera.
Note: This class is currently only implemented on Linux, Android, macOS, and iOS. On other platforms no CameraFeeds will be available. To get a CameraFeed on iOS, enable EditorExportPlatformIOS.modules/camera.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Properties2
MonitoringFeedsProperty
public static bool MonitoringFeeds { get; set; }If true, the server is actively monitoring available camera feeds.
This has a performance cost, so only set it to true when you're actively accessing the camera.
Note: After setting it to true, you can receive updated camera feeds through the CameraServer.CameraFeedsUpdated signal.
public override void _Ready()
{
CameraServer.CameraFeedsUpdated += OnCameraFeedsUpdated;
CameraServer.MonitoringFeeds = true;
}
void OnCameraFeedsUpdated()
{
var feeds = CameraServer.Feeds();
}SingletonProperty
public static CameraServerInstance Singleton { get; }Methods7
AddFeedvoid
public static void AddFeed(CameraFeed feed);Adds the camera feed to the camera server.
| Name | Type | Default |
|---|---|---|
feed | CameraFeed | — |
FeedsReckfell.Collections.Array<CameraFeed>
public static Reckfell.Collections.Array<CameraFeed> Feeds();Returns an array of CameraFeeds.
Reckfell.Collections.Array<CameraFeed>GetFeedCameraFeed
public static CameraFeed GetFeed(int index);Returns the CameraFeed corresponding to the camera with the given index.
| Name | Type | Default |
|---|---|---|
index | int | — |
CameraFeedGetFeedCountint
public static int GetFeedCount();Returns the number of CameraFeeds registered.
intIsMonitoringFeedsbool
public static bool IsMonitoringFeeds();boolRemoveFeedvoid
public static void RemoveFeed(CameraFeed feed);Removes the specified camera feed.
| Name | Type | Default |
|---|---|---|
feed | CameraFeed | — |
SetMonitoringFeedsvoid
public static void SetMonitoringFeeds(bool isMonitoringFeeds);| Name | Type | Default |
|---|---|---|
isMonitoringFeeds | bool | — |
Signals and events3
CameraFeedAddedEvent
public static event CameraServer.CameraFeedAddedEventHandler CameraFeedAdded;Emitted when a CameraFeed is added (e.g. a webcam is plugged in).
| Name | Type | Default |
|---|---|---|
id | long | — |
CameraFeedRemovedEvent
public static event CameraServer.CameraFeedRemovedEventHandler CameraFeedRemoved;Emitted when a CameraFeed is removed (e.g. a webcam is unplugged).
| Name | Type | Default |
|---|---|---|
id | long | — |
CameraFeedsUpdatedEvent
public static event Action CameraFeedsUpdated;Emitted when camera feeds are updated.
CameraServer.FeedImage
| Value | Description |
|---|---|
CbcrImage = 1 | The CbCr component camera image. |
RgbaImage = 0 | The RGBA camera image. |
YImage = 0 | The Y component camera image. |
YcbcrImage = 0 | The YCbCr(https://en.wikipedia.org/wiki/YCbCr) camera image. |