| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 } | 85 } |
| 86 | 86 |
| 87 - (BOOL)setEnabled:(BOOL)enabled { | 87 - (BOOL)setEnabled:(BOOL)enabled { |
| 88 return self.mediaTrack->set_enabled(enabled); | 88 return self.mediaTrack->set_enabled(enabled); |
| 89 } | 89 } |
| 90 | 90 |
| 91 - (RTCTrackState)state { | 91 - (RTCTrackState)state { |
| 92 return [RTCEnumConverter convertTrackStateToObjC:self.mediaTrack->state()]; | 92 return [RTCEnumConverter convertTrackStateToObjC:self.mediaTrack->state()]; |
| 93 } | 93 } |
| 94 | 94 |
| 95 - (BOOL)setState:(RTCTrackState)state { | |
| 96 return self.mediaTrack->set_state( | |
| 97 [RTCEnumConverter convertTrackStateToNative:state]); | |
| 98 } | |
| 99 | |
| 100 @end | 95 @end |
| 101 | 96 |
| 102 @implementation RTCMediaStreamTrack (Internal) | 97 @implementation RTCMediaStreamTrack (Internal) |
| 103 | 98 |
| 104 - (id)initWithMediaTrack: | 99 - (id)initWithMediaTrack: |
| 105 (rtc::scoped_refptr<webrtc::MediaStreamTrackInterface>) | 100 (rtc::scoped_refptr<webrtc::MediaStreamTrackInterface>) |
| 106 mediaTrack { | 101 mediaTrack { |
| 107 if (!mediaTrack) { | 102 if (!mediaTrack) { |
| 108 NSAssert(NO, @"nil arguments not allowed"); | 103 NSAssert(NO, @"nil arguments not allowed"); |
| 109 self = nil; | 104 self = nil; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 120 | 115 |
| 121 - (void)dealloc { | 116 - (void)dealloc { |
| 122 _mediaTrack->UnregisterObserver(_observer.get()); | 117 _mediaTrack->UnregisterObserver(_observer.get()); |
| 123 } | 118 } |
| 124 | 119 |
| 125 - (rtc::scoped_refptr<webrtc::MediaStreamTrackInterface>)mediaTrack { | 120 - (rtc::scoped_refptr<webrtc::MediaStreamTrackInterface>)mediaTrack { |
| 126 return _mediaTrack; | 121 return _mediaTrack; |
| 127 } | 122 } |
| 128 | 123 |
| 129 @end | 124 @end |
| OLD | NEW |