Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

IOS: Subscription update with replacing stream #112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion talk/owt/sdk/conference/conferencesubscription.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,17 @@ void ConferenceSubscription::ApplyOptions(
});
}
} else {
that->UpdateSubscription(id_, stream_id_, options, on_success, on_failure);
std::string update_stream_id = options.video.streamid;
if( update_stream_id.empty() ){
that->UpdateSubscription(id_, stream_id_, options, on_success, on_failure);
}
else{
std::function<void()> local_on_success = [this, &update_stream_id, on_success]() {
stream_id_.assign(update_stream_id);
on_success();
};
that->UpdateSubscription(id_, update_stream_id, options, local_on_success, on_failure);
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions talk/owt/sdk/conference/objc/OWTConferenceSubscription.mm
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ @implementation OWTConferenceVideoSubscriptionUpdateConstraints
constrains->frameRate = _frameRate;
constrains->bitrateMultiplier = _bitrateMultiplier;
constrains->keyFrameInterval = _keyFrameInterval;
if(_streamid != nil)
constrains->streamid = std::string([_streamid UTF8String]);
return constrains;
}
@end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ struct VideoSubscriptionUpdateConstraints {
double frameRate;
double bitrateMultiplier;
unsigned long keyFrameInterval;
std::string streamid;
};
/// Subscription update option used by subscription's ApplyOptions API.
struct SubscriptionUpdateOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ RTC_EXPORT
@property(nonatomic, assign) double frameRate;
@property(nonatomic, assign) double bitrateMultiplier;
@property(nonatomic, assign) NSUInteger keyFrameInterval;
@property(nonatomic, strong) NSString *streamid;
@end
RTC_EXPORT
@interface OWTConferenceSubscriptionUpdateOptions : NSObject
Expand Down