Skip to content

Commit c7bb373

Browse files
Modernize namespaces
1 parent d6936cb commit c7bb373

23 files changed

Lines changed: 46 additions & 102 deletions

bridge/include/livekit_bridge/rpc_constants.h

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,7 @@
3131
#define LIVEKIT_BRIDGE_API
3232
#endif
3333

34-
namespace livekit_bridge {
35-
namespace rpc {
36-
37-
/// Built-in RPC method name used by remote track control.
38-
/// Allows remote participants to mute or unmute tracks
39-
/// published by this bridge. Must be called after connect().
40-
/// Audio/video tracks support mute and unmute. Data tracks
41-
/// only support mute and unmute.
42-
namespace track_control {
34+
namespace livekit_bridge::rpc::track_control {
4335

4436
enum class Action { kActionMute, kActionUnmute };
4537

@@ -60,6 +52,4 @@ LIVEKIT_BRIDGE_API extern const char *const kResponseOk;
6052
LIVEKIT_BRIDGE_API std::string formatPayload(const char *action,
6153
const std::string &track_name);
6254

63-
} // namespace track_control
64-
} // namespace rpc
65-
} // namespace livekit_bridge
55+
} // namespace livekit_bridge::rpc::track_control

bridge/src/rpc_constants.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616

1717
#include "livekit_bridge/rpc_constants.h"
1818

19-
namespace livekit_bridge {
20-
namespace rpc {
21-
namespace track_control {
19+
namespace livekit_bridge::rpc::track_control {
2220

2321
const char *const kMethod = "lk.bridge.track-control";
2422
const char *const kActionMute = "mute";
@@ -36,6 +34,4 @@ std::string formatPayload(const char *action, const std::string &track_name) {
3634
return payload;
3735
}
3836

39-
} // namespace track_control
40-
} // namespace rpc
41-
} // namespace livekit_bridge
37+
} // namespace livekit_bridge::rpc::track_control

bridge/tests/integration/test_bridge_rpc_roundtrip.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
#include "../common/bridge_test_common.h"
1818
#include <livekit/rpc_error.h>
1919

20-
namespace livekit_bridge {
21-
namespace test {
20+
namespace livekit_bridge::test {
2221

2322
class BridgeRpcRoundtripTest : public BridgeTestBase {};
2423

@@ -267,5 +266,4 @@ TEST_F(BridgeRemoteTrackControlTest, RemoteMuteNonexistentTrack) {
267266
}
268267
}
269268

270-
} // namespace test
271-
} // namespace livekit_bridge
269+
} // namespace livekit_bridge::test

bridge/tests/test_bridge_audio_track.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
#include <memory>
2525
#include <vector>
2626

27-
namespace livekit_bridge {
28-
namespace test {
27+
namespace livekit_bridge::test {
2928

3029
class BridgeAudioTrackTest : public ::testing::Test {
3130
protected:
@@ -114,5 +113,4 @@ TEST_F(BridgeAudioTrackTest, UnmuteOnReleasedTrackDoesNotCrash) {
114113
<< "unmute() on a released track should be a no-op";
115114
}
116115

117-
} // namespace test
118-
} // namespace livekit_bridge
116+
} // namespace livekit_bridge::test

bridge/tests/test_bridge_video_track.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
#include <memory>
2525
#include <vector>
2626

27-
namespace livekit_bridge {
28-
namespace test {
27+
namespace livekit_bridge::test {
2928

3029
class BridgeVideoTrackTest : public ::testing::Test {
3130
protected:
@@ -110,5 +109,4 @@ TEST_F(BridgeVideoTrackTest, UnmuteOnReleasedTrackDoesNotCrash) {
110109
<< "unmute() on a released track should be a no-op";
111110
}
112111

113-
} // namespace test
114-
} // namespace livekit_bridge
112+
} // namespace livekit_bridge::test

bridge/tests/test_livekit_bridge.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424

2525
#include <stdexcept>
2626

27-
namespace livekit_bridge {
28-
namespace test {
27+
namespace livekit_bridge::test {
2928

3029
class LiveKitBridgeTest : public ::testing::Test {
3130
protected:
@@ -134,5 +133,4 @@ TEST_F(LiveKitBridgeTest, ClearNonExistentCallbackIsNoOp) {
134133
}) << "Clearing a callback that was never registered should be a no-op";
135134
}
136135

137-
} // namespace test
138-
} // namespace livekit_bridge
136+
} // namespace livekit_bridge::test

bridge/tests/test_rpc_controller.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
#include <string>
2929
#include <vector>
3030

31-
namespace livekit_bridge {
32-
namespace test {
31+
namespace livekit_bridge::test {
3332

3433
// Records (action, track_name) pairs passed to the TrackActionFn callback.
3534
struct TrackActionRecord {
@@ -269,5 +268,4 @@ TEST_F(RpcControllerTest, FormatPayloadRoundTrip) {
269268
EXPECT_EQ(recorded_actions_[0].track_name, track_name);
270269
}
271270

272-
} // namespace test
273-
} // namespace livekit_bridge
271+
} // namespace livekit_bridge::test

src/lk_log.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
#include <memory>
2121
#include <spdlog/spdlog.h>
2222

23-
namespace livekit {
24-
namespace detail {
23+
namespace livekit::detail {
2524

2625
/// Returns the shared "livekit" logger instance.
2726
/// The logger is created lazily on first access and lives until
@@ -31,8 +30,7 @@ std::shared_ptr<spdlog::logger> getLogger();
3130
/// Tears down the spdlog logger. Called by livekit::shutdown().
3231
void shutdownLogger();
3332

34-
} // namespace detail
35-
} // namespace livekit
33+
} // namespace livekit::detail
3634

3735
// Convenience macros — two-tier filtering:
3836
//

src/tests/common/audio_utils.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
#include <memory>
2525
#include <thread>
2626

27-
namespace livekit {
28-
namespace test {
27+
namespace livekit::test {
2928

3029
// Default audio parameters for tests
3130
constexpr int kDefaultAudioSampleRate = 48000;
@@ -116,5 +115,4 @@ inline void fillToneFrame(AudioFrame &frame, double freq_hz, int sample_rate,
116115
}
117116
}
118117

119-
} // namespace test
120-
} // namespace livekit
118+
} // namespace livekit::test

src/tests/common/test_common.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
#include <thread>
3535
#include <vector>
3636

37-
namespace livekit {
38-
namespace test {
37+
namespace livekit::test {
3938

4039
using namespace std::chrono_literals;
4140

@@ -435,5 +434,4 @@ class LiveKitTestBase : public ::testing::Test {
435434
TestConfig config_;
436435
};
437436

438-
} // namespace test
439-
} // namespace livekit
437+
} // namespace livekit::test

0 commit comments

Comments
 (0)