コード例 #1
0
//-----------------------------------------------------------------------------
bool android_fx_initEffectObj(audio_session_t sessionId, android::sp<android::AudioEffect>& effect,
        const effect_uuid_t *type) {
    //SL_LOGV("android_fx_initEffectObj on session %d", sessionId);

    effect = new android::AudioEffect(type, android::String16(), EFFECT_UUID_NULL,
            0,// priority
            0,// effect callback
            0,// callback data
            sessionId,// session ID
            0 );// output

    android::status_t status = effect->initCheck();
    if (android::NO_ERROR != status) {
        effect.clear();
        SL_LOGE("Effect initCheck() returned %d", status);
        return false;
    }

    return true;
}
コード例 #2
0
ファイル: shim.cpp プロジェクト: cdotstout/ozone_shim
bool Shim::init() {
  composer_client_ = new android::SurfaceComposerClient;

  LOG("Inc ref on composerClient\n");

  // Required to pass initCheck
  composer_client_->incStrong(nullptr);

  android::status_t status;

  LOG("calling initCheck\n");

  status = composer_client_->initCheck();
  if (status != android::NO_ERROR) {
    fprintf(stderr, "failed composer init check %d\n", status);
    return false;
  }

  return true;
}