RTC_OBJC_TYPE RTCWrappedNativeVideo{Decoder,Encoder}.
Some versionss of WebKit.framework export these symbols. Even if they are private symbols, WebRTC needs to provide a way to prefix them like the OBJC API symbols (see [1]). [1] - https://webrtc-review.googlesource.com/c/src/+/173781 Bug: None Change-Id: Ibb9ca2c89796a0d5e2ca65c549ba8799f24bbe7c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/182421 Commit-Queue: Kári Helgason <kthelgason@webrtc.org> Reviewed-by: Kári Helgason <kthelgason@webrtc.org> Cr-Commit-Position: refs/heads/master@{#31987}
This commit is contained in:

committed by
Commit Bot

parent
cccd55094d
commit
5923083657
@ -11,6 +11,7 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "RTCMacros.h"
|
||||
#import "RTCVideoDecoderVP8.h"
|
||||
#import "RTCWrappedNativeVideoDecoder.h"
|
||||
|
||||
@ -19,7 +20,7 @@
|
||||
@implementation RTC_OBJC_TYPE (RTCVideoDecoderVP8)
|
||||
|
||||
+ (id<RTC_OBJC_TYPE(RTCVideoDecoder)>)vp8Decoder {
|
||||
return [[RTCWrappedNativeVideoDecoder alloc]
|
||||
return [[RTC_OBJC_TYPE(RTCWrappedNativeVideoDecoder) alloc]
|
||||
initWithNativeDecoder:std::unique_ptr<webrtc::VideoDecoder>(webrtc::VP8Decoder::Create())];
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "RTCMacros.h"
|
||||
#import "RTCVideoDecoderVP9.h"
|
||||
#import "RTCWrappedNativeVideoDecoder.h"
|
||||
|
||||
@ -19,7 +20,7 @@
|
||||
@implementation RTC_OBJC_TYPE (RTCVideoDecoderVP9)
|
||||
|
||||
+ (id<RTC_OBJC_TYPE(RTCVideoDecoder)>)vp9Decoder {
|
||||
return [[RTCWrappedNativeVideoDecoder alloc]
|
||||
return [[RTC_OBJC_TYPE(RTCWrappedNativeVideoDecoder) alloc]
|
||||
initWithNativeDecoder:std::unique_ptr<webrtc::VideoDecoder>(webrtc::VP9Decoder::Create())];
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "RTCMacros.h"
|
||||
#import "RTCVideoEncoderVP8.h"
|
||||
#import "RTCWrappedNativeVideoEncoder.h"
|
||||
|
||||
@ -19,7 +20,7 @@
|
||||
@implementation RTC_OBJC_TYPE (RTCVideoEncoderVP8)
|
||||
|
||||
+ (id<RTC_OBJC_TYPE(RTCVideoEncoder)>)vp8Encoder {
|
||||
return [[RTCWrappedNativeVideoEncoder alloc]
|
||||
return [[RTC_OBJC_TYPE(RTCWrappedNativeVideoEncoder) alloc]
|
||||
initWithNativeEncoder:std::unique_ptr<webrtc::VideoEncoder>(webrtc::VP8Encoder::Create())];
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "RTCMacros.h"
|
||||
#import "RTCVideoEncoderVP9.h"
|
||||
#import "RTCWrappedNativeVideoEncoder.h"
|
||||
|
||||
@ -19,7 +20,7 @@
|
||||
@implementation RTC_OBJC_TYPE (RTCVideoEncoderVP9)
|
||||
|
||||
+ (id<RTC_OBJC_TYPE(RTCVideoEncoder)>)vp9Encoder {
|
||||
return [[RTCWrappedNativeVideoEncoder alloc]
|
||||
return [[RTC_OBJC_TYPE(RTCWrappedNativeVideoEncoder) alloc]
|
||||
initWithNativeEncoder:std::unique_ptr<webrtc::VideoEncoder>(webrtc::VP9Encoder::Create())];
|
||||
}
|
||||
|
||||
|
@ -10,12 +10,13 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "base/RTCMacros.h"
|
||||
#import "base/RTCVideoDecoder.h"
|
||||
|
||||
#include "api/video_codecs/video_decoder.h"
|
||||
#include "media/base/codec.h"
|
||||
|
||||
@interface RTCWrappedNativeVideoDecoder : NSObject <RTC_OBJC_TYPE (RTCVideoDecoder)>
|
||||
@interface RTC_OBJC_TYPE (RTCWrappedNativeVideoDecoder) : NSObject <RTC_OBJC_TYPE (RTCVideoDecoder)>
|
||||
|
||||
- (instancetype)initWithNativeDecoder:(std::unique_ptr<webrtc::VideoDecoder>)decoder;
|
||||
|
||||
|
@ -11,9 +11,10 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "RTCWrappedNativeVideoDecoder.h"
|
||||
#import "base/RTCMacros.h"
|
||||
#import "helpers/NSString+StdString.h"
|
||||
|
||||
@implementation RTCWrappedNativeVideoDecoder {
|
||||
@implementation RTC_OBJC_TYPE (RTCWrappedNativeVideoDecoder) {
|
||||
std::unique_ptr<webrtc::VideoDecoder> _wrappedDecoder;
|
||||
}
|
||||
|
||||
|
@ -10,13 +10,14 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "base/RTCMacros.h"
|
||||
#import "base/RTCVideoEncoder.h"
|
||||
|
||||
#include "api/video_codecs/sdp_video_format.h"
|
||||
#include "api/video_codecs/video_encoder.h"
|
||||
#include "media/base/codec.h"
|
||||
|
||||
@interface RTCWrappedNativeVideoEncoder : NSObject <RTC_OBJC_TYPE (RTCVideoEncoder)>
|
||||
@interface RTC_OBJC_TYPE (RTCWrappedNativeVideoEncoder) : NSObject <RTC_OBJC_TYPE (RTCVideoEncoder)>
|
||||
|
||||
- (instancetype)initWithNativeEncoder:(std::unique_ptr<webrtc::VideoEncoder>)encoder;
|
||||
|
||||
|
@ -11,9 +11,10 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "RTCWrappedNativeVideoEncoder.h"
|
||||
#import "base/RTCMacros.h"
|
||||
#import "helpers/NSString+StdString.h"
|
||||
|
||||
@implementation RTCWrappedNativeVideoEncoder {
|
||||
@implementation RTC_OBJC_TYPE (RTCWrappedNativeVideoEncoder) {
|
||||
std::unique_ptr<webrtc::VideoEncoder> _wrappedEncoder;
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
#include "sdk/objc/native/src/objc_video_decoder_factory.h"
|
||||
|
||||
#import "base/RTCMacros.h"
|
||||
#import "base/RTCVideoDecoder.h"
|
||||
#import "base/RTCVideoDecoderFactory.h"
|
||||
#import "base/RTCVideoFrame.h"
|
||||
@ -98,8 +99,8 @@ std::unique_ptr<VideoDecoder> ObjCVideoDecoderFactory::CreateVideoDecoder(
|
||||
if ([codecName isEqualToString:codecInfo.name]) {
|
||||
id<RTC_OBJC_TYPE(RTCVideoDecoder)> decoder = [decoder_factory_ createDecoder:codecInfo];
|
||||
|
||||
if ([decoder isKindOfClass:[RTCWrappedNativeVideoDecoder class]]) {
|
||||
return [(RTCWrappedNativeVideoDecoder *)decoder releaseWrappedDecoder];
|
||||
if ([decoder isKindOfClass:[RTC_OBJC_TYPE(RTCWrappedNativeVideoDecoder) class]]) {
|
||||
return [(RTC_OBJC_TYPE(RTCWrappedNativeVideoDecoder) *)decoder releaseWrappedDecoder];
|
||||
} else {
|
||||
return std::unique_ptr<ObjCVideoDecoder>(new ObjCVideoDecoder(decoder));
|
||||
}
|
||||
|
@ -175,8 +175,8 @@ std::unique_ptr<VideoEncoder> ObjCVideoEncoderFactory::CreateVideoEncoder(
|
||||
RTC_OBJC_TYPE(RTCVideoCodecInfo) *info =
|
||||
[[RTC_OBJC_TYPE(RTCVideoCodecInfo) alloc] initWithNativeSdpVideoFormat:format];
|
||||
id<RTC_OBJC_TYPE(RTCVideoEncoder)> encoder = [encoder_factory_ createEncoder:info];
|
||||
if ([encoder isKindOfClass:[RTCWrappedNativeVideoEncoder class]]) {
|
||||
return [(RTCWrappedNativeVideoEncoder *)encoder releaseWrappedEncoder];
|
||||
if ([encoder isKindOfClass:[RTC_OBJC_TYPE(RTCWrappedNativeVideoEncoder) class]]) {
|
||||
return [(RTC_OBJC_TYPE(RTCWrappedNativeVideoEncoder) *)encoder releaseWrappedEncoder];
|
||||
} else {
|
||||
return std::unique_ptr<ObjCVideoEncoder>(new ObjCVideoEncoder(encoder));
|
||||
}
|
||||
|
Reference in New Issue
Block a user