Merge branch 'tizen' into tizen_line_coverage 90/199690/1 tizen_line_coverage
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 14 Feb 2019 05:27:38 +0000 (14:27 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Thu, 14 Feb 2019 05:30:09 +0000 (14:30 +0900)
Change-Id: I2f9d5cbdb39ab3552e1472c27272e5cedf804983

1  2 
src/cpp/CAudioInput.cpp
src/cpp/CAudioOutput.cpp
src/cpp/CPulseAudioClient.cpp
src/cpp/cpp_audio_io.cpp

diff --combined src/cpp/CAudioInput.cpp
@@@ -37,7 -37,6 +37,7 @@@ CAudioInput::CAudioInput(CAudioInfo& in
      mDirection = CAudioInfo::EAudioDirection::AUDIO_DIRECTION_IN;
  }
  
 +//LCOV_EXCL_START
  CAudioInput::CAudioInput(
          unsigned int            sampleRate,
          CAudioInfo::EChannel    channel,
@@@ -48,7 -47,6 +48,7 @@@
      mDirection = CAudioInfo::EAudioDirection::AUDIO_DIRECTION_IN;
      mAudioInfo = CAudioInfo(sampleRate, channel, type, audioType, -1);
  }
 +//LCOV_EXCL_STOP
  
  CAudioInput::~CAudioInput() {
  }
@@@ -62,7 -60,7 +62,7 @@@ void CAudioInput::onStream(CPulseAudioC
       */
      if (__mIsUsedSyncRead == true) {
  #ifdef _AUDIO_IO_DEBUG_TIMING_
-         AUDIO_IO_LOGD("Sync Read Mode! - pClient:[%p], length:[%d]", pClient, length);
+         AUDIO_IO_LOGD("Sync Read Mode! - pClient:[%p], length:[%zu]", pClient, length);
  #endif
          return;
      }
@@@ -71,7 -69,7 +71,7 @@@
       * Accrues callback function
       */
  #ifdef _AUDIO_IO_DEBUG_TIMING_
-     AUDIO_IO_LOGD("pClient:[%p], length:[%d]", pClient, length);
+     AUDIO_IO_LOGD("pClient:[%p], length:[%zu]", pClient, length);
  #endif
      CAudioIO::onStream(pClient, length);
  }
@@@ -138,6 -136,10 +138,10 @@@ void CAudioInput::prepare() 
          /* Init StreamSpec */
          AUDIO_IO_LOGD("Set Stream Spec : CPulseStreamSpec::STREAM_LATENCY_INPUT_DEFAULT");
          CPulseStreamSpec::EStreamLatency streamSpec = CPulseStreamSpec::EStreamLatency::STREAM_LATENCY_INPUT_DEFAULT;
+         /* Override the default value by audio type */
+         if (audioType == CAudioInfo::EAudioType::AUDIO_IN_TYPE_VOIP)
+             streamSpec = CPulseStreamSpec::EStreamLatency::STREAM_LATENCY_INPUT_VOIP;
          CPulseStreamSpec spec(streamSpec, mAudioInfo);
  
          internalLock();
          internalUnlock();
          throw;
      } catch (const std::bad_alloc&) {
 +//LCOV_EXCL_START
          internalUnlock();
          THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed to allocate CPulseAudioClient object");
 +//LCOV_EXCL_STOP
      }
  }
  
diff --combined src/cpp/CAudioOutput.cpp
@@@ -33,7 -33,6 +33,7 @@@ CAudioOutput::CAudioOutput(CAudioInfo& 
      mDirection = CAudioInfo::EAudioDirection::AUDIO_DIRECTION_OUT;
  }
  
 +//LCOV_EXCL_START
  CAudioOutput::CAudioOutput(
          unsigned int            sampleRate,
          CAudioInfo::EChannel    channel,
@@@ -44,7 -43,6 +44,7 @@@
      mDirection = CAudioInfo::EAudioDirection::AUDIO_DIRECTION_OUT;
      mAudioInfo = CAudioInfo(sampleRate, channel, sampleType, audioType, -1);
  }
 +//LCOV_EXCL_STOP
  
  CAudioOutput::~CAudioOutput() {
  }
