Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(610)

Side by Side Diff: webrtc/examples/objc/AppRTCDemo/ARDAppClient.m

Issue 2283743003: Add local capturer on mac (Closed)
Patch Set: rebase to master Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/examples/objc/AppRTCDemo/mac/APPRTCAppDelegate.m » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2014 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #import "ARDAppClient+Internal.h" 11 #import "ARDAppClient+Internal.h"
12 12
13 #if defined(WEBRTC_IOS)
14 #import "WebRTC/RTCAVFoundationVideoSource.h" 13 #import "WebRTC/RTCAVFoundationVideoSource.h"
15 #endif
16 #import "WebRTC/RTCAudioTrack.h" 14 #import "WebRTC/RTCAudioTrack.h"
17 #import "WebRTC/RTCConfiguration.h" 15 #import "WebRTC/RTCConfiguration.h"
18 #import "WebRTC/RTCFileLogger.h" 16 #import "WebRTC/RTCFileLogger.h"
19 #import "WebRTC/RTCIceServer.h" 17 #import "WebRTC/RTCIceServer.h"
20 #import "WebRTC/RTCLogging.h" 18 #import "WebRTC/RTCLogging.h"
21 #import "WebRTC/RTCMediaConstraints.h" 19 #import "WebRTC/RTCMediaConstraints.h"
22 #import "WebRTC/RTCMediaStream.h" 20 #import "WebRTC/RTCMediaStream.h"
23 #import "WebRTC/RTCPeerConnectionFactory.h" 21 #import "WebRTC/RTCPeerConnectionFactory.h"
24 #import "WebRTC/RTCRtpSender.h" 22 #import "WebRTC/RTCRtpSender.h"
25 #import "WebRTC/RTCTracing.h" 23 #import "WebRTC/RTCTracing.h"
(...skipping 20 matching lines...) Expand all
46 static NSInteger const kARDAppClientErrorUnknown = -1; 44 static NSInteger const kARDAppClientErrorUnknown = -1;
47 static NSInteger const kARDAppClientErrorRoomFull = -2; 45 static NSInteger const kARDAppClientErrorRoomFull = -2;
48 static NSInteger const kARDAppClientErrorCreateSDP = -3; 46 static NSInteger const kARDAppClientErrorCreateSDP = -3;
49 static NSInteger const kARDAppClientErrorSetSDP = -4; 47 static NSInteger const kARDAppClientErrorSetSDP = -4;
50 static NSInteger const kARDAppClientErrorInvalidClient = -5; 48 static NSInteger const kARDAppClientErrorInvalidClient = -5;
51 static NSInteger const kARDAppClientErrorInvalidRoom = -6; 49 static NSInteger const kARDAppClientErrorInvalidRoom = -6;
52 static NSString * const kARDMediaStreamId = @"ARDAMS"; 50 static NSString * const kARDMediaStreamId = @"ARDAMS";
53 static NSString * const kARDAudioTrackId = @"ARDAMSa0"; 51 static NSString * const kARDAudioTrackId = @"ARDAMSa0";
54 static NSString * const kARDVideoTrackId = @"ARDAMSv0"; 52 static NSString * const kARDVideoTrackId = @"ARDAMSv0";
55 53
56 // TODO(tkchin): Remove guard once rtc_sdk_common_objc compiles on Mac.
57 #if defined(WEBRTC_IOS)
58 // TODO(tkchin): Add these as UI options. 54 // TODO(tkchin): Add these as UI options.
59 static BOOL const kARDAppClientEnableTracing = NO; 55 static BOOL const kARDAppClientEnableTracing = NO;
60 static BOOL const kARDAppClientEnableRtcEventLog = YES; 56 static BOOL const kARDAppClientEnableRtcEventLog = YES;
61 static int64_t const kARDAppClientAecDumpMaxSizeInBytes = 5e6; // 5 MB. 57 static int64_t const kARDAppClientAecDumpMaxSizeInBytes = 5e6; // 5 MB.
62 static int64_t const kARDAppClientRtcEventLogMaxSizeInBytes = 5e6; // 5 MB. 58 static int64_t const kARDAppClientRtcEventLogMaxSizeInBytes = 5e6; // 5 MB.
63 #endif
64 59
65 // We need a proxy to NSTimer because it causes a strong retain cycle. When 60 // We need a proxy to NSTimer because it causes a strong retain cycle. When
66 // using the proxy, |invalidate| must be called before it properly deallocs. 61 // using the proxy, |invalidate| must be called before it properly deallocs.
67 @interface ARDTimerProxy : NSObject 62 @interface ARDTimerProxy : NSObject
68 63
69 - (instancetype)initWithInterval:(NSTimeInterval)interval 64 - (instancetype)initWithInterval:(NSTimeInterval)interval
70 repeats:(BOOL)repeats 65 repeats:(BOOL)repeats
71 timerHandler:(void (^)(void))timerHandler; 66 timerHandler:(void (^)(void))timerHandler;
72 - (void)invalidate; 67 - (void)invalidate;
73 68
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 streamId:kARDMediaStreamId]; 686 streamId:kARDMediaStreamId];
692 sender.track = track; 687 sender.track = track;
693 return sender; 688 return sender;
694 } 689 }
695 690
696 - (RTCVideoTrack *)createLocalVideoTrack { 691 - (RTCVideoTrack *)createLocalVideoTrack {
697 RTCVideoTrack* localVideoTrack = nil; 692 RTCVideoTrack* localVideoTrack = nil;
698 // The iOS simulator doesn't provide any sort of camera capture 693 // The iOS simulator doesn't provide any sort of camera capture
699 // support or emulation (http://goo.gl/rHAnC1) so don't bother 694 // support or emulation (http://goo.gl/rHAnC1) so don't bother
700 // trying to open a local stream. 695 // trying to open a local stream.
701 // TODO(tkchin): local video capture for OSX. See 696 #if !TARGET_IPHONE_SIMULATOR
702 // https://code.google.com/p/webrtc/issues/detail?id=3417.
703 #if !TARGET_IPHONE_SIMULATOR && TARGET_OS_IPHONE
704 if (!_isAudioOnly) { 697 if (!_isAudioOnly) {
705 RTCMediaConstraints *mediaConstraints = 698 RTCMediaConstraints *mediaConstraints =
706 [self defaultMediaStreamConstraints]; 699 [self defaultMediaStreamConstraints];
707 RTCAVFoundationVideoSource *source = 700 RTCAVFoundationVideoSource *source =
708 [_factory avFoundationVideoSourceWithConstraints:mediaConstraints]; 701 [_factory avFoundationVideoSourceWithConstraints:mediaConstraints];
709 localVideoTrack = 702 localVideoTrack =
710 [_factory videoTrackWithSource:source 703 [_factory videoTrackWithSource:source
711 trackId:kARDVideoTrackId]; 704 trackId:kARDVideoTrackId];
712 } 705 }
713 #endif 706 #endif
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 code:kARDAppClientErrorInvalidRoom 837 code:kARDAppClientErrorInvalidRoom
845 userInfo:@{ 838 userInfo:@{
846 NSLocalizedDescriptionKey: @"Invalid room.", 839 NSLocalizedDescriptionKey: @"Invalid room.",
847 }]; 840 }];
848 break; 841 break;
849 } 842 }
850 return error; 843 return error;
851 } 844 }
852 845
853 @end 846 @end
OLDNEW
« no previous file with comments | « no previous file | webrtc/examples/objc/AppRTCDemo/mac/APPRTCAppDelegate.m » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698