|
|
@ -6,6 +6,7 @@ import android.content.res.TypedArray; |
|
|
|
import com.otaliastudios.cameraview.R; |
|
|
|
import com.otaliastudios.cameraview.R; |
|
|
|
|
|
|
|
|
|
|
|
import androidx.annotation.NonNull; |
|
|
|
import androidx.annotation.NonNull; |
|
|
|
|
|
|
|
import androidx.annotation.Nullable; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Parses controls from XML attributes. |
|
|
|
* Parses controls from XML attributes. |
|
|
@ -36,42 +37,53 @@ public class ControlParser { |
|
|
|
this.engine = array.getInteger(R.styleable.CameraView_cameraEngine, Engine.DEFAULT.value()); |
|
|
|
this.engine = array.getInteger(R.styleable.CameraView_cameraEngine, Engine.DEFAULT.value()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@NonNull |
|
|
|
public Preview getPreview() { |
|
|
|
public Preview getPreview() { |
|
|
|
return Preview.fromValue(preview); |
|
|
|
return Preview.fromValue(preview); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@NonNull |
|
|
|
public Facing getFacing() { |
|
|
|
public Facing getFacing() { |
|
|
|
|
|
|
|
//noinspection ConstantConditions
|
|
|
|
return Facing.fromValue(facing); |
|
|
|
return Facing.fromValue(facing); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@NonNull |
|
|
|
public Flash getFlash() { |
|
|
|
public Flash getFlash() { |
|
|
|
return Flash.fromValue(flash); |
|
|
|
return Flash.fromValue(flash); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@NonNull |
|
|
|
public Grid getGrid() { |
|
|
|
public Grid getGrid() { |
|
|
|
return Grid.fromValue(grid); |
|
|
|
return Grid.fromValue(grid); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@NonNull |
|
|
|
public Mode getMode() { |
|
|
|
public Mode getMode() { |
|
|
|
return Mode.fromValue(mode); |
|
|
|
return Mode.fromValue(mode); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@NonNull |
|
|
|
public WhiteBalance getWhiteBalance() { |
|
|
|
public WhiteBalance getWhiteBalance() { |
|
|
|
return WhiteBalance.fromValue(whiteBalance); |
|
|
|
return WhiteBalance.fromValue(whiteBalance); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@NonNull |
|
|
|
public Hdr getHdr() { |
|
|
|
public Hdr getHdr() { |
|
|
|
return Hdr.fromValue(hdr); |
|
|
|
return Hdr.fromValue(hdr); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@NonNull |
|
|
|
public Audio getAudio() { |
|
|
|
public Audio getAudio() { |
|
|
|
return Audio.fromValue(audio); |
|
|
|
return Audio.fromValue(audio); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@NonNull |
|
|
|
public VideoCodec getVideoCodec() { |
|
|
|
public VideoCodec getVideoCodec() { |
|
|
|
return VideoCodec.fromValue(videoCodec); |
|
|
|
return VideoCodec.fromValue(videoCodec); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@NonNull |
|
|
|
public Engine getEngine() { |
|
|
|
public Engine getEngine() { |
|
|
|
return Engine.fromValue(engine); |
|
|
|
return Engine.fromValue(engine); |
|
|
|
} |
|
|
|
} |
|
|
|