cli (call): Add arguments to set custom pipelines in sources.
This commit is contained in:
parent
e91ebd8cf2
commit
91b9fc7cd3
1 changed files with 25 additions and 3 deletions
|
|
@ -28,7 +28,7 @@ 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
|
||||
from libervia.frontends.tools.webrtc_models import CallData, SourcesPipeline
|
||||
|
||||
from . import base
|
||||
|
||||
|
|
@ -58,18 +58,40 @@ class Common(base.CommandBase):
|
|||
self.parser.add_argument(
|
||||
"--no-ui", action="store_true", help=_("disable user interface")
|
||||
)
|
||||
sources_group = self.parser.add_mutually_exclusive_group()
|
||||
sources_group.add_argument(
|
||||
self.parser.add_argument(
|
||||
"-s",
|
||||
"--sources",
|
||||
choices=["auto", "test"],
|
||||
default="auto",
|
||||
help='Well-known sources to use (default: "auto").',
|
||||
)
|
||||
pipelines_group = self.parser.add_argument_group(
|
||||
title = "Custom Pipelines"
|
||||
)
|
||||
pipelines_group.add_argument(
|
||||
"-V",
|
||||
"--video",
|
||||
help="GStreamer pipeline description for the video stream"
|
||||
)
|
||||
pipelines_group.add_argument(
|
||||
"-A",
|
||||
"--audio",
|
||||
help="GStreamer pipeline description for the audio stream"
|
||||
)
|
||||
|
||||
def get_call_data_kw(self) -> dict[str, Any]:
|
||||
"""Get relevant keyword arguments for CallData"""
|
||||
kwargs: dict[str, Any] = {}
|
||||
if self.args.video or self.args.audio:
|
||||
if self.args.sources != "auto":
|
||||
self.parser.error(
|
||||
"You can 't use --sources and --video or --audio at the same time."
|
||||
)
|
||||
kwargs["sources_data"] = SourcesPipeline(
|
||||
video_pipeline=self.args.video,
|
||||
audio_pipeline=self.args.audio
|
||||
)
|
||||
|
||||
if self.args.sources == "test":
|
||||
from libervia.frontends.tools.webrtc_models import SourcesTest
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue