Skip to content

Add object detection, tracking, mobile notifications, and search to any security camera.

remove useless stuff

roryclear45aeceba29bb
diff --git a/clearcam/ViewController.m b/clearcam/ViewController.m
index b5317b5..c17ad4a 100644
--- a/clearcam/ViewController.m
+++ b/clearcam/ViewController.m
@@ -16,7 +16,6 @@
@property (atomic, assign) BOOL isProcessing;
@property (nonatomic, assign) BOOL isRecording;
-@property (nonatomic, assign) BOOL orientation_changed;
@property (nonatomic, assign) CMTime startTime;
@property (nonatomic, assign) CMTime currentTime;
@property (nonatomic, strong) AVAssetWriter *assetWriter;
@@ -51,7 +50,6 @@ NSMutableDictionary *classColorMap;
self.digits[@"-"] = @[@[ @0, @2, @3, @1 ]];
self.digits[@":"] = @[@[ @1, @1, @1, @1 ], @[ @1, @3, @1, @1 ]];
[[NSFileManager defaultManager] removeItemAtPath:[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject stringByAppendingPathComponent:@"segments.txt"] error:nil]; //TODO remove
- self.orientation_changed = FALSE;
//TODO REMOVE THIS
NSFileManager *fileManager = [NSFileManager defaultManager];
@@ -104,7 +102,6 @@ NSMutableDictionary *classColorMap;
}
- (void)handleDeviceOrientationChange {
- self.orientation_changed = TRUE;
UIDeviceOrientation deviceOrientation = [[UIDevice currentDevice] orientation];
AVCaptureVideoOrientation videoOrientation;
switch (deviceOrientation) {
@@ -393,18 +390,7 @@ NSMutableDictionary *classColorMap;
@"duration": @(CMTimeGetSeconds(time)),
@"frames":[self.current_segment_squares copy]
}];
-
- if(self.orientation_changed){
- if(self.previewLayer.connection.videoOrientation == AVCaptureVideoOrientationLandscapeRight){
- segmentEntry[@"orientation"] = @"landscape_right";
- } else if(self.previewLayer.connection.videoOrientation == AVCaptureVideoOrientationLandscapeLeft){
- segmentEntry[@"orientation"] = @"landscape_left";
- } else { //todo upside down!
- segmentEntry[@"orientation"] = @"portait";
- }
- self.orientation_changed = FALSE;
- }
-
+
//timestamp of every segment now
calendar = [NSCalendar currentCalendar];
components = [calendar components:NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay fromDate:self.current_file_timestamp];
@@ -601,7 +587,6 @@ NSMutableDictionary *classColorMap;
return pixelBuffer;
}
-
- (CVPixelBufferRef)addTimeStampToPixelBuffer:(CVPixelBufferRef)pixelBuffer{
NSInteger pixelSize = 4;
NSInteger spaceSize = 2;