English | Site Directory

Android - An Open Handset Alliance Project

android.media
public class

android.media.MediaRecorder

java.lang.Object
android.media.MediaRecorder

Summary

Public Constructors

          MediaRecorder()

Public Methods

        String  getMimeContentType()
        void  prepare()
Prepares the recorder to begin capturing and encoding data.
        void  release()
Releases resources associated with this MediaRecorder object.
        void  reset()
Restarts the MediaRecorder to its uninitialized state.
        void  setAudioEncoder(int audio_encoder)
Sets the audio encoder to be used for recording.
        void  setAudioSource(int audio_source)
Sets the audio source to be used for recording.
        void  setOutputFile(String path)
Sets the path of the output file to be produced.
        void  setOutputFormat(int output_format)
Sets the format of the output file produced during recording.
        void  setPreviewDisplay(Surface sv)
        void  setVideoEncoder(int video_encoder)
Sets the video encoder to be used for recording.
        void  setVideoFrameRate(int rate)
Sets the frame rate of the video to be captured.
        void  setVideoSize(int width, int height)
Sets the width and height of the video to be captured.
        void  setVideoSource(int video_source)
Sets the video source to be used for recording.
        void  start()
Begins capturing and encoding data to the file specified with setOutputFile().
        void  stop()
Stops recording.

Protected Methods

        void  finalize()
Called by the virtual machine when there are no longer any (non-weak) references to the receiver.
Methods inherited from class java.lang.Object

Details

Public Constructors

public MediaRecorder()

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.

Build m5-rc15g - 14 May 2008 12:50