0

I'm working on Camera Apps using Android 13 API. However, when I tried to obtain the maxFrameWidth and maxFrameHeight of each supported video encoders such as MPEG4, H263 and so on, VideoEncoderCap is not able to call. I wonder is it deprecated in Android 13 ?

I set mintargetSdkVersion and targetSdkVersion to 30, seems not working too.

The reason why I want to use VideoEncoderCap because the maxFrameWidth and maxFrameHeight obtained through MediaCodecInfo (getSupportedHeights().getUpper()) is different compare to VideoEncoderCap.

Any advice are welcome.

peter teoh
  • 25
  • 6
  • Based on: https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-13.0.0_r45/media/java/android/media/EncoderCapabilities.java the entire class has the [@hide annotation](https://stackoverflow.com/q/31908205/295004) and if you checked [Android 12 version of that file](https://android.googlesource.com/platform/frameworks/base/+/refs/heads/android12-release/media/java/android/media/EncoderCapabilities.java) those fields you are interested in where marked with [@UnsupportedAppUsage](https://stackoverflow.com/q/52499754/295004) – Morrison Chang May 21 '23 at 06:59
  • @Morrison Chang, so it's not recommended to use in Android 13 ? Is there any other method to access same dimensions with other API ? So far I tested `MediaCodecInfo` `MediaCodecList` , the output is different. – peter teoh May 21 '23 at 09:36
  • @Morrison Chang, I compared both links you shared, it seems like both classes from the both links are marked with `@unsuportedAppUsage` , I don't see the `@hide` annototation except the one in the commented code. – peter teoh May 21 '23 at 09:47
  • Somehow missed the both have the [@hide annotation](https://stackoverflow.com/q/17035271/295004). Details/use case as to why you are accessing `VideoEncoderCap` fields might be helpful. Found this issue which may be related: https://issuetracker.google.com/issues/224990734 – Morrison Chang May 21 '23 at 18:06
  • @Morrison Chang, I'm accessing those parameters to calculate the max frame width / max frame height of video encoder. – peter teoh May 22 '23 at 13:35

0 Answers0