@@@ -58,7 -56,7 +58,7 @@@ void CAudioOutput::onStream(CPulseAudio
       */
      if (__mIsUsedSyncWrite == true) {
  #ifdef _AUDIO_IO_DEBUG_TIMING_
-         AUDIO_IO_LOGD("Sync Write Mode! - signal! - pClient:[%p], length:[%d]", pClient, length);
+         AUDIO_IO_LOGD("Sync Write Mode! - signal! - pClient:[%p], length:[%zu]", pClient, length);
  #endif
          internalSignal();
          return;
@@@ -68,7 -66,7 +68,7 @@@
       * Accrues callback function
       */
  #ifdef _AUDIO_IO_DEBUG_TIMING_
-     AUDIO_IO_LOGD("pClient:[%p], length:[%d]", pClient, length);
+     AUDIO_IO_LOGD("pClient:[%p], length:[%zu]", pClient, length);
  #endif
      CAudioIO::onStream(pClient, length);
  }
@@@ -140,6 -138,10 +140,10 @@@ void CAudioOutput::prepare() 
              streamSpec = CPulseStreamSpec::EStreamLatency::STREAM_LATENCY_OUTPUT_DEFAULT_ASYNC;
          }
  #endif
+         /* Override the default value by audio type */
+         if (audioType == CAudioInfo::EAudioType::AUDIO_OUT_TYPE_VOIP)
+             streamSpec = CPulseStreamSpec::EStreamLatency::STREAM_LATENCY_OUTPUT_VOIP;
          CPulseStreamSpec spec(streamSpec, mAudioInfo);
  
          internalLock();
          internalUnlock();
          throw;
      } catch (const std::bad_alloc&) {
 +//LCOV_EXCL_START
          internalUnlock();
          THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed to allocate CPulseAudioClient object");
 +//LCOV_EXCL_STOP
      }
  }
  
@@@ -272,7 -272,7 +276,7 @@@ size_t CAudioOutput::write(const void* 
              THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INTERNAL_OPERATION,
                                     "The written result is invalid ret:%d", ret);
  #ifdef _AUDIO_IO_DEBUG_TIMING_
-         AUDIO_IO_LOGD("CPulseAudioClient->write(buffer:%p, length:%d)", buffer, length);
+         AUDIO_IO_LOGD("CPulseAudioClient->write(buffer:%p, length:%zu)", buffer, length);
  #endif
          return length;
      }
  
              while ((l = mpPulseAudioClient->getWritableSize()) == 0) {
  #ifdef _AUDIO_IO_DEBUG_TIMING_
-                 AUDIO_IO_LOGD("writableSize is [%d].. wait", l);
+                 AUDIO_IO_LOGD("writableSize is [%zu].. wait", l);
  #endif
                  internalWait();
              }
                  l = lengthIter;
  
  #ifdef _AUDIO_IO_DEBUG_TIMING_
-             AUDIO_IO_LOGD("CPulseAudioClient->write(buffer:%p, length:%d)", buffer, l);
+             AUDIO_IO_LOGD("CPulseAudioClient->write(buffer:%p, length:%zu)", buffer, l);
  #endif
  
              int ret = mpPulseAudioClient->write(buffer, l);
              if (ret < 0)
 -                THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INTERNAL_OPERATION,
 -                                       "The written result is invalid ret:%d", ret);
 +                THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INTERNAL_OPERATION,//LCOV_EXCL_LINE
 +                                       "The written result is invalid ret:%d", ret); //LCOV_EXCL_LINE
  
              buffer = static_cast<const uint8_t*>(buffer) + l;
              lengthIter -= l;
