@@ -95,6 +95,7 @@ private static HevcConfig parseImpl(
95
95
// Concatenate the codec-specific data into a single buffer.
96
96
data .setPosition (csdStartPosition );
97
97
byte [] buffer = new byte [csdLength ];
98
+ int maxSubLayers = Format .NO_VALUE ;
98
99
int bufferPosition = 0 ;
99
100
int width = Format .NO_VALUE ;
100
101
int height = Format .NO_VALUE ;
@@ -131,6 +132,7 @@ private static HevcConfig parseImpl(
131
132
NalUnitUtil .H265SpsData spsData =
132
133
NalUnitUtil .parseH265SpsNalUnit (
133
134
buffer , bufferPosition , bufferPosition + nalUnitLength , currentVpsData );
135
+ maxSubLayers = spsData .maxSubLayersMinus1 + 1 ;
134
136
width = spsData .width ;
135
137
height = spsData .height ;
136
138
bitdepthLuma = spsData .bitDepthLumaMinus8 + 8 ;
@@ -172,6 +174,7 @@ private static HevcConfig parseImpl(
172
174
return new HevcConfig (
173
175
initializationData ,
174
176
lengthSizeMinusOne + 1 ,
177
+ maxSubLayers ,
175
178
width ,
176
179
height ,
177
180
bitdepthLuma ,
@@ -200,6 +203,9 @@ private static HevcConfig parseImpl(
200
203
/** The length of the NAL unit length field in the bitstream's container, in bytes. */
201
204
public final int nalUnitLengthFieldLength ;
202
205
206
+ /** The {@code sps_max_sub_layers_minus1 + 1} value: the number of temporal sub-layers. */
207
+ public final int maxSubLayers ;
208
+
203
209
/** The width of each decoded frame, or {@link Format#NO_VALUE} if unknown. */
204
210
public final int width ;
205
211
@@ -258,6 +264,7 @@ private static HevcConfig parseImpl(
258
264
private HevcConfig (
259
265
List <byte []> initializationData ,
260
266
int nalUnitLengthFieldLength ,
267
+ int maxSubLayers ,
261
268
int width ,
262
269
int height ,
263
270
int bitdepthLuma ,
@@ -272,6 +279,7 @@ private HevcConfig(
272
279
@ Nullable NalUnitUtil .H265VpsData vpsData ) {
273
280
this .initializationData = initializationData ;
274
281
this .nalUnitLengthFieldLength = nalUnitLengthFieldLength ;
282
+ this .maxSubLayers = maxSubLayers ;
275
283
this .width = width ;
276
284
this .height = height ;
277
285
this .bitdepthLuma = bitdepthLuma ;
0 commit comments