mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-20 12:38:09 +00:00
Landscape preview in landscape orientation on sdk>=8
This commit is contained in:
parent
013e835343
commit
276874bf64
3 changed files with 9 additions and 6 deletions
|
|
@ -167,7 +167,8 @@ public abstract class AndroidCameraRecord {
|
|||
public void setDisplayOrientation(int rotation) {
|
||||
displayOrientation = rotation;
|
||||
}
|
||||
|
||||
protected int getDisplayOrientation() {return displayOrientation;}
|
||||
|
||||
protected int rotateCapturedFrame() {
|
||||
if (params.videoDimensionsInverted) {
|
||||
return 1; // always rotate 90°
|
||||
|
|
|
|||
|
|
@ -30,10 +30,10 @@ import android.util.Log;
|
|||
* @author Guillaume Beraudo
|
||||
*
|
||||
*/
|
||||
public class AndroidCameraRecordBufferedImpl extends AndroidCameraRecordImplAPI5 {
|
||||
public class AndroidCameraRecordAPI8Impl extends AndroidCameraRecordImplAPI5 {
|
||||
|
||||
|
||||
public AndroidCameraRecordBufferedImpl(RecorderParams parameters) {
|
||||
public AndroidCameraRecordAPI8Impl(RecorderParams parameters) {
|
||||
super(parameters);
|
||||
}
|
||||
|
||||
|
|
@ -66,8 +66,10 @@ public class AndroidCameraRecordBufferedImpl extends AndroidCameraRecordImplAPI5
|
|||
protected void onSettingCameraParameters(Parameters parameters) {
|
||||
super.onSettingCameraParameters(parameters);
|
||||
// Only on v8 hardware
|
||||
camera.setDisplayOrientation(90 * rotateCapturedFrame());
|
||||
camera.setDisplayOrientation(90 * getPreviewCaptureRotation());
|
||||
}
|
||||
|
||||
|
||||
private int getPreviewCaptureRotation() {
|
||||
return (4 + 1 - displayOrientation) % 4;
|
||||
}
|
||||
}
|
||||
|
|
@ -155,7 +155,7 @@ public class AndroidCameraRecordManager {
|
|||
parameters.rotation = rotation;
|
||||
parameters.surfaceView = surfaceView;
|
||||
if (version >= 8) {
|
||||
recorder = new AndroidCameraRecordBufferedImpl(parameters);
|
||||
recorder = new AndroidCameraRecordAPI8Impl(parameters);
|
||||
} else if (version >= 5) {
|
||||
recorder = new AndroidCameraRecordImplAPI5(parameters);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue