CameraServer

Hereda: Object

El servidor mantiene un seguimiento de las diferentes cámaras accesibles en Godot.

Descripción

The CameraServer keeps track of different cameras accessible in Godot. 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, the camera plugin from godot-ios-plugins is required.

Propiedades

bool

monitoring_feeds

false

Métodos

void

add_feed(feed: CameraFeed)

Array[CameraFeed]

feeds()

CameraFeed

get_feed(index: int)

int

get_feed_count()

void

remove_feed(feed: CameraFeed)


Señales

camera_feed_added(id: int) 🔗

Emitted when a CameraFeed is added (e.g. a webcam is plugged in).


camera_feed_removed(id: int) 🔗

Emitida cuando se retira una CameraFeed (por ejemplo, se desenchufa una cámara web).


camera_feeds_updated() 🔗

Emitted when camera feeds are updated.


Enumeraciones

enum FeedImage: 🔗

FeedImage FEED_RGBA_IMAGE = 0

La imagen de la cámara RGBA.

FeedImage FEED_YCBCR_IMAGE = 0

La imagen de la cámara YCbCr.

FeedImage FEED_Y_IMAGE = 0

La imagen de la cámara del componente Y.

FeedImage FEED_CBCR_IMAGE = 1

La imagen de la cámara del componente CbCr.


Descripciones de Propiedades

bool monitoring_feeds = false 🔗

  • void set_monitoring_feeds(value: bool)

  • bool is_monitoring_feeds()

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 camera_feeds_updated signal.

func _ready():
    CameraServer.camera_feeds_updated.connect(_on_camera_feeds_updated)
    CameraServer.monitoring_feeds = true

func _on_camera_feeds_updated():
    var feeds = CameraServer.feeds()

Descripciones de Métodos

void add_feed(feed: CameraFeed) 🔗

Agrega la cámara feed al servidor de cámara.


Array[CameraFeed] feeds() 🔗

Devuelve un array de CameraFeeds.


CameraFeed get_feed(index: int) 🔗

Devuelve el CameraFeed correspondiente a la cámara con el index dado.


int get_feed_count() 🔗

Devuelve el número de CameraFeeds registrados.


void remove_feed(feed: CameraFeed) 🔗

Elimina el feed de la cámara especificada.