本文整理汇总了Java中com.twilio.video.CameraCapturer.CameraSource方法的典型用法代码示例。如果您正苦于以下问题:Java CameraCapturer.CameraSource方法的具体用法?Java CameraCapturer.CameraSource怎么用?Java CameraCapturer.CameraSource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.twilio.video.CameraCapturer
的用法示例。
在下文中一共展示了CameraCapturer.CameraSource方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: switchCameraClickListener
import com.twilio.video.CameraCapturer; //导入方法依赖的package包/类
private View.OnClickListener switchCameraClickListener() {
return new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
if (cameraCapturer != null) {
CameraCapturer.CameraSource cameraSource = cameraCapturer.getCameraSource();
cameraCapturer.switchCamera();
if (thumbnailVideoView.getVisibility() == View.VISIBLE) {
thumbnailVideoView.setMirror(cameraSource == CameraCapturer.CameraSource.BACK_CAMERA);
} else {
primaryVideoView.setMirror(cameraSource == CameraCapturer.CameraSource.BACK_CAMERA);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
};
}
示例2: CameraCapturerCompat
import com.twilio.video.CameraCapturer; //导入方法依赖的package包/类
public CameraCapturerCompat(Context context,
CameraCapturer.CameraSource cameraSource) {
if (Camera2Capturer.isSupported(context)) {
setCameraPairs(context);
camera2Capturer = new Camera2Capturer(context,
getCameraId(cameraSource),
camera2Listener);
} else {
camera1Capturer = new CameraCapturer(context, cameraSource);
}
}
示例3: getCameraSource
import com.twilio.video.CameraCapturer; //导入方法依赖的package包/类
public CameraCapturer.CameraSource getCameraSource() {
if (usingCamera1()) {
return camera1Capturer.getCameraSource();
} else {
return getCameraSource(camera2Capturer.getCameraId());
}
}
示例4: switchCamera
import com.twilio.video.CameraCapturer; //导入方法依赖的package包/类
public void switchCamera() {
if (usingCamera1()) {
camera1Capturer.switchCamera();
} else {
CameraCapturer.CameraSource cameraSource = getCameraSource(camera2Capturer
.getCameraId());
if (cameraSource == CameraCapturer.CameraSource.FRONT_CAMERA) {
camera2Capturer.switchCamera(backCameraPair.second);
} else {
camera2Capturer.switchCamera(frontCameraPair.second);
}
}
}
示例5: getCameraId
import com.twilio.video.CameraCapturer; //导入方法依赖的package包/类
private String getCameraId(CameraCapturer.CameraSource cameraSource) {
if (frontCameraPair.first == cameraSource) {
return frontCameraPair.second;
} else {
return backCameraPair.second;
}
}
示例6: setThumbnailMirror
import com.twilio.video.CameraCapturer; //导入方法依赖的package包/类
private static void setThumbnailMirror() {
if (cameraCapturer != null) {
CameraCapturer.CameraSource cameraSource = cameraCapturer.getCameraSource();
final boolean isBackCamera = (cameraSource == CameraCapturer.CameraSource.BACK_CAMERA);
if (thumbnailVideoView != null && thumbnailVideoView.getVisibility() == View.VISIBLE) {
thumbnailVideoView.setMirror(isBackCamera);
}
}
}
示例7: switchCamera
import com.twilio.video.CameraCapturer; //导入方法依赖的package包/类
public void switchCamera() {
if (cameraCapturer != null) {
cameraCapturer.switchCamera();
setThumbnailMirror();
CameraCapturer.CameraSource cameraSource = cameraCapturer.getCameraSource();
final boolean isBackCamera = cameraSource == CameraCapturer.CameraSource.BACK_CAMERA;
WritableMap event = new WritableNativeMap();
event.putBoolean("isBackCamera", isBackCamera);
pushEvent(CustomTwilioVideoView.this, ON_CAMERA_SWITCHED, event);
}
}