libretro.drivers.camera.driver

Protocol definition for emulated camera input drivers.

See also

libretro.api.camera

The matching ctypes types and callback definitions.

Classes

CameraDriver

Protocol for drivers that supply emulated camera input frames.

class CameraDriver[source]

Bases: Protocol

Protocol for drivers that supply emulated camera input frames.

See also

libretro.api.camera

The matching ctypes types and callback definitions.

abstract property caps

The camera capabilities requested by the core.

Set from the caps field of the retro_camera_callback registered via RETRO_ENVIRONMENT_GET_CAMERA_INTERFACE.

Parameters:

value – The capability flags requested by the core.

See also

CameraCapabilityFlags

Bit flags describing which buffer formats the driver must support.

abstractmethod start()[source]

Begin capturing frames from the emulated camera.

Called by the core through the retro_camera_callback.start function pointer when it wants the camera to start producing frames.

Return type:

bool

Returns:

True if the camera started successfully, False otherwise.

See also

retro_camera_start_t

The C function pointer type whose signature this method implements.

abstractmethod stop()[source]

Stop capturing frames from the emulated camera.

Called by the core through the retro_camera_callback.stop function pointer when it no longer needs camera input.

See also

retro_camera_stop_t

The C function pointer type whose signature this method implements.

Return type:

None

abstractmethod poll()[source]

Advance the camera by one frame, delivering any newly available frame to the core.

Called once per frame by the session before Core.run(), so that any pending frame is dispatched through frame_raw_framebuffer or frame_opengl_texture.

Return type:

None

abstract property width

The width of camera frames in pixels, as requested by the core.

A value of 0 lets the driver pick its preferred width. Set from the width field of the retro_camera_callback.

Parameters:

value – The frame width in pixels requested by the core.

abstract property height

The height of camera frames in pixels, as requested by the core.

A value of 0 lets the driver pick its preferred height. Set from the height field of the retro_camera_callback.

Parameters:

value – The frame height in pixels requested by the core.

abstract property frame_raw_framebuffer

Callback the driver invokes to deliver a frame backed by a raw framebuffer.

Registered by the core through retro_camera_callback.frame_raw_framebuffer; None if the core has not registered one.

Parameters:

value – The callback to invoke for raw framebuffer frames, or None to clear it.

See also

retro_camera_frame_raw_framebuffer_t

The C function pointer type that this attribute holds.

__init__(*args, **kwargs)
classmethod __new__(*args, **kwargs)
abstract property frame_opengl_texture

Callback the driver invokes to deliver a frame backed by an OpenGL texture.

Registered by the core through retro_camera_callback.frame_opengl_texture; None if the core has not registered one.

Parameters:

value – The callback to invoke for OpenGL texture frames, or None to clear it.

See also

retro_camera_frame_opengl_texture_t

The C function pointer type that this attribute holds.

abstract property initialized

Callback the driver invokes after it finishes initializing.

Registered by the core through retro_camera_callback.initialized; None if the core has not registered one.

Parameters:

value – The callback to invoke after initialization, or None to clear it.

See also

retro_camera_lifetime_status_t

The C function pointer type that this attribute holds.

abstract property deinitialized

Callback the driver invokes immediately before it deinitializes.

Registered by the core through retro_camera_callback.deinitialized; None if the core has not registered one.

Parameters:

value – The callback to invoke before deinitialization, or None to clear it.

See also

retro_camera_lifetime_status_t

The C function pointer type that this attribute holds.