Skip to content

Commit e37c7a6

Browse files
committed
Release 0.9.9
1 parent 61bd055 commit e37c7a6

File tree

21 files changed

+220
-36
lines changed

21 files changed

+220
-36
lines changed

README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ GStreamer project.
8484
$ brew install gstreamer gst-plugins-base gst-plugins-good gst-python json-glib
8585
```
8686

87+
Install additional Python dependencies
88+
```console
89+
pip3 install pycairo
90+
pip3 install PyGObject
91+
```
92+
8793
Build
8894
```console
8995
$ meson build
@@ -95,8 +101,8 @@ GStreamer and the plugins can be built from source by using
95101
[gst-build](https://gitlab.freedesktop.org/gstreamer/gst-build), or starting
96102
from GStreamer 1.20, [GStreamer mono repo](https://gitlab.freedesktop.org/gstreamer/gstreamer).
97103

98-
Install `meson` and `ninja` as instructed in the [Linux](#linux) and
99-
[Windows](#windows) sections above.
104+
Install `meson` and `ninja` as instructed in the [Linux](#linux),
105+
[Windows](#windows), and [macOS](#macos) sections above.
100106

101107
On Linux systems additional dependencies may be required:
102108
```console
@@ -120,6 +126,13 @@ $ meson builddir -Dcustom_subprojects=gst-home-audio -Dauto_features=disabled -D
120126
$ ninja -C builddir
121127
```
122128

129+
**Note:** *On macOS, an additional `-Dcpp_std=c++17` flag is needed to build the project*
130+
```console
131+
$ cd gst-build
132+
$ meson builddir -Dcustom_subprojects=gst-home-audio -Dauto_features=disabled -Dgstreamer:tools=enabled -Dcpp_std=c++17
133+
$ ninja -C builddir
134+
```
135+
123136
These commands will build the `gst-home-audio` plugins, along with GStreamer
124137
core, basic plugins, and tools such as `gst-launch-1.0`, `gst-inspect-1.0` etc.
125138

@@ -253,7 +266,7 @@ $ ./gst-ha-dap -i input.xml -o output.json
253266
## Plugins Overview
254267

255268
### dlbac3parse
256-
Dolby Digital Plus Parser.This plug-in performs parsing of incoming Dolby
269+
Dolby Digital Plus Parser. This plug-in performs parsing of incoming Dolby
257270
Digital, Dolby Digital Plus signal.
258271

259272
**Launch Line**
@@ -283,7 +296,7 @@ Single stream:
283296
```console
284297
$ gst-launch-1.0 \
285298
audiotestsrc ! \
286-
dlbflexr device-config=device.conf sink_0::stream-config=stream.conf sink_0::volume=0.9 sink_0::upmix=true ! \
299+
dlbflexr device-config=device.conf sink_0::stream-config=stream.conf sink_0::upmix=true ! \
287300
autoaudiosink
288301
```
289302

docker/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2828
valgrind\
2929
wget
3030

31-
RUN pip3 install --no-cache-dir meson
31+
RUN pip3 install --no-cache-dir \
32+
meson \
33+
gcovr
3234

3335
RUN groupadd -g 1002 builder
3436
RUN useradd -u 1002 -g 1002 -ms /bin/bash builder

integration/gst_ha_dap/interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
VERSION_MAJOR = 0
1313
VERSION_MINOR = 9
14-
VERSION_BUGFIX = 3
14+
VERSION_BUGFIX = 9
1515

1616
PREAMBLE = """
1717
Dolby Atmos for home audio executable

integration/gst_ha_flexr/interface.py

Lines changed: 59 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
VERSION_MAJOR = 0
1515
VERSION_MINOR = 9
16-
VERSION_BUGFIX = 3
16+
VERSION_BUGFIX = 9
1717

1818
PREAMBLE = """
1919
Dolby Atmos for home audio executable
@@ -43,6 +43,8 @@ def parse_command_line(my_args=None) -> argparse.Namespace:
4343
prog="gst-ha-flexr", formatter_class=argparse.RawTextHelpFormatter
4444
)
4545
sinks = parser.add_mutually_exclusive_group()
46+
input_gains = parser.add_mutually_exclusive_group()
47+
external_gains = parser.add_mutually_exclusive_group()
4648
parser.add_argument(
4749
"-wd",
4850
"--working_dir",
@@ -58,7 +60,8 @@ def parse_command_line(my_args=None) -> argparse.Namespace:
5860
"Supported formats:\n"
5961
"Dolby Digital: .ac3\n"
6062
"Dolby Digital Plus: .ec3\n"
61-
"PCM: .wav\n\n",
63+
"PCM: .wav\n"
64+
"MP4: .mp4\n\n",
6265
type=str,
6366
metavar="<filename>",
6467
required=True,
@@ -116,12 +119,23 @@ def parse_command_line(my_args=None) -> argparse.Namespace:
116119
action="store_true",
117120
default=False,
118121
)
119-
parser.add_argument(
122+
input_gains.add_argument(
123+
"-pr",
124+
"--profile",
125+
help="Select content profile.\n"
126+
"Default: off\n"
127+
"Not allowed with content normalization gain (-cg argument).\n\n",
128+
type=str,
129+
metavar="<off|movie|music>",
130+
default="off",
131+
)
132+
input_gains.add_argument(
120133
"-cg",
121134
"--content-normalization-gain",
122135
help="Linear gain to bring the input to system level.\n"
123136
"Range: [0.0 - 10.0]\n"
124-
"Default: 1.0\n\n",
137+
"Default: 1.0\n"
138+
"Not allowed with profile (-pr argument)\n\n",
125139
type=float,
126140
metavar="<gain>",
127141
default=1.0
@@ -136,7 +150,7 @@ def parse_command_line(my_args=None) -> argparse.Namespace:
136150
metavar="<gain>",
137151
default=1.0
138152
)
139-
parser.add_argument(
153+
external_gains.add_argument(
140154
"-eg",
141155
"--external-user-gain",
142156
help="Linear gain to be applied by downstream external processing.\n"
@@ -146,6 +160,27 @@ def parse_command_line(my_args=None) -> argparse.Namespace:
146160
metavar="<gain>",
147161
default=1.0
148162
)
163+
external_gains.add_argument(
164+
"-egs",
165+
"--external-user-gain-by-step",
166+
help="Linear gain to be applied by downstream external processing.\n"
167+
"This property is an alternative form of external-user-gain \n"
168+
"where instead of using the linear gain, index into the volume \n"
169+
"steps defined in device configuration is used.\n"
170+
"Default: disabled - flag not set.\n\n",
171+
type=int,
172+
metavar="<vol_step>",
173+
default=-1
174+
)
175+
parser.add_argument(
176+
"-im",
177+
"--interp-mode",
178+
help="Selects interpolation mode.\n"
179+
"Default: offline\n\n",
180+
type=str,
181+
metavar="<offline|runtime>",
182+
default="offline"
183+
)
149184
parser.add_argument(
150185
"--debug",
151186
help=argparse.SUPPRESS,
@@ -154,15 +189,15 @@ def parse_command_line(my_args=None) -> argparse.Namespace:
154189
)
155190
parser.add_argument(
156191
"-gd",
157-
"--gst_debug",
192+
"--gst-debug",
158193
help="Number specyfing Gstreamer Debug Level\n\n",
159194
type=int,
160195
metavar="<val>",
161196
default=0,
162197
)
163198
parser.add_argument(
164199
"-pg",
165-
"--pipeline_graph",
200+
"--pipeline-graph",
166201
help="Defines debug dot file name\n\n",
167202
type=str,
168203
metavar="<filename>",
@@ -214,6 +249,23 @@ def validate_command_line(args) -> Tuple[bool, str]:
214249
"Invalid gain value. Gain must be in range [0.0 - 10.0]"
215250
)
216251

252+
if args.profile is not None:
253+
if args.profile not in ["off", "music", "movie"]:
254+
return False, (
255+
"Invalid profile name. Allowed options are:\n"
256+
" off\n"
257+
" movie\n"
258+
" music"
259+
)
260+
261+
if args.interp_mode is not None:
262+
if args.interp_mode not in ["offline", "runtime"]:
263+
return False, (
264+
"Invalid interpolation mode. Allowed options are:\n"
265+
" offline\n"
266+
" runtime"
267+
)
268+
217269
return True, "OK"
218270

219271

integration/gst_ha_flexr/pipeline.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ def __init__(self, plugin_path, settings):
6767
# Set element properties
6868
self.flexr.set_property("device-config", self.settings.dconf)
6969
self.flexr.set_property("external-user-gain", self.settings.external_gain)
70+
self.flexr.set_property("external-user-gain-by-step",
71+
self.settings.external_gain_by_step)
7072
if self.settings.active_channels_enable:
7173
self.flexr.set_property("active-channels-enable", True)
7274
self.flexr.set_property(
@@ -79,8 +81,10 @@ def __init__(self, plugin_path, settings):
7981
# Set pad properies
8082
self.flexr_sink_pad.set_property("stream-config", self.settings.sconf)
8183
self.flexr_sink_pad.set_property("upmix", self.settings.upmix)
82-
self.flexr_sink_pad.set_property("content-normalization-gain", self.settings.content_gain)
84+
self.flexr_sink_pad.set_property("content-normalization-gain",
85+
self.settings.content_gain)
8386
self.flexr_sink_pad.set_property("internal-user-gain", self.settings.internal_gain)
87+
self.flexr_sink_pad.set_property("interp-mode", self.settings.interp_mode)
8488

8589
# Populate the pipeline
8690
self.pipeline.add(self.src)
@@ -123,12 +127,26 @@ def _have_type(self, typefind, probability, caps):
123127
self.input_type = caps.to_string()
124128

125129
# Set flexr pad properties dependent on file type
130+
force_order = False
131+
set_profile = self.settings.profile != "off"
132+
126133
if self.input_type in DD_TYPES or "video/quicktime" in self.input_type:
127134
force_order = True
135+
if set_profile:
136+
profile_name = "dlb-"+self.settings.profile
128137
else:
129-
force_order = False
138+
if set_profile:
139+
profile_name = self.settings.profile
140+
130141
self.flexr_sink_pad.set_property("force-order", force_order)
142+
143+
if set_profile:
144+
self.flexr_sink_pad.set_property(
145+
"content-normalization-gain",
146+
self.settings.content_gain_for_profile[profile_name]
147+
)
131148

149+
# Add elements to pipeline according to input type
132150
if "video/quicktime" in self.input_type:
133151
# Demuxer for MP4 input
134152
self.demux = Gst.ElementFactory.make("qtdemux", "demux")
@@ -154,6 +172,7 @@ def _have_type(self, typefind, probability, caps):
154172
self.dec1 = Gst.ElementFactory.make("dlbac3parse", "ac3-parser")
155173
# AC3 decoder
156174
self.dec2 = Gst.ElementFactory.make("dlbac3dec", "ac3-dec")
175+
157176
else:
158177
print("Error: Unable to create pipeline - unsupported input file format.")
159178
self.error_kill()

integration/gst_ha_flexr/settings.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,19 @@ def __init__(self):
1919
self.upmix = False
2020
self.active_channels_enable = False
2121
self.active_channels_bitmask = 0
22+
self.profile = None
2223
self.content_gain = 1.0
2324
self.internal_gain = 1.0
2425
self.external_gain = 1.0
26+
self.external_gain_by_step = -1
27+
self.content_gain_for_profile = {
28+
"off": 1.0, # 0 dB
29+
"music": 0.63095, # -4 dB
30+
"movie": 1.41253, # +3 dB
31+
"dlb-music": 4.46683, # +13 dB
32+
"dlb-movie": 3.54813 # +11 dB
33+
}
34+
self.interp_mode = None
2535
self.pipeline_graph = ""
2636
self.device_obj = None
2737
self.playback_device = ""
@@ -173,9 +183,12 @@ def create_from_args(self, args):
173183

174184
# Write other settings
175185
self.upmix = args.upmix
186+
self.profile = args.profile
187+
self.content_gain = args.content_normalization_gain
176188
self.internal_gain = args.internal_user_gain
177189
self.external_gain = args.external_user_gain
178-
self.content_gain = args.content_normalization_gain
190+
self.external_gain_by_step = args.external_user_gain_by_step
191+
self.interp_mode = args.interp_mode
179192
if type(args.playback) == bool:
180193
self._select_device()
181194
elif type(args.playback) == str:

libs/utils/dlbutils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*******************************************************************************
22
33
* Dolby Home Audio GStreamer Plugins
4-
* Copyright (C) 2020, Dolby Laboratories
4+
* Copyright (C) 2020-2022, Dolby Laboratories
55
66
* This library is free software; you can redistribute it and/or
77
* modify it under the terms of the GNU Lesser General Public

meson.build

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
project('gst-home-audio', 'c', 'cpp',
2-
version : '0.9.3',
3-
meson_version : '>= 0.58.0',
2+
version : '0.9.9',
3+
meson_version : '>= 0.59.0',
44
default_options : ['warning_level=1', 'buildtype=debugoptimized', 'cpp_std=c++17'])
55

66
system = host_machine.system()
@@ -102,7 +102,7 @@ gst_plugins_dlb_build_dir = meson.current_build_dir()
102102
dep_map = {
103103
'dlb_buffer': {'ver': '>= 1.0.0'},
104104
'dlb_audio_parser': {'ver': '>= 1.0.0'},
105-
'dlb_flexr': {'option': get_option('flexr').disabled(), 'ver': '0.6.0'},
105+
'dlb_flexr': {'option': get_option('flexr').disabled(), 'ver': '1.0.1'},
106106
'dlb_oar': {'option': get_option('oar').disabled(), 'ver': '2.5.0'},
107107
'dlb_udc': {'option': get_option('ac3').disabled(), 'ver': '4.10.0'},
108108
'dlb_dap': {'option': get_option('dap').disabled(), 'ver': '2.9.0.2'},

plugins/ac3/dlbac3dec.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*******************************************************************************
22
33
* Dolby Home Audio GStreamer Plugins
4-
* Copyright (C) 2020-2021, Dolby Laboratories
4+
* Copyright (C) 2020-2022, Dolby Laboratories
55
66
* This library is free software; you can redistribute it and/or
77
* modify it under the terms of the GNU Lesser General Public
@@ -165,6 +165,7 @@ dlb_ac3dec_init (DlbAc3Dec * ac3dec)
165165
dlb_udc_drc_settings_init (&ac3dec->drc);
166166

167167
gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (ac3dec), TRUE);
168+
gst_audio_decoder_set_estimate_rate (GST_AUDIO_DECODER (ac3dec), TRUE);
168169
gst_audio_decoder_set_use_default_pad_acceptcaps (GST_AUDIO_DECODER_CAST
169170
(ac3dec), TRUE);
170171

@@ -532,6 +533,7 @@ dlb_ac3dec_handle_frame (GstAudioDecoder * decoder, GstBuffer * inbuf)
532533
goto decode_error;
533534

534535
if (G_UNLIKELY (!blocksz)) {
536+
gst_buffer_unmap (outbuf, &outmap);
535537
gst_buffer_unref (outbuf);
536538
goto cleanup;
537539
}
@@ -567,7 +569,7 @@ dlb_ac3dec_handle_frame (GstAudioDecoder * decoder, GstBuffer * inbuf)
567569
{
568570
gst_buffer_unmap (inbuf, &inmap);
569571

570-
if (ret != GST_FLOW_ERROR && blocksz) {
572+
if (ret != GST_FLOW_ERROR) {
571573
GST_LOG_OBJECT (decoder, "finish frame");
572574
ret = gst_audio_decoder_finish_subframe (decoder, NULL);
573575
}

plugins/ac3/dlbac3dec.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*******************************************************************************
22
33
* Dolby Home Audio GStreamer Plugins
4-
* Copyright (C) 2020, Dolby Laboratories
4+
* Copyright (C) 2020-2022, Dolby Laboratories
55
66
* This library is free software; you can redistribute it and/or
77
* modify it under the terms of the GNU Lesser General Public

0 commit comments

Comments
 (0)