Coder Social home page Coder Social logo

jorgehatccrma / cam Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thisandagain/cam

0.0 1.0 0.0 190 KB

A “keep it simple, stupid” approach to handling photo and video capture with AVFoundation.

License: Other

Ruby 1.39% Objective-C 96.76% C 1.85%

cam's Introduction

Cam

A "keep it simple, stupid" approach to working with AVFoundation

DIYCam is a high-level layer built on top of AVFoundation that enables simple setup and implementation of photo and video capture within iOS.

Getting Started

The easiest way to get going with DIYCam is to take a look at the included example application. The XCode project file can be found at Example > cam.xcodeproj.

In order to use DIYCam, you'll want to add the entirety of the DIYCam directory to your project. To get started, simply:

#import "DIYCam.h"
DIYCam *cam         = [[DIYCam alloc] initWithFrame:self.view.frame];
cam.delegate        = self;
cam.captureMode     = DIYCamModePhoto;
[self.view addSubview:cam];

You'll also need to link the following frameworks:

AssetsLibrary.framework
AVFoundation.framework
CoreGraphics.framework
CoreMedia.framework
MobileCoreServices.framework
QuartzCore.framework

Configuration

Default configuration settings can be modified within DIYCamDefaults.h where options for asset library use, orientation, device settings, and quality can be modified.


Methods

- (void)capturePhoto;
- (void)captureVideoStart;
- (void)captureVideoStop;

Delegate Methods

- (void)camReady:(DIYCam *)cam;
- (void)camDidFail:(DIYCam *)cam withError:(NSError *)error;

- (void)camModeWillChange:(DIYCam *)cam mode:(DIYCamMode)mode;
- (void)camModeDidChange:(DIYCam *)cam mode:(DIYCamMode)mode;

- (void)camCaptureStarted:(DIYCam *)cam;
- (void)camCaptureStopped:(DIYCam *)cam;
- (void)camCaptureProcessing:(DIYCam *)cam;
- (void)camCaptureComplete:(DIYCam *)cam withAsset:(NSDictionary *)asset;

Properties

@property (nonatomic, assign) id<DIYCamDelegate> delegate;
@property (nonatomic, assign) DIYCamMode captureMode;
@property (nonatomic, retain) AVCaptureSession *session;
@property (nonatomic, assign, readonly) BOOL isRecording;

iOS Support

DIYCam is tested on iOS 5 and up. Older versions of iOS may work but are not currently supported.

ARC

If you are including DIYCam in a project that uses Automatic Reference Counting (ARC), you will need to set the -fno-objc-arc compiler flag on all of the DIYCam source files. To do this in Xcode, go to your active target and select the "Build Phases" tab. Now select all DIYCam source files, press Enter, insert -fno-objc-arc and then "Done" to disable ARC for DIYCam.

cam's People

Contributors

dongle avatar jorgehatccrma avatar thisandagain avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.