mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
audio: make audio format an uri type
This commit is contained in:
parent
ff62c1b9ce
commit
03292fd80f
24 changed files with 608 additions and 364 deletions
|
|
@ -24,7 +24,7 @@
|
|||
#include <spa/id-map.h>
|
||||
#include <spa/node.h>
|
||||
#include <spa/list.h>
|
||||
#include <spa/audio/format.h>
|
||||
#include <spa/audio/format-utils.h>
|
||||
#include <spa/format-builder.h>
|
||||
#include <lib/props.h>
|
||||
|
||||
|
|
@ -66,6 +66,7 @@ typedef struct {
|
|||
SpaMediaTypes media_types;
|
||||
SpaMediaSubtypes media_subtypes;
|
||||
SpaPropAudio prop_audio;
|
||||
SpaAudioFormats audio_formats;
|
||||
} URI;
|
||||
|
||||
struct _SpaVolume {
|
||||
|
|
@ -312,10 +313,10 @@ next:
|
|||
case 0:
|
||||
spa_pod_builder_format (&b, &f[0],
|
||||
this->uri.media_types.audio, this->uri.media_subtypes.raw,
|
||||
PROP_U_EN (&f[1], this->uri.prop_audio.format, SPA_POD_TYPE_INT, 3,
|
||||
SPA_AUDIO_FORMAT_S16,
|
||||
SPA_AUDIO_FORMAT_S16,
|
||||
SPA_AUDIO_FORMAT_S32),
|
||||
PROP_U_EN (&f[1], this->uri.prop_audio.format, SPA_POD_TYPE_URI, 3,
|
||||
this->uri.audio_formats.S16,
|
||||
this->uri.audio_formats.S16,
|
||||
this->uri.audio_formats.S32),
|
||||
PROP_U_MM (&f[1], this->uri.prop_audio.rate, SPA_POD_TYPE_INT, 44100, 1, INT32_MAX),
|
||||
PROP_U_MM (&f[1], this->uri.prop_audio.channels, SPA_POD_TYPE_INT, 2, 1, INT32_MAX));
|
||||
|
||||
|
|
@ -844,6 +845,7 @@ volume_init (const SpaHandleFactory *factory,
|
|||
spa_media_types_fill (&this->uri.media_types, this->map);
|
||||
spa_media_subtypes_map (this->map, &this->uri.media_subtypes);
|
||||
spa_prop_audio_map (this->map, &this->uri.prop_audio);
|
||||
spa_audio_formats_map (this->map, &this->uri.audio_formats);
|
||||
|
||||
this->node = volume_node;
|
||||
reset_volume_props (&this->props);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue