| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 MEDIA_CAST_NET_CAST_TRANSPORT_CONFIG_H_ | 5 #ifndef MEDIA_CAST_NET_CAST_TRANSPORT_CONFIG_H_ |
| 6 #define MEDIA_CAST_NET_CAST_TRANSPORT_CONFIG_H_ | 6 #define MEDIA_CAST_NET_CAST_TRANSPORT_CONFIG_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <memory> |
| 11 #include <string> | 12 #include <string> |
| 12 | 13 |
| 13 #include "base/callback.h" | 14 #include "base/callback.h" |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
| 16 #include "media/cast/common/rtp_time.h" | 16 #include "media/cast/common/rtp_time.h" |
| 17 #include "media/cast/net/cast_transport_defines.h" | 17 #include "media/cast/net/cast_transport_defines.h" |
| 18 | 18 |
| 19 namespace media { | 19 namespace media { |
| 20 namespace cast { | 20 namespace cast { |
| 21 | 21 |
| 22 enum Codec { | 22 enum Codec { |
| 23 CODEC_UNKNOWN, | 23 CODEC_UNKNOWN, |
| 24 CODEC_AUDIO_OPUS, | 24 CODEC_AUDIO_OPUS, |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 base::TimeTicks reference_time; | 116 base::TimeTicks reference_time; |
| 117 | 117 |
| 118 // Playout delay for this and all future frames. Used by the Adaptive | 118 // Playout delay for this and all future frames. Used by the Adaptive |
| 119 // Playout delay extension. Zero means no change. | 119 // Playout delay extension. Zero means no change. |
| 120 uint16_t new_playout_delay_ms; | 120 uint16_t new_playout_delay_ms; |
| 121 | 121 |
| 122 // The encoded signal data. | 122 // The encoded signal data. |
| 123 std::string data; | 123 std::string data; |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 typedef base::Callback<void(scoped_ptr<Packet> packet)> PacketReceiverCallback; | 126 typedef base::Callback<void(std::unique_ptr<Packet> packet)> |
| 127 typedef base::Callback<bool(scoped_ptr<Packet> packet)> | 127 PacketReceiverCallback; |
| 128 typedef base::Callback<bool(std::unique_ptr<Packet> packet)> |
| 128 PacketReceiverCallbackWithStatus; | 129 PacketReceiverCallbackWithStatus; |
| 129 | 130 |
| 130 class PacketTransport { | 131 class PacketTransport { |
| 131 public: | 132 public: |
| 132 // Send a packet to the network. Returns false if the network is blocked | 133 // Send a packet to the network. Returns false if the network is blocked |
| 133 // and we should wait for |cb| to be called. It is not allowed to called | 134 // and we should wait for |cb| to be called. It is not allowed to called |
| 134 // SendPacket again until |cb| has been called. Any other errors that | 135 // SendPacket again until |cb| has been called. Any other errors that |
| 135 // occur will be reported through side channels, in such cases, this function | 136 // occur will be reported through side channels, in such cases, this function |
| 136 // will return true indicating that the channel is not blocked. | 137 // will return true indicating that the channel is not blocked. |
| 137 virtual bool SendPacket(PacketRef packet, const base::Closure& cb) = 0; | 138 virtual bool SendPacket(PacketRef packet, const base::Closure& cb) = 0; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 lhs.ntp_fraction == rhs.ntp_fraction && | 187 lhs.ntp_fraction == rhs.ntp_fraction && |
| 187 lhs.rtp_timestamp == rhs.rtp_timestamp && | 188 lhs.rtp_timestamp == rhs.rtp_timestamp && |
| 188 lhs.send_packet_count == rhs.send_packet_count && | 189 lhs.send_packet_count == rhs.send_packet_count && |
| 189 lhs.send_octet_count == rhs.send_octet_count; | 190 lhs.send_octet_count == rhs.send_octet_count; |
| 190 } | 191 } |
| 191 | 192 |
| 192 } // namespace cast | 193 } // namespace cast |
| 193 } // namespace media | 194 } // namespace media |
| 194 | 195 |
| 195 #endif // MEDIA_CAST_NET_CAST_TRANSPORT_CONFIG_H_ | 196 #endif // MEDIA_CAST_NET_CAST_TRANSPORT_CONFIG_H_ |
| OLD | NEW |