motion-capture 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/project/motion-capture.rb +8 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07f7f1e40256802d73115f3bb22e8bf34de7a037
|
4
|
+
data.tar.gz: 3e4b7325ebb2e8e57ea8b9a89b56fa3efac0732e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4d8836518d35462514bfc3f668c91690348f4c233fa16829912ca4b5890d3b002c02b0aa918db8ddf058bec6f08387558243aad3fd6c83bf3640a3d529b36f5
|
7
|
+
data.tar.gz: 29fe72673e7f09b2fc9e92fcd11950013f6991b042dbd83064db11d39afe50ba68a1ac912f50ba751b18b3384f88265d95a01b63cd0309f31da1a8621ee705ba
|
@@ -2,7 +2,7 @@ module Motion; class Capture
|
|
2
2
|
CAMERA_POSITIONS = { rear: AVCaptureDevicePositionBack, front: AVCaptureDevicePositionFront }
|
3
3
|
FLASH_MODES = { on: AVCaptureFlashModeOn, off: AVCaptureFlashModeOff, auto: AVCaptureFlashModeAuto }
|
4
4
|
|
5
|
-
attr_reader :options, :device
|
5
|
+
attr_reader :options, :device, :preview_layer
|
6
6
|
|
7
7
|
def initialize(options = {})
|
8
8
|
@options = options
|
@@ -28,10 +28,11 @@ module Motion; class Capture
|
|
28
28
|
remove_outputs
|
29
29
|
remove_inputs
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
@
|
34
|
-
@
|
31
|
+
preview_layer.removeFromSuperlayer if preview_layer && preview_layer.superlayer
|
32
|
+
|
33
|
+
@still_image_output = nil
|
34
|
+
@session = nil
|
35
|
+
@preview_layer = nil
|
35
36
|
end
|
36
37
|
|
37
38
|
def running?
|
@@ -83,7 +84,7 @@ module Motion; class Capture
|
|
83
84
|
end
|
84
85
|
|
85
86
|
def attach(view, options = {})
|
86
|
-
preview_layer = preview_layer_for_view(view, options)
|
87
|
+
@preview_layer = preview_layer_for_view(view, options)
|
87
88
|
|
88
89
|
view.layer.addSublayer(preview_layer)
|
89
90
|
end
|
@@ -143,7 +144,7 @@ module Motion; class Capture
|
|
143
144
|
end
|
144
145
|
|
145
146
|
def still_image_connection
|
146
|
-
|
147
|
+
still_image_output.connectionWithMediaType(AVMediaTypeVideo).tap do |connection|
|
147
148
|
connection.setVideoOrientation(UIDevice.currentDevice.orientation) if connection.videoOrientationSupported?
|
148
149
|
end
|
149
150
|
end
|