OSDN Git Service

Fix indentation and redundant whitespace
authorGlenn Kasten <gkasten@google.com>
Fri, 12 Aug 2011 21:29:12 +0000 (14:29 -0700)
committerGlenn Kasten <gkasten@google.com>
Thu, 15 Dec 2011 01:43:26 +0000 (17:43 -0800)
Change-Id: I8e0193ad5aa9405f64203bf7814d8a9e434c5dde

wilhelm/src/android/AudioPlayer_to_android.cpp
wilhelm/src/android/AudioRecorder_to_android.cpp
wilhelm/src/android/VideoCodec_to_android.cpp
wilhelm/src/itf/IEqualizer.c
wilhelm/src/itf/IStreamInformation.c
wilhelm/src/itf/IVirtualizer.c
wilhelm/tests/native-media/jni/native-media-jni.c
wilhelm/tools/hashgen/Makefile

index 8f85e59..0e8a8be 100644 (file)
@@ -129,7 +129,7 @@ static size_t adecoder_writeToBufferQueue(const uint8_t *data, size_t size, CAud
 
             // the buffer at the head of the buffer queue is full, update the state
             ap->mBufferQueue.mSizeConsumed = 0;
-            if (newFront ==  &ap->mBufferQueue.mArray[ap->mBufferQueue.mNumBuffers + 1]) {
+            if (newFront == &ap->mBufferQueue.mArray[ap->mBufferQueue.mNumBuffers + 1]) {
                 newFront = ap->mBufferQueue.mArray;
             }
             ap->mBufferQueue.mFront = newFront;
@@ -906,7 +906,7 @@ SLresult android_audioPlayer_checkSourceSink(CAudioPlayer *pAudioPlayer)
     case SL_DATALOCATOR_BUFFERQUEUE:
     case SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE:
         {
-        SLDataLocator_BufferQueue *dl_bq =  (SLDataLocator_BufferQueue *) pAudioSrc->pLocator;
+        SLDataLocator_BufferQueue *dl_bq = (SLDataLocator_BufferQueue *) pAudioSrc->pLocator;
 
         // Buffer format
         switch (sourceFormatType) {
@@ -996,7 +996,7 @@ SLresult android_audioPlayer_checkSourceSink(CAudioPlayer *pAudioPlayer)
     //   URI
     case SL_DATALOCATOR_URI:
         {
-        SLDataLocator_URI *dl_uri =  (SLDataLocator_URI *) pAudioSrc->pLocator;
+        SLDataLocator_URI *dl_uri = (SLDataLocator_URI *) pAudioSrc->pLocator;
         if (NULL == dl_uri->URI) {
             return SL_RESULT_PARAMETER_INVALID;
         }
@@ -1375,7 +1375,7 @@ SLresult android_audioPlayer_realize(CAudioPlayer *pAudioPlayer, SLboolean async
         {
         // initialize platform-specific CAudioPlayer fields
 
-        SLDataLocator_BufferQueue *dl_bq =  (SLDataLocator_BufferQueue *)
+        SLDataLocator_BufferQueue *dl_bq = (SLDataLocator_BufferQueue *)
                 pAudioPlayer->mDynamicSource.mDataSource;
         SLDataFormat_PCM *df_pcm = (SLDataFormat_PCM *)
                 pAudioPlayer->mDynamicSource.mDataSource->pFormat;
@@ -1573,39 +1573,39 @@ SLresult android_audioPlayer_preDestroy(CAudioPlayer *pAudioPlayer) {
     SL_LOGD("android_audioPlayer_preDestroy(%p)", pAudioPlayer);
     SLresult result = SL_RESULT_SUCCESS;
 
-  bool disableCallbacksBeforePreDestroy;
-  switch (pAudioPlayer->mAndroidObjType) {
-  // Not yet clear why this order is important, but it reduces detected deadlocks
-  case AUDIOPLAYER_FROM_URIFD_TO_PCM_BUFFERQUEUE:
-    disableCallbacksBeforePreDestroy = true;
-    break;
-  // Use the old behavior for all other use cases until proven
-  // case AUDIOPLAYER_FROM_ADTS_ABQ_TO_PCM_BUFFERQUEUE:
-  default:
-    disableCallbacksBeforePreDestroy = false;
-    break;
-  }
+    bool disableCallbacksBeforePreDestroy;
+    switch (pAudioPlayer->mAndroidObjType) {
+    // Not yet clear why this order is important, but it reduces detected deadlocks
+    case AUDIOPLAYER_FROM_URIFD_TO_PCM_BUFFERQUEUE:
+        disableCallbacksBeforePreDestroy = true;
+        break;
+    // Use the old behavior for all other use cases until proven
+    // case AUDIOPLAYER_FROM_ADTS_ABQ_TO_PCM_BUFFERQUEUE:
+    default:
+        disableCallbacksBeforePreDestroy = false;
+        break;
+    }
 
-  if (disableCallbacksBeforePreDestroy) {
-    object_unlock_exclusive(&pAudioPlayer->mObject);
-    if (pAudioPlayer->mCallbackProtector != 0) {
-        pAudioPlayer->mCallbackProtector->requestCbExitAndWait();
+    if (disableCallbacksBeforePreDestroy) {
+        object_unlock_exclusive(&pAudioPlayer->mObject);
+        if (pAudioPlayer->mCallbackProtector != 0) {
+            pAudioPlayer->mCallbackProtector->requestCbExitAndWait();
+        }
+        object_lock_exclusive(&pAudioPlayer->mObject);
     }
-    object_lock_exclusive(&pAudioPlayer->mObject);
-  }
 
     if (pAudioPlayer->mAPlayer != 0) {
         pAudioPlayer->mAPlayer->preDestroy();
     }
     SL_LOGD("android_audioPlayer_preDestroy(%p) after mAPlayer->preDestroy()", pAudioPlayer);
 
-  if (!disableCallbacksBeforePreDestroy) {
-    object_unlock_exclusive(&pAudioPlayer->mObject);
-    if (pAudioPlayer->mCallbackProtector != 0) {
-        pAudioPlayer->mCallbackProtector->requestCbExitAndWait();
+    if (!disableCallbacksBeforePreDestroy) {
+        object_unlock_exclusive(&pAudioPlayer->mObject);
+        if (pAudioPlayer->mCallbackProtector != 0) {
+            pAudioPlayer->mCallbackProtector->requestCbExitAndWait();
+        }
+        object_lock_exclusive(&pAudioPlayer->mObject);
     }
-    object_lock_exclusive(&pAudioPlayer->mObject);
-  }
 
     return result;
 }
index 497bed2..d7bafcb 100644 (file)
@@ -192,7 +192,7 @@ SLresult android_audioRecorder_checkSourceSinkSupport(CAudioRecorder* ar) {
     } else {
 
         // check it's an input device
-        SLDataLocator_IODevice *dl_iod =  (SLDataLocator_IODevice *) pAudioSrc->pLocator;
+        SLDataLocator_IODevice *dl_iod = (SLDataLocator_IODevice *) pAudioSrc->pLocator;
         if (SL_IODEVICE_AUDIOINPUT != dl_iod->deviceType) {
             SL_LOGE(ERROR_RECORDER_IODEVICE_MUST_BE_AUDIOINPUT);
             return SL_RESULT_PARAMETER_INVALID;
@@ -244,7 +244,7 @@ static void audioRecorder_callback(int event, void* user, void *info) {
                 // finish pushing the buffer or push the buffer in one shot
                 pBuff->size = oldFront->mSize - ar->mBufferQueue.mSizeConsumed;
                 ar->mBufferQueue.mSizeConsumed = 0;
-                if (newFront ==  &ar->mBufferQueue.mArray[ar->mBufferQueue.mNumBuffers + 1]) {
+                if (newFront == &ar->mBufferQueue.mArray[ar->mBufferQueue.mNumBuffers + 1]) {
                     newFront = ar->mBufferQueue.mArray;
                 }
                 ar->mBufferQueue.mFront = newFront;
index 20aad28..5f3deaa 100644 (file)
@@ -181,7 +181,7 @@ SLresult android_videoCodec_getProfileLevelCombination(XAuint32 decoderId, XAuin
             pDescr->codecId = decoderId;
             pDescr->profileSetting = convertOpenMaxIlToAl(VideoDecoderCapabilities[decoderIndex].
                     itemAt(0).mProfileLevels.itemAt(plIndex).mProfile);
-            pDescr->levelSetting =  convertOpenMaxIlToAl(VideoDecoderCapabilities[decoderIndex].
+            pDescr->levelSetting = convertOpenMaxIlToAl(VideoDecoderCapabilities[decoderIndex].
                     itemAt(0).mProfileLevels.itemAt(plIndex).mLevel);
             //     initialize the fields we don't know about
             pDescr->maxWidth = 0;
index e50bdb7..14ff965 100644 (file)
@@ -80,25 +80,25 @@ static SLresult IEqualizer_IsEnabled(SLEqualizerItf self, SLboolean *pEnabled)
 {
     SL_ENTER_INTERFACE
 
-      if (NULL == pEnabled) {
-          result = SL_RESULT_PARAMETER_INVALID;
-      } else {
-          IEqualizer *thiz = (IEqualizer *) self;
-          interface_lock_exclusive(thiz);
-          SLboolean enabled = thiz->mEnabled;
+    if (NULL == pEnabled) {
+        result = SL_RESULT_PARAMETER_INVALID;
+    } else {
+        IEqualizer *thiz = (IEqualizer *) self;
+        interface_lock_exclusive(thiz);
+        SLboolean enabled = thiz->mEnabled;
  #if !defined(ANDROID)
-          *pEnabled = enabled;
-          result = SL_RESULT_SUCCESS;
+        *pEnabled = enabled;
+        result = SL_RESULT_SUCCESS;
  #else
-          if (NO_EQ(thiz)) {
-              result = SL_RESULT_CONTROL_LOST;
-          } else {
-              *pEnabled = (SLboolean) thiz->mEqEffect->getEnabled();
-              result = SL_RESULT_SUCCESS;
-          }
+        if (NO_EQ(thiz)) {
+            result = SL_RESULT_CONTROL_LOST;
+        } else {
+            *pEnabled = (SLboolean) thiz->mEqEffect->getEnabled();
+            result = SL_RESULT_SUCCESS;
+        }
  #endif
-          interface_unlock_exclusive(thiz);
-      }
+        interface_unlock_exclusive(thiz);
+    }
 
       SL_LEAVE_INTERFACE
 }
index bfd9233..d8da5a9 100644 (file)
@@ -60,7 +60,7 @@ static XAresult IStreamInformation_QueryStreamType( XAStreamInformationItf self,
     }
 
 #ifndef ANDROID
-    *domain =  XA_DOMAINTYPE_UNKNOWN;
+    *domain = XA_DOMAINTYPE_UNKNOWN;
 #else
     if (0 == streamIndex) {
         // stream 0 is reserved for the container
index 70e2295..c640811 100644 (file)
@@ -64,27 +64,27 @@ static SLresult IVirtualizer_IsEnabled(SLVirtualizerItf self, SLboolean *pEnable
 {
     SL_ENTER_INTERFACE
 
-     if (NULL == pEnabled) {
-         result = SL_RESULT_PARAMETER_INVALID;
-     } else {
-         IVirtualizer *thiz = (IVirtualizer *) self;
-         interface_lock_exclusive(thiz);
-         SLboolean enabled = thiz->mEnabled;
+    if (NULL == pEnabled) {
+        result = SL_RESULT_PARAMETER_INVALID;
+    } else {
+        IVirtualizer *thiz = (IVirtualizer *) self;
+        interface_lock_exclusive(thiz);
+        SLboolean enabled = thiz->mEnabled;
 #if !defined(ANDROID)
-         *pEnabled = enabled;
-         result = SL_RESULT_SUCCESS;
+        *pEnabled = enabled;
+        result = SL_RESULT_SUCCESS;
 #else
-         if (NO_VIRTUALIZER(thiz)) {
-             result = SL_RESULT_CONTROL_LOST;
-         } else {
-             *pEnabled = (SLboolean) thiz->mVirtualizerEffect->getEnabled();
-             result = SL_RESULT_SUCCESS;
-         }
+        if (NO_VIRTUALIZER(thiz)) {
+            result = SL_RESULT_CONTROL_LOST;
+        } else {
+            *pEnabled = (SLboolean) thiz->mVirtualizerEffect->getEnabled();
+            result = SL_RESULT_SUCCESS;
+        }
 #endif
-         interface_unlock_exclusive(thiz);
-     }
+        interface_unlock_exclusive(thiz);
+    }
 
-     SL_LEAVE_INTERFACE
+    SL_LEAVE_INTERFACE
 }
 
 
@@ -92,27 +92,27 @@ static SLresult IVirtualizer_SetStrength(SLVirtualizerItf self, SLpermille stren
 {
     SL_ENTER_INTERFACE
 
-     if ((VIRTUALIZER_STRENGTH_MIN > strength) || (VIRTUALIZER_STRENGTH_MAX < strength)) {
-         result = SL_RESULT_PARAMETER_INVALID;
-     } else {
-         IVirtualizer *thiz = (IVirtualizer *) self;
-         interface_lock_exclusive(thiz);
+    if ((VIRTUALIZER_STRENGTH_MIN > strength) || (VIRTUALIZER_STRENGTH_MAX < strength)) {
+        result = SL_RESULT_PARAMETER_INVALID;
+    } else {
+        IVirtualizer *thiz = (IVirtualizer *) self;
+        interface_lock_exclusive(thiz);
 #if !defined(ANDROID)
-         thiz->mStrength = strength;
-         result = SL_RESULT_SUCCESS;
+        thiz->mStrength = strength;
+        result = SL_RESULT_SUCCESS;
 #else
-         if (NO_VIRTUALIZER(thiz)) {
-             result = SL_RESULT_CONTROL_LOST;
-         } else {
-             android::status_t status = android_virt_setParam(thiz->mVirtualizerEffect,
-                     VIRTUALIZER_PARAM_STRENGTH, &strength);
-             result = android_fx_statusToResult(status);
-         }
+        if (NO_VIRTUALIZER(thiz)) {
+            result = SL_RESULT_CONTROL_LOST;
+        } else {
+            android::status_t status = android_virt_setParam(thiz->mVirtualizerEffect,
+                    VIRTUALIZER_PARAM_STRENGTH, &strength);
+            result = android_fx_statusToResult(status);
+        }
 #endif
-         interface_unlock_exclusive(thiz);
-     }
+        interface_unlock_exclusive(thiz);
+    }
 
-     SL_LEAVE_INTERFACE
+    SL_LEAVE_INTERFACE
 }
 
 
index 6c5a283..e8db6f2 100644 (file)
@@ -445,7 +445,7 @@ jboolean Java_com_example_nativemedia_NativeMedia_createStreamingMediaPlayer(JNI
 
     // start the playback
     res = (*playerPlayItf)->SetPlayState(playerPlayItf, XA_PLAYSTATE_PLAYING);
-        assert(XA_RESULT_SUCCESS == res);
+    assert(XA_RESULT_SUCCESS == res);
 
     return JNI_TRUE;
 }
index b9db863..525e2f9 100644 (file)
@@ -58,7 +58,7 @@ part5gen : part5gen.o OpenSLES_IID.o interfaces.o
 
 clean :
        $(RM) part5gen frag1 *.o
-       $(RM) part23in.gperf part5gen.c part23in.c 
+       $(RM) part23in.gperf part5gen.c part23in.c
        $(RM) part2.c part3.c part5.c part7.c
 
 distclean : clean