blob: 1a455a00b392c9f88628b466740c66c1c1941350 [file] [log] [blame] [edit]
// Copyright 2024 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "quiche/quic/moqt/moqt_cached_object.h"
#include "quiche/quic/moqt/moqt_publisher.h"
#include "quiche/common/platform/api/quiche_mem_slice.h"
namespace moqt {
moqt::PublishedObject CachedObjectToPublishedObject(
const CachedObject& object) {
PublishedObject result;
result.sequence = object.sequence;
result.status = object.status;
result.publisher_priority = object.publisher_priority;
if (object.payload != nullptr && !object.payload->empty()) {
result.payload = quiche::QuicheMemSlice(
object.payload->data(), object.payload->length(),
[retained_pointer = object.payload](const char*) {});
}
result.arrival_time = object.arrival_time;
result.fin_after_this = object.fin_after_this;
return result;
}
} // namespace moqt