We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://github.com/pedroSG94/RootEncoder/blob/master/library/src/main/java/com/pedro/library/util/sources/video/ScreenSource.kt
override fun start(surfaceTexture: SurfaceTexture) { this.surfaceTexture = surfaceTexture if (!isRunning()) { val dpi = context.resources.displayMetrics.densityDpi val flags = DisplayManager.VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR //Adapt MediaProjection render to stream resolution val shouldRotate = width > height val displayWidth = if (shouldRotate) height else width val displayHeight = if (shouldRotate) width else height if (shouldRotate) { surfaceTexture.setDefaultBufferSize(height, width) } handlerThread.start() val mediaProjectionCallback = object : MediaProjection.Callback() {} mediaProjection.registerCallback(mediaProjectionCallback, Handler(handlerThread.looper)) val callback = object : VirtualDisplay.Callback() {} virtualDisplay = mediaProjection.createVirtualDisplay("ScreenSource", displayWidth, displayHeight, dpi, flags, Surface(surfaceTexture), callback, Handler(handlerThread.looper) ) } }
Displaywidth height is always greater than displaywidth. This will cause the landscape screen to be stretched.
The text was updated successfully, but these errors were encountered:
Hello,
This should be fixed here (I had no time to test it well yet): #1439
You can test it and let me know if the problem is solved. Also, you can suggest changes if you find a better way to implement this.
Sorry, something went wrong.
Closed as complete
No branches or pull requests
https://github.com/pedroSG94/RootEncoder/blob/master/library/src/main/java/com/pedro/library/util/sources/video/ScreenSource.kt
Displaywidth height is always greater than displaywidth. This will cause the landscape screen to be stretched.
The text was updated successfully, but these errors were encountered: