"""PR13 branch primitives. Queue owns buffers; native relay bounds async flight."""
import os

LATEST_QUEUE = {'max-size-buffers': 1, 'max-size-bytes': 0,
                'max-size-time': 0, 'leaky': 2}


def load_completion_relay():
    # GI element overrides are absent in the pinned image. This native element
    # uses the existing Gst headers, without a Python scheduler or new package.
    import gi
    gi.require_version('Gst', '1.0')
    from gi.repository import Gst
    Gst.init(None)
    path = os.environ.get('CONTEXTRA_FLIGHT_PLUGIN', '/opt/contextra/lib/libgstcontextraflight.so')
    if not Gst.Plugin.load_file(path):
        raise RuntimeError('Cannot load provider completion relay.')
