public class AbstractMediaPlayerModel extends java.lang.Object implements IMediaPlayerModel
AbstractMediaPlayerModel
- abstract IMediaPlayerModel
.IMediaPlayerModel.IListener, IMediaPlayerModel.ListenerAdapter, IMediaPlayerModel.Method
Constructor and Description |
---|
AbstractMediaPlayerModel()
Constructor.
|
AbstractMediaPlayerModel(java.lang.String source)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(IMediaPlayerModel.IListener listener)
Adds a new listener.
|
protected void |
copyVideoFrameCropOffset(int[] src,
int[] dst)
Copies
src video frame crop offset to dst |
protected void |
fireOnClose(java.lang.Object info)
Fires 'onClose' event.
|
protected void |
fireOnEvent(java.lang.String event,
java.lang.Object info)
Fires 'onEvent' event.
|
protected void |
fireOnOpen(java.lang.Object info)
Fires 'onOpen' event.
|
protected void |
fireOnOpenFailure(java.lang.Object info)
Fires 'onOpenFailure' event.
|
protected void |
fireOnTracks(boolean live,
MediaTrackInfo[] tracks,
MediaTrackInfo[] all)
Fires 'onTracks' event.
|
java.lang.String |
getSource()
Returns media source.
|
java.lang.Object |
invoke(java.lang.String method,
java.lang.Object... args)
Invokes
method with args arguments. |
AudioFrame |
nextAudioFrame()
Returns audio frame to be played.
|
VideoFrame |
nextVideoFrame(int[] offset)
Returns video frame to be played.
|
void |
release()
Release all the resources acquired by model.
|
void |
removeListener(IMediaPlayerModel.IListener listener)
Removes the listener.
|
void |
start()
Starts the model.
|
public AbstractMediaPlayerModel()
public AbstractMediaPlayerModel(java.lang.String source)
source
- public java.lang.String getSource()
IMediaPlayerModel
getSource
in interface IMediaPlayerModel
public void addListener(IMediaPlayerModel.IListener listener)
IMediaPlayerModel
addListener
in interface IMediaPlayerModel
public void removeListener(IMediaPlayerModel.IListener listener)
IMediaPlayerModel
removeListener
in interface IMediaPlayerModel
public java.lang.Object invoke(java.lang.String method, java.lang.Object... args) throws java.lang.Exception
IInvocable
method
with args
arguments.invoke
in interface IInvocable
method
- method nameargs
- argumentsjava.lang.Exception
- if an exception occurredpublic void start()
IMediaPlayerModel
Note:
- It can be connection to the remote source.
start
in interface IMediaPlayerModel
public AudioFrame nextAudioFrame()
IMediaPlayerModel
Note:
- Some implementations may block current thread
until audio frame is available, the end of the audio stream is detected, or an exception is thrown.
nextAudioFrame
in interface IMediaPlayerModel
null
if no more data availablepublic VideoFrame nextVideoFrame(int[] offset)
IMediaPlayerModel
Note:
- Some implementations may block current thread
until video frame is available, the end of the video stream is detected, or an exception is thrown.
nextVideoFrame
in interface IMediaPlayerModel
offset
- frame crop offset (0 - top, 1 - left, 2 - bottom, 3 - right),null
if no more video frames are availablepublic void release()
IMediaPlayerModel
release
in interface IMediaPlayerModel
protected void copyVideoFrameCropOffset(int[] src, int[] dst)
src
video frame crop offset to dst
src
- dst
- protected final void fireOnEvent(java.lang.String event, java.lang.Object info)
event
- event idinfo
- event infoprotected final void fireOnTracks(boolean live, MediaTrackInfo[] tracks, MediaTrackInfo[] all)
live
- 'live' stream flagtracks
- all
- protected final void fireOnOpen(java.lang.Object info)
info
- protected final void fireOnOpenFailure(java.lang.Object info)
info
- protected final void fireOnClose(java.lang.Object info)
info
-