blob: 74cd00db3436a1f4a782eeef2a5c4a7a17a78337 [file] [log] [blame]
// Copyright 2016 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.media.playback;
using zx;
// Reader with seek semantics.
// TODO(dalesat): Report problems using Problem rather than SeekingReaderResult.
closed protocol SeekingReader {
// Describes the content. If there’s a problem accessing the content, this
// is expressed by using result. The size_in_bytes may be reported as
// UNKNOWN_SIZE if the size of the content is unknown.
strict Describe() -> (struct {
status zx.Status;
size uint64;
can_seek bool;
});
// Reads the content. If there’s a problem performing the read, this is
// expressed using result. If the read succeeded, the reply must contain a
// valid socket from which the content can be read.
strict ReadAt(struct {
position uint64;
}) -> (resource struct {
status zx.Status;
socket zx.Handle:<SOCKET, optional>;
});
};
/// Distinguished value for the `size` value returned by `SeekingReader.Describe`
/// Indicating that the size isn't known.
const UNKNOWN_SIZE uint64 = 0xffffffffffffffff;