@@@ -84,7 -84,6 +84,7 @@@ void CPulseAudioClient::__contextStateC
      }
  }
  
 +//LCOV_EXCL_START
  void CPulseAudioClient::__successContextCb(pa_context* c, int success, void* user_data) {
      AUDIO_IO_LOGD("pa_context[%p], success[%d], user_data[%p]", c, success, user_data);
      assert(c);
@@@ -114,7 -113,6 +114,7 @@@ static bool __is_microphone_restricted(
  #endif
      return (state ? false : true);
  }
 +//LCOV_EXCL_STOP
  
  void CPulseAudioClient::__streamStateChangeCb(pa_stream* s, void* user_data) {
      assert(s);
          break;
  
      case PA_STREAM_FAILED:
 +//LCOV_EXCL_START
          AUDIO_IO_LOGD("The stream is failed");
          pClient->__mpListener->onStateChanged(CAudioInfo::EAudioIOState::AUDIO_IO_STATE_IDLE,
                                                __is_microphone_restricted());
          pa_threaded_mainloop_signal(pClient->__mpMainloop, 0);
          break;
 +//LCOV_EXCL_STOP
  
      case PA_STREAM_TERMINATED:
          AUDIO_IO_LOGD("The stream is terminated");
@@@ -186,12 -182,12 +186,12 @@@ void CPulseAudioClient::__streamPlaybac
  
  #ifndef DISABLE_MOBILE_BACK_COMP
      if (pClient->__mIsInit == false) {
-         AUDIO_IO_LOGD("Occurred this listener when an out stream is on the way to create : Write dummy, length[%d]", length);
+         AUDIO_IO_LOGD("Occurred this listener when an out stream is on the way to create : Write dummy, length[%zu]", length);
          __dummy_write(s, length);
          return;
      }
      if (pClient->isCorked()) {
-         AUDIO_IO_LOGD("Occurred this listener when an out stream is CORKED : Write dummy, length[%d]", length);
+         AUDIO_IO_LOGD("Occurred this listener when an out stream is CORKED : Write dummy, length[%zu]", length);
          __dummy_write(s, length);
          return;
      }
         then write dummy data to ensure the start */
      if (pClient->__mSpec.getStreamLatency() == CPulseStreamSpec::EStreamLatency::STREAM_LATENCY_OUTPUT_DEFAULT_ASYNC &&
          pClient->__mIsFirstStream) {
-         AUDIO_IO_LOGW("[async] Write dummy of length[%d] since not written in first callback during prepare", length);
+         AUDIO_IO_LOGW("[async] Write dummy of length[%zu] since not written in first callback during prepare", length);
          __dummy_write(s, length);
          pClient->__mIsFirstStream = false;
      }
@@@ -242,7 -238,6 +242,7 @@@ void CPulseAudioClient::__streamUnderfl
      pClient->__mIsStarted = false;
  }
  
 +//LCOV_EXCL_START
  void CPulseAudioClient::__streamEventCb(pa_stream* s, const char *name, pa_proplist *pl, void *user_data) {
      assert(s);
      assert(user_data);
          pa_operation_unref(pa_stream_cork(pClient->__mpStream, 1, NULL, NULL));
      }
  }
 -
 +//LCOV_EXCL_STOP
  
  void CPulseAudioClient::__successStreamCb(pa_stream* s, int success, void* user_data) {
      AUDIO_IO_LOGD("pa_stream[%p], success[%d], user_data[%p]", s, success, user_data);
      pa_threaded_mainloop_signal(pClient->__mpMainloop, 0);
  }
  
 +//LCOV_EXCL_START
  void CPulseAudioClient::__successDrainCbInThread(pa_stream* s, int success, void* user_data) {
      AUDIO_IO_LOGD("pa_stream[%p], success[%d], user_data[%p]", s, success, user_data);
      assert(s);
      pClient->__mIsOperationSuccess = static_cast<bool>(success);
      pClient->__mIsDraining = false;
  }
 +//LCOV_EXCL_STOP
  
  void CPulseAudioClient::__successDrainCb(pa_stream* s, int success, void* user_data) {
      AUDIO_IO_LOGD("pa_stream[%p], success[%d], user_data[%p]", s, success, user_data);
@@@ -303,7 -296,7 +303,7 @@@ void CPulseAudioClient::initialize() 
          // Allocates PA proplist
          __mpPropList = pa_proplist_new();
          if (__mpPropList == NULL) {
 -            THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed pa_proplist_new()");
 +            THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed pa_proplist_new()"); //LCOV_EXCL_LINE
          }
  
          // Adds values on proplist for delivery to PULSEAUDIO
          // Allocates PA mainloop
          __mpMainloop = pa_threaded_mainloop_new();
          if (__mpMainloop == NULL) {
 -            THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed pa_threaded_mainloop_new()");
 +            THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed pa_threaded_mainloop_new()"); //LCOV_EXCL_LINE
          }
  
          // Allocates PA context
          __mpContext = pa_context_new(pa_threaded_mainloop_get_api(__mpMainloop), CLIENT_NAME);
          if (__mpContext == NULL) {
 -            THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed pa_context_new()");
 +            THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed pa_context_new()"); //LCOV_EXCL_LINE
          }
  
          // Sets context state changed callback
  
          // Connects this client with PA server
          if (pa_context_connect(__mpContext, NULL, PA_CONTEXT_NOFLAGS, NULL) < 0) {
 -            THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed pa_context_connect()");
 +            THROW_ERROR_MSG(CAudioError::EError::ERROR_OUT_OF_MEMORY, "Failed pa_context_connect()"); //LCOV_EXCL_LINE
          }
  
          // LOCK for synchronous connection
          // Start mainloop
          if (pa_threaded_mainloop_start(__mpMainloop) < 0) {
              pa_threaded_mainloop_unlock(__mpMainloop);
 -            THROW_ERROR_MSG(CAudioError::EError::ERROR_FAILED_OPERATION, "Failed pa_threaded_mainloop_start()");
 +            THROW_ERROR_MSG(CAudioError::EError::ERROR_FAILED_OPERATION, "Failed pa_threaded_mainloop_start()"); //LCOV_EXCL_LINE
          }
  
          // Connection process is asynchronously
              }
  
              if (!PA_CONTEXT_IS_GOOD(state)) {
 +//LCOV_EXCL_START
                  err = pa_context_errno(__mpContext);
                  pa_threaded_mainloop_unlock(__mpMainloop);
                  THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INTERNAL_OPERATION, "pa_context's state is not good : err[%d]", err);
 +//LCOV_EXCL_STOP
              }
  
              /* Wait until the context is ready */
  
          __mpStream = pa_stream_new_with_proplist(__mpContext, __mSpec.getStreamName(), &ss, &map, __mpPropList);
          if (__mpStream == NULL) {
 +//LCOV_EXCL_START
              pa_threaded_mainloop_unlock(__mpMainloop);
              THROW_ERROR_MSG(CAudioError::EError::ERROR_FAILED_OPERATION, "Failed pa_stream_new_with_proplist()");
 +//LCOV_EXCL_STOP
          }
  
          // Sets stream callbacks
          }
  
          if (ret != 0) {
 +//LCOV_EXCL_START
              err = pa_context_errno(__mpContext);
              pa_threaded_mainloop_unlock(__mpMainloop);
              THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_FAILED_OPERATION, "Failed pa_stream_connect() : err[%d]", err);
 +//LCOV_EXCL_STOP
          }
  
          while (true) {
                  if (err == PA_ERR_ACCESS) {
                      THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_DEVICE_POLICY_RESTRICTION, "pa_stream's state is not good : err[%d]", err);
                  } else {
 -                    THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INTERNAL_OPERATION, "pa_stream's state is not good : err[%d]", err);
 +                    THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INTERNAL_OPERATION, "pa_stream's state is not good : err[%d]", err); //LCOV_EXCL_LINE
                  }
              }
  
