media/docs/doc/reference-v1/com/google/android/exoplayer/util/NalUnitUtil.html
2021-04-20 17:32:19 +01:00

561 lines
27 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_101) on Wed Dec 14 17:18:29 GMT 2016 -->
<title>NalUnitUtil (ExoPlayer library)</title>
<meta name="date" content="2016-12-14">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="NalUnitUtil (ExoPlayer library)";
}
}
catch(err) {
}
//-->
var methods = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9,"i7":9,"i8":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../com/google/android/exoplayer/util/MpegAudioHeader.html" title="class in com.google.android.exoplayer.util"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../com/google/android/exoplayer/util/NalUnitUtil.PpsData.html" title="class in com.google.android.exoplayer.util"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/google/android/exoplayer/util/NalUnitUtil.html" target="_top">Frames</a></li>
<li><a href="NalUnitUtil.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.google.android.exoplayer.util</div>
<h2 title="Class NalUnitUtil" class="title">Class NalUnitUtil</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>com.google.android.exoplayer.util.NalUnitUtil</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public final class <span class="typeNameLabel">NalUnitUtil</span>
extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block">Utility methods for handling H.264/AVC and H.265/HEVC NAL units.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer/util/NalUnitUtil.PpsData.html" title="class in com.google.android.exoplayer.util">NalUnitUtil.PpsData</a></span></code>
<div class="block">Holds data parsed from a picture parameter set NAL unit.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer/util/NalUnitUtil.SpsData.html" title="class in com.google.android.exoplayer.util">NalUnitUtil.SpsData</a></span></code>
<div class="block">Holds data parsed from a sequence parameter set NAL unit.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static float[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer/util/NalUnitUtil.html#ASPECT_RATIO_IDC_VALUES">ASPECT_RATIO_IDC_VALUES</a></span></code>
<div class="block">Aspect ratios indexed by aspect_ratio_idc, in H.264 and H.265 SPSs.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer/util/NalUnitUtil.html#EXTENDED_SAR">EXTENDED_SAR</a></span></code>
<div class="block">Value for aspect_ratio_idc indicating an extended aspect ratio, in H.264 and H.265 SPSs.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static byte[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer/util/NalUnitUtil.html#NAL_START_CODE">NAL_START_CODE</a></span></code>
<div class="block">Four initial bytes that must prefix NAL units for decoding.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer/util/NalUnitUtil.html#clearPrefixFlags-boolean:A-">clearPrefixFlags</a></span>(boolean[]&nbsp;prefixFlags)</code>
<div class="block">Clears prefix flags, as used by <a href="../../../../../com/google/android/exoplayer/util/NalUnitUtil.html#findNalUnit-byte:A-int-int-boolean:A-"><code>findNalUnit(byte[], int, int, boolean[])</code></a>.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer/util/NalUnitUtil.html#discardToSps-java.nio.ByteBuffer-">discardToSps</a></span>(<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</a>&nbsp;data)</code>
<div class="block">Discards data from the buffer up to the first SPS, where <code>data.position()</code> is interpreted
as the length of the buffer.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer/util/NalUnitUtil.html#findNalUnit-byte:A-int-int-boolean:A-">findNalUnit</a></span>(byte[]&nbsp;data,
int&nbsp;startOffset,
int&nbsp;endOffset,
boolean[]&nbsp;prefixFlags)</code>
<div class="block">Finds the first NAL unit in <code>data</code>.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer/util/NalUnitUtil.html#getH265NalUnitType-byte:A-int-">getH265NalUnitType</a></span>(byte[]&nbsp;data,
int&nbsp;offset)</code>
<div class="block">Gets the type of the H.265 NAL unit in <code>data</code> that starts at <code>offset</code>.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer/util/NalUnitUtil.html#getNalUnitType-byte:A-int-">getNalUnitType</a></span>(byte[]&nbsp;data,
int&nbsp;offset)</code>
<div class="block">Gets the type of the NAL unit in <code>data</code> that starts at <code>offset</code>.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>static byte[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer/util/NalUnitUtil.html#parseChildNalUnit-com.google.android.exoplayer.util.ParsableByteArray-">parseChildNalUnit</a></span>(<a href="../../../../../com/google/android/exoplayer/util/ParsableByteArray.html" title="class in com.google.android.exoplayer.util">ParsableByteArray</a>&nbsp;atom)</code>
<div class="block">Constructs and returns a NAL unit with a start code followed by the data in <code>atom</code>.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>static <a href="../../../../../com/google/android/exoplayer/util/NalUnitUtil.PpsData.html" title="class in com.google.android.exoplayer.util">NalUnitUtil.PpsData</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer/util/NalUnitUtil.html#parsePpsNalUnit-com.google.android.exoplayer.util.ParsableBitArray-">parsePpsNalUnit</a></span>(<a href="../../../../../com/google/android/exoplayer/util/ParsableBitArray.html" title="class in com.google.android.exoplayer.util">ParsableBitArray</a>&nbsp;data)</code>
<div class="block">Parses a PPS NAL unit using the syntax defined in ITU-T Recommendation H.264 (2013) subsection
7.3.2.2.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../com/google/android/exoplayer/util/NalUnitUtil.SpsData.html" title="class in com.google.android.exoplayer.util">NalUnitUtil.SpsData</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer/util/NalUnitUtil.html#parseSpsNalUnit-com.google.android.exoplayer.util.ParsableBitArray-">parseSpsNalUnit</a></span>(<a href="../../../../../com/google/android/exoplayer/util/ParsableBitArray.html" title="class in com.google.android.exoplayer.util">ParsableBitArray</a>&nbsp;data)</code>
<div class="block">Parses an SPS NAL unit using the syntax defined in ITU-T Recommendation H.264 (2013) subsection
7.3.2.1.1.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/android/exoplayer/util/NalUnitUtil.html#unescapeStream-byte:A-int-">unescapeStream</a></span>(byte[]&nbsp;data,
int&nbsp;limit)</code>
<div class="block">Unescapes <code>data</code> up to the specified limit, replacing occurrences of [0, 0, 3] with
[0, 0].</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="NAL_START_CODE">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>NAL_START_CODE</h4>
<pre>public static final&nbsp;byte[] NAL_START_CODE</pre>
<div class="block">Four initial bytes that must prefix NAL units for decoding.</div>
</li>
</ul>
<a name="EXTENDED_SAR">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>EXTENDED_SAR</h4>
<pre>public static final&nbsp;int EXTENDED_SAR</pre>
<div class="block">Value for aspect_ratio_idc indicating an extended aspect ratio, in H.264 and H.265 SPSs.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../constant-values.html#com.google.android.exoplayer.util.NalUnitUtil.EXTENDED_SAR">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="ASPECT_RATIO_IDC_VALUES">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>ASPECT_RATIO_IDC_VALUES</h4>
<pre>public static final&nbsp;float[] ASPECT_RATIO_IDC_VALUES</pre>
<div class="block">Aspect ratios indexed by aspect_ratio_idc, in H.264 and H.265 SPSs.</div>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="unescapeStream-byte:A-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>unescapeStream</h4>
<pre>public static&nbsp;int&nbsp;unescapeStream(byte[]&nbsp;data,
int&nbsp;limit)</pre>
<div class="block">Unescapes <code>data</code> up to the specified limit, replacing occurrences of [0, 0, 3] with
[0, 0]. The unescaped data is returned in-place, with the return value indicating its length.
<p>
Executions of this method are mutually exclusive, so it should not be called with very large
buffers.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>data</code> - The data to unescape.</dd>
<dd><code>limit</code> - The limit (exclusive) of the data to unescape.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The length of the unescaped data.</dd>
</dl>
</li>
</ul>
<a name="discardToSps-java.nio.ByteBuffer-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>discardToSps</h4>
<pre>public static&nbsp;void&nbsp;discardToSps(<a href="http://docs.oracle.com/javase/7/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</a>&nbsp;data)</pre>
<div class="block">Discards data from the buffer up to the first SPS, where <code>data.position()</code> is interpreted
as the length of the buffer.
<p>
When the method returns, <code>data.position()</code> will contain the new length of the buffer. If
the buffer is not empty it is guaranteed to start with an SPS.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>data</code> - Buffer containing start code delimited NAL units.</dd>
</dl>
</li>
</ul>
<a name="parseChildNalUnit-com.google.android.exoplayer.util.ParsableByteArray-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>parseChildNalUnit</h4>
<pre>public static&nbsp;byte[]&nbsp;parseChildNalUnit(<a href="../../../../../com/google/android/exoplayer/util/ParsableByteArray.html" title="class in com.google.android.exoplayer.util">ParsableByteArray</a>&nbsp;atom)</pre>
<div class="block">Constructs and returns a NAL unit with a start code followed by the data in <code>atom</code>.</div>
</li>
</ul>
<a name="getNalUnitType-byte:A-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNalUnitType</h4>
<pre>public static&nbsp;int&nbsp;getNalUnitType(byte[]&nbsp;data,
int&nbsp;offset)</pre>
<div class="block">Gets the type of the NAL unit in <code>data</code> that starts at <code>offset</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>data</code> - The data to search.</dd>
<dd><code>offset</code> - The start offset of a NAL unit. Must lie between <code>-3</code> (inclusive) and
<code>data.length - 3</code> (exclusive).</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The type of the unit.</dd>
</dl>
</li>
</ul>
<a name="getH265NalUnitType-byte:A-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getH265NalUnitType</h4>
<pre>public static&nbsp;int&nbsp;getH265NalUnitType(byte[]&nbsp;data,
int&nbsp;offset)</pre>
<div class="block">Gets the type of the H.265 NAL unit in <code>data</code> that starts at <code>offset</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>data</code> - The data to search.</dd>
<dd><code>offset</code> - The start offset of a NAL unit. Must lie between <code>-3</code> (inclusive) and
<code>data.length - 3</code> (exclusive).</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The type of the unit.</dd>
</dl>
</li>
</ul>
<a name="parseSpsNalUnit-com.google.android.exoplayer.util.ParsableBitArray-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>parseSpsNalUnit</h4>
<pre>public static&nbsp;<a href="../../../../../com/google/android/exoplayer/util/NalUnitUtil.SpsData.html" title="class in com.google.android.exoplayer.util">NalUnitUtil.SpsData</a>&nbsp;parseSpsNalUnit(<a href="../../../../../com/google/android/exoplayer/util/ParsableBitArray.html" title="class in com.google.android.exoplayer.util">ParsableBitArray</a>&nbsp;data)</pre>
<div class="block">Parses an SPS NAL unit using the syntax defined in ITU-T Recommendation H.264 (2013) subsection
7.3.2.1.1.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>data</code> - A <a href="../../../../../com/google/android/exoplayer/util/ParsableBitArray.html" title="class in com.google.android.exoplayer.util"><code>ParsableBitArray</code></a> containing the SPS data. The position must to set to the
start of the data (i.e. the first bit of the profile_idc field).</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A parsed representation of the SPS data.</dd>
</dl>
</li>
</ul>
<a name="parsePpsNalUnit-com.google.android.exoplayer.util.ParsableBitArray-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>parsePpsNalUnit</h4>
<pre>public static&nbsp;<a href="../../../../../com/google/android/exoplayer/util/NalUnitUtil.PpsData.html" title="class in com.google.android.exoplayer.util">NalUnitUtil.PpsData</a>&nbsp;parsePpsNalUnit(<a href="../../../../../com/google/android/exoplayer/util/ParsableBitArray.html" title="class in com.google.android.exoplayer.util">ParsableBitArray</a>&nbsp;data)</pre>
<div class="block">Parses a PPS NAL unit using the syntax defined in ITU-T Recommendation H.264 (2013) subsection
7.3.2.2.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>data</code> - A <a href="../../../../../com/google/android/exoplayer/util/ParsableBitArray.html" title="class in com.google.android.exoplayer.util"><code>ParsableBitArray</code></a> containing the PPS data. The position must to set to the
start of the data (i.e. the first bit of the pic_parameter_set_id field).</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A parsed representation of the PPS data.</dd>
</dl>
</li>
</ul>
<a name="findNalUnit-byte:A-int-int-boolean:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>findNalUnit</h4>
<pre>public static&nbsp;int&nbsp;findNalUnit(byte[]&nbsp;data,
int&nbsp;startOffset,
int&nbsp;endOffset,
boolean[]&nbsp;prefixFlags)</pre>
<div class="block">Finds the first NAL unit in <code>data</code>.
<p>
If <code>prefixFlags</code> is null then the first three bytes of a NAL unit must be entirely
contained within the part of the array being searched in order for it to be found.
<p>
When <code>prefixFlags</code> is non-null, this method supports finding NAL units whose first four
bytes span <code>data</code> arrays passed to successive calls. To use this feature, pass the same
<code>prefixFlags</code> parameter to successive calls. State maintained in this parameter enables
the detection of such NAL units. Note that when using this feature, the return value may be 3,
2 or 1 less than <code>startOffset</code>, to indicate a NAL unit starting 3, 2 or 1 bytes before
the first byte in the current array.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>data</code> - The data to search.</dd>
<dd><code>startOffset</code> - The offset (inclusive) in the data to start the search.</dd>
<dd><code>endOffset</code> - The offset (exclusive) in the data to end the search.</dd>
<dd><code>prefixFlags</code> - A boolean array whose first three elements are used to store the state
required to detect NAL units where the NAL unit prefix spans array boundaries. The array
must be at least 3 elements long.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The offset of the NAL unit, or <code>endOffset</code> if a NAL unit was not found.</dd>
</dl>
</li>
</ul>
<a name="clearPrefixFlags-boolean:A-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>clearPrefixFlags</h4>
<pre>public static&nbsp;void&nbsp;clearPrefixFlags(boolean[]&nbsp;prefixFlags)</pre>
<div class="block">Clears prefix flags, as used by <a href="../../../../../com/google/android/exoplayer/util/NalUnitUtil.html#findNalUnit-byte:A-int-int-boolean:A-"><code>findNalUnit(byte[], int, int, boolean[])</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>prefixFlags</code> - The flags to clear.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../com/google/android/exoplayer/util/MpegAudioHeader.html" title="class in com.google.android.exoplayer.util"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../com/google/android/exoplayer/util/NalUnitUtil.PpsData.html" title="class in com.google.android.exoplayer.util"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/google/android/exoplayer/util/NalUnitUtil.html" target="_top">Frames</a></li>
<li><a href="NalUnitUtil.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>