public class RtspServer
extends Service
Modifier and Type | Class and Description |
---|---|
static interface |
RtspServer.CallbackListener
Be careful: those callbacks won't necessarily be called from the ui thread !
|
class |
RtspServer.LocalBinder
The Binder you obtain when a connection with the Service is established.
|
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_RTSP_PORT
Port used by default.
|
static int |
ERROR_BIND_FAILED
Port already in use.
|
static int |
ERROR_START_FAILED
A stream could not be started.
|
static java.lang.String |
KEY_ENABLED
Key used in the SharedPreferences to store whether the RTSP server is enabled or not.
|
static java.lang.String |
KEY_PORT
Key used in the SharedPreferences for the port used by the RTSP server.
|
static int |
MESSAGE_STREAMING_STARTED
Streaming started.
|
static int |
MESSAGE_STREAMING_STOPPED
Streaming stopped.
|
static java.lang.String |
SERVER_NAME
The server name that will appear in responses.
|
static java.lang.String |
TAG |
Constructor and Description |
---|
RtspServer() |
Modifier and Type | Method and Description |
---|---|
void |
addCallbackListener(RtspServer.CallbackListener listener)
See
RtspServer.CallbackListener to check out what events will be fired once you set up a listener. |
long |
getBitrate()
Returns the bandwidth consumed by the RTSP server in bits per second.
|
int |
getPort()
Returns the port used by the RTSP server.
|
boolean |
isEnabled() |
boolean |
isStreaming()
Returns whether or not the RTSP server is streaming to some client(s).
|
IBinder |
onBind(Intent intent) |
void |
onCreate() |
void |
onDestroy() |
int |
onStartCommand(Intent intent,
int flags,
int startId) |
void |
removeCallbackListener(RtspServer.CallbackListener listener)
Removes the listener.
|
void |
setAuthorization(java.lang.String username,
java.lang.String password)
Set Basic authorization to access RTSP Stream
|
void |
setPort(int port)
Sets the port for the RTSP server to use.
|
void |
start()
Starts (or restart if needed, if for example the configuration
of the server has been modified) the RTSP server.
|
void |
stop()
Stops the RTSP server but not the Android Service.
|
public static final java.lang.String TAG
public static java.lang.String SERVER_NAME
public static final int DEFAULT_RTSP_PORT
public static final int ERROR_BIND_FAILED
public static final int ERROR_START_FAILED
public static final int MESSAGE_STREAMING_STARTED
public static final int MESSAGE_STREAMING_STOPPED
public static final java.lang.String KEY_ENABLED
public static final java.lang.String KEY_PORT
public void addCallbackListener(RtspServer.CallbackListener listener)
RtspServer.CallbackListener
to check out what events will be fired once you set up a listener.listener
- The listenerpublic void removeCallbackListener(RtspServer.CallbackListener listener)
listener
- The listenerpublic int getPort()
public void setPort(int port)
port
- The portpublic void setAuthorization(java.lang.String username, java.lang.String password)
username
- usernamepassword
- passwordpublic void start()
public void stop()
android.content.Context#stopService(Intent)
;public boolean isStreaming()
public boolean isEnabled()
public long getBitrate()
public int onStartCommand(Intent intent, int flags, int startId)
public void onCreate()
public void onDestroy()
public IBinder onBind(Intent intent)