Changeset 110735 in webkit
- Timestamp:
- Mar 14, 2012 12:53:23 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 added
- 5 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r110732 r110735 1 2012-03-14 Tommy Widenflycht <tommyw@google.com> 2 3 MediaStream API (JSEP): Introducing IceCandidate 4 https://bugs.webkit.org/show_bug.cgi?id=80699 5 6 Reviewed by Adam Barth. 7 8 Patch #2 in a series of patches to change the PeerConnection from ROAP to JSEP, 9 see bug 80589 for more information. 10 Adding the JS object IceCandidate and its WebCore/platform sibling IceCandidateDescriptor. 11 This object will be created both from JS and the embedder. 12 13 Not possible to test until the entire JSEP feature is commited. 14 15 * GNUmakefile.list.am: 16 * Modules/mediastream/IceCandidate.cpp: Copied from Source/WebCore/platform/mediastream/MediaStreamCenter.cpp. 17 (WebCore): 18 (WebCore::IceCandidate::create): 19 (WebCore::IceCandidate::IceCandidate): 20 (WebCore::IceCandidate::~IceCandidate): 21 (WebCore::IceCandidate::label): 22 (WebCore::IceCandidate::candidateLine): 23 (WebCore::IceCandidate::toSdp): 24 (WebCore::IceCandidate::descriptor): 25 * Modules/mediastream/IceCandidate.h: Copied from Source/WebCore/platform/mediastream/MediaStreamCenter.cpp. 26 (WebCore): 27 (IceCandidate): 28 * Modules/mediastream/IceCandidate.idl: Added. 29 * WebCore.gypi: 30 * platform/mediastream/IceCandidateDescriptor.cpp: Copied from Source/WebCore/platform/mediastream/MediaStreamCenter.cpp. 31 (WebCore): 32 (WebCore::IceCandidateDescriptor::create): 33 (WebCore::IceCandidateDescriptor::IceCandidateDescriptor): 34 (WebCore::IceCandidateDescriptor::~IceCandidateDescriptor): 35 (WebCore::IceCandidateDescriptor::toSdp): 36 * platform/mediastream/IceCandidateDescriptor.h: Copied from Source/WebCore/platform/mediastream/MediaStreamCenter.cpp. 37 (WebCore): 38 (IceCandidateDescriptor): 39 (WebCore::IceCandidateDescriptor::label): 40 (WebCore::IceCandidateDescriptor::candidateLine): 41 * platform/mediastream/MediaStreamCenter.cpp: 42 (WebCore::MediaStreamCenter::constructSdp): 43 (WebCore): 44 * platform/mediastream/MediaStreamCenter.h: 45 (WebCore): 46 (MediaStreamCenter): 47 1 48 2012-03-14 Simon Fraser <simon.fraser@apple.com> 2 49 -
trunk/Source/WebCore/GNUmakefile.list.am
r110669 r110735 345 345 DerivedSources/WebCore/JSHTMLVideoElement.cpp \ 346 346 DerivedSources/WebCore/JSHTMLVideoElement.h \ 347 DerivedSources/WebCore/JSIceCandidate.cpp \ 348 DerivedSources/WebCore/JSIceCandidate.h \ 347 349 DerivedSources/WebCore/JSImageData.cpp \ 348 350 DerivedSources/WebCore/JSImageData.h \ … … 661 663 $(WebCore)/Modules/mediastream/DeprecatedPeerConnection.idl \ 662 664 $(WebCore)/Modules/mediastream/DOMWindowMediaStream.idl \ 665 $(WebCore)/Modules/mediastream/IceCandidate.idl \ 663 666 $(WebCore)/Modules/mediastream/LocalMediaStream.idl \ 664 667 $(WebCore)/Modules/mediastream/MediaStream.idl \ … … 1034 1037 Source/WebCore/Modules/mediastream/DeprecatedPeerConnection.cpp \ 1035 1038 Source/WebCore/Modules/mediastream/DeprecatedPeerConnection.h \ 1039 Source/WebCore/Modules/mediastream/IceCandidate.cpp \ 1040 Source/WebCore/Modules/mediastream/IceCandidate.h \ 1036 1041 Source/WebCore/Modules/mediastream/LocalMediaStream.cpp \ 1037 1042 Source/WebCore/Modules/mediastream/LocalMediaStream.h \ … … 3323 3328 Source/WebCore/platform/mediastream/DeprecatedPeerConnectionHandler.h \ 3324 3329 Source/WebCore/platform/mediastream/DeprecatedPeerConnectionHandlerClient.h \ 3330 Source/WebCore/platform/mediastream/IceCandidateDescriptor.cpp \ 3331 Source/WebCore/platform/mediastream/IceCandidateDescriptor.h \ 3325 3332 Source/WebCore/platform/mediastream/MediaStreamCenter.cpp \ 3326 3333 Source/WebCore/platform/mediastream/MediaStreamCenter.h \ -
trunk/Source/WebCore/Modules/mediastream/IceCandidate.cpp
r110733 r110735 1 1 /* 2 * Copyright (C) 201 1 Ericsson AB. All rights reserved.2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 12 12 * in the documentation and/or other materials provided with the 13 13 * distribution. 14 * 3. Neither the name of Ericssonnor the names of its contributors14 * 3. Neither the name of Google Inc. nor the names of its contributors 15 15 * may be used to endorse or promote products derived from this 16 16 * software without specific prior written permission. … … 33 33 #if ENABLE(MEDIA_STREAM) 34 34 35 #include " MediaStreamCenter.h"35 #include "IceCandidate.h" 36 36 37 #include "MainThread.h" 38 #include "MediaStreamDescriptor.h" 37 #include "IceCandidateDescriptor.h" 39 38 40 39 namespace WebCore { 41 40 42 MediaStreamCenter& MediaStreamCenter::instance()41 PassRefPtr<IceCandidate> IceCandidate::create(const String& label, const String& candidateLine) 43 42 { 44 ASSERT(isMainThread()); 45 DEFINE_STATIC_LOCAL(MediaStreamCenter, center, ()); 46 return center; 43 return adoptRef(new IceCandidate(IceCandidateDescriptor::create(label, candidateLine))); 47 44 } 48 45 49 void MediaStreamCenter::endLocalMediaStream(MediaStreamDescriptor* streamDescriptor)46 PassRefPtr<IceCandidate> IceCandidate::create(PassRefPtr<IceCandidateDescriptor> descriptor) 50 47 { 51 MediaStreamDescriptorOwner* owner = streamDescriptor->owner(); 52 if (owner) 53 owner->streamEnded(); 54 else 55 streamDescriptor->setEnded(); 48 return adoptRef(new IceCandidate(descriptor)); 56 49 } 57 50 58 #if !PLATFORM(CHROMIUM) 59 60 // Empty implementations for ports that build with MEDIA_STREAM enabled by default, but haven't yet implemented MediaStreamCenter. 61 62 MediaStreamCenter::MediaStreamCenter() 51 IceCandidate::IceCandidate(PassRefPtr<IceCandidateDescriptor> descriptor) 52 : m_descriptor(descriptor) 63 53 { 64 54 } 65 55 66 MediaStreamCenter::~MediaStreamCenter()56 IceCandidate::~IceCandidate() 67 57 { 68 58 } 69 59 70 void MediaStreamCenter::queryMediaStreamSources(PassRefPtr<MediaStreamSourcesQueryClient> client)60 const String& IceCandidate::label() 71 61 { 72 MediaStreamSourceVector audioSources, videoSources; 73 client->didCompleteQuery(audioSources, videoSources); 62 return m_descriptor->label(); 74 63 } 75 64 76 void MediaStreamCenter::didSetMediaStreamTrackEnabled(MediaStreamDescriptor*, MediaStreamComponent*)65 const String& IceCandidate::candidateLine() 77 66 { 67 return m_descriptor->candidateLine(); 78 68 } 79 69 80 void MediaStreamCenter::didStopLocalMediaStream(MediaStreamDescriptor*)70 String IceCandidate::toSdp() 81 71 { 72 return m_descriptor->toSdp(); 82 73 } 83 74 84 void MediaStreamCenter::didConstructMediaStream(MediaStreamDescriptor*)75 IceCandidateDescriptor* IceCandidate::descriptor() 85 76 { 77 return m_descriptor.get(); 86 78 } 87 88 #endif // !PLATFORM(CHROMIUM)89 79 90 80 } // namespace WebCore -
trunk/Source/WebCore/Modules/mediastream/IceCandidate.h
r110733 r110735 1 1 /* 2 * Copyright (C) 201 1 Ericsson AB. All rights reserved.2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 12 12 * in the documentation and/or other materials provided with the 13 13 * distribution. 14 * 3. Neither the name of Ericssonnor the names of its contributors14 * 3. Neither the name of Google Inc. nor the names of its contributors 15 15 * may be used to endorse or promote products derived from this 16 16 * software without specific prior written permission. … … 29 29 */ 30 30 31 #include "config.h" 31 #ifndef IceCandidate_h 32 #define IceCandidate_h 32 33 33 34 #if ENABLE(MEDIA_STREAM) 34 35 35 #include "MediaStreamCenter.h"36 37 #include "MainThread.h"38 #include "MediaStreamDescriptor.h"36 #include <wtf/PassRefPtr.h> 37 #include <wtf/RefCounted.h> 38 #include <wtf/RefPtr.h> 39 #include <wtf/text/WTFString.h> 39 40 40 41 namespace WebCore { 41 42 42 MediaStreamCenter& MediaStreamCenter::instance() 43 { 44 ASSERT(isMainThread()); 45 DEFINE_STATIC_LOCAL(MediaStreamCenter, center, ()); 46 return center; 47 } 43 class IceCandidateDescriptor; 48 44 49 void MediaStreamCenter::endLocalMediaStream(MediaStreamDescriptor* streamDescriptor) 50 { 51 MediaStreamDescriptorOwner* owner = streamDescriptor->owner(); 52 if (owner) 53 owner->streamEnded(); 54 else 55 streamDescriptor->setEnded(); 56 } 45 class IceCandidate : public RefCounted<IceCandidate> { 46 public: 47 static PassRefPtr<IceCandidate> create(const String& label, const String& candidateLine); 48 static PassRefPtr<IceCandidate> create(PassRefPtr<IceCandidateDescriptor>); 49 virtual ~IceCandidate(); 57 50 58 #if !PLATFORM(CHROMIUM) 51 const String& label(); 52 const String& candidateLine(); 59 53 60 // Empty implementations for ports that build with MEDIA_STREAM enabled by default, but haven't yet implemented MediaStreamCenter. 54 String toSdp(); 61 55 62 MediaStreamCenter::MediaStreamCenter() 63 { 64 } 56 IceCandidateDescriptor* descriptor(); 65 57 66 MediaStreamCenter::~MediaStreamCenter() 67 { 68 } 58 private: 59 IceCandidate(PassRefPtr<IceCandidateDescriptor>); 69 60 70 void MediaStreamCenter::queryMediaStreamSources(PassRefPtr<MediaStreamSourcesQueryClient> client) 71 { 72 MediaStreamSourceVector audioSources, videoSources; 73 client->didCompleteQuery(audioSources, videoSources); 74 } 75 76 void MediaStreamCenter::didSetMediaStreamTrackEnabled(MediaStreamDescriptor*, MediaStreamComponent*) 77 { 78 } 79 80 void MediaStreamCenter::didStopLocalMediaStream(MediaStreamDescriptor*) 81 { 82 } 83 84 void MediaStreamCenter::didConstructMediaStream(MediaStreamDescriptor*) 85 { 86 } 87 88 #endif // !PLATFORM(CHROMIUM) 61 RefPtr<IceCandidateDescriptor> m_descriptor; 62 }; 89 63 90 64 } // namespace WebCore 91 65 92 66 #endif // ENABLE(MEDIA_STREAM) 67 68 #endif // IceCandidate_h -
trunk/Source/WebCore/WebCore.gypi
r110641 r110735 420 420 'platform/mediastream/DeprecatedPeerConnectionHandler.h', 421 421 'platform/mediastream/DeprecatedPeerConnectionHandlerClient.h', 422 'platform/mediastream/IceCandidateDescriptor.cpp', 423 'platform/mediastream/IceCandidateDescriptor.h', 422 424 'platform/mediastream/MediaStreamCenter.cpp', 423 425 'platform/mediastream/MediaStreamCenter.h', … … 754 756 'Modules/mediastream/DeprecatedPeerConnection.idl', 755 757 'Modules/mediastream/DOMWindowMediaStream.idl', 758 'Modules/mediastream/IceCandidate.idl', 756 759 'Modules/mediastream/LocalMediaStream.idl', 757 760 'Modules/mediastream/MediaStream.idl', … … 1387 1390 'Modules/mediastream/DeprecatedPeerConnection.cpp', 1388 1391 'Modules/mediastream/DeprecatedPeerConnection.h', 1392 'Modules/mediastream/IceCandidate.cpp', 1393 'Modules/mediastream/IceCandidate.h', 1389 1394 'Modules/mediastream/LocalMediaStream.cpp', 1390 1395 'Modules/mediastream/LocalMediaStream.h', -
trunk/Source/WebCore/platform/mediastream/IceCandidateDescriptor.cpp
r110733 r110735 1 1 /* 2 * Copyright (C) 201 1 Ericsson AB. All rights reserved.2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 12 12 * in the documentation and/or other materials provided with the 13 13 * distribution. 14 * 3. Neither the name of Ericssonnor the names of its contributors14 * 3. Neither the name of Google Inc. nor the names of its contributors 15 15 * may be used to endorse or promote products derived from this 16 16 * software without specific prior written permission. … … 33 33 #if ENABLE(MEDIA_STREAM) 34 34 35 #include "IceCandidateDescriptor.h" 36 35 37 #include "MediaStreamCenter.h" 36 37 #include "MainThread.h"38 #include "MediaStreamDescriptor.h"39 38 40 39 namespace WebCore { 41 40 42 MediaStreamCenter& MediaStreamCenter::instance()41 PassRefPtr<IceCandidateDescriptor> IceCandidateDescriptor::create(const String& label, const String& candidateLine) 43 42 { 44 ASSERT(isMainThread()); 45 DEFINE_STATIC_LOCAL(MediaStreamCenter, center, ()); 46 return center; 43 return adoptRef(new IceCandidateDescriptor(label, candidateLine)); 47 44 } 48 45 49 void MediaStreamCenter::endLocalMediaStream(MediaStreamDescriptor* streamDescriptor) 50 { 51 MediaStreamDescriptorOwner* owner = streamDescriptor->owner(); 52 if (owner) 53 owner->streamEnded(); 54 else 55 streamDescriptor->setEnded(); 56 } 57 58 #if !PLATFORM(CHROMIUM) 59 60 // Empty implementations for ports that build with MEDIA_STREAM enabled by default, but haven't yet implemented MediaStreamCenter. 61 62 MediaStreamCenter::MediaStreamCenter() 46 IceCandidateDescriptor::IceCandidateDescriptor(const String& label, const String& candidateLine) 47 : m_label(label) 48 , m_candidateLine(candidateLine) 63 49 { 64 50 } 65 51 66 MediaStreamCenter::~MediaStreamCenter()52 IceCandidateDescriptor::~IceCandidateDescriptor() 67 53 { 68 54 } 69 55 70 void MediaStreamCenter::queryMediaStreamSources(PassRefPtr<MediaStreamSourcesQueryClient> client)56 String IceCandidateDescriptor::toSdp() 71 57 { 72 MediaStreamSourceVector audioSources, videoSources; 73 client->didCompleteQuery(audioSources, videoSources); 58 return MediaStreamCenter::instance().constructSdp(this); 74 59 } 75 76 void MediaStreamCenter::didSetMediaStreamTrackEnabled(MediaStreamDescriptor*, MediaStreamComponent*)77 {78 }79 80 void MediaStreamCenter::didStopLocalMediaStream(MediaStreamDescriptor*)81 {82 }83 84 void MediaStreamCenter::didConstructMediaStream(MediaStreamDescriptor*)85 {86 }87 88 #endif // !PLATFORM(CHROMIUM)89 60 90 61 } // namespace WebCore -
trunk/Source/WebCore/platform/mediastream/IceCandidateDescriptor.h
r110733 r110735 1 1 /* 2 * Copyright (C) 201 1 Ericsson AB. All rights reserved.2 * Copyright (C) 2012 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 12 12 * in the documentation and/or other materials provided with the 13 13 * distribution. 14 * 3. Neither the name of Ericssonnor the names of its contributors14 * 3. Neither the name of Google Inc. nor the names of its contributors 15 15 * may be used to endorse or promote products derived from this 16 16 * software without specific prior written permission. … … 29 29 */ 30 30 31 #include "config.h" 31 #ifndef IceCandidateDescriptor_h 32 #define IceCandidateDescriptor_h 32 33 33 34 #if ENABLE(MEDIA_STREAM) 34 35 35 #include "MediaStreamCenter.h" 36 37 #include "MainThread.h" 38 #include "MediaStreamDescriptor.h" 36 #include <wtf/PassRefPtr.h> 37 #include <wtf/RefCounted.h> 38 #include <wtf/text/WTFString.h> 39 39 40 40 namespace WebCore { 41 41 42 MediaStreamCenter& MediaStreamCenter::instance() 43 { 44 ASSERT(isMainThread()); 45 DEFINE_STATIC_LOCAL(MediaStreamCenter, center, ()); 46 return center; 47 } 42 class IceCandidateDescriptor : public RefCounted<IceCandidateDescriptor> { 43 public: 44 static PassRefPtr<IceCandidateDescriptor> create(const String& label, const String& candidateLine); 45 virtual ~IceCandidateDescriptor(); 48 46 49 void MediaStreamCenter::endLocalMediaStream(MediaStreamDescriptor* streamDescriptor) 50 { 51 MediaStreamDescriptorOwner* owner = streamDescriptor->owner(); 52 if (owner) 53 owner->streamEnded(); 54 else 55 streamDescriptor->setEnded(); 56 } 47 const String& label() { return m_label; } 48 const String& candidateLine() { return m_candidateLine; } 57 49 58 #if !PLATFORM(CHROMIUM) 50 String toSdp(); 59 51 60 // Empty implementations for ports that build with MEDIA_STREAM enabled by default, but haven't yet implemented MediaStreamCenter. 52 private: 53 IceCandidateDescriptor(const String& label, const String& candidateLine); 61 54 62 MediaStreamCenter::MediaStreamCenter() 63 { 64 } 65 66 MediaStreamCenter::~MediaStreamCenter() 67 { 68 } 69 70 void MediaStreamCenter::queryMediaStreamSources(PassRefPtr<MediaStreamSourcesQueryClient> client) 71 { 72 MediaStreamSourceVector audioSources, videoSources; 73 client->didCompleteQuery(audioSources, videoSources); 74 } 75 76 void MediaStreamCenter::didSetMediaStreamTrackEnabled(MediaStreamDescriptor*, MediaStreamComponent*) 77 { 78 } 79 80 void MediaStreamCenter::didStopLocalMediaStream(MediaStreamDescriptor*) 81 { 82 } 83 84 void MediaStreamCenter::didConstructMediaStream(MediaStreamDescriptor*) 85 { 86 } 87 88 #endif // !PLATFORM(CHROMIUM) 55 String m_label; 56 String m_candidateLine; 57 }; 89 58 90 59 } // namespace WebCore 91 60 92 61 #endif // ENABLE(MEDIA_STREAM) 62 63 #endif // IceCandidateDescriptor_h -
trunk/Source/WebCore/platform/mediastream/MediaStreamCenter.cpp
r106581 r110735 56 56 } 57 57 58 String MediaStreamCenter::constructSdp(IceCandidateDescriptor*) 59 { 60 return ""; 61 } 62 58 63 #if !PLATFORM(CHROMIUM) 59 64 -
trunk/Source/WebCore/platform/mediastream/MediaStreamCenter.h
r106581 r110735 43 43 #endif 44 44 45 class IceCandidateDescriptor; 45 46 class MediaStreamComponent; 46 47 class MediaStreamDescriptor; … … 75 76 void didConstructMediaStream(MediaStreamDescriptor*); 76 77 78 String constructSdp(IceCandidateDescriptor*); 79 77 80 // Calls from the platform to update the DOM objects 78 81 void endLocalMediaStream(MediaStreamDescriptor*);
Note: See TracChangeset
for help on using the changeset viewer.