33import logging
44import sys
55
6- from lib .config import Config
76from gi .repository import Gst
87
98gi .require_version ('GstController' , '1.0' )
@@ -50,13 +49,13 @@ def create_mixmatrix(in_channels: int, out_channels: int, channel_mapping: str):
5049 return pipeline
5150
5251
53- def construct_audio_encoder_pipeline (section ):
52+ def construct_audio_encoder_pipeline (config , section ):
5453 """
5554 Build audio encoder pipeline block including an adapter matrix for channel mapping
5655 :param section: Name of the config section this block is for
5756 :return: String containing the pipeline block
5857 """
59- encoder = Config .get_audio_encoder (section )
58+ encoder = config .get_audio_encoder (section )
6059 encoder_options = None
6160 # check if we have an option string as part of the codec config
6261 if ',' in encoder :
@@ -66,11 +65,11 @@ def construct_audio_encoder_pipeline(section):
6665 if encoder in encoders :
6766 pipeline += """! audioconvert
6867 {mixmatrix} ! {encoder} ! {acaps}
69- """ .format (mixmatrix = create_mixmatrix (Config .getAudioChannels (),
70- Config .get_sink_audio_channels (section ),
71- Config .get_sink_audio_map (section )),
68+ """ .format (mixmatrix = create_mixmatrix (config .getAudioChannels (),
69+ config .get_sink_audio_channels (section ),
70+ config .get_sink_audio_map (section )),
7271 encoder = encoder ,
73- acaps = Config .getAudioCaps (section ))
72+ acaps = config .getAudioCaps (section ))
7473 else :
7574 log .error ("Unknown audio encoder {}" .format (encoder ))
7675 sys .exit (- 1 )
0 commit comments