Renamed RTCStatsReport to RTCLegacyStatsReport in objc files.
This is to avoid a naming conflict with webrtc::RTCStatsReport that is surfaced if you try to include it in peerconnectioninterface.h. Background: The current stats is very much non-spec-compliant. A new stats collection API is underway that is meant to be spec-compliant. Some classes in Chromium and webrtc/sdk/objc have spec-compliant names but non-spec-compliant behavior. These are being renamed to "Legacy" so that new spec-compliant classes can be added with the correct names. BUG=chromium:627816 TBR=tkchin@webrtc.org NOTRY=True Review-Url: https://codereview.webrtc.org/2313943002 Cr-Commit-Position: refs/heads/master@{#14150}
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class RTCStatsReport;
|
||||
@class RTCLegacyStatsReport;
|
||||
|
||||
/** Class used to accumulate stats information into a single displayable string.
|
||||
*/
|
||||
@ -24,6 +24,6 @@
|
||||
/** Parses the information in the stats report into an appropriate internal
|
||||
* format used to generate the stats string.
|
||||
*/
|
||||
- (void)parseStatsReport:(RTCStatsReport *)statsReport;
|
||||
- (void)parseStatsReport:(RTCLegacyStatsReport *)statsReport;
|
||||
|
||||
@end
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
#import "ARDStatsBuilder.h"
|
||||
|
||||
#import "WebRTC/RTCStatsReport.h"
|
||||
#import "WebRTC/RTCLegacyStatsReport.h"
|
||||
|
||||
#import "ARDBitrateTracker.h"
|
||||
#import "ARDUtilities.h"
|
||||
@ -129,7 +129,7 @@
|
||||
return result;
|
||||
}
|
||||
|
||||
- (void)parseStatsReport:(RTCStatsReport *)statsReport {
|
||||
- (void)parseStatsReport:(RTCLegacyStatsReport *)statsReport {
|
||||
NSString *reportType = statsReport.type;
|
||||
if ([reportType isEqualToString:@"ssrc"] &&
|
||||
[statsReport.reportId rangeOfString:@"ssrc"].location != NSNotFound) {
|
||||
@ -148,7 +148,7 @@
|
||||
|
||||
#pragma mark - Private
|
||||
|
||||
- (void)parseBweStatsReport:(RTCStatsReport *)statsReport {
|
||||
- (void)parseBweStatsReport:(RTCLegacyStatsReport *)statsReport {
|
||||
[statsReport.values enumerateKeysAndObjectsUsingBlock:^(
|
||||
NSString *key, NSString *value, BOOL *stop) {
|
||||
if ([key isEqualToString:@"googAvailableSendBandwidth"]) {
|
||||
@ -167,7 +167,7 @@
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)parseConnectionStatsReport:(RTCStatsReport *)statsReport {
|
||||
- (void)parseConnectionStatsReport:(RTCLegacyStatsReport *)statsReport {
|
||||
NSString *activeConnection = statsReport.values[@"googActiveConnection"];
|
||||
if (![activeConnection isEqualToString:@"true"]) {
|
||||
return;
|
||||
@ -194,7 +194,7 @@
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)parseSendSsrcStatsReport:(RTCStatsReport *)statsReport {
|
||||
- (void)parseSendSsrcStatsReport:(RTCLegacyStatsReport *)statsReport {
|
||||
NSDictionary *values = statsReport.values;
|
||||
if ([values objectForKey:@"googFrameRateSent"]) {
|
||||
// Video track.
|
||||
@ -205,7 +205,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)parseAudioSendStatsReport:(RTCStatsReport *)statsReport {
|
||||
- (void)parseAudioSendStatsReport:(RTCLegacyStatsReport *)statsReport {
|
||||
[statsReport.values enumerateKeysAndObjectsUsingBlock:^(
|
||||
NSString *key, NSString *value, BOOL *stop) {
|
||||
if ([key isEqualToString:@"googCodecName"]) {
|
||||
@ -218,7 +218,7 @@
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)parseVideoSendStatsReport:(RTCStatsReport *)statsReport {
|
||||
- (void)parseVideoSendStatsReport:(RTCLegacyStatsReport *)statsReport {
|
||||
[statsReport.values enumerateKeysAndObjectsUsingBlock:^(
|
||||
NSString *key, NSString *value, BOOL *stop) {
|
||||
if ([key isEqualToString:@"googCodecName"]) {
|
||||
@ -245,7 +245,7 @@
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)parseRecvSsrcStatsReport:(RTCStatsReport *)statsReport {
|
||||
- (void)parseRecvSsrcStatsReport:(RTCLegacyStatsReport *)statsReport {
|
||||
NSDictionary *values = statsReport.values;
|
||||
if ([values objectForKey:@"googFrameWidthReceived"]) {
|
||||
// Video track.
|
||||
@ -256,7 +256,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)parseAudioRecvStatsReport:(RTCStatsReport *)statsReport {
|
||||
- (void)parseAudioRecvStatsReport:(RTCLegacyStatsReport *)statsReport {
|
||||
[statsReport.values enumerateKeysAndObjectsUsingBlock:^(
|
||||
NSString *key, NSString *value, BOOL *stop) {
|
||||
if ([key isEqualToString:@"googCodecName"]) {
|
||||
@ -273,7 +273,7 @@
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)parseVideoRecvStatsReport:(RTCStatsReport *)statsReport {
|
||||
- (void)parseVideoRecvStatsReport:(RTCLegacyStatsReport *)statsReport {
|
||||
[statsReport.values enumerateKeysAndObjectsUsingBlock:^(
|
||||
NSString *key, NSString *value, BOOL *stop) {
|
||||
if ([key isEqualToString:@"googFrameHeightReceived"]) {
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
#import "ARDStatsView.h"
|
||||
|
||||
#import "WebRTC/RTCStatsReport.h"
|
||||
#import "WebRTC/RTCLegacyStatsReport.h"
|
||||
|
||||
#import "ARDStatsBuilder.h"
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
}
|
||||
|
||||
- (void)setStats:(NSArray *)stats {
|
||||
for (RTCStatsReport *report in stats) {
|
||||
for (RTCLegacyStatsReport *report in stats) {
|
||||
[_statsBuilder parseStatsReport:report];
|
||||
}
|
||||
_statsLabel.text = _statsBuilder.statsString;
|
||||
|
||||
@ -81,6 +81,8 @@ if (is_ios || (is_mac && mac_deployment_target == "10.7")) {
|
||||
"objc/Framework/Classes/RTCIceCandidate.mm",
|
||||
"objc/Framework/Classes/RTCIceServer+Private.h",
|
||||
"objc/Framework/Classes/RTCIceServer.mm",
|
||||
"objc/Framework/Classes/RTCLegacyStatsReport+Private.h",
|
||||
"objc/Framework/Classes/RTCLegacyStatsReport.mm",
|
||||
"objc/Framework/Classes/RTCMediaConstraints+Private.h",
|
||||
"objc/Framework/Classes/RTCMediaConstraints.mm",
|
||||
"objc/Framework/Classes/RTCMediaSource+Private.h",
|
||||
@ -113,8 +115,6 @@ if (is_ios || (is_mac && mac_deployment_target == "10.7")) {
|
||||
"objc/Framework/Classes/RTCShader+Private.h",
|
||||
"objc/Framework/Classes/RTCShader.h",
|
||||
"objc/Framework/Classes/RTCShader.mm",
|
||||
"objc/Framework/Classes/RTCStatsReport+Private.h",
|
||||
"objc/Framework/Classes/RTCStatsReport.mm",
|
||||
"objc/Framework/Classes/RTCVideoFrame+Private.h",
|
||||
"objc/Framework/Classes/RTCVideoFrame.mm",
|
||||
"objc/Framework/Classes/RTCVideoRendererAdapter+Private.h",
|
||||
@ -134,6 +134,7 @@ if (is_ios || (is_mac && mac_deployment_target == "10.7")) {
|
||||
"objc/Framework/Headers/WebRTC/RTCDataChannelConfiguration.h",
|
||||
"objc/Framework/Headers/WebRTC/RTCIceCandidate.h",
|
||||
"objc/Framework/Headers/WebRTC/RTCIceServer.h",
|
||||
"objc/Framework/Headers/WebRTC/RTCLegacyStatsReport.h",
|
||||
"objc/Framework/Headers/WebRTC/RTCMediaConstraints.h",
|
||||
"objc/Framework/Headers/WebRTC/RTCMediaSource.h",
|
||||
"objc/Framework/Headers/WebRTC/RTCMediaStream.h",
|
||||
@ -146,7 +147,6 @@ if (is_ios || (is_mac && mac_deployment_target == "10.7")) {
|
||||
"objc/Framework/Headers/WebRTC/RTCRtpReceiver.h",
|
||||
"objc/Framework/Headers/WebRTC/RTCRtpSender.h",
|
||||
"objc/Framework/Headers/WebRTC/RTCSessionDescription.h",
|
||||
"objc/Framework/Headers/WebRTC/RTCStatsReport.h",
|
||||
"objc/Framework/Headers/WebRTC/RTCVideoFrame.h",
|
||||
"objc/Framework/Headers/WebRTC/RTCVideoRenderer.h",
|
||||
"objc/Framework/Headers/WebRTC/RTCVideoSource.h",
|
||||
|
||||
@ -8,15 +8,15 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "WebRTC/RTCStatsReport.h"
|
||||
#import "WebRTC/RTCLegacyStatsReport.h"
|
||||
|
||||
#include "webrtc/api/statstypes.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RTCStatsReport ()
|
||||
@interface RTCLegacyStatsReport ()
|
||||
|
||||
/** Initialize an RTCStatsReport object from a native StatsReport. */
|
||||
/** Initialize an RTCLegacyStatsReport object from a native StatsReport. */
|
||||
- (instancetype)initWithNativeReport:(const webrtc::StatsReport &)nativeReport;
|
||||
|
||||
@end
|
||||
@ -8,14 +8,14 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#import "RTCStatsReport+Private.h"
|
||||
#import "RTCLegacyStatsReport+Private.h"
|
||||
|
||||
#import "NSString+StdString.h"
|
||||
#import "WebRTC/RTCLogging.h"
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
|
||||
@implementation RTCStatsReport
|
||||
@implementation RTCLegacyStatsReport
|
||||
|
||||
@synthesize timestamp = _timestamp;
|
||||
@synthesize type = _type;
|
||||
@ -23,7 +23,7 @@
|
||||
@synthesize values = _values;
|
||||
|
||||
- (NSString *)description {
|
||||
return [NSString stringWithFormat:@"RTCStatsReport:\n%@\n%@\n%f\n%@",
|
||||
return [NSString stringWithFormat:@"RTCLegacyStatsReport:\n%@\n%@\n%f\n%@",
|
||||
_reportId,
|
||||
_type,
|
||||
_timestamp,
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
#import "NSString+StdString.h"
|
||||
#import "RTCMediaStreamTrack+Private.h"
|
||||
#import "RTCStatsReport+Private.h"
|
||||
#import "RTCLegacyStatsReport+Private.h"
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
|
||||
@ -21,7 +21,7 @@ namespace webrtc {
|
||||
class StatsObserverAdapter : public StatsObserver {
|
||||
public:
|
||||
StatsObserverAdapter(void (^completionHandler)
|
||||
(NSArray<RTCStatsReport *> *stats)) {
|
||||
(NSArray<RTCLegacyStatsReport *> *stats)) {
|
||||
completion_handler_ = completionHandler;
|
||||
}
|
||||
|
||||
@ -33,8 +33,8 @@ class StatsObserverAdapter : public StatsObserver {
|
||||
RTC_DCHECK(completion_handler_);
|
||||
NSMutableArray *stats = [NSMutableArray arrayWithCapacity:reports.size()];
|
||||
for (const auto* report : reports) {
|
||||
RTCStatsReport *statsReport =
|
||||
[[RTCStatsReport alloc] initWithNativeReport:*report];
|
||||
RTCLegacyStatsReport *statsReport =
|
||||
[[RTCLegacyStatsReport alloc] initWithNativeReport:*report];
|
||||
[stats addObject:statsReport];
|
||||
}
|
||||
completion_handler_(stats);
|
||||
@ -42,7 +42,7 @@ class StatsObserverAdapter : public StatsObserver {
|
||||
}
|
||||
|
||||
private:
|
||||
void (^completion_handler_)(NSArray<RTCStatsReport *> *stats);
|
||||
void (^completion_handler_)(NSArray<RTCLegacyStatsReport *> *stats);
|
||||
};
|
||||
} // namespace webrtc
|
||||
|
||||
@ -51,7 +51,7 @@ class StatsObserverAdapter : public StatsObserver {
|
||||
- (void)statsForTrack:(RTCMediaStreamTrack *)mediaStreamTrack
|
||||
statsOutputLevel:(RTCStatsOutputLevel)statsOutputLevel
|
||||
completionHandler:
|
||||
(void (^)(NSArray<RTCStatsReport *> *stats))completionHandler {
|
||||
(void (^)(NSArray<RTCLegacyStatsReport *> *stats))completionHandler {
|
||||
rtc::scoped_refptr<webrtc::StatsObserverAdapter> observer(
|
||||
new rtc::RefCountedObject<webrtc::StatsObserverAdapter>
|
||||
(completionHandler));
|
||||
|
||||
@ -14,13 +14,13 @@
|
||||
#import "RTCConfiguration+Private.h"
|
||||
#import "RTCDataChannel+Private.h"
|
||||
#import "RTCIceCandidate+Private.h"
|
||||
#import "RTCLegacyStatsReport+Private.h"
|
||||
#import "RTCMediaConstraints+Private.h"
|
||||
#import "RTCMediaStream+Private.h"
|
||||
#import "RTCPeerConnectionFactory+Private.h"
|
||||
#import "RTCRtpReceiver+Private.h"
|
||||
#import "RTCRtpSender+Private.h"
|
||||
#import "RTCSessionDescription+Private.h"
|
||||
#import "RTCStatsReport+Private.h"
|
||||
#import "WebRTC/RTCLogging.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/** This does not currently conform to the spec. */
|
||||
RTC_EXPORT
|
||||
@interface RTCStatsReport : NSObject
|
||||
@interface RTCLegacyStatsReport : NSObject
|
||||
|
||||
/** Time since 1970-01-01T00:00:00Z in milliseconds. */
|
||||
@property(nonatomic, readonly) CFTimeInterval timestamp;
|
||||
@ -23,7 +23,7 @@
|
||||
@class RTCRtpReceiver;
|
||||
@class RTCRtpSender;
|
||||
@class RTCSessionDescription;
|
||||
@class RTCStatsReport;
|
||||
@class RTCLegacyStatsReport;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@ -217,7 +217,7 @@ RTC_EXPORT
|
||||
(nullable RTCMediaStreamTrack *)mediaStreamTrack
|
||||
statsOutputLevel:(RTCStatsOutputLevel)statsOutputLevel
|
||||
completionHandler:
|
||||
(nullable void (^)(NSArray<RTCStatsReport *> *stats))completionHandler;
|
||||
(nullable void (^)(NSArray<RTCLegacyStatsReport *> *stats))completionHandler;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
#import <WebRTC/RTCFileLogger.h>
|
||||
#import <WebRTC/RTCIceCandidate.h>
|
||||
#import <WebRTC/RTCIceServer.h>
|
||||
#import <WebRTC/RTCLegacyStatsReport.h>
|
||||
#import <WebRTC/RTCLogging.h>
|
||||
#import <WebRTC/RTCMacros.h>
|
||||
#import <WebRTC/RTCMediaConstraints.h>
|
||||
@ -38,7 +39,6 @@
|
||||
#import <WebRTC/RTCRtpSender.h>
|
||||
#import <WebRTC/RTCSSLAdapter.h>
|
||||
#import <WebRTC/RTCSessionDescription.h>
|
||||
#import <WebRTC/RTCStatsReport.h>
|
||||
#import <WebRTC/RTCTracing.h>
|
||||
#import <WebRTC/RTCVideoFrame.h>
|
||||
#import <WebRTC/RTCVideoRenderer.h>
|
||||
|
||||
@ -123,6 +123,8 @@
|
||||
'objc/Framework/Classes/RTCIceCandidate.mm',
|
||||
'objc/Framework/Classes/RTCIceServer+Private.h',
|
||||
'objc/Framework/Classes/RTCIceServer.mm',
|
||||
'objc/Framework/Classes/RTCLegacyStatsReport+Private.h',
|
||||
'objc/Framework/Classes/RTCLegacyStatsReport.mm',
|
||||
'objc/Framework/Classes/RTCMediaConstraints+Private.h',
|
||||
'objc/Framework/Classes/RTCMediaConstraints.mm',
|
||||
'objc/Framework/Classes/RTCMediaSource+Private.h',
|
||||
@ -155,8 +157,6 @@
|
||||
'objc/Framework/Classes/RTCShader+Private.h',
|
||||
'objc/Framework/Classes/RTCShader.h',
|
||||
'objc/Framework/Classes/RTCShader.mm',
|
||||
'objc/Framework/Classes/RTCStatsReport+Private.h',
|
||||
'objc/Framework/Classes/RTCStatsReport.mm',
|
||||
'objc/Framework/Classes/RTCVideoFrame+Private.h',
|
||||
'objc/Framework/Classes/RTCVideoFrame.mm',
|
||||
'objc/Framework/Classes/RTCVideoRendererAdapter+Private.h',
|
||||
@ -176,6 +176,7 @@
|
||||
'objc/Framework/Headers/WebRTC/RTCDataChannelConfiguration.h',
|
||||
'objc/Framework/Headers/WebRTC/RTCIceCandidate.h',
|
||||
'objc/Framework/Headers/WebRTC/RTCIceServer.h',
|
||||
'objc/Framework/Headers/WebRTC/RTCLegacyStatsReport.h',
|
||||
'objc/Framework/Headers/WebRTC/RTCMediaConstraints.h',
|
||||
'objc/Framework/Headers/WebRTC/RTCMediaSource.h',
|
||||
'objc/Framework/Headers/WebRTC/RTCMediaStream.h',
|
||||
@ -188,7 +189,6 @@
|
||||
'objc/Framework/Headers/WebRTC/RTCRtpReceiver.h',
|
||||
'objc/Framework/Headers/WebRTC/RTCRtpSender.h',
|
||||
'objc/Framework/Headers/WebRTC/RTCSessionDescription.h',
|
||||
'objc/Framework/Headers/WebRTC/RTCStatsReport.h',
|
||||
'objc/Framework/Headers/WebRTC/RTCVideoFrame.h',
|
||||
'objc/Framework/Headers/WebRTC/RTCVideoRenderer.h',
|
||||
'objc/Framework/Headers/WebRTC/RTCVideoSource.h',
|
||||
@ -268,6 +268,7 @@
|
||||
'objc/Framework/Headers/WebRTC/RTCFileLogger.h',
|
||||
'objc/Framework/Headers/WebRTC/RTCIceCandidate.h',
|
||||
'objc/Framework/Headers/WebRTC/RTCIceServer.h',
|
||||
'objc/Framework/Headers/WebRTC/RTCLegacyStatsReport.h',
|
||||
'objc/Framework/Headers/WebRTC/RTCLogging.h',
|
||||
'objc/Framework/Headers/WebRTC/RTCMacros.h',
|
||||
'objc/Framework/Headers/WebRTC/RTCMediaConstraints.h',
|
||||
@ -286,7 +287,6 @@
|
||||
'objc/Framework/Headers/WebRTC/RTCRtpSender.h',
|
||||
'objc/Framework/Headers/WebRTC/RTCSessionDescription.h',
|
||||
'objc/Framework/Headers/WebRTC/RTCSSLAdapter.h',
|
||||
'objc/Framework/Headers/WebRTC/RTCStatsReport.h',
|
||||
'objc/Framework/Headers/WebRTC/RTCTracing.h',
|
||||
'objc/Framework/Headers/WebRTC/RTCVideoFrame.h',
|
||||
'objc/Framework/Headers/WebRTC/RTCVideoRenderer.h',
|
||||
|
||||
Reference in New Issue
Block a user