OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "remoting/protocol/rtp_reader.h" | 5 #include "remoting/protocol/rtp_reader.h" |
6 | 6 |
7 #include "net/base/completion_callback.h" | 7 #include "net/base/completion_callback.h" |
8 #include "net/base/io_buffer.h" | 8 #include "net/base/io_buffer.h" |
9 | 9 |
10 namespace remoting { | 10 namespace remoting { |
(...skipping 16 matching lines...) Expand all Loading... |
27 int header_size = UnpackRtpHeader(reinterpret_cast<uint8*>(buffer->data()), | 27 int header_size = UnpackRtpHeader(reinterpret_cast<uint8*>(buffer->data()), |
28 data_size, &packet.header); | 28 data_size, &packet.header); |
29 if (header_size < 0) { | 29 if (header_size < 0) { |
30 LOG(WARNING) << "Received invalid RTP packet."; | 30 LOG(WARNING) << "Received invalid RTP packet."; |
31 return; | 31 return; |
32 } | 32 } |
33 packet.data = buffer; | 33 packet.data = buffer; |
34 packet.payload = buffer->data() + header_size; | 34 packet.payload = buffer->data() + header_size; |
35 packet.payload_size = data_size - header_size; | 35 packet.payload_size = data_size - header_size; |
36 | 36 |
37 on_message_callback_->Run(&packet); | 37 on_message_callback_->Run(packet); |
38 } | 38 } |
39 | 39 |
40 } // namespace remoting | 40 } // namespace remoting |
OLD | NEW |