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

Side by Side Diff: chrome/renderer/media/cast_rtp_stream.h

Issue 184853003: Cast: Add GetStats() extensions API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add missing include Created 6 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
OLDNEW
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
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" 16 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
17 17
18 namespace base {
19 class DictionaryValue;
20 }
21
18 class CastAudioSink; 22 class CastAudioSink;
19 class CastSession; 23 class CastSession;
20 class CastVideoSink; 24 class CastVideoSink;
21 25
22 // A key value pair structure for codec specific parameters. 26 // A key value pair structure for codec specific parameters.
23 struct CastCodecSpecificParams { 27 struct CastCodecSpecificParams {
24 std::string key; 28 std::string key;
25 std::string value; 29 std::string value;
26 30
27 CastCodecSpecificParams(); 31 CastCodecSpecificParams();
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 void Stop(); 122 void Stop();
119 123
120 // Enables or disables logging for this stream. 124 // Enables or disables logging for this stream.
121 void ToggleLogging(bool enable); 125 void ToggleLogging(bool enable);
122 126
123 // Get serialized raw events for this stream and invokes |callback| 127 // Get serialized raw events for this stream and invokes |callback|
124 // with the result. 128 // with the result.
125 void GetRawEvents( 129 void GetRawEvents(
126 const base::Callback<void(scoped_ptr<std::string>)>& callback); 130 const base::Callback<void(scoped_ptr<std::string>)>& callback);
127 131
132 // Get stats in DictionaryValue format and invokves |callback| with
133 // the result.
134 void GetStats(const base::Callback<void(
135 scoped_ptr<base::DictionaryValue>)>& callback);
136
128 private: 137 private:
129 // Return true if this track is an audio track. Return false if this 138 // Return true if this track is an audio track. Return false if this
130 // track is a video track. 139 // track is a video track.
131 bool IsAudio() const; 140 bool IsAudio() const;
132 141
133 void DidEncounterError(const std::string& message); 142 void DidEncounterError(const std::string& message);
134 143
135 blink::WebMediaStreamTrack track_; 144 blink::WebMediaStreamTrack track_;
136 const scoped_refptr<CastSession> cast_session_; 145 const scoped_refptr<CastSession> cast_session_;
137 scoped_ptr<CastAudioSink> audio_sink_; 146 scoped_ptr<CastAudioSink> audio_sink_;
138 scoped_ptr<CastVideoSink> video_sink_; 147 scoped_ptr<CastVideoSink> video_sink_;
139 CastRtpParams params_; 148 CastRtpParams params_;
140 base::WeakPtrFactory<CastRtpStream> weak_factory_; 149 base::WeakPtrFactory<CastRtpStream> weak_factory_;
141 base::Closure stop_callback_; 150 base::Closure stop_callback_;
142 ErrorCallback error_callback_; 151 ErrorCallback error_callback_;
143 152
144 DISALLOW_COPY_AND_ASSIGN(CastRtpStream); 153 DISALLOW_COPY_AND_ASSIGN(CastRtpStream);
145 }; 154 };
146 155
147 #endif // CHROME_RENDERER_MEDIA_CAST_RTP_STREAM_H_ 156 #endif // CHROME_RENDERER_MEDIA_CAST_RTP_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698