-
-
Notifications
You must be signed in to change notification settings - Fork 248
feat(YouTube - Spoof client): Allow forcing AVC codec with iOS #679
feat(YouTube - Spoof client): Allow forcing AVC codec with iOS #679
Conversation
Does not seem to fix anything but might as well do it
it might be worth adding a toggle for iOS to force AVC1, as it appears some devices can act up when using VP9 (even though they have VP9 hardware decoding) ReVanced/revanced-patches#3353 edit: the issue above might be unrelated and have nothing to do with AVC1 vs VP9 |
Why would the issue be unrelated? |
Because the user in that issue also saw dropped frames in Android VR as well. |
It might be worth renaming So some users updating from the first release of Spoof client will have Android VR turned on by default, caused by their old settings. The downside to this change is anyone who currently has and wants Android VR will have to change the setting again. |
Added AVC1 (aka H.264) override. Googling for "VP9 problems" and you get many forum and bug reports for non YouTube apps that struggle with VP9 (and report no problem with AVC1), despite the reported devices officially supporting VP9. So perhaps the devices don't support VP9 in all codec configurations, or the device overheats with VP9 and throttles the chipset. The users who report VP9 issues seem to be those with older first generation VP9 chipsets (such as Snapdragon 810 released in 2015), or they have a budget non mainstream chipset. |
…ference due to excessive text clipping in foreign languages
After some sleep, I finally came up with a logic to check both codecs in one check. 😅 /**
* @return 0 = AVC, 1 = VP9, 2 = AV1
*/
private static int checkSupportedHardwareDecoding() {
boolean vp9found = false;
MediaCodecList codecList = new MediaCodecList(MediaCodecList.ALL_CODECS);
for (MediaCodecInfo codecInfo : codecList.getCodecInfos()) {
final boolean isHardwareAccelerated = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
? codecInfo.isHardwareAccelerated()
: !codecInfo.getName().startsWith("OMX.google"); // Software decoder.
if (isHardwareAccelerated && !codecInfo.isEncoder()) {
for (String type : codecInfo.getSupportedTypes()) {
if (type.equalsIgnoreCase("video/av01")) {
Logger.printDebug(() -> "Device supports AV1 hardware decoding.");
return 2;
} else if (!vp9found && type.equalsIgnoreCase("video/x-vnd.on2.vp9")) {
vp9found = true;
}
}
}
}
if (vp9found) {
Logger.printDebug(() -> "Device supports VP9 hardware decoding.");
return 1;
} else {
Logger.printDebug(() -> "Device does not support either VP9 or AV1 hardware decoding.");
return 0;
}
}
/**
* Represents the hardware decoding supported by the device.
* 0 = AVC only.
* 1 = VP9 hardware decoding is supported.
* 2 = AV1 hardware decoding is supported.
*/
private static final int SUPPORTED_CODEC_LEVEL = checkSupportedHardwareDecoding();
private static boolean allowVP9() {
return SUPPORTED_CODEC_LEVEL >= 1 && !Settings.SPOOF_CLIENT_IOS_FORCE_AVC1.get();
}
private static boolean allowAV1() {
return SUPPORTED_CODEC_LEVEL >= 2;
} I have no idea if this code is well designed or not. |
That works. But for this situation I think a little copy paste and using two methods is simpler and easier to understand. |
# [1.14.0-dev.1](v1.13.1-dev.2...v1.14.0-dev.1) (2024-08-22) ### Features * **YouTube - Spoof client:** Allow forcing AVC codec with iOS ([#679](#679)) ([2c471f3](2c471f3))
# [1.14.0-dev.1](v1.13.1...v1.14.0-dev.1) (2024-08-26) ### Bug Fixes * **YouTube - Hide layout components:** Hide new kind of community post ([ReVanced#678](https://github.com/zainarbani/revanced-integrations/issues/678)) ([6be257a](6be257a)) * **YouTube - SponsorBlock:** Handle if the user enters an invalid number into any SB settings ([01f084d](01f084d)) * **YouTube - Spoof Client:** Fix playback by replace streaming data ([d498d79](d498d79)) ### Features * **YouTube - Spoof client:** Allow forcing AVC codec with iOS ([ReVanced#679](https://github.com/zainarbani/revanced-integrations/issues/679)) ([2c471f3](2c471f3))
# [1.14.0](v1.13.0...v1.14.0) (2024-09-18) ### Bug Fixes * **YouTube - Check environment patch:** Allow adb installs even if patched more than 30 minutes ago ([5adf8bd](5adf8bd)) * **YouTube - Check environment patch:** Show if patched apk is too old, if the install source is not Manager or ADB ([18048f3](18048f3)) * **YouTube - Check environment patch:** Use app install/update time instead of current time ([#687](#687)) ([b0d82b0](b0d82b0)) * **YouTube - GmsCore support:** Show an error toast if GmsCore is included with root mounted installation ([#686](#686)) ([a4848be](a4848be)) * **YouTube - Hide layout components:** Hide new kind of community post ([#678](#678)) ([6be257a](6be257a)) * **YouTube - Return YouTube Dislike:** Show correct value when swiping back to prior Short and disliking ([2eb5e3a](2eb5e3a)) * **YouTube - ReturnYouTubeDislike:** Show estimated like count for videos with hidden likes ([#684](#684)) ([27d2b60](27d2b60)) * **YouTube - SponsorBlock:** Add summary text to 'view my segments' button ([0f5dfb4](0f5dfb4)) * **YouTube - SponsorBlock:** Handle if the user enters an invalid number into any SB settings ([01f084d](01f084d)) * **YouTube:** Fix issues related to playback by replace streaming data ([#680](#680)) ([0468235](0468235)) ### Features * Add `Check environment` patch ([#683](#683)) ([e856455](e856455)) * **YouTube - Hide Shorts components:** Hide 'Use this sound' button ([#691](#691)) ([6f3d2ff](6f3d2ff)) * **YouTube - Keyword filter:** Add syntax to match whole keywords and not substrings ([#681](#681)) ([5314dd9](5314dd9)) * **YouTube - Spoof client:** Allow forcing AVC codec with iOS ([#679](#679)) ([2c471f3](2c471f3)) * **YouTube:** Add donation link to settings about screen ([#688](#688)) ([b816c45](b816c45))
# [1.17.0-dev.1](v1.16.1...v1.17.0-dev.1) (2024-10-04) ### Bug Fixes * **YouTube - Check environment patch:** Allow adb installs even if patched more than 30 minutes ago ([5adf8bd](5adf8bd)) * **YouTube - Check environment patch:** Show if patched apk is too old, if the install source is not Manager or ADB ([18048f3](18048f3)) * **YouTube - Check environment patch:** Use app install/update time instead of current time ([ReVanced#687](https://github.com/zainarbani/revanced-integrations/issues/687)) ([b0d82b0](b0d82b0)) * **YouTube - Check environment:** Only use fields available since Android 8 ([ReVanced#693](https://github.com/zainarbani/revanced-integrations/issues/693)) ([c0829c3](c0829c3)) * **YouTube - Check watch history domain name resolution:** Do not show warning if network connection is flaky ([ReVanced#702](https://github.com/zainarbani/revanced-integrations/issues/702)) ([80482df](80482df)) * **YouTube - GmsCore support:** Show an error toast if GmsCore is included with root mounted installation ([ReVanced#686](https://github.com/zainarbani/revanced-integrations/issues/686)) ([a4848be](a4848be)) * **YouTube - Hide layout components:** Hide new kind of community post ([ReVanced#678](https://github.com/zainarbani/revanced-integrations/issues/678)) ([6be257a](6be257a)) * **YouTube - Hide layout components:** Hide new kind of community posts ([ReVanced#695](https://github.com/zainarbani/revanced-integrations/issues/695)) ([b384926](b384926)) * **YouTube - Return YouTube Dislike:** Show correct value when swiping back to prior Short and disliking ([2eb5e3a](2eb5e3a)) * **YouTube - ReturnYouTubeDislike:** Show estimated like count for videos with hidden likes ([ReVanced#684](https://github.com/zainarbani/revanced-integrations/issues/684)) ([27d2b60](27d2b60)) * **YouTube - SponsorBlock:** Add summary text to 'view my segments' button ([0f5dfb4](0f5dfb4)) * **YouTube - SponsorBlock:** Handle if the user enters an invalid number into any SB settings ([01f084d](01f084d)) * **YouTube - Spoof video streams:** Change default client type to Android VR ([a2e8bbb](a2e8bbb)) * **YouTube - Spoof video streams:** Change default client type to Android VR ([ReVanced#697](https://github.com/zainarbani/revanced-integrations/issues/697)) ([d06706d](d06706d)) * **YouTube - Spoof video streams:** Handle app left open for a long time ([ReVanced#709](https://github.com/zainarbani/revanced-integrations/issues/709)) ([ea4b073](ea4b073)) * **YouTube:** Fix issues related to playback by replace streaming data ([ReVanced#680](https://github.com/zainarbani/revanced-integrations/issues/680)) ([0468235](0468235)) * **YouTube:** Show video chapter titles without clipping when overlay buttons are enabled ([ReVanced#699](https://github.com/zainarbani/revanced-integrations/issues/699)) ([325cc17](325cc17)) ### Features * Add `Check environment` patch ([ReVanced#683](https://github.com/zainarbani/revanced-integrations/issues/683)) ([e856455](e856455)) * Merge branch `feat/yt-bump` to `dev` ([48a7ac4](48a7ac4)) * **YouTube - Disable precise seeking gesture:** Hide "pull up" label that shows up when swiping ([ReVanced#696](https://github.com/zainarbani/revanced-integrations/issues/696)) ([0b9afd0](0b9afd0)) * **YouTube - Hide Shorts components:** Add `Hide save music`, `Hide stickers` ([ReVanced#703](https://github.com/zainarbani/revanced-integrations/issues/703)) ([a87456e](a87456e)) * **YouTube - Hide Shorts components:** Add option to hide like fountain ([ReVanced#708](https://github.com/zainarbani/revanced-integrations/issues/708)) ([16c3ef7](16c3ef7)) * **YouTube - Hide Shorts components:** Hide 'Use this sound' button ([ReVanced#691](https://github.com/zainarbani/revanced-integrations/issues/691)) ([6f3d2ff](6f3d2ff)) * **YouTube - Keyword filter:** Add syntax to match whole keywords and not substrings ([ReVanced#681](https://github.com/zainarbani/revanced-integrations/issues/681)) ([5314dd9](5314dd9)) * **YouTube - Spoof client:** Allow forcing AVC codec with iOS ([ReVanced#679](https://github.com/zainarbani/revanced-integrations/issues/679)) ([2c471f3](2c471f3)) * **YouTube:** Add donation link to settings about screen ([ReVanced#688](https://github.com/zainarbani/revanced-integrations/issues/688)) ([b816c45](b816c45))
Integration changes for ReVanced/revanced-patches#3570