[Standalone] Fix build
This patch fixes some build issues introduced by recent changes
to how spans and buffers are used.
Change-Id: I649f647c1c8a1532d94e45a493a1918c90a73c0c
Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/4237200
Reviewed-by: Mark Foltz <mfoltz@chromium.org>
Commit-Queue: Jordan Bayles <jophba@chromium.org>
diff --git a/cast/standalone_receiver/decoder.cc b/cast/standalone_receiver/decoder.cc
index 2fa3eb9..3287dcd 100644
--- a/cast/standalone_receiver/decoder.cc
+++ b/cast/standalone_receiver/decoder.cc
@@ -48,14 +48,14 @@
}
ByteView Decoder::Buffer::AsByteView() const {
- ByteView view(buffer_);
+ ByteView view(buffer_.data(), buffer_.size() - AV_INPUT_BUFFER_PADDING_SIZE);
view.remove_suffix(AV_INPUT_BUFFER_PADDING_SIZE);
return view;
}
-absl::Span<uint8_t> Decoder::Buffer::AsSpan() {
- return absl::Span<uint8_t>(buffer_.data(),
- buffer_.size() - AV_INPUT_BUFFER_PADDING_SIZE);
+ByteBuffer Decoder::Buffer::AsByteBuffer() {
+ return ByteBuffer(buffer_.data(),
+ buffer_.size() - AV_INPUT_BUFFER_PADDING_SIZE);
}
Decoder::Client::Client() = default;
diff --git a/cast/standalone_receiver/decoder.h b/cast/standalone_receiver/decoder.h
index 89d407c..59ceada 100644
--- a/cast/standalone_receiver/decoder.h
+++ b/cast/standalone_receiver/decoder.h
@@ -10,7 +10,6 @@
#include <string>
#include <vector>
-#include "absl/types/span.h"
#include "cast/standalone_receiver/avcodec_glue.h"
#include "cast/streaming/frame_id.h"
#include "platform/base/span.h"
@@ -30,7 +29,7 @@
void Resize(int new_size);
ByteView AsByteView() const;
- absl::Span<uint8_t> AsSpan();
+ ByteBuffer AsByteBuffer();
private:
std::vector<uint8_t> buffer_;
diff --git a/cast/standalone_receiver/sdl_player_base.cc b/cast/standalone_receiver/sdl_player_base.cc
index 0ba3481..72f28b7 100644
--- a/cast/standalone_receiver/sdl_player_base.cc
+++ b/cast/standalone_receiver/sdl_player_base.cc
@@ -101,7 +101,7 @@
// Consume the next frame.
const Clock::time_point start_time = now_();
buffer_.Resize(buffer_size);
- EncodedFrame frame = receiver_->ConsumeNextFrame(buffer_.AsSpan());
+ EncodedFrame frame = receiver_->ConsumeNextFrame(buffer_.AsByteBuffer());
// Create the tracking state for the frame in the player pipeline.
OSP_DCHECK_EQ(frames_to_render_.count(frame.frame_id), 0);
diff --git a/cast/standalone_sender/streaming_av1_encoder.cc b/cast/standalone_sender/streaming_av1_encoder.cc
index 79284af..ae3e6de 100644
--- a/cast/standalone_sender/streaming_av1_encoder.cc
+++ b/cast/standalone_sender/streaming_av1_encoder.cc
@@ -380,7 +380,7 @@
}
frame.rtp_timestamp = results.rtp_timestamp;
frame.reference_time = results.reference_time;
- frame.data = absl::Span<uint8_t>(results.payload);
+ frame.data = ByteBuffer(results.payload);
if (sender_->EnqueueFrame(frame) != Sender::OK) {
// Since the frame will not be sent, the encoder's frame dependency chain