shithub: openh264

Download patch

ref: b53f8909de7651216cecd70d00f32863b098815e
parent: 30e510e30791b0242fabf465091d9c1aaa1d0bc2
author: syureyi <[email protected]>
date: Fri Jul 25 10:41:06 EDT 2014

astyle

--- a/autotest/unitTest/android/run_AutoTest_android.sh
+++ b/autotest/unitTest/android/run_AutoTest_android.sh
@@ -5,8 +5,8 @@
 AUTO_TEST_RES_PATH="${AUTO_TEST_ANDROID_PATH}/report"
 mkdir -p ${AUTO_TEST_RES_PATH}
 #Prepare android build enviroment
-echo please set the enviroment variable as: 
-echo export ANDROID_HOME="path of android sdk" 
+echo please set the enviroment variable as:
+echo export ANDROID_HOME="path of android sdk"
 echo export ANDROID_NDK_HOME="path of android ndk"
 ANDROID_SDK_PATH=${ANDROID_HOME}
 ANDROID_NDK_PATH=${ANDROID_NDK_HOME}
@@ -13,13 +13,13 @@
 ANDROID_MAKE_PARAMS="OS=android NDKROOT=${ANDROID_NDK_PATH} TARGET=android-19"
 
 if [ "#${ANDROID_SDK_PATH}" = "#" ]
-then  
-echo Please set ANDROID_HOME with the path of Android SDK 
+then
+echo Please set ANDROID_HOME with the path of Android SDK
 exit 1
 fi
 if [ "#${ANDROID_NDK_PATH}" = "#" ]
 then
-echo Please set ANDROID_NDK_HOME with the path of Android NDK 
+echo Please set ANDROID_NDK_HOME with the path of Android NDK
 exit 1
 fi
 #make build
@@ -30,7 +30,7 @@
 make $ANDROID_MAKE_PARAMS test
 
 if [ $? -ne 0 ]
-then 
+then
    echo Build error,check with the trace of make
    exit 1
 fi
@@ -48,13 +48,13 @@
 ADB=${ANDROID_SDK_PATH}/platform-tools/adb
 
 #get devices
-devices=`$ADB devices | awk -F" " '/\tdevice/{print $1}'`                                         
-if [ "#$devices" = "#" ];then                                                                     
-   echo "Have not any android devices."                                        
-   exit 1                                                                                        
-fi 
-              
-#run apk                                                                          
+devices=`$ADB devices | awk -F" " '/\tdevice/{print $1}'`
+if [ "#$devices" = "#" ];then
+   echo "Have not any android devices."
+   exit 1
+fi
+
+#run apk
 run_apk() {
 local apk=$1;
 local rand=` date +%s`
@@ -64,10 +64,10 @@
 log_grep_params="welsenc"
 test_res=./res
 xml_file="sdcard/codec_unittest.xml"
-for dev in $devices; do  
+for dev in $devices; do
     #dev_info_file=${AUTO_TEST_RES_PATH}/${dev}.log
-    report_file=${AUTO_TEST_RES_PATH}/codec_unittest_${dev}_${rand}.xml                                                                  
-    $ADB -s $dev uninstall ${apk_id}                                            
+    report_file=${AUTO_TEST_RES_PATH}/codec_unittest_${dev}_${rand}.xml
+    $ADB -s $dev uninstall ${apk_id}
     $ADB -s $dev install -r ${apk}
     #TODO: output more info about android device such as name,cpu,memory,and also power comsumption.
     echo `$ADB -s $dev shell cat /system/build.prop |grep ro.product.model | awk -F"=" '{print $2}'`>${dev_info_file}
@@ -89,7 +89,7 @@
     #delete the res
     $ADB -s $dev shell rm -rf ${xml_file}
     $ADB -s $dev shell rm -rf /sdcard/res
-done      
+done
 }
 for apk in ${apk_name};do
    run_apk $apk;
