blob: edda892e502f9bf806980f14d1e6cc708c26aad3 [file] [log] [blame]
tkchind4bfbfc2016-08-30 11:56:05 -07001/*
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020011#import "RTCMediaSource.h"
tkchind4bfbfc2016-08-30 11:56:05 -070012
Steve Anton10542f22019-01-11 09:11:00 -080013#include "api/media_stream_interface.h"
tkchind4bfbfc2016-08-30 11:56:05 -070014
15NS_ASSUME_NONNULL_BEGIN
16
Mirko Bonadeia81e9c82020-05-04 16:14:32 +020017@class RTC_OBJC_TYPE(RTCPeerConnectionFactory);
Yura Yaroshevich01cee072018-07-11 15:35:40 +030018
tkchind4bfbfc2016-08-30 11:56:05 -070019typedef NS_ENUM(NSInteger, RTCMediaSourceType) {
20 RTCMediaSourceTypeAudio,
21 RTCMediaSourceTypeVideo,
22};
23
Mirko Bonadeia81e9c82020-05-04 16:14:32 +020024@interface RTC_OBJC_TYPE (RTCMediaSource)
25()
tkchind4bfbfc2016-08-30 11:56:05 -070026
Mirko Bonadeia81e9c82020-05-04 16:14:32 +020027 @property(nonatomic,
28 readonly) rtc::scoped_refptr<webrtc::MediaSourceInterface> nativeMediaSource;
tkchind4bfbfc2016-08-30 11:56:05 -070029
Mirko Bonadeia81e9c82020-05-04 16:14:32 +020030- (instancetype)initWithFactory:(RTC_OBJC_TYPE(RTCPeerConnectionFactory) *)factory
Yura Yaroshevich01cee072018-07-11 15:35:40 +030031 nativeMediaSource:(rtc::scoped_refptr<webrtc::MediaSourceInterface>)nativeMediaSource
32 type:(RTCMediaSourceType)type NS_DESIGNATED_INITIALIZER;
tkchind4bfbfc2016-08-30 11:56:05 -070033
Yves Gerey665174f2018-06-19 15:03:05 +020034+ (webrtc::MediaSourceInterface::SourceState)nativeSourceStateForState:(RTCSourceState)state;
tkchind4bfbfc2016-08-30 11:56:05 -070035
Yves Gerey665174f2018-06-19 15:03:05 +020036+ (RTCSourceState)sourceStateForNativeState:(webrtc::MediaSourceInterface::SourceState)nativeState;
tkchind4bfbfc2016-08-30 11:56:05 -070037
38+ (NSString *)stringForState:(RTCSourceState)state;
39
40@end
41
42NS_ASSUME_NONNULL_END