This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | public class FaceCropUtil { | |
| public static Bitmap getCropedFaceFromBitmap(Bitmap bitmap, FaceInfo info) { | |
| if (bitmap != null && info != null) { | |
| int centerX = (int) info.mCenter_x; | |
| int centerY = (int) info.mCenter_y; | |
| int faceWidth = (int) (info.mWidth * 1.5f); | |
| int faceHeight = (int) (info.mWidth * 1.6f); | |
| Rect cropRect = new Rect( | |
| Math.max(0, centerX - faceWidth / 2), | |
| Math.max(0, centerY - (int) (faceHeight / 1.6f)), | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Promission grant list | |
| adb shell pm grant com.baidu.aip.robot android.permission.ACCESS_NETWORK_STATE | |
| adb shell pm grant com.baidu.aip.robot android.permission.ACCESS_WIFI_STATE | |
| adb shell pm grant com.baidu.aip.robot android.permission.BATTERY_STATS | |
| adb shell pm grant com.baidu.aip.robot android.permission.CHANGE_WIFI_STATE | |
| adb shell pm grant com.baidu.aip.robot android.permission.CAMERA | |
| adb shell pm grant com.baidu.aip.robot android.permission.DISABLE_KEYGUARD | |
| adb shell pm grant com.baidu.aip.robot android.permission.INTERNET | |
| adb shell pm grant com.baidu.aip.robot android.permission.RECORD_AUDIO | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Push Stream | |
| ffmpeg -f avfoundation -i "1" -vcodec libx264 -preset ultrafast -acodec libfaac -f flv rtmp://push.hainiutv.com/manatee/stream1 | |
| # PCM Play | |
| ffplay -ar 16000 -channels 1 -f s16le -i xxx.pcm | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import java.util.*; | |
| import java.io.*; | |
| import java.security.*; | |
| public class ChangePassword | |
| { | |
| private final static JKS j = new JKS(); | |
| public static void main(String[] args) throws Exception | |
| { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | func resizeImage(with buffer: CMSampleBuffer) { | |
| let pixel = CMSampleBufferGetImageBuffer(buffer) | |
| guard let pixelBuffer = pixel else { return } | |
| CVPixelBufferLockBaseAddress(pixelBuffer, CVPixelBufferLockFlags(rawValue: 0)) | |
| let baseAddress = CVPixelBufferGetBaseAddress(pixelBuffer) | |
| let bytesPerRow = CVPixelBufferGetBytesPerRow(pixelBuffer) | |
| var inputBuffer = vImage_Buffer() | |
| inputBuffer.height = inputHeight | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | -(UIImage*)mmg_imageScaledToFitSize:(CGSize)fitSize | |
| { | |
| // Create a vImage_Buffer from the CGImage | |
| CGImageRef sourceRef = self.CGImage; | |
| vImage_Buffer srcBuffer; | |
| vImage_CGImageFormat format = { | |
| .bitsPerComponent = 8, | |
| .bitsPerPixel = 32, | |
| .colorSpace = NULL, | |
| .bitmapInfo = (CGBitmapInfo)kCGImageAlphaFirst, |