@@@ -553,14 -540,14 +553,14 @@@ int CPulseAudioClient::read(void* buffe
  
                  if (__mSyncReadLength <= 0) {
  #ifdef _AUDIO_IO_DEBUG_TIMING_
-                     AUDIO_IO_LOGD("readLength(%d byte) is not valid. wait...", __mSyncReadLength);
+                     AUDIO_IO_LOGD("readLength(%zu byte) is not valid. wait...", __mSyncReadLength);
  #endif
                      pa_threaded_mainloop_wait(__mpMainloop);
                  } else if (__mpSyncReadDataPtr == NULL) {
                      // Data peeked, but it doesn't have any data
                      ret = pa_stream_drop(__mpStream);
                      if (ret != 0) {
 -                        THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INTERNAL_OPERATION, "Failed pa_stream_drop() : ret[%d]", ret);
 +                        THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INTERNAL_OPERATION, "Failed pa_stream_drop() : ret[%d]", ret); //LCOV_EXCL_LINE
                      }
                  } else {
                      __mSyncReadIndex = 0;
  
              // Copy partial pcm data on out parameter
  #ifdef _AUDIO_IO_DEBUG_TIMING_
-             AUDIO_IO_LOGD("memcpy() that a peeked buffer[0x%x], index[%d], length[%d] on out buffer", (const uint8_t*)(__mpSyncReadDataPtr) + __mSyncReadIndex, __mSyncReadIndex, l);
+             AUDIO_IO_LOGD("memcpy() that a peeked buffer[%p], index[%zu], length[%zu] on out buffer", (const uint8_t*)(__mpSyncReadDataPtr) + __mSyncReadIndex, __mSyncReadIndex, l);
  #endif
              memcpy(buffer, (const uint8_t*)__mpSyncReadDataPtr + __mSyncReadIndex, l);
  
  #endif
                  ret = pa_stream_drop(__mpStream);
                  if (ret != 0) {
 -                    THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INTERNAL_OPERATION, "Failed pa_stream_drop() : ret[%d]", ret);
 +                    THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_INTERNAL_OPERATION, "Failed pa_stream_drop() : ret[%d]", ret); //LCOV_EXCL_LINE
                  }
  
                  // Reset the internal pointer
