diff options
| author | 2024-03-06 00:46:22 +0000 | |
|---|---|---|
| committer | 2024-03-06 00:46:22 +0000 | |
| commit | fc99cd5a66cd314a73da8dfb3e1464788389039a (patch) | |
| tree | 91a831b6271ab0d83d367da3c9996bf04cca21c0 | |
| parent | 52dfe53a4dfb5e77324b12e11719c6a4cec5b452 (diff) | |
| parent | 9fbaf5f7e75fc593e0325cdbe63676a67f67ef70 (diff) | |
Merge "Clarify documentation for why an app might use a PlaybackSession, and how to create and use it." into main am: 9fbaf5f7e7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2928590
Change-Id: I9c61dc312c22291e928befa115ab596d2d19d80f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -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; } |