Skip to content

Commit 5681573

Browse files
Updated to latest SDK method signatures (#14)
* Updated to latest method signatures
1 parent 839e38f commit 5681573

16 files changed

Lines changed: 33 additions & 33 deletions

File tree

basic_room/capture_utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ using namespace livekit;
3030

3131
// Test utils to run a capture loop to publish noisy audio frames to the room
3232
void runNoiseCaptureLoop(const std::shared_ptr<AudioSource>& source, std::atomic<bool>& running_flag) {
33-
const int sample_rate = source->sample_rate();
34-
const int num_channels = source->num_channels();
33+
const int sample_rate = source->sampleRate();
34+
const int num_channels = source->numChannels();
3535
const int frame_ms = 10;
3636
const int samples_per_channel = sample_rate * frame_ms / 1000;
3737

basic_room/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ int main(int argc, char* argv[]) {
112112
options.dynacast = false;
113113

114114
std::cout << "Connecting to: " << url << "\n";
115-
if (!room->Connect(url, token, options)) {
115+
if (!room->connect(url, token, options)) {
116116
std::cerr << "Failed to connect\n";
117117
livekit::shutdown();
118118
return 1;

hello_livekit/receiver/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ int main(int argc, char* argv[]) {
7777
options.auto_subscribe = true;
7878
options.dynacast = false;
7979

80-
if (!room->Connect(url, receiver_token, options)) {
80+
if (!room->connect(url, receiver_token, options)) {
8181
std::cerr << "[error] [receiver] Failed to connect\n";
8282
livekit::shutdown();
8383
return 1;
@@ -86,7 +86,7 @@ int main(int argc, char* argv[]) {
8686
LocalParticipant* lp = room->localParticipant();
8787
assert(lp);
8888

89-
std::cout << "[info] [receiver] Connected as identity='" << lp->identity() << "' room='" << room->room_info().name
89+
std::cout << "[info] [receiver] Connected as identity='" << lp->identity() << "' room='" << room->roomInfo().name
9090
<< "'; subscribing to sender identity='" << sender_identity << "'\n";
9191

9292
int video_frame_count = 0;

hello_livekit/sender/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ int main(int argc, char* argv[]) {
7878
options.auto_subscribe = true;
7979
options.dynacast = false;
8080

81-
if (!room->Connect(url, sender_token, options)) {
81+
if (!room->connect(url, sender_token, options)) {
8282
std::cerr << "[error] [sender] Failed to connect\n";
8383
livekit::shutdown();
8484
return 1;
@@ -87,7 +87,7 @@ int main(int argc, char* argv[]) {
8787
LocalParticipant* lp = room->localParticipant();
8888
assert(lp);
8989

90-
std::cout << "[info] [sender] Connected as identity='" << lp->identity() << "' room='" << room->room_info().name
90+
std::cout << "[info] [sender] Connected as identity='" << lp->identity() << "' room='" << room->roomInfo().name
9191
<< "' — pass this identity to HelloLivekitReceiver\n";
9292

9393
auto video_source = std::make_shared<VideoSource>(kWidth, kHeight);

ping_pong/ping/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ int main(int argc, char* argv[]) {
9292
options.auto_subscribe = true;
9393
options.dynacast = false;
9494

95-
if (!room->Connect(url, token, options)) {
95+
if (!room->connect(url, token, options)) {
9696
std::cerr << "[error] Failed to connect to room\n";
9797
livekit::shutdown();
9898
return 1;
@@ -102,7 +102,7 @@ int main(int argc, char* argv[]) {
102102
assert(local_participant);
103103

104104
std::cout << "[info] ping connected as identity='" << local_participant->identity() << "' room='"
105-
<< room->room_info().name << "'\n";
105+
<< room->roomInfo().name << "'\n";
106106

107107
auto publish_result = local_participant->publishDataTrack(ping_pong::kPingTrackName);
108108
if (!publish_result) {

ping_pong/pong/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ int main(int argc, char* argv[]) {
7171
options.auto_subscribe = true;
7272
options.dynacast = false;
7373

74-
if (!room->Connect(url, token, options)) {
74+
if (!room->connect(url, token, options)) {
7575
std::cerr << "[error] Failed to connect to room\n";
7676
livekit::shutdown();
7777
return 1;
@@ -81,7 +81,7 @@ int main(int argc, char* argv[]) {
8181
assert(local_participant);
8282

8383
std::cout << "[info] pong connected as identity='" << local_participant->identity() << "' room='"
84-
<< room->room_info().name << "'\n";
84+
<< room->roomInfo().name << "'\n";
8585

8686
auto publish_result = local_participant->publishDataTrack(ping_pong::kPongTrackName);
8787
if (!publish_result) {

simple_data_stream/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,15 +213,15 @@ int main(int argc, char* argv[]) {
213213
options.auto_subscribe = true;
214214
options.dynacast = false;
215215

216-
bool ok = room->Connect(url, token, options);
216+
bool ok = room->connect(url, token, options);
217217
std::cout << "[DataStream] Connect result: " << std::boolalpha << ok << "\n";
218218
if (!ok) {
219219
std::cerr << "[DataStream] Failed to connect to room\n";
220220
livekit::shutdown();
221221
return 1;
222222
}
223223

224-
auto info = room->room_info();
224+
auto info = room->roomInfo();
225225
std::cout << "[DataStream] Connected to room '" << info.name << "', participants: " << info.num_participants << "\n";
226226

227227
// Register stream handlers

simple_joystick/receiver/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ int main(int argc, char* argv[]) {
6565
options.auto_subscribe = true;
6666
options.dynacast = false;
6767

68-
bool res = room->Connect(url, token, options);
68+
bool res = room->connect(url, token, options);
6969
std::cout << "[Receiver] Connect result: " << std::boolalpha << res << "\n";
7070
if (!res) {
7171
std::cerr << "[Receiver] Failed to connect to room\n";
7272
livekit::shutdown();
7373
return 1;
7474
}
7575

76-
auto info = room->room_info();
76+
auto info = room->roomInfo();
7777
std::cout << "[Receiver] Connected to room: " << info.name << "\n";
7878
std::cout << "[Receiver] Waiting for sender peer (up to 2 minutes)...\n";
7979

simple_joystick/sender/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,15 @@ int main(int argc, char* argv[]) {
133133
options.auto_subscribe = true;
134134
options.dynacast = false;
135135

136-
bool res = room->Connect(url, token, options);
136+
bool res = room->connect(url, token, options);
137137
std::cout << "[Sender] Connect result: " << std::boolalpha << res << "\n";
138138
if (!res) {
139139
std::cerr << "[Sender] Failed to connect to room\n";
140140
livekit::shutdown();
141141
return 1;
142142
}
143143

144-
auto info = room->room_info();
144+
auto info = room->roomInfo();
145145
std::cout << "[Sender] Connected to room: " << info.name << "\n";
146146

147147
// Enable raw terminal mode for immediate keypress detection

simple_room/fallback_capture.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ using namespace livekit;
3030

3131
// Test utils to run a capture loop to publish noisy audio frames to the room
3232
void runNoiseCaptureLoop(const std::shared_ptr<AudioSource>& source, std::atomic<bool>& running_flag) {
33-
const int sample_rate = source->sample_rate();
34-
const int num_channels = source->num_channels();
33+
const int sample_rate = source->sampleRate();
34+
const int num_channels = source->numChannels();
3535
const int frame_ms = 10;
3636
const int samples_per_channel = sample_rate * frame_ms / 1000;
3737

0 commit comments

Comments
 (0)