Skip to content

Commit

Permalink
Add option to play DV profile 7 as HDR HEVC
Browse files Browse the repository at this point in the history
Resolves #270
  • Loading branch information
moneytoo committed Nov 30, 2022
1 parent 3a11da2 commit e7518dc
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Some advanced features can be enabled or configured in settings. To access it, l
* Decoder priority. Prefer device or app decoders.
* Auto frame rate matching. (On Android 11+ and "compatible" displays, ExoPlayer supports [seamless refresh rate switching](https://source.android.com/devices/graphics/multiple-refresh-rate))
* [Tunneled playback](https://medium.com/google-exoplayer/tunneled-video-playback-in-exoplayer-84f084a8094d). Enabling tunneling can improve playback of 4K/HDR content on Android TV.
* Playback of Dolby Vision profile 7 (UHD Blu-ray) as HDR HEVC
* Auto picture-in-picture. When you leave Just Player through the home button and video is playing, PiP will be activated automatically.
* Skip silence
* Repeat toggle
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {
applicationId "com.brouken.player"
minSdkVersion 21
targetSdkVersion 33
versionCode 125
versionCode 126
versionName "0.${versionCode}"
archivesBaseName = "Just.Player.v${versionName}"
}
Expand Down
Binary file modified app/libs/library-core-release.aar
Binary file not shown.
3 changes: 2 additions & 1 deletion app/src/main/java/com/brouken/player/PlayerActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,8 @@ public void initializePlayer() {
.setTsExtractorFlags(DefaultTsPayloadReaderFactory.FLAG_ENABLE_HDMV_DTS_AUDIO_STREAMS)
.setTsExtractorTimestampSearchBytes(1500 * TsExtractor.TS_PACKET_SIZE);
@SuppressLint("WrongConstant") RenderersFactory renderersFactory = new DefaultRenderersFactory(this)
.setExtensionRendererMode(mPrefs.decoderPriority);
.setExtensionRendererMode(mPrefs.decoderPriority)
.setMapDV7ToHevc(mPrefs.mapDV7ToHevc);

ExoPlayer.Builder playerBuilder = new ExoPlayer.Builder(this, renderersFactory)
.setTrackSelector(trackSelector)
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/com/brouken/player/Prefs.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Prefs {
private static final String PREF_KEY_SPEED = "speed";
private static final String PREF_KEY_FILE_ACCESS = "fileAccess";
private static final String PREF_KEY_DECODER_PRIORITY = "decoderPriority";
private static final String PREF_KEY_MAP_DV7 = "mapDV7ToHevc";

final Context mContext;
final SharedPreferences mSharedPreferences;
Expand Down Expand Up @@ -70,6 +71,7 @@ class Prefs {
public boolean repeatToggle = false;
public String fileAccess = "auto";
public int decoderPriority = DefaultRenderersFactory.EXTENSION_RENDERER_MODE_ON;
public boolean mapDV7ToHevc = false;

private LinkedHashMap positions;

Expand Down Expand Up @@ -115,6 +117,7 @@ public void loadUserPreferences() {
repeatToggle = mSharedPreferences.getBoolean(PREF_KEY_REPEAT_TOGGLE, repeatToggle);
fileAccess = mSharedPreferences.getString(PREF_KEY_FILE_ACCESS, fileAccess);
decoderPriority = Integer.parseInt(mSharedPreferences.getString(PREF_KEY_DECODER_PRIORITY, String.valueOf(decoderPriority)));
mapDV7ToHevc = mSharedPreferences.getBoolean(PREF_KEY_MAP_DV7, mapDV7ToHevc);
}

public void updateMedia(final Context context, final Uri uri, final String type) {
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values-cs/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
<string name="pref_skip_silence_off">Přehrávat obsah tak, jak je</string>
<string name="pref_repeat_toggle">Přepínač opakování</string>
<string name="pref_repeat_toggle_summary">Extra tlačítko na nekonečné přehrávání videa dokola (vyžaduje restart aplikace)</string>
<string name="pref_map_dv7">Dolby Vision profil 7</string>
<string name="pref_map_dv7_on">Přehrávat obsah s Dolby Vision profil 7 na HDR displejích</string>
<string name="pref_map_dv7_off">Přehrávat UHD Blu-ray obsah s Dolby Vision tak, jak je</string>
<string name="shortcut_videos">Videa</string>
<string name="button_open">Otevřít</string>
<string name="button_crop">Změnit velikost</string>
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
<string name="pref_skip_silence_off">Play content as is</string>
<string name="pref_repeat_toggle">Repeat toggle</string>
<string name="pref_repeat_toggle_summary">Extra control to allow indefinitely loop video (requires app restart)</string>
<string name="pref_map_dv7">Dolby Vision profile 7 fallback</string>
<string name="pref_map_dv7_on">Play Dolby Vision profile 7 content on HDR displays</string>
<string name="pref_map_dv7_off">Play UHD Blu-ray content containing Dolby Vision as is</string>
<string name="shortcut_videos">Videos</string>
<string name="button_open">Open</string>
<string name="button_crop">Resize</string>
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/res/xml/root_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@
app:summary="@string/pref_tunneling_summary"
app:title="@string/pref_tunneling" />

<SwitchPreferenceCompat
app:key="mapDV7ToHevc"
app:defaultValue="false"
app:summaryOn="@string/pref_map_dv7_on"
app:summaryOff="@string/pref_map_dv7_off"
app:title="@string/pref_map_dv7" />

<SwitchPreferenceCompat
app:key="autoPiP"
app:defaultValue="false"
Expand Down

0 comments on commit e7518dc

Please sign in to comment.