cli (call), frontends(tools/webrtc_models): Add source for stdin:
If data is piped in with `auto` source, a new `SourcesStdin` is used.
This commit is contained in:
parent
91b9fc7cd3
commit
59cf0b846d
2 changed files with 9 additions and 1 deletions
|
|
@ -22,13 +22,15 @@ from functools import partial
|
|||
import importlib
|
||||
import logging
|
||||
from typing import Any
|
||||
import sys
|
||||
import select
|
||||
|
||||
|
||||
from libervia.backend.core.i18n import _
|
||||
from libervia.backend.tools.common import data_format
|
||||
from libervia.cli.constants import Const as C
|
||||
from libervia.frontends.tools import jid
|
||||
from libervia.frontends.tools.webrtc_models import CallData, SourcesPipeline
|
||||
from libervia.frontends.tools.webrtc_models import CallData, SourcesPipeline, SourcesStdin
|
||||
|
||||
from . import base
|
||||
|
||||
|
|
@ -96,6 +98,8 @@ class Common(base.CommandBase):
|
|||
from libervia.frontends.tools.webrtc_models import SourcesTest
|
||||
|
||||
kwargs["sources_data"] = SourcesTest()
|
||||
elif self.args.sources == "auto" and not sys.stdin.isatty():
|
||||
kwargs["sources_data"] = SourcesStdin()
|
||||
return kwargs
|
||||
|
||||
async def start(self):
|
||||
|
|
|
|||
|
|
@ -87,6 +87,10 @@ class SourcesPipeline(SourcesData):
|
|||
audio_properties: dict = Field(default_factory=lambda: {})
|
||||
|
||||
|
||||
class SourcesStdin(SourcesData):
|
||||
"""Sources from stdin with automatic format detection."""
|
||||
|
||||
|
||||
class SinksData(BaseModel):
|
||||
"""Data for Sinks"""
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue