Package com.castlabs.android.player
Class DefaultTrackTypeProvider
java.lang.Object
com.castlabs.android.player.TrackTypeProvider
com.castlabs.android.player.DefaultTrackTypeProvider
Default implementation of
TrackTypeProvider
with the video tracks
separated according to the following video resolutions: SD, HD or UHD.- Since:
- 4.0.7
-
Field Summary
Fields inherited from class com.castlabs.android.player.TrackTypeProvider
TYPE_UNDEFINED
-
Constructor Summary
ConstructorDescriptionDefault pixel values are specified as: HD = 1280x720 FHD = 1920x1080 UHD = 3840x2160DefaultTrackTypeProvider
(Point hdMinPx, Point fhdMinPx, Point uhdMinPx) Specify pixels for each resolution type: HD, FHD and UHD. -
Method Summary
Modifier and TypeMethodDescriptionint
getGroupType
(int type1, int type2) Gets the track group type by provided track or track group types.int
getTrackType
(com.google.android.exoplayer2.Format format) Defines the type of the track with the provided format.float
getTrackTypeWeight
(int type) Defines the weight of the provided track.boolean
typesOverlap
(int type1, int type2) Returnstrue
if the types overlap otherwisefalse
.
-
Constructor Details
-
DefaultTrackTypeProvider
public DefaultTrackTypeProvider()Default pixel values are specified as: HD = 1280x720 FHD = 1920x1080 UHD = 3840x2160 -
DefaultTrackTypeProvider
public DefaultTrackTypeProvider(@NonNull Point hdMinPx, @NonNull Point fhdMinPx, @NonNull Point uhdMinPx) Specify pixels for each resolution type: HD, FHD and UHD. Some values can be equal for instance if HD and FHD are both specified as 1920 then 720 rendition is considered FHD and will not be merged with adaptation having 1920 renditions.- Parameters:
hdMinPx
- HD min pixelsfhdMinPx
- FHD min pixelsuhdMinPx
- UHD min pixels
-
-
Method Details
-
getTrackType
public int getTrackType(@NonNull com.google.android.exoplayer2.Format format) Description copied from class:TrackTypeProvider
Defines the type of the track with the provided format. The type itself could be defined as one of theint
bits set.- Specified by:
getTrackType
in classTrackTypeProvider
- Parameters:
format
- The track format- Returns:
- The track type or
TrackTypeProvider.TYPE_UNDEFINED
-
getTrackTypeWeight
public float getTrackTypeWeight(int type) Description copied from class:TrackTypeProvider
Defines the weight of the provided track. The value should be normalized to 0f .. 1.0f- Specified by:
getTrackTypeWeight
in classTrackTypeProvider
- Parameters:
type
- The track or track group type- Returns:
- The normalized to 0f .. 1.0f weight
-
getGroupType
public int getGroupType(int type1, int type2) Description copied from class:TrackTypeProvider
Gets the track group type by provided track or track group types. In case the track types are defined as bit-sets then the implementation here would be just logical OR of the track group and track types.- Specified by:
getGroupType
in classTrackTypeProvider
- Parameters:
type1
- The track or track group type onetype2
- The track or track group type two- Returns:
- The track group type
-
typesOverlap
public boolean typesOverlap(int type1, int type2) Description copied from class:TrackTypeProvider
Returnstrue
if the types overlap otherwisefalse
. In case the track types are defined as bit-sets then the implementation here would be just logical AND of the track group and track types.- Specified by:
typesOverlap
in classTrackTypeProvider
- Parameters:
type1
- The track or track group type onetype2
- The track or track group type two- Returns:
- True if the types overlap otherwise false
-