@@@ -640,11 -627,11 +640,11 @@@ int CPulseAudioClient::peek(const void*
      }
  
  #ifdef _AUDIO_IO_DEBUG_TIMING_
-     AUDIO_IO_LOGD("buffer[%p], length[%d]", *buffer, *length);
+     AUDIO_IO_LOGD("buffer[%p], length[%zu]", *buffer, *length);
  #endif
  
      if (ret < 0) {
 -        THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_FAILED_OPERATION, "Failed pa_stream_peek() : err[%d]", ret);
 +        THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_FAILED_OPERATION, "Failed pa_stream_peek() : err[%d]", ret); //LCOV_EXCL_LINE
      }
  
      return ret;
@@@ -676,7 -663,7 +676,7 @@@ int CPulseAudioClient::drop() 
      }
  
      if (ret < 0) {
 -        THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_FAILED_OPERATION, "Failed pa_stream_drop() : err[%d]", ret);
 +        THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_FAILED_OPERATION, "Failed pa_stream_drop() : err[%d]", ret); //LCOV_EXCL_LINE
      }
  
      return ret;
@@@ -694,18 -681,24 +694,24 @@@ int CPulseAudioClient::write(const void
      int ret = 0;
  
  #ifdef _AUDIO_IO_DEBUG_TIMING_
-     AUDIO_IO_LOGD("data[%p], length[%d], First[%d]", data, length, __mIsFirstStream);
+     AUDIO_IO_LOGD("data[%p], length[%zu], First[%d]", data, length, __mIsFirstStream);
  #endif
-     if (pa_stream_is_corked(__mpStream)) {
-         AUDIO_IO_LOGW("stream is corked...do uncork here first!!!!");
-         pa_operation_unref(pa_stream_cork(__mpStream, 0, NULL, this));
-     }
  
      if (isInThread() == false) {
          pa_threaded_mainloop_lock(__mpMainloop);
+         if (pa_stream_is_corked(__mpStream)) {
+             AUDIO_IO_LOGW("stream is corked...do uncork here first!!!!");
+             pa_operation_unref(pa_stream_cork(__mpStream, 0, NULL, this));
+         }
          ret = pa_stream_write(__mpStream, data, length, NULL, 0LL, PA_SEEK_RELATIVE);
          pa_threaded_mainloop_unlock(__mpMainloop);
      } else {
+         if (pa_stream_is_corked(__mpStream)) {
+             AUDIO_IO_LOGW("stream is corked...do uncork here first!!!!");
+             pa_operation_unref(pa_stream_cork(__mpStream, 0, NULL, this));
+         }
          if (__mIsFirstStream) {
              const pa_buffer_attr* attr = pa_stream_get_buffer_attr(__mpStream);
              uint32_t prebuf = attr->prebuf;
                  delete [] dummy;
              }
              __mIsFirstStream = false;
-             AUDIO_IO_LOGW("FIRST STREAM CALLBACK : length[%d], prebuf[%d], dummy[%d]",
+             AUDIO_IO_LOGW("FIRST STREAM CALLBACK : length[%zu], prebuf[%d], dummy[%zu]",
                            length, prebuf, (length < prebuf) ? prebuf - length : 0);
          }
          ret = pa_stream_write(__mpStream, data, length, NULL, 0LL, PA_SEEK_RELATIVE);
      }
  
      if (ret < 0) {
 -        THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_FAILED_OPERATION, "Failed pa_stream_write() : err[%d]", ret);
 +        THROW_ERROR_MSG_FORMAT(CAudioError::EError::ERROR_FAILED_OPERATION, "Failed pa_stream_write() : err[%d]", ret); //LCOV_EXCL_LINE
      }
  
      return ret;
