AVClub 0.1.3 → 0.1.4
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.
- data/lib/AVClub/version.rb +1 -1
- data/vendor/AVClub/AVClub/AVCamRecorder.m +12 -9
- data/vendor/AVClub/AVClub/AVClub.m +12 -9
- metadata +2 -2
data/lib/AVClub/version.rb
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
/*
|
2
2
|
File: AVCamRecorder.m
|
3
|
-
Abstract: An interface to manage the use of AVCaptureMovieFileOutput for recording videos. Its responsibilities include
|
3
|
+
Abstract: An interface to manage the use of AVCaptureMovieFileOutput for recording videos. Its responsibilities include
|
4
4
|
configuring the AVCaptureMovieFileOutput, adding it to the desired capture session, and starting and stopping video recordings.
|
5
5
|
Version: 1.2
|
6
|
-
|
6
|
+
|
7
7
|
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
|
8
8
|
Inc. ("Apple") in consideration of your agreement to the following
|
9
9
|
terms, and your use, installation, modification or redistribution of
|
10
10
|
this Apple software constitutes acceptance of these terms. If you do
|
11
11
|
not agree with these terms, please do not use, install, modify or
|
12
12
|
redistribute this Apple software.
|
13
|
-
|
13
|
+
|
14
14
|
In consideration of your agreement to abide by the following terms, and
|
15
15
|
subject to these terms, Apple grants you a personal, non-exclusive
|
16
16
|
license, under Apple's copyrights in this original Apple software (the
|
@@ -26,13 +26,13 @@
|
|
26
26
|
implied, are granted by Apple herein, including but not limited to any
|
27
27
|
patent rights that may be infringed by your derivative works or by other
|
28
28
|
works in which the Apple Software may be incorporated.
|
29
|
-
|
29
|
+
|
30
30
|
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
|
31
31
|
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
|
32
32
|
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
|
33
33
|
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
|
34
34
|
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
|
35
|
-
|
35
|
+
|
36
36
|
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
|
37
37
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
38
38
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
@@ -41,9 +41,9 @@
|
|
41
41
|
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
|
42
42
|
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
|
43
43
|
POSSIBILITY OF SUCH DAMAGE.
|
44
|
-
|
44
|
+
|
45
45
|
Copyright (C) 2011 Apple Inc. All Rights Reserved.
|
46
|
-
|
46
|
+
|
47
47
|
*/
|
48
48
|
|
49
49
|
#import "AVCamRecorder.h"
|
@@ -67,7 +67,7 @@
|
|
67
67
|
if ([aSession canAddOutput:aMovieFileOutput])
|
68
68
|
[aSession addOutput:aMovieFileOutput];
|
69
69
|
[self setMovieFileOutput:aMovieFileOutput];
|
70
|
-
|
70
|
+
|
71
71
|
[self setSession:aSession];
|
72
72
|
[self setOutputFileURL:anOutputFileURL];
|
73
73
|
}
|
@@ -118,9 +118,12 @@
|
|
118
118
|
-(void)startRecordingWithOrientation:(AVCaptureVideoOrientation)videoOrientation;
|
119
119
|
{
|
120
120
|
AVCaptureConnection *videoConnection = [AVCamUtilities connectionWithMediaType:AVMediaTypeVideo fromConnections:[[self movieFileOutput] connections]];
|
121
|
+
if ( ! videoConnection )
|
122
|
+
return;
|
123
|
+
|
121
124
|
if ([videoConnection isVideoOrientationSupported])
|
122
125
|
[videoConnection setVideoOrientation:videoOrientation];
|
123
|
-
|
126
|
+
|
124
127
|
[[self movieFileOutput] startRecordingToOutputFileURL:[self outputFileURL] recordingDelegate:self];
|
125
128
|
}
|
126
129
|
|
@@ -44,7 +44,7 @@
|
|
44
44
|
if (self != nil) {
|
45
45
|
self.isRunning = NO;
|
46
46
|
|
47
|
-
__block
|
47
|
+
__block AVClub *weakSelf = self;
|
48
48
|
void (^deviceConnectedBlock)(NSNotification *) = ^(NSNotification *notification) {
|
49
49
|
AVCaptureDevice *device = [notification object];
|
50
50
|
|
@@ -83,11 +83,11 @@
|
|
83
83
|
|
84
84
|
if ( [device hasMediaType:AVMediaTypeAudio] ) {
|
85
85
|
[session removeInput:[weakSelf audioInput]];
|
86
|
-
|
86
|
+
weakSelf.audioInput = nil;
|
87
87
|
}
|
88
88
|
else if ( [device hasMediaType:AVMediaTypeVideo] ) {
|
89
89
|
[session removeInput:[weakSelf videoInput]];
|
90
|
-
|
90
|
+
weakSelf.videoInput = nil;
|
91
91
|
}
|
92
92
|
|
93
93
|
if ( [delegate respondsToSelector:@selector(clubDeviceConfigurationChanged:)] )
|
@@ -167,10 +167,10 @@
|
|
167
167
|
if ( [newCaptureSession canAddOutput:newStillImageOutput] )
|
168
168
|
[newCaptureSession addOutput:newStillImageOutput];
|
169
169
|
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
170
|
+
self.stillImageOutput = newStillImageOutput;
|
171
|
+
self.videoInput = newVideoInput;
|
172
|
+
self.audioInput = newAudioInput;
|
173
|
+
self.session = newCaptureSession;
|
174
174
|
|
175
175
|
// Set up the movie file output
|
176
176
|
NSURL *outputFileURL = [self tempFileURL];
|
@@ -191,7 +191,7 @@
|
|
191
191
|
CFRunLoopPerformBlock(CFRunLoopGetMain(), kCFRunLoopCommonModes, ^{ [delegate club:self didFailWithError:noVideoError]; });
|
192
192
|
}
|
193
193
|
|
194
|
-
|
194
|
+
self.recorder = newRecorder;
|
195
195
|
|
196
196
|
// Create video preview layer and add it to the UI
|
197
197
|
if ( videoView )
|
@@ -280,6 +280,9 @@
|
|
280
280
|
- (void) captureStillImageAnimated:(BOOL)animated
|
281
281
|
{
|
282
282
|
AVCaptureConnection *stillImageConnection = [AVCamUtilities connectionWithMediaType:AVMediaTypeVideo fromConnections:[[self stillImageOutput] connections]];
|
283
|
+
if ( ! stillImageConnection )
|
284
|
+
return;
|
285
|
+
|
283
286
|
if ( [stillImageConnection isVideoOrientationSupported] )
|
284
287
|
[stillImageConnection setVideoOrientation:self.orientation];
|
285
288
|
|
@@ -354,7 +357,7 @@
|
|
354
357
|
if ( [[self session] canAddInput:newVideoInput] )
|
355
358
|
{
|
356
359
|
[[self session] addInput:newVideoInput];
|
357
|
-
|
360
|
+
self.videoInput = newVideoInput;
|
358
361
|
}
|
359
362
|
else
|
360
363
|
[[self session] addInput:[self videoInput]];
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: AVClub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|