Skip to content

Commit

Permalink
Workaround for Camera Mode detection during video recording on GH4 ca…
Browse files Browse the repository at this point in the history
…mera.
  • Loading branch information
Rambalac committed May 1, 2017
1 parent c809eaa commit 00e6a76
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Core/Camera/LumixData/CameraMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public enum CameraMode
[EnumValue(CameraModeFlags.Aperture | CameraModeFlags.Shutter | CameraModeFlags.Photo)]
M = 04,

VideoRecording = 05,

[EnumValue(CameraModeFlags.Video)]
vP = 0x3c,

Expand Down
10 changes: 7 additions & 3 deletions Core/Camera/OffFrameProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public OffFrameProcessor(string deviceName, CameraParser parser, LumixState lumi

public event Action LensChanged;

public bool OffframeBytesSupported { get; } = true;
public bool OffFrameBytesSupported { get; } = true;

public int CalcImageStart(Slice slice)
{
Expand All @@ -38,7 +38,7 @@ public void Process(Slice slice, IntPoint size)
{
var state = new ProcessState(slice, GetMultiplier(slice));

if (!OffframeBytesSupported || slice.Length < 130)
if (!OffFrameBytesSupported || slice.Length < 130)
{
return;
}
Expand All @@ -50,7 +50,11 @@ public void Process(Slice slice, IntPoint size)

lumixState.Aperture = GetFromShort(state.Main, 56, parser.ApertureBinary);

lumixState.CameraMode = state.Main[92].ToEnum(CameraMode.Unknown);
var newmode = state.Main[92].ToEnum(CameraMode.Unknown);
if (newmode != CameraMode.VideoRecording)
{
lumixState.CameraMode = newmode;
}

lumixState.Orientation = state.Original[42].ToEnum(CameraOrientation.Undefined);

Expand Down

0 comments on commit 00e6a76

Please sign in to comment.