@@@ -893,7 -886,6 +899,7 @@@ bool CPulseAudioClient::isInThread() 
      return static_cast<bool>(ret);
  }
  
 +//LCOV_EXCL_START
  size_t CPulseAudioClient::getReadableSize() {
      if (__mIsInit == false) {
          THROW_ERROR_MSG(CAudioError::EError::ERROR_NOT_INITIALIZED, "Did not initialize CPulseAudioClient");
@@@ -940,10 -932,10 +946,10 @@@ size_t CPulseAudioClient::getBufferSize
  
          if (__mDirection == EStreamDirection::STREAM_DIRECTION_PLAYBACK) {
              ret = attr->tlength;
-             AUDIO_IO_LOGD("PLAYBACK buffer size[%d]", ret);
+             AUDIO_IO_LOGD("PLAYBACK buffer size[%zu]", ret);
          } else {
              ret = attr->fragsize;
-             AUDIO_IO_LOGD("RECORD buffer size[%d]", ret);
+             AUDIO_IO_LOGD("RECORD buffer size[%zu]", ret);
          }
      } catch (CAudioError& e) {
          if (isInThread() == false) {
@@@ -1062,4 -1054,3 +1068,4 @@@ CPulseAudioClient::EStreamDirection CPu
  CPulseStreamSpec CPulseAudioClient::getStreamSpec() {
      return __mSpec;
  }
 +//LCOV_EXCL_STOP
diff --combined src/cpp/cpp_audio_io.cpp
@@@ -390,12 -390,10 +390,12 @@@ int cpp_audio_in_create(int sample_rate
          __handle_safe_free(handle, (void *)input, false);
          return __convert_CAudioError(e);
      } catch (const std::bad_alloc&) {
 +//LCOV_EXCL_START
          CAudioError e = CAudioError::EError::ERROR_OUT_OF_MEMORY;
          AUDIO_IO_LOGE("Failed to allocate handle");
          __handle_safe_free(handle, (void *)input, false);
          return __convert_CAudioError(e);
 +//LCOV_EXCL_STOP
      }
  
      return AUDIO_IO_ERROR_NONE;
@@@ -571,7 -569,7 +571,7 @@@ int cpp_audio_in_read(audio_in_h input
          size_t readn = inputHandle->read(buffer, static_cast<size_t>(length));
          ret = static_cast<int>(readn);
  #ifdef _AUDIO_IO_DEBUG_TIMING_
-         AUDIO_IO_LOGD("readn:%d", readn);
+         AUDIO_IO_LOGD("readn:%zu", readn);
  #endif
      } catch (CAudioError& e) {
          AUDIO_IO_LOGE("%s", e.getErrorMsg());
@@@ -673,7 -671,6 +673,7 @@@ static void __stream_cb_internal(size_
          audioIo->stream_callback.onStream(audioIo, nbytes, audioIo->stream_callback.user_data);
  }
  
 +//LCOV_EXCL_START
  static void __state_changed_cb_internal(CAudioInfo::EAudioIOState state,
                                          CAudioInfo::EAudioIOState state_prev,
                                          bool by_policy,
                                                         __convert_state_type(state), by_policy,
                                                         audioIo->state_changed_callback.user_data);
  }
 +//LCOV_EXCL_STOP
  
  int cpp_audio_in_set_stream_cb(audio_in_h input, audio_in_stream_cb callback, void* user_data) {
      audio_io_s* handle = static_cast<audio_io_s*>(input);
@@@ -872,12 -868,10 +872,12 @@@ int cpp_audio_out_create_new(int sample
          __handle_safe_free(handle, (void *)output, true);
          return __convert_CAudioError(e);
      } catch (const std::bad_alloc&) {
 +//LCOV_EXCL_START
          CAudioError e = CAudioError::EError::ERROR_OUT_OF_MEMORY;
          AUDIO_IO_LOGE("Failed to allocate handle");
          __handle_safe_free(handle, (void *)output, true);
          return __convert_CAudioError(e);
 +//LCOV_EXCL_STOP
      }
  
      return AUDIO_IO_ERROR_NONE;
@@@ -1073,7 -1067,7 +1073,7 @@@ int cpp_audio_out_write(audio_out_h out
          size_t written = outputHandle->write(buffer, static_cast<size_t>(length));
          ret = static_cast<int>(written);
  #ifdef _AUDIO_IO_DEBUG_TIMING_
-         AUDIO_IO_LOGD("written:%d", written);
+         AUDIO_IO_LOGD("written:%zu", written);
  #endif
      } catch (CAudioError& e) {
          AUDIO_IO_LOGE("%s", e.getErrorMsg());