-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Aperture: Hook up video dynamic range
Change-Id: Ia7bf123cfb6afca962e195c991b8919f985c1f49
- Loading branch information
1 parent
4d1eedf
commit b349c8a
Showing
12 changed files
with
265 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
The person or persons who have associated work with this document (the "Dedicator" or "Certifier") hereby either (a) certifies that, to the best of his knowledge, the work of authorship identified is in the public domain of the country from which the work is published, or (b) hereby dedicates whatever copyright the dedicators holds in the work of authorship identified below (the "Work") to the public domain. A certifier, moreover, dedicates any copyright interest he may have in the associated work, and for these purposes, is described as a "dedicator" below. | ||
|
||
A certifier has taken reasonable steps to verify the copyright status of this work. Certifier recognizes that his good faith efforts may not shield him from liability if in fact the work certified is not in the public domain. | ||
|
||
Dedicator makes this dedication for the benefit of the public at large and to the detriment of the Dedicator's heirs and successors. Dedicator intends this dedication to be an overt act of relinquishment in perpetuity of all present and future rights under copyright law, whether vested or contingent, in the Work. Dedicator understands that such relinquishment of all rights includes the relinquishment of all rights to enforce (by lawsuit or otherwise) those copyrights in the Work. | ||
|
||
Dedicator recognizes that, once placed in the public domain, the Work may be freely reproduced, distributed, transmitted, used, modified, built upon, or otherwise exploited by anyone for any purpose, commercial or non-commercial, and in any way, including by methods that have not yet been invented or conceived. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
app/src/main/java/org/lineageos/aperture/camera/VideoDynamicRange.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2022-2023 The LineageOS Project | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.lineageos.aperture.camera | ||
|
||
import androidx.annotation.DrawableRes | ||
import androidx.annotation.StringRes | ||
import androidx.camera.core.DynamicRange | ||
import org.lineageos.aperture.R | ||
|
||
/** | ||
* Video dynamic range. | ||
* @param dynamicRange The [DynamicRange] it refers to | ||
* @param title A string resource used to represent the dynamic range | ||
* @param icon An icon resource used to represent the dynamic range | ||
*/ | ||
enum class VideoDynamicRange( | ||
val dynamicRange: DynamicRange, | ||
@StringRes val title: Int, | ||
@DrawableRes val icon: Int, | ||
) { | ||
SDR( | ||
DynamicRange.SDR, | ||
R.string.video_dynamic_range_sdr, | ||
R.drawable.ic_hdr_off, | ||
), | ||
HLG_10_BIT( | ||
DynamicRange.HLG_10_BIT, | ||
R.string.video_dynamic_range_hlg_10_bit, | ||
R.drawable.ic_hdr_on, | ||
), | ||
HDR10_10_BIT( | ||
DynamicRange.HDR10_10_BIT, | ||
R.string.video_dynamic_range_hdr10_10_bit, | ||
R.drawable.ic_hdr_on, | ||
), | ||
HDR10_PLUS_10_BIT( | ||
DynamicRange.HDR10_PLUS_10_BIT, | ||
R.string.video_dynamic_range_hdr10_plus_10_bit, | ||
R.drawable.ic_hdr_off, | ||
), | ||
DOLBY_VISION_10_BIT( | ||
DynamicRange.DOLBY_VISION_10_BIT, | ||
R.string.video_dynamic_range_dolby_vision_10_bit, | ||
R.drawable.ic_dolby, | ||
), | ||
DOLBY_VISION_8_BIT( | ||
DynamicRange.DOLBY_VISION_8_BIT, | ||
R.string.video_dynamic_range_dolby_vision_8_bit, | ||
R.drawable.ic_dolby, | ||
); | ||
|
||
companion object { | ||
fun fromDynamicRange(dynamicRange: DynamicRange) = values().first { | ||
it.dynamicRange == dynamicRange | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
app/src/main/java/org/lineageos/aperture/camera/VideoQualityInfo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 The LineageOS Project | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.lineageos.aperture.camera | ||
|
||
import androidx.camera.video.Quality | ||
|
||
/** | ||
* Video [Quality] info. | ||
* @param quality The quality | ||
* @param supportedFrameRates The supported frame rates for this quality | ||
* @param supportedDynamicRanges The supported dynamic ranges for this quality | ||
*/ | ||
data class VideoQualityInfo( | ||
val quality: Quality, | ||
val supportedFrameRates: Set<FrameRate>, | ||
val supportedDynamicRanges: Set<VideoDynamicRange>, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
SPDX-FileCopyrightText: Dolby Laboratories Inc. | ||
SPDX-License-Identifier: CC-PDDC | ||
--> | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="279.08dp" | ||
android:height="193.28dp" | ||
android:tint="#000000" | ||
android:viewportWidth="279.08" | ||
android:viewportHeight="193.28"> | ||
<path | ||
android:fillColor="@android:color/white" | ||
android:pathData="m279.08,193.28h-28.14c-53.82,0 -96.64,-44.04 -96.64,-96.64C154.31,44.04 198.35,0 250.95,0h28.14z" /> | ||
<path | ||
android:fillColor="@android:color/white" | ||
android:pathData="m0,0h28.14c53.82,0 96.64,44.04 96.64,96.64 0,52.6 -44.04,96.64 -96.64,96.64H0Z" /> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
SPDX-FileCopyrightText: Material Design Authors / Google LLC | ||
SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:tint="#000000" | ||
android:viewportWidth="960" | ||
android:viewportHeight="960"> | ||
<path | ||
android:fillColor="@android:color/white" | ||
android:pathData="M792,904L56,168L112,112L848,846L792,904ZM780,600L744,520L700,520L700,586L640,526L640,360L780,360Q804,360 822,378Q840,396 840,420L840,460Q840,478 829.5,492.5Q819,507 804,516L840,600L780,600ZM700,460L780,460Q780,460 780,460Q780,460 780,460L780,420Q780,420 780,420Q780,420 780,420L700,420L700,460ZM580,466L474,360L520,360Q544,360 562,378Q580,396 580,420L580,466ZM120,600L120,360L180,360L180,440L260,440L260,360L320,360L320,600L260,600L260,500L180,500L180,600L120,600ZM380,436L440,496L440,540L485,540Q485,540 485,540Q485,540 485,540L540,596Q535,598 530,599Q525,600 520,600L380,600L380,436Z" /> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
SPDX-FileCopyrightText: Material Design Authors / Google LLC | ||
SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:tint="#000000" | ||
android:viewportWidth="24" | ||
android:viewportHeight="24"> | ||
<path | ||
android:fillColor="@android:color/white" | ||
android:pathData="M21,11.5v-1c0,-0.8 -0.7,-1.5 -1.5,-1.5L16,9v6h1.5v-2h1.1l0.9,2L21,15l-0.9,-2.1c0.5,-0.3 0.9,-0.8 0.9,-1.4zM19.5,11.5h-2v-1h2v1zM6.5,11h-2L4.5,9L3,9v6h1.5v-2.5h2L6.5,15L8,15L8,9L6.5,9v2zM13,9L9.5,9v6L13,15c0.8,0 1.5,-0.7 1.5,-1.5v-3c0,-0.8 -0.7,-1.5 -1.5,-1.5zM13,13.5h-2v-3h2v3z" /> | ||
</vector> |
Oops, something went wrong.