--- a/autotest/unitTest/ios/run_AutoTest_ios.sh
+++ b/autotest/unitTest/ios/run_AutoTest_ios.sh
@@ -13,13 +13,13 @@
 buildXcodeProject()
 {
  xcodebuild ARCHS="${CODEC_TEST_IOS_ARCH}" VALID_ARCHS="${CODEC_TEST_IOS_ARCH}" ONLY_ACTIVE_ARCH=NO -project $1 -target $2 -configuration $3 -sdk ${CODEC_TEST_IOS_PLATFORM} clean build
- 
-if [ $? -eq 0 ]; then                                                                              
- echo "build $1 $3 successfully"                                                                                                                                                         
- else                                                                                              
- echo "build $1 $3  fail"                                                                        
- exit 1                                                                                         
- fi            
+
+if [ $? -eq 0 ]; then
+ echo "build $1 $3 successfully"
+ else
+ echo "build $1 $3  fail"
+ exit 1
+ fi
 }
 
 
@@ -39,27 +39,27 @@
      CODEC_TEST_IOS_APP_ID="com.cisco.codec-unittest"
      CODEC_TEST_RES=${AUTO_TEST_SRC_PATH}/res
      CODEC_TEST_LOG="codec_unittest"
-for PARAM in $*; do  
+for PARAM in $*; do
    if [ "release" = "${PARAM}" ]; then
-     CODEC_TEST_IOS_DEBUG_RELEASE="Release"                                                      
-     CODEC_TEST_IOS_REPORT_SUBFOLDER="release"                                                   
- elif [ "debug" = "${PARAM}" ]; then                                                             
-     CODEC_TEST_IOS_DEBUG_RELEASE="Debug"                                                        
-     CODEC_TEST_IOS_REPORT_SUBFOLDER="debug"   
+     CODEC_TEST_IOS_DEBUG_RELEASE="Release"
+     CODEC_TEST_IOS_REPORT_SUBFOLDER="release"
+ elif [ "debug" = "${PARAM}" ]; then
+     CODEC_TEST_IOS_DEBUG_RELEASE="Debug"
+     CODEC_TEST_IOS_REPORT_SUBFOLDER="debug"
  elif [ "armv7" = "${PARAM}" ];then
       CODEC_TEST_IOS_ARCH="armv7"
  elif [ "armv7s" = "${PARAM}" ];then
      CODEC_TEST_IOS_ARCH="armv7s"
  elif [ "arm64" = "${PARAM}" ];then
-    CODEC_TEST_IOS_ARCH="arm64"                                                  
- else                                                                                          
-    echo parameters are illegal!!!, please have a check.                                        
-    exit 1                                                                                      
- fi                                                                                            
- done     
+    CODEC_TEST_IOS_ARCH="arm64"
+ else
+    echo parameters are illegal!!!, please have a check.
+    exit 1
+ fi
+ done
 cd ${AUTO_TEST_SRC_PATH}
 IOS_MAKE_PARAMS="OS=ios ARCH=${CODEC_TEST_IOS_ARCH}"
-############make build 
+############make build
 find ./ -name *.o -exec rm -rf {} \;
 find ./ -name *.d -exec rm -rf {} \;
 make clean
@@ -69,8 +69,8 @@
 buildXcodeProject ${CODEC_TEST_XCODE_PROJECT_NAME} ${CODEC_TEST_IOS_PROJECT_NAME} ${CODEC_TEST_IOS_DEBUG_RELEASE} ${CODEC_TEST_IOS_PLATFORM}
 
 
- 
 
+
 ##############run on ios devices#########################
 # for real device
 if [ ! -d ${CODEC_TEST_IOS_APP} ] ; then
@@ -85,15 +85,15 @@
 pids_str=`ps x -o pid,command | grep -v grep | grep "instruments" | awk '{printf "%s,", $1}'`
 instruments_pids="${pids_str//,/ }"
 for pid in ${instruments_pids}; do
-echo "Found instruments ${pid}. Killing..."                                                      
-kill -9 ${pid} && wait ${pid} &> /dev/null                                                       
-done                                                                                             
+echo "Found instruments ${pid}. Killing..."
+kill -9 ${pid} && wait ${pid} &> /dev/null
+done
 
 
 
 DEVICES=`system_profiler SPUSBDataType | sed -n -e '/iPad/,/Serial/p' -e '/iPhone/,/Serial/p' | grep "Serial Number:" | awk -F ": " '{print $2}'`
 if [ "${DEVICES}#" == "#" ]
