android.media
public
class
android.media.MediaRecorder
Nested Classes
Summary
Public Constructors
Public Methods
Protected Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Public Constructors
Public Methods
public
String
getMimeContentType()
public
void
prepare()
Prepares the recorder to begin capturing and encoding data. This method
must be called after setting up the desired audio and video sources,
encoders, file format, etc., and before start().
public
void
release()
Releases resources associated with this MediaRecorder object.
It is good practice to call this method when you're done
using the MediaRecorder.
public
void
reset()
Restarts the MediaRecorder to its uninitialized state. After calling
this method, you will have to initialize it again as if it had just been
constructed.
public
void
setAudioEncoder(int audio_encoder)
Sets the audio encoder to be used for recording. If this method is not
called, the output file will not contain an audio track.
Parameters
| audio_encoder
| The audio encoder to use. |
public
void
setAudioSource(int audio_source)
Sets the audio source to be used for recording. If this method is not
called, the output file will not contain an audio track.
Parameters
| audio_source
| The audio source to use. |
public
void
setOutputFile(String path)
Sets the path of the output file to be produced.
Parameters
| path
| The pathname to use.
|
public
void
setOutputFormat(int output_format)
Sets the format of the output file produced during recording.
Parameters
| output_format
| The output format to use. |
public
void
setPreviewDisplay(Surface sv)
public
void
setVideoEncoder(int video_encoder)
Sets the video encoder to be used for recording. If this method is not
called, the output file will not contain an video track.
Parameters
| video_encoder
| The video encoder to use. |
public
void
setVideoFrameRate(int rate)
Sets the frame rate of the video to be captured. Must be called
after setVideoSource().
Parameters
| rate
| The number of frames per second of video to capture.
|
public
void
setVideoSize(int width, int height)
Sets the width and height of the video to be captured. Must be called
after setVideoSource().
Parameters
| width
| The width of the video to be captured. |
| height
| The height of the video to be captured.
|
public
void
setVideoSource(int video_source)
Sets the video source to be used for recording. If this method is not
called, the output file will not contain an video track.
Parameters
| video_source
| The video source to use. |
public
void
start()
Begins capturing and encoding data to the file specified with setOutputFile().
public
void
stop()
Stops recording.
Protected Methods
protected
void
finalize()
Called by the virtual machine when there are no longer any (non-weak)
references to the receiver. Subclasses can use this facility to guarantee
that any associated resources are cleaned up before the receiver is
garbage collected. Uncaught exceptions which are thrown during the
running of the method cause it to terminate immediately, but are
otherwise ignored.
Note: The virtual machine assumes that the implementation in class Object
is empty.