From 7b0a87897c75329135c1ed5d205b6d0fbf9d0500 Mon Sep 17 00:00:00 2001 From: Kailiang Chen Date: Mon, 27 Nov 2023 17:33:20 -0800 Subject: [PATCH] [Camera2Video] Add note that MediaRecorder is not supporting HDR Video capture Bug: b/308178715 Test: test on real devices Change-Id: Ide226dd460ff05737f21850260ffc315cfdd423d --- .../android/camera2/video/fragments/EncodeApiFragment.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Camera2Video/app/src/main/java/com/example/android/camera2/video/fragments/EncodeApiFragment.kt b/Camera2Video/app/src/main/java/com/example/android/camera2/video/fragments/EncodeApiFragment.kt index cd8c4146..c4022776 100644 --- a/Camera2Video/app/src/main/java/com/example/android/camera2/video/fragments/EncodeApiFragment.kt +++ b/Camera2Video/app/src/main/java/com/example/android/camera2/video/fragments/EncodeApiFragment.kt @@ -52,7 +52,7 @@ class EncodeApiFragment : Fragment() { view as RecyclerView view.apply { layoutManager = LinearLayoutManager(requireContext()) - val modeList = enumerateModes() + val modeList = enumerateModes(args.dynamicRange) val layoutId = android.R.layout.simple_list_item_1 adapter = GenericListAdapter(modeList, itemLayoutId = layoutId) { view, item, _ -> view.findViewById(android.R.id.text1).text = item.name @@ -79,11 +79,13 @@ class EncodeApiFragment : Fragment() { val value: Boolean) @SuppressLint("InlinedApi") - private fun enumerateModes(): List { + private fun enumerateModes(dynamicRange: Long): List { val modeList: MutableList = mutableListOf() modeList.add(ApiInfo("MediaCodec", false)) - modeList.add(ApiInfo("MediaRecorder", true)) + if (dynamicRange == DynamicRangeProfiles.STANDARD) { + modeList.add(ApiInfo("MediaRecorder", true)) + } return modeList }