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 { ...@@ -288,12 +288,6 @@ public final class CastPlayer extends BasePlayer {
@Override @Override
@Nullable @Nullable
public MetadataComponent getMetadataComponent() {
return null;
}
@Override
@Nullable
public DeviceComponent getDeviceComponent() { public DeviceComponent getDeviceComponent() {
// TODO(b/151792305): Implement the component. // TODO(b/151792305): Implement the component.
return null; return null;
......
...@@ -227,24 +227,6 @@ public interface Player { ...@@ -227,24 +227,6 @@ public interface Player {
List<Cue> getCurrentCues(); 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}. */ /** The device component of a {@link Player}. */
interface DeviceComponent { interface DeviceComponent {
...@@ -1173,12 +1155,6 @@ public interface Player { ...@@ -1173,12 +1155,6 @@ public interface Player {
@Nullable @Nullable
TextComponent getTextComponent(); 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. */ /** Returns the component of this player for playback device, or null if it's not supported. */
@Nullable @Nullable
DeviceComponent getDeviceComponent(); DeviceComponent getDeviceComponent();
......
...@@ -28,6 +28,7 @@ import com.google.android.exoplayer2.audio.AudioSink; ...@@ -28,6 +28,7 @@ import com.google.android.exoplayer2.audio.AudioSink;
import com.google.android.exoplayer2.audio.AuxEffectInfo; import com.google.android.exoplayer2.audio.AuxEffectInfo;
import com.google.android.exoplayer2.audio.DefaultAudioSink; import com.google.android.exoplayer2.audio.DefaultAudioSink;
import com.google.android.exoplayer2.audio.MediaCodecAudioRenderer; 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.metadata.MetadataRenderer;
import com.google.android.exoplayer2.source.DefaultMediaSourceFactory; import com.google.android.exoplayer2.source.DefaultMediaSourceFactory;
import com.google.android.exoplayer2.source.MediaSource; import com.google.android.exoplayer2.source.MediaSource;
...@@ -218,6 +219,24 @@ public interface ExoPlayer extends Player { ...@@ -218,6 +219,24 @@ public interface ExoPlayer extends Player {
boolean getSkipSilenceEnabled(); 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 * The default timeout for calls to {@link #release} and {@link #setForegroundMode}, in
* milliseconds. * milliseconds.
...@@ -562,6 +581,12 @@ public interface ExoPlayer extends Player { ...@@ -562,6 +581,12 @@ public interface ExoPlayer extends Player {
AudioComponent getAudioComponent(); 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. * Adds a listener to receive audio offload events.
* *
* @param listener The listener to register. * @param listener The listener to register.
......
...@@ -81,7 +81,7 @@ public class SimpleExoPlayer extends BasePlayer ...@@ -81,7 +81,7 @@ public class SimpleExoPlayer extends BasePlayer
ExoPlayer.AudioComponent, ExoPlayer.AudioComponent,
Player.VideoComponent, Player.VideoComponent,
Player.TextComponent, Player.TextComponent,
Player.MetadataComponent, ExoPlayer.MetadataComponent,
Player.DeviceComponent { Player.DeviceComponent {
/** The default timeout for detaching a surface from the player, in milliseconds. */ /** 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