Fever too big ah flashlight Do not drive too long Oh, be careful, first off you put twists, burning JJ peril
Flashlight:
Header file:
Source:
Turn on the camera:
- MMHandleType handler = 0, attr;
- MMCamPreset cp;
- cp.videodev_type = MM_VIDEO_DEVICE_CAMERA0; / / camera0 on behalf of the main camera
- int c = MMCamcorderCreate (& handler, & cp); / / Create a handler
- fprintf (stderr, "create [% d] \ n", c);
- / / Get the handler the strobe attributes enumeration, and assigned to the attr
- MMCamcorderGetAttrs (handler, MM_CAMCORDER_ATTR_STROBE, & attr);
- fprintf (stderr, "attr [% d] \ n", attr);
- int r = MMCamcorderRealize (handler); / / initialize handler
- fprintf (stderr, "Realize [% d] \ n", r);
- / / From attr obtain the strobe property control, and set FLASH_MOVIE_ON
- / / Set FLASH_OFF said Close, FLASH_ON and FLASH_AUTO are only flash, FLASH_MOVIE_ON long bright
- MMAttrsSetInt (attr, MM_CAMCORDER_STROBE_CONTROL, MM_CAMCORDER_FLASH_MOVIE_ON);
- / / Set a good strobe attribute set back to the handler
- MMCamcorderSetAttrs (handler, MM_CAMCORDER_ATTR_STROBE, attr);
- / / Start camera preview preview state handler
- int s = MMCamcorderStart (handler);
- fprintf (stderr, "start [% d] \ n", s);
- / / This is where the real start shooting, open to little reaction time, so if you just open the flash, do not need this step
- / / Int cs = MMCamcorderCaptureStart (handler);
- / / Fprintf (stderr, "CaptureStart [% d] \ n", cs);
- / / Close is turn you stop shooting
- / / Int css = MMCamcorderCaptureStop (handler);
- / / Fprintf (stderr, "CaptureStop [% d] \ n", css);
- / / Close the preview mode
- int ss = MMCamcorderStop (handler);
- fprintf (stderr, "Stop [% d] \ n", ss);
- / / Turn off the flash
- MMAttrsSetInt (attr, MM_CAMCORDER_STROBE_CONTROL, MM_CAMCORDER_FLASH_OFF);
- MMCamcorderSetAttrs (handler, MM_CAMCORDER_ATTR_STROBE, attr);
- / / Unrealize
- int ur = MMCamcorderUnrealize (handler);
- fprintf (stderr, "unrealize [% d] \ n", ur);
- / / Final destruction
- int d = MMCamcorderDestroy (handler);
- fprintf (stderr, "destroy [% d] \ n", d);
No comments:
Post a Comment