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/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
9 #include "content/public/renderer/p2p_socket_client.h" | 9 #include "content/public/renderer/p2p_socket_client.h" |
10 #include "content/public/renderer/render_thread.h" | 10 #include "content/public/renderer/render_thread.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 // thread hopping for incoming video frames and outgoing network packets. | 73 // thread hopping for incoming video frames and outgoing network packets. |
74 // There's no need to decode so no thread assigned for decoding. | 74 // There's no need to decode so no thread assigned for decoding. |
75 // Get default logging: All disabled. | 75 // Get default logging: All disabled. |
76 cast_environment_ = new CastEnvironment( | 76 cast_environment_ = new CastEnvironment( |
77 &clock_, | 77 &clock_, |
78 base::MessageLoopProxy::current(), | 78 base::MessageLoopProxy::current(), |
79 audio_encode_thread_.message_loop_proxy(), | 79 audio_encode_thread_.message_loop_proxy(), |
80 NULL, | 80 NULL, |
81 video_encode_thread_.message_loop_proxy(), | 81 video_encode_thread_.message_loop_proxy(), |
82 NULL, | 82 NULL, |
| 83 base::MessageLoopProxy::current(), |
83 media::cast::GetDefaultCastLoggingConfig()); | 84 media::cast::GetDefaultCastLoggingConfig()); |
84 | 85 |
85 // TODO(hclam): Implement VideoEncoderController to configure hardware | 86 // TODO(hclam): Implement VideoEncoderController to configure hardware |
86 // encoder. | 87 // encoder. |
87 cast_sender_.reset(CastSender::CreateCastSender( | 88 cast_sender_.reset(CastSender::CreateCastSender( |
88 cast_environment_, | 89 cast_environment_, |
89 audio_config_, | 90 audio_config_, |
90 video_config_, | 91 video_config_, |
91 NULL, | 92 NULL, |
92 this)); | 93 this)); |
(...skipping 21 matching lines...) Expand all Loading... |
114 } | 115 } |
115 return true; | 116 return true; |
116 } | 117 } |
117 | 118 |
118 void CastSessionDelegate::ReceivePacket(const std::vector<char>& packet) { | 119 void CastSessionDelegate::ReceivePacket(const std::vector<char>& packet) { |
119 uint8 *packet_copy = new uint8[packet.size()]; | 120 uint8 *packet_copy = new uint8[packet.size()]; |
120 memcpy(packet_copy, &packet[0], packet.size()); | 121 memcpy(packet_copy, &packet[0], packet.size()); |
121 cast_sender_->packet_receiver()->ReceivedPacket( | 122 cast_sender_->packet_receiver()->ReceivedPacket( |
122 packet_copy, | 123 packet_copy, |
123 packet.size(), | 124 packet.size(), |
124 base::Bind(&media::cast::PacketReceiver::DeletePacket, packet_copy)); | 125 base::Bind(&media::cast::transport::PacketReceiver::DeletePacket, |
| 126 packet_copy)); |
125 } | 127 } |
OLD | NEW |