-then  
+then
 echo "Can not find any connected device! please check device is connected to MAC!"
 exit 1
 else
@@ -139,25 +139,25 @@
 #start to run unittest,default run the xcode at arch armv7 with release
 iosUnitTest armv7 release
 
-if [ $? -ne 0 ]; then                                                                                              
-echo "Running Unittest demo with armv7 is failed!"                          
+if [ $? -ne 0 ]; then
+echo "Running Unittest demo with armv7 is failed!"
 exit 1
-else 
+else
 echo Finished unittest with armv7 on ios devices
 echo the test result is generated at ./ios/report/xx.xml
 fi
 #start to run unittest,run the xcode at arch arm64 with release
 iosUnitTest arm64 release
-if [ $? -ne 0 ]; then                                    
-echo "Running Unittest demo with arm64 is failed!"                  
-exit 1                                                   
-else                                                     
-echo Finished unittest with arm64 on ios devices         
-echo the test result is generated at ./ios/report/xx.xml 
+if [ $? -ne 0 ]; then
+echo "Running Unittest demo with arm64 is failed!"
+exit 1
+else
+echo Finished unittest with arm64 on ios devices
+echo the test result is generated at ./ios/report/xx.xml
 fi
 
 echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxIOS unittest  Endxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
-#TODO:according to the trace of instruments to do some analysis                            
+#TODO:according to the trace of instruments to do some analysis
 #find ${AUTO_TEST_IOS_SCRIPT_PATH} -name *.trace -exec rm -rf {} \;
 rm -rf *.trace
--- a/autotest/unitTest/run_ParseUTxml.sh
+++ b/autotest/unitTest/run_ParseUTxml.sh
@@ -22,7 +22,6 @@
     echo $msg
     UT_Failed_Num=$[${UT_Failed_Num}+${fails}]
 	fi
-		
 }
 
 xmlcount=`ls $REPORT | wc -l`
--- a/test/api/DataGenerator.cpp
+++ b/test/api/DataGenerator.cpp
@@ -22,12 +22,12 @@
   }
 
   FileInputStream fileStream;
