Skip to content

utils

Classes:

  • VSDebug

    Special class that follows the VapourSynth lifecycle for debug purposes.

  • vs_object

    Special object that follows the lifecycle of the VapourSynth environment/core.

VSObjSelf module-attribute

VSObjSelf = TypeVar('VSObjSelf', bound=vs_object)

VSDebug

VSDebug(
    *,
    env_life: bool = True,
    core_fetch: bool = False,
    use_logging: bool = False
)

Bases: Singleton

Special class that follows the VapourSynth lifecycle for debug purposes.

Print useful debug information.

Parameters:

  • env_life

    (bool, default: True ) –

    Print creation/destroy of VapourSynth environment.

  • core_fetch

    (bool, default: False ) –

    Print traceback of the code that led to the first concrete core fetch. Especially useful when trying to find the code path that is locking you into a EnvironmentPolicy.

Source code
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
def __init__(self, *, env_life: bool = True, core_fetch: bool = False, use_logging: bool = False) -> None:
    """
    Print useful debug information.

    :param env_life:    Print creation/destroy of VapourSynth environment.
    :param core_fetch:  Print traceback of the code that led to the first concrete core fetch.
                        Especially useful when trying to find the code path that is
                        locking you into a EnvironmentPolicy.
    """

    from ..utils.vs_proxy import register_on_creation

    if use_logging:
        import logging
        VSDebug._print_func = logging.debug
    else:
        VSDebug._print_func = print

    if env_life:
        register_on_creation(VSDebug._print_env_live, True)

    if core_fetch:
        register_on_creation(VSDebug._print_stack, True)

vs_object

Bases: ABC

Special object that follows the lifecycle of the VapourSynth environment/core.

If a special dunder is created, vs_del, it will be called when the environment is getting deleted.

This is especially useful if you have to hold a reference to a VideoNode or Plugin/Function object in this object as you need to remove it for the VapourSynth core to be freed correctly.