-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Scaling the video independently of the size of the SurfaceView #1428
Comments
Some more thoughts:
|
I don't think I really understand what the request is here. Please clarify? To address the final point, I'm pretty sure |
Hi ! Sorry for the confusion. There are 2 questions:
|
Nope, you didn't miss something. It appears that I found that if you move the call to |
Marking as a bug to make sure we fix/workaround application of the scaling mode. |
If it helps either of you (or anyone else reaching this issue) I have implemented a Center_crop style (among other) scaling in brianwernick/ExoMedia#158 and fixed in https:/brianwernick/ExoMedia/pull/168/files. In short I wait until the ExoPlayer informs us that the video size has changed, then wait for the TextureView to resize before applying the modified scaling |
Hi @brianwernick, I don't really want to use a TextureView unless you have significant data showing that it does not hurt the battery too much (see #1084). I was considering using a GLSurfaceView instead which should be a bit better since it can still use the hardware layers for composition. But even that still requires some additional frames copy if I understand correctly. Having VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING work would be the best solution, battery usage wise. |
I agree that having the MediaCodec perform the work will be better performance/battery wise due to only having to do a single pass for each frame. It does look like I skimmed over some information that was pertinent (that's what I get for looking at bugs after a full day of work). However worrying about the battery different between a |
|
Thanks @ojw28. |
@ojw28 Any update? Thanks. |
Issue: #1428 ------------- Created by MOE: https:/google/moe MOE_MIGRATED_REVID=119952373
Cheers @ojw28. Got this working using the dev branch library project. Any idea when you'll be pushing an updated master release? P.S. the applied fix doesn't seem to work if you're obtaining a Surface from TextureView. Cheers. |
Scaling mode only works for |
Issue: #1428 ------------- Created by MOE: https:/google/moe MOE_MIGRATED_REVID=119952373
Is it somehow possible to manually control how the video is scaled in a SurfaceView ? What I have in mind is having something like a letterbox format but that could switch to VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING when the SurfaceView is collapsed.
I have read #1076 and https://code.google.com/p/android/issues/detail?id=37800 but none seem to provide a solution for letterboxing.
I guess I could workaround that by drawing myself in a GLSurfaceView using openGL but I'm unsure if this has battery/performance implications. Any idea how to do this ?
The text was updated successfully, but these errors were encountered: