if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.BAKLAVA){valmediaQualityManager:MediaQualityManager=context.getSystemService(MediaQualityManager::class.java)valprofiles=mediaQualityManager.getAvailablePictureProfiles(null)for(profileinprofiles){// If we have a system sports profile, apply it to our media codecif(profile.profileType==PictureProfile.TYPE_SYSTEM && profile.name==NAME_SPORTS){valbundle=Bundle().apply{putParcelable(MediaFormat.KEY_PICTURE_PROFILE_INSTANCE,profile)}mediaCodec.setParameters(bundle)}}}
[null,null,["最后更新时间 (UTC):2025-08-21。"],[],[],null,["# Adjust display settings\n\nAndroid includes APIs that allow apps to adjust display settings on supported\nhardware. On Android TV OS, apps can take advantage of this to ensure that\ncontent displays in the best possible format, by matching the framerate and\ncolor profile for the ideal watching experience.\n\nMatch content frame rate\n------------------------\n\nWhen the framerate of a video doesn't match the refresh rate of the display,\nusers can experience unpleasant motion judder artifacts from frame rate\nconversion. This is especially visible during slow panning shots. For this\nreason, it's important to use the\n[`SurfaceControl.Transaction.setFrameRate()`](/training/tv/playback/(/reference/android/view/SurfaceControl.Transaction#setFrameRate(android.view.SurfaceControl,%20float,%20int,%20int)))\nAPI to notify the framework about the frame rate of the content and to signal\nwhether the video content is eligible for a non-seamless\n[frame rate switch](/guide/topics/media/frame-rate#non-seamless).\n\nFor more information, read the [frame rate guide](/guide/topics/media/frame-rate).\n\nMatch preferred picture profiles\n--------------------------------\n\nThe MediaQuality API in Android 16 allows developers to take control over\npicture profiles.\n\nSome example scenarios include:\n\n- For movies and TV series that are mastered with a wider dynamic range, developers might request Filmmaker mode to accurately display content as the creator intended for it to look. A cinema profile with greater color accuracy brings out subtle details in shadows in favor of increasing brightness.\n- Live sporting events, which are often mastered with a narrow dynamic range and watched in the daylight, can benefit from a profile that gives preference to brightness over color accuracy.\n- Game developers can request a low latency profile with minimal image processing so players can get the best performance from their display.\n\n| **Note:** OEMs may add additional presets and provide mechanisms for users to define their own picture profiles. This implementation uses the [`createPictureProfile()`](/reference/android/media/quality/MediaQualityManager#createPictureProfile(android.media.quality.PictureProfile)) method that requires a system permission.\n\n### Selecting a system picture profile\n\nBefore selecting a picture profile, it's important to first validate that the\ndevice supports it.\n\nThe following snippet shows how to use\n[`getAvailablePictureProfiles()`](/reference/android/media/quality/MediaQualityManager#getAvailablePictureProfiles(android.media.quality.MediaQualityManager.ProfileQueryParams)) to query all\nsupported picture profiles and apply a sports profile: \n\n if (Build.VERSION.SDK_INT \u003e= Build.VERSION_CODES.BAKLAVA) {\n val mediaQualityManager: MediaQualityManager =\n context.getSystemService(MediaQualityManager::class.java)\n val profiles = mediaQualityManager.getAvailablePictureProfiles(null)\n for (profile in profiles) {\n // If we have a system sports profile, apply it to our media codec\n if (profile.profileType == PictureProfile.TYPE_SYSTEM\n && profile.name == NAME_SPORTS\n ) {\n val bundle = Bundle().apply { \n putParcelable(MediaFormat.KEY_PICTURE_PROFILE_INSTANCE, profile)\n }\n mediaCodec.setParameters(bundle)\n }\n }\n }\n\nTo obtain a specific profile by name, use [`getPictureProfile()`](/reference/android/media/quality/MediaQualityManager#getPictureProfile(int,%20java.lang.String,%20android.media.quality.MediaQualityManager.ProfileQueryParams)): \n\n if (Build.VERSION.SDK_INT \u003e= Build.VERSION_CODES.BAKLAVA) {\n val profile = mediaQualityManager.getPictureProfile(\n PictureProfile.TYPE_SYSTEM, NAME_SPORTS, null)\n }\n\nIf you don't need to query whether a profile is available, profiles can be\nprovided directly by their ID to a MediaCodec by using\n`MediaFormat.KEY_PICTURE_PROFILE_INSTANCE`.\n\nWhile supported profiles may differ by device, you may consider matching against\nthe following known system profile IDs: \n\n const val NAME_STANDARD: String = \"standard\"\n const val NAME_VIVID: String = \"vivid\"\n const val NAME_SPORTS: String = \"sports\"\n const val NAME_GAME: String = \"game\"\n const val NAME_MOVIE: String = \"movie\"\n const val NAME_ENERGY_SAVING: String = \"energy_saving\"\n const val NAME_USER: String = \"user\"\n\n| **Note:** These strings are provided as recommendations to OEMs and are subject to change in future API levels."]]