Skip to content
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

Add RtcpReceivingSession support to C API #1029

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions include/rtc/rtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ RTC_C_EXPORT int rtcGetTrackDescription(int tr, char *buffer, int size);
RTC_C_EXPORT int rtcGetTrackMid(int tr, char *buffer, int size);
RTC_C_EXPORT int rtcGetTrackDirection(int tr, rtcDirection *direction);

RTC_C_EXPORT int rtcSendTrackRequestKeyframe(int tr);
paullouisageneau marked this conversation as resolved.
Show resolved Hide resolved
RTC_C_EXPORT int rtcSendTrackRequestBitrate(int tr, unsigned int bitrate);
paullouisageneau marked this conversation as resolved.
Show resolved Hide resolved

#if RTC_ENABLE_MEDIA

// Media
Expand Down Expand Up @@ -364,6 +367,9 @@ RTC_C_EXPORT int rtcSetOpusPacketizationHandler(int tr, const rtcPacketizationHa
// Set AACPacketizationHandler for track
RTC_C_EXPORT int rtcSetAACPacketizationHandler(int tr, const rtcPacketizationHandlerInit *init);

// Set RtcpReceivingSession for track
RTC_C_EXPORT int rtcSetRtcpReceivingSession(int tr);
paullouisageneau marked this conversation as resolved.
Show resolved Hide resolved

// Chain RtcpSrReporter to handler chain for given track
RTC_C_EXPORT int rtcChainRtcpSrReporter(int tr);

Expand Down
25 changes: 25 additions & 0 deletions src/capi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1144,6 +1144,22 @@ int rtcGetTrackDirection(int tr, rtcDirection *direction) {
});
}

int rtcSendTrackRequestKeyframe(int tr) {
paullouisageneau marked this conversation as resolved.
Show resolved Hide resolved
return wrap([&] {
auto track = getTrack(tr);
track->requestKeyframe();
return RTC_ERR_SUCCESS;
});
}

int rtcSendTrackRequestBitrate(int tr, unsigned int bitrate) {
paullouisageneau marked this conversation as resolved.
Show resolved Hide resolved
return wrap([&] {
auto track = getTrack(tr);
track->requestBitrate(bitrate);
return RTC_ERR_SUCCESS;
});
}

#if RTC_ENABLE_MEDIA

void setSSRC(Description::Media *description, uint32_t ssrc, const char *_name, const char *_msid,
Expand Down Expand Up @@ -1276,6 +1292,15 @@ int rtcSetAACPacketizationHandler(int tr, const rtcPacketizationHandlerInit *ini
});
}

int rtcSetRtcpReceivingSession(int tr) {
paullouisageneau marked this conversation as resolved.
Show resolved Hide resolved
return wrap([&] {
auto track = getTrack(tr);
auto session = std::make_shared<rtc::RtcpReceivingSession>();
track->setMediaHandler(session);
paullouisageneau marked this conversation as resolved.
Show resolved Hide resolved
return RTC_ERR_SUCCESS;
});
}

int rtcChainRtcpSrReporter(int tr) {
return wrap([&] {
auto track = getTrack(tr);
Expand Down
Loading