diff --git a/README.md b/README.md
index 4a08e421..b5f7921d 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@
* Supported encoders includes H.264, H.263, AAC and AMR
* Since version 2.0, a basic support for RTCP has been implemented.
-* libstreaming also features a RTSP server for easy remote control of the phones camera and microphone.
+* libstreaming also features a RTSP server for easy remote control of the phone camera and microphone.
The full javadoc documentation of the API is available here: http://libstreaming.majorkernelpanic.net/
@@ -57,7 +57,7 @@ String sdp = session.getSessionDescription();
session.start();
```
-The **SessionBuilder** simply facilitates the creation of **Session** objects. The call to **setSurfaceHolder** is needed for video streaming, that should not come up as a surprise since Android requires a valid surface for recording video (It's an ennoying limitation of the **MediaRecorder**). The call to **setContext** is optional but recommanded, it allows **H264Stream** objects and **AACStream** objects to store and recover data in the **SharedPreferences** of your app. Check the implementation of those two classes to find out exactly what data are stored.
+The **SessionBuilder** simply facilitates the creation of **Session** objects. The call to **setSurfaceHolder** is needed for video streaming, that should not come up as a surprise since Android requires a valid surface for recording video (It's an ennoying limitation of the **MediaRecorder** API). The call to **setContext** is optional but recommanded, it allows **H264Stream** objects and **AACStream** objects to store and recover data in the **SharedPreferences** of your app. Check the implementation of those two classes to find out exactly what data are stored.
**Session** objects represents a streaming session to some peer. It contains one or more **Stream** objects that are started (resp. stopped) when the start() (resp. stop()) method is invoked. The method **setDestination** allows you to specify the ip address to which RTP and RTCP packets will be sent. The method **getSessionDescription** will return a SDP of the session in the form of a String.
diff --git a/doc/allclasses-frame.html b/doc/allclasses-frame.html
index 686ddf16..be734996 100644
--- a/doc/allclasses-frame.html
+++ b/doc/allclasses-frame.html
@@ -2,12 +2,12 @@
Prepare the VideoStream, you can then call MediaStream.start().
- The underlying Camera will be opened and configured whaen you call this method so don't forget to deal with the RuntimeExceptions !
+ The underlying Camera will be opened and configured when you call this method so don't forget to deal with the RuntimeExceptions !
Camera.open, Camera.setParameter, Camera.unlock may throw one !
diff --git a/doc/net/majorkernelpanic/streaming/video/package-frame.html b/doc/net/majorkernelpanic/streaming/video/package-frame.html
index 5af75b6c..b6ee3381 100644
--- a/doc/net/majorkernelpanic/streaming/video/package-frame.html
+++ b/doc/net/majorkernelpanic/streaming/video/package-frame.html
@@ -2,12 +2,12 @@
-
+
net.majorkernelpanic.streaming.video
-
+
diff --git a/doc/net/majorkernelpanic/streaming/video/package-summary.html b/doc/net/majorkernelpanic/streaming/video/package-summary.html
index 22be385b..d58e72b9 100644
--- a/doc/net/majorkernelpanic/streaming/video/package-summary.html
+++ b/doc/net/majorkernelpanic/streaming/video/package-summary.html
@@ -2,12 +2,12 @@
-
+
net.majorkernelpanic.streaming.video
-
+
diff --git a/doc/net/majorkernelpanic/streaming/video/package-tree.html b/doc/net/majorkernelpanic/streaming/video/package-tree.html
index b7814720..783897ac 100644
--- a/doc/net/majorkernelpanic/streaming/video/package-tree.html
+++ b/doc/net/majorkernelpanic/streaming/video/package-tree.html
@@ -2,12 +2,12 @@
-
+
net.majorkernelpanic.streaming.video Class Hierarchy
-
+
diff --git a/doc/overview-frame.html b/doc/overview-frame.html
index 7f2d281c..a0544f08 100644
--- a/doc/overview-frame.html
+++ b/doc/overview-frame.html
@@ -2,12 +2,12 @@
-
+
Overview List
-
+
diff --git a/doc/overview-summary.html b/doc/overview-summary.html
index cc24f507..6d223f5d 100644
--- a/doc/overview-summary.html
+++ b/doc/overview-summary.html
@@ -2,12 +2,12 @@
-
+
Overview
-
+
diff --git a/doc/overview-tree.html b/doc/overview-tree.html
index 1fa1f9f4..b40ad9c2 100644
--- a/doc/overview-tree.html
+++ b/doc/overview-tree.html
@@ -2,12 +2,12 @@
-
+
Class Hierarchy
-
+
diff --git a/doc/serialized-form.html b/doc/serialized-form.html
index eb7c47e2..37b69c9e 100644
--- a/doc/serialized-form.html
+++ b/doc/serialized-form.html
@@ -2,12 +2,12 @@
-
+
Serialized Form
-
+
diff --git a/src/net/majorkernelpanic/streaming/rtsp/RtspServer.java b/src/net/majorkernelpanic/streaming/rtsp/RtspServer.java
index 7a89aaae..ae06d436 100644
--- a/src/net/majorkernelpanic/streaming/rtsp/RtspServer.java
+++ b/src/net/majorkernelpanic/streaming/rtsp/RtspServer.java
@@ -36,7 +36,6 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import net.majorkernelpanic.http.TinyHttpServer;
import net.majorkernelpanic.streaming.Session;
import net.majorkernelpanic.streaming.SessionBuilder;
import android.app.Service;
@@ -260,6 +259,22 @@ protected void postError(Exception exception, int id) {
}
}
+ /**
+ * By default the RTSP uses {@link UriParser} to parse the URI requested by the client
+ * but you can change that behavior by override this method.
+ * @param uri The uri that the client has requested
+ * @param client The socket associated to the client
+ * @return A proper session
+ */
+ protected Session handleRequest(String uri, Socket client) throws IllegalStateException, IOException {
+ Session session = UriParser.parse(uri);
+ session.setOrigin(client.getLocalAddress());
+ if (session.getDestination()==null) {
+ session.setDestination(client.getInetAddress());
+ }
+ return session;
+ }
+
class RequestListener extends Thread implements Runnable {
private final ServerSocket mServer;
@@ -391,12 +406,9 @@ public Response processRequest(Request request) throws IllegalStateException, IO
if (request.method.equalsIgnoreCase("DESCRIBE")) {
// Parse the requested URI and configure the session
- mSession = UriParser.parse(request.uri);
+ mSession = handleRequest(request.uri, mClient);
mSessions.put(mSession, null);
- mSession.setOrigin(mClient.getLocalAddress());
- if (mSession.getDestination()==null) {
- mSession.setDestination(mClient.getInetAddress());
- }
+
String requestContent = mSession.getSessionDescription();
String requestAttributes =
"Content-Base: "+mClient.getLocalAddress().getHostAddress()+":"+mClient.getLocalPort()+"/\r\n" +
diff --git a/src/net/majorkernelpanic/streaming/video/VideoStream.java b/src/net/majorkernelpanic/streaming/video/VideoStream.java
index b49b2483..8baaf4ed 100644
--- a/src/net/majorkernelpanic/streaming/video/VideoStream.java
+++ b/src/net/majorkernelpanic/streaming/video/VideoStream.java
@@ -196,7 +196,7 @@ public synchronized void stop() {
/**
* Prepare the VideoStream, you can then call {@link #start()}.
- * The underlying Camera will be opened and configured whaen you call this method so don't forget to deal with the RuntimeExceptions !
+ * The underlying Camera will be opened and configured when you call this method so don't forget to deal with the RuntimeExceptions !
* Camera.open, Camera.setParameter, Camera.unlock may throw one !
*/
public void prepare() throws IllegalStateException, IOException {