android.media.MediaCodecInfo.AudioCapabilities Java Examples

The following examples show how to use android.media.MediaCodecInfo.AudioCapabilities. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MediaCodecInfo.java    From MediaSDK with Apache License 2.0 6 votes vote down vote up
/**
 * Whether the decoder supports audio with a given sample rate.
 * <p>
 * Must not be called if the device SDK version is less than 21.
 *
 * @param sampleRate The sample rate in Hz.
 * @return Whether the decoder supports audio with the given sample rate.
 */
@TargetApi(21)
public boolean isAudioSampleRateSupportedV21(int sampleRate) {
  if (capabilities == null) {
    logNoSupport("sampleRate.caps");
    return false;
  }
  AudioCapabilities audioCapabilities = capabilities.getAudioCapabilities();
  if (audioCapabilities == null) {
    logNoSupport("sampleRate.aCaps");
    return false;
  }
  if (!audioCapabilities.isSampleRateSupported(sampleRate)) {
    logNoSupport("sampleRate.support, " + sampleRate);
    return false;
  }
  return true;
}
 
Example #2
Source File: MediaCodecInfo.java    From MediaSDK with Apache License 2.0 6 votes vote down vote up
/**
 * Whether the decoder supports audio with a given channel count.
 * <p>
 * Must not be called if the device SDK version is less than 21.
 *
 * @param channelCount The channel count.
 * @return Whether the decoder supports audio with the given channel count.
 */
@TargetApi(21)
public boolean isAudioChannelCountSupportedV21(int channelCount) {
  if (capabilities == null) {
    logNoSupport("channelCount.caps");
    return false;
  }
  AudioCapabilities audioCapabilities = capabilities.getAudioCapabilities();
  if (audioCapabilities == null) {
    logNoSupport("channelCount.aCaps");
    return false;
  }
  int maxInputChannelCount = adjustMaxInputChannelCount(name, mimeType,
      audioCapabilities.getMaxInputChannelCount());
  if (maxInputChannelCount < channelCount) {
    logNoSupport("channelCount.support, " + channelCount);
    return false;
  }
  return true;
}
 
Example #3
Source File: MediaCodecInfo.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Whether the decoder supports audio with a given sample rate.
 * <p>
 * Must not be called if the device SDK version is less than 21.
 *
 * @param sampleRate The sample rate in Hz.
 * @return Whether the decoder supports audio with the given sample rate.
 */
@TargetApi(21)
public boolean isAudioSampleRateSupportedV21(int sampleRate) {
  if (capabilities == null) {
    logNoSupport("sampleRate.caps");
    return false;
  }
  AudioCapabilities audioCapabilities = capabilities.getAudioCapabilities();
  if (audioCapabilities == null) {
    logNoSupport("sampleRate.aCaps");
    return false;
  }
  if (!audioCapabilities.isSampleRateSupported(sampleRate)) {
    logNoSupport("sampleRate.support, " + sampleRate);
    return false;
  }
  return true;
}
 
Example #4
Source File: MediaCodecInfo.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Whether the decoder supports audio with a given channel count.
 * <p>
 * Must not be called if the device SDK version is less than 21.
 *
 * @param channelCount The channel count.
 * @return Whether the decoder supports audio with the given channel count.
 */
@TargetApi(21)
public boolean isAudioChannelCountSupportedV21(int channelCount) {
  if (capabilities == null) {
    logNoSupport("channelCount.caps");
    return false;
  }
  AudioCapabilities audioCapabilities = capabilities.getAudioCapabilities();
  if (audioCapabilities == null) {
    logNoSupport("channelCount.aCaps");
    return false;
  }
  int maxInputChannelCount = adjustMaxInputChannelCount(name, mimeType,
      audioCapabilities.getMaxInputChannelCount());
  if (maxInputChannelCount < channelCount) {
    logNoSupport("channelCount.support, " + channelCount);
    return false;
  }
  return true;
}
 
Example #5
Source File: MediaCodecInfo.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Whether the decoder supports audio with a given sample rate.
 * <p>
 * Must not be called if the device SDK version is less than 21.
 *
 * @param sampleRate The sample rate in Hz.
 * @return Whether the decoder supports audio with the given sample rate.
 */
@TargetApi(21)
public boolean isAudioSampleRateSupportedV21(int sampleRate) {
  if (capabilities == null) {
    logNoSupport("sampleRate.caps");
    return false;
  }
  AudioCapabilities audioCapabilities = capabilities.getAudioCapabilities();
  if (audioCapabilities == null) {
    logNoSupport("sampleRate.aCaps");
    return false;
  }
  if (!audioCapabilities.isSampleRateSupported(sampleRate)) {
    logNoSupport("sampleRate.support, " + sampleRate);
    return false;
  }
  return true;
}
 
Example #6
Source File: MediaCodecInfo.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Whether the decoder supports audio with a given channel count.
 * <p>
 * Must not be called if the device SDK version is less than 21.
 *
 * @param channelCount The channel count.
 * @return Whether the decoder supports audio with the given channel count.
 */
@TargetApi(21)
public boolean isAudioChannelCountSupportedV21(int channelCount) {
  if (capabilities == null) {
    logNoSupport("channelCount.caps");
    return false;
  }
  AudioCapabilities audioCapabilities = capabilities.getAudioCapabilities();
  if (audioCapabilities == null) {
    logNoSupport("channelCount.aCaps");
    return false;
  }
  int maxInputChannelCount = adjustMaxInputChannelCount(name, mimeType,
      audioCapabilities.getMaxInputChannelCount());
  if (maxInputChannelCount < channelCount) {
    logNoSupport("channelCount.support, " + channelCount);
    return false;
  }
  return true;
}
 
