public class Source extends Object
SystemCapability.Multimedia#MEDIA| 限定符和类型 | 类 | 说明 |
|---|---|---|
static class |
Source.AudioSource |
Describes the audio source.
|
static class |
Source.VideoSource |
Describes the video source, including the camera and surface.
|
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
AUDIO_SOURCE_INIT |
Indicates the default audio source.
|
static int |
VIDEO_SOURCE_INIT |
Indicates the default video source.
|
| 构造器 | 说明 |
|---|---|
Source() |
Default constructor used to create a
Source instance. |
Source(FileDescriptor fd) |
A constructor used to create a
Source instance based on a file descriptor. |
Source(FileDescriptor fd,
long offset,
long len) |
A constructor used to create a
Source instance based on a file descriptor, start offset, and source
data length. |
Source(String uri) |
A constructor used to create a
Source instance based on a specified URI. |
Source(String uri,
Map<String,String> header) |
A constructor used to create a
Source instance based on a specified URI and headers. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
int |
getFileType() |
Obtains the source type.
|
int |
getRecorderAudioSource() |
Obtains the audio source.
|
int |
getRecorderVideoSource() |
Obtains the video source.
|
String |
getUri() |
Obtains the the media source URI.
|
void |
setRecorderAudioSource(int recorderAudioSource) |
Sets an audio source, which is defined by
Recorder.AudioSource. |
void |
setRecorderVideoSource(int recorderVideoSource) |
Sets the video source, which is defined by
Recorder.AudioSource. |
public static final int AUDIO_SOURCE_INIT
public static final int VIDEO_SOURCE_INIT
public Source()
Source instance.public Source(String uri)
Source instance based on a specified URI.uri - Indicates the media source URI.public Source(String uri, Map<String,String> header)
Source instance based on a specified URI and headers.
This is usually used for creating a source through HTTP or HTTPS files.uri - Indicates the media source URI.header - Indicates data headers.public Source(FileDescriptor fd)
Source instance based on a file descriptor.
This is usually used for creating a source through local files.fd - Indicates the file descriptor.public Source(FileDescriptor fd, long offset, long len)
Source instance based on a file descriptor, start offset, and source
data length.fd - Indicates the file descriptor.offset - Indicates the start offset.len - Indicates the source data length.public int getFileType()
public int getRecorderAudioSource()
public void setRecorderAudioSource(int recorderAudioSource)
Recorder.AudioSource.recorderAudioSource - Indicates the audio source to set.public int getRecorderVideoSource()
public void setRecorderVideoSource(int recorderVideoSource)
Recorder.AudioSource.recorderVideoSource - Indicates the video source to set.public String getUri()