OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_RENDERER_MEDIA_CAST_RTP_STREAM_H_ | 5 #ifndef CHROME_RENDERER_MEDIA_CAST_RTP_STREAM_H_ |
6 #define CHROME_RENDERER_MEDIA_CAST_RTP_STREAM_H_ | 6 #define CHROME_RENDERER_MEDIA_CAST_RTP_STREAM_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 void Stop(); | 118 void Stop(); |
119 | 119 |
120 // Enables or disables logging for this stream. | 120 // Enables or disables logging for this stream. |
121 void ToggleLogging(bool enable); | 121 void ToggleLogging(bool enable); |
122 | 122 |
123 // Get serialized raw events for this stream and invokes |callback| | 123 // Get serialized raw events for this stream and invokes |callback| |
124 // with the result. | 124 // with the result. |
125 void GetRawEvents( | 125 void GetRawEvents( |
126 const base::Callback<void(scoped_ptr<std::string>)>& callback); | 126 const base::Callback<void(scoped_ptr<std::string>)>& callback); |
127 | 127 |
| 128 // Get stats in JSON string and invokves |callback| with the result. |
| 129 void GetStats(const base::Callback<void(scoped_ptr<std::string>)>& callback); |
| 130 |
128 private: | 131 private: |
129 // Return true if this track is an audio track. Return false if this | 132 // Return true if this track is an audio track. Return false if this |
130 // track is a video track. | 133 // track is a video track. |
131 bool IsAudio() const; | 134 bool IsAudio() const; |
132 | 135 |
133 void DidEncounterError(const std::string& message); | 136 void DidEncounterError(const std::string& message); |
134 | 137 |
135 blink::WebMediaStreamTrack track_; | 138 blink::WebMediaStreamTrack track_; |
136 const scoped_refptr<CastSession> cast_session_; | 139 const scoped_refptr<CastSession> cast_session_; |
137 scoped_ptr<CastAudioSink> audio_sink_; | 140 scoped_ptr<CastAudioSink> audio_sink_; |
138 scoped_ptr<CastVideoSink> video_sink_; | 141 scoped_ptr<CastVideoSink> video_sink_; |
139 CastRtpParams params_; | 142 CastRtpParams params_; |
140 base::WeakPtrFactory<CastRtpStream> weak_factory_; | 143 base::WeakPtrFactory<CastRtpStream> weak_factory_; |
141 base::Closure stop_callback_; | 144 base::Closure stop_callback_; |
142 ErrorCallback error_callback_; | 145 ErrorCallback error_callback_; |
143 | 146 |
144 DISALLOW_COPY_AND_ASSIGN(CastRtpStream); | 147 DISALLOW_COPY_AND_ASSIGN(CastRtpStream); |
145 }; | 148 }; |
146 | 149 |
147 #endif // CHROME_RENDERER_MEDIA_CAST_RTP_STREAM_H_ | 150 #endif // CHROME_RENDERER_MEDIA_CAST_RTP_STREAM_H_ |
OLD | NEW |