@@ -41,7 +41,8 @@ void printUsage(const char *prog) {
4141 << " LIVEKIT_URL, LIVEKIT_TOKEN\n " ;
4242}
4343
44- bool parseArgs (int argc, char *argv[], std::string &url, std::string &token, bool &self_test) {
44+ bool parseArgs (int argc, char *argv[], std::string &url, std::string &token,
45+ bool &self_test) {
4546 for (int i = 1 ; i < argc; ++i) {
4647 const std::string a = argv[i];
4748 if (a == " -h" || a == " --help" )
@@ -85,14 +86,9 @@ bool parseArgs(int argc, char *argv[], std::string &url, std::string &token, boo
8586}
8687
8788void print_livekit_version () {
88- std::cout
89- << " LiveKit version: "
90- << LIVEKIT_BUILD_VERSION_FULL
91- << " (" << LIVEKIT_BUILD_FLAVOR
92- << " , commit " << LIVEKIT_BUILD_COMMIT
93- << " , built " << LIVEKIT_BUILD_DATE
94- << " )"
95- << std::endl;
89+ std::cout << " LiveKit version: " << LIVEKIT_BUILD_VERSION_FULL << " ("
90+ << LIVEKIT_BUILD_FLAVOR << " , commit " << LIVEKIT_BUILD_COMMIT
91+ << " , built " << LIVEKIT_BUILD_DATE << " )" << std::endl;
9692}
9793
9894} // namespace
@@ -106,7 +102,7 @@ int main(int argc, char *argv[]) {
106102 return 1 ;
107103 }
108104 if (self_test) {
109- livekit::initialize (livekit::LogSink::kConsole );
105+ livekit::initialize (livekit::LogLevel::Info, livekit:: LogSink::kConsole );
110106 livekit::shutdown ();
111107 std::cout << " self-test ok" << std::endl;
112108 return 0 ;
@@ -115,7 +111,7 @@ int main(int argc, char *argv[]) {
115111 std::signal (SIGINT , handleSignal);
116112
117113 // Init LiveKit
118- livekit::initialize (livekit::LogSink::kConsole );
114+ livekit::initialize (livekit::LogLevel::Info, livekit:: LogSink::kConsole );
119115
120116 auto room = std::make_unique<Room>();
121117
@@ -145,7 +141,8 @@ int main(int argc, char *argv[]) {
145141
146142 std::shared_ptr<LocalTrackPublication> audioPub;
147143 try {
148- audioPub = room->localParticipant ()->publishTrack (audioTrack, audioOpts);
144+ room->localParticipant ()->publishTrack (audioTrack, audioOpts);
145+ audioPub = audioTrack->publication ();
149146 std::cout << " Published audio: sid=" << audioPub->sid () << " \n " ;
150147 } catch (const std::exception &e) {
151148 std::cerr << " Failed to publish audio: " << e.what () << " \n " ;
@@ -163,7 +160,8 @@ int main(int argc, char *argv[]) {
163160
164161 std::shared_ptr<LocalTrackPublication> videoPub;
165162 try {
166- videoPub = room->localParticipant ()->publishTrack (videoTrack, videoOpts);
163+ room->localParticipant ()->publishTrack (videoTrack, videoOpts);
164+ videoPub = videoTrack->publication ();
167165 std::cout << " Published video: sid=" << videoPub->sid () << " \n " ;
168166 } catch (const std::exception &e) {
169167 std::cerr << " Failed to publish video: " << e.what () << " \n " ;
0 commit comments