Skip to content

fix: transceiver id. #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 7, 2023
Merged
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
2 changes: 2 additions & 0 deletions include/rtc_rtp_transceiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ class RTCRtpTransceiver : public RefCountInterface {

virtual void SetCodecPreferences(
vector<scoped_refptr<RTCRtpCodecCapability>> codecs) = 0;

virtual const string transceiver_id() const = 0;
};

} // namespace libwebrtc
Expand Down
8 changes: 8 additions & 0 deletions src/rtc_rtp_transceiver_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <src/rtc_rtp_receiver_impl.h>
#include <src/rtc_rtp_sender_impl.h>

#include <sstream>

namespace libwebrtc {

LIB_WEBRTC_API scoped_refptr<RTCRtpTransceiverInit>
Expand Down Expand Up @@ -160,4 +162,10 @@ void RTCRtpTransceiverImpl::SetCodecPreferences(
rtp_transceiver_->SetCodecPreferences(list);
}

const string RTCRtpTransceiverImpl::transceiver_id() const {
std::stringstream ss;
ss << "transceiver_" << rtp_transceiver_.get();
return ss.str();
}

} // namespace libwebrtc
2 changes: 1 addition & 1 deletion src/rtc_rtp_transceiver_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class RTCRtpTransceiverImpl : public RTCRtpTransceiver {
virtual void StopInternal() override;
virtual void SetCodecPreferences(
vector<scoped_refptr<RTCRtpCodecCapability>> codecs) override;

virtual const string transceiver_id() const override;
rtc::scoped_refptr<webrtc::RtpTransceiverInterface> rtp_transceiver();

private:
Expand Down