Adding injectable audio decoder and encoder factory support to the RTCPeerConnection obj-c layer.
Bug: webrtc:8093 Change-Id: I868ce5f75a72c6deb065dec60784289d045ae22a Reviewed-on: https://chromium-review.googlesource.com/608981 Commit-Queue: Jeremy Newton-Smith <jeremyns@webrtc.org> Reviewed-by: Zeke Chin <tkchin@webrtc.org> Reviewed-by: Kári Tristan Helgason <kthelgason@webrtc.org> Cr-Commit-Position: refs/heads/master@{#19477}
This commit is contained in:
committed by
Commit Bot
parent
82fac89381
commit
96de428fd1
@ -310,9 +310,15 @@ if (is_ios || is_mac) {
|
|||||||
|
|
||||||
rtc_static_library("objc_peerconnectionfactory") {
|
rtc_static_library("objc_peerconnectionfactory") {
|
||||||
sources = [
|
sources = [
|
||||||
|
"objc/Framework/Classes/PeerConnection/RTCBuiltinAudioDecoderFactory.mm",
|
||||||
|
"objc/Framework/Classes/PeerConnection/RTCBuiltinAudioEncoderFactory.mm",
|
||||||
"objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory+Private.h",
|
"objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory+Private.h",
|
||||||
"objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory.mm",
|
"objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory.mm",
|
||||||
"objc/Framework/Classes/PeerConnection/RTCVideoCodecH264.mm",
|
"objc/Framework/Classes/PeerConnection/RTCVideoCodecH264.mm",
|
||||||
|
"objc/Framework/Headers/WebRTC/RTCAudioDecoderFactory.h",
|
||||||
|
"objc/Framework/Headers/WebRTC/RTCAudioEncoderFactory.h",
|
||||||
|
"objc/Framework/Headers/WebRTC/RTCBuiltinAudioDecoderFactory.h",
|
||||||
|
"objc/Framework/Headers/WebRTC/RTCBuiltinAudioEncoderFactory.h",
|
||||||
]
|
]
|
||||||
|
|
||||||
public_configs = [ ":objc_common_config" ]
|
public_configs = [ ":objc_common_config" ]
|
||||||
@ -331,6 +337,8 @@ if (is_ios || is_mac) {
|
|||||||
":objc_videotoolbox",
|
":objc_videotoolbox",
|
||||||
":objc_videotracksource",
|
":objc_videotracksource",
|
||||||
"../api:video_frame_api",
|
"../api:video_frame_api",
|
||||||
|
"../api/audio_codecs:builtin_audio_decoder_factory",
|
||||||
|
"../api/audio_codecs:builtin_audio_encoder_factory",
|
||||||
"../api/video_codecs:video_codecs_api",
|
"../api/video_codecs:video_codecs_api",
|
||||||
"../media:rtc_audio_video",
|
"../media:rtc_audio_video",
|
||||||
"../media:rtc_media_base",
|
"../media:rtc_media_base",
|
||||||
@ -569,15 +577,16 @@ if (is_ios || is_mac) {
|
|||||||
ios_framework_bundle("objc_framework") {
|
ios_framework_bundle("objc_framework") {
|
||||||
info_plist = "objc/Framework/Info.plist"
|
info_plist = "objc/Framework/Info.plist"
|
||||||
output_name = "WebRTC"
|
output_name = "WebRTC"
|
||||||
|
|
||||||
common_objc_headers = [
|
common_objc_headers = [
|
||||||
"objc/Framework/Headers/WebRTC/RTCAudioSession.h",
|
|
||||||
"objc/Framework/Headers/WebRTC/RTCVideoCodec.h",
|
|
||||||
"objc/Framework/Headers/WebRTC/RTCVideoCodecFactory.h",
|
|
||||||
"objc/Framework/Headers/WebRTC/RTCAudioSessionConfiguration.h",
|
|
||||||
"objc/Framework/Headers/WebRTC/RTCAVFoundationVideoSource.h",
|
"objc/Framework/Headers/WebRTC/RTCAVFoundationVideoSource.h",
|
||||||
|
"objc/Framework/Headers/WebRTC/RTCAudioDecoderFactory.h",
|
||||||
|
"objc/Framework/Headers/WebRTC/RTCAudioEncoderFactory.h",
|
||||||
|
"objc/Framework/Headers/WebRTC/RTCAudioSession.h",
|
||||||
|
"objc/Framework/Headers/WebRTC/RTCAudioSessionConfiguration.h",
|
||||||
"objc/Framework/Headers/WebRTC/RTCAudioSource.h",
|
"objc/Framework/Headers/WebRTC/RTCAudioSource.h",
|
||||||
"objc/Framework/Headers/WebRTC/RTCAudioTrack.h",
|
"objc/Framework/Headers/WebRTC/RTCAudioTrack.h",
|
||||||
|
"objc/Framework/Headers/WebRTC/RTCBuiltinAudioDecoderFactory.h",
|
||||||
|
"objc/Framework/Headers/WebRTC/RTCBuiltinAudioEncoderFactory.h",
|
||||||
"objc/Framework/Headers/WebRTC/RTCCameraVideoCapturer.h",
|
"objc/Framework/Headers/WebRTC/RTCCameraVideoCapturer.h",
|
||||||
"objc/Framework/Headers/WebRTC/RTCCameraPreviewView.h",
|
"objc/Framework/Headers/WebRTC/RTCCameraPreviewView.h",
|
||||||
"objc/Framework/Headers/WebRTC/RTCConfiguration.h",
|
"objc/Framework/Headers/WebRTC/RTCConfiguration.h",
|
||||||
@ -609,6 +618,8 @@ if (is_ios || is_mac) {
|
|||||||
"objc/Framework/Headers/WebRTC/RTCSessionDescription.h",
|
"objc/Framework/Headers/WebRTC/RTCSessionDescription.h",
|
||||||
"objc/Framework/Headers/WebRTC/RTCTracing.h",
|
"objc/Framework/Headers/WebRTC/RTCTracing.h",
|
||||||
"objc/Framework/Headers/WebRTC/RTCVideoCapturer.h",
|
"objc/Framework/Headers/WebRTC/RTCVideoCapturer.h",
|
||||||
|
"objc/Framework/Headers/WebRTC/RTCVideoCodec.h",
|
||||||
|
"objc/Framework/Headers/WebRTC/RTCVideoCodecFactory.h",
|
||||||
"objc/Framework/Headers/WebRTC/RTCVideoFrame.h",
|
"objc/Framework/Headers/WebRTC/RTCVideoFrame.h",
|
||||||
"objc/Framework/Headers/WebRTC/RTCVideoFrameBuffer.h",
|
"objc/Framework/Headers/WebRTC/RTCVideoFrameBuffer.h",
|
||||||
"objc/Framework/Headers/WebRTC/RTCVideoRenderer.h",
|
"objc/Framework/Headers/WebRTC/RTCVideoRenderer.h",
|
||||||
|
|||||||
@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "WebRTC/RTCBuiltinAudioDecoderFactory.h"
|
||||||
|
|
||||||
|
#include "webrtc/api/audio_codecs/builtin_audio_decoder_factory.h"
|
||||||
|
#include "webrtc/rtc_base/scoped_ref_ptr.h"
|
||||||
|
|
||||||
|
@implementation RTCBuiltinAudioDecoderFactory {
|
||||||
|
rtc::scoped_refptr<webrtc::AudioDecoderFactory> _nativeAudioDecoderFactory;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (rtc::scoped_refptr<webrtc::AudioDecoderFactory>)nativeAudioDecoderFactory {
|
||||||
|
if (_nativeAudioDecoderFactory == nullptr) {
|
||||||
|
_nativeAudioDecoderFactory = webrtc::CreateBuiltinAudioDecoderFactory();
|
||||||
|
}
|
||||||
|
return _nativeAudioDecoderFactory;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "WebRTC/RTCBuiltinAudioEncoderFactory.h"
|
||||||
|
|
||||||
|
#include "webrtc/api/audio_codecs/builtin_audio_encoder_factory.h"
|
||||||
|
#include "webrtc/rtc_base/scoped_ref_ptr.h"
|
||||||
|
|
||||||
|
@implementation RTCBuiltinAudioEncoderFactory {
|
||||||
|
rtc::scoped_refptr<webrtc::AudioEncoderFactory> _nativeAudioEncoderFactory;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (rtc::scoped_refptr<webrtc::AudioEncoderFactory>)nativeAudioEncoderFactory {
|
||||||
|
if (_nativeAudioEncoderFactory == nullptr) {
|
||||||
|
_nativeAudioEncoderFactory = webrtc::CreateBuiltinAudioEncoderFactory();
|
||||||
|
}
|
||||||
|
return _nativeAudioEncoderFactory;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
@ -19,9 +19,13 @@
|
|||||||
#import "RTCPeerConnection+Private.h"
|
#import "RTCPeerConnection+Private.h"
|
||||||
#import "RTCVideoSource+Private.h"
|
#import "RTCVideoSource+Private.h"
|
||||||
#import "RTCVideoTrack+Private.h"
|
#import "RTCVideoTrack+Private.h"
|
||||||
|
#import "WebRTC/RTCAudioDecoderFactory.h"
|
||||||
|
#import "WebRTC/RTCAudioEncoderFactory.h"
|
||||||
#import "WebRTC/RTCLogging.h"
|
#import "WebRTC/RTCLogging.h"
|
||||||
#import "WebRTC/RTCVideoCodecFactory.h"
|
#import "WebRTC/RTCVideoCodecFactory.h"
|
||||||
#ifndef HAVE_NO_MEDIA
|
#ifndef HAVE_NO_MEDIA
|
||||||
|
#import "WebRTC/RTCBuiltinAudioDecoderFactory.h"
|
||||||
|
#import "WebRTC/RTCBuiltinAudioEncoderFactory.h"
|
||||||
#import "WebRTC/RTCVideoCodecH264.h"
|
#import "WebRTC/RTCVideoCodecH264.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -47,15 +51,22 @@
|
|||||||
|
|
||||||
- (instancetype)init {
|
- (instancetype)init {
|
||||||
#ifdef HAVE_NO_MEDIA
|
#ifdef HAVE_NO_MEDIA
|
||||||
return [self initWithEncoderFactory:nil decoderFactory:nil];
|
return [self initWithAudioEncoderFactory:nil
|
||||||
|
audioDecoderFactory:nil
|
||||||
|
videoEncoderFactory:nil
|
||||||
|
videoDecoderFactory:nil];
|
||||||
#else
|
#else
|
||||||
return [self initWithEncoderFactory:[[RTCVideoEncoderFactoryH264 alloc] init]
|
return [self initWithAudioEncoderFactory:[[RTCBuiltinAudioEncoderFactory alloc] init]
|
||||||
decoderFactory:[[RTCVideoDecoderFactoryH264 alloc] init]];
|
audioDecoderFactory:[[RTCBuiltinAudioDecoderFactory alloc] init]
|
||||||
|
videoEncoderFactory:[[RTCVideoEncoderFactoryH264 alloc] init]
|
||||||
|
videoDecoderFactory:[[RTCVideoDecoderFactoryH264 alloc] init]];
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithEncoderFactory:(nullable id<RTCVideoEncoderFactory>)encoderFactory
|
- (instancetype)initWithAudioEncoderFactory:(id<RTCAudioEncoderFactory>)audioEncoderFactory
|
||||||
decoderFactory:(nullable id<RTCVideoDecoderFactory>)decoderFactory {
|
audioDecoderFactory:(id<RTCAudioDecoderFactory>)audioDecoderFactory
|
||||||
|
videoEncoderFactory:(id<RTCVideoEncoderFactory>)videoEncoderFactory
|
||||||
|
videoDecoderFactory:(id<RTCVideoDecoderFactory>)videoDecoderFactory {
|
||||||
if (self = [super init]) {
|
if (self = [super init]) {
|
||||||
_networkThread = rtc::Thread::CreateWithSocketServer();
|
_networkThread = rtc::Thread::CreateWithSocketServer();
|
||||||
BOOL result = _networkThread->Start();
|
BOOL result = _networkThread->Start();
|
||||||
@ -83,13 +94,21 @@
|
|||||||
std::unique_ptr<webrtc::CallFactoryInterface>(),
|
std::unique_ptr<webrtc::CallFactoryInterface>(),
|
||||||
std::unique_ptr<webrtc::RtcEventLogFactoryInterface>());
|
std::unique_ptr<webrtc::RtcEventLogFactoryInterface>());
|
||||||
#else
|
#else
|
||||||
cricket::WebRtcVideoEncoderFactory *platform_encoder_factory = nullptr;
|
rtc::scoped_refptr<webrtc::AudioEncoderFactory> platform_audio_encoder_factory = nullptr;
|
||||||
cricket::WebRtcVideoDecoderFactory *platform_decoder_factory = nullptr;
|
rtc::scoped_refptr<webrtc::AudioDecoderFactory> platform_audio_decoder_factory = nullptr;
|
||||||
if (encoderFactory) {
|
if (audioEncoderFactory) {
|
||||||
platform_encoder_factory = new webrtc::ObjCVideoEncoderFactory(encoderFactory);
|
platform_audio_encoder_factory = [audioEncoderFactory nativeAudioEncoderFactory];
|
||||||
}
|
}
|
||||||
if (decoderFactory) {
|
if (audioDecoderFactory) {
|
||||||
platform_decoder_factory = new webrtc::ObjCVideoDecoderFactory(decoderFactory);
|
platform_audio_decoder_factory = [audioDecoderFactory nativeAudioDecoderFactory];
|
||||||
|
}
|
||||||
|
cricket::WebRtcVideoEncoderFactory *platform_video_encoder_factory = nullptr;
|
||||||
|
cricket::WebRtcVideoDecoderFactory *platform_video_decoder_factory = nullptr;
|
||||||
|
if (videoEncoderFactory) {
|
||||||
|
platform_video_encoder_factory = new webrtc::ObjCVideoEncoderFactory(videoEncoderFactory);
|
||||||
|
}
|
||||||
|
if (videoDecoderFactory) {
|
||||||
|
platform_video_decoder_factory = new webrtc::ObjCVideoDecoderFactory(videoDecoderFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ownership of encoder/decoder factories is passed on to the
|
// Ownership of encoder/decoder factories is passed on to the
|
||||||
@ -97,9 +116,11 @@
|
|||||||
_nativeFactory = webrtc::CreatePeerConnectionFactory(_networkThread.get(),
|
_nativeFactory = webrtc::CreatePeerConnectionFactory(_networkThread.get(),
|
||||||
_workerThread.get(),
|
_workerThread.get(),
|
||||||
_signalingThread.get(),
|
_signalingThread.get(),
|
||||||
nullptr,
|
nullptr, // audio device module
|
||||||
platform_encoder_factory,
|
platform_audio_encoder_factory,
|
||||||
platform_decoder_factory);
|
platform_audio_decoder_factory,
|
||||||
|
platform_video_encoder_factory,
|
||||||
|
platform_video_decoder_factory);
|
||||||
#endif
|
#endif
|
||||||
NSAssert(_nativeFactory, @"Failed to initialize PeerConnectionFactory!");
|
NSAssert(_nativeFactory, @"Failed to initialize PeerConnectionFactory!");
|
||||||
}
|
}
|
||||||
@ -121,15 +142,12 @@
|
|||||||
return [self audioTrackWithSource:audioSource trackId:trackId];
|
return [self audioTrackWithSource:audioSource trackId:trackId];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (RTCAudioTrack *)audioTrackWithSource:(RTCAudioSource *)source
|
- (RTCAudioTrack *)audioTrackWithSource:(RTCAudioSource *)source trackId:(NSString *)trackId {
|
||||||
trackId:(NSString *)trackId {
|
return [[RTCAudioTrack alloc] initWithFactory:self source:source trackId:trackId];
|
||||||
return [[RTCAudioTrack alloc] initWithFactory:self
|
|
||||||
source:source
|
|
||||||
trackId:trackId];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (RTCAVFoundationVideoSource *)avFoundationVideoSourceWithConstraints:
|
- (RTCAVFoundationVideoSource *)avFoundationVideoSourceWithConstraints:
|
||||||
(nullable RTCMediaConstraints *)constraints {
|
(nullable RTCMediaConstraints *)constraints {
|
||||||
#ifdef HAVE_NO_MEDIA
|
#ifdef HAVE_NO_MEDIA
|
||||||
return nil;
|
return nil;
|
||||||
#else
|
#else
|
||||||
@ -146,32 +164,25 @@
|
|||||||
objcVideoTrackSource)];
|
objcVideoTrackSource)];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (RTCVideoTrack *)videoTrackWithSource:(RTCVideoSource *)source
|
- (RTCVideoTrack *)videoTrackWithSource:(RTCVideoSource *)source trackId:(NSString *)trackId {
|
||||||
trackId:(NSString *)trackId {
|
return [[RTCVideoTrack alloc] initWithFactory:self source:source trackId:trackId];
|
||||||
return [[RTCVideoTrack alloc] initWithFactory:self
|
|
||||||
source:source
|
|
||||||
trackId:trackId];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (RTCMediaStream *)mediaStreamWithStreamId:(NSString *)streamId {
|
- (RTCMediaStream *)mediaStreamWithStreamId:(NSString *)streamId {
|
||||||
return [[RTCMediaStream alloc] initWithFactory:self
|
return [[RTCMediaStream alloc] initWithFactory:self streamId:streamId];
|
||||||
streamId:streamId];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (RTCPeerConnection *)peerConnectionWithConfiguration:
|
- (RTCPeerConnection *)peerConnectionWithConfiguration:(RTCConfiguration *)configuration
|
||||||
(RTCConfiguration *)configuration
|
constraints:(RTCMediaConstraints *)constraints
|
||||||
constraints:
|
|
||||||
(RTCMediaConstraints *)constraints
|
|
||||||
delegate:
|
delegate:
|
||||||
(nullable id<RTCPeerConnectionDelegate>)delegate {
|
(nullable id<RTCPeerConnectionDelegate>)delegate {
|
||||||
return [[RTCPeerConnection alloc] initWithFactory:self
|
return [[RTCPeerConnection alloc] initWithFactory:self
|
||||||
configuration:configuration
|
configuration:configuration
|
||||||
constraints:constraints
|
constraints:constraints
|
||||||
delegate:delegate];
|
delegate:delegate];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)startAecDumpWithFilePath:(NSString *)filePath
|
- (BOOL)startAecDumpWithFilePath:(NSString *)filePath maxSizeInBytes:(int64_t)maxSizeInBytes {
|
||||||
maxSizeInBytes:(int64_t)maxSizeInBytes {
|
|
||||||
RTC_DCHECK(filePath.length);
|
RTC_DCHECK(filePath.length);
|
||||||
RTC_DCHECK_GT(maxSizeInBytes, 0);
|
RTC_DCHECK_GT(maxSizeInBytes, 0);
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
namespace rtc
|
||||||
|
{
|
||||||
|
template <class T>
|
||||||
|
class scoped_refptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace webrtc
|
||||||
|
{
|
||||||
|
class AudioDecoderFactory;
|
||||||
|
};
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@protocol RTCAudioDecoderFactory<NSObject>
|
||||||
|
|
||||||
|
@property(nonatomic, readonly) rtc::scoped_refptr<webrtc::AudioDecoderFactory>
|
||||||
|
nativeAudioDecoderFactory;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
namespace rtc
|
||||||
|
{
|
||||||
|
template <class T>
|
||||||
|
class scoped_refptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace webrtc
|
||||||
|
{
|
||||||
|
class AudioEncoderFactory;
|
||||||
|
};
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@protocol RTCAudioEncoderFactory<NSObject>
|
||||||
|
|
||||||
|
@property(nonatomic, readonly) rtc::scoped_refptr<webrtc::AudioEncoderFactory>
|
||||||
|
nativeAudioEncoderFactory;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
#import "WebRTC/RTCAudioDecoderFactory.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface RTCBuiltinAudioDecoderFactory : NSObject<RTCAudioDecoderFactory>
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
#import "WebRTC/RTCAudioEncoderFactory.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface RTCBuiltinAudioEncoderFactory : NSObject<RTCAudioEncoderFactory>
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
@ -23,6 +23,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
@class RTCPeerConnection;
|
@class RTCPeerConnection;
|
||||||
@class RTCVideoSource;
|
@class RTCVideoSource;
|
||||||
@class RTCVideoTrack;
|
@class RTCVideoTrack;
|
||||||
|
@protocol RTCAudioEncoderFactory;
|
||||||
|
@protocol RTCAudioDecoderFactory;
|
||||||
@protocol RTCPeerConnectionDelegate;
|
@protocol RTCPeerConnectionDelegate;
|
||||||
@protocol RTCVideoDecoderFactory;
|
@protocol RTCVideoDecoderFactory;
|
||||||
@protocol RTCVideoEncoderFactory;
|
@protocol RTCVideoEncoderFactory;
|
||||||
@ -30,38 +32,40 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
RTC_EXPORT
|
RTC_EXPORT
|
||||||
@interface RTCPeerConnectionFactory : NSObject
|
@interface RTCPeerConnectionFactory : NSObject
|
||||||
|
|
||||||
/* Initialize object with default H264 video encoder/decoder factories */
|
/* Initialize object with default audio and H264 video encoder/decoder factories
|
||||||
|
*/
|
||||||
- (instancetype)init;
|
- (instancetype)init;
|
||||||
|
|
||||||
/* Initialize object with injectable video encoder/decoder factories */
|
/* Initialize object with injectable audio/video encoder/decoder factories */
|
||||||
- (instancetype)initWithEncoderFactory:(nullable id<RTCVideoEncoderFactory>)encoderFactory
|
- (instancetype)initWithAudioEncoderFactory:(nullable id<RTCAudioEncoderFactory>)audioEncoderFactory
|
||||||
decoderFactory:(nullable id<RTCVideoDecoderFactory>)decoderFactory
|
audioDecoderFactory:(nullable id<RTCAudioDecoderFactory>)audioDecoderFactory
|
||||||
|
videoEncoderFactory:(nullable id<RTCVideoEncoderFactory>)videoEncoderFactory
|
||||||
|
videoDecoderFactory:(nullable id<RTCVideoDecoderFactory>)videoDecoderFactory
|
||||||
NS_DESIGNATED_INITIALIZER;
|
NS_DESIGNATED_INITIALIZER;
|
||||||
|
|
||||||
/** Initialize an RTCAudioSource with constraints. */
|
/** Initialize an RTCAudioSource with constraints. */
|
||||||
- (RTCAudioSource *)audioSourceWithConstraints:(nullable RTCMediaConstraints *)constraints;
|
- (RTCAudioSource *)audioSourceWithConstraints:(nullable RTCMediaConstraints *)constraints;
|
||||||
|
|
||||||
/** Initialize an RTCAudioTrack with an id. Convenience ctor to use an audio source with no
|
/** Initialize an RTCAudioTrack with an id. Convenience ctor to use an audio
|
||||||
* constraints.
|
* source with no constraints.
|
||||||
*/
|
*/
|
||||||
- (RTCAudioTrack *)audioTrackWithTrackId:(NSString *)trackId;
|
- (RTCAudioTrack *)audioTrackWithTrackId:(NSString *)trackId;
|
||||||
|
|
||||||
/** Initialize an RTCAudioTrack with a source and an id. */
|
/** Initialize an RTCAudioTrack with a source and an id. */
|
||||||
- (RTCAudioTrack *)audioTrackWithSource:(RTCAudioSource *)source
|
- (RTCAudioTrack *)audioTrackWithSource:(RTCAudioSource *)source trackId:(NSString *)trackId;
|
||||||
trackId:(NSString *)trackId;
|
|
||||||
|
|
||||||
/** Initialize an RTCAVFoundationVideoSource with constraints. */
|
/** Initialize an RTCAVFoundationVideoSource with constraints. */
|
||||||
- (RTCAVFoundationVideoSource *)avFoundationVideoSourceWithConstraints:
|
- (RTCAVFoundationVideoSource *)avFoundationVideoSourceWithConstraints:
|
||||||
(nullable RTCMediaConstraints *)constraints;
|
(nullable RTCMediaConstraints *)constraints;
|
||||||
|
|
||||||
/** Initialize a generic RTCVideoSource. The RTCVideoSource should be passed to a RTCVideoCapturer
|
/** Initialize a generic RTCVideoSource. The RTCVideoSource should be passed to
|
||||||
* implementation, e.g. RTCCameraVideoCapturer, in order to produce frames.
|
* a RTCVideoCapturer implementation, e.g. RTCCameraVideoCapturer, in order to
|
||||||
|
* produce frames.
|
||||||
*/
|
*/
|
||||||
- (RTCVideoSource *)videoSource;
|
- (RTCVideoSource *)videoSource;
|
||||||
|
|
||||||
/** Initialize an RTCVideoTrack with a source and an id. */
|
/** Initialize an RTCVideoTrack with a source and an id. */
|
||||||
- (RTCVideoTrack *)videoTrackWithSource:(RTCVideoSource *)source
|
- (RTCVideoTrack *)videoTrackWithSource:(RTCVideoSource *)source trackId:(NSString *)trackId;
|
||||||
trackId:(NSString *)trackId;
|
|
||||||
|
|
||||||
/** Initialize an RTCMediaStream with an id. */
|
/** Initialize an RTCMediaStream with an id. */
|
||||||
- (RTCMediaStream *)mediaStreamWithStreamId:(NSString *)streamId;
|
- (RTCMediaStream *)mediaStreamWithStreamId:(NSString *)streamId;
|
||||||
@ -69,16 +73,14 @@ RTC_EXPORT
|
|||||||
/** Initialize an RTCPeerConnection with a configuration, constraints, and
|
/** Initialize an RTCPeerConnection with a configuration, constraints, and
|
||||||
* delegate.
|
* delegate.
|
||||||
*/
|
*/
|
||||||
- (RTCPeerConnection *)peerConnectionWithConfiguration:
|
- (RTCPeerConnection *)peerConnectionWithConfiguration:(RTCConfiguration *)configuration
|
||||||
(RTCConfiguration *)configuration
|
constraints:(RTCMediaConstraints *)constraints
|
||||||
constraints:
|
|
||||||
(RTCMediaConstraints *)constraints
|
|
||||||
delegate:
|
delegate:
|
||||||
(nullable id<RTCPeerConnectionDelegate>)delegate;
|
(nullable id<RTCPeerConnectionDelegate>)delegate;
|
||||||
|
|
||||||
/** Start an AecDump recording. This API call will likely change in the future. */
|
/** Start an AecDump recording. This API call will likely change in the future.
|
||||||
- (BOOL)startAecDumpWithFilePath:(NSString *)filePath
|
*/
|
||||||
maxSizeInBytes:(int64_t)maxSizeInBytes;
|
- (BOOL)startAecDumpWithFilePath:(NSString *)filePath maxSizeInBytes:(int64_t)maxSizeInBytes;
|
||||||
|
|
||||||
/* Stop an active AecDump recording */
|
/* Stop an active AecDump recording */
|
||||||
- (void)stopAecDump;
|
- (void)stopAecDump;
|
||||||
|
|||||||
@ -9,12 +9,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#import <WebRTC/RTCAVFoundationVideoSource.h>
|
#import <WebRTC/RTCAVFoundationVideoSource.h>
|
||||||
|
#import <WebRTC/RTCAudioDecoderFactory.h>
|
||||||
|
#import <WebRTC/RTCAudioEncoderFactory.h>
|
||||||
#if TARGET_OS_IPHONE
|
#if TARGET_OS_IPHONE
|
||||||
#import <WebRTC/RTCAudioSession.h>
|
#import <WebRTC/RTCAudioSession.h>
|
||||||
#import <WebRTC/RTCAudioSessionConfiguration.h>
|
#import <WebRTC/RTCAudioSessionConfiguration.h>
|
||||||
#endif
|
#endif
|
||||||
#import <WebRTC/RTCAudioSource.h>
|
#import <WebRTC/RTCAudioSource.h>
|
||||||
#import <WebRTC/RTCAudioTrack.h>
|
#import <WebRTC/RTCAudioTrack.h>
|
||||||
|
#import <WebRTC/RTCBuiltinAudioDecoderFactory.h>
|
||||||
|
#import <WebRTC/RTCBuiltinAudioEncoderFactory.h>
|
||||||
#import <WebRTC/RTCCameraVideoCapturer.h>
|
#import <WebRTC/RTCCameraVideoCapturer.h>
|
||||||
#import <WebRTC/RTCVideoCapturer.h>
|
#import <WebRTC/RTCVideoCapturer.h>
|
||||||
#if TARGET_OS_IPHONE
|
#if TARGET_OS_IPHONE
|
||||||
|
|||||||
Reference in New Issue
Block a user