Repository navigation
feat(replay): Add hooks for a Hybrid SDK's own replay recorder and frames #6829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
bitsandfoxes
wants to merge
11
commits into
main
Choose a base branch
from
spire/sentry-java-hooks-for-hybrid-sdk-session
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
1e5d289
feat(replay): Add hooks for a recorder of a Hybrid SDK and raw pixel โฆ
bitsandfoxes 08cc766
test(replay): Prove the Hybrid SDK recorder hooks with Unity on a device
bitsandfoxes 157a4f4
docs(replay): Say a Hybrid SDK recorder must report its frame size
bitsandfoxes c5b95c3
changelog
bitsandfoxes 743dfa3
ref(replay): Name the RGBA bytes per pixel and update the detekt baseโฆ
bitsandfoxes 6fbffc3
ref(replay): Keep the RGBA bytes-per-pixel constant private
bitsandfoxes 90303e1
fix(replay): Drop the recycled frame bitmap before allocating a new one
bitsandfoxes 589aea6
test(replay): Make the onFrame pixel check independent of the host's โฆ
bitsandfoxes 3b10c0c
ref(replay): Pass the replay cache to addBitmapFrame and name sentry-โฆ
bitsandfoxes 0a71bbd
Merge main at b98cbdd into spire/sentry-java-hooks-for-hybrid-sdk-sesโฆ
bitsandfoxes 9e8b2d4
ref(replay): Name the reused frame bitmap helper for what it does
bitsandfoxes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
sentry-android-replay/src/main/java/io/sentry/android/replay/ReplayRecorderFactory.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| package io.sentry.android.replay | ||
|
|
||
| import org.jetbrains.annotations.ApiStatus | ||
|
|
||
| /** | ||
| * Creates the [Recorder] that captures session replay frames in place of the replay's own one. | ||
| * Meant for Hybrid SDKs that capture frames themselves. | ||
| */ | ||
| @ApiStatus.Internal | ||
| public fun interface ReplayRecorderFactory { | ||
| /** | ||
| * @param frames takes the frames the returned recorder captures | ||
| * @return the recorder session replay starts, pauses, resumes and stops | ||
| */ | ||
| public fun create(frames: ReplayFrameReceiver): Recorder | ||
| } | ||
|
|
||
| /** Takes session replay frames that a [Recorder] captured as raw pixels. */ | ||
| @ApiStatus.Internal | ||
| public interface ReplayFrameReceiver { | ||
| /** | ||
| * Takes one frame. The receiver owns [pixels] from then on: the caller must not change the array | ||
| * after the call. The frame must be [ScreenshotRecorderConfig.recordingWidth] x | ||
| * [ScreenshotRecorderConfig.recordingHeight] of the config last passed to | ||
| * [ReplayIntegration.onConfigurationChanged], or it is cropped or padded in the video. | ||
| * | ||
| * @param pixels [width] * [height] * 4 bytes, in RGBA order, top row first. Alpha is ignored. | ||
| * @param width the frame's width in pixels | ||
| * @param height the frame's height in pixels | ||
| */ | ||
| public fun onFrame(pixels: ByteArray, width: Int, height: Int) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.