summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/rtsp/ARTSPConnection.h
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-10-20 15:00:34 -0700
committerAndreas Huber <andih@google.com>2010-10-20 15:01:01 -0700
commit4579b7d49f6dd4f37e6043e59debfd72d69b8e7b (patch)
tree4a3611bf36ef0ab70971df7a0c8314fb97d7d582 /media/libstagefright/rtsp/ARTSPConnection.h
parent6a9da9fc558263548ebfbae2cbf177eb7454a41b (diff)
downloadframeworks_av-4579b7d49f6dd4f37e6043e59debfd72d69b8e7b.zip
frameworks_av-4579b7d49f6dd4f37e6043e59debfd72d69b8e7b.tar.gz
frameworks_av-4579b7d49f6dd4f37e6043e59debfd72d69b8e7b.tar.bz2
Support for BASIC and DIGEST authentication schemes in RTSP. Support for malformed packet descriptions that end lines in LF only, instead of CRLF.
Change-Id: I57eaefdc4b300a8f56bbe5cf3a34c424e8efe63a related-to-bug: 3084183
Diffstat (limited to 'media/libstagefright/rtsp/ARTSPConnection.h')
-rw-r--r--media/libstagefright/rtsp/ARTSPConnection.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/media/libstagefright/rtsp/ARTSPConnection.h b/media/libstagefright/rtsp/ARTSPConnection.h
index 96e0d5b..19be2a6 100644
--- a/media/libstagefright/rtsp/ARTSPConnection.h
+++ b/media/libstagefright/rtsp/ARTSPConnection.h
@@ -42,6 +42,10 @@ struct ARTSPConnection : public AHandler {
void observeBinaryData(const sp<AMessage> &reply);
+ static bool ParseURL(
+ const char *url, AString *host, unsigned *port, AString *path,
+ AString *user, AString *pass);
+
protected:
virtual ~ARTSPConnection();
virtual void onMessageReceived(const sp<AMessage> &msg);
@@ -62,9 +66,18 @@ private:
kWhatObserveBinaryData = 'obin',
};
+ enum AuthType {
+ NONE,
+ BASIC,
+ DIGEST
+ };
+
static const int64_t kSelectTimeoutUs;
State mState;
+ AString mUser, mPass;
+ AuthType mAuthType;
+ AString mNonce;
int mSocket;
int32_t mConnectionID;
int32_t mNextCSeq;
@@ -90,8 +103,11 @@ private:
sp<ABuffer> receiveBinaryData();
bool notifyResponseListener(const sp<ARTSPResponse> &response);
- static bool ParseURL(
- const char *url, AString *host, unsigned *port, AString *path);
+ bool parseAuthMethod(const sp<ARTSPResponse> &response);
+ void addAuthentication(AString *request);
+
+ status_t findPendingRequest(
+ const sp<ARTSPResponse> &response, ssize_t *index) const;
static bool ParseSingleUnsignedLong(
const char *from, unsigned long *x);