- #if defined(ANDROID_NDK)
+#if defined(ANDROID_NDK)
   if (!fileStream.Open ("/sdcard/res/CiscoVT2people_160x96_6fps.yuv")) {
 #else
- if (!fileStream.Open ("res/CiscoVT2people_160x96_6fps.yuv")) {
-#endif    
-return false;
+  if (!fileStream.Open ("res/CiscoVT2people_160x96_6fps.yuv")) {
+#endif
+    return false;
   }
   if (fileStream.read (sBuf.data(), kiFrameSize) == kiFrameSize) {
     int32_t iStartPosX = rand() % (SRC_FRAME_WIDTH - iWidth);
--- a/test/api/decoder_test.cpp
+++ b/test/api/decoder_test.cpp
@@ -111,25 +111,25 @@
   {"res/CI1_FT_B.264", "cbfec15e17a504678b19a1191992131c92a1ac26"},
   {"res/CI_MW_D.264", "289f29a103c8d95adf2909c646466904be8b06d7"},
   {"res/CVFC1_Sony_C.jsv", "4641abd7419a5580b97f16e83fd1d566339229d0"},
-  {"res/CVPCMNL1_SVA_C.264", "c2b0d964de727c64b9fccb58f63b567c82bda95a"},   
-  {"res/LS_SVA_D.264", "72118f4d1674cf14e58bed7e67cb3aeed3df62b9"},         
-  {"res/MIDR_MW_D.264", "9467030f4786f75644bf06a7fc809c36d1959827"},        
-  {"res/MPS_MW_A.264", "67f1cfbef0e8025ed60dedccf8d9558d0636be5f"},         
-  {"res/MR1_BT_A.h264", "6e585f8359667a16b03e5f49a06f5ceae8d991e0"},        
-  {"res/MR1_MW_A.264", "d9e2bf34e9314dcc171ddaea2c5015d0421479f2"},         
-  {"res/MR2_MW_A.264", "628b1d4eff04c2d277f7144e23484957dad63cbe"},         
-  {"res/MR2_TANDBERG_E.264", "74d618bc7d9d41998edf4c85d51aa06111db6609"},   
-  {"res/NL1_Sony_D.jsv", "e401e30669938443c2f02522fd4d5aa1382931a0"},       
-  {"res/NLMQ1_JVC_C.264", "f3265c6ddf8db1b2bf604d8a2954f75532e28cda"},      
-  {"res/NLMQ2_JVC_C.264", "350ae86ef9ba09390d63a09b7f9ff54184109ca8"},      
-  {"res/NRF_MW_E.264", "20732198c04cd2591350a361e4510892f6eed3f0"},         
-  {"res/SVA_BA1_B.264", "c4543b24823b16c424c673616c36c7f537089b2d"},        
-  {"res/SVA_BA2_D.264", "98ff2d67860462d8d8bcc9352097c06cc401d97e"},        
-  {"res/SVA_Base_B.264", "91f514d81cd33de9f6fbf5dbefdb189cc2e7ecf4"},       
-  {"res/SVA_CL1_E.264", "4fe09ab6cdc965ea10a20f1d6dd38aca954412bb"},        
-  {"res/SVA_FM1_E.264", "fad08c4ff7cf2307b6579853d0f4652fc26645d3"},        
-  {"res/SVA_NL1_B.264", "6d63f72a0c0d833b1db0ba438afff3b4180fb3e6"},        
-  {"res/SVA_NL2_E.264", "70453ef8097c94dd190d6d2d1d5cb83c67e66238"}         
+  {"res/CVPCMNL1_SVA_C.264", "c2b0d964de727c64b9fccb58f63b567c82bda95a"},
+  {"res/LS_SVA_D.264", "72118f4d1674cf14e58bed7e67cb3aeed3df62b9"},
+  {"res/MIDR_MW_D.264", "9467030f4786f75644bf06a7fc809c36d1959827"},
+  {"res/MPS_MW_A.264", "67f1cfbef0e8025ed60dedccf8d9558d0636be5f"},
+  {"res/MR1_BT_A.h264", "6e585f8359667a16b03e5f49a06f5ceae8d991e0"},
+  {"res/MR1_MW_A.264", "d9e2bf34e9314dcc171ddaea2c5015d0421479f2"},
+  {"res/MR2_MW_A.264", "628b1d4eff04c2d277f7144e23484957dad63cbe"},
+  {"res/MR2_TANDBERG_E.264", "74d618bc7d9d41998edf4c85d51aa06111db6609"},
+  {"res/NL1_Sony_D.jsv", "e401e30669938443c2f02522fd4d5aa1382931a0"},
+  {"res/NLMQ1_JVC_C.264", "f3265c6ddf8db1b2bf604d8a2954f75532e28cda"},
+  {"res/NLMQ2_JVC_C.264", "350ae86ef9ba09390d63a09b7f9ff54184109ca8"},
+  {"res/NRF_MW_E.264", "20732198c04cd2591350a361e4510892f6eed3f0"},
+  {"res/SVA_BA1_B.264", "c4543b24823b16c424c673616c36c7f537089b2d"},
+  {"res/SVA_BA2_D.264", "98ff2d67860462d8d8bcc9352097c06cc401d97e"},
+  {"res/SVA_Base_B.264", "91f514d81cd33de9f6fbf5dbefdb189cc2e7ecf4"},
+  {"res/SVA_CL1_E.264", "4fe09ab6cdc965ea10a20f1d6dd38aca954412bb"},
+  {"res/SVA_FM1_E.264", "fad08c4ff7cf2307b6579853d0f4652fc26645d3"},
+  {"res/SVA_NL1_B.264", "6d63f72a0c0d833b1db0ba438afff3b4180fb3e6"},
+  {"res/SVA_NL2_E.264", "70453ef8097c94dd190d6d2d1d5cb83c67e66238"}
 };
 
 #endif