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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d6077491aed6ea870d7b11b9f43d3d2626227e4
4
- data.tar.gz: 2200a6cd83b7e830eea2d69a0754fd9546283b42
3
+ metadata.gz: 07f7f1e40256802d73115f3bb22e8bf34de7a037
4
+ data.tar.gz: 3e4b7325ebb2e8e57ea8b9a89b56fa3efac0732e
5
5
  SHA512:
6
- metadata.gz: 8f91edaa92370bf2e24943d0b5ffb84be8b4f35231afe9eee80fe8b33b86ae8ad8401d951ae6f32cf24fe550745124b8c8bf0c6d726d243c3f7253ce7ade0637
7
- data.tar.gz: 3955f8667dd0198ffb7cbdf8a981ebdc139891f98c8e59d2105d1f2b395703cd28b6fee89f8503b5969e72e24ec17f67cbeae5f30592c093069f147a7166f56e
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
- @still_image_output = nil
32
- @still_image_connection = nil
33
- @session = nil
34
- @capture_preview_view = nil
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
- @still_image_connection ||= still_image_output.connectionWithMediaType(AVMediaTypeVideo).tap do |connection|
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-capture
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Devon Blandin