Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Unified Diff: include/rtp.h

Issue 2344973002: Update libsrtp to version 2.0 (Closed)
Patch Set: Add '.' back to include_dirs Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/getopt_s.h ('k') | include/rtp_priv.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/rtp.h
diff --git a/srtp/include/rtp.h b/include/rtp.h
similarity index 83%
rename from srtp/include/rtp.h
rename to include/rtp.h
index 0e0119cf7bb191ed7d2b9e98dcdf946fd5d4fc3e..78feafbf3e3c77190e97b31b5f9a7459d5f9023e 100644
--- a/srtp/include/rtp.h
+++ b/include/rtp.h
@@ -60,8 +60,46 @@
# include <winsock2.h>
#endif
+//#include "srtp_priv.h"
#include "srtp.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * RTP_HEADER_LEN indicates the size of an RTP header
+ */
+#define RTP_HEADER_LEN 12
+
+/*
+ * RTP_MAX_BUF_LEN defines the largest RTP packet in the rtp.c implementation
+ */
+#define RTP_MAX_BUF_LEN 16384
+
+
+typedef srtp_hdr_t rtp_hdr_t;
+
+typedef struct {
+ srtp_hdr_t header;
+ char body[RTP_MAX_BUF_LEN];
+} rtp_msg_t;
+
+typedef struct rtp_sender_ctx_t {
+ rtp_msg_t message;
+ int socket;
+ srtp_ctx_t *srtp_ctx;
+ struct sockaddr_in addr; /* reciever's address */
+} rtp_sender_ctx_t;
+
+typedef struct rtp_receiver_ctx_t {
+ rtp_msg_t message;
+ int socket;
+ srtp_ctx_t *srtp_ctx;
+ struct sockaddr_in addr; /* receiver's address */
+} rtp_receiver_ctx_t;
+
+
typedef struct rtp_sender_ctx_t *rtp_sender_t;
typedef struct rtp_receiver_ctx_t *rtp_receiver_t;
@@ -87,14 +125,14 @@ rtp_sender_init(rtp_sender_t sender, int sock,
int
srtp_sender_init(rtp_sender_t rtp_ctx, /* structure to be init'ed */
struct sockaddr_in name, /* socket name */
- sec_serv_t security_services, /* sec. servs. to be used */
+ srtp_sec_serv_t security_services, /* sec. servs. to be used */
unsigned char *input_key /* master key/salt in hex */
);
int
srtp_receiver_init(rtp_receiver_t rtp_ctx, /* structure to be init'ed */
struct sockaddr_in name, /* socket name */
- sec_serv_t security_services, /* sec. servs. to be used */
+ srtp_sec_serv_t security_services, /* sec. servs. to be used */
unsigned char *input_key /* master key/salt in hex */
);
@@ -125,15 +163,8 @@ void
rtp_receiver_dealloc(rtp_receiver_t rtp_ctx);
-/*
- * RTP_HEADER_LEN indicates the size of an RTP header
- */
-#define RTP_HEADER_LEN 12
-
-/*
- * RTP_MAX_BUF_LEN defines the largest RTP packet in the rtp.c implementation
- */
-#define RTP_MAX_BUF_LEN 16384
-
+#ifdef __cplusplus
+}
+#endif
#endif /* RTP_H */
« no previous file with comments | « include/getopt_s.h ('k') | include/rtp_priv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698