mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
module-rtp: fix compilation without opus
This commit is contained in:
parent
345582dd15
commit
59d5d93878
3 changed files with 11 additions and 6 deletions
|
|
@ -284,6 +284,7 @@ cdata.set('HAVE_PW_CAT_FFMPEG_INTEGRATION', pw_cat_ffmpeg.allowed())
|
||||||
|
|
||||||
opus_dep = dependency('opus', required : get_option('opus'))
|
opus_dep = dependency('opus', required : get_option('opus'))
|
||||||
summary({'opus (Bluetooth, RTP)': opus_dep.found()}, bool_yn: true, section: 'Misc dependencies')
|
summary({'opus (Bluetooth, RTP)': opus_dep.found()}, bool_yn: true, section: 'Misc dependencies')
|
||||||
|
cdata.set('HAVE_OPUS', opus_dep.found())
|
||||||
|
|
||||||
summary({'readline (for pw-cli)': readline_dep.found()}, bool_yn: true, section: 'Misc dependencies')
|
summary({'readline (for pw-cli)': readline_dep.found()}, bool_yn: true, section: 'Misc dependencies')
|
||||||
cdata.set('HAVE_READLINE', readline_dep.found())
|
cdata.set('HAVE_READLINE', readline_dep.found())
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,11 @@
|
||||||
/* SPDX-FileCopyrightText: Copyright © 2023 Wim Taymans <wim.taymans@gmail.com> */
|
/* SPDX-FileCopyrightText: Copyright © 2023 Wim Taymans <wim.taymans@gmail.com> */
|
||||||
/* SPDX-License-Identifier: MIT */
|
/* SPDX-License-Identifier: MIT */
|
||||||
|
|
||||||
|
#ifdef HAVE_OPUS
|
||||||
|
|
||||||
#include <opus/opus.h>
|
#include <opus/opus.h>
|
||||||
#include <opus/opus_multistream.h>
|
#include <opus/opus_multistream.h>
|
||||||
|
|
||||||
struct rtp_opus_data {
|
|
||||||
};
|
|
||||||
|
|
||||||
static void rtp_opus_process_playback(void *data)
|
static void rtp_opus_process_playback(void *data)
|
||||||
{
|
{
|
||||||
struct impl *impl = data;
|
struct impl *impl = data;
|
||||||
|
|
@ -367,3 +366,9 @@ static int rtp_opus_init(struct impl *impl, enum spa_direction direction)
|
||||||
pw_log_error("opus error: %d", err);
|
pw_log_error("opus error: %d", err);
|
||||||
return impl->stream_data ? 0 : err;
|
return impl->stream_data ? 0 : err;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
static int rtp_opus_init(struct impl *impl, enum spa_direction direction)
|
||||||
|
{
|
||||||
|
return -ENOTSUP;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,6 @@
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
#include <opus/opus.h>
|
|
||||||
#include <opus/opus_multistream.h>
|
|
||||||
|
|
||||||
#include <spa/utils/result.h>
|
#include <spa/utils/result.h>
|
||||||
#include <spa/utils/json.h>
|
#include <spa/utils/json.h>
|
||||||
#include <spa/utils/ringbuffer.h>
|
#include <spa/utils/ringbuffer.h>
|
||||||
|
|
@ -292,11 +289,13 @@ struct rtp_stream *rtp_stream_new(struct pw_core *core,
|
||||||
impl->info.media_subtype = SPA_MEDIA_SUBTYPE_control;
|
impl->info.media_subtype = SPA_MEDIA_SUBTYPE_control;
|
||||||
impl->payload = 0x61;
|
impl->payload = 0x61;
|
||||||
}
|
}
|
||||||
|
#ifdef HAVE_OPUS
|
||||||
else if (spa_streq(str, "opus")) {
|
else if (spa_streq(str, "opus")) {
|
||||||
impl->info.media_type = SPA_MEDIA_TYPE_audio;
|
impl->info.media_type = SPA_MEDIA_TYPE_audio;
|
||||||
impl->info.media_subtype = SPA_MEDIA_SUBTYPE_opus;
|
impl->info.media_subtype = SPA_MEDIA_SUBTYPE_opus;
|
||||||
impl->payload = 127;
|
impl->payload = 127;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
else {
|
else {
|
||||||
pw_log_error("unsupported media type:%s", str);
|
pw_log_error("unsupported media type:%s", str);
|
||||||
res = -EINVAL;
|
res = -EINVAL;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue