Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ lib/
*.dll
*.exe
livekit.log
web/
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

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

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

target_link_libraries(livekit
PUBLIC
$<BUILD_INTERFACE:spdlog::spdlog>
PRIVATE
livekit_ffi
${LIVEKIT_PROTOBUF_TARGET}
spdlog::spdlog
)

target_compile_definitions(livekit
Expand Down
1 change: 1 addition & 0 deletions bridge/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ add_library(livekit_bridge SHARED
src/bridge_video_track.cpp
src/bridge_room_delegate.cpp
src/bridge_room_delegate.h
src/rpc_constants.cpp
src/rpc_controller.cpp
src/rpc_controller.h
)
Expand Down
1 change: 1 addition & 0 deletions bridge/include/livekit_bridge/livekit_bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "livekit_bridge/bridge_video_track.h"
#include "livekit_bridge/rpc_constants.h"

#include "livekit/lk_log.h"
#include "livekit/local_participant.h"
#include "livekit/room.h"
#include "livekit/rpc_error.h"
Expand Down
21 changes: 6 additions & 15 deletions bridge/include/livekit_bridge/rpc_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,20 @@ namespace track_control {
enum class Action { kActionMute, kActionUnmute };

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

/// Payload action strings.
constexpr const char *kActionMute = "mute";
constexpr const char *kActionUnmute = "unmute";
extern const char *const kActionMute;
extern const char *const kActionUnmute;

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

/// Response payload returned on success.
constexpr const char *kResponseOk = "ok";
extern const char *const kResponseOk;

/// Build a track-control RPC payload: "<action>:<track_name>".
inline std::string formatPayload(const char *action,
const std::string &track_name) {
std::string payload;
payload.reserve(std::char_traits<char>::length(action) + 1 +
track_name.size());
payload += action;
payload += kDelimiter;
payload += track_name;
return payload;
}
std::string formatPayload(const char *action, const std::string &track_name);

} // namespace track_control
} // namespace rpc
Expand Down
2 changes: 1 addition & 1 deletion bridge/src/bridge_audio_track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#include <stdexcept>

#include "lk_log.h"
#include "livekit/lk_log.h"

