diff --git a/third_party_mods/libjingle/libjingle.gyp b/third_party_mods/libjingle/libjingle.gyp index d285ec652..ae1f483f4 100644 --- a/third_party_mods/libjingle/libjingle.gyp +++ b/third_party_mods/libjingle/libjingle.gyp @@ -656,9 +656,10 @@ ['peer_connection_dev==1', { 'type': 'executable', 'sources': [ - '<(libjingle_mods)/source/talk/app/peer_connection_dev/peerconnection_unittests.cc', - '<(libjingle_mods)/source/talk/app/peer_connection_dev/local_stream_dev_unittest.cc', - '<(libjingle_mods)/source/talk/app/peer_connection_dev/remote_stream_dev_unittest.cc', + '<(libjingle_mods)/source/talk/app/webrtc_dev/peerconnection_unittests.cc', + '<(libjingle_mods)/source/talk/app/webrtc_dev/local_stream_dev_unittest.cc', + '<(libjingle_mods)/source/talk/app/webrtc_dev/remote_stream_dev_unittest.cc', + '<(libjingle_mods)/source/talk/app/webrtc_dev/peerconnection_impl_dev_unittest.cc', ], }, { 'type': 'none', diff --git a/third_party_mods/libjingle/source/talk/app/webrtc_dev/audio_device_dev.cc b/third_party_mods/libjingle/source/talk/app/webrtc_dev/audio_device_dev.cc index e8b3cd621..ef80632bd 100644 --- a/third_party_mods/libjingle/source/talk/app/webrtc_dev/audio_device_dev.cc +++ b/third_party_mods/libjingle/source/talk/app/webrtc_dev/audio_device_dev.cc @@ -24,7 +24,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "talk/app/webrtc/local_stream_dev.h" +#include "talk/app/webrtc_dev/local_stream_dev.h" namespace webrtc { diff --git a/third_party_mods/libjingle/source/talk/app/webrtc_dev/local_audio_track_impl_dev.cc b/third_party_mods/libjingle/source/talk/app/webrtc_dev/local_audio_track_impl_dev.cc index c5d3ec919..87b94db14 100644 --- a/third_party_mods/libjingle/source/talk/app/webrtc_dev/local_audio_track_impl_dev.cc +++ b/third_party_mods/libjingle/source/talk/app/webrtc_dev/local_audio_track_impl_dev.cc @@ -24,7 +24,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "talk/app/webrtc/local_stream_dev.h" +#include "talk/app/webrtc_dev/local_stream_dev.h" namespace webrtc { diff --git a/third_party_mods/libjingle/source/talk/app/webrtc_dev/local_stream_dev.cc b/third_party_mods/libjingle/source/talk/app/webrtc_dev/local_stream_dev.cc index 57bc0a478..ecf6f8e15 100644 --- a/third_party_mods/libjingle/source/talk/app/webrtc_dev/local_stream_dev.cc +++ b/third_party_mods/libjingle/source/talk/app/webrtc_dev/local_stream_dev.cc @@ -24,7 +24,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "talk/app/webrtc/local_stream_dev.h" +#include "talk/app/webrtc_dev/local_stream_dev.h" namespace webrtc { diff --git a/third_party_mods/libjingle/source/talk/app/webrtc_dev/local_stream_dev.h b/third_party_mods/libjingle/source/talk/app/webrtc_dev/local_stream_dev.h index 15b3f32ee..692b6961c 100644 --- a/third_party_mods/libjingle/source/talk/app/webrtc_dev/local_stream_dev.h +++ b/third_party_mods/libjingle/source/talk/app/webrtc_dev/local_stream_dev.h @@ -28,8 +28,8 @@ #ifndef TALK_APP_WEBRTC_LOCAL_STREAM_H_ #define TALK_APP_WEBRTC_LOCAL_STREAM_H_ -#include "talk/app/webrtc/media_stream_impl_dev.h" -#include "talk/app/webrtc/stream_dev.h" +#include "talk/app/webrtc_dev/media_stream_impl_dev.h" +#include "talk/app/webrtc_dev/stream_dev.h" #include "talk/base/scoped_ptr.h" namespace webrtc { diff --git a/third_party_mods/libjingle/source/talk/app/webrtc_dev/local_stream_dev_unittest.cc b/third_party_mods/libjingle/source/talk/app/webrtc_dev/local_stream_dev_unittest.cc index d81c2caa0..ed6e1d9fc 100644 --- a/third_party_mods/libjingle/source/talk/app/webrtc_dev/local_stream_dev_unittest.cc +++ b/third_party_mods/libjingle/source/talk/app/webrtc_dev/local_stream_dev_unittest.cc @@ -28,7 +28,7 @@ #include #include "gtest/gtest.h" -#include "talk/app/webrtc/local_stream_dev.h" +#include "talk/app/webrtc_dev/local_stream_dev.h" static const char kStreamLabel1[] = "local_stream_1"; const char* kVideoDeviceName = "dummy_video_cam_1"; diff --git a/third_party_mods/libjingle/source/talk/app/webrtc_dev/local_video_track_impl_dev.cc b/third_party_mods/libjingle/source/talk/app/webrtc_dev/local_video_track_impl_dev.cc index 1bcc8ecaa..23a47c7a5 100644 --- a/third_party_mods/libjingle/source/talk/app/webrtc_dev/local_video_track_impl_dev.cc +++ b/third_party_mods/libjingle/source/talk/app/webrtc_dev/local_video_track_impl_dev.cc @@ -24,7 +24,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "talk/app/webrtc/local_stream_dev.h" +#include "talk/app/webrtc_dev/local_stream_dev.h" namespace webrtc { diff --git a/third_party_mods/libjingle/source/talk/app/webrtc_dev/media_stream_impl_dev.cc b/third_party_mods/libjingle/source/talk/app/webrtc_dev/media_stream_impl_dev.cc index 4946905b4..d175b7059 100644 --- a/third_party_mods/libjingle/source/talk/app/webrtc_dev/media_stream_impl_dev.cc +++ b/third_party_mods/libjingle/source/talk/app/webrtc_dev/media_stream_impl_dev.cc @@ -25,7 +25,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "talk/app/webrtc/media_stream_impl_dev.h" +#include "talk/app/webrtc_dev/media_stream_impl_dev.h" namespace webrtc { diff --git a/third_party_mods/libjingle/source/talk/app/webrtc_dev/media_stream_impl_dev.h b/third_party_mods/libjingle/source/talk/app/webrtc_dev/media_stream_impl_dev.h index 73aa5d95d..5ebb3a70c 100644 --- a/third_party_mods/libjingle/source/talk/app/webrtc_dev/media_stream_impl_dev.h +++ b/third_party_mods/libjingle/source/talk/app/webrtc_dev/media_stream_impl_dev.h @@ -31,10 +31,10 @@ #include #include -#include "talk/app/webrtc/notifier_impl.h" -#include "talk/app/webrtc/ref_count.h" -#include "talk/app/webrtc/scoped_refptr.h" -#include "talk/app/webrtc/stream_dev.h" +#include "talk/app/webrtc_dev/notifier_impl.h" +#include "talk/app/webrtc_dev/ref_count.h" +#include "talk/app/webrtc_dev/scoped_refptr.h" +#include "talk/app/webrtc_dev/stream_dev.h" namespace webrtc { diff --git a/third_party_mods/libjingle/source/talk/app/webrtc_dev/notifier_impl.h b/third_party_mods/libjingle/source/talk/app/webrtc_dev/notifier_impl.h index 762b71f62..f237420a8 100644 --- a/third_party_mods/libjingle/source/talk/app/webrtc_dev/notifier_impl.h +++ b/third_party_mods/libjingle/source/talk/app/webrtc_dev/notifier_impl.h @@ -31,7 +31,7 @@ #include #include "talk/base/common.h" -#include "talk/app/webrtc/stream_dev.h" +#include "talk/app/webrtc_dev/stream_dev.h" namespace webrtc { diff --git a/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnection_dev.h b/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnection_dev.h index 5563c0add..694cfc10e 100644 --- a/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnection_dev.h +++ b/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnection_dev.h @@ -30,7 +30,7 @@ #include -#include "talk/app/webrtc/stream_dev.h" +#include "talk/app/webrtc_dev/stream_dev.h" namespace cricket { class PortAllocator; @@ -109,6 +109,8 @@ class PeerConnection { // and stop sending media on removed stream. virtual void CommitStreamChanges() = 0; + protected: + // Dtor protected as objects shouldn't be deleted via this interface. virtual ~PeerConnection() {} }; diff --git a/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnection_impl_dev.cc b/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnection_impl_dev.cc index 6e0d9df25..207441fd9 100644 --- a/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnection_impl_dev.cc +++ b/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnection_impl_dev.cc @@ -26,24 +26,25 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "talk/app/webrtc/peerconnection_impl_dev.h" +#include "talk/app/webrtc_dev/peerconnection_impl_dev.h" -#include "talk/app/webrtc/webrtcsession.h" +#include "talk/app/webrtc_dev/scoped_refptr_msg.h" #include "talk/base/logging.h" #include "talk/session/phone/channelmanager.h" #include "talk/p2p/base/portallocator.h" + namespace webrtc { PeerConnectionImpl::PeerConnectionImpl( cricket::ChannelManager* channel_manager, - cricket::PortAllocator* port_allocator) + cricket::PortAllocator* port_allocator, + talk_base::Thread* signal_thread) : observer_(NULL), - session_(NULL), - worker_thread_(new talk_base::Thread()), + signal_thread_(signal_thread), channel_manager_(channel_manager), port_allocator_(port_allocator) { - ASSERT(port_allocator_ != NULL); +// TODO(perkj): // ASSERT(port_allocator_ != NULL); } PeerConnectionImpl::~PeerConnectionImpl() { @@ -54,11 +55,48 @@ void PeerConnectionImpl::RegisterObserver(PeerConnectionObserver* observer) { } void PeerConnectionImpl::AddStream(LocalMediaStream* local_stream) { - add_commit_queue_.push_back(local_stream); + ScopedRefMessageData* msg = + new ScopedRefMessageData (local_stream); + signal_thread_->Post(this, MSG_ADDMEDIASTREAM, msg); } void PeerConnectionImpl::RemoveStream(LocalMediaStream* remove_stream) { - remove_commit_queue_.push_back(remove_stream); + ScopedRefMessageData* msg = + new ScopedRefMessageData (remove_stream); + signal_thread_->Post(this, MSG_REMOVEMEDIASTREAM, msg); } -} // namespace webrtc +void PeerConnectionImpl::CommitStreamChanges() { + signal_thread_->Post(this, MSG_COMMITSTREAMCHANGES); +} + +void PeerConnectionImpl::OnMessage(talk_base::Message* msg) { + talk_base::MessageData* data = msg->pdata; + switch (msg->message_id) { + case MSG_ADDMEDIASTREAM: { + ScopedRefMessageData* s = + static_cast*> (data); + LocalStreamMap::iterator it = + local_media_streams_.find(s->data()->label()); + if (it != local_media_streams_.end()) + return; // Stream already exist. + const std::string& label = s->data()->label(); + local_media_streams_[label] = s->data(); + break; + } + case MSG_REMOVEMEDIASTREAM: { + ScopedRefMessageData* s = + static_cast*> (data); + local_media_streams_.erase(s->data()->label()); + break; + } + case MSG_COMMITSTREAMCHANGES: { + // TODO(perkj): Here is where necessary signaling + // and creation of channels should happen. Also removing of channels. + // The media streams are in the local_media_streams_ array. + break; + } + } +} + +} // namespace webrtc diff --git a/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnection_impl_dev.h b/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnection_impl_dev.h index d37203139..533aefc35 100644 --- a/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnection_impl_dev.h +++ b/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnection_impl_dev.h @@ -29,24 +29,22 @@ #define TALK_APP_WEBRTC_PEERCONNECTION_IMPL_H_ #include +#include +#include -#include "talk/app/webrtc/peerconnection_dev.h" +#include "talk/app/webrtc_dev/peerconnection_dev.h" #include "talk/base/scoped_ptr.h" +#include "talk/base/messagequeue.h" namespace cricket { class ChannelManager; class PortAllocator; } -namespace talk_base { -class Message; -} - namespace webrtc { -class WebRtcSession; - -class PeerConnectionImpl : public PeerConnection { +class PeerConnectionImpl : public PeerConnection, + public talk_base::MessageHandler { public: enum Error { ERROR_NONE = 0, // Good @@ -60,7 +58,8 @@ class PeerConnectionImpl : public PeerConnection { }; PeerConnectionImpl(cricket::ChannelManager* channel_manager, - cricket::PortAllocator* port_allocator); + cricket::PortAllocator* port_allocator, + talk_base::Thread* signal_thread); virtual ~PeerConnectionImpl(); // Interfaces from PeerConnection @@ -85,15 +84,23 @@ class PeerConnectionImpl : public PeerConnection { void RegisterObserver(PeerConnectionObserver* observer); + // Implement talk_base::MessageHandler. + void OnMessage(talk_base::Message* msg); + private: + enum { + MSG_ADDMEDIASTREAM = 1, + MSG_REMOVEMEDIASTREAM = 2, + MSG_COMMITSTREAMCHANGES = 3 + }; + PeerConnectionObserver* observer_; - // List of media streams to process. - std::list > add_commit_queue_; - std::list > remove_commit_queue_; + // Map of local media streams. + typedef std::map > LocalStreamMap; + LocalStreamMap local_media_streams_; - talk_base::scoped_ptr session_; - talk_base::scoped_ptr worker_thread_; + talk_base::Thread* signal_thread_; cricket::ChannelManager* channel_manager_; cricket::PortAllocator* port_allocator_; }; diff --git a/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnection_unittests.cc b/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnection_unittests.cc new file mode 100644 index 000000000..e9bc50a21 --- /dev/null +++ b/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnection_unittests.cc @@ -0,0 +1,36 @@ +/* + * libjingle + * Copyright 2011, Google Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "gtest/gtest.h" + +int main(int argc, char **argv) { + ::testing::InitGoogleTest(&argc, argv); + // Added return_value so that it's convenient to put a breakpoint before + // exiting please note that the return value from RUN_ALL_TESTS() must + // be returned by the main function. + const int return_value = RUN_ALL_TESTS(); + return return_value; +} diff --git a/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnectionmanager.cc b/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnectionmanager.cc index 76229e289..ef53779ba 100644 --- a/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnectionmanager.cc +++ b/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnectionmanager.cc @@ -25,9 +25,9 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "talk/app/webrtc/peerconnectionmanager.h" +#include "talk/app/webrtc_dev/peerconnectionmanager.h" -#include "talk/app/webrtc/peerconnection_impl_dev.h" +#include "talk/app/webrtc_dev/peerconnection_impl_dev.h" #include "talk/base/logging.h" #include "talk/base/thread.h" #include "talk/session/phone/channelmanager.h" @@ -71,6 +71,11 @@ bool PeerConnectionManager::Initialize(cricket::MediaEngine* media_engine, return initialized_; } +PeerConnectionManager::PeerConnectionManager() + : signal_thread_(new talk_base::Thread) { + +} + bool PeerConnectionManager::Initialize(cricket::PortAllocator* port_allocator, talk_base::Thread* worker_thread) { port_allocator_.reset(port_allocator); @@ -85,11 +90,12 @@ PeerConnection* PeerConnectionManager::CreatePeerConnection() { // TODO(mallinath) - It may be necessary to store the created PeerConnection // object in manager. return new PeerConnectionImpl(channel_manager_.get(), - port_allocator_.get()); + port_allocator_.get(), + signal_thread_.get()); } void PeerConnectionManager::DestroyPeerConnection(PeerConnection* pc) { - delete pc; + delete static_cast (pc); } } // namespace webrtc diff --git a/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnectionmanager.h b/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnectionmanager.h index 6cbcc34c3..f51d38225 100644 --- a/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnectionmanager.h +++ b/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnectionmanager.h @@ -61,7 +61,7 @@ class PeerConnectionManager { void DestroyPeerConnection(PeerConnection* pc); protected: - PeerConnectionManager() {}; + PeerConnectionManager(); virtual ~PeerConnectionManager() {}; private: @@ -74,6 +74,7 @@ class PeerConnectionManager { talk_base::Thread* worker_thread); bool initialized_; + talk_base::scoped_ptr signal_thread_; talk_base::scoped_ptr port_allocator_; talk_base::scoped_ptr channel_manager_; }; diff --git a/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnectiontransport.cc b/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnectiontransport.cc index 1fc61a333..c99be89d9 100644 --- a/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnectiontransport.cc +++ b/third_party_mods/libjingle/source/talk/app/webrtc_dev/peerconnectiontransport.cc @@ -1,5 +1,5 @@ -#include "talk/app/webrtc/peerconnectiontransport.h" +#include "talk/app/webrtc_dev/peerconnectiontransport.h" #include "talk/base/common.h" #include "talk/base/logging.h" diff --git a/third_party_mods/libjingle/source/talk/app/webrtc_dev/remote_stream_dev.cc b/third_party_mods/libjingle/source/talk/app/webrtc_dev/remote_stream_dev.cc index 27a291431..d21d89163 100644 --- a/third_party_mods/libjingle/source/talk/app/webrtc_dev/remote_stream_dev.cc +++ b/third_party_mods/libjingle/source/talk/app/webrtc_dev/remote_stream_dev.cc @@ -24,7 +24,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "talk/app/webrtc/remote_stream_dev.h" +#include "talk/app/webrtc_dev/remote_stream_dev.h" #include diff --git a/third_party_mods/libjingle/source/talk/app/webrtc_dev/remote_stream_dev.h b/third_party_mods/libjingle/source/talk/app/webrtc_dev/remote_stream_dev.h index 8e480aeb7..034476d20 100644 --- a/third_party_mods/libjingle/source/talk/app/webrtc_dev/remote_stream_dev.h +++ b/third_party_mods/libjingle/source/talk/app/webrtc_dev/remote_stream_dev.h @@ -28,8 +28,8 @@ #ifndef TALK_APP_WEBRTC_REMOTE_STREAM_H_ #define TALK_APP_WEBRTC_REMOTE_STREAM_H_ -#include "talk/app/webrtc/media_stream_impl_dev.h" -#include "talk/app/webrtc/stream_dev.h" +#include "talk/app/webrtc_dev/media_stream_impl_dev.h" +#include "talk/app/webrtc_dev/stream_dev.h" #include "talk/base/scoped_ptr.h" namespace webrtc { diff --git a/third_party_mods/libjingle/source/talk/app/webrtc_dev/remote_stream_dev_unittest.cc b/third_party_mods/libjingle/source/talk/app/webrtc_dev/remote_stream_dev_unittest.cc index fdc65765d..a3ed0009c 100644 --- a/third_party_mods/libjingle/source/talk/app/webrtc_dev/remote_stream_dev_unittest.cc +++ b/third_party_mods/libjingle/source/talk/app/webrtc_dev/remote_stream_dev_unittest.cc @@ -28,7 +28,7 @@ #include #include "gtest/gtest.h" -#include "talk/app/webrtc/remote_stream_dev.h" +#include "talk/app/webrtc_dev/remote_stream_dev.h" static const char kStreamLabel1[] = "remote_stream_1"; diff --git a/third_party_mods/libjingle/source/talk/app/webrtc_dev/scoped_refptr_msg.h b/third_party_mods/libjingle/source/talk/app/webrtc_dev/scoped_refptr_msg.h new file mode 100644 index 000000000..ad439ff50 --- /dev/null +++ b/third_party_mods/libjingle/source/talk/app/webrtc_dev/scoped_refptr_msg.h @@ -0,0 +1,52 @@ +/* + * libjingle + * Copyright 2011, Google Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef TALK_APP_WEBRTC_SCOPED_REF_PTR_MSG_H_ +#define TALK_APP_WEBRTC_SCOPED_REF_PTR_MSG_H_ + + +#include "talk/base/messagequeue.h" + +// Like ScopedRefMessageData, but for reference counting pointers. +template +class ScopedRefMessageData : public talk_base::MessageData { + public: + explicit ScopedRefMessageData(T* data) : data_(data) { } + const scoped_refptr& data() const { return data_; } + scoped_refptr& data() { return data_; } + private: + scoped_refptr data_; +}; +/* +struct ScopedTypedMessageData : public talk_base::MessageData { + ScopedRefPtrMsgParams(scoped_refptr ptr) + : ptr_(ptr) { + } + scoped_refptr ptr_; +};*/ + +#endif // TALK_APP_WEBRTC_SCOPED_REF_PTR_MSG_H_ diff --git a/third_party_mods/libjingle/source/talk/app/webrtc_dev/stream_dev.h b/third_party_mods/libjingle/source/talk/app/webrtc_dev/stream_dev.h index 1c0dedc7c..b12c10adb 100644 --- a/third_party_mods/libjingle/source/talk/app/webrtc_dev/stream_dev.h +++ b/third_party_mods/libjingle/source/talk/app/webrtc_dev/stream_dev.h @@ -30,8 +30,8 @@ #include -#include "talk/app/webrtc/ref_count.h" -#include "talk/app/webrtc/scoped_refptr.h" +#include "talk/app/webrtc_dev/ref_count.h" +#include "talk/app/webrtc_dev/scoped_refptr.h" namespace cricket { class VideoRenderer; diff --git a/third_party_mods/libjingle/source/talk/app/webrtc_dev/video_device_dev.cc b/third_party_mods/libjingle/source/talk/app/webrtc_dev/video_device_dev.cc index b871af5a0..71aaaa152 100644 --- a/third_party_mods/libjingle/source/talk/app/webrtc_dev/video_device_dev.cc +++ b/third_party_mods/libjingle/source/talk/app/webrtc_dev/video_device_dev.cc @@ -24,7 +24,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "talk/app/webrtc/local_stream_dev.h" +#include "talk/app/webrtc_dev/local_stream_dev.h" namespace webrtc { diff --git a/third_party_mods/libjingle/source/talk/app/webrtc_dev/video_renderer_dev.cc b/third_party_mods/libjingle/source/talk/app/webrtc_dev/video_renderer_dev.cc index 23771a4bd..bd309e35c 100644 --- a/third_party_mods/libjingle/source/talk/app/webrtc_dev/video_renderer_dev.cc +++ b/third_party_mods/libjingle/source/talk/app/webrtc_dev/video_renderer_dev.cc @@ -24,7 +24,7 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "talk/app/webrtc/local_stream_dev.h" +#include "talk/app/webrtc_dev/local_stream_dev.h" namespace webrtc {