コード例 #1
0
 public int getNativeCameraHardRotation(boolean preview) {
   int terminalRotation = getTerminalRotation();
   boolean isFront = NgnCameraProducer.isFrontFacingCameraEnabled();
   if (NgnApplication.isSamsung()) {
     if (preview) {
       if (isFront) {
         if (terminalRotation == 0) return 0;
         else return 90;
       } else return 0;
     } else {
       if (isFront) {
         if (terminalRotation == 0) return -270;
         else return 90;
       } else {
         if (terminalRotation == 0) return 0;
         else return 0;
       }
     }
   } else if (NgnApplication.isToshiba()) {
     if (preview) {
       if (terminalRotation == 0) return 0;
       else return 270;
     } else {
       return 0;
     }
   } else {
     return 0;
   }
 }
コード例 #2
0
 public int getTerminalRotation() {
   android.content.res.Configuration conf =
       NgnApplication.getContext().getResources().getConfiguration();
   int terminalRotation = 0;
   switch (conf.orientation) {
     case android.content.res.Configuration.ORIENTATION_LANDSCAPE:
       terminalRotation = 0; // The starting position is 0 (landscape).
       break;
     case android.content.res.Configuration.ORIENTATION_PORTRAIT:
       terminalRotation = 90;
       break;
   }
   return terminalRotation;
 }
コード例 #3
0
 public static NgnProxyVideoConsumer createInstance(BigInteger id, ProxyVideoConsumer consumer) {
   return NgnApplication.isGlEs2Supported()
       ? new NgnProxyVideoConsumerGL(id, consumer)
       : new NgnProxyVideoConsumerSV(id, consumer);
 }