Skip to content

Commit 20e5d5b

Browse files
trim
1 parent 709a8ab commit 20e5d5b

3 files changed

Lines changed: 7 additions & 45 deletions

File tree

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,13 @@ The following features are deprecated and will be removed in the next major rele
260260

261261
- `PacketTrailerFeatures` is deprecated. Use `FrameMetadataFeatures` via
262262
`TrackPublishOptions::frame_metadata_features` instead.
263+
- `Room::setOnAudioFrameCallback`, `Room::setOnVideoFrameCallback`, and
264+
`Room::setOnVideoFrameEventCallback` are deprecated. Use the `[[nodiscard]]`
265+
variants `trySetOnAudioFrameCallback`, `trySetOnVideoFrameCallback`, and
266+
`trySetOnVideoFrameEventCallback` instead, which return `false` when a
267+
callback is already registered rather than silently replacing it. To replace
268+
an active callback, call `clearOn*FrameCallback` first. (The same rename
269+
applies to the corresponding `SubscriptionThreadDispatcher` methods.)
263270

264271
### `v1.0.0`
265272

include/livekit/room.h

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -374,46 +374,20 @@ class LIVEKIT_API Room {
374374
/// @deprecated Use trySetOnAudioFrameCallback() instead.
375375
///
376376
/// Forwards to @ref trySetOnAudioFrameCallback and discards the result.
377-
/// Replacing an active callback is not supported through this overload; call
378-
/// @ref clearOnAudioFrameCallback first, then @ref trySetOnAudioFrameCallback.
379-
///
380-
/// @param participant_identity Identity of the remote participant.
381-
/// @param track_name Track name to match.
382-
/// @param callback Function invoked for each decoded audio frame.
383-
/// @param opts Options used when creating the backing
384-
/// @ref AudioStream.
385377
[[deprecated("Room::setOnAudioFrameCallback is deprecated; use trySetOnAudioFrameCallback instead")]]
386378
void setOnAudioFrameCallback(const std::string& participant_identity, const std::string& track_name,
387379
AudioFrameCallback callback, const AudioStream::Options& opts = {});
388380

389381
/// @deprecated Use trySetOnVideoFrameCallback() instead.
390382
///
391383
/// Forwards to @ref trySetOnVideoFrameCallback and discards the result.
392-
/// Replacing an active callback is not supported through this overload; call
393-
/// @ref clearOnVideoFrameCallback first, then @ref trySetOnVideoFrameCallback.
394-
///
395-
/// @param participant_identity Identity of the remote participant.
396-
/// @param track_name Track name to match.
397-
/// @param callback Function invoked for each decoded video frame.
398-
/// @param opts Options used when creating the backing
399-
/// @ref VideoStream.
400384
[[deprecated("Room::setOnVideoFrameCallback is deprecated; use trySetOnVideoFrameCallback instead")]]
401385
void setOnVideoFrameCallback(const std::string& participant_identity, const std::string& track_name,
402386
VideoFrameCallback callback, const VideoStream::Options& opts = {});
403387

404388
/// @deprecated Use trySetOnVideoFrameEventCallback() instead.
405389
///
406390
/// Forwards to @ref trySetOnVideoFrameEventCallback and discards the result.
407-
/// Replacing an active callback is not supported through this overload; call
408-
/// @ref clearOnVideoFrameCallback first, then
409-
/// @ref trySetOnVideoFrameEventCallback.
410-
///
411-
/// @param participant_identity Identity of the remote participant.
412-
/// @param track_name Track name to match.
413-
/// @param callback Function invoked for each decoded video frame
414-
/// event, including optional metadata.
415-
/// @param opts Options used when creating the backing
416-
/// @ref VideoStream.
417391
[[deprecated("Room::setOnVideoFrameEventCallback is deprecated; use trySetOnVideoFrameEventCallback instead")]]
418392
void setOnVideoFrameEventCallback(const std::string& participant_identity, const std::string& track_name,
419393
VideoFrameEventCallback callback, const VideoStream::Options& opts = {});

include/livekit/subscription_thread_dispatcher.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,6 @@ class LIVEKIT_API SubscriptionThreadDispatcher {
160160
/// Forwards to @ref trySetOnAudioFrameCallback and discards the result.
161161
/// Replacing an active callback is not supported through this overload; call
162162
/// @ref clearOnAudioFrameCallback first, then @ref trySetOnAudioFrameCallback.
163-
///
164-
/// @param participant_identity Identity of the remote participant.
165-
/// @param track_name Track name to match.
166-
/// @param callback Function invoked for each decoded audio frame.
167-
/// @param opts Options used when creating the backing
168-
/// @ref AudioStream.
169163
[[deprecated(
170164
"SubscriptionThreadDispatcher::setOnAudioFrameCallback is deprecated; use trySetOnAudioFrameCallback instead")]]
171165
void setOnAudioFrameCallback(const std::string& participant_identity, const std::string& track_name,
@@ -176,12 +170,6 @@ class LIVEKIT_API SubscriptionThreadDispatcher {
176170
/// Forwards to @ref trySetOnVideoFrameCallback and discards the result.
177171
/// Replacing an active callback is not supported through this overload; call
178172
/// @ref clearOnVideoFrameCallback first, then @ref trySetOnVideoFrameCallback.
179-
///
180-
/// @param participant_identity Identity of the remote participant.
181-
/// @param track_name Track name to match.
182-
/// @param callback Function invoked for each decoded video frame.
183-
/// @param opts Options used when creating the backing
184-
/// @ref VideoStream.
185173
[[deprecated(
186174
"SubscriptionThreadDispatcher::setOnVideoFrameCallback is deprecated; use trySetOnVideoFrameCallback instead")]]
187175
void setOnVideoFrameCallback(const std::string& participant_identity, const std::string& track_name,
@@ -193,13 +181,6 @@ class LIVEKIT_API SubscriptionThreadDispatcher {
193181
/// Replacing an active callback is not supported through this overload; call
194182
/// @ref clearOnVideoFrameCallback first, then
195183
/// @ref trySetOnVideoFrameEventCallback.
196-
///
197-
/// @param participant_identity Identity of the remote participant.
198-
/// @param track_name Track name to match.
199-
/// @param callback Function invoked for each decoded video frame
200-
/// event, including optional metadata.
201-
/// @param opts Options used when creating the backing
202-
/// @ref VideoStream.
203184
[[deprecated(
204185
"SubscriptionThreadDispatcher::setOnVideoFrameEventCallback is deprecated; use "
205186
"trySetOnVideoFrameEventCallback instead")]]

0 commit comments

Comments
 (0)