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

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

Issue 170063006: Cast: Add JS API to get raw events logs from cast extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed alpha's comments Created 6 years, 10 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
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // When the stream is stopped |stop_callback| is called. 110 // When the stream is stopped |stop_callback| is called.
111 // When there is an error |error_callback| is called with a message. 111 // When there is an error |error_callback| is called with a message.
112 void Start(const CastRtpParams& params, 112 void Start(const CastRtpParams& params,
113 const base::Closure& start_callback, 113 const base::Closure& start_callback,
114 const base::Closure& stop_callback, 114 const base::Closure& stop_callback,
115 const ErrorCallback& error_callback); 115 const ErrorCallback& error_callback);
116 116
117 // Stop encoding. 117 // Stop encoding.
118 void Stop(); 118 void Stop();
119 119
120 void SetStreamId(const int stream_id);
Alpha Left Google 2014/02/24 23:25:51 Stream ID doesn't belong to CastRtpStream.
imcheng 2014/02/25 08:10:18 See other reply
121
122 // Enables or disables logging for this stream.
123 void ToggleLogging(const bool enable);
Alpha Left Google 2014/02/24 23:25:51 nit: there's no need to make this const.
imcheng 2014/02/25 08:10:18 Done.
124
125 // Get serialized raw events for this stream and invokes |callback|
126 // with the result.
127 void GetRawEvents(base::Callback<void(scoped_ptr<std::string>)> callback);
128
120 private: 129 private:
121 // Return true if this track is an audio track. Return false if this 130 // Return true if this track is an audio track. Return false if this
122 // track is a video track. 131 // track is a video track.
123 bool IsAudio() const; 132 bool IsAudio() const;
124 133
125 void DidEncounterError(const std::string& message); 134 void DidEncounterError(const std::string& message);
126 135
127 blink::WebMediaStreamTrack track_; 136 blink::WebMediaStreamTrack track_;
128 const scoped_refptr<CastSession> cast_session_; 137 const scoped_refptr<CastSession> cast_session_;
129 scoped_ptr<CastAudioSink> audio_sink_; 138 scoped_ptr<CastAudioSink> audio_sink_;
130 scoped_ptr<CastVideoSink> video_sink_; 139 scoped_ptr<CastVideoSink> video_sink_;
131 CastRtpParams params_; 140 CastRtpParams params_;
141 int stream_id_;
132 base::WeakPtrFactory<CastRtpStream> weak_factory_; 142 base::WeakPtrFactory<CastRtpStream> weak_factory_;
133 base::Closure stop_callback_; 143 base::Closure stop_callback_;
134 ErrorCallback error_callback_; 144 ErrorCallback error_callback_;
135 145
136 DISALLOW_COPY_AND_ASSIGN(CastRtpStream); 146 DISALLOW_COPY_AND_ASSIGN(CastRtpStream);
137 }; 147 };
138 148
139 #endif // CHROME_RENDERER_MEDIA_CAST_RTP_STREAM_H_ 149 #endif // CHROME_RENDERER_MEDIA_CAST_RTP_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698