| 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 |
| 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 { | 18 namespace base { |
| 19 class BinaryValue; |
| 19 class DictionaryValue; | 20 class DictionaryValue; |
| 20 } | 21 } |
| 21 | 22 |
| 22 class CastAudioSink; | 23 class CastAudioSink; |
| 23 class CastSession; | 24 class CastSession; |
| 24 class CastVideoSink; | 25 class CastVideoSink; |
| 25 | 26 |
| 26 // A key value pair structure for codec specific parameters. | 27 // A key value pair structure for codec specific parameters. |
| 27 struct CastCodecSpecificParams { | 28 struct CastCodecSpecificParams { |
| 28 std::string key; | 29 std::string key; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 121 |
| 121 // Stop encoding. | 122 // Stop encoding. |
| 122 void Stop(); | 123 void Stop(); |
| 123 | 124 |
| 124 // Enables or disables logging for this stream. | 125 // Enables or disables logging for this stream. |
| 125 void ToggleLogging(bool enable); | 126 void ToggleLogging(bool enable); |
| 126 | 127 |
| 127 // Get serialized raw events for this stream and invokes |callback| | 128 // Get serialized raw events for this stream and invokes |callback| |
| 128 // with the result. | 129 // with the result. |
| 129 void GetRawEvents( | 130 void GetRawEvents( |
| 130 const base::Callback<void(scoped_ptr<std::string>)>& callback); | 131 const base::Callback<void(scoped_ptr<base::BinaryValue>)>& callback); |
| 131 | 132 |
| 132 // Get stats in DictionaryValue format and invokves |callback| with | 133 // Get stats in DictionaryValue format and invokves |callback| with |
| 133 // the result. | 134 // the result. |
| 134 void GetStats(const base::Callback<void( | 135 void GetStats(const base::Callback<void( |
| 135 scoped_ptr<base::DictionaryValue>)>& callback); | 136 scoped_ptr<base::DictionaryValue>)>& callback); |
| 136 | 137 |
| 137 private: | 138 private: |
| 138 // Return true if this track is an audio track. Return false if this | 139 // Return true if this track is an audio track. Return false if this |
| 139 // track is a video track. | 140 // track is a video track. |
| 140 bool IsAudio() const; | 141 bool IsAudio() const; |
| 141 | 142 |
| 142 void DidEncounterError(const std::string& message); | 143 void DidEncounterError(const std::string& message); |
| 143 | 144 |
| 144 blink::WebMediaStreamTrack track_; | 145 blink::WebMediaStreamTrack track_; |
| 145 const scoped_refptr<CastSession> cast_session_; | 146 const scoped_refptr<CastSession> cast_session_; |
| 146 scoped_ptr<CastAudioSink> audio_sink_; | 147 scoped_ptr<CastAudioSink> audio_sink_; |
| 147 scoped_ptr<CastVideoSink> video_sink_; | 148 scoped_ptr<CastVideoSink> video_sink_; |
| 148 CastRtpParams params_; | 149 CastRtpParams params_; |
| 149 base::WeakPtrFactory<CastRtpStream> weak_factory_; | 150 base::WeakPtrFactory<CastRtpStream> weak_factory_; |
| 150 base::Closure stop_callback_; | 151 base::Closure stop_callback_; |
| 151 ErrorCallback error_callback_; | 152 ErrorCallback error_callback_; |
| 152 | 153 |
| 153 DISALLOW_COPY_AND_ASSIGN(CastRtpStream); | 154 DISALLOW_COPY_AND_ASSIGN(CastRtpStream); |
| 154 }; | 155 }; |
| 155 | 156 |
| 156 #endif // CHROME_RENDERER_MEDIA_CAST_RTP_STREAM_H_ | 157 #endif // CHROME_RENDERER_MEDIA_CAST_RTP_STREAM_H_ |
| OLD | NEW |