diff --git a/talk/owt/sdk/conference/conferencesubscription.cc b/talk/owt/sdk/conference/conferencesubscription.cc index a298153f3..3a3180f5e 100644 --- a/talk/owt/sdk/conference/conferencesubscription.cc +++ b/talk/owt/sdk/conference/conferencesubscription.cc @@ -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 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); + } } } diff --git a/talk/owt/sdk/conference/objc/OWTConferenceSubscription.mm b/talk/owt/sdk/conference/objc/OWTConferenceSubscription.mm index 8c5c46253..51bcfabc8 100644 --- a/talk/owt/sdk/conference/objc/OWTConferenceSubscription.mm +++ b/talk/owt/sdk/conference/objc/OWTConferenceSubscription.mm @@ -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 diff --git a/talk/owt/sdk/include/cpp/owt/conference/subscribeoptions.h b/talk/owt/sdk/include/cpp/owt/conference/subscribeoptions.h index 900d4135c..ee5e138a8 100644 --- a/talk/owt/sdk/include/cpp/owt/conference/subscribeoptions.h +++ b/talk/owt/sdk/include/cpp/owt/conference/subscribeoptions.h @@ -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 { diff --git a/talk/owt/sdk/include/objc/OWT/OWTConferenceSubscription.h b/talk/owt/sdk/include/objc/OWT/OWTConferenceSubscription.h index ecc5ea74a..9e7ed7ecb 100644 --- a/talk/owt/sdk/include/objc/OWT/OWTConferenceSubscription.h +++ b/talk/owt/sdk/include/objc/OWT/OWTConferenceSubscription.h @@ -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