Skip to content

Commit 8d51968

Browse files
rm unneeded vars
1 parent 7899536 commit 8d51968

3 files changed

Lines changed: 7 additions & 26 deletions

File tree

‎include/livekit/subscription_thread_dispatcher.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,9 @@ class LIVEKIT_API SubscriptionThreadDispatcher {
161161
/// If no matching callback is registered, this is a no-op.
162162
///
163163
/// @param participant_identity Identity of the remote participant.
164-
/// @param source Track source associated with the subscription.
165164
/// @param track_name Track name associated with the subscription.
166165
/// @param track Subscribed remote track to read from.
167-
void handleTrackSubscribed(const std::string& participant_identity, TrackSource source, const std::string& track_name,
166+
void handleTrackSubscribed(const std::string& participant_identity, const std::string& track_name,
168167
const std::shared_ptr<Track>& track);
169168

170169
/// Stop reader dispatch for an unsubscribed remote track.

‎src/room.cpp‎

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,6 @@ void readyForRoomEvent(std::uint64_t room_handle) {
7272
}
7373
}
7474

75-
TrackKind trackKindFromSource(TrackSource source) {
76-
switch (source) {
77-
case TrackSource::SOURCE_MICROPHONE:
78-
case TrackSource::SOURCE_SCREENSHARE_AUDIO:
79-
return TrackKind::KIND_AUDIO;
80-
case TrackSource::SOURCE_CAMERA:
81-
case TrackSource::SOURCE_SCREENSHARE:
82-
return TrackKind::KIND_VIDEO;
83-
case TrackSource::SOURCE_UNKNOWN:
84-
return TrackKind::KIND_UNKNOWN;
85-
}
86-
87-
return TrackKind::KIND_UNKNOWN;
88-
}
89-
9075
} // namespace
9176
Room::Room() : subscription_thread_dispatcher_(std::make_unique<SubscriptionThreadDispatcher>()) {}
9277

@@ -639,8 +624,7 @@ void Room::onEvent(const FfiEvent& event) {
639624
}
640625

641626
if (subscription_thread_dispatcher_ && remote_track && rpublication) {
642-
subscription_thread_dispatcher_->handleTrackSubscribed(identity, rpublication->source(),
643-
rpublication->name(), remote_track);
627+
subscription_thread_dispatcher_->handleTrackSubscribed(identity, rpublication->name(), remote_track);
644628
}
645629
break;
646630
}

‎src/subscription_thread_dispatcher.cpp‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,19 +143,17 @@ void SubscriptionThreadDispatcher::clearOnVideoFrameCallback(const std::string&
143143
}
144144
}
145145

146-
void SubscriptionThreadDispatcher::handleTrackSubscribed(const std::string& participant_identity, TrackSource source,
146+
void SubscriptionThreadDispatcher::handleTrackSubscribed(const std::string& participant_identity,
147147
const std::string& track_name,
148148
const std::shared_ptr<Track>& track) {
149149
if (!track) {
150-
LK_LOG_WARN(
151-
"Ignoring subscribed track dispatch for participant={} source={} "
152-
"because track is null",
153-
participant_identity, static_cast<int>(source));
150+
LK_LOG_WARN("Ignoring subscribed track dispatch for participant={} track_name={} because track is null",
151+
participant_identity, track_name);
154152
return;
155153
}
156154

157-
LK_LOG_DEBUG("Handling subscribed track for participant={} source={} kind={}", participant_identity,
158-
static_cast<int>(source), trackKindName(track->kind()));
155+
LK_LOG_DEBUG("Handling subscribed track for participant={} track_name={} kind={}", participant_identity, track_name,
156+
trackKindName(track->kind()));
159157

160158
const CallbackKey key{participant_identity, track_name, track->kind()};
161159
std::thread old_thread;

0 commit comments

Comments
 (0)