1<!DOCTYPE HTML> 2<!-- NewPage --> 3<html lang="en"> 4<head><!-- start favicons snippet, use https://realfavicongenerator.net/ --><link rel="apple-touch-icon" sizes="180x180" href="/assets/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon-16x16.png"><link rel="manifest" href="/assets/site.webmanifest"><link rel="mask-icon" href="/assets/safari-pinned-tab.svg" color="#fc4d50"><link rel="shortcut icon" href="/assets/favicon.ico"><meta name="msapplication-TileColor" content="#ffc40d"><meta name="msapplication-config" content="/assets/browserconfig.xml"><meta name="theme-color" content="#ffffff"><!-- end favicons snippet --> 5<title>Codec.EncoderFactory (ExoPlayer library)</title> 6<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 7<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> 8<link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style"> 9<script type="text/javascript" src="../../../../../script.js"></script> 10<script type="text/javascript" src="../../../../../jquery/jszip/dist/jszip.min.js"></script> 11<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> 12<!--[if IE]> 13<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> 14<![endif]--> 15<script type="text/javascript" src="../../../../../jquery/jquery-3.5.1.js"></script> 16<script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script> 17</head> 18<body> 19<script type="text/javascript"><!-- 20 try { 21 if (location.href.indexOf('is-external=true') == -1) { 22 parent.document.title="Codec.EncoderFactory (ExoPlayer library)"; 23 } 24 } 25 catch(err) { 26 } 27//--> 28var data = {"i0":6,"i1":6}; 29var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; 30var altColor = "altColor"; 31var rowColor = "rowColor"; 32var tableTab = "tableTab"; 33var activeTableTab = "activeTableTab"; 34var pathtoroot = "../../../../../"; 35var useModuleDirectories = false; 36loadScripts(document, 'script');</script> 37<noscript> 38<div>JavaScript is disabled on your browser.</div> 39</noscript> 40<header role="banner"> 41<nav role="navigation"> 42<div class="fixedNav"> 43<!-- ========= START OF TOP NAVBAR ======= --> 44<div class="topNav"><a id="navbar.top"> 45<!-- --> 46</a> 47<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> 48<a id="navbar.top.firstrow"> 49<!-- --> 50</a> 51<ul class="navList" title="Navigation"> 52<li><a href="../../../../../index.html">Overview</a></li> 53<li><a href="package-summary.html">Package</a></li> 54<li class="navBarCell1Rev">Class</li> 55<li><a href="package-tree.html">Tree</a></li> 56<li><a href="../../../../../deprecated-list.html">Deprecated</a></li> 57<li><a href="../../../../../index-all.html">Index</a></li> 58<li><a href="../../../../../help-doc.html">Help</a></li> 59</ul> 60</div> 61<div class="subNav"> 62<ul class="navList" id="allclasses_navbar_top"> 63<li><a href="../../../../../allclasses.html">All Classes</a></li> 64</ul> 65<ul class="navListSearch"> 66<li><label for="search">SEARCH:</label> 67<input type="text" id="search" value="search" disabled="disabled"> 68<input type="reset" id="reset" value="reset" disabled="disabled"> 69</li> 70</ul> 71<div> 72<script type="text/javascript"><!-- 73 allClassesLink = document.getElementById("allclasses_navbar_top"); 74 if(window==top) { 75 allClassesLink.style.display = "block"; 76 } 77 else { 78 allClassesLink.style.display = "none"; 79 } 80 //--> 81</script> 82<noscript> 83<div>JavaScript is disabled on your browser.</div> 84</noscript> 85</div> 86<div> 87<ul class="subNavList"> 88<li>Summary: </li> 89<li>Nested | </li> 90<li><a href="#field.summary">Field</a> | </li> 91<li>Constr | </li> 92<li><a href="#method.summary">Method</a></li> 93</ul> 94<ul class="subNavList"> 95<li>Detail: </li> 96<li><a href="#field.detail">Field</a> | </li> 97<li>Constr | </li> 98<li><a href="#method.detail">Method</a></li> 99</ul> 100</div> 101<a id="skip.navbar.top"> 102<!-- --> 103</a></div> 104<!-- ========= END OF TOP NAVBAR ========= --> 105</div> 106<div class="navPadding"> </div> 107<script type="text/javascript"><!-- 108$('.navPadding').css('padding-top', $('.fixedNav').css("height")); 109//--> 110</script> 111</nav> 112</header> 113<!-- ======== START OF CLASS DATA ======== --> 114<main role="main"> 115<div class="header"> 116<div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">com.google.android.exoplayer2.transformer</a></div> 117<h2 title="Interface Codec.EncoderFactory" class="title">Interface Codec.EncoderFactory</h2> 118</div> 119<div class="contentContainer"> 120<div class="description"> 121<ul class="blockList"> 122<li class="blockList"> 123<dl> 124<dt>Enclosing class:</dt> 125<dd><a href="Codec.html" title="class in com.google.android.exoplayer2.transformer">Codec</a></dd> 126</dl> 127<hr> 128<pre>public static interface <span class="typeNameLabel">Codec.EncoderFactory</span></pre> 129<div class="block">A factory for <a href="Codec.html" title="class in com.google.android.exoplayer2.transformer"><code>encoder</code></a> instances.</div> 130</li> 131</ul> 132</div> 133<div class="summary"> 134<ul class="blockList"> 135<li class="blockList"> 136<!-- =========== FIELD SUMMARY =========== --> 137<section role="region"> 138<ul class="blockList"> 139<li class="blockList"><a id="field.summary"> 140<!-- --> 141</a> 142<h3>Field Summary</h3> 143<table class="memberSummary"> 144<caption><span>Fields</span><span class="tabEnd"> </span></caption> 145<tr> 146<th class="colFirst" scope="col">Modifier and Type</th> 147<th class="colSecond" scope="col">Field</th> 148<th class="colLast" scope="col">Description</th> 149</tr> 150<tr class="altColor"> 151<td class="colFirst"><code>static <a href="Codec.EncoderFactory.html" title="interface in com.google.android.exoplayer2.transformer">Codec.EncoderFactory</a></code></td> 152<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#DEFAULT">DEFAULT</a></span></code></th> 153<td class="colLast"> 154<div class="block">A default <code>EncoderFactory</code> implementation.</div> 155</td> 156</tr> 157</table> 158</li> 159</ul> 160</section> 161<!-- ========== METHOD SUMMARY =========== --> 162<section role="region"> 163<ul class="blockList"> 164<li class="blockList"><a id="method.summary"> 165<!-- --> 166</a> 167<h3>Method Summary</h3> 168<table class="memberSummary"> 169<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span></caption> 170<tr> 171<th class="colFirst" scope="col">Modifier and Type</th> 172<th class="colSecond" scope="col">Method</th> 173<th class="colLast" scope="col">Description</th> 174</tr> 175<tr id="i0" class="altColor"> 176<td class="colFirst"><code><a href="Codec.html" title="class in com.google.android.exoplayer2.transformer">Codec</a></code></td> 177<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#createForAudioEncoding(com.google.android.exoplayer2.Format,java.util.List)">createForAudioEncoding</a></span>​(<a href="../Format.html" title="class in com.google.android.exoplayer2">Format</a> format, 178 <a href="https://developer.android.com/reference/java/util/List.html" title="class or interface in java.util" class="externalLink">List</a><<a href="https://developer.android.com/reference/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink" target="_top">String</a>> allowedMimeTypes)</code></th> 179<td class="colLast"> 180<div class="block">Returns a <a href="Codec.html" title="class in com.google.android.exoplayer2.transformer"><code>Codec</code></a> for audio encoding.</div> 181</td> 182</tr> 183<tr id="i1" class="rowColor"> 184<td class="colFirst"><code><a href="Codec.html" title="class in com.google.android.exoplayer2.transformer">Codec</a></code></td> 185<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#createForVideoEncoding(com.google.android.exoplayer2.Format,java.util.List)">createForVideoEncoding</a></span>​(<a href="../Format.html" title="class in com.google.android.exoplayer2">Format</a> format, 186 <a href="https://developer.android.com/reference/java/util/List.html" title="class or interface in java.util" class="externalLink">List</a><<a href="https://developer.android.com/reference/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink" target="_top">String</a>> allowedMimeTypes)</code></th> 187<td class="colLast"> 188<div class="block">Returns a <a href="Codec.html" title="class in com.google.android.exoplayer2.transformer"><code>Codec</code></a> for video encoding.</div> 189</td> 190</tr> 191</table> 192</li> 193</ul> 194</section> 195</li> 196</ul> 197</div> 198<div class="details"> 199<ul class="blockList"> 200<li class="blockList"> 201<!-- ============ FIELD DETAIL =========== --> 202<section role="region"> 203<ul class="blockList"> 204<li class="blockList"><a id="field.detail"> 205<!-- --> 206</a> 207<h3>Field Detail</h3> 208<a id="DEFAULT"> 209<!-- --> 210</a> 211<ul class="blockListLast"> 212<li class="blockList"> 213<h4>DEFAULT</h4> 214<pre>static final <a href="Codec.EncoderFactory.html" title="interface in com.google.android.exoplayer2.transformer">Codec.EncoderFactory</a> DEFAULT</pre> 215<div class="block">A default <code>EncoderFactory</code> implementation.</div> 216</li> 217</ul> 218</li> 219</ul> 220</section> 221<!-- ============ METHOD DETAIL ========== --> 222<section role="region"> 223<ul class="blockList"> 224<li class="blockList"><a id="method.detail"> 225<!-- --> 226</a> 227<h3>Method Detail</h3> 228<a id="createForAudioEncoding(com.google.android.exoplayer2.Format,java.util.List)"> 229<!-- --> 230</a> 231<ul class="blockList"> 232<li class="blockList"> 233<h4>createForAudioEncoding</h4> 234<pre class="methodSignature"><a href="Codec.html" title="class in com.google.android.exoplayer2.transformer">Codec</a> createForAudioEncoding​(<a href="../Format.html" title="class in com.google.android.exoplayer2">Format</a> format, 235 <a href="https://developer.android.com/reference/java/util/List.html" title="class or interface in java.util" class="externalLink">List</a><<a href="https://developer.android.com/reference/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink" target="_top">String</a>> allowedMimeTypes) 236 throws <a href="TransformationException.html" title="class in com.google.android.exoplayer2.transformer">TransformationException</a></pre> 237<div class="block">Returns a <a href="Codec.html" title="class in com.google.android.exoplayer2.transformer"><code>Codec</code></a> for audio encoding. 238 239 <p>This method must validate that the <a href="Codec.html" title="class in com.google.android.exoplayer2.transformer"><code>Codec</code></a> is configured to produce one of the 240 <code>allowedMimeTypes</code>. The <a href="../Format.html#sampleMimeType"><code>sample MIME type</code></a> given in <code> 241 format</code> is not necessarily allowed.</div> 242<dl> 243<dt><span class="paramLabel">Parameters:</span></dt> 244<dd><code>format</code> - The <a href="../Format.html" title="class in com.google.android.exoplayer2"><code>Format</code></a> (of the output data) used to determine the underlying <a href="https://developer.android.com/reference/android/media/MediaCodec.html" title="class or interface in android.media" class="externalLink" target="_top"><code>MediaCodec</code></a> and its configuration values.</dd> 245<dd><code>allowedMimeTypes</code> - The non-empty list of allowed output sample <a href="../util/MimeTypes.html" title="class in com.google.android.exoplayer2.util"><code>MIME 246 types</code></a>.</dd> 247<dt><span class="returnLabel">Returns:</span></dt> 248<dd>A configured and started encoder wrapper.</dd> 249<dt><span class="throwsLabel">Throws:</span></dt> 250<dd><code><a href="TransformationException.html" title="class in com.google.android.exoplayer2.transformer">TransformationException</a></code> - If no suitable codec can be created.</dd> 251</dl> 252</li> 253</ul> 254<a id="createForVideoEncoding(com.google.android.exoplayer2.Format,java.util.List)"> 255<!-- --> 256</a> 257<ul class="blockListLast"> 258<li class="blockList"> 259<h4>createForVideoEncoding</h4> 260<pre class="methodSignature"><a href="Codec.html" title="class in com.google.android.exoplayer2.transformer">Codec</a> createForVideoEncoding​(<a href="../Format.html" title="class in com.google.android.exoplayer2">Format</a> format, 261 <a href="https://developer.android.com/reference/java/util/List.html" title="class or interface in java.util" class="externalLink">List</a><<a href="https://developer.android.com/reference/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink" target="_top">String</a>> allowedMimeTypes) 262 throws <a href="TransformationException.html" title="class in com.google.android.exoplayer2.transformer">TransformationException</a></pre> 263<div class="block">Returns a <a href="Codec.html" title="class in com.google.android.exoplayer2.transformer"><code>Codec</code></a> for video encoding. 264 265 <p>This method must validate that the <a href="Codec.html" title="class in com.google.android.exoplayer2.transformer"><code>Codec</code></a> is configured to produce one of the 266 <code>allowedMimeTypes</code>. The <a href="../Format.html#sampleMimeType"><code>sample MIME type</code></a> given in <code> 267 format</code> is not necessarily allowed.</div> 268<dl> 269<dt><span class="paramLabel">Parameters:</span></dt> 270<dd><code>format</code> - The <a href="../Format.html" title="class in com.google.android.exoplayer2"><code>Format</code></a> (of the output data) used to determine the underlying <a href="https://developer.android.com/reference/android/media/MediaCodec.html" title="class or interface in android.media" class="externalLink"><code>MediaCodec</code></a> and its configuration values. <a href="../Format.html#sampleMimeType"><code>Format.sampleMimeType</code></a>, <a href="../Format.html#width"><code>Format.width</code></a> and <a href="../Format.html#height" target="_top"><code>Format.height</code></a> must be set to those of the desired output video 271 format. <a href="../Format.html#rotationDegrees"><code>Format.rotationDegrees</code></a> should be 0. The video should always be in 272 landscape orientation.</dd> 273<dd><code>allowedMimeTypes</code> - The non-empty list of allowed output sample <a href="../util/MimeTypes.html" title="class in com.google.android.exoplayer2.util"><code>MIME 274 types</code></a>.</dd> 275<dt><span class="returnLabel">Returns:</span></dt> 276<dd>A configured and started encoder wrapper.</dd> 277<dt><span class="throwsLabel">Throws:</span></dt> 278<dd><code><a href="TransformationException.html" title="class in com.google.android.exoplayer2.transformer">TransformationException</a></code> - If no suitable codec can be created.</dd> 279</dl> 280</li> 281</ul> 282</li> 283</ul> 284</section> 285</li> 286</ul> 287</div> 288</div> 289</main> 290<!-- ========= END OF CLASS DATA ========= --> 291<footer role="contentinfo"> 292<nav role="navigation"> 293<!-- ======= START OF BOTTOM NAVBAR ====== --> 294<div class="bottomNav"><a id="navbar.bottom"> 295<!-- --> 296</a> 297<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> 298<a id="navbar.bottom.firstrow"> 299<!-- --> 300</a> 301<ul class="navList" title="Navigation"> 302<li><a href="../../../../../index.html">Overview</a></li> 303<li><a href="package-summary.html">Package</a></li> 304<li class="navBarCell1Rev">Class</li> 305<li><a href="package-tree.html">Tree</a></li> 306<li><a href="../../../../../deprecated-list.html">Deprecated</a></li> 307<li><a href="../../../../../index-all.html">Index</a></li> 308<li><a href="../../../../../help-doc.html">Help</a></li> 309</ul> 310</div> 311<div class="subNav"> 312<ul class="navList" id="allclasses_navbar_bottom"> 313<li><a href="../../../../../allclasses.html">All Classes</a></li> 314</ul> 315<div> 316<script type="text/javascript"><!-- 317 allClassesLink = document.getElementById("allclasses_navbar_bottom"); 318 if(window==top) { 319 allClassesLink.style.display = "block"; 320 } 321 else { 322 allClassesLink.style.display = "none"; 323 } 324 //--> 325</script> 326<noscript> 327<div>JavaScript is disabled on your browser.</div> 328</noscript> 329</div> 330<div> 331<ul class="subNavList"> 332<li>Summary: </li> 333<li>Nested | </li> 334<li><a href="#field.summary">Field</a> | </li> 335<li>Constr | </li> 336<li><a href="#method.summary">Method</a></li> 337</ul> 338<ul class="subNavList"> 339<li>Detail: </li> 340<li><a href="#field.detail">Field</a> | </li> 341<li>Constr | </li> 342<li><a href="#method.detail">Method</a></li> 343</ul> 344</div> 345<a id="skip.navbar.bottom"> 346<!-- --> 347</a></div> 348<!-- ======== END OF BOTTOM NAVBAR ======= --> 349</nav> 350</footer> 351</body> 352</html> 353