blob: aed684b48fe8c0a48462ba08901fdccd84d2423b [file] [log] [blame]
// Copyright 2019 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 "base/files/scoped_file.h"
#include "base/memory/scoped_refptr.h"
#include "base/time/time.h"
namespace media {
class DecoderBuffer;
} // namespace media
namespace arc {
// Intermediate class in converting from a mojom::DecoderBuffer to
// media::DecoderBuffer. Because media::DecoderBuffer doesn't have a public
// constructor, we cannot convert to media::DecoderBuffer directly by
// StructTraits::Read().
struct DecoderBuffer {
DecoderBuffer(base::ScopedFD handle_fd,
uint32_t offset,
uint32_t payload_size,
bool end_of_stream,
base::TimeDelta timestamp);
DecoderBuffer(DecoderBuffer&& buf);
DecoderBuffer& operator=(DecoderBuffer&& buf);
// Convert to media::DecoderBuffer.
scoped_refptr<media::DecoderBuffer> ToMediaDecoderBuffer() &&;
// See components/arc/mojom/video_common.mojom for descriptions of each field.
base::ScopedFD handle_fd;
uint32_t offset;
uint32_t payload_size;
bool end_of_stream;
base::TimeDelta timestamp;
} // namespace arc