namespace livekit_bridge {

Expand Down
2 changes: 1 addition & 1 deletion bridge/src/bridge_video_track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#include <stdexcept>

#include "lk_log.h"
#include "livekit/lk_log.h"

namespace livekit_bridge {

Expand Down
2 changes: 0 additions & 2 deletions bridge/src/livekit_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
#include <cassert>
#include <stdexcept>

#include "lk_log.h"

namespace livekit_bridge {

// ---------------------------------------------------------------
Expand Down
41 changes: 41 additions & 0 deletions bridge/src/rpc_constants.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright 2026 LiveKit
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "livekit_bridge/rpc_constants.h"

namespace livekit_bridge {
namespace rpc {
namespace track_control {

const char *const kMethod = "lk.bridge.track-control";
const char *const kActionMute = "mute";
const char *const kActionUnmute = "unmute";
const char kDelimiter = ':';
const char *const kResponseOk = "ok";

std::string formatPayload(const char *action, const std::string &track_name) {
std::string payload;
payload.reserve(std::char_traits<char>::length(action) + 1 +
track_name.size());
payload += action;
payload += kDelimiter;
payload += track_name;
return payload;
}

} // namespace track_control
} // namespace rpc
} // namespace livekit_bridge
22 changes: 22 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Commands:
release Configure + build Release version (build-release/)
release-examples Configure + build Release version with examples
release-tests Configure + build Release version with tests
build-all Configure + build all of the above (debug/release + examples + tests)
clean Clean both Debug and Release build directories
clean-all Full clean (build dirs + Rust targets)
help Show this help message
Expand All @@ -60,6 +61,7 @@ Examples:
./build.sh debug
./build.sh debug-tests
./build.sh release-tests
./build.sh build-all
./build.sh clean
./build.sh clean-all
EOF
Expand Down Expand Up @@ -401,6 +403,26 @@ case "${cmd}" in
fi
fi
;;
build-all)
echo "==> Build-all: debug, debug-examples, debug-tests, release, release-examples, release-tests"
BUILD_TYPE="Debug"
BUILD_DIR="${PROJECT_ROOT}/build-debug"
PRESET="${OS_TYPE}-debug"
configure && build
PRESET="${OS_TYPE}-debug-examples"
configure && build
PRESET="${OS_TYPE}-debug-tests"
configure && build
BUILD_TYPE="Release"
BUILD_DIR="${PROJECT_ROOT}/build-release"
PRESET="${OS_TYPE}-release"
configure && build
PRESET="${OS_TYPE}-release-examples"
configure && build
PRESET="${OS_TYPE}-release-tests"
configure && build
echo "==> Build-all complete."
;;
clean)
clean
;;
Expand Down
3 changes: 3 additions & 0 deletions cmake/LiveKitConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
@PACKAGE_INIT@

include(CMakeFindDependencyMacro)
find_dependency(spdlog)

include("${CMAKE_CURRENT_LIST_DIR}/LiveKitTargets.cmake")

1 change: 0 additions & 1 deletion examples/bridge_human_robot/human.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
#include "livekit/track.h"
#include "livekit/video_frame.h"
#include "livekit_bridge/livekit_bridge.h"
#include "lk_log.h"
#include "sdl_media.h"

#include <SDL3/SDL.h>
Expand Down
1 change: 0 additions & 1 deletion examples/bridge_human_robot/robot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include "livekit/track.h"
#include "livekit/video_frame.h"
#include "livekit_bridge/livekit_bridge.h"
#include "lk_log.h"
#include "sdl_media.h"

#include <SDL3/SDL.h>
Expand Down
2 changes: 1 addition & 1 deletion examples/common/sdl_media.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include "sdl_media.h"

#include "lk_log.h"
#include "livekit/lk_log.h"

// ---------------------- SDLMicSource -----------------------------

Expand Down
2 changes: 1 addition & 1 deletion examples/common/sdl_media_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "fallback_capture.h"
#include "livekit/livekit.h"
#include "lk_log.h"
#include "livekit/lk_log.h"
#include "sdl_media.h"
#include "sdl_video_renderer.h"
#include <cstring>
Expand Down
2 changes: 1 addition & 1 deletion examples/common/sdl_video_renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "sdl_video_renderer.h"

#include "livekit/livekit.h"
#include "lk_log.h"
#include "livekit/lk_log.h"
#include <cstring>

using namespace livekit;
Expand Down
2 changes: 1 addition & 1 deletion examples/logging_levels/basic_usage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/// see which messages are filtered at each setting.

#include "livekit/livekit.h"
#include "lk_log.h"
#include "livekit/lk_log.h"

#include <cstring>
#include <iostream>
Expand Down
1 change: 0 additions & 1 deletion examples/simple_room/fallback_capture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <thread>

#include "livekit/livekit.h"
#include "lk_log.h"
#include "wav_audio_source.h"

using namespace livekit;
Expand Down
1 change: 0 additions & 1 deletion examples/simple_room/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <vector>

#include "livekit/livekit.h"
#include "lk_log.h"
#include "sdl_media_manager.h"
#include "wav_audio_source.h"

Expand Down
1 change: 1 addition & 0 deletions include/livekit/livekit.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "audio_stream.h"
#include "build.h"
#include "e2ee.h"
#include "lk_log.h"
#include "local_audio_track.h"
#include "local_participant.h"
#include "local_track_publication.h"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/audio_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "ffi.pb.h"
#include "ffi_client.h"
#include "livekit/audio_frame.h"
#include "lk_log.h"
#include "livekit/lk_log.h"

namespace livekit {

Expand Down
2 changes: 1 addition & 1 deletion src/data_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include <stdexcept>

#include "ffi_client.h"
#include "livekit/lk_log.h"
#include "livekit/local_participant.h"
#include "lk_log.h"
#include "room.pb.h"

namespace livekit {
Expand Down
2 changes: 1 addition & 1 deletion src/ffi_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
#include "livekit/build.h"
#include "livekit/e2ee.h"
#include "livekit/ffi_handle.h"
#include "livekit/lk_log.h"
#include "livekit/room.h"
#include "livekit/rpc_error.h"
#include "livekit/track.h"
#include "livekit_ffi.h"
#include "lk_log.h"
#include "room.pb.h"
#include "room_proto_converter.h"

Expand Down
2 changes: 1 addition & 1 deletion src/livekit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include "livekit/livekit.h"
#include "ffi_client.h"
#include "lk_log.h"
#include "livekit/lk_log.h"

namespace livekit {

Expand Down
2 changes: 1 addition & 1 deletion src/room.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

#include "ffi.pb.h"
#include "ffi_client.h"
#include "livekit/lk_log.h"
#include "livekit_ffi.h"
#include "lk_log.h"
#include "room.pb.h"
#include "room_proto_converter.h"
#include "track.pb.h"
Expand Down
1 change: 0 additions & 1 deletion src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ if(INTEGRATION_TEST_SOURCES)
target_link_libraries(livekit_integration_tests
PRIVATE
livekit
spdlog::spdlog
GTest::gtest_main
GTest::gmock
)
Expand Down
2 changes: 1 addition & 1 deletion src/tests/integration/test_logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <gtest/gtest.h>
#include <livekit/livekit.h>

#include "lk_log.h"
#include "livekit/lk_log.h"

#include <atomic>
#include <mutex>
Expand Down
2 changes: 1 addition & 1 deletion src/video_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <vector>

#include "livekit/ffi_handle.h"
#include "lk_log.h"
#include "livekit/lk_log.h"
#include "video_utils.h"

namespace livekit {
Expand Down
2 changes: 1 addition & 1 deletion src/video_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

#include "ffi.pb.h"
#include "ffi_client.h"
#include "livekit/lk_log.h"
#include "livekit/track.h"
#include "lk_log.h"
#include "video_frame.pb.h"
#include "video_utils.h"

Expand Down
Loading