| 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 #include "chrome/renderer/media/cast_session_delegate.h" | 5 #include "chrome/renderer/media/cast_session_delegate.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 10 #include "chrome/common/chrome_version_info.h" | 10 #include "chrome/common/chrome_version_info.h" |
| 11 #include "chrome/renderer/media/cast_threads.h" | 11 #include "chrome/renderer/media/cast_threads.h" |
| 12 #include "chrome/renderer/media/cast_transport_sender_ipc.h" | 12 #include "chrome/renderer/media/cast_transport_sender_ipc.h" |
| 13 #include "content/public/renderer/render_thread.h" | 13 #include "content/public/renderer/render_thread.h" |
| 14 #include "media/cast/cast_config.h" | 14 #include "media/cast/cast_config.h" |
| 15 #include "media/cast/cast_environment.h" | 15 #include "media/cast/cast_environment.h" |
| 16 #include "media/cast/cast_sender.h" | 16 #include "media/cast/cast_sender.h" |
| 17 #include "media/cast/logging/log_serializer.h" | 17 #include "media/cast/logging/log_serializer.h" |
| 18 #include "media/cast/logging/logging_defines.h" | 18 #include "media/cast/logging/logging_defines.h" |
| 19 #include "media/cast/logging/proto/raw_events.pb.h" | 19 #include "media/cast/logging/proto/raw_events.pb.h" |
| 20 #include "media/cast/logging/raw_event_subscriber_bundle.h" | 20 #include "media/cast/logging/raw_event_subscriber_bundle.h" |
| 21 #include "media/cast/transport/cast_transport_config.h" | 21 #include "media/cast/net/cast_transport_config.h" |
| 22 #include "media/cast/transport/cast_transport_sender.h" | 22 #include "media/cast/net/cast_transport_sender.h" |
| 23 | 23 |
| 24 using media::cast::AudioSenderConfig; | 24 using media::cast::AudioSenderConfig; |
| 25 using media::cast::CastEnvironment; | 25 using media::cast::CastEnvironment; |
| 26 using media::cast::CastSender; | 26 using media::cast::CastSender; |
| 27 using media::cast::VideoSenderConfig; | 27 using media::cast::VideoSenderConfig; |
| 28 | 28 |
| 29 static base::LazyInstance<CastThreads> g_cast_threads = | 29 static base::LazyInstance<CastThreads> g_cast_threads = |
| 30 LAZY_INSTANCE_INITIALIZER; | 30 LAZY_INSTANCE_INITIALIZER; |
| 31 | 31 |
| 32 CastSessionDelegate::CastSessionDelegate() | 32 CastSessionDelegate::CastSessionDelegate() |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 return; | 191 return; |
| 192 } | 192 } |
| 193 | 193 |
| 194 scoped_ptr<base::DictionaryValue> stats = subscriber->GetStats(); | 194 scoped_ptr<base::DictionaryValue> stats = subscriber->GetStats(); |
| 195 subscriber->Reset(); | 195 subscriber->Reset(); |
| 196 | 196 |
| 197 callback.Run(stats.Pass()); | 197 callback.Run(stats.Pass()); |
| 198 } | 198 } |
| 199 | 199 |
| 200 void CastSessionDelegate::StatusNotificationCB( | 200 void CastSessionDelegate::StatusNotificationCB( |
| 201 media::cast::transport::CastTransportStatus unused_status) { | 201 media::cast::CastTransportStatus unused_status) { |
| 202 DCHECK(io_message_loop_proxy_->BelongsToCurrentThread()); | 202 DCHECK(io_message_loop_proxy_->BelongsToCurrentThread()); |
| 203 // TODO(hubbe): Call javascript UDPTransport error function. | 203 // TODO(hubbe): Call javascript UDPTransport error function. |
| 204 } | 204 } |
| 205 | 205 |
| 206 void CastSessionDelegate::InitializationResultCB( | 206 void CastSessionDelegate::InitializationResultCB( |
| 207 media::cast::CastInitializationStatus result) const { | 207 media::cast::CastInitializationStatus result) const { |
| 208 DCHECK(cast_sender_); | 208 DCHECK(cast_sender_); |
| 209 | 209 |
| 210 // TODO(pwestin): handle the error codes. | 210 // TODO(pwestin): handle the error codes. |
| 211 if (result == media::cast::STATUS_AUDIO_INITIALIZED) { | 211 if (result == media::cast::STATUS_AUDIO_INITIALIZED) { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 228 cast_environment_->Logging()->InsertPacketEvent(it->timestamp, | 228 cast_environment_->Logging()->InsertPacketEvent(it->timestamp, |
| 229 it->type, | 229 it->type, |
| 230 it->media_type, | 230 it->media_type, |
| 231 it->rtp_timestamp, | 231 it->rtp_timestamp, |
| 232 it->frame_id, | 232 it->frame_id, |
| 233 it->packet_id, | 233 it->packet_id, |
| 234 it->max_packet_id, | 234 it->max_packet_id, |
| 235 it->size); | 235 it->size); |
| 236 } | 236 } |
| 237 } | 237 } |
| OLD | NEW |