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

Unified Diff: content/renderer/media/media_stream_center.cc

Issue 9699069: Adding JSEP PeerConnection glue. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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
Index: content/renderer/media/media_stream_center.cc
diff --git a/content/renderer/media/media_stream_center.cc b/content/renderer/media/media_stream_center.cc
index 172a1512003992bc6090756e05c3415d65d452f3..0792bd58580c21cee2c542d7514ea2cf99a2337d 100644
--- a/content/renderer/media/media_stream_center.cc
+++ b/content/renderer/media/media_stream_center.cc
@@ -4,10 +4,17 @@
#include "content/renderer/media/media_stream_center.h"
+#include <string>
+
+#include "base/logging.h"
+#include "base/utf_string_conversions.h"
+#include "third_party/libjingle/source/talk/app/webrtc/jsep.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebIceCandidate.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStreamCenterClient.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStreamDescriptor.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStreamSource.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStreamSourcesRequest.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSessionDescription.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h"
namespace content {
@@ -41,4 +48,36 @@ void MediaStreamCenter::didConstructMediaStream(
const WebKit::WebMediaStreamDescriptor& stream) {
}
+WebKit::WebString MediaStreamCenter::constructSdp(
+ const WebKit::WebIceCandidate& candidate) {
+ webrtc::IceCandidateInterface* native_candidate =
+ webrtc::CreateIceCandidate(UTF16ToUTF8(candidate.label()),
+ UTF16ToUTF8(candidate.candidateLine()));
+ std::string sdp;
+ if (!native_candidate->ToString(&sdp))
tommi (sloooow) - chröme 2012/03/15 12:31:52 is this the same as oom? If so, then maybe just CH
Henrik Grunell 2012/03/23 12:50:45 This could be some other error according to libjin
+ LOG(ERROR) << "Could not create SDP string";
+ return UTF8ToUTF16(sdp);
+}
+
+WebKit::WebString MediaStreamCenter::constructSdp(
+ const WebKit::WebSessionDescription& description) {
+ webrtc::SessionDescriptionInterface* native_desc =
+ webrtc::CreateSessionDescription(UTF16ToUTF8(description.initialSdp()));
+ if (!native_desc)
+ return "";
+
+ for (size_t i = 0; i < description.numberOfAddedCandidates(); ++i) {
+ WebKit::WebIceCandidate candidate = description.candidate(i);
+ webrtc::IceCandidateInterface* native_candidate =
+ webrtc::CreateIceCandidate(UTF16ToUTF8(candidate.label()),
+ UTF16ToUTF8(candidate.candidateLine()));
+ native_desc->AddCandidate(native_candidate);
+ }
+
+ std::string sdp;
+ if (!native_desc->ToString(&sdp))
+ LOG(ERROR) << "Could not create SDP string";
+ return UTF8ToUTF16(sdp);
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698