Commit 77853a57 authored by bayers's avatar bayers
Browse files

fixed correct setting of the network simulators nFramesPerPacket command line...

fixed correct setting of the network simulators nFramesPerPacket command line parameter, added logging the of network simulator processing
parent 0af0e852
Loading
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
#

import os.path
import logging
from pathlib import Path
from typing import Optional, Union

@@ -90,6 +91,7 @@ def network_simulator(
    out_bitstream: Union[str, Path],
    n_frames_per_packet: int,
    offset: int,
    logger: Optional[logging.Logger] = None,
) -> None:
    """
    Wrapper for networkSimulator_g192 binary to apply error patterns for the bitstream processing
@@ -106,6 +108,8 @@ def network_simulator(
        Number of frames per paket [1,2]
    offset: Optional[int]
        delay offset
    logger: Optional[logging.Logger]
        logger
    """

    # find binary
@@ -133,7 +137,7 @@ def network_simulator(
    ]

    # run command
    run(cmd)
    run(cmd, logger=logger)

    return

@@ -145,6 +149,7 @@ def apply_network_simulator(
    error_profile: Optional[int] = None,
    n_frames_per_packet: Optional[int] = None,
    offset: Optional[int] = 0,
    logger: Optional[logging.Logger] = None,
) -> None:
    """
    Function to apply a network simulator profile to a bitstreaam
@@ -163,6 +168,8 @@ def apply_network_simulator(
        Number of frames per paket
    offset: Optional[int]
        delay offset
    logger: Optional[logging.Logger]
        logger
    """

    if error_pattern is None:
@@ -192,7 +199,7 @@ def apply_network_simulator(

    # apply error pattern
    network_simulator(
        error_pattern, in_bitstream, out_bitstream, n_frames_per_packet, offset
        error_pattern, in_bitstream, out_bitstream, n_frames_per_packet, offset, logger
    )

    return
+1 −1
Original line number Diff line number Diff line
@@ -256,7 +256,7 @@ def get_processing_chain(
                    "type": cfg.tx.get("type", None),
                    "error_pattern": cfg.tx.get("error_pattern", None),
                    "error_profile": cfg.tx.get("error_profile", None),
                    "n_frames_per_packet": cfg.tx.get("n_frames_per_packet", 1),
                    "n_frames_per_packet": cfg.tx.get("n_frames_per_packet", None),
                }
            else:
                raise ValueError(
+1 −0
Original line number Diff line number Diff line
@@ -225,6 +225,7 @@ class IVAS(Processing):
                    self.tx["error_pattern"],
                    self.tx["error_profile"],
                    self.tx["n_frames_per_packet"],
                    logger=logger,
                )
                # add -voip cmdline option to the decoder
                # TODO: tracefile also?