diff --git a/include/rtc/rtc.h b/include/rtc/rtc.h index 55b26d3fa..464d9ceb1 100644 --- a/include/rtc/rtc.h +++ b/include/rtc/rtc.h @@ -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 rtcRequestKeyframe(int tr); +RTC_C_EXPORT int rtcRequestBitrate(int tr, unsigned int bitrate); + #if RTC_ENABLE_MEDIA // Media @@ -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 rtcChainRtcpReceivingSession(int tr); + // Chain RtcpSrReporter to handler chain for given track RTC_C_EXPORT int rtcChainRtcpSrReporter(int tr); diff --git a/src/capi.cpp b/src/capi.cpp index ce0cb77f6..54a5b4edb 100644 --- a/src/capi.cpp +++ b/src/capi.cpp @@ -1144,6 +1144,22 @@ int rtcGetTrackDirection(int tr, rtcDirection *direction) { }); } +int rtcRequestKeyframe(int tr) { + return wrap([&] { + auto track = getTrack(tr); + track->requestKeyframe(); + return RTC_ERR_SUCCESS; + }); +} + +int rtcRequestBitrate(int tr, unsigned int bitrate) { + 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, @@ -1276,6 +1292,15 @@ int rtcSetAACPacketizationHandler(int tr, const rtcPacketizationHandlerInit *ini }); } +int rtcChainRtcpReceivingSession(int tr) { + return wrap([&] { + auto track = getTrack(tr); + auto session = std::make_shared(); + track->chainMediaHandler(session); + return RTC_ERR_SUCCESS; + }); +} + int rtcChainRtcpSrReporter(int tr) { return wrap([&] { auto track = getTrack(tr);