public final class NMediaReader
extends com.neurotec.lang.NObject
| Modifier and Type | Class and Description |
|---|---|
static class |
NMediaReader.ReadResult
Bean that contains NMediaReader results.
|
| Constructor and Description |
|---|
NMediaReader(NMediaSource source,
EnumSet<NMediaType> mediaTypes,
boolean isLive)
Creates new instance of NMediaReader.
|
NMediaReader(NMediaSource source,
EnumSet<NMediaType> mediaTypes,
boolean isLive,
int flags)
Creates new instance of NMediaReader.
|
NMediaReader(String fileName,
EnumSet<NMediaType> mediaTypes,
boolean isLive)
Creates new instance of NMediaReader from specified file.
|
NMediaReader(String fileNameOrUrl,
EnumSet<NMediaType> mediaTypes,
boolean isLive,
boolean isUrl)
Creates new instance of NMediaReader from specified file or Url.
|
NMediaReader(String fileNameOrUrl,
EnumSet<NMediaType> mediaTypes,
boolean isLive,
boolean isUrl,
int flags)
Creates new instance of NMediaReader from specified file or Url.
|
NMediaReader(String fileName,
EnumSet<NMediaType> mediaTypes,
boolean isLive,
int flags)
Creates new instance of NMediaReader from specified file.
|
NMediaReader(URI url,
EnumSet<NMediaType> mediaTypes,
boolean isLive)
Creates new instance of NMediaReader from specified Url.
|
NMediaReader(URI url,
EnumSet<NMediaType> mediaTypes,
boolean isLive,
int flags)
Creates new instance of NMediaReader from specified Url.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getLength()
Gets file length when NMediaReader source is file.
|
long |
getPosition()
Gets NMediaReader position in media source (file).
|
NMediaSource |
getSource()
Gets media source (file or device) of the NMediaReader.
|
NMediaState |
getState()
Gets NMediaReader state.
|
boolean |
isLive()
Checks if media source which is used by NMediaReader is live.
|
static com.neurotec.lang.NType |
nativeTypeOf()
Retrieves the native type for the enclosing class.
|
void |
pause()
Pauses specified NMediaReader.
|
NMediaReader.ReadResult |
readAudioSample()
Reads audio sample to NSoundBuffer.
|
NMediaReader.ReadResult |
readVideoSample()
Reads video sample using NMediaReader.
|
void |
setPosition(long value)
Sets NMediaReader position in media source (file).
|
void |
start()
Starts NMediaReader.
|
void |
stop()
Stops NMediaReader.
|
addListener, addPropertyChangeListener, captureProperties, claimHandle, clone, compareTo, copyProperties, dispose, disposeArray, equals, fromHandle, fromHandle, fromObject, getFlags, getHandle, getNativeType, getOwner, getProperty, getProperty, getSize, getSize, getSizeMany, getSizeMany, hashCode, invoke, invoke, invoke, isDisposed, nObjectCallbackNativeTypeOf, nObjectPropertyChangedCallbackNativeTypeOf, ref, removeListener, removePropertyChangeListener, reset, resetProperty, save, save, save, save, save, save, save, save, save, save, save, save, saveMany, saveMany, saveMany, saveMany, saveMany, saveMany, saveMany, saveMany, saveMany, saveMany, saveMany, saveMany, setFlags, setProperty, setProperty, toHandle, toObject, toString, toString, unref, unrefArray, unrefElementspublic NMediaReader(NMediaSource source, EnumSet<NMediaType> mediaTypes, boolean isLive, int flags)
source - Media source from which NMediaReader will be created.mediaTypes - Media types supported by NMediaReader.
Can be Audio and Video (only one at a time or both).isLive - Flag indicating if media source is live.
If set to true media from source will be read in real time
(from devices). In this case video or audio samples will be
dropped until user calls ReadAudioSample or ReadVideoSample
functions. If user calls these functions too quickly
they are blocked until new video frame or audio sample appears.
If set to false video frames or audio samples are not dropped
and user can read them in any speed (gets all samples/frames).
When set to false, NMediaReader works only with video/audio data saved in files.flags - Flags controlling NMediaReader.
These flags can be used (for flags parameter):
* FlagDoNotUseDirectShow
* FlagDoNotUseWindowsMediaFoundation
* FlagPreferDirectShow
These flags work only on Windows OS.public NMediaReader(String fileName, EnumSet<NMediaType> mediaTypes, boolean isLive, int flags) throws IOException
fileName - File name. The specified file should contain media source.mediaTypes - Media types supported by NMediaReader.
Can be Audio and Video (only one at a time or both).isLive - Flag indicating if media source is live.
If set to true media from source will be read in real time
(from devices). In this case video or audio samples will be
dropped until user calls ReadAudioSample or ReadVideoSample
functions. If user calls these functions too quickly
they are blocked until new video frame or audio sample appears.
If set to false video frames or audio samples are not dropped
and user can read them in any speed (gets all samples/frames).
When set to false, NMediaReader works only with video/audio data saved in files.flags - Flags controlling NMediaReader.
These flags can be used (for flags parameter):
* FlagDoNotUseDirectShow
* FlagDoNotUseWindowsMediaFoundation
* FlagPreferDirectShow
These flags work only on Windows OS.IOExceptionpublic NMediaReader(URI url, EnumSet<NMediaType> mediaTypes, boolean isLive, int flags) throws IOException
url - Uniform resource identifier (URI) which contains
URL address (address of IP camera).mediaTypes - Media types supported by NMediaReader.
Can be Audio and Video (only one at a time or both).isLive - Flag indicating if media source is live.
If set to true media from source will be read in real time
(from devices). In this case video or audio samples will be
dropped until user calls ReadAudioSample or ReadVideoSample
functions. If user calls these functions too quickly
they are blocked until new video frame or audio sample appears.
If set to false video frames or audio samples are not dropped
and user can read them in any speed (gets all samples/frames).
When set to false, NMediaReader works only with video/audio data saved in files.flags - Flags controlling NMediaReader.
These flags can be used (for flags parameter):
* FlagDoNotUseDirectShow
* FlagDoNotUseWindowsMediaFoundation
* FlagPreferDirectShow
These flags work only on Windows OS.IOExceptionpublic NMediaReader(String fileNameOrUrl, EnumSet<NMediaType> mediaTypes, boolean isLive, boolean isUrl, int flags) throws IOException
fileNameOrUrl - String representation of file name or URL.
The specified file should contain media source.mediaTypes - Media types supported by NMediaReader.
Can be Audio and Video (only one at a time or both).isLive - Flag indicating if media source is live.
If set to true media from source will be read in real time
(from devices). In this case video or audio samples will be
dropped until user calls ReadAudioSample or ReadVideoSample
functions. If user calls these functions too quickly
they are blocked until new video frame or audio sample appears.
If set to false video frames or audio samples are not dropped
and user can read them in any speed (gets all samples/frames).
When set to false, NMediaReader works only with video/audio data saved in files.isUrl - Flag indicating if media source is from Url (IP camera).flags - Flags controlling NMediaReader.
These flags can be used (for flags parameter):
* FlagDoNotUseDirectShow
* FlagDoNotUseWindowsMediaFoundation
* FlagPreferDirectShow
These flags work only on Windows OS.IOExceptionpublic NMediaReader(NMediaSource source, EnumSet<NMediaType> mediaTypes, boolean isLive)
source - Media source from which NMediaReader will be created.mediaTypes - Media types supported by NMediaReader.
Can be Audio and Video (only one at a time or both).isLive - Flag indicating if media source is live.
If set to true media from source will be read in real time
(from devices). In this case video or audio samples will be
dropped until user calls ReadAudioSample or ReadVideoSample
functions. If user calls these functions too quickly
they are blocked until new video frame or audio sample appears.
If set to false video frames or audio samples are not dropped
and user can read them in any speed (gets all samples/frames).
When set to false, NMediaReader works only with video/audio data saved in files.public NMediaReader(String fileName, EnumSet<NMediaType> mediaTypes, boolean isLive) throws IOException
fileName - File name. The specified file should contain media source.mediaTypes - Media types supported by NMediaReader.
Can be Audio and Video (only one at a time or both).isLive - Flag indicating if media source is live.
If set to true media from source will be read in real time
(from devices). In this case video or audio samples will be
dropped until user calls ReadAudioSample or ReadVideoSample
functions. If user calls these functions too quickly
they are blocked until new video frame or audio sample appears.
If set to false video frames or audio samples are not dropped
and user can read them in any speed (gets all samples/frames).
When set to false, NMediaReader works only with video/audio data saved in files.IOExceptionpublic NMediaReader(URI url, EnumSet<NMediaType> mediaTypes, boolean isLive) throws IOException
url - Uniform resource identifier (URI) which contains
URL address (address of IP camera).mediaTypes - Media types supported by NMediaReader.
Can be Audio and Video (only one at a time or both).isLive - Flag indicating if media source is live.
If set to true media from source will be read in real time
(from devices). In this case video or audio samples will be
dropped until user calls ReadAudioSample or ReadVideoSample
functions. If user calls these functions too quickly
they are blocked until new video frame or audio sample appears.
If set to false video frames or audio samples are not dropped
and user can read them in any speed (gets all samples/frames).
When set to false, NMediaReader works only with video/audio data saved in files.IOExceptionpublic NMediaReader(String fileNameOrUrl, EnumSet<NMediaType> mediaTypes, boolean isLive, boolean isUrl) throws IOException
fileNameOrUrl - String representation of file name or URL.
The specified file should contain media source.mediaTypes - Media types supported by NMediaReader.
Can be Audio and Video (only one at a time or both).isLive - Flag indicating if media source is live.
If set to true media from source will be read in real time
(from devices). In this case video or audio samples will be
dropped until user calls ReadAudioSample or ReadVideoSample
functions. If user calls these functions too quickly
they are blocked until new video frame or audio sample appears.
If set to false video frames or audio samples are not dropped
and user can read them in any speed (gets all samples/frames).
When set to false, NMediaReader works only with video/audio data saved in files.isUrl - Flag indicating if media source is from Url (IP camera).IOExceptionpublic static com.neurotec.lang.NType nativeTypeOf()
public void start()
public void stop()
public void pause()
public NMediaReader.ReadResult readAudioSample()
public NMediaReader.ReadResult readVideoSample()
public NMediaSource getSource()
public boolean isLive()
public NMediaState getState()
public long getLength()
public long getPosition()
public void setPosition(long value)
value - Time interval (TimeSpan) representing NMediaReader position in media source.Copyright © 2016 Neurotechnology. All rights reserved.