Commit 40d3e128 by krocard Committed by Andrew Lewis

Move MetadataComponent from Player to ExoPlayer

PiperOrigin-RevId: 368418142
parent f4f31273
......@@ -288,12 +288,6 @@ public final class CastPlayer extends BasePlayer {
@Override
@Nullable
public MetadataComponent getMetadataComponent() {
return null;
}
@Override
@Nullable
public DeviceComponent getDeviceComponent() {
// TODO(b/151792305): Implement the component.
return null;
......
......@@ -227,24 +227,6 @@ public interface Player {
List<Cue> getCurrentCues();
}
/** The metadata component of a {@link Player}. */
interface MetadataComponent {
/**
* Adds a {@link MetadataOutput} to receive metadata.
*
* @param output The output to register.
*/
void addMetadataOutput(MetadataOutput output);
/**
* Removes a {@link MetadataOutput}.
*
* @param output The output to remove.
*/
void removeMetadataOutput(MetadataOutput output);
}
/** The device component of a {@link Player}. */
interface DeviceComponent {
......@@ -1173,12 +1155,6 @@ public interface Player {
@Nullable
TextComponent getTextComponent();
/**
* Returns the component of this player for metadata output, or null if metadata is not supported.
*/
@Nullable
MetadataComponent getMetadataComponent();
/** Returns the component of this player for playback device, or null if it's not supported. */
@Nullable
DeviceComponent getDeviceComponent();
......
......@@ -28,6 +28,7 @@ import com.google.android.exoplayer2.audio.AudioSink;
import com.google.android.exoplayer2.audio.AuxEffectInfo;
import com.google.android.exoplayer2.audio.DefaultAudioSink;
import com.google.android.exoplayer2.audio.MediaCodecAudioRenderer;
import com.google.android.exoplayer2.metadata.MetadataOutput;
import com.google.android.exoplayer2.metadata.MetadataRenderer;
import com.google.android.exoplayer2.source.DefaultMediaSourceFactory;
import com.google.android.exoplayer2.source.MediaSource;
......@@ -218,6 +219,24 @@ public interface ExoPlayer extends Player {
boolean getSkipSilenceEnabled();
}
/** The metadata component of an {@link ExoPlayer}. */
interface MetadataComponent {
/**
* Adds a {@link MetadataOutput} to receive metadata.
*
* @param output The output to register.
*/
void addMetadataOutput(MetadataOutput output);
/**
* Removes a {@link MetadataOutput}.
*
* @param output The output to remove.
*/
void removeMetadataOutput(MetadataOutput output);
}
/**
* The default timeout for calls to {@link #release} and {@link #setForegroundMode}, in
* milliseconds.
......@@ -562,6 +581,12 @@ public interface ExoPlayer extends Player {
AudioComponent getAudioComponent();
/**
* Returns the component of this player for metadata output, or null if metadata is not supported.
*/
@Nullable
MetadataComponent getMetadataComponent();
/**
* Adds a listener to receive audio offload events.
*
* @param listener The listener to register.
......
......@@ -81,7 +81,7 @@ public class SimpleExoPlayer extends BasePlayer
ExoPlayer.AudioComponent,
Player.VideoComponent,
Player.TextComponent,
Player.MetadataComponent,
ExoPlayer.MetadataComponent,
Player.DeviceComponent {
/** The default timeout for detaching a surface from the player, in milliseconds. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment