libretro.api.av¶
Types to describe the parameters of a core’s rendered audio and video.
See also
Classes
Bit flags that denote whether the loaded core should render audio and/or video frames. |
|
TV region. |
|
The expected (and possible) dimensions of the framebuffer. |
|
Description of the emulated platform's audio and video characteristics. |
|
Description of the emulated system's video and audio output timings. |
- class Region[source]¶
Bases:
IntEnumTV region.
See also
- NTSC = 0¶
Corresponds to
RETRO_REGION_NTSC.Tip
Cores may also return this if the NTSC/PAL region isn’t applicable, e.g. for handhelds or arcade machines.
- PAL = 1¶
Corresponds to
RETRO_REGION_PAL.
- __new__(value)¶
- classmethod value in self¶
Return True if value is in cls.
value is in cls if: 1) value is a member of cls, or 2) value is the value of one of the cls’s members. 3) value is a pseudo-member (flags)
- classmethod self[name]¶
Return the member matching name.
- __init__()¶
- classmethod iter(self)¶
Return members in definition order.
- classmethod len(self)¶
Return the number of members (no aliases)
- class AvEnableFlags[source]¶
Bases:
IntFlagBit flags that denote whether the loaded core should render audio and/or video frames.
Tip
These flags can be set even if libretro.py isn’t literally showing audio or video output to the user.
- VIDEO = 1¶
If not set, the core can safely skip rendering the next video frame.
Corresponds to
RETRO_AV_ENABLE_VIDEO.
- AUDIO = 2¶
If not set, the core can safely skip rendering the next audio frame.
Corresponds to
RETRO_AV_ENABLE_AUDIO.
- FAST_SAVESTATES = 4¶
Indicates that savestates will only be used by this process and will not be saved to disk.
Corresponds to
RETRO_AV_ENABLE_FAST_SAVESTATES.
- HARD_DISABLE_AUDIO = 8¶
If set, the core can safely skip rendering audio frames for the entire duration of its execution.
Corresponds to
RETRO_AV_ENABLE_HARD_DISABLE_AUDIO.
- ALL = 15¶
All other flags are set.
Caution
If additional flags are added in the future, this value will be updated to include them. Try not to rely on the exact value of this constant.
- __new__(value)¶
- other in self¶
Returns True if self has at least the same flags set as other.
- iter(self)¶
Returns flags in definition order.
- len(self)¶
Return the number of members (no aliases)
- classmethod self[name]¶
Return the member matching name.
- __init__()¶
- class retro_game_geometry[source]¶
Bases:
StructureThe expected (and possible) dimensions of the framebuffer.
Corresponds to
retro_game_geometry.Warning
This object is mutable, therefore
VideoDrivers should not expose or store references to it; all access should be done through copies, otherwise you run the risk of encountering hard-to-debug issues!See also
- base_width¶
Nominal video width in pixels.
Assigned values will be bitwise-masked to fit into an unsigned int.
- base_height¶
Nominal video height in pixels.
Assigned values will be bitwise-masked to fit into an unsigned int.
- max_width¶
Maximum possible video width in pixels.
Assigned values will be bitwise-masked to fit into an unsigned int.
- max_height¶
Maximum possible video height in pixels.
Assigned values will be bitwise-masked to fit into an unsigned int.
- aspect_ratio¶
Nominal aspect ratio.
0.0indicates that it should be calculated frombase_widthandbase_height.Assigned values will be converted to a C float.
- __deepcopy__(_)[source]¶
Return a deep copy of this object. Intended for use with
copy.deepcopy().>>> import copy >>> from libretro.api import retro_game_geometry >>> geom = retro_game_geometry(base_width=320, base_height=240, max_width=640, max_height=480, aspect_ratio=0.0) >>> geom2 = copy.deepcopy(geom) >>> geom == geom2 True >>> geom is geom2 False
- property base_size¶
The base (nominal) resolution as
(width, height).>>> from libretro.api import retro_game_geometry >>> geom = retro_game_geometry(base_width=256, base_height=224, max_width=256, max_height=224) >>> geom.base_size (256, 224) >>> (geom.base_width, geom.base_height) == geom.base_size True
- __init__(*args, **kwargs)¶
- classmethod __new__(*args, **kwargs)¶
- property max_size¶
The maximum possible resolution as
(width, height).>>> from libretro.api import retro_game_geometry >>> geom = retro_game_geometry(base_width=256, base_height=224, max_width=512, max_height=448) >>> geom.max_size (512, 448) >>> (geom.max_width, geom.max_height) == geom.max_size True
- class retro_system_timing[source]¶
Bases:
StructureDescription of the emulated system’s video and audio output timings.
Corresponds to
retro_system_timinginlibretro.h.- __init__(*args, **kwargs)¶
- classmethod __new__(*args, **kwargs)¶
- fps¶
The core’s video refresh rate in frames per second.
Assigned values will be converted to a C double.
- __deepcopy__(_)[source]¶
Return a deep copy of this object. Intended for use with
copy.deepcopy().>>> import copy >>> from libretro.api import retro_system_timing >>> timing = retro_system_timing(fps=60.0, sample_rate=44100.0) >>> copy.deepcopy(timing).sample_rate 44100.0
- class retro_system_av_info[source]¶
Bases:
StructureDescription of the emulated platform’s audio and video characteristics.
Corresponds to
retro_system_av_infoinlibretro.h.Warning
This object is mutable, therefore
VideoDrivers andAudioDrivers should not expose or store references to it; all access should be done through copies, otherwise you run the risk of encountering hard-to-debug issues!>>> from libretro.api import retro_system_av_info, retro_game_geometry, retro_system_timing >>> geom = retro_game_geometry(base_width=320, base_height=240, max_width=320, max_height=240) >>> timing = retro_system_timing(fps=60.0, sample_rate=32000.0) >>> av = retro_system_av_info(geom, timing) >>> av.geometry.base_width 320 >>> av.timing.fps 60.0
See also
- __init__(*args, **kwargs)¶
- classmethod __new__(*args, **kwargs)¶
- geometry¶
Video output geometry.
- timing¶
Audio/video timing information.
- __deepcopy__(_)[source]¶
Return a deep copy of this object. Intended for use with
copy.deepcopy().>>> import copy >>> from libretro.api import retro_system_av_info, retro_game_geometry, retro_system_timing >>> geom = retro_game_geometry(base_width=320, base_height=240, max_width=320, max_height=240) >>> timing = retro_system_timing(fps=60.0, sample_rate=32000.0) >>> av = retro_system_av_info(geom, timing) >>> av2 = copy.deepcopy(av) >>> av2.timing.sample_rate 32000.0