diff options
author | Brian Lindahl <blindahl@google.com> | 2024-03-05 23:11:13 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2024-03-05 23:11:13 +0000 |
commit | 9fbaf5f7e75fc593e0325cdbe63676a67f67ef70 (patch) | |
tree | 5e514b96e94522f4381f7c9363ee1c6f76ec135e | |
parent | bc05bdbba8031a0181a0e6df7a41e5b3afd184a0 (diff) | |
parent | d5af19e48c1170872a09ff45e5ce412f6522692e (diff) | |
download | base-9fbaf5f7e75fc593e0325cdbe63676a67f67ef70.tar.gz |
Merge "Clarify documentation for why an app might use a PlaybackSession, and how to create and use it." into main
-rw-r--r-- | media/java/android/media/metrics/PlaybackSession.java | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/media/java/android/media/metrics/PlaybackSession.java b/media/java/android/media/metrics/PlaybackSession.java index f8dd756c5f9c..6223acf8ffa4 100644 --- a/media/java/android/media/metrics/PlaybackSession.java +++ b/media/java/android/media/metrics/PlaybackSession.java @@ -24,7 +24,10 @@ import com.android.internal.util.AnnotationValidations; import java.util.Objects; /** - * An instances of this class represents a session of media playback. + * An instance of this class represents a session of media playback used to report playback + * metrics and events. + * + * Create a new instance using {@link MediaMetricsManager#createPlaybackSession}. */ public final class PlaybackSession implements AutoCloseable { private final @NonNull String mId; @@ -80,6 +83,21 @@ public final class PlaybackSession implements AutoCloseable { mManager.reportTrackChangeEvent(mId, event); } + /** + * A session ID is used to identify a unique playback and to tie together lower-level + * playback components. + * + * Associate this session with a {@link MediaCodec} by passing the ID into + * {@link MediaFormat} through {@link MediaFormat#LOG_SESSION_ID} when + * creating the {@link MediaCodec}. + * + * Associate this session with an {@link AudioTrack} by calling + * {@link AudioTrack#setLogSessionId}. + * + * Associate this session with {@link MediaDrm} and {@link MediaCrypto} by calling + * {@link MediaDrm#getPlaybackComponent} and then calling + * {@link PlaybackComponent#setLogSessionId}. + */ public @NonNull LogSessionId getSessionId() { return mLogSessionId; } |