Skip to content
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

[SR] Fix crashing MediaCodec and use density to determine recording resolution #3327

Merged
merged 5 commits into from
Apr 9, 2024

Conversation

romtsn
Copy link
Member

@romtsn romtsn commented Apr 5, 2024

#skip-changelog

📜 Description

  • Moves away from using a static height, but rather determine the recording size based on density (use 1x=mdpi for now, which means 2280x1080 will translate to something like 840x400)
  • Fixes crashing MediaCodec on some devices, because we were not rounding height and width so they're divisible by 16 (pixel block size, which codecs work on)
  • Increases default bitrate because 20k bps is of very low quality (we'll introduce different quality levels in the future, so it's easier for customers to chose from low|medium|high rather than picking arbitrary values)
  • Fixes out-of-sync viewHierarchy in some cases by setting it to null immediately so it's not used for a later (maybe irrelevant) screenshot

💡 Motivation and Context

Part of getsentry/sentry#63255

💚 How did you test it?

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Copy link
Contributor

github-actions bot commented Apr 5, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 413.26 ms 481.35 ms 68.09 ms
Size 1.70 MiB 2.30 MiB 617.62 KiB

Previous results on branch: rz/fix/session-replay-media-codec

Startup times

Revision Plain With Sentry Diff
9126844 416.33 ms 501.73 ms 85.41 ms
a11f6db 325.17 ms 397.65 ms 72.49 ms
cc2af40 385.08 ms 466.36 ms 81.28 ms

App size

Revision Plain With Sentry Diff
9126844 1.70 MiB 2.30 MiB 617.62 KiB
a11f6db 1.70 MiB 2.30 MiB 617.64 KiB
cc2af40 1.70 MiB 2.30 MiB 617.64 KiB

@@ -55,11 +55,6 @@ internal class WindowRecorder(
return
}

// val (height, width) = (wm.currentWindowMetrics.bounds.bottom /
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this can be safely removed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah red lines means these have been removed, haha ;)

sentry/src/main/java/io/sentry/SentryReplayOptions.java Outdated Show resolved Hide resolved
Base automatically changed from rz/feat/session-replay-cleanups to rz/feat/session-replay April 9, 2024 10:03
Co-authored-by: Markus Hintersteiner <markus.hintersteiner@sentry.io>
@romtsn romtsn merged commit 1430e7e into rz/feat/session-replay Apr 9, 2024
20 checks passed
@romtsn romtsn deleted the rz/fix/session-replay-media-codec branch April 9, 2024 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants