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

Commit 535f946

Browse files
authored
webrtc stack changes for native SDK optimizations (#137)
1 parent 7c5ceac commit 535f946

40 files changed

+374
-86
lines changed

api/ice_transport_factory.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <memory>
1414
#include <utility>
1515

16+
#include "api/media_types.h"
1617
#include "p2p/base/ice_transport_internal.h"
1718
#include "p2p/base/p2p_transport_channel.h"
1819
#include "p2p/base/port_allocator.h"
@@ -59,7 +60,7 @@ rtc::scoped_refptr<IceTransportInterface> CreateIceTransport(
5960
IceTransportInit init) {
6061
return new rtc::RefCountedObject<IceTransportWithTransportChannel>(
6162
std::make_unique<cricket::P2PTransportChannel>(
62-
"", 0, init.port_allocator(), init.async_resolver_factory(),
63+
"", cricket::MediaType::MEDIA_TYPE_AUDIO, 0, init.port_allocator(), init.async_resolver_factory(),
6364
init.event_log()));
6465
}
6566

api/ice_transport_interface.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <string>
1515

1616
#include "api/async_resolver_factory.h"
17+
#include "api/media_types.h"
1718
#include "api/rtc_error.h"
1819
#include "api/rtc_event_log/rtc_event_log.h"
1920
#include "api/scoped_refptr.h"
@@ -87,6 +88,7 @@ class IceTransportFactory {
8788
// peer connection should offer transports compatible with these assumptions.
8889
virtual rtc::scoped_refptr<IceTransportInterface> CreateIceTransport(
8990
const std::string& transport_name,
91+
cricket::MediaType media_type,
9092
int component,
9193
IceTransportInit init) = 0;
9294
};

api/media_types.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ namespace cricket {
1717
const char kMediaTypeVideo[] = "video";
1818
const char kMediaTypeAudio[] = "audio";
1919
const char kMediaTypeData[] = "data";
20+
const char kMediaTypeScreen[] = "screen";
2021

2122
std::string MediaTypeToString(MediaType type) {
2223
switch (type) {

api/media_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ enum MediaType {
2424
MEDIA_TYPE_AUDIO,
2525
MEDIA_TYPE_VIDEO,
2626
MEDIA_TYPE_DATA,
27+
MEDIA_TYPE_SCREEN,
2728
MEDIA_TYPE_UNSUPPORTED
2829
};
2930

3031
extern const char kMediaTypeAudio[];
3132
extern const char kMediaTypeVideo[];
3233
extern const char kMediaTypeData[];
34+
extern const char kMediaTypeScreen[];
3335

3436
RTC_EXPORT std::string MediaTypeToString(MediaType type);
3537

api/stats/rtcstats_objects.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ class RTC_EXPORT RTCInboundRTPStreamStats final : public RTCRTPStreamStats {
458458
RTCStatsMember<uint32_t> frame_bit_depth;
459459
RTCStatsMember<double> frames_per_second;
460460
RTCStatsMember<uint32_t> frames_decoded;
461+
RTCStatsMember<uint32_t> frames_rendered;
461462
RTCStatsMember<uint32_t> key_frames_decoded;
462463
RTCStatsMember<uint32_t> frames_dropped;
463464
RTCStatsMember<double> total_decode_time;

api/stats_types.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,8 @@ const char* StatsReport::Value::display_name() const {
401401
return "datachannelid";
402402
case kStatsValueNameFramesDecoded:
403403
return "framesDecoded";
404+
case kStatsValueNameFramesRendered:
405+
return "framesRendered";
404406
case kStatsValueNameFramesEncoded:
405407
return "framesEncoded";
406408
case kStatsValueNameJitterBufferDelay:

api/stats_types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ class RTC_EXPORT StatsReport {
108108
kStatsValueNameConcealmentEvents,
109109
kStatsValueNameDataChannelId,
110110
kStatsValueNameFramesDecoded,
111+
kStatsValueNameFramesRendered,
111112
kStatsValueNameFramesEncoded,
112113
kStatsValueNameJitterBufferDelay,
113114
kStatsValueNameMediaType,

api/video_codecs/video_encoder.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ VideoCodecVP9 VideoEncoder::GetDefaultVp9Settings() {
3939
vp9_settings.numberOfTemporalLayers = 1;
4040
vp9_settings.denoisingOn = true;
4141
vp9_settings.frameDroppingOn = true;
42-
vp9_settings.keyFrameInterval = 3000;
42+
vp9_settings.keyFrameInterval = 60;
4343
vp9_settings.adaptiveQpMode = true;
4444
vp9_settings.automaticResizeOn = true;
4545
vp9_settings.numberOfSpatialLayers = 1;

media/engine/constants.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ namespace cricket {
1515
const int kVideoMtu = 1200;
1616
const int kVideoRtpSendBufferSize = 65536;
1717
const int kVideoRtpRecvBufferSize = 262144;
18+
const int kVideoRtpBufferSizeIncreased = 4 * 1024 * 1024;
1819

1920
} // namespace cricket

media/engine/constants.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ namespace cricket {
1616
extern const int kVideoMtu;
1717
extern const int kVideoRtpSendBufferSize;
1818
extern const int kVideoRtpRecvBufferSize;
19+
extern const int kVideoRtpBufferSizeIncreased;
1920

2021
} // namespace cricket
2122

0 commit comments

Comments
 (0)