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

Side by Side Diff: webrtc/api/mediastreamtrack.h

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/mediastreaminterface.h ('k') | webrtc/api/objc/RTCMediaStreamTrack.h » ('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 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
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_
OLDNEW
« no previous file with comments | « webrtc/api/mediastreaminterface.h ('k') | webrtc/api/objc/RTCMediaStreamTrack.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698