29 | * Must be called prior to each attempt to dequeue output buffers from the decoder.
30 | *
31 | * @param positionUs The current playback position in microseconds.
32 | */
33 | void setPositionUs(long positionUs);
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/text/SubtitleInputBuffer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.text;
17 |
18 | import com.google.android.exoplayer2.Format;
19 | import com.google.android.exoplayer2.decoder.DecoderInputBuffer;
20 |
21 | /** A {@link DecoderInputBuffer} for a {@link SubtitleDecoder}. */
22 | public class SubtitleInputBuffer extends DecoderInputBuffer {
23 |
24 | /**
25 | * An offset that must be added to the subtitle's event times after it's been decoded, or
26 | * {@link Format#OFFSET_SAMPLE_RELATIVE} if {@link #timeUs} should be added.
27 | */
28 | public long subsampleOffsetUs;
29 |
30 | public SubtitleInputBuffer() {
31 | super(DecoderInputBuffer.BUFFER_REPLACEMENT_MODE_NORMAL);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/exoplayer/src/main/java/com/google/android/exoplayer2/text/TextOutput.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.google.android.exoplayer2.text;
17 |
18 | import java.util.List;
19 |
20 | /**
21 | * Receives text output.
22 | */
23 | public interface TextOutput {
24 |
25 | /**
26 | * Called when there is a change in the {@link Cue}s.
27 | *
28 | * @param cues The {@link Cue}s. May be empty.
29 | */
30 | void onCues(List