blob: f7a5ffde9dac5eae857adfa55d90ce3d5191798c [file] [log] [blame]
// Copyright 2016 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.
[DartPackage="mojo_services"]
module mojo.media;
import "mojo/services/media/common/interfaces/media_common.mojom";
// Reader with seek semantics.
interface SeekingReader {
const uint64 kUnknownSize = 0xffffffffffffffff;
// Gets the content size and whether the reader can seek. The |result|
// callback parameter is |OK| unless there was a problem accessing the
// content to be read. Other possible values:
// |NOT_FOUND| - The content could not be found.
// |UNKNOWN_ERROR| - Some other error occurred.
// A |size| value of |kUnknownSize| if the size of the content isn't known.
Describe() => (MediaResult result, uint64 size, bool can_seek);
// Reads into a data pipe starting at a specified position. If the reader
// can't seek, position must be 0. The |result| callback parameter is |OK|
// unless there was a problem performing the read. Other possible values:
// |NOT_FOUND| - The content could not be found.
// |INVALID_ARGUMENT| - The reader can't seek and |position| was non-zero.
// |UNKNOWN_ERROR| - Some other error occurred.
ReadAt(uint64 position) =>
(MediaResult result, handle<data_pipe_consumer>? data_pipe);
};