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

Side by Side Diff: webrtc/api/objc/RTCMediaStreamTrack.mm

Issue 1790633002: Propagate MediaStreamSource state to video tracks the same way as audio. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@refactor_track
Patch Set: Fix bug with wrong enum values. Created 4 years, 9 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 | « webrtc/api/objc/RTCMediaStreamTrack.h ('k') | webrtc/api/rtpreceiver.cc » ('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 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
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
OLDNEW
« no previous file with comments | « webrtc/api/objc/RTCMediaStreamTrack.h ('k') | webrtc/api/rtpreceiver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698