diff --git a/sdk/objc/api/peerconnection/RTCPeerConnection+Stats.mm b/sdk/objc/api/peerconnection/RTCPeerConnection+Stats.mm index 46a6e3c780..8ded55200e 100644 --- a/sdk/objc/api/peerconnection/RTCPeerConnection+Stats.mm +++ b/sdk/objc/api/peerconnection/RTCPeerConnection+Stats.mm @@ -28,7 +28,8 @@ class StatsCollectorCallbackAdapter : public RTCStatsCollectorCallback { void OnStatsDelivered(const rtc::scoped_refptr &report) override { RTC_DCHECK(completion_handler_); - RTCStatisticsReport *statisticsReport = [[RTCStatisticsReport alloc] initWithReport:*report]; + RTC_OBJC_TYPE(RTCStatisticsReport) *statisticsReport = + [[RTC_OBJC_TYPE(RTCStatisticsReport) alloc] initWithReport:*report]; completion_handler_(statisticsReport); completion_handler_ = nil; } diff --git a/sdk/objc/api/peerconnection/RTCPeerConnection.h b/sdk/objc/api/peerconnection/RTCPeerConnection.h index cfc0a3d824..bb8d87bc2d 100644 --- a/sdk/objc/api/peerconnection/RTCPeerConnection.h +++ b/sdk/objc/api/peerconnection/RTCPeerConnection.h @@ -25,7 +25,7 @@ @class RTC_OBJC_TYPE(RTCRtpTransceiver); @class RTC_OBJC_TYPE(RTCRtpTransceiverInit); @class RTC_OBJC_TYPE(RTCSessionDescription); -@class RTCStatisticsReport; +@class RTC_OBJC_TYPE(RTCStatisticsReport); @class RTC_OBJC_TYPE(RTCLegacyStatsReport); typedef NS_ENUM(NSInteger, RTCRtpMediaType); @@ -341,7 +341,7 @@ RTC_OBJC_EXPORT @end -typedef void (^RTCStatisticsCompletionHandler)(RTCStatisticsReport *); +typedef void (^RTCStatisticsCompletionHandler)(RTC_OBJC_TYPE(RTCStatisticsReport) *); @interface RTC_OBJC_TYPE (RTCPeerConnection) (Stats) diff --git a/sdk/objc/api/peerconnection/RTCStatisticsReport+Private.h b/sdk/objc/api/peerconnection/RTCStatisticsReport+Private.h index 0220d186b7..47c5241d51 100644 --- a/sdk/objc/api/peerconnection/RTCStatisticsReport+Private.h +++ b/sdk/objc/api/peerconnection/RTCStatisticsReport+Private.h @@ -12,8 +12,8 @@ #include "api/stats/rtc_stats_report.h" -@interface RTCStatisticsReport (Private) +@interface RTC_OBJC_TYPE (RTCStatisticsReport) (Private) -- (instancetype)initWithReport:(const webrtc::RTCStatsReport &)report; +- (instancetype)initWithReport : (const webrtc::RTCStatsReport &)report; @end diff --git a/sdk/objc/api/peerconnection/RTCStatisticsReport.h b/sdk/objc/api/peerconnection/RTCStatisticsReport.h index 6fbd59b112..38d93e8771 100644 --- a/sdk/objc/api/peerconnection/RTCStatisticsReport.h +++ b/sdk/objc/api/peerconnection/RTCStatisticsReport.h @@ -10,25 +10,29 @@ #import -@class RTCStatistics; +#import "RTCMacros.h" + +@class RTC_OBJC_TYPE(RTCStatistics); NS_ASSUME_NONNULL_BEGIN /** A statistics report. Encapsulates a number of RTCStatistics objects. */ -@interface RTCStatisticsReport : NSObject +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCStatisticsReport) : NSObject /** The timestamp of the report in microseconds since 1970-01-01T00:00:00Z. */ @property(nonatomic, readonly) CFTimeInterval timestamp_us; /** RTCStatistics objects by id. */ -@property(nonatomic, readonly) NSDictionary *statistics; +@property(nonatomic, readonly) NSDictionary *statistics; - (instancetype)init NS_UNAVAILABLE; @end /** A part of a report (a subreport) covering a certain area. */ -@interface RTCStatistics : NSObject +RTC_OBJC_EXPORT +@interface RTC_OBJC_TYPE (RTCStatistics) : NSObject /** The id of this subreport, e.g. "RTCMediaStreamTrack_receiver_2". */ @property(nonatomic, readonly) NSString *id; diff --git a/sdk/objc/api/peerconnection/RTCStatisticsReport.mm b/sdk/objc/api/peerconnection/RTCStatisticsReport.mm index 526976707d..ab8006d9bd 100644 --- a/sdk/objc/api/peerconnection/RTCStatisticsReport.mm +++ b/sdk/objc/api/peerconnection/RTCStatisticsReport.mm @@ -100,7 +100,7 @@ NSObject *ValueFromStatsMember(const RTCStatsMemberInterface *member) { } } // namespace webrtc -@implementation RTCStatistics +@implementation RTC_OBJC_TYPE (RTCStatistics) @synthesize id = _id; @synthesize timestamp_us = _timestamp_us; @@ -139,7 +139,7 @@ NSObject *ValueFromStatsMember(const RTCStatsMemberInterface *member) { @end -@implementation RTCStatisticsReport +@implementation RTC_OBJC_TYPE (RTCStatisticsReport) @synthesize timestamp_us = _timestamp_us; @synthesize statistics = _statistics; @@ -151,16 +151,17 @@ NSObject *ValueFromStatsMember(const RTCStatsMemberInterface *member) { @end -@implementation RTCStatisticsReport (Private) +@implementation RTC_OBJC_TYPE (RTCStatisticsReport) (Private) -- (instancetype)initWithReport:(const webrtc::RTCStatsReport &)report { +- (instancetype)initWithReport : (const webrtc::RTCStatsReport &)report { if (self = [super init]) { _timestamp_us = report.timestamp_us(); NSMutableDictionary *statisticsById = [NSMutableDictionary dictionaryWithCapacity:report.size()]; for (const auto &stat : report) { - RTCStatistics *statistics = [[RTCStatistics alloc] initWithStatistics:stat]; + RTC_OBJC_TYPE(RTCStatistics) *statistics = + [[RTC_OBJC_TYPE(RTCStatistics) alloc] initWithStatistics:stat]; statisticsById[statistics.id] = statistics; } _statistics = [statisticsById copy];