aboutsummaryrefslogtreecommitdiff
path: root/cast
diff options
context:
space:
mode:
Diffstat (limited to 'cast')
-rw-r--r--cast/standalone_receiver/cast_service.cc3
-rw-r--r--cast/streaming/offer_messages.cc4
-rw-r--r--cast/streaming/receiver_packet_router.cc5
-rw-r--r--cast/streaming/sender_packet_router.cc5
4 files changed, 10 insertions, 7 deletions
diff --git a/cast/standalone_receiver/cast_service.cc b/cast/standalone_receiver/cast_service.cc
index 009190b0..0e3d9c9c 100644
--- a/cast/standalone_receiver/cast_service.cc
+++ b/cast/standalone_receiver/cast_service.cc
@@ -69,7 +69,8 @@ CastService::CastService(CastService::Configuration config)
if (discovery_publisher_) {
ReceiverInfo info;
info.port = local_endpoint_.port;
- info.unique_id = HexEncode(config.interface.hardware_address);
+ info.unique_id = HexEncode(config.interface.hardware_address.data(),
+ config.interface.hardware_address.size());
info.friendly_name = config.friendly_name;
info.model_name = config.model_name;
info.capabilities = kHasVideoOutput | kHasAudioOutput;
diff --git a/cast/streaming/offer_messages.cc b/cast/streaming/offer_messages.cc
index 3e816026..eeefcc5d 100644
--- a/cast/streaming/offer_messages.cc
+++ b/cast/streaming/offer_messages.cc
@@ -202,8 +202,8 @@ Json::Value Stream::ToJson() const {
"this code assumes Ssrc fits in a Json::UInt");
root["ssrc"] = static_cast<Json::UInt>(ssrc);
root["targetDelay"] = static_cast<int>(target_delay.count());
- root["aesKey"] = HexEncode(aes_key);
- root["aesIvMask"] = HexEncode(aes_iv_mask);
+ root["aesKey"] = HexEncode(aes_key.data(), aes_key.size());
+ root["aesIvMask"] = HexEncode(aes_iv_mask.data(), aes_iv_mask.size());
root["receiverRtcpEventLog"] = receiver_rtcp_event_log;
root["receiverRtcpDscp"] = receiver_rtcp_dscp;
root["timeBase"] = "1/" + std::to_string(rtp_timebase);
diff --git a/cast/streaming/receiver_packet_router.cc b/cast/streaming/receiver_packet_router.cc
index 1ac4266a..23b99ce4 100644
--- a/cast/streaming/receiver_packet_router.cc
+++ b/cast/streaming/receiver_packet_router.cc
@@ -73,10 +73,11 @@ void ReceiverPacketRouter::OnReceivedPacket(const IPEndpoint& source,
InspectPacketForRouting(packet);
if (seems_like.first == ApparentPacketType::UNKNOWN) {
constexpr int kMaxPartiaHexDumpSize = 96;
+ const std::size_t encode_size =
+ std::min(packet.size(), static_cast<size_t>(kMaxPartiaHexDumpSize));
OSP_LOG_WARN << "UNKNOWN packet of " << packet.size()
<< " bytes. Partial hex dump: "
- << HexEncode(absl::Span<const uint8_t>(packet).subspan(
- 0, kMaxPartiaHexDumpSize));
+ << HexEncode(packet.data(), encode_size);
return;
}
auto it = receivers_.find(seems_like.second);
diff --git a/cast/streaming/sender_packet_router.cc b/cast/streaming/sender_packet_router.cc
index c2b23dbf..684b1fb2 100644
--- a/cast/streaming/sender_packet_router.cc
+++ b/cast/streaming/sender_packet_router.cc
@@ -102,10 +102,11 @@ void SenderPacketRouter::OnReceivedPacket(const IPEndpoint& source,
InspectPacketForRouting(packet);
if (seems_like.first != ApparentPacketType::RTCP) {
constexpr int kMaxPartiaHexDumpSize = 96;
+ const std::size_t encode_size =
+ std::min(packet.size(), static_cast<size_t>(kMaxPartiaHexDumpSize));
OSP_LOG_WARN << "UNKNOWN packet of " << packet.size()
<< " bytes. Partial hex dump: "
- << HexEncode(absl::Span<const uint8_t>(packet).subspan(
- 0, kMaxPartiaHexDumpSize));
+ << HexEncode(packet.data(), encode_size);
return;
}
const auto it = FindEntry(seems_like.second);