OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 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 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 if (self = [super init]) { | 60 if (self = [super init]) { |
61 _nativeTrack = nativeTrack; | 61 _nativeTrack = nativeTrack; |
62 _type = type; | 62 _type = type; |
63 } | 63 } |
64 return self; | 64 return self; |
65 } | 65 } |
66 | 66 |
67 + (webrtc::MediaStreamTrackInterface::TrackState)nativeTrackStateForState: | 67 + (webrtc::MediaStreamTrackInterface::TrackState)nativeTrackStateForState: |
68 (RTCMediaStreamTrackState)state { | 68 (RTCMediaStreamTrackState)state { |
69 switch (state) { | 69 switch (state) { |
70 case RTCMediaStreamTrackStateInitializing: | |
71 return webrtc::MediaStreamTrackInterface::kInitializing; | |
72 case RTCMediaStreamTrackStateLive: | 70 case RTCMediaStreamTrackStateLive: |
73 return webrtc::MediaStreamTrackInterface::kLive; | 71 return webrtc::MediaStreamTrackInterface::kLive; |
74 case RTCMediaStreamTrackStateEnded: | 72 case RTCMediaStreamTrackStateEnded: |
75 return webrtc::MediaStreamTrackInterface::kEnded; | 73 return webrtc::MediaStreamTrackInterface::kEnded; |
76 case RTCMediaStreamTrackStateFailed: | |
77 return webrtc::MediaStreamTrackInterface::kFailed; | |
78 } | 74 } |
79 } | 75 } |
80 | 76 |
81 + (RTCMediaStreamTrackState)trackStateForNativeState: | 77 + (RTCMediaStreamTrackState)trackStateForNativeState: |
82 (webrtc::MediaStreamTrackInterface::TrackState)nativeState { | 78 (webrtc::MediaStreamTrackInterface::TrackState)nativeState { |
83 switch (nativeState) { | 79 switch (nativeState) { |
84 case webrtc::MediaStreamTrackInterface::kInitializing: | |
85 return RTCMediaStreamTrackStateInitializing; | |
86 case webrtc::MediaStreamTrackInterface::kLive: | 80 case webrtc::MediaStreamTrackInterface::kLive: |
87 return RTCMediaStreamTrackStateLive; | 81 return RTCMediaStreamTrackStateLive; |
88 case webrtc::MediaStreamTrackInterface::kEnded: | 82 case webrtc::MediaStreamTrackInterface::kEnded: |
89 return RTCMediaStreamTrackStateEnded; | 83 return RTCMediaStreamTrackStateEnded; |
90 case webrtc::MediaStreamTrackInterface::kFailed: | |
91 return RTCMediaStreamTrackStateFailed; | |
92 } | 84 } |
93 } | 85 } |
94 | 86 |
95 + (NSString *)stringForState:(RTCMediaStreamTrackState)state { | 87 + (NSString *)stringForState:(RTCMediaStreamTrackState)state { |
96 switch (state) { | 88 switch (state) { |
97 case RTCMediaStreamTrackStateInitializing: | |
98 return @"Initializing"; | |
99 case RTCMediaStreamTrackStateLive: | 89 case RTCMediaStreamTrackStateLive: |
100 return @"Live"; | 90 return @"Live"; |
101 case RTCMediaStreamTrackStateEnded: | 91 case RTCMediaStreamTrackStateEnded: |
102 return @"Ended"; | 92 return @"Ended"; |
103 case RTCMediaStreamTrackStateFailed: | |
104 return @"Failed"; | |
105 } | 93 } |
106 } | 94 } |
107 | 95 |
108 @end | 96 @end |
OLD | NEW |