当前位置: 首页>>代码示例>>Java>>正文


Java C.Encoding方法代码示例

本文整理汇总了Java中com.google.android.exoplayer2.C.Encoding方法的典型用法代码示例。如果您正苦于以下问题:Java C.Encoding方法的具体用法?Java C.Encoding怎么用?Java C.Encoding使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.android.exoplayer2.C的用法示例。


在下文中一共展示了C.Encoding方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configure

import com.google.android.exoplayer2.C; //导入方法依赖的package包/类
@Override
public boolean configure(int sampleRateHz, int channelCount, @C.Encoding int encoding)
    throws UnhandledFormatException {
  if (encoding != C.ENCODING_PCM_8BIT && encoding != C.ENCODING_PCM_16BIT
      && encoding != C.ENCODING_PCM_24BIT && encoding != C.ENCODING_PCM_32BIT) {
    throw new UnhandledFormatException(sampleRateHz, channelCount, encoding);
  }
  if (this.sampleRateHz == sampleRateHz && this.channelCount == channelCount
      && this.encoding == encoding) {
    return false;
  }
  this.sampleRateHz = sampleRateHz;
  this.channelCount = channelCount;
  this.encoding = encoding;
  if (encoding == C.ENCODING_PCM_16BIT) {
    buffer = EMPTY_BUFFER;
  }
  return true;
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:20,代码来源:ResamplingAudioProcessor.java

示例2: getEncodingForMimeType

import com.google.android.exoplayer2.C; //导入方法依赖的package包/类
@C.Encoding
private static int getEncodingForMimeType(String mimeType) {
  switch (mimeType) {
    case MimeTypes.AUDIO_AC3:
      return C.ENCODING_AC3;
    case MimeTypes.AUDIO_E_AC3:
      return C.ENCODING_E_AC3;
    case MimeTypes.AUDIO_DTS:
      return C.ENCODING_DTS;
    case MimeTypes.AUDIO_DTS_HD:
      return C.ENCODING_DTS_HD;
    default:
      return C.ENCODING_INVALID;
  }
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:16,代码来源:AudioTrack.java

示例3: getFramesPerEncodedSample

import com.google.android.exoplayer2.C; //导入方法依赖的package包/类
private static int getFramesPerEncodedSample(@C.Encoding int encoding, ByteBuffer buffer) {
  if (encoding == C.ENCODING_DTS || encoding == C.ENCODING_DTS_HD) {
    return DtsUtil.parseDtsAudioSampleCount(buffer);
  } else if (encoding == C.ENCODING_AC3) {
    return Ac3Util.getAc3SyncframeAudioSampleCount();
  } else if (encoding == C.ENCODING_E_AC3) {
    return Ac3Util.parseEAc3SyncframeAudioSampleCount(buffer);
  } else {
    throw new IllegalStateException("Unexpected audio encoding: " + encoding);
  }
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:12,代码来源:AudioTrack.java

示例4: UnhandledFormatException

import com.google.android.exoplayer2.C; //导入方法依赖的package包/类
public UnhandledFormatException(int sampleRateHz, int channelCount, @C.Encoding int encoding) {
  super("Unhandled format: " + sampleRateHz + " Hz, " + channelCount + " channels in encoding "
      + encoding);
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:5,代码来源:AudioProcessor.java

示例5: configure

import com.google.android.exoplayer2.C; //导入方法依赖的package包/类
/**
 * Configures the processor to process input audio with the specified format. After calling this
 * method, {@link #isActive()} returns whether the processor needs to handle buffers; if not, the
 * processor will not accept any buffers until it is reconfigured. Returns {@code true} if the
 * processor must be flushed, or if the value returned by {@link #isActive()} has changed as a
 * result of the call. If it's active, {@link #getOutputChannelCount()} and
 * {@link #getOutputEncoding()} return the processor's output format.
 *
 * @param sampleRateHz The sample rate of input audio in Hz.
 * @param channelCount The number of interleaved channels in input audio.
 * @param encoding The encoding of input audio.
 * @return {@code true} if the processor must be flushed or the value returned by
 *     {@link #isActive()} has changed as a result of the call.
 * @throws UnhandledFormatException Thrown if the specified format can't be handled as input.
 */
boolean configure(int sampleRateHz, int channelCount, @C.Encoding int encoding)
    throws UnhandledFormatException;
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:18,代码来源:AudioProcessor.java

示例6: getOutputEncoding

import com.google.android.exoplayer2.C; //导入方法依赖的package包/类
/**
 * Returns the audio encoding used in the data output by the processor.
 */
@C.Encoding
int getOutputEncoding();
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:6,代码来源:AudioProcessor.java


注:本文中的com.google.android.exoplayer2.C.Encoding方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。