11abddd9f6225298066094e20a6c29061b6af4590Nick Chalko/*
21abddd9f6225298066094e20a6c29061b6af4590Nick Chalko * Copyright (C) 2015 The Android Open Source Project
31abddd9f6225298066094e20a6c29061b6af4590Nick Chalko *
41abddd9f6225298066094e20a6c29061b6af4590Nick Chalko * Licensed under the Apache License, Version 2.0 (the "License");
51abddd9f6225298066094e20a6c29061b6af4590Nick Chalko * you may not use this file except in compliance with the License.
61abddd9f6225298066094e20a6c29061b6af4590Nick Chalko * You may obtain a copy of the License at
71abddd9f6225298066094e20a6c29061b6af4590Nick Chalko *
81abddd9f6225298066094e20a6c29061b6af4590Nick Chalko *      http://www.apache.org/licenses/LICENSE-2.0
91abddd9f6225298066094e20a6c29061b6af4590Nick Chalko *
101abddd9f6225298066094e20a6c29061b6af4590Nick Chalko * Unless required by applicable law or agreed to in writing, software
111abddd9f6225298066094e20a6c29061b6af4590Nick Chalko * distributed under the License is distributed on an "AS IS" BASIS,
121abddd9f6225298066094e20a6c29061b6af4590Nick Chalko * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
131abddd9f6225298066094e20a6c29061b6af4590Nick Chalko * See the License for the specific language governing permissions and
141abddd9f6225298066094e20a6c29061b6af4590Nick Chalko * limitations under the License.
151abddd9f6225298066094e20a6c29061b6af4590Nick Chalko */
161abddd9f6225298066094e20a6c29061b6af4590Nick Chalko
1765fda1eaa94968bb55d5ded10dcb0b3f37fb05f2Nick Chalkopackage com.android.tv.tuner.tvinput;
181abddd9f6225298066094e20a6c29061b6af4590Nick Chalko
191abddd9f6225298066094e20a6c29061b6af4590Nick Chalko/**
2065fda1eaa94968bb55d5ded10dcb0b3f37fb05f2Nick Chalko * The listener for buffer events occurred during playback.
211abddd9f6225298066094e20a6c29061b6af4590Nick Chalko */
2265fda1eaa94968bb55d5ded10dcb0b3f37fb05f2Nick Chalkopublic interface PlaybackBufferListener {
231abddd9f6225298066094e20a6c29061b6af4590Nick Chalko
241abddd9f6225298066094e20a6c29061b6af4590Nick Chalko    /**
2565fda1eaa94968bb55d5ded10dcb0b3f37fb05f2Nick Chalko     * Invoked when the start position of the buffer has been changed.
261abddd9f6225298066094e20a6c29061b6af4590Nick Chalko     *
2765fda1eaa94968bb55d5ded10dcb0b3f37fb05f2Nick Chalko     * @param startTimeMs the new start time of the buffer in millisecond
281abddd9f6225298066094e20a6c29061b6af4590Nick Chalko     */
2965fda1eaa94968bb55d5ded10dcb0b3f37fb05f2Nick Chalko    void onBufferStartTimeChanged(long startTimeMs);
301abddd9f6225298066094e20a6c29061b6af4590Nick Chalko
311abddd9f6225298066094e20a6c29061b6af4590Nick Chalko    /**
3265fda1eaa94968bb55d5ded10dcb0b3f37fb05f2Nick Chalko     * Invoked when the state of the buffer has been changed.
331abddd9f6225298066094e20a6c29061b6af4590Nick Chalko     *
3465fda1eaa94968bb55d5ded10dcb0b3f37fb05f2Nick Chalko     * @param available whether the buffer is available or not
351abddd9f6225298066094e20a6c29061b6af4590Nick Chalko     */
3665fda1eaa94968bb55d5ded10dcb0b3f37fb05f2Nick Chalko    void onBufferStateChanged(boolean available);
371abddd9f6225298066094e20a6c29061b6af4590Nick Chalko
381abddd9f6225298066094e20a6c29061b6af4590Nick Chalko    /**
3965fda1eaa94968bb55d5ded10dcb0b3f37fb05f2Nick Chalko     * Invoked when the disk speed is too slow to write the buffers.
401abddd9f6225298066094e20a6c29061b6af4590Nick Chalko     */
411abddd9f6225298066094e20a6c29061b6af4590Nick Chalko    void onDiskTooSlow();
421abddd9f6225298066094e20a6c29061b6af4590Nick Chalko}
43