Skip to content

Commit a0c739b

Browse files
include lk_log.h inside livekit.h, rpc_constants.cpp/h
1 parent 67a8a10 commit a0c739b

30 files changed

Lines changed: 92 additions & 38 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ lib/
2929
*.dll
3030
*.exe
3131
livekit.log
32+
web/

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
1212

1313
option(LIVEKIT_BUILD_EXAMPLES "Build LiveKit examples" OFF)
1414
option(LIVEKIT_BUILD_TESTS "Build LiveKit tests" OFF)
15-
option(LIVEKIT_BUILD_BRIDGE "Build LiveKit Bridge (simplified high-level API)" OFF)
1615

1716
# vcpkg is only used on Windows; Linux/macOS use system package managers
1817
if(WIN32)
@@ -372,10 +371,11 @@ target_include_directories(livekit
372371
)
373372

374373
target_link_libraries(livekit
374+
PUBLIC
375+
$<BUILD_INTERFACE:spdlog::spdlog>
375376
PRIVATE
376377
livekit_ffi
377378
${LIVEKIT_PROTOBUF_TARGET}
378-
spdlog::spdlog
379379
)
380380

381381
target_compile_definitions(livekit

bridge/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ add_library(livekit_bridge SHARED
1111
src/bridge_video_track.cpp
1212
src/bridge_room_delegate.cpp
1313
src/bridge_room_delegate.h
14+
src/rpc_constants.cpp
1415
src/rpc_controller.cpp
1516
src/rpc_controller.h
1617
)

bridge/include/livekit_bridge/livekit_bridge.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "livekit_bridge/bridge_video_track.h"
2424
#include "livekit_bridge/rpc_constants.h"
2525

26+
#include "livekit/lk_log.h"
2627
#include "livekit/local_participant.h"
2728
#include "livekit/room.h"
2829
#include "livekit/rpc_error.h"

bridge/include/livekit_bridge/rpc_constants.h

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,20 @@ namespace track_control {
3434
enum class Action { kActionMute, kActionUnmute };
3535

3636
/// RPC method name registered by the bridge for remote track control.
37-
constexpr const char *kMethod = "lk.bridge.track-control";
37+
extern const char *const kMethod;
3838

3939
/// Payload action strings.
40-
constexpr const char *kActionMute = "mute";
41-
constexpr const char *kActionUnmute = "unmute";
40+
extern const char *const kActionMute;
41+
extern const char *const kActionUnmute;
4242

4343
/// Delimiter between action and track name in the payload (e.g. "mute:cam").
44-
constexpr char kDelimiter = ':';
44+
extern const char kDelimiter;
4545

4646
/// Response payload returned on success.
47-
constexpr const char *kResponseOk = "ok";
47+
extern const char *const kResponseOk;
4848

4949
/// Build a track-control RPC payload: "<action>:<track_name>".
50-
inline std::string formatPayload(const char *action,
51-
const std::string &track_name) {
52-
std::string payload;
53-
payload.reserve(std::char_traits<char>::length(action) + 1 +
54-
track_name.size());
55-
payload += action;
56-
payload += kDelimiter;
57-
payload += track_name;
58-
return payload;
59-
}
50+
std::string formatPayload(const char *action, const std::string &track_name);
6051

6152
} // namespace track_control
6253
} // namespace rpc

bridge/src/bridge_audio_track.cpp

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

2828
#include <stdexcept>
2929

30-
#include "lk_log.h"
30+
#include "livekit/lk_log.h"
3131

3232
namespace livekit_bridge {
3333

bridge/src/bridge_video_track.cpp

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

2828
#include <stdexcept>
2929

30-
#include "lk_log.h"
30+
#include "livekit/lk_log.h"
3131

3232
namespace livekit_bridge {
3333

bridge/src/livekit_bridge.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@
3939
#include <cassert>
4040
#include <stdexcept>
4141

42-
#include "lk_log.h"
43-
4442
namespace livekit_bridge {
4543

4644
// ---------------------------------------------------------------

bridge/src/rpc_constants.cpp

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright 2026 LiveKit
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#include "livekit_bridge/rpc_constants.h"
18+
19+
namespace livekit_bridge {
20+
namespace rpc {
21+
namespace track_control {
22+
23+
const char *const kMethod = "lk.bridge.track-control";
24+
const char *const kActionMute = "mute";
25+
const char *const kActionUnmute = "unmute";
26+
const char kDelimiter = ':';
27+
const char *const kResponseOk = "ok";
28+
29+
std::string formatPayload(const char *action, const std::string &track_name) {
30+
std::string payload;
31+
payload.reserve(std::char_traits<char>::length(action) + 1 +
32+
track_name.size());
33+
payload += action;
34+
payload += kDelimiter;
35+
payload += track_name;
36+
return payload;
37+
}
38+
39+
} // namespace track_control
40+
} // namespace rpc
41+
} // namespace livekit_bridge

build.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Commands:
3737
release Configure + build Release version (build-release/)
3838
release-examples Configure + build Release version with examples
3939
release-tests Configure + build Release version with tests
40+
build-all Configure + build all of the above (debug/release + examples + tests)
4041
clean Clean both Debug and Release build directories
4142
clean-all Full clean (build dirs + Rust targets)
4243
help Show this help message
@@ -60,6 +61,7 @@ Examples:
6061
./build.sh debug
6162
./build.sh debug-tests
6263
./build.sh release-tests
64+
./build.sh build-all
6365
./build.sh clean
6466
./build.sh clean-all
6567
EOF
@@ -401,6 +403,26 @@ case "${cmd}" in
401403
fi
402404
fi
403405
;;
406+
build-all)
407+
echo "==> Build-all: debug, debug-examples, debug-tests, release, release-examples, release-tests"
408+
BUILD_TYPE="Debug"
409+
BUILD_DIR="${PROJECT_ROOT}/build-debug"
410+
PRESET="${OS_TYPE}-debug"
411+
configure && build
412+
PRESET="${OS_TYPE}-debug-examples"
413+
configure && build
414+
PRESET="${OS_TYPE}-debug-tests"
415+
configure && build
416+
BUILD_TYPE="Release"
417+
BUILD_DIR="${PROJECT_ROOT}/build-release"
418+
PRESET="${OS_TYPE}-release"
419+
configure && build
420+
PRESET="${OS_TYPE}-release-examples"
421+
configure && build
422+
PRESET="${OS_TYPE}-release-tests"
423+
configure && build
424+
echo "==> Build-all complete."
425+
;;
404426
clean)
405427
clean
406428
;;

0 commit comments

Comments
 (0)