From c7416745e9d35902e62517d1bddcd546623e1c34 Mon Sep 17 00:00:00 2001 From: "buildbot@webrtc.org" Date: Thu, 7 Aug 2014 22:09:08 +0000 Subject: (Auto)update libjingle 72839629-> 72847605 git-svn-id: http://webrtc.googlecode.com/svn/trunk/talk@6854 4adac7df-926f-26a2-2b94-8c16560cd09d --- media/base/device.h | 50 ++++++++++++++++++++++ media/base/fakescreencapturerfactory.h | 78 ++++++++++++++++++++++++++++++++++ media/base/videocapturerfactory.h | 55 ++++++++++++++++++++++++ 3 files changed, 183 insertions(+) create mode 100755 media/base/device.h create mode 100755 media/base/fakescreencapturerfactory.h create mode 100755 media/base/videocapturerfactory.h (limited to 'media/base') diff --git a/media/base/device.h b/media/base/device.h new file mode 100755 index 0000000..ced74c6 --- /dev/null +++ b/media/base/device.h @@ -0,0 +1,50 @@ +// libjingle +// Copyright 2014 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_MEDIA_BASE_DEVICE_H_ +#define TALK_MEDIA_BASE_DEVICE_H_ + +#include "webrtc/base/stringencode.h" + +namespace cricket { + +// Used to represent an audio or video capture or render device. +struct Device { + Device() {} + Device(const std::string& name, int id) + : name(name), + id(rtc::ToString(id)) { + } + Device(const std::string& name, const std::string& id) + : name(name), id(id) {} + + std::string name; + std::string id; +}; + +} // namespace cricket + +#endif // TALK_MEDIA_BASE_DEVICE_H_ diff --git a/media/base/fakescreencapturerfactory.h b/media/base/fakescreencapturerfactory.h new file mode 100755 index 0000000..dfd7376 --- /dev/null +++ b/media/base/fakescreencapturerfactory.h @@ -0,0 +1,78 @@ +/* + * libjingle + * Copyright 2012 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_MEDIA_BASE_FAKESCREENCAPTURERFACTORY_H_ +#define TALK_MEDIA_BASE_FAKESCREENCAPTURERFACTORY_H_ + +#include "talk/media/base/fakevideocapturer.h" +#include "talk/media/base/videocapturerfactory.h" + +namespace cricket { + +class FakeScreenCapturerFactory + : public cricket::ScreenCapturerFactory, + public sigslot::has_slots<> { + public: + FakeScreenCapturerFactory() + : window_capturer_(NULL), + capture_state_(cricket::CS_STOPPED) {} + + virtual cricket::VideoCapturer* Create(const ScreencastId& window) { + if (window_capturer_ != NULL) { + return NULL; + } + window_capturer_ = new cricket::FakeVideoCapturer; + window_capturer_->SignalDestroyed.connect( + this, + &FakeScreenCapturerFactory::OnWindowCapturerDestroyed); + window_capturer_->SignalStateChange.connect( + this, + &FakeScreenCapturerFactory::OnStateChange); + return window_capturer_; + } + + cricket::FakeVideoCapturer* window_capturer() { return window_capturer_; } + + cricket::CaptureState capture_state() { return capture_state_; } + + private: + void OnWindowCapturerDestroyed(cricket::FakeVideoCapturer* capturer) { + if (capturer == window_capturer_) { + window_capturer_ = NULL; + } + } + void OnStateChange(cricket::VideoCapturer*, cricket::CaptureState state) { + capture_state_ = state; + } + + cricket::FakeVideoCapturer* window_capturer_; + cricket::CaptureState capture_state_; +}; + +} // namespace cricket + +#endif // TALK_MEDIA_BASE_FAKESCREENCAPTURERFACTORY_H_ diff --git a/media/base/videocapturerfactory.h b/media/base/videocapturerfactory.h new file mode 100755 index 0000000..009a5ee --- /dev/null +++ b/media/base/videocapturerfactory.h @@ -0,0 +1,55 @@ +// libjingle +// Copyright 2014 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_MEDIA_BASE_VIDEOCAPTURERFACTORY_H_ +#define TALK_MEDIA_BASE_VIDEOCAPTURERFACTORY_H_ + +#include "talk/media/base/device.h" +#include "talk/media/base/screencastid.h" + +namespace cricket { + +class VideoCapturer; + +class VideoDeviceCapturerFactory { + public: + VideoDeviceCapturerFactory() {} + virtual ~VideoDeviceCapturerFactory() {} + + virtual VideoCapturer* Create(const Device& device) = 0; +}; + +class ScreenCapturerFactory { + public: + ScreenCapturerFactory() {} + virtual ~ScreenCapturerFactory() {} + + virtual VideoCapturer* Create(const ScreencastId& screenid) = 0; +}; + +} // namespace cricket + +#endif // TALK_MEDIA_BASE_VIDEOCAPTURERFACTORY_H_ -- cgit v1.2.3