|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdanger.video.Recorder
public class Recorder
This class provides the api for capturing a 3GP video file. Use the factory method getInstance(danger.system.CameraDevice)
to create an instance of this class.
| Nested Class Summary | |
|---|---|
static interface |
Recorder.Errors
Status values returned in the data field of the Event handed to #start. |
| Field Summary | |
|---|---|
static int |
FILE_STATUS
Value passed in callback Event.what indicating the status of the recorded file in the filesystem |
static int |
RECORDING_FINISHED
Value passed in callback Event.what when recording phase is finished |
| Method Summary | |
|---|---|
void |
abortRecording()
Stop video capture and delete the file. |
int |
getAvailableFileRecordSeconds(MountPoint volume)
Return the available time in seconds that can be recorded to this volume given the current record parameters. |
int |
getAvailableFileRecordSeconds(MountPoint volume,
int format,
int frameRate)
Return the available time in seconds that can be recorded to this volume given these record parameters. |
CameraDevice |
getCameraDevice()
Return the CameraDevice associated with this Recorder object |
int |
getCurrentDuration()
Of the currently recording video, get the number of milliseconds captured so far. |
static Recorder |
getInstance(CameraDevice device)
return an instance of the Recorder class. |
int |
getMaxDuration()
Return the value set by the previous call to setMaxDuration. |
boolean |
isPreviewing()
Return true if recorder is currently previwing video. |
boolean |
isRecordingActive()
Return true if recorder is currently capturing video, even if capture is paused. |
boolean |
isRecordingPaused()
Return true betwen calls to pause and resume. |
void |
pauseRecording()
Pause video capture. |
void |
resumeRecording()
Resume video capture. |
void |
setCaptureView(VideoCaptureView captureView)
Register the component which will monitor the captured video. |
void |
setMaxDuration(int maxDuration)
Set the max duration in milliseconds that will be recorded. |
void |
startPreview()
Start previewing the video stream |
void |
startRecording(String filePath,
Event completedEvent)
Start video capture. |
void |
stopPreview()
Stop previewing the video stream |
void |
stopRecording()
Stop video capture and close the file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int RECORDING_FINISHED
public static final int FILE_STATUS
| Method Detail |
|---|
public static final Recorder getInstance(CameraDevice device)
throws VideoException
device - Camera device to attach to. Use null to specify the default device
unless you need to control the camera device power state yourself.
VideoException - if video recording is not implemented.public void startPreview()
public void stopPreview()
public void startRecording(String filePath,
Event completedEvent)
filePath - filename name including path (i.e. '/removable0/recorded.3gp').completedEvent - event that is sent once when initial recording (capture) completes, stops, or fails,
and again whenever the status of the captured file in the filesystem changes. The status
may change more than once, with a new event for each change.
IllegalArgumentException - if filePath is null.public void stopRecording()
public boolean isRecordingActive()
public boolean isPreviewing()
public void abortRecording()
public void pauseRecording()
public void resumeRecording()
public boolean isRecordingPaused()
public int getMaxDuration()
public void setMaxDuration(int maxDuration)
throws IllegalStateException
maxDuration - - max amount of record time in milliseconds
IllegalStateException - - if the Recorder is in recording modepublic int getCurrentDuration()
public int getAvailableFileRecordSeconds(MountPoint volume)
volume - - The MountPoint to be queried for free space.
IllegalArgumentException - if volumePath is null.
public int getAvailableFileRecordSeconds(MountPoint volume,
int format,
int frameRate)
volume - - The MountPoint to be queried for free space.format - - record encoding. Ignored for this release -- always H263 64Kb/sframeRate - - must be between 10 and 30.channels - - currently only 1 is supported.
IllegalArgumentException - if parameter values are invalid or volumePath is null.public CameraDevice getCameraDevice()
CameraDevice associated with this Recorder object
public void setCaptureView(VideoCaptureView captureView)
captureView - the VideoCaptureView to update when each new captured frame is available.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||