| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2011 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 30 matching lines...) Expand all Loading... |
| 41 virtual bool set_state(MediaStreamTrackInterface::TrackState new_state) { | 41 virtual bool set_state(MediaStreamTrackInterface::TrackState new_state) { |
| 42 bool fire_on_change = (state_ != new_state); | 42 bool fire_on_change = (state_ != new_state); |
| 43 state_ = new_state; | 43 state_ = new_state; |
| 44 if (fire_on_change) | 44 if (fire_on_change) |
| 45 Notifier<T>::FireOnChanged(); | 45 Notifier<T>::FireOnChanged(); |
| 46 return true; | 46 return true; |
| 47 } | 47 } |
| 48 | 48 |
| 49 protected: | 49 protected: |
| 50 explicit MediaStreamTrack(const std::string& id) | 50 explicit MediaStreamTrack(const std::string& id) |
| 51 : enabled_(true), | 51 : enabled_(true), id_(id), state_(MediaStreamTrackInterface::kLive) {} |
| 52 id_(id), | |
| 53 state_(MediaStreamTrackInterface::kInitializing) { | |
| 54 } | |
| 55 | 52 |
| 56 private: | 53 private: |
| 57 bool enabled_; | 54 bool enabled_; |
| 58 std::string id_; | 55 std::string id_; |
| 59 MediaStreamTrackInterface::TrackState state_; | 56 MediaStreamTrackInterface::TrackState state_; |
| 60 }; | 57 }; |
| 61 | 58 |
| 62 } // namespace webrtc | 59 } // namespace webrtc |
| 63 | 60 |
| 64 #endif // WEBRTC_API_MEDIASTREAMTRACK_H_ | 61 #endif // WEBRTC_API_MEDIASTREAMTRACK_H_ |
| OLD | NEW |