motion-capture 1.2.4 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/project/motion-capture.rb +11 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 45554733eedab534e6821dacf7e406ded0ca56ca
4
- data.tar.gz: da06914f0262e3b3e5464e25438afbb2eb028f81
3
+ metadata.gz: 01995d1b733c94c5488a143581561388ba1a1da4
4
+ data.tar.gz: ed9d092385cff36b92ea2e3abca95fcb072b3411
5
5
  SHA512:
6
- metadata.gz: 1cf2112337bebae3517694c7d624418eac47ddeac5e9b0d0a01e48173635e754fd117f584b4ac90e37c1f643921086bcb1b4ef0200ccbc116a3a36d556fc4ff4
7
- data.tar.gz: 6e5eb10ce04a9b678b221b3c483b624cbde9455740d13def41968d7fdf7c557aa0c32c504b8c7aeaba2ba01159cdd394674bcf817bffd879e13cdfdeae24d425
6
+ metadata.gz: 265a593eba5add1be3cd5452ed61b73668a35165f1ed4388ac5a31db97d1c3744dbf803bb415258d49b9399e8f484f40ac9b683d38d190520ee2e9417515e932
7
+ data.tar.gz: cc94fe1e5cae8c9843cbc8bfde0833b403999523eb6dd8620df61479172002376a0d045a4a5bc0badbd1c8a10dd0a8785345205498c22861c4d00c4b8dbf4eba
@@ -147,10 +147,20 @@ module Motion; class Capture
147
147
 
148
148
  def still_image_connection
149
149
  still_image_output.connectionWithMediaType(AVMediaTypeVideo).tap do |connection|
150
- connection.setVideoOrientation(UIDevice.currentDevice.orientation) if connection.videoOrientationSupported?
150
+ device_orientation = UIDevice.currentDevice.orientation
151
+ video_orientation = orientation_mapping.fetch(device_orientation, AVCaptureVideoOrientationPortrait)
152
+
153
+ connection.setVideoOrientation(video_orientation) if connection.videoOrientationSupported?
151
154
  end
152
155
  end
153
156
 
157
+ def orientation_mapping
158
+ { UIDeviceOrientationPortrait => AVCaptureVideoOrientationPortrait,
159
+ UIDeviceOrientationPortraitUpsideDown => AVCaptureVideoOrientationPortraitUpsideDown,
160
+ UIDeviceOrientationLandscapeRight => AVCaptureVideoOrientationLandscapeRight,
161
+ UIDeviceOrientationLandscapeLeft => AVCaptureVideoOrientationLandscapeLeft }
162
+ end
163
+
154
164
  def assets_library
155
165
  @assets_library ||= ALAssetsLibrary.alloc.init
156
166
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-capture
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Devon Blandin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-15 00:00:00.000000000 Z
11
+ date: 2014-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake