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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 return; | 69 return; |
70 | 70 |
71 audio_encode_thread_.Start(); | 71 audio_encode_thread_.Start(); |
72 video_encode_thread_.Start(); | 72 video_encode_thread_.Start(); |
73 | 73 |
74 // CastSender uses the renderer's IO thread as the main thread. This reduces | 74 // CastSender uses the renderer's IO thread as the main thread. This reduces |
75 // thread hopping for incoming video frames and outgoing network packets. | 75 // thread hopping for incoming video frames and outgoing network packets. |
76 // There's no need to decode so no thread assigned for decoding. | 76 // There's no need to decode so no thread assigned for decoding. |
77 // Get default logging: All disabled. | 77 // Get default logging: All disabled. |
78 cast_environment_ = new CastEnvironment( | 78 cast_environment_ = new CastEnvironment( |
79 &clock_, | 79 scoped_ptr<base::TickClock>(new base::DefaultTickClock()).Pass(), |
80 base::MessageLoopProxy::current(), | 80 base::MessageLoopProxy::current(), |
81 audio_encode_thread_.message_loop_proxy(), | 81 audio_encode_thread_.message_loop_proxy(), |
82 NULL, | 82 NULL, |
83 video_encode_thread_.message_loop_proxy(), | 83 video_encode_thread_.message_loop_proxy(), |
84 NULL, | 84 NULL, |
85 base::MessageLoopProxy::current(), | 85 base::MessageLoopProxy::current(), |
86 media::cast::GetDefaultCastSenderLoggingConfig()); | 86 media::cast::GetDefaultCastSenderLoggingConfig()); |
87 | 87 |
88 // TODO(hclam): Implement VideoEncoderController to configure hardware | 88 // TODO(hclam): Implement VideoEncoderController to configure hardware |
89 // encoder. | 89 // encoder. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 122 |
123 void CastSessionDelegate::ReceivePacket(const std::vector<char>& packet) { | 123 void CastSessionDelegate::ReceivePacket(const std::vector<char>& packet) { |
124 uint8 *packet_copy = new uint8[packet.size()]; | 124 uint8 *packet_copy = new uint8[packet.size()]; |
125 memcpy(packet_copy, &packet[0], packet.size()); | 125 memcpy(packet_copy, &packet[0], packet.size()); |
126 cast_sender_->packet_receiver()->ReceivedPacket( | 126 cast_sender_->packet_receiver()->ReceivedPacket( |
127 packet_copy, | 127 packet_copy, |
128 packet.size(), | 128 packet.size(), |
129 base::Bind(&media::cast::transport::PacketReceiver::DeletePacket, | 129 base::Bind(&media::cast::transport::PacketReceiver::DeletePacket, |
130 packet_copy)); | 130 packet_copy)); |
131 } | 131 } |
OLD | NEW |