@@ -159,6 +159,26 @@ class SubscriptionThreadDispatcher {
159159 VideoFrameCallback callback,
160160 VideoStream::Options opts = {});
161161
162+ /* *
163+ * Register or replace a rich video frame event callback for a remote
164+ * subscription.
165+ *
166+ * The callback is keyed by remote participant identity plus \p source.
167+ * If the matching remote video track is already subscribed, \ref Room may
168+ * immediately call \ref handleTrackSubscribed to start a reader.
169+ *
170+ * @param participant_identity Identity of the remote participant.
171+ * @param source Track source to match.
172+ * @param callback Function invoked for each decoded video frame
173+ * event, including optional metadata.
174+ * @param opts Options used when creating the backing
175+ * \ref VideoStream.
176+ */
177+ void setOnVideoFrameEventCallback (const std::string &participant_identity,
178+ TrackSource source,
179+ VideoFrameEventCallback callback,
180+ VideoStream::Options opts = {});
181+
162182 /* *
163183 * Remove an audio callback registration and stop any active reader.
164184 *
@@ -382,7 +402,8 @@ class SubscriptionThreadDispatcher {
382402
383403 // / Stored video callback registration plus stream-construction options.
384404 struct RegisteredVideoCallback {
385- VideoFrameCallback callback;
405+ VideoFrameCallback legacy_callback;
406+ VideoFrameEventCallback event_callback;
386407 VideoStream::Options options;
387408 };
388409
@@ -413,8 +434,7 @@ class SubscriptionThreadDispatcher {
413434 // / is extracted and returned to the caller for joining outside the lock.
414435 std::thread startVideoReaderLocked (const CallbackKey &key,
415436 const std::shared_ptr<Track> &track,
416- const VideoFrameCallback &cb,
417- const VideoStream::Options &opts);
437+ const RegisteredVideoCallback &callback);
418438
419439 // / Extract and close the data reader for a given callback ID, returning its
420440 // / thread. Must be called with \ref lock_ held.
0 commit comments