Example #7
Source File: MediaCodecInfo.java    From K-Sonic with MIT License 6 votes vote down vote up
/**
 * Whether the decoder supports audio with a given sample rate.
 * <p>
 * Must not be called if the device SDK version is less than 21.
 *
 * @param sampleRate The sample rate in Hz.
 * @return Whether the decoder supports audio with the given sample rate.
 */
@TargetApi(21)
public boolean isAudioSampleRateSupportedV21(int sampleRate) {
  if (capabilities == null) {
    logNoSupport("sampleRate.caps");
    return false;
  }
  AudioCapabilities audioCapabilities = capabilities.getAudioCapabilities();
  if (audioCapabilities == null) {
    logNoSupport("sampleRate.aCaps");
    return false;
  }
  if (!audioCapabilities.isSampleRateSupported(sampleRate)) {
    logNoSupport("sampleRate.support, " + sampleRate);
    return false;
  }
  return true;
}
 
Example #8
Source File: MediaCodecInfo.java    From K-Sonic with MIT License 6 votes vote down vote up
/**
 * Whether the decoder supports audio with a given channel count.
 * <p>
 * Must not be called if the device SDK version is less than 21.
 *
 * @param channelCount The channel count.
 * @return Whether the decoder supports audio with the given channel count.
 */
@TargetApi(21)
public boolean isAudioChannelCountSupportedV21(int channelCount) {
  if (capabilities == null) {
    logNoSupport("channelCount.caps");
    return false;
  }
  AudioCapabilities audioCapabilities = capabilities.getAudioCapabilities();
  if (audioCapabilities == null) {
    logNoSupport("channelCount.aCaps");
    return false;
  }
  if (audioCapabilities.getMaxInputChannelCount() < channelCount) {
    logNoSupport("channelCount.support, " + channelCount);
    return false;
  }
  return true;
}
 
Example #9
Source File: MediaCodecInfo.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Whether the decoder supports audio with a given sample rate.
 * <p>
 * Must not be called if the device SDK version is less than 21.
 *
 * @param sampleRate The sample rate in Hz.
 * @return Whether the decoder supports audio with the given sample rate.
 */
@TargetApi(21)
public boolean isAudioSampleRateSupportedV21(int sampleRate) {
  if (capabilities == null) {
    logNoSupport("sampleRate.caps");
    return false;
  }
  AudioCapabilities audioCapabilities = capabilities.getAudioCapabilities();
  if (audioCapabilities == null) {
    logNoSupport("sampleRate.aCaps");
    return false;
  }
  if (!audioCapabilities.isSampleRateSupported(sampleRate)) {
    logNoSupport("sampleRate.support, " + sampleRate);
    return false;
  }
  return true;
}
 
Example #10
Source File: MediaCodecInfo.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Whether the decoder supports audio with a given channel count.
 * <p>
 * Must not be called if the device SDK version is less than 21.
 *
 * @param channelCount The channel count.
 * @return Whether the decoder supports audio with the given channel count.
 */
@TargetApi(21)
public boolean isAudioChannelCountSupportedV21(int channelCount) {
  if (capabilities == null) {
    logNoSupport("channelCount.caps");
    return false;
  }
  AudioCapabilities audioCapabilities = capabilities.getAudioCapabilities();
  if (audioCapabilities == null) {
    logNoSupport("channelCount.aCaps");
    return false;
  }
  int maxInputChannelCount = adjustMaxInputChannelCount(name, mimeType,
      audioCapabilities.getMaxInputChannelCount());
  if (maxInputChannelCount < channelCount) {
    logNoSupport("channelCount.support, " + channelCount);
    return false;
  }
  return true;
}
 
Example #11
Source File: MediaCodecInfo.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Whether the decoder supports audio with a given sample rate.
 * <p>
 * Must not be called if the device SDK version is less than 21.
 *
 * @param sampleRate The sample rate in Hz.
 * @return Whether the decoder supports audio with the given sample rate.
 */
@TargetApi(21)
public boolean isAudioSampleRateSupportedV21(int sampleRate) {
  if (capabilities == null) {
    logNoSupport("sampleRate.caps");
    return false;
  }
  AudioCapabilities audioCapabilities = capabilities.getAudioCapabilities();
  if (audioCapabilities == null) {
    logNoSupport("sampleRate.aCaps");
    return false;
  }
  if (!audioCapabilities.isSampleRateSupported(sampleRate)) {
    logNoSupport("sampleRate.support, " + sampleRate);
    return false;
  }
  return true;
}
 
Example #12
Source File: MediaCodecInfo.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Whether the decoder supports audio with a given channel count.
 * <p>
 * Must not be called if the device SDK version is less than 21.
 *
 * @param channelCount The channel count.
 * @return Whether the decoder supports audio with the given channel count.
 */
@TargetApi(21)
public boolean isAudioChannelCountSupportedV21(int channelCount) {
  if (capabilities == null) {
    logNoSupport("channelCount.caps");
    return false;
  }
  AudioCapabilities audioCapabilities = capabilities.getAudioCapabilities();
  if (audioCapabilities == null) {
    logNoSupport("channelCount.aCaps");
    return false;
  }
  int maxInputChannelCount = adjustMaxInputChannelCount(name, mimeType,
      audioCapabilities.getMaxInputChannelCount());
  if (maxInputChannelCount < channelCount) {
    logNoSupport("channelCount.support, " + channelCount);
    return false;
  }
  return true;
}