-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add: gstreamer st30p Tx/Rx tests, media create for audio files
- Loading branch information
Showing
6 changed files
with
222 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
62 changes: 62 additions & 0 deletions
62
tests/validation/tests/single/gstreamer/audio_format/test_audio_format.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import os | ||
import pytest | ||
|
||
import tests.Engine.GstreamerApp as gstreamerapp | ||
import tests.Engine.media_creator as media_create | ||
|
||
@pytest.mark.parametrize("audio_format", ["s8", "s16le", "s24le"]) | ||
@pytest.mark.parametrize("audio_channel", [1, 2]) | ||
@pytest.mark.parametrize("audio_rate", [44100, 48000, 96000]) | ||
def test_audio_format( | ||
build, | ||
media, | ||
nic_port_list, | ||
audio_format, | ||
audio_channel, | ||
audio_rate | ||
): | ||
input_file_path = os.path.join(media, "test.pcm") | ||
|
||
media_create.create_audio_file_sox( | ||
sample_rate=audio_rate, | ||
channels=audio_channel, | ||
bit_depth=gstreamerapp.audio_format_change(audio_format), | ||
duration=10, | ||
frequency=440, | ||
output_path=input_file_path | ||
) | ||
|
||
tx_config = gstreamerapp.setup_gstreamer_st30_tx_pipeline( | ||
build=build, | ||
nic_port_list=nic_port_list[0], | ||
input_path=input_file_path, | ||
tx_payload_type=111, | ||
tx_queues=4, | ||
audio_format=audio_format, | ||
channels=audio_channel, | ||
sampling=audio_rate | ||
) | ||
|
||
rx_config = gstreamerapp.setup_gstreamer_st30_rx_pipeline( | ||
build=build, | ||
nic_port_list=nic_port_list[1], | ||
output_path=os.path.join(media, "output.pcm"), | ||
rx_payload_type=111, | ||
rx_queues=4, | ||
rx_audio_format=gstreamerapp.audio_format_change(audio_format, rx_side=True), | ||
rx_channels=audio_channel, | ||
rx_sampling=audio_rate | ||
) | ||
|
||
try: | ||
gstreamerapp.execute_test( | ||
build=build, | ||
tx_command=tx_config, | ||
rx_command=rx_config, | ||
input_file=input_file_path, | ||
output_file=os.path.join(media, "output.pcm"), | ||
type="st30" | ||
) | ||
finally: | ||
media_create.remove_file(input_file_path) | ||
media_create.remove_file(os.path.join(media, "output.pcm")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.