diff --git a/common/mac/_messagehandler.cc b/common/mac/_messagehandler.cc deleted file mode 100755 index 89f40e1..0000000 --- a/common/mac/_messagehandler.cc +++ /dev/null @@ -1,37 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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 "talk/base/messagehandler.h" -#include "talk/base/messagequeue.h" - -namespace talk_base { - -MessageHandler::~MessageHandler() { - MessageQueueManager::Clear(this); -} - -} // namespace talk_base diff --git a/common/mac/_videocapturer.cc b/common/mac/_videocapturer.cc deleted file mode 100755 index 44b66ff..0000000 --- a/common/mac/_videocapturer.cc +++ /dev/null @@ -1,742 +0,0 @@ -// libjingle -// Copyright 2010 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. -// -// Implementation file of class VideoCapturer. - -#include "talk/media/base/videocapturer.h" - -#include - -#if !defined(DISABLE_YUV) -#include "libyuv/scale_argb.h" -#endif -#include "talk/base/common.h" -#include "talk/base/logging.h" -#include "talk/base/systeminfo.h" -#include "talk/media/base/videoprocessor.h" - -#if defined(HAVE_WEBRTC_VIDEO) -#include "talk/media/webrtc/webrtcvideoframe.h" -#endif // HAVE_WEBRTC_VIDEO - - -namespace cricket { - -namespace { - -// TODO(thorcarpenter): This is a BIG hack to flush the system with black -// frames. Frontends should coordinate to update the video state of a muted -// user. When all frontends to this consider removing the black frame business. -const int kNumBlackFramesOnMute = 30; - -// MessageHandler constants. -enum { - MSG_DO_PAUSE = 0, - MSG_DO_UNPAUSE, - MSG_STATE_CHANGE -}; - -static const int64 kMaxDistance = ~(static_cast(1) << 63); -#ifdef LINUX -static const int kYU12Penalty = 16; // Needs to be higher than MJPG index. -#endif -static const int kDefaultScreencastFps = 5; -typedef talk_base::TypedMessageData StateChangeParams; - -// Limit stats data collections to ~20 seconds of 30fps data before dropping -// old data in case stats aren't reset for long periods of time. -static const size_t kMaxAccumulatorSize = 600; - -} // namespace - -///////////////////////////////////////////////////////////////////// -// Implementation of struct CapturedFrame -///////////////////////////////////////////////////////////////////// -CapturedFrame::CapturedFrame() - : width(0), - height(0), - fourcc(0), - pixel_width(0), - pixel_height(0), - elapsed_time(0), - time_stamp(0), - data_size(0), - rotation(0), - data(NULL) {} - -// TODO(fbarchard): Remove this function once lmimediaengine stops using it. -bool CapturedFrame::GetDataSize(uint32* size) const { - if (!size || data_size == CapturedFrame::kUnknownDataSize) { - return false; - } - *size = data_size; - return true; -} - -///////////////////////////////////////////////////////////////////// -// Implementation of class VideoCapturer -///////////////////////////////////////////////////////////////////// -VideoCapturer::VideoCapturer() - : thread_(talk_base::Thread::Current()), - adapt_frame_drops_data_(kMaxAccumulatorSize), - effect_frame_drops_data_(kMaxAccumulatorSize), - frame_time_data_(kMaxAccumulatorSize) { - Construct(); -} - -VideoCapturer::VideoCapturer(talk_base::Thread* thread) - : thread_(thread), - adapt_frame_drops_data_(kMaxAccumulatorSize), - effect_frame_drops_data_(kMaxAccumulatorSize), - frame_time_data_(kMaxAccumulatorSize) { - Construct(); -} - -void VideoCapturer::Construct() { - ClearAspectRatio(); - enable_camera_list_ = false; - square_pixel_aspect_ratio_ = false; - capture_state_ = CS_STOPPED; - SignalFrameCaptured.connect(this, &VideoCapturer::OnFrameCaptured); - scaled_width_ = 0; - scaled_height_ = 0; - screencast_max_pixels_ = 0; - muted_ = false; - black_frame_count_down_ = kNumBlackFramesOnMute; - enable_video_adapter_ = true; - adapt_frame_drops_ = 0; - effect_frame_drops_ = 0; - previous_frame_time_ = 0.0; -} - -const std::vector* VideoCapturer::GetSupportedFormats() const { - return &filtered_supported_formats_; -} - -bool VideoCapturer::StartCapturing(const VideoFormat& capture_format) { - previous_frame_time_ = frame_length_time_reporter_.TimerNow(); - CaptureState result = Start(capture_format); - const bool success = (result == CS_RUNNING) || (result == CS_STARTING); - if (!success) { - return false; - } - if (result == CS_RUNNING) { - SetCaptureState(result); - } - return true; -} - -void VideoCapturer::UpdateAspectRatio(int ratio_w, int ratio_h) { - if (ratio_w == 0 || ratio_h == 0) { - LOG(LS_WARNING) << "UpdateAspectRatio ignored invalid ratio: " - << ratio_w << "x" << ratio_h; - return; - } - ratio_w_ = ratio_w; - ratio_h_ = ratio_h; -} - -void VideoCapturer::ClearAspectRatio() { - ratio_w_ = 0; - ratio_h_ = 0; -} - -// Override this to have more control of how your device is started/stopped. -bool VideoCapturer::Pause(bool pause) { - if (pause) { - if (capture_state() == CS_PAUSED) { - return true; - } - bool is_running = capture_state() == CS_STARTING || - capture_state() == CS_RUNNING; - if (!is_running) { - LOG(LS_ERROR) << "Cannot pause a stopped camera."; - return false; - } - LOG(LS_INFO) << "Pausing a camera."; - talk_base::scoped_ptr capture_format_when_paused( - capture_format_ ? new VideoFormat(*capture_format_) : NULL); - Stop(); - SetCaptureState(CS_PAUSED); - // If you override this function be sure to restore the capture format - // after calling Stop(). - SetCaptureFormat(capture_format_when_paused.get()); - } else { // Unpause. - if (capture_state() != CS_PAUSED) { - LOG(LS_WARNING) << "Cannot unpause a camera that hasn't been paused."; - return false; - } - if (!capture_format_) { - LOG(LS_ERROR) << "Missing capture_format_, cannot unpause a camera."; - return false; - } - if (muted_) { - LOG(LS_WARNING) << "Camera cannot be unpaused while muted."; - return false; - } - LOG(LS_INFO) << "Unpausing a camera."; - if (!Start(*capture_format_)) { - LOG(LS_ERROR) << "Camera failed to start when unpausing."; - return false; - } - } - return true; -} - -bool VideoCapturer::Restart(const VideoFormat& capture_format) { - if (!IsRunning()) { - return StartCapturing(capture_format); - } - - if (GetCaptureFormat() != NULL && *GetCaptureFormat() == capture_format) { - // The reqested format is the same; nothing to do. - return true; - } - - Stop(); - return StartCapturing(capture_format); -} - -bool VideoCapturer::MuteToBlackThenPause(bool muted) { - if (muted == IsMuted()) { - return true; - } - - LOG(LS_INFO) << (muted ? "Muting" : "Unmuting") << " this video capturer."; - muted_ = muted; // Do this before calling Pause(). - if (muted) { - // Reset black frame count down. - black_frame_count_down_ = kNumBlackFramesOnMute; - // Following frames will be overritten with black, then the camera will be - // paused. - return true; - } - // Start the camera. - thread_->Clear(this, MSG_DO_PAUSE); - return Pause(false); -} - -void VideoCapturer::SetSupportedFormats( - const std::vector& formats) { - supported_formats_ = formats; - UpdateFilteredSupportedFormats(); -} - -bool VideoCapturer::GetBestCaptureFormat(const VideoFormat& format, - VideoFormat* best_format) { - // TODO(fbarchard): Directly support max_format. - UpdateFilteredSupportedFormats(); - const std::vector* supported_formats = GetSupportedFormats(); - - if (supported_formats->empty()) { - return false; - } - LOG(LS_INFO) << " Capture Requested " << format.ToString(); - int64 best_distance = kMaxDistance; - std::vector::const_iterator best = supported_formats->end(); - std::vector::const_iterator i; - for (i = supported_formats->begin(); i != supported_formats->end(); ++i) { - int64 distance = GetFormatDistance(format, *i); - // TODO(fbarchard): Reduce to LS_VERBOSE if/when camera capture is - // relatively bug free. - LOG(LS_INFO) << " Supported " << i->ToString() << " distance " << distance; - if (distance < best_distance) { - best_distance = distance; - best = i; - } - } - if (supported_formats->end() == best) { - LOG(LS_ERROR) << " No acceptable camera format found"; - return false; - } - - if (best_format) { - best_format->width = best->width; - best_format->height = best->height; - best_format->fourcc = best->fourcc; - best_format->interval = best->interval; - LOG(LS_INFO) << " Best " << best_format->ToString() << " Interval " - << best_format->interval << " distance " << best_distance; - } - return true; -} - -void VideoCapturer::AddVideoProcessor(VideoProcessor* video_processor) { - talk_base::CritScope cs(&crit_); - ASSERT(std::find(video_processors_.begin(), video_processors_.end(), - video_processor) == video_processors_.end()); - video_processors_.push_back(video_processor); -} - -bool VideoCapturer::RemoveVideoProcessor(VideoProcessor* video_processor) { - talk_base::CritScope cs(&crit_); - VideoProcessors::iterator found = std::find( - video_processors_.begin(), video_processors_.end(), video_processor); - if (found == video_processors_.end()) { - return false; - } - video_processors_.erase(found); - return true; -} - -void VideoCapturer::ConstrainSupportedFormats(const VideoFormat& max_format) { - max_format_.reset(new VideoFormat(max_format)); - LOG(LS_VERBOSE) << " ConstrainSupportedFormats " << max_format.ToString(); - UpdateFilteredSupportedFormats(); -} - -std::string VideoCapturer::ToString(const CapturedFrame* captured_frame) const { - std::string fourcc_name = GetFourccName(captured_frame->fourcc) + " "; - for (std::string::const_iterator i = fourcc_name.begin(); - i < fourcc_name.end(); ++i) { - // Test character is printable; Avoid isprint() which asserts on negatives. - if (*i < 32 || *i >= 127) { - fourcc_name = ""; - break; - } - } - - std::ostringstream ss; - ss << fourcc_name << captured_frame->width << "x" << captured_frame->height - << "x" << VideoFormat::IntervalToFpsFloat(captured_frame->elapsed_time); - return ss.str(); -} - -void VideoCapturer::GetStats(VariableInfo* adapt_drops_stats, - VariableInfo* effect_drops_stats, - VariableInfo* frame_time_stats, - VideoFormat* last_captured_frame_format) { - talk_base::CritScope cs(&frame_stats_crit_); - GetVariableSnapshot(adapt_frame_drops_data_, adapt_drops_stats); - GetVariableSnapshot(effect_frame_drops_data_, effect_drops_stats); - GetVariableSnapshot(frame_time_data_, frame_time_stats); - *last_captured_frame_format = last_captured_frame_format_; - - adapt_frame_drops_data_.Reset(); - effect_frame_drops_data_.Reset(); - frame_time_data_.Reset(); -} - -void VideoCapturer::OnFrameCaptured(VideoCapturer*, - const CapturedFrame* captured_frame) { - if (muted_) { - if (black_frame_count_down_ == 0) { - thread_->Post(this, MSG_DO_PAUSE, NULL); - } else { - --black_frame_count_down_; - } - } - - if (SignalVideoFrame.is_empty()) { - return; - } -#if defined(HAVE_WEBRTC_VIDEO) -#define VIDEO_FRAME_NAME WebRtcVideoFrame -#endif -#if defined(VIDEO_FRAME_NAME) -#if !defined(DISABLE_YUV) - if (IsScreencast()) { - int scaled_width, scaled_height; - if (screencast_max_pixels_ > 0) { - ComputeScaleMaxPixels(captured_frame->width, captured_frame->height, - screencast_max_pixels_, &scaled_width, &scaled_height); - } else { - int desired_screencast_fps = capture_format_.get() ? - VideoFormat::IntervalToFps(capture_format_->interval) : - kDefaultScreencastFps; - ComputeScale(captured_frame->width, captured_frame->height, - desired_screencast_fps, &scaled_width, &scaled_height); - } - - if (FOURCC_ARGB == captured_frame->fourcc && - (scaled_width != captured_frame->width || - scaled_height != captured_frame->height)) { - if (scaled_width != scaled_width_ || scaled_height != scaled_height_) { - LOG(LS_INFO) << "Scaling Screencast from " - << captured_frame->width << "x" - << captured_frame->height << " to " - << scaled_width << "x" << scaled_height; - scaled_width_ = scaled_width; - scaled_height_ = scaled_height; - } - CapturedFrame* modified_frame = - const_cast(captured_frame); - // Compute new width such that width * height is less than maximum but - // maintains original captured frame aspect ratio. - // Round down width to multiple of 4 so odd width won't round up beyond - // maximum, and so chroma channel is even width to simplify spatial - // resampling. - libyuv::ARGBScale(reinterpret_cast(captured_frame->data), - captured_frame->width * 4, captured_frame->width, - captured_frame->height, - reinterpret_cast(modified_frame->data), - scaled_width * 4, scaled_width, scaled_height, - libyuv::kFilterBilinear); - modified_frame->width = scaled_width; - modified_frame->height = scaled_height; - modified_frame->data_size = scaled_width * 4 * scaled_height; - } - } - - const int kYuy2Bpp = 2; - const int kArgbBpp = 4; - // TODO(fbarchard): Make a helper function to adjust pixels to square. - // TODO(fbarchard): Hook up experiment to scaling. - // TODO(fbarchard): Avoid scale and convert if muted. - // Temporary buffer is scoped here so it will persist until i420_frame.Init() - // makes a copy of the frame, converting to I420. - talk_base::scoped_ptr temp_buffer; - // YUY2 can be scaled vertically using an ARGB scaler. Aspect ratio is only - // a problem on OSX. OSX always converts webcams to YUY2 or UYVY. - bool can_scale = - FOURCC_YUY2 == CanonicalFourCC(captured_frame->fourcc) || - FOURCC_UYVY == CanonicalFourCC(captured_frame->fourcc); - - // If pixels are not square, optionally use vertical scaling to make them - // square. Square pixels simplify the rest of the pipeline, including - // effects and rendering. - if (can_scale && square_pixel_aspect_ratio_ && - captured_frame->pixel_width != captured_frame->pixel_height) { - int scaled_width, scaled_height; - // modified_frame points to the captured_frame but with const casted away - // so it can be modified. - CapturedFrame* modified_frame = const_cast(captured_frame); - // Compute the frame size that makes pixels square pixel aspect ratio. - ComputeScaleToSquarePixels(captured_frame->width, captured_frame->height, - captured_frame->pixel_width, - captured_frame->pixel_height, - &scaled_width, &scaled_height); - - if (scaled_width != scaled_width_ || scaled_height != scaled_height_) { - LOG(LS_INFO) << "Scaling WebCam from " - << captured_frame->width << "x" - << captured_frame->height << " to " - << scaled_width << "x" << scaled_height - << " for PAR " - << captured_frame->pixel_width << "x" - << captured_frame->pixel_height; - scaled_width_ = scaled_width; - scaled_height_ = scaled_height; - } - const int modified_frame_size = scaled_width * scaled_height * kYuy2Bpp; - uint8* temp_buffer_data; - // Pixels are wide and short; Increasing height. Requires temporary buffer. - if (scaled_height > captured_frame->height) { - temp_buffer.reset(new uint8[modified_frame_size]); - temp_buffer_data = temp_buffer.get(); - } else { - // Pixels are narrow and tall; Decreasing height. Scale will be done - // in place. - temp_buffer_data = reinterpret_cast(captured_frame->data); - } - - // Use ARGBScaler to vertically scale the YUY2 image, adjusting for 16 bpp. - libyuv::ARGBScale(reinterpret_cast(captured_frame->data), - captured_frame->width * kYuy2Bpp, // Stride for YUY2. - captured_frame->width * kYuy2Bpp / kArgbBpp, // Width. - abs(captured_frame->height), // Height. - temp_buffer_data, - scaled_width * kYuy2Bpp, // Stride for YUY2. - scaled_width * kYuy2Bpp / kArgbBpp, // Width. - abs(scaled_height), // New height. - libyuv::kFilterBilinear); - modified_frame->width = scaled_width; - modified_frame->height = scaled_height; - modified_frame->pixel_width = 1; - modified_frame->pixel_height = 1; - modified_frame->data_size = modified_frame_size; - modified_frame->data = temp_buffer_data; - } -#endif // !DISABLE_YUV - - // Size to crop captured frame to. This adjusts the captured frames - // aspect ratio to match the final view aspect ratio, considering pixel - // aspect ratio and rotation. The final size may be scaled down by video - // adapter to better match ratio_w_ x ratio_h_. - // Note that abs() of frame height is passed in, because source may be - // inverted, but output will be positive. - int desired_width = captured_frame->width; - int desired_height = captured_frame->height; - - // TODO(fbarchard): Improve logic to pad or crop. - // MJPG can crop vertically, but not horizontally. This logic disables crop. - // Alternatively we could pad the image with black, or implement a 2 step - // crop. - bool can_crop = true; - if (captured_frame->fourcc == FOURCC_MJPG) { - float cam_aspect = static_cast(captured_frame->width) / - static_cast(captured_frame->height); - float view_aspect = static_cast(ratio_w_) / - static_cast(ratio_h_); - can_crop = cam_aspect <= view_aspect; - } - if (can_crop && !IsScreencast()) { - // TODO(ronghuawu): The capturer should always produce the native - // resolution and the cropping should be done in downstream code. - ComputeCrop(ratio_w_, ratio_h_, captured_frame->width, - abs(captured_frame->height), captured_frame->pixel_width, - captured_frame->pixel_height, captured_frame->rotation, - &desired_width, &desired_height); - } - - VIDEO_FRAME_NAME i420_frame; - if (!i420_frame.Alias(captured_frame, desired_width, desired_height)) { - // TODO(fbarchard): LOG more information about captured frame attributes. - LOG(LS_ERROR) << "Couldn't convert to I420! " - << "From " << ToString(captured_frame) << " To " - << desired_width << " x " << desired_height; - return; - } - - VideoFrame* adapted_frame = &i420_frame; - if (enable_video_adapter_ && !IsScreencast()) { - VideoFrame* out_frame = NULL; - video_adapter_.AdaptFrame(adapted_frame, &out_frame); - if (!out_frame) { - // VideoAdapter dropped the frame. - ++adapt_frame_drops_; - return; - } - adapted_frame = out_frame; - } - - if (!muted_ && !ApplyProcessors(adapted_frame)) { - // Processor dropped the frame. - ++effect_frame_drops_; - return; - } - if (muted_) { - adapted_frame->SetToBlack(); - } - SignalVideoFrame(this, adapted_frame); - - UpdateStats(captured_frame); - -#endif // VIDEO_FRAME_NAME -} - -void VideoCapturer::SetCaptureState(CaptureState state) { - if (state == capture_state_) { - // Don't trigger a state changed callback if the state hasn't changed. - return; - } - StateChangeParams* state_params = new StateChangeParams(state); - capture_state_ = state; - thread_->Post(this, MSG_STATE_CHANGE, state_params); -} - -void VideoCapturer::OnMessage(talk_base::Message* message) { - switch (message->message_id) { - case MSG_STATE_CHANGE: { - talk_base::scoped_ptr p( - static_cast(message->pdata)); - SignalStateChange(this, p->data()); - break; - } - case MSG_DO_PAUSE: { - Pause(true); - break; - } - case MSG_DO_UNPAUSE: { - Pause(false); - break; - } - default: { - ASSERT(false); - } - } -} - -// Get the distance between the supported and desired formats. -// Prioritization is done according to this algorithm: -// 1) Width closeness. If not same, we prefer wider. -// 2) Height closeness. If not same, we prefer higher. -// 3) Framerate closeness. If not same, we prefer faster. -// 4) Compression. If desired format has a specific fourcc, we need exact match; -// otherwise, we use preference. -int64 VideoCapturer::GetFormatDistance(const VideoFormat& desired, - const VideoFormat& supported) { - int64 distance = kMaxDistance; - - // Check fourcc. - uint32 supported_fourcc = CanonicalFourCC(supported.fourcc); - int64 delta_fourcc = kMaxDistance; - if (FOURCC_ANY == desired.fourcc) { - // Any fourcc is OK for the desired. Use preference to find best fourcc. - std::vector preferred_fourccs; - if (!GetPreferredFourccs(&preferred_fourccs)) { - return distance; - } - - for (size_t i = 0; i < preferred_fourccs.size(); ++i) { - if (supported_fourcc == CanonicalFourCC(preferred_fourccs[i])) { - delta_fourcc = i; -#ifdef LINUX - // For HD avoid YU12 which is a software conversion and has 2 bugs - // b/7326348 b/6960899. Reenable when fixed. - if (supported.height >= 720 && (supported_fourcc == FOURCC_YU12 || - supported_fourcc == FOURCC_YV12)) { - delta_fourcc += kYU12Penalty; - } -#endif - break; - } - } - } else if (supported_fourcc == CanonicalFourCC(desired.fourcc)) { - delta_fourcc = 0; // Need exact match. - } - - if (kMaxDistance == delta_fourcc) { - // Failed to match fourcc. - return distance; - } - - // Check resolution and fps. - int desired_width = desired.width; - int desired_height = desired.height; - int64 delta_w = supported.width - desired_width; - float supported_fps = VideoFormat::IntervalToFpsFloat(supported.interval); - float delta_fps = - supported_fps - VideoFormat::IntervalToFpsFloat(desired.interval); - // Check height of supported height compared to height we would like it to be. - int64 aspect_h = - desired_width ? supported.width * desired_height / desired_width - : desired_height; - int64 delta_h = supported.height - aspect_h; - - distance = 0; - // Set high penalty if the supported format is lower than the desired format. - // 3x means we would prefer down to down to 3/4, than up to double. - // But we'd prefer up to double than down to 1/2. This is conservative, - // strongly avoiding going down in resolution, similar to - // the old method, but not completely ruling it out in extreme situations. - // It also ignores framerate, which is often very low at high resolutions. - // TODO(fbarchard): Improve logic to use weighted factors. - static const int kDownPenalty = -3; - if (delta_w < 0) { - delta_w = delta_w * kDownPenalty; - } - if (delta_h < 0) { - delta_h = delta_h * kDownPenalty; - } - // Require camera fps to be at least 80% of what is requested if resolution - // matches. - // Require camera fps to be at least 96% of what is requested, or higher, - // if resolution differs. 96% allows for slight variations in fps. e.g. 29.97 - if (delta_fps < 0) { - float min_desirable_fps = delta_w ? - VideoFormat::IntervalToFpsFloat(desired.interval) * 28.f / 30.f : - VideoFormat::IntervalToFpsFloat(desired.interval) * 23.f / 30.f; - delta_fps = -delta_fps; - if (supported_fps < min_desirable_fps) { - distance |= static_cast(1) << 62; - } else { - distance |= static_cast(1) << 15; - } - } - int64 idelta_fps = static_cast(delta_fps); - - // 12 bits for width and height and 8 bits for fps and fourcc. - distance |= - (delta_w << 28) | (delta_h << 16) | (idelta_fps << 8) | delta_fourcc; - - return distance; -} - -bool VideoCapturer::ApplyProcessors(VideoFrame* video_frame) { - bool drop_frame = false; - talk_base::CritScope cs(&crit_); - for (VideoProcessors::iterator iter = video_processors_.begin(); - iter != video_processors_.end(); ++iter) { - (*iter)->OnFrame(kDummyVideoSsrc, video_frame, &drop_frame); - if (drop_frame) { - return false; - } - } - return true; -} - -void VideoCapturer::UpdateFilteredSupportedFormats() { - filtered_supported_formats_.clear(); - filtered_supported_formats_ = supported_formats_; - if (!max_format_) { - return; - } - std::vector::iterator iter = filtered_supported_formats_.begin(); - while (iter != filtered_supported_formats_.end()) { - if (ShouldFilterFormat(*iter)) { - iter = filtered_supported_formats_.erase(iter); - } else { - ++iter; - } - } - if (filtered_supported_formats_.empty()) { - // The device only captures at resolutions higher than |max_format_| this - // indicates that |max_format_| should be ignored as it is better to capture - // at too high a resolution than to not capture at all. - filtered_supported_formats_ = supported_formats_; - } -} - -bool VideoCapturer::ShouldFilterFormat(const VideoFormat& format) const { - if (!enable_camera_list_) { - return false; - } - return format.width > max_format_->width || - format.height > max_format_->height; -} - -void VideoCapturer::UpdateStats(const CapturedFrame* captured_frame) { - // Update stats protected from fetches from different thread. - talk_base::CritScope cs(&frame_stats_crit_); - - last_captured_frame_format_.width = captured_frame->width; - last_captured_frame_format_.height = captured_frame->height; - // TODO(ronghuawu): Useful to report interval as well? - last_captured_frame_format_.interval = 0; - last_captured_frame_format_.fourcc = captured_frame->fourcc; - - double time_now = frame_length_time_reporter_.TimerNow(); - if (previous_frame_time_ != 0.0) { - adapt_frame_drops_data_.AddSample(adapt_frame_drops_); - effect_frame_drops_data_.AddSample(effect_frame_drops_); - frame_time_data_.AddSample(time_now - previous_frame_time_); - } - previous_frame_time_ = time_now; - effect_frame_drops_ = 0; - adapt_frame_drops_ = 0; -} - -template -void VideoCapturer::GetVariableSnapshot( - const talk_base::RollingAccumulator& data, - VariableInfo* stats) { - stats->max_val = data.ComputeMax(); - stats->mean = data.ComputeMean(); - stats->min_val = data.ComputeMin(); - stats->variance = data.ComputeVariance(); -} - -} // namespace cricket diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/audiotrack.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/audiotrack.h deleted file mode 100755 index 5387946..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/audiotrack.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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_AUDIOTRACK_H_ -#define TALK_APP_WEBRTC_AUDIOTRACK_H_ - -#include "talk/app/webrtc/mediastreaminterface.h" -#include "talk/app/webrtc/mediastreamtrack.h" -#include "talk/app/webrtc/notifier.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/scoped_ref_ptr.h" - -namespace webrtc { - -class AudioTrack : public MediaStreamTrack { - public: - static talk_base::scoped_refptr Create( - const std::string& id, AudioSourceInterface* source); - - // AudioTrackInterface implementation. - virtual AudioSourceInterface* GetSource() const OVERRIDE { - return audio_source_.get(); - } - // TODO(xians): Implement these methods. - virtual void AddSink(AudioTrackSinkInterface* sink) OVERRIDE {} - virtual void RemoveSink(AudioTrackSinkInterface* sink) OVERRIDE {} - virtual bool GetSignalLevel(int* level) OVERRIDE { return false; } - virtual talk_base::scoped_refptr GetAudioProcessor() - OVERRIDE { return NULL; } - virtual cricket::AudioRenderer* GetRenderer() OVERRIDE { - return NULL; - } - - // MediaStreamTrack implementation. - virtual std::string kind() const OVERRIDE; - - protected: - AudioTrack(const std::string& label, AudioSourceInterface* audio_source); - - private: - talk_base::scoped_refptr audio_source_; -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_AUDIOTRACK_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/audiotrackrenderer.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/audiotrackrenderer.h deleted file mode 100755 index 32fc85d..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/audiotrackrenderer.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * libjingle - * Copyright 2013, 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_AUDIOTRACKRENDERER_H_ -#define TALK_APP_WEBRTC_AUDIOTRACKRENDERER_H_ - -#include "talk/base/thread.h" -#include "talk/media/base/audiorenderer.h" - -namespace webrtc { - -// Class used for AudioTrack to get the ID of WebRtc voice channel that -// the AudioTrack is connecting to. -// Each AudioTrack owns a AudioTrackRenderer instance. -// AddChannel() will be called when an AudioTrack is added to a MediaStream. -// RemoveChannel will be called when the AudioTrack or WebRtc VoE channel is -// going away. -// This implementation only supports one channel, and it is only used by -// Chrome for remote audio tracks." -class AudioTrackRenderer : public cricket::AudioRenderer { - public: - AudioTrackRenderer(); - ~AudioTrackRenderer(); - - // Implements cricket::AudioRenderer. - virtual void AddChannel(int channel_id) OVERRIDE; - virtual void RemoveChannel(int channel_id) OVERRIDE; - - private: - int channel_id_; -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_AUDIOTRACKRENDERER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/datachannel.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/datachannel.h deleted file mode 100755 index 3fc3c8c..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/datachannel.h +++ /dev/null @@ -1,246 +0,0 @@ -/* - * 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_APP_WEBRTC_DATACHANNEL_H_ -#define TALK_APP_WEBRTC_DATACHANNEL_H_ - -#include -#include - -#include "talk/app/webrtc/datachannelinterface.h" -#include "talk/app/webrtc/proxy.h" -#include "talk/base/messagehandler.h" -#include "talk/base/scoped_ref_ptr.h" -#include "talk/base/sigslot.h" -#include "talk/media/base/mediachannel.h" -#include "talk/session/media/channel.h" - -namespace webrtc { - -class DataChannel; - -class DataChannelProviderInterface { - public: - // Sends the data to the transport. - virtual bool SendData(const cricket::SendDataParams& params, - const talk_base::Buffer& payload, - cricket::SendDataResult* result) = 0; - // Connects to the transport signals. - virtual bool ConnectDataChannel(DataChannel* data_channel) = 0; - // Disconnects from the transport signals. - virtual void DisconnectDataChannel(DataChannel* data_channel) = 0; - // Adds the data channel SID to the transport for SCTP. - virtual void AddSctpDataStream(uint32 sid) = 0; - // Removes the data channel SID from the transport for SCTP. - virtual void RemoveSctpDataStream(uint32 sid) = 0; - // Returns true if the transport channel is ready to send data. - virtual bool ReadyToSendData() const = 0; - - protected: - virtual ~DataChannelProviderInterface() {} -}; - -struct InternalDataChannelInit : public DataChannelInit { - enum OpenHandshakeRole { - kOpener, - kAcker, - kNone - }; - // The default role is kOpener because the default |negotiated| is false. - InternalDataChannelInit() : open_handshake_role(kOpener) {} - explicit InternalDataChannelInit(const DataChannelInit& base) - : DataChannelInit(base), open_handshake_role(kOpener) { - // If the channel is externally negotiated, do not send the OPEN message. - if (base.negotiated) { - open_handshake_role = kNone; - } - } - - OpenHandshakeRole open_handshake_role; -}; - -// DataChannel is a an implementation of the DataChannelInterface based on -// libjingle's data engine. It provides an implementation of unreliable or -// reliabledata channels. Currently this class is specifically designed to use -// both RtpDataEngine and SctpDataEngine. - -// DataChannel states: -// kConnecting: The channel has been created the transport might not yet be -// ready. -// kOpen: The channel have a local SSRC set by a call to UpdateSendSsrc -// and a remote SSRC set by call to UpdateReceiveSsrc and the transport -// has been writable once. -// kClosing: DataChannelInterface::Close has been called or UpdateReceiveSsrc -// has been called with SSRC==0 -// kClosed: Both UpdateReceiveSsrc and UpdateSendSsrc has been called with -// SSRC==0. -class DataChannel : public DataChannelInterface, - public sigslot::has_slots<>, - public talk_base::MessageHandler { - public: - static talk_base::scoped_refptr Create( - DataChannelProviderInterface* provider, - cricket::DataChannelType dct, - const std::string& label, - const InternalDataChannelInit& config); - - virtual void RegisterObserver(DataChannelObserver* observer); - virtual void UnregisterObserver(); - - virtual std::string label() const { return label_; } - virtual bool reliable() const; - virtual bool ordered() const { return config_.ordered; } - virtual uint16 maxRetransmitTime() const { - return config_.maxRetransmitTime; - } - virtual uint16 maxRetransmits() const { - return config_.maxRetransmits; - } - virtual std::string protocol() const { return config_.protocol; } - virtual bool negotiated() const { return config_.negotiated; } - virtual int id() const { return config_.id; } - virtual uint64 buffered_amount() const; - virtual void Close(); - virtual DataState state() const { return state_; } - virtual bool Send(const DataBuffer& buffer); - - // talk_base::MessageHandler override. - virtual void OnMessage(talk_base::Message* msg); - - // Called if the underlying data engine is closing. - void OnDataEngineClose(); - - // Called when the channel's ready to use. That can happen when the - // underlying DataMediaChannel becomes ready, or when this channel is a new - // stream on an existing DataMediaChannel, and we've finished negotiation. - void OnChannelReady(bool writable); - - // Sigslots from cricket::DataChannel - void OnDataReceived(cricket::DataChannel* channel, - const cricket::ReceiveDataParams& params, - const talk_base::Buffer& payload); - - // The remote peer request that this channel should be closed. - void RemotePeerRequestClose(); - - // The following methods are for SCTP only. - - // Sets the SCTP sid and adds to transport layer if not set yet. - void SetSctpSid(int sid); - // Called when the transport channel is created. - void OnTransportChannelCreated(); - - // The following methods are for RTP only. - - // Set the SSRC this channel should use to send data on the - // underlying data engine. |send_ssrc| == 0 means that the channel is no - // longer part of the session negotiation. - void SetSendSsrc(uint32 send_ssrc); - // Set the SSRC this channel should use to receive data from the - // underlying data engine. - void SetReceiveSsrc(uint32 receive_ssrc); - - cricket::DataChannelType data_channel_type() const { - return data_channel_type_; - } - - protected: - DataChannel(DataChannelProviderInterface* client, - cricket::DataChannelType dct, - const std::string& label); - virtual ~DataChannel(); - - private: - bool Init(const InternalDataChannelInit& config); - void DoClose(); - void UpdateState(); - void SetState(DataState state); - void DisconnectFromTransport(); - void DeliverQueuedControlData(); - void QueueControl(const talk_base::Buffer* buffer); - void ClearQueuedControlData(); - void DeliverQueuedReceivedData(); - void ClearQueuedReceivedData(); - void DeliverQueuedSendData(); - void ClearQueuedSendData(); - bool InternalSendWithoutQueueing(const DataBuffer& buffer, - cricket::SendDataResult* send_result); - bool QueueSendData(const DataBuffer& buffer); - bool SendOpenMessage(const talk_base::Buffer* buffer); - bool SendOpenAckMessage(const talk_base::Buffer* buffer); - - std::string label_; - InternalDataChannelInit config_; - DataChannelObserver* observer_; - DataState state_; - cricket::DataChannelType data_channel_type_; - DataChannelProviderInterface* provider_; - bool waiting_for_open_ack_; - bool was_ever_writable_; - bool connected_to_provider_; - bool send_ssrc_set_; - bool receive_ssrc_set_; - uint32 send_ssrc_; - uint32 receive_ssrc_; - // Control messages that always have to get sent out before any queued - // data. - std::queue queued_control_data_; - std::queue queued_received_data_; - std::deque queued_send_data_; -}; - -class DataChannelFactory { - public: - virtual talk_base::scoped_refptr CreateDataChannel( - const std::string& label, - const InternalDataChannelInit* config) = 0; - - protected: - virtual ~DataChannelFactory() {} -}; - -// Define proxy for DataChannelInterface. -BEGIN_PROXY_MAP(DataChannel) - PROXY_METHOD1(void, RegisterObserver, DataChannelObserver*) - PROXY_METHOD0(void, UnregisterObserver) - PROXY_CONSTMETHOD0(std::string, label) - PROXY_CONSTMETHOD0(bool, reliable) - PROXY_CONSTMETHOD0(bool, ordered) - PROXY_CONSTMETHOD0(uint16, maxRetransmitTime) - PROXY_CONSTMETHOD0(uint16, maxRetransmits) - PROXY_CONSTMETHOD0(std::string, protocol) - PROXY_CONSTMETHOD0(bool, negotiated) - PROXY_CONSTMETHOD0(int, id) - PROXY_CONSTMETHOD0(DataState, state) - PROXY_CONSTMETHOD0(uint64, buffered_amount) - PROXY_METHOD0(void, Close) - PROXY_METHOD1(bool, Send, const DataBuffer&) -END_PROXY() - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_DATACHANNEL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/datachannelinterface.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/datachannelinterface.h deleted file mode 100755 index 8f4e031..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/datachannelinterface.h +++ /dev/null @@ -1,141 +0,0 @@ -/* - * 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. - */ - -// This file contains interfaces for DataChannels -// http://dev.w3.org/2011/webrtc/editor/webrtc.html#rtcdatachannel - -#ifndef TALK_APP_WEBRTC_DATACHANNELINTERFACE_H_ -#define TALK_APP_WEBRTC_DATACHANNELINTERFACE_H_ - -#include - -#include "talk/base/basictypes.h" -#include "talk/base/buffer.h" -#include "talk/base/refcount.h" - - -namespace webrtc { - -struct DataChannelInit { - DataChannelInit() - : reliable(false), - ordered(true), - maxRetransmitTime(-1), - maxRetransmits(-1), - negotiated(false), - id(-1) { - } - - bool reliable; // Deprecated. - bool ordered; // True if ordered delivery is required. - int maxRetransmitTime; // The max period of time in milliseconds in which - // retransmissions will be sent. After this time, no - // more retransmissions will be sent. -1 if unset. - int maxRetransmits; // The max number of retransmissions. -1 if unset. - std::string protocol; // This is set by the application and opaque to the - // WebRTC implementation. - bool negotiated; // True if the channel has been externally negotiated - // and we do not send an in-band signalling in the - // form of an "open" message. - int id; // The stream id, or SID, for SCTP data channels. -1 - // if unset. -}; - -struct DataBuffer { - DataBuffer(const talk_base::Buffer& data, bool binary) - : data(data), - binary(binary) { - } - // For convenience for unit tests. - explicit DataBuffer(const std::string& text) - : data(text.data(), text.length()), - binary(false) { - } - size_t size() const { return data.length(); } - - talk_base::Buffer data; - // Indicates if the received data contains UTF-8 or binary data. - // Note that the upper layers are left to verify the UTF-8 encoding. - // TODO(jiayl): prefer to use an enum instead of a bool. - bool binary; -}; - -class DataChannelObserver { - public: - // The data channel state have changed. - virtual void OnStateChange() = 0; - // A data buffer was successfully received. - virtual void OnMessage(const DataBuffer& buffer) = 0; - - protected: - virtual ~DataChannelObserver() {} -}; - -class DataChannelInterface : public talk_base::RefCountInterface { - public: - // Keep in sync with DataChannel.java:State and - // RTCDataChannel.h:RTCDataChannelState. - enum DataState { - kConnecting, - kOpen, // The DataChannel is ready to send data. - kClosing, - kClosed - }; - - virtual void RegisterObserver(DataChannelObserver* observer) = 0; - virtual void UnregisterObserver() = 0; - // The label attribute represents a label that can be used to distinguish this - // DataChannel object from other DataChannel objects. - virtual std::string label() const = 0; - virtual bool reliable() const = 0; - - // TODO(tommyw): Remove these dummy implementations when all classes have - // implemented these APIs. They should all just return the values the - // DataChannel was created with. - virtual bool ordered() const { return false; } - virtual uint16 maxRetransmitTime() const { return 0; } - virtual uint16 maxRetransmits() const { return 0; } - virtual std::string protocol() const { return std::string(); } - virtual bool negotiated() const { return false; } - - virtual int id() const = 0; - virtual DataState state() const = 0; - // The buffered_amount returns the number of bytes of application data - // (UTF-8 text and binary data) that have been queued using SendBuffer but - // have not yet been transmitted to the network. - virtual uint64 buffered_amount() const = 0; - virtual void Close() = 0; - // Sends |data| to the remote peer. - virtual bool Send(const DataBuffer& buffer) = 0; - - protected: - virtual ~DataChannelInterface() {} -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_DATACHANNELINTERFACE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/dtmfsender.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/dtmfsender.h deleted file mode 100755 index e47dcf2..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/dtmfsender.h +++ /dev/null @@ -1,138 +0,0 @@ -/* - * 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_APP_WEBRTC_DTMFSENDER_H_ -#define TALK_APP_WEBRTC_DTMFSENDER_H_ - -#include - -#include "talk/app/webrtc/dtmfsenderinterface.h" -#include "talk/app/webrtc/mediastreaminterface.h" -#include "talk/app/webrtc/proxy.h" -#include "talk/base/common.h" -#include "talk/base/messagehandler.h" -#include "talk/base/refcount.h" - -// DtmfSender is the native implementation of the RTCDTMFSender defined by -// the WebRTC W3C Editor's Draft. -// http://dev.w3.org/2011/webrtc/editor/webrtc.html - -namespace talk_base { -class Thread; -} - -namespace webrtc { - -// This interface is called by DtmfSender to talk to the actual audio channel -// to send DTMF. -class DtmfProviderInterface { - public: - // Returns true if the audio track with given id (|track_id|) is capable - // of sending DTMF. Otherwise returns false. - virtual bool CanInsertDtmf(const std::string& track_id) = 0; - // Sends DTMF |code| via the audio track with given id (|track_id|). - // The |duration| indicates the length of the DTMF tone in ms. - // Returns true on success and false on failure. - virtual bool InsertDtmf(const std::string& track_id, - int code, int duration) = 0; - // Returns a |sigslot::signal0<>| signal. The signal should fire before - // the provider is destroyed. - virtual sigslot::signal0<>* GetOnDestroyedSignal() = 0; - - protected: - virtual ~DtmfProviderInterface() {} -}; - -class DtmfSender - : public DtmfSenderInterface, - public sigslot::has_slots<>, - public talk_base::MessageHandler { - public: - static talk_base::scoped_refptr Create( - AudioTrackInterface* track, - talk_base::Thread* signaling_thread, - DtmfProviderInterface* provider); - - // Implements DtmfSenderInterface. - virtual void RegisterObserver(DtmfSenderObserverInterface* observer) OVERRIDE; - virtual void UnregisterObserver() OVERRIDE; - virtual bool CanInsertDtmf() OVERRIDE; - virtual bool InsertDtmf(const std::string& tones, int duration, - int inter_tone_gap) OVERRIDE; - virtual const AudioTrackInterface* track() const OVERRIDE; - virtual std::string tones() const OVERRIDE; - virtual int duration() const OVERRIDE; - virtual int inter_tone_gap() const OVERRIDE; - - protected: - DtmfSender(AudioTrackInterface* track, - talk_base::Thread* signaling_thread, - DtmfProviderInterface* provider); - virtual ~DtmfSender(); - - private: - DtmfSender(); - - // Implements MessageHandler. - virtual void OnMessage(talk_base::Message* msg); - - // The DTMF sending task. - void DoInsertDtmf(); - - void OnProviderDestroyed(); - - void StopSending(); - - talk_base::scoped_refptr track_; - DtmfSenderObserverInterface* observer_; - talk_base::Thread* signaling_thread_; - DtmfProviderInterface* provider_; - std::string tones_; - int duration_; - int inter_tone_gap_; - - DISALLOW_COPY_AND_ASSIGN(DtmfSender); -}; - -// Define proxy for DtmfSenderInterface. -BEGIN_PROXY_MAP(DtmfSender) - PROXY_METHOD1(void, RegisterObserver, DtmfSenderObserverInterface*) - PROXY_METHOD0(void, UnregisterObserver) - PROXY_METHOD0(bool, CanInsertDtmf) - PROXY_METHOD3(bool, InsertDtmf, const std::string&, int, int) - PROXY_CONSTMETHOD0(const AudioTrackInterface*, track) - PROXY_CONSTMETHOD0(std::string, tones) - PROXY_CONSTMETHOD0(int, duration) - PROXY_CONSTMETHOD0(int, inter_tone_gap) -END_PROXY() - -// Get DTMF code from the DTMF event character. -bool GetDtmfCode(char tone, int* code); - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_DTMFSENDER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/dtmfsenderinterface.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/dtmfsenderinterface.h deleted file mode 100755 index bea6625..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/dtmfsenderinterface.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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_APP_WEBRTC_DTMFSENDERINTERFACE_H_ -#define TALK_APP_WEBRTC_DTMFSENDERINTERFACE_H_ - -#include - -#include "talk/app/webrtc/mediastreaminterface.h" -#include "talk/base/common.h" -#include "talk/base/refcount.h" - -// This file contains interfaces for DtmfSender. - -namespace webrtc { - -// DtmfSender callback interface. Application should implement this interface -// to get notifications from the DtmfSender. -class DtmfSenderObserverInterface { - public: - // Triggered when DTMF |tone| is sent. - // If |tone| is empty that means the DtmfSender has sent out all the given - // tones. - virtual void OnToneChange(const std::string& tone) = 0; - - protected: - virtual ~DtmfSenderObserverInterface() {} -}; - -// The interface of native implementation of the RTCDTMFSender defined by the -// WebRTC W3C Editor's Draft. -class DtmfSenderInterface : public talk_base::RefCountInterface { - public: - virtual void RegisterObserver(DtmfSenderObserverInterface* observer) = 0; - virtual void UnregisterObserver() = 0; - - // Returns true if this DtmfSender is capable of sending DTMF. - // Otherwise returns false. - virtual bool CanInsertDtmf() = 0; - - // Queues a task that sends the DTMF |tones|. The |tones| parameter is treated - // as a series of characters. The characters 0 through 9, A through D, #, and - // * generate the associated DTMF tones. The characters a to d are equivalent - // to A to D. The character ',' indicates a delay of 2 seconds before - // processing the next character in the tones parameter. - // Unrecognized characters are ignored. - // The |duration| parameter indicates the duration in ms to use for each - // character passed in the |tones| parameter. - // The duration cannot be more than 6000 or less than 70. - // The |inter_tone_gap| parameter indicates the gap between tones in ms. - // The |inter_tone_gap| must be at least 50 ms but should be as short as - // possible. - // If InsertDtmf is called on the same object while an existing task for this - // object to generate DTMF is still running, the previous task is canceled. - // Returns true on success and false on failure. - virtual bool InsertDtmf(const std::string& tones, int duration, - int inter_tone_gap) = 0; - - // Returns the track given as argument to the constructor. - virtual const AudioTrackInterface* track() const = 0; - - // Returns the tones remaining to be played out. - virtual std::string tones() const = 0; - - // Returns the current tone duration value in ms. - // This value will be the value last set via the InsertDtmf() method, or the - // default value of 100 ms if InsertDtmf() was never called. - virtual int duration() const = 0; - - // Returns the current value of the between-tone gap in ms. - // This value will be the value last set via the InsertDtmf() method, or the - // default value of 50 ms if InsertDtmf() was never called. - virtual int inter_tone_gap() const = 0; - - protected: - virtual ~DtmfSenderInterface() {} -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_DTMFSENDERINTERFACE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/fakeportallocatorfactory.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/fakeportallocatorfactory.h deleted file mode 100755 index 366f796..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/fakeportallocatorfactory.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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. - */ - -// This file defines a fake port allocator factory used for testing. -// This implementation creates instances of cricket::FakePortAllocator. - -#ifndef TALK_APP_WEBRTC_FAKEPORTALLOCATORFACTORY_H_ -#define TALK_APP_WEBRTC_FAKEPORTALLOCATORFACTORY_H_ - -#include "talk/app/webrtc/peerconnectioninterface.h" -#include "talk/p2p/client/fakeportallocator.h" - -namespace webrtc { - -class FakePortAllocatorFactory : public PortAllocatorFactoryInterface { - public: - static FakePortAllocatorFactory* Create() { - talk_base::RefCountedObject* allocator = - new talk_base::RefCountedObject(); - return allocator; - } - - virtual cricket::PortAllocator* CreatePortAllocator( - const std::vector& stun_configurations, - const std::vector& turn_configurations) { - stun_configs_ = stun_configurations; - turn_configs_ = turn_configurations; - return new cricket::FakePortAllocator(talk_base::Thread::Current(), NULL); - } - - const std::vector& stun_configs() const { - return stun_configs_; - } - - const std::vector& turn_configs() const { - return turn_configs_; - } - - protected: - FakePortAllocatorFactory() {} - ~FakePortAllocatorFactory() {} - - private: - std::vector stun_configs_; - std::vector turn_configs_; -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_FAKEPORTALLOCATORFACTORY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/jsep.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/jsep.h deleted file mode 100755 index cb06b48..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/jsep.h +++ /dev/null @@ -1,164 +0,0 @@ -/* - * 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. - */ - -// Interfaces matching the draft-ietf-rtcweb-jsep-01. - -#ifndef TALK_APP_WEBRTC_JSEP_H_ -#define TALK_APP_WEBRTC_JSEP_H_ - -#include -#include - -#include "talk/base/basictypes.h" -#include "talk/base/refcount.h" - -namespace cricket { -class SessionDescription; -class Candidate; -} // namespace cricket - -namespace webrtc { - -struct SdpParseError { - public: - // The sdp line that causes the error. - std::string line; - // Explains the error. - std::string description; -}; - -// Class representation of an ICE candidate. -// An instance of this interface is supposed to be owned by one class at -// a time and is therefore not expected to be thread safe. -class IceCandidateInterface { - public: - virtual ~IceCandidateInterface() {} - /// If present, this contains the identierfier of the "media stream - // identification" as defined in [RFC 3388] for m-line this candidate is - // assocated with. - virtual std::string sdp_mid() const = 0; - // This indeicates the index (starting at zero) of m-line in the SDP this - // candidate is assocated with. - virtual int sdp_mline_index() const = 0; - virtual const cricket::Candidate& candidate() const = 0; - // Creates a SDP-ized form of this candidate. - virtual bool ToString(std::string* out) const = 0; -}; - -// Creates a IceCandidateInterface based on SDP string. -// Returns NULL if the sdp string can't be parsed. -// TODO(ronghuawu): Deprecated. -IceCandidateInterface* CreateIceCandidate(const std::string& sdp_mid, - int sdp_mline_index, - const std::string& sdp); - -// |error| can be NULL if doesn't care about the failure reason. -IceCandidateInterface* CreateIceCandidate(const std::string& sdp_mid, - int sdp_mline_index, - const std::string& sdp, - SdpParseError* error); - -// This class represents a collection of candidates for a specific m-line. -// This class is used in SessionDescriptionInterface to represent all known -// candidates for a certain m-line. -class IceCandidateCollection { - public: - virtual ~IceCandidateCollection() {} - virtual size_t count() const = 0; - // Returns true if an equivalent |candidate| exist in the collection. - virtual bool HasCandidate(const IceCandidateInterface* candidate) const = 0; - virtual const IceCandidateInterface* at(size_t index) const = 0; -}; - -// Class representation of a Session description. -// An instance of this interface is supposed to be owned by one class at -// a time and is therefore not expected to be thread safe. -class SessionDescriptionInterface { - public: - // Supported types: - static const char kOffer[]; - static const char kPrAnswer[]; - static const char kAnswer[]; - - virtual ~SessionDescriptionInterface() {} - virtual cricket::SessionDescription* description() = 0; - virtual const cricket::SessionDescription* description() const = 0; - // Get the session id and session version, which are defined based on - // RFC 4566 for the SDP o= line. - virtual std::string session_id() const = 0; - virtual std::string session_version() const = 0; - virtual std::string type() const = 0; - // Adds the specified candidate to the description. - // Ownership is not transferred. - // Returns false if the session description does not have a media section that - // corresponds to the |candidate| label. - virtual bool AddCandidate(const IceCandidateInterface* candidate) = 0; - // Returns the number of m- lines in the session description. - virtual size_t number_of_mediasections() const = 0; - // Returns a collection of all candidates that belong to a certain m-line - virtual const IceCandidateCollection* candidates( - size_t mediasection_index) const = 0; - // Serializes the description to SDP. - virtual bool ToString(std::string* out) const = 0; -}; - -// Creates a SessionDescriptionInterface based on SDP string and the type. -// Returns NULL if the sdp string can't be parsed or the type is unsupported. -// TODO(ronghuawu): Deprecated. -SessionDescriptionInterface* CreateSessionDescription(const std::string& type, - const std::string& sdp); - -// |error| can be NULL if doesn't care about the failure reason. -SessionDescriptionInterface* CreateSessionDescription(const std::string& type, - const std::string& sdp, - SdpParseError* error); - -// Jsep CreateOffer and CreateAnswer callback interface. -class CreateSessionDescriptionObserver : public talk_base::RefCountInterface { - public: - // The implementation of the CreateSessionDescriptionObserver takes - // the ownership of the |desc|. - virtual void OnSuccess(SessionDescriptionInterface* desc) = 0; - virtual void OnFailure(const std::string& error) = 0; - - protected: - ~CreateSessionDescriptionObserver() {} -}; - -// Jsep SetLocalDescription and SetRemoteDescription callback interface. -class SetSessionDescriptionObserver : public talk_base::RefCountInterface { - public: - virtual void OnSuccess() = 0; - virtual void OnFailure(const std::string& error) = 0; - - protected: - ~SetSessionDescriptionObserver() {} -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_JSEP_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/jsepicecandidate.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/jsepicecandidate.h deleted file mode 100755 index 74bee11..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/jsepicecandidate.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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. - */ - -// Implements the IceCandidateInterface. - -#ifndef TALK_APP_WEBRTC_JSEPICECANDIDATE_H_ -#define TALK_APP_WEBRTC_JSEPICECANDIDATE_H_ - -#include - -#include "talk/app/webrtc/jsep.h" -#include "talk/base/constructormagic.h" -#include "talk/p2p/base/candidate.h" - -namespace webrtc { - -class JsepIceCandidate : public IceCandidateInterface { - public: - JsepIceCandidate(const std::string& sdp_mid, int sdp_mline_index); - JsepIceCandidate(const std::string& sdp_mid, int sdp_mline_index, - const cricket::Candidate& candidate); - ~JsepIceCandidate(); - // |error| can be NULL if don't care about the failure reason. - bool Initialize(const std::string& sdp, SdpParseError* err); - void SetCandidate(const cricket::Candidate& candidate) { - candidate_ = candidate; - } - - virtual std::string sdp_mid() const { return sdp_mid_; } - virtual int sdp_mline_index() const { return sdp_mline_index_; } - virtual const cricket::Candidate& candidate() const { - return candidate_; - } - - virtual bool ToString(std::string* out) const; - - private: - std::string sdp_mid_; - int sdp_mline_index_; - cricket::Candidate candidate_; - - DISALLOW_COPY_AND_ASSIGN(JsepIceCandidate); -}; - -// Implementation of IceCandidateCollection. -// This implementation stores JsepIceCandidates. -class JsepCandidateCollection : public IceCandidateCollection { - public: - ~JsepCandidateCollection(); - virtual size_t count() const { - return candidates_.size(); - } - virtual bool HasCandidate(const IceCandidateInterface* candidate) const; - // Adds and takes ownership of the JsepIceCandidate. - virtual void add(JsepIceCandidate* candidate) { - candidates_.push_back(candidate); - } - virtual const IceCandidateInterface* at(size_t index) const { - return candidates_[index]; - } - - private: - std::vector candidates_; -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_JSEPICECANDIDATE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/jsepsessiondescription.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/jsepsessiondescription.h deleted file mode 100755 index 767ae28..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/jsepsessiondescription.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * 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. - */ - -// Implements the SessionDescriptionInterface. - -#ifndef TALK_APP_WEBRTC_JSEPSESSIONDESCRIPTION_H_ -#define TALK_APP_WEBRTC_JSEPSESSIONDESCRIPTION_H_ - -#include -#include - -#include "talk/app/webrtc/jsep.h" -#include "talk/app/webrtc/jsepicecandidate.h" -#include "talk/base/scoped_ptr.h" - -namespace cricket { -class SessionDescription; -} - -namespace webrtc { - -class JsepSessionDescription : public SessionDescriptionInterface { - public: - explicit JsepSessionDescription(const std::string& type); - virtual ~JsepSessionDescription(); - - // |error| can be NULL if don't care about the failure reason. - bool Initialize(const std::string& sdp, SdpParseError* error); - - // Takes ownership of |description|. - bool Initialize(cricket::SessionDescription* description, - const std::string& session_id, - const std::string& session_version); - - virtual cricket::SessionDescription* description() { - return description_.get(); - } - virtual const cricket::SessionDescription* description() const { - return description_.get(); - } - virtual std::string session_id() const { - return session_id_; - } - virtual std::string session_version() const { - return session_version_; - } - virtual std::string type() const { - return type_; - } - // Allow changing the type. Used for testing. - void set_type(const std::string& type) { type_ = type; } - virtual bool AddCandidate(const IceCandidateInterface* candidate); - virtual size_t number_of_mediasections() const; - virtual const IceCandidateCollection* candidates( - size_t mediasection_index) const; - virtual bool ToString(std::string* out) const; - - // Default video encoder settings. The resolution is the max resolution. - // TODO(perkj): Implement proper negotiation of video resolution. - static const int kDefaultVideoCodecId; - static const int kDefaultVideoCodecFramerate; - static const char kDefaultVideoCodecName[]; - static const int kMaxVideoCodecWidth; - static const int kMaxVideoCodecHeight; - static const int kDefaultVideoCodecPreference; - - private: - talk_base::scoped_ptr description_; - std::string session_id_; - std::string session_version_; - std::string type_; - std::vector candidate_collection_; - - bool GetMediasectionIndex(const IceCandidateInterface* candidate, - size_t* index); - - DISALLOW_COPY_AND_ASSIGN(JsepSessionDescription); -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_JSEPSESSIONDESCRIPTION_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/localaudiosource.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/localaudiosource.h deleted file mode 100755 index 5296633..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/localaudiosource.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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_APP_WEBRTC_LOCALAUDIOSOURCE_H_ -#define TALK_APP_WEBRTC_LOCALAUDIOSOURCE_H_ - -#include "talk/app/webrtc/mediastreaminterface.h" -#include "talk/app/webrtc/notifier.h" -#include "talk/app/webrtc/peerconnectioninterface.h" -#include "talk/base/scoped_ptr.h" -#include "talk/media/base/mediachannel.h" - -// LocalAudioSource implements AudioSourceInterface. -// This contains settings for switching audio processing on and off. - -namespace webrtc { - -class MediaConstraintsInterface; - -class LocalAudioSource : public Notifier { - public: - // Creates an instance of LocalAudioSource. - static talk_base::scoped_refptr Create( - const PeerConnectionFactoryInterface::Options& options, - const MediaConstraintsInterface* constraints); - - virtual SourceState state() const { return source_state_; } - virtual const cricket::AudioOptions& options() const { return options_; } - - protected: - LocalAudioSource() - : source_state_(kInitializing) { - } - - ~LocalAudioSource() { - } - - private: - void Initialize(const PeerConnectionFactoryInterface::Options& options, - const MediaConstraintsInterface* constraints); - - cricket::AudioOptions options_; - SourceState source_state_; -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_LOCALAUDIOSOURCE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediaconstraintsinterface.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediaconstraintsinterface.h deleted file mode 100755 index 097a555..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediaconstraintsinterface.h +++ /dev/null @@ -1,145 +0,0 @@ -/* - * libjingle - * Copyright 2013, 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. - */ - -// This file contains the interface for MediaConstraints, corresponding to -// the definition at -// http://www.w3.org/TR/mediacapture-streams/#mediastreamconstraints and also -// used in WebRTC: http://dev.w3.org/2011/webrtc/editor/webrtc.html#constraints. - -#ifndef TALK_APP_WEBRTC_MEDIACONSTRAINTSINTERFACE_H_ -#define TALK_APP_WEBRTC_MEDIACONSTRAINTSINTERFACE_H_ - -#include -#include - -namespace webrtc { - -// MediaConstraintsInterface -// Interface used for passing arguments about media constraints -// to the MediaStream and PeerConnection implementation. -class MediaConstraintsInterface { - public: - struct Constraint { - Constraint() {} - Constraint(const std::string& key, const std::string value) - : key(key), value(value) { - } - std::string key; - std::string value; - }; - - class Constraints : public std::vector { - public: - bool FindFirst(const std::string& key, std::string* value) const; - }; - - virtual const Constraints& GetMandatory() const = 0; - virtual const Constraints& GetOptional() const = 0; - - // Constraint keys used by a local video source. - // Specified by draft-alvestrand-constraints-resolution-00b - static const char kMinAspectRatio[]; // minAspectRatio - static const char kMaxAspectRatio[]; // maxAspectRatio - static const char kMaxWidth[]; // maxWidth - static const char kMinWidth[]; // minWidth - static const char kMaxHeight[]; // maxHeight - static const char kMinHeight[]; // minHeight - static const char kMaxFrameRate[]; // maxFrameRate - static const char kMinFrameRate[]; // minFrameRate - - // Constraint keys used by a local audio source. - // These keys are google specific. - static const char kEchoCancellation[]; // googEchoCancellation - static const char kExperimentalEchoCancellation[]; // googEchoCancellation2 - static const char kAutoGainControl[]; // googAutoGainControl - static const char kExperimentalAutoGainControl[]; // googAutoGainControl2 - static const char kNoiseSuppression[]; // googNoiseSuppression - static const char kExperimentalNoiseSuppression[]; // googNoiseSuppression2 - static const char kHighpassFilter[]; // googHighpassFilter - static const char kTypingNoiseDetection[]; // googTypingNoiseDetection - static const char kAudioMirroring[]; // googAudioMirroring - - // Google-specific constraint keys for a local video source - static const char kNoiseReduction[]; // googNoiseReduction - static const char kLeakyBucket[]; // googLeakyBucket - static const char kTemporalLayeredScreencast[]; - // googTemporalLayeredScreencast - - // Constraint keys for CreateOffer / CreateAnswer - // Specified by the W3C PeerConnection spec - static const char kOfferToReceiveVideo[]; // OfferToReceiveVideo - static const char kOfferToReceiveAudio[]; // OfferToReceiveAudio - static const char kVoiceActivityDetection[]; // VoiceActivityDetection - static const char kIceRestart[]; // IceRestart - // These keys are google specific. - static const char kUseRtpMux[]; // googUseRtpMUX - - // Constraints values. - static const char kValueTrue[]; // true - static const char kValueFalse[]; // false - - // PeerConnection constraint keys. - // Temporary pseudo-constraints used to enable DTLS-SRTP - static const char kEnableDtlsSrtp[]; // Enable DTLS-SRTP - // Temporary pseudo-constraints used to enable DataChannels - static const char kEnableRtpDataChannels[]; // Enable RTP DataChannels - // Google-specific constraint keys. - // Temporary pseudo-constraint for enabling DSCP through JS. - static const char kEnableDscp[]; // googDscp - // Constraint to enable IPv6 through JS. - static const char kEnableIPv6[]; // googIPv6 - // Temporary constraint to enable suspend below min bitrate feature. - static const char kEnableVideoSuspendBelowMinBitrate[]; - // googSuspendBelowMinBitrate - static const char kImprovedWifiBwe[]; // googImprovedWifiBwe - static const char kScreencastMinBitrate[]; // googScreencastMinBitrate - static const char kSkipEncodingUnusedStreams[]; - // googSkipEncodingUnusedStreams - static const char kCpuOveruseDetection[]; // googCpuOveruseDetection - static const char kCpuUnderuseThreshold[]; // googCpuUnderuseThreshold - static const char kCpuOveruseThreshold[]; // googCpuOveruseThreshold - static const char kCpuOveruseEncodeUsage[]; // googCpuOveruseEncodeUsage - static const char kHighStartBitrate[]; // googHighStartBitrate - static const char kHighBitrate[]; // googHighBitrate - static const char kVeryHighBitrate[]; // googVeryHighBitrate - - // The prefix of internal-only constraints whose JS set values should be - // stripped by Chrome before passed down to Libjingle. - static const char kInternalConstraintPrefix[]; - - protected: - // Dtor protected as objects shouldn't be deleted via this interface - virtual ~MediaConstraintsInterface() {} -}; - -bool FindConstraint(const MediaConstraintsInterface* constraints, - const std::string& key, bool* value, - size_t* mandatory_constraints); - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_MEDIACONSTRAINTSINTERFACE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediastream.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediastream.h deleted file mode 100755 index 3d53221..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediastream.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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. - */ - -// This file contains the implementation of MediaStreamInterface interface. - -#ifndef TALK_APP_WEBRTC_MEDIASTREAM_H_ -#define TALK_APP_WEBRTC_MEDIASTREAM_H_ - -#include -#include - -#include "talk/app/webrtc/mediastreaminterface.h" -#include "talk/app/webrtc/notifier.h" - -namespace webrtc { - -class MediaStream : public Notifier { - public: - static talk_base::scoped_refptr Create(const std::string& label); - - virtual std::string label() const OVERRIDE { return label_; } - - virtual bool AddTrack(AudioTrackInterface* track) OVERRIDE; - virtual bool AddTrack(VideoTrackInterface* track) OVERRIDE; - virtual bool RemoveTrack(AudioTrackInterface* track) OVERRIDE; - virtual bool RemoveTrack(VideoTrackInterface* track) OVERRIDE; - virtual talk_base::scoped_refptr - FindAudioTrack(const std::string& track_id); - virtual talk_base::scoped_refptr - FindVideoTrack(const std::string& track_id); - - virtual AudioTrackVector GetAudioTracks() OVERRIDE { return audio_tracks_; } - virtual VideoTrackVector GetVideoTracks() OVERRIDE { return video_tracks_; } - - protected: - explicit MediaStream(const std::string& label); - - private: - template - bool AddTrack(TrackVector* Tracks, Track* track); - template - bool RemoveTrack(TrackVector* Tracks, MediaStreamTrackInterface* track); - - std::string label_; - AudioTrackVector audio_tracks_; - VideoTrackVector video_tracks_; -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_MEDIASTREAM_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediastreamhandler.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediastreamhandler.h deleted file mode 100755 index 0345152..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediastreamhandler.h +++ /dev/null @@ -1,295 +0,0 @@ -/* - * 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. - */ - -// This file contains classes for listening on changes on MediaStreams and -// MediaTracks that are connected to a certain PeerConnection. -// Example: If a user sets a rendererer on a remote video track the renderer is -// connected to the appropriate remote video stream. - -#ifndef TALK_APP_WEBRTC_MEDIASTREAMHANDLER_H_ -#define TALK_APP_WEBRTC_MEDIASTREAMHANDLER_H_ - -#include -#include - -#include "talk/app/webrtc/mediastreaminterface.h" -#include "talk/app/webrtc/mediastreamprovider.h" -#include "talk/app/webrtc/peerconnectioninterface.h" -#include "talk/base/thread.h" -#include "talk/media/base/audiorenderer.h" - -namespace webrtc { - -// TrackHandler listen to events on a MediaStreamTrackInterface that is -// connected to a certain PeerConnection. -class TrackHandler : public ObserverInterface { - public: - TrackHandler(MediaStreamTrackInterface* track, uint32 ssrc); - virtual ~TrackHandler(); - virtual void OnChanged(); - // Stop using |track_| on this PeerConnection. - virtual void Stop() = 0; - - MediaStreamTrackInterface* track() { return track_; } - uint32 ssrc() const { return ssrc_; } - - protected: - virtual void OnStateChanged() = 0; - virtual void OnEnabledChanged() = 0; - - private: - talk_base::scoped_refptr track_; - uint32 ssrc_; - MediaStreamTrackInterface::TrackState state_; - bool enabled_; -}; - -// LocalAudioSinkAdapter receives data callback as a sink to the local -// AudioTrack, and passes the data to the sink of AudioRenderer. -class LocalAudioSinkAdapter : public AudioTrackSinkInterface, - public cricket::AudioRenderer { - public: - LocalAudioSinkAdapter(); - virtual ~LocalAudioSinkAdapter(); - - private: - // AudioSinkInterface implementation. - virtual void OnData(const void* audio_data, int bits_per_sample, - int sample_rate, int number_of_channels, - int number_of_frames) OVERRIDE; - - // cricket::AudioRenderer implementation. - virtual void SetSink(cricket::AudioRenderer::Sink* sink) OVERRIDE; - - cricket::AudioRenderer::Sink* sink_; - // Critical section protecting |sink_|. - talk_base::CriticalSection lock_; -}; - -// LocalAudioTrackHandler listen to events on a local AudioTrack instance -// connected to a PeerConnection and orders the |provider| to executes the -// requested change. -class LocalAudioTrackHandler : public TrackHandler { - public: - LocalAudioTrackHandler(AudioTrackInterface* track, - uint32 ssrc, - AudioProviderInterface* provider); - virtual ~LocalAudioTrackHandler(); - - virtual void Stop() OVERRIDE; - - protected: - virtual void OnStateChanged() OVERRIDE; - virtual void OnEnabledChanged() OVERRIDE; - - private: - AudioTrackInterface* audio_track_; - AudioProviderInterface* provider_; - - // Used to pass the data callback from the |audio_track_| to the other - // end of cricket::AudioRenderer. - talk_base::scoped_ptr sink_adapter_; -}; - -// RemoteAudioTrackHandler listen to events on a remote AudioTrack instance -// connected to a PeerConnection and orders the |provider| to executes the -// requested change. -class RemoteAudioTrackHandler : public AudioSourceInterface::AudioObserver, - public TrackHandler { - public: - RemoteAudioTrackHandler(AudioTrackInterface* track, - uint32 ssrc, - AudioProviderInterface* provider); - virtual ~RemoteAudioTrackHandler(); - virtual void Stop() OVERRIDE; - - protected: - virtual void OnStateChanged() OVERRIDE; - virtual void OnEnabledChanged() OVERRIDE; - - private: - // AudioSourceInterface::AudioObserver implementation. - virtual void OnSetVolume(double volume) OVERRIDE; - - AudioTrackInterface* audio_track_; - AudioProviderInterface* provider_; -}; - -// LocalVideoTrackHandler listen to events on a local VideoTrack instance -// connected to a PeerConnection and orders the |provider| to executes the -// requested change. -class LocalVideoTrackHandler : public TrackHandler { - public: - LocalVideoTrackHandler(VideoTrackInterface* track, - uint32 ssrc, - VideoProviderInterface* provider); - virtual ~LocalVideoTrackHandler(); - virtual void Stop() OVERRIDE; - - protected: - virtual void OnStateChanged() OVERRIDE; - virtual void OnEnabledChanged() OVERRIDE; - - private: - VideoTrackInterface* local_video_track_; - VideoProviderInterface* provider_; -}; - -// RemoteVideoTrackHandler listen to events on a remote VideoTrack instance -// connected to a PeerConnection and orders the |provider| to execute -// requested changes. -class RemoteVideoTrackHandler : public TrackHandler { - public: - RemoteVideoTrackHandler(VideoTrackInterface* track, - uint32 ssrc, - VideoProviderInterface* provider); - virtual ~RemoteVideoTrackHandler(); - virtual void Stop() OVERRIDE; - - protected: - virtual void OnStateChanged() OVERRIDE; - virtual void OnEnabledChanged() OVERRIDE; - - private: - VideoTrackInterface* remote_video_track_; - VideoProviderInterface* provider_; -}; - -class MediaStreamHandler : public ObserverInterface { - public: - MediaStreamHandler(MediaStreamInterface* stream, - AudioProviderInterface* audio_provider, - VideoProviderInterface* video_provider); - ~MediaStreamHandler(); - MediaStreamInterface* stream(); - void Stop(); - - virtual void AddAudioTrack(AudioTrackInterface* audio_track, uint32 ssrc) = 0; - virtual void AddVideoTrack(VideoTrackInterface* video_track, uint32 ssrc) = 0; - - virtual void RemoveTrack(MediaStreamTrackInterface* track); - virtual void OnChanged() OVERRIDE; - - protected: - TrackHandler* FindTrackHandler(MediaStreamTrackInterface* track); - talk_base::scoped_refptr stream_; - AudioProviderInterface* audio_provider_; - VideoProviderInterface* video_provider_; - typedef std::vector TrackHandlers; - TrackHandlers track_handlers_; -}; - -class LocalMediaStreamHandler : public MediaStreamHandler { - public: - LocalMediaStreamHandler(MediaStreamInterface* stream, - AudioProviderInterface* audio_provider, - VideoProviderInterface* video_provider); - ~LocalMediaStreamHandler(); - - virtual void AddAudioTrack(AudioTrackInterface* audio_track, - uint32 ssrc) OVERRIDE; - virtual void AddVideoTrack(VideoTrackInterface* video_track, - uint32 ssrc) OVERRIDE; -}; - -class RemoteMediaStreamHandler : public MediaStreamHandler { - public: - RemoteMediaStreamHandler(MediaStreamInterface* stream, - AudioProviderInterface* audio_provider, - VideoProviderInterface* video_provider); - ~RemoteMediaStreamHandler(); - virtual void AddAudioTrack(AudioTrackInterface* audio_track, - uint32 ssrc) OVERRIDE; - virtual void AddVideoTrack(VideoTrackInterface* video_track, - uint32 ssrc) OVERRIDE; -}; - -// Container for MediaStreamHandlers of currently known local and remote -// MediaStreams. -class MediaStreamHandlerContainer { - public: - MediaStreamHandlerContainer(AudioProviderInterface* audio_provider, - VideoProviderInterface* video_provider); - ~MediaStreamHandlerContainer(); - - // Notify all referenced objects that MediaStreamHandlerContainer will be - // destroyed. This method must be called prior to the dtor and prior to the - // |audio_provider| and |video_provider| is destroyed. - void TearDown(); - - // Remove all TrackHandlers for tracks in |stream| and make sure - // the audio_provider and video_provider is notified that the tracks has been - // removed. - void RemoveRemoteStream(MediaStreamInterface* stream); - - // Create a RemoteAudioTrackHandler and associate |audio_track| with |ssrc|. - void AddRemoteAudioTrack(MediaStreamInterface* stream, - AudioTrackInterface* audio_track, - uint32 ssrc); - // Create a RemoteVideoTrackHandler and associate |video_track| with |ssrc|. - void AddRemoteVideoTrack(MediaStreamInterface* stream, - VideoTrackInterface* video_track, - uint32 ssrc); - // Remove the TrackHandler for |track|. - void RemoveRemoteTrack(MediaStreamInterface* stream, - MediaStreamTrackInterface* track); - - // Remove all TrackHandlers for tracks in |stream| and make sure - // the audio_provider and video_provider is notified that the tracks has been - // removed. - void RemoveLocalStream(MediaStreamInterface* stream); - - // Create a LocalAudioTrackHandler and associate |audio_track| with |ssrc|. - void AddLocalAudioTrack(MediaStreamInterface* stream, - AudioTrackInterface* audio_track, - uint32 ssrc); - // Create a LocalVideoTrackHandler and associate |video_track| with |ssrc|. - void AddLocalVideoTrack(MediaStreamInterface* stream, - VideoTrackInterface* video_track, - uint32 ssrc); - // Remove the TrackHandler for |track|. - void RemoveLocalTrack(MediaStreamInterface* stream, - MediaStreamTrackInterface* track); - - private: - typedef std::list StreamHandlerList; - MediaStreamHandler* FindStreamHandler(const StreamHandlerList& handlers, - MediaStreamInterface* stream); - MediaStreamHandler* CreateRemoteStreamHandler(MediaStreamInterface* stream); - MediaStreamHandler* CreateLocalStreamHandler(MediaStreamInterface* stream); - void DeleteStreamHandler(StreamHandlerList* streamhandlers, - MediaStreamInterface* stream); - - StreamHandlerList local_streams_handlers_; - StreamHandlerList remote_streams_handlers_; - AudioProviderInterface* audio_provider_; - VideoProviderInterface* video_provider_; -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_MEDIASTREAMHANDLER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediastreaminterface.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediastreaminterface.h deleted file mode 100755 index 86e97f3..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediastreaminterface.h +++ /dev/null @@ -1,264 +0,0 @@ -/* - * 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. - */ - -// This file contains interfaces for MediaStream, MediaTrack and MediaSource. -// These interfaces are used for implementing MediaStream and MediaTrack as -// defined in http://dev.w3.org/2011/webrtc/editor/webrtc.html#stream-api. These -// interfaces must be used only with PeerConnection. PeerConnectionManager -// interface provides the factory methods to create MediaStream and MediaTracks. - -#ifndef TALK_APP_WEBRTC_MEDIASTREAMINTERFACE_H_ -#define TALK_APP_WEBRTC_MEDIASTREAMINTERFACE_H_ - -#include -#include - -#include "talk/base/basictypes.h" -#include "talk/base/refcount.h" -#include "talk/base/scoped_ref_ptr.h" - -namespace cricket { - -class AudioRenderer; -class VideoCapturer; -class VideoRenderer; -class VideoFrame; - -} // namespace cricket - -namespace webrtc { - -// Generic observer interface. -class ObserverInterface { - public: - virtual void OnChanged() = 0; - - protected: - virtual ~ObserverInterface() {} -}; - -class NotifierInterface { - public: - virtual void RegisterObserver(ObserverInterface* observer) = 0; - virtual void UnregisterObserver(ObserverInterface* observer) = 0; - - virtual ~NotifierInterface() {} -}; - -// Base class for sources. A MediaStreamTrack have an underlying source that -// provide media. A source can be shared with multiple tracks. -// TODO(perkj): Implement sources for local and remote audio tracks and -// remote video tracks. -class MediaSourceInterface : public talk_base::RefCountInterface, - public NotifierInterface { - public: - enum SourceState { - kInitializing, - kLive, - kEnded, - kMuted - }; - - virtual SourceState state() const = 0; - - protected: - virtual ~MediaSourceInterface() {} -}; - -// Information about a track. -class MediaStreamTrackInterface : public talk_base::RefCountInterface, - public NotifierInterface { - public: - enum TrackState { - kInitializing, // Track is beeing negotiated. - kLive = 1, // Track alive - kEnded = 2, // Track have ended - kFailed = 3, // Track negotiation failed. - }; - - virtual std::string kind() const = 0; - virtual std::string id() const = 0; - virtual bool enabled() const = 0; - virtual TrackState state() const = 0; - virtual bool set_enabled(bool enable) = 0; - // These methods should be called by implementation only. - virtual bool set_state(TrackState new_state) = 0; - - protected: - virtual ~MediaStreamTrackInterface() {} -}; - -// Interface for rendering VideoFrames from a VideoTrack -class VideoRendererInterface { - public: - virtual void SetSize(int width, int height) = 0; - virtual void RenderFrame(const cricket::VideoFrame* frame) = 0; - - protected: - // The destructor is protected to prevent deletion via the interface. - // This is so that we allow reference counted classes, where the destructor - // should never be public, to implement the interface. - virtual ~VideoRendererInterface() {} -}; - -class VideoSourceInterface; - -class VideoTrackInterface : public MediaStreamTrackInterface { - public: - // Register a renderer that will render all frames received on this track. - virtual void AddRenderer(VideoRendererInterface* renderer) = 0; - // Deregister a renderer. - virtual void RemoveRenderer(VideoRendererInterface* renderer) = 0; - - virtual VideoSourceInterface* GetSource() const = 0; - - protected: - virtual ~VideoTrackInterface() {} -}; - -// AudioSourceInterface is a reference counted source used for AudioTracks. -// The same source can be used in multiple AudioTracks. -class AudioSourceInterface : public MediaSourceInterface { - public: - class AudioObserver { - public: - virtual void OnSetVolume(double volume) = 0; - - protected: - virtual ~AudioObserver() {} - }; - - // TODO(xians): Makes all the interface pure virtual after Chrome has their - // implementations. - // Sets the volume to the source. |volume| is in the range of [0, 10]. - virtual void SetVolume(double volume) {} - - // Registers/unregisters observer to the audio source. - virtual void RegisterAudioObserver(AudioObserver* observer) {} - virtual void UnregisterAudioObserver(AudioObserver* observer) {} -}; - -// Interface for receiving audio data from a AudioTrack. -class AudioTrackSinkInterface { - public: - virtual void OnData(const void* audio_data, - int bits_per_sample, - int sample_rate, - int number_of_channels, - int number_of_frames) = 0; - protected: - virtual ~AudioTrackSinkInterface() {} -}; - -// Interface of the audio processor used by the audio track to collect -// statistics. -class AudioProcessorInterface : public talk_base::RefCountInterface { - public: - struct AudioProcessorStats { - AudioProcessorStats() : typing_noise_detected(false), - echo_return_loss(0), - echo_return_loss_enhancement(0), - echo_delay_median_ms(0), - aec_quality_min(0.0), - echo_delay_std_ms(0) {} - ~AudioProcessorStats() {} - - bool typing_noise_detected; - int echo_return_loss; - int echo_return_loss_enhancement; - int echo_delay_median_ms; - float aec_quality_min; - int echo_delay_std_ms; - }; - - // Get audio processor statistics. - virtual void GetStats(AudioProcessorStats* stats) = 0; - - protected: - virtual ~AudioProcessorInterface() {} -}; - -class AudioTrackInterface : public MediaStreamTrackInterface { - public: - // TODO(xians): Figure out if the following interface should be const or not. - virtual AudioSourceInterface* GetSource() const = 0; - - // Add/Remove a sink that will receive the audio data from the track. - virtual void AddSink(AudioTrackSinkInterface* sink) = 0; - virtual void RemoveSink(AudioTrackSinkInterface* sink) = 0; - - // Get the signal level from the audio track. - // Return true on success, otherwise false. - // TODO(xians): Change the interface to int GetSignalLevel() and pure virtual - // after Chrome has the correct implementation of the interface. - virtual bool GetSignalLevel(int* level) { return false; } - - // Get the audio processor used by the audio track. Return NULL if the track - // does not have any processor. - // TODO(xians): Make the interface pure virtual. - virtual talk_base::scoped_refptr - GetAudioProcessor() { return NULL; } - - // Get a pointer to the audio renderer of this AudioTrack. - // The pointer is valid for the lifetime of this AudioTrack. - // TODO(xians): Remove the following interface after Chrome switches to - // AddSink() and RemoveSink() interfaces. - virtual cricket::AudioRenderer* GetRenderer() { return NULL; } - - protected: - virtual ~AudioTrackInterface() {} -}; - -typedef std::vector > - AudioTrackVector; -typedef std::vector > - VideoTrackVector; - -class MediaStreamInterface : public talk_base::RefCountInterface, - public NotifierInterface { - public: - virtual std::string label() const = 0; - - virtual AudioTrackVector GetAudioTracks() = 0; - virtual VideoTrackVector GetVideoTracks() = 0; - virtual talk_base::scoped_refptr - FindAudioTrack(const std::string& track_id) = 0; - virtual talk_base::scoped_refptr - FindVideoTrack(const std::string& track_id) = 0; - - virtual bool AddTrack(AudioTrackInterface* track) = 0; - virtual bool AddTrack(VideoTrackInterface* track) = 0; - virtual bool RemoveTrack(AudioTrackInterface* track) = 0; - virtual bool RemoveTrack(VideoTrackInterface* track) = 0; - - protected: - virtual ~MediaStreamInterface() {} -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_MEDIASTREAMINTERFACE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediastreamprovider.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediastreamprovider.h deleted file mode 100755 index 53de16e..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediastreamprovider.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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_APP_WEBRTC_MEDIASTREAMPROVIDER_H_ -#define TALK_APP_WEBRTC_MEDIASTREAMPROVIDER_H_ - -namespace cricket { - -class AudioRenderer; -class VideoCapturer; -class VideoRenderer; -struct AudioOptions; -struct VideoOptions; - -} // namespace cricket - -namespace webrtc { - -// This interface is called by AudioTrackHandler classes in mediastreamhandler.h -// to change the settings of an audio track connected to certain PeerConnection. -class AudioProviderInterface { - public: - // Enable/disable the audio playout of a remote audio track with |ssrc|. - virtual void SetAudioPlayout(uint32 ssrc, bool enable, - cricket::AudioRenderer* renderer) = 0; - // Enable/disable sending audio on the local audio track with |ssrc|. - // When |enable| is true |options| should be applied to the audio track. - virtual void SetAudioSend(uint32 ssrc, bool enable, - const cricket::AudioOptions& options, - cricket::AudioRenderer* renderer) = 0; - - // Sets the audio playout volume of a remote audio track with |ssrc|. - // |volume| is in the range of [0, 10]. - virtual void SetAudioPlayoutVolume(uint32 ssrc, double volume) = 0; - - protected: - virtual ~AudioProviderInterface() {} -}; - -// This interface is called by VideoTrackHandler classes in mediastreamhandler.h -// to change the settings of a video track connected to a certain -// PeerConnection. -class VideoProviderInterface { - public: - virtual bool SetCaptureDevice(uint32 ssrc, - cricket::VideoCapturer* camera) = 0; - // Enable/disable the video playout of a remote video track with |ssrc|. - virtual void SetVideoPlayout(uint32 ssrc, bool enable, - cricket::VideoRenderer* renderer) = 0; - // Enable sending video on the local video track with |ssrc|. - virtual void SetVideoSend(uint32 ssrc, bool enable, - const cricket::VideoOptions* options) = 0; - - protected: - virtual ~VideoProviderInterface() {} -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_MEDIASTREAMPROVIDER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediastreamproxy.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediastreamproxy.h deleted file mode 100755 index c1e3728..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediastreamproxy.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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_MEDIASTREAMPROXY_H_ -#define TALK_APP_WEBRTC_MEDIASTREAMPROXY_H_ - -#include "talk/app/webrtc/mediastreaminterface.h" -#include "talk/app/webrtc/proxy.h" - -namespace webrtc { - -BEGIN_PROXY_MAP(MediaStream) - PROXY_CONSTMETHOD0(std::string, label) - PROXY_METHOD0(AudioTrackVector, GetAudioTracks) - PROXY_METHOD0(VideoTrackVector, GetVideoTracks) - PROXY_METHOD1(talk_base::scoped_refptr, - FindAudioTrack, const std::string&) - PROXY_METHOD1(talk_base::scoped_refptr, - FindVideoTrack, const std::string&) - PROXY_METHOD1(bool, AddTrack, AudioTrackInterface*) - PROXY_METHOD1(bool, AddTrack, VideoTrackInterface*) - PROXY_METHOD1(bool, RemoveTrack, AudioTrackInterface*) - PROXY_METHOD1(bool, RemoveTrack, VideoTrackInterface*) - PROXY_METHOD1(void, RegisterObserver, ObserverInterface*) - PROXY_METHOD1(void, UnregisterObserver, ObserverInterface*) -END_PROXY() - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_MEDIASTREAMPROXY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediastreamsignaling.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediastreamsignaling.h deleted file mode 100755 index 9c3b25d..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediastreamsignaling.h +++ /dev/null @@ -1,397 +0,0 @@ -/* - * 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_APP_WEBRTC_MEDIASTREAMSIGNALING_H_ -#define TALK_APP_WEBRTC_MEDIASTREAMSIGNALING_H_ - -#include -#include -#include - -#include "talk/app/webrtc/datachannel.h" -#include "talk/app/webrtc/mediastream.h" -#include "talk/app/webrtc/peerconnectioninterface.h" -#include "talk/app/webrtc/streamcollection.h" -#include "talk/base/scoped_ref_ptr.h" -#include "talk/session/media/mediasession.h" - -namespace talk_base { -class Thread; -} // namespace talk_base - -namespace webrtc { - -class RemoteMediaStreamFactory; - -// A MediaStreamSignalingObserver is notified when events happen to -// MediaStreams, MediaStreamTracks or DataChannels associated with the observed -// MediaStreamSignaling object. The notifications identify the stream, track or -// channel. -class MediaStreamSignalingObserver { - public: - // Triggered when the remote SessionDescription has a new stream. - virtual void OnAddRemoteStream(MediaStreamInterface* stream) = 0; - - // Triggered when the remote SessionDescription removes a stream. - virtual void OnRemoveRemoteStream(MediaStreamInterface* stream) = 0; - - // Triggered when the remote SessionDescription has a new data channel. - virtual void OnAddDataChannel(DataChannelInterface* data_channel) = 0; - - // Triggered when the remote SessionDescription has a new audio track. - virtual void OnAddRemoteAudioTrack(MediaStreamInterface* stream, - AudioTrackInterface* audio_track, - uint32 ssrc) = 0; - - // Triggered when the remote SessionDescription has a new video track. - virtual void OnAddRemoteVideoTrack(MediaStreamInterface* stream, - VideoTrackInterface* video_track, - uint32 ssrc) = 0; - - // Triggered when the remote SessionDescription has removed an audio track. - virtual void OnRemoveRemoteAudioTrack(MediaStreamInterface* stream, - AudioTrackInterface* audio_track) = 0; - - // Triggered when the remote SessionDescription has removed a video track. - virtual void OnRemoveRemoteVideoTrack(MediaStreamInterface* stream, - VideoTrackInterface* video_track) = 0; - - // Triggered when the local SessionDescription has a new audio track. - virtual void OnAddLocalAudioTrack(MediaStreamInterface* stream, - AudioTrackInterface* audio_track, - uint32 ssrc) = 0; - - // Triggered when the local SessionDescription has a new video track. - virtual void OnAddLocalVideoTrack(MediaStreamInterface* stream, - VideoTrackInterface* video_track, - uint32 ssrc) = 0; - - // Triggered when the local SessionDescription has removed an audio track. - virtual void OnRemoveLocalAudioTrack(MediaStreamInterface* stream, - AudioTrackInterface* audio_track, - uint32 ssrc) = 0; - - // Triggered when the local SessionDescription has removed a video track. - virtual void OnRemoveLocalVideoTrack(MediaStreamInterface* stream, - VideoTrackInterface* video_track) = 0; - - // Triggered when RemoveLocalStream is called. |stream| is no longer used - // when negotiating and all tracks in |stream| should stop providing data to - // this PeerConnection. This doesn't mean that the local session description - // has changed and OnRemoveLocalAudioTrack and OnRemoveLocalVideoTrack is not - // called for each individual track. - virtual void OnRemoveLocalStream(MediaStreamInterface* stream) = 0; - - protected: - ~MediaStreamSignalingObserver() {} -}; - -// MediaStreamSignaling works as a glue between MediaStreams and a cricket -// classes for SessionDescriptions. -// It is used for creating cricket::MediaSessionOptions given the local -// MediaStreams and data channels. -// -// It is responsible for creating remote MediaStreams given a remote -// SessionDescription and creating cricket::MediaSessionOptions given -// local MediaStreams. -// -// To signal that a DataChannel should be established: -// 1. Call AddDataChannel with the new DataChannel. Next time -// GetMediaSessionOptions will include the description of the DataChannel. -// 2. When a local session description is set, call UpdateLocalStreams with the -// session description. This will set the SSRC used for sending data on -// this DataChannel. -// 3. When remote session description is set, call UpdateRemoteStream with the -// session description. If the DataChannel label and a SSRC is included in -// the description, the DataChannel is updated with SSRC that will be used -// for receiving data. -// 4. When both the local and remote SSRC of a DataChannel is set the state of -// the DataChannel change to kOpen. -// -// To setup a DataChannel initialized by the remote end. -// 1. When remote session description is set, call UpdateRemoteStream with the -// session description. If a label and a SSRC of a new DataChannel is found -// MediaStreamSignalingObserver::OnAddDataChannel with the label and SSRC is -// triggered. -// 2. Create a DataChannel instance with the label and set the remote SSRC. -// 3. Call AddDataChannel with this new DataChannel. GetMediaSessionOptions -// will include the description of the DataChannel. -// 4. Create a local session description and call UpdateLocalStreams. This will -// set the local SSRC used by the DataChannel. -// 5. When both the local and remote SSRC of a DataChannel is set the state of -// the DataChannel change to kOpen. -// -// To close a DataChannel: -// 1. Call DataChannel::Close. This will change the state of the DataChannel to -// kClosing. GetMediaSessionOptions will not -// include the description of the DataChannel. -// 2. When a local session description is set, call UpdateLocalStreams with the -// session description. The description will no longer contain the -// DataChannel label or SSRC. -// 3. When remote session description is set, call UpdateRemoteStream with the -// session description. The description will no longer contain the -// DataChannel label or SSRC. The DataChannel SSRC is updated with SSRC=0. -// The DataChannel change state to kClosed. - -class MediaStreamSignaling { - public: - MediaStreamSignaling(talk_base::Thread* signaling_thread, - MediaStreamSignalingObserver* stream_observer, - cricket::ChannelManager* channel_manager); - virtual ~MediaStreamSignaling(); - - // Notify all referenced objects that MediaStreamSignaling will be teared - // down. This method must be called prior to the dtor. - void TearDown(); - - // Set a factory for creating data channels that are initiated by the remote - // peer. - void SetDataChannelFactory(DataChannelFactory* data_channel_factory) { - data_channel_factory_ = data_channel_factory; - } - - // Checks if |id| is available to be assigned to a new SCTP data channel. - bool IsSctpSidAvailable(int sid) const; - - // Gets the first available SCTP id that is not assigned to any existing - // data channels. - bool AllocateSctpSid(talk_base::SSLRole role, int* sid); - - // Adds |local_stream| to the collection of known MediaStreams that will be - // offered in a SessionDescription. - bool AddLocalStream(MediaStreamInterface* local_stream); - - // Removes |local_stream| from the collection of known MediaStreams that will - // be offered in a SessionDescription. - void RemoveLocalStream(MediaStreamInterface* local_stream); - - // Checks if any data channel has been added. - bool HasDataChannels() const; - // Adds |data_channel| to the collection of DataChannels that will be - // be offered in a SessionDescription. - bool AddDataChannel(DataChannel* data_channel); - // After we receive an OPEN message, create a data channel and add it. - bool AddDataChannelFromOpenMessage(const cricket::ReceiveDataParams& params, - const talk_base::Buffer& payload); - - // Returns a MediaSessionOptions struct with options decided by |constraints|, - // the local MediaStreams and DataChannels. - virtual bool GetOptionsForOffer( - const MediaConstraintsInterface* constraints, - cricket::MediaSessionOptions* options); - - // Returns a MediaSessionOptions struct with options decided by - // |constraints|, the local MediaStreams and DataChannels. - virtual bool GetOptionsForAnswer( - const MediaConstraintsInterface* constraints, - cricket::MediaSessionOptions* options); - - // Called when the remote session description has changed. The purpose is to - // update remote MediaStreams and DataChannels with the current - // session state. - // If the remote SessionDescription contain information about a new remote - // MediaStreams a new remote MediaStream is created and - // MediaStreamSignalingObserver::OnAddStream is called. - // If a remote MediaStream is missing from - // the remote SessionDescription MediaStreamSignalingObserver::OnRemoveStream - // is called. - // If the SessionDescription contains information about a new DataChannel, - // MediaStreamSignalingObserver::OnAddDataChannel is called with the - // DataChannel. - void OnRemoteDescriptionChanged(const SessionDescriptionInterface* desc); - - // Called when the local session description has changed. The purpose is to - // update local and remote MediaStreams and DataChannels with the current - // session state. - // If |desc| indicates that the media type should be rejected, the method - // ends the remote MediaStreamTracks. - // It also updates local DataChannels with information about its local SSRC. - void OnLocalDescriptionChanged(const SessionDescriptionInterface* desc); - - // Called when the audio channel closes. - void OnAudioChannelClose(); - // Called when the video channel closes. - void OnVideoChannelClose(); - // Called when the data channel closes. - void OnDataChannelClose(); - - // Returns all current known local MediaStreams. - StreamCollectionInterface* local_streams() const { return local_streams_;} - - // Returns all current remote MediaStreams. - StreamCollectionInterface* remote_streams() const { - return remote_streams_.get(); - } - void OnDataTransportCreatedForSctp(); - void OnDtlsRoleReadyForSctp(talk_base::SSLRole role); - - private: - struct RemotePeerInfo { - RemotePeerInfo() - : msid_supported(false), - default_audio_track_needed(false), - default_video_track_needed(false) { - } - // True if it has been discovered that the remote peer support MSID. - bool msid_supported; - // The remote peer indicates in the session description that audio will be - // sent but no MSID is given. - bool default_audio_track_needed; - // The remote peer indicates in the session description that video will be - // sent but no MSID is given. - bool default_video_track_needed; - - bool IsDefaultMediaStreamNeeded() { - return !msid_supported && (default_audio_track_needed || - default_video_track_needed); - } - }; - - struct TrackInfo { - TrackInfo() : ssrc(0) {} - TrackInfo(const std::string& stream_label, - const std::string track_id, - uint32 ssrc) - : stream_label(stream_label), - track_id(track_id), - ssrc(ssrc) { - } - std::string stream_label; - std::string track_id; - uint32 ssrc; - }; - typedef std::vector TrackInfos; - - void UpdateSessionOptions(); - - // Makes sure a MediaStream Track is created for each StreamParam in - // |streams|. |media_type| is the type of the |streams| and can be either - // audio or video. - // If a new MediaStream is created it is added to |new_streams|. - void UpdateRemoteStreamsList( - const std::vector& streams, - cricket::MediaType media_type, - StreamCollection* new_streams); - - // Triggered when a remote track has been seen for the first time in a remote - // session description. It creates a remote MediaStreamTrackInterface - // implementation and triggers MediaStreamSignaling::OnAddRemoteAudioTrack or - // MediaStreamSignaling::OnAddRemoteVideoTrack. - void OnRemoteTrackSeen(const std::string& stream_label, - const std::string& track_id, - uint32 ssrc, - cricket::MediaType media_type); - - // Triggered when a remote track has been removed from a remote session - // description. It removes the remote track with id |track_id| from a remote - // MediaStream and triggers MediaStreamSignaling::OnRemoveRemoteAudioTrack or - // MediaStreamSignaling::OnRemoveRemoteVideoTrack. - void OnRemoteTrackRemoved(const std::string& stream_label, - const std::string& track_id, - cricket::MediaType media_type); - - // Set the MediaStreamTrackInterface::TrackState to |kEnded| on all remote - // tracks of type |media_type|. - void RejectRemoteTracks(cricket::MediaType media_type); - - // Finds remote MediaStreams without any tracks and removes them from - // |remote_streams_| and notifies the observer that the MediaStream no longer - // exist. - void UpdateEndedRemoteMediaStreams(); - void MaybeCreateDefaultStream(); - TrackInfos* GetRemoteTracks(cricket::MediaType type); - - // Returns a map of currently negotiated LocalTrackInfo of type |type|. - TrackInfos* GetLocalTracks(cricket::MediaType type); - bool FindLocalTrack(const std::string& track_id, cricket::MediaType type); - - // Loops through the vector of |streams| and finds added and removed - // StreamParams since last time this method was called. - // For each new or removed StreamParam NotifyLocalTrackAdded or - // NotifyLocalTrackRemoved in invoked. - void UpdateLocalTracks(const std::vector& streams, - cricket::MediaType media_type); - - // Triggered when a local track has been seen for the first time in a local - // session description. - // This method triggers MediaStreamSignaling::OnAddLocalAudioTrack or - // MediaStreamSignaling::OnAddLocalVideoTrack if the rtp streams in the local - // SessionDescription can be mapped to a MediaStreamTrack in a MediaStream in - // |local_streams_| - void OnLocalTrackSeen(const std::string& stream_label, - const std::string& track_id, - uint32 ssrc, - cricket::MediaType media_type); - - // Triggered when a local track has been removed from a local session - // description. - // This method triggers MediaStreamSignaling::OnRemoveLocalAudioTrack or - // MediaStreamSignaling::OnRemoveLocalVideoTrack if a stream has been removed - // from the local SessionDescription and the stream can be mapped to a - // MediaStreamTrack in a MediaStream in |local_streams_|. - void OnLocalTrackRemoved(const std::string& stream_label, - const std::string& track_id, - uint32 ssrc, - cricket::MediaType media_type); - - void UpdateLocalRtpDataChannels(const cricket::StreamParamsVec& streams); - void UpdateRemoteRtpDataChannels(const cricket::StreamParamsVec& streams); - void UpdateClosingDataChannels( - const std::vector& active_channels, bool is_local_update); - void CreateRemoteDataChannel(const std::string& label, uint32 remote_ssrc); - - const TrackInfo* FindTrackInfo(const TrackInfos& infos, - const std::string& stream_label, - const std::string track_id) const; - - RemotePeerInfo remote_info_; - talk_base::Thread* signaling_thread_; - DataChannelFactory* data_channel_factory_; - cricket::MediaSessionOptions options_; - MediaStreamSignalingObserver* stream_observer_; - talk_base::scoped_refptr local_streams_; - talk_base::scoped_refptr remote_streams_; - talk_base::scoped_ptr remote_stream_factory_; - - TrackInfos remote_audio_tracks_; - TrackInfos remote_video_tracks_; - TrackInfos local_audio_tracks_; - TrackInfos local_video_tracks_; - - int last_allocated_sctp_even_sid_; - int last_allocated_sctp_odd_sid_; - - typedef std::map > - RtpDataChannels; - typedef std::vector > SctpDataChannels; - RtpDataChannels rtp_data_channels_; - SctpDataChannels sctp_data_channels_; -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_MEDIASTREAMSIGNALING_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediastreamtrack.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediastreamtrack.h deleted file mode 100755 index 183b575..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediastreamtrack.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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_MEDIASTREAMTRACK_H_ -#define TALK_APP_WEBRTC_MEDIASTREAMTRACK_H_ - -#include - -#include "talk/app/webrtc/mediastreaminterface.h" -#include "talk/app/webrtc/notifier.h" - -namespace webrtc { - -// MediaTrack implements the interface common to AudioTrackInterface and -// VideoTrackInterface. -template -class MediaStreamTrack : public Notifier { - public: - typedef typename T::TrackState TypedTrackState; - - virtual std::string id() const { return id_; } - virtual MediaStreamTrackInterface::TrackState state() const { - return state_; - } - virtual bool enabled() const { return enabled_; } - virtual bool set_enabled(bool enable) { - bool fire_on_change = (enable != enabled_); - enabled_ = enable; - if (fire_on_change) { - Notifier::FireOnChanged(); - } - return fire_on_change; - } - virtual bool set_state(MediaStreamTrackInterface::TrackState new_state) { - bool fire_on_change = (state_ != new_state); - state_ = new_state; - if (fire_on_change) - Notifier::FireOnChanged(); - return true; - } - - protected: - explicit MediaStreamTrack(const std::string& id) - : enabled_(true), - id_(id), - state_(MediaStreamTrackInterface::kInitializing) { - } - - private: - bool enabled_; - std::string id_; - MediaStreamTrackInterface::TrackState state_; -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_MEDIASTREAMTRACK_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediastreamtrackproxy.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediastreamtrackproxy.h deleted file mode 100755 index cd3d8fa..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/mediastreamtrackproxy.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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. - */ - -// This file includes proxy classes for tracks. The purpose is -// to make sure tracks are only accessed from the signaling thread. - -#ifndef TALK_APP_WEBRTC_MEDIASTREAMTRACKPROXY_H_ -#define TALK_APP_WEBRTC_MEDIASTREAMTRACKPROXY_H_ - -#include "talk/app/webrtc/mediastreaminterface.h" -#include "talk/app/webrtc/proxy.h" - -namespace webrtc { - -BEGIN_PROXY_MAP(AudioTrack) - PROXY_CONSTMETHOD0(std::string, kind) - PROXY_CONSTMETHOD0(std::string, id) - PROXY_CONSTMETHOD0(TrackState, state) - PROXY_CONSTMETHOD0(bool, enabled) - PROXY_CONSTMETHOD0(AudioSourceInterface*, GetSource) - PROXY_METHOD1(void, AddSink, AudioTrackSinkInterface*) - PROXY_METHOD1(void, RemoveSink, AudioTrackSinkInterface*) - PROXY_METHOD1(bool, GetSignalLevel, int*) - PROXY_METHOD0(talk_base::scoped_refptr, - GetAudioProcessor) - PROXY_METHOD0(cricket::AudioRenderer*, GetRenderer) - - PROXY_METHOD1(bool, set_enabled, bool) - PROXY_METHOD1(bool, set_state, TrackState) - - PROXY_METHOD1(void, RegisterObserver, ObserverInterface*) - PROXY_METHOD1(void, UnregisterObserver, ObserverInterface*) -END_PROXY() - -BEGIN_PROXY_MAP(VideoTrack) - PROXY_CONSTMETHOD0(std::string, kind) - PROXY_CONSTMETHOD0(std::string, id) - PROXY_CONSTMETHOD0(TrackState, state) - PROXY_CONSTMETHOD0(bool, enabled) - PROXY_METHOD1(bool, set_enabled, bool) - PROXY_METHOD1(bool, set_state, TrackState) - - PROXY_METHOD1(void, AddRenderer, VideoRendererInterface*) - PROXY_METHOD1(void, RemoveRenderer, VideoRendererInterface*) - PROXY_CONSTMETHOD0(VideoSourceInterface*, GetSource) - - PROXY_METHOD1(void, RegisterObserver, ObserverInterface*) - PROXY_METHOD1(void, UnregisterObserver, ObserverInterface*) -END_PROXY() - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_MEDIASTREAMTRACKPROXY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/notifier.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/notifier.h deleted file mode 100755 index fa19a01..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/notifier.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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_NOTIFIER_H_ -#define TALK_APP_WEBRTC_NOTIFIER_H_ - -#include - -#include "talk/base/common.h" -#include "talk/app/webrtc/mediastreaminterface.h" - -namespace webrtc { - -// Implement a template version of a notifier. -template -class Notifier : public T { - public: - Notifier() { - } - - virtual void RegisterObserver(ObserverInterface* observer) { - ASSERT(observer != NULL); - observers_.push_back(observer); - } - - virtual void UnregisterObserver(ObserverInterface* observer) { - for (std::list::iterator it = observers_.begin(); - it != observers_.end(); it++) { - if (*it == observer) { - observers_.erase(it); - break; - } - } - } - - void FireOnChanged() { - // Copy the list of observers to avoid a crash if the observer object - // unregisters as a result of the OnChanged() call. If the same list is used - // UnregisterObserver will affect the list make the iterator invalid. - std::list observers = observers_; - for (std::list::iterator it = observers.begin(); - it != observers.end(); ++it) { - (*it)->OnChanged(); - } - } - - protected: - std::list observers_; -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_NOTIFIER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/peerconnection.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/peerconnection.h deleted file mode 100755 index 182e3ec..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/peerconnection.h +++ /dev/null @@ -1,204 +0,0 @@ -/* - * 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_APP_WEBRTC_PEERCONNECTION_H_ -#define TALK_APP_WEBRTC_PEERCONNECTION_H_ - -#include - -#include "talk/app/webrtc/mediastreamsignaling.h" -#include "talk/app/webrtc/peerconnectioninterface.h" -#include "talk/app/webrtc/peerconnectionfactory.h" -#include "talk/app/webrtc/statscollector.h" -#include "talk/app/webrtc/streamcollection.h" -#include "talk/app/webrtc/webrtcsession.h" -#include "talk/base/scoped_ptr.h" - -namespace webrtc { -class MediaStreamHandlerContainer; - -typedef std::vector - StunConfigurations; -typedef std::vector - TurnConfigurations; - -// PeerConnectionImpl implements the PeerConnection interface. -// It uses MediaStreamSignaling and WebRtcSession to implement -// the PeerConnection functionality. -class PeerConnection : public PeerConnectionInterface, - public MediaStreamSignalingObserver, - public IceObserver, - public talk_base::MessageHandler, - public sigslot::has_slots<> { - public: - explicit PeerConnection(PeerConnectionFactory* factory); - - bool Initialize( - const PeerConnectionInterface::RTCConfiguration& configuration, - const MediaConstraintsInterface* constraints, - PortAllocatorFactoryInterface* allocator_factory, - DTLSIdentityServiceInterface* dtls_identity_service, - PeerConnectionObserver* observer); - virtual talk_base::scoped_refptr local_streams(); - virtual talk_base::scoped_refptr remote_streams(); - virtual bool AddStream(MediaStreamInterface* local_stream, - const MediaConstraintsInterface* constraints); - virtual void RemoveStream(MediaStreamInterface* local_stream); - - virtual talk_base::scoped_refptr CreateDtmfSender( - AudioTrackInterface* track); - - virtual talk_base::scoped_refptr CreateDataChannel( - const std::string& label, - const DataChannelInit* config); - virtual bool GetStats(StatsObserver* observer, - webrtc::MediaStreamTrackInterface* track, - StatsOutputLevel level); - - virtual SignalingState signaling_state(); - - // TODO(bemasc): Remove ice_state() when callers are removed. - virtual IceState ice_state(); - virtual IceConnectionState ice_connection_state(); - virtual IceGatheringState ice_gathering_state(); - - virtual const SessionDescriptionInterface* local_description() const; - virtual const SessionDescriptionInterface* remote_description() const; - - // JSEP01 - virtual void CreateOffer(CreateSessionDescriptionObserver* observer, - const MediaConstraintsInterface* constraints); - virtual void CreateAnswer(CreateSessionDescriptionObserver* observer, - const MediaConstraintsInterface* constraints); - virtual void SetLocalDescription(SetSessionDescriptionObserver* observer, - SessionDescriptionInterface* desc); - virtual void SetRemoteDescription(SetSessionDescriptionObserver* observer, - SessionDescriptionInterface* desc); - // TODO(mallinath) : Deprecated version, remove after all clients are updated. - virtual bool UpdateIce(const IceServers& configuration, - const MediaConstraintsInterface* constraints); - virtual bool UpdateIce( - const PeerConnectionInterface::RTCConfiguration& config); - virtual bool AddIceCandidate(const IceCandidateInterface* candidate); - - virtual void RegisterUMAObserver(UMAObserver* observer); - - virtual void Close(); - - protected: - virtual ~PeerConnection(); - - private: - // Implements MessageHandler. - virtual void OnMessage(talk_base::Message* msg); - - // Implements MediaStreamSignalingObserver. - virtual void OnAddRemoteStream(MediaStreamInterface* stream) OVERRIDE; - virtual void OnRemoveRemoteStream(MediaStreamInterface* stream) OVERRIDE; - virtual void OnAddDataChannel(DataChannelInterface* data_channel) OVERRIDE; - virtual void OnAddRemoteAudioTrack(MediaStreamInterface* stream, - AudioTrackInterface* audio_track, - uint32 ssrc) OVERRIDE; - virtual void OnAddRemoteVideoTrack(MediaStreamInterface* stream, - VideoTrackInterface* video_track, - uint32 ssrc) OVERRIDE; - virtual void OnRemoveRemoteAudioTrack( - MediaStreamInterface* stream, - AudioTrackInterface* audio_track) OVERRIDE; - virtual void OnRemoveRemoteVideoTrack( - MediaStreamInterface* stream, - VideoTrackInterface* video_track) OVERRIDE; - virtual void OnAddLocalAudioTrack(MediaStreamInterface* stream, - AudioTrackInterface* audio_track, - uint32 ssrc) OVERRIDE; - virtual void OnAddLocalVideoTrack(MediaStreamInterface* stream, - VideoTrackInterface* video_track, - uint32 ssrc) OVERRIDE; - virtual void OnRemoveLocalAudioTrack( - MediaStreamInterface* stream, - AudioTrackInterface* audio_track, - uint32 ssrc) OVERRIDE; - virtual void OnRemoveLocalVideoTrack( - MediaStreamInterface* stream, - VideoTrackInterface* video_track) OVERRIDE; - virtual void OnRemoveLocalStream(MediaStreamInterface* stream); - - // Implements IceObserver - virtual void OnIceConnectionChange(IceConnectionState new_state); - virtual void OnIceGatheringChange(IceGatheringState new_state); - virtual void OnIceCandidate(const IceCandidateInterface* candidate); - virtual void OnIceComplete(); - - // Signals from WebRtcSession. - void OnSessionStateChange(cricket::BaseSession* session, - cricket::BaseSession::State state); - void ChangeSignalingState(SignalingState signaling_state); - - bool DoInitialize(IceTransportsType type, - const StunConfigurations& stun_config, - const TurnConfigurations& turn_config, - const MediaConstraintsInterface* constraints, - PortAllocatorFactoryInterface* allocator_factory, - DTLSIdentityServiceInterface* dtls_identity_service, - PeerConnectionObserver* observer); - - talk_base::Thread* signaling_thread() const { - return factory_->signaling_thread(); - } - - void PostSetSessionDescriptionFailure(SetSessionDescriptionObserver* observer, - const std::string& error); - - bool IsClosed() const { - return signaling_state_ == PeerConnectionInterface::kClosed; - } - - // Storing the factory as a scoped reference pointer ensures that the memory - // in the PeerConnectionFactoryImpl remains available as long as the - // PeerConnection is running. It is passed to PeerConnection as a raw pointer. - // However, since the reference counting is done in the - // PeerConnectionFactoryInteface all instances created using the raw pointer - // will refer to the same reference count. - talk_base::scoped_refptr factory_; - PeerConnectionObserver* observer_; - UMAObserver* uma_observer_; - SignalingState signaling_state_; - // TODO(bemasc): Remove ice_state_. - IceState ice_state_; - IceConnectionState ice_connection_state_; - IceGatheringState ice_gathering_state_; - - talk_base::scoped_ptr port_allocator_; - talk_base::scoped_ptr session_; - talk_base::scoped_ptr mediastream_signaling_; - talk_base::scoped_ptr stream_handler_container_; - StatsCollector stats_; -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_PEERCONNECTION_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/peerconnectionfactory.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/peerconnectionfactory.h deleted file mode 100755 index 1e6889a..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/peerconnectionfactory.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - * 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_PEERCONNECTIONFACTORY_H_ -#define TALK_APP_WEBRTC_PEERCONNECTIONFACTORY_H_ - -#include - -#include "talk/app/webrtc/mediastreaminterface.h" -#include "talk/app/webrtc/peerconnectioninterface.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/thread.h" -#include "talk/session/media/channelmanager.h" - -namespace webrtc { - -class PeerConnectionFactory : public PeerConnectionFactoryInterface, - public talk_base::MessageHandler { - public: - virtual void SetOptions(const Options& options) { - options_ = options; - } - - virtual talk_base::scoped_refptr - CreatePeerConnection( - const PeerConnectionInterface::RTCConfiguration& configuration, - const MediaConstraintsInterface* constraints, - PortAllocatorFactoryInterface* allocator_factory, - DTLSIdentityServiceInterface* dtls_identity_service, - PeerConnectionObserver* observer); - - bool Initialize(); - - virtual talk_base::scoped_refptr - CreateLocalMediaStream(const std::string& label); - - virtual talk_base::scoped_refptr CreateAudioSource( - const MediaConstraintsInterface* constraints); - - virtual talk_base::scoped_refptr CreateVideoSource( - cricket::VideoCapturer* capturer, - const MediaConstraintsInterface* constraints); - - virtual talk_base::scoped_refptr - CreateVideoTrack(const std::string& id, - VideoSourceInterface* video_source); - - virtual talk_base::scoped_refptr - CreateAudioTrack(const std::string& id, - AudioSourceInterface* audio_source); - - virtual bool StartAecDump(talk_base::PlatformFile file); - - virtual cricket::ChannelManager* channel_manager(); - virtual talk_base::Thread* signaling_thread(); - virtual talk_base::Thread* worker_thread(); - const Options& options() const { return options_; } - - protected: - PeerConnectionFactory(); - PeerConnectionFactory( - talk_base::Thread* worker_thread, - talk_base::Thread* signaling_thread, - AudioDeviceModule* default_adm, - cricket::WebRtcVideoEncoderFactory* video_encoder_factory, - cricket::WebRtcVideoDecoderFactory* video_decoder_factory); - virtual ~PeerConnectionFactory(); - - private: - bool Initialize_s(); - void Terminate_s(); - talk_base::scoped_refptr CreateAudioSource_s( - const MediaConstraintsInterface* constraints); - talk_base::scoped_refptr CreateVideoSource_s( - cricket::VideoCapturer* capturer, - const MediaConstraintsInterface* constraints); - - talk_base::scoped_refptr CreatePeerConnection_s( - const PeerConnectionInterface::RTCConfiguration& configuration, - const MediaConstraintsInterface* constraints, - PortAllocatorFactoryInterface* allocator_factory, - DTLSIdentityServiceInterface* dtls_identity_service, - PeerConnectionObserver* observer); - - bool StartAecDump_s(talk_base::PlatformFile file); - - // Implements talk_base::MessageHandler. - void OnMessage(talk_base::Message* msg); - - bool owns_ptrs_; - talk_base::Thread* signaling_thread_; - talk_base::Thread* worker_thread_; - Options options_; - talk_base::scoped_refptr allocator_factory_; - // External Audio device used for audio playback. - talk_base::scoped_refptr default_adm_; - talk_base::scoped_ptr channel_manager_; - // External Video encoder factory. This can be NULL if the client has not - // injected any. In that case, video engine will use the internal SW encoder. - talk_base::scoped_ptr - video_encoder_factory_; - // External Video decoder factory. This can be NULL if the client has not - // injected any. In that case, video engine will use the internal SW decoder. - talk_base::scoped_ptr - video_decoder_factory_; -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_PEERCONNECTIONFACTORY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/peerconnectioninterface.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/peerconnectioninterface.h deleted file mode 100755 index 9093b9c..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/peerconnectioninterface.h +++ /dev/null @@ -1,528 +0,0 @@ -/* - * 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. - */ - -// This file contains the PeerConnection interface as defined in -// http://dev.w3.org/2011/webrtc/editor/webrtc.html#peer-to-peer-connections. -// Applications must use this interface to implement peerconnection. -// PeerConnectionFactory class provides factory methods to create -// peerconnection, mediastream and media tracks objects. -// -// The Following steps are needed to setup a typical call using Jsep. -// 1. Create a PeerConnectionFactoryInterface. Check constructors for more -// information about input parameters. -// 2. Create a PeerConnection object. Provide a configuration string which -// points either to stun or turn server to generate ICE candidates and provide -// an object that implements the PeerConnectionObserver interface. -// 3. Create local MediaStream and MediaTracks using the PeerConnectionFactory -// and add it to PeerConnection by calling AddStream. -// 4. Create an offer and serialize it and send it to the remote peer. -// 5. Once an ice candidate have been found PeerConnection will call the -// observer function OnIceCandidate. The candidates must also be serialized and -// sent to the remote peer. -// 6. Once an answer is received from the remote peer, call -// SetLocalSessionDescription with the offer and SetRemoteSessionDescription -// with the remote answer. -// 7. Once a remote candidate is received from the remote peer, provide it to -// the peerconnection by calling AddIceCandidate. - - -// The Receiver of a call can decide to accept or reject the call. -// This decision will be taken by the application not peerconnection. -// If application decides to accept the call -// 1. Create PeerConnectionFactoryInterface if it doesn't exist. -// 2. Create a new PeerConnection. -// 3. Provide the remote offer to the new PeerConnection object by calling -// SetRemoteSessionDescription. -// 4. Generate an answer to the remote offer by calling CreateAnswer and send it -// back to the remote peer. -// 5. Provide the local answer to the new PeerConnection by calling -// SetLocalSessionDescription with the answer. -// 6. Provide the remote ice candidates by calling AddIceCandidate. -// 7. Once a candidate have been found PeerConnection will call the observer -// function OnIceCandidate. Send these candidates to the remote peer. - -#ifndef TALK_APP_WEBRTC_PEERCONNECTIONINTERFACE_H_ -#define TALK_APP_WEBRTC_PEERCONNECTIONINTERFACE_H_ - -#include -#include - -#include "talk/app/webrtc/datachannelinterface.h" -#include "talk/app/webrtc/dtmfsenderinterface.h" -#include "talk/app/webrtc/jsep.h" -#include "talk/app/webrtc/mediastreaminterface.h" -#include "talk/app/webrtc/statstypes.h" -#include "talk/app/webrtc/umametrics.h" -#include "talk/base/fileutils.h" -#include "talk/base/socketaddress.h" - -namespace talk_base { -class Thread; -} - -namespace cricket { -class PortAllocator; -class WebRtcVideoDecoderFactory; -class WebRtcVideoEncoderFactory; -} - -namespace webrtc { -class AudioDeviceModule; -class MediaConstraintsInterface; - -// MediaStream container interface. -class StreamCollectionInterface : public talk_base::RefCountInterface { - public: - // TODO(ronghuawu): Update the function names to c++ style, e.g. find -> Find. - virtual size_t count() = 0; - virtual MediaStreamInterface* at(size_t index) = 0; - virtual MediaStreamInterface* find(const std::string& label) = 0; - virtual MediaStreamTrackInterface* FindAudioTrack( - const std::string& id) = 0; - virtual MediaStreamTrackInterface* FindVideoTrack( - const std::string& id) = 0; - - protected: - // Dtor protected as objects shouldn't be deleted via this interface. - ~StreamCollectionInterface() {} -}; - -class StatsObserver : public talk_base::RefCountInterface { - public: - virtual void OnComplete(const std::vector& reports) = 0; - - protected: - virtual ~StatsObserver() {} -}; - -class UMAObserver : public talk_base::RefCountInterface { - public: - virtual void IncrementCounter(PeerConnectionUMAMetricsCounter type) = 0; - virtual void AddHistogramSample(PeerConnectionUMAMetricsName type, - int value) = 0; - - protected: - virtual ~UMAObserver() {} -}; - -class PeerConnectionInterface : public talk_base::RefCountInterface { - public: - // See http://dev.w3.org/2011/webrtc/editor/webrtc.html#state-definitions . - enum SignalingState { - kStable, - kHaveLocalOffer, - kHaveLocalPrAnswer, - kHaveRemoteOffer, - kHaveRemotePrAnswer, - kClosed, - }; - - // TODO(bemasc): Remove IceState when callers are changed to - // IceConnection/GatheringState. - enum IceState { - kIceNew, - kIceGathering, - kIceWaiting, - kIceChecking, - kIceConnected, - kIceCompleted, - kIceFailed, - kIceClosed, - }; - - enum IceGatheringState { - kIceGatheringNew, - kIceGatheringGathering, - kIceGatheringComplete - }; - - enum IceConnectionState { - kIceConnectionNew, - kIceConnectionChecking, - kIceConnectionConnected, - kIceConnectionCompleted, - kIceConnectionFailed, - kIceConnectionDisconnected, - kIceConnectionClosed, - }; - - struct IceServer { - std::string uri; - std::string username; - std::string password; - }; - typedef std::vector IceServers; - - enum IceTransportsType { - kNone, - kRelay, - kNoHost, - kAll - }; - - struct RTCConfiguration { - IceTransportsType type; - IceServers servers; - - RTCConfiguration() : type(kAll) {} - explicit RTCConfiguration(IceTransportsType type) : type(type) {} - }; - - // Used by GetStats to decide which stats to include in the stats reports. - // |kStatsOutputLevelStandard| includes the standard stats for Javascript API; - // |kStatsOutputLevelDebug| includes both the standard stats and additional - // stats for debugging purposes. - enum StatsOutputLevel { - kStatsOutputLevelStandard, - kStatsOutputLevelDebug, - }; - - // Accessor methods to active local streams. - virtual talk_base::scoped_refptr - local_streams() = 0; - - // Accessor methods to remote streams. - virtual talk_base::scoped_refptr - remote_streams() = 0; - - // Add a new MediaStream to be sent on this PeerConnection. - // Note that a SessionDescription negotiation is needed before the - // remote peer can receive the stream. - virtual bool AddStream(MediaStreamInterface* stream, - const MediaConstraintsInterface* constraints) = 0; - - // Remove a MediaStream from this PeerConnection. - // Note that a SessionDescription negotiation is need before the - // remote peer is notified. - virtual void RemoveStream(MediaStreamInterface* stream) = 0; - - // Returns pointer to the created DtmfSender on success. - // Otherwise returns NULL. - virtual talk_base::scoped_refptr CreateDtmfSender( - AudioTrackInterface* track) = 0; - - virtual bool GetStats(StatsObserver* observer, - MediaStreamTrackInterface* track, - StatsOutputLevel level) = 0; - - virtual talk_base::scoped_refptr CreateDataChannel( - const std::string& label, - const DataChannelInit* config) = 0; - - virtual const SessionDescriptionInterface* local_description() const = 0; - virtual const SessionDescriptionInterface* remote_description() const = 0; - - // Create a new offer. - // The CreateSessionDescriptionObserver callback will be called when done. - virtual void CreateOffer(CreateSessionDescriptionObserver* observer, - const MediaConstraintsInterface* constraints) = 0; - // Create an answer to an offer. - // The CreateSessionDescriptionObserver callback will be called when done. - virtual void CreateAnswer(CreateSessionDescriptionObserver* observer, - const MediaConstraintsInterface* constraints) = 0; - // Sets the local session description. - // JsepInterface takes the ownership of |desc| even if it fails. - // The |observer| callback will be called when done. - virtual void SetLocalDescription(SetSessionDescriptionObserver* observer, - SessionDescriptionInterface* desc) = 0; - // Sets the remote session description. - // JsepInterface takes the ownership of |desc| even if it fails. - // The |observer| callback will be called when done. - virtual void SetRemoteDescription(SetSessionDescriptionObserver* observer, - SessionDescriptionInterface* desc) = 0; - // Restarts or updates the ICE Agent process of gathering local candidates - // and pinging remote candidates. - virtual bool UpdateIce(const IceServers& configuration, - const MediaConstraintsInterface* constraints) = 0; - // Provides a remote candidate to the ICE Agent. - // A copy of the |candidate| will be created and added to the remote - // description. So the caller of this method still has the ownership of the - // |candidate|. - // TODO(ronghuawu): Consider to change this so that the AddIceCandidate will - // take the ownership of the |candidate|. - virtual bool AddIceCandidate(const IceCandidateInterface* candidate) = 0; - - virtual void RegisterUMAObserver(UMAObserver* observer) = 0; - - // Returns the current SignalingState. - virtual SignalingState signaling_state() = 0; - - // TODO(bemasc): Remove ice_state when callers are changed to - // IceConnection/GatheringState. - // Returns the current IceState. - virtual IceState ice_state() = 0; - virtual IceConnectionState ice_connection_state() = 0; - virtual IceGatheringState ice_gathering_state() = 0; - - // Terminates all media and closes the transport. - virtual void Close() = 0; - - protected: - // Dtor protected as objects shouldn't be deleted via this interface. - ~PeerConnectionInterface() {} -}; - -// PeerConnection callback interface. Application should implement these -// methods. -class PeerConnectionObserver { - public: - enum StateType { - kSignalingState, - kIceState, - }; - - virtual void OnError() = 0; - - // Triggered when the SignalingState changed. - virtual void OnSignalingChange( - PeerConnectionInterface::SignalingState new_state) {} - - // Triggered when SignalingState or IceState have changed. - // TODO(bemasc): Remove once callers transition to OnSignalingChange. - virtual void OnStateChange(StateType state_changed) {} - - // Triggered when media is received on a new stream from remote peer. - virtual void OnAddStream(MediaStreamInterface* stream) = 0; - - // Triggered when a remote peer close a stream. - virtual void OnRemoveStream(MediaStreamInterface* stream) = 0; - - // Triggered when a remote peer open a data channel. - // TODO(perkj): Make pure virtual. - virtual void OnDataChannel(DataChannelInterface* data_channel) {} - - // Triggered when renegotiation is needed, for example the ICE has restarted. - virtual void OnRenegotiationNeeded() = 0; - - // Called any time the IceConnectionState changes - virtual void OnIceConnectionChange( - PeerConnectionInterface::IceConnectionState new_state) {} - - // Called any time the IceGatheringState changes - virtual void OnIceGatheringChange( - PeerConnectionInterface::IceGatheringState new_state) {} - - // New Ice candidate have been found. - virtual void OnIceCandidate(const IceCandidateInterface* candidate) = 0; - - // TODO(bemasc): Remove this once callers transition to OnIceGatheringChange. - // All Ice candidates have been found. - virtual void OnIceComplete() {} - - protected: - // Dtor protected as objects shouldn't be deleted via this interface. - ~PeerConnectionObserver() {} -}; - -// Factory class used for creating cricket::PortAllocator that is used -// for ICE negotiation. -class PortAllocatorFactoryInterface : public talk_base::RefCountInterface { - public: - struct StunConfiguration { - StunConfiguration(const std::string& address, int port) - : server(address, port) {} - // STUN server address and port. - talk_base::SocketAddress server; - }; - - struct TurnConfiguration { - TurnConfiguration(const std::string& address, - int port, - const std::string& username, - const std::string& password, - const std::string& transport_type, - bool secure) - : server(address, port), - username(username), - password(password), - transport_type(transport_type), - secure(secure) {} - talk_base::SocketAddress server; - std::string username; - std::string password; - std::string transport_type; - bool secure; - }; - - virtual cricket::PortAllocator* CreatePortAllocator( - const std::vector& stun_servers, - const std::vector& turn_configurations) = 0; - - protected: - PortAllocatorFactoryInterface() {} - ~PortAllocatorFactoryInterface() {} -}; - -// Used to receive callbacks of DTLS identity requests. -class DTLSIdentityRequestObserver : public talk_base::RefCountInterface { - public: - virtual void OnFailure(int error) = 0; - virtual void OnSuccess(const std::string& der_cert, - const std::string& der_private_key) = 0; - protected: - virtual ~DTLSIdentityRequestObserver() {} -}; - -class DTLSIdentityServiceInterface { - public: - // Asynchronously request a DTLS identity, including a self-signed certificate - // and the private key used to sign the certificate, from the identity store - // for the given identity name. - // DTLSIdentityRequestObserver::OnSuccess will be called with the identity if - // the request succeeded; DTLSIdentityRequestObserver::OnFailure will be - // called with an error code if the request failed. - // - // Only one request can be made at a time. If a second request is called - // before the first one completes, RequestIdentity will abort and return - // false. - // - // |identity_name| is an internal name selected by the client to identify an - // identity within an origin. E.g. an web site may cache the certificates used - // to communicate with differnent peers under different identity names. - // - // |common_name| is the common name used to generate the certificate. If the - // certificate already exists in the store, |common_name| is ignored. - // - // |observer| is the object to receive success or failure callbacks. - // - // Returns true if either OnFailure or OnSuccess will be called. - virtual bool RequestIdentity( - const std::string& identity_name, - const std::string& common_name, - DTLSIdentityRequestObserver* observer) = 0; - - virtual ~DTLSIdentityServiceInterface() {} -}; - -// PeerConnectionFactoryInterface is the factory interface use for creating -// PeerConnection, MediaStream and media tracks. -// PeerConnectionFactoryInterface will create required libjingle threads, -// socket and network manager factory classes for networking. -// If an application decides to provide its own threads and network -// implementation of these classes it should use the alternate -// CreatePeerConnectionFactory method which accepts threads as input and use the -// CreatePeerConnection version that takes a PortAllocatorFactoryInterface as -// argument. -class PeerConnectionFactoryInterface : public talk_base::RefCountInterface { - public: - class Options { - public: - Options() : - disable_encryption(false), - disable_sctp_data_channels(false) { - } - bool disable_encryption; - bool disable_sctp_data_channels; - }; - - virtual void SetOptions(const Options& options) = 0; - - virtual talk_base::scoped_refptr - CreatePeerConnection( - const PeerConnectionInterface::RTCConfiguration& configuration, - const MediaConstraintsInterface* constraints, - PortAllocatorFactoryInterface* allocator_factory, - DTLSIdentityServiceInterface* dtls_identity_service, - PeerConnectionObserver* observer) = 0; - - // TODO(mallinath) : Remove below versions after clients are updated - // to above method. - // In latest W3C WebRTC draft, PC constructor will take RTCConfiguration, - // and not IceServers. RTCConfiguration is made up of ice servers and - // ice transport type. - // http://dev.w3.org/2011/webrtc/editor/webrtc.html - inline talk_base::scoped_refptr - CreatePeerConnection( - const PeerConnectionInterface::IceServers& configuration, - const MediaConstraintsInterface* constraints, - PortAllocatorFactoryInterface* allocator_factory, - DTLSIdentityServiceInterface* dtls_identity_service, - PeerConnectionObserver* observer) { - PeerConnectionInterface::RTCConfiguration rtc_config; - rtc_config.servers = configuration; - return CreatePeerConnection(rtc_config, constraints, allocator_factory, - dtls_identity_service, observer); - } - - virtual talk_base::scoped_refptr - CreateLocalMediaStream(const std::string& label) = 0; - - // Creates a AudioSourceInterface. - // |constraints| decides audio processing settings but can be NULL. - virtual talk_base::scoped_refptr CreateAudioSource( - const MediaConstraintsInterface* constraints) = 0; - - // Creates a VideoSourceInterface. The new source take ownership of - // |capturer|. |constraints| decides video resolution and frame rate but can - // be NULL. - virtual talk_base::scoped_refptr CreateVideoSource( - cricket::VideoCapturer* capturer, - const MediaConstraintsInterface* constraints) = 0; - - // Creates a new local VideoTrack. The same |source| can be used in several - // tracks. - virtual talk_base::scoped_refptr - CreateVideoTrack(const std::string& label, - VideoSourceInterface* source) = 0; - - // Creates an new AudioTrack. At the moment |source| can be NULL. - virtual talk_base::scoped_refptr - CreateAudioTrack(const std::string& label, - AudioSourceInterface* source) = 0; - - // Starts AEC dump using existing file. Takes ownership of |file| and passes - // it on to VoiceEngine (via other objects) immediately, which will take - // the ownerhip. If the operation fails, the file will be closed. - // TODO(grunell): Remove when Chromium has started to use AEC in each source. - // http://crbug.com/264611. - virtual bool StartAecDump(talk_base::PlatformFile file) = 0; - - protected: - // Dtor and ctor protected as objects shouldn't be created or deleted via - // this interface. - PeerConnectionFactoryInterface() {} - ~PeerConnectionFactoryInterface() {} // NOLINT -}; - -// Create a new instance of PeerConnectionFactoryInterface. -talk_base::scoped_refptr -CreatePeerConnectionFactory(); - -// Create a new instance of PeerConnectionFactoryInterface. -// Ownership of |factory|, |default_adm|, and optionally |encoder_factory| and -// |decoder_factory| transferred to the returned factory. -talk_base::scoped_refptr -CreatePeerConnectionFactory( - talk_base::Thread* worker_thread, - talk_base::Thread* signaling_thread, - AudioDeviceModule* default_adm, - cricket::WebRtcVideoEncoderFactory* encoder_factory, - cricket::WebRtcVideoDecoderFactory* decoder_factory); - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_PEERCONNECTIONINTERFACE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/peerconnectionproxy.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/peerconnectionproxy.h deleted file mode 100755 index 66276bb..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/peerconnectionproxy.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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_APP_WEBRTC_PEERCONNECTIONPROXY_H_ -#define TALK_APP_WEBRTC_PEERCONNECTIONPROXY_H_ - -#include "talk/app/webrtc/peerconnectioninterface.h" -#include "talk/app/webrtc/proxy.h" - -namespace webrtc { - -// Define proxy for PeerConnectionInterface. -BEGIN_PROXY_MAP(PeerConnection) - PROXY_METHOD0(talk_base::scoped_refptr, - local_streams) - PROXY_METHOD0(talk_base::scoped_refptr, - remote_streams) - PROXY_METHOD2(bool, AddStream, MediaStreamInterface*, - const MediaConstraintsInterface*) - PROXY_METHOD1(void, RemoveStream, MediaStreamInterface*) - PROXY_METHOD1(talk_base::scoped_refptr, - CreateDtmfSender, AudioTrackInterface*) - PROXY_METHOD3(bool, GetStats, StatsObserver*, - MediaStreamTrackInterface*, - StatsOutputLevel) - PROXY_METHOD2(talk_base::scoped_refptr, - CreateDataChannel, const std::string&, const DataChannelInit*) - PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, local_description) - PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, remote_description) - PROXY_METHOD2(void, CreateOffer, CreateSessionDescriptionObserver*, - const MediaConstraintsInterface*) - PROXY_METHOD2(void, CreateAnswer, CreateSessionDescriptionObserver*, - const MediaConstraintsInterface*) - PROXY_METHOD2(void, SetLocalDescription, SetSessionDescriptionObserver*, - SessionDescriptionInterface*) - PROXY_METHOD2(void, SetRemoteDescription, SetSessionDescriptionObserver*, - SessionDescriptionInterface*) - PROXY_METHOD2(bool, UpdateIce, const IceServers&, - const MediaConstraintsInterface*) - PROXY_METHOD1(bool, AddIceCandidate, const IceCandidateInterface*) - PROXY_METHOD1(void, RegisterUMAObserver, UMAObserver*) - PROXY_METHOD0(SignalingState, signaling_state) - PROXY_METHOD0(IceState, ice_state) - PROXY_METHOD0(IceConnectionState, ice_connection_state) - PROXY_METHOD0(IceGatheringState, ice_gathering_state) - PROXY_METHOD0(void, Close) -END_PROXY() - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_PEERCONNECTIONPROXY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/portallocatorfactory.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/portallocatorfactory.h deleted file mode 100755 index 3f3bdb1..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/portallocatorfactory.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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. - */ - -// This file defines the default implementation of -// PortAllocatorFactoryInterface. -// This implementation creates instances of cricket::HTTPPortAllocator and uses -// the BasicNetworkManager and BasicPacketSocketFactory. - -#ifndef TALK_APP_WEBRTC_PORTALLOCATORFACTORY_H_ -#define TALK_APP_WEBRTC_PORTALLOCATORFACTORY_H_ - -#include "talk/app/webrtc/peerconnectioninterface.h" -#include "talk/base/scoped_ptr.h" - -namespace cricket { -class PortAllocator; -} - -namespace talk_base { -class BasicNetworkManager; -class BasicPacketSocketFactory; -} - -namespace webrtc { - -class PortAllocatorFactory : public PortAllocatorFactoryInterface { - public: - static talk_base::scoped_refptr Create( - talk_base::Thread* worker_thread); - - virtual cricket::PortAllocator* CreatePortAllocator( - const std::vector& stun, - const std::vector& turn); - - protected: - explicit PortAllocatorFactory(talk_base::Thread* worker_thread); - ~PortAllocatorFactory(); - - private: - talk_base::scoped_ptr network_manager_; - talk_base::scoped_ptr socket_factory_; -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_PORTALLOCATORFACTORY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/proxy.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/proxy.h deleted file mode 100755 index e3833e6..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/proxy.h +++ /dev/null @@ -1,287 +0,0 @@ -/* - * libjingle - * Copyright 2013, 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. - */ - -// This file contains Macros for creating proxies for webrtc MediaStream and -// PeerConnection classes. - -// -// Example usage: -// -// class TestInterface : public talk_base::RefCountInterface { -// public: -// std::string FooA() = 0; -// std::string FooB(bool arg1) const = 0; -// std::string FooC(bool arg1)= 0; -// }; -// -// Note that return types can not be a const reference. -// -// class Test : public TestInterface { -// ... implementation of the interface. -// }; -// -// BEGIN_PROXY_MAP(Test) -// PROXY_METHOD0(std::string, FooA) -// PROXY_CONSTMETHOD1(std::string, FooB, arg1) -// PROXY_METHOD1(std::string, FooC, arg1) -// END_PROXY() -// -// The proxy can be created using TestProxy::Create(Thread*, TestInterface*). - -#ifndef TALK_APP_WEBRTC_PROXY_H_ -#define TALK_APP_WEBRTC_PROXY_H_ - -#include "talk/base/thread.h" - -namespace webrtc { - -template -class ReturnType { - public: - template - void Invoke(C* c, M m) { r_ = (c->*m)(); } - template - void Invoke(C* c, M m, T1 a1) { r_ = (c->*m)(a1); } - template - void Invoke(C* c, M m, T1 a1, T2 a2) { r_ = (c->*m)(a1, a2); } - template - void Invoke(C* c, M m, T1 a1, T2 a2, T3 a3) { r_ = (c->*m)(a1, a2, a3); } - - R value() { return r_; } - - private: - R r_; -}; - -template <> -class ReturnType { - public: - template - void Invoke(C* c, M m) { (c->*m)(); } - template - void Invoke(C* c, M m, T1 a1) { (c->*m)(a1); } - template - void Invoke(C* c, M m, T1 a1, T2 a2) { (c->*m)(a1, a2); } - template - void Invoke(C* c, M m, T1 a1, T2 a2, T3 a3) { (c->*m)(a1, a2, a3); } - - void value() {} -}; - -template -class MethodCall0 : public talk_base::Message, - public talk_base::MessageHandler { - public: - typedef R (C::*Method)(); - MethodCall0(C* c, Method m) : c_(c), m_(m) {} - - R Marshal(talk_base::Thread* t) { - t->Send(this, 0); - return r_.value(); - } - - private: - void OnMessage(talk_base::Message*) { r_.Invoke(c_, m_);} - - C* c_; - Method m_; - ReturnType r_; -}; - -template -class ConstMethodCall0 : public talk_base::Message, - public talk_base::MessageHandler { - public: - typedef R (C::*Method)() const; - ConstMethodCall0(C* c, Method m) : c_(c), m_(m) {} - - R Marshal(talk_base::Thread* t) { - t->Send(this, 0); - return r_.value(); - } - - private: - void OnMessage(talk_base::Message*) { r_.Invoke(c_, m_); } - - C* c_; - Method m_; - ReturnType r_; -}; - -template -class MethodCall1 : public talk_base::Message, - public talk_base::MessageHandler { - public: - typedef R (C::*Method)(T1 a1); - MethodCall1(C* c, Method m, T1 a1) : c_(c), m_(m), a1_(a1) {} - - R Marshal(talk_base::Thread* t) { - t->Send(this, 0); - return r_.value(); - } - - private: - void OnMessage(talk_base::Message*) { r_.Invoke(c_, m_, a1_); } - - C* c_; - Method m_; - ReturnType r_; - T1 a1_; -}; - -template -class ConstMethodCall1 : public talk_base::Message, - public talk_base::MessageHandler { - public: - typedef R (C::*Method)(T1 a1) const; - ConstMethodCall1(C* c, Method m, T1 a1) : c_(c), m_(m), a1_(a1) {} - - R Marshal(talk_base::Thread* t) { - t->Send(this, 0); - return r_.value(); - } - - private: - void OnMessage(talk_base::Message*) { r_.Invoke(c_, m_, a1_); } - - C* c_; - Method m_; - ReturnType r_; - T1 a1_; -}; - -template -class MethodCall2 : public talk_base::Message, - public talk_base::MessageHandler { - public: - typedef R (C::*Method)(T1 a1, T2 a2); - MethodCall2(C* c, Method m, T1 a1, T2 a2) : c_(c), m_(m), a1_(a1), a2_(a2) {} - - R Marshal(talk_base::Thread* t) { - t->Send(this, 0); - return r_.value(); - } - - private: - void OnMessage(talk_base::Message*) { r_.Invoke(c_, m_, a1_, a2_); } - - C* c_; - Method m_; - ReturnType r_; - T1 a1_; - T2 a2_; -}; - -template -class MethodCall3 : public talk_base::Message, - public talk_base::MessageHandler { - public: - typedef R (C::*Method)(T1 a1, T2 a2, T3 a3); - MethodCall3(C* c, Method m, T1 a1, T2 a2, T3 a3) - : c_(c), m_(m), a1_(a1), a2_(a2), a3_(a3) {} - - R Marshal(talk_base::Thread* t) { - t->Send(this, 0); - return r_.value(); - } - - private: - void OnMessage(talk_base::Message*) { r_.Invoke(c_, m_, a1_, a2_, a3_); } - - C* c_; - Method m_; - ReturnType r_; - T1 a1_; - T2 a2_; - T3 a3_; -}; - -#define BEGIN_PROXY_MAP(c) \ - class c##Proxy : public c##Interface {\ - protected:\ - typedef c##Interface C;\ - c##Proxy(talk_base::Thread* thread, C* c)\ - : owner_thread_(thread), \ - c_(c) {}\ - ~c##Proxy() {\ - MethodCall0 call(this, &c##Proxy::Release_s);\ - call.Marshal(owner_thread_);\ - }\ - public:\ - static talk_base::scoped_refptr Create(talk_base::Thread* thread, \ - C* c) {\ - return new talk_base::RefCountedObject(thread, c);\ - }\ - -#define PROXY_METHOD0(r, method)\ - r method() OVERRIDE {\ - MethodCall0 call(c_.get(), &C::method);\ - return call.Marshal(owner_thread_);\ - }\ - -#define PROXY_CONSTMETHOD0(r, method)\ - r method() const OVERRIDE {\ - ConstMethodCall0 call(c_.get(), &C::method);\ - return call.Marshal(owner_thread_);\ - }\ - -#define PROXY_METHOD1(r, method, t1)\ - r method(t1 a1) OVERRIDE {\ - MethodCall1 call(c_.get(), &C::method, a1);\ - return call.Marshal(owner_thread_);\ - }\ - -#define PROXY_CONSTMETHOD1(r, method, t1)\ - r method(t1 a1) const OVERRIDE {\ - ConstMethodCall1 call(c_.get(), &C::method, a1);\ - return call.Marshal(owner_thread_);\ - }\ - -#define PROXY_METHOD2(r, method, t1, t2)\ - r method(t1 a1, t2 a2) OVERRIDE {\ - MethodCall2 call(c_.get(), &C::method, a1, a2);\ - return call.Marshal(owner_thread_);\ - }\ - -#define PROXY_METHOD3(r, method, t1, t2, t3)\ - r method(t1 a1, t2 a2, t3 a3) OVERRIDE {\ - MethodCall3 call(c_.get(), &C::method, a1, a2, a3);\ - return call.Marshal(owner_thread_);\ - }\ - -#define END_PROXY() \ - private:\ - void Release_s() {\ - c_ = NULL;\ - }\ - mutable talk_base::Thread* owner_thread_;\ - talk_base::scoped_refptr c_;\ - };\ - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_PROXY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/remoteaudiosource.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/remoteaudiosource.h deleted file mode 100755 index f1793b0..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/remoteaudiosource.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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_APP_WEBRTC_REMOTEAUDIOSOURCE_H_ -#define TALK_APP_WEBRTC_REMOTEAUDIOSOURCE_H_ - -#include - -#include "talk/app/webrtc/mediastreaminterface.h" -#include "talk/app/webrtc/notifier.h" - -namespace webrtc { - -using webrtc::AudioSourceInterface; - -// This class implements the audio source used by the remote audio track. -class RemoteAudioSource : public Notifier { - public: - // Creates an instance of RemoteAudioSource. - static talk_base::scoped_refptr Create(); - - protected: - RemoteAudioSource(); - virtual ~RemoteAudioSource(); - - private: - typedef std::list AudioObserverList; - - // MediaSourceInterface implementation. - virtual MediaSourceInterface::SourceState state() const OVERRIDE; - - // AudioSourceInterface implementation. - virtual void SetVolume(double volume) OVERRIDE; - virtual void RegisterAudioObserver(AudioObserver* observer) OVERRIDE; - virtual void UnregisterAudioObserver(AudioObserver* observer) OVERRIDE; - - AudioObserverList audio_observers_; -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_REMOTEAUDIOSOURCE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/remotevideocapturer.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/remotevideocapturer.h deleted file mode 100755 index 11a2a1e..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/remotevideocapturer.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * libjingle - * Copyright 2013, 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_REMOTEVIDEOCAPTURER_H_ -#define TALK_APP_WEBRTC_REMOTEVIDEOCAPTURER_H_ - -#include - -#include "talk/app/webrtc/mediastreaminterface.h" -#include "talk/media/base/videocapturer.h" -#include "talk/media/base/videorenderer.h" - -namespace webrtc { - -// RemoteVideoCapturer implements a simple cricket::VideoCapturer which -// gets decoded remote video frames from media channel. -// It's used as the remote video source's VideoCapturer so that the remote video -// can be used as a cricket::VideoCapturer and in that way a remote video stream -// can implement the MediaStreamSourceInterface. -class RemoteVideoCapturer : public cricket::VideoCapturer { - public: - RemoteVideoCapturer(); - virtual ~RemoteVideoCapturer(); - - // cricket::VideoCapturer implementation. - virtual cricket::CaptureState Start( - const cricket::VideoFormat& capture_format) OVERRIDE; - virtual void Stop() OVERRIDE; - virtual bool IsRunning() OVERRIDE; - virtual bool GetPreferredFourccs(std::vector* fourccs) OVERRIDE; - virtual bool GetBestCaptureFormat(const cricket::VideoFormat& desired, - cricket::VideoFormat* best_format) OVERRIDE; - virtual bool IsScreencast() const OVERRIDE; - - private: - DISALLOW_COPY_AND_ASSIGN(RemoteVideoCapturer); -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_REMOTEVIDEOCAPTURER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/sctputils.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/sctputils.h deleted file mode 100755 index f4c8e06..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/sctputils.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * libjingle - * Copyright 2013 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_SCTPUTILS_H_ -#define TALK_APP_WEBRTC_SCTPUTILS_H_ - -#include - -#include "talk/app/webrtc/datachannelinterface.h" - -namespace talk_base { -class Buffer; -} // namespace talk_base - -namespace webrtc { -struct DataChannelInit; - -bool ParseDataChannelOpenMessage(const talk_base::Buffer& payload, - std::string* label, - DataChannelInit* config); - -bool ParseDataChannelOpenAckMessage(const talk_base::Buffer& payload); - -bool WriteDataChannelOpenMessage(const std::string& label, - const DataChannelInit& config, - talk_base::Buffer* payload); - -void WriteDataChannelOpenAckMessage(talk_base::Buffer* payload); -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_SCTPUTILS_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/statscollector.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/statscollector.h deleted file mode 100755 index 9b2a19c..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/statscollector.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - * 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. - */ - -// This file contains a class used for gathering statistics from an ongoing -// libjingle PeerConnection. - -#ifndef TALK_APP_WEBRTC_STATSCOLLECTOR_H_ -#define TALK_APP_WEBRTC_STATSCOLLECTOR_H_ - -#include -#include -#include - -#include "talk/app/webrtc/mediastreaminterface.h" -#include "talk/app/webrtc/peerconnectioninterface.h" -#include "talk/app/webrtc/statstypes.h" -#include "talk/app/webrtc/webrtcsession.h" - -#include "talk/base/timing.h" - -namespace webrtc { - -class StatsCollector { - public: - StatsCollector(); - - // Register the session Stats should operate on. - // Set to NULL if the session has ended. - void set_session(WebRtcSession* session) { - session_ = session; - } - - // Adds a MediaStream with tracks that can be used as a |selector| in a call - // to GetStats. - void AddStream(MediaStreamInterface* stream); - - // Adds a local audio track that is used for getting some voice statistics. - void AddLocalAudioTrack(AudioTrackInterface* audio_track, uint32 ssrc); - - // Removes a local audio tracks that is used for getting some voice - // statistics. - void RemoveLocalAudioTrack(AudioTrackInterface* audio_track, uint32 ssrc); - - // Gather statistics from the session and store them for future use. - void UpdateStats(PeerConnectionInterface::StatsOutputLevel level); - - // Gets a StatsReports of the last collected stats. Note that UpdateStats must - // be called before this function to get the most recent stats. |selector| is - // a track label or empty string. The most recent reports are stored in - // |reports|. - bool GetStats(MediaStreamTrackInterface* track, - StatsReports* reports); - - // Prepare an SSRC report for the given ssrc. Used internally - // in the ExtractStatsFromList template. - StatsReport* PrepareLocalReport(uint32 ssrc, const std::string& transport); - // Prepare an SSRC report for the given remote ssrc. Used internally. - StatsReport* PrepareRemoteReport(uint32 ssrc, const std::string& transport); - // Extracts the ID of a Transport belonging to an SSRC. Used internally. - bool GetTransportIdFromProxy(const std::string& proxy, - std::string* transport_id); - - private: - bool CopySelectedReports(const std::string& selector, StatsReports* reports); - - // Helper method for AddCertificateReports. - std::string AddOneCertificateReport( - const talk_base::SSLCertificate* cert, const std::string& issuer_id); - - // Adds a report for this certificate and every certificate in its chain, and - // returns the leaf certificate's report's ID. - std::string AddCertificateReports(const talk_base::SSLCertificate* cert); - - void ExtractSessionInfo(); - void ExtractVoiceInfo(); - void ExtractVideoInfo(PeerConnectionInterface::StatsOutputLevel level); - double GetTimeNow(); - void BuildSsrcToTransportId(); - WebRtcSession* session() { return session_; } - webrtc::StatsReport* GetOrCreateReport(const std::string& type, - const std::string& id); - webrtc::StatsReport* GetReport(const std::string& type, - const std::string& id); - - // Helper method to get stats from the local audio tracks. - void UpdateStatsFromExistingLocalAudioTracks(); - void UpdateReportFromAudioTrack(AudioTrackInterface* track, - StatsReport* report); - - // A map from the report id to the report. - std::map reports_; - // Raw pointer to the session the statistics are gathered from. - WebRtcSession* session_; - double stats_gathering_started_; - talk_base::Timing timing_; - cricket::ProxyTransportMap proxy_to_transport_; - - typedef std::vector > - LocalAudioTrackVector; - LocalAudioTrackVector local_audio_tracks_; -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_STATSCOLLECTOR_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/statstypes.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/statstypes.h deleted file mode 100755 index b96989d..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/statstypes.h +++ /dev/null @@ -1,215 +0,0 @@ -/* - * 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. - */ - -// This file contains structures used for retrieving statistics from an ongoing -// libjingle session. - -#ifndef TALK_APP_WEBRTC_STATSTYPES_H_ -#define TALK_APP_WEBRTC_STATSTYPES_H_ - -#include -#include - -#include "talk/base/basictypes.h" -#include "talk/base/stringencode.h" - -namespace webrtc { - -class StatsReport { - public: - StatsReport() : timestamp(0) { } - - std::string id; // See below for contents. - std::string type; // See below for contents. - - struct Value { - std::string name; - std::string value; - }; - - void AddValue(const std::string& name, const std::string& value); - void AddValue(const std::string& name, int64 value); - template - void AddValue(const std::string& name, const std::vector& value); - void AddBoolean(const std::string& name, bool value); - - void ReplaceValue(const std::string& name, const std::string& value); - - double timestamp; // Time since 1970-01-01T00:00:00Z in milliseconds. - typedef std::vector Values; - Values values; - - // StatsReport types. - // A StatsReport of |type| = "googSession" contains overall information - // about the thing libjingle calls a session (which may contain one - // or more RTP sessions. - static const char kStatsReportTypeSession[]; - - // A StatsReport of |type| = "googTransport" contains information - // about a libjingle "transport". - static const char kStatsReportTypeTransport[]; - - // A StatsReport of |type| = "googComponent" contains information - // about a libjingle "channel" (typically, RTP or RTCP for a transport). - // This is intended to be the same thing as an ICE "Component". - static const char kStatsReportTypeComponent[]; - - // A StatsReport of |type| = "googCandidatePair" contains information - // about a libjingle "connection" - a single source/destination port pair. - // This is intended to be the same thing as an ICE "candidate pair". - static const char kStatsReportTypeCandidatePair[]; - - // StatsReport of |type| = "VideoBWE" is statistics for video Bandwidth - // Estimation, which is global per-session. The |id| field is "bweforvideo" - // (will probably change in the future). - static const char kStatsReportTypeBwe[]; - - // StatsReport of |type| = "ssrc" is statistics for a specific rtp stream. - // The |id| field is the SSRC in decimal form of the rtp stream. - static const char kStatsReportTypeSsrc[]; - - // StatsReport of |type| = "remoteSsrc" is statistics for a specific - // rtp stream, generated by the remote end of the connection. - static const char kStatsReportTypeRemoteSsrc[]; - - // StatsReport of |type| = "googTrack" is statistics for a specific media - // track. The |id| field is the track id. - static const char kStatsReportTypeTrack[]; - - // StatsReport of |type| = "iceCandidate" is statistics on a specific - // ICE Candidate. It links to its transport. - static const char kStatsReportTypeIceCandidate[]; - - // The id of StatsReport of type VideoBWE. - static const char kStatsReportVideoBweId[]; - - // A StatsReport of |type| = "googCertificate" contains an SSL certificate - // transmitted by one of the endpoints of this connection. The |id| is - // controlled by the fingerprint, and is used to identify the certificate in - // the Channel stats (as "googLocalCertificateId" or - // "googRemoteCertificateId") and in any child certificates (as - // "googIssuerId"). - static const char kStatsReportTypeCertificate[]; - - // StatsValue names - static const char kStatsValueNameAudioOutputLevel[]; - static const char kStatsValueNameAudioInputLevel[]; - static const char kStatsValueNameBytesSent[]; - static const char kStatsValueNamePacketsSent[]; - static const char kStatsValueNameBytesReceived[]; - static const char kStatsValueNamePacketsReceived[]; - static const char kStatsValueNamePacketsLost[]; - static const char kStatsValueNameTransportId[]; - static const char kStatsValueNameLocalAddress[]; - static const char kStatsValueNameRemoteAddress[]; - static const char kStatsValueNameWritable[]; - static const char kStatsValueNameReadable[]; - static const char kStatsValueNameActiveConnection[]; - - - // Internal StatsValue names - static const char kStatsValueNameAvgEncodeMs[]; - static const char kStatsValueNameEncodeUsagePercent[]; - static const char kStatsValueNameCaptureJitterMs[]; - static const char kStatsValueNameCaptureQueueDelayMsPerS[]; - static const char kStatsValueNameCodecName[]; - static const char kStatsValueNameBandwidthLimitedResolution[]; - static const char kStatsValueNameCpuLimitedResolution[]; - static const char kStatsValueNameViewLimitedResolution[]; - static const char kStatsValueNameEchoCancellationQualityMin[]; - static const char kStatsValueNameEchoDelayMedian[]; - static const char kStatsValueNameEchoDelayStdDev[]; - static const char kStatsValueNameEchoReturnLoss[]; - static const char kStatsValueNameEchoReturnLossEnhancement[]; - static const char kStatsValueNameExpandRate[]; - static const char kStatsValueNameFirsReceived[]; - static const char kStatsValueNameFirsSent[]; - static const char kStatsValueNameFrameHeightInput[]; - static const char kStatsValueNameFrameHeightReceived[]; - static const char kStatsValueNameFrameHeightSent[]; - static const char kStatsValueNameFrameRateReceived[]; - static const char kStatsValueNameFrameRateDecoded[]; - static const char kStatsValueNameFrameRateOutput[]; - static const char kStatsValueNameDecodeMs[]; - static const char kStatsValueNameMaxDecodeMs[]; - static const char kStatsValueNameCurrentDelayMs[]; - static const char kStatsValueNameTargetDelayMs[]; - static const char kStatsValueNameJitterBufferMs[]; - static const char kStatsValueNameMinPlayoutDelayMs[]; - static const char kStatsValueNameRenderDelayMs[]; - static const char kStatsValueNameCaptureStartNtpTimeMs[]; - static const char kStatsValueNameFrameRateInput[]; - static const char kStatsValueNameFrameRateSent[]; - static const char kStatsValueNameFrameWidthInput[]; - static const char kStatsValueNameFrameWidthReceived[]; - static const char kStatsValueNameFrameWidthSent[]; - static const char kStatsValueNameJitterReceived[]; - static const char kStatsValueNameNacksReceived[]; - static const char kStatsValueNameNacksSent[]; - static const char kStatsValueNamePlisReceived[]; - static const char kStatsValueNamePlisSent[]; - static const char kStatsValueNamePreferredJitterBufferMs[]; - static const char kStatsValueNameRtt[]; - static const char kStatsValueNameAvailableSendBandwidth[]; - static const char kStatsValueNameAvailableReceiveBandwidth[]; - static const char kStatsValueNameTargetEncBitrate[]; - static const char kStatsValueNameActualEncBitrate[]; - static const char kStatsValueNameRetransmitBitrate[]; - static const char kStatsValueNameTransmitBitrate[]; - static const char kStatsValueNameBucketDelay[]; - static const char kStatsValueNameInitiator[]; - static const char kStatsValueNameTransportType[]; - static const char kStatsValueNameContentName[]; - static const char kStatsValueNameComponent[]; - static const char kStatsValueNameChannelId[]; - static const char kStatsValueNameTrackId[]; - static const char kStatsValueNameSsrc[]; - static const char kStatsValueNameTypingNoiseState[]; - static const char kStatsValueNameDer[]; - static const char kStatsValueNameFingerprint[]; - static const char kStatsValueNameFingerprintAlgorithm[]; - static const char kStatsValueNameIssuerId[]; - static const char kStatsValueNameLocalCertificateId[]; - static const char kStatsValueNameRemoteCertificateId[]; - static const char kStatsValueNameLocalCandidateType[]; - static const char kStatsValueNameRemoteCandidateType[]; - static const char kStatsValueNameRecvPacketGroupArrivalTimeDebug[]; - static const char kStatsValueNameRecvPacketGroupPropagationDeltaDebug[]; - static const char kStatsValueNameRecvPacketGroupPropagationDeltaSumDebug[]; - static const char kStatsValueNameDecodingCTSG[]; - static const char kStatsValueNameDecodingCTN[]; - static const char kStatsValueNameDecodingNormal[]; - static const char kStatsValueNameDecodingPLC[]; - static const char kStatsValueNameDecodingCNG[]; - static const char kStatsValueNameDecodingPLCCNG[]; -}; - -typedef std::vector StatsReports; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_STATSTYPES_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/streamcollection.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/streamcollection.h deleted file mode 100755 index f38adc4..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/streamcollection.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - * 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_STREAMCOLLECTION_H_ -#define TALK_APP_WEBRTC_STREAMCOLLECTION_H_ - -#include -#include - -#include "talk/app/webrtc/peerconnectioninterface.h" - -namespace webrtc { - -// Implementation of StreamCollection. -class StreamCollection : public StreamCollectionInterface { - public: - static talk_base::scoped_refptr Create() { - talk_base::RefCountedObject* implementation = - new talk_base::RefCountedObject(); - return implementation; - } - - static talk_base::scoped_refptr Create( - StreamCollection* streams) { - talk_base::RefCountedObject* implementation = - new talk_base::RefCountedObject(streams); - return implementation; - } - - virtual size_t count() { - return media_streams_.size(); - } - - virtual MediaStreamInterface* at(size_t index) { - return media_streams_.at(index); - } - - virtual MediaStreamInterface* find(const std::string& label) { - for (StreamVector::iterator it = media_streams_.begin(); - it != media_streams_.end(); ++it) { - if ((*it)->label().compare(label) == 0) { - return (*it); - } - } - return NULL; - } - - virtual MediaStreamTrackInterface* FindAudioTrack( - const std::string& id) { - for (size_t i = 0; i < media_streams_.size(); ++i) { - MediaStreamTrackInterface* track = media_streams_[i]->FindAudioTrack(id); - if (track) { - return track; - } - } - return NULL; - } - - virtual MediaStreamTrackInterface* FindVideoTrack( - const std::string& id) { - for (size_t i = 0; i < media_streams_.size(); ++i) { - MediaStreamTrackInterface* track = media_streams_[i]->FindVideoTrack(id); - if (track) { - return track; - } - } - return NULL; - } - - void AddStream(MediaStreamInterface* stream) { - for (StreamVector::iterator it = media_streams_.begin(); - it != media_streams_.end(); ++it) { - if ((*it)->label().compare(stream->label()) == 0) - return; - } - media_streams_.push_back(stream); - } - - void RemoveStream(MediaStreamInterface* remove_stream) { - for (StreamVector::iterator it = media_streams_.begin(); - it != media_streams_.end(); ++it) { - if ((*it)->label().compare(remove_stream->label()) == 0) { - media_streams_.erase(it); - break; - } - } - } - - protected: - StreamCollection() {} - explicit StreamCollection(StreamCollection* original) - : media_streams_(original->media_streams_) { - } - typedef std::vector > - StreamVector; - StreamVector media_streams_; -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_STREAMCOLLECTION_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/umametrics.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/umametrics.h deleted file mode 100755 index a8e6a96..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/umametrics.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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. - */ - -// This file contains enums related to IPv4/IPv6 metrics. - -#ifndef TALK_APP_WEBRTC_UMAMETRICS_H_ -#define TALK_APP_WEBRTC_UMAMETRICS_H_ - -namespace webrtc { - -// Currently this contains information related to WebRTC network/transport -// information. - -// This enum is backed by Chromium's histograms.xml, -// chromium/src/tools/metrics/histograms/histograms.xml -// Existing values cannot be re-ordered and new enums must be added -// before kBoundary. -enum PeerConnectionUMAMetricsCounter { - kPeerConnection_IPv4, - kPeerConnection_IPv6, - kBestConnections_IPv4, - kBestConnections_IPv6, - kBoundary, -}; - -// This enum defines types for UMA samples, which will have a range. -enum PeerConnectionUMAMetricsName { - kNetworkInterfaces_IPv4, // Number of IPv4 interfaces. - kNetworkInterfaces_IPv6, // Number of IPv6 interfaces. - kTimeToConnect, // In milliseconds. -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_UMA6METRICS_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/videosource.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/videosource.h deleted file mode 100755 index b68eca0..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/videosource.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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_APP_WEBRTC_VIDEOSOURCE_H_ -#define TALK_APP_WEBRTC_VIDEOSOURCE_H_ - -#include "talk/app/webrtc/mediastreaminterface.h" -#include "talk/app/webrtc/notifier.h" -#include "talk/app/webrtc/videosourceinterface.h" -#include "talk/app/webrtc/videotrackrenderers.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/sigslot.h" -#include "talk/media/base/videocapturer.h" -#include "talk/media/base/videocommon.h" - -// VideoSource implements VideoSourceInterface. It owns a -// cricket::VideoCapturer and make sure the camera is started at a resolution -// that honors the constraints. -// The state is set depending on the result of starting the capturer. -// If the constraint can't be met or the capturer fails to start, the state -// transition to kEnded, otherwise it transitions to kLive. - -namespace cricket { - -class ChannelManager; - -} // namespace cricket - -namespace webrtc { - -class MediaConstraintsInterface; - -class VideoSource : public Notifier, - public sigslot::has_slots<> { - public: - // Creates an instance of VideoSource. - // VideoSource take ownership of |capturer|. - // |constraints| can be NULL and in that case the camera is opened using a - // default resolution. - static talk_base::scoped_refptr Create( - cricket::ChannelManager* channel_manager, - cricket::VideoCapturer* capturer, - const webrtc::MediaConstraintsInterface* constraints); - - virtual SourceState state() const { return state_; } - virtual const cricket::VideoOptions* options() const { return &options_; } - virtual cricket::VideoRenderer* FrameInput(); - - virtual cricket::VideoCapturer* GetVideoCapturer() { - return video_capturer_.get(); - } - // |output| will be served video frames as long as the underlying capturer - // is running video frames. - virtual void AddSink(cricket::VideoRenderer* output); - virtual void RemoveSink(cricket::VideoRenderer* output); - - protected: - VideoSource(cricket::ChannelManager* channel_manager, - cricket::VideoCapturer* capturer); - virtual ~VideoSource(); - void Initialize(const webrtc::MediaConstraintsInterface* constraints); - - private: - void OnStateChange(cricket::VideoCapturer* capturer, - cricket::CaptureState capture_state); - void SetState(SourceState new_state); - - cricket::ChannelManager* channel_manager_; - talk_base::scoped_ptr video_capturer_; - talk_base::scoped_ptr frame_input_; - - cricket::VideoFormat format_; - cricket::VideoOptions options_; - SourceState state_; -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_VIDEOSOURCE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/videosourceinterface.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/videosourceinterface.h deleted file mode 100755 index 1568deb..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/videosourceinterface.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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_APP_WEBRTC_VIDEOSOURCEINTERFACE_H_ -#define TALK_APP_WEBRTC_VIDEOSOURCEINTERFACE_H_ - -#include "talk/app/webrtc/mediastreaminterface.h" -#include "talk/media/base/mediachannel.h" - -namespace webrtc { - -// VideoSourceInterface is a reference counted source used for VideoTracks. -// The same source can be used in multiple VideoTracks. -// The methods are only supposed to be called by the PeerConnection -// implementation. -class VideoSourceInterface : public MediaSourceInterface { - public: - // Get access to the source implementation of cricket::VideoCapturer. - // This can be used for receiving frames and state notifications. - // But it should not be used for starting or stopping capturing. - virtual cricket::VideoCapturer* GetVideoCapturer() = 0; - // Adds |output| to the source to receive frames. - virtual void AddSink(cricket::VideoRenderer* output) = 0; - virtual void RemoveSink(cricket::VideoRenderer* output) = 0; - virtual const cricket::VideoOptions* options() const = 0; - virtual cricket::VideoRenderer* FrameInput() = 0; - - protected: - virtual ~VideoSourceInterface() {} -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_VIDEOSOURCEINTERFACE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/videosourceproxy.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/videosourceproxy.h deleted file mode 100755 index 4c53f3c..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/videosourceproxy.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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_APP_WEBRTC_VIDEOSOURCEPROXY_H_ -#define TALK_APP_WEBRTC_VIDEOSOURCEPROXY_H_ - -#include "talk/app/webrtc/proxy.h" -#include "talk/app/webrtc/videosourceinterface.h" - -namespace webrtc { - -// VideoSourceProxy makes sure the real VideoSourceInterface implementation is -// destroyed on the signaling thread and marshals all method calls to the -// signaling thread. -BEGIN_PROXY_MAP(VideoSource) - PROXY_CONSTMETHOD0(SourceState, state) - PROXY_METHOD0(cricket::VideoCapturer*, GetVideoCapturer) - PROXY_METHOD1(void, AddSink, cricket::VideoRenderer*) - PROXY_METHOD1(void, RemoveSink, cricket::VideoRenderer*) - PROXY_CONSTMETHOD0(const cricket::VideoOptions*, options) - PROXY_METHOD0(cricket::VideoRenderer*, FrameInput) - PROXY_METHOD1(void, RegisterObserver, ObserverInterface*) - PROXY_METHOD1(void, UnregisterObserver, ObserverInterface*) -END_PROXY() - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_VIDEOSOURCEPROXY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/videotrack.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/videotrack.h deleted file mode 100755 index 06c69b7..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/videotrack.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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_APP_WEBRTC_VIDEOTRACK_H_ -#define TALK_APP_WEBRTC_VIDEOTRACK_H_ - -#include - -#include "talk/app/webrtc/mediastreamtrack.h" -#include "talk/app/webrtc/videosourceinterface.h" -#include "talk/app/webrtc/videotrackrenderers.h" -#include "talk/base/scoped_ref_ptr.h" - -namespace webrtc { - -class VideoTrack : public MediaStreamTrack { - public: - static talk_base::scoped_refptr Create( - const std::string& label, VideoSourceInterface* source); - - virtual void AddRenderer(VideoRendererInterface* renderer); - virtual void RemoveRenderer(VideoRendererInterface* renderer); - virtual VideoSourceInterface* GetSource() const { - return video_source_.get(); - } - virtual bool set_enabled(bool enable); - virtual std::string kind() const; - - protected: - VideoTrack(const std::string& id, VideoSourceInterface* video_source); - ~VideoTrack(); - - private: - VideoTrackRenderers renderers_; - talk_base::scoped_refptr video_source_; -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_VIDEOTRACK_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/videotrackrenderers.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/videotrackrenderers.h deleted file mode 100755 index f1541fa..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/videotrackrenderers.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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_APP_WEBRTC_VIDEOTRACKRENDERERS_H_ -#define TALK_APP_WEBRTC_VIDEOTRACKRENDERERS_H_ - -#include - -#include "talk/app/webrtc/mediastreaminterface.h" -#include "talk/base/criticalsection.h" -#include "talk/media/base/videorenderer.h" - -namespace webrtc { - -// Class used for rendering cricket::VideoFrames to multiple renderers of type -// VideoRendererInterface. -// Each VideoTrack owns a VideoTrackRenderers instance. -// The class is thread safe. Rendering to the added VideoRendererInterfaces is -// done on the same thread as the cricket::VideoRenderer. -class VideoTrackRenderers : public cricket::VideoRenderer { - public: - VideoTrackRenderers(); - ~VideoTrackRenderers(); - - // Implements cricket::VideoRenderer - virtual bool SetSize(int width, int height, int reserved); - virtual bool RenderFrame(const cricket::VideoFrame* frame); - - void AddRenderer(VideoRendererInterface* renderer); - void RemoveRenderer(VideoRendererInterface* renderer); - void SetEnabled(bool enable); - - private: - struct RenderObserver { - explicit RenderObserver(VideoRendererInterface* renderer) - : renderer_(renderer), - size_set_(false) { - } - VideoRendererInterface* renderer_; - bool size_set_; - }; - - int width_; - int height_; - bool enabled_; - std::vector renderers_; - - talk_base::CriticalSection critical_section_; // Protects the above variables -}; - -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_VIDEOTRACKRENDERERS_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/webrtcsdp.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/webrtcsdp.h deleted file mode 100755 index 9d348b7..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/webrtcsdp.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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. - */ - -// This file contain functions for parsing and serializing SDP messages. -// Related RFC/draft including: -// * RFC 4566 - SDP -// * RFC 5245 - ICE -// * RFC 3388 - Grouping of Media Lines in SDP -// * RFC 4568 - SDP Security Descriptions for Media Streams -// * draft-lennox-mmusic-sdp-source-selection-02 - -// Mechanisms for Media Source Selection in SDP - -#ifndef TALK_APP_WEBRTC_WEBRTCSDP_H_ -#define TALK_APP_WEBRTC_WEBRTCSDP_H_ - -#include - -namespace webrtc { - -class IceCandidateInterface; -class JsepIceCandidate; -class JsepSessionDescription; -struct SdpParseError; - -// Serializes the passed in JsepSessionDescription. -// Serialize SessionDescription including candidates if -// JsepSessionDescription has candidates. -// jdesc - The JsepSessionDescription object to be serialized. -// return - SDP string serialized from the arguments. -std::string SdpSerialize(const JsepSessionDescription& jdesc); - -// Serializes the passed in IceCandidateInterface to a SDP string. -// candidate - The candidate to be serialized. -std::string SdpSerializeCandidate(const IceCandidateInterface& candidate); - -// Deserializes the passed in SDP string to a JsepSessionDescription. -// message - SDP string to be Deserialized. -// jdesc - The JsepSessionDescription deserialized from the SDP string. -// error - The detail error information when parsing fails. -// return - true on success, false on failure. -bool SdpDeserialize(const std::string& message, - JsepSessionDescription* jdesc, - SdpParseError* error); - -// Deserializes the passed in SDP string to one JsepIceCandidate. -// The first line must be a=candidate line and only the first line will be -// parsed. -// message - The SDP string to be Deserialized. -// candidates - The JsepIceCandidate from the SDP string. -// error - The detail error information when parsing fails. -// return - true on success, false on failure. -bool SdpDeserializeCandidate(const std::string& message, - JsepIceCandidate* candidate, - SdpParseError* error); -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_WEBRTCSDP_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/webrtcsession.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/webrtcsession.h deleted file mode 100755 index fe3ce81..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/webrtcsession.h +++ /dev/null @@ -1,354 +0,0 @@ -/* - * 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_APP_WEBRTC_WEBRTCSESSION_H_ -#define TALK_APP_WEBRTC_WEBRTCSESSION_H_ - -#include - -#include "talk/app/webrtc/peerconnectioninterface.h" -#include "talk/app/webrtc/dtmfsender.h" -#include "talk/app/webrtc/mediastreamprovider.h" -#include "talk/app/webrtc/datachannel.h" -#include "talk/app/webrtc/statstypes.h" -#include "talk/base/sigslot.h" -#include "talk/base/thread.h" -#include "talk/media/base/mediachannel.h" -#include "talk/p2p/base/session.h" -#include "talk/session/media/mediasession.h" - -namespace cricket { - -class BaseChannel; -class ChannelManager; -class DataChannel; -class StatsReport; -class Transport; -class VideoCapturer; -class VideoChannel; -class VoiceChannel; - -} // namespace cricket - -namespace webrtc { - -class IceRestartAnswerLatch; -class JsepIceCandidate; -class MediaStreamSignaling; -class WebRtcSessionDescriptionFactory; - -extern const char kBundleWithoutRtcpMux[]; -extern const char kCreateChannelFailed[]; -extern const char kInvalidCandidates[]; -extern const char kInvalidSdp[]; -extern const char kMlineMismatch[]; -extern const char kPushDownTDFailed[]; -extern const char kSdpWithoutDtlsFingerprint[]; -extern const char kSdpWithoutSdesCrypto[]; -extern const char kSdpWithoutIceUfragPwd[]; -extern const char kSdpWithoutSdesAndDtlsDisabled[]; -extern const char kSessionError[]; -extern const char kSessionErrorDesc[]; - -// ICE state callback interface. -class IceObserver { - public: - IceObserver() {} - // Called any time the IceConnectionState changes - virtual void OnIceConnectionChange( - PeerConnectionInterface::IceConnectionState new_state) {} - // Called any time the IceGatheringState changes - virtual void OnIceGatheringChange( - PeerConnectionInterface::IceGatheringState new_state) {} - // New Ice candidate have been found. - virtual void OnIceCandidate(const IceCandidateInterface* candidate) = 0; - // All Ice candidates have been found. - // TODO(bemasc): Remove this once callers transition to OnIceGatheringChange. - // (via PeerConnectionObserver) - virtual void OnIceComplete() {} - - protected: - ~IceObserver() {} - - private: - DISALLOW_COPY_AND_ASSIGN(IceObserver); -}; - -class WebRtcSession : public cricket::BaseSession, - public AudioProviderInterface, - public DataChannelFactory, - public VideoProviderInterface, - public DtmfProviderInterface, - public DataChannelProviderInterface { - public: - WebRtcSession(cricket::ChannelManager* channel_manager, - talk_base::Thread* signaling_thread, - talk_base::Thread* worker_thread, - cricket::PortAllocator* port_allocator, - MediaStreamSignaling* mediastream_signaling); - virtual ~WebRtcSession(); - - bool Initialize(const PeerConnectionFactoryInterface::Options& options, - const MediaConstraintsInterface* constraints, - DTLSIdentityServiceInterface* dtls_identity_service, - PeerConnectionInterface::IceTransportsType ice_transport); - // Deletes the voice, video and data channel and changes the session state - // to STATE_RECEIVEDTERMINATE. - void Terminate(); - - void RegisterIceObserver(IceObserver* observer) { - ice_observer_ = observer; - } - - virtual cricket::VoiceChannel* voice_channel() { - return voice_channel_.get(); - } - virtual cricket::VideoChannel* video_channel() { - return video_channel_.get(); - } - virtual cricket::DataChannel* data_channel() { - return data_channel_.get(); - } - - void SetSdesPolicy(cricket::SecurePolicy secure_policy); - cricket::SecurePolicy SdesPolicy() const; - - // Get current ssl role from transport. - bool GetSslRole(talk_base::SSLRole* role); - - // Generic error message callback from WebRtcSession. - // TODO - It may be necessary to supply error code as well. - sigslot::signal0<> SignalError; - - void CreateOffer(CreateSessionDescriptionObserver* observer, - const MediaConstraintsInterface* constraints); - void CreateAnswer(CreateSessionDescriptionObserver* observer, - const MediaConstraintsInterface* constraints); - // The ownership of |desc| will be transferred after this call. - bool SetLocalDescription(SessionDescriptionInterface* desc, - std::string* err_desc); - // The ownership of |desc| will be transferred after this call. - bool SetRemoteDescription(SessionDescriptionInterface* desc, - std::string* err_desc); - bool ProcessIceMessage(const IceCandidateInterface* ice_candidate); - - bool UpdateIce(PeerConnectionInterface::IceTransportsType type); - - const SessionDescriptionInterface* local_description() const { - return local_desc_.get(); - } - const SessionDescriptionInterface* remote_description() const { - return remote_desc_.get(); - } - - // Get the id used as a media stream track's "id" field from ssrc. - virtual bool GetTrackIdBySsrc(uint32 ssrc, std::string* id); - - // AudioMediaProviderInterface implementation. - virtual void SetAudioPlayout(uint32 ssrc, bool enable, - cricket::AudioRenderer* renderer) OVERRIDE; - virtual void SetAudioSend(uint32 ssrc, bool enable, - const cricket::AudioOptions& options, - cricket::AudioRenderer* renderer) OVERRIDE; - virtual void SetAudioPlayoutVolume(uint32 ssrc, double volume) OVERRIDE; - - // Implements VideoMediaProviderInterface. - virtual bool SetCaptureDevice(uint32 ssrc, - cricket::VideoCapturer* camera) OVERRIDE; - virtual void SetVideoPlayout(uint32 ssrc, - bool enable, - cricket::VideoRenderer* renderer) OVERRIDE; - virtual void SetVideoSend(uint32 ssrc, bool enable, - const cricket::VideoOptions* options) OVERRIDE; - - // Implements DtmfProviderInterface. - virtual bool CanInsertDtmf(const std::string& track_id); - virtual bool InsertDtmf(const std::string& track_id, - int code, int duration); - virtual sigslot::signal0<>* GetOnDestroyedSignal(); - - // Implements DataChannelProviderInterface. - virtual bool SendData(const cricket::SendDataParams& params, - const talk_base::Buffer& payload, - cricket::SendDataResult* result) OVERRIDE; - virtual bool ConnectDataChannel(DataChannel* webrtc_data_channel) OVERRIDE; - virtual void DisconnectDataChannel(DataChannel* webrtc_data_channel) OVERRIDE; - virtual void AddSctpDataStream(uint32 sid) OVERRIDE; - virtual void RemoveSctpDataStream(uint32 sid) OVERRIDE; - virtual bool ReadyToSendData() const OVERRIDE; - - // Implements DataChannelFactory. - talk_base::scoped_refptr CreateDataChannel( - const std::string& label, - const InternalDataChannelInit* config) OVERRIDE; - - cricket::DataChannelType data_channel_type() const; - - bool IceRestartPending() const; - - void ResetIceRestartLatch(); - - // Called when an SSLIdentity is generated or retrieved by - // WebRTCSessionDescriptionFactory. Should happen before setLocalDescription. - void OnIdentityReady(talk_base::SSLIdentity* identity); - - // For unit test. - bool waiting_for_identity() const; - - private: - // Indicates the type of SessionDescription in a call to SetLocalDescription - // and SetRemoteDescription. - enum Action { - kOffer, - kPrAnswer, - kAnswer, - }; - - // Invokes ConnectChannels() on transport proxies, which initiates ice - // candidates allocation. - bool StartCandidatesAllocation(); - bool UpdateSessionState(Action action, cricket::ContentSource source, - std::string* err_desc); - static Action GetAction(const std::string& type); - - // Transport related callbacks, override from cricket::BaseSession. - virtual void OnTransportRequestSignaling(cricket::Transport* transport); - virtual void OnTransportConnecting(cricket::Transport* transport); - virtual void OnTransportWritable(cricket::Transport* transport); - virtual void OnTransportCompleted(cricket::Transport* transport); - virtual void OnTransportFailed(cricket::Transport* transport); - virtual void OnTransportProxyCandidatesReady( - cricket::TransportProxy* proxy, - const cricket::Candidates& candidates); - virtual void OnCandidatesAllocationDone(); - - // Creates local session description with audio and video contents. - bool CreateDefaultLocalDescription(); - // Enables media channels to allow sending of media. - void EnableChannels(); - // Creates a JsepIceCandidate and adds it to the local session description - // and notify observers. Called when a new local candidate have been found. - void ProcessNewLocalCandidate(const std::string& content_name, - const cricket::Candidates& candidates); - // Returns the media index for a local ice candidate given the content name. - // Returns false if the local session description does not have a media - // content called |content_name|. - bool GetLocalCandidateMediaIndex(const std::string& content_name, - int* sdp_mline_index); - // Uses all remote candidates in |remote_desc| in this session. - bool UseCandidatesInSessionDescription( - const SessionDescriptionInterface* remote_desc); - // Uses |candidate| in this session. - bool UseCandidate(const IceCandidateInterface* candidate); - // Deletes the corresponding channel of contents that don't exist in |desc|. - // |desc| can be null. This means that all channels are deleted. - void RemoveUnusedChannelsAndTransports( - const cricket::SessionDescription* desc); - - // Allocates media channels based on the |desc|. If |desc| doesn't have - // the BUNDLE option, this method will disable BUNDLE in PortAllocator. - // This method will also delete any existing media channels before creating. - bool CreateChannels(const cricket::SessionDescription* desc); - - // Helper methods to create media channels. - bool CreateVoiceChannel(const cricket::ContentInfo* content); - bool CreateVideoChannel(const cricket::ContentInfo* content); - bool CreateDataChannel(const cricket::ContentInfo* content); - - // Copy the candidates from |saved_candidates_| to |dest_desc|. - // The |saved_candidates_| will be cleared after this function call. - void CopySavedCandidates(SessionDescriptionInterface* dest_desc); - - // Listens to SCTP CONTROL messages on unused SIDs and process them as OPEN - // messages. - void OnDataChannelMessageReceived(cricket::DataChannel* channel, - const cricket::ReceiveDataParams& params, - const talk_base::Buffer& payload); - - bool GetLocalTrackId(uint32 ssrc, std::string* track_id); - bool GetRemoteTrackId(uint32 ssrc, std::string* track_id); - - std::string BadStateErrMsg(State state); - void SetIceConnectionState(PeerConnectionInterface::IceConnectionState state); - - bool ValidateBundleSettings(const cricket::SessionDescription* desc); - bool HasRtcpMuxEnabled(const cricket::ContentInfo* content); - // Below methods are helper methods which verifies SDP. - bool ValidateSessionDescription(const SessionDescriptionInterface* sdesc, - cricket::ContentSource source, - std::string* err_desc); - - // Check if a call to SetLocalDescription is acceptable with |action|. - bool ExpectSetLocalDescription(Action action); - // Check if a call to SetRemoteDescription is acceptable with |action|. - bool ExpectSetRemoteDescription(Action action); - // Verifies a=setup attribute as per RFC 5763. - bool ValidateDtlsSetupAttribute(const cricket::SessionDescription* desc, - Action action); - - std::string GetSessionErrorMsg(); - - talk_base::scoped_ptr voice_channel_; - talk_base::scoped_ptr video_channel_; - talk_base::scoped_ptr data_channel_; - cricket::ChannelManager* channel_manager_; - MediaStreamSignaling* mediastream_signaling_; - IceObserver* ice_observer_; - PeerConnectionInterface::IceConnectionState ice_connection_state_; - talk_base::scoped_ptr local_desc_; - talk_base::scoped_ptr remote_desc_; - // Candidates that arrived before the remote description was set. - std::vector saved_candidates_; - // If the remote peer is using a older version of implementation. - bool older_version_remote_peer_; - bool dtls_enabled_; - // Specifies which kind of data channel is allowed. This is controlled - // by the chrome command-line flag and constraints: - // 1. If chrome command-line switch 'enable-sctp-data-channels' is enabled, - // constraint kEnableDtlsSrtp is true, and constaint kEnableRtpDataChannels is - // not set or false, SCTP is allowed (DCT_SCTP); - // 2. If constraint kEnableRtpDataChannels is true, RTP is allowed (DCT_RTP); - // 3. If both 1&2 are false, data channel is not allowed (DCT_NONE). - cricket::DataChannelType data_channel_type_; - talk_base::scoped_ptr ice_restart_latch_; - - talk_base::scoped_ptr - webrtc_session_desc_factory_; - - sigslot::signal0<> SignalVoiceChannelDestroyed; - sigslot::signal0<> SignalVideoChannelDestroyed; - sigslot::signal0<> SignalDataChannelDestroyed; - - // Member variables for caching global options. - cricket::AudioOptions audio_options_; - cricket::VideoOptions video_options_; - - DISALLOW_COPY_AND_ASSIGN(WebRtcSession); -}; -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_WEBRTCSESSION_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/webrtcsessiondescriptionfactory.h b/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/webrtcsessiondescriptionfactory.h deleted file mode 100755 index d954669..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/app/webrtc/webrtcsessiondescriptionfactory.h +++ /dev/null @@ -1,169 +0,0 @@ -/* - * libjingle - * Copyright 2013, 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_WEBRTCSESSIONDESCRIPTIONFACTORY_H_ -#define TALK_APP_WEBRTC_WEBRTCSESSIONDESCRIPTIONFACTORY_H_ - -#include "talk/app/webrtc/peerconnectioninterface.h" -#include "talk/base/messagehandler.h" -#include "talk/p2p/base/transportdescriptionfactory.h" -#include "talk/session/media/mediasession.h" - -namespace cricket { -class ChannelManager; -class TransportDescriptionFactory; -} // namespace cricket - -namespace webrtc { -class CreateSessionDescriptionObserver; -class MediaConstraintsInterface; -class MediaStreamSignaling; -class SessionDescriptionInterface; -class WebRtcSession; - -// DTLS identity request callback class. -class WebRtcIdentityRequestObserver : public DTLSIdentityRequestObserver, - public sigslot::has_slots<> { - public: - // DTLSIdentityRequestObserver overrides. - virtual void OnFailure(int error) { - SignalRequestFailed(error); - } - virtual void OnSuccess(const std::string& der_cert, - const std::string& der_private_key) { - SignalIdentityReady(der_cert, der_private_key); - } - - sigslot::signal1 SignalRequestFailed; - sigslot::signal2 SignalIdentityReady; -}; - -struct CreateSessionDescriptionRequest { - enum Type { - kOffer, - kAnswer, - }; - - CreateSessionDescriptionRequest( - Type type, - CreateSessionDescriptionObserver* observer, - const cricket::MediaSessionOptions& options) - : type(type), - observer(observer), - options(options) {} - - Type type; - talk_base::scoped_refptr observer; - cricket::MediaSessionOptions options; -}; - -// This class is used to create offer/answer session description with regards to -// the async DTLS identity generation for WebRtcSession. -// It queues the create offer/answer request until the DTLS identity -// request has completed, i.e. when OnIdentityRequestFailed or OnIdentityReady -// is called. -class WebRtcSessionDescriptionFactory : public talk_base::MessageHandler, - public sigslot::has_slots<> { - public: - WebRtcSessionDescriptionFactory( - talk_base::Thread* signaling_thread, - cricket::ChannelManager* channel_manager, - MediaStreamSignaling* mediastream_signaling, - DTLSIdentityServiceInterface* dtls_identity_service, - // TODO(jiayl): remove the dependency on session once b/10226852 is fixed. - WebRtcSession* session, - const std::string& session_id, - cricket::DataChannelType dct, - bool dtls_enabled); - virtual ~WebRtcSessionDescriptionFactory(); - - static void CopyCandidatesFromSessionDescription( - const SessionDescriptionInterface* source_desc, - SessionDescriptionInterface* dest_desc); - - void CreateOffer( - CreateSessionDescriptionObserver* observer, - const MediaConstraintsInterface* constraints); - void CreateAnswer( - CreateSessionDescriptionObserver* observer, - const MediaConstraintsInterface* constraints); - - void SetSdesPolicy(cricket::SecurePolicy secure_policy); - cricket::SecurePolicy SdesPolicy() const; - - sigslot::signal1 SignalIdentityReady; - - // For testing. - bool waiting_for_identity() const { - return identity_request_state_ == IDENTITY_WAITING; - } - - private: - enum IdentityRequestState { - IDENTITY_NOT_NEEDED, - IDENTITY_WAITING, - IDENTITY_SUCCEEDED, - IDENTITY_FAILED, - }; - - // MessageHandler implementation. - virtual void OnMessage(talk_base::Message* msg); - - void InternalCreateOffer(CreateSessionDescriptionRequest request); - void InternalCreateAnswer(CreateSessionDescriptionRequest request); - void PostCreateSessionDescriptionFailed( - CreateSessionDescriptionObserver* observer, - const std::string& error); - void PostCreateSessionDescriptionSucceeded( - CreateSessionDescriptionObserver* observer, - SessionDescriptionInterface* description); - - void OnIdentityRequestFailed(int error); - void OnIdentityReady(const std::string& der_cert, - const std::string& der_private_key); - void SetIdentity(talk_base::SSLIdentity* identity); - - std::queue - create_session_description_requests_; - talk_base::Thread* signaling_thread_; - MediaStreamSignaling* mediastream_signaling_; - cricket::TransportDescriptionFactory transport_desc_factory_; - cricket::MediaSessionDescriptionFactory session_desc_factory_; - uint64 session_version_; - talk_base::scoped_ptr identity_service_; - talk_base::scoped_refptr - identity_request_observer_; - WebRtcSession* session_; - std::string session_id_; - cricket::DataChannelType data_channel_type_; - IdentityRequestState identity_request_state_; - - DISALLOW_COPY_AND_ASSIGN(WebRtcSessionDescriptionFactory); -}; -} // namespace webrtc - -#endif // TALK_APP_WEBRTC_WEBRTCSESSIONDESCRIPTIONFACTORY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/asyncfile.h b/thirdparties/common/include/webrtc-sdk/talk/base/asyncfile.h deleted file mode 100755 index cfc3e26..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/asyncfile.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_BASE_ASYNCFILE_H__ -#define TALK_BASE_ASYNCFILE_H__ - -#include "talk/base/sigslot.h" - -namespace talk_base { - -// Provides the ability to perform file I/O asynchronously. -// TODO: Create a common base class with AsyncSocket. -class AsyncFile { - public: - AsyncFile(); - virtual ~AsyncFile(); - - // Determines whether the file will receive read events. - virtual bool readable() = 0; - virtual void set_readable(bool value) = 0; - - // Determines whether the file will receive write events. - virtual bool writable() = 0; - virtual void set_writable(bool value) = 0; - - sigslot::signal1 SignalReadEvent; - sigslot::signal1 SignalWriteEvent; - sigslot::signal2 SignalCloseEvent; -}; - -} // namespace talk_base - -#endif // TALK_BASE_ASYNCFILE_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/asynchttprequest.h b/thirdparties/common/include/webrtc-sdk/talk/base/asynchttprequest.h deleted file mode 100755 index d4de520..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/asynchttprequest.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_BASE_ASYNCHTTPREQUEST_H_ -#define TALK_BASE_ASYNCHTTPREQUEST_H_ - -#include -#include "talk/base/event.h" -#include "talk/base/httpclient.h" -#include "talk/base/signalthread.h" -#include "talk/base/socketpool.h" -#include "talk/base/sslsocketfactory.h" - -namespace talk_base { - -class FirewallManager; - -/////////////////////////////////////////////////////////////////////////////// -// AsyncHttpRequest -// Performs an HTTP request on a background thread. Notifies on the foreground -// thread once the request is done (successfully or unsuccessfully). -/////////////////////////////////////////////////////////////////////////////// - -class AsyncHttpRequest : public SignalThread { - public: - explicit AsyncHttpRequest(const std::string &user_agent); - ~AsyncHttpRequest(); - - // If start_delay is less than or equal to zero, this starts immediately. - // Start_delay defaults to zero. - int start_delay() const { return start_delay_; } - void set_start_delay(int delay) { start_delay_ = delay; } - - const ProxyInfo& proxy() const { return proxy_; } - void set_proxy(const ProxyInfo& proxy) { - proxy_ = proxy; - } - void set_firewall(FirewallManager * firewall) { - firewall_ = firewall; - } - - // The DNS name of the host to connect to. - const std::string& host() { return host_; } - void set_host(const std::string& host) { host_ = host; } - - // The port to connect to on the target host. - int port() { return port_; } - void set_port(int port) { port_ = port; } - - // Whether the request should use SSL. - bool secure() { return secure_; } - void set_secure(bool secure) { secure_ = secure; } - - // Time to wait on the download, in ms. - int timeout() { return timeout_; } - void set_timeout(int timeout) { timeout_ = timeout; } - - // Fail redirects to allow analysis of redirect urls, etc. - bool fail_redirect() const { return fail_redirect_; } - void set_fail_redirect(bool redirect) { fail_redirect_ = redirect; } - - // Returns the redirect when redirection occurs - const std::string& response_redirect() { return response_redirect_; } - - HttpRequestData& request() { return client_.request(); } - HttpResponseData& response() { return client_.response(); } - HttpErrorType error() { return error_; } - - protected: - void set_error(HttpErrorType error) { error_ = error; } - virtual void OnWorkStart(); - virtual void OnWorkStop(); - void OnComplete(HttpClient* client, HttpErrorType error); - virtual void OnMessage(Message* message); - virtual void DoWork(); - - private: - void LaunchRequest(); - - int start_delay_; - ProxyInfo proxy_; - FirewallManager* firewall_; - std::string host_; - int port_; - bool secure_; - int timeout_; - bool fail_redirect_; - SslSocketFactory factory_; - ReuseSocketPool pool_; - HttpClient client_; - HttpErrorType error_; - std::string response_redirect_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_ASYNCHTTPREQUEST_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/asyncinvoker-inl.h b/thirdparties/common/include/webrtc-sdk/talk/base/asyncinvoker-inl.h deleted file mode 100755 index b676301..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/asyncinvoker-inl.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - * 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_BASE_ASYNCINVOKER_INL_H_ -#define TALK_BASE_ASYNCINVOKER_INL_H_ - -#include "talk/base/bind.h" -#include "talk/base/callback.h" -#include "talk/base/criticalsection.h" -#include "talk/base/messagehandler.h" -#include "talk/base/refcount.h" -#include "talk/base/scoped_ref_ptr.h" -#include "talk/base/sigslot.h" -#include "talk/base/thread.h" - -namespace talk_base { - -class AsyncInvoker; - -// Helper class for AsyncInvoker. Runs a task and triggers a callback -// on the calling thread if necessary. Instances are ref-counted so their -// lifetime can be independent of AsyncInvoker. -class AsyncClosure : public RefCountInterface { - public: - virtual ~AsyncClosure() {} - // Runs the asynchronous task, and triggers a callback to the calling - // thread if needed. Should be called from the target thread. - virtual void Execute() = 0; -}; - -// Simple closure that doesn't trigger a callback for the calling thread. -template -class FireAndForgetAsyncClosure : public AsyncClosure { - public: - explicit FireAndForgetAsyncClosure(const FunctorT& functor) - : functor_(functor) {} - virtual void Execute() { - functor_(); - } - private: - FunctorT functor_; -}; - -// Base class for closures that may trigger a callback for the calling thread. -// Listens for the "destroyed" signals from the calling thread and the invoker, -// and cancels the callback to the calling thread if either is destroyed. -class NotifyingAsyncClosureBase : public AsyncClosure, - public sigslot::has_slots<> { - public: - virtual ~NotifyingAsyncClosureBase() { disconnect_all(); } - - protected: - NotifyingAsyncClosureBase(AsyncInvoker* invoker, Thread* calling_thread); - void TriggerCallback(); - void SetCallback(const Callback0& callback) { - CritScope cs(&crit_); - callback_ = callback; - } - bool CallbackCanceled() const { return calling_thread_ == NULL; } - - private: - Callback0 callback_; - CriticalSection crit_; - AsyncInvoker* invoker_; - Thread* calling_thread_; - - void CancelCallback(); -}; - -// Closures that have a non-void return value and require a callback. -template -class NotifyingAsyncClosure : public NotifyingAsyncClosureBase { - public: - NotifyingAsyncClosure(AsyncInvoker* invoker, - Thread* calling_thread, - const FunctorT& functor, - void (HostT::*callback)(ReturnT), - HostT* callback_host) - : NotifyingAsyncClosureBase(invoker, calling_thread), - functor_(functor), - callback_(callback), - callback_host_(callback_host) {} - virtual void Execute() { - ReturnT result = functor_(); - if (!CallbackCanceled()) { - SetCallback(Callback0(Bind(callback_, callback_host_, result))); - TriggerCallback(); - } - } - - private: - FunctorT functor_; - void (HostT::*callback_)(ReturnT); - HostT* callback_host_; -}; - -// Closures that have a void return value and require a callback. -template -class NotifyingAsyncClosure - : public NotifyingAsyncClosureBase { - public: - NotifyingAsyncClosure(AsyncInvoker* invoker, - Thread* calling_thread, - const FunctorT& functor, - void (HostT::*callback)(), - HostT* callback_host) - : NotifyingAsyncClosureBase(invoker, calling_thread), - functor_(functor) { - SetCallback(Callback0(Bind(callback, callback_host))); - } - virtual void Execute() { - functor_(); - TriggerCallback(); - } - - private: - FunctorT functor_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_ASYNCINVOKER_INL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/asyncinvoker.h b/thirdparties/common/include/webrtc-sdk/talk/base/asyncinvoker.h deleted file mode 100755 index 4b692cd..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/asyncinvoker.h +++ /dev/null @@ -1,151 +0,0 @@ -/* - * 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_BASE_ASYNCINVOKER_H_ -#define TALK_BASE_ASYNCINVOKER_H_ - -#include "talk/base/asyncinvoker-inl.h" -#include "talk/base/bind.h" -#include "talk/base/sigslot.h" -#include "talk/base/scopedptrcollection.h" -#include "talk/base/thread.h" - -namespace talk_base { - -// Invokes function objects (aka functors) asynchronously on a Thread, and -// owns the lifetime of calls (ie, when this object is destroyed, calls in -// flight are cancelled). AsyncInvoker can optionally execute a user-specified -// function when the asynchronous call is complete, or operates in -// fire-and-forget mode otherwise. -// -// AsyncInvoker does not own the thread it calls functors on. -// -// A note about async calls and object lifetimes: users should -// be mindful of object lifetimes when calling functions asynchronously and -// ensure objects used by the function _cannot_ be deleted between the -// invocation and execution of the functor. AsyncInvoker is designed to -// help: any calls in flight will be cancelled when the AsyncInvoker used to -// make the call is destructed, and any calls executing will be allowed to -// complete before AsyncInvoker destructs. -// -// The easiest way to ensure lifetimes are handled correctly is to create a -// class that owns the Thread and AsyncInvoker objects, and then call its -// methods asynchronously as needed. -// -// Example: -// class MyClass { -// public: -// void FireAsyncTaskWithResult(Thread* thread, int x) { -// // Specify a callback to get the result upon completion. -// invoker_.AsyncInvoke( -// thread, Bind(&MyClass::AsyncTaskWithResult, this, x), -// &MyClass::OnTaskComplete, this); -// } -// void FireAnotherAsyncTask(Thread* thread) { -// // No callback specified means fire-and-forget. -// invoker_.AsyncInvoke( -// thread, Bind(&MyClass::AnotherAsyncTask, this)); -// -// private: -// int AsyncTaskWithResult(int x) { -// // Some long running process... -// return x * x; -// } -// void AnotherAsyncTask() { -// // Some other long running process... -// } -// void OnTaskComplete(int result) { result_ = result; } -// -// AsyncInvoker invoker_; -// int result_; -// }; -class AsyncInvoker : public MessageHandler { - public: - AsyncInvoker(); - virtual ~AsyncInvoker(); - - // Call |functor| asynchronously on |thread|, with no callback upon - // completion. Returns immediately. - template - void AsyncInvoke(Thread* thread, - const FunctorT& functor, - uint32 id = 0) { - AsyncClosure* closure = - new RefCountedObject >(functor); - DoInvoke(thread, closure, id); - } - - // Call |functor| asynchronously on |thread|, calling |callback| when done. - template - void AsyncInvoke(Thread* thread, - const FunctorT& functor, - void (HostT::*callback)(ReturnT), - HostT* callback_host, - uint32 id = 0) { - AsyncClosure* closure = - new RefCountedObject >( - this, Thread::Current(), functor, callback, callback_host); - DoInvoke(thread, closure, id); - } - - // Call |functor| asynchronously on |thread|, calling |callback| when done. - // Overloaded for void return. - template - void AsyncInvoke(Thread* thread, - const FunctorT& functor, - void (HostT::*callback)(), - HostT* callback_host, - uint32 id = 0) { - AsyncClosure* closure = - new RefCountedObject >( - this, Thread::Current(), functor, callback, callback_host); - DoInvoke(thread, closure, id); - } - - // Synchronously execute on |thread| all outstanding calls we own - // that are pending on |thread|, and wait for calls to complete - // before returning. Optionally filter by message id. - // The destructor will not wait for outstanding calls, so if that - // behavior is desired, call Flush() before destroying this object. - void Flush(Thread* thread, uint32 id = MQID_ANY); - - // Signaled when this object is destructed. - sigslot::signal0<> SignalInvokerDestroyed; - - private: - virtual void OnMessage(Message* msg); - void DoInvoke(Thread* thread, AsyncClosure* closure, uint32 id); - - bool destroying_; - - DISALLOW_COPY_AND_ASSIGN(AsyncInvoker); -}; - -} // namespace talk_base - - -#endif // TALK_BASE_ASYNCINVOKER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/asyncpacketsocket.h b/thirdparties/common/include/webrtc-sdk/talk/base/asyncpacketsocket.h deleted file mode 100755 index 7e86f36..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/asyncpacketsocket.h +++ /dev/null @@ -1,157 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_ASYNCPACKETSOCKET_H_ -#define TALK_BASE_ASYNCPACKETSOCKET_H_ - -#include "talk/base/dscp.h" -#include "talk/base/sigslot.h" -#include "talk/base/socket.h" -#include "talk/base/timeutils.h" - -namespace talk_base { - -// This structure holds the info needed to update the packet send time header -// extension, including the information needed to update the authentication tag -// after changing the value. -struct PacketTimeUpdateParams { - PacketTimeUpdateParams() - : rtp_sendtime_extension_id(-1), srtp_auth_tag_len(-1), - srtp_packet_index(-1) { - } - - int rtp_sendtime_extension_id; // extension header id present in packet. - std::vector srtp_auth_key; // Authentication key. - int srtp_auth_tag_len; // Authentication tag length. - int64 srtp_packet_index; // Required for Rtp Packet authentication. -}; - -// This structure holds meta information for the packet which is about to send -// over network. -struct PacketOptions { - PacketOptions() : dscp(DSCP_NO_CHANGE) {} - explicit PacketOptions(DiffServCodePoint dscp) : dscp(dscp) {} - - DiffServCodePoint dscp; - PacketTimeUpdateParams packet_time_params; -}; - -// This structure will have the information about when packet is actually -// received by socket. -struct PacketTime { - PacketTime() : timestamp(-1), not_before(-1) {} - PacketTime(int64 timestamp, int64 not_before) - : timestamp(timestamp), not_before(not_before) { - } - - int64 timestamp; // Receive time after socket delivers the data. - int64 not_before; // Earliest possible time the data could have arrived, - // indicating the potential error in the |timestamp| value, - // in case the system, is busy. For example, the time of - // the last select() call. - // If unknown, this value will be set to zero. -}; - -inline PacketTime CreatePacketTime(int64 not_before) { - return PacketTime(TimeMicros(), not_before); -} - -// Provides the ability to receive packets asynchronously. Sends are not -// buffered since it is acceptable to drop packets under high load. -class AsyncPacketSocket : public sigslot::has_slots<> { - public: - enum State { - STATE_CLOSED, - STATE_BINDING, - STATE_BOUND, - STATE_CONNECTING, - STATE_CONNECTED - }; - - AsyncPacketSocket() { } - virtual ~AsyncPacketSocket() { } - - // Returns current local address. Address may be set to NULL if the - // socket is not bound yet (GetState() returns STATE_BINDING). - virtual SocketAddress GetLocalAddress() const = 0; - - // Returns remote address. Returns zeroes if this is not a client TCP socket. - virtual SocketAddress GetRemoteAddress() const = 0; - - // Send a packet. - virtual int Send(const void *pv, size_t cb, const PacketOptions& options) = 0; - virtual int SendTo(const void *pv, size_t cb, const SocketAddress& addr, - const PacketOptions& options) = 0; - - // Close the socket. - virtual int Close() = 0; - - // Returns current state of the socket. - virtual State GetState() const = 0; - - // Get/set options. - virtual int GetOption(Socket::Option opt, int* value) = 0; - virtual int SetOption(Socket::Option opt, int value) = 0; - - // Get/Set current error. - // TODO: Remove SetError(). - virtual int GetError() const = 0; - virtual void SetError(int error) = 0; - - // Emitted each time a packet is read. Used only for UDP and - // connected TCP sockets. - sigslot::signal5 SignalReadPacket; - - // Emitted when the socket is currently able to send. - sigslot::signal1 SignalReadyToSend; - - // Emitted after address for the socket is allocated, i.e. binding - // is finished. State of the socket is changed from BINDING to BOUND - // (for UDP and server TCP sockets) or CONNECTING (for client TCP - // sockets). - sigslot::signal2 SignalAddressReady; - - // Emitted for client TCP sockets when state is changed from - // CONNECTING to CONNECTED. - sigslot::signal1 SignalConnect; - - // Emitted for client TCP sockets when state is changed from - // CONNECTED to CLOSED. - sigslot::signal2 SignalClose; - - // Used only for listening TCP sockets. - sigslot::signal2 SignalNewConnection; - - private: - DISALLOW_EVIL_CONSTRUCTORS(AsyncPacketSocket); -}; - -} // namespace talk_base - -#endif // TALK_BASE_ASYNCPACKETSOCKET_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/asyncresolverinterface.h b/thirdparties/common/include/webrtc-sdk/talk/base/asyncresolverinterface.h deleted file mode 100755 index 00d7691..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/asyncresolverinterface.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * libjingle - * Copyright 2013, 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_BASE_ASYNCRESOLVERINTERFACE_H_ -#define TALK_BASE_ASYNCRESOLVERINTERFACE_H_ - -#include "talk/base/sigslot.h" -#include "talk/base/socketaddress.h" - -namespace talk_base { - -// This interface defines the methods to resolve the address asynchronously. -class AsyncResolverInterface { - public: - AsyncResolverInterface() {} - virtual ~AsyncResolverInterface() {} - - // Start address resolve process. - virtual void Start(const SocketAddress& addr) = 0; - // Returns top most resolved address of |family| - virtual bool GetResolvedAddress(int family, SocketAddress* addr) const = 0; - // Returns error from resolver. - virtual int GetError() const = 0; - // Delete the resolver. - virtual void Destroy(bool wait) = 0; - // Returns top most resolved IPv4 address if address is resolved successfully. - // Otherwise returns address set in SetAddress. - SocketAddress address() const { - SocketAddress addr; - GetResolvedAddress(AF_INET, &addr); - return addr; - } - - // This signal is fired when address resolve process is completed. - sigslot::signal1 SignalDone; -}; - -} // namespace talk_base - -#endif diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/asyncsocket.h b/thirdparties/common/include/webrtc-sdk/talk/base/asyncsocket.h deleted file mode 100755 index 3655fbc..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/asyncsocket.h +++ /dev/null @@ -1,141 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_BASE_ASYNCSOCKET_H_ -#define TALK_BASE_ASYNCSOCKET_H_ - -#include "talk/base/common.h" -#include "talk/base/sigslot.h" -#include "talk/base/socket.h" - -namespace talk_base { - -// TODO: Remove Socket and rename AsyncSocket to Socket. - -// Provides the ability to perform socket I/O asynchronously. -class AsyncSocket : public Socket { - public: - AsyncSocket(); - virtual ~AsyncSocket(); - - virtual AsyncSocket* Accept(SocketAddress* paddr) = 0; - - // SignalReadEvent and SignalWriteEvent use multi_threaded_local to allow - // access concurrently from different thread. - // For example SignalReadEvent::connect will be called in AsyncUDPSocket ctor - // but at the same time the SocketDispatcher maybe signaling the read event. - // ready to read - sigslot::signal1 SignalReadEvent; - // ready to write - sigslot::signal1 SignalWriteEvent; - sigslot::signal1 SignalConnectEvent; // connected - sigslot::signal2 SignalCloseEvent; // closed -}; - -class AsyncSocketAdapter : public AsyncSocket, public sigslot::has_slots<> { - public: - // The adapted socket may explicitly be NULL, and later assigned using Attach. - // However, subclasses which support detached mode must override any methods - // that will be called during the detached period (usually GetState()), to - // avoid dereferencing a null pointer. - explicit AsyncSocketAdapter(AsyncSocket* socket); - virtual ~AsyncSocketAdapter(); - void Attach(AsyncSocket* socket); - virtual SocketAddress GetLocalAddress() const { - return socket_->GetLocalAddress(); - } - virtual SocketAddress GetRemoteAddress() const { - return socket_->GetRemoteAddress(); - } - virtual int Bind(const SocketAddress& addr) { - return socket_->Bind(addr); - } - virtual int Connect(const SocketAddress& addr) { - return socket_->Connect(addr); - } - virtual int Send(const void* pv, size_t cb) { - return socket_->Send(pv, cb); - } - virtual int SendTo(const void* pv, size_t cb, const SocketAddress& addr) { - return socket_->SendTo(pv, cb, addr); - } - virtual int Recv(void* pv, size_t cb) { - return socket_->Recv(pv, cb); - } - virtual int RecvFrom(void* pv, size_t cb, SocketAddress* paddr) { - return socket_->RecvFrom(pv, cb, paddr); - } - virtual int Listen(int backlog) { - return socket_->Listen(backlog); - } - virtual AsyncSocket* Accept(SocketAddress* paddr) { - return socket_->Accept(paddr); - } - virtual int Close() { - return socket_->Close(); - } - virtual int GetError() const { - return socket_->GetError(); - } - virtual void SetError(int error) { - return socket_->SetError(error); - } - virtual ConnState GetState() const { - return socket_->GetState(); - } - virtual int EstimateMTU(uint16* mtu) { - return socket_->EstimateMTU(mtu); - } - virtual int GetOption(Option opt, int* value) { - return socket_->GetOption(opt, value); - } - virtual int SetOption(Option opt, int value) { - return socket_->SetOption(opt, value); - } - - protected: - virtual void OnConnectEvent(AsyncSocket* socket) { - SignalConnectEvent(this); - } - virtual void OnReadEvent(AsyncSocket* socket) { - SignalReadEvent(this); - } - virtual void OnWriteEvent(AsyncSocket* socket) { - SignalWriteEvent(this); - } - virtual void OnCloseEvent(AsyncSocket* socket, int err) { - SignalCloseEvent(this, err); - } - - AsyncSocket* socket_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_ASYNCSOCKET_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/asynctcpsocket.h b/thirdparties/common/include/webrtc-sdk/talk/base/asynctcpsocket.h deleted file mode 100755 index 0fb4828..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/asynctcpsocket.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_BASE_ASYNCTCPSOCKET_H_ -#define TALK_BASE_ASYNCTCPSOCKET_H_ - -#include "talk/base/asyncpacketsocket.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/socketfactory.h" - -namespace talk_base { - -// Simulates UDP semantics over TCP. Send and Recv packet sizes -// are preserved, and drops packets silently on Send, rather than -// buffer them in user space. -class AsyncTCPSocketBase : public AsyncPacketSocket { - public: - AsyncTCPSocketBase(AsyncSocket* socket, bool listen, size_t max_packet_size); - virtual ~AsyncTCPSocketBase(); - - // Pure virtual methods to send and recv data. - virtual int Send(const void *pv, size_t cb, - const talk_base::PacketOptions& options) = 0; - virtual void ProcessInput(char* data, size_t* len) = 0; - // Signals incoming connection. - virtual void HandleIncomingConnection(AsyncSocket* socket) = 0; - - virtual SocketAddress GetLocalAddress() const; - virtual SocketAddress GetRemoteAddress() const; - virtual int SendTo(const void *pv, size_t cb, const SocketAddress& addr, - const talk_base::PacketOptions& options); - virtual int Close(); - - virtual State GetState() const; - virtual int GetOption(Socket::Option opt, int* value); - virtual int SetOption(Socket::Option opt, int value); - virtual int GetError() const; - virtual void SetError(int error); - - protected: - // Binds and connects |socket| and creates AsyncTCPSocket for - // it. Takes ownership of |socket|. Returns NULL if bind() or - // connect() fail (|socket| is destroyed in that case). - static AsyncSocket* ConnectSocket(AsyncSocket* socket, - const SocketAddress& bind_address, - const SocketAddress& remote_address); - virtual int SendRaw(const void* pv, size_t cb); - int FlushOutBuffer(); - // Add data to |outbuf_|. - void AppendToOutBuffer(const void* pv, size_t cb); - - // Helper methods for |outpos_|. - bool IsOutBufferEmpty() const { return outpos_ == 0; } - void ClearOutBuffer() { outpos_ = 0; } - - private: - // Called by the underlying socket - void OnConnectEvent(AsyncSocket* socket); - void OnReadEvent(AsyncSocket* socket); - void OnWriteEvent(AsyncSocket* socket); - void OnCloseEvent(AsyncSocket* socket, int error); - - scoped_ptr socket_; - bool listen_; - char* inbuf_, * outbuf_; - size_t insize_, inpos_, outsize_, outpos_; - - DISALLOW_EVIL_CONSTRUCTORS(AsyncTCPSocketBase); -}; - -class AsyncTCPSocket : public AsyncTCPSocketBase { - public: - // Binds and connects |socket| and creates AsyncTCPSocket for - // it. Takes ownership of |socket|. Returns NULL if bind() or - // connect() fail (|socket| is destroyed in that case). - static AsyncTCPSocket* Create(AsyncSocket* socket, - const SocketAddress& bind_address, - const SocketAddress& remote_address); - AsyncTCPSocket(AsyncSocket* socket, bool listen); - virtual ~AsyncTCPSocket() {} - - virtual int Send(const void* pv, size_t cb, - const talk_base::PacketOptions& options); - virtual void ProcessInput(char* data, size_t* len); - virtual void HandleIncomingConnection(AsyncSocket* socket); - - private: - DISALLOW_EVIL_CONSTRUCTORS(AsyncTCPSocket); -}; - -} // namespace talk_base - -#endif // TALK_BASE_ASYNCTCPSOCKET_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/asyncudpsocket.h b/thirdparties/common/include/webrtc-sdk/talk/base/asyncudpsocket.h deleted file mode 100755 index eb9b3d2..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/asyncudpsocket.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_ASYNCUDPSOCKET_H_ -#define TALK_BASE_ASYNCUDPSOCKET_H_ - -#include "talk/base/asyncpacketsocket.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/socketfactory.h" - -namespace talk_base { - -// Provides the ability to receive packets asynchronously. Sends are not -// buffered since it is acceptable to drop packets under high load. -class AsyncUDPSocket : public AsyncPacketSocket { - public: - // Binds |socket| and creates AsyncUDPSocket for it. Takes ownership - // of |socket|. Returns NULL if bind() fails (|socket| is destroyed - // in that case). - static AsyncUDPSocket* Create(AsyncSocket* socket, - const SocketAddress& bind_address); - // Creates a new socket for sending asynchronous UDP packets using an - // asynchronous socket from the given factory. - static AsyncUDPSocket* Create(SocketFactory* factory, - const SocketAddress& bind_address); - explicit AsyncUDPSocket(AsyncSocket* socket); - virtual ~AsyncUDPSocket(); - - virtual SocketAddress GetLocalAddress() const; - virtual SocketAddress GetRemoteAddress() const; - virtual int Send(const void *pv, size_t cb, - const talk_base::PacketOptions& options); - virtual int SendTo(const void *pv, size_t cb, const SocketAddress& addr, - const talk_base::PacketOptions& options); - virtual int Close(); - - virtual State GetState() const; - virtual int GetOption(Socket::Option opt, int* value); - virtual int SetOption(Socket::Option opt, int value); - virtual int GetError() const; - virtual void SetError(int error); - - private: - // Called when the underlying socket is ready to be read from. - void OnReadEvent(AsyncSocket* socket); - // Called when the underlying socket is ready to send. - void OnWriteEvent(AsyncSocket* socket); - - scoped_ptr socket_; - char* buf_; - size_t size_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_ASYNCUDPSOCKET_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/atomicops.h b/thirdparties/common/include/webrtc-sdk/talk/base/atomicops.h deleted file mode 100755 index f7d7d6c..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/atomicops.h +++ /dev/null @@ -1,166 +0,0 @@ -/* - * 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_BASE_ATOMICOPS_H_ -#define TALK_BASE_ATOMICOPS_H_ - -#include - -#include "talk/base/basictypes.h" -#include "talk/base/common.h" -#include "talk/base/logging.h" -#include "talk/base/scoped_ptr.h" - -namespace talk_base { - -// A single-producer, single-consumer, fixed-size queue. -// All methods not ending in Unsafe can be safely called without locking, -// provided that calls to consumer methods (Peek/Pop) or producer methods (Push) -// only happen on a single thread per method type. If multiple threads need to -// read simultaneously or write simultaneously, other synchronization is -// necessary. Synchronization is also required if a call into any Unsafe method -// could happen at the same time as a call to any other method. -template -class FixedSizeLockFreeQueue { - private: -// Atomic primitives and memory barrier -#if defined(__arm__) - typedef uint32 Atomic32; - - // Copied from google3/base/atomicops-internals-arm-v6plus.h - static inline void MemoryBarrier() { - asm volatile("dmb":::"memory"); - } - - // Adapted from google3/base/atomicops-internals-arm-v6plus.h - static inline void AtomicIncrement(volatile Atomic32* ptr) { - Atomic32 str_success, value; - asm volatile ( - "1:\n" - "ldrex %1, [%2]\n" - "add %1, %1, #1\n" - "strex %0, %1, [%2]\n" - "teq %0, #0\n" - "bne 1b" - : "=&r"(str_success), "=&r"(value) - : "r" (ptr) - : "cc", "memory"); - } -#elif !defined(SKIP_ATOMIC_CHECK) -#error "No atomic operations defined for the given architecture." -#endif - - public: - // Constructs an empty queue, with capacity 0. - FixedSizeLockFreeQueue() : pushed_count_(0), - popped_count_(0), - capacity_(0), - data_() {} - // Constructs an empty queue with the given capacity. - FixedSizeLockFreeQueue(size_t capacity) : pushed_count_(0), - popped_count_(0), - capacity_(capacity), - data_(new T[capacity]) {} - - // Pushes a value onto the queue. Returns true if the value was successfully - // pushed (there was space in the queue). This method can be safely called at - // the same time as PeekFront/PopFront. - bool PushBack(T value) { - if (capacity_ == 0) { - LOG(LS_WARNING) << "Queue capacity is 0."; - return false; - } - if (IsFull()) { - return false; - } - - data_[pushed_count_ % capacity_] = value; - // Make sure the data is written before the count is incremented, so other - // threads can't see the value exists before being able to read it. - MemoryBarrier(); - AtomicIncrement(&pushed_count_); - return true; - } - - // Retrieves the oldest value pushed onto the queue. Returns true if there was - // an item to peek (the queue was non-empty). This method can be safely called - // at the same time as PushBack. - bool PeekFront(T* value_out) { - if (capacity_ == 0) { - LOG(LS_WARNING) << "Queue capacity is 0."; - return false; - } - if (IsEmpty()) { - return false; - } - - *value_out = data_[popped_count_ % capacity_]; - return true; - } - - // Retrieves the oldest value pushed onto the queue and removes it from the - // queue. Returns true if there was an item to pop (the queue was non-empty). - // This method can be safely called at the same time as PushBack. - bool PopFront(T* value_out) { - if (PeekFront(value_out)) { - AtomicIncrement(&popped_count_); - return true; - } - return false; - } - - // Clears the current items in the queue and sets the new (fixed) size. This - // method cannot be called at the same time as any other method. - void ClearAndResizeUnsafe(int new_capacity) { - capacity_ = new_capacity; - data_.reset(new T[new_capacity]); - pushed_count_ = 0; - popped_count_ = 0; - } - - // Returns true if there is no space left in the queue for new elements. - int IsFull() const { return pushed_count_ == popped_count_ + capacity_; } - // Returns true if there are no elements in the queue. - int IsEmpty() const { return pushed_count_ == popped_count_; } - // Returns the current number of elements in the queue. This is always in the - // range [0, capacity] - size_t Size() const { return pushed_count_ - popped_count_; } - - // Returns the capacity of the queue (max size). - size_t capacity() const { return capacity_; } - - private: - volatile Atomic32 pushed_count_; - volatile Atomic32 popped_count_; - size_t capacity_; - talk_base::scoped_ptr data_; - DISALLOW_COPY_AND_ASSIGN(FixedSizeLockFreeQueue); -}; - -} - -#endif // TALK_BASE_ATOMICOPS_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/autodetectproxy.h b/thirdparties/common/include/webrtc-sdk/talk/base/autodetectproxy.h deleted file mode 100755 index a5b32c4..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/autodetectproxy.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_AUTODETECTPROXY_H_ -#define TALK_BASE_AUTODETECTPROXY_H_ - -#include - -#include "talk/base/constructormagic.h" -#include "talk/base/cryptstring.h" -#include "talk/base/proxydetect.h" -#include "talk/base/proxyinfo.h" -#include "talk/base/signalthread.h" - -namespace talk_base { - -/////////////////////////////////////////////////////////////////////////////// -// AutoDetectProxy -/////////////////////////////////////////////////////////////////////////////// - -class AsyncResolverInterface; -class AsyncSocket; - -class AutoDetectProxy : public SignalThread { - public: - explicit AutoDetectProxy(const std::string& user_agent); - - const ProxyInfo& proxy() const { return proxy_; } - - void set_server_url(const std::string& url) { - server_url_ = url; - } - void set_proxy(const SocketAddress& proxy) { - proxy_.type = PROXY_UNKNOWN; - proxy_.address = proxy; - } - void set_auth_info(bool use_auth, const std::string& username, - const CryptString& password) { - if (use_auth) { - proxy_.username = username; - proxy_.password = password; - } - } - // Default implementation of GetProxySettingsForUrl. Override for special - // implementation. - virtual bool GetProxyForUrl(const char* agent, const char* url, - talk_base::ProxyInfo* proxy) { - return GetProxySettingsForUrl(agent, url, proxy, true); - } - enum { MSG_TIMEOUT = SignalThread::ST_MSG_FIRST_AVAILABLE, - MSG_UNRESOLVABLE, - ADP_MSG_FIRST_AVAILABLE}; - - protected: - virtual ~AutoDetectProxy(); - - // SignalThread Interface - virtual void DoWork(); - virtual void OnMessage(Message *msg); - - void Next(); - void Complete(ProxyType type); - - void OnConnectEvent(AsyncSocket * socket); - void OnReadEvent(AsyncSocket * socket); - void OnCloseEvent(AsyncSocket * socket, int error); - void OnResolveResult(AsyncResolverInterface* resolver); - bool DoConnect(); - - private: - std::string agent_; - std::string server_url_; - ProxyInfo proxy_; - AsyncResolverInterface* resolver_; - AsyncSocket* socket_; - int next_; - - DISALLOW_IMPLICIT_CONSTRUCTORS(AutoDetectProxy); -}; - -} // namespace talk_base - -#endif // TALK_BASE_AUTODETECTPROXY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/bandwidthsmoother.h b/thirdparties/common/include/webrtc-sdk/talk/base/bandwidthsmoother.h deleted file mode 100755 index a9887cc..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/bandwidthsmoother.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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_BASE_BANDWIDTHSMOOTHER_H_ -#define TALK_BASE_BANDWIDTHSMOOTHER_H_ - -#include "talk/base/rollingaccumulator.h" -#include "talk/base/timeutils.h" - -namespace talk_base { - -// The purpose of BandwidthSmoother is to smooth out bandwidth -// estimations so that 'trstate' messages can be triggered when we -// are "sure" there is sufficient bandwidth. To avoid frequent fluctuations, -// we take a slightly pessimistic view of our bandwidth. We only increase -// our estimation when we have sampled bandwidth measurements of values -// at least as large as the current estimation * percent_increase -// for at least time_between_increase time. If a sampled bandwidth -// is less than our current estimation we immediately decrease our estimation -// to that sampled value. -// We retain the initial bandwidth guess as our current bandwidth estimation -// until we have received (min_sample_count_percent * samples_count_to_average) -// number of samples. Min_sample_count_percent must be in range [0, 1]. -class BandwidthSmoother { - public: - BandwidthSmoother(int initial_bandwidth_guess, - uint32 time_between_increase, - double percent_increase, - size_t samples_count_to_average, - double min_sample_count_percent); - - // Samples a new bandwidth measurement. - // bandwidth is expected to be non-negative. - // returns true if the bandwidth estimation changed - bool Sample(uint32 sample_time, int bandwidth); - - int get_bandwidth_estimation() const { - return bandwidth_estimation_; - } - - private: - uint32 time_between_increase_; - double percent_increase_; - uint32 time_at_last_change_; - int bandwidth_estimation_; - RollingAccumulator accumulator_; - double min_sample_count_percent_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_BANDWIDTHSMOOTHER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/base64.h b/thirdparties/common/include/webrtc-sdk/talk/base/base64.h deleted file mode 100755 index 65b0260..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/base64.h +++ /dev/null @@ -1,104 +0,0 @@ - -//********************************************************************* -//* C_Base64 - a simple base64 encoder and decoder. -//* -//* Copyright (c) 1999, Bob Withers - bwit@pobox.com -//* -//* This code may be freely used for any purpose, either personal -//* or commercial, provided the authors copyright notice remains -//* intact. -//********************************************************************* - -#ifndef TALK_BASE_BASE64_H__ -#define TALK_BASE_BASE64_H__ - -#include -#include - -namespace talk_base { - -class Base64 -{ -public: - enum DecodeOption { - DO_PARSE_STRICT = 1, // Parse only base64 characters - DO_PARSE_WHITE = 2, // Parse only base64 and whitespace characters - DO_PARSE_ANY = 3, // Parse all characters - DO_PARSE_MASK = 3, - - DO_PAD_YES = 4, // Padding is required - DO_PAD_ANY = 8, // Padding is optional - DO_PAD_NO = 12, // Padding is disallowed - DO_PAD_MASK = 12, - - DO_TERM_BUFFER = 16, // Must termiante at end of buffer - DO_TERM_CHAR = 32, // May terminate at any character boundary - DO_TERM_ANY = 48, // May terminate at a sub-character bit offset - DO_TERM_MASK = 48, - - // Strictest interpretation - DO_STRICT = DO_PARSE_STRICT | DO_PAD_YES | DO_TERM_BUFFER, - - DO_LAX = DO_PARSE_ANY | DO_PAD_ANY | DO_TERM_CHAR, - }; - typedef int DecodeFlags; - - static bool IsBase64Char(char ch); - - // Get the char next to the |ch| from the Base64Table. - // If the |ch| is the last one in the Base64Table then returns - // the first one from the table. - // Expects the |ch| be a base64 char. - // The result will be saved in |next_ch|. - // Returns true on success. - static bool GetNextBase64Char(char ch, char* next_ch); - - // Determines whether the given string consists entirely of valid base64 - // encoded characters. - static bool IsBase64Encoded(const std::string& str); - - static void EncodeFromArray(const void* data, size_t len, - std::string* result); - static bool DecodeFromArray(const char* data, size_t len, DecodeFlags flags, - std::string* result, size_t* data_used); - static bool DecodeFromArray(const char* data, size_t len, DecodeFlags flags, - std::vector* result, size_t* data_used); - - // Convenience Methods - static inline std::string Encode(const std::string& data) { - std::string result; - EncodeFromArray(data.data(), data.size(), &result); - return result; - } - static inline std::string Decode(const std::string& data, DecodeFlags flags) { - std::string result; - DecodeFromArray(data.data(), data.size(), flags, &result, NULL); - return result; - } - static inline bool Decode(const std::string& data, DecodeFlags flags, - std::string* result, size_t* data_used) - { - return DecodeFromArray(data.data(), data.size(), flags, result, data_used); - } - static inline bool Decode(const std::string& data, DecodeFlags flags, - std::vector* result, size_t* data_used) - { - return DecodeFromArray(data.data(), data.size(), flags, result, data_used); - } - -private: - static const char Base64Table[]; - static const unsigned char DecodeTable[]; - - static size_t GetNextQuantum(DecodeFlags parse_flags, bool illegal_pads, - const char* data, size_t len, size_t* dpos, - unsigned char qbuf[4], bool* padded); - template - static bool DecodeFromArrayTemplate(const char* data, size_t len, - DecodeFlags flags, T* result, - size_t* data_used); -}; - -} // namespace talk_base - -#endif // TALK_BASE_BASE64_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/basicdefs.h b/thirdparties/common/include/webrtc-sdk/talk/base/basicdefs.h deleted file mode 100755 index 5731080..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/basicdefs.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_BASE_BASICDEFS_H_ -#define TALK_BASE_BASICDEFS_H_ - -#if HAVE_CONFIG_H -#include "config.h" // NOLINT -#endif - -#define ARRAY_SIZE(x) (static_cast(sizeof(x) / sizeof(x[0]))) - -#endif // TALK_BASE_BASICDEFS_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/basictypes.h b/thirdparties/common/include/webrtc-sdk/talk/base/basictypes.h deleted file mode 100755 index db4754b..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/basictypes.h +++ /dev/null @@ -1,171 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_BASE_BASICTYPES_H_ -#define TALK_BASE_BASICTYPES_H_ - -#include // for NULL, size_t - -#if !(defined(_MSC_VER) && (_MSC_VER < 1600)) -#include // for uintptr_t -#endif - -#ifdef HAVE_CONFIG_H -#include "config.h" // NOLINT -#endif - -#include "talk/base/constructormagic.h" - -#if !defined(INT_TYPES_DEFINED) -#define INT_TYPES_DEFINED -#ifdef COMPILER_MSVC -typedef unsigned __int64 uint64; -typedef __int64 int64; -#ifndef INT64_C -#define INT64_C(x) x ## I64 -#endif -#ifndef UINT64_C -#define UINT64_C(x) x ## UI64 -#endif -#define INT64_F "I64" -#else // COMPILER_MSVC -// On Mac OS X, cssmconfig.h defines uint64 as uint64_t -// TODO(fbarchard): Use long long for compatibility with chromium on BSD/OSX. -#if defined(OSX) -typedef uint64_t uint64; -typedef int64_t int64; -#ifndef INT64_C -#define INT64_C(x) x ## LL -#endif -#ifndef UINT64_C -#define UINT64_C(x) x ## ULL -#endif -#define INT64_F "l" -#elif defined(__LP64__) -typedef unsigned long uint64; // NOLINT -typedef long int64; // NOLINT -#ifndef INT64_C -#define INT64_C(x) x ## L -#endif -#ifndef UINT64_C -#define UINT64_C(x) x ## UL -#endif -#define INT64_F "l" -#else // __LP64__ -typedef unsigned long long uint64; // NOLINT -typedef long long int64; // NOLINT -#ifndef INT64_C -#define INT64_C(x) x ## LL -#endif -#ifndef UINT64_C -#define UINT64_C(x) x ## ULL -#endif -#define INT64_F "ll" -#endif // __LP64__ -#endif // COMPILER_MSVC -typedef unsigned int uint32; -typedef int int32; -typedef unsigned short uint16; // NOLINT -typedef short int16; // NOLINT -typedef unsigned char uint8; -typedef signed char int8; -#endif // INT_TYPES_DEFINED - -// Detect compiler is for x86 or x64. -#if defined(__x86_64__) || defined(_M_X64) || \ - defined(__i386__) || defined(_M_IX86) -#define CPU_X86 1 -#endif -// Detect compiler is for arm. -#if defined(__arm__) || defined(_M_ARM) -#define CPU_ARM 1 -#endif -#if defined(CPU_X86) && defined(CPU_ARM) -#error CPU_X86 and CPU_ARM both defined. -#endif -#if !defined(ARCH_CPU_BIG_ENDIAN) && !defined(ARCH_CPU_LITTLE_ENDIAN) -// x86, arm or GCC provided __BYTE_ORDER__ macros -#if CPU_X86 || CPU_ARM || \ - (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) -#define ARCH_CPU_LITTLE_ENDIAN -#elif defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -#define ARCH_CPU_BIG_ENDIAN -#else -#error ARCH_CPU_BIG_ENDIAN or ARCH_CPU_LITTLE_ENDIAN should be defined. -#endif -#endif -#if defined(ARCH_CPU_BIG_ENDIAN) && defined(ARCH_CPU_LITTLE_ENDIAN) -#error ARCH_CPU_BIG_ENDIAN and ARCH_CPU_LITTLE_ENDIAN both defined. -#endif - -#ifdef WIN32 -typedef int socklen_t; -#endif - -// The following only works for C++ -#ifdef __cplusplus -namespace talk_base { - template inline T _min(T a, T b) { return (a > b) ? b : a; } - template inline T _max(T a, T b) { return (a < b) ? b : a; } - - // For wait functions that take a number of milliseconds, kForever indicates - // unlimited time. - const int kForever = -1; -} - -#define ALIGNP(p, t) \ - (reinterpret_cast(((reinterpret_cast(p) + \ - ((t) - 1)) & ~((t) - 1)))) -#define IS_ALIGNED(p, a) (!((uintptr_t)(p) & ((a) - 1))) - -// Note: UNUSED is also defined in common.h -#ifndef UNUSED -#define UNUSED(x) Unused(static_cast(&x)) -#define UNUSED2(x, y) Unused(static_cast(&x)); \ - Unused(static_cast(&y)) -#define UNUSED3(x, y, z) Unused(static_cast(&x)); \ - Unused(static_cast(&y)); \ - Unused(static_cast(&z)) -#define UNUSED4(x, y, z, a) Unused(static_cast(&x)); \ - Unused(static_cast(&y)); \ - Unused(static_cast(&z)); \ - Unused(static_cast(&a)) -#define UNUSED5(x, y, z, a, b) Unused(static_cast(&x)); \ - Unused(static_cast(&y)); \ - Unused(static_cast(&z)); \ - Unused(static_cast(&a)); \ - Unused(static_cast(&b)) -inline void Unused(const void*) {} -#endif // UNUSED - -// Use these to declare and define a static local variable (static T;) so that -// it is leaked so that its destructors are not called at exit. -#define LIBJINGLE_DEFINE_STATIC_LOCAL(type, name, arguments) \ - static type& name = *new type arguments - -#endif // __cplusplus -#endif // TALK_BASE_BASICTYPES_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/bind.h b/thirdparties/common/include/webrtc-sdk/talk/base/bind.h deleted file mode 100755 index b8b92b8..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/bind.h +++ /dev/null @@ -1,604 +0,0 @@ -// This file was GENERATED by command: -// pump.py bind.h.pump -// DO NOT EDIT BY HAND!!! - -/* - * 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. - */ - -// To generate bind.h from bind.h.pump, execute: -// /home/build/google3/third_party/gtest/scripts/pump.py bind.h.pump - -// Bind() is an overloaded function that converts method calls into function -// objects (aka functors). It captures any arguments to the method by value -// when Bind is called, producing a stateful, nullary function object. Care -// should be taken about the lifetime of objects captured by Bind(); the -// returned functor knows nothing about the lifetime of the method's object or -// any arguments passed by pointer, and calling the functor with a destroyed -// object will surely do bad things. -// -// Example usage: -// struct Foo { -// int Test1() { return 42; } -// int Test2() const { return 52; } -// int Test3(int x) { return x*x; } -// float Test4(int x, float y) { return x + y; } -// }; -// -// int main() { -// Foo foo; -// cout << talk_base::Bind(&Foo::Test1, &foo)() << endl; -// cout << talk_base::Bind(&Foo::Test2, &foo)() << endl; -// cout << talk_base::Bind(&Foo::Test3, &foo, 3)() << endl; -// cout << talk_base::Bind(&Foo::Test4, &foo, 7, 8.5f)() << endl; -// } - -#ifndef TALK_BASE_BIND_H_ -#define TALK_BASE_BIND_H_ - -#define NONAME - -namespace talk_base { -namespace detail { -// This is needed because the template parameters in Bind can't be resolved -// if they're used both as parameters of the function pointer type and as -// parameters to Bind itself: the function pointer parameters are exact -// matches to the function prototype, but the parameters to bind have -// references stripped. This trick allows the compiler to dictate the Bind -// parameter types rather than deduce them. -template struct identity { typedef T type; }; -} // namespace detail - -template -class MethodFunctor0 { - public: - MethodFunctor0(MethodT method, ObjectT* object) - : method_(method), object_(object) {} - R operator()() const { - return (object_->*method_)(); } - private: - MethodT method_; - ObjectT* object_; -}; - -template -class Functor0 { - public: - explicit Functor0(const FunctorT& functor) - : functor_(functor) {} - R operator()() const { - return functor_(); } - private: - FunctorT functor_; -}; - - -#define FP_T(x) R (ObjectT::*x)() - -template -MethodFunctor0 -Bind(FP_T(method), ObjectT* object) { - return MethodFunctor0( - method, object); -} - -#undef FP_T -#define FP_T(x) R (ObjectT::*x)() const - -template -MethodFunctor0 -Bind(FP_T(method), const ObjectT* object) { - return MethodFunctor0( - method, object); -} - -#undef FP_T -#define FP_T(x) R (*x)() - -template -Functor0 -Bind(FP_T(function)) { - return Functor0( - function); -} - -#undef FP_T - -template -class MethodFunctor1 { - public: - MethodFunctor1(MethodT method, ObjectT* object, - P1 p1) - : method_(method), object_(object), - p1_(p1) {} - R operator()() const { - return (object_->*method_)(p1_); } - private: - MethodT method_; - ObjectT* object_; - P1 p1_; -}; - -template -class Functor1 { - public: - Functor1(const FunctorT& functor, P1 p1) - : functor_(functor), - p1_(p1) {} - R operator()() const { - return functor_(p1_); } - private: - FunctorT functor_; - P1 p1_; -}; - - -#define FP_T(x) R (ObjectT::*x)(P1) - -template -MethodFunctor1 -Bind(FP_T(method), ObjectT* object, - typename detail::identity::type p1) { - return MethodFunctor1( - method, object, p1); -} - -#undef FP_T -#define FP_T(x) R (ObjectT::*x)(P1) const - -template -MethodFunctor1 -Bind(FP_T(method), const ObjectT* object, - typename detail::identity::type p1) { - return MethodFunctor1( - method, object, p1); -} - -#undef FP_T -#define FP_T(x) R (*x)(P1) - -template -Functor1 -Bind(FP_T(function), - typename detail::identity::type p1) { - return Functor1( - function, p1); -} - -#undef FP_T - -template -class MethodFunctor2 { - public: - MethodFunctor2(MethodT method, ObjectT* object, - P1 p1, - P2 p2) - : method_(method), object_(object), - p1_(p1), - p2_(p2) {} - R operator()() const { - return (object_->*method_)(p1_, p2_); } - private: - MethodT method_; - ObjectT* object_; - P1 p1_; - P2 p2_; -}; - -template -class Functor2 { - public: - Functor2(const FunctorT& functor, P1 p1, P2 p2) - : functor_(functor), - p1_(p1), - p2_(p2) {} - R operator()() const { - return functor_(p1_, p2_); } - private: - FunctorT functor_; - P1 p1_; - P2 p2_; -}; - - -#define FP_T(x) R (ObjectT::*x)(P1, P2) - -template -MethodFunctor2 -Bind(FP_T(method), ObjectT* object, - typename detail::identity::type p1, - typename detail::identity::type p2) { - return MethodFunctor2( - method, object, p1, p2); -} - -#undef FP_T -#define FP_T(x) R (ObjectT::*x)(P1, P2) const - -template -MethodFunctor2 -Bind(FP_T(method), const ObjectT* object, - typename detail::identity::type p1, - typename detail::identity::type p2) { - return MethodFunctor2( - method, object, p1, p2); -} - -#undef FP_T -#define FP_T(x) R (*x)(P1, P2) - -template -Functor2 -Bind(FP_T(function), - typename detail::identity::type p1, - typename detail::identity::type p2) { - return Functor2( - function, p1, p2); -} - -#undef FP_T - -template -class MethodFunctor3 { - public: - MethodFunctor3(MethodT method, ObjectT* object, - P1 p1, - P2 p2, - P3 p3) - : method_(method), object_(object), - p1_(p1), - p2_(p2), - p3_(p3) {} - R operator()() const { - return (object_->*method_)(p1_, p2_, p3_); } - private: - MethodT method_; - ObjectT* object_; - P1 p1_; - P2 p2_; - P3 p3_; -}; - -template -class Functor3 { - public: - Functor3(const FunctorT& functor, P1 p1, P2 p2, P3 p3) - : functor_(functor), - p1_(p1), - p2_(p2), - p3_(p3) {} - R operator()() const { - return functor_(p1_, p2_, p3_); } - private: - FunctorT functor_; - P1 p1_; - P2 p2_; - P3 p3_; -}; - - -#define FP_T(x) R (ObjectT::*x)(P1, P2, P3) - -template -MethodFunctor3 -Bind(FP_T(method), ObjectT* object, - typename detail::identity::type p1, - typename detail::identity::type p2, - typename detail::identity::type p3) { - return MethodFunctor3( - method, object, p1, p2, p3); -} - -#undef FP_T -#define FP_T(x) R (ObjectT::*x)(P1, P2, P3) const - -template -MethodFunctor3 -Bind(FP_T(method), const ObjectT* object, - typename detail::identity::type p1, - typename detail::identity::type p2, - typename detail::identity::type p3) { - return MethodFunctor3( - method, object, p1, p2, p3); -} - -#undef FP_T -#define FP_T(x) R (*x)(P1, P2, P3) - -template -Functor3 -Bind(FP_T(function), - typename detail::identity::type p1, - typename detail::identity::type p2, - typename detail::identity::type p3) { - return Functor3( - function, p1, p2, p3); -} - -#undef FP_T - -template -class MethodFunctor4 { - public: - MethodFunctor4(MethodT method, ObjectT* object, - P1 p1, - P2 p2, - P3 p3, - P4 p4) - : method_(method), object_(object), - p1_(p1), - p2_(p2), - p3_(p3), - p4_(p4) {} - R operator()() const { - return (object_->*method_)(p1_, p2_, p3_, p4_); } - private: - MethodT method_; - ObjectT* object_; - P1 p1_; - P2 p2_; - P3 p3_; - P4 p4_; -}; - -template -class Functor4 { - public: - Functor4(const FunctorT& functor, P1 p1, P2 p2, P3 p3, P4 p4) - : functor_(functor), - p1_(p1), - p2_(p2), - p3_(p3), - p4_(p4) {} - R operator()() const { - return functor_(p1_, p2_, p3_, p4_); } - private: - FunctorT functor_; - P1 p1_; - P2 p2_; - P3 p3_; - P4 p4_; -}; - - -#define FP_T(x) R (ObjectT::*x)(P1, P2, P3, P4) - -template -MethodFunctor4 -Bind(FP_T(method), ObjectT* object, - typename detail::identity::type p1, - typename detail::identity::type p2, - typename detail::identity::type p3, - typename detail::identity::type p4) { - return MethodFunctor4( - method, object, p1, p2, p3, p4); -} - -#undef FP_T -#define FP_T(x) R (ObjectT::*x)(P1, P2, P3, P4) const - -template -MethodFunctor4 -Bind(FP_T(method), const ObjectT* object, - typename detail::identity::type p1, - typename detail::identity::type p2, - typename detail::identity::type p3, - typename detail::identity::type p4) { - return MethodFunctor4( - method, object, p1, p2, p3, p4); -} - -#undef FP_T -#define FP_T(x) R (*x)(P1, P2, P3, P4) - -template -Functor4 -Bind(FP_T(function), - typename detail::identity::type p1, - typename detail::identity::type p2, - typename detail::identity::type p3, - typename detail::identity::type p4) { - return Functor4( - function, p1, p2, p3, p4); -} - -#undef FP_T - -template -class MethodFunctor5 { - public: - MethodFunctor5(MethodT method, ObjectT* object, - P1 p1, - P2 p2, - P3 p3, - P4 p4, - P5 p5) - : method_(method), object_(object), - p1_(p1), - p2_(p2), - p3_(p3), - p4_(p4), - p5_(p5) {} - R operator()() const { - return (object_->*method_)(p1_, p2_, p3_, p4_, p5_); } - private: - MethodT method_; - ObjectT* object_; - P1 p1_; - P2 p2_; - P3 p3_; - P4 p4_; - P5 p5_; -}; - -template -class Functor5 { - public: - Functor5(const FunctorT& functor, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) - : functor_(functor), - p1_(p1), - p2_(p2), - p3_(p3), - p4_(p4), - p5_(p5) {} - R operator()() const { - return functor_(p1_, p2_, p3_, p4_, p5_); } - private: - FunctorT functor_; - P1 p1_; - P2 p2_; - P3 p3_; - P4 p4_; - P5 p5_; -}; - - -#define FP_T(x) R (ObjectT::*x)(P1, P2, P3, P4, P5) - -template -MethodFunctor5 -Bind(FP_T(method), ObjectT* object, - typename detail::identity::type p1, - typename detail::identity::type p2, - typename detail::identity::type p3, - typename detail::identity::type p4, - typename detail::identity::type p5) { - return MethodFunctor5( - method, object, p1, p2, p3, p4, p5); -} - -#undef FP_T -#define FP_T(x) R (ObjectT::*x)(P1, P2, P3, P4, P5) const - -template -MethodFunctor5 -Bind(FP_T(method), const ObjectT* object, - typename detail::identity::type p1, - typename detail::identity::type p2, - typename detail::identity::type p3, - typename detail::identity::type p4, - typename detail::identity::type p5) { - return MethodFunctor5( - method, object, p1, p2, p3, p4, p5); -} - -#undef FP_T -#define FP_T(x) R (*x)(P1, P2, P3, P4, P5) - -template -Functor5 -Bind(FP_T(function), - typename detail::identity::type p1, - typename detail::identity::type p2, - typename detail::identity::type p3, - typename detail::identity::type p4, - typename detail::identity::type p5) { - return Functor5( - function, p1, p2, p3, p4, p5); -} - -#undef FP_T - -} // namespace talk_base - -#undef NONAME - -#endif // TALK_BASE_BIND_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/buffer.h b/thirdparties/common/include/webrtc-sdk/talk/base/buffer.h deleted file mode 100755 index 6866005..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/buffer.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - * libjingle - * Copyright 2004-2010, 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_BASE_BUFFER_H_ -#define TALK_BASE_BUFFER_H_ - -#include - -#include "talk/base/scoped_ptr.h" - -namespace talk_base { - -// Basic buffer class, can be grown and shrunk dynamically. -// Unlike std::string/vector, does not initialize data when expanding capacity. -class Buffer { - public: - Buffer() { - Construct(NULL, 0, 0); - } - Buffer(const void* data, size_t length) { - Construct(data, length, length); - } - Buffer(const void* data, size_t length, size_t capacity) { - Construct(data, length, capacity); - } - Buffer(const Buffer& buf) { - Construct(buf.data(), buf.length(), buf.length()); - } - - const char* data() const { return data_.get(); } - char* data() { return data_.get(); } - // TODO: should this be size(), like STL? - size_t length() const { return length_; } - size_t capacity() const { return capacity_; } - - Buffer& operator=(const Buffer& buf) { - if (&buf != this) { - Construct(buf.data(), buf.length(), buf.length()); - } - return *this; - } - bool operator==(const Buffer& buf) const { - return (length_ == buf.length() && - memcmp(data_.get(), buf.data(), length_) == 0); - } - bool operator!=(const Buffer& buf) const { - return !operator==(buf); - } - - void SetData(const void* data, size_t length) { - ASSERT(data != NULL || length == 0); - SetLength(length); - memcpy(data_.get(), data, length); - } - void AppendData(const void* data, size_t length) { - ASSERT(data != NULL || length == 0); - size_t old_length = length_; - SetLength(length_ + length); - memcpy(data_.get() + old_length, data, length); - } - void SetLength(size_t length) { - SetCapacity(length); - length_ = length; - } - void SetCapacity(size_t capacity) { - if (capacity > capacity_) { - talk_base::scoped_ptr data(new char[capacity]); - memcpy(data.get(), data_.get(), length_); - data_.swap(data); - capacity_ = capacity; - } - } - - void TransferTo(Buffer* buf) { - ASSERT(buf != NULL); - buf->data_.reset(data_.release()); - buf->length_ = length_; - buf->capacity_ = capacity_; - Construct(NULL, 0, 0); - } - - protected: - void Construct(const void* data, size_t length, size_t capacity) { - data_.reset(new char[capacity_ = capacity]); - SetData(data, length); - } - - scoped_ptr data_; - size_t length_; - size_t capacity_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_BUFFER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/bytebuffer.h b/thirdparties/common/include/webrtc-sdk/talk/base/bytebuffer.h deleted file mode 100755 index 22b80e0..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/bytebuffer.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_BYTEBUFFER_H_ -#define TALK_BASE_BYTEBUFFER_H_ - -#include - -#include "talk/base/basictypes.h" -#include "talk/base/constructormagic.h" - -namespace talk_base { - -class ByteBuffer { - public: - - enum ByteOrder { - ORDER_NETWORK = 0, // Default, use network byte order (big endian). - ORDER_HOST, // Use the native order of the host. - }; - - // |byte_order| defines order of bytes in the buffer. - ByteBuffer(); - explicit ByteBuffer(ByteOrder byte_order); - ByteBuffer(const char* bytes, size_t len); - ByteBuffer(const char* bytes, size_t len, ByteOrder byte_order); - - // Initializes buffer from a zero-terminated string. - explicit ByteBuffer(const char* bytes); - - ~ByteBuffer(); - - const char* Data() const { return bytes_ + start_; } - size_t Length() const { return end_ - start_; } - size_t Capacity() const { return size_ - start_; } - ByteOrder Order() const { return byte_order_; } - - // Read a next value from the buffer. Return false if there isn't - // enough data left for the specified type. - bool ReadUInt8(uint8* val); - bool ReadUInt16(uint16* val); - bool ReadUInt24(uint32* val); - bool ReadUInt32(uint32* val); - bool ReadUInt64(uint64* val); - bool ReadBytes(char* val, size_t len); - - // Appends next |len| bytes from the buffer to |val|. Returns false - // if there is less than |len| bytes left. - bool ReadString(std::string* val, size_t len); - - // Write value to the buffer. Resizes the buffer when it is - // neccessary. - void WriteUInt8(uint8 val); - void WriteUInt16(uint16 val); - void WriteUInt24(uint32 val); - void WriteUInt32(uint32 val); - void WriteUInt64(uint64 val); - void WriteString(const std::string& val); - void WriteBytes(const char* val, size_t len); - - // Reserves the given number of bytes and returns a char* that can be written - // into. Useful for functions that require a char* buffer and not a - // ByteBuffer. - char* ReserveWriteBuffer(size_t len); - - // Resize the buffer to the specified |size|. This invalidates any remembered - // seek positions. - void Resize(size_t size); - - // Moves current position |size| bytes forward. Returns false if - // there is less than |size| bytes left in the buffer. Consume doesn't - // permanently remove data, so remembered read positions are still valid - // after this call. - bool Consume(size_t size); - - // Clears the contents of the buffer. After this, Length() will be 0. - void Clear(); - - // Used with GetReadPosition/SetReadPosition. - class ReadPosition { - friend class ByteBuffer; - ReadPosition(size_t start, int version) - : start_(start), version_(version) { } - size_t start_; - int version_; - }; - - // Remembers the current read position for a future SetReadPosition. Any - // calls to Shift or Resize in the interim will invalidate the position. - ReadPosition GetReadPosition() const; - - // If the given position is still valid, restores that read position. - bool SetReadPosition(const ReadPosition &position); - - private: - void Construct(const char* bytes, size_t size, ByteOrder byte_order); - - char* bytes_; - size_t size_; - size_t start_; - size_t end_; - int version_; - ByteOrder byte_order_; - - // There are sensible ways to define these, but they aren't needed in our code - // base. - DISALLOW_COPY_AND_ASSIGN(ByteBuffer); -}; - -} // namespace talk_base - -#endif // TALK_BASE_BYTEBUFFER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/byteorder.h b/thirdparties/common/include/webrtc-sdk/talk/base/byteorder.h deleted file mode 100755 index 8d57c01..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/byteorder.h +++ /dev/null @@ -1,185 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_BASE_BYTEORDER_H_ -#define TALK_BASE_BYTEORDER_H_ - -#if defined(POSIX) && !defined(__native_client__) -#include -#endif - -#ifdef WIN32 -#include -#endif - -#include "talk/base/basictypes.h" - -namespace talk_base { - -// Reading and writing of little and big-endian numbers from memory -// TODO: Optimized versions, with direct read/writes of -// integers in host-endian format, when the platform supports it. - -inline void Set8(void* memory, size_t offset, uint8 v) { - static_cast(memory)[offset] = v; -} - -inline uint8 Get8(const void* memory, size_t offset) { - return static_cast(memory)[offset]; -} - -inline void SetBE16(void* memory, uint16 v) { - Set8(memory, 0, static_cast(v >> 8)); - Set8(memory, 1, static_cast(v >> 0)); -} - -inline void SetBE32(void* memory, uint32 v) { - Set8(memory, 0, static_cast(v >> 24)); - Set8(memory, 1, static_cast(v >> 16)); - Set8(memory, 2, static_cast(v >> 8)); - Set8(memory, 3, static_cast(v >> 0)); -} - -inline void SetBE64(void* memory, uint64 v) { - Set8(memory, 0, static_cast(v >> 56)); - Set8(memory, 1, static_cast(v >> 48)); - Set8(memory, 2, static_cast(v >> 40)); - Set8(memory, 3, static_cast(v >> 32)); - Set8(memory, 4, static_cast(v >> 24)); - Set8(memory, 5, static_cast(v >> 16)); - Set8(memory, 6, static_cast(v >> 8)); - Set8(memory, 7, static_cast(v >> 0)); -} - -inline uint16 GetBE16(const void* memory) { - return static_cast((Get8(memory, 0) << 8) | - (Get8(memory, 1) << 0)); -} - -inline uint32 GetBE32(const void* memory) { - return (static_cast(Get8(memory, 0)) << 24) | - (static_cast(Get8(memory, 1)) << 16) | - (static_cast(Get8(memory, 2)) << 8) | - (static_cast(Get8(memory, 3)) << 0); -} - -inline uint64 GetBE64(const void* memory) { - return (static_cast(Get8(memory, 0)) << 56) | - (static_cast(Get8(memory, 1)) << 48) | - (static_cast(Get8(memory, 2)) << 40) | - (static_cast(Get8(memory, 3)) << 32) | - (static_cast(Get8(memory, 4)) << 24) | - (static_cast(Get8(memory, 5)) << 16) | - (static_cast(Get8(memory, 6)) << 8) | - (static_cast(Get8(memory, 7)) << 0); -} - -inline void SetLE16(void* memory, uint16 v) { - Set8(memory, 0, static_cast(v >> 0)); - Set8(memory, 1, static_cast(v >> 8)); -} - -inline void SetLE32(void* memory, uint32 v) { - Set8(memory, 0, static_cast(v >> 0)); - Set8(memory, 1, static_cast(v >> 8)); - Set8(memory, 2, static_cast(v >> 16)); - Set8(memory, 3, static_cast(v >> 24)); -} - -inline void SetLE64(void* memory, uint64 v) { - Set8(memory, 0, static_cast(v >> 0)); - Set8(memory, 1, static_cast(v >> 8)); - Set8(memory, 2, static_cast(v >> 16)); - Set8(memory, 3, static_cast(v >> 24)); - Set8(memory, 4, static_cast(v >> 32)); - Set8(memory, 5, static_cast(v >> 40)); - Set8(memory, 6, static_cast(v >> 48)); - Set8(memory, 7, static_cast(v >> 56)); -} - -inline uint16 GetLE16(const void* memory) { - return static_cast((Get8(memory, 0) << 0) | - (Get8(memory, 1) << 8)); -} - -inline uint32 GetLE32(const void* memory) { - return (static_cast(Get8(memory, 0)) << 0) | - (static_cast(Get8(memory, 1)) << 8) | - (static_cast(Get8(memory, 2)) << 16) | - (static_cast(Get8(memory, 3)) << 24); -} - -inline uint64 GetLE64(const void* memory) { - return (static_cast(Get8(memory, 0)) << 0) | - (static_cast(Get8(memory, 1)) << 8) | - (static_cast(Get8(memory, 2)) << 16) | - (static_cast(Get8(memory, 3)) << 24) | - (static_cast(Get8(memory, 4)) << 32) | - (static_cast(Get8(memory, 5)) << 40) | - (static_cast(Get8(memory, 6)) << 48) | - (static_cast(Get8(memory, 7)) << 56); -} - -// Check if the current host is big endian. -inline bool IsHostBigEndian() { - static const int number = 1; - return 0 == *reinterpret_cast(&number); -} - -inline uint16 HostToNetwork16(uint16 n) { - uint16 result; - SetBE16(&result, n); - return result; -} - -inline uint32 HostToNetwork32(uint32 n) { - uint32 result; - SetBE32(&result, n); - return result; -} - -inline uint64 HostToNetwork64(uint64 n) { - uint64 result; - SetBE64(&result, n); - return result; -} - -inline uint16 NetworkToHost16(uint16 n) { - return GetBE16(&n); -} - -inline uint32 NetworkToHost32(uint32 n) { - return GetBE32(&n); -} - -inline uint64 NetworkToHost64(uint64 n) { - return GetBE64(&n); -} - -} // namespace talk_base - -#endif // TALK_BASE_BYTEORDER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/callback.h b/thirdparties/common/include/webrtc-sdk/talk/base/callback.h deleted file mode 100755 index cd3daf5..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/callback.h +++ /dev/null @@ -1,278 +0,0 @@ -// This file was GENERATED by command: -// pump.py callback.h.pump -// DO NOT EDIT BY HAND!!! - -/* - * 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. - */ - -// To generate callback.h from callback.h.pump, execute: -// /home/build/google3/third_party/gtest/scripts/pump.py callback.h.pump - -// Callbacks are callable object containers. They can hold a function pointer -// or a function object and behave like a value type. Internally, data is -// reference-counted, making copies and pass-by-value inexpensive. -// -// Callbacks are typed using template arguments. The format is: -// CallbackN -// where N is the number of arguments supplied to the callable object. -// Callbacks are invoked using operator(), just like a function or a function -// object. Default-constructed callbacks are "empty," and executing an empty -// callback does nothing. A callback can be made empty by assigning it from -// a default-constructed callback. -// -// Callbacks are similar in purpose to std::function (which isn't available on -// all platforms we support) and a lightweight alternative to sigslots. Since -// they effectively hide the type of the object they call, they're useful in -// breaking dependencies between objects that need to interact with one another. -// Notably, they can hold the results of Bind(), std::bind*, etc, without -// needing -// to know the resulting object type of those calls. -// -// Sigslots, on the other hand, provide a fuller feature set, such as multiple -// subscriptions to a signal, optional thread-safety, and lifetime tracking of -// slots. When these features are needed, choose sigslots. -// -// Example: -// int sqr(int x) { return x * x; } -// struct AddK { -// int k; -// int operator()(int x) const { return x + k; } -// } add_k = {5}; -// -// Callback1 my_callback; -// cout << my_callback.empty() << endl; // true -// -// my_callback = Callback1(&sqr); -// cout << my_callback.empty() << endl; // false -// cout << my_callback(3) << endl; // 9 -// -// my_callback = Callback1(add_k); -// cout << my_callback(10) << endl; // 15 -// -// my_callback = Callback1(); -// cout << my_callback.empty() << endl; // true - -#ifndef TALK_BASE_CALLBACK_H_ -#define TALK_BASE_CALLBACK_H_ - -#include "talk/base/logging.h" -#include "talk/base/refcount.h" -#include "talk/base/scoped_ref_ptr.h" - -namespace talk_base { - -template -class Callback0 { - public: - // Default copy operations are appropriate for this class. - Callback0() {} - template Callback0(const T& functor) - : helper_(new RefCountedObject< HelperImpl >(functor)) {} - R operator()() { - if (empty()) - return R(); - return helper_->Run(); - } - bool empty() const { return !helper_; } - - private: - struct Helper : RefCountInterface { - virtual ~Helper() {} - virtual R Run() = 0; - }; - template struct HelperImpl : Helper { - explicit HelperImpl(const T& functor) : functor_(functor) {} - virtual R Run() { - return functor_(); - } - T functor_; - }; - scoped_refptr helper_; -}; - -template -class Callback1 { - public: - // Default copy operations are appropriate for this class. - Callback1() {} - template Callback1(const T& functor) - : helper_(new RefCountedObject< HelperImpl >(functor)) {} - R operator()(P1 p1) { - if (empty()) - return R(); - return helper_->Run(p1); - } - bool empty() const { return !helper_; } - - private: - struct Helper : RefCountInterface { - virtual ~Helper() {} - virtual R Run(P1 p1) = 0; - }; - template struct HelperImpl : Helper { - explicit HelperImpl(const T& functor) : functor_(functor) {} - virtual R Run(P1 p1) { - return functor_(p1); - } - T functor_; - }; - scoped_refptr helper_; -}; - -template -class Callback2 { - public: - // Default copy operations are appropriate for this class. - Callback2() {} - template Callback2(const T& functor) - : helper_(new RefCountedObject< HelperImpl >(functor)) {} - R operator()(P1 p1, P2 p2) { - if (empty()) - return R(); - return helper_->Run(p1, p2); - } - bool empty() const { return !helper_; } - - private: - struct Helper : RefCountInterface { - virtual ~Helper() {} - virtual R Run(P1 p1, P2 p2) = 0; - }; - template struct HelperImpl : Helper { - explicit HelperImpl(const T& functor) : functor_(functor) {} - virtual R Run(P1 p1, P2 p2) { - return functor_(p1, p2); - } - T functor_; - }; - scoped_refptr helper_; -}; - -template -class Callback3 { - public: - // Default copy operations are appropriate for this class. - Callback3() {} - template Callback3(const T& functor) - : helper_(new RefCountedObject< HelperImpl >(functor)) {} - R operator()(P1 p1, P2 p2, P3 p3) { - if (empty()) - return R(); - return helper_->Run(p1, p2, p3); - } - bool empty() const { return !helper_; } - - private: - struct Helper : RefCountInterface { - virtual ~Helper() {} - virtual R Run(P1 p1, P2 p2, P3 p3) = 0; - }; - template struct HelperImpl : Helper { - explicit HelperImpl(const T& functor) : functor_(functor) {} - virtual R Run(P1 p1, P2 p2, P3 p3) { - return functor_(p1, p2, p3); - } - T functor_; - }; - scoped_refptr helper_; -}; - -template -class Callback4 { - public: - // Default copy operations are appropriate for this class. - Callback4() {} - template Callback4(const T& functor) - : helper_(new RefCountedObject< HelperImpl >(functor)) {} - R operator()(P1 p1, P2 p2, P3 p3, P4 p4) { - if (empty()) - return R(); - return helper_->Run(p1, p2, p3, p4); - } - bool empty() const { return !helper_; } - - private: - struct Helper : RefCountInterface { - virtual ~Helper() {} - virtual R Run(P1 p1, P2 p2, P3 p3, P4 p4) = 0; - }; - template struct HelperImpl : Helper { - explicit HelperImpl(const T& functor) : functor_(functor) {} - virtual R Run(P1 p1, P2 p2, P3 p3, P4 p4) { - return functor_(p1, p2, p3, p4); - } - T functor_; - }; - scoped_refptr helper_; -}; - -template -class Callback5 { - public: - // Default copy operations are appropriate for this class. - Callback5() {} - template Callback5(const T& functor) - : helper_(new RefCountedObject< HelperImpl >(functor)) {} - R operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) { - if (empty()) - return R(); - return helper_->Run(p1, p2, p3, p4, p5); - } - bool empty() const { return !helper_; } - - private: - struct Helper : RefCountInterface { - virtual ~Helper() {} - virtual R Run(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) = 0; - }; - template struct HelperImpl : Helper { - explicit HelperImpl(const T& functor) : functor_(functor) {} - virtual R Run(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) { - return functor_(p1, p2, p3, p4, p5); - } - T functor_; - }; - scoped_refptr helper_; -}; -} // namespace talk_base - -#endif // TALK_BASE_CALLBACK_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/checks.h b/thirdparties/common/include/webrtc-sdk/talk/base/checks.h deleted file mode 100755 index 382e4a0..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/checks.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * libjingle - * Copyright 2006, 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. - */ - -// This module contains some basic debugging facilities. -// Originally comes from shared/commandlineflags/checks.h - -#ifndef TALK_BASE_CHECKS_H_ -#define TALK_BASE_CHECKS_H_ - -#include - -// Prints an error message to stderr and aborts execution. -void Fatal(const char* file, int line, const char* format, ...); - - -// The UNREACHABLE macro is very useful during development. -#define UNREACHABLE() \ - Fatal(__FILE__, __LINE__, "unreachable code") - -#endif // TALK_BASE_CHECKS_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/common.h b/thirdparties/common/include/webrtc-sdk/talk/base/common.h deleted file mode 100755 index 4158ac2..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/common.h +++ /dev/null @@ -1,218 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_BASE_COMMON_H_ // NOLINT -#define TALK_BASE_COMMON_H_ - -#include "talk/base/basictypes.h" -#include "talk/base/constructormagic.h" - -#if defined(_MSC_VER) -// warning C4355: 'this' : used in base member initializer list -#pragma warning(disable:4355) -#endif - -////////////////////////////////////////////////////////////////////// -// General Utilities -////////////////////////////////////////////////////////////////////// - -// Note: UNUSED is also defined in basictypes.h -#ifndef UNUSED -#define UNUSED(x) Unused(static_cast(&x)) -#define UNUSED2(x, y) Unused(static_cast(&x)); \ - Unused(static_cast(&y)) -#define UNUSED3(x, y, z) Unused(static_cast(&x)); \ - Unused(static_cast(&y)); \ - Unused(static_cast(&z)) -#define UNUSED4(x, y, z, a) Unused(static_cast(&x)); \ - Unused(static_cast(&y)); \ - Unused(static_cast(&z)); \ - Unused(static_cast(&a)) -#define UNUSED5(x, y, z, a, b) Unused(static_cast(&x)); \ - Unused(static_cast(&y)); \ - Unused(static_cast(&z)); \ - Unused(static_cast(&a)); \ - Unused(static_cast(&b)) -inline void Unused(const void*) {} -#endif // UNUSED - -#ifndef WIN32 - -#ifndef strnicmp -#define strnicmp(x, y, n) strncasecmp(x, y, n) -#endif - -#ifndef stricmp -#define stricmp(x, y) strcasecmp(x, y) -#endif - -// TODO(fbarchard): Remove this. std::max should be used everywhere in the code. -// NOMINMAX must be defined where we include . -#define stdmax(x, y) std::max(x, y) -#else -#define stdmax(x, y) talk_base::_max(x, y) -#endif - -#define ARRAY_SIZE(x) (static_cast(sizeof(x) / sizeof(x[0]))) - -///////////////////////////////////////////////////////////////////////////// -// Assertions -///////////////////////////////////////////////////////////////////////////// - -#ifndef ENABLE_DEBUG -#define ENABLE_DEBUG _DEBUG -#endif // !defined(ENABLE_DEBUG) - -// Even for release builds, allow for the override of LogAssert. Though no -// macro is provided, this can still be used for explicit runtime asserts -// and allow applications to override the assert behavior. - -namespace talk_base { - - -// If a debugger is attached, triggers a debugger breakpoint. If a debugger is -// not attached, forces program termination. -void Break(); - -// LogAssert writes information about an assertion to the log. It's called by -// Assert (and from the ASSERT macro in debug mode) before any other action -// is taken (e.g. breaking the debugger, abort()ing, etc.). -void LogAssert(const char* function, const char* file, int line, - const char* expression); - -typedef void (*AssertLogger)(const char* function, - const char* file, - int line, - const char* expression); - -// Sets a custom assert logger to be used instead of the default LogAssert -// behavior. To clear the custom assert logger, pass NULL for |logger| and the -// default behavior will be restored. Only one custom assert logger can be set -// at a time, so this should generally be set during application startup and -// only by one component. -void SetCustomAssertLogger(AssertLogger logger); - -} // namespace talk_base - -#if ENABLE_DEBUG - -namespace talk_base { - -inline bool Assert(bool result, const char* function, const char* file, - int line, const char* expression) { - if (!result) { - LogAssert(function, file, line, expression); - Break(); - return false; - } - return true; -} - -} // namespace talk_base - -#if defined(_MSC_VER) && _MSC_VER < 1300 -#define __FUNCTION__ "" -#endif - -#ifndef ASSERT -#define ASSERT(x) \ - (void)talk_base::Assert((x), __FUNCTION__, __FILE__, __LINE__, #x) -#endif - -#ifndef VERIFY -#define VERIFY(x) talk_base::Assert((x), __FUNCTION__, __FILE__, __LINE__, #x) -#endif - -#else // !ENABLE_DEBUG - -namespace talk_base { - -inline bool ImplicitCastToBool(bool result) { return result; } - -} // namespace talk_base - -#ifndef ASSERT -#define ASSERT(x) (void)0 -#endif - -#ifndef VERIFY -#define VERIFY(x) talk_base::ImplicitCastToBool(x) -#endif - -#endif // !ENABLE_DEBUG - -#define COMPILE_TIME_ASSERT(expr) char CTA_UNIQUE_NAME[expr] -#define CTA_UNIQUE_NAME CTA_MAKE_NAME(__LINE__) -#define CTA_MAKE_NAME(line) CTA_MAKE_NAME2(line) -#define CTA_MAKE_NAME2(line) constraint_ ## line - -// Forces compiler to inline, even against its better judgement. Use wisely. -#if defined(__GNUC__) -#define FORCE_INLINE __attribute__((always_inline)) -#elif defined(WIN32) -#define FORCE_INLINE __forceinline -#else -#define FORCE_INLINE -#endif - -// Borrowed from Chromium's base/compiler_specific.h. -// Annotate a virtual method indicating it must be overriding a virtual -// method in the parent class. -// Use like: -// virtual void foo() OVERRIDE; -#if defined(WIN32) -#define OVERRIDE override -#elif defined(__clang__) -// Clang defaults to C++03 and warns about using override. Squelch that. -// Intentionally no push/pop here so all users of OVERRIDE ignore the warning -// too. This is like passing -Wno-c++11-extensions, except that GCC won't die -// (because it won't see this pragma). -#pragma clang diagnostic ignored "-Wc++11-extensions" -#define OVERRIDE override -#elif defined(__GNUC__) && __cplusplus >= 201103 && \ - (__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= 40700 -// GCC 4.7 supports explicit virtual overrides when C++11 support is enabled. -#define OVERRIDE override -#else -#define OVERRIDE -#endif - -// Annotate a function indicating the caller must examine the return value. -// Use like: -// int foo() WARN_UNUSED_RESULT; -// To explicitly ignore a result, see |ignore_result()| in . -// TODO(ajm): Hack to avoid multiple definitions until the base/ of webrtc and -// libjingle are merged. -#if !defined(WARN_UNUSED_RESULT) -#if defined(__GNUC__) -#define WARN_UNUSED_RESULT __attribute__((warn_unused_result)) -#else -#define WARN_UNUSED_RESULT -#endif -#endif // WARN_UNUSED_RESULT - -#endif // TALK_BASE_COMMON_H_ // NOLINT diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/compile_assert.h b/thirdparties/common/include/webrtc-sdk/talk/base/compile_assert.h deleted file mode 100755 index bb8227a..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/compile_assert.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * libjingle - * Copyright 2013, 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. - */ - -// COMPILE_ASSERT macro, borrowed from google3/base/macros.h. -#ifndef TALK_BASE_COMPILE_ASSERT_H_ -#define TALK_BASE_COMPILE_ASSERT_H_ - -// The COMPILE_ASSERT macro can be used to verify that a compile time -// expression is true. For example, you could use it to verify the -// size of a static array: -// -// COMPILE_ASSERT(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES, -// content_type_names_incorrect_size); -// -// or to make sure a struct is smaller than a certain size: -// -// COMPILE_ASSERT(sizeof(foo) < 128, foo_too_large); -// -// The second argument to the macro is the name of the variable. If -// the expression is false, most compilers will issue a warning/error -// containing the name of the variable. - -// TODO(ajm): Hack to avoid multiple definitions until the base/ of webrtc and -// libjingle are merged. -#if !defined(COMPILE_ASSERT) -template -struct CompileAssert { -}; - -#define COMPILE_ASSERT(expr, msg) \ - typedef CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] // NOLINT -#endif // COMPILE_ASSERT - -// Implementation details of COMPILE_ASSERT: -// -// - COMPILE_ASSERT works by defining an array type that has -1 -// elements (and thus is invalid) when the expression is false. -// -// - The simpler definition -// -// #define COMPILE_ASSERT(expr, msg) typedef char msg[(expr) ? 1 : -1] -// -// does not work, as gcc supports variable-length arrays whose sizes -// are determined at run-time (this is gcc's extension and not part -// of the C++ standard). As a result, gcc fails to reject the -// following code with the simple definition: -// -// int foo; -// COMPILE_ASSERT(foo, msg); // not supposed to compile as foo is -// // not a compile-time constant. -// -// - By using the type CompileAssert<(bool(expr))>, we ensures that -// expr is a compile-time constant. (Template arguments must be -// determined at compile-time.) -// -// - The outer parentheses in CompileAssert<(bool(expr))> are necessary -// to work around a bug in gcc 3.4.4 and 4.0.1. If we had written -// -// CompileAssert -// -// instead, these compilers will refuse to compile -// -// COMPILE_ASSERT(5 > 0, some_message); -// -// (They seem to think the ">" in "5 > 0" marks the end of the -// template argument list.) -// -// - The array size is (bool(expr) ? 1 : -1), instead of simply -// -// ((expr) ? 1 : -1). -// -// This is to avoid running into a bug in MS VC 7.1, which -// causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1. - -#endif // TALK_BASE_COMPILE_ASSERT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/constructormagic.h b/thirdparties/common/include/webrtc-sdk/talk/base/constructormagic.h deleted file mode 100755 index 15a240f..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/constructormagic.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_CONSTRUCTORMAGIC_H_ -#define TALK_BASE_CONSTRUCTORMAGIC_H_ - -#define DISALLOW_ASSIGN(TypeName) \ - void operator=(const TypeName&) - -// A macro to disallow the evil copy constructor and operator= functions -// This should be used in the private: declarations for a class. -// Undefine this, just in case. Some third-party includes have their own -// version. -#undef DISALLOW_COPY_AND_ASSIGN -#define DISALLOW_COPY_AND_ASSIGN(TypeName) \ - TypeName(const TypeName&); \ - DISALLOW_ASSIGN(TypeName) - -// Alternative, less-accurate legacy name. -#define DISALLOW_EVIL_CONSTRUCTORS(TypeName) \ - DISALLOW_COPY_AND_ASSIGN(TypeName) - -// A macro to disallow all the implicit constructors, namely the -// default constructor, copy constructor and operator= functions. -// -// This should be used in the private: declarations for a class -// that wants to prevent anyone from instantiating it. This is -// especially useful for classes containing only static methods. -#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ - TypeName(); \ - DISALLOW_EVIL_CONSTRUCTORS(TypeName) - - -#endif // TALK_BASE_CONSTRUCTORMAGIC_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/cpumonitor.h b/thirdparties/common/include/webrtc-sdk/talk/base/cpumonitor.h deleted file mode 100755 index 8c0ec22..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/cpumonitor.h +++ /dev/null @@ -1,140 +0,0 @@ -/* - * libjingle - * Copyright 2010 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_BASE_CPUMONITOR_H_ -#define TALK_BASE_CPUMONITOR_H_ - -#include "talk/base/basictypes.h" -#include "talk/base/messagehandler.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/sigslot.h" -#if defined(LINUX) || defined(ANDROID) -#include "talk/base/stream.h" -#endif // defined(LINUX) || defined(ANDROID) - -namespace talk_base { -class Thread; -class SystemInfo; - -struct CpuStats { - CpuStats() - : prev_total_times_(0), - prev_cpu_times_(0), - prev_load_(0.f), - prev_load_time_(0u) { - } - - uint64 prev_total_times_; - uint64 prev_cpu_times_; - float prev_load_; // Previous load value. - uint32 prev_load_time_; // Time previous load value was taken. -}; - -// CpuSampler samples the process and system load. -class CpuSampler { - public: - CpuSampler(); - ~CpuSampler(); - - // Initialize CpuSampler. Returns true if successful. - bool Init(); - - // Set minimum interval in ms between computing new load values. - // Default 950 ms. Set to 0 to disable interval. - void set_load_interval(int min_load_interval); - - // Return CPU load of current process as a float from 0 to 1. - float GetProcessLoad(); - - // Return CPU load of current process as a float from 0 to 1. - float GetSystemLoad(); - - // Return number of cpus. Includes hyperthreads. - int GetMaxCpus() const; - - // Return current number of cpus available to this process. - int GetCurrentCpus(); - - // For testing. Allows forcing of fallback to using NTDLL functions. - void set_force_fallback(bool fallback) { -#ifdef WIN32 - force_fallback_ = fallback; -#endif - } - - private: - float UpdateCpuLoad(uint64 current_total_times, - uint64 current_cpu_times, - uint64 *prev_total_times, - uint64 *prev_cpu_times); - CpuStats process_; - CpuStats system_; - int cpus_; - int min_load_interval_; // Minimum time between computing new load. - scoped_ptr sysinfo_; -#ifdef WIN32 - void* get_system_times_; - void* nt_query_system_information_; - bool force_fallback_; -#endif -#if defined(LINUX) || defined(ANDROID) - // File for reading /proc/stat - scoped_ptr sfile_; -#endif // defined(LINUX) || defined(ANDROID) -}; - -// CpuMonitor samples and signals the CPU load periodically. -class CpuMonitor - : public talk_base::MessageHandler, public sigslot::has_slots<> { - public: - explicit CpuMonitor(Thread* thread); - virtual ~CpuMonitor(); - void set_thread(Thread* thread); - - bool Start(int period_ms); - void Stop(); - // Signal parameters are current cpus, max cpus, process load and system load. - sigslot::signal4 SignalUpdate; - - protected: - // Override virtual method of parent MessageHandler. - virtual void OnMessage(talk_base::Message* msg); - // Clear the monitor thread and stop sending it messages if the thread goes - // away before our lifetime. - void OnMessageQueueDestroyed() { monitor_thread_ = NULL; } - - private: - Thread* monitor_thread_; - CpuSampler sampler_; - int period_ms_; - - DISALLOW_COPY_AND_ASSIGN(CpuMonitor); -}; - -} // namespace talk_base - -#endif // TALK_BASE_CPUMONITOR_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/crc32.h b/thirdparties/common/include/webrtc-sdk/talk/base/crc32.h deleted file mode 100755 index b54e5e2..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/crc32.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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_BASE_CRC32_H_ -#define TALK_BASE_CRC32_H_ - -#include - -#include "talk/base/basictypes.h" - -namespace talk_base { - -// Updates a CRC32 checksum with |len| bytes from |buf|. |initial| holds the -// checksum result from the previous update; for the first call, it should be 0. -uint32 UpdateCrc32(uint32 initial, const void* buf, size_t len); - -// Computes a CRC32 checksum using |len| bytes from |buf|. -inline uint32 ComputeCrc32(const void* buf, size_t len) { - return UpdateCrc32(0, buf, len); -} -inline uint32 ComputeCrc32(const std::string& str) { - return ComputeCrc32(str.c_str(), str.size()); -} - -} // namespace talk_base - -#endif // TALK_BASE_CRC32_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/criticalsection.h b/thirdparties/common/include/webrtc-sdk/talk/base/criticalsection.h deleted file mode 100755 index 681655b..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/criticalsection.h +++ /dev/null @@ -1,196 +0,0 @@ -/* - * libjingle - * Copyright 2004, 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_BASE_CRITICALSECTION_H__ -#define TALK_BASE_CRITICALSECTION_H__ - -#include "talk/base/constructormagic.h" - -#ifdef WIN32 -#include "talk/base/win32.h" -#endif - -#ifdef POSIX -#include -#endif - -#ifdef _DEBUG -#define CS_TRACK_OWNER 1 -#endif // _DEBUG - -#if CS_TRACK_OWNER -#define TRACK_OWNER(x) x -#else // !CS_TRACK_OWNER -#define TRACK_OWNER(x) -#endif // !CS_TRACK_OWNER - -namespace talk_base { - -#ifdef WIN32 -class CriticalSection { - public: - CriticalSection() { - InitializeCriticalSection(&crit_); - // Windows docs say 0 is not a valid thread id - TRACK_OWNER(thread_ = 0); - } - ~CriticalSection() { - DeleteCriticalSection(&crit_); - } - void Enter() { - EnterCriticalSection(&crit_); - TRACK_OWNER(thread_ = GetCurrentThreadId()); - } - bool TryEnter() { - if (TryEnterCriticalSection(&crit_) != FALSE) { - TRACK_OWNER(thread_ = GetCurrentThreadId()); - return true; - } - return false; - } - void Leave() { - TRACK_OWNER(thread_ = 0); - LeaveCriticalSection(&crit_); - } - -#if CS_TRACK_OWNER - bool CurrentThreadIsOwner() const { return thread_ == GetCurrentThreadId(); } -#endif // CS_TRACK_OWNER - - private: - CRITICAL_SECTION crit_; - TRACK_OWNER(DWORD thread_); // The section's owning thread id -}; -#endif // WIN32 - -#ifdef POSIX -class CriticalSection { - public: - CriticalSection() { - pthread_mutexattr_t mutex_attribute; - pthread_mutexattr_init(&mutex_attribute); - pthread_mutexattr_settype(&mutex_attribute, PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init(&mutex_, &mutex_attribute); - pthread_mutexattr_destroy(&mutex_attribute); - TRACK_OWNER(thread_ = 0); - } - ~CriticalSection() { - pthread_mutex_destroy(&mutex_); - } - void Enter() { - pthread_mutex_lock(&mutex_); - TRACK_OWNER(thread_ = pthread_self()); - } - bool TryEnter() { - if (pthread_mutex_trylock(&mutex_) == 0) { - TRACK_OWNER(thread_ = pthread_self()); - return true; - } - return false; - } - void Leave() { - TRACK_OWNER(thread_ = 0); - pthread_mutex_unlock(&mutex_); - } - -#if CS_TRACK_OWNER - bool CurrentThreadIsOwner() const { return pthread_equal(thread_, pthread_self()); } -#endif // CS_TRACK_OWNER - - private: - pthread_mutex_t mutex_; - TRACK_OWNER(pthread_t thread_); -}; -#endif // POSIX - -// CritScope, for serializing execution through a scope. -class CritScope { - public: - explicit CritScope(CriticalSection *pcrit) { - pcrit_ = pcrit; - pcrit_->Enter(); - } - ~CritScope() { - pcrit_->Leave(); - } - private: - CriticalSection *pcrit_; - DISALLOW_COPY_AND_ASSIGN(CritScope); -}; - -// Tries to lock a critical section on construction via -// CriticalSection::TryEnter, and unlocks on destruction if the -// lock was taken. Never blocks. -// -// IMPORTANT: Unlike CritScope, the lock may not be owned by this thread in -// subsequent code. Users *must* check locked() to determine if the -// lock was taken. If you're not calling locked(), you're doing it wrong! -class TryCritScope { - public: - explicit TryCritScope(CriticalSection *pcrit) { - pcrit_ = pcrit; - locked_ = pcrit_->TryEnter(); - } - ~TryCritScope() { - if (locked_) { - pcrit_->Leave(); - } - } - bool locked() const { - return locked_; - } - private: - CriticalSection *pcrit_; - bool locked_; - DISALLOW_COPY_AND_ASSIGN(TryCritScope); -}; - -// TODO: Move this to atomicops.h, which can't be done easily because of -// complex compile rules. -class AtomicOps { - public: -#ifdef WIN32 - // Assumes sizeof(int) == sizeof(LONG), which it is on Win32 and Win64. - static int Increment(int* i) { - return ::InterlockedIncrement(reinterpret_cast(i)); - } - static int Decrement(int* i) { - return ::InterlockedDecrement(reinterpret_cast(i)); - } -#else - static int Increment(int* i) { - return __sync_add_and_fetch(i, 1); - } - static int Decrement(int* i) { - return __sync_sub_and_fetch(i, 1); - } -#endif -}; - -} // namespace talk_base - -#endif // TALK_BASE_CRITICALSECTION_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/cryptstring.h b/thirdparties/common/include/webrtc-sdk/talk/base/cryptstring.h deleted file mode 100755 index 75d817a..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/cryptstring.h +++ /dev/null @@ -1,200 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_CRYPTSTRING_H_ -#define _TALK_BASE_CRYPTSTRING_H_ - -#include - -#include -#include - -#include "talk/base/linked_ptr.h" -#include "talk/base/scoped_ptr.h" - -namespace talk_base { - -class CryptStringImpl { -public: - virtual ~CryptStringImpl() {} - virtual size_t GetLength() const = 0; - virtual void CopyTo(char * dest, bool nullterminate) const = 0; - virtual std::string UrlEncode() const = 0; - virtual CryptStringImpl * Copy() const = 0; - virtual void CopyRawTo(std::vector * dest) const = 0; -}; - -class EmptyCryptStringImpl : public CryptStringImpl { -public: - virtual ~EmptyCryptStringImpl() {} - virtual size_t GetLength() const { return 0; } - virtual void CopyTo(char * dest, bool nullterminate) const { - if (nullterminate) { - *dest = '\0'; - } - } - virtual std::string UrlEncode() const { return ""; } - virtual CryptStringImpl * Copy() const { return new EmptyCryptStringImpl(); } - virtual void CopyRawTo(std::vector * dest) const { - dest->clear(); - } -}; - -class CryptString { -public: - CryptString() : impl_(new EmptyCryptStringImpl()) {} - size_t GetLength() const { return impl_->GetLength(); } - void CopyTo(char * dest, bool nullterminate) const { impl_->CopyTo(dest, nullterminate); } - CryptString(const CryptString & other) : impl_(other.impl_->Copy()) {} - explicit CryptString(const CryptStringImpl & impl) : impl_(impl.Copy()) {} - CryptString & operator=(const CryptString & other) { - if (this != &other) { - impl_.reset(other.impl_->Copy()); - } - return *this; - } - void Clear() { impl_.reset(new EmptyCryptStringImpl()); } - std::string UrlEncode() const { return impl_->UrlEncode(); } - void CopyRawTo(std::vector * dest) const { - return impl_->CopyRawTo(dest); - } - -private: - scoped_ptr impl_; -}; - - -// Used for constructing strings where a password is involved and we -// need to ensure that we zero memory afterwards -class FormatCryptString { -public: - FormatCryptString() { - storage_ = new char[32]; - capacity_ = 32; - length_ = 0; - storage_[0] = 0; - } - - void Append(const std::string & text) { - Append(text.data(), text.length()); - } - - void Append(const char * data, size_t length) { - EnsureStorage(length_ + length + 1); - memcpy(storage_ + length_, data, length); - length_ += length; - storage_[length_] = '\0'; - } - - void Append(const CryptString * password) { - size_t len = password->GetLength(); - EnsureStorage(length_ + len + 1); - password->CopyTo(storage_ + length_, true); - length_ += len; - } - - size_t GetLength() { - return length_; - } - - const char * GetData() { - return storage_; - } - - - // Ensures storage of at least n bytes - void EnsureStorage(size_t n) { - if (capacity_ >= n) { - return; - } - - size_t old_capacity = capacity_; - char * old_storage = storage_; - - for (;;) { - capacity_ *= 2; - if (capacity_ >= n) - break; - } - - storage_ = new char[capacity_]; - - if (old_capacity) { - memcpy(storage_, old_storage, length_); - - // zero memory in a way that an optimizer won't optimize it out - old_storage[0] = 0; - for (size_t i = 1; i < old_capacity; i++) { - old_storage[i] = old_storage[i - 1]; - } - delete[] old_storage; - } - } - - ~FormatCryptString() { - if (capacity_) { - storage_[0] = 0; - for (size_t i = 1; i < capacity_; i++) { - storage_[i] = storage_[i - 1]; - } - } - delete[] storage_; - } -private: - char * storage_; - size_t capacity_; - size_t length_; -}; - -class InsecureCryptStringImpl : public CryptStringImpl { - public: - std::string& password() { return password_; } - const std::string& password() const { return password_; } - - virtual ~InsecureCryptStringImpl() {} - virtual size_t GetLength() const { return password_.size(); } - virtual void CopyTo(char * dest, bool nullterminate) const { - memcpy(dest, password_.data(), password_.size()); - if (nullterminate) dest[password_.size()] = 0; - } - virtual std::string UrlEncode() const { return password_; } - virtual CryptStringImpl * Copy() const { - InsecureCryptStringImpl * copy = new InsecureCryptStringImpl; - copy->password() = password_; - return copy; - } - virtual void CopyRawTo(std::vector * dest) const { - dest->resize(password_.size()); - memcpy(&dest->front(), password_.data(), password_.size()); - } - private: - std::string password_; -}; - -} - -#endif // _TALK_BASE_CRYPTSTRING_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/dbus.h b/thirdparties/common/include/webrtc-sdk/talk/base/dbus.h deleted file mode 100755 index 3169e46..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/dbus.h +++ /dev/null @@ -1,185 +0,0 @@ -/* - * libjingle - * Copyright 2004--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_BASE_DBUS_H_ -#define TALK_BASE_DBUS_H_ - -#ifdef HAVE_DBUS_GLIB - -#include - -#include -#include - -#include "talk/base/libdbusglibsymboltable.h" -#include "talk/base/messagehandler.h" -#include "talk/base/thread.h" - -namespace talk_base { - -#define DBUS_TYPE "type" -#define DBUS_SIGNAL "signal" -#define DBUS_PATH "path" -#define DBUS_INTERFACE "interface" -#define DBUS_MEMBER "member" - -#ifdef CHROMEOS -#define CROS_PM_PATH "/" -#define CROS_PM_INTERFACE "org.chromium.PowerManager" -#define CROS_SIG_POWERCHANGED "PowerStateChanged" -#define CROS_VALUE_SLEEP "mem" -#define CROS_VALUE_RESUME "on" -#else -#define UP_PATH "/org/freedesktop/UPower" -#define UP_INTERFACE "org.freedesktop.UPower" -#define UP_SIG_SLEEPING "Sleeping" -#define UP_SIG_RESUMING "Resuming" -#endif // CHROMEOS - -// Wraps a DBus messages. -class DBusSigMessageData : public TypedMessageData { - public: - explicit DBusSigMessageData(DBusMessage *message); - ~DBusSigMessageData(); -}; - -// DBusSigFilter is an abstract class that defines the interface of DBus -// signal handling. -// The subclasses implement ProcessSignal() for various purposes. -// When a DBus signal comes, a DSM_SIGNAL message is posted to the caller thread -// which will then invokes ProcessSignal(). -class DBusSigFilter : protected MessageHandler { - public: - enum DBusSigMessage { DSM_SIGNAL }; - - // This filter string should ususally come from BuildFilterString() - explicit DBusSigFilter(const std::string &filter) - : caller_thread_(Thread::Current()), filter_(filter) { - } - - // Builds a DBus monitor filter string from given DBus path, interface, and - // member. - // See http://dbus.freedesktop.org/doc/api/html/group__DBusConnection.html - static std::string BuildFilterString(const std::string &path, - const std::string &interface, - const std::string &member); - - // Handles callback on DBus messages by DBus system. - static DBusHandlerResult DBusCallback(DBusConnection *dbus_conn, - DBusMessage *message, - void *instance); - - // Handles callback on DBus messages to each DBusSigFilter instance. - DBusHandlerResult Callback(DBusMessage *message); - - // From MessageHandler. - virtual void OnMessage(Message *message); - - // Returns the DBus monitor filter string. - const std::string &filter() const { return filter_; } - - private: - // On caller thread. - virtual void ProcessSignal(DBusMessage *message) = 0; - - Thread *caller_thread_; - const std::string filter_; -}; - -// DBusMonitor is a class for DBus signal monitoring. -// -// The caller-thread calls AddFilter() first to add the signals that it wants to -// monitor and then calls StartMonitoring() to start the monitoring. -// This will create a worker-thread which listens on DBus connection and sends -// DBus signals back through the callback. -// The worker-thread will be running forever until either StopMonitoring() is -// called from the caller-thread or the worker-thread hit some error. -// -// Programming model: -// 1. Caller-thread: Creates an object of DBusMonitor. -// 2. Caller-thread: Calls DBusMonitor::AddFilter() one or several times. -// 3. Caller-thread: StartMonitoring(). -// ... -// 4. Worker-thread: DBus signal recieved. Post a message to caller-thread. -// 5. Caller-thread: DBusFilterBase::ProcessSignal() is invoked. -// ... -// 6. Caller-thread: StopMonitoring(). -// -// Assumption: -// AddFilter(), StartMonitoring(), and StopMonitoring() methods are called by -// a single thread. Hence, there is no need to make them thread safe. -class DBusMonitor { - public: - // Status of DBus monitoring. - enum DBusMonitorStatus { - DMS_NOT_INITIALIZED, // Not initialized. - DMS_INITIALIZING, // Initializing the monitoring thread. - DMS_RUNNING, // Monitoring. - DMS_STOPPED, // Not monitoring. Stopped normally. - DMS_FAILED, // Not monitoring. Failed. - }; - - // Returns the DBus-Glib symbol table. - // We should only use this function to access DBus-Glib symbols. - static LibDBusGlibSymbolTable *GetDBusGlibSymbolTable(); - - // Creates an instance of DBusMonitor. - static DBusMonitor *Create(DBusBusType type); - ~DBusMonitor(); - - // Adds a filter to DBusMonitor. - bool AddFilter(DBusSigFilter *filter); - - // Starts DBus message monitoring. - bool StartMonitoring(); - - // Stops DBus message monitoring. - bool StopMonitoring(); - - // Gets the status of DBus monitoring. - DBusMonitorStatus GetStatus(); - - private: - // Forward declaration. Defined in the .cc file. - class DBusMonitoringThread; - - explicit DBusMonitor(DBusBusType type); - - // Updates status_ when monitoring status has changed. - void OnMonitoringStatusChanged(DBusMonitorStatus status); - - DBusBusType type_; - DBusMonitorStatus status_; - DBusMonitoringThread *monitoring_thread_; - std::vector filter_list_; -}; - -} // namespace talk_base - -#endif // HAVE_DBUS_GLIB - -#endif // TALK_BASE_DBUS_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/diskcache.h b/thirdparties/common/include/webrtc-sdk/talk/base/diskcache.h deleted file mode 100755 index a0e397d..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/diskcache.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_DISKCACHE_H__ -#define TALK_BASE_DISKCACHE_H__ - -#include -#include - -#ifdef WIN32 -#undef UnlockResource -#endif // WIN32 - -namespace talk_base { - -class StreamInterface; - -/////////////////////////////////////////////////////////////////////////////// -// DiskCache - An LRU cache of streams, stored on disk. -// -// Streams are identified by a unique resource id. Multiple streams can be -// associated with each resource id, distinguished by an index. When old -// resources are flushed from the cache, all streams associated with those -// resources are removed together. -// DiskCache is designed to persist across executions of the program. It is -// safe for use from an arbitrary number of users on a single thread, but not -// from multiple threads or other processes. -/////////////////////////////////////////////////////////////////////////////// - -class DiskCache { -public: - DiskCache(); - virtual ~DiskCache(); - - bool Initialize(const std::string& folder, size_t size); - bool Purge(); - - bool LockResource(const std::string& id); - StreamInterface* WriteResource(const std::string& id, size_t index); - bool UnlockResource(const std::string& id); - - StreamInterface* ReadResource(const std::string& id, size_t index) const; - - bool HasResource(const std::string& id) const; - bool HasResourceStream(const std::string& id, size_t index) const; - bool DeleteResource(const std::string& id); - - protected: - virtual bool InitializeEntries() = 0; - virtual bool PurgeFiles() = 0; - - virtual bool FileExists(const std::string& filename) const = 0; - virtual bool DeleteFile(const std::string& filename) const = 0; - - enum LockState { LS_UNLOCKED, LS_LOCKED, LS_UNLOCKING }; - struct Entry { - LockState lock_state; - mutable size_t accessors; - size_t size; - size_t streams; - time_t last_modified; - }; - typedef std::map EntryMap; - friend class DiskCacheAdapter; - - bool CheckLimit(); - - std::string IdToFilename(const std::string& id, size_t index) const; - bool FilenameToId(const std::string& filename, std::string* id, - size_t* index) const; - - const Entry* GetEntry(const std::string& id) const { - return const_cast(this)->GetOrCreateEntry(id, false); - } - Entry* GetOrCreateEntry(const std::string& id, bool create); - - void ReleaseResource(const std::string& id, size_t index) const; - - std::string folder_; - size_t max_cache_, total_size_; - EntryMap map_; - mutable size_t total_accessors_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// CacheLock - Automatically manage locking and unlocking, with optional -// rollback semantics -/////////////////////////////////////////////////////////////////////////////// - -class CacheLock { -public: - CacheLock(DiskCache* cache, const std::string& id, bool rollback = false) - : cache_(cache), id_(id), rollback_(rollback) - { - locked_ = cache_->LockResource(id_); - } - ~CacheLock() { - if (locked_) { - cache_->UnlockResource(id_); - if (rollback_) { - cache_->DeleteResource(id_); - } - } - } - bool IsLocked() const { return locked_; } - void Commit() { rollback_ = false; } - -private: - DiskCache* cache_; - std::string id_; - bool rollback_, locked_; -}; - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace talk_base - -#endif // TALK_BASE_DISKCACHE_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/diskcache_win32.h b/thirdparties/common/include/webrtc-sdk/talk/base/diskcache_win32.h deleted file mode 100755 index 1dbfc67..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/diskcache_win32.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * libjingle - * Copyright 2006, 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_BASE_DISKCACHEWIN32_H__ -#define TALK_BASE_DISKCACHEWIN32_H__ - -#include "talk/base/diskcache.h" - -namespace talk_base { - -class DiskCacheWin32 : public DiskCache { - protected: - virtual bool InitializeEntries(); - virtual bool PurgeFiles(); - - virtual bool FileExists(const std::string& filename) const; - virtual bool DeleteFile(const std::string& filename) const; -}; - -} - -#endif // TALK_BASE_DISKCACHEWIN32_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/dscp.h b/thirdparties/common/include/webrtc-sdk/talk/base/dscp.h deleted file mode 100755 index 4acef1b..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/dscp.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * libjingle - * Copyright 2013, 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_BASE_DSCP_H_ -#define TALK_BASE_DSCP_H_ - -namespace talk_base { -// Differentiated Services Code Point. -// See http://tools.ietf.org/html/rfc2474 for details. -enum DiffServCodePoint { - DSCP_NO_CHANGE = -1, - DSCP_DEFAULT = 0, // Same as DSCP_CS0 - DSCP_CS0 = 0, // The default - DSCP_CS1 = 8, // Bulk/background traffic - DSCP_AF11 = 10, - DSCP_AF12 = 12, - DSCP_AF13 = 14, - DSCP_CS2 = 16, - DSCP_AF21 = 18, - DSCP_AF22 = 20, - DSCP_AF23 = 22, - DSCP_CS3 = 24, - DSCP_AF31 = 26, - DSCP_AF32 = 28, - DSCP_AF33 = 30, - DSCP_CS4 = 32, - DSCP_AF41 = 34, // Video - DSCP_AF42 = 36, // Video - DSCP_AF43 = 38, // Video - DSCP_CS5 = 40, // Video - DSCP_EF = 46, // Voice - DSCP_CS6 = 48, // Voice - DSCP_CS7 = 56, // Control messages -}; - -} // namespace talk_base - - #endif // TALK_BASE_DSCP_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/event.h b/thirdparties/common/include/webrtc-sdk/talk/base/event.h deleted file mode 100755 index 3969e58..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/event.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * libjingle - * Copyright 2004--2008, 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_BASE_EVENT_H__ -#define TALK_BASE_EVENT_H__ - -#if defined(WIN32) -#include "talk/base/win32.h" // NOLINT: consider this a system header. -#elif defined(POSIX) -#include -#else -#error "Must define either WIN32 or POSIX." -#endif - -#include "talk/base/basictypes.h" -#include "talk/base/common.h" - -namespace talk_base { - -class Event { - public: - Event(bool manual_reset, bool initially_signaled); - ~Event(); - - void Set(); - void Reset(); - bool Wait(int cms); - - private: - bool is_manual_reset_; - -#if defined(WIN32) - bool is_initially_signaled_; - HANDLE event_handle_; -#elif defined(POSIX) - bool event_status_; - pthread_mutex_t event_mutex_; - pthread_cond_t event_cond_; -#endif -}; - -} // namespace talk_base - -#endif // TALK_BASE_EVENT_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/fakecpumonitor.h b/thirdparties/common/include/webrtc-sdk/talk/base/fakecpumonitor.h deleted file mode 100755 index b73ff77..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/fakecpumonitor.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * libjingle - * Copyright 2013 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_BASE_FAKECPUMONITOR_H_ -#define TALK_BASE_FAKECPUMONITOR_H_ - -#include "talk/base/cpumonitor.h" - -namespace talk_base { - -class FakeCpuMonitor : public talk_base::CpuMonitor { - public: - explicit FakeCpuMonitor(Thread* thread) - : CpuMonitor(thread) { - } - ~FakeCpuMonitor() { - } - - virtual void OnMessage(talk_base::Message* msg) { - } -}; - -} // namespace talk_base - -#endif // TALK_BASE_FAKECPUMONITOR_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/fakenetwork.h b/thirdparties/common/include/webrtc-sdk/talk/base/fakenetwork.h deleted file mode 100755 index acb75d0..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/fakenetwork.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * libjingle - * Copyright 2009 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_BASE_FAKENETWORK_H_ -#define TALK_BASE_FAKENETWORK_H_ - -#include -#include - -#include "talk/base/network.h" -#include "talk/base/messagehandler.h" -#include "talk/base/socketaddress.h" -#include "talk/base/stringencode.h" -#include "talk/base/thread.h" - -namespace talk_base { - -const int kFakeIPv4NetworkPrefixLength = 24; -const int kFakeIPv6NetworkPrefixLength = 64; - -// Fake network manager that allows us to manually specify the IPs to use. -class FakeNetworkManager : public NetworkManagerBase, - public MessageHandler { - public: - FakeNetworkManager() - : thread_(Thread::Current()), - next_index_(0), - started_(false), - sent_first_update_(false) { - } - - typedef std::vector IfaceList; - - void AddInterface(const SocketAddress& iface) { - // ensure a unique name for the interface - SocketAddress address("test" + talk_base::ToString(next_index_++), 0); - address.SetResolvedIP(iface.ipaddr()); - ifaces_.push_back(address); - DoUpdateNetworks(); - } - - void RemoveInterface(const SocketAddress& iface) { - for (IfaceList::iterator it = ifaces_.begin(); - it != ifaces_.end(); ++it) { - if (it->EqualIPs(iface)) { - ifaces_.erase(it); - break; - } - } - DoUpdateNetworks(); - } - - virtual void StartUpdating() { - if (started_) { - if (sent_first_update_) - SignalNetworksChanged(); - return; - } - - started_ = true; - sent_first_update_ = false; - thread_->Post(this); - } - - virtual void StopUpdating() { - started_ = false; - } - - // MessageHandler interface. - virtual void OnMessage(Message* msg) { - DoUpdateNetworks(); - } - - private: - void DoUpdateNetworks() { - if (!started_) - return; - std::vector networks; - for (IfaceList::iterator it = ifaces_.begin(); - it != ifaces_.end(); ++it) { - int prefix_length = 0; - if (it->ipaddr().family() == AF_INET) { - prefix_length = kFakeIPv4NetworkPrefixLength; - } else if (it->ipaddr().family() == AF_INET6) { - prefix_length = kFakeIPv6NetworkPrefixLength; - } - IPAddress prefix = TruncateIP(it->ipaddr(), prefix_length); - scoped_ptr net(new Network(it->hostname(), - it->hostname(), - prefix, - prefix_length)); - net->AddIP(it->ipaddr()); - networks.push_back(net.release()); - } - bool changed; - MergeNetworkList(networks, &changed); - if (changed || !sent_first_update_) { - SignalNetworksChanged(); - sent_first_update_ = true; - } - } - - Thread* thread_; - IfaceList ifaces_; - int next_index_; - bool started_; - bool sent_first_update_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_FAKENETWORK_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/fakesslidentity.h b/thirdparties/common/include/webrtc-sdk/talk/base/fakesslidentity.h deleted file mode 100755 index d625230..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/fakesslidentity.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * libjingle - * Copyright 2012, The Libjingle Authors. - * - * 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_BASE_FAKESSLIDENTITY_H_ -#define TALK_BASE_FAKESSLIDENTITY_H_ - -#include -#include - -#include "talk/base/messagedigest.h" -#include "talk/base/sslidentity.h" - -namespace talk_base { - -class FakeSSLCertificate : public talk_base::SSLCertificate { - public: - // SHA-1 is the default digest algorithm because it is available in all build - // configurations used for unit testing. - explicit FakeSSLCertificate(const std::string& data) - : data_(data), digest_algorithm_(DIGEST_SHA_1) {} - explicit FakeSSLCertificate(const std::vector& certs) - : data_(certs.front()), digest_algorithm_(DIGEST_SHA_1) { - std::vector::const_iterator it; - // Skip certs[0]. - for (it = certs.begin() + 1; it != certs.end(); ++it) { - certs_.push_back(FakeSSLCertificate(*it)); - } - } - virtual FakeSSLCertificate* GetReference() const { - return new FakeSSLCertificate(*this); - } - virtual std::string ToPEMString() const { - return data_; - } - virtual void ToDER(Buffer* der_buffer) const { - std::string der_string; - VERIFY(SSLIdentity::PemToDer(kPemTypeCertificate, data_, &der_string)); - der_buffer->SetData(der_string.c_str(), der_string.size()); - } - void set_digest_algorithm(const std::string& algorithm) { - digest_algorithm_ = algorithm; - } - virtual bool GetSignatureDigestAlgorithm(std::string* algorithm) const { - *algorithm = digest_algorithm_; - return true; - } - virtual bool ComputeDigest(const std::string& algorithm, - unsigned char* digest, - size_t size, - size_t* length) const { - *length = talk_base::ComputeDigest(algorithm, data_.c_str(), data_.size(), - digest, size); - return (*length != 0); - } - virtual bool GetChain(SSLCertChain** chain) const { - if (certs_.empty()) - return false; - std::vector new_certs(certs_.size()); - std::transform(certs_.begin(), certs_.end(), new_certs.begin(), DupCert); - *chain = new SSLCertChain(new_certs); - return true; - } - - private: - static FakeSSLCertificate* DupCert(FakeSSLCertificate cert) { - return cert.GetReference(); - } - std::string data_; - std::vector certs_; - std::string digest_algorithm_; -}; - -class FakeSSLIdentity : public talk_base::SSLIdentity { - public: - explicit FakeSSLIdentity(const std::string& data) : cert_(data) {} - explicit FakeSSLIdentity(const FakeSSLCertificate& cert) : cert_(cert) {} - virtual FakeSSLIdentity* GetReference() const { - return new FakeSSLIdentity(*this); - } - virtual const FakeSSLCertificate& certificate() const { return cert_; } - private: - FakeSSLCertificate cert_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_FAKESSLIDENTITY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/faketaskrunner.h b/thirdparties/common/include/webrtc-sdk/talk/base/faketaskrunner.h deleted file mode 100755 index 52fa50d..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/faketaskrunner.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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. - */ - -// A fake TaskRunner for use in unit tests. - -#ifndef TALK_BASE_FAKETASKRUNNER_H_ -#define TALK_BASE_FAKETASKRUNNER_H_ - -#include "talk/base/taskparent.h" -#include "talk/base/taskrunner.h" - -namespace talk_base { - -class FakeTaskRunner : public TaskRunner { - public: - FakeTaskRunner() : current_time_(0) {} - virtual ~FakeTaskRunner() {} - - virtual void WakeTasks() { RunTasks(); } - - virtual int64 CurrentTime() { - // Implement if needed. - return current_time_++; - } - - int64 current_time_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_FAKETASKRUNNER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/filelock.h b/thirdparties/common/include/webrtc-sdk/talk/base/filelock.h deleted file mode 100755 index 4bd732f..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/filelock.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * libjingle - * Copyright 2009, 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_BASE_FILELOCK_H_ -#define TALK_BASE_FILELOCK_H_ - -#include - -#include "talk/base/constructormagic.h" -#include "talk/base/scoped_ptr.h" - -namespace talk_base { - -class FileStream; - -// Implements a very simple cross process lock based on a file. -// When Lock(...) is called we try to open/create the file in read/write -// mode without any sharing. (Or locking it with flock(...) on Unix) -// If the process crash the OS will make sure that the file descriptor -// is released and another process can accuire the lock. -// This doesn't work on ancient OSX/Linux versions if used on NFS. -// (Nfs-client before: ~2.6 and Linux Kernel < 2.6.) -class FileLock { - public: - virtual ~FileLock(); - - // Attempts to lock the file. The caller owns the returned - // lock object. Returns NULL if the file already was locked. - static FileLock* TryLock(const std::string& path); - void Unlock(); - - protected: - FileLock(const std::string& path, FileStream* file); - - private: - void MaybeUnlock(); - - std::string path_; - scoped_ptr file_; - - DISALLOW_EVIL_CONSTRUCTORS(FileLock); -}; - -} // namespace talk_base - -#endif // TALK_BASE_FILELOCK_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/fileutils.h b/thirdparties/common/include/webrtc-sdk/talk/base/fileutils.h deleted file mode 100755 index eb36e64..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/fileutils.h +++ /dev/null @@ -1,476 +0,0 @@ -/* - * libjingle - * Copyright 2004--2006, 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_BASE_FILEUTILS_H_ -#define TALK_BASE_FILEUTILS_H_ - -#include - -#ifdef WIN32 -#include "talk/base/win32.h" -#else -#include -#include -#include -#include -#include -#endif - -#include "talk/base/basictypes.h" -#include "talk/base/common.h" -#include "talk/base/scoped_ptr.h" - -namespace talk_base { - -class FileStream; -class Pathname; - -////////////////////////// -// Directory Iterator // -////////////////////////// - -// A DirectoryIterator is created with a given directory. It originally points -// to the first file in the directory, and can be advanecd with Next(). This -// allows you to get information about each file. - -class DirectoryIterator { - friend class Filesystem; - public: - // Constructor - DirectoryIterator(); - // Destructor - virtual ~DirectoryIterator(); - - // Starts traversing a directory - // dir is the directory to traverse - // returns true if the directory exists and is valid - // The iterator will point to the first entry in the directory - virtual bool Iterate(const Pathname &path); - - // Advances to the next file - // returns true if there were more files in the directory. - virtual bool Next(); - - // returns true if the file currently pointed to is a directory - virtual bool IsDirectory() const; - - // returns the name of the file currently pointed to - virtual std::string Name() const; - - // returns the size of the file currently pointed to - virtual size_t FileSize() const; - - // returns the last modified time of the file currently pointed to - virtual time_t FileModifyTime() const; - - // checks whether current file is a special directory file "." or ".." - bool IsDots() const { - std::string filename(Name()); - return (filename.compare(".") == 0) || (filename.compare("..") == 0); - } - - private: - std::string directory_; -#ifdef WIN32 - WIN32_FIND_DATA data_; - HANDLE handle_; -#else - DIR *dir_; - struct dirent *dirent_; - struct stat stat_; -#endif -}; - -enum FileTimeType { FTT_CREATED, FTT_MODIFIED, FTT_ACCESSED }; - -class FilesystemInterface { - public: - virtual ~FilesystemInterface() {} - - // Returns a DirectoryIterator for a given pathname. - // TODO: Do fancy abstracted stuff - virtual DirectoryIterator *IterateDirectory() { - return new DirectoryIterator(); - } - - // Opens a file. Returns an open StreamInterface if function succeeds. - // Otherwise, returns NULL. - // TODO: Add an error param to indicate failure reason, similar to - // FileStream::Open - virtual FileStream *OpenFile(const Pathname &filename, - const std::string &mode) = 0; - - // Atomically creates an empty file accessible only to the current user if one - // does not already exist at the given path, otherwise fails. This is the only - // secure way to create a file in a shared temp directory (e.g., C:\Temp on - // Windows or /tmp on Linux). - // Note that if it is essential that a file be successfully created then the - // app must generate random names and retry on failure, or else it will be - // vulnerable to a trivial DoS. - virtual bool CreatePrivateFile(const Pathname &filename) = 0; - - // This will attempt to delete the path located at filename. - // It ASSERTS and returns false if the path points to a folder or a - // non-existent file. - virtual bool DeleteFile(const Pathname &filename) = 0; - - // This will attempt to delete the empty folder located at 'folder' - // It ASSERTS and returns false if the path points to a file or a non-existent - // folder. It fails normally if the folder is not empty or can otherwise - // not be deleted. - virtual bool DeleteEmptyFolder(const Pathname &folder) = 0; - - // This will call IterateDirectory, to get a directory iterator, and then - // call DeleteFolderAndContents and DeleteFile on every path contained in this - // folder. If the folder is empty, this returns true. - virtual bool DeleteFolderContents(const Pathname &folder); - - // This deletes the contents of a folder, recursively, and then deletes - // the folder itself. - virtual bool DeleteFolderAndContents(const Pathname &folder) { - return DeleteFolderContents(folder) && DeleteEmptyFolder(folder); - } - - // This will delete whatever is located at path, be it a file or a folder. - // If it is a folder, it will delete it recursively by calling - // DeleteFolderAndContents - bool DeleteFileOrFolder(const Pathname &path) { - if (IsFolder(path)) - return DeleteFolderAndContents(path); - else - return DeleteFile(path); - } - - // Creates a directory. This will call itself recursively to create /foo/bar - // even if /foo does not exist. Returns true if the function succeeds. - virtual bool CreateFolder(const Pathname &pathname) = 0; - - // This moves a file from old_path to new_path, where "old_path" is a - // plain file. This ASSERTs and returns false if old_path points to a - // directory, and returns true if the function succeeds. - // If the new path is on a different volume than the old path, this function - // will attempt to copy and, if that succeeds, delete the old path. - virtual bool MoveFolder(const Pathname &old_path, - const Pathname &new_path) = 0; - - // This moves a directory from old_path to new_path, where "old_path" is a - // directory. This ASSERTs and returns false if old_path points to a plain - // file, and returns true if the function succeeds. - // If the new path is on a different volume, this function will attempt to - // copy and if that succeeds, delete the old path. - virtual bool MoveFile(const Pathname &old_path, const Pathname &new_path) = 0; - - // This attempts to move whatever is located at old_path to new_path, - // be it a file or folder. - bool MoveFileOrFolder(const Pathname &old_path, const Pathname &new_path) { - if (IsFile(old_path)) { - return MoveFile(old_path, new_path); - } else { - return MoveFolder(old_path, new_path); - } - } - - // This copies a file from old_path to new_path. This method ASSERTs and - // returns false if old_path is a folder, and returns true if the copy - // succeeds. - virtual bool CopyFile(const Pathname &old_path, const Pathname &new_path) = 0; - - // This copies a folder from old_path to new_path. - bool CopyFolder(const Pathname &old_path, const Pathname &new_path); - - bool CopyFileOrFolder(const Pathname &old_path, const Pathname &new_path) { - if (IsFile(old_path)) - return CopyFile(old_path, new_path); - else - return CopyFolder(old_path, new_path); - } - - // Returns true if pathname refers to a directory - virtual bool IsFolder(const Pathname& pathname) = 0; - - // Returns true if pathname refers to a file - virtual bool IsFile(const Pathname& pathname) = 0; - - // Returns true if pathname refers to no filesystem object, every parent - // directory either exists, or is also absent. - virtual bool IsAbsent(const Pathname& pathname) = 0; - - // Returns true if pathname represents a temporary location on the system. - virtual bool IsTemporaryPath(const Pathname& pathname) = 0; - - // A folder appropriate for storing temporary files (Contents are - // automatically deleted when the program exits) - virtual bool GetTemporaryFolder(Pathname &path, bool create, - const std::string *append) = 0; - - virtual std::string TempFilename(const Pathname &dir, - const std::string &prefix) = 0; - - // Determines the size of the file indicated by path. - virtual bool GetFileSize(const Pathname& path, size_t* size) = 0; - - // Determines a timestamp associated with the file indicated by path. - virtual bool GetFileTime(const Pathname& path, FileTimeType which, - time_t* time) = 0; - - // Returns the path to the running application. - // Note: This is not guaranteed to work on all platforms. Be aware of the - // limitations before using it, and robustly handle failure. - virtual bool GetAppPathname(Pathname* path) = 0; - - // Get a folder that is unique to the current application, which is suitable - // for sharing data between executions of the app. If the per_user arg is - // true, the folder is also specific to the current user. - virtual bool GetAppDataFolder(Pathname* path, bool per_user) = 0; - - // Get a temporary folder that is unique to the current user and application. - // TODO: Re-evaluate the goals of this function. We probably just need any - // directory that won't collide with another existing directory, and which - // will be cleaned up when the program exits. - virtual bool GetAppTempFolder(Pathname* path) = 0; - - // Delete the contents of the folder returned by GetAppTempFolder - bool CleanAppTempFolder(); - - virtual bool GetDiskFreeSpace(const Pathname& path, int64 *freebytes) = 0; - - // Returns the absolute path of the current directory. - virtual Pathname GetCurrentDirectory() = 0; - - // Note: These might go into some shared config section later, but they're - // used by some methods in this interface, so we're leaving them here for now. - void SetOrganizationName(const std::string& organization) { - organization_name_ = organization; - } - void GetOrganizationName(std::string* organization) { - ASSERT(NULL != organization); - *organization = organization_name_; - } - void SetApplicationName(const std::string& application) { - application_name_ = application; - } - void GetApplicationName(std::string* application) { - ASSERT(NULL != application); - *application = application_name_; - } - - protected: - std::string organization_name_; - std::string application_name_; -}; - -class Filesystem { - public: - static FilesystemInterface *default_filesystem() { - ASSERT(default_filesystem_ != NULL); - return default_filesystem_; - } - - static void set_default_filesystem(FilesystemInterface *filesystem) { - default_filesystem_ = filesystem; - } - - static FilesystemInterface *swap_default_filesystem( - FilesystemInterface *filesystem) { - FilesystemInterface *cur = default_filesystem_; - default_filesystem_ = filesystem; - return cur; - } - - static DirectoryIterator *IterateDirectory() { - return EnsureDefaultFilesystem()->IterateDirectory(); - } - - static bool CreateFolder(const Pathname &pathname) { - return EnsureDefaultFilesystem()->CreateFolder(pathname); - } - - static FileStream *OpenFile(const Pathname &filename, - const std::string &mode) { - return EnsureDefaultFilesystem()->OpenFile(filename, mode); - } - - static bool CreatePrivateFile(const Pathname &filename) { - return EnsureDefaultFilesystem()->CreatePrivateFile(filename); - } - - static bool DeleteFile(const Pathname &filename) { - return EnsureDefaultFilesystem()->DeleteFile(filename); - } - - static bool DeleteEmptyFolder(const Pathname &folder) { - return EnsureDefaultFilesystem()->DeleteEmptyFolder(folder); - } - - static bool DeleteFolderContents(const Pathname &folder) { - return EnsureDefaultFilesystem()->DeleteFolderContents(folder); - } - - static bool DeleteFolderAndContents(const Pathname &folder) { - return EnsureDefaultFilesystem()->DeleteFolderAndContents(folder); - } - - static bool MoveFolder(const Pathname &old_path, const Pathname &new_path) { - return EnsureDefaultFilesystem()->MoveFolder(old_path, new_path); - } - - static bool MoveFile(const Pathname &old_path, const Pathname &new_path) { - return EnsureDefaultFilesystem()->MoveFile(old_path, new_path); - } - - static bool CopyFolder(const Pathname &old_path, const Pathname &new_path) { - return EnsureDefaultFilesystem()->CopyFolder(old_path, new_path); - } - - static bool CopyFile(const Pathname &old_path, const Pathname &new_path) { - return EnsureDefaultFilesystem()->CopyFile(old_path, new_path); - } - - static bool IsFolder(const Pathname& pathname) { - return EnsureDefaultFilesystem()->IsFolder(pathname); - } - - static bool IsFile(const Pathname &pathname) { - return EnsureDefaultFilesystem()->IsFile(pathname); - } - - static bool IsAbsent(const Pathname &pathname) { - return EnsureDefaultFilesystem()->IsAbsent(pathname); - } - - static bool IsTemporaryPath(const Pathname& pathname) { - return EnsureDefaultFilesystem()->IsTemporaryPath(pathname); - } - - static bool GetTemporaryFolder(Pathname &path, bool create, - const std::string *append) { - return EnsureDefaultFilesystem()->GetTemporaryFolder(path, create, append); - } - - static std::string TempFilename(const Pathname &dir, - const std::string &prefix) { - return EnsureDefaultFilesystem()->TempFilename(dir, prefix); - } - - static bool GetFileSize(const Pathname& path, size_t* size) { - return EnsureDefaultFilesystem()->GetFileSize(path, size); - } - - static bool GetFileTime(const Pathname& path, FileTimeType which, - time_t* time) { - return EnsureDefaultFilesystem()->GetFileTime(path, which, time); - } - - static bool GetAppPathname(Pathname* path) { - return EnsureDefaultFilesystem()->GetAppPathname(path); - } - - static bool GetAppDataFolder(Pathname* path, bool per_user) { - return EnsureDefaultFilesystem()->GetAppDataFolder(path, per_user); - } - - static bool GetAppTempFolder(Pathname* path) { - return EnsureDefaultFilesystem()->GetAppTempFolder(path); - } - - static bool CleanAppTempFolder() { - return EnsureDefaultFilesystem()->CleanAppTempFolder(); - } - - static bool GetDiskFreeSpace(const Pathname& path, int64 *freebytes) { - return EnsureDefaultFilesystem()->GetDiskFreeSpace(path, freebytes); - } - - // Definition has to be in the .cc file due to returning forward-declared - // Pathname by value. - static Pathname GetCurrentDirectory(); - - static void SetOrganizationName(const std::string& organization) { - EnsureDefaultFilesystem()->SetOrganizationName(organization); - } - - static void GetOrganizationName(std::string* organization) { - EnsureDefaultFilesystem()->GetOrganizationName(organization); - } - - static void SetApplicationName(const std::string& application) { - EnsureDefaultFilesystem()->SetApplicationName(application); - } - - static void GetApplicationName(std::string* application) { - EnsureDefaultFilesystem()->GetApplicationName(application); - } - - private: - static FilesystemInterface* default_filesystem_; - - static FilesystemInterface *EnsureDefaultFilesystem(); - DISALLOW_IMPLICIT_CONSTRUCTORS(Filesystem); -}; - -class FilesystemScope{ - public: - explicit FilesystemScope(FilesystemInterface *new_fs) { - old_fs_ = Filesystem::swap_default_filesystem(new_fs); - } - ~FilesystemScope() { - Filesystem::set_default_filesystem(old_fs_); - } - private: - FilesystemInterface* old_fs_; - DISALLOW_IMPLICIT_CONSTRUCTORS(FilesystemScope); -}; - -// Generates a unique filename based on the input path. If no path component -// is specified, it uses the temporary directory. If a filename is provided, -// up to 100 variations of form basename-N.extension are tried. When -// create_empty is true, an empty file of this name is created (which -// decreases the chance of a temporary filename collision with another -// process). -bool CreateUniqueFile(Pathname& path, bool create_empty); - -// Taken from Chromium's base/platform_file.h. -// Don't use ClosePlatformFile to close a file opened with FdopenPlatformFile. -// Use fclose instead. -// TODO(grunell): Remove when Chromium has started to use AEC in each source. -// http://crbug.com/264611. -#if defined(WIN32) -typedef HANDLE PlatformFile; -const PlatformFile kInvalidPlatformFileValue = INVALID_HANDLE_VALUE; -#elif defined(POSIX) -typedef int PlatformFile; -const PlatformFile kInvalidPlatformFileValue = -1; -#else -#error Unsupported platform -#endif - -FILE* FdopenPlatformFileForWriting(PlatformFile file); -bool ClosePlatformFile(PlatformFile file); - -} // namespace talk_base - -#endif // TALK_BASE_FILEUTILS_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/fileutils_mock.h b/thirdparties/common/include/webrtc-sdk/talk/base/fileutils_mock.h deleted file mode 100755 index 01410af..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/fileutils_mock.h +++ /dev/null @@ -1,270 +0,0 @@ -/* - * libjingle - * Copyright 2004--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_BASE_FILEUTILS_MOCK_H_ -#define TALK_BASE_FILEUTILS_MOCK_H_ - -#include -#include -#include - -#include "talk/base/fileutils.h" -#include "talk/base/gunit.h" -#include "talk/base/pathutils.h" -#include "talk/base/stream.h" - -namespace talk_base { - -class FakeFileStream : public FileStream { - public: - explicit FakeFileStream(const std::string & contents) : - string_stream_(contents) - {} - - virtual StreamResult Read(void* buffer, size_t buffer_len, - size_t* read, int* error) { - return string_stream_.Read(buffer, buffer_len, read, error); - } - - virtual void Close() { - return string_stream_.Close(); - } - virtual bool GetSize(size_t* size) const { - return string_stream_.GetSize(size); - } - - private: - StringStream string_stream_; -}; - -class FakeDirectoryIterator : public DirectoryIterator { - public: - typedef std::pair File; - - /* - * files should be sorted by directory - * put '/' at the end of file if you want it to be a directory - * - * Sample list: - * /var/dir/file1 - * /var/dir/file2 - * /var/dir/subdir1/ - * /var/dir/subdir2/ - * /var/dir2/file2 - * /var/dir3/ - * - * you can call Iterate for any path: /var, /var/dir, /var/dir2 - * unrelated files will be ignored - */ - explicit FakeDirectoryIterator(const std::vector& all_files) : - all_files_(all_files) {} - - virtual bool Iterate(const Pathname& path) { - path_iterator_ = all_files_.begin(); - path_ = path.pathname(); - - // make sure path ends end with '/' - if (path_.rfind(Pathname::DefaultFolderDelimiter()) != path_.size() - 1) - path_ += Pathname::DefaultFolderDelimiter(); - - return FakeDirectoryIterator::Search(std::string("")); - } - - virtual bool Next() { - std::string current_name = Name(); - path_iterator_++; - return FakeDirectoryIterator::Search(current_name); - } - - bool Search(const std::string& current_name) { - for (; path_iterator_ != all_files_.end(); path_iterator_++) { - if (path_iterator_->first.find(path_) == 0 - && Name().compare(current_name) != 0) { - return true; - } - } - - return false; - } - - virtual bool IsDirectory() const { - std::string sub_path = path_iterator_->first; - - return std::string::npos != - sub_path.find(Pathname::DefaultFolderDelimiter(), path_.size()); - } - - virtual std::string Name() const { - std::string sub_path = path_iterator_->first; - - // path - top level path (ex. /var/lib) - // sub_path - subpath under top level path (ex. /var/lib/dir/dir/file ) - // find shortest non-trivial common path. (ex. /var/lib/dir) - size_t start = path_.size(); - size_t end = sub_path.find(Pathname::DefaultFolderDelimiter(), start); - - if (end != std::string::npos) { - return sub_path.substr(start, end - start); - } else { - return sub_path.substr(start); - } - } - - private: - const std::vector all_files_; - - std::string path_; - std::vector::const_iterator path_iterator_; -}; - -class FakeFileSystem : public FilesystemInterface { - public: - typedef std::pair File; - - explicit FakeFileSystem(const std::vector& all_files) : - all_files_(all_files) {} - - virtual DirectoryIterator *IterateDirectory() { - return new FakeDirectoryIterator(all_files_); - } - - virtual FileStream * OpenFile( - const Pathname &filename, - const std::string &mode) { - std::vector::const_iterator i_files = all_files_.begin(); - std::string path = filename.pathname(); - - for (; i_files != all_files_.end(); i_files++) { - if (i_files->first.compare(path) == 0) { - return new FakeFileStream(i_files->second); - } - } - - return NULL; - } - - bool CreatePrivateFile(const Pathname &filename) { - EXPECT_TRUE(false) << "Unsupported operation"; - return false; - } - bool DeleteFile(const Pathname &filename) { - EXPECT_TRUE(false) << "Unsupported operation"; - return false; - } - bool DeleteEmptyFolder(const Pathname &folder) { - EXPECT_TRUE(false) << "Unsupported operation"; - return false; - } - bool DeleteFolderContents(const Pathname &folder) { - EXPECT_TRUE(false) << "Unsupported operation"; - return false; - } - bool DeleteFolderAndContents(const Pathname &folder) { - EXPECT_TRUE(false) << "Unsupported operation"; - return false; - } - bool CreateFolder(const Pathname &pathname) { - EXPECT_TRUE(false) << "Unsupported operation"; - return false; - } - bool MoveFolder(const Pathname &old_path, const Pathname &new_path) { - EXPECT_TRUE(false) << "Unsupported operation"; - return false; - } - bool MoveFile(const Pathname &old_path, const Pathname &new_path) { - EXPECT_TRUE(false) << "Unsupported operation"; - return false; - } - bool CopyFile(const Pathname &old_path, const Pathname &new_path) { - EXPECT_TRUE(false) << "Unsupported operation"; - return false; - } - bool IsFolder(const Pathname &pathname) { - EXPECT_TRUE(false) << "Unsupported operation"; - return false; - } - bool IsFile(const Pathname &pathname) { - EXPECT_TRUE(false) << "Unsupported operation"; - return false; - } - bool IsAbsent(const Pathname &pathname) { - EXPECT_TRUE(false) << "Unsupported operation"; - return false; - } - bool IsTemporaryPath(const Pathname &pathname) { - EXPECT_TRUE(false) << "Unsupported operation"; - return false; - } - bool GetTemporaryFolder(Pathname &path, bool create, - const std::string *append) { - EXPECT_TRUE(false) << "Unsupported operation"; - return false; - } - std::string TempFilename(const Pathname &dir, const std::string &prefix) { - EXPECT_TRUE(false) << "Unsupported operation"; - return std::string(); - } - bool GetFileSize(const Pathname &path, size_t *size) { - EXPECT_TRUE(false) << "Unsupported operation"; - return false; - } - bool GetFileTime(const Pathname &path, FileTimeType which, - time_t* time) { - EXPECT_TRUE(false) << "Unsupported operation"; - return false; - } - bool GetAppPathname(Pathname *path) { - EXPECT_TRUE(false) << "Unsupported operation"; - return false; - } - bool GetAppDataFolder(Pathname *path, bool per_user) { - EXPECT_TRUE(per_user) << "Unsupported operation"; -#ifdef WIN32 - path->SetPathname("c:\\Users\\test_user", ""); -#else - path->SetPathname("/home/user/test_user", ""); -#endif - return true; - } - bool GetAppTempFolder(Pathname *path) { - EXPECT_TRUE(false) << "Unsupported operation"; - return false; - } - bool GetDiskFreeSpace(const Pathname &path, int64 *freebytes) { - EXPECT_TRUE(false) << "Unsupported operation"; - return false; - } - Pathname GetCurrentDirectory() { - return Pathname(); - } - - private: - const std::vector all_files_; -}; -} // namespace talk_base - -#endif // TALK_BASE_FILEUTILS_MOCK_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/firewallsocketserver.h b/thirdparties/common/include/webrtc-sdk/talk/base/firewallsocketserver.h deleted file mode 100755 index 5d5553e..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/firewallsocketserver.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_FIREWALLSOCKETSERVER_H_ -#define TALK_BASE_FIREWALLSOCKETSERVER_H_ - -#include -#include "talk/base/socketserver.h" -#include "talk/base/criticalsection.h" - -namespace talk_base { - -class FirewallManager; - -// This SocketServer shim simulates a rule-based firewall server. - -enum FirewallProtocol { FP_UDP, FP_TCP, FP_ANY }; -enum FirewallDirection { FD_IN, FD_OUT, FD_ANY }; - -class FirewallSocketServer : public SocketServer { - public: - FirewallSocketServer(SocketServer * server, - FirewallManager * manager = NULL, - bool should_delete_server = false); - virtual ~FirewallSocketServer(); - - SocketServer* socketserver() const { return server_; } - void set_socketserver(SocketServer* server) { - if (server_ && should_delete_server_) { - delete server_; - server_ = NULL; - should_delete_server_ = false; - } - server_ = server; - } - - // Settings to control whether CreateSocket or Socket::Listen succeed. - void set_udp_sockets_enabled(bool enabled) { udp_sockets_enabled_ = enabled; } - void set_tcp_sockets_enabled(bool enabled) { tcp_sockets_enabled_ = enabled; } - bool tcp_listen_enabled() const { return tcp_listen_enabled_; } - void set_tcp_listen_enabled(bool enabled) { tcp_listen_enabled_ = enabled; } - - // Rules govern the behavior of Connect/Accept/Send/Recv attempts. - void AddRule(bool allow, FirewallProtocol p = FP_ANY, - FirewallDirection d = FD_ANY, - const SocketAddress& addr = SocketAddress()); - void AddRule(bool allow, FirewallProtocol p, - const SocketAddress& src, const SocketAddress& dst); - void ClearRules(); - - bool Check(FirewallProtocol p, - const SocketAddress& src, const SocketAddress& dst); - - virtual Socket* CreateSocket(int type); - virtual Socket* CreateSocket(int family, int type); - - virtual AsyncSocket* CreateAsyncSocket(int type); - virtual AsyncSocket* CreateAsyncSocket(int family, int type); - - virtual void SetMessageQueue(MessageQueue* queue) { - server_->SetMessageQueue(queue); - } - virtual bool Wait(int cms, bool process_io) { - return server_->Wait(cms, process_io); - } - virtual void WakeUp() { - return server_->WakeUp(); - } - - Socket * WrapSocket(Socket * sock, int type); - AsyncSocket * WrapSocket(AsyncSocket * sock, int type); - - private: - SocketServer * server_; - FirewallManager * manager_; - CriticalSection crit_; - struct Rule { - bool allow; - FirewallProtocol p; - FirewallDirection d; - SocketAddress src; - SocketAddress dst; - }; - std::vector rules_; - bool should_delete_server_; - bool udp_sockets_enabled_; - bool tcp_sockets_enabled_; - bool tcp_listen_enabled_; -}; - -// FirewallManager allows you to manage firewalls in multiple threads together - -class FirewallManager { - public: - FirewallManager(); - ~FirewallManager(); - - void AddServer(FirewallSocketServer * server); - void RemoveServer(FirewallSocketServer * server); - - void AddRule(bool allow, FirewallProtocol p = FP_ANY, - FirewallDirection d = FD_ANY, - const SocketAddress& addr = SocketAddress()); - void ClearRules(); - - private: - CriticalSection crit_; - std::vector servers_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_FIREWALLSOCKETSERVER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/flags.h b/thirdparties/common/include/webrtc-sdk/talk/base/flags.h deleted file mode 100755 index c43036c..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/flags.h +++ /dev/null @@ -1,284 +0,0 @@ -/* - * libjingle - * Copyright 2006, 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. - */ - - -// Originally comes from shared/commandlineflags/flags.h - -// Flags are defined and declared using DEFINE_xxx and DECLARE_xxx macros, -// where xxx is the flag type. Flags are referred to via FLAG_yyy, -// where yyy is the flag name. For intialization and iteration of flags, -// see the FlagList class. For full programmatic access to any -// flag, see the Flag class. -// -// The implementation only relies and basic C++ functionality -// and needs no special library or STL support. - -#ifndef TALK_BASE_FLAGS_H__ -#define TALK_BASE_FLAGS_H__ - -#include - -#include "talk/base/checks.h" -#include "talk/base/common.h" - -// Internal use only. -union FlagValue { - // Note: Because in C++ non-bool values are silently converted into - // bool values ('bool b = "false";' results in b == true!), we pass - // and int argument to New_BOOL as this appears to be safer - sigh. - // In particular, it prevents the (not uncommon!) bug where a bool - // flag is defined via: DEFINE_bool(flag, "false", "some comment");. - static FlagValue New_BOOL(int b) { - FlagValue v; - v.b = (b != 0); - return v; - } - - static FlagValue New_INT(int i) { - FlagValue v; - v.i = i; - return v; - } - - static FlagValue New_FLOAT(float f) { - FlagValue v; - v.f = f; - return v; - } - - static FlagValue New_STRING(const char* s) { - FlagValue v; - v.s = s; - return v; - } - - bool b; - int i; - double f; - const char* s; -}; - - -// Each flag can be accessed programmatically via a Flag object. -class Flag { - public: - enum Type { BOOL, INT, FLOAT, STRING }; - - // Internal use only. - Flag(const char* file, const char* name, const char* comment, - Type type, void* variable, FlagValue default_); - - // General flag information - const char* file() const { return file_; } - const char* name() const { return name_; } - const char* comment() const { return comment_; } - - // Flag type - Type type() const { return type_; } - - // Flag variables - bool* bool_variable() const { - assert(type_ == BOOL); - return &variable_->b; - } - - int* int_variable() const { - assert(type_ == INT); - return &variable_->i; - } - - double* float_variable() const { - assert(type_ == FLOAT); - return &variable_->f; - } - - const char** string_variable() const { - assert(type_ == STRING); - return &variable_->s; - } - - // Default values - bool bool_default() const { - assert(type_ == BOOL); - return default_.b; - } - - int int_default() const { - assert(type_ == INT); - return default_.i; - } - - double float_default() const { - assert(type_ == FLOAT); - return default_.f; - } - - const char* string_default() const { - assert(type_ == STRING); - return default_.s; - } - - // Resets a flag to its default value - void SetToDefault(); - - // Iteration support - Flag* next() const { return next_; } - - // Prints flag information. The current flag value is only printed - // if print_current_value is set. - void Print(bool print_current_value); - - private: - const char* file_; - const char* name_; - const char* comment_; - - Type type_; - FlagValue* variable_; - FlagValue default_; - - Flag* next_; - - friend class FlagList; // accesses next_ -}; - - -// Internal use only. -#define DEFINE_FLAG(type, c_type, name, default, comment) \ - /* define and initialize the flag */ \ - c_type FLAG_##name = (default); \ - /* register the flag */ \ - static Flag Flag_##name(__FILE__, #name, (comment), \ - Flag::type, &FLAG_##name, \ - FlagValue::New_##type(default)) - - -// Internal use only. -#define DECLARE_FLAG(c_type, name) \ - /* declare the external flag */ \ - extern c_type FLAG_##name - - -// Use the following macros to define a new flag: -#define DEFINE_bool(name, default, comment) \ - DEFINE_FLAG(BOOL, bool, name, default, comment) -#define DEFINE_int(name, default, comment) \ - DEFINE_FLAG(INT, int, name, default, comment) -#define DEFINE_float(name, default, comment) \ - DEFINE_FLAG(FLOAT, double, name, default, comment) -#define DEFINE_string(name, default, comment) \ - DEFINE_FLAG(STRING, const char*, name, default, comment) - - -// Use the following macros to declare a flag defined elsewhere: -#define DECLARE_bool(name) DECLARE_FLAG(bool, name) -#define DECLARE_int(name) DECLARE_FLAG(int, name) -#define DECLARE_float(name) DECLARE_FLAG(double, name) -#define DECLARE_string(name) DECLARE_FLAG(const char*, name) - - -// The global list of all flags. -class FlagList { - public: - FlagList(); - - // The NULL-terminated list of all flags. Traverse with Flag::next(). - static Flag* list() { return list_; } - - // If file != NULL, prints information for all flags defined in file; - // otherwise prints information for all flags in all files. The current - // flag value is only printed if print_current_value is set. - static void Print(const char* file, bool print_current_value); - - // Lookup a flag by name. Returns the matching flag or NULL. - static Flag* Lookup(const char* name); - - // Helper function to parse flags: Takes an argument arg and splits it into - // a flag name and flag value (or NULL if they are missing). is_bool is set - // if the arg started with "-no" or "--no". The buffer may be used to NUL- - // terminate the name, it must be large enough to hold any possible name. - static void SplitArgument(const char* arg, - char* buffer, int buffer_size, - const char** name, const char** value, - bool* is_bool); - - // Set the flag values by parsing the command line. If remove_flags - // is set, the flags and associated values are removed from (argc, - // argv). Returns 0 if no error occurred. Otherwise, returns the - // argv index > 0 for the argument where an error occurred. In that - // case, (argc, argv) will remain unchanged indepdendent of the - // remove_flags value, and no assumptions about flag settings should - // be made. - // - // The following syntax for flags is accepted (both '-' and '--' are ok): - // - // --flag (bool flags only) - // --noflag (bool flags only) - // --flag=value (non-bool flags only, no spaces around '=') - // --flag value (non-bool flags only) - static int SetFlagsFromCommandLine(int* argc, - const char** argv, - bool remove_flags); - static inline int SetFlagsFromCommandLine(int* argc, - char** argv, - bool remove_flags) { - return SetFlagsFromCommandLine(argc, const_cast(argv), - remove_flags); - } - - // Registers a new flag. Called during program initialization. Not - // thread-safe. - static void Register(Flag* flag); - - private: - static Flag* list_; -}; - -#ifdef WIN32 -// A helper class to translate Windows command line arguments into UTF8, -// which then allows us to just pass them to the flags system. -// This encapsulates all the work of getting the command line and translating -// it to an array of 8-bit strings; all you have to do is create one of these, -// and then call argc() and argv(). -class WindowsCommandLineArguments { - public: - WindowsCommandLineArguments(); - ~WindowsCommandLineArguments(); - - int argc() { return argc_; } - char **argv() { return argv_; } - private: - int argc_; - char **argv_; - - private: - DISALLOW_EVIL_CONSTRUCTORS(WindowsCommandLineArguments); -}; -#endif // WIN32 - - -#endif // SHARED_COMMANDLINEFLAGS_FLAGS_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/genericslot.h b/thirdparties/common/include/webrtc-sdk/talk/base/genericslot.h deleted file mode 100755 index c0999a6..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/genericslot.h +++ /dev/null @@ -1,258 +0,0 @@ -// This file was GENERATED by command: -// pump.py genericslot.h.pump -// DO NOT EDIT BY HAND!!! - -/* - * 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_BASE_GENERICSLOT_H_ -#define TALK_BASE_GENERICSLOT_H_ - -// To generate genericslot.h from genericslot.h.pump, execute: -// /home/build/google3/third_party/gtest/scripts/pump.py genericslot.h.pump - -// Generic-slots are pure slots that can be hooked up to signals. They're -// mainly intended to be used in tests where we want to check if a signal -// was invoked and what arguments were passed. NOTE: They do not do any -// lifetime management of the arguments received via callbacks. -// -// Example: -// /* Some signal */ -// sigslot::signal1 foo; -// -// /* We want to monitor foo in some test */ -// talk_base::GenericSlot1 slot(&foo, 0); -// foo.emit(5); -// EXPECT_TRUE(slot.callback_received()); -// EXPECT_EQ(5, *(slot.arg1())); -// - -#include "talk/base/constructormagic.h" -#include "talk/base/sigslot.h" - -namespace talk_base { - -template -class GenericSlot1 : public sigslot::has_slots<> { - public: - GenericSlot1(sigslot::signal1* signal, - const A1& arg1_initial) - : arg1_initial_(arg1_initial) { - Reset(); - signal->connect(this, &GenericSlot1::OnSignalCallback); - } - - void Reset() { - callback_received_ = false; - arg1_ = arg1_initial_; - } - - bool callback_received() const { return callback_received_; } - const A1& arg1() const { return arg1_; } - - private: - void OnSignalCallback(A1 arg1) { - callback_received_ = true; - arg1_ = arg1; - } - - bool callback_received_; - A1 arg1_initial_, arg1_; - - DISALLOW_COPY_AND_ASSIGN(GenericSlot1); -}; - -template -class GenericSlot2 : public sigslot::has_slots<> { - public: - GenericSlot2(sigslot::signal2* signal, - const A1& arg1_initial, const A2& arg2_initial) - : arg1_initial_(arg1_initial), arg2_initial_(arg2_initial) { - Reset(); - signal->connect(this, &GenericSlot2::OnSignalCallback); - } - - void Reset() { - callback_received_ = false; - arg1_ = arg1_initial_; - arg2_ = arg2_initial_; - } - - bool callback_received() const { return callback_received_; } - const A1& arg1() const { return arg1_; } - const A2& arg2() const { return arg2_; } - - private: - void OnSignalCallback(A1 arg1, A2 arg2) { - callback_received_ = true; - arg1_ = arg1; - arg2_ = arg2; - } - - bool callback_received_; - A1 arg1_initial_, arg1_; - A2 arg2_initial_, arg2_; - - DISALLOW_COPY_AND_ASSIGN(GenericSlot2); -}; - -template -class GenericSlot3 : public sigslot::has_slots<> { - public: - GenericSlot3(sigslot::signal3* signal, - const A1& arg1_initial, const A2& arg2_initial, - const A3& arg3_initial) - : arg1_initial_(arg1_initial), arg2_initial_(arg2_initial), - arg3_initial_(arg3_initial) { - Reset(); - signal->connect(this, &GenericSlot3::OnSignalCallback); - } - - void Reset() { - callback_received_ = false; - arg1_ = arg1_initial_; - arg2_ = arg2_initial_; - arg3_ = arg3_initial_; - } - - bool callback_received() const { return callback_received_; } - const A1& arg1() const { return arg1_; } - const A2& arg2() const { return arg2_; } - const A3& arg3() const { return arg3_; } - - private: - void OnSignalCallback(A1 arg1, A2 arg2, A3 arg3) { - callback_received_ = true; - arg1_ = arg1; - arg2_ = arg2; - arg3_ = arg3; - } - - bool callback_received_; - A1 arg1_initial_, arg1_; - A2 arg2_initial_, arg2_; - A3 arg3_initial_, arg3_; - - DISALLOW_COPY_AND_ASSIGN(GenericSlot3); -}; - -template -class GenericSlot4 : public sigslot::has_slots<> { - public: - GenericSlot4(sigslot::signal4* signal, - const A1& arg1_initial, const A2& arg2_initial, - const A3& arg3_initial, const A4& arg4_initial) - : arg1_initial_(arg1_initial), arg2_initial_(arg2_initial), - arg3_initial_(arg3_initial), arg4_initial_(arg4_initial) { - Reset(); - signal->connect(this, &GenericSlot4::OnSignalCallback); - } - - void Reset() { - callback_received_ = false; - arg1_ = arg1_initial_; - arg2_ = arg2_initial_; - arg3_ = arg3_initial_; - arg4_ = arg4_initial_; - } - - bool callback_received() const { return callback_received_; } - const A1& arg1() const { return arg1_; } - const A2& arg2() const { return arg2_; } - const A3& arg3() const { return arg3_; } - const A4& arg4() const { return arg4_; } - - private: - void OnSignalCallback(A1 arg1, A2 arg2, A3 arg3, A4 arg4) { - callback_received_ = true; - arg1_ = arg1; - arg2_ = arg2; - arg3_ = arg3; - arg4_ = arg4; - } - - bool callback_received_; - A1 arg1_initial_, arg1_; - A2 arg2_initial_, arg2_; - A3 arg3_initial_, arg3_; - A4 arg4_initial_, arg4_; - - DISALLOW_COPY_AND_ASSIGN(GenericSlot4); -}; - -template -class GenericSlot5 : public sigslot::has_slots<> { - public: - GenericSlot5(sigslot::signal5* signal, - const A1& arg1_initial, const A2& arg2_initial, - const A3& arg3_initial, const A4& arg4_initial, - const A5& arg5_initial) - : arg1_initial_(arg1_initial), arg2_initial_(arg2_initial), - arg3_initial_(arg3_initial), arg4_initial_(arg4_initial), - arg5_initial_(arg5_initial) { - Reset(); - signal->connect(this, &GenericSlot5::OnSignalCallback); - } - - void Reset() { - callback_received_ = false; - arg1_ = arg1_initial_; - arg2_ = arg2_initial_; - arg3_ = arg3_initial_; - arg4_ = arg4_initial_; - arg5_ = arg5_initial_; - } - - bool callback_received() const { return callback_received_; } - const A1& arg1() const { return arg1_; } - const A2& arg2() const { return arg2_; } - const A3& arg3() const { return arg3_; } - const A4& arg4() const { return arg4_; } - const A5& arg5() const { return arg5_; } - - private: - void OnSignalCallback(A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5) { - callback_received_ = true; - arg1_ = arg1; - arg2_ = arg2; - arg3_ = arg3; - arg4_ = arg4; - arg5_ = arg5; - } - - bool callback_received_; - A1 arg1_initial_, arg1_; - A2 arg2_initial_, arg2_; - A3 arg3_initial_, arg3_; - A4 arg4_initial_, arg4_; - A5 arg5_initial_, arg5_; - - DISALLOW_COPY_AND_ASSIGN(GenericSlot5); -}; -} // namespace talk_base - -#endif // TALK_BASE_GENERICSLOT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/gunit.h b/thirdparties/common/include/webrtc-sdk/talk/base/gunit.h deleted file mode 100755 index 9edfd7e..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/gunit.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * libjingle - * Copyright 2004--2008, 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_BASE_GUNIT_H_ -#define TALK_BASE_GUNIT_H_ - -#include "talk/base/logging.h" -#include "talk/base/thread.h" -#if defined(ANDROID) || defined(GTEST_RELATIVE_PATH) -#include "gtest/gtest.h" -#else -#include "testing/base/public/gunit.h" -#endif - -// Wait until "ex" is true, or "timeout" expires. -#define WAIT(ex, timeout) \ - for (uint32 start = talk_base::Time(); \ - !(ex) && talk_base::Time() < start + timeout;) \ - talk_base::Thread::Current()->ProcessMessages(1); - -// This returns the result of the test in res, so that we don't re-evaluate -// the expression in the XXXX_WAIT macros below, since that causes problems -// when the expression is only true the first time you check it. -#define WAIT_(ex, timeout, res) \ - do { \ - uint32 start = talk_base::Time(); \ - res = (ex); \ - while (!res && talk_base::Time() < start + timeout) { \ - talk_base::Thread::Current()->ProcessMessages(1); \ - res = (ex); \ - } \ - } while (0); - -// The typical EXPECT_XXXX and ASSERT_XXXXs, but done until true or a timeout. -#define EXPECT_TRUE_WAIT(ex, timeout) \ - do { \ - bool res; \ - WAIT_(ex, timeout, res); \ - if (!res) EXPECT_TRUE(ex); \ - } while (0); - -#define EXPECT_EQ_WAIT(v1, v2, timeout) \ - do { \ - bool res; \ - WAIT_(v1 == v2, timeout, res); \ - if (!res) EXPECT_EQ(v1, v2); \ - } while (0); - -#define ASSERT_TRUE_WAIT(ex, timeout) \ - do { \ - bool res; \ - WAIT_(ex, timeout, res); \ - if (!res) ASSERT_TRUE(ex); \ - } while (0); - -#define ASSERT_EQ_WAIT(v1, v2, timeout) \ - do { \ - bool res; \ - WAIT_(v1 == v2, timeout, res); \ - if (!res) ASSERT_EQ(v1, v2); \ - } while (0); - -// Version with a "soft" timeout and a margin. This logs if the timeout is -// exceeded, but it only fails if the expression still isn't true after the -// margin time passes. -#define EXPECT_TRUE_WAIT_MARGIN(ex, timeout, margin) \ - do { \ - bool res; \ - WAIT_(ex, timeout, res); \ - if (res) { \ - break; \ - } \ - LOG(LS_WARNING) << "Expression " << #ex << " still not true after " << \ - timeout << "ms; waiting an additional " << margin << "ms"; \ - WAIT_(ex, margin, res); \ - if (!res) { \ - EXPECT_TRUE(ex); \ - } \ - } while (0); - -#endif // TALK_BASE_GUNIT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/gunit_prod.h b/thirdparties/common/include/webrtc-sdk/talk/base/gunit_prod.h deleted file mode 100755 index 843148f..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/gunit_prod.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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_BASE_GUNIT_PROD_H_ -#define TALK_BASE_GUNIT_PROD_H_ - -#if defined(ANDROID) -// Android doesn't use gtest at all, so anything that relies on gtest should -// check this define first. -#define NO_GTEST -#elif defined (GTEST_RELATIVE_PATH) -#include "gtest/gtest_prod.h" -#else -#include "testing/base/gunit_prod.h" -#endif - -#endif // TALK_BASE_GUNIT_PROD_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/helpers.h b/thirdparties/common/include/webrtc-sdk/talk/base/helpers.h deleted file mode 100755 index f4d2aaa..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/helpers.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_HELPERS_H_ -#define TALK_BASE_HELPERS_H_ - -#include -#include "talk/base/basictypes.h" - -namespace talk_base { - -// For testing, we can return predictable data. -void SetRandomTestMode(bool test); - -// Initializes the RNG, and seeds it with the specified entropy. -bool InitRandom(int seed); -bool InitRandom(const char* seed, size_t len); - -// Generates a (cryptographically) random string of the given length. -// We generate base64 values so that they will be printable. -// WARNING: could silently fail. Use the version below instead. -std::string CreateRandomString(size_t length); - -// Generates a (cryptographically) random string of the given length. -// We generate base64 values so that they will be printable. -// Return false if the random number generator failed. -bool CreateRandomString(size_t length, std::string* str); - -// Generates a (cryptographically) random string of the given length, -// with characters from the given table. Return false if the random -// number generator failed. -bool CreateRandomString(size_t length, const std::string& table, - std::string* str); - -// Generates a random id. -uint32 CreateRandomId(); - -// Generates a 64 bit random id. -uint64 CreateRandomId64(); - -// Generates a random id > 0. -uint32 CreateRandomNonZeroId(); - -// Generates a random double between 0.0 (inclusive) and 1.0 (exclusive). -double CreateRandomDouble(); - -} // namespace talk_base - -#endif // TALK_BASE_HELPERS_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/httpbase.h b/thirdparties/common/include/webrtc-sdk/talk/base/httpbase.h deleted file mode 100755 index 9fc725a..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/httpbase.h +++ /dev/null @@ -1,201 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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. - */ - -// Copyright 2005 Google Inc. All Rights Reserved. -// - - -#ifndef TALK_BASE_HTTPBASE_H__ -#define TALK_BASE_HTTPBASE_H__ - -#include "talk/base/httpcommon.h" - -namespace talk_base { - -class StreamInterface; - -/////////////////////////////////////////////////////////////////////////////// -// HttpParser - Parses an HTTP stream provided via Process and end_of_input, and -// generates events for: -// Structural Elements: Leader, Headers, Document Data -// Events: End of Headers, End of Document, Errors -/////////////////////////////////////////////////////////////////////////////// - -class HttpParser { -public: - enum ProcessResult { PR_CONTINUE, PR_BLOCK, PR_COMPLETE }; - HttpParser(); - virtual ~HttpParser(); - - void reset(); - ProcessResult Process(const char* buffer, size_t len, size_t* processed, - HttpError* error); - bool is_valid_end_of_input() const; - void complete(HttpError err); - - size_t GetDataRemaining() const { return data_size_; } - -protected: - ProcessResult ProcessLine(const char* line, size_t len, HttpError* error); - - // HttpParser Interface - virtual ProcessResult ProcessLeader(const char* line, size_t len, - HttpError* error) = 0; - virtual ProcessResult ProcessHeader(const char* name, size_t nlen, - const char* value, size_t vlen, - HttpError* error) = 0; - virtual ProcessResult ProcessHeaderComplete(bool chunked, size_t& data_size, - HttpError* error) = 0; - virtual ProcessResult ProcessData(const char* data, size_t len, size_t& read, - HttpError* error) = 0; - virtual void OnComplete(HttpError err) = 0; - -private: - enum State { - ST_LEADER, ST_HEADERS, - ST_CHUNKSIZE, ST_CHUNKTERM, ST_TRAILERS, - ST_DATA, ST_COMPLETE - } state_; - bool chunked_; - size_t data_size_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// IHttpNotify -/////////////////////////////////////////////////////////////////////////////// - -enum HttpMode { HM_NONE, HM_CONNECT, HM_RECV, HM_SEND }; - -class IHttpNotify { -public: - virtual ~IHttpNotify() {} - virtual HttpError onHttpHeaderComplete(bool chunked, size_t& data_size) = 0; - virtual void onHttpComplete(HttpMode mode, HttpError err) = 0; - virtual void onHttpClosed(HttpError err) = 0; -}; - -/////////////////////////////////////////////////////////////////////////////// -// HttpBase - Provides a state machine for implementing HTTP-based components. -// Attach HttpBase to a StreamInterface which represents a bidirectional HTTP -// stream, and then call send() or recv() to initiate sending or receiving one -// side of an HTTP transaction. By default, HttpBase operates as an I/O pump, -// moving data from the HTTP stream to the HttpData object and vice versa. -// However, it can also operate in stream mode, in which case the user of the -// stream interface drives I/O via calls to Read(). -/////////////////////////////////////////////////////////////////////////////// - -class HttpBase -: private HttpParser, - public sigslot::has_slots<> -{ -public: - HttpBase(); - virtual ~HttpBase(); - - void notify(IHttpNotify* notify) { notify_ = notify; } - bool attach(StreamInterface* stream); - StreamInterface* stream() { return http_stream_; } - StreamInterface* detach(); - bool isConnected() const; - - void send(HttpData* data); - void recv(HttpData* data); - void abort(HttpError err); - - HttpMode mode() const { return mode_; } - - void set_ignore_data(bool ignore) { ignore_data_ = ignore; } - bool ignore_data() const { return ignore_data_; } - - // Obtaining this stream puts HttpBase into stream mode until the stream - // is closed. HttpBase can only expose one open stream interface at a time. - // Further calls will return NULL. - StreamInterface* GetDocumentStream(); - -protected: - // Do cleanup when the http stream closes (error may be 0 for a clean - // shutdown), and return the error code to signal. - HttpError HandleStreamClose(int error); - - // DoReceiveLoop acts as a data pump, pulling data from the http stream, - // pushing it through the HttpParser, and then populating the HttpData object - // based on the callbacks from the parser. One of the most interesting - // callbacks is ProcessData, which provides the actual http document body. - // This data is then written to the HttpData::document. As a result, data - // flows from the network to the document, with some incidental protocol - // parsing in between. - // Ideally, we would pass in the document* to DoReceiveLoop, to more easily - // support GetDocumentStream(). However, since the HttpParser is callback - // driven, we are forced to store the pointer somewhere until the callback - // is triggered. - // Returns true if the received document has finished, and - // HttpParser::complete should be called. - bool DoReceiveLoop(HttpError* err); - - void read_and_process_data(); - void flush_data(); - bool queue_headers(); - void do_complete(HttpError err = HE_NONE); - - void OnHttpStreamEvent(StreamInterface* stream, int events, int error); - void OnDocumentEvent(StreamInterface* stream, int events, int error); - - // HttpParser Interface - virtual ProcessResult ProcessLeader(const char* line, size_t len, - HttpError* error); - virtual ProcessResult ProcessHeader(const char* name, size_t nlen, - const char* value, size_t vlen, - HttpError* error); - virtual ProcessResult ProcessHeaderComplete(bool chunked, size_t& data_size, - HttpError* error); - virtual ProcessResult ProcessData(const char* data, size_t len, size_t& read, - HttpError* error); - virtual void OnComplete(HttpError err); - -private: - class DocumentStream; - friend class DocumentStream; - - enum { kBufferSize = 32 * 1024 }; - - HttpMode mode_; - HttpData* data_; - IHttpNotify* notify_; - StreamInterface* http_stream_; - DocumentStream* doc_stream_; - char buffer_[kBufferSize]; - size_t len_; - - bool ignore_data_, chunk_data_; - HttpData::const_iterator header_; -}; - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace talk_base - -#endif // TALK_BASE_HTTPBASE_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/httpclient.h b/thirdparties/common/include/webrtc-sdk/talk/base/httpclient.h deleted file mode 100755 index a1f48cc..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/httpclient.h +++ /dev/null @@ -1,219 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_HTTPCLIENT_H__ -#define TALK_BASE_HTTPCLIENT_H__ - -#include "talk/base/common.h" -#include "talk/base/httpbase.h" -#include "talk/base/nethelpers.h" -#include "talk/base/proxyinfo.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/sigslot.h" -#include "talk/base/socketaddress.h" -#include "talk/base/socketpool.h" - -namespace talk_base { - -////////////////////////////////////////////////////////////////////// -// Client-specific http utilities -////////////////////////////////////////////////////////////////////// - -// Write cache-relevant response headers to output stream. If size is non-null, -// it contains the length of the output in bytes. output may be null if only -// the length is desired. -bool HttpWriteCacheHeaders(const HttpResponseData* response, - StreamInterface* output, size_t* size); -// Read cached headers from a stream, and them merge them into the response -// object using the specified combine operation. -bool HttpReadCacheHeaders(StreamInterface* input, - HttpResponseData* response, - HttpData::HeaderCombine combine); - -////////////////////////////////////////////////////////////////////// -// HttpClient -// Implements an HTTP 1.1 client. -////////////////////////////////////////////////////////////////////// - -class DiskCache; -class HttpClient; -class IPNetPool; - -class SignalThread; -// What to do: Define STRICT_HTTP_ERROR=1 in your makefile. Use HttpError in -// your code (HttpErrorType should only be used for code that is shared -// with groups which have not yet migrated). -#if STRICT_HTTP_ERROR -typedef HttpError HttpErrorType; -#else // !STRICT_HTTP_ERROR -typedef int HttpErrorType; -#endif // !STRICT_HTTP_ERROR - -class HttpClient : private IHttpNotify, public sigslot::has_slots<> { -public: - // If HttpRequestData and HttpResponseData objects are provided, they must - // be freed by the caller. Otherwise, an internal object is allocated. - HttpClient(const std::string& agent, StreamPool* pool, - HttpTransaction* transaction = NULL); - virtual ~HttpClient(); - - void set_pool(StreamPool* pool) { pool_ = pool; } - - void set_agent(const std::string& agent) { agent_ = agent; } - const std::string& agent() const { return agent_; } - - void set_proxy(const ProxyInfo& proxy) { proxy_ = proxy; } - const ProxyInfo& proxy() const { return proxy_; } - - // Request retries occur when the connection closes before the beginning of - // an http response is received. In these cases, the http server may have - // timed out the keepalive connection before it received our request. Note - // that if a request document cannot be rewound, no retry is made. The - // default is 1. - void set_request_retries(size_t retries) { retries_ = retries; } - size_t request_retries() const { return retries_; } - - enum RedirectAction { REDIRECT_DEFAULT, REDIRECT_ALWAYS, REDIRECT_NEVER }; - void set_redirect_action(RedirectAction action) { redirect_action_ = action; } - RedirectAction redirect_action() const { return redirect_action_; } - // Deprecated - void set_fail_redirect(bool fail_redirect) { - redirect_action_ = REDIRECT_NEVER; - } - bool fail_redirect() const { return (REDIRECT_NEVER == redirect_action_); } - - enum UriForm { URI_DEFAULT, URI_ABSOLUTE, URI_RELATIVE }; - void set_uri_form(UriForm form) { uri_form_ = form; } - UriForm uri_form() const { return uri_form_; } - - void set_cache(DiskCache* cache) { ASSERT(!IsCacheActive()); cache_ = cache; } - bool cache_enabled() const { return (NULL != cache_); } - - // reset clears the server, request, and response structures. It will also - // abort an active request. - void reset(); - - void set_server(const SocketAddress& address); - const SocketAddress& server() const { return server_; } - - // Note: in order for HttpClient to retry a POST in response to - // an authentication challenge, a redirect response, or socket disconnection, - // the request document must support 'replaying' by calling Rewind() on it. - // In the case where just a subset of a stream should be used as the request - // document, the stream may be wrapped with the StreamSegment adapter. - HttpTransaction* transaction() { return transaction_; } - const HttpTransaction* transaction() const { return transaction_; } - HttpRequestData& request() { return transaction_->request; } - const HttpRequestData& request() const { return transaction_->request; } - HttpResponseData& response() { return transaction_->response; } - const HttpResponseData& response() const { return transaction_->response; } - - // convenience methods - void prepare_get(const std::string& url); - void prepare_post(const std::string& url, const std::string& content_type, - StreamInterface* request_doc); - - // Convert HttpClient to a pull-based I/O model. - StreamInterface* GetDocumentStream(); - - // After you finish setting up your request, call start. - void start(); - - // Signalled when the header has finished downloading, before the document - // content is processed. You may change the response document in response - // to this signal. The second parameter indicates whether this is an - // intermediate (false) or final (true) header. An intermediate header is - // one that generates another request, such as a redirect or authentication - // challenge. The third parameter indicates the length of the response - // document, or else SIZE_UNKNOWN. Note: Do NOT abort the request in response - // to this signal. - sigslot::signal3 SignalHeaderAvailable; - // Signalled when the current request finishes. On success, err is 0. - sigslot::signal2 SignalHttpClientComplete; - -protected: - void connect(); - void release(); - - bool ShouldRedirect(std::string* location) const; - - bool BeginCacheFile(); - HttpError WriteCacheHeaders(const std::string& id); - void CompleteCacheFile(); - - bool CheckCache(); - HttpError ReadCacheHeaders(const std::string& id, bool override); - HttpError ReadCacheBody(const std::string& id); - - bool PrepareValidate(); - HttpError CompleteValidate(); - - HttpError OnHeaderAvailable(bool ignore_data, bool chunked, size_t data_size); - - void StartDNSLookup(); - void OnResolveResult(AsyncResolverInterface* resolver); - - // IHttpNotify Interface - virtual HttpError onHttpHeaderComplete(bool chunked, size_t& data_size); - virtual void onHttpComplete(HttpMode mode, HttpError err); - virtual void onHttpClosed(HttpError err); - -private: - enum CacheState { CS_READY, CS_WRITING, CS_READING, CS_VALIDATING }; - bool IsCacheActive() const { return (cache_state_ > CS_READY); } - - std::string agent_; - StreamPool* pool_; - HttpBase base_; - SocketAddress server_; - ProxyInfo proxy_; - HttpTransaction* transaction_; - bool free_transaction_; - size_t retries_, attempt_, redirects_; - RedirectAction redirect_action_; - UriForm uri_form_; - scoped_ptr context_; - DiskCache* cache_; - CacheState cache_state_; - AsyncResolverInterface* resolver_; -}; - -////////////////////////////////////////////////////////////////////// -// HttpClientDefault - Default implementation of HttpClient -////////////////////////////////////////////////////////////////////// - -class HttpClientDefault : public ReuseSocketPool, public HttpClient { -public: - HttpClientDefault(SocketFactory* factory, const std::string& agent, - HttpTransaction* transaction = NULL); -}; - -////////////////////////////////////////////////////////////////////// - -} // namespace talk_base - -#endif // TALK_BASE_HTTPCLIENT_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/httpcommon-inl.h b/thirdparties/common/include/webrtc-sdk/talk/base/httpcommon-inl.h deleted file mode 100755 index 48d62d7..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/httpcommon-inl.h +++ /dev/null @@ -1,148 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_HTTPCOMMON_INL_H__ -#define TALK_BASE_HTTPCOMMON_INL_H__ - -#include "talk/base/common.h" -#include "talk/base/httpcommon.h" - -namespace talk_base { - -/////////////////////////////////////////////////////////////////////////////// -// Url -/////////////////////////////////////////////////////////////////////////////// - -template -void Url::do_set_url(const CTYPE* val, size_t len) { - if (ascnicmp(val, "http://", 7) == 0) { - val += 7; len -= 7; - secure_ = false; - } else if (ascnicmp(val, "https://", 8) == 0) { - val += 8; len -= 8; - secure_ = true; - } else { - clear(); - return; - } - const CTYPE* path = strchrn(val, len, static_cast('/')); - if (!path) { - path = val + len; - } - size_t address_length = (path - val); - do_set_address(val, address_length); - do_set_full_path(path, len - address_length); -} - -template -void Url::do_set_address(const CTYPE* val, size_t len) { - if (const CTYPE* at = strchrn(val, len, static_cast('@'))) { - // Everything before the @ is a user:password combo, so skip it. - len -= at - val + 1; - val = at + 1; - } - if (const CTYPE* colon = strchrn(val, len, static_cast(':'))) { - host_.assign(val, colon - val); - // Note: In every case, we're guaranteed that colon is followed by a null, - // or non-numeric character. - port_ = static_cast(::strtoul(colon + 1, NULL, 10)); - // TODO: Consider checking for invalid data following port number. - } else { - host_.assign(val, len); - port_ = HttpDefaultPort(secure_); - } -} - -template -void Url::do_set_full_path(const CTYPE* val, size_t len) { - const CTYPE* query = strchrn(val, len, static_cast('?')); - if (!query) { - query = val + len; - } - size_t path_length = (query - val); - if (0 == path_length) { - // TODO: consider failing in this case. - path_.assign(1, static_cast('/')); - } else { - ASSERT(val[0] == static_cast('/')); - path_.assign(val, path_length); - } - query_.assign(query, len - path_length); -} - -template -void Url::do_get_url(string* val) const { - CTYPE protocol[9]; - asccpyn(protocol, ARRAY_SIZE(protocol), secure_ ? "https://" : "http://"); - val->append(protocol); - do_get_address(val); - do_get_full_path(val); -} - -template -void Url::do_get_address(string* val) const { - val->append(host_); - if (port_ != HttpDefaultPort(secure_)) { - CTYPE format[5], port[32]; - asccpyn(format, ARRAY_SIZE(format), ":%hu"); - sprintfn(port, ARRAY_SIZE(port), format, port_); - val->append(port); - } -} - -template -void Url::do_get_full_path(string* val) const { - val->append(path_); - val->append(query_); -} - -template -bool Url::get_attribute(const string& name, string* value) const { - if (query_.empty()) - return false; - - std::string::size_type pos = query_.find(name, 1); - if (std::string::npos == pos) - return false; - - pos += name.length() + 1; - if ((pos > query_.length()) || (static_cast('=') != query_[pos-1])) - return false; - - std::string::size_type end = query_.find(static_cast('&'), pos); - if (std::string::npos == end) { - end = query_.length(); - } - value->assign(query_.substr(pos, end - pos)); - return true; -} - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace talk_base - -#endif // TALK_BASE_HTTPCOMMON_INL_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/httpcommon.h b/thirdparties/common/include/webrtc-sdk/talk/base/httpcommon.h deleted file mode 100755 index 797dbc6..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/httpcommon.h +++ /dev/null @@ -1,463 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_HTTPCOMMON_H__ -#define TALK_BASE_HTTPCOMMON_H__ - -#include -#include -#include -#include "talk/base/basictypes.h" -#include "talk/base/common.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/stringutils.h" -#include "talk/base/stream.h" - -namespace talk_base { - -class CryptString; -class SocketAddress; - -////////////////////////////////////////////////////////////////////// -// Constants -////////////////////////////////////////////////////////////////////// - -enum HttpCode { - HC_OK = 200, - HC_NON_AUTHORITATIVE = 203, - HC_NO_CONTENT = 204, - HC_PARTIAL_CONTENT = 206, - - HC_MULTIPLE_CHOICES = 300, - HC_MOVED_PERMANENTLY = 301, - HC_FOUND = 302, - HC_SEE_OTHER = 303, - HC_NOT_MODIFIED = 304, - HC_MOVED_TEMPORARILY = 307, - - HC_BAD_REQUEST = 400, - HC_UNAUTHORIZED = 401, - HC_FORBIDDEN = 403, - HC_NOT_FOUND = 404, - HC_PROXY_AUTHENTICATION_REQUIRED = 407, - HC_GONE = 410, - - HC_INTERNAL_SERVER_ERROR = 500, - HC_NOT_IMPLEMENTED = 501, - HC_SERVICE_UNAVAILABLE = 503, -}; - -enum HttpVersion { - HVER_1_0, HVER_1_1, HVER_UNKNOWN, - HVER_LAST = HVER_UNKNOWN -}; - -enum HttpVerb { - HV_GET, HV_POST, HV_PUT, HV_DELETE, HV_CONNECT, HV_HEAD, - HV_LAST = HV_HEAD -}; - -enum HttpError { - HE_NONE, - HE_PROTOCOL, // Received non-valid HTTP data - HE_DISCONNECTED, // Connection closed unexpectedly - HE_OVERFLOW, // Received too much data for internal buffers - HE_CONNECT_FAILED, // The socket failed to connect. - HE_SOCKET_ERROR, // An error occurred on a connected socket - HE_SHUTDOWN, // Http object is being destroyed - HE_OPERATION_CANCELLED, // Connection aborted locally - HE_AUTH, // Proxy Authentication Required - HE_CERTIFICATE_EXPIRED, // During SSL negotiation - HE_STREAM, // Problem reading or writing to the document - HE_CACHE, // Problem reading from cache - HE_DEFAULT -}; - -enum HttpHeader { - HH_AGE, - HH_CACHE_CONTROL, - HH_CONNECTION, - HH_CONTENT_DISPOSITION, - HH_CONTENT_LENGTH, - HH_CONTENT_RANGE, - HH_CONTENT_TYPE, - HH_COOKIE, - HH_DATE, - HH_ETAG, - HH_EXPIRES, - HH_HOST, - HH_IF_MODIFIED_SINCE, - HH_IF_NONE_MATCH, - HH_KEEP_ALIVE, - HH_LAST_MODIFIED, - HH_LOCATION, - HH_PROXY_AUTHENTICATE, - HH_PROXY_AUTHORIZATION, - HH_PROXY_CONNECTION, - HH_RANGE, - HH_SET_COOKIE, - HH_TE, - HH_TRAILERS, - HH_TRANSFER_ENCODING, - HH_UPGRADE, - HH_USER_AGENT, - HH_WWW_AUTHENTICATE, - HH_LAST = HH_WWW_AUTHENTICATE -}; - -const uint16 HTTP_DEFAULT_PORT = 80; -const uint16 HTTP_SECURE_PORT = 443; - -////////////////////////////////////////////////////////////////////// -// Utility Functions -////////////////////////////////////////////////////////////////////// - -inline HttpError mkerr(HttpError err, HttpError def_err = HE_DEFAULT) { - return (err != HE_NONE) ? err : def_err; -} - -const char* ToString(HttpVersion version); -bool FromString(HttpVersion& version, const std::string& str); - -const char* ToString(HttpVerb verb); -bool FromString(HttpVerb& verb, const std::string& str); - -const char* ToString(HttpHeader header); -bool FromString(HttpHeader& header, const std::string& str); - -inline bool HttpCodeIsInformational(uint32 code) { return ((code / 100) == 1); } -inline bool HttpCodeIsSuccessful(uint32 code) { return ((code / 100) == 2); } -inline bool HttpCodeIsRedirection(uint32 code) { return ((code / 100) == 3); } -inline bool HttpCodeIsClientError(uint32 code) { return ((code / 100) == 4); } -inline bool HttpCodeIsServerError(uint32 code) { return ((code / 100) == 5); } - -bool HttpCodeHasBody(uint32 code); -bool HttpCodeIsCacheable(uint32 code); -bool HttpHeaderIsEndToEnd(HttpHeader header); -bool HttpHeaderIsCollapsible(HttpHeader header); - -struct HttpData; -bool HttpShouldKeepAlive(const HttpData& data); - -typedef std::pair HttpAttribute; -typedef std::vector HttpAttributeList; -void HttpComposeAttributes(const HttpAttributeList& attributes, char separator, - std::string* composed); -void HttpParseAttributes(const char * data, size_t len, - HttpAttributeList& attributes); -bool HttpHasAttribute(const HttpAttributeList& attributes, - const std::string& name, - std::string* value); -bool HttpHasNthAttribute(HttpAttributeList& attributes, - size_t index, - std::string* name, - std::string* value); - -// Convert RFC1123 date (DoW, DD Mon YYYY HH:MM:SS TZ) to unix timestamp -bool HttpDateToSeconds(const std::string& date, time_t* seconds); - -inline uint16 HttpDefaultPort(bool secure) { - return secure ? HTTP_SECURE_PORT : HTTP_DEFAULT_PORT; -} - -// Returns the http server notation for a given address -std::string HttpAddress(const SocketAddress& address, bool secure); - -// functional for insensitive std::string compare -struct iless { - bool operator()(const std::string& lhs, const std::string& rhs) const { - return (::_stricmp(lhs.c_str(), rhs.c_str()) < 0); - } -}; - -// put quotes around a string and escape any quotes inside it -std::string quote(const std::string& str); - -////////////////////////////////////////////////////////////////////// -// Url -////////////////////////////////////////////////////////////////////// - -template -class Url { -public: - typedef typename Traits::string string; - - // TODO: Implement Encode/Decode - static int Encode(const CTYPE* source, CTYPE* destination, size_t len); - static int Encode(const string& source, string& destination); - static int Decode(const CTYPE* source, CTYPE* destination, size_t len); - static int Decode(const string& source, string& destination); - - Url(const string& url) { do_set_url(url.c_str(), url.size()); } - Url(const string& path, const string& host, uint16 port = HTTP_DEFAULT_PORT) - : host_(host), port_(port), secure_(HTTP_SECURE_PORT == port) - { set_full_path(path); } - - bool valid() const { return !host_.empty(); } - void clear() { - host_.clear(); - port_ = HTTP_DEFAULT_PORT; - secure_ = false; - path_.assign(1, static_cast('/')); - query_.clear(); - } - - void set_url(const string& val) { - do_set_url(val.c_str(), val.size()); - } - string url() const { - string val; do_get_url(&val); return val; - } - - void set_address(const string& val) { - do_set_address(val.c_str(), val.size()); - } - string address() const { - string val; do_get_address(&val); return val; - } - - void set_full_path(const string& val) { - do_set_full_path(val.c_str(), val.size()); - } - string full_path() const { - string val; do_get_full_path(&val); return val; - } - - void set_host(const string& val) { host_ = val; } - const string& host() const { return host_; } - - void set_port(uint16 val) { port_ = val; } - uint16 port() const { return port_; } - - void set_secure(bool val) { secure_ = val; } - bool secure() const { return secure_; } - - void set_path(const string& val) { - if (val.empty()) { - path_.assign(1, static_cast('/')); - } else { - ASSERT(val[0] == static_cast('/')); - path_ = val; - } - } - const string& path() const { return path_; } - - void set_query(const string& val) { - ASSERT(val.empty() || (val[0] == static_cast('?'))); - query_ = val; - } - const string& query() const { return query_; } - - bool get_attribute(const string& name, string* value) const; - -private: - void do_set_url(const CTYPE* val, size_t len); - void do_set_address(const CTYPE* val, size_t len); - void do_set_full_path(const CTYPE* val, size_t len); - - void do_get_url(string* val) const; - void do_get_address(string* val) const; - void do_get_full_path(string* val) const; - - string host_, path_, query_; - uint16 port_; - bool secure_; -}; - -////////////////////////////////////////////////////////////////////// -// HttpData -////////////////////////////////////////////////////////////////////// - -struct HttpData { - typedef std::multimap HeaderMap; - typedef HeaderMap::const_iterator const_iterator; - typedef HeaderMap::iterator iterator; - - HttpVersion version; - scoped_ptr document; - - HttpData() : version(HVER_1_1) { } - - enum HeaderCombine { HC_YES, HC_NO, HC_AUTO, HC_REPLACE, HC_NEW }; - void changeHeader(const std::string& name, const std::string& value, - HeaderCombine combine); - inline void addHeader(const std::string& name, const std::string& value, - bool append = true) { - changeHeader(name, value, append ? HC_AUTO : HC_NO); - } - inline void setHeader(const std::string& name, const std::string& value, - bool overwrite = true) { - changeHeader(name, value, overwrite ? HC_REPLACE : HC_NEW); - } - // Returns count of erased headers - size_t clearHeader(const std::string& name); - // Returns iterator to next header - iterator clearHeader(iterator header); - - // keep in mind, this may not do what you want in the face of multiple headers - bool hasHeader(const std::string& name, std::string* value) const; - - inline const_iterator begin() const { - return headers_.begin(); - } - inline const_iterator end() const { - return headers_.end(); - } - inline iterator begin() { - return headers_.begin(); - } - inline iterator end() { - return headers_.end(); - } - inline const_iterator begin(const std::string& name) const { - return headers_.lower_bound(name); - } - inline const_iterator end(const std::string& name) const { - return headers_.upper_bound(name); - } - inline iterator begin(const std::string& name) { - return headers_.lower_bound(name); - } - inline iterator end(const std::string& name) { - return headers_.upper_bound(name); - } - - // Convenience methods using HttpHeader - inline void changeHeader(HttpHeader header, const std::string& value, - HeaderCombine combine) { - changeHeader(ToString(header), value, combine); - } - inline void addHeader(HttpHeader header, const std::string& value, - bool append = true) { - addHeader(ToString(header), value, append); - } - inline void setHeader(HttpHeader header, const std::string& value, - bool overwrite = true) { - setHeader(ToString(header), value, overwrite); - } - inline void clearHeader(HttpHeader header) { - clearHeader(ToString(header)); - } - inline bool hasHeader(HttpHeader header, std::string* value) const { - return hasHeader(ToString(header), value); - } - inline const_iterator begin(HttpHeader header) const { - return headers_.lower_bound(ToString(header)); - } - inline const_iterator end(HttpHeader header) const { - return headers_.upper_bound(ToString(header)); - } - inline iterator begin(HttpHeader header) { - return headers_.lower_bound(ToString(header)); - } - inline iterator end(HttpHeader header) { - return headers_.upper_bound(ToString(header)); - } - - void setContent(const std::string& content_type, StreamInterface* document); - void setDocumentAndLength(StreamInterface* document); - - virtual size_t formatLeader(char* buffer, size_t size) const = 0; - virtual HttpError parseLeader(const char* line, size_t len) = 0; - -protected: - virtual ~HttpData() { } - void clear(bool release_document); - void copy(const HttpData& src); - -private: - HeaderMap headers_; -}; - -struct HttpRequestData : public HttpData { - HttpVerb verb; - std::string path; - - HttpRequestData() : verb(HV_GET) { } - - void clear(bool release_document); - void copy(const HttpRequestData& src); - - virtual size_t formatLeader(char* buffer, size_t size) const; - virtual HttpError parseLeader(const char* line, size_t len); - - bool getAbsoluteUri(std::string* uri) const; - bool getRelativeUri(std::string* host, std::string* path) const; -}; - -struct HttpResponseData : public HttpData { - uint32 scode; - std::string message; - - HttpResponseData() : scode(HC_INTERNAL_SERVER_ERROR) { } - void clear(bool release_document); - void copy(const HttpResponseData& src); - - // Convenience methods - void set_success(uint32 scode = HC_OK); - void set_success(const std::string& content_type, StreamInterface* document, - uint32 scode = HC_OK); - void set_redirect(const std::string& location, - uint32 scode = HC_MOVED_TEMPORARILY); - void set_error(uint32 scode); - - virtual size_t formatLeader(char* buffer, size_t size) const; - virtual HttpError parseLeader(const char* line, size_t len); -}; - -struct HttpTransaction { - HttpRequestData request; - HttpResponseData response; -}; - -////////////////////////////////////////////////////////////////////// -// Http Authentication -////////////////////////////////////////////////////////////////////// - -struct HttpAuthContext { - std::string auth_method; - HttpAuthContext(const std::string& auth) : auth_method(auth) { } - virtual ~HttpAuthContext() { } -}; - -enum HttpAuthResult { HAR_RESPONSE, HAR_IGNORE, HAR_CREDENTIALS, HAR_ERROR }; - -// 'context' is used by this function to record information between calls. -// Start by passing a null pointer, then pass the same pointer each additional -// call. When the authentication attempt is finished, delete the context. -HttpAuthResult HttpAuthenticate( - const char * challenge, size_t len, - const SocketAddress& server, - const std::string& method, const std::string& uri, - const std::string& username, const CryptString& password, - HttpAuthContext *& context, std::string& response, std::string& auth_method); - -////////////////////////////////////////////////////////////////////// - -} // namespace talk_base - -#endif // TALK_BASE_HTTPCOMMON_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/httprequest.h b/thirdparties/common/include/webrtc-sdk/talk/base/httprequest.h deleted file mode 100755 index 886dfa9..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/httprequest.h +++ /dev/null @@ -1,132 +0,0 @@ -/* - * libjingle - * Copyright 2006, 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 _HTTPREQUEST_H_ -#define _HTTPREQUEST_H_ - -#include "talk/base/httpclient.h" -#include "talk/base/logging.h" -#include "talk/base/proxyinfo.h" -#include "talk/base/socketserver.h" -#include "talk/base/thread.h" -#include "talk/base/sslsocketfactory.h" // Deprecated include - -namespace talk_base { - -/////////////////////////////////////////////////////////////////////////////// -// HttpRequest -/////////////////////////////////////////////////////////////////////////////// - -class FirewallManager; -class MemoryStream; - -class HttpRequest { -public: - HttpRequest(const std::string &user_agent); - - void Send(); - - void set_proxy(const ProxyInfo& proxy) { - proxy_ = proxy; - } - void set_firewall(FirewallManager * firewall) { - firewall_ = firewall; - } - - // The DNS name of the host to connect to. - const std::string& host() { return host_; } - void set_host(const std::string& host) { host_ = host; } - - // The port to connect to on the target host. - int port() { return port_; } - void set_port(int port) { port_ = port; } - - // Whether the request should use SSL. - bool secure() { return secure_; } - void set_secure(bool secure) { secure_ = secure; } - - // Returns the redirect when redirection occurs - const std::string& response_redirect() { return response_redirect_; } - - // Time to wait on the download, in ms. Default is 5000 (5s) - int timeout() { return timeout_; } - void set_timeout(int timeout) { timeout_ = timeout; } - - // Fail redirects to allow analysis of redirect urls, etc. - bool fail_redirect() const { return fail_redirect_; } - void set_fail_redirect(bool fail_redirect) { fail_redirect_ = fail_redirect; } - - HttpRequestData& request() { return client_.request(); } - HttpResponseData& response() { return client_.response(); } - HttpErrorType error() { return error_; } - -protected: - void set_error(HttpErrorType error) { error_ = error; } - -private: - ProxyInfo proxy_; - FirewallManager * firewall_; - std::string host_; - int port_; - bool secure_; - int timeout_; - bool fail_redirect_; - HttpClient client_; - HttpErrorType error_; - std::string response_redirect_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// HttpMonitor -/////////////////////////////////////////////////////////////////////////////// - -class HttpMonitor : public sigslot::has_slots<> { -public: - HttpMonitor(SocketServer *ss); - - void reset() { - complete_ = false; - error_ = HE_DEFAULT; - } - - bool done() const { return complete_; } - HttpErrorType error() const { return error_; } - - void Connect(HttpClient* http); - void OnHttpClientComplete(HttpClient * http, HttpErrorType error); - -private: - bool complete_; - HttpErrorType error_; - SocketServer *ss_; -}; - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace talk_base_ - -#endif // _HTTPREQUEST_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/httpserver.h b/thirdparties/common/include/webrtc-sdk/talk/base/httpserver.h deleted file mode 100755 index 272fead..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/httpserver.h +++ /dev/null @@ -1,154 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_HTTPSERVER_H__ -#define TALK_BASE_HTTPSERVER_H__ - -#include -#include "talk/base/httpbase.h" - -namespace talk_base { - -class AsyncSocket; -class HttpServer; -class SocketAddress; - -////////////////////////////////////////////////////////////////////// -// HttpServer -////////////////////////////////////////////////////////////////////// - -const int HTTP_INVALID_CONNECTION_ID = 0; - -struct HttpServerTransaction : public HttpTransaction { -public: - HttpServerTransaction(int id) : connection_id_(id) { } - int connection_id() const { return connection_id_; } - -private: - int connection_id_; -}; - -class HttpServer { -public: - HttpServer(); - virtual ~HttpServer(); - - int HandleConnection(StreamInterface* stream); - // Due to sigslot issues, we can't destroy some streams at an arbitrary time. - sigslot::signal3 SignalConnectionClosed; - - // This signal occurs when the HTTP request headers have been received, but - // before the request body is written to the request document. By default, - // the request document is a MemoryStream. By handling this signal, the - // document can be overridden, in which case the third signal argument should - // be set to true. In the case where the request body should be ignored, - // the document can be set to NULL. Note that the transaction object is still - // owened by the HttpServer at this point. - sigslot::signal3 - SignalHttpRequestHeader; - - // An HTTP request has been made, and is available in the transaction object. - // Populate the transaction's response, and then return the object via the - // Respond method. Note that during this time, ownership of the transaction - // object is transferred, so it may be passed between threads, although - // respond must be called on the server's active thread. - sigslot::signal2 SignalHttpRequest; - void Respond(HttpServerTransaction* transaction); - - // If you want to know when a request completes, listen to this event. - sigslot::signal3 - SignalHttpRequestComplete; - - // Stop processing the connection indicated by connection_id. - // Unless force is true, the server will complete sending a response that is - // in progress. - void Close(int connection_id, bool force); - void CloseAll(bool force); - - // After calling CloseAll, this event is signalled to indicate that all - // outstanding connections have closed. - sigslot::signal1 SignalCloseAllComplete; - -private: - class Connection : private IHttpNotify { - public: - Connection(int connection_id, HttpServer* server); - virtual ~Connection(); - - void BeginProcess(StreamInterface* stream); - StreamInterface* EndProcess(); - - void Respond(HttpServerTransaction* transaction); - void InitiateClose(bool force); - - // IHttpNotify Interface - virtual HttpError onHttpHeaderComplete(bool chunked, size_t& data_size); - virtual void onHttpComplete(HttpMode mode, HttpError err); - virtual void onHttpClosed(HttpError err); - - int connection_id_; - HttpServer* server_; - HttpBase base_; - HttpServerTransaction* current_; - bool signalling_, close_; - }; - - Connection* Find(int connection_id); - void Remove(int connection_id); - - friend class Connection; - typedef std::map ConnectionMap; - - ConnectionMap connections_; - int next_connection_id_; - bool closing_; -}; - -////////////////////////////////////////////////////////////////////// - -class HttpListenServer : public HttpServer, public sigslot::has_slots<> { -public: - HttpListenServer(); - virtual ~HttpListenServer(); - - int Listen(const SocketAddress& address); - bool GetAddress(SocketAddress* address) const; - void StopListening(); - -private: - void OnReadEvent(AsyncSocket* socket); - void OnConnectionClosed(HttpServer* server, int connection_id, - StreamInterface* stream); - - scoped_ptr listener_; -}; - -////////////////////////////////////////////////////////////////////// - -} // namespace talk_base - -#endif // TALK_BASE_HTTPSERVER_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/ifaddrs-android.h b/thirdparties/common/include/webrtc-sdk/talk/base/ifaddrs-android.h deleted file mode 100755 index 29f0926..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/ifaddrs-android.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * libjingle - * Copyright 2013, 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_BASE_IFADDRS_ANDROID_H_ -#define TALK_BASE_IFADDRS_ANDROID_H_ - -#include -#include -// Implementation of getifaddrs for Android. -// Fills out a list of ifaddr structs (see below) which contain information -// about every network interface available on the host. -// See 'man getifaddrs' on Linux or OS X (nb: it is not a POSIX function). -struct ifaddrs { - struct ifaddrs* ifa_next; - char* ifa_name; - unsigned int ifa_flags; - struct sockaddr* ifa_addr; - struct sockaddr* ifa_netmask; - // Real ifaddrs has broadcast, point to point and data members. - // We don't need them (yet?). -}; - -int getifaddrs(struct ifaddrs** result); -void freeifaddrs(struct ifaddrs* addrs); - -#endif // TALK_BASE_IFADDRS_ANDROID_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/ipaddress.h b/thirdparties/common/include/webrtc-sdk/talk/base/ipaddress.h deleted file mode 100755 index 5a9d9e7..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/ipaddress.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - * 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_BASE_IPADDRESS_H_ -#define TALK_BASE_IPADDRESS_H_ - -#ifdef POSIX -#include -#include -#include -#include -#endif -#ifdef WIN32 -#include -#include -#endif -#include -#include -#include - -#include "talk/base/basictypes.h" -#include "talk/base/byteorder.h" -#ifdef WIN32 -#include "talk/base/win32.h" -#endif - -namespace talk_base { - -// Version-agnostic IP address class, wraps a union of in_addr and in6_addr. -class IPAddress { - public: - IPAddress() : family_(AF_UNSPEC) { - ::memset(&u_, 0, sizeof(u_)); - } - - explicit IPAddress(const in_addr &ip4) : family_(AF_INET) { - memset(&u_, 0, sizeof(u_)); - u_.ip4 = ip4; - } - - explicit IPAddress(const in6_addr &ip6) : family_(AF_INET6) { - u_.ip6 = ip6; - } - - explicit IPAddress(uint32 ip_in_host_byte_order) : family_(AF_INET) { - memset(&u_, 0, sizeof(u_)); - u_.ip4.s_addr = HostToNetwork32(ip_in_host_byte_order); - } - - IPAddress(const IPAddress &other) : family_(other.family_) { - ::memcpy(&u_, &other.u_, sizeof(u_)); - } - - ~IPAddress() {} - - const IPAddress & operator=(const IPAddress &other) { - family_ = other.family_; - ::memcpy(&u_, &other.u_, sizeof(u_)); - return *this; - } - - bool operator==(const IPAddress &other) const; - bool operator!=(const IPAddress &other) const; - bool operator <(const IPAddress &other) const; - bool operator >(const IPAddress &other) const; - friend std::ostream& operator<<(std::ostream& os, const IPAddress& addr); - - int family() const { return family_; } - in_addr ipv4_address() const; - in6_addr ipv6_address() const; - - // Returns the number of bytes needed to store the raw address. - size_t Size() const; - - // Wraps inet_ntop. - std::string ToString() const; - - // Same as ToString but anonymizes it by hiding the last part. - std::string ToSensitiveString() const; - - // Returns an unmapped address from a possibly-mapped address. - // Returns the same address if this isn't a mapped address. - IPAddress Normalized() const; - - // Returns this address as an IPv6 address. - // Maps v4 addresses (as ::ffff:a.b.c.d), returns v6 addresses unchanged. - IPAddress AsIPv6Address() const; - - // For socketaddress' benefit. Returns the IP in host byte order. - uint32 v4AddressAsHostOrderInteger() const; - - static void set_strip_sensitive(bool enable); - - private: - int family_; - union { - in_addr ip4; - in6_addr ip6; - } u_; - - static bool strip_sensitive_; -}; - -bool IPFromAddrInfo(struct addrinfo* info, IPAddress* out); -bool IPFromString(const std::string& str, IPAddress* out); -bool IPIsAny(const IPAddress& ip); -bool IPIsLoopback(const IPAddress& ip); -bool IPIsPrivate(const IPAddress& ip); -bool IPIsUnspec(const IPAddress& ip); -size_t HashIP(const IPAddress& ip); - -// These are only really applicable for IPv6 addresses. -bool IPIs6Bone(const IPAddress& ip); -bool IPIs6To4(const IPAddress& ip); -bool IPIsSiteLocal(const IPAddress& ip); -bool IPIsTeredo(const IPAddress& ip); -bool IPIsULA(const IPAddress& ip); -bool IPIsV4Compatibility(const IPAddress& ip); -bool IPIsV4Mapped(const IPAddress& ip); - -// Returns the precedence value for this IP as given in RFC3484. -int IPAddressPrecedence(const IPAddress& ip); - -// Returns 'ip' truncated to be 'length' bits long. -IPAddress TruncateIP(const IPAddress& ip, int length); - -// Returns the number of contiguously set bits, counting from the MSB in network -// byte order, in this IPAddress. Bits after the first 0 encountered are not -// counted. -int CountIPMaskBits(IPAddress mask); - -} // namespace talk_base - -#endif // TALK_BASE_IPADDRESS_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/json.h b/thirdparties/common/include/webrtc-sdk/talk/base/json.h deleted file mode 100755 index e2212b6..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/json.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_JSON_H_ -#define TALK_BASE_JSON_H_ - -#include -#include - -#ifdef JSONCPP_RELATIVE_PATH -#include "json/json.h" -#else -#include "third_party/jsoncpp/json.h" -#endif - -// TODO: Move to talk_base namespace - -/////////////////////////////////////////////////////////////////////////////// -// JSON Helpers -/////////////////////////////////////////////////////////////////////////////// - -// Robust conversion operators, better than the ones in JsonCpp. -bool GetIntFromJson(const Json::Value& in, int* out); -bool GetUIntFromJson(const Json::Value& in, unsigned int* out); -bool GetStringFromJson(const Json::Value& in, std::string* out); -bool GetBoolFromJson(const Json::Value& in, bool* out); -bool GetDoubleFromJson(const Json::Value& in, double* out); - -// Pull values out of a JSON array. -bool GetValueFromJsonArray(const Json::Value& in, size_t n, - Json::Value* out); -bool GetIntFromJsonArray(const Json::Value& in, size_t n, - int* out); -bool GetUIntFromJsonArray(const Json::Value& in, size_t n, - unsigned int* out); -bool GetStringFromJsonArray(const Json::Value& in, size_t n, - std::string* out); -bool GetBoolFromJsonArray(const Json::Value& in, size_t n, - bool* out); -bool GetDoubleFromJsonArray(const Json::Value& in, size_t n, - double* out); - -// Convert json arrays to std::vector -bool JsonArrayToValueVector(const Json::Value& in, - std::vector* out); -bool JsonArrayToIntVector(const Json::Value& in, - std::vector* out); -bool JsonArrayToUIntVector(const Json::Value& in, - std::vector* out); -bool JsonArrayToStringVector(const Json::Value& in, - std::vector* out); -bool JsonArrayToBoolVector(const Json::Value& in, - std::vector* out); -bool JsonArrayToDoubleVector(const Json::Value& in, - std::vector* out); - -// Convert std::vector to json array -Json::Value ValueVectorToJsonArray(const std::vector& in); -Json::Value IntVectorToJsonArray(const std::vector& in); -Json::Value UIntVectorToJsonArray(const std::vector& in); -Json::Value StringVectorToJsonArray(const std::vector& in); -Json::Value BoolVectorToJsonArray(const std::vector& in); -Json::Value DoubleVectorToJsonArray(const std::vector& in); - -// Pull values out of a JSON object. -bool GetValueFromJsonObject(const Json::Value& in, const std::string& k, - Json::Value* out); -bool GetIntFromJsonObject(const Json::Value& in, const std::string& k, - int* out); -bool GetUIntFromJsonObject(const Json::Value& in, const std::string& k, - unsigned int* out); -bool GetStringFromJsonObject(const Json::Value& in, const std::string& k, - std::string* out); -bool GetBoolFromJsonObject(const Json::Value& in, const std::string& k, - bool* out); -bool GetDoubleFromJsonObject(const Json::Value& in, const std::string& k, - double* out); - -// Writes out a Json value as a string. -std::string JsonValueToString(const Json::Value& json); - -#endif // TALK_BASE_JSON_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/latebindingsymboltable.h b/thirdparties/common/include/webrtc-sdk/talk/base/latebindingsymboltable.h deleted file mode 100755 index 683086d..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/latebindingsymboltable.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_BASE_LATEBINDINGSYMBOLTABLE_H_ -#define TALK_BASE_LATEBINDINGSYMBOLTABLE_H_ - -#include - -#include "talk/base/common.h" - -namespace talk_base { - -#ifdef POSIX -typedef void *DllHandle; -#else -#error Not implemented for this platform -#endif - -// This is the base class for "symbol table" classes to simplify the dynamic -// loading of symbols from DLLs. Currently the implementation only supports -// Linux and OS X, and pure C symbols (or extern "C" symbols that wrap C++ -// functions). Sub-classes for specific DLLs are generated via the "supermacro" -// files latebindingsymboltable.h.def and latebindingsymboltable.cc.def. See -// talk/sound/pulseaudiosymboltable.(h|cc) for an example. -class LateBindingSymbolTable { - public: - struct TableInfo { - const char *dll_name; - int num_symbols; - // Array of size num_symbols. - const char *const *symbol_names; - }; - - LateBindingSymbolTable(const TableInfo *info, void **table); - ~LateBindingSymbolTable(); - - bool IsLoaded() const; - // Loads the DLL and the symbol table. Returns true iff the DLL and symbol - // table loaded successfully. - bool Load(); - // Like load, but allows overriding the dll path for when the dll path is - // dynamic. - bool LoadFromPath(const char *dll_path); - void Unload(); - - // Gets the raw OS handle to the DLL. Be careful what you do with it. - DllHandle GetDllHandle() const { return handle_; } - - private: - void ClearSymbols(); - - const TableInfo *info_; - void **table_; - DllHandle handle_; - bool undefined_symbols_; - - DISALLOW_COPY_AND_ASSIGN(LateBindingSymbolTable); -}; - -} // namespace talk_base - -#endif // TALK_BASE_LATEBINDINGSYMBOLTABLE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/libdbusglibsymboltable.h b/thirdparties/common/include/webrtc-sdk/talk/base/libdbusglibsymboltable.h deleted file mode 100755 index 5bc79f4..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/libdbusglibsymboltable.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * libjingle - * Copyright 2004--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_BASE_LIBDBUSGLIBSYMBOLTABLE_H_ -#define TALK_BASE_LIBDBUSGLIBSYMBOLTABLE_H_ - -#ifdef HAVE_DBUS_GLIB - -#include -#include - -#include "talk/base/latebindingsymboltable.h" - -namespace talk_base { - -#define LIBDBUS_GLIB_CLASS_NAME LibDBusGlibSymbolTable -// The libdbus-glib symbols we need, as an X-Macro list. -// This list must contain precisely every libdbus-glib function that is used in -// dbus.cc. -#define LIBDBUS_GLIB_SYMBOLS_LIST \ - X(dbus_bus_add_match) \ - X(dbus_connection_add_filter) \ - X(dbus_connection_close) \ - X(dbus_connection_remove_filter) \ - X(dbus_connection_set_exit_on_disconnect) \ - X(dbus_g_bus_get) \ - X(dbus_g_bus_get_private) \ - X(dbus_g_connection_get_connection) \ - X(dbus_g_connection_unref) \ - X(dbus_g_thread_init) \ - X(dbus_message_get_interface) \ - X(dbus_message_get_member) \ - X(dbus_message_get_path) \ - X(dbus_message_get_type) \ - X(dbus_message_iter_get_arg_type) \ - X(dbus_message_iter_get_basic) \ - X(dbus_message_iter_init) \ - X(dbus_message_ref) \ - X(dbus_message_unref) - -#define LATE_BINDING_SYMBOL_TABLE_CLASS_NAME LIBDBUS_GLIB_CLASS_NAME -#define LATE_BINDING_SYMBOL_TABLE_SYMBOLS_LIST LIBDBUS_GLIB_SYMBOLS_LIST -#include "talk/base/latebindingsymboltable.h.def" - -} // namespace talk_base - -#endif // HAVE_DBUS_GLIB - -#endif // TALK_BASE_LIBDBUSGLIBSYMBOLTABLE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/linked_ptr.h b/thirdparties/common/include/webrtc-sdk/talk/base/linked_ptr.h deleted file mode 100755 index a163a2a..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/linked_ptr.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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. - */ - -/* - * linked_ptr - simple reference linked pointer - * (like reference counting, just using a linked list of the references - * instead of their count.) - * - * The implementation stores three pointers for every linked_ptr, but - * does not allocate anything on the free store. - */ - -#ifndef TALK_BASE_LINKED_PTR_H__ -#define TALK_BASE_LINKED_PTR_H__ - -namespace talk_base { - -/* For ANSI-challenged compilers, you may want to #define - * NO_MEMBER_TEMPLATES, explicit or mutable */ -#define NO_MEMBER_TEMPLATES - -template class linked_ptr -{ -public: - -#ifndef NO_MEMBER_TEMPLATES -# define TEMPLATE_FUNCTION template - TEMPLATE_FUNCTION friend class linked_ptr; -#else -# define TEMPLATE_FUNCTION - typedef X Y; -#endif - - typedef X element_type; - - explicit linked_ptr(X* p = 0) throw() - : itsPtr(p) {itsPrev = itsNext = this;} - ~linked_ptr() - {release();} - linked_ptr(const linked_ptr& r) throw() - {acquire(r);} - linked_ptr& operator=(const linked_ptr& r) - { - if (this != &r) { - release(); - acquire(r); - } - return *this; - } - -#ifndef NO_MEMBER_TEMPLATES - template friend class linked_ptr; - template linked_ptr(const linked_ptr& r) throw() - {acquire(r);} - template linked_ptr& operator=(const linked_ptr& r) - { - if (this != &r) { - release(); - acquire(r); - } - return *this; - } -#endif // NO_MEMBER_TEMPLATES - - X& operator*() const throw() {return *itsPtr;} - X* operator->() const throw() {return itsPtr;} - X* get() const throw() {return itsPtr;} - bool unique() const throw() {return itsPrev ? itsPrev==this : true;} - -private: - X* itsPtr; - mutable const linked_ptr* itsPrev; - mutable const linked_ptr* itsNext; - - void acquire(const linked_ptr& r) throw() - { // insert this to the list - itsPtr = r.itsPtr; - itsNext = r.itsNext; - itsNext->itsPrev = this; - itsPrev = &r; -#ifndef mutable - r.itsNext = this; -#else // for ANSI-challenged compilers - (const_cast*>(&r))->itsNext = this; -#endif - } - -#ifndef NO_MEMBER_TEMPLATES - template void acquire(const linked_ptr& r) throw() - { // insert this to the list - itsPtr = r.itsPtr; - itsNext = r.itsNext; - itsNext->itsPrev = this; - itsPrev = &r; -#ifndef mutable - r.itsNext = this; -#else // for ANSI-challenged compilers - (const_cast*>(&r))->itsNext = this; -#endif - } -#endif // NO_MEMBER_TEMPLATES - - void release() - { // erase this from the list, delete if unique - if (unique()) delete itsPtr; - else { - itsPrev->itsNext = itsNext; - itsNext->itsPrev = itsPrev; - itsPrev = itsNext = 0; - } - itsPtr = 0; - } -}; - -} // namespace talk_base - -#endif // TALK_BASE_LINKED_PTR_H__ - diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/linux.h b/thirdparties/common/include/webrtc-sdk/talk/base/linux.h deleted file mode 100755 index a80b29e..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/linux.h +++ /dev/null @@ -1,140 +0,0 @@ -/* - * libjingle - * Copyright 2008, 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_BASE_LINUX_H_ -#define TALK_BASE_LINUX_H_ - -#if defined(LINUX) || defined(ANDROID) -#include -#include -#include - -#include "talk/base/scoped_ptr.h" -#include "talk/base/stream.h" - -namespace talk_base { - -////////////////////////////////////////////////////////////////////////////// -// ConfigParser parses a FileStream of an ".ini."-type format into a map. -////////////////////////////////////////////////////////////////////////////// - -// Sample Usage: -// ConfigParser parser; -// ConfigParser::MapVector key_val_pairs; -// if (parser.Open(inifile) && parser.Parse(&key_val_pairs)) { -// for (int section_num=0; i < key_val_pairs.size(); ++section_num) { -// std::string val1 = key_val_pairs[section_num][key1]; -// std::string val2 = key_val_pairs[section_num][key2]; -// // Do something with valn; -// } -// } - -class ConfigParser { - public: - typedef std::map SimpleMap; - typedef std::vector MapVector; - - ConfigParser(); - virtual ~ConfigParser(); - - virtual bool Open(const std::string& filename); - virtual void Attach(StreamInterface* stream); - virtual bool Parse(MapVector* key_val_pairs); - virtual bool ParseSection(SimpleMap* key_val_pair); - virtual bool ParseLine(std::string* key, std::string* value); - - private: - scoped_ptr instream_; -}; - -////////////////////////////////////////////////////////////////////////////// -// ProcCpuInfo reads CPU info from the /proc subsystem on any *NIX platform. -////////////////////////////////////////////////////////////////////////////// - -// Sample Usage: -// ProcCpuInfo proc_info; -// int no_of_cpu; -// if (proc_info.LoadFromSystem()) { -// std::string out_str; -// proc_info.GetNumCpus(&no_of_cpu); -// proc_info.GetCpuStringValue(0, "vendor_id", &out_str); -// } -// } - -class ProcCpuInfo { - public: - ProcCpuInfo(); - virtual ~ProcCpuInfo(); - - // Reads the proc subsystem's cpu info into memory. If this fails, this - // returns false; if it succeeds, it returns true. - virtual bool LoadFromSystem(); - - // Obtains the number of logical CPU threads and places the value num. - virtual bool GetNumCpus(int* num); - - // Obtains the number of physical CPU cores and places the value num. - virtual bool GetNumPhysicalCpus(int* num); - - // Obtains the CPU family id. - virtual bool GetCpuFamily(int* id); - - // Obtains the number of sections in /proc/cpuinfo, which may be greater - // than the number of CPUs (e.g. on ARM) - virtual bool GetSectionCount(size_t* count); - - // Looks for the CPU proc item with the given name for the given section - // number and places the string value in result. - virtual bool GetSectionStringValue(size_t section_num, const std::string& key, - std::string* result); - - // Looks for the CPU proc item with the given name for the given section - // number and places the int value in result. - virtual bool GetSectionIntValue(size_t section_num, const std::string& key, - int* result); - - private: - ConfigParser::MapVector sections_; -}; - -#if !defined(GOOGLE_CHROME_BUILD) && !defined(CHROMIUM_BUILD) -// Builds a string containing the info from lsb_release on a single line. -std::string ReadLinuxLsbRelease(); -#endif - -// Returns the output of "uname". -std::string ReadLinuxUname(); - -// Returns the content (int) of -// /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq -// Returns -1 on error. -int ReadCpuMaxFreq(); - -} // namespace talk_base - -#endif // defined(LINUX) || defined(ANDROID) -#endif // TALK_BASE_LINUX_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/linuxfdwalk.h b/thirdparties/common/include/webrtc-sdk/talk/base/linuxfdwalk.h deleted file mode 100755 index 29f04db..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/linuxfdwalk.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * libjingle - * Copyright 2004--2009, 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_BASE_LINUXFDWALK_H_ -#define TALK_BASE_LINUXFDWALK_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -// Linux port of SunOS's fdwalk(3) call. It loops over all open file descriptors -// and calls func on each one. Additionally, it is safe to use from the child -// of a fork that hasn't exec'ed yet, so you can use it to close all open file -// descriptors prior to exec'ing a daemon. -// The return value is 0 if successful, or else -1 and errno is set. The -// possible errors include any error that can be returned by opendir(), -// readdir(), or closedir(), plus EBADF if there are problems parsing the -// contents of /proc/self/fd. -// The file descriptors that are enumerated will not include the file descriptor -// used for the enumeration itself. -int fdwalk(void (*func)(void *, int), void *opaque); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // TALK_BASE_LINUXFDWALK_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/linuxwindowpicker.h b/thirdparties/common/include/webrtc-sdk/talk/base/linuxwindowpicker.h deleted file mode 100755 index f0156ea..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/linuxwindowpicker.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * libjingle - * Copyright 2010 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_BASE_LINUXWINDOWPICKER_H_ -#define TALK_BASE_LINUXWINDOWPICKER_H_ - -#include "talk/base/basictypes.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/windowpicker.h" - -// Avoid include . -struct _XDisplay; -typedef unsigned long Window; - -namespace talk_base { - -class XWindowEnumerator; - -class LinuxWindowPicker : public WindowPicker { - public: - LinuxWindowPicker(); - ~LinuxWindowPicker(); - - static bool IsDesktopElement(_XDisplay* display, Window window); - - virtual bool Init(); - virtual bool IsVisible(const WindowId& id); - virtual bool MoveToFront(const WindowId& id); - virtual bool GetWindowList(WindowDescriptionList* descriptions); - virtual bool GetDesktopList(DesktopDescriptionList* descriptions); - virtual bool GetDesktopDimensions(const DesktopId& id, int* width, - int* height); - uint8* GetWindowIcon(const WindowId& id, int* width, int* height); - uint8* GetWindowThumbnail(const WindowId& id, int width, int height); - int GetNumDesktops(); - uint8* GetDesktopThumbnail(const DesktopId& id, int width, int height); - - private: - scoped_ptr enumerator_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_LINUXWINDOWPICKER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/logging.h b/thirdparties/common/include/webrtc-sdk/talk/base/logging.h deleted file mode 100755 index 2f56982..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/logging.h +++ /dev/null @@ -1,404 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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. - */ - -// LOG(...) an ostream target that can be used to send formatted -// output to a variety of logging targets, such as debugger console, stderr, -// file, or any StreamInterface. -// The severity level passed as the first argument to the LOGging -// functions is used as a filter, to limit the verbosity of the logging. -// Static members of LogMessage documented below are used to control the -// verbosity and target of the output. -// There are several variations on the LOG macro which facilitate logging -// of common error conditions, detailed below. - -// LOG(sev) logs the given stream at severity "sev", which must be a -// compile-time constant of the LoggingSeverity type, without the namespace -// prefix. -// LOG_V(sev) Like LOG(), but sev is a run-time variable of the LoggingSeverity -// type (basically, it just doesn't prepend the namespace). -// LOG_F(sev) Like LOG(), but includes the name of the current function. -// LOG_T(sev) Like LOG(), but includes the this pointer. -// LOG_T_F(sev) Like LOG_F(), but includes the this pointer. -// LOG_GLE(M)(sev [, mod]) attempt to add a string description of the -// HRESULT returned by GetLastError. The "M" variant allows searching of a -// DLL's string table for the error description. -// LOG_ERRNO(sev) attempts to add a string description of an errno-derived -// error. errno and associated facilities exist on both Windows and POSIX, -// but on Windows they only apply to the C/C++ runtime. -// LOG_ERR(sev) is an alias for the platform's normal error system, i.e. _GLE on -// Windows and _ERRNO on POSIX. -// (The above three also all have _EX versions that let you specify the error -// code, rather than using the last one.) -// LOG_E(sev, ctx, err, ...) logs a detailed error interpreted using the -// specified context. -// LOG_CHECK_LEVEL(sev) (and LOG_CHECK_LEVEL_V(sev)) can be used as a test -// before performing expensive or sensitive operations whose sole purpose is -// to output logging data at the desired level. -// Lastly, PLOG(sev, err) is an alias for LOG_ERR_EX. - -#ifndef TALK_BASE_LOGGING_H_ -#define TALK_BASE_LOGGING_H_ - -#ifdef HAVE_CONFIG_H -#include "config.h" // NOLINT -#endif - -#include -#include -#include -#include -#include "talk/base/basictypes.h" -#include "talk/base/criticalsection.h" - -namespace talk_base { - -class StreamInterface; - -/////////////////////////////////////////////////////////////////////////////// -// ConstantLabel can be used to easily generate string names from constant -// values. This can be useful for logging descriptive names of error messages. -// Usage: -// const ConstantLabel LIBRARY_ERRORS[] = { -// KLABEL(SOME_ERROR), -// KLABEL(SOME_OTHER_ERROR), -// ... -// LASTLABEL -// } -// -// int err = LibraryFunc(); -// LOG(LS_ERROR) << "LibraryFunc returned: " -// << ErrorName(err, LIBRARY_ERRORS); - -struct ConstantLabel { int value; const char * label; }; -#define KLABEL(x) { x, #x } -#define TLABEL(x, y) { x, y } -#define LASTLABEL { 0, 0 } - -const char * FindLabel(int value, const ConstantLabel entries[]); -std::string ErrorName(int err, const ConstantLabel* err_table); - -////////////////////////////////////////////////////////////////////// - -// Note that the non-standard LoggingSeverity aliases exist because they are -// still in broad use. The meanings of the levels are: -// LS_SENSITIVE: Information which should only be logged with the consent -// of the user, due to privacy concerns. -// LS_VERBOSE: This level is for data which we do not want to appear in the -// normal debug log, but should appear in diagnostic logs. -// LS_INFO: Chatty level used in debugging for all sorts of things, the default -// in debug builds. -// LS_WARNING: Something that may warrant investigation. -// LS_ERROR: Something that should not have occurred. -enum LoggingSeverity { LS_SENSITIVE, LS_VERBOSE, LS_INFO, LS_WARNING, LS_ERROR, - INFO = LS_INFO, - WARNING = LS_WARNING, - LERROR = LS_ERROR }; - -// LogErrorContext assists in interpreting the meaning of an error value. -enum LogErrorContext { - ERRCTX_NONE, - ERRCTX_ERRNO, // System-local errno - ERRCTX_HRESULT, // Windows HRESULT - ERRCTX_OSSTATUS, // MacOS OSStatus - - // Abbreviations for LOG_E macro - ERRCTX_EN = ERRCTX_ERRNO, // LOG_E(sev, EN, x) - ERRCTX_HR = ERRCTX_HRESULT, // LOG_E(sev, HR, x) - ERRCTX_OS = ERRCTX_OSSTATUS, // LOG_E(sev, OS, x) -}; - -class LogMessage { - public: - static const int NO_LOGGING; - static const uint32 WARN_SLOW_LOGS_DELAY = 50; // ms - - LogMessage(const char* file, int line, LoggingSeverity sev, - LogErrorContext err_ctx = ERRCTX_NONE, int err = 0, - const char* module = NULL); - ~LogMessage(); - - static inline bool Loggable(LoggingSeverity sev) { return (sev >= min_sev_); } - std::ostream& stream() { return print_stream_; } - - // Returns the time at which this function was called for the first time. - // The time will be used as the logging start time. - // If this is not called externally, the LogMessage ctor also calls it, in - // which case the logging start time will be the time of the first LogMessage - // instance is created. - static uint32 LogStartTime(); - - // Returns the wall clock equivalent of |LogStartTime|, in seconds from the - // epoch. - static uint32 WallClockStartTime(); - - // These are attributes which apply to all logging channels - // LogContext: Display the file and line number of the message - static void LogContext(int min_sev); - // LogThreads: Display the thread identifier of the current thread - static void LogThreads(bool on = true); - // LogTimestamps: Display the elapsed time of the program - static void LogTimestamps(bool on = true); - - // These are the available logging channels - // Debug: Debug console on Windows, otherwise stderr - static void LogToDebug(int min_sev); - static int GetLogToDebug() { return dbg_sev_; } - - // Stream: Any non-blocking stream interface. LogMessage takes ownership of - // the stream. Multiple streams may be specified by using AddLogToStream. - // LogToStream is retained for backwards compatibility; when invoked, it - // will discard any previously set streams and install the specified stream. - // GetLogToStream gets the severity for the specified stream, of if none - // is specified, the minimum stream severity. - // RemoveLogToStream removes the specified stream, without destroying it. - static void LogToStream(StreamInterface* stream, int min_sev); - static int GetLogToStream(StreamInterface* stream = NULL); - static void AddLogToStream(StreamInterface* stream, int min_sev); - static void RemoveLogToStream(StreamInterface* stream); - - // Testing against MinLogSeverity allows code to avoid potentially expensive - // logging operations by pre-checking the logging level. - static int GetMinLogSeverity() { return min_sev_; } - - static void SetDiagnosticMode(bool f) { is_diagnostic_mode_ = f; } - static bool IsDiagnosticMode() { return is_diagnostic_mode_; } - - // Parses the provided parameter stream to configure the options above. - // Useful for configuring logging from the command line. If file logging - // is enabled, it is output to the specified filename. - static void ConfigureLogging(const char* params, const char* filename); - - // Convert the string to a LS_ value; also accept numeric values. - static int ParseLogSeverity(const std::string& value); - - private: - typedef std::list > StreamList; - - // Updates min_sev_ appropriately when debug sinks change. - static void UpdateMinLogSeverity(); - - // These assist in formatting some parts of the debug output. - static const char* Describe(LoggingSeverity sev); - static const char* DescribeFile(const char* file); - - // These write out the actual log messages. - static void OutputToDebug(const std::string& msg, LoggingSeverity severity_); - static void OutputToStream(StreamInterface* stream, const std::string& msg); - - // The ostream that buffers the formatted message before output - std::ostringstream print_stream_; - - // The severity level of this message - LoggingSeverity severity_; - - // String data generated in the constructor, that should be appended to - // the message before output. - std::string extra_; - - // If time it takes to write to stream is more than this, log one - // additional warning about it. - uint32 warn_slow_logs_delay_; - - // Global lock for the logging subsystem - static CriticalSection crit_; - - // dbg_sev_ is the thresholds for those output targets - // min_sev_ is the minimum (most verbose) of those levels, and is used - // as a short-circuit in the logging macros to identify messages that won't - // be logged. - // ctx_sev_ is the minimum level at which file context is displayed - static int min_sev_, dbg_sev_, ctx_sev_; - - // The output streams and their associated severities - static StreamList streams_; - - // Flags for formatting options - static bool thread_, timestamp_; - - // are we in diagnostic mode (as defined by the app)? - static bool is_diagnostic_mode_; - - DISALLOW_EVIL_CONSTRUCTORS(LogMessage); -}; - -////////////////////////////////////////////////////////////////////// -// Logging Helpers -////////////////////////////////////////////////////////////////////// - -class LogMultilineState { - public: - size_t unprintable_count_[2]; - LogMultilineState() { - unprintable_count_[0] = unprintable_count_[1] = 0; - } -}; - -// When possible, pass optional state variable to track various data across -// multiple calls to LogMultiline. Otherwise, pass NULL. -void LogMultiline(LoggingSeverity level, const char* label, bool input, - const void* data, size_t len, bool hex_mode, - LogMultilineState* state); - -////////////////////////////////////////////////////////////////////// -// Macros which automatically disable logging when LOGGING == 0 -////////////////////////////////////////////////////////////////////// - -// If LOGGING is not explicitly defined, default to enabled in debug mode -#if !defined(LOGGING) -#if defined(_DEBUG) && !defined(NDEBUG) -#define LOGGING 1 -#else -#define LOGGING 0 -#endif -#endif // !defined(LOGGING) - -#ifndef LOG -#if LOGGING - -// The following non-obvious technique for implementation of a -// conditional log stream was stolen from google3/base/logging.h. - -// This class is used to explicitly ignore values in the conditional -// logging macros. This avoids compiler warnings like "value computed -// is not used" and "statement has no effect". - -class LogMessageVoidify { - public: - LogMessageVoidify() { } - // This has to be an operator with a precedence lower than << but - // higher than ?: - void operator&(std::ostream&) { } -}; - -#define LOG_SEVERITY_PRECONDITION(sev) \ - !(talk_base::LogMessage::Loggable(sev)) \ - ? (void) 0 \ - : talk_base::LogMessageVoidify() & - -#define LOG(sev) \ - LOG_SEVERITY_PRECONDITION(talk_base::sev) \ - talk_base::LogMessage(__FILE__, __LINE__, talk_base::sev).stream() - -// The _V version is for when a variable is passed in. It doesn't do the -// namespace concatination. -#define LOG_V(sev) \ - LOG_SEVERITY_PRECONDITION(sev) \ - talk_base::LogMessage(__FILE__, __LINE__, sev).stream() - -// The _F version prefixes the message with the current function name. -#if (defined(__GNUC__) && defined(_DEBUG)) || defined(WANT_PRETTY_LOG_F) -#define LOG_F(sev) LOG(sev) << __PRETTY_FUNCTION__ << ": " -#define LOG_T_F(sev) LOG(sev) << this << ": " << __PRETTY_FUNCTION__ << ": " -#else -#define LOG_F(sev) LOG(sev) << __FUNCTION__ << ": " -#define LOG_T_F(sev) LOG(sev) << this << ": " << __FUNCTION__ << ": " -#endif - -#define LOG_CHECK_LEVEL(sev) \ - talk_base::LogCheckLevel(talk_base::sev) -#define LOG_CHECK_LEVEL_V(sev) \ - talk_base::LogCheckLevel(sev) -inline bool LogCheckLevel(LoggingSeverity sev) { - return (LogMessage::GetMinLogSeverity() <= sev); -} - -#define LOG_E(sev, ctx, err, ...) \ - LOG_SEVERITY_PRECONDITION(talk_base::sev) \ - talk_base::LogMessage(__FILE__, __LINE__, talk_base::sev, \ - talk_base::ERRCTX_ ## ctx, err , ##__VA_ARGS__) \ - .stream() - -#define LOG_T(sev) LOG(sev) << this << ": " - -#else // !LOGGING - -// Hopefully, the compiler will optimize away some of this code. -// Note: syntax of "1 ? (void)0 : LogMessage" was causing errors in g++, -// converted to "while (false)" -#define LOG(sev) \ - while (false)talk_base:: LogMessage(NULL, 0, talk_base::sev).stream() -#define LOG_V(sev) \ - while (false) talk_base::LogMessage(NULL, 0, sev).stream() -#define LOG_F(sev) LOG(sev) << __FUNCTION__ << ": " -#define LOG_CHECK_LEVEL(sev) \ - false -#define LOG_CHECK_LEVEL_V(sev) \ - false - -#define LOG_E(sev, ctx, err, ...) \ - while (false) talk_base::LogMessage(__FILE__, __LINE__, talk_base::sev, \ - talk_base::ERRCTX_ ## ctx, err , ##__VA_ARGS__) \ - .stream() - -#define LOG_T(sev) LOG(sev) << this << ": " -#define LOG_T_F(sev) LOG(sev) << this << ": " << __FUNCTION__ << -#endif // !LOGGING - -#define LOG_ERRNO_EX(sev, err) \ - LOG_E(sev, ERRNO, err) -#define LOG_ERRNO(sev) \ - LOG_ERRNO_EX(sev, errno) - -#ifdef WIN32 -#define LOG_GLE_EX(sev, err) \ - LOG_E(sev, HRESULT, err) -#define LOG_GLE(sev) \ - LOG_GLE_EX(sev, GetLastError()) -#define LOG_GLEM(sev, mod) \ - LOG_E(sev, HRESULT, GetLastError(), mod) -#define LOG_ERR_EX(sev, err) \ - LOG_GLE_EX(sev, err) -#define LOG_ERR(sev) \ - LOG_GLE(sev) -#define LAST_SYSTEM_ERROR \ - (::GetLastError()) -#elif __native_client__ -#define LOG_ERR_EX(sev, err) \ - LOG(sev) -#define LOG_ERR(sev) \ - LOG(sev) -#define LAST_SYSTEM_ERROR \ - (0) -#elif POSIX -#define LOG_ERR_EX(sev, err) \ - LOG_ERRNO_EX(sev, err) -#define LOG_ERR(sev) \ - LOG_ERRNO(sev) -#define LAST_SYSTEM_ERROR \ - (errno) -#endif // WIN32 - -#define PLOG(sev, err) \ - LOG_ERR_EX(sev, err) - -// TODO(?): Add an "assert" wrapper that logs in the same manner. - -#endif // LOG - -} // namespace talk_base - -#endif // TALK_BASE_LOGGING_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/macasyncsocket.h b/thirdparties/common/include/webrtc-sdk/talk/base/macasyncsocket.h deleted file mode 100755 index 72fddf6..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/macasyncsocket.h +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2008 Google Inc. All Rights Reserved. - -// -// MacAsyncSocket is a kind of AsyncSocket. It only creates sockets -// of the TCP type, and does not (yet) support listen and accept. It works -// asynchronously, which means that users of this socket should connect to -// the various events declared in asyncsocket.h to receive notifications about -// this socket. - -#ifndef TALK_BASE_MACASYNCSOCKET_H__ -#define TALK_BASE_MACASYNCSOCKET_H__ - -#include - -#include "talk/base/asyncsocket.h" -#include "talk/base/nethelpers.h" - -namespace talk_base { - -class MacBaseSocketServer; - -class MacAsyncSocket : public AsyncSocket, public sigslot::has_slots<> { - public: - MacAsyncSocket(MacBaseSocketServer* ss, int family); - virtual ~MacAsyncSocket(); - - bool valid() const { return source_ != NULL; } - - // Socket interface - virtual SocketAddress GetLocalAddress() const; - virtual SocketAddress GetRemoteAddress() const; - virtual int Bind(const SocketAddress& addr); - virtual int Connect(const SocketAddress& addr); - virtual int Send(const void* buffer, size_t length); - virtual int SendTo(const void* buffer, size_t length, - const SocketAddress& addr); - virtual int Recv(void* buffer, size_t length); - virtual int RecvFrom(void* buffer, size_t length, SocketAddress* out_addr); - virtual int Listen(int backlog); - virtual MacAsyncSocket* Accept(SocketAddress* out_addr); - virtual int Close(); - virtual int GetError() const; - virtual void SetError(int error); - virtual ConnState GetState() const; - virtual int EstimateMTU(uint16* mtu); - virtual int GetOption(Option opt, int* value); - virtual int SetOption(Option opt, int value); - - // For the MacBaseSocketServer to disable callbacks when process_io is false. - void EnableCallbacks(); - void DisableCallbacks(); - - protected: - void OnResolveResult(SignalThread* thread); - int DoConnect(const SocketAddress& addr); - - private: - // Creates an async socket from an existing bsd socket - MacAsyncSocket(MacBaseSocketServer* ss, int family, int native_socket); - - // Attaches the socket to the CFRunloop and sets the wrapped bsd socket - // to async mode - void Initialize(int family); - - // Translate the SocketAddress into a CFDataRef to pass to CF socket - // functions. Caller must call CFRelease on the result when done. - static CFDataRef CopyCFAddress(const SocketAddress& address); - - // Callback for the underlying CFSocketRef. - static void MacAsyncSocketCallBack(CFSocketRef s, - CFSocketCallBackType callbackType, - CFDataRef address, - const void* data, - void* info); - - MacBaseSocketServer* ss_; - CFSocketRef socket_; - int native_socket_; - CFRunLoopSourceRef source_; - int current_callbacks_; - bool disabled_; - int error_; - ConnState state_; - AsyncResolver* resolver_; - - DISALLOW_EVIL_CONSTRUCTORS(MacAsyncSocket); -}; - -} // namespace talk_base - -#endif // TALK_BASE_MACASYNCSOCKET_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/maccocoasocketserver.h b/thirdparties/common/include/webrtc-sdk/talk/base/maccocoasocketserver.h deleted file mode 100755 index b629e8c..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/maccocoasocketserver.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * libjingle - * Copyright 2007, 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. - */ - -// A libjingle compatible SocketServer for OSX/iOS/Cocoa. - -#ifndef TALK_BASE_MACCOCOASOCKETSERVER_H_ -#define TALK_BASE_MACCOCOASOCKETSERVER_H_ - -#include "talk/base/macsocketserver.h" - -#ifdef __OBJC__ -@class NSTimer, MacCocoaSocketServerHelper; -#else -class NSTimer; -class MacCocoaSocketServerHelper; -#endif - -namespace talk_base { - -// A socketserver implementation that wraps the main cocoa -// application loop accessed through [NSApp run]. -class MacCocoaSocketServer : public MacBaseSocketServer { - public: - explicit MacCocoaSocketServer(); - virtual ~MacCocoaSocketServer(); - - virtual bool Wait(int cms, bool process_io); - virtual void WakeUp(); - - private: - MacCocoaSocketServerHelper* helper_; - NSTimer* timer_; // Weak. - // The count of how many times we're inside the NSApplication main loop. - int run_count_; - - DISALLOW_EVIL_CONSTRUCTORS(MacCocoaSocketServer); -}; - -} // namespace talk_base - -#endif // TALK_BASE_MACCOCOASOCKETSERVER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/maccocoathreadhelper.h b/thirdparties/common/include/webrtc-sdk/talk/base/maccocoathreadhelper.h deleted file mode 100755 index fed168a..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/maccocoathreadhelper.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * libjingle - * Copyright 2008 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. - */ - -// Helper function for using Cocoa with Posix threads. This header should be -// included from C/C++ files that want to use some Cocoa functionality without -// using the .mm extension (mostly for files that are compiled on multiple -// platforms). - -#ifndef TALK_BASE_MACCOCOATHREADHELPER_H__ -#define TALK_BASE_MACCOCOATHREADHELPER_H__ - -namespace talk_base { - -// Cocoa must be "put into multithreading mode" before Cocoa functionality can -// be used on POSIX threads. This function does that. -void InitCocoaMultiThreading(); - -} // namespace talk_base - -#endif // TALK_BASE_MACCOCOATHREADHELPER_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/macconversion.h b/thirdparties/common/include/webrtc-sdk/talk/base/macconversion.h deleted file mode 100755 index c63beb6..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/macconversion.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * libjingle - * Copyright 2004--2009, 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_BASE_MACCONVERSION_H_ -#define TALK_BASE_MACCONVERSION_H_ - -#ifdef OSX - -#include - -#include - -// given a CFStringRef, attempt to convert it to a C++ string. -// returns true if it succeeds, false otherwise. -// We can safely assume, given our context, that the string is -// going to be in ASCII, because it will either be an IP address, -// or a domain name, which is guaranteed to be ASCII-representable. -bool p_convertHostCFStringRefToCPPString(const CFStringRef cfstr, - std::string& cppstr); - -// Convert the CFNumber to an integer, putting the integer in the location -// given, and returhing true, if the conversion succeeds. -// If given a NULL or a non-CFNumber, returns false. -// This is pretty aggresive about trying to convert to int. -bool p_convertCFNumberToInt(CFNumberRef cfn, int* i); - -// given a CFNumberRef, determine if it represents a true value. -bool p_isCFNumberTrue(CFNumberRef cfn); - -#endif // OSX - -#endif // TALK_BASE_MACCONVERSION_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/macsocketserver.h b/thirdparties/common/include/webrtc-sdk/talk/base/macsocketserver.h deleted file mode 100755 index f24e687..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/macsocketserver.h +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright 2007, Google Inc. - - -#ifndef TALK_BASE_MACSOCKETSERVER_H__ -#define TALK_BASE_MACSOCKETSERVER_H__ - -#include -#ifdef OSX // Invalid on IOS -#include -#endif -#include "talk/base/physicalsocketserver.h" - -namespace talk_base { - -/////////////////////////////////////////////////////////////////////////////// -// MacBaseSocketServer -/////////////////////////////////////////////////////////////////////////////// -class MacAsyncSocket; - -class MacBaseSocketServer : public PhysicalSocketServer { - public: - MacBaseSocketServer(); - virtual ~MacBaseSocketServer(); - - // SocketServer Interface - virtual Socket* CreateSocket(int type) { return NULL; } - virtual Socket* CreateSocket(int family, int type) { return NULL; } - - virtual AsyncSocket* CreateAsyncSocket(int type); - virtual AsyncSocket* CreateAsyncSocket(int family, int type); - - virtual bool Wait(int cms, bool process_io) = 0; - virtual void WakeUp() = 0; - - void RegisterSocket(MacAsyncSocket* socket); - void UnregisterSocket(MacAsyncSocket* socket); - - // PhysicalSocketServer Overrides - virtual bool SetPosixSignalHandler(int signum, void (*handler)(int)); - - protected: - void EnableSocketCallbacks(bool enable); - const std::set& sockets() { - return sockets_; - } - - private: - static void FileDescriptorCallback(CFFileDescriptorRef ref, - CFOptionFlags flags, - void* context); - - std::set sockets_; -}; - -// Core Foundation implementation of the socket server. While idle it -// will run the current CF run loop. When the socket server has work -// to do the run loop will be paused. Does not support Carbon or Cocoa -// UI interaction. -class MacCFSocketServer : public MacBaseSocketServer { - public: - MacCFSocketServer(); - virtual ~MacCFSocketServer(); - - // SocketServer Interface - virtual bool Wait(int cms, bool process_io); - virtual void WakeUp(); - void OnWakeUpCallback(); - - private: - CFRunLoopRef run_loop_; - CFRunLoopSourceRef wake_up_; -}; - -#ifndef CARBON_DEPRECATED - -/////////////////////////////////////////////////////////////////////////////// -// MacCarbonSocketServer -/////////////////////////////////////////////////////////////////////////////// - -// Interacts with the Carbon event queue. While idle it will block, -// waiting for events. When the socket server has work to do, it will -// post a 'wake up' event to the queue, causing the thread to exit the -// event loop until the next call to Wait. Other events are dispatched -// to their target. Supports Carbon and Cocoa UI interaction. -class MacCarbonSocketServer : public MacBaseSocketServer { - public: - MacCarbonSocketServer(); - virtual ~MacCarbonSocketServer(); - - // SocketServer Interface - virtual bool Wait(int cms, bool process_io); - virtual void WakeUp(); - - private: - EventQueueRef event_queue_; - EventRef wake_up_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// MacCarbonAppSocketServer -/////////////////////////////////////////////////////////////////////////////// - -// Runs the Carbon application event loop on the current thread while -// idle. When the socket server has work to do, it will post an event -// to the queue, causing the thread to exit the event loop until the -// next call to Wait. Other events are automatically dispatched to -// their target. -class MacCarbonAppSocketServer : public MacBaseSocketServer { - public: - MacCarbonAppSocketServer(); - virtual ~MacCarbonAppSocketServer(); - - // SocketServer Interface - virtual bool Wait(int cms, bool process_io); - virtual void WakeUp(); - - private: - static OSStatus WakeUpEventHandler(EventHandlerCallRef next, EventRef event, - void *data); - static void TimerHandler(EventLoopTimerRef timer, void *data); - - EventQueueRef event_queue_; - EventHandlerRef event_handler_; - EventLoopTimerRef timer_; -}; - -#endif -} // namespace talk_base - -#endif // TALK_BASE_MACSOCKETSERVER_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/macutils.h b/thirdparties/common/include/webrtc-sdk/talk/base/macutils.h deleted file mode 100755 index 71fc40e..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/macutils.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * libjingle - * Copyright 2007 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_BASE_MACUTILS_H__ -#define TALK_BASE_MACUTILS_H__ - -#include -#ifdef OSX -#include -#endif -#include - -namespace talk_base { - -/////////////////////////////////////////////////////////////////////////////// - -// Note that some of these functions work for both iOS and Mac OS X. The ones -// that are specific to Mac are #ifdef'ed as such. - -bool ToUtf8(const CFStringRef str16, std::string* str8); -bool ToUtf16(const std::string& str8, CFStringRef* str16); - -#ifdef OSX -void DecodeFourChar(UInt32 fc, std::string* out); - -enum MacOSVersionName { - kMacOSUnknown, // ??? - kMacOSOlder, // 10.2- - kMacOSPanther, // 10.3 - kMacOSTiger, // 10.4 - kMacOSLeopard, // 10.5 - kMacOSSnowLeopard, // 10.6 - kMacOSLion, // 10.7 - kMacOSMountainLion, // 10.8 - kMacOSMavericks, // 10.9 - kMacOSNewer, // 10.10+ -}; - -bool GetOSVersion(int* major, int* minor, int* bugfix); -MacOSVersionName GetOSVersionName(); -bool GetQuickTimeVersion(std::string* version); - -// Runs the given apple script. Only supports scripts that does not -// require user interaction. -bool RunAppleScript(const std::string& script); -#endif - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace talk_base - -#endif // TALK_BASE_MACUTILS_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/macwindowpicker.h b/thirdparties/common/include/webrtc-sdk/talk/base/macwindowpicker.h deleted file mode 100755 index 475d7d3..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/macwindowpicker.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved - - -#ifndef TALK_BASE_MACWINDOWPICKER_H_ -#define TALK_BASE_MACWINDOWPICKER_H_ - -#include "talk/base/windowpicker.h" - -namespace talk_base { - -class MacWindowPicker : public WindowPicker { - public: - MacWindowPicker(); - ~MacWindowPicker(); - virtual bool Init(); - virtual bool IsVisible(const WindowId& id); - virtual bool MoveToFront(const WindowId& id); - virtual bool GetWindowList(WindowDescriptionList* descriptions); - virtual bool GetDesktopList(DesktopDescriptionList* descriptions); - virtual bool GetDesktopDimensions(const DesktopId& id, int* width, - int* height); - - private: - void* lib_handle_; - void* get_window_list_; - void* get_window_list_desc_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_MACWINDOWPICKER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/mathutils.h b/thirdparties/common/include/webrtc-sdk/talk/base/mathutils.h deleted file mode 100755 index 437882a..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/mathutils.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * libjingle - * Copyright 2005 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_BASE_MATHUTILS_H_ -#define TALK_BASE_MATHUTILS_H_ - -#include - -#ifndef M_PI -#define M_PI 3.14159265359f -#endif - -#endif // TALK_BASE_MATHUTILS_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/md5.h b/thirdparties/common/include/webrtc-sdk/talk/base/md5.h deleted file mode 100755 index ce408ab..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/md5.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * This is the header file for the MD5 message-digest algorithm. - * The algorithm is due to Ron Rivest. This code was - * written by Colin Plumb in 1993, no copyright is claimed. - * This code is in the public domain; do with it what you wish. - * - * Equivalent code is available from RSA Data Security, Inc. - * This code has been tested against that, and is equivalent, - * except that you don't need to include two pages of legalese - * with every copy. - * To compute the message digest of a chunk of bytes, declare an - * MD5Context structure, pass it to MD5Init, call MD5Update as - * needed on buffers full of bytes, and then call MD5Final, which - * will fill a supplied 16-byte array with the digest. - * - */ - -// Changes(fbarchard): Ported to C++ and Google style guide. -// Made context first parameter in MD5Final for consistency with Sha1. - -#ifndef TALK_BASE_MD5_H_ -#define TALK_BASE_MD5_H_ - -#include "talk/base/basictypes.h" - -// Canonical name for a MD5 context structure, used in many crypto libs. -typedef struct MD5Context MD5_CTX; - -struct MD5Context { - uint32 buf[4]; - uint32 bits[2]; - uint32 in[16]; -}; - -void MD5Init(MD5Context* context); -void MD5Update(MD5Context* context, const uint8* data, size_t len); -void MD5Final(MD5Context* context, uint8 digest[16]); -void MD5Transform(uint32 buf[4], const uint32 in[16]); - -#endif // TALK_BASE_MD5_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/md5digest.h b/thirdparties/common/include/webrtc-sdk/talk/base/md5digest.h deleted file mode 100755 index fadb05c..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/md5digest.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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_BASE_MD5DIGEST_H_ -#define TALK_BASE_MD5DIGEST_H_ - -#include "talk/base/md5.h" -#include "talk/base/messagedigest.h" - -namespace talk_base { - -// A simple wrapper for our MD5 implementation. -class Md5Digest : public MessageDigest { - public: - enum { kSize = 16 }; - Md5Digest() { - MD5Init(&ctx_); - } - virtual size_t Size() const { - return kSize; - } - virtual void Update(const void* buf, size_t len) { - MD5Update(&ctx_, static_cast(buf), len); - } - virtual size_t Finish(void* buf, size_t len) { - if (len < kSize) { - return 0; - } - MD5Final(&ctx_, static_cast(buf)); - MD5Init(&ctx_); // Reset for next use. - return kSize; - } - private: - MD5_CTX ctx_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_MD5DIGEST_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/messagedigest.h b/thirdparties/common/include/webrtc-sdk/talk/base/messagedigest.h deleted file mode 100755 index e8e0f4f..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/messagedigest.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * libjingle - * Copyright 2004, 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_BASE_MESSAGEDIGEST_H_ -#define TALK_BASE_MESSAGEDIGEST_H_ - -#include - -namespace talk_base { - -// Definitions for the digest algorithms. -extern const char DIGEST_MD5[]; -extern const char DIGEST_SHA_1[]; -extern const char DIGEST_SHA_224[]; -extern const char DIGEST_SHA_256[]; -extern const char DIGEST_SHA_384[]; -extern const char DIGEST_SHA_512[]; - -// A general class for computing hashes. -class MessageDigest { - public: - enum { kMaxSize = 64 }; // Maximum known size (SHA-512) - virtual ~MessageDigest() {} - // Returns the digest output size (e.g. 16 bytes for MD5). - virtual size_t Size() const = 0; - // Updates the digest with |len| bytes from |buf|. - virtual void Update(const void* buf, size_t len) = 0; - // Outputs the digest value to |buf| with length |len|. - // Returns the number of bytes written, i.e., Size(). - virtual size_t Finish(void* buf, size_t len) = 0; -}; - -// A factory class for creating digest objects. -class MessageDigestFactory { - public: - static MessageDigest* Create(const std::string& alg); -}; - -// A whitelist of approved digest algorithms from RFC 4572 (FIPS 180). -bool IsFips180DigestAlgorithm(const std::string& alg); - -// Functions to create hashes. - -// Computes the hash of |in_len| bytes of |input|, using the |digest| hash -// implementation, and outputs the hash to the buffer |output|, which is -// |out_len| bytes long. Returns the number of bytes written to |output| if -// successful, or 0 if |out_len| was too small. -size_t ComputeDigest(MessageDigest* digest, const void* input, size_t in_len, - void* output, size_t out_len); -// Like the previous function, but creates a digest implementation based on -// the desired digest name |alg|, e.g. DIGEST_SHA_1. Returns 0 if there is no -// digest with the given name. -size_t ComputeDigest(const std::string& alg, const void* input, size_t in_len, - void* output, size_t out_len); -// Computes the hash of |input| using the |digest| hash implementation, and -// returns it as a hex-encoded string. -std::string ComputeDigest(MessageDigest* digest, const std::string& input); -// Like the previous function, but creates a digest implementation based on -// the desired digest name |alg|, e.g. DIGEST_SHA_1. Returns empty string if -// there is no digest with the given name. -std::string ComputeDigest(const std::string& alg, const std::string& input); -// Like the previous function, but returns an explicit result code. -bool ComputeDigest(const std::string& alg, const std::string& input, - std::string* output); - -// Shorthand way to compute a hex-encoded hash using MD5. -inline std::string MD5(const std::string& input) { - return ComputeDigest(DIGEST_MD5, input); -} - -// Functions to compute RFC 2104 HMACs. - -// Computes the HMAC of |in_len| bytes of |input|, using the |digest| hash -// implementation and |key_len| bytes of |key| to key the HMAC, and outputs -// the HMAC to the buffer |output|, which is |out_len| bytes long. Returns the -// number of bytes written to |output| if successful, or 0 if |out_len| was too -// small. -size_t ComputeHmac(MessageDigest* digest, const void* key, size_t key_len, - const void* input, size_t in_len, - void* output, size_t out_len); -// Like the previous function, but creates a digest implementation based on -// the desired digest name |alg|, e.g. DIGEST_SHA_1. Returns 0 if there is no -// digest with the given name. -size_t ComputeHmac(const std::string& alg, const void* key, size_t key_len, - const void* input, size_t in_len, - void* output, size_t out_len); -// Computes the HMAC of |input| using the |digest| hash implementation and |key| -// to key the HMAC, and returns it as a hex-encoded string. -std::string ComputeHmac(MessageDigest* digest, const std::string& key, - const std::string& input); -// Like the previous function, but creates a digest implementation based on -// the desired digest name |alg|, e.g. DIGEST_SHA_1. Returns empty string if -// there is no digest with the given name. -std::string ComputeHmac(const std::string& alg, const std::string& key, - const std::string& input); -// Like the previous function, but returns an explicit result code. -bool ComputeHmac(const std::string& alg, const std::string& key, - const std::string& input, std::string* output); - -} // namespace talk_base - -#endif // TALK_BASE_MESSAGEDIGEST_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/messagehandler.h b/thirdparties/common/include/webrtc-sdk/talk/base/messagehandler.h deleted file mode 100755 index eb29ee8..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/messagehandler.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_MESSAGEHANDLER_H_ -#define TALK_BASE_MESSAGEHANDLER_H_ - -#include "talk/base/constructormagic.h" - -namespace talk_base { - -struct Message; - -// Messages get dispatched to a MessageHandler - -class MessageHandler { - public: - virtual ~MessageHandler(); - virtual void OnMessage(Message* msg) = 0; - - protected: - MessageHandler() {} - - private: - DISALLOW_COPY_AND_ASSIGN(MessageHandler); -}; - -// Helper class to facilitate executing a functor on a thread. -template -class FunctorMessageHandler : public MessageHandler { - public: - explicit FunctorMessageHandler(const FunctorT& functor) - : functor_(functor) {} - virtual void OnMessage(Message* msg) { - result_ = functor_(); - } - const ReturnT& result() const { return result_; } - - private: - FunctorT functor_; - ReturnT result_; -}; - -// Specialization for ReturnT of void. -template -class FunctorMessageHandler : public MessageHandler { - public: - explicit FunctorMessageHandler(const FunctorT& functor) - : functor_(functor) {} - virtual void OnMessage(Message* msg) { - functor_(); - } - void result() const {} - - private: - FunctorT functor_; -}; - - -} // namespace talk_base - -#endif // TALK_BASE_MESSAGEHANDLER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/messagequeue.h b/thirdparties/common/include/webrtc-sdk/talk/base/messagequeue.h deleted file mode 100755 index 2032593..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/messagequeue.h +++ /dev/null @@ -1,271 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_MESSAGEQUEUE_H_ -#define TALK_BASE_MESSAGEQUEUE_H_ - -#include - -#include -#include -#include -#include - -#include "talk/base/basictypes.h" -#include "talk/base/constructormagic.h" -#include "talk/base/criticalsection.h" -#include "talk/base/messagehandler.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/scoped_ref_ptr.h" -#include "talk/base/sigslot.h" -#include "talk/base/socketserver.h" -#include "talk/base/timeutils.h" - -namespace talk_base { - -struct Message; -class MessageQueue; - -// MessageQueueManager does cleanup of of message queues - -class MessageQueueManager { - public: - static void Add(MessageQueue *message_queue); - static void Remove(MessageQueue *message_queue); - static void Clear(MessageHandler *handler); - - // For testing purposes, we expose whether or not the MessageQueueManager - // instance has been initialized. It has no other use relative to the rest of - // the functions of this class, which auto-initialize the underlying - // MessageQueueManager instance when necessary. - static bool IsInitialized(); - - private: - static MessageQueueManager* Instance(); - - MessageQueueManager(); - ~MessageQueueManager(); - - void AddInternal(MessageQueue *message_queue); - void RemoveInternal(MessageQueue *message_queue); - void ClearInternal(MessageHandler *handler); - - static MessageQueueManager* instance_; - // This list contains all live MessageQueues. - std::vector message_queues_; - CriticalSection crit_; -}; - -// Derive from this for specialized data -// App manages lifetime, except when messages are purged - -class MessageData { - public: - MessageData() {} - virtual ~MessageData() {} -}; - -template -class TypedMessageData : public MessageData { - public: - explicit TypedMessageData(const T& data) : data_(data) { } - const T& data() const { return data_; } - T& data() { return data_; } - private: - T data_; -}; - -// Like TypedMessageData, but for pointers that require a delete. -template -class ScopedMessageData : public MessageData { - public: - explicit ScopedMessageData(T* data) : data_(data) { } - const scoped_ptr& data() const { return data_; } - scoped_ptr& data() { return data_; } - private: - scoped_ptr data_; -}; - -// Like ScopedMessageData, but for reference counted pointers. -template -class ScopedRefMessageData : public MessageData { - public: - explicit ScopedRefMessageData(T* data) : data_(data) { } - const scoped_refptr& data() const { return data_; } - scoped_refptr& data() { return data_; } - private: - scoped_refptr data_; -}; - -template -inline MessageData* WrapMessageData(const T& data) { - return new TypedMessageData(data); -} - -template -inline const T& UseMessageData(MessageData* data) { - return static_cast< TypedMessageData* >(data)->data(); -} - -template -class DisposeData : public MessageData { - public: - explicit DisposeData(T* data) : data_(data) { } - virtual ~DisposeData() { delete data_; } - private: - T* data_; -}; - -const uint32 MQID_ANY = static_cast(-1); -const uint32 MQID_DISPOSE = static_cast(-2); - -// No destructor - -struct Message { - Message() { - memset(this, 0, sizeof(*this)); - } - inline bool Match(MessageHandler* handler, uint32 id) const { - return (handler == NULL || handler == phandler) - && (id == MQID_ANY || id == message_id); - } - MessageHandler *phandler; - uint32 message_id; - MessageData *pdata; - uint32 ts_sensitive; -}; - -typedef std::list MessageList; - -// DelayedMessage goes into a priority queue, sorted by trigger time. Messages -// with the same trigger time are processed in num_ (FIFO) order. - -class DelayedMessage { - public: - DelayedMessage(int delay, uint32 trigger, uint32 num, const Message& msg) - : cmsDelay_(delay), msTrigger_(trigger), num_(num), msg_(msg) { } - - bool operator< (const DelayedMessage& dmsg) const { - return (dmsg.msTrigger_ < msTrigger_) - || ((dmsg.msTrigger_ == msTrigger_) && (dmsg.num_ < num_)); - } - - int cmsDelay_; // for debugging - uint32 msTrigger_; - uint32 num_; - Message msg_; -}; - -class MessageQueue { - public: - explicit MessageQueue(SocketServer* ss = NULL); - virtual ~MessageQueue(); - - SocketServer* socketserver() { return ss_; } - void set_socketserver(SocketServer* ss); - - // Note: The behavior of MessageQueue has changed. When a MQ is stopped, - // futher Posts and Sends will fail. However, any pending Sends and *ready* - // Posts (as opposed to unexpired delayed Posts) will be delivered before - // Get (or Peek) returns false. By guaranteeing delivery of those messages, - // we eliminate the race condition when an MessageHandler and MessageQueue - // may be destroyed independently of each other. - virtual void Quit(); - virtual bool IsQuitting(); - virtual void Restart(); - - // Get() will process I/O until: - // 1) A message is available (returns true) - // 2) cmsWait seconds have elapsed (returns false) - // 3) Stop() is called (returns false) - virtual bool Get(Message *pmsg, int cmsWait = kForever, - bool process_io = true); - virtual bool Peek(Message *pmsg, int cmsWait = 0); - virtual void Post(MessageHandler *phandler, uint32 id = 0, - MessageData *pdata = NULL, bool time_sensitive = false); - virtual void PostDelayed(int cmsDelay, MessageHandler *phandler, - uint32 id = 0, MessageData *pdata = NULL) { - return DoDelayPost(cmsDelay, TimeAfter(cmsDelay), phandler, id, pdata); - } - virtual void PostAt(uint32 tstamp, MessageHandler *phandler, - uint32 id = 0, MessageData *pdata = NULL) { - return DoDelayPost(TimeUntil(tstamp), tstamp, phandler, id, pdata); - } - virtual void Clear(MessageHandler *phandler, uint32 id = MQID_ANY, - MessageList* removed = NULL); - virtual void Dispatch(Message *pmsg); - virtual void ReceiveSends(); - - // Amount of time until the next message can be retrieved - virtual int GetDelay(); - - bool empty() const { return size() == 0u; } - size_t size() const { - CritScope cs(&crit_); // msgq_.size() is not thread safe. - return msgq_.size() + dmsgq_.size() + (fPeekKeep_ ? 1u : 0u); - } - - // Internally posts a message which causes the doomed object to be deleted - template void Dispose(T* doomed) { - if (doomed) { - Post(NULL, MQID_DISPOSE, new DisposeData(doomed)); - } - } - - // When this signal is sent out, any references to this queue should - // no longer be used. - sigslot::signal0<> SignalQueueDestroyed; - - protected: - class PriorityQueue : public std::priority_queue { - public: - container_type& container() { return c; } - void reheap() { make_heap(c.begin(), c.end(), comp); } - }; - - void DoDelayPost(int cmsDelay, uint32 tstamp, MessageHandler *phandler, - uint32 id, MessageData* pdata); - - // The SocketServer is not owned by MessageQueue. - SocketServer* ss_; - // If a server isn't supplied in the constructor, use this one. - scoped_ptr default_ss_; - bool fStop_; - bool fPeekKeep_; - Message msgPeek_; - MessageList msgq_; - PriorityQueue dmsgq_; - uint32 dmsgq_next_num_; - mutable CriticalSection crit_; - - private: - DISALLOW_COPY_AND_ASSIGN(MessageQueue); -}; - -} // namespace talk_base - -#endif // TALK_BASE_MESSAGEQUEUE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/move.h b/thirdparties/common/include/webrtc-sdk/talk/base/move.h deleted file mode 100755 index b6687e0..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/move.h +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef THIRD_PARTY_WEBRTC_FILES_TALK_BASE_MOVE_H_ -#define THIRD_PARTY_WEBRTC_FILES_TALK_BASE_MOVE_H_ - -// Macro with the boilerplate that makes a type move-only in C++03. -// -// USAGE -// -// This macro should be used instead of DISALLOW_COPY_AND_ASSIGN to create -// a "move-only" type. Unlike DISALLOW_COPY_AND_ASSIGN, this macro should be -// the first line in a class declaration. -// -// A class using this macro must call .Pass() (or somehow be an r-value already) -// before it can be: -// -// * Passed as a function argument -// * Used as the right-hand side of an assignment -// * Returned from a function -// -// Each class will still need to define their own "move constructor" and "move -// operator=" to make this useful. Here's an example of the macro, the move -// constructor, and the move operator= from the scoped_ptr class: -// -// template -// class scoped_ptr { -// TALK_MOVE_ONLY_TYPE_FOR_CPP_03(scoped_ptr, RValue) -// public: -// scoped_ptr(RValue& other) : ptr_(other.release()) { } -// scoped_ptr& operator=(RValue& other) { -// swap(other); -// return *this; -// } -// }; -// -// Note that the constructor must NOT be marked explicit. -// -// For consistency, the second parameter to the macro should always be RValue -// unless you have a strong reason to do otherwise. It is only exposed as a -// macro parameter so that the move constructor and move operator= don't look -// like they're using a phantom type. -// -// -// HOW THIS WORKS -// -// For a thorough explanation of this technique, see: -// -// http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Move_Constructor -// -// The summary is that we take advantage of 2 properties: -// -// 1) non-const references will not bind to r-values. -// 2) C++ can apply one user-defined conversion when initializing a -// variable. -// -// The first lets us disable the copy constructor and assignment operator -// by declaring private version of them with a non-const reference parameter. -// -// For l-values, direct initialization still fails like in -// DISALLOW_COPY_AND_ASSIGN because the copy constructor and assignment -// operators are private. -// -// For r-values, the situation is different. The copy constructor and -// assignment operator are not viable due to (1), so we are trying to call -// a non-existent constructor and non-existing operator= rather than a private -// one. Since we have not committed an error quite yet, we can provide an -// alternate conversion sequence and a constructor. We add -// -// * a private struct named "RValue" -// * a user-defined conversion "operator RValue()" -// * a "move constructor" and "move operator=" that take the RValue& as -// their sole parameter. -// -// Only r-values will trigger this sequence and execute our "move constructor" -// or "move operator=." L-values will match the private copy constructor and -// operator= first giving a "private in this context" error. This combination -// gives us a move-only type. -// -// For signaling a destructive transfer of data from an l-value, we provide a -// method named Pass() which creates an r-value for the current instance -// triggering the move constructor or move operator=. -// -// Other ways to get r-values is to use the result of an expression like a -// function call. -// -// Here's an example with comments explaining what gets triggered where: -// -// class Foo { -// TALK_MOVE_ONLY_TYPE_FOR_CPP_03(Foo, RValue); -// -// public: -// ... API ... -// Foo(RValue other); // Move constructor. -// Foo& operator=(RValue rhs); // Move operator= -// }; -// -// Foo MakeFoo(); // Function that returns a Foo. -// -// Foo f; -// Foo f_copy(f); // ERROR: Foo(Foo&) is private in this context. -// Foo f_assign; -// f_assign = f; // ERROR: operator=(Foo&) is private in this context. -// -// -// Foo f(MakeFoo()); // R-value so alternate conversion executed. -// Foo f_copy(f.Pass()); // R-value so alternate conversion executed. -// f = f_copy.Pass(); // R-value so alternate conversion executed. -// -// -// IMPLEMENTATION SUBTLETIES WITH RValue -// -// The RValue struct is just a container for a pointer back to the original -// object. It should only ever be created as a temporary, and no external -// class should ever declare it or use it in a parameter. -// -// It is tempting to want to use the RValue type in function parameters, but -// excluding the limited usage here for the move constructor and move -// operator=, doing so would mean that the function could take both r-values -// and l-values equially which is unexpected. See COMPARED To Boost.Move for -// more details. -// -// An alternate, and incorrect, implementation of the RValue class used by -// Boost.Move makes RValue a fieldless child of the move-only type. RValue& -// is then used in place of RValue in the various operators. The RValue& is -// "created" by doing *reinterpret_cast(this). This has the appeal -// of never creating a temporary RValue struct even with optimizations -// disabled. Also, by virtue of inheritance you can treat the RValue -// reference as if it were the move-only type itself. Unfortunately, -// using the result of this reinterpret_cast<> is actually undefined behavior -// due to C++98 5.2.10.7. In certain compilers (e.g., NaCl) the optimizer -// will generate non-working code. -// -// In optimized builds, both implementations generate the same assembly so we -// choose the one that adheres to the standard. -// -// -// COMPARED TO C++11 -// -// In C++11, you would implement this functionality using an r-value reference -// and our .Pass() method would be replaced with a call to std::move(). -// -// This emulation also has a deficiency where it uses up the single -// user-defined conversion allowed by C++ during initialization. This can -// cause problems in some API edge cases. For instance, in scoped_ptr, it is -// impossible to make a function "void Foo(scoped_ptr p)" accept a -// value of type scoped_ptr even if you add a constructor to -// scoped_ptr<> that would make it look like it should work. C++11 does not -// have this deficiency. -// -// -// COMPARED TO Boost.Move -// -// Our implementation similar to Boost.Move, but we keep the RValue struct -// private to the move-only type, and we don't use the reinterpret_cast<> hack. -// -// In Boost.Move, RValue is the boost::rv<> template. This type can be used -// when writing APIs like: -// -// void MyFunc(boost::rv& f) -// -// that can take advantage of rv<> to avoid extra copies of a type. However you -// would still be able to call this version of MyFunc with an l-value: -// -// Foo f; -// MyFunc(f); // Uh oh, we probably just destroyed |f| w/o calling Pass(). -// -// unless someone is very careful to also declare a parallel override like: -// -// void MyFunc(const Foo& f) -// -// that would catch the l-values first. This was declared unsafe in C++11 and -// a C++11 compiler will explicitly fail MyFunc(f). Unfortunately, we cannot -// ensure this in C++03. -// -// Since we have no need for writing such APIs yet, our implementation keeps -// RValue private and uses a .Pass() method to do the conversion instead of -// trying to write a version of "std::move()." Writing an API like std::move() -// would require the RValue struct to be public. -// -// -// CAVEATS -// -// If you include a move-only type as a field inside a class that does not -// explicitly declare a copy constructor, the containing class's implicit -// copy constructor will change from Containing(const Containing&) to -// Containing(Containing&). This can cause some unexpected errors. -// -// http://llvm.org/bugs/show_bug.cgi?id=11528 -// -// The workaround is to explicitly declare your copy constructor. -// -#define TALK_MOVE_ONLY_TYPE_FOR_CPP_03(type, rvalue_type) \ - private: \ - struct rvalue_type { \ - explicit rvalue_type(type* object) : object(object) {} \ - type* object; \ - }; \ - type(type&); \ - void operator=(type&); \ - public: \ - operator rvalue_type() { return rvalue_type(this); } \ - type Pass() { return type(rvalue_type(this)); } \ - private: - -#endif // THIRD_PARTY_WEBRTC_FILES_TALK_BASE_MOVE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/multipart.h b/thirdparties/common/include/webrtc-sdk/talk/base/multipart.h deleted file mode 100755 index 4ff6d89..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/multipart.h +++ /dev/null @@ -1,94 +0,0 @@ -// libjingle -// Copyright 2004--2010, 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_BASE_MULTIPART_H__ -#define TALK_BASE_MULTIPART_H__ - -#include -#include - -#include "talk/base/sigslot.h" -#include "talk/base/stream.h" - -namespace talk_base { - -/////////////////////////////////////////////////////////////////////////////// -// MultipartStream - Implements an RFC2046 multipart stream by concatenating -// the supplied parts together, and adding the correct boundaries. -/////////////////////////////////////////////////////////////////////////////// - -class MultipartStream : public StreamInterface, public sigslot::has_slots<> { - public: - MultipartStream(const std::string& type, const std::string& boundary); - virtual ~MultipartStream(); - - void GetContentType(std::string* content_type); - - // Note: If content_disposition and/or content_type are the empty string, - // they will be omitted. - bool AddPart(StreamInterface* data_stream, - const std::string& content_disposition, - const std::string& content_type); - bool AddPart(const std::string& data, - const std::string& content_disposition, - const std::string& content_type); - void EndParts(); - - // Calculates the size of a part before actually adding the part. - size_t GetPartSize(const std::string& data, - const std::string& content_disposition, - const std::string& content_type) const; - size_t GetEndPartSize() const; - - // StreamInterface - virtual StreamState GetState() const; - virtual StreamResult Read(void* buffer, size_t buffer_len, - size_t* read, int* error); - virtual StreamResult Write(const void* data, size_t data_len, - size_t* written, int* error); - virtual void Close(); - virtual bool SetPosition(size_t position); - virtual bool GetPosition(size_t* position) const; - virtual bool GetSize(size_t* size) const; - virtual bool GetAvailable(size_t* size) const; - - private: - typedef std::vector PartList; - - // StreamInterface Slots - void OnEvent(StreamInterface* stream, int events, int error); - - std::string type_, boundary_; - PartList parts_; - bool adding_; - size_t current_; // The index into parts_ of the current read position. - size_t position_; // The current read position in bytes. - - DISALLOW_COPY_AND_ASSIGN(MultipartStream); -}; - -} // namespace talk_base - -#endif // TALK_BASE_MULTIPART_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/natserver.h b/thirdparties/common/include/webrtc-sdk/talk/base/natserver.h deleted file mode 100755 index b17e5e7..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/natserver.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_NATSERVER_H_ -#define TALK_BASE_NATSERVER_H_ - -#include -#include - -#include "talk/base/asyncudpsocket.h" -#include "talk/base/socketaddresspair.h" -#include "talk/base/thread.h" -#include "talk/base/socketfactory.h" -#include "talk/base/nattypes.h" - -namespace talk_base { - -// Change how routes (socketaddress pairs) are compared based on the type of -// NAT. The NAT server maintains a hashtable of the routes that it knows -// about. So these affect which routes are treated the same. -struct RouteCmp { - explicit RouteCmp(NAT* nat); - size_t operator()(const SocketAddressPair& r) const; - bool operator()( - const SocketAddressPair& r1, const SocketAddressPair& r2) const; - - bool symmetric; -}; - -// Changes how addresses are compared based on the filtering rules of the NAT. -struct AddrCmp { - explicit AddrCmp(NAT* nat); - size_t operator()(const SocketAddress& r) const; - bool operator()(const SocketAddress& r1, const SocketAddress& r2) const; - - bool use_ip; - bool use_port; -}; - -// Implements the NAT device. It listens for packets on the internal network, -// translates them, and sends them out over the external network. - -const int NAT_SERVER_PORT = 4237; - -class NATServer : public sigslot::has_slots<> { - public: - NATServer( - NATType type, SocketFactory* internal, const SocketAddress& internal_addr, - SocketFactory* external, const SocketAddress& external_ip); - ~NATServer(); - - SocketAddress internal_address() const { - return server_socket_->GetLocalAddress(); - } - - // Packets received on one of the networks. - void OnInternalPacket(AsyncPacketSocket* socket, const char* buf, - size_t size, const SocketAddress& addr, - const PacketTime& packet_time); - void OnExternalPacket(AsyncPacketSocket* socket, const char* buf, - size_t size, const SocketAddress& remote_addr, - const PacketTime& packet_time); - - private: - typedef std::set AddressSet; - - /* Records a translation and the associated external socket. */ - struct TransEntry { - TransEntry(const SocketAddressPair& r, AsyncUDPSocket* s, NAT* nat); - ~TransEntry(); - - void WhitelistInsert(const SocketAddress& addr); - bool WhitelistContains(const SocketAddress& ext_addr); - - SocketAddressPair route; - AsyncUDPSocket* socket; - AddressSet* whitelist; - CriticalSection crit_; - }; - - typedef std::map InternalMap; - typedef std::map ExternalMap; - - /* Creates a new entry that translates the given route. */ - void Translate(const SocketAddressPair& route); - - /* Determines whether the NAT would filter out a packet from this address. */ - bool ShouldFilterOut(TransEntry* entry, const SocketAddress& ext_addr); - - NAT* nat_; - SocketFactory* internal_; - SocketFactory* external_; - SocketAddress external_ip_; - AsyncUDPSocket* server_socket_; - AsyncSocket* tcp_server_socket_; - InternalMap* int_map_; - ExternalMap* ext_map_; - DISALLOW_EVIL_CONSTRUCTORS(NATServer); -}; - -} // namespace talk_base - -#endif // TALK_BASE_NATSERVER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/natsocketfactory.h b/thirdparties/common/include/webrtc-sdk/talk/base/natsocketfactory.h deleted file mode 100755 index c18d745..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/natsocketfactory.h +++ /dev/null @@ -1,183 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_NATSOCKETFACTORY_H_ -#define TALK_BASE_NATSOCKETFACTORY_H_ - -#include -#include -#include - -#include "talk/base/natserver.h" -#include "talk/base/socketaddress.h" -#include "talk/base/socketserver.h" - -namespace talk_base { - -const size_t kNATEncodedIPv4AddressSize = 8U; -const size_t kNATEncodedIPv6AddressSize = 20U; - -// Used by the NAT socket implementation. -class NATInternalSocketFactory { - public: - virtual ~NATInternalSocketFactory() {} - virtual AsyncSocket* CreateInternalSocket(int family, int type, - const SocketAddress& local_addr, SocketAddress* nat_addr) = 0; -}; - -// Creates sockets that will send all traffic through a NAT, using an existing -// NATServer instance running at nat_addr. The actual data is sent using sockets -// from a socket factory, given to the constructor. -class NATSocketFactory : public SocketFactory, public NATInternalSocketFactory { - public: - NATSocketFactory(SocketFactory* factory, const SocketAddress& nat_addr); - - // SocketFactory implementation - virtual Socket* CreateSocket(int type); - virtual Socket* CreateSocket(int family, int type); - virtual AsyncSocket* CreateAsyncSocket(int type); - virtual AsyncSocket* CreateAsyncSocket(int family, int type); - - // NATInternalSocketFactory implementation - virtual AsyncSocket* CreateInternalSocket(int family, int type, - const SocketAddress& local_addr, SocketAddress* nat_addr); - - private: - SocketFactory* factory_; - SocketAddress nat_addr_; - DISALLOW_EVIL_CONSTRUCTORS(NATSocketFactory); -}; - -// Creates sockets that will send traffic through a NAT depending on what -// address they bind to. This can be used to simulate a client on a NAT sending -// to a client that is not behind a NAT. -// Note that the internal addresses of clients must be unique. This is because -// there is only one socketserver per thread, and the Bind() address is used to -// figure out which NAT (if any) the socket should talk to. -// -// Example with 3 NATs (2 cascaded), and 3 clients. -// ss->AddTranslator("1.2.3.4", "192.168.0.1", NAT_ADDR_RESTRICTED); -// ss->AddTranslator("99.99.99.99", "10.0.0.1", NAT_SYMMETRIC)-> -// AddTranslator("10.0.0.2", "192.168.1.1", NAT_OPEN_CONE); -// ss->GetTranslator("1.2.3.4")->AddClient("1.2.3.4", "192.168.0.2"); -// ss->GetTranslator("99.99.99.99")->AddClient("10.0.0.3"); -// ss->GetTranslator("99.99.99.99")->GetTranslator("10.0.0.2")-> -// AddClient("192.168.1.2"); -class NATSocketServer : public SocketServer, public NATInternalSocketFactory { - public: - class Translator; - // holds a list of NATs - class TranslatorMap : private std::map { - public: - ~TranslatorMap(); - Translator* Get(const SocketAddress& ext_ip); - Translator* Add(const SocketAddress& ext_ip, Translator*); - void Remove(const SocketAddress& ext_ip); - Translator* FindClient(const SocketAddress& int_ip); - }; - - // a specific NAT - class Translator { - public: - Translator(NATSocketServer* server, NATType type, - const SocketAddress& int_addr, SocketFactory* ext_factory, - const SocketAddress& ext_addr); - - SocketFactory* internal_factory() { return internal_factory_.get(); } - SocketAddress internal_address() const { - return nat_server_->internal_address(); - } - SocketAddress internal_tcp_address() const { - return SocketAddress(); // nat_server_->internal_tcp_address(); - } - - Translator* GetTranslator(const SocketAddress& ext_ip); - Translator* AddTranslator(const SocketAddress& ext_ip, - const SocketAddress& int_ip, NATType type); - void RemoveTranslator(const SocketAddress& ext_ip); - - bool AddClient(const SocketAddress& int_ip); - void RemoveClient(const SocketAddress& int_ip); - - // Looks for the specified client in this or a child NAT. - Translator* FindClient(const SocketAddress& int_ip); - - private: - NATSocketServer* server_; - scoped_ptr internal_factory_; - scoped_ptr nat_server_; - TranslatorMap nats_; - std::set clients_; - }; - - explicit NATSocketServer(SocketServer* ss); - - SocketServer* socketserver() { return server_; } - MessageQueue* queue() { return msg_queue_; } - - Translator* GetTranslator(const SocketAddress& ext_ip); - Translator* AddTranslator(const SocketAddress& ext_ip, - const SocketAddress& int_ip, NATType type); - void RemoveTranslator(const SocketAddress& ext_ip); - - // SocketServer implementation - virtual Socket* CreateSocket(int type); - virtual Socket* CreateSocket(int family, int type); - - virtual AsyncSocket* CreateAsyncSocket(int type); - virtual AsyncSocket* CreateAsyncSocket(int family, int type); - - virtual void SetMessageQueue(MessageQueue* queue) { - msg_queue_ = queue; - server_->SetMessageQueue(queue); - } - virtual bool Wait(int cms, bool process_io) { - return server_->Wait(cms, process_io); - } - virtual void WakeUp() { - server_->WakeUp(); - } - - // NATInternalSocketFactory implementation - virtual AsyncSocket* CreateInternalSocket(int family, int type, - const SocketAddress& local_addr, SocketAddress* nat_addr); - - private: - SocketServer* server_; - MessageQueue* msg_queue_; - TranslatorMap nats_; - DISALLOW_EVIL_CONSTRUCTORS(NATSocketServer); -}; - -// Free-standing NAT helper functions. -size_t PackAddressForNAT(char* buf, size_t buf_size, - const SocketAddress& remote_addr); -size_t UnpackAddressFromNAT(const char* buf, size_t buf_size, - SocketAddress* remote_addr); -} // namespace talk_base - -#endif // TALK_BASE_NATSOCKETFACTORY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/nattypes.h b/thirdparties/common/include/webrtc-sdk/talk/base/nattypes.h deleted file mode 100755 index a10f4b9..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/nattypes.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_NATTYPE_H__ -#define TALK_BASE_NATTYPE_H__ - -namespace talk_base { - -/* Identifies each type of NAT that can be simulated. */ -enum NATType { - NAT_OPEN_CONE, - NAT_ADDR_RESTRICTED, - NAT_PORT_RESTRICTED, - NAT_SYMMETRIC -}; - -// Implements the rules for each specific type of NAT. -class NAT { -public: - virtual ~NAT() { } - - // Determines whether this NAT uses both source and destination address when - // checking whether a mapping already exists. - virtual bool IsSymmetric() = 0; - - // Determines whether this NAT drops packets received from a different IP - // the one last sent to. - virtual bool FiltersIP() = 0; - - // Determines whether this NAT drops packets received from a different port - // the one last sent to. - virtual bool FiltersPort() = 0; - - // Returns an implementation of the given type of NAT. - static NAT* Create(NATType type); -}; - -} // namespace talk_base - -#endif // TALK_BASE_NATTYPE_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/nethelpers.h b/thirdparties/common/include/webrtc-sdk/talk/base/nethelpers.h deleted file mode 100755 index 28fc566..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/nethelpers.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * libjingle - * Copyright 2008, 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_BASE_NETHELPERS_H_ -#define TALK_BASE_NETHELPERS_H_ - -#ifdef POSIX -#include -#include -#elif WIN32 -#include // NOLINT -#endif - -#include - -#include "talk/base/asyncresolverinterface.h" -#include "talk/base/signalthread.h" -#include "talk/base/sigslot.h" -#include "talk/base/socketaddress.h" - -namespace talk_base { - -class AsyncResolverTest; - -// AsyncResolver will perform async DNS resolution, signaling the result on -// the SignalDone from AsyncResolverInterface when the operation completes. -class AsyncResolver : public SignalThread, public AsyncResolverInterface { - public: - AsyncResolver(); - virtual ~AsyncResolver() {} - - virtual void Start(const SocketAddress& addr); - virtual bool GetResolvedAddress(int family, SocketAddress* addr) const; - virtual int GetError() const { return error_; } - virtual void Destroy(bool wait) { SignalThread::Destroy(wait); } - - const std::vector& addresses() const { return addresses_; } - void set_error(int error) { error_ = error; } - - protected: - virtual void DoWork(); - virtual void OnWorkDone(); - - private: - SocketAddress addr_; - std::vector addresses_; - int error_; -}; - -// talk_base namespaced wrappers for inet_ntop and inet_pton so we can avoid -// the windows-native versions of these. -const char* inet_ntop(int af, const void *src, char* dst, socklen_t size); -int inet_pton(int af, const char* src, void *dst); - -bool HasIPv6Enabled(); -} // namespace talk_base - -#endif // TALK_BASE_NETHELPERS_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/network.h b/thirdparties/common/include/webrtc-sdk/talk/base/network.h deleted file mode 100755 index 0c5349f..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/network.h +++ /dev/null @@ -1,262 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_NETWORK_H_ -#define TALK_BASE_NETWORK_H_ - -#include -#include -#include -#include - -#include "talk/base/basictypes.h" -#include "talk/base/ipaddress.h" -#include "talk/base/messagehandler.h" -#include "talk/base/sigslot.h" - -#if defined(POSIX) -struct ifaddrs; -#endif // defined(POSIX) - -namespace talk_base { - -class Network; -class Thread; - -enum AdapterType { - // This enum resembles the one in Chromium net::ConnectionType. - ADAPTER_TYPE_UNKNOWN = 0, - ADAPTER_TYPE_ETHERNET = 1, - ADAPTER_TYPE_WIFI = 2, - ADAPTER_TYPE_CELLULAR = 3, - ADAPTER_TYPE_VPN = 4 -}; - -// Makes a string key for this network. Used in the network manager's maps. -// Network objects are keyed on interface name, network prefix and the -// length of that prefix. -std::string MakeNetworkKey(const std::string& name, const IPAddress& prefix, - int prefix_length); - -// Generic network manager interface. It provides list of local -// networks. -class NetworkManager { - public: - typedef std::vector NetworkList; - - NetworkManager(); - virtual ~NetworkManager(); - - // Called when network list is updated. - sigslot::signal0<> SignalNetworksChanged; - - // Indicates a failure when getting list of network interfaces. - sigslot::signal0<> SignalError; - - // Start/Stop monitoring of network interfaces - // list. SignalNetworksChanged or SignalError is emitted immidiately - // after StartUpdating() is called. After that SignalNetworksChanged - // is emitted wheneven list of networks changes. - virtual void StartUpdating() = 0; - virtual void StopUpdating() = 0; - - // Returns the current list of networks available on this machine. - // UpdateNetworks() must be called before this method is called. - // It makes sure that repeated calls return the same object for a - // given network, so that quality is tracked appropriately. Does not - // include ignored networks. - virtual void GetNetworks(NetworkList* networks) const = 0; - - // Dumps a list of networks available to LS_INFO. - virtual void DumpNetworks(bool include_ignored) {} -}; - -// Base class for NetworkManager implementations. -class NetworkManagerBase : public NetworkManager { - public: - NetworkManagerBase(); - virtual ~NetworkManagerBase(); - - virtual void GetNetworks(std::vector* networks) const; - bool ipv6_enabled() const { return ipv6_enabled_; } - void set_ipv6_enabled(bool enabled) { ipv6_enabled_ = enabled; } - - protected: - typedef std::map NetworkMap; - // Updates |networks_| with the networks listed in |list|. If - // |network_map_| already has a Network object for a network listed - // in the |list| then it is reused. Accept ownership of the Network - // objects in the |list|. |changed| will be set to true if there is - // any change in the network list. - void MergeNetworkList(const NetworkList& list, bool* changed); - - private: - friend class NetworkTest; - void DoUpdateNetworks(); - - NetworkList networks_; - NetworkMap networks_map_; - bool ipv6_enabled_; -}; - -// Basic implementation of the NetworkManager interface that gets list -// of networks using OS APIs. -class BasicNetworkManager : public NetworkManagerBase, - public MessageHandler { - public: - BasicNetworkManager(); - virtual ~BasicNetworkManager(); - - virtual void StartUpdating(); - virtual void StopUpdating(); - - // Logs the available networks. - virtual void DumpNetworks(bool include_ignored); - - // MessageHandler interface. - virtual void OnMessage(Message* msg); - bool started() { return start_count_ > 0; } - - // Sets the network ignore list, which is empty by default. Any network on - // the ignore list will be filtered from network enumeration results. - void set_network_ignore_list(const std::vector& list) { - network_ignore_list_ = list; - } -#if defined(ANDROID) || defined(LINUX) - // Sets the flag for ignoring non-default routes. - void set_ignore_non_default_routes(bool value) { - ignore_non_default_routes_ = true; - } -#endif - - protected: -#if defined(POSIX) - // Separated from CreateNetworks for tests. - void ConvertIfAddrs(ifaddrs* interfaces, - bool include_ignored, - NetworkList* networks) const; -#endif // defined(POSIX) - - // Creates a network object for each network available on the machine. - bool CreateNetworks(bool include_ignored, NetworkList* networks) const; - - // Determines if a network should be ignored. - bool IsIgnoredNetwork(const Network& network) const; - - private: - friend class NetworkTest; - - void DoUpdateNetworks(); - - Thread* thread_; - bool sent_first_update_; - int start_count_; - std::vector network_ignore_list_; - bool ignore_non_default_routes_; -}; - -// Represents a Unix-type network interface, with a name and single address. -class Network { - public: - Network(const std::string& name, const std::string& description, - const IPAddress& prefix, int prefix_length); - - Network(const std::string& name, const std::string& description, - const IPAddress& prefix, int prefix_length, AdapterType type); - - // Returns the name of the interface this network is associated wtih. - const std::string& name() const { return name_; } - - // Returns the OS-assigned name for this network. This is useful for - // debugging but should not be sent over the wire (for privacy reasons). - const std::string& description() const { return description_; } - - // Returns the prefix for this network. - const IPAddress& prefix() const { return prefix_; } - // Returns the length, in bits, of this network's prefix. - int prefix_length() const { return prefix_length_; } - - // |key_| has unique value per network interface. Used in sorting network - // interfaces. Key is derived from interface name and it's prefix. - std::string key() const { return key_; } - - // Returns the Network's current idea of the 'best' IP it has. - // 'Best' currently means the first one added. - // TODO: We should be preferring temporary addresses. - // Returns an unset IP if this network has no active addresses. - IPAddress ip() const { - if (ips_.size() == 0) { - return IPAddress(); - } - return ips_.at(0); - } - // Adds an active IP address to this network. Does not check for duplicates. - void AddIP(const IPAddress& ip) { ips_.push_back(ip); } - - // Sets the network's IP address list. Returns true if new IP addresses were - // detected. Passing true to already_changed skips this check. - bool SetIPs(const std::vector& ips, bool already_changed); - // Get the list of IP Addresses associated with this network. - const std::vector& GetIPs() { return ips_;} - // Clear the network's list of addresses. - void ClearIPs() { ips_.clear(); } - - // Returns the scope-id of the network's address. - // Should only be relevant for link-local IPv6 addresses. - int scope_id() const { return scope_id_; } - void set_scope_id(int id) { scope_id_ = id; } - - // Indicates whether this network should be ignored, perhaps because - // the IP is 0, or the interface is one we know is invalid. - bool ignored() const { return ignored_; } - void set_ignored(bool ignored) { ignored_ = ignored; } - - AdapterType type() const { return type_; } - int preference() const { return preference_; } - void set_preference(int preference) { preference_ = preference; } - - // Debugging description of this network - std::string ToString() const; - - private: - std::string name_; - std::string description_; - IPAddress prefix_; - int prefix_length_; - std::string key_; - std::vector ips_; - int scope_id_; - bool ignored_; - AdapterType type_; - int preference_; - - friend class NetworkManager; -}; - -} // namespace talk_base - -#endif // TALK_BASE_NETWORK_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/nssidentity.h b/thirdparties/common/include/webrtc-sdk/talk/base/nssidentity.h deleted file mode 100755 index 41a18df..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/nssidentity.h +++ /dev/null @@ -1,147 +0,0 @@ -/* - * libjingle - * Copyright 2004--2008, 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_BASE_NSSIDENTITY_H_ -#define TALK_BASE_NSSIDENTITY_H_ - -#include - -#include "cert.h" -#include "nspr.h" -#include "hasht.h" -#include "keythi.h" - -#include "talk/base/common.h" -#include "talk/base/logging.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/sslidentity.h" - -namespace talk_base { - -class NSSKeyPair { - public: - NSSKeyPair(SECKEYPrivateKey* privkey, SECKEYPublicKey* pubkey) : - privkey_(privkey), pubkey_(pubkey) {} - ~NSSKeyPair(); - - // Generate a 1024-bit RSA key pair. - static NSSKeyPair* Generate(); - NSSKeyPair* GetReference(); - - SECKEYPrivateKey* privkey() const { return privkey_; } - SECKEYPublicKey * pubkey() const { return pubkey_; } - - private: - SECKEYPrivateKey* privkey_; - SECKEYPublicKey* pubkey_; - - DISALLOW_EVIL_CONSTRUCTORS(NSSKeyPair); -}; - - -class NSSCertificate : public SSLCertificate { - public: - static NSSCertificate* FromPEMString(const std::string& pem_string); - // The caller retains ownership of the argument to all the constructors, - // and the constructor makes a copy. - explicit NSSCertificate(CERTCertificate* cert); - explicit NSSCertificate(CERTCertList* cert_list); - virtual ~NSSCertificate() { - if (certificate_) - CERT_DestroyCertificate(certificate_); - } - - virtual NSSCertificate* GetReference() const; - - virtual std::string ToPEMString() const; - - virtual void ToDER(Buffer* der_buffer) const; - - virtual bool GetSignatureDigestAlgorithm(std::string* algorithm) const; - - virtual bool ComputeDigest(const std::string& algorithm, - unsigned char* digest, - size_t size, - size_t* length) const; - - virtual bool GetChain(SSLCertChain** chain) const; - - CERTCertificate* certificate() { return certificate_; } - - // Performs minimal checks to determine if the list is a valid chain. This - // only checks that each certificate certifies the preceding certificate, - // and ignores many other certificate features such as expiration dates. - static bool IsValidChain(const CERTCertList* cert_list); - - // Helper function to get the length of a digest - static bool GetDigestLength(const std::string& algorithm, size_t* length); - - // Comparison. Only the certificate itself is considered, not the chain. - bool Equals(const NSSCertificate* tocompare) const; - - private: - NSSCertificate(CERTCertificate* cert, SSLCertChain* chain); - static bool GetDigestObject(const std::string& algorithm, - const SECHashObject** hash_object); - - CERTCertificate* certificate_; - scoped_ptr chain_; - - DISALLOW_EVIL_CONSTRUCTORS(NSSCertificate); -}; - -// Represents a SSL key pair and certificate for NSS. -class NSSIdentity : public SSLIdentity { - public: - static NSSIdentity* Generate(const std::string& common_name); - static NSSIdentity* GenerateForTest(const SSLIdentityParams& params); - static SSLIdentity* FromPEMStrings(const std::string& private_key, - const std::string& certificate); - virtual ~NSSIdentity() { - LOG(LS_INFO) << "Destroying NSS identity"; - } - - virtual NSSIdentity* GetReference() const; - virtual NSSCertificate& certificate() const; - - NSSKeyPair* keypair() const { return keypair_.get(); } - - private: - NSSIdentity(NSSKeyPair* keypair, NSSCertificate* cert) : - keypair_(keypair), certificate_(cert) {} - - static NSSIdentity* GenerateInternal(const SSLIdentityParams& params); - - talk_base::scoped_ptr keypair_; - talk_base::scoped_ptr certificate_; - - DISALLOW_EVIL_CONSTRUCTORS(NSSIdentity); -}; - -} // namespace talk_base - -#endif // TALK_BASE_NSSIDENTITY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/nssstreamadapter.h b/thirdparties/common/include/webrtc-sdk/talk/base/nssstreamadapter.h deleted file mode 100755 index 7c879cb..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/nssstreamadapter.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - * libjingle - * Copyright 2004--2008, Google Inc. - * Copyright 2011, RTFM, 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_BASE_NSSSTREAMADAPTER_H_ -#define TALK_BASE_NSSSTREAMADAPTER_H_ - -#include -#include - -#include "nspr.h" -#include "nss.h" -#include "secmodt.h" - -#include "talk/base/buffer.h" -#include "talk/base/nssidentity.h" -#include "talk/base/ssladapter.h" -#include "talk/base/sslstreamadapter.h" -#include "talk/base/sslstreamadapterhelper.h" - -namespace talk_base { - -// Singleton -class NSSContext { - public: - NSSContext() {} - ~NSSContext() { - } - - static PK11SlotInfo *GetSlot() { - return Instance() ? Instance()->slot_: NULL; - } - - static NSSContext *Instance(); - static bool InitializeSSL(VerificationCallback callback); - static bool InitializeSSLThread(); - static bool CleanupSSL(); - - private: - PK11SlotInfo *slot_; // The PKCS-11 slot - static bool initialized; // Was this initialized? - static NSSContext *global_nss_context; // The global context -}; - - -class NSSStreamAdapter : public SSLStreamAdapterHelper { - public: - explicit NSSStreamAdapter(StreamInterface* stream); - virtual ~NSSStreamAdapter(); - bool Init(); - - virtual StreamResult Read(void* data, size_t data_len, - size_t* read, int* error); - virtual StreamResult Write(const void* data, size_t data_len, - size_t* written, int* error); - void OnMessage(Message *msg); - - // Key Extractor interface - virtual bool ExportKeyingMaterial(const std::string& label, - const uint8* context, - size_t context_len, - bool use_context, - uint8* result, - size_t result_len); - - // DTLS-SRTP interface - virtual bool SetDtlsSrtpCiphers(const std::vector& ciphers); - virtual bool GetDtlsSrtpCipher(std::string* cipher); - - // Capabilities interfaces - static bool HaveDtls(); - static bool HaveDtlsSrtp(); - static bool HaveExporter(); - - protected: - // Override SSLStreamAdapter - virtual void OnEvent(StreamInterface* stream, int events, int err); - - // Override SSLStreamAdapterHelper - virtual int BeginSSL(); - virtual void Cleanup(); - virtual bool GetDigestLength(const std::string& algorithm, size_t* length) { - return NSSCertificate::GetDigestLength(algorithm, length); - } - - private: - int ContinueSSL(); - static SECStatus AuthCertificateHook(void *arg, PRFileDesc *fd, - PRBool checksig, PRBool isServer); - static SECStatus GetClientAuthDataHook(void *arg, PRFileDesc *fd, - CERTDistNames *caNames, - CERTCertificate **pRetCert, - SECKEYPrivateKey **pRetKey); - - PRFileDesc *ssl_fd_; // NSS's SSL file descriptor - static bool initialized; // Was InitializeSSL() called? - bool cert_ok_; // Did we get and check a cert - std::vector srtp_ciphers_; // SRTP cipher list - - static PRDescIdentity nspr_layer_identity; // The NSPR layer identity -}; - -} // namespace talk_base - -#endif // TALK_BASE_NSSSTREAMADAPTER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/nullsocketserver.h b/thirdparties/common/include/webrtc-sdk/talk/base/nullsocketserver.h deleted file mode 100755 index 518ba60..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/nullsocketserver.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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_BASE_NULLSOCKETSERVER_H_ -#define TALK_BASE_NULLSOCKETSERVER_H_ - -#include "talk/base/event.h" -#include "talk/base/physicalsocketserver.h" - -namespace talk_base { - -// NullSocketServer - -class NullSocketServer : public talk_base::SocketServer { - public: - NullSocketServer() : event_(false, false) {} - - virtual bool Wait(int cms, bool process_io) { - event_.Wait(cms); - return true; - } - - virtual void WakeUp() { - event_.Set(); - } - - virtual talk_base::Socket* CreateSocket(int type) { - ASSERT(false); - return NULL; - } - - virtual talk_base::Socket* CreateSocket(int family, int type) { - ASSERT(false); - return NULL; - } - - virtual talk_base::AsyncSocket* CreateAsyncSocket(int type) { - ASSERT(false); - return NULL; - } - - virtual talk_base::AsyncSocket* CreateAsyncSocket(int family, int type) { - ASSERT(false); - return NULL; - } - - - private: - talk_base::Event event_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_NULLSOCKETSERVER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/openssl.h b/thirdparties/common/include/webrtc-sdk/talk/base/openssl.h deleted file mode 100755 index 5c2dcca..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/openssl.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * libjingle - * Copyright 2013, 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_BASE_OPENSSL_H_ -#define TALK_BASE_OPENSSL_H_ - -#include - -#if (OPENSSL_VERSION_NUMBER < 0x10000000L) -#error OpenSSL is older than 1.0.0, which is the minimum supported version. -#endif - -#endif // TALK_BASE_OPENSSL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/openssladapter.h b/thirdparties/common/include/webrtc-sdk/talk/base/openssladapter.h deleted file mode 100755 index 456b862..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/openssladapter.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_OPENSSLADAPTER_H__ -#define TALK_BASE_OPENSSLADAPTER_H__ - -#include -#include "talk/base/ssladapter.h" - -typedef struct ssl_st SSL; -typedef struct ssl_ctx_st SSL_CTX; -typedef struct x509_store_ctx_st X509_STORE_CTX; - -namespace talk_base { - -/////////////////////////////////////////////////////////////////////////////// - -class OpenSSLAdapter : public SSLAdapter { -public: - static bool InitializeSSL(VerificationCallback callback); - static bool InitializeSSLThread(); - static bool CleanupSSL(); - - OpenSSLAdapter(AsyncSocket* socket); - virtual ~OpenSSLAdapter(); - - virtual int StartSSL(const char* hostname, bool restartable); - virtual int Send(const void* pv, size_t cb); - virtual int Recv(void* pv, size_t cb); - virtual int Close(); - - // Note that the socket returns ST_CONNECTING while SSL is being negotiated. - virtual ConnState GetState() const; - -protected: - virtual void OnConnectEvent(AsyncSocket* socket); - virtual void OnReadEvent(AsyncSocket* socket); - virtual void OnWriteEvent(AsyncSocket* socket); - virtual void OnCloseEvent(AsyncSocket* socket, int err); - -private: - enum SSLState { - SSL_NONE, SSL_WAIT, SSL_CONNECTING, SSL_CONNECTED, SSL_ERROR - }; - - int BeginSSL(); - int ContinueSSL(); - void Error(const char* context, int err, bool signal = true); - void Cleanup(); - - static bool VerifyServerName(SSL* ssl, const char* host, - bool ignore_bad_cert); - bool SSLPostConnectionCheck(SSL* ssl, const char* host); -#if _DEBUG - static void SSLInfoCallback(const SSL* s, int where, int ret); -#endif // !_DEBUG - static int SSLVerifyCallback(int ok, X509_STORE_CTX* store); - static VerificationCallback custom_verify_callback_; - friend class OpenSSLStreamAdapter; // for custom_verify_callback_; - - static bool ConfigureTrustedRootCertificates(SSL_CTX* ctx); - static SSL_CTX* SetupSSLContext(); - - SSLState state_; - bool ssl_read_needs_write_; - bool ssl_write_needs_read_; - // If true, socket will retain SSL configuration after Close. - bool restartable_; - - SSL* ssl_; - SSL_CTX* ssl_ctx_; - std::string ssl_host_name_; - - bool custom_verification_succeeded_; -}; - -///////////////////////////////////////////////////////////////////////////// - -} // namespace talk_base - -#endif // TALK_BASE_OPENSSLADAPTER_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/openssldigest.h b/thirdparties/common/include/webrtc-sdk/talk/base/openssldigest.h deleted file mode 100755 index 6f98f6a..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/openssldigest.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * libjingle - * Copyright 2004--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_BASE_OPENSSLDIGEST_H_ -#define TALK_BASE_OPENSSLDIGEST_H_ - -#include - -#include "talk/base/messagedigest.h" - -namespace talk_base { - -// An implementation of the digest class that uses OpenSSL. -class OpenSSLDigest : public MessageDigest { - public: - // Creates an OpenSSLDigest with |algorithm| as the hash algorithm. - explicit OpenSSLDigest(const std::string& algorithm); - ~OpenSSLDigest(); - // Returns the digest output size (e.g. 16 bytes for MD5). - virtual size_t Size() const; - // Updates the digest with |len| bytes from |buf|. - virtual void Update(const void* buf, size_t len); - // Outputs the digest value to |buf| with length |len|. - virtual size_t Finish(void* buf, size_t len); - - // Helper function to look up a digest's EVP by name. - static bool GetDigestEVP(const std::string &algorithm, - const EVP_MD** md); - // Helper function to look up a digest's name by EVP. - static bool GetDigestName(const EVP_MD* md, - std::string* algorithm); - // Helper function to get the length of a digest. - static bool GetDigestSize(const std::string &algorithm, - size_t* len); - - private: - EVP_MD_CTX ctx_; - const EVP_MD* md_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_OPENSSLDIGEST_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/opensslidentity.h b/thirdparties/common/include/webrtc-sdk/talk/base/opensslidentity.h deleted file mode 100755 index b48ba8e..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/opensslidentity.h +++ /dev/null @@ -1,167 +0,0 @@ -/* - * libjingle - * Copyright 2004--2008, 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_BASE_OPENSSLIDENTITY_H_ -#define TALK_BASE_OPENSSLIDENTITY_H_ - -#include -#include - -#include - -#include "talk/base/common.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/sslidentity.h" - -typedef struct ssl_ctx_st SSL_CTX; - -namespace talk_base { - -// OpenSSLKeyPair encapsulates an OpenSSL EVP_PKEY* keypair object, -// which is reference counted inside the OpenSSL library. -class OpenSSLKeyPair { - public: - explicit OpenSSLKeyPair(EVP_PKEY* pkey) : pkey_(pkey) { - ASSERT(pkey_ != NULL); - } - - static OpenSSLKeyPair* Generate(); - - virtual ~OpenSSLKeyPair(); - - virtual OpenSSLKeyPair* GetReference() { - AddReference(); - return new OpenSSLKeyPair(pkey_); - } - - EVP_PKEY* pkey() const { return pkey_; } - - private: - void AddReference(); - - EVP_PKEY* pkey_; - - DISALLOW_EVIL_CONSTRUCTORS(OpenSSLKeyPair); -}; - -// OpenSSLCertificate encapsulates an OpenSSL X509* certificate object, -// which is also reference counted inside the OpenSSL library. -class OpenSSLCertificate : public SSLCertificate { - public: - // Caller retains ownership of the X509 object. - explicit OpenSSLCertificate(X509* x509) : x509_(x509) { - AddReference(); - } - - static OpenSSLCertificate* Generate(OpenSSLKeyPair* key_pair, - const SSLIdentityParams& params); - static OpenSSLCertificate* FromPEMString(const std::string& pem_string); - - virtual ~OpenSSLCertificate(); - - virtual OpenSSLCertificate* GetReference() const { - return new OpenSSLCertificate(x509_); - } - - X509* x509() const { return x509_; } - - virtual std::string ToPEMString() const; - - virtual void ToDER(Buffer* der_buffer) const; - - // Compute the digest of the certificate given algorithm - virtual bool ComputeDigest(const std::string& algorithm, - unsigned char* digest, - size_t size, - size_t* length) const; - - // Compute the digest of a certificate as an X509 * - static bool ComputeDigest(const X509* x509, - const std::string& algorithm, - unsigned char* digest, - size_t size, - size_t* length); - - virtual bool GetSignatureDigestAlgorithm(std::string* algorithm) const; - - virtual bool GetChain(SSLCertChain** chain) const { - // Chains are not yet supported when using OpenSSL. - // OpenSSLStreamAdapter::SSLVerifyCallback currently requires the remote - // certificate to be self-signed. - return false; - } - - private: - void AddReference() const; - - X509* x509_; - - DISALLOW_EVIL_CONSTRUCTORS(OpenSSLCertificate); -}; - -// Holds a keypair and certificate together, and a method to generate -// them consistently. -class OpenSSLIdentity : public SSLIdentity { - public: - static OpenSSLIdentity* Generate(const std::string& common_name); - static OpenSSLIdentity* GenerateForTest(const SSLIdentityParams& params); - static SSLIdentity* FromPEMStrings(const std::string& private_key, - const std::string& certificate); - virtual ~OpenSSLIdentity() { } - - virtual const OpenSSLCertificate& certificate() const { - return *certificate_; - } - - virtual OpenSSLIdentity* GetReference() const { - return new OpenSSLIdentity(key_pair_->GetReference(), - certificate_->GetReference()); - } - - // Configure an SSL context object to use our key and certificate. - bool ConfigureIdentity(SSL_CTX* ctx); - - private: - OpenSSLIdentity(OpenSSLKeyPair* key_pair, - OpenSSLCertificate* certificate) - : key_pair_(key_pair), certificate_(certificate) { - ASSERT(key_pair != NULL); - ASSERT(certificate != NULL); - } - - static OpenSSLIdentity* GenerateInternal(const SSLIdentityParams& params); - - scoped_ptr key_pair_; - scoped_ptr certificate_; - - DISALLOW_EVIL_CONSTRUCTORS(OpenSSLIdentity); -}; - - -} // namespace talk_base - -#endif // TALK_BASE_OPENSSLIDENTITY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/opensslstreamadapter.h b/thirdparties/common/include/webrtc-sdk/talk/base/opensslstreamadapter.h deleted file mode 100755 index 218345d..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/opensslstreamadapter.h +++ /dev/null @@ -1,215 +0,0 @@ -/* - * libjingle - * Copyright 2004--2008, 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_BASE_OPENSSLSTREAMADAPTER_H__ -#define TALK_BASE_OPENSSLSTREAMADAPTER_H__ - -#include -#include - -#include "talk/base/buffer.h" -#include "talk/base/sslstreamadapter.h" -#include "talk/base/opensslidentity.h" - -typedef struct ssl_st SSL; -typedef struct ssl_ctx_st SSL_CTX; -typedef struct x509_store_ctx_st X509_STORE_CTX; - -namespace talk_base { - -// This class was written with OpenSSLAdapter (a socket adapter) as a -// starting point. It has similar structure and functionality, with -// the peer-to-peer mode added. -// -// Static methods to initialize and deinit the SSL library are in -// OpenSSLAdapter. This class also uses -// OpenSSLAdapter::custom_verify_callback_ (a static field). These -// should probably be moved out to a neutral class. -// -// In a few cases I have factored out some OpenSSLAdapter code into -// static methods so it can be reused from this class. Eventually that -// code should probably be moved to a common support -// class. Unfortunately there remain a few duplicated sections of -// code. I have not done more restructuring because I did not want to -// affect existing code that uses OpenSSLAdapter. -// -// This class does not support the SSL connection restart feature -// present in OpenSSLAdapter. I am not entirely sure how the feature -// is useful and I am not convinced that it works properly. -// -// This implementation is careful to disallow data exchange after an -// SSL error, and it has an explicit SSL_CLOSED state. It should not -// be possible to send any data in clear after one of the StartSSL -// methods has been called. - -// Look in sslstreamadapter.h for documentation of the methods. - -class OpenSSLIdentity; - -/////////////////////////////////////////////////////////////////////////////// - -class OpenSSLStreamAdapter : public SSLStreamAdapter { - public: - explicit OpenSSLStreamAdapter(StreamInterface* stream); - virtual ~OpenSSLStreamAdapter(); - - virtual void SetIdentity(SSLIdentity* identity); - - // Default argument is for compatibility - virtual void SetServerRole(SSLRole role = SSL_SERVER); - virtual bool SetPeerCertificateDigest(const std::string& digest_alg, - const unsigned char* digest_val, - size_t digest_len); - - virtual bool GetPeerCertificate(SSLCertificate** cert) const; - - virtual int StartSSLWithServer(const char* server_name); - virtual int StartSSLWithPeer(); - virtual void SetMode(SSLMode mode); - - virtual StreamResult Read(void* data, size_t data_len, - size_t* read, int* error); - virtual StreamResult Write(const void* data, size_t data_len, - size_t* written, int* error); - virtual void Close(); - virtual StreamState GetState() const; - - // Key Extractor interface - virtual bool ExportKeyingMaterial(const std::string& label, - const uint8* context, - size_t context_len, - bool use_context, - uint8* result, - size_t result_len); - - - // DTLS-SRTP interface - virtual bool SetDtlsSrtpCiphers(const std::vector& ciphers); - virtual bool GetDtlsSrtpCipher(std::string* cipher); - - // Capabilities interfaces - static bool HaveDtls(); - static bool HaveDtlsSrtp(); - static bool HaveExporter(); - - protected: - virtual void OnEvent(StreamInterface* stream, int events, int err); - - private: - enum SSLState { - // Before calling one of the StartSSL methods, data flows - // in clear text. - SSL_NONE, - SSL_WAIT, // waiting for the stream to open to start SSL negotiation - SSL_CONNECTING, // SSL negotiation in progress - SSL_CONNECTED, // SSL stream successfully established - SSL_ERROR, // some SSL error occurred, stream is closed - SSL_CLOSED // Clean close - }; - - enum { MSG_TIMEOUT = MSG_MAX+1}; - - // The following three methods return 0 on success and a negative - // error code on failure. The error code may be from OpenSSL or -1 - // on some other error cases, so it can't really be interpreted - // unfortunately. - - // Go from state SSL_NONE to either SSL_CONNECTING or SSL_WAIT, - // depending on whether the underlying stream is already open or - // not. - int StartSSL(); - // Prepare SSL library, state is SSL_CONNECTING. - int BeginSSL(); - // Perform SSL negotiation steps. - int ContinueSSL(); - - // Error handler helper. signal is given as true for errors in - // asynchronous contexts (when an error method was not returned - // through some other method), and in that case an SE_CLOSE event is - // raised on the stream with the specified error. - // A 0 error means a graceful close, otherwise there is not really enough - // context to interpret the error code. - void Error(const char* context, int err, bool signal); - void Cleanup(); - - // Override MessageHandler - virtual void OnMessage(Message* msg); - - // Flush the input buffers by reading left bytes (for DTLS) - void FlushInput(unsigned int left); - - // SSL library configuration - SSL_CTX* SetupSSLContext(); - // SSL verification check - bool SSLPostConnectionCheck(SSL* ssl, const char* server_name, - const X509* peer_cert, - const std::string& peer_digest); - // SSL certification verification error handler, called back from - // the openssl library. Returns an int interpreted as a boolean in - // the C style: zero means verification failure, non-zero means - // passed. - static int SSLVerifyCallback(int ok, X509_STORE_CTX* store); - - SSLState state_; - SSLRole role_; - int ssl_error_code_; // valid when state_ == SSL_ERROR or SSL_CLOSED - // Whether the SSL negotiation is blocked on needing to read or - // write to the wrapped stream. - bool ssl_read_needs_write_; - bool ssl_write_needs_read_; - - SSL* ssl_; - SSL_CTX* ssl_ctx_; - - // Our key and certificate, mostly useful in peer-to-peer mode. - scoped_ptr identity_; - // in traditional mode, the server name that the server's certificate - // must specify. Empty in peer-to-peer mode. - std::string ssl_server_name_; - // The certificate that the peer must present or did present. Initially - // null in traditional mode, until the connection is established. - scoped_ptr peer_certificate_; - // In peer-to-peer mode, the digest of the certificate that - // the peer must present. - Buffer peer_certificate_digest_value_; - std::string peer_certificate_digest_algorithm_; - - // OpenSSLAdapter::custom_verify_callback_ result - bool custom_verification_succeeded_; - - // The DtlsSrtp ciphers - std::string srtp_ciphers_; - - // Do DTLS or not - SSLMode ssl_mode_; -}; - -///////////////////////////////////////////////////////////////////////////// - -} // namespace talk_base - -#endif // TALK_BASE_OPENSSLSTREAMADAPTER_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/optionsfile.h b/thirdparties/common/include/webrtc-sdk/talk/base/optionsfile.h deleted file mode 100755 index 68b351b..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/optionsfile.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * libjingle - * Copyright 2008, 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_BASE_OPTIONSFILE_H_ -#define TALK_BASE_OPTIONSFILE_H_ - -#include -#include - -namespace talk_base { - -// Implements storage of simple options in a text file on disk. This is -// cross-platform, but it is intended mostly for Linux where there is no -// first-class options storage system. -class OptionsFile { - public: - OptionsFile(const std::string &path); - - // Loads the file from disk, overwriting the in-memory values. - bool Load(); - // Saves the contents in memory, overwriting the on-disk values. - bool Save(); - - bool GetStringValue(const std::string& option, std::string* out_val) const; - bool GetIntValue(const std::string& option, int* out_val) const; - bool SetStringValue(const std::string& option, const std::string& val); - bool SetIntValue(const std::string& option, int val); - bool RemoveValue(const std::string& option); - - private: - typedef std::map OptionsMap; - - static bool IsLegalName(const std::string &name); - static bool IsLegalValue(const std::string &value); - - std::string path_; - OptionsMap options_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_OPTIONSFILE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/pathutils.h b/thirdparties/common/include/webrtc-sdk/talk/base/pathutils.h deleted file mode 100755 index ce060e7..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/pathutils.h +++ /dev/null @@ -1,180 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_PATHUTILS_H__ -#define TALK_BASE_PATHUTILS_H__ - -#include -// Temporary, until deprecated helpers are removed. -#include "talk/base/fileutils.h" - -namespace talk_base { - -/////////////////////////////////////////////////////////////////////////////// -// Pathname - parsing of pathnames into components, and vice versa. -// -// To establish consistent terminology, a filename never contains a folder -// component. A folder never contains a filename. A pathname may include -// a folder and/or filename component. Here are some examples: -// -// pathname() /home/john/example.txt -// folder() /home/john/ -// filename() example.txt -// parent_folder() /home/ -// folder_name() john/ -// basename() example -// extension() .txt -// -// Basename may begin, end, and/or include periods, but no folder delimiters. -// If extension exists, it consists of a period followed by zero or more -// non-period/non-delimiter characters, and basename is non-empty. -/////////////////////////////////////////////////////////////////////////////// - -class Pathname { -public: - // Folder delimiters are slash and backslash - static bool IsFolderDelimiter(char ch); - static char DefaultFolderDelimiter(); - - Pathname(); - Pathname(const std::string& pathname); - Pathname(const std::string& folder, const std::string& filename); - - // Set's the default folder delimiter for this Pathname - char folder_delimiter() const { return folder_delimiter_; } - void SetFolderDelimiter(char delimiter); - - // Normalize changes all folder delimiters to folder_delimiter() - void Normalize(); - - // Reset to the empty pathname - void clear(); - - // Returns true if the pathname is empty. Note: this->pathname().empty() - // is always false. - bool empty() const; - - std::string url() const; - - // Returns the folder and filename components. If the pathname is empty, - // returns a string representing the current directory (as a relative path, - // i.e., "."). - std::string pathname() const; - void SetPathname(const std::string& pathname); - void SetPathname(const std::string& folder, const std::string& filename); - - // Append pathname to the current folder (if any). Any existing filename - // will be discarded. - void AppendPathname(const std::string& pathname); - - std::string folder() const; - std::string folder_name() const; - std::string parent_folder() const; - // SetFolder and AppendFolder will append a folder delimiter, if needed. - void SetFolder(const std::string& folder); - void AppendFolder(const std::string& folder); - - std::string basename() const; - bool SetBasename(const std::string& basename); - - std::string extension() const; - // SetExtension will prefix a period, if needed. - bool SetExtension(const std::string& extension); - - std::string filename() const; - bool SetFilename(const std::string& filename); - -#ifdef WIN32 - bool GetDrive(char *drive, uint32 bytes) const; - static bool GetDrive(char *drive, uint32 bytes,const std::string& pathname); -#endif - -private: - std::string folder_, basename_, extension_; - char folder_delimiter_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// Global Helpers (deprecated) -/////////////////////////////////////////////////////////////////////////////// - -inline void SetOrganizationName(const std::string& organization) { - Filesystem::SetOrganizationName(organization); -} -inline void SetApplicationName(const std::string& application) { - Filesystem::SetApplicationName(application); -} -inline void GetOrganizationName(std::string* organization) { - Filesystem::GetOrganizationName(organization); -} -inline void GetApplicationName(std::string* application) { - Filesystem::GetApplicationName(application); -} -inline bool CreateFolder(const Pathname& path) { - return Filesystem::CreateFolder(path); -} -inline bool FinishPath(Pathname& path, bool create, const std::string& append) { - if (!append.empty()) - path.AppendFolder(append); - return !create || CreateFolder(path); -} -// Note: this method uses the convention of / for the temporary -// folder. Filesystem uses /. We will be migrating exclusively -// to // eventually. Since these are temp folders, -// it's probably ok to orphan them during the transition. -inline bool GetTemporaryFolder(Pathname& path, bool create, - const std::string& append) { - std::string application_name; - Filesystem::GetApplicationName(&application_name); - ASSERT(!application_name.empty()); - return Filesystem::GetTemporaryFolder(path, create, &application_name) - && FinishPath(path, create, append); -} -inline bool GetAppDataFolder(Pathname& path, bool create, - const std::string& append) { - ASSERT(!create); // TODO: Support create flag on Filesystem::GetAppDataFolder. - return Filesystem::GetAppDataFolder(&path, true) - && FinishPath(path, create, append); -} -inline bool CleanupTemporaryFolder() { - Pathname path; - if (!GetTemporaryFolder(path, false, "")) - return false; - if (Filesystem::IsAbsent(path)) - return true; - if (!Filesystem::IsTemporaryPath(path)) { - ASSERT(false); - return false; - } - return Filesystem::DeleteFolderContents(path); -} - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace talk_base - -#endif // TALK_BASE_PATHUTILS_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/physicalsocketserver.h b/thirdparties/common/include/webrtc-sdk/talk/base/physicalsocketserver.h deleted file mode 100755 index 715b24e..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/physicalsocketserver.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_PHYSICALSOCKETSERVER_H__ -#define TALK_BASE_PHYSICALSOCKETSERVER_H__ - -#include - -#include "talk/base/asyncfile.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/socketserver.h" -#include "talk/base/criticalsection.h" - -#ifdef POSIX -typedef int SOCKET; -#endif // POSIX - -namespace talk_base { - -// Event constants for the Dispatcher class. -enum DispatcherEvent { - DE_READ = 0x0001, - DE_WRITE = 0x0002, - DE_CONNECT = 0x0004, - DE_CLOSE = 0x0008, - DE_ACCEPT = 0x0010, -}; - -class Signaler; -#ifdef POSIX -class PosixSignalDispatcher; -#endif - -class Dispatcher { - public: - virtual ~Dispatcher() {} - virtual uint32 GetRequestedEvents() = 0; - virtual void OnPreEvent(uint32 ff) = 0; - virtual void OnEvent(uint32 ff, int err) = 0; -#ifdef WIN32 - virtual WSAEVENT GetWSAEvent() = 0; - virtual SOCKET GetSocket() = 0; - virtual bool CheckSignalClose() = 0; -#elif POSIX - virtual int GetDescriptor() = 0; - virtual bool IsDescriptorClosed() = 0; -#endif -}; - -// A socket server that provides the real sockets of the underlying OS. -class PhysicalSocketServer : public SocketServer { - public: - PhysicalSocketServer(); - virtual ~PhysicalSocketServer(); - - // SocketFactory: - virtual Socket* CreateSocket(int type); - virtual Socket* CreateSocket(int family, int type); - - virtual AsyncSocket* CreateAsyncSocket(int type); - virtual AsyncSocket* CreateAsyncSocket(int family, int type); - - // Internal Factory for Accept - AsyncSocket* WrapSocket(SOCKET s); - - // SocketServer: - virtual bool Wait(int cms, bool process_io); - virtual void WakeUp(); - - void Add(Dispatcher* dispatcher); - void Remove(Dispatcher* dispatcher); - -#ifdef POSIX - AsyncFile* CreateFile(int fd); - - // Sets the function to be executed in response to the specified POSIX signal. - // The function is executed from inside Wait() using the "self-pipe trick"-- - // regardless of which thread receives the signal--and hence can safely - // manipulate user-level data structures. - // "handler" may be SIG_IGN, SIG_DFL, or a user-specified function, just like - // with signal(2). - // Only one PhysicalSocketServer should have user-level signal handlers. - // Dispatching signals on multiple PhysicalSocketServers is not reliable. - // The signal mask is not modified. It is the caller's responsibily to - // maintain it as desired. - virtual bool SetPosixSignalHandler(int signum, void (*handler)(int)); - - protected: - Dispatcher* signal_dispatcher(); -#endif - - private: - typedef std::vector DispatcherList; - typedef std::vector IteratorList; - -#ifdef POSIX - static bool InstallSignal(int signum, void (*handler)(int)); - - scoped_ptr signal_dispatcher_; -#endif - DispatcherList dispatchers_; - IteratorList iterators_; - Signaler* signal_wakeup_; - CriticalSection crit_; - bool fWait_; -#ifdef WIN32 - WSAEVENT socket_ev_; -#endif -}; - -} // namespace talk_base - -#endif // TALK_BASE_PHYSICALSOCKETSERVER_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/posix.h b/thirdparties/common/include/webrtc-sdk/talk/base/posix.h deleted file mode 100755 index 1e650a0..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/posix.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_BASE_POSIX_H_ -#define TALK_BASE_POSIX_H_ - -namespace talk_base { - -// Runs the given executable name as a daemon, so that it executes concurrently -// with this process. Upon completion, the daemon process will automatically be -// reaped by init(8), so an error exit status or a failure to start the -// executable are not reported. Returns true if the daemon process was forked -// successfully, else false. -bool RunAsDaemon(const char *file, const char *const argv[]); - -} // namespace talk_base - -#endif // TALK_BASE_POSIX_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/profiler.h b/thirdparties/common/include/webrtc-sdk/talk/base/profiler.h deleted file mode 100755 index ca13e17..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/profiler.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - * libjingle - * Copyright 2013, 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. - */ - -// A simple wall-clock profiler for instrumented code. -// Example: -// void MyLongFunction() { -// PROFILE_F(); // Time the execution of this function. -// // Do something -// { // Time just what is in this scope. -// PROFILE("My event"); -// // Do something else -// } -// } -// Another example: -// void StartAsyncProcess() { -// PROFILE_START("My async event"); -// DoSomethingAsyncAndThenCall(&Callback); -// } -// void Callback() { -// PROFILE_STOP("My async event"); -// // Handle callback. -// } - -#ifndef TALK_BASE_PROFILER_H_ -#define TALK_BASE_PROFILER_H_ - -#include -#include - -#include "talk/base/basictypes.h" -#include "talk/base/common.h" -#include "talk/base/logging.h" -#include "talk/base/sharedexclusivelock.h" - -// Profiling could be switched via a build flag, but for now, it's always on. -#ifndef ENABLE_PROFILING -#define ENABLE_PROFILING -#endif - -#ifdef ENABLE_PROFILING - -#define UV_HELPER2(x) _uv_ ## x -#define UV_HELPER(x) UV_HELPER2(x) -#define UNIQUE_VAR UV_HELPER(__LINE__) - -// Profiles the current scope. -#define PROFILE(msg) talk_base::ProfilerScope UNIQUE_VAR(msg) -// When placed at the start of a function, profiles the current function. -#define PROFILE_F() PROFILE(__FUNCTION__) -// Reports current timings to the log at severity |sev|. -#define PROFILE_DUMP_ALL(sev) \ - talk_base::Profiler::Instance()->ReportAllToLog(__FILE__, __LINE__, sev) -// Reports current timings for all events whose names are prefixed by |prefix| -// to the log at severity |sev|. Using a unique event name as |prefix| will -// report only that event. -#define PROFILE_DUMP(sev, prefix) \ - talk_base::Profiler::Instance()->ReportToLog(__FILE__, __LINE__, sev, prefix) -// Starts and stops a profile event. Useful when an event is not easily -// captured within a scope (eg, an async call with a callback when done). -#define PROFILE_START(msg) talk_base::Profiler::Instance()->StartEvent(msg) -#define PROFILE_STOP(msg) talk_base::Profiler::Instance()->StopEvent(msg) -// TODO(ryanpetrie): Consider adding PROFILE_DUMP_EVERY(sev, iterations) - -#undef UV_HELPER2 -#undef UV_HELPER -#undef UNIQUE_VAR - -#else // ENABLE_PROFILING - -#define PROFILE(msg) (void)0 -#define PROFILE_F() (void)0 -#define PROFILE_DUMP_ALL(sev) (void)0 -#define PROFILE_DUMP(sev, prefix) (void)0 -#define PROFILE_START(msg) (void)0 -#define PROFILE_STOP(msg) (void)0 - -#endif // ENABLE_PROFILING - -namespace talk_base { - -// Tracks information for one profiler event. -class ProfilerEvent { - public: - ProfilerEvent(); - void Start(); - void Stop(); - void Stop(uint64 stop_time); - double standard_deviation() const; - double total_time() const { return total_time_; } - double mean() const { return mean_; } - double minimum() const { return minimum_; } - double maximum() const { return maximum_; } - int event_count() const { return event_count_; } - bool is_started() const { return start_count_ > 0; } - - private: - uint64 current_start_time_; - double total_time_; - double mean_; - double sum_of_squared_differences_; - double minimum_; - double maximum_; - int start_count_; - int event_count_; -}; - -// Singleton that owns ProfilerEvents and reports results. Prefer to use -// macros, defined above, rather than directly calling Profiler methods. -class Profiler { - public: - void StartEvent(const std::string& event_name); - void StopEvent(const std::string& event_name); - void ReportToLog(const char* file, int line, LoggingSeverity severity_to_use, - const std::string& event_prefix); - void ReportAllToLog(const char* file, int line, - LoggingSeverity severity_to_use); - const ProfilerEvent* GetEvent(const std::string& event_name) const; - // Clears all _stopped_ events. Returns true if _all_ events were cleared. - bool Clear(); - - static Profiler* Instance(); - private: - Profiler() {} - - typedef std::map EventMap; - EventMap events_; - mutable SharedExclusiveLock lock_; - - DISALLOW_COPY_AND_ASSIGN(Profiler); -}; - -// Starts an event on construction and stops it on destruction. -// Used by PROFILE macro. -class ProfilerScope { - public: - explicit ProfilerScope(const std::string& event_name) - : event_name_(event_name) { - Profiler::Instance()->StartEvent(event_name_); - } - ~ProfilerScope() { - Profiler::Instance()->StopEvent(event_name_); - } - private: - std::string event_name_; - - DISALLOW_COPY_AND_ASSIGN(ProfilerScope); -}; - -std::ostream& operator<<(std::ostream& stream, - const ProfilerEvent& profiler_event); - -} // namespace talk_base - -#endif // TALK_BASE_PROFILER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/proxydetect.h b/thirdparties/common/include/webrtc-sdk/talk/base/proxydetect.h deleted file mode 100755 index f2a1450..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/proxydetect.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * libjingle - * Copyright 2007, 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 _PROXYDETECT_H_ -#define _PROXYDETECT_H_ - -#include "talk/base/proxyinfo.h" - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -namespace talk_base { -// Auto-detect the proxy server. Returns true if a proxy is configured, -// although hostname may be empty if the proxy is not required for -// the given URL. - -bool GetProxySettingsForUrl(const char* agent, const char* url, - talk_base::ProxyInfo* proxy, - bool long_operation = false); - -} // namespace talk_base - -#endif // _PROXYDETECT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/proxyinfo.h b/thirdparties/common/include/webrtc-sdk/talk/base/proxyinfo.h deleted file mode 100755 index e182cd5..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/proxyinfo.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_PROXYINFO_H__ -#define TALK_BASE_PROXYINFO_H__ - -#include -#include "talk/base/socketaddress.h" -#include "talk/base/cryptstring.h" - -namespace talk_base { - -enum ProxyType { - PROXY_NONE, - PROXY_HTTPS, - PROXY_SOCKS5, - PROXY_UNKNOWN -}; -const char * ProxyToString(ProxyType proxy); - -struct ProxyInfo { - ProxyType type; - SocketAddress address; - std::string autoconfig_url; - bool autodetect; - std::string bypass_list; - std::string username; - CryptString password; - - ProxyInfo() : type(PROXY_NONE), autodetect(false) { } -}; - -} // namespace talk_base - -#endif // TALK_BASE_PROXYINFO_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/proxyserver.h b/thirdparties/common/include/webrtc-sdk/talk/base/proxyserver.h deleted file mode 100755 index 1858ee1..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/proxyserver.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_PROXYSERVER_H_ -#define TALK_BASE_PROXYSERVER_H_ - -#include -#include "talk/base/asyncsocket.h" -#include "talk/base/socketadapters.h" -#include "talk/base/socketaddress.h" -#include "talk/base/stream.h" - -namespace talk_base { - -class SocketFactory; - -// ProxyServer is a base class that allows for easy construction of proxy -// servers. With its helper class ProxyBinding, it contains all the necessary -// logic for receiving and bridging connections. The specific client-server -// proxy protocol is implemented by an instance of the AsyncProxyServerSocket -// class; children of ProxyServer implement WrapSocket appropriately to return -// the correct protocol handler. - -class ProxyBinding : public sigslot::has_slots<> { - public: - ProxyBinding(AsyncProxyServerSocket* in_socket, AsyncSocket* out_socket); - sigslot::signal1 SignalDestroyed; - - private: - void OnConnectRequest(AsyncProxyServerSocket* socket, - const SocketAddress& addr); - void OnInternalRead(AsyncSocket* socket); - void OnInternalWrite(AsyncSocket* socket); - void OnInternalClose(AsyncSocket* socket, int err); - void OnExternalConnect(AsyncSocket* socket); - void OnExternalRead(AsyncSocket* socket); - void OnExternalWrite(AsyncSocket* socket); - void OnExternalClose(AsyncSocket* socket, int err); - - static void Read(AsyncSocket* socket, FifoBuffer* buffer); - static void Write(AsyncSocket* socket, FifoBuffer* buffer); - void Destroy(); - - static const int kBufferSize = 4096; - scoped_ptr int_socket_; - scoped_ptr ext_socket_; - bool connected_; - FifoBuffer out_buffer_; - FifoBuffer in_buffer_; - DISALLOW_EVIL_CONSTRUCTORS(ProxyBinding); -}; - -class ProxyServer : public sigslot::has_slots<> { - public: - ProxyServer(SocketFactory* int_factory, const SocketAddress& int_addr, - SocketFactory* ext_factory, const SocketAddress& ext_ip); - virtual ~ProxyServer(); - - protected: - void OnAcceptEvent(AsyncSocket* socket); - virtual AsyncProxyServerSocket* WrapSocket(AsyncSocket* socket) = 0; - void OnBindingDestroyed(ProxyBinding* binding); - - private: - typedef std::list BindingList; - SocketFactory* ext_factory_; - SocketAddress ext_ip_; - scoped_ptr server_socket_; - BindingList bindings_; - DISALLOW_EVIL_CONSTRUCTORS(ProxyServer); -}; - -// SocksProxyServer is a simple extension of ProxyServer to implement SOCKS. -class SocksProxyServer : public ProxyServer { - public: - SocksProxyServer(SocketFactory* int_factory, const SocketAddress& int_addr, - SocketFactory* ext_factory, const SocketAddress& ext_ip) - : ProxyServer(int_factory, int_addr, ext_factory, ext_ip) { - } - protected: - AsyncProxyServerSocket* WrapSocket(AsyncSocket* socket) { - return new AsyncSocksProxyServerSocket(socket); - } - DISALLOW_EVIL_CONSTRUCTORS(SocksProxyServer); -}; - -} // namespace talk_base - -#endif // TALK_BASE_PROXYSERVER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/ratelimiter.h b/thirdparties/common/include/webrtc-sdk/talk/base/ratelimiter.h deleted file mode 100755 index 6a7ee40..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/ratelimiter.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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_BASE_RATELIMITER_H_ -#define TALK_BASE_RATELIMITER_H_ - -#include -#include "talk/base/basictypes.h" - -namespace talk_base { - -// Limits the rate of use to a certain maximum quantity per period of -// time. Use, for example, for simple bandwidth throttling. -// -// It's implemented like a diet plan: You have so many calories per -// day. If you hit the limit, you can't eat any more until the next -// day. -class RateLimiter { - public: - // For example, 100kb per second. - RateLimiter(size_t max, double period) - : max_per_period_(max), - period_length_(period), - used_in_period_(0), - period_start_(0.0), - period_end_(period) { - } - virtual ~RateLimiter() {} - - // Returns true if if the desired quantity is available in the - // current period (< (max - used)). Once the given time passes the - // end of the period, used is set to zero and more use is available. - bool CanUse(size_t desired, double time); - // Increment the quantity used this period. If past the end of a - // period, a new period is started. - void Use(size_t used, double time); - - size_t used_in_period() const { - return used_in_period_; - } - - size_t max_per_period() const { - return max_per_period_; - } - - private: - size_t max_per_period_; - double period_length_; - size_t used_in_period_; - double period_start_; - double period_end_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_RATELIMITER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/ratetracker.h b/thirdparties/common/include/webrtc-sdk/talk/base/ratetracker.h deleted file mode 100755 index 61fd41a..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/ratetracker.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_BASE_RATETRACKER_H_ -#define TALK_BASE_RATETRACKER_H_ - -#include -#include "talk/base/basictypes.h" - -namespace talk_base { - -// Computes instantaneous units per second. -class RateTracker { - public: - RateTracker(); - virtual ~RateTracker() {} - - size_t total_units() const; - size_t units_second(); - void Update(size_t units); - - protected: - // overrideable for tests - virtual uint32 Time() const; - - private: - size_t total_units_; - size_t units_second_; - uint32 last_units_second_time_; - size_t last_units_second_calc_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_RATETRACKER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/refcount.h b/thirdparties/common/include/webrtc-sdk/talk/base/refcount.h deleted file mode 100755 index 7025f6c..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/refcount.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * 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_BASE_REFCOUNT_H_ -#define TALK_APP_BASE_REFCOUNT_H_ - -#include - -#include "talk/base/criticalsection.h" - -namespace talk_base { - -// Reference count interface. -class RefCountInterface { - public: - virtual int AddRef() = 0; - virtual int Release() = 0; - protected: - virtual ~RefCountInterface() {} -}; - -template -class RefCountedObject : public T { - public: - RefCountedObject() : ref_count_(0) { - } - - template - explicit RefCountedObject(P p) : T(p), ref_count_(0) { - } - - template - RefCountedObject(P1 p1, P2 p2) : T(p1, p2), ref_count_(0) { - } - - template - RefCountedObject(P1 p1, P2 p2, P3 p3) : T(p1, p2, p3), ref_count_(0) { - } - - template - RefCountedObject(P1 p1, P2 p2, P3 p3, P4 p4) - : T(p1, p2, p3, p4), ref_count_(0) { - } - - template - RefCountedObject(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) - : T(p1, p2, p3, p4, p5), ref_count_(0) { - } - - virtual int AddRef() { - return talk_base::AtomicOps::Increment(&ref_count_); - } - - virtual int Release() { - int count = talk_base::AtomicOps::Decrement(&ref_count_); - if (!count) { - delete this; - } - return count; - } - - protected: - virtual ~RefCountedObject() { - } - - int ref_count_; -}; - -} // namespace talk_base - -#endif // TALK_APP_BASE_REFCOUNT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/referencecountedsingletonfactory.h b/thirdparties/common/include/webrtc-sdk/talk/base/referencecountedsingletonfactory.h deleted file mode 100755 index b9eebbd..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/referencecountedsingletonfactory.h +++ /dev/null @@ -1,174 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_BASE_REFERENCECOUNTEDSINGLETONFACTORY_H_ -#define TALK_BASE_REFERENCECOUNTEDSINGLETONFACTORY_H_ - -#include "talk/base/common.h" -#include "talk/base/criticalsection.h" -#include "talk/base/logging.h" -#include "talk/base/scoped_ptr.h" - -namespace talk_base { - -template class rcsf_ptr; - -// A ReferenceCountedSingletonFactory is an object which owns another object, -// and doles out the owned object to consumers in a reference-counted manner. -// Thus, the factory owns at most one object of the desired kind, and -// hands consumers a special pointer to it, through which they can access it. -// When the consumers delete the pointer, the reference count goes down, -// and if the reference count hits zero, the factory can throw the object -// away. If a consumer requests the pointer and the factory has none, -// it can create one on the fly and pass it back. -template -class ReferenceCountedSingletonFactory { - friend class rcsf_ptr; - public: - ReferenceCountedSingletonFactory() : ref_count_(0) {} - - virtual ~ReferenceCountedSingletonFactory() { - ASSERT(ref_count_ == 0); - } - - protected: - // Must be implemented in a sub-class. The sub-class may choose whether or not - // to cache the instance across lifetimes by either reset()'ing or not - // reset()'ing the scoped_ptr in CleanupInstance(). - virtual bool SetupInstance() = 0; - virtual void CleanupInstance() = 0; - - scoped_ptr instance_; - - private: - Interface* GetInstance() { - talk_base::CritScope cs(&crit_); - if (ref_count_ == 0) { - if (!SetupInstance()) { - LOG(LS_VERBOSE) << "Failed to setup instance"; - return NULL; - } - ASSERT(instance_.get() != NULL); - } - ++ref_count_; - - LOG(LS_VERBOSE) << "Number of references: " << ref_count_; - return instance_.get(); - } - - void ReleaseInstance() { - talk_base::CritScope cs(&crit_); - ASSERT(ref_count_ > 0); - ASSERT(instance_.get() != NULL); - --ref_count_; - LOG(LS_VERBOSE) << "Number of references: " << ref_count_; - if (ref_count_ == 0) { - CleanupInstance(); - } - } - - CriticalSection crit_; - int ref_count_; - - DISALLOW_COPY_AND_ASSIGN(ReferenceCountedSingletonFactory); -}; - -template -class rcsf_ptr { - public: - // Create a pointer that uses the factory to get the instance. - // This is lazy - it won't generate the instance until it is requested. - explicit rcsf_ptr(ReferenceCountedSingletonFactory* factory) - : instance_(NULL), - factory_(factory) { - } - - ~rcsf_ptr() { - release(); - } - - Interface& operator*() { - EnsureAcquired(); - return *instance_; - } - - Interface* operator->() { - EnsureAcquired(); - return instance_; - } - - // Gets the pointer, creating the singleton if necessary. May return NULL if - // creation failed. - Interface* get() { - Acquire(); - return instance_; - } - - // Set instance to NULL and tell the factory we aren't using the instance - // anymore. - void release() { - if (instance_) { - instance_ = NULL; - factory_->ReleaseInstance(); - } - } - - // Lets us know whether instance is valid or not right now. - // Even though attempts to use the instance will automatically create it, it - // is advisable to check this because creation can fail. - bool valid() const { - return instance_ != NULL; - } - - // Returns the factory that this pointer is using. - ReferenceCountedSingletonFactory* factory() const { - return factory_; - } - - private: - void EnsureAcquired() { - Acquire(); - ASSERT(instance_ != NULL); - } - - void Acquire() { - // Since we're getting a singleton back, acquire is a noop if instance is - // already populated. - if (!instance_) { - instance_ = factory_->GetInstance(); - } - } - - Interface* instance_; - ReferenceCountedSingletonFactory* factory_; - - DISALLOW_IMPLICIT_CONSTRUCTORS(rcsf_ptr); -}; - -}; // namespace talk_base - -#endif // TALK_BASE_REFERENCECOUNTEDSINGLETONFACTORY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/rollingaccumulator.h b/thirdparties/common/include/webrtc-sdk/talk/base/rollingaccumulator.h deleted file mode 100755 index 3e45d4b..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/rollingaccumulator.h +++ /dev/null @@ -1,189 +0,0 @@ -/* - * 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_BASE_ROLLINGACCUMULATOR_H_ -#define TALK_BASE_ROLLINGACCUMULATOR_H_ - -#include - -#include "talk/base/common.h" - -namespace talk_base { - -// RollingAccumulator stores and reports statistics -// over N most recent samples. -// -// T is assumed to be an int, long, double or float. -template -class RollingAccumulator { - public: - explicit RollingAccumulator(size_t max_count) - : samples_(max_count) { - Reset(); - } - ~RollingAccumulator() { - } - - size_t max_count() const { - return samples_.size(); - } - - size_t count() const { - return count_; - } - - void Reset() { - count_ = 0U; - next_index_ = 0U; - sum_ = 0.0; - sum_2_ = 0.0; - max_ = T(); - max_stale_ = false; - min_ = T(); - min_stale_ = false; - } - - void AddSample(T sample) { - if (count_ == max_count()) { - // Remove oldest sample. - T sample_to_remove = samples_[next_index_]; - sum_ -= sample_to_remove; - sum_2_ -= sample_to_remove * sample_to_remove; - if (sample_to_remove >= max_) { - max_stale_ = true; - } - if (sample_to_remove <= min_) { - min_stale_ = true; - } - } else { - // Increase count of samples. - ++count_; - } - // Add new sample. - samples_[next_index_] = sample; - sum_ += sample; - sum_2_ += sample * sample; - if (count_ == 1 || sample >= max_) { - max_ = sample; - max_stale_ = false; - } - if (count_ == 1 || sample <= min_) { - min_ = sample; - min_stale_ = false; - } - // Update next_index_. - next_index_ = (next_index_ + 1) % max_count(); - } - - T ComputeSum() const { - return static_cast(sum_); - } - - double ComputeMean() const { - if (count_ == 0) { - return 0.0; - } - return sum_ / count_; - } - - T ComputeMax() const { - if (max_stale_) { - ASSERT(count_ > 0 && - "It shouldn't be possible for max_stale_ && count_ == 0"); - max_ = samples_[next_index_]; - for (size_t i = 1u; i < count_; i++) { - max_ = _max(max_, samples_[(next_index_ + i) % max_count()]); - } - max_stale_ = false; - } - return max_; - } - - T ComputeMin() const { - if (min_stale_) { - ASSERT(count_ > 0 && - "It shouldn't be possible for min_stale_ && count_ == 0"); - min_ = samples_[next_index_]; - for (size_t i = 1u; i < count_; i++) { - min_ = _min(min_, samples_[(next_index_ + i) % max_count()]); - } - min_stale_ = false; - } - return min_; - } - - // O(n) time complexity. - // Weights nth sample with weight (learning_rate)^n. Learning_rate should be - // between (0.0, 1.0], otherwise the non-weighted mean is returned. - double ComputeWeightedMean(double learning_rate) const { - if (count_ < 1 || learning_rate <= 0.0 || learning_rate >= 1.0) { - return ComputeMean(); - } - double weighted_mean = 0.0; - double current_weight = 1.0; - double weight_sum = 0.0; - const size_t max_size = max_count(); - for (size_t i = 0; i < count_; ++i) { - current_weight *= learning_rate; - weight_sum += current_weight; - // Add max_size to prevent underflow. - size_t index = (next_index_ + max_size - i - 1) % max_size; - weighted_mean += current_weight * samples_[index]; - } - return weighted_mean / weight_sum; - } - - // Compute estimated variance. Estimation is more accurate - // as the number of samples grows. - double ComputeVariance() const { - if (count_ == 0) { - return 0.0; - } - // Var = E[x^2] - (E[x])^2 - double count_inv = 1.0 / count_; - double mean_2 = sum_2_ * count_inv; - double mean = sum_ * count_inv; - return mean_2 - (mean * mean); - } - - private: - size_t count_; - size_t next_index_; - double sum_; // Sum(x) - double to avoid overflow - double sum_2_; // Sum(x*x) - double to avoid overflow - mutable T max_; - mutable bool max_stale_; - mutable T min_; - mutable bool min_stale_; - std::vector samples_; - - DISALLOW_COPY_AND_ASSIGN(RollingAccumulator); -}; - -} // namespace talk_base - -#endif // TALK_BASE_ROLLINGACCUMULATOR_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/safe_conversions.h b/thirdparties/common/include/webrtc-sdk/talk/base/safe_conversions.h deleted file mode 100755 index d258dfb..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/safe_conversions.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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. - */ - -// Borrowed from Chromium's src/base/numerics/safe_conversions.h. - -#ifndef TALK_BASE_SAFE_CONVERSIONS_H_ -#define TALK_BASE_SAFE_CONVERSIONS_H_ - -#include - -#include "talk/base/common.h" -#include "talk/base/logging.h" -#include "talk/base/safe_conversions_impl.h" - -namespace talk_base { - -inline void Check(bool condition) { - if (!condition) { - LOG(LS_ERROR) << "CHECK failed."; - Break(); - // The program should have crashed at this point. - } -} - -// Convenience function that returns true if the supplied value is in range -// for the destination type. -template -inline bool IsValueInRangeForNumericType(Src value) { - return internal::RangeCheck(value) == internal::TYPE_VALID; -} - -// checked_cast<> is analogous to static_cast<> for numeric types, -// except that it CHECKs that the specified numeric conversion will not -// overflow or underflow. NaN source will always trigger a CHECK. -template -inline Dst checked_cast(Src value) { - Check(IsValueInRangeForNumericType(value)); - return static_cast(value); -} - -// saturated_cast<> is analogous to static_cast<> for numeric types, except -// that the specified numeric conversion will saturate rather than overflow or -// underflow. NaN assignment to an integral will trigger a CHECK condition. -template -inline Dst saturated_cast(Src value) { - // Optimization for floating point values, which already saturate. - if (std::numeric_limits::is_iec559) - return static_cast(value); - - switch (internal::RangeCheck(value)) { - case internal::TYPE_VALID: - return static_cast(value); - - case internal::TYPE_UNDERFLOW: - return std::numeric_limits::min(); - - case internal::TYPE_OVERFLOW: - return std::numeric_limits::max(); - - // Should fail only on attempting to assign NaN to a saturated integer. - case internal::TYPE_INVALID: - Check(false); - return std::numeric_limits::max(); - } - - Check(false); // NOTREACHED(); - return static_cast(value); -} - -} // namespace talk_base - -#endif // TALK_BASE_SAFE_CONVERSIONS_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/safe_conversions_impl.h b/thirdparties/common/include/webrtc-sdk/talk/base/safe_conversions_impl.h deleted file mode 100755 index 82c942a..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/safe_conversions_impl.h +++ /dev/null @@ -1,205 +0,0 @@ -/* - * 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. - */ - -// Borrowed from Chromium's src/base/numerics/safe_conversions_impl.h. - -#ifndef TALK_BASE_SAFE_CONVERSIONS_IMPL_H_ -#define TALK_BASE_SAFE_CONVERSIONS_IMPL_H_ - -#include - -namespace talk_base { -namespace internal { - -enum DstSign { - DST_UNSIGNED, - DST_SIGNED -}; - -enum SrcSign { - SRC_UNSIGNED, - SRC_SIGNED -}; - -enum DstRange { - OVERLAPS_RANGE, - CONTAINS_RANGE -}; - -// Helper templates to statically determine if our destination type can contain -// all values represented by the source type. - -template ::is_signed ? - DST_SIGNED : DST_UNSIGNED, - SrcSign IsSrcSigned = std::numeric_limits::is_signed ? - SRC_SIGNED : SRC_UNSIGNED> -struct StaticRangeCheck {}; - -template -struct StaticRangeCheck { - typedef std::numeric_limits DstLimits; - typedef std::numeric_limits SrcLimits; - // Compare based on max_exponent, which we must compute for integrals. - static const size_t kDstMaxExponent = DstLimits::is_iec559 ? - DstLimits::max_exponent : - (sizeof(Dst) * 8 - 1); - static const size_t kSrcMaxExponent = SrcLimits::is_iec559 ? - SrcLimits::max_exponent : - (sizeof(Src) * 8 - 1); - static const DstRange value = kDstMaxExponent >= kSrcMaxExponent ? - CONTAINS_RANGE : OVERLAPS_RANGE; -}; - -template -struct StaticRangeCheck { - static const DstRange value = sizeof(Dst) >= sizeof(Src) ? - CONTAINS_RANGE : OVERLAPS_RANGE; -}; - -template -struct StaticRangeCheck { - typedef std::numeric_limits DstLimits; - typedef std::numeric_limits SrcLimits; - // Compare based on max_exponent, which we must compute for integrals. - static const size_t kDstMaxExponent = DstLimits::is_iec559 ? - DstLimits::max_exponent : - (sizeof(Dst) * 8 - 1); - static const size_t kSrcMaxExponent = sizeof(Src) * 8; - static const DstRange value = kDstMaxExponent >= kSrcMaxExponent ? - CONTAINS_RANGE : OVERLAPS_RANGE; -}; - -template -struct StaticRangeCheck { - static const DstRange value = OVERLAPS_RANGE; -}; - - -enum RangeCheckResult { - TYPE_VALID = 0, // Value can be represented by the destination type. - TYPE_UNDERFLOW = 1, // Value would overflow. - TYPE_OVERFLOW = 2, // Value would underflow. - TYPE_INVALID = 3 // Source value is invalid (i.e. NaN). -}; - -// This macro creates a RangeCheckResult from an upper and lower bound -// check by taking advantage of the fact that only NaN can be out of range in -// both directions at once. -#define BASE_NUMERIC_RANGE_CHECK_RESULT(is_in_upper_bound, is_in_lower_bound) \ - RangeCheckResult(((is_in_upper_bound) ? 0 : TYPE_OVERFLOW) | \ - ((is_in_lower_bound) ? 0 : TYPE_UNDERFLOW)) - -template ::is_signed ? - DST_SIGNED : DST_UNSIGNED, - SrcSign IsSrcSigned = std::numeric_limits::is_signed ? - SRC_SIGNED : SRC_UNSIGNED, - DstRange IsSrcRangeContained = StaticRangeCheck::value> -struct RangeCheckImpl {}; - -// The following templates are for ranges that must be verified at runtime. We -// split it into checks based on signedness to avoid confusing casts and -// compiler warnings on signed an unsigned comparisons. - -// Dst range always contains the result: nothing to check. -template -struct RangeCheckImpl { - static RangeCheckResult Check(Src value) { - return TYPE_VALID; - } -}; - -// Signed to signed narrowing. -template -struct RangeCheckImpl { - static RangeCheckResult Check(Src value) { - typedef std::numeric_limits DstLimits; - return DstLimits::is_iec559 ? - BASE_NUMERIC_RANGE_CHECK_RESULT( - value <= static_cast(DstLimits::max()), - value >= static_cast(DstLimits::max() * -1)) : - BASE_NUMERIC_RANGE_CHECK_RESULT( - value <= static_cast(DstLimits::max()), - value >= static_cast(DstLimits::min())); - } -}; - -// Unsigned to unsigned narrowing. -template -struct RangeCheckImpl { - static RangeCheckResult Check(Src value) { - typedef std::numeric_limits DstLimits; - return BASE_NUMERIC_RANGE_CHECK_RESULT( - value <= static_cast(DstLimits::max()), true); - } -}; - -// Unsigned to signed. -template -struct RangeCheckImpl { - static RangeCheckResult Check(Src value) { - typedef std::numeric_limits DstLimits; - return sizeof(Dst) > sizeof(Src) ? TYPE_VALID : - BASE_NUMERIC_RANGE_CHECK_RESULT( - value <= static_cast(DstLimits::max()), true); - } -}; - -// Signed to unsigned. -template -struct RangeCheckImpl { - static RangeCheckResult Check(Src value) { - typedef std::numeric_limits DstLimits; - typedef std::numeric_limits SrcLimits; - // Compare based on max_exponent, which we must compute for integrals. - static const size_t kDstMaxExponent = sizeof(Dst) * 8; - static const size_t kSrcMaxExponent = SrcLimits::is_iec559 ? - SrcLimits::max_exponent : - (sizeof(Src) * 8 - 1); - return (kDstMaxExponent >= kSrcMaxExponent) ? - BASE_NUMERIC_RANGE_CHECK_RESULT(true, value >= static_cast(0)) : - BASE_NUMERIC_RANGE_CHECK_RESULT( - value <= static_cast(DstLimits::max()), - value >= static_cast(0)); - } -}; - -template -inline RangeCheckResult RangeCheck(Src value) { - COMPILE_ASSERT(std::numeric_limits::is_specialized, - argument_must_be_numeric); - COMPILE_ASSERT(std::numeric_limits::is_specialized, - result_must_be_numeric); - return RangeCheckImpl::Check(value); -} - -} // namespace internal -} // namespace talk_base - -#endif // TALK_BASE_SAFE_CONVERSIONS_IMPL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/schanneladapter.h b/thirdparties/common/include/webrtc-sdk/talk/base/schanneladapter.h deleted file mode 100755 index 7373bc8..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/schanneladapter.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_SCHANNELADAPTER_H__ -#define TALK_BASE_SCHANNELADAPTER_H__ - -#include -#include "talk/base/ssladapter.h" -#include "talk/base/messagequeue.h" -struct _SecBufferDesc; - -namespace talk_base { - -/////////////////////////////////////////////////////////////////////////////// - -class SChannelAdapter : public SSLAdapter, public MessageHandler { -public: - SChannelAdapter(AsyncSocket* socket); - virtual ~SChannelAdapter(); - - virtual int StartSSL(const char* hostname, bool restartable); - virtual int Send(const void* pv, size_t cb); - virtual int Recv(void* pv, size_t cb); - virtual int Close(); - - // Note that the socket returns ST_CONNECTING while SSL is being negotiated. - virtual ConnState GetState() const; - -protected: - enum SSLState { - SSL_NONE, SSL_WAIT, SSL_CONNECTING, SSL_CONNECTED, SSL_ERROR - }; - struct SSLImpl; - - virtual void OnConnectEvent(AsyncSocket* socket); - virtual void OnReadEvent(AsyncSocket* socket); - virtual void OnWriteEvent(AsyncSocket* socket); - virtual void OnCloseEvent(AsyncSocket* socket, int err); - virtual void OnMessage(Message* pmsg); - - int BeginSSL(); - int ContinueSSL(); - int ProcessContext(long int status, _SecBufferDesc* sbd_in, - _SecBufferDesc* sbd_out); - int DecryptData(); - - int Read(); - int Flush(); - void Error(const char* context, int err, bool signal = true); - void Cleanup(); - - void PostEvent(); - -private: - SSLState state_; - std::string ssl_host_name_; - // If true, socket will retain SSL configuration after Close. - bool restartable_; - // If true, we are delaying signalling close until all data is read. - bool signal_close_; - // If true, we are waiting to be woken up to signal readability or closure. - bool message_pending_; - SSLImpl* impl_; -}; - -///////////////////////////////////////////////////////////////////////////// - -} // namespace talk_base - -#endif // TALK_BASE_SCHANNELADAPTER_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/scoped_autorelease_pool.h b/thirdparties/common/include/webrtc-sdk/talk/base/scoped_autorelease_pool.h deleted file mode 100755 index e128ca4..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/scoped_autorelease_pool.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * libjingle - * Copyright 2008 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. - */ - -// Automatically initialize and and free an autoreleasepool. Never allocate -// an instance of this class using "new" - that will result in a compile-time -// error. Only use it as a stack object. -// -// Note: NSAutoreleasePool docs say that you should not normally need to -// declare an NSAutoreleasePool as a member of an object - but there's nothing -// that indicates it will be a problem, as long as the stack lifetime of the -// pool exactly matches the stack lifetime of the object. - -#ifndef TALK_BASE_SCOPED_AUTORELEASE_POOL_H__ -#define TALK_BASE_SCOPED_AUTORELEASE_POOL_H__ - -#if defined(IOS) || defined(OSX) - -#include "talk/base/common.h" - -// This header may be included from Obj-C files or C++ files. -#ifdef __OBJC__ -@class NSAutoreleasePool; -#else -class NSAutoreleasePool; -#endif - -namespace talk_base { - -class ScopedAutoreleasePool { - public: - ScopedAutoreleasePool(); - ~ScopedAutoreleasePool(); - - private: - // Declaring private overrides of new and delete here enforces the "only use - // as a stack object" discipline. - // - // Note: new is declared as "throw()" to get around a gcc warning about new - // returning NULL, but this method will never get called and therefore will - // never actually throw any exception. - void* operator new(size_t size) throw() { return NULL; } - void operator delete (void* ptr) {} - - NSAutoreleasePool* pool_; - - DISALLOW_EVIL_CONSTRUCTORS(ScopedAutoreleasePool); -}; - -} // namespace talk_base - -#endif // IOS || OSX -#endif // TALK_BASE_SCOPED_AUTORELEASE_POOL_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/scoped_ptr.h b/thirdparties/common/include/webrtc-sdk/talk/base/scoped_ptr.h deleted file mode 100755 index 964ae6e..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/scoped_ptr.h +++ /dev/null @@ -1,590 +0,0 @@ -// Borrowed from chromium. -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Scopers help you manage ownership of a pointer, helping you easily manage the -// a pointer within a scope, and automatically destroying the pointer at the -// end of a scope. There are two main classes you will use, which correspond -// to the operators new/delete and new[]/delete[]. -// -// Example usage (scoped_ptr): -// { -// scoped_ptr foo(new Foo("wee")); -// } // foo goes out of scope, releasing the pointer with it. -// -// { -// scoped_ptr foo; // No pointer managed. -// foo.reset(new Foo("wee")); // Now a pointer is managed. -// foo.reset(new Foo("wee2")); // Foo("wee") was destroyed. -// foo.reset(new Foo("wee3")); // Foo("wee2") was destroyed. -// foo->Method(); // Foo::Method() called. -// foo.get()->Method(); // Foo::Method() called. -// SomeFunc(foo.release()); // SomeFunc takes ownership, foo no longer -// // manages a pointer. -// foo.reset(new Foo("wee4")); // foo manages a pointer again. -// foo.reset(); // Foo("wee4") destroyed, foo no longer -// // manages a pointer. -// } // foo wasn't managing a pointer, so nothing was destroyed. -// -// Example usage (scoped_ptr): -// { -// scoped_ptr foo(new Foo[100]); -// foo.get()->Method(); // Foo::Method on the 0th element. -// foo[10].Method(); // Foo::Method on the 10th element. -// } -// -// These scopers also implement part of the functionality of C++11 unique_ptr -// in that they are "movable but not copyable." You can use the scopers in -// the parameter and return types of functions to signify ownership transfer -// in to and out of a function. When calling a function that has a scoper -// as the argument type, it must be called with the result of an analogous -// scoper's Pass() function or another function that generates a temporary; -// passing by copy will NOT work. Here is an example using scoped_ptr: -// -// void TakesOwnership(scoped_ptr arg) { -// // Do something with arg -// } -// scoped_ptr CreateFoo() { -// // No need for calling Pass() because we are constructing a temporary -// // for the return value. -// return scoped_ptr(new Foo("new")); -// } -// scoped_ptr PassThru(scoped_ptr arg) { -// return arg.Pass(); -// } -// -// { -// scoped_ptr ptr(new Foo("yay")); // ptr manages Foo("yay"). -// TakesOwnership(ptr.Pass()); // ptr no longer owns Foo("yay"). -// scoped_ptr ptr2 = CreateFoo(); // ptr2 owns the return Foo. -// scoped_ptr ptr3 = // ptr3 now owns what was in ptr2. -// PassThru(ptr2.Pass()); // ptr2 is correspondingly NULL. -// } -// -// Notice that if you do not call Pass() when returning from PassThru(), or -// when invoking TakesOwnership(), the code will not compile because scopers -// are not copyable; they only implement move semantics which require calling -// the Pass() function to signify a destructive transfer of state. CreateFoo() -// is different though because we are constructing a temporary on the return -// line and thus can avoid needing to call Pass(). -// -// Pass() properly handles upcast in initialization, i.e. you can use a -// scoped_ptr to initialize a scoped_ptr: -// -// scoped_ptr foo(new Foo()); -// scoped_ptr parent(foo.Pass()); -// -// PassAs<>() should be used to upcast return value in return statement: -// -// scoped_ptr CreateFoo() { -// scoped_ptr result(new FooChild()); -// return result.PassAs(); -// } -// -// Note that PassAs<>() is implemented only for scoped_ptr, but not for -// scoped_ptr. This is because casting array pointers may not be safe. - -#ifndef TALK_BASE_SCOPED_PTR_H__ -#define TALK_BASE_SCOPED_PTR_H__ - -#include // for ptrdiff_t -#include // for free() decl - -#include // For std::swap(). - -#include "talk/base/common.h" // for ASSERT -#include "talk/base/compile_assert.h" // for COMPILE_ASSERT -#include "talk/base/move.h" // for TALK_MOVE_ONLY_TYPE_FOR_CPP_03 -#include "talk/base/template_util.h" // for is_convertible, is_array - -#ifdef _WIN32 -namespace std { using ::ptrdiff_t; }; -#endif // _WIN32 - -namespace talk_base { - -// Function object which deletes its parameter, which must be a pointer. -// If C is an array type, invokes 'delete[]' on the parameter; otherwise, -// invokes 'delete'. The default deleter for scoped_ptr. -template -struct DefaultDeleter { - DefaultDeleter() {} - template DefaultDeleter(const DefaultDeleter& other) { - // IMPLEMENTATION NOTE: C++11 20.7.1.1.2p2 only provides this constructor - // if U* is implicitly convertible to T* and U is not an array type. - // - // Correct implementation should use SFINAE to disable this - // constructor. However, since there are no other 1-argument constructors, - // using a COMPILE_ASSERT() based on is_convertible<> and requiring - // complete types is simpler and will cause compile failures for equivalent - // misuses. - // - // Note, the is_convertible check also ensures that U is not an - // array. T is guaranteed to be a non-array, so any U* where U is an array - // cannot convert to T*. - enum { T_must_be_complete = sizeof(T) }; - enum { U_must_be_complete = sizeof(U) }; - COMPILE_ASSERT((talk_base::is_convertible::value), - U_ptr_must_implicitly_convert_to_T_ptr); - } - inline void operator()(T* ptr) const { - enum { type_must_be_complete = sizeof(T) }; - delete ptr; - } -}; - -// Specialization of DefaultDeleter for array types. -template -struct DefaultDeleter { - inline void operator()(T* ptr) const { - enum { type_must_be_complete = sizeof(T) }; - delete[] ptr; - } - - private: - // Disable this operator for any U != T because it is undefined to execute - // an array delete when the static type of the array mismatches the dynamic - // type. - // - // References: - // C++98 [expr.delete]p3 - // http://cplusplus.github.com/LWG/lwg-defects.html#938 - template void operator()(U* array) const; -}; - -template -struct DefaultDeleter { - // Never allow someone to declare something like scoped_ptr. - COMPILE_ASSERT(sizeof(T) == -1, do_not_use_array_with_size_as_type); -}; - -// Function object which invokes 'free' on its parameter, which must be -// a pointer. Can be used to store malloc-allocated pointers in scoped_ptr: -// -// scoped_ptr foo_ptr( -// static_cast(malloc(sizeof(int)))); -struct FreeDeleter { - inline void operator()(void* ptr) const { - free(ptr); - } -}; - -namespace internal { - -// Minimal implementation of the core logic of scoped_ptr, suitable for -// reuse in both scoped_ptr and its specializations. -template -class scoped_ptr_impl { - public: - explicit scoped_ptr_impl(T* p) : data_(p) { } - - // Initializer for deleters that have data parameters. - scoped_ptr_impl(T* p, const D& d) : data_(p, d) {} - - // Templated constructor that destructively takes the value from another - // scoped_ptr_impl. - template - scoped_ptr_impl(scoped_ptr_impl* other) - : data_(other->release(), other->get_deleter()) { - // We do not support move-only deleters. We could modify our move - // emulation to have talk_base::subtle::move() and - // talk_base::subtle::forward() - // functions that are imperfect emulations of their C++11 equivalents, - // but until there's a requirement, just assume deleters are copyable. - } - - template - void TakeState(scoped_ptr_impl* other) { - // See comment in templated constructor above regarding lack of support - // for move-only deleters. - reset(other->release()); - get_deleter() = other->get_deleter(); - } - - ~scoped_ptr_impl() { - if (data_.ptr != NULL) { - // Not using get_deleter() saves one function call in non-optimized - // builds. - static_cast(data_)(data_.ptr); - } - } - - void reset(T* p) { - // This is a self-reset, which is no longer allowed: http://crbug.com/162971 - if (p != NULL && p == data_.ptr) - abort(); - - // Note that running data_.ptr = p can lead to undefined behavior if - // get_deleter()(get()) deletes this. In order to pevent this, reset() - // should update the stored pointer before deleting its old value. - // - // However, changing reset() to use that behavior may cause current code to - // break in unexpected ways. If the destruction of the owned object - // dereferences the scoped_ptr when it is destroyed by a call to reset(), - // then it will incorrectly dispatch calls to |p| rather than the original - // value of |data_.ptr|. - // - // During the transition period, set the stored pointer to NULL while - // deleting the object. Eventually, this safety check will be removed to - // prevent the scenario initially described from occuring and - // http://crbug.com/176091 can be closed. - T* old = data_.ptr; - data_.ptr = NULL; - if (old != NULL) - static_cast(data_)(old); - data_.ptr = p; - } - - T* get() const { return data_.ptr; } - - D& get_deleter() { return data_; } - const D& get_deleter() const { return data_; } - - void swap(scoped_ptr_impl& p2) { - // Standard swap idiom: 'using std::swap' ensures that std::swap is - // present in the overload set, but we call swap unqualified so that - // any more-specific overloads can be used, if available. - using std::swap; - swap(static_cast(data_), static_cast(p2.data_)); - swap(data_.ptr, p2.data_.ptr); - } - - T* release() { - T* old_ptr = data_.ptr; - data_.ptr = NULL; - return old_ptr; - } - - T** accept() { - reset(NULL); - return &(data_.ptr); - } - - T** use() { - return &(data_.ptr); - } - - private: - // Needed to allow type-converting constructor. - template friend class scoped_ptr_impl; - - // Use the empty base class optimization to allow us to have a D - // member, while avoiding any space overhead for it when D is an - // empty class. See e.g. http://www.cantrip.org/emptyopt.html for a good - // discussion of this technique. - struct Data : public D { - explicit Data(T* ptr_in) : ptr(ptr_in) {} - Data(T* ptr_in, const D& other) : D(other), ptr(ptr_in) {} - T* ptr; - }; - - Data data_; - - DISALLOW_COPY_AND_ASSIGN(scoped_ptr_impl); -}; - -} // namespace internal - -// A scoped_ptr is like a T*, except that the destructor of scoped_ptr -// automatically deletes the pointer it holds (if any). -// That is, scoped_ptr owns the T object that it points to. -// Like a T*, a scoped_ptr may hold either NULL or a pointer to a T object. -// Also like T*, scoped_ptr is thread-compatible, and once you -// dereference it, you get the thread safety guarantees of T. -// -// The size of scoped_ptr is small. On most compilers, when using the -// DefaultDeleter, sizeof(scoped_ptr) == sizeof(T*). Custom deleters will -// increase the size proportional to whatever state they need to have. See -// comments inside scoped_ptr_impl<> for details. -// -// Current implementation targets having a strict subset of C++11's -// unique_ptr<> features. Known deficiencies include not supporting move-only -// deleteres, function pointers as deleters, and deleters with reference -// types. -template > -class scoped_ptr { - TALK_MOVE_ONLY_TYPE_FOR_CPP_03(scoped_ptr, RValue) - - public: - // The element and deleter types. - typedef T element_type; - typedef D deleter_type; - - // Constructor. Defaults to initializing with NULL. - scoped_ptr() : impl_(NULL) { } - - // Constructor. Takes ownership of p. - explicit scoped_ptr(element_type* p) : impl_(p) { } - - // Constructor. Allows initialization of a stateful deleter. - scoped_ptr(element_type* p, const D& d) : impl_(p, d) { } - - // Constructor. Allows construction from a scoped_ptr rvalue for a - // convertible type and deleter. - // - // IMPLEMENTATION NOTE: C++11 unique_ptr<> keeps this constructor distinct - // from the normal move constructor. By C++11 20.7.1.2.1.21, this constructor - // has different post-conditions if D is a reference type. Since this - // implementation does not support deleters with reference type, - // we do not need a separate move constructor allowing us to avoid one - // use of SFINAE. You only need to care about this if you modify the - // implementation of scoped_ptr. - template - scoped_ptr(scoped_ptr other) : impl_(&other.impl_) { - COMPILE_ASSERT(!talk_base::is_array::value, U_cannot_be_an_array); - } - - // Constructor. Move constructor for C++03 move emulation of this type. - scoped_ptr(RValue rvalue) : impl_(&rvalue.object->impl_) { } - - // operator=. Allows assignment from a scoped_ptr rvalue for a convertible - // type and deleter. - // - // IMPLEMENTATION NOTE: C++11 unique_ptr<> keeps this operator= distinct from - // the normal move assignment operator. By C++11 20.7.1.2.3.4, this templated - // form has different requirements on for move-only Deleters. Since this - // implementation does not support move-only Deleters, we do not need a - // separate move assignment operator allowing us to avoid one use of SFINAE. - // You only need to care about this if you modify the implementation of - // scoped_ptr. - template - scoped_ptr& operator=(scoped_ptr rhs) { - COMPILE_ASSERT(!talk_base::is_array::value, U_cannot_be_an_array); - impl_.TakeState(&rhs.impl_); - return *this; - } - - // Reset. Deletes the currently owned object, if any. - // Then takes ownership of a new object, if given. - void reset(element_type* p = NULL) { impl_.reset(p); } - - // Accessors to get the owned object. - // operator* and operator-> will assert() if there is no current object. - element_type& operator*() const { - ASSERT(impl_.get() != NULL); - return *impl_.get(); - } - element_type* operator->() const { - ASSERT(impl_.get() != NULL); - return impl_.get(); - } - element_type* get() const { return impl_.get(); } - - // Access to the deleter. - deleter_type& get_deleter() { return impl_.get_deleter(); } - const deleter_type& get_deleter() const { return impl_.get_deleter(); } - - // Allow scoped_ptr to be used in boolean expressions, but not - // implicitly convertible to a real bool (which is dangerous). - // - // Note that this trick is only safe when the == and != operators - // are declared explicitly, as otherwise "scoped_ptr1 == - // scoped_ptr2" will compile but do the wrong thing (i.e., convert - // to Testable and then do the comparison). - private: - typedef talk_base::internal::scoped_ptr_impl - scoped_ptr::*Testable; - - public: - operator Testable() const { return impl_.get() ? &scoped_ptr::impl_ : NULL; } - - // Comparison operators. - // These return whether two scoped_ptr refer to the same object, not just to - // two different but equal objects. - bool operator==(const element_type* p) const { return impl_.get() == p; } - bool operator!=(const element_type* p) const { return impl_.get() != p; } - - // Swap two scoped pointers. - void swap(scoped_ptr& p2) { - impl_.swap(p2.impl_); - } - - // Release a pointer. - // The return value is the current pointer held by this object. - // If this object holds a NULL pointer, the return value is NULL. - // After this operation, this object will hold a NULL pointer, - // and will not own the object any more. - element_type* release() WARN_UNUSED_RESULT { - return impl_.release(); - } - - // Delete the currently held pointer and return a pointer - // to allow overwriting of the current pointer address. - element_type** accept() WARN_UNUSED_RESULT { - return impl_.accept(); - } - - // Return a pointer to the current pointer address. - element_type** use() WARN_UNUSED_RESULT { - return impl_.use(); - } - - // C++98 doesn't support functions templates with default parameters which - // makes it hard to write a PassAs() that understands converting the deleter - // while preserving simple calling semantics. - // - // Until there is a use case for PassAs() with custom deleters, just ignore - // the custom deleter. - template - scoped_ptr PassAs() { - return scoped_ptr(Pass()); - } - - private: - // Needed to reach into |impl_| in the constructor. - template friend class scoped_ptr; - talk_base::internal::scoped_ptr_impl impl_; - - // Forbidden for API compatibility with std::unique_ptr. - explicit scoped_ptr(int disallow_construction_from_null); - - // Forbid comparison of scoped_ptr types. If U != T, it totally - // doesn't make sense, and if U == T, it still doesn't make sense - // because you should never have the same object owned by two different - // scoped_ptrs. - template bool operator==(scoped_ptr const& p2) const; - template bool operator!=(scoped_ptr const& p2) const; -}; - -template -class scoped_ptr { - TALK_MOVE_ONLY_TYPE_FOR_CPP_03(scoped_ptr, RValue) - - public: - // The element and deleter types. - typedef T element_type; - typedef D deleter_type; - - // Constructor. Defaults to initializing with NULL. - scoped_ptr() : impl_(NULL) { } - - // Constructor. Stores the given array. Note that the argument's type - // must exactly match T*. In particular: - // - it cannot be a pointer to a type derived from T, because it is - // inherently unsafe in the general case to access an array through a - // pointer whose dynamic type does not match its static type (eg., if - // T and the derived types had different sizes access would be - // incorrectly calculated). Deletion is also always undefined - // (C++98 [expr.delete]p3). If you're doing this, fix your code. - // - it cannot be NULL, because NULL is an integral expression, not a - // pointer to T. Use the no-argument version instead of explicitly - // passing NULL. - // - it cannot be const-qualified differently from T per unique_ptr spec - // (http://cplusplus.github.com/LWG/lwg-active.html#2118). Users wanting - // to work around this may use implicit_cast(). - // However, because of the first bullet in this comment, users MUST - // NOT use implicit_cast() to upcast the static type of the array. - explicit scoped_ptr(element_type* array) : impl_(array) { } - - // Constructor. Move constructor for C++03 move emulation of this type. - scoped_ptr(RValue rvalue) : impl_(&rvalue.object->impl_) { } - - // operator=. Move operator= for C++03 move emulation of this type. - scoped_ptr& operator=(RValue rhs) { - impl_.TakeState(&rhs.object->impl_); - return *this; - } - - // Reset. Deletes the currently owned array, if any. - // Then takes ownership of a new object, if given. - void reset(element_type* array = NULL) { impl_.reset(array); } - - // Accessors to get the owned array. - element_type& operator[](size_t i) const { - ASSERT(impl_.get() != NULL); - return impl_.get()[i]; - } - element_type* get() const { return impl_.get(); } - - // Access to the deleter. - deleter_type& get_deleter() { return impl_.get_deleter(); } - const deleter_type& get_deleter() const { return impl_.get_deleter(); } - - // Allow scoped_ptr to be used in boolean expressions, but not - // implicitly convertible to a real bool (which is dangerous). - private: - typedef talk_base::internal::scoped_ptr_impl - scoped_ptr::*Testable; - - public: - operator Testable() const { return impl_.get() ? &scoped_ptr::impl_ : NULL; } - - // Comparison operators. - // These return whether two scoped_ptr refer to the same object, not just to - // two different but equal objects. - bool operator==(element_type* array) const { return impl_.get() == array; } - bool operator!=(element_type* array) const { return impl_.get() != array; } - - // Swap two scoped pointers. - void swap(scoped_ptr& p2) { - impl_.swap(p2.impl_); - } - - // Release a pointer. - // The return value is the current pointer held by this object. - // If this object holds a NULL pointer, the return value is NULL. - // After this operation, this object will hold a NULL pointer, - // and will not own the object any more. - element_type* release() WARN_UNUSED_RESULT { - return impl_.release(); - } - - // Delete the currently held pointer and return a pointer - // to allow overwriting of the current pointer address. - element_type** accept() WARN_UNUSED_RESULT { - return impl_.accept(); - } - - // Return a pointer to the current pointer address. - element_type** use() WARN_UNUSED_RESULT { - return impl_.use(); - } - - private: - // Force element_type to be a complete type. - enum { type_must_be_complete = sizeof(element_type) }; - - // Actually hold the data. - talk_base::internal::scoped_ptr_impl impl_; - - // Disable initialization from any type other than element_type*, by - // providing a constructor that matches such an initialization, but is - // private and has no definition. This is disabled because it is not safe to - // call delete[] on an array whose static type does not match its dynamic - // type. - template explicit scoped_ptr(U* array); - explicit scoped_ptr(int disallow_construction_from_null); - - // Disable reset() from any type other than element_type*, for the same - // reasons as the constructor above. - template void reset(U* array); - void reset(int disallow_reset_from_null); - - // Forbid comparison of scoped_ptr types. If U != T, it totally - // doesn't make sense, and if U == T, it still doesn't make sense - // because you should never have the same object owned by two different - // scoped_ptrs. - template bool operator==(scoped_ptr const& p2) const; - template bool operator!=(scoped_ptr const& p2) const; -}; - -} // namespace talk_base - -// Free functions -template -void swap(talk_base::scoped_ptr& p1, talk_base::scoped_ptr& p2) { - p1.swap(p2); -} - -template -bool operator==(T* p1, const talk_base::scoped_ptr& p2) { - return p1 == p2.get(); -} - -template -bool operator!=(T* p1, const talk_base::scoped_ptr& p2) { - return p1 != p2.get(); -} - -#endif // #ifndef TALK_BASE_SCOPED_PTR_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/scoped_ref_ptr.h b/thirdparties/common/include/webrtc-sdk/talk/base/scoped_ref_ptr.h deleted file mode 100755 index 39b8af6..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/scoped_ref_ptr.h +++ /dev/null @@ -1,164 +0,0 @@ -/* - * 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. - */ - -// Originally these classes are from Chromium. -// http://src.chromium.org/viewvc/chrome/trunk/src/base/memory/ref_counted.h?view=markup - -// -// A smart pointer class for reference counted objects. Use this class instead -// of calling AddRef and Release manually on a reference counted object to -// avoid common memory leaks caused by forgetting to Release an object -// reference. Sample usage: -// -// class MyFoo : public RefCounted { -// ... -// }; -// -// void some_function() { -// scoped_refptr foo = new MyFoo(); -// foo->Method(param); -// // |foo| is released when this function returns -// } -// -// void some_other_function() { -// scoped_refptr foo = new MyFoo(); -// ... -// foo = NULL; // explicitly releases |foo| -// ... -// if (foo) -// foo->Method(param); -// } -// -// The above examples show how scoped_refptr acts like a pointer to T. -// Given two scoped_refptr classes, it is also possible to exchange -// references between the two objects, like so: -// -// { -// scoped_refptr a = new MyFoo(); -// scoped_refptr b; -// -// b.swap(a); -// // now, |b| references the MyFoo object, and |a| references NULL. -// } -// -// To make both |a| and |b| in the above example reference the same MyFoo -// object, simply use the assignment operator: -// -// { -// scoped_refptr a = new MyFoo(); -// scoped_refptr b; -// -// b = a; -// // now, |a| and |b| each own a reference to the same MyFoo object. -// } -// - -#ifndef TALK_BASE_SCOPED_REF_PTR_H_ -#define TALK_BASE_SCOPED_REF_PTR_H_ - -#include - -namespace talk_base { - -template -class scoped_refptr { - public: - scoped_refptr() : ptr_(NULL) { - } - - scoped_refptr(T* p) : ptr_(p) { - if (ptr_) - ptr_->AddRef(); - } - - scoped_refptr(const scoped_refptr& r) : ptr_(r.ptr_) { - if (ptr_) - ptr_->AddRef(); - } - - template - scoped_refptr(const scoped_refptr& r) : ptr_(r.get()) { - if (ptr_) - ptr_->AddRef(); - } - - ~scoped_refptr() { - if (ptr_) - ptr_->Release(); - } - - T* get() const { return ptr_; } - operator T*() const { return ptr_; } - T* operator->() const { return ptr_; } - - // Release a pointer. - // The return value is the current pointer held by this object. - // If this object holds a NULL pointer, the return value is NULL. - // After this operation, this object will hold a NULL pointer, - // and will not own the object any more. - T* release() { - T* retVal = ptr_; - ptr_ = NULL; - return retVal; - } - - scoped_refptr& operator=(T* p) { - // AddRef first so that self assignment should work - if (p) - p->AddRef(); - if (ptr_ ) - ptr_ ->Release(); - ptr_ = p; - return *this; - } - - scoped_refptr& operator=(const scoped_refptr& r) { - return *this = r.ptr_; - } - - template - scoped_refptr& operator=(const scoped_refptr& r) { - return *this = r.get(); - } - - void swap(T** pp) { - T* p = ptr_; - ptr_ = *pp; - *pp = p; - } - - void swap(scoped_refptr& r) { - swap(&r.ptr_); - } - - protected: - T* ptr_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_SCOPED_REF_PTR_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/scopedptrcollection.h b/thirdparties/common/include/webrtc-sdk/talk/base/scopedptrcollection.h deleted file mode 100755 index 2d07989..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/scopedptrcollection.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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. - */ - -// Stores a collection of pointers that are deleted when the container is -// destructed. - -#ifndef TALK_BASE_SCOPEDPTRCOLLECTION_H_ -#define TALK_BASE_SCOPEDPTRCOLLECTION_H_ - -#include -#include - -#include "talk/base/basictypes.h" -#include "talk/base/constructormagic.h" - -namespace talk_base { - -template -class ScopedPtrCollection { - public: - typedef std::vector VectorT; - - ScopedPtrCollection() { } - ~ScopedPtrCollection() { - for (typename VectorT::iterator it = collection_.begin(); - it != collection_.end(); ++it) { - delete *it; - } - } - - const VectorT& collection() const { return collection_; } - void Reserve(size_t size) { - collection_.reserve(size); - } - void PushBack(T* t) { - collection_.push_back(t); - } - - // Remove |t| from the collection without deleting it. - void Remove(T* t) { - collection_.erase(std::remove(collection_.begin(), collection_.end(), t), - collection_.end()); - } - - private: - VectorT collection_; - - DISALLOW_COPY_AND_ASSIGN(ScopedPtrCollection); -}; - -} // namespace talk_base - -#endif // TALK_BASE_SCOPEDPTRCOLLECTION_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/sec_buffer.h b/thirdparties/common/include/webrtc-sdk/talk/base/sec_buffer.h deleted file mode 100755 index 093eb23..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/sec_buffer.h +++ /dev/null @@ -1,173 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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. - */ - -// @file Contains utility classes that make it easier to use SecBuffers - -#ifndef TALK_BASE_SEC_BUFFER_H__ -#define TALK_BASE_SEC_BUFFER_H__ - -namespace talk_base { - -// A base class for CSecBuffer. Contains -// all implementation that does not require -// template arguments. -class CSecBufferBase : public SecBuffer { - public: - CSecBufferBase() { - Clear(); - } - - // Uses the SSPI to free a pointer, must be - // used for buffers returned from SSPI APIs. - static void FreeSSPI(void *ptr) { - if ( ptr ) { - SECURITY_STATUS status; - status = ::FreeContextBuffer(ptr); - ASSERT(SEC_E_OK == status); // "Freeing context buffer" - } - } - - // Deletes a buffer with operator delete - static void FreeDelete(void *ptr) { - delete [] reinterpret_cast(ptr); - } - - // A noop delete, for buffers over other - // people's memory - static void FreeNone(void *ptr) { - } - - protected: - // Clears the buffer to EMPTY & NULL - void Clear() { - this->BufferType = SECBUFFER_EMPTY; - this->cbBuffer = 0; - this->pvBuffer = NULL; - } -}; - -// Wrapper class for SecBuffer to take care -// of initialization and destruction. -template -class CSecBuffer: public CSecBufferBase { - public: - // Initializes buffer to empty & NULL - CSecBuffer() { - } - - // Frees any allocated memory - ~CSecBuffer() { - Release(); - } - - // Frees the buffer appropriately, and re-nulls - void Release() { - pfnFreeBuffer(this->pvBuffer); - Clear(); - } - - private: - // A placeholder function for compile-time asserts on the class - void CompileAsserts() { - // never invoked... - assert(false); // _T("Notreached") - - // This class must not extend the size of SecBuffer, since - // we use arrays of CSecBuffer in CSecBufferBundle below - cassert(sizeof(CSecBuffer == sizeof(SecBuffer))); - } -}; - -// Contains all generic implementation for the -// SecBufferBundle class -class SecBufferBundleBase { - public: -}; - -// A template class that bundles a SecBufferDesc with -// one or more SecBuffers for convenience. Can take -// care of deallocating buffers appropriately, as indicated -// by pfnFreeBuffer function. -// By default does no deallocation. -template -class CSecBufferBundle : public SecBufferBundleBase { - public: - // Constructs a security buffer bundle with num_buffers - // buffers, all of which are empty and nulled. - CSecBufferBundle() { - desc_.ulVersion = SECBUFFER_VERSION; - desc_.cBuffers = num_buffers; - desc_.pBuffers = buffers_; - } - - // Frees all currently used buffers. - ~CSecBufferBundle() { - Release(); - } - - // Accessor for the descriptor - PSecBufferDesc desc() { - return &desc_; - } - - // Accessor for the descriptor - const PSecBufferDesc desc() const { - return &desc_; - } - - // returns the i-th security buffer - SecBuffer &operator[] (size_t num) { - ASSERT(num < num_buffers); // "Buffer index out of bounds" - return buffers_[num]; - } - - // returns the i-th security buffer - const SecBuffer &operator[] (size_t num) const { - ASSERT(num < num_buffers); // "Buffer index out of bounds" - return buffers_[num]; - } - - // Frees all non-NULL security buffers, - // using the deallocation function - void Release() { - for ( size_t i = 0; i < num_buffers; ++i ) { - buffers_[i].Release(); - } - } - - private: - // Our descriptor - SecBufferDesc desc_; - // Our bundled buffers, each takes care of its own - // initialization and destruction - CSecBuffer buffers_[num_buffers]; -}; - -} // namespace talk_base - -#endif // TALK_BASE_SEC_BUFFER_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/sha1.h b/thirdparties/common/include/webrtc-sdk/talk/base/sha1.h deleted file mode 100755 index 09ab424..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/sha1.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SHA-1 in C - * By Steve Reid - * 100% Public Domain - * -*/ - -// Ported to C++, Google style and uses basictypes.h - -#ifndef TALK_BASE_SHA1_H_ -#define TALK_BASE_SHA1_H_ - -#include "talk/base/basictypes.h" - -struct SHA1_CTX { - uint32 state[5]; - // TODO: Change bit count to uint64. - uint32 count[2]; // Bit count of input. - uint8 buffer[64]; -}; - -#define SHA1_DIGEST_SIZE 20 - -void SHA1Init(SHA1_CTX* context); -void SHA1Update(SHA1_CTX* context, const uint8* data, size_t len); -void SHA1Final(SHA1_CTX* context, uint8 digest[SHA1_DIGEST_SIZE]); - -#endif // TALK_BASE_SHA1_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/sha1digest.h b/thirdparties/common/include/webrtc-sdk/talk/base/sha1digest.h deleted file mode 100755 index 786e46c..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/sha1digest.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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_BASE_SHA1DIGEST_H_ -#define TALK_BASE_SHA1DIGEST_H_ - -#include "talk/base/messagedigest.h" -#include "talk/base/sha1.h" - -namespace talk_base { - -// A simple wrapper for our SHA-1 implementation. -class Sha1Digest : public MessageDigest { - public: - enum { kSize = SHA1_DIGEST_SIZE }; - Sha1Digest() { - SHA1Init(&ctx_); - } - virtual size_t Size() const { - return kSize; - } - virtual void Update(const void* buf, size_t len) { - SHA1Update(&ctx_, static_cast(buf), len); - } - virtual size_t Finish(void* buf, size_t len) { - if (len < kSize) { - return 0; - } - SHA1Final(&ctx_, static_cast(buf)); - SHA1Init(&ctx_); // Reset for next use. - return kSize; - } - - private: - SHA1_CTX ctx_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_SHA1DIGEST_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/sharedexclusivelock.h b/thirdparties/common/include/webrtc-sdk/talk/base/sharedexclusivelock.h deleted file mode 100755 index 391e83c..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/sharedexclusivelock.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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_BASE_SHAREDEXCLUSIVELOCK_H_ -#define TALK_BASE_SHAREDEXCLUSIVELOCK_H_ - -#include "talk/base/constructormagic.h" -#include "talk/base/criticalsection.h" -#include "talk/base/event.h" - -namespace talk_base { - -// This class provides shared-exclusive lock. It can be used in cases like -// multiple-readers/single-writer model. -class SharedExclusiveLock { - public: - SharedExclusiveLock(); - - // Locking/unlocking methods. It is encouraged to use SharedScope or - // ExclusiveScope for protection. - void LockExclusive(); - void UnlockExclusive(); - void LockShared(); - void UnlockShared(); - - private: - talk_base::CriticalSection cs_exclusive_; - talk_base::CriticalSection cs_shared_; - talk_base::Event shared_count_is_zero_; - int shared_count_; - - DISALLOW_COPY_AND_ASSIGN(SharedExclusiveLock); -}; - -class SharedScope { - public: - explicit SharedScope(SharedExclusiveLock* lock) : lock_(lock) { - lock_->LockShared(); - } - - ~SharedScope() { - lock_->UnlockShared(); - } - - private: - SharedExclusiveLock* lock_; - - DISALLOW_COPY_AND_ASSIGN(SharedScope); -}; - -class ExclusiveScope { - public: - explicit ExclusiveScope(SharedExclusiveLock* lock) : lock_(lock) { - lock_->LockExclusive(); - } - - ~ExclusiveScope() { - lock_->UnlockExclusive(); - } - - private: - SharedExclusiveLock* lock_; - - DISALLOW_COPY_AND_ASSIGN(ExclusiveScope); -}; - -} // namespace talk_base - -#endif // TALK_BASE_SHAREDEXCLUSIVELOCK_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/signalthread.h b/thirdparties/common/include/webrtc-sdk/talk/base/signalthread.h deleted file mode 100755 index e141e5a..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/signalthread.h +++ /dev/null @@ -1,173 +0,0 @@ -/* - * libjingle - * Copyright 2004--2009, 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_BASE_SIGNALTHREAD_H_ -#define TALK_BASE_SIGNALTHREAD_H_ - -#include - -#include "talk/base/constructormagic.h" -#include "talk/base/sigslot.h" -#include "talk/base/thread.h" - -namespace talk_base { - -/////////////////////////////////////////////////////////////////////////////// -// SignalThread - Base class for worker threads. The main thread should call -// Start() to begin work, and then follow one of these models: -// Normal: Wait for SignalWorkDone, and then call Release to destroy. -// Cancellation: Call Release(true), to abort the worker thread. -// Fire-and-forget: Call Release(false), which allows the thread to run to -// completion, and then self-destruct without further notification. -// Periodic tasks: Wait for SignalWorkDone, then eventually call Start() -// again to repeat the task. When the instance isn't needed anymore, -// call Release. DoWork, OnWorkStart and OnWorkStop are called again, -// on a new thread. -// The subclass should override DoWork() to perform the background task. By -// periodically calling ContinueWork(), it can check for cancellation. -// OnWorkStart and OnWorkDone can be overridden to do pre- or post-work -// tasks in the context of the main thread. -/////////////////////////////////////////////////////////////////////////////// - -class SignalThread - : public sigslot::has_slots<>, - protected MessageHandler { - public: - SignalThread(); - - // Context: Main Thread. Call before Start to change the worker's name. - bool SetName(const std::string& name, const void* obj); - - // Context: Main Thread. Call before Start to change the worker's priority. - bool SetPriority(ThreadPriority priority); - - // Context: Main Thread. Call to begin the worker thread. - void Start(); - - // Context: Main Thread. If the worker thread is not running, deletes the - // object immediately. Otherwise, asks the worker thread to abort processing, - // and schedules the object to be deleted once the worker exits. - // SignalWorkDone will not be signalled. If wait is true, does not return - // until the thread is deleted. - void Destroy(bool wait); - - // Context: Main Thread. If the worker thread is complete, deletes the - // object immediately. Otherwise, schedules the object to be deleted once - // the worker thread completes. SignalWorkDone will be signalled. - void Release(); - - // Context: Main Thread. Signalled when work is complete. - sigslot::signal1 SignalWorkDone; - - enum { ST_MSG_WORKER_DONE, ST_MSG_FIRST_AVAILABLE }; - - protected: - virtual ~SignalThread(); - - Thread* worker() { return &worker_; } - - // Context: Main Thread. Subclass should override to do pre-work setup. - virtual void OnWorkStart() { } - - // Context: Worker Thread. Subclass should override to do work. - virtual void DoWork() = 0; - - // Context: Worker Thread. Subclass should call periodically to - // dispatch messages and determine if the thread should terminate. - bool ContinueWork(); - - // Context: Worker Thread. Subclass should override when extra work is - // needed to abort the worker thread. - virtual void OnWorkStop() { } - - // Context: Main Thread. Subclass should override to do post-work cleanup. - virtual void OnWorkDone() { } - - // Context: Any Thread. If subclass overrides, be sure to call the base - // implementation. Do not use (message_id < ST_MSG_FIRST_AVAILABLE) - virtual void OnMessage(Message *msg); - - private: - enum State { - kInit, // Initialized, but not started - kRunning, // Started and doing work - kReleasing, // Same as running, but to be deleted when work is done - kComplete, // Work is done - kStopping, // Work is being interrupted - }; - - class Worker : public Thread { - public: - explicit Worker(SignalThread* parent) : parent_(parent) {} - virtual ~Worker() { Stop(); } - virtual void Run() { parent_->Run(); } - - private: - SignalThread* parent_; - - DISALLOW_IMPLICIT_CONSTRUCTORS(Worker); - }; - - class EnterExit { - public: - explicit EnterExit(SignalThread* t) : t_(t) { - t_->cs_.Enter(); - // If refcount_ is zero then the object has already been deleted and we - // will be double-deleting it in ~EnterExit()! (shouldn't happen) - ASSERT(t_->refcount_ != 0); - ++t_->refcount_; - } - ~EnterExit() { - bool d = (0 == --t_->refcount_); - t_->cs_.Leave(); - if (d) - delete t_; - } - - private: - SignalThread* t_; - - DISALLOW_IMPLICIT_CONSTRUCTORS(EnterExit); - }; - - void Run(); - void OnMainThreadDestroyed(); - - Thread* main_; - Worker worker_; - CriticalSection cs_; - State state_; - int refcount_; - - DISALLOW_COPY_AND_ASSIGN(SignalThread); -}; - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace talk_base - -#endif // TALK_BASE_SIGNALTHREAD_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/sigslot.h b/thirdparties/common/include/webrtc-sdk/talk/base/sigslot.h deleted file mode 100755 index ce33b8c..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/sigslot.h +++ /dev/null @@ -1,2850 +0,0 @@ -// sigslot.h: Signal/Slot classes -// -// Written by Sarah Thompson (sarah@telergy.com) 2002. -// -// License: Public domain. You are free to use this code however you like, with the proviso that -// the author takes on no responsibility or liability for any use. -// -// QUICK DOCUMENTATION -// -// (see also the full documentation at http://sigslot.sourceforge.net/) -// -// #define switches -// SIGSLOT_PURE_ISO - Define this to force ISO C++ compliance. This also disables -// all of the thread safety support on platforms where it is -// available. -// -// SIGSLOT_USE_POSIX_THREADS - Force use of Posix threads when using a C++ compiler other than -// gcc on a platform that supports Posix threads. (When using gcc, -// this is the default - use SIGSLOT_PURE_ISO to disable this if -// necessary) -// -// SIGSLOT_DEFAULT_MT_POLICY - Where thread support is enabled, this defaults to multi_threaded_global. -// Otherwise, the default is single_threaded. #define this yourself to -// override the default. In pure ISO mode, anything other than -// single_threaded will cause a compiler error. -// -// PLATFORM NOTES -// -// Win32 - On Win32, the WIN32 symbol must be #defined. Most mainstream -// compilers do this by default, but you may need to define it -// yourself if your build environment is less standard. This causes -// the Win32 thread support to be compiled in and used automatically. -// -// Unix/Linux/BSD, etc. - If you're using gcc, it is assumed that you have Posix threads -// available, so they are used automatically. You can override this -// (as under Windows) with the SIGSLOT_PURE_ISO switch. If you're using -// something other than gcc but still want to use Posix threads, you -// need to #define SIGSLOT_USE_POSIX_THREADS. -// -// ISO C++ - If none of the supported platforms are detected, or if -// SIGSLOT_PURE_ISO is defined, all multithreading support is turned off, -// along with any code that might cause a pure ISO C++ environment to -// complain. Before you ask, gcc -ansi -pedantic won't compile this -// library, but gcc -ansi is fine. Pedantic mode seems to throw a lot of -// errors that aren't really there. If you feel like investigating this, -// please contact the author. -// -// -// THREADING MODES -// -// single_threaded - Your program is assumed to be single threaded from the point of view -// of signal/slot usage (i.e. all objects using signals and slots are -// created and destroyed from a single thread). Behaviour if objects are -// destroyed concurrently is undefined (i.e. you'll get the occasional -// segmentation fault/memory exception). -// -// multi_threaded_global - Your program is assumed to be multi threaded. Objects using signals and -// slots can be safely created and destroyed from any thread, even when -// connections exist. In multi_threaded_global mode, this is achieved by a -// single global mutex (actually a critical section on Windows because they -// are faster). This option uses less OS resources, but results in more -// opportunities for contention, possibly resulting in more context switches -// than are strictly necessary. -// -// multi_threaded_local - Behaviour in this mode is essentially the same as multi_threaded_global, -// except that each signal, and each object that inherits has_slots, all -// have their own mutex/critical section. In practice, this means that -// mutex collisions (and hence context switches) only happen if they are -// absolutely essential. However, on some platforms, creating a lot of -// mutexes can slow down the whole OS, so use this option with care. -// -// USING THE LIBRARY -// -// See the full documentation at http://sigslot.sourceforge.net/ -// -// -// Libjingle specific: -// This file has been modified such that has_slots and signalx do not have to be -// using the same threading requirements. E.g. it is possible to connect a -// has_slots and signal0 or -// has_slots and signal0. -// If has_slots is single threaded the user must ensure that it is not trying -// to connect or disconnect to signalx concurrently or data race may occur. -// If signalx is single threaded the user must ensure that disconnect, connect -// or signal is not happening concurrently or data race may occur. - -#ifndef TALK_BASE_SIGSLOT_H__ -#define TALK_BASE_SIGSLOT_H__ - -#include -#include -#include - -// On our copy of sigslot.h, we set single threading as default. -#define SIGSLOT_DEFAULT_MT_POLICY single_threaded - -#if defined(SIGSLOT_PURE_ISO) || (!defined(WIN32) && !defined(__GNUG__) && !defined(SIGSLOT_USE_POSIX_THREADS)) -# define _SIGSLOT_SINGLE_THREADED -#elif defined(WIN32) -# define _SIGSLOT_HAS_WIN32_THREADS -# if !defined(WIN32_LEAN_AND_MEAN) -# define WIN32_LEAN_AND_MEAN -# endif -# include "talk/base/win32.h" -#elif defined(__GNUG__) || defined(SIGSLOT_USE_POSIX_THREADS) -# define _SIGSLOT_HAS_POSIX_THREADS -# include -#else -# define _SIGSLOT_SINGLE_THREADED -#endif - -#ifndef SIGSLOT_DEFAULT_MT_POLICY -# ifdef _SIGSLOT_SINGLE_THREADED -# define SIGSLOT_DEFAULT_MT_POLICY single_threaded -# else -# define SIGSLOT_DEFAULT_MT_POLICY multi_threaded_local -# endif -#endif - -// TODO: change this namespace to talk_base? -namespace sigslot { - - class single_threaded - { - public: - single_threaded() - { - ; - } - - virtual ~single_threaded() - { - ; - } - - virtual void lock() - { - ; - } - - virtual void unlock() - { - ; - } - }; - -#ifdef _SIGSLOT_HAS_WIN32_THREADS - // The multi threading policies only get compiled in if they are enabled. - class multi_threaded_global - { - public: - multi_threaded_global() - { - static bool isinitialised = false; - - if(!isinitialised) - { - InitializeCriticalSection(get_critsec()); - isinitialised = true; - } - } - - multi_threaded_global(const multi_threaded_global&) - { - ; - } - - virtual ~multi_threaded_global() - { - ; - } - - virtual void lock() - { - EnterCriticalSection(get_critsec()); - } - - virtual void unlock() - { - LeaveCriticalSection(get_critsec()); - } - - private: - CRITICAL_SECTION* get_critsec() - { - static CRITICAL_SECTION g_critsec; - return &g_critsec; - } - }; - - class multi_threaded_local - { - public: - multi_threaded_local() - { - InitializeCriticalSection(&m_critsec); - } - - multi_threaded_local(const multi_threaded_local&) - { - InitializeCriticalSection(&m_critsec); - } - - virtual ~multi_threaded_local() - { - DeleteCriticalSection(&m_critsec); - } - - virtual void lock() - { - EnterCriticalSection(&m_critsec); - } - - virtual void unlock() - { - LeaveCriticalSection(&m_critsec); - } - - private: - CRITICAL_SECTION m_critsec; - }; -#endif // _SIGSLOT_HAS_WIN32_THREADS - -#ifdef _SIGSLOT_HAS_POSIX_THREADS - // The multi threading policies only get compiled in if they are enabled. - class multi_threaded_global - { - public: - multi_threaded_global() - { - pthread_mutex_init(get_mutex(), NULL); - } - - multi_threaded_global(const multi_threaded_global&) - { - ; - } - - virtual ~multi_threaded_global() - { - ; - } - - virtual void lock() - { - pthread_mutex_lock(get_mutex()); - } - - virtual void unlock() - { - pthread_mutex_unlock(get_mutex()); - } - - private: - pthread_mutex_t* get_mutex() - { - static pthread_mutex_t g_mutex; - return &g_mutex; - } - }; - - class multi_threaded_local - { - public: - multi_threaded_local() - { - pthread_mutex_init(&m_mutex, NULL); - } - - multi_threaded_local(const multi_threaded_local&) - { - pthread_mutex_init(&m_mutex, NULL); - } - - virtual ~multi_threaded_local() - { - pthread_mutex_destroy(&m_mutex); - } - - virtual void lock() - { - pthread_mutex_lock(&m_mutex); - } - - virtual void unlock() - { - pthread_mutex_unlock(&m_mutex); - } - - private: - pthread_mutex_t m_mutex; - }; -#endif // _SIGSLOT_HAS_POSIX_THREADS - - template - class lock_block - { - public: - mt_policy *m_mutex; - - lock_block(mt_policy *mtx) - : m_mutex(mtx) - { - m_mutex->lock(); - } - - ~lock_block() - { - m_mutex->unlock(); - } - }; - - class has_slots_interface; - - template - class _connection_base0 - { - public: - virtual ~_connection_base0() {} - virtual has_slots_interface* getdest() const = 0; - virtual void emit() = 0; - virtual _connection_base0* clone() = 0; - virtual _connection_base0* duplicate(has_slots_interface* pnewdest) = 0; - }; - - template - class _connection_base1 - { - public: - virtual ~_connection_base1() {} - virtual has_slots_interface* getdest() const = 0; - virtual void emit(arg1_type) = 0; - virtual _connection_base1* clone() = 0; - virtual _connection_base1* duplicate(has_slots_interface* pnewdest) = 0; - }; - - template - class _connection_base2 - { - public: - virtual ~_connection_base2() {} - virtual has_slots_interface* getdest() const = 0; - virtual void emit(arg1_type, arg2_type) = 0; - virtual _connection_base2* clone() = 0; - virtual _connection_base2* duplicate(has_slots_interface* pnewdest) = 0; - }; - - template - class _connection_base3 - { - public: - virtual ~_connection_base3() {} - virtual has_slots_interface* getdest() const = 0; - virtual void emit(arg1_type, arg2_type, arg3_type) = 0; - virtual _connection_base3* clone() = 0; - virtual _connection_base3* duplicate(has_slots_interface* pnewdest) = 0; - }; - - template - class _connection_base4 - { - public: - virtual ~_connection_base4() {} - virtual has_slots_interface* getdest() const = 0; - virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type) = 0; - virtual _connection_base4* clone() = 0; - virtual _connection_base4* duplicate(has_slots_interface* pnewdest) = 0; - }; - - template - class _connection_base5 - { - public: - virtual ~_connection_base5() {} - virtual has_slots_interface* getdest() const = 0; - virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, - arg5_type) = 0; - virtual _connection_base5* clone() = 0; - virtual _connection_base5* duplicate(has_slots_interface* pnewdest) = 0; - }; - - template - class _connection_base6 - { - public: - virtual ~_connection_base6() {} - virtual has_slots_interface* getdest() const = 0; - virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, - arg6_type) = 0; - virtual _connection_base6* clone() = 0; - virtual _connection_base6* duplicate(has_slots_interface* pnewdest) = 0; - }; - - template - class _connection_base7 - { - public: - virtual ~_connection_base7() {} - virtual has_slots_interface* getdest() const = 0; - virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, - arg6_type, arg7_type) = 0; - virtual _connection_base7* clone() = 0; - virtual _connection_base7* duplicate(has_slots_interface* pnewdest) = 0; - }; - - template - class _connection_base8 - { - public: - virtual ~_connection_base8() {} - virtual has_slots_interface* getdest() const = 0; - virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, - arg6_type, arg7_type, arg8_type) = 0; - virtual _connection_base8* clone() = 0; - virtual _connection_base8* duplicate(has_slots_interface* pnewdest) = 0; - }; - - class _signal_base_interface - { - public: - virtual void slot_disconnect(has_slots_interface* pslot) = 0; - virtual void slot_duplicate(const has_slots_interface* poldslot, has_slots_interface* pnewslot) = 0; - }; - - template - class _signal_base : public _signal_base_interface, public mt_policy - { - }; - - class has_slots_interface - { - public: - has_slots_interface() - { - ; - } - - virtual void signal_connect(_signal_base_interface* sender) = 0; - - virtual void signal_disconnect(_signal_base_interface* sender) = 0; - - virtual ~has_slots_interface() - { - } - - virtual void disconnect_all() = 0; - }; - - template - class has_slots : public has_slots_interface, public mt_policy - { - private: - typedef std::set<_signal_base_interface*> sender_set; - typedef sender_set::const_iterator const_iterator; - - public: - has_slots() - { - ; - } - - has_slots(const has_slots& hs) - { - lock_block lock(this); - const_iterator it = hs.m_senders.begin(); - const_iterator itEnd = hs.m_senders.end(); - - while(it != itEnd) - { - (*it)->slot_duplicate(&hs, this); - m_senders.insert(*it); - ++it; - } - } - - void signal_connect(_signal_base_interface* sender) - { - lock_block lock(this); - m_senders.insert(sender); - } - - void signal_disconnect(_signal_base_interface* sender) - { - lock_block lock(this); - m_senders.erase(sender); - } - - virtual ~has_slots() - { - disconnect_all(); - } - - void disconnect_all() - { - lock_block lock(this); - const_iterator it = m_senders.begin(); - const_iterator itEnd = m_senders.end(); - - while(it != itEnd) - { - (*it)->slot_disconnect(this); - ++it; - } - - m_senders.erase(m_senders.begin(), m_senders.end()); - } - - private: - sender_set m_senders; - }; - - template - class _signal_base0 : public _signal_base - { - public: - typedef std::list<_connection_base0 *> connections_list; - - _signal_base0() - { - ; - } - - _signal_base0(const _signal_base0& s) - : _signal_base(s) - { - lock_block lock(this); - typename connections_list::const_iterator it = s.m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); - - while(it != itEnd) - { - (*it)->getdest()->signal_connect(this); - m_connected_slots.push_back((*it)->clone()); - - ++it; - } - } - - ~_signal_base0() - { - disconnect_all(); - } - - bool is_empty() - { - lock_block lock(this); - typename connections_list::const_iterator it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - return it == itEnd; - } - - void disconnect_all() - { - lock_block lock(this); - typename connections_list::const_iterator it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - (*it)->getdest()->signal_disconnect(this); - delete *it; - - ++it; - } - - m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); - } - -#ifdef _DEBUG - bool connected(has_slots_interface* pclass) - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - while(it != itEnd) - { - itNext = it; - ++itNext; - if ((*it)->getdest() == pclass) - return true; - it = itNext; - } - return false; - } -#endif - - void disconnect(has_slots_interface* pclass) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - if((*it)->getdest() == pclass) - { - delete *it; - m_connected_slots.erase(it); - pclass->signal_disconnect(this); - return; - } - - ++it; - } - } - - void slot_disconnect(has_slots_interface* pslot) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - typename connections_list::iterator itNext = it; - ++itNext; - - if((*it)->getdest() == pslot) - { - delete *it; - m_connected_slots.erase(it); - } - - it = itNext; - } - } - - void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - if((*it)->getdest() == oldtarget) - { - m_connected_slots.push_back((*it)->duplicate(newtarget)); - } - - ++it; - } - } - - protected: - connections_list m_connected_slots; - }; - - template - class _signal_base1 : public _signal_base - { - public: - typedef std::list<_connection_base1 *> connections_list; - - _signal_base1() - { - ; - } - - _signal_base1(const _signal_base1& s) - : _signal_base(s) - { - lock_block lock(this); - typename connections_list::const_iterator it = s.m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); - - while(it != itEnd) - { - (*it)->getdest()->signal_connect(this); - m_connected_slots.push_back((*it)->clone()); - - ++it; - } - } - - void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - if((*it)->getdest() == oldtarget) - { - m_connected_slots.push_back((*it)->duplicate(newtarget)); - } - - ++it; - } - } - - ~_signal_base1() - { - disconnect_all(); - } - - bool is_empty() - { - lock_block lock(this); - typename connections_list::const_iterator it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - return it == itEnd; - } - - void disconnect_all() - { - lock_block lock(this); - typename connections_list::const_iterator it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - (*it)->getdest()->signal_disconnect(this); - delete *it; - - ++it; - } - - m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); - } - -#ifdef _DEBUG - bool connected(has_slots_interface* pclass) - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - while(it != itEnd) - { - itNext = it; - ++itNext; - if ((*it)->getdest() == pclass) - return true; - it = itNext; - } - return false; - } -#endif - - void disconnect(has_slots_interface* pclass) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - if((*it)->getdest() == pclass) - { - delete *it; - m_connected_slots.erase(it); - pclass->signal_disconnect(this); - return; - } - - ++it; - } - } - - void slot_disconnect(has_slots_interface* pslot) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - typename connections_list::iterator itNext = it; - ++itNext; - - if((*it)->getdest() == pslot) - { - delete *it; - m_connected_slots.erase(it); - } - - it = itNext; - } - } - - - protected: - connections_list m_connected_slots; - }; - - template - class _signal_base2 : public _signal_base - { - public: - typedef std::list<_connection_base2 *> - connections_list; - - _signal_base2() - { - ; - } - - _signal_base2(const _signal_base2& s) - : _signal_base(s) - { - lock_block lock(this); - typename connections_list::const_iterator it = s.m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); - - while(it != itEnd) - { - (*it)->getdest()->signal_connect(this); - m_connected_slots.push_back((*it)->clone()); - - ++it; - } - } - - void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - if((*it)->getdest() == oldtarget) - { - m_connected_slots.push_back((*it)->duplicate(newtarget)); - } - - ++it; - } - } - - ~_signal_base2() - { - disconnect_all(); - } - - bool is_empty() - { - lock_block lock(this); - typename connections_list::const_iterator it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - return it == itEnd; - } - - void disconnect_all() - { - lock_block lock(this); - typename connections_list::const_iterator it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - (*it)->getdest()->signal_disconnect(this); - delete *it; - - ++it; - } - - m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); - } - -#ifdef _DEBUG - bool connected(has_slots_interface* pclass) - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - while(it != itEnd) - { - itNext = it; - ++itNext; - if ((*it)->getdest() == pclass) - return true; - it = itNext; - } - return false; - } -#endif - - void disconnect(has_slots_interface* pclass) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - if((*it)->getdest() == pclass) - { - delete *it; - m_connected_slots.erase(it); - pclass->signal_disconnect(this); - return; - } - - ++it; - } - } - - void slot_disconnect(has_slots_interface* pslot) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - typename connections_list::iterator itNext = it; - ++itNext; - - if((*it)->getdest() == pslot) - { - delete *it; - m_connected_slots.erase(it); - } - - it = itNext; - } - } - - protected: - connections_list m_connected_slots; - }; - - template - class _signal_base3 : public _signal_base - { - public: - typedef std::list<_connection_base3 *> - connections_list; - - _signal_base3() - { - ; - } - - _signal_base3(const _signal_base3& s) - : _signal_base(s) - { - lock_block lock(this); - typename connections_list::const_iterator it = s.m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); - - while(it != itEnd) - { - (*it)->getdest()->signal_connect(this); - m_connected_slots.push_back((*it)->clone()); - - ++it; - } - } - - void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - if((*it)->getdest() == oldtarget) - { - m_connected_slots.push_back((*it)->duplicate(newtarget)); - } - - ++it; - } - } - - ~_signal_base3() - { - disconnect_all(); - } - - bool is_empty() - { - lock_block lock(this); - typename connections_list::const_iterator it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - return it == itEnd; - } - - void disconnect_all() - { - lock_block lock(this); - typename connections_list::const_iterator it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - (*it)->getdest()->signal_disconnect(this); - delete *it; - - ++it; - } - - m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); - } - -#ifdef _DEBUG - bool connected(has_slots_interface* pclass) - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - while(it != itEnd) - { - itNext = it; - ++itNext; - if ((*it)->getdest() == pclass) - return true; - it = itNext; - } - return false; - } -#endif - - void disconnect(has_slots_interface* pclass) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - if((*it)->getdest() == pclass) - { - delete *it; - m_connected_slots.erase(it); - pclass->signal_disconnect(this); - return; - } - - ++it; - } - } - - void slot_disconnect(has_slots_interface* pslot) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - typename connections_list::iterator itNext = it; - ++itNext; - - if((*it)->getdest() == pslot) - { - delete *it; - m_connected_slots.erase(it); - } - - it = itNext; - } - } - - protected: - connections_list m_connected_slots; - }; - - template - class _signal_base4 : public _signal_base - { - public: - typedef std::list<_connection_base4 *> connections_list; - - _signal_base4() - { - ; - } - - _signal_base4(const _signal_base4& s) - : _signal_base(s) - { - lock_block lock(this); - typename connections_list::const_iterator it = s.m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); - - while(it != itEnd) - { - (*it)->getdest()->signal_connect(this); - m_connected_slots.push_back((*it)->clone()); - - ++it; - } - } - - void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - if((*it)->getdest() == oldtarget) - { - m_connected_slots.push_back((*it)->duplicate(newtarget)); - } - - ++it; - } - } - - ~_signal_base4() - { - disconnect_all(); - } - - bool is_empty() - { - lock_block lock(this); - typename connections_list::const_iterator it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - return it == itEnd; - } - - void disconnect_all() - { - lock_block lock(this); - typename connections_list::const_iterator it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - (*it)->getdest()->signal_disconnect(this); - delete *it; - - ++it; - } - - m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); - } - -#ifdef _DEBUG - bool connected(has_slots_interface* pclass) - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - while(it != itEnd) - { - itNext = it; - ++itNext; - if ((*it)->getdest() == pclass) - return true; - it = itNext; - } - return false; - } -#endif - - void disconnect(has_slots_interface* pclass) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - if((*it)->getdest() == pclass) - { - delete *it; - m_connected_slots.erase(it); - pclass->signal_disconnect(this); - return; - } - - ++it; - } - } - - void slot_disconnect(has_slots_interface* pslot) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - typename connections_list::iterator itNext = it; - ++itNext; - - if((*it)->getdest() == pslot) - { - delete *it; - m_connected_slots.erase(it); - } - - it = itNext; - } - } - - protected: - connections_list m_connected_slots; - }; - - template - class _signal_base5 : public _signal_base - { - public: - typedef std::list<_connection_base5 *> connections_list; - - _signal_base5() - { - ; - } - - _signal_base5(const _signal_base5& s) - : _signal_base(s) - { - lock_block lock(this); - typename connections_list::const_iterator it = s.m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); - - while(it != itEnd) - { - (*it)->getdest()->signal_connect(this); - m_connected_slots.push_back((*it)->clone()); - - ++it; - } - } - - void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - if((*it)->getdest() == oldtarget) - { - m_connected_slots.push_back((*it)->duplicate(newtarget)); - } - - ++it; - } - } - - ~_signal_base5() - { - disconnect_all(); - } - - bool is_empty() - { - lock_block lock(this); - typename connections_list::const_iterator it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - return it == itEnd; - } - - void disconnect_all() - { - lock_block lock(this); - typename connections_list::const_iterator it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - (*it)->getdest()->signal_disconnect(this); - delete *it; - - ++it; - } - - m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); - } - -#ifdef _DEBUG - bool connected(has_slots_interface* pclass) - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - while(it != itEnd) - { - itNext = it; - ++itNext; - if ((*it)->getdest() == pclass) - return true; - it = itNext; - } - return false; - } -#endif - - void disconnect(has_slots_interface* pclass) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - if((*it)->getdest() == pclass) - { - delete *it; - m_connected_slots.erase(it); - pclass->signal_disconnect(this); - return; - } - - ++it; - } - } - - void slot_disconnect(has_slots_interface* pslot) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - typename connections_list::iterator itNext = it; - ++itNext; - - if((*it)->getdest() == pslot) - { - delete *it; - m_connected_slots.erase(it); - } - - it = itNext; - } - } - - protected: - connections_list m_connected_slots; - }; - - template - class _signal_base6 : public _signal_base - { - public: - typedef std::list<_connection_base6 *> connections_list; - - _signal_base6() - { - ; - } - - _signal_base6(const _signal_base6& s) - : _signal_base(s) - { - lock_block lock(this); - typename connections_list::const_iterator it = s.m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); - - while(it != itEnd) - { - (*it)->getdest()->signal_connect(this); - m_connected_slots.push_back((*it)->clone()); - - ++it; - } - } - - void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - if((*it)->getdest() == oldtarget) - { - m_connected_slots.push_back((*it)->duplicate(newtarget)); - } - - ++it; - } - } - - ~_signal_base6() - { - disconnect_all(); - } - - bool is_empty() - { - lock_block lock(this); - typename connections_list::const_iterator it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - return it == itEnd; - } - - void disconnect_all() - { - lock_block lock(this); - typename connections_list::const_iterator it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - (*it)->getdest()->signal_disconnect(this); - delete *it; - - ++it; - } - - m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); - } - -#ifdef _DEBUG - bool connected(has_slots_interface* pclass) - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - while(it != itEnd) - { - itNext = it; - ++itNext; - if ((*it)->getdest() == pclass) - return true; - it = itNext; - } - return false; - } -#endif - - void disconnect(has_slots_interface* pclass) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - if((*it)->getdest() == pclass) - { - delete *it; - m_connected_slots.erase(it); - pclass->signal_disconnect(this); - return; - } - - ++it; - } - } - - void slot_disconnect(has_slots_interface* pslot) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - typename connections_list::iterator itNext = it; - ++itNext; - - if((*it)->getdest() == pslot) - { - delete *it; - m_connected_slots.erase(it); - } - - it = itNext; - } - } - - protected: - connections_list m_connected_slots; - }; - - template - class _signal_base7 : public _signal_base - { - public: - typedef std::list<_connection_base7 *> connections_list; - - _signal_base7() - { - ; - } - - _signal_base7(const _signal_base7& s) - : _signal_base(s) - { - lock_block lock(this); - typename connections_list::const_iterator it = s.m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); - - while(it != itEnd) - { - (*it)->getdest()->signal_connect(this); - m_connected_slots.push_back((*it)->clone()); - - ++it; - } - } - - void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - if((*it)->getdest() == oldtarget) - { - m_connected_slots.push_back((*it)->duplicate(newtarget)); - } - - ++it; - } - } - - ~_signal_base7() - { - disconnect_all(); - } - - bool is_empty() - { - lock_block lock(this); - typename connections_list::const_iterator it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - return it == itEnd; - } - - void disconnect_all() - { - lock_block lock(this); - typename connections_list::const_iterator it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - (*it)->getdest()->signal_disconnect(this); - delete *it; - - ++it; - } - - m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); - } - -#ifdef _DEBUG - bool connected(has_slots_interface* pclass) - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - while(it != itEnd) - { - itNext = it; - ++itNext; - if ((*it)->getdest() == pclass) - return true; - it = itNext; - } - return false; - } -#endif - - void disconnect(has_slots_interface* pclass) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - if((*it)->getdest() == pclass) - { - delete *it; - m_connected_slots.erase(it); - pclass->signal_disconnect(this); - return; - } - - ++it; - } - } - - void slot_disconnect(has_slots_interface* pslot) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - typename connections_list::iterator itNext = it; - ++itNext; - - if((*it)->getdest() == pslot) - { - delete *it; - m_connected_slots.erase(it); - } - - it = itNext; - } - } - - protected: - connections_list m_connected_slots; - }; - - template - class _signal_base8 : public _signal_base - { - public: - typedef std::list<_connection_base8 *> - connections_list; - - _signal_base8() - { - ; - } - - _signal_base8(const _signal_base8& s) - : _signal_base(s) - { - lock_block lock(this); - typename connections_list::const_iterator it = s.m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); - - while(it != itEnd) - { - (*it)->getdest()->signal_connect(this); - m_connected_slots.push_back((*it)->clone()); - - ++it; - } - } - - void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - if((*it)->getdest() == oldtarget) - { - m_connected_slots.push_back((*it)->duplicate(newtarget)); - } - - ++it; - } - } - - ~_signal_base8() - { - disconnect_all(); - } - - bool is_empty() - { - lock_block lock(this); - typename connections_list::const_iterator it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - return it == itEnd; - } - - void disconnect_all() - { - lock_block lock(this); - typename connections_list::const_iterator it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - (*it)->getdest()->signal_disconnect(this); - delete *it; - - ++it; - } - - m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); - } - -#ifdef _DEBUG - bool connected(has_slots_interface* pclass) - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - while(it != itEnd) - { - itNext = it; - ++itNext; - if ((*it)->getdest() == pclass) - return true; - it = itNext; - } - return false; - } -#endif - - void disconnect(has_slots_interface* pclass) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - if((*it)->getdest() == pclass) - { - delete *it; - m_connected_slots.erase(it); - pclass->signal_disconnect(this); - return; - } - - ++it; - } - } - - void slot_disconnect(has_slots_interface* pslot) - { - lock_block lock(this); - typename connections_list::iterator it = m_connected_slots.begin(); - typename connections_list::iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - typename connections_list::iterator itNext = it; - ++itNext; - - if((*it)->getdest() == pslot) - { - delete *it; - m_connected_slots.erase(it); - } - - it = itNext; - } - } - - protected: - connections_list m_connected_slots; - }; - - - template - class _connection0 : public _connection_base0 - { - public: - _connection0() - { - m_pobject = NULL; - m_pmemfun = NULL; - } - - _connection0(dest_type* pobject, void (dest_type::*pmemfun)()) - { - m_pobject = pobject; - m_pmemfun = pmemfun; - } - - virtual ~_connection0() - { - } - - virtual _connection_base0* clone() - { - return new _connection0(*this); - } - - virtual _connection_base0* duplicate(has_slots_interface* pnewdest) - { - return new _connection0((dest_type *)pnewdest, m_pmemfun); - } - - virtual void emit() - { - (m_pobject->*m_pmemfun)(); - } - - virtual has_slots_interface* getdest() const - { - return m_pobject; - } - - private: - dest_type* m_pobject; - void (dest_type::* m_pmemfun)(); - }; - - template - class _connection1 : public _connection_base1 - { - public: - _connection1() - { - m_pobject = NULL; - m_pmemfun = NULL; - } - - _connection1(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type)) - { - m_pobject = pobject; - m_pmemfun = pmemfun; - } - - virtual ~_connection1() - { - } - - virtual _connection_base1* clone() - { - return new _connection1(*this); - } - - virtual _connection_base1* duplicate(has_slots_interface* pnewdest) - { - return new _connection1((dest_type *)pnewdest, m_pmemfun); - } - - virtual void emit(arg1_type a1) - { - (m_pobject->*m_pmemfun)(a1); - } - - virtual has_slots_interface* getdest() const - { - return m_pobject; - } - - private: - dest_type* m_pobject; - void (dest_type::* m_pmemfun)(arg1_type); - }; - - template - class _connection2 : public _connection_base2 - { - public: - _connection2() - { - m_pobject = NULL; - m_pmemfun = NULL; - } - - _connection2(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, - arg2_type)) - { - m_pobject = pobject; - m_pmemfun = pmemfun; - } - - virtual ~_connection2() - { - } - - virtual _connection_base2* clone() - { - return new _connection2(*this); - } - - virtual _connection_base2* duplicate(has_slots_interface* pnewdest) - { - return new _connection2((dest_type *)pnewdest, m_pmemfun); - } - - virtual void emit(arg1_type a1, arg2_type a2) - { - (m_pobject->*m_pmemfun)(a1, a2); - } - - virtual has_slots_interface* getdest() const - { - return m_pobject; - } - - private: - dest_type* m_pobject; - void (dest_type::* m_pmemfun)(arg1_type, arg2_type); - }; - - template - class _connection3 : public _connection_base3 - { - public: - _connection3() - { - m_pobject = NULL; - m_pmemfun = NULL; - } - - _connection3(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, - arg2_type, arg3_type)) - { - m_pobject = pobject; - m_pmemfun = pmemfun; - } - - virtual ~_connection3() - { - } - - virtual _connection_base3* clone() - { - return new _connection3(*this); - } - - virtual _connection_base3* duplicate(has_slots_interface* pnewdest) - { - return new _connection3((dest_type *)pnewdest, m_pmemfun); - } - - virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3) - { - (m_pobject->*m_pmemfun)(a1, a2, a3); - } - - virtual has_slots_interface* getdest() const - { - return m_pobject; - } - - private: - dest_type* m_pobject; - void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type); - }; - - template - class _connection4 : public _connection_base4 - { - public: - _connection4() - { - m_pobject = NULL; - m_pmemfun = NULL; - } - - _connection4(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, - arg2_type, arg3_type, arg4_type)) - { - m_pobject = pobject; - m_pmemfun = pmemfun; - } - - virtual ~_connection4() - { - } - - virtual _connection_base4* clone() - { - return new _connection4(*this); - } - - virtual _connection_base4* duplicate(has_slots_interface* pnewdest) - { - return new _connection4((dest_type *)pnewdest, m_pmemfun); - } - - virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, - arg4_type a4) - { - (m_pobject->*m_pmemfun)(a1, a2, a3, a4); - } - - virtual has_slots_interface* getdest() const - { - return m_pobject; - } - - private: - dest_type* m_pobject; - void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, - arg4_type); - }; - - template - class _connection5 : public _connection_base5 - { - public: - _connection5() - { - m_pobject = NULL; - m_pmemfun = NULL; - } - - _connection5(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, - arg2_type, arg3_type, arg4_type, arg5_type)) - { - m_pobject = pobject; - m_pmemfun = pmemfun; - } - - virtual ~_connection5() - { - } - - virtual _connection_base5* clone() - { - return new _connection5(*this); - } - - virtual _connection_base5* duplicate(has_slots_interface* pnewdest) - { - return new _connection5((dest_type *)pnewdest, m_pmemfun); - } - - virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, - arg5_type a5) - { - (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5); - } - - virtual has_slots_interface* getdest() const - { - return m_pobject; - } - - private: - dest_type* m_pobject; - void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type, - arg5_type); - }; - - template - class _connection6 : public _connection_base6 - { - public: - _connection6() - { - m_pobject = NULL; - m_pmemfun = NULL; - } - - _connection6(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, - arg2_type, arg3_type, arg4_type, arg5_type, arg6_type)) - { - m_pobject = pobject; - m_pmemfun = pmemfun; - } - - virtual ~_connection6() - { - } - - virtual _connection_base6* clone() - { - return new _connection6(*this); - } - - virtual _connection_base6* duplicate(has_slots_interface* pnewdest) - { - return new _connection6((dest_type *)pnewdest, m_pmemfun); - } - - virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, - arg5_type a5, arg6_type a6) - { - (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5, a6); - } - - virtual has_slots_interface* getdest() const - { - return m_pobject; - } - - private: - dest_type* m_pobject; - void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type, - arg5_type, arg6_type); - }; - - template - class _connection7 : public _connection_base7 - { - public: - _connection7() - { - m_pobject = NULL; - m_pmemfun = NULL; - } - - _connection7(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, - arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type)) - { - m_pobject = pobject; - m_pmemfun = pmemfun; - } - - virtual ~_connection7() - { - } - - virtual _connection_base7* clone() - { - return new _connection7(*this); - } - - virtual _connection_base7* duplicate(has_slots_interface* pnewdest) - { - return new _connection7((dest_type *)pnewdest, m_pmemfun); - } - - virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, - arg5_type a5, arg6_type a6, arg7_type a7) - { - (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5, a6, a7); - } - - virtual has_slots_interface* getdest() const - { - return m_pobject; - } - - private: - dest_type* m_pobject; - void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type, - arg5_type, arg6_type, arg7_type); - }; - - template - class _connection8 : public _connection_base8 - { - public: - _connection8() - { - m_pobject = NULL; - m_pmemfun = NULL; - } - - _connection8(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, - arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, - arg7_type, arg8_type)) - { - m_pobject = pobject; - m_pmemfun = pmemfun; - } - - virtual ~_connection8() - { - } - - virtual _connection_base8* clone() - { - return new _connection8(*this); - } - - virtual _connection_base8* duplicate(has_slots_interface* pnewdest) - { - return new _connection8((dest_type *)pnewdest, m_pmemfun); - } - - virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, - arg5_type a5, arg6_type a6, arg7_type a7, arg8_type a8) - { - (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5, a6, a7, a8); - } - - virtual has_slots_interface* getdest() const - { - return m_pobject; - } - - private: - dest_type* m_pobject; - void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type, - arg5_type, arg6_type, arg7_type, arg8_type); - }; - - template - class signal0 : public _signal_base0 - { - public: - typedef _signal_base0 base; - typedef typename base::connections_list connections_list; - using base::m_connected_slots; - - signal0() - { - ; - } - - signal0(const signal0& s) - : _signal_base0(s) - { - ; - } - - template - void connect(desttype* pclass, void (desttype::*pmemfun)()) - { - lock_block lock(this); - _connection0* conn = - new _connection0(pclass, pmemfun); - m_connected_slots.push_back(conn); - pclass->signal_connect(this); - } - - void emit() - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - itNext = it; - ++itNext; - - (*it)->emit(); - - it = itNext; - } - } - - void operator()() - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - itNext = it; - ++itNext; - - (*it)->emit(); - - it = itNext; - } - } - }; - - template - class signal1 : public _signal_base1 - { - public: - typedef _signal_base1 base; - typedef typename base::connections_list connections_list; - using base::m_connected_slots; - - signal1() - { - ; - } - - signal1(const signal1& s) - : _signal_base1(s) - { - ; - } - - template - void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type)) - { - lock_block lock(this); - _connection1* conn = - new _connection1(pclass, pmemfun); - m_connected_slots.push_back(conn); - pclass->signal_connect(this); - } - - void emit(arg1_type a1) - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - itNext = it; - ++itNext; - - (*it)->emit(a1); - - it = itNext; - } - } - - void operator()(arg1_type a1) - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - itNext = it; - ++itNext; - - (*it)->emit(a1); - - it = itNext; - } - } - }; - - template - class signal2 : public _signal_base2 - { - public: - typedef _signal_base2 base; - typedef typename base::connections_list connections_list; - using base::m_connected_slots; - - signal2() - { - ; - } - - signal2(const signal2& s) - : _signal_base2(s) - { - ; - } - - template - void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, - arg2_type)) - { - lock_block lock(this); - _connection2* conn = new - _connection2(pclass, pmemfun); - m_connected_slots.push_back(conn); - pclass->signal_connect(this); - } - - void emit(arg1_type a1, arg2_type a2) - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - itNext = it; - ++itNext; - - (*it)->emit(a1, a2); - - it = itNext; - } - } - - void operator()(arg1_type a1, arg2_type a2) - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - itNext = it; - ++itNext; - - (*it)->emit(a1, a2); - - it = itNext; - } - } - }; - - template - class signal3 : public _signal_base3 - { - public: - typedef _signal_base3 base; - typedef typename base::connections_list connections_list; - using base::m_connected_slots; - - signal3() - { - ; - } - - signal3(const signal3& s) - : _signal_base3(s) - { - ; - } - - template - void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, - arg2_type, arg3_type)) - { - lock_block lock(this); - _connection3* conn = - new _connection3(pclass, - pmemfun); - m_connected_slots.push_back(conn); - pclass->signal_connect(this); - } - - void emit(arg1_type a1, arg2_type a2, arg3_type a3) - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - itNext = it; - ++itNext; - - (*it)->emit(a1, a2, a3); - - it = itNext; - } - } - - void operator()(arg1_type a1, arg2_type a2, arg3_type a3) - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - itNext = it; - ++itNext; - - (*it)->emit(a1, a2, a3); - - it = itNext; - } - } - }; - - template - class signal4 : public _signal_base4 - { - public: - typedef _signal_base4 base; - typedef typename base::connections_list connections_list; - using base::m_connected_slots; - - signal4() - { - ; - } - - signal4(const signal4& s) - : _signal_base4(s) - { - ; - } - - template - void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, - arg2_type, arg3_type, arg4_type)) - { - lock_block lock(this); - _connection4* - conn = new _connection4(pclass, pmemfun); - m_connected_slots.push_back(conn); - pclass->signal_connect(this); - } - - void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4) - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - itNext = it; - ++itNext; - - (*it)->emit(a1, a2, a3, a4); - - it = itNext; - } - } - - void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4) - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - itNext = it; - ++itNext; - - (*it)->emit(a1, a2, a3, a4); - - it = itNext; - } - } - }; - - template - class signal5 : public _signal_base5 - { - public: - typedef _signal_base5 base; - typedef typename base::connections_list connections_list; - using base::m_connected_slots; - - signal5() - { - ; - } - - signal5(const signal5& s) - : _signal_base5(s) - { - ; - } - - template - void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, - arg2_type, arg3_type, arg4_type, arg5_type)) - { - lock_block lock(this); - _connection5* conn = new _connection5(pclass, pmemfun); - m_connected_slots.push_back(conn); - pclass->signal_connect(this); - } - - void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, - arg5_type a5) - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - itNext = it; - ++itNext; - - (*it)->emit(a1, a2, a3, a4, a5); - - it = itNext; - } - } - - void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, - arg5_type a5) - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - itNext = it; - ++itNext; - - (*it)->emit(a1, a2, a3, a4, a5); - - it = itNext; - } - } - }; - - - template - class signal6 : public _signal_base6 - { - public: - typedef _signal_base6 base; - typedef typename base::connections_list connections_list; - using base::m_connected_slots; - - signal6() - { - ; - } - - signal6(const signal6& s) - : _signal_base6(s) - { - ; - } - - template - void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, - arg2_type, arg3_type, arg4_type, arg5_type, arg6_type)) - { - lock_block lock(this); - _connection6* conn = - new _connection6(pclass, pmemfun); - m_connected_slots.push_back(conn); - pclass->signal_connect(this); - } - - void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, - arg5_type a5, arg6_type a6) - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - itNext = it; - ++itNext; - - (*it)->emit(a1, a2, a3, a4, a5, a6); - - it = itNext; - } - } - - void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, - arg5_type a5, arg6_type a6) - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - itNext = it; - ++itNext; - - (*it)->emit(a1, a2, a3, a4, a5, a6); - - it = itNext; - } - } - }; - - template - class signal7 : public _signal_base7 - { - public: - typedef _signal_base7 base; - typedef typename base::connections_list connections_list; - using base::m_connected_slots; - - signal7() - { - ; - } - - signal7(const signal7& s) - : _signal_base7(s) - { - ; - } - - template - void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, - arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, - arg7_type)) - { - lock_block lock(this); - _connection7* conn = - new _connection7(pclass, pmemfun); - m_connected_slots.push_back(conn); - pclass->signal_connect(this); - } - - void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, - arg5_type a5, arg6_type a6, arg7_type a7) - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - itNext = it; - ++itNext; - - (*it)->emit(a1, a2, a3, a4, a5, a6, a7); - - it = itNext; - } - } - - void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, - arg5_type a5, arg6_type a6, arg7_type a7) - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - itNext = it; - ++itNext; - - (*it)->emit(a1, a2, a3, a4, a5, a6, a7); - - it = itNext; - } - } - }; - - template - class signal8 : public _signal_base8 - { - public: - typedef _signal_base8 base; - typedef typename base::connections_list connections_list; - using base::m_connected_slots; - - signal8() - { - ; - } - - signal8(const signal8& s) - : _signal_base8(s) - { - ; - } - - template - void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, - arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, - arg7_type, arg8_type)) - { - lock_block lock(this); - _connection8* conn = - new _connection8(pclass, pmemfun); - m_connected_slots.push_back(conn); - pclass->signal_connect(this); - } - - void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, - arg5_type a5, arg6_type a6, arg7_type a7, arg8_type a8) - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - itNext = it; - ++itNext; - - (*it)->emit(a1, a2, a3, a4, a5, a6, a7, a8); - - it = itNext; - } - } - - void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, - arg5_type a5, arg6_type a6, arg7_type a7, arg8_type a8) - { - lock_block lock(this); - typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); - typename connections_list::const_iterator itEnd = m_connected_slots.end(); - - while(it != itEnd) - { - itNext = it; - ++itNext; - - (*it)->emit(a1, a2, a3, a4, a5, a6, a7, a8); - - it = itNext; - } - } - }; - -}; // namespace sigslot - -#endif // TALK_BASE_SIGSLOT_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/sigslotrepeater.h b/thirdparties/common/include/webrtc-sdk/talk/base/sigslotrepeater.h deleted file mode 100755 index 1a86636..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/sigslotrepeater.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * libjingle - * Copyright 2006, 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_BASE_SIGSLOTREPEATER_H__ -#define TALK_BASE_SIGSLOTREPEATER_H__ - -// repeaters are both signals and slots, which are designed as intermediate -// pass-throughs for signals and slots which don't know about each other (for -// modularity or encapsulation). This eliminates the need to declare a signal -// handler whose sole purpose is to fire another signal. The repeater connects -// to the originating signal using the 'repeat' method. When the repeated -// signal fires, the repeater will also fire. - -#include "talk/base/sigslot.h" - -namespace sigslot { - - template - class repeater0 : public signal0, - public has_slots - { - public: - typedef signal0 base_type; - typedef repeater0 this_type; - - repeater0() { } - repeater0(const this_type& s) : base_type(s) { } - - void reemit() { signal0::emit(); } - void repeat(base_type &s) { s.connect(this, &this_type::reemit); } - void stop(base_type &s) { s.disconnect(this); } - }; - - template - class repeater1 : public signal1, - public has_slots - { - public: - typedef signal1 base_type; - typedef repeater1 this_type; - - repeater1() { } - repeater1(const this_type& s) : base_type(s) { } - - void reemit(arg1_type a1) { signal1::emit(a1); } - void repeat(base_type& s) { s.connect(this, &this_type::reemit); } - void stop(base_type &s) { s.disconnect(this); } - }; - - template - class repeater2 : public signal2, - public has_slots - { - public: - typedef signal2 base_type; - typedef repeater2 this_type; - - repeater2() { } - repeater2(const this_type& s) : base_type(s) { } - - void reemit(arg1_type a1, arg2_type a2) { signal2::emit(a1,a2); } - void repeat(base_type& s) { s.connect(this, &this_type::reemit); } - void stop(base_type &s) { s.disconnect(this); } - }; - - template - class repeater3 : public signal3, - public has_slots - { - public: - typedef signal3 base_type; - typedef repeater3 this_type; - - repeater3() { } - repeater3(const this_type& s) : base_type(s) { } - - void reemit(arg1_type a1, arg2_type a2, arg3_type a3) { - signal3::emit(a1,a2,a3); - } - void repeat(base_type& s) { s.connect(this, &this_type::reemit); } - void stop(base_type &s) { s.disconnect(this); } - }; - -} // namespace sigslot - -#endif // TALK_BASE_SIGSLOTREPEATER_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/socket.h b/thirdparties/common/include/webrtc-sdk/talk/base/socket.h deleted file mode 100755 index f83d374..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/socket.h +++ /dev/null @@ -1,205 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_SOCKET_H__ -#define TALK_BASE_SOCKET_H__ - -#include - -#ifdef POSIX -#include -#include -#include -#include -#define SOCKET_EACCES EACCES -#endif - -#ifdef WIN32 -#include "talk/base/win32.h" -#endif - -#include "talk/base/basictypes.h" -#include "talk/base/socketaddress.h" - -// Rather than converting errors into a private namespace, -// Reuse the POSIX socket api errors. Note this depends on -// Win32 compatibility. - -#ifdef WIN32 -#undef EWOULDBLOCK // Remove errno.h's definition for each macro below. -#define EWOULDBLOCK WSAEWOULDBLOCK -#undef EINPROGRESS -#define EINPROGRESS WSAEINPROGRESS -#undef EALREADY -#define EALREADY WSAEALREADY -#undef ENOTSOCK -#define ENOTSOCK WSAENOTSOCK -#undef EDESTADDRREQ -#define EDESTADDRREQ WSAEDESTADDRREQ -#undef EMSGSIZE -#define EMSGSIZE WSAEMSGSIZE -#undef EPROTOTYPE -#define EPROTOTYPE WSAEPROTOTYPE -#undef ENOPROTOOPT -#define ENOPROTOOPT WSAENOPROTOOPT -#undef EPROTONOSUPPORT -#define EPROTONOSUPPORT WSAEPROTONOSUPPORT -#undef ESOCKTNOSUPPORT -#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT -#undef EOPNOTSUPP -#define EOPNOTSUPP WSAEOPNOTSUPP -#undef EPFNOSUPPORT -#define EPFNOSUPPORT WSAEPFNOSUPPORT -#undef EAFNOSUPPORT -#define EAFNOSUPPORT WSAEAFNOSUPPORT -#undef EADDRINUSE -#define EADDRINUSE WSAEADDRINUSE -#undef EADDRNOTAVAIL -#define EADDRNOTAVAIL WSAEADDRNOTAVAIL -#undef ENETDOWN -#define ENETDOWN WSAENETDOWN -#undef ENETUNREACH -#define ENETUNREACH WSAENETUNREACH -#undef ENETRESET -#define ENETRESET WSAENETRESET -#undef ECONNABORTED -#define ECONNABORTED WSAECONNABORTED -#undef ECONNRESET -#define ECONNRESET WSAECONNRESET -#undef ENOBUFS -#define ENOBUFS WSAENOBUFS -#undef EISCONN -#define EISCONN WSAEISCONN -#undef ENOTCONN -#define ENOTCONN WSAENOTCONN -#undef ESHUTDOWN -#define ESHUTDOWN WSAESHUTDOWN -#undef ETOOMANYREFS -#define ETOOMANYREFS WSAETOOMANYREFS -#undef ETIMEDOUT -#define ETIMEDOUT WSAETIMEDOUT -#undef ECONNREFUSED -#define ECONNREFUSED WSAECONNREFUSED -#undef ELOOP -#define ELOOP WSAELOOP -#undef ENAMETOOLONG -#define ENAMETOOLONG WSAENAMETOOLONG -#undef EHOSTDOWN -#define EHOSTDOWN WSAEHOSTDOWN -#undef EHOSTUNREACH -#define EHOSTUNREACH WSAEHOSTUNREACH -#undef ENOTEMPTY -#define ENOTEMPTY WSAENOTEMPTY -#undef EPROCLIM -#define EPROCLIM WSAEPROCLIM -#undef EUSERS -#define EUSERS WSAEUSERS -#undef EDQUOT -#define EDQUOT WSAEDQUOT -#undef ESTALE -#define ESTALE WSAESTALE -#undef EREMOTE -#define EREMOTE WSAEREMOTE -#undef EACCES -#define SOCKET_EACCES WSAEACCES -#endif // WIN32 - -#ifdef POSIX -#define INVALID_SOCKET (-1) -#define SOCKET_ERROR (-1) -#define closesocket(s) close(s) -#endif // POSIX - -namespace talk_base { - -inline bool IsBlockingError(int e) { - return (e == EWOULDBLOCK) || (e == EAGAIN) || (e == EINPROGRESS); -} - -// General interface for the socket implementations of various networks. The -// methods match those of normal UNIX sockets very closely. -class Socket { - public: - virtual ~Socket() {} - - // Returns the address to which the socket is bound. If the socket is not - // bound, then the any-address is returned. - virtual SocketAddress GetLocalAddress() const = 0; - - // Returns the address to which the socket is connected. If the socket is - // not connected, then the any-address is returned. - virtual SocketAddress GetRemoteAddress() const = 0; - - virtual int Bind(const SocketAddress& addr) = 0; - virtual int Connect(const SocketAddress& addr) = 0; - virtual int Send(const void *pv, size_t cb) = 0; - virtual int SendTo(const void *pv, size_t cb, const SocketAddress& addr) = 0; - virtual int Recv(void *pv, size_t cb) = 0; - virtual int RecvFrom(void *pv, size_t cb, SocketAddress *paddr) = 0; - virtual int Listen(int backlog) = 0; - virtual Socket *Accept(SocketAddress *paddr) = 0; - virtual int Close() = 0; - virtual int GetError() const = 0; - virtual void SetError(int error) = 0; - inline bool IsBlocking() const { return IsBlockingError(GetError()); } - - enum ConnState { - CS_CLOSED, - CS_CONNECTING, - CS_CONNECTED - }; - virtual ConnState GetState() const = 0; - - // Fills in the given uint16 with the current estimate of the MTU along the - // path to the address to which this socket is connected. NOTE: This method - // can block for up to 10 seconds on Windows. - virtual int EstimateMTU(uint16* mtu) = 0; - - enum Option { - OPT_DONTFRAGMENT, - OPT_RCVBUF, // receive buffer size - OPT_SNDBUF, // send buffer size - OPT_NODELAY, // whether Nagle algorithm is enabled - OPT_IPV6_V6ONLY, // Whether the socket is IPv6 only. - OPT_DSCP, // DSCP code - OPT_RTP_SENDTIME_EXTN_ID, // This is a non-traditional socket option param. - // This is specific to libjingle and will be used - // if SendTime option is needed at socket level. - }; - virtual int GetOption(Option opt, int* value) = 0; - virtual int SetOption(Option opt, int value) = 0; - - protected: - Socket() {} - - private: - DISALLOW_EVIL_CONSTRUCTORS(Socket); -}; - -} // namespace talk_base - -#endif // TALK_BASE_SOCKET_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/socket_unittest.h b/thirdparties/common/include/webrtc-sdk/talk/base/socket_unittest.h deleted file mode 100755 index e054fb2..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/socket_unittest.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * libjingle - * Copyright 2009, 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_BASE_SOCKET_UNITTEST_H_ -#define TALK_BASE_SOCKET_UNITTEST_H_ - -#include "talk/base/gunit.h" -#include "talk/base/thread.h" - -namespace talk_base { - -// Generic socket tests, to be used when testing individual socketservers. -// Derive your specific test class from SocketTest, install your -// socketserver, and call the SocketTest test methods. -class SocketTest : public testing::Test { - protected: - SocketTest() : ss_(NULL), kIPv4Loopback(INADDR_LOOPBACK), - kIPv6Loopback(in6addr_loopback) {} - virtual void SetUp() { ss_ = Thread::Current()->socketserver(); } - void TestConnectIPv4(); - void TestConnectIPv6(); - void TestConnectWithDnsLookupIPv4(); - void TestConnectWithDnsLookupIPv6(); - void TestConnectFailIPv4(); - void TestConnectFailIPv6(); - void TestConnectWithDnsLookupFailIPv4(); - void TestConnectWithDnsLookupFailIPv6(); - void TestConnectWithClosedSocketIPv4(); - void TestConnectWithClosedSocketIPv6(); - void TestConnectWhileNotClosedIPv4(); - void TestConnectWhileNotClosedIPv6(); - void TestServerCloseDuringConnectIPv4(); - void TestServerCloseDuringConnectIPv6(); - void TestClientCloseDuringConnectIPv4(); - void TestClientCloseDuringConnectIPv6(); - void TestServerCloseIPv4(); - void TestServerCloseIPv6(); - void TestCloseInClosedCallbackIPv4(); - void TestCloseInClosedCallbackIPv6(); - void TestSocketServerWaitIPv4(); - void TestSocketServerWaitIPv6(); - void TestTcpIPv4(); - void TestTcpIPv6(); - void TestSingleFlowControlCallbackIPv4(); - void TestSingleFlowControlCallbackIPv6(); - void TestUdpIPv4(); - void TestUdpIPv6(); - void TestUdpReadyToSendIPv4(); - void TestUdpReadyToSendIPv6(); - void TestGetSetOptionsIPv4(); - void TestGetSetOptionsIPv6(); - - private: - void ConnectInternal(const IPAddress& loopback); - void ConnectWithDnsLookupInternal(const IPAddress& loopback, - const std::string& host); - void ConnectFailInternal(const IPAddress& loopback); - - void ConnectWithDnsLookupFailInternal(const IPAddress& loopback); - void ConnectWithClosedSocketInternal(const IPAddress& loopback); - void ConnectWhileNotClosedInternal(const IPAddress& loopback); - void ServerCloseDuringConnectInternal(const IPAddress& loopback); - void ClientCloseDuringConnectInternal(const IPAddress& loopback); - void ServerCloseInternal(const IPAddress& loopback); - void CloseInClosedCallbackInternal(const IPAddress& loopback); - void SocketServerWaitInternal(const IPAddress& loopback); - void TcpInternal(const IPAddress& loopback); - void SingleFlowControlCallbackInternal(const IPAddress& loopback); - void UdpInternal(const IPAddress& loopback); - void UdpReadyToSend(const IPAddress& loopback); - void GetSetOptionsInternal(const IPAddress& loopback); - - static const int kTimeout = 5000; // ms - SocketServer* ss_; - const IPAddress kIPv4Loopback; - const IPAddress kIPv6Loopback; -}; - -} // namespace talk_base - -#endif // TALK_BASE_SOCKET_UNITTEST_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/socketadapters.h b/thirdparties/common/include/webrtc-sdk/talk/base/socketadapters.h deleted file mode 100755 index 021c628..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/socketadapters.h +++ /dev/null @@ -1,261 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_SOCKETADAPTERS_H_ -#define TALK_BASE_SOCKETADAPTERS_H_ - -#include -#include - -#include "talk/base/asyncsocket.h" -#include "talk/base/cryptstring.h" -#include "talk/base/logging.h" - -namespace talk_base { - -struct HttpAuthContext; -class ByteBuffer; - -/////////////////////////////////////////////////////////////////////////////// - -// Implements a socket adapter that can buffer and process data internally, -// as in the case of connecting to a proxy, where you must speak the proxy -// protocol before commencing normal socket behavior. -class BufferedReadAdapter : public AsyncSocketAdapter { - public: - BufferedReadAdapter(AsyncSocket* socket, size_t buffer_size); - virtual ~BufferedReadAdapter(); - - virtual int Send(const void* pv, size_t cb); - virtual int Recv(void* pv, size_t cb); - - protected: - int DirectSend(const void* pv, size_t cb) { - return AsyncSocketAdapter::Send(pv, cb); - } - - void BufferInput(bool on = true); - virtual void ProcessInput(char* data, size_t* len) = 0; - - virtual void OnReadEvent(AsyncSocket * socket); - - private: - char * buffer_; - size_t buffer_size_, data_len_; - bool buffering_; - DISALLOW_EVIL_CONSTRUCTORS(BufferedReadAdapter); -}; - -/////////////////////////////////////////////////////////////////////////////// - -// Interface for implementing proxy server sockets. -class AsyncProxyServerSocket : public BufferedReadAdapter { - public: - AsyncProxyServerSocket(AsyncSocket* socket, size_t buffer_size) - : BufferedReadAdapter(socket, buffer_size) {} - sigslot::signal2 SignalConnectRequest; - virtual void SendConnectResult(int err, const SocketAddress& addr) = 0; -}; - -/////////////////////////////////////////////////////////////////////////////// - -// Implements a socket adapter that performs the client side of a -// fake SSL handshake. Used for "ssltcp" P2P functionality. -class AsyncSSLSocket : public BufferedReadAdapter { - public: - explicit AsyncSSLSocket(AsyncSocket* socket); - - virtual int Connect(const SocketAddress& addr); - - protected: - virtual void OnConnectEvent(AsyncSocket* socket); - virtual void ProcessInput(char* data, size_t* len); - DISALLOW_EVIL_CONSTRUCTORS(AsyncSSLSocket); -}; - -// Implements a socket adapter that performs the server side of a -// fake SSL handshake. Used when implementing a relay server that does "ssltcp". -class AsyncSSLServerSocket : public BufferedReadAdapter { - public: - explicit AsyncSSLServerSocket(AsyncSocket* socket); - - protected: - virtual void ProcessInput(char* data, size_t* len); - DISALLOW_EVIL_CONSTRUCTORS(AsyncSSLServerSocket); -}; - -/////////////////////////////////////////////////////////////////////////////// - -// Implements a socket adapter that speaks the HTTP/S proxy protocol. -class AsyncHttpsProxySocket : public BufferedReadAdapter { - public: - AsyncHttpsProxySocket(AsyncSocket* socket, const std::string& user_agent, - const SocketAddress& proxy, - const std::string& username, const CryptString& password); - virtual ~AsyncHttpsProxySocket(); - - // If connect is forced, the adapter will always issue an HTTP CONNECT to the - // target address. Otherwise, it will connect only if the destination port - // is not port 80. - void SetForceConnect(bool force) { force_connect_ = force; } - - virtual int Connect(const SocketAddress& addr); - virtual SocketAddress GetRemoteAddress() const; - virtual int Close(); - virtual ConnState GetState() const; - - protected: - virtual void OnConnectEvent(AsyncSocket* socket); - virtual void OnCloseEvent(AsyncSocket* socket, int err); - virtual void ProcessInput(char* data, size_t* len); - - bool ShouldIssueConnect() const; - void SendRequest(); - void ProcessLine(char* data, size_t len); - void EndResponse(); - void Error(int error); - - private: - SocketAddress proxy_, dest_; - std::string agent_, user_, headers_; - CryptString pass_; - bool force_connect_; - size_t content_length_; - int defer_error_; - bool expect_close_; - enum ProxyState { - PS_INIT, PS_LEADER, PS_AUTHENTICATE, PS_SKIP_HEADERS, PS_ERROR_HEADERS, - PS_TUNNEL_HEADERS, PS_SKIP_BODY, PS_TUNNEL, PS_WAIT_CLOSE, PS_ERROR - } state_; - HttpAuthContext * context_; - std::string unknown_mechanisms_; - DISALLOW_EVIL_CONSTRUCTORS(AsyncHttpsProxySocket); -}; - -/* TODO: Implement this. -class AsyncHttpsProxyServerSocket : public AsyncProxyServerSocket { - public: - explicit AsyncHttpsProxyServerSocket(AsyncSocket* socket); - - private: - virtual void ProcessInput(char * data, size_t& len); - void Error(int error); - DISALLOW_EVIL_CONSTRUCTORS(AsyncHttpsProxyServerSocket); -}; -*/ - -/////////////////////////////////////////////////////////////////////////////// - -// Implements a socket adapter that speaks the SOCKS proxy protocol. -class AsyncSocksProxySocket : public BufferedReadAdapter { - public: - AsyncSocksProxySocket(AsyncSocket* socket, const SocketAddress& proxy, - const std::string& username, const CryptString& password); - - virtual int Connect(const SocketAddress& addr); - virtual SocketAddress GetRemoteAddress() const; - virtual int Close(); - virtual ConnState GetState() const; - - protected: - virtual void OnConnectEvent(AsyncSocket* socket); - virtual void ProcessInput(char* data, size_t* len); - - void SendHello(); - void SendConnect(); - void SendAuth(); - void Error(int error); - - private: - enum State { - SS_INIT, SS_HELLO, SS_AUTH, SS_CONNECT, SS_TUNNEL, SS_ERROR - }; - State state_; - SocketAddress proxy_, dest_; - std::string user_; - CryptString pass_; - DISALLOW_EVIL_CONSTRUCTORS(AsyncSocksProxySocket); -}; - -// Implements a proxy server socket for the SOCKS protocol. -class AsyncSocksProxyServerSocket : public AsyncProxyServerSocket { - public: - explicit AsyncSocksProxyServerSocket(AsyncSocket* socket); - - private: - virtual void ProcessInput(char* data, size_t* len); - void DirectSend(const ByteBuffer& buf); - - void HandleHello(ByteBuffer* request); - void SendHelloReply(int method); - void HandleAuth(ByteBuffer* request); - void SendAuthReply(int result); - void HandleConnect(ByteBuffer* request); - virtual void SendConnectResult(int result, const SocketAddress& addr); - - void Error(int error); - - static const int kBufferSize = 1024; - enum State { - SS_HELLO, SS_AUTH, SS_CONNECT, SS_CONNECT_PENDING, SS_TUNNEL, SS_ERROR - }; - State state_; - DISALLOW_EVIL_CONSTRUCTORS(AsyncSocksProxyServerSocket); -}; - -/////////////////////////////////////////////////////////////////////////////// - -// Implements a socket adapter that logs everything that it sends and receives. -class LoggingSocketAdapter : public AsyncSocketAdapter { - public: - LoggingSocketAdapter(AsyncSocket* socket, LoggingSeverity level, - const char * label, bool hex_mode = false); - - virtual int Send(const void *pv, size_t cb); - virtual int SendTo(const void *pv, size_t cb, const SocketAddress& addr); - virtual int Recv(void *pv, size_t cb); - virtual int RecvFrom(void *pv, size_t cb, SocketAddress *paddr); - virtual int Close(); - - protected: - virtual void OnConnectEvent(AsyncSocket * socket); - virtual void OnCloseEvent(AsyncSocket * socket, int err); - - private: - LoggingSeverity level_; - std::string label_; - bool hex_mode_; - LogMultilineState lms_; - DISALLOW_EVIL_CONSTRUCTORS(LoggingSocketAdapter); -}; - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace talk_base - -#endif // TALK_BASE_SOCKETADAPTERS_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/socketaddress.h b/thirdparties/common/include/webrtc-sdk/talk/base/socketaddress.h deleted file mode 100755 index 6f8d21d..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/socketaddress.h +++ /dev/null @@ -1,231 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_SOCKETADDRESS_H_ -#define TALK_BASE_SOCKETADDRESS_H_ - -#include -#include -#include -#include "talk/base/basictypes.h" -#include "talk/base/ipaddress.h" - -#undef SetPort - -struct sockaddr_in; -struct sockaddr_storage; - -namespace talk_base { - -// Records an IP address and port. -class SocketAddress { - public: - // Creates a nil address. - SocketAddress(); - - // Creates the address with the given host and port. Host may be a - // literal IP string or a hostname to be resolved later. - SocketAddress(const std::string& hostname, int port); - - // Creates the address with the given IP and port. - // IP is given as an integer in host byte order. V4 only, to be deprecated. - SocketAddress(uint32 ip_as_host_order_integer, int port); - - // Creates the address with the given IP and port. - SocketAddress(const IPAddress& ip, int port); - - // Creates a copy of the given address. - SocketAddress(const SocketAddress& addr); - - // Resets to the nil address. - void Clear(); - - // Determines if this is a nil address (empty hostname, any IP, null port) - bool IsNil() const; - - // Returns true if ip and port are set. - bool IsComplete() const; - - // Replaces our address with the given one. - SocketAddress& operator=(const SocketAddress& addr); - - // Changes the IP of this address to the given one, and clears the hostname - // IP is given as an integer in host byte order. V4 only, to be deprecated.. - void SetIP(uint32 ip_as_host_order_integer); - - // Changes the IP of this address to the given one, and clears the hostname. - void SetIP(const IPAddress& ip); - - // Changes the hostname of this address to the given one. - // Does not resolve the address; use Resolve to do so. - void SetIP(const std::string& hostname); - - // Sets the IP address while retaining the hostname. Useful for bypassing - // DNS for a pre-resolved IP. - // IP is given as an integer in host byte order. V4 only, to be deprecated. - void SetResolvedIP(uint32 ip_as_host_order_integer); - - // Sets the IP address while retaining the hostname. Useful for bypassing - // DNS for a pre-resolved IP. - void SetResolvedIP(const IPAddress& ip); - - // Changes the port of this address to the given one. - void SetPort(int port); - - // Returns the hostname. - const std::string& hostname() const { return hostname_; } - - // Returns the IP address as a host byte order integer. - // Returns 0 for non-v4 addresses. - uint32 ip() const; - - const IPAddress& ipaddr() const; - - int family() const {return ip_.family(); } - - // Returns the port part of this address. - uint16 port() const; - - // Returns the scope ID associated with this address. Scope IDs are a - // necessary addition to IPv6 link-local addresses, with different network - // interfaces having different scope-ids for their link-local addresses. - // IPv4 address do not have scope_ids and sockaddr_in structures do not have - // a field for them. - int scope_id() const {return scope_id_; } - void SetScopeID(int id) { scope_id_ = id; } - - // Returns the 'host' portion of the address (hostname or IP) in a form - // suitable for use in a URI. If both IP and hostname are present, hostname - // is preferred. IPv6 addresses are enclosed in square brackets ('[' and ']'). - std::string HostAsURIString() const; - - // Same as HostAsURIString but anonymizes IP addresses by hiding the last - // part. - std::string HostAsSensitiveURIString() const; - - // Returns the port as a string. - std::string PortAsString() const; - - // Returns hostname:port or [hostname]:port. - std::string ToString() const; - - // Same as ToString but anonymizes it by hiding the last part. - std::string ToSensitiveString() const; - - // Parses hostname:port and [hostname]:port. - bool FromString(const std::string& str); - - friend std::ostream& operator<<(std::ostream& os, const SocketAddress& addr); - - // Determines whether this represents a missing / any IP address. - // That is, 0.0.0.0 or ::. - // Hostname and/or port may be set. - bool IsAnyIP() const; - inline bool IsAny() const { return IsAnyIP(); } // deprecated - - // Determines whether the IP address refers to a loopback address. - // For v4 addresses this means the address is in the range 127.0.0.0/8. - // For v6 addresses this means the address is ::1. - bool IsLoopbackIP() const; - - // Determines whether the IP address is in one of the private ranges: - // For v4: 127.0.0.0/8 10.0.0.0/8 192.168.0.0/16 172.16.0.0/12. - // For v6: FE80::/16 and ::1. - bool IsPrivateIP() const; - - // Determines whether the hostname has been resolved to an IP. - bool IsUnresolvedIP() const; - inline bool IsUnresolved() const { return IsUnresolvedIP(); } // deprecated - - // Determines whether this address is identical to the given one. - bool operator ==(const SocketAddress& addr) const; - inline bool operator !=(const SocketAddress& addr) const { - return !this->operator ==(addr); - } - - // Compares based on IP and then port. - bool operator <(const SocketAddress& addr) const; - - // Determines whether this address has the same IP as the one given. - bool EqualIPs(const SocketAddress& addr) const; - - // Determines whether this address has the same port as the one given. - bool EqualPorts(const SocketAddress& addr) const; - - // Hashes this address into a small number. - size_t Hash() const; - - // Write this address to a sockaddr_in. - // If IPv6, will zero out the sockaddr_in and sets family to AF_UNSPEC. - void ToSockAddr(sockaddr_in* saddr) const; - - // Read this address from a sockaddr_in. - bool FromSockAddr(const sockaddr_in& saddr); - - // Read and write the address to/from a sockaddr_storage. - // Dual stack version always sets family to AF_INET6, and maps v4 addresses. - // The other version doesn't map, and outputs an AF_INET address for - // v4 or mapped addresses, and AF_INET6 addresses for others. - // Returns the size of the sockaddr_in or sockaddr_in6 structure that is - // written to the sockaddr_storage, or zero on failure. - size_t ToDualStackSockAddrStorage(sockaddr_storage* saddr) const; - size_t ToSockAddrStorage(sockaddr_storage* saddr) const; - - // Converts the IP address given in 'compact form' into dotted form. - // IP is given as an integer in host byte order. V4 only, to be deprecated. - // TODO: Deprecate this. - static std::string IPToString(uint32 ip_as_host_order_integer); - - // Same as IPToString but anonymizes it by hiding the last part. - // TODO: Deprecate this. - static std::string IPToSensitiveString(uint32 ip_as_host_order_integer); - - // Converts the IP address given in dotted form into compact form. - // Only dotted names (A.B.C.D) are converted. - // Output integer is returned in host byte order. - // TODO: Deprecate, replace wth agnostic versions. - static bool StringToIP(const std::string& str, uint32* ip); - static uint32 StringToIP(const std::string& str); - - // Converts the IP address given in printable form into an IPAddress. - static bool StringToIP(const std::string& str, IPAddress* ip); - - private: - std::string hostname_; - IPAddress ip_; - uint16 port_; - int scope_id_; - bool literal_; // Indicates that 'hostname_' contains a literal IP string. -}; - -bool SocketAddressFromSockAddrStorage(const sockaddr_storage& saddr, - SocketAddress* out); -SocketAddress EmptySocketAddressWithFamily(int family); - -} // namespace talk_base - -#endif // TALK_BASE_SOCKETADDRESS_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/socketaddresspair.h b/thirdparties/common/include/webrtc-sdk/talk/base/socketaddresspair.h deleted file mode 100755 index adea0b7..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/socketaddresspair.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_SOCKETADDRESSPAIR_H__ -#define TALK_BASE_SOCKETADDRESSPAIR_H__ - -#include "talk/base/socketaddress.h" - -namespace talk_base { - -// Records a pair (source,destination) of socket addresses. The two addresses -// identify a connection between two machines. (For UDP, this "connection" is -// not maintained explicitly in a socket.) -class SocketAddressPair { -public: - SocketAddressPair() {} - SocketAddressPair(const SocketAddress& srs, const SocketAddress& dest); - - const SocketAddress& source() const { return src_; } - const SocketAddress& destination() const { return dest_; } - - bool operator ==(const SocketAddressPair& r) const; - bool operator <(const SocketAddressPair& r) const; - - size_t Hash() const; - -private: - SocketAddress src_; - SocketAddress dest_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_SOCKETADDRESSPAIR_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/socketfactory.h b/thirdparties/common/include/webrtc-sdk/talk/base/socketfactory.h deleted file mode 100755 index 4be2dd9..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/socketfactory.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_SOCKETFACTORY_H__ -#define TALK_BASE_SOCKETFACTORY_H__ - -#include "talk/base/socket.h" -#include "talk/base/asyncsocket.h" - -namespace talk_base { - -class SocketFactory { -public: - virtual ~SocketFactory() {} - - // Returns a new socket for blocking communication. The type can be - // SOCK_DGRAM and SOCK_STREAM. - // TODO: C++ inheritance rules mean that all users must have both - // CreateSocket(int) and CreateSocket(int,int). Will remove CreateSocket(int) - // (and CreateAsyncSocket(int) when all callers are changed. - virtual Socket* CreateSocket(int type) = 0; - virtual Socket* CreateSocket(int family, int type) = 0; - // Returns a new socket for nonblocking communication. The type can be - // SOCK_DGRAM and SOCK_STREAM. - virtual AsyncSocket* CreateAsyncSocket(int type) = 0; - virtual AsyncSocket* CreateAsyncSocket(int family, int type) = 0; -}; - -} // namespace talk_base - -#endif // TALK_BASE_SOCKETFACTORY_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/socketpool.h b/thirdparties/common/include/webrtc-sdk/talk/base/socketpool.h deleted file mode 100755 index def41e4..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/socketpool.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_SOCKETPOOL_H_ -#define TALK_BASE_SOCKETPOOL_H_ - -#include -#include -#include "talk/base/logging.h" -#include "talk/base/sigslot.h" -#include "talk/base/socketaddress.h" - -namespace talk_base { - -class AsyncSocket; -class LoggingAdapter; -class SocketFactory; -class SocketStream; -class StreamInterface; - -////////////////////////////////////////////////////////////////////// -// StreamPool -////////////////////////////////////////////////////////////////////// - -class StreamPool { -public: - virtual ~StreamPool() { } - - virtual StreamInterface* RequestConnectedStream(const SocketAddress& remote, - int* err) = 0; - virtual void ReturnConnectedStream(StreamInterface* stream) = 0; -}; - -/////////////////////////////////////////////////////////////////////////////// -// StreamCache - Caches a set of open streams, defers creation/destruction to -// the supplied StreamPool. -/////////////////////////////////////////////////////////////////////////////// - -class StreamCache : public StreamPool, public sigslot::has_slots<> { -public: - StreamCache(StreamPool* pool); - virtual ~StreamCache(); - - // StreamPool Interface - virtual StreamInterface* RequestConnectedStream(const SocketAddress& remote, - int* err); - virtual void ReturnConnectedStream(StreamInterface* stream); - -private: - typedef std::pair ConnectedStream; - typedef std::list ConnectedList; - - void OnStreamEvent(StreamInterface* stream, int events, int err); - - // We delegate stream creation and deletion to this pool. - StreamPool* pool_; - // Streams that are in use (returned from RequestConnectedStream). - ConnectedList active_; - // Streams which were returned to us, but are still open. - ConnectedList cached_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// NewSocketPool -// Creates a new stream on every request -/////////////////////////////////////////////////////////////////////////////// - -class NewSocketPool : public StreamPool { -public: - NewSocketPool(SocketFactory* factory); - virtual ~NewSocketPool(); - - // StreamPool Interface - virtual StreamInterface* RequestConnectedStream(const SocketAddress& remote, - int* err); - virtual void ReturnConnectedStream(StreamInterface* stream); - -private: - SocketFactory* factory_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// ReuseSocketPool -// Maintains a single socket at a time, and will reuse it without closing if -// the destination address is the same. -/////////////////////////////////////////////////////////////////////////////// - -class ReuseSocketPool : public StreamPool, public sigslot::has_slots<> { -public: - ReuseSocketPool(SocketFactory* factory); - virtual ~ReuseSocketPool(); - - // StreamPool Interface - virtual StreamInterface* RequestConnectedStream(const SocketAddress& remote, - int* err); - virtual void ReturnConnectedStream(StreamInterface* stream); - -private: - void OnStreamEvent(StreamInterface* stream, int events, int err); - - SocketFactory* factory_; - SocketStream* stream_; - SocketAddress remote_; - bool checked_out_; // Whether the stream is currently checked out -}; - -/////////////////////////////////////////////////////////////////////////////// -// LoggingPoolAdapter - Adapts a StreamPool to supply streams with attached -// LoggingAdapters. -/////////////////////////////////////////////////////////////////////////////// - -class LoggingPoolAdapter : public StreamPool { -public: - LoggingPoolAdapter(StreamPool* pool, LoggingSeverity level, - const std::string& label, bool binary_mode); - virtual ~LoggingPoolAdapter(); - - // StreamPool Interface - virtual StreamInterface* RequestConnectedStream(const SocketAddress& remote, - int* err); - virtual void ReturnConnectedStream(StreamInterface* stream); - -private: - StreamPool* pool_; - LoggingSeverity level_; - std::string label_; - bool binary_mode_; - typedef std::deque StreamList; - StreamList recycle_bin_; -}; - -////////////////////////////////////////////////////////////////////// - -} // namespace talk_base - -#endif // TALK_BASE_SOCKETPOOL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/socketserver.h b/thirdparties/common/include/webrtc-sdk/talk/base/socketserver.h deleted file mode 100755 index 7fef8cd..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/socketserver.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_SOCKETSERVER_H_ -#define TALK_BASE_SOCKETSERVER_H_ - -#include "talk/base/socketfactory.h" - -namespace talk_base { - -class MessageQueue; - -// Provides the ability to wait for activity on a set of sockets. The Thread -// class provides a nice wrapper on a socket server. -// -// The server is also a socket factory. The sockets it creates will be -// notified of asynchronous I/O from this server's Wait method. -class SocketServer : public SocketFactory { - public: - // When the socket server is installed into a Thread, this function is - // called to allow the socket server to use the thread's message queue for - // any messaging that it might need to perform. - virtual void SetMessageQueue(MessageQueue* queue) {} - - // Sleeps until: - // 1) cms milliseconds have elapsed (unless cms == kForever) - // 2) WakeUp() is called - // While sleeping, I/O is performed if process_io is true. - virtual bool Wait(int cms, bool process_io) = 0; - - // Causes the current wait (if one is in progress) to wake up. - virtual void WakeUp() = 0; -}; - -} // namespace talk_base - -#endif // TALK_BASE_SOCKETSERVER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/socketstream.h b/thirdparties/common/include/webrtc-sdk/talk/base/socketstream.h deleted file mode 100755 index fd0a005..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/socketstream.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * libjingle - * Copyright 2005--2010, 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_BASE_SOCKETSTREAM_H_ -#define TALK_BASE_SOCKETSTREAM_H_ - -#include "talk/base/asyncsocket.h" -#include "talk/base/common.h" -#include "talk/base/stream.h" - -namespace talk_base { - -/////////////////////////////////////////////////////////////////////////////// - -class SocketStream : public StreamInterface, public sigslot::has_slots<> { - public: - explicit SocketStream(AsyncSocket* socket); - virtual ~SocketStream(); - - void Attach(AsyncSocket* socket); - AsyncSocket* Detach(); - - AsyncSocket* GetSocket() { return socket_; } - - virtual StreamState GetState() const; - - virtual StreamResult Read(void* buffer, size_t buffer_len, - size_t* read, int* error); - - virtual StreamResult Write(const void* data, size_t data_len, - size_t* written, int* error); - - virtual void Close(); - - private: - void OnConnectEvent(AsyncSocket* socket); - void OnReadEvent(AsyncSocket* socket); - void OnWriteEvent(AsyncSocket* socket); - void OnCloseEvent(AsyncSocket* socket, int err); - - AsyncSocket* socket_; - - DISALLOW_EVIL_CONSTRUCTORS(SocketStream); -}; - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace talk_base - -#endif // TALK_BASE_SOCKETSTREAM_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/ssladapter.h b/thirdparties/common/include/webrtc-sdk/talk/base/ssladapter.h deleted file mode 100755 index 09813b5..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/ssladapter.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_SSLADAPTER_H_ -#define TALK_BASE_SSLADAPTER_H_ - -#include "talk/base/asyncsocket.h" - -namespace talk_base { - -/////////////////////////////////////////////////////////////////////////////// - -class SSLAdapter : public AsyncSocketAdapter { - public: - explicit SSLAdapter(AsyncSocket* socket) - : AsyncSocketAdapter(socket), ignore_bad_cert_(false) { } - - bool ignore_bad_cert() const { return ignore_bad_cert_; } - void set_ignore_bad_cert(bool ignore) { ignore_bad_cert_ = ignore; } - - // StartSSL returns 0 if successful. - // If StartSSL is called while the socket is closed or connecting, the SSL - // negotiation will begin as soon as the socket connects. - virtual int StartSSL(const char* hostname, bool restartable) = 0; - - // Create the default SSL adapter for this platform. On failure, returns NULL - // and deletes |socket|. Otherwise, the returned SSLAdapter takes ownership - // of |socket|. - static SSLAdapter* Create(AsyncSocket* socket); - - private: - // If true, the server certificate need not match the configured hostname. - bool ignore_bad_cert_; -}; - -/////////////////////////////////////////////////////////////////////////////// - -typedef bool (*VerificationCallback)(void* cert); - -// Call this on the main thread, before using SSL. -// Call CleanupSSLThread when finished with SSL. -bool InitializeSSL(VerificationCallback callback = NULL); - -// Call to initialize additional threads. -bool InitializeSSLThread(); - -// Call to cleanup additional threads, and also the main thread. -bool CleanupSSL(); - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace talk_base - -#endif // TALK_BASE_SSLADAPTER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/sslconfig.h b/thirdparties/common/include/webrtc-sdk/talk/base/sslconfig.h deleted file mode 100755 index f926e8c..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/sslconfig.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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_BASE_SSLCONFIG_H_ -#define TALK_BASE_SSLCONFIG_H_ - -// If no preference has been indicated, default to SChannel on Windows and -// OpenSSL everywhere else, if it is available. -#if !defined(SSL_USE_SCHANNEL) && !defined(SSL_USE_OPENSSL) && \ - !defined(SSL_USE_NSS) -#if defined(WIN32) - -#define SSL_USE_SCHANNEL 1 - -#else // defined(WIN32) - -#if defined(HAVE_OPENSSL_SSL_H) -#define SSL_USE_OPENSSL 1 -#elif defined(HAVE_NSS_SSL_H) -#define SSL_USE_NSS 1 -#endif - -#endif // !defined(WIN32) -#endif - -#endif // TALK_BASE_SSLCONFIG_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/sslfingerprint.h b/thirdparties/common/include/webrtc-sdk/talk/base/sslfingerprint.h deleted file mode 100755 index f8978c7..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/sslfingerprint.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * libjingle - * Copyright 2012, Google Inc. - * Copyright 2012, RTFM 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_BASE_SSLFINGERPRINT_H_ -#define TALK_BASE_SSLFINGERPRINT_H_ - -#include - -#include "talk/base/buffer.h" -#include "talk/base/sslidentity.h" - -namespace talk_base { - -class SSLCertificate; - -struct SSLFingerprint { - static SSLFingerprint* Create(const std::string& algorithm, - const talk_base::SSLIdentity* identity); - - static SSLFingerprint* Create(const std::string& algorithm, - const talk_base::SSLCertificate* cert); - - static SSLFingerprint* CreateFromRfc4572(const std::string& algorithm, - const std::string& fingerprint); - - SSLFingerprint(const std::string& algorithm, const uint8* digest_in, - size_t digest_len); - - SSLFingerprint(const SSLFingerprint& from); - - bool operator==(const SSLFingerprint& other) const; - - std::string GetRfc4572Fingerprint() const; - - std::string ToString(); - - std::string algorithm; - talk_base::Buffer digest; -}; - -} // namespace talk_base - -#endif // TALK_BASE_SSLFINGERPRINT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/sslidentity.h b/thirdparties/common/include/webrtc-sdk/talk/base/sslidentity.h deleted file mode 100755 index 4b7d1d7..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/sslidentity.h +++ /dev/null @@ -1,189 +0,0 @@ -/* - * libjingle - * Copyright 2004, 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. - */ - -// Handling of certificates and keypairs for SSLStreamAdapter's peer mode. - -#ifndef TALK_BASE_SSLIDENTITY_H_ -#define TALK_BASE_SSLIDENTITY_H_ - -#include -#include -#include - -#include "talk/base/buffer.h" -#include "talk/base/messagedigest.h" - -namespace talk_base { - -// Forward declaration due to circular dependency with SSLCertificate. -class SSLCertChain; - -// Abstract interface overridden by SSL library specific -// implementations. - -// A somewhat opaque type used to encapsulate a certificate. -// Wraps the SSL library's notion of a certificate, with reference counting. -// The SSLCertificate object is pretty much immutable once created. -// (The OpenSSL implementation only does reference counting and -// possibly caching of intermediate results.) -class SSLCertificate { - public: - // Parses and build a certificate from a PEM encoded string. - // Returns NULL on failure. - // The length of the string representation of the certificate is - // stored in *pem_length if it is non-NULL, and only if - // parsing was successful. - // Caller is responsible for freeing the returned object. - static SSLCertificate* FromPEMString(const std::string& pem_string); - virtual ~SSLCertificate() {} - - // Returns a new SSLCertificate object instance wrapping the same - // underlying certificate, including its chain if present. - // Caller is responsible for freeing the returned object. - virtual SSLCertificate* GetReference() const = 0; - - // Provides the cert chain, or returns false. The caller owns the chain. - // The chain includes a copy of each certificate, excluding the leaf. - virtual bool GetChain(SSLCertChain** chain) const = 0; - - // Returns a PEM encoded string representation of the certificate. - virtual std::string ToPEMString() const = 0; - - // Provides a DER encoded binary representation of the certificate. - virtual void ToDER(Buffer* der_buffer) const = 0; - - // Gets the name of the digest algorithm that was used to compute this - // certificate's signature. - virtual bool GetSignatureDigestAlgorithm(std::string* algorithm) const = 0; - - // Compute the digest of the certificate given algorithm - virtual bool ComputeDigest(const std::string& algorithm, - unsigned char* digest, - size_t size, - size_t* length) const = 0; -}; - -// SSLCertChain is a simple wrapper for a vector of SSLCertificates. It serves -// primarily to ensure proper memory management (especially deletion) of the -// SSLCertificate pointers. -class SSLCertChain { - public: - // These constructors copy the provided SSLCertificate(s), so the caller - // retains ownership. - explicit SSLCertChain(const std::vector& certs) { - ASSERT(!certs.empty()); - certs_.resize(certs.size()); - std::transform(certs.begin(), certs.end(), certs_.begin(), DupCert); - } - explicit SSLCertChain(const SSLCertificate* cert) { - certs_.push_back(cert->GetReference()); - } - - ~SSLCertChain() { - std::for_each(certs_.begin(), certs_.end(), DeleteCert); - } - - // Vector access methods. - size_t GetSize() const { return certs_.size(); } - - // Returns a temporary reference, only valid until the chain is destroyed. - const SSLCertificate& Get(size_t pos) const { return *(certs_[pos]); } - - // Returns a new SSLCertChain object instance wrapping the same underlying - // certificate chain. Caller is responsible for freeing the returned object. - SSLCertChain* Copy() const { - return new SSLCertChain(certs_); - } - - private: - // Helper function for duplicating a vector of certificates. - static SSLCertificate* DupCert(const SSLCertificate* cert) { - return cert->GetReference(); - } - - // Helper function for deleting a vector of certificates. - static void DeleteCert(SSLCertificate* cert) { delete cert; } - - std::vector certs_; - - DISALLOW_COPY_AND_ASSIGN(SSLCertChain); -}; - -// Parameters for generating an identity for testing. If common_name is -// non-empty, it will be used for the certificate's subject and issuer name, -// otherwise a random string will be used. |not_before| and |not_after| are -// offsets to the current time in number of seconds. -struct SSLIdentityParams { - std::string common_name; - int not_before; // in seconds. - int not_after; // in seconds. -}; - -// Our identity in an SSL negotiation: a keypair and certificate (both -// with the same public key). -// This too is pretty much immutable once created. -class SSLIdentity { - public: - // Generates an identity (keypair and self-signed certificate). If - // common_name is non-empty, it will be used for the certificate's - // subject and issuer name, otherwise a random string will be used. - // Returns NULL on failure. - // Caller is responsible for freeing the returned object. - static SSLIdentity* Generate(const std::string& common_name); - - // Generates an identity with the specified validity period. - static SSLIdentity* GenerateForTest(const SSLIdentityParams& params); - - // Construct an identity from a private key and a certificate. - static SSLIdentity* FromPEMStrings(const std::string& private_key, - const std::string& certificate); - - virtual ~SSLIdentity() {} - - // Returns a new SSLIdentity object instance wrapping the same - // identity information. - // Caller is responsible for freeing the returned object. - virtual SSLIdentity* GetReference() const = 0; - - // Returns a temporary reference to the certificate. - virtual const SSLCertificate& certificate() const = 0; - - // Helpers for parsing converting between PEM and DER format. - static bool PemToDer(const std::string& pem_type, - const std::string& pem_string, - std::string* der); - static std::string DerToPem(const std::string& pem_type, - const unsigned char* data, - size_t length); -}; - -extern const char kPemTypeCertificate[]; -extern const char kPemTypeRsaPrivateKey[]; - -} // namespace talk_base - -#endif // TALK_BASE_SSLIDENTITY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/sslroots.h b/thirdparties/common/include/webrtc-sdk/talk/base/sslroots.h deleted file mode 100755 index 56d7c52..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/sslroots.h +++ /dev/null @@ -1,4930 +0,0 @@ -// This file is the root certificates in C form that are needed to connect to -// Google. - -// It was generated with the following command line: -// > python //depot/googleclient/talk/tools/generate_sslroots.py -// //depot/google3/security/cacerts/for_connecting_to_google/roots.pem - -/* subject:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root */ -/* issuer :/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root */ - - -const unsigned char AddTrust_External_Root_certificate[1082]={ -0x30,0x82,0x04,0x36,0x30,0x82,0x03,0x1E,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x6F,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x53,0x45,0x31,0x14, -0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x13,0x0B,0x41,0x64,0x64,0x54,0x72,0x75,0x73, -0x74,0x20,0x41,0x42,0x31,0x26,0x30,0x24,0x06,0x03,0x55,0x04,0x0B,0x13,0x1D,0x41, -0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x45,0x78,0x74,0x65,0x72,0x6E,0x61,0x6C, -0x20,0x54,0x54,0x50,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x22,0x30,0x20, -0x06,0x03,0x55,0x04,0x03,0x13,0x19,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20, -0x45,0x78,0x74,0x65,0x72,0x6E,0x61,0x6C,0x20,0x43,0x41,0x20,0x52,0x6F,0x6F,0x74, -0x30,0x1E,0x17,0x0D,0x30,0x30,0x30,0x35,0x33,0x30,0x31,0x30,0x34,0x38,0x33,0x38, -0x5A,0x17,0x0D,0x32,0x30,0x30,0x35,0x33,0x30,0x31,0x30,0x34,0x38,0x33,0x38,0x5A, -0x30,0x6F,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x53,0x45,0x31, -0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x13,0x0B,0x41,0x64,0x64,0x54,0x72,0x75, -0x73,0x74,0x20,0x41,0x42,0x31,0x26,0x30,0x24,0x06,0x03,0x55,0x04,0x0B,0x13,0x1D, -0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x45,0x78,0x74,0x65,0x72,0x6E,0x61, -0x6C,0x20,0x54,0x54,0x50,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x22,0x30, -0x20,0x06,0x03,0x55,0x04,0x03,0x13,0x19,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74, -0x20,0x45,0x78,0x74,0x65,0x72,0x6E,0x61,0x6C,0x20,0x43,0x41,0x20,0x52,0x6F,0x6F, -0x74,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, -0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01, -0x01,0x00,0xB7,0xF7,0x1A,0x33,0xE6,0xF2,0x00,0x04,0x2D,0x39,0xE0,0x4E,0x5B,0xED, -0x1F,0xBC,0x6C,0x0F,0xCD,0xB5,0xFA,0x23,0xB6,0xCE,0xDE,0x9B,0x11,0x33,0x97,0xA4, -0x29,0x4C,0x7D,0x93,0x9F,0xBD,0x4A,0xBC,0x93,0xED,0x03,0x1A,0xE3,0x8F,0xCF,0xE5, -0x6D,0x50,0x5A,0xD6,0x97,0x29,0x94,0x5A,0x80,0xB0,0x49,0x7A,0xDB,0x2E,0x95,0xFD, -0xB8,0xCA,0xBF,0x37,0x38,0x2D,0x1E,0x3E,0x91,0x41,0xAD,0x70,0x56,0xC7,0xF0,0x4F, -0x3F,0xE8,0x32,0x9E,0x74,0xCA,0xC8,0x90,0x54,0xE9,0xC6,0x5F,0x0F,0x78,0x9D,0x9A, -0x40,0x3C,0x0E,0xAC,0x61,0xAA,0x5E,0x14,0x8F,0x9E,0x87,0xA1,0x6A,0x50,0xDC,0xD7, -0x9A,0x4E,0xAF,0x05,0xB3,0xA6,0x71,0x94,0x9C,0x71,0xB3,0x50,0x60,0x0A,0xC7,0x13, -0x9D,0x38,0x07,0x86,0x02,0xA8,0xE9,0xA8,0x69,0x26,0x18,0x90,0xAB,0x4C,0xB0,0x4F, -0x23,0xAB,0x3A,0x4F,0x84,0xD8,0xDF,0xCE,0x9F,0xE1,0x69,0x6F,0xBB,0xD7,0x42,0xD7, -0x6B,0x44,0xE4,0xC7,0xAD,0xEE,0x6D,0x41,0x5F,0x72,0x5A,0x71,0x08,0x37,0xB3,0x79, -0x65,0xA4,0x59,0xA0,0x94,0x37,0xF7,0x00,0x2F,0x0D,0xC2,0x92,0x72,0xDA,0xD0,0x38, -0x72,0xDB,0x14,0xA8,0x45,0xC4,0x5D,0x2A,0x7D,0xB7,0xB4,0xD6,0xC4,0xEE,0xAC,0xCD, -0x13,0x44,0xB7,0xC9,0x2B,0xDD,0x43,0x00,0x25,0xFA,0x61,0xB9,0x69,0x6A,0x58,0x23, -0x11,0xB7,0xA7,0x33,0x8F,0x56,0x75,0x59,0xF5,0xCD,0x29,0xD7,0x46,0xB7,0x0A,0x2B, -0x65,0xB6,0xD3,0x42,0x6F,0x15,0xB2,0xB8,0x7B,0xFB,0xEF,0xE9,0x5D,0x53,0xD5,0x34, -0x5A,0x27,0x02,0x03,0x01,0x00,0x01,0xA3,0x81,0xDC,0x30,0x81,0xD9,0x30,0x1D,0x06, -0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xAD,0xBD,0x98,0x7A,0x34,0xB4,0x26,0xF7, -0xFA,0xC4,0x26,0x54,0xEF,0x03,0xBD,0xE0,0x24,0xCB,0x54,0x1A,0x30,0x0B,0x06,0x03, -0x55,0x1D,0x0F,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13, -0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x81,0x99,0x06,0x03,0x55, -0x1D,0x23,0x04,0x81,0x91,0x30,0x81,0x8E,0x80,0x14,0xAD,0xBD,0x98,0x7A,0x34,0xB4, -0x26,0xF7,0xFA,0xC4,0x26,0x54,0xEF,0x03,0xBD,0xE0,0x24,0xCB,0x54,0x1A,0xA1,0x73, -0xA4,0x71,0x30,0x6F,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x53, -0x45,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x13,0x0B,0x41,0x64,0x64,0x54, -0x72,0x75,0x73,0x74,0x20,0x41,0x42,0x31,0x26,0x30,0x24,0x06,0x03,0x55,0x04,0x0B, -0x13,0x1D,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x45,0x78,0x74,0x65,0x72, -0x6E,0x61,0x6C,0x20,0x54,0x54,0x50,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31, -0x22,0x30,0x20,0x06,0x03,0x55,0x04,0x03,0x13,0x19,0x41,0x64,0x64,0x54,0x72,0x75, -0x73,0x74,0x20,0x45,0x78,0x74,0x65,0x72,0x6E,0x61,0x6C,0x20,0x43,0x41,0x20,0x52, -0x6F,0x6F,0x74,0x82,0x01,0x01,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D, -0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0xB0,0x9B,0xE0,0x85,0x25,0xC2, -0xD6,0x23,0xE2,0x0F,0x96,0x06,0x92,0x9D,0x41,0x98,0x9C,0xD9,0x84,0x79,0x81,0xD9, -0x1E,0x5B,0x14,0x07,0x23,0x36,0x65,0x8F,0xB0,0xD8,0x77,0xBB,0xAC,0x41,0x6C,0x47, -0x60,0x83,0x51,0xB0,0xF9,0x32,0x3D,0xE7,0xFC,0xF6,0x26,0x13,0xC7,0x80,0x16,0xA5, -0xBF,0x5A,0xFC,0x87,0xCF,0x78,0x79,0x89,0x21,0x9A,0xE2,0x4C,0x07,0x0A,0x86,0x35, -0xBC,0xF2,0xDE,0x51,0xC4,0xD2,0x96,0xB7,0xDC,0x7E,0x4E,0xEE,0x70,0xFD,0x1C,0x39, -0xEB,0x0C,0x02,0x51,0x14,0x2D,0x8E,0xBD,0x16,0xE0,0xC1,0xDF,0x46,0x75,0xE7,0x24, -0xAD,0xEC,0xF4,0x42,0xB4,0x85,0x93,0x70,0x10,0x67,0xBA,0x9D,0x06,0x35,0x4A,0x18, -0xD3,0x2B,0x7A,0xCC,0x51,0x42,0xA1,0x7A,0x63,0xD1,0xE6,0xBB,0xA1,0xC5,0x2B,0xC2, -0x36,0xBE,0x13,0x0D,0xE6,0xBD,0x63,0x7E,0x79,0x7B,0xA7,0x09,0x0D,0x40,0xAB,0x6A, -0xDD,0x8F,0x8A,0xC3,0xF6,0xF6,0x8C,0x1A,0x42,0x05,0x51,0xD4,0x45,0xF5,0x9F,0xA7, -0x62,0x21,0x68,0x15,0x20,0x43,0x3C,0x99,0xE7,0x7C,0xBD,0x24,0xD8,0xA9,0x91,0x17, -0x73,0x88,0x3F,0x56,0x1B,0x31,0x38,0x18,0xB4,0x71,0x0F,0x9A,0xCD,0xC8,0x0E,0x9E, -0x8E,0x2E,0x1B,0xE1,0x8C,0x98,0x83,0xCB,0x1F,0x31,0xF1,0x44,0x4C,0xC6,0x04,0x73, -0x49,0x76,0x60,0x0F,0xC7,0xF8,0xBD,0x17,0x80,0x6B,0x2E,0xE9,0xCC,0x4C,0x0E,0x5A, -0x9A,0x79,0x0F,0x20,0x0A,0x2E,0xD5,0x9E,0x63,0x26,0x1E,0x55,0x92,0x94,0xD8,0x82, -0x17,0x5A,0x7B,0xD0,0xBC,0xC7,0x8F,0x4E,0x86,0x04, -}; - - -/* subject:/C=SE/O=AddTrust AB/OU=AddTrust TTP Network/CN=AddTrust Class 1 CA Root */ -/* issuer :/C=SE/O=AddTrust AB/OU=AddTrust TTP Network/CN=AddTrust Class 1 CA Root */ - - -const unsigned char AddTrust_Low_Value_Services_Root_certificate[1052]={ -0x30,0x82,0x04,0x18,0x30,0x82,0x03,0x00,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x65,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x53,0x45,0x31,0x14, -0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x13,0x0B,0x41,0x64,0x64,0x54,0x72,0x75,0x73, -0x74,0x20,0x41,0x42,0x31,0x1D,0x30,0x1B,0x06,0x03,0x55,0x04,0x0B,0x13,0x14,0x41, -0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x54,0x54,0x50,0x20,0x4E,0x65,0x74,0x77, -0x6F,0x72,0x6B,0x31,0x21,0x30,0x1F,0x06,0x03,0x55,0x04,0x03,0x13,0x18,0x41,0x64, -0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x31,0x20,0x43, -0x41,0x20,0x52,0x6F,0x6F,0x74,0x30,0x1E,0x17,0x0D,0x30,0x30,0x30,0x35,0x33,0x30, -0x31,0x30,0x33,0x38,0x33,0x31,0x5A,0x17,0x0D,0x32,0x30,0x30,0x35,0x33,0x30,0x31, -0x30,0x33,0x38,0x33,0x31,0x5A,0x30,0x65,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04, -0x06,0x13,0x02,0x53,0x45,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x13,0x0B, -0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x41,0x42,0x31,0x1D,0x30,0x1B,0x06, -0x03,0x55,0x04,0x0B,0x13,0x14,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x54, -0x54,0x50,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x21,0x30,0x1F,0x06,0x03, -0x55,0x04,0x03,0x13,0x18,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x43,0x6C, -0x61,0x73,0x73,0x20,0x31,0x20,0x43,0x41,0x20,0x52,0x6F,0x6F,0x74,0x30,0x82,0x01, -0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00, -0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0x96,0x96, -0xD4,0x21,0x49,0x60,0xE2,0x6B,0xE8,0x41,0x07,0x0C,0xDE,0xC4,0xE0,0xDC,0x13,0x23, -0xCD,0xC1,0x35,0xC7,0xFB,0xD6,0x4E,0x11,0x0A,0x67,0x5E,0xF5,0x06,0x5B,0x6B,0xA5, -0x08,0x3B,0x5B,0x29,0x16,0x3A,0xE7,0x87,0xB2,0x34,0x06,0xC5,0xBC,0x05,0xA5,0x03, -0x7C,0x82,0xCB,0x29,0x10,0xAE,0xE1,0x88,0x81,0xBD,0xD6,0x9E,0xD3,0xFE,0x2D,0x56, -0xC1,0x15,0xCE,0xE3,0x26,0x9D,0x15,0x2E,0x10,0xFB,0x06,0x8F,0x30,0x04,0xDE,0xA7, -0xB4,0x63,0xB4,0xFF,0xB1,0x9C,0xAE,0x3C,0xAF,0x77,0xB6,0x56,0xC5,0xB5,0xAB,0xA2, -0xE9,0x69,0x3A,0x3D,0x0E,0x33,0x79,0x32,0x3F,0x70,0x82,0x92,0x99,0x61,0x6D,0x8D, -0x30,0x08,0x8F,0x71,0x3F,0xA6,0x48,0x57,0x19,0xF8,0x25,0xDC,0x4B,0x66,0x5C,0xA5, -0x74,0x8F,0x98,0xAE,0xC8,0xF9,0xC0,0x06,0x22,0xE7,0xAC,0x73,0xDF,0xA5,0x2E,0xFB, -0x52,0xDC,0xB1,0x15,0x65,0x20,0xFA,0x35,0x66,0x69,0xDE,0xDF,0x2C,0xF1,0x6E,0xBC, -0x30,0xDB,0x2C,0x24,0x12,0xDB,0xEB,0x35,0x35,0x68,0x90,0xCB,0x00,0xB0,0x97,0x21, -0x3D,0x74,0x21,0x23,0x65,0x34,0x2B,0xBB,0x78,0x59,0xA3,0xD6,0xE1,0x76,0x39,0x9A, -0xA4,0x49,0x8E,0x8C,0x74,0xAF,0x6E,0xA4,0x9A,0xA3,0xD9,0x9B,0xD2,0x38,0x5C,0x9B, -0xA2,0x18,0xCC,0x75,0x23,0x84,0xBE,0xEB,0xE2,0x4D,0x33,0x71,0x8E,0x1A,0xF0,0xC2, -0xF8,0xC7,0x1D,0xA2,0xAD,0x03,0x97,0x2C,0xF8,0xCF,0x25,0xC6,0xF6,0xB8,0x24,0x31, -0xB1,0x63,0x5D,0x92,0x7F,0x63,0xF0,0x25,0xC9,0x53,0x2E,0x1F,0xBF,0x4D,0x02,0x03, -0x01,0x00,0x01,0xA3,0x81,0xD2,0x30,0x81,0xCF,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E, -0x04,0x16,0x04,0x14,0x95,0xB1,0xB4,0xF0,0x94,0xB6,0xBD,0xC7,0xDA,0xD1,0x11,0x09, -0x21,0xBE,0xC1,0xAF,0x49,0xFD,0x10,0x7B,0x30,0x0B,0x06,0x03,0x55,0x1D,0x0F,0x04, -0x04,0x03,0x02,0x01,0x06,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04, -0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x81,0x8F,0x06,0x03,0x55,0x1D,0x23,0x04,0x81, -0x87,0x30,0x81,0x84,0x80,0x14,0x95,0xB1,0xB4,0xF0,0x94,0xB6,0xBD,0xC7,0xDA,0xD1, -0x11,0x09,0x21,0xBE,0xC1,0xAF,0x49,0xFD,0x10,0x7B,0xA1,0x69,0xA4,0x67,0x30,0x65, -0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x53,0x45,0x31,0x14,0x30, -0x12,0x06,0x03,0x55,0x04,0x0A,0x13,0x0B,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74, -0x20,0x41,0x42,0x31,0x1D,0x30,0x1B,0x06,0x03,0x55,0x04,0x0B,0x13,0x14,0x41,0x64, -0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x54,0x54,0x50,0x20,0x4E,0x65,0x74,0x77,0x6F, -0x72,0x6B,0x31,0x21,0x30,0x1F,0x06,0x03,0x55,0x04,0x03,0x13,0x18,0x41,0x64,0x64, -0x54,0x72,0x75,0x73,0x74,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x31,0x20,0x43,0x41, -0x20,0x52,0x6F,0x6F,0x74,0x82,0x01,0x01,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86, -0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x2C,0x6D,0x64,0x1B, -0x1F,0xCD,0x0D,0xDD,0xB9,0x01,0xFA,0x96,0x63,0x34,0x32,0x48,0x47,0x99,0xAE,0x97, -0xED,0xFD,0x72,0x16,0xA6,0x73,0x47,0x5A,0xF4,0xEB,0xDD,0xE9,0xF5,0xD6,0xFB,0x45, -0xCC,0x29,0x89,0x44,0x5D,0xBF,0x46,0x39,0x3D,0xE8,0xEE,0xBC,0x4D,0x54,0x86,0x1E, -0x1D,0x6C,0xE3,0x17,0x27,0x43,0xE1,0x89,0x56,0x2B,0xA9,0x6F,0x72,0x4E,0x49,0x33, -0xE3,0x72,0x7C,0x2A,0x23,0x9A,0xBC,0x3E,0xFF,0x28,0x2A,0xED,0xA3,0xFF,0x1C,0x23, -0xBA,0x43,0x57,0x09,0x67,0x4D,0x4B,0x62,0x06,0x2D,0xF8,0xFF,0x6C,0x9D,0x60,0x1E, -0xD8,0x1C,0x4B,0x7D,0xB5,0x31,0x2F,0xD9,0xD0,0x7C,0x5D,0xF8,0xDE,0x6B,0x83,0x18, -0x78,0x37,0x57,0x2F,0xE8,0x33,0x07,0x67,0xDF,0x1E,0xC7,0x6B,0x2A,0x95,0x76,0xAE, -0x8F,0x57,0xA3,0xF0,0xF4,0x52,0xB4,0xA9,0x53,0x08,0xCF,0xE0,0x4F,0xD3,0x7A,0x53, -0x8B,0xFD,0xBB,0x1C,0x56,0x36,0xF2,0xFE,0xB2,0xB6,0xE5,0x76,0xBB,0xD5,0x22,0x65, -0xA7,0x3F,0xFE,0xD1,0x66,0xAD,0x0B,0xBC,0x6B,0x99,0x86,0xEF,0x3F,0x7D,0xF3,0x18, -0x32,0xCA,0x7B,0xC6,0xE3,0xAB,0x64,0x46,0x95,0xF8,0x26,0x69,0xD9,0x55,0x83,0x7B, -0x2C,0x96,0x07,0xFF,0x59,0x2C,0x44,0xA3,0xC6,0xE5,0xE9,0xA9,0xDC,0xA1,0x63,0x80, -0x5A,0x21,0x5E,0x21,0xCF,0x53,0x54,0xF0,0xBA,0x6F,0x89,0xDB,0xA8,0xAA,0x95,0xCF, -0x8B,0xE3,0x71,0xCC,0x1E,0x1B,0x20,0x44,0x08,0xC0,0x7A,0xB6,0x40,0xFD,0xC4,0xE4, -0x35,0xE1,0x1D,0x16,0x1C,0xD0,0xBC,0x2B,0x8E,0xD6,0x71,0xD9, -}; - - -/* subject:/C=SE/O=AddTrust AB/OU=AddTrust TTP Network/CN=AddTrust Public CA Root */ -/* issuer :/C=SE/O=AddTrust AB/OU=AddTrust TTP Network/CN=AddTrust Public CA Root */ - - -const unsigned char AddTrust_Public_Services_Root_certificate[1049]={ -0x30,0x82,0x04,0x15,0x30,0x82,0x02,0xFD,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x64,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x53,0x45,0x31,0x14, -0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x13,0x0B,0x41,0x64,0x64,0x54,0x72,0x75,0x73, -0x74,0x20,0x41,0x42,0x31,0x1D,0x30,0x1B,0x06,0x03,0x55,0x04,0x0B,0x13,0x14,0x41, -0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x54,0x54,0x50,0x20,0x4E,0x65,0x74,0x77, -0x6F,0x72,0x6B,0x31,0x20,0x30,0x1E,0x06,0x03,0x55,0x04,0x03,0x13,0x17,0x41,0x64, -0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x20,0x43,0x41, -0x20,0x52,0x6F,0x6F,0x74,0x30,0x1E,0x17,0x0D,0x30,0x30,0x30,0x35,0x33,0x30,0x31, -0x30,0x34,0x31,0x35,0x30,0x5A,0x17,0x0D,0x32,0x30,0x30,0x35,0x33,0x30,0x31,0x30, -0x34,0x31,0x35,0x30,0x5A,0x30,0x64,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06, -0x13,0x02,0x53,0x45,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x13,0x0B,0x41, -0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x41,0x42,0x31,0x1D,0x30,0x1B,0x06,0x03, -0x55,0x04,0x0B,0x13,0x14,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x54,0x54, -0x50,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x20,0x30,0x1E,0x06,0x03,0x55, -0x04,0x03,0x13,0x17,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x50,0x75,0x62, -0x6C,0x69,0x63,0x20,0x43,0x41,0x20,0x52,0x6F,0x6F,0x74,0x30,0x82,0x01,0x22,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82, -0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xE9,0x1A,0x30,0x8F, -0x83,0x88,0x14,0xC1,0x20,0xD8,0x3C,0x9B,0x8F,0x1B,0x7E,0x03,0x74,0xBB,0xDA,0x69, -0xD3,0x46,0xA5,0xF8,0x8E,0xC2,0x0C,0x11,0x90,0x51,0xA5,0x2F,0x66,0x54,0x40,0x55, -0xEA,0xDB,0x1F,0x4A,0x56,0xEE,0x9F,0x23,0x6E,0xF4,0x39,0xCB,0xA1,0xB9,0x6F,0xF2, -0x7E,0xF9,0x5D,0x87,0x26,0x61,0x9E,0x1C,0xF8,0xE2,0xEC,0xA6,0x81,0xF8,0x21,0xC5, -0x24,0xCC,0x11,0x0C,0x3F,0xDB,0x26,0x72,0x7A,0xC7,0x01,0x97,0x07,0x17,0xF9,0xD7, -0x18,0x2C,0x30,0x7D,0x0E,0x7A,0x1E,0x62,0x1E,0xC6,0x4B,0xC0,0xFD,0x7D,0x62,0x77, -0xD3,0x44,0x1E,0x27,0xF6,0x3F,0x4B,0x44,0xB3,0xB7,0x38,0xD9,0x39,0x1F,0x60,0xD5, -0x51,0x92,0x73,0x03,0xB4,0x00,0x69,0xE3,0xF3,0x14,0x4E,0xEE,0xD1,0xDC,0x09,0xCF, -0x77,0x34,0x46,0x50,0xB0,0xF8,0x11,0xF2,0xFE,0x38,0x79,0xF7,0x07,0x39,0xFE,0x51, -0x92,0x97,0x0B,0x5B,0x08,0x5F,0x34,0x86,0x01,0xAD,0x88,0x97,0xEB,0x66,0xCD,0x5E, -0xD1,0xFF,0xDC,0x7D,0xF2,0x84,0xDA,0xBA,0x77,0xAD,0xDC,0x80,0x08,0xC7,0xA7,0x87, -0xD6,0x55,0x9F,0x97,0x6A,0xE8,0xC8,0x11,0x64,0xBA,0xE7,0x19,0x29,0x3F,0x11,0xB3, -0x78,0x90,0x84,0x20,0x52,0x5B,0x11,0xEF,0x78,0xD0,0x83,0xF6,0xD5,0x48,0x90,0xD0, -0x30,0x1C,0xCF,0x80,0xF9,0x60,0xFE,0x79,0xE4,0x88,0xF2,0xDD,0x00,0xEB,0x94,0x45, -0xEB,0x65,0x94,0x69,0x40,0xBA,0xC0,0xD5,0xB4,0xB8,0xBA,0x7D,0x04,0x11,0xA8,0xEB, -0x31,0x05,0x96,0x94,0x4E,0x58,0x21,0x8E,0x9F,0xD0,0x60,0xFD,0x02,0x03,0x01,0x00, -0x01,0xA3,0x81,0xD1,0x30,0x81,0xCE,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16, -0x04,0x14,0x81,0x3E,0x37,0xD8,0x92,0xB0,0x1F,0x77,0x9F,0x5C,0xB4,0xAB,0x73,0xAA, -0xE7,0xF6,0x34,0x60,0x2F,0xFA,0x30,0x0B,0x06,0x03,0x55,0x1D,0x0F,0x04,0x04,0x03, -0x02,0x01,0x06,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30, -0x03,0x01,0x01,0xFF,0x30,0x81,0x8E,0x06,0x03,0x55,0x1D,0x23,0x04,0x81,0x86,0x30, -0x81,0x83,0x80,0x14,0x81,0x3E,0x37,0xD8,0x92,0xB0,0x1F,0x77,0x9F,0x5C,0xB4,0xAB, -0x73,0xAA,0xE7,0xF6,0x34,0x60,0x2F,0xFA,0xA1,0x68,0xA4,0x66,0x30,0x64,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x53,0x45,0x31,0x14,0x30,0x12,0x06, -0x03,0x55,0x04,0x0A,0x13,0x0B,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x41, -0x42,0x31,0x1D,0x30,0x1B,0x06,0x03,0x55,0x04,0x0B,0x13,0x14,0x41,0x64,0x64,0x54, -0x72,0x75,0x73,0x74,0x20,0x54,0x54,0x50,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B, -0x31,0x20,0x30,0x1E,0x06,0x03,0x55,0x04,0x03,0x13,0x17,0x41,0x64,0x64,0x54,0x72, -0x75,0x73,0x74,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x20,0x43,0x41,0x20,0x52,0x6F, -0x6F,0x74,0x82,0x01,0x01,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, -0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x03,0xF7,0x15,0x4A,0xF8,0x24,0xDA, -0x23,0x56,0x16,0x93,0x76,0xDD,0x36,0x28,0xB9,0xAE,0x1B,0xB8,0xC3,0xF1,0x64,0xBA, -0x20,0x18,0x78,0x95,0x29,0x27,0x57,0x05,0xBC,0x7C,0x2A,0xF4,0xB9,0x51,0x55,0xDA, -0x87,0x02,0xDE,0x0F,0x16,0x17,0x31,0xF8,0xAA,0x79,0x2E,0x09,0x13,0xBB,0xAF,0xB2, -0x20,0x19,0x12,0xE5,0x93,0xF9,0x4B,0xF9,0x83,0xE8,0x44,0xD5,0xB2,0x41,0x25,0xBF, -0x88,0x75,0x6F,0xFF,0x10,0xFC,0x4A,0x54,0xD0,0x5F,0xF0,0xFA,0xEF,0x36,0x73,0x7D, -0x1B,0x36,0x45,0xC6,0x21,0x6D,0xB4,0x15,0xB8,0x4E,0xCF,0x9C,0x5C,0xA5,0x3D,0x5A, -0x00,0x8E,0x06,0xE3,0x3C,0x6B,0x32,0x7B,0xF2,0x9F,0xF0,0xB6,0xFD,0xDF,0xF0,0x28, -0x18,0x48,0xF0,0xC6,0xBC,0xD0,0xBF,0x34,0x80,0x96,0xC2,0x4A,0xB1,0x6D,0x8E,0xC7, -0x90,0x45,0xDE,0x2F,0x67,0xAC,0x45,0x04,0xA3,0x7A,0xDC,0x55,0x92,0xC9,0x47,0x66, -0xD8,0x1A,0x8C,0xC7,0xED,0x9C,0x4E,0x9A,0xE0,0x12,0xBB,0xB5,0x6A,0x4C,0x84,0xE1, -0xE1,0x22,0x0D,0x87,0x00,0x64,0xFE,0x8C,0x7D,0x62,0x39,0x65,0xA6,0xEF,0x42,0xB6, -0x80,0x25,0x12,0x61,0x01,0xA8,0x24,0x13,0x70,0x00,0x11,0x26,0x5F,0xFA,0x35,0x50, -0xC5,0x48,0xCC,0x06,0x47,0xE8,0x27,0xD8,0x70,0x8D,0x5F,0x64,0xE6,0xA1,0x44,0x26, -0x5E,0x22,0xEC,0x92,0xCD,0xFF,0x42,0x9A,0x44,0x21,0x6D,0x5C,0xC5,0xE3,0x22,0x1D, -0x5F,0x47,0x12,0xE7,0xCE,0x5F,0x5D,0xFA,0xD8,0xAA,0xB1,0x33,0x2D,0xD9,0x76,0xF2, -0x4E,0x3A,0x33,0x0C,0x2B,0xB3,0x2D,0x90,0x06, -}; - - -/* subject:/C=SE/O=AddTrust AB/OU=AddTrust TTP Network/CN=AddTrust Qualified CA Root */ -/* issuer :/C=SE/O=AddTrust AB/OU=AddTrust TTP Network/CN=AddTrust Qualified CA Root */ - - -const unsigned char AddTrust_Qualified_Certificates_Root_certificate[1058]={ -0x30,0x82,0x04,0x1E,0x30,0x82,0x03,0x06,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x67,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x53,0x45,0x31,0x14, -0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x13,0x0B,0x41,0x64,0x64,0x54,0x72,0x75,0x73, -0x74,0x20,0x41,0x42,0x31,0x1D,0x30,0x1B,0x06,0x03,0x55,0x04,0x0B,0x13,0x14,0x41, -0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x54,0x54,0x50,0x20,0x4E,0x65,0x74,0x77, -0x6F,0x72,0x6B,0x31,0x23,0x30,0x21,0x06,0x03,0x55,0x04,0x03,0x13,0x1A,0x41,0x64, -0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x51,0x75,0x61,0x6C,0x69,0x66,0x69,0x65,0x64, -0x20,0x43,0x41,0x20,0x52,0x6F,0x6F,0x74,0x30,0x1E,0x17,0x0D,0x30,0x30,0x30,0x35, -0x33,0x30,0x31,0x30,0x34,0x34,0x35,0x30,0x5A,0x17,0x0D,0x32,0x30,0x30,0x35,0x33, -0x30,0x31,0x30,0x34,0x34,0x35,0x30,0x5A,0x30,0x67,0x31,0x0B,0x30,0x09,0x06,0x03, -0x55,0x04,0x06,0x13,0x02,0x53,0x45,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0A, -0x13,0x0B,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x41,0x42,0x31,0x1D,0x30, -0x1B,0x06,0x03,0x55,0x04,0x0B,0x13,0x14,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74, -0x20,0x54,0x54,0x50,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x23,0x30,0x21, -0x06,0x03,0x55,0x04,0x03,0x13,0x1A,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20, -0x51,0x75,0x61,0x6C,0x69,0x66,0x69,0x65,0x64,0x20,0x43,0x41,0x20,0x52,0x6F,0x6F, -0x74,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, -0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01, -0x01,0x00,0xE4,0x1E,0x9A,0xFE,0xDC,0x09,0x5A,0x87,0xA4,0x9F,0x47,0xBE,0x11,0x5F, -0xAF,0x84,0x34,0xDB,0x62,0x3C,0x79,0x78,0xB7,0xE9,0x30,0xB5,0xEC,0x0C,0x1C,0x2A, -0xC4,0x16,0xFF,0xE0,0xEC,0x71,0xEB,0x8A,0xF5,0x11,0x6E,0xED,0x4F,0x0D,0x91,0xD2, -0x12,0x18,0x2D,0x49,0x15,0x01,0xC2,0xA4,0x22,0x13,0xC7,0x11,0x64,0xFF,0x22,0x12, -0x9A,0xB9,0x8E,0x5C,0x2F,0x08,0xCF,0x71,0x6A,0xB3,0x67,0x01,0x59,0xF1,0x5D,0x46, -0xF3,0xB0,0x78,0xA5,0xF6,0x0E,0x42,0x7A,0xE3,0x7F,0x1B,0xCC,0xD0,0xF0,0xB7,0x28, -0xFD,0x2A,0xEA,0x9E,0xB3,0xB0,0xB9,0x04,0xAA,0xFD,0xF6,0xC7,0xB4,0xB1,0xB8,0x2A, -0xA0,0xFB,0x58,0xF1,0x19,0xA0,0x6F,0x70,0x25,0x7E,0x3E,0x69,0x4A,0x7F,0x0F,0x22, -0xD8,0xEF,0xAD,0x08,0x11,0x9A,0x29,0x99,0xE1,0xAA,0x44,0x45,0x9A,0x12,0x5E,0x3E, -0x9D,0x6D,0x52,0xFC,0xE7,0xA0,0x3D,0x68,0x2F,0xF0,0x4B,0x70,0x7C,0x13,0x38,0xAD, -0xBC,0x15,0x25,0xF1,0xD6,0xCE,0xAB,0xA2,0xC0,0x31,0xD6,0x2F,0x9F,0xE0,0xFF,0x14, -0x59,0xFC,0x84,0x93,0xD9,0x87,0x7C,0x4C,0x54,0x13,0xEB,0x9F,0xD1,0x2D,0x11,0xF8, -0x18,0x3A,0x3A,0xDE,0x25,0xD9,0xF7,0xD3,0x40,0xED,0xA4,0x06,0x12,0xC4,0x3B,0xE1, -0x91,0xC1,0x56,0x35,0xF0,0x14,0xDC,0x65,0x36,0x09,0x6E,0xAB,0xA4,0x07,0xC7,0x35, -0xD1,0xC2,0x03,0x33,0x36,0x5B,0x75,0x26,0x6D,0x42,0xF1,0x12,0x6B,0x43,0x6F,0x4B, -0x71,0x94,0xFA,0x34,0x1D,0xED,0x13,0x6E,0xCA,0x80,0x7F,0x98,0x2F,0x6C,0xB9,0x65, -0xD8,0xE9,0x02,0x03,0x01,0x00,0x01,0xA3,0x81,0xD4,0x30,0x81,0xD1,0x30,0x1D,0x06, -0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x39,0x95,0x8B,0x62,0x8B,0x5C,0xC9,0xD4, -0x80,0xBA,0x58,0x0F,0x97,0x3F,0x15,0x08,0x43,0xCC,0x98,0xA7,0x30,0x0B,0x06,0x03, -0x55,0x1D,0x0F,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13, -0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x81,0x91,0x06,0x03,0x55, -0x1D,0x23,0x04,0x81,0x89,0x30,0x81,0x86,0x80,0x14,0x39,0x95,0x8B,0x62,0x8B,0x5C, -0xC9,0xD4,0x80,0xBA,0x58,0x0F,0x97,0x3F,0x15,0x08,0x43,0xCC,0x98,0xA7,0xA1,0x6B, -0xA4,0x69,0x30,0x67,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x53, -0x45,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x13,0x0B,0x41,0x64,0x64,0x54, -0x72,0x75,0x73,0x74,0x20,0x41,0x42,0x31,0x1D,0x30,0x1B,0x06,0x03,0x55,0x04,0x0B, -0x13,0x14,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x54,0x54,0x50,0x20,0x4E, -0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x23,0x30,0x21,0x06,0x03,0x55,0x04,0x03,0x13, -0x1A,0x41,0x64,0x64,0x54,0x72,0x75,0x73,0x74,0x20,0x51,0x75,0x61,0x6C,0x69,0x66, -0x69,0x65,0x64,0x20,0x43,0x41,0x20,0x52,0x6F,0x6F,0x74,0x82,0x01,0x01,0x30,0x0D, -0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01, -0x01,0x00,0x19,0xAB,0x75,0xEA,0xF8,0x8B,0x65,0x61,0x95,0x13,0xBA,0x69,0x04,0xEF, -0x86,0xCA,0x13,0xA0,0xC7,0xAA,0x4F,0x64,0x1B,0x3F,0x18,0xF6,0xA8,0x2D,0x2C,0x55, -0x8F,0x05,0xB7,0x30,0xEA,0x42,0x6A,0x1D,0xC0,0x25,0x51,0x2D,0xA7,0xBF,0x0C,0xB3, -0xED,0xEF,0x08,0x7F,0x6C,0x3C,0x46,0x1A,0xEA,0x18,0x43,0xDF,0x76,0xCC,0xF9,0x66, -0x86,0x9C,0x2C,0x68,0xF5,0xE9,0x17,0xF8,0x31,0xB3,0x18,0xC4,0xD6,0x48,0x7D,0x23, -0x4C,0x68,0xC1,0x7E,0xBB,0x01,0x14,0x6F,0xC5,0xD9,0x6E,0xDE,0xBB,0x04,0x42,0x6A, -0xF8,0xF6,0x5C,0x7D,0xE5,0xDA,0xFA,0x87,0xEB,0x0D,0x35,0x52,0x67,0xD0,0x9E,0x97, -0x76,0x05,0x93,0x3F,0x95,0xC7,0x01,0xE6,0x69,0x55,0x38,0x7F,0x10,0x61,0x99,0xC9, -0xE3,0x5F,0xA6,0xCA,0x3E,0x82,0x63,0x48,0xAA,0xE2,0x08,0x48,0x3E,0xAA,0xF2,0xB2, -0x85,0x62,0xA6,0xB4,0xA7,0xD9,0xBD,0x37,0x9C,0x68,0xB5,0x2D,0x56,0x7D,0xB0,0xB7, -0x3F,0xA0,0xB1,0x07,0xD6,0xE9,0x4F,0xDC,0xDE,0x45,0x71,0x30,0x32,0x7F,0x1B,0x2E, -0x09,0xF9,0xBF,0x52,0xA1,0xEE,0xC2,0x80,0x3E,0x06,0x5C,0x2E,0x55,0x40,0xC1,0x1B, -0xF5,0x70,0x45,0xB0,0xDC,0x5D,0xFA,0xF6,0x72,0x5A,0x77,0xD2,0x63,0xCD,0xCF,0x58, -0x89,0x00,0x42,0x63,0x3F,0x79,0x39,0xD0,0x44,0xB0,0x82,0x6E,0x41,0x19,0xE8,0xDD, -0xE0,0xC1,0x88,0x5A,0xD1,0x1E,0x71,0x93,0x1F,0x24,0x30,0x74,0xE5,0x1E,0xA8,0xDE, -0x3C,0x27,0x37,0x7F,0x83,0xAE,0x9E,0x77,0xCF,0xF0,0x30,0xB1,0xFF,0x4B,0x99,0xE8, -0xC6,0xA1, -}; - - -/* subject:/C=US/O=AffirmTrust/CN=AffirmTrust Commercial */ -/* issuer :/C=US/O=AffirmTrust/CN=AffirmTrust Commercial */ - - -const unsigned char AffirmTrust_Commercial_certificate[848]={ -0x30,0x82,0x03,0x4C,0x30,0x82,0x02,0x34,0xA0,0x03,0x02,0x01,0x02,0x02,0x08,0x77, -0x77,0x06,0x27,0x26,0xA9,0xB1,0x7C,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7, -0x0D,0x01,0x01,0x0B,0x05,0x00,0x30,0x44,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04, -0x06,0x13,0x02,0x55,0x53,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x0C,0x0B, -0x41,0x66,0x66,0x69,0x72,0x6D,0x54,0x72,0x75,0x73,0x74,0x31,0x1F,0x30,0x1D,0x06, -0x03,0x55,0x04,0x03,0x0C,0x16,0x41,0x66,0x66,0x69,0x72,0x6D,0x54,0x72,0x75,0x73, -0x74,0x20,0x43,0x6F,0x6D,0x6D,0x65,0x72,0x63,0x69,0x61,0x6C,0x30,0x1E,0x17,0x0D, -0x31,0x30,0x30,0x31,0x32,0x39,0x31,0x34,0x30,0x36,0x30,0x36,0x5A,0x17,0x0D,0x33, -0x30,0x31,0x32,0x33,0x31,0x31,0x34,0x30,0x36,0x30,0x36,0x5A,0x30,0x44,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x14,0x30,0x12,0x06, -0x03,0x55,0x04,0x0A,0x0C,0x0B,0x41,0x66,0x66,0x69,0x72,0x6D,0x54,0x72,0x75,0x73, -0x74,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x03,0x0C,0x16,0x41,0x66,0x66,0x69, -0x72,0x6D,0x54,0x72,0x75,0x73,0x74,0x20,0x43,0x6F,0x6D,0x6D,0x65,0x72,0x63,0x69, -0x61,0x6C,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D, -0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82, -0x01,0x01,0x00,0xF6,0x1B,0x4F,0x67,0x07,0x2B,0xA1,0x15,0xF5,0x06,0x22,0xCB,0x1F, -0x01,0xB2,0xE3,0x73,0x45,0x06,0x44,0x49,0x2C,0xBB,0x49,0x25,0x14,0xD6,0xCE,0xC3, -0xB7,0xAB,0x2C,0x4F,0xC6,0x41,0x32,0x94,0x57,0xFA,0x12,0xA7,0x5B,0x0E,0xE2,0x8F, -0x1F,0x1E,0x86,0x19,0xA7,0xAA,0xB5,0x2D,0xB9,0x5F,0x0D,0x8A,0xC2,0xAF,0x85,0x35, -0x79,0x32,0x2D,0xBB,0x1C,0x62,0x37,0xF2,0xB1,0x5B,0x4A,0x3D,0xCA,0xCD,0x71,0x5F, -0xE9,0x42,0xBE,0x94,0xE8,0xC8,0xDE,0xF9,0x22,0x48,0x64,0xC6,0xE5,0xAB,0xC6,0x2B, -0x6D,0xAD,0x05,0xF0,0xFA,0xD5,0x0B,0xCF,0x9A,0xE5,0xF0,0x50,0xA4,0x8B,0x3B,0x47, -0xA5,0x23,0x5B,0x7A,0x7A,0xF8,0x33,0x3F,0xB8,0xEF,0x99,0x97,0xE3,0x20,0xC1,0xD6, -0x28,0x89,0xCF,0x94,0xFB,0xB9,0x45,0xED,0xE3,0x40,0x17,0x11,0xD4,0x74,0xF0,0x0B, -0x31,0xE2,0x2B,0x26,0x6A,0x9B,0x4C,0x57,0xAE,0xAC,0x20,0x3E,0xBA,0x45,0x7A,0x05, -0xF3,0xBD,0x9B,0x69,0x15,0xAE,0x7D,0x4E,0x20,0x63,0xC4,0x35,0x76,0x3A,0x07,0x02, -0xC9,0x37,0xFD,0xC7,0x47,0xEE,0xE8,0xF1,0x76,0x1D,0x73,0x15,0xF2,0x97,0xA4,0xB5, -0xC8,0x7A,0x79,0xD9,0x42,0xAA,0x2B,0x7F,0x5C,0xFE,0xCE,0x26,0x4F,0xA3,0x66,0x81, -0x35,0xAF,0x44,0xBA,0x54,0x1E,0x1C,0x30,0x32,0x65,0x9D,0xE6,0x3C,0x93,0x5E,0x50, -0x4E,0x7A,0xE3,0x3A,0xD4,0x6E,0xCC,0x1A,0xFB,0xF9,0xD2,0x37,0xAE,0x24,0x2A,0xAB, -0x57,0x03,0x22,0x28,0x0D,0x49,0x75,0x7F,0xB7,0x28,0xDA,0x75,0xBF,0x8E,0xE3,0xDC, -0x0E,0x79,0x31,0x02,0x03,0x01,0x00,0x01,0xA3,0x42,0x30,0x40,0x30,0x1D,0x06,0x03, -0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x9D,0x93,0xC6,0x53,0x8B,0x5E,0xCA,0xAF,0x3F, -0x9F,0x1E,0x0F,0xE5,0x99,0x95,0xBC,0x24,0xF6,0x94,0x8F,0x30,0x0F,0x06,0x03,0x55, -0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06,0x03, -0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0D,0x06,0x09, -0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x03,0x82,0x01,0x01,0x00, -0x58,0xAC,0xF4,0x04,0x0E,0xCD,0xC0,0x0D,0xFF,0x0A,0xFD,0xD4,0xBA,0x16,0x5F,0x29, -0xBD,0x7B,0x68,0x99,0x58,0x49,0xD2,0xB4,0x1D,0x37,0x4D,0x7F,0x27,0x7D,0x46,0x06, -0x5D,0x43,0xC6,0x86,0x2E,0x3E,0x73,0xB2,0x26,0x7D,0x4F,0x93,0xA9,0xB6,0xC4,0x2A, -0x9A,0xAB,0x21,0x97,0x14,0xB1,0xDE,0x8C,0xD3,0xAB,0x89,0x15,0xD8,0x6B,0x24,0xD4, -0xF1,0x16,0xAE,0xD8,0xA4,0x5C,0xD4,0x7F,0x51,0x8E,0xED,0x18,0x01,0xB1,0x93,0x63, -0xBD,0xBC,0xF8,0x61,0x80,0x9A,0x9E,0xB1,0xCE,0x42,0x70,0xE2,0xA9,0x7D,0x06,0x25, -0x7D,0x27,0xA1,0xFE,0x6F,0xEC,0xB3,0x1E,0x24,0xDA,0xE3,0x4B,0x55,0x1A,0x00,0x3B, -0x35,0xB4,0x3B,0xD9,0xD7,0x5D,0x30,0xFD,0x81,0x13,0x89,0xF2,0xC2,0x06,0x2B,0xED, -0x67,0xC4,0x8E,0xC9,0x43,0xB2,0x5C,0x6B,0x15,0x89,0x02,0xBC,0x62,0xFC,0x4E,0xF2, -0xB5,0x33,0xAA,0xB2,0x6F,0xD3,0x0A,0xA2,0x50,0xE3,0xF6,0x3B,0xE8,0x2E,0x44,0xC2, -0xDB,0x66,0x38,0xA9,0x33,0x56,0x48,0xF1,0x6D,0x1B,0x33,0x8D,0x0D,0x8C,0x3F,0x60, -0x37,0x9D,0xD3,0xCA,0x6D,0x7E,0x34,0x7E,0x0D,0x9F,0x72,0x76,0x8B,0x1B,0x9F,0x72, -0xFD,0x52,0x35,0x41,0x45,0x02,0x96,0x2F,0x1C,0xB2,0x9A,0x73,0x49,0x21,0xB1,0x49, -0x47,0x45,0x47,0xB4,0xEF,0x6A,0x34,0x11,0xC9,0x4D,0x9A,0xCC,0x59,0xB7,0xD6,0x02, -0x9E,0x5A,0x4E,0x65,0xB5,0x94,0xAE,0x1B,0xDF,0x29,0xB0,0x16,0xF1,0xBF,0x00,0x9E, -0x07,0x3A,0x17,0x64,0xB5,0x04,0xB5,0x23,0x21,0x99,0x0A,0x95,0x3B,0x97,0x7C,0xEF, -}; - - -/* subject:/C=US/O=AffirmTrust/CN=AffirmTrust Networking */ -/* issuer :/C=US/O=AffirmTrust/CN=AffirmTrust Networking */ - - -const unsigned char AffirmTrust_Networking_certificate[848]={ -0x30,0x82,0x03,0x4C,0x30,0x82,0x02,0x34,0xA0,0x03,0x02,0x01,0x02,0x02,0x08,0x7C, -0x4F,0x04,0x39,0x1C,0xD4,0x99,0x2D,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7, -0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x44,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04, -0x06,0x13,0x02,0x55,0x53,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x0C,0x0B, -0x41,0x66,0x66,0x69,0x72,0x6D,0x54,0x72,0x75,0x73,0x74,0x31,0x1F,0x30,0x1D,0x06, -0x03,0x55,0x04,0x03,0x0C,0x16,0x41,0x66,0x66,0x69,0x72,0x6D,0x54,0x72,0x75,0x73, -0x74,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x69,0x6E,0x67,0x30,0x1E,0x17,0x0D, -0x31,0x30,0x30,0x31,0x32,0x39,0x31,0x34,0x30,0x38,0x32,0x34,0x5A,0x17,0x0D,0x33, -0x30,0x31,0x32,0x33,0x31,0x31,0x34,0x30,0x38,0x32,0x34,0x5A,0x30,0x44,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x14,0x30,0x12,0x06, -0x03,0x55,0x04,0x0A,0x0C,0x0B,0x41,0x66,0x66,0x69,0x72,0x6D,0x54,0x72,0x75,0x73, -0x74,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x03,0x0C,0x16,0x41,0x66,0x66,0x69, -0x72,0x6D,0x54,0x72,0x75,0x73,0x74,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x69, -0x6E,0x67,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D, -0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82, -0x01,0x01,0x00,0xB4,0x84,0xCC,0x33,0x17,0x2E,0x6B,0x94,0x6C,0x6B,0x61,0x52,0xA0, -0xEB,0xA3,0xCF,0x79,0x94,0x4C,0xE5,0x94,0x80,0x99,0xCB,0x55,0x64,0x44,0x65,0x8F, -0x67,0x64,0xE2,0x06,0xE3,0x5C,0x37,0x49,0xF6,0x2F,0x9B,0x84,0x84,0x1E,0x2D,0xF2, -0x60,0x9D,0x30,0x4E,0xCC,0x84,0x85,0xE2,0x2C,0xCF,0x1E,0x9E,0xFE,0x36,0xAB,0x33, -0x77,0x35,0x44,0xD8,0x35,0x96,0x1A,0x3D,0x36,0xE8,0x7A,0x0E,0xD8,0xD5,0x47,0xA1, -0x6A,0x69,0x8B,0xD9,0xFC,0xBB,0x3A,0xAE,0x79,0x5A,0xD5,0xF4,0xD6,0x71,0xBB,0x9A, -0x90,0x23,0x6B,0x9A,0xB7,0x88,0x74,0x87,0x0C,0x1E,0x5F,0xB9,0x9E,0x2D,0xFA,0xAB, -0x53,0x2B,0xDC,0xBB,0x76,0x3E,0x93,0x4C,0x08,0x08,0x8C,0x1E,0xA2,0x23,0x1C,0xD4, -0x6A,0xAD,0x22,0xBA,0x99,0x01,0x2E,0x6D,0x65,0xCB,0xBE,0x24,0x66,0x55,0x24,0x4B, -0x40,0x44,0xB1,0x1B,0xD7,0xE1,0xC2,0x85,0xC0,0xDE,0x10,0x3F,0x3D,0xED,0xB8,0xFC, -0xF1,0xF1,0x23,0x53,0xDC,0xBF,0x65,0x97,0x6F,0xD9,0xF9,0x40,0x71,0x8D,0x7D,0xBD, -0x95,0xD4,0xCE,0xBE,0xA0,0x5E,0x27,0x23,0xDE,0xFD,0xA6,0xD0,0x26,0x0E,0x00,0x29, -0xEB,0x3C,0x46,0xF0,0x3D,0x60,0xBF,0x3F,0x50,0xD2,0xDC,0x26,0x41,0x51,0x9E,0x14, -0x37,0x42,0x04,0xA3,0x70,0x57,0xA8,0x1B,0x87,0xED,0x2D,0xFA,0x7B,0xEE,0x8C,0x0A, -0xE3,0xA9,0x66,0x89,0x19,0xCB,0x41,0xF9,0xDD,0x44,0x36,0x61,0xCF,0xE2,0x77,0x46, -0xC8,0x7D,0xF6,0xF4,0x92,0x81,0x36,0xFD,0xDB,0x34,0xF1,0x72,0x7E,0xF3,0x0C,0x16, -0xBD,0xB4,0x15,0x02,0x03,0x01,0x00,0x01,0xA3,0x42,0x30,0x40,0x30,0x1D,0x06,0x03, -0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x07,0x1F,0xD2,0xE7,0x9C,0xDA,0xC2,0x6E,0xA2, -0x40,0xB4,0xB0,0x7A,0x50,0x10,0x50,0x74,0xC4,0xC8,0xBD,0x30,0x0F,0x06,0x03,0x55, -0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06,0x03, -0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0D,0x06,0x09, -0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00, -0x89,0x57,0xB2,0x16,0x7A,0xA8,0xC2,0xFD,0xD6,0xD9,0x9B,0x9B,0x34,0xC2,0x9C,0xB4, -0x32,0x14,0x4D,0xA7,0xA4,0xDF,0xEC,0xBE,0xA7,0xBE,0xF8,0x43,0xDB,0x91,0x37,0xCE, -0xB4,0x32,0x2E,0x50,0x55,0x1A,0x35,0x4E,0x76,0x43,0x71,0x20,0xEF,0x93,0x77,0x4E, -0x15,0x70,0x2E,0x87,0xC3,0xC1,0x1D,0x6D,0xDC,0xCB,0xB5,0x27,0xD4,0x2C,0x56,0xD1, -0x52,0x53,0x3A,0x44,0xD2,0x73,0xC8,0xC4,0x1B,0x05,0x65,0x5A,0x62,0x92,0x9C,0xEE, -0x41,0x8D,0x31,0xDB,0xE7,0x34,0xEA,0x59,0x21,0xD5,0x01,0x7A,0xD7,0x64,0xB8,0x64, -0x39,0xCD,0xC9,0xED,0xAF,0xED,0x4B,0x03,0x48,0xA7,0xA0,0x99,0x01,0x80,0xDC,0x65, -0xA3,0x36,0xAE,0x65,0x59,0x48,0x4F,0x82,0x4B,0xC8,0x65,0xF1,0x57,0x1D,0xE5,0x59, -0x2E,0x0A,0x3F,0x6C,0xD8,0xD1,0xF5,0xE5,0x09,0xB4,0x6C,0x54,0x00,0x0A,0xE0,0x15, -0x4D,0x87,0x75,0x6D,0xB7,0x58,0x96,0x5A,0xDD,0x6D,0xD2,0x00,0xA0,0xF4,0x9B,0x48, -0xBE,0xC3,0x37,0xA4,0xBA,0x36,0xE0,0x7C,0x87,0x85,0x97,0x1A,0x15,0xA2,0xDE,0x2E, -0xA2,0x5B,0xBD,0xAF,0x18,0xF9,0x90,0x50,0xCD,0x70,0x59,0xF8,0x27,0x67,0x47,0xCB, -0xC7,0xA0,0x07,0x3A,0x7D,0xD1,0x2C,0x5D,0x6C,0x19,0x3A,0x66,0xB5,0x7D,0xFD,0x91, -0x6F,0x82,0xB1,0xBE,0x08,0x93,0xDB,0x14,0x47,0xF1,0xA2,0x37,0xC7,0x45,0x9E,0x3C, -0xC7,0x77,0xAF,0x64,0xA8,0x93,0xDF,0xF6,0x69,0x83,0x82,0x60,0xF2,0x49,0x42,0x34, -0xED,0x5A,0x00,0x54,0x85,0x1C,0x16,0x36,0x92,0x0C,0x5C,0xFA,0xA6,0xAD,0xBF,0xDB, -}; - - -/* subject:/C=US/O=AffirmTrust/CN=AffirmTrust Premium */ -/* issuer :/C=US/O=AffirmTrust/CN=AffirmTrust Premium */ - - -const unsigned char AffirmTrust_Premium_certificate[1354]={ -0x30,0x82,0x05,0x46,0x30,0x82,0x03,0x2E,0xA0,0x03,0x02,0x01,0x02,0x02,0x08,0x6D, -0x8C,0x14,0x46,0xB1,0xA6,0x0A,0xEE,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7, -0x0D,0x01,0x01,0x0C,0x05,0x00,0x30,0x41,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04, -0x06,0x13,0x02,0x55,0x53,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x0C,0x0B, -0x41,0x66,0x66,0x69,0x72,0x6D,0x54,0x72,0x75,0x73,0x74,0x31,0x1C,0x30,0x1A,0x06, -0x03,0x55,0x04,0x03,0x0C,0x13,0x41,0x66,0x66,0x69,0x72,0x6D,0x54,0x72,0x75,0x73, -0x74,0x20,0x50,0x72,0x65,0x6D,0x69,0x75,0x6D,0x30,0x1E,0x17,0x0D,0x31,0x30,0x30, -0x31,0x32,0x39,0x31,0x34,0x31,0x30,0x33,0x36,0x5A,0x17,0x0D,0x34,0x30,0x31,0x32, -0x33,0x31,0x31,0x34,0x31,0x30,0x33,0x36,0x5A,0x30,0x41,0x31,0x0B,0x30,0x09,0x06, -0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04, -0x0A,0x0C,0x0B,0x41,0x66,0x66,0x69,0x72,0x6D,0x54,0x72,0x75,0x73,0x74,0x31,0x1C, -0x30,0x1A,0x06,0x03,0x55,0x04,0x03,0x0C,0x13,0x41,0x66,0x66,0x69,0x72,0x6D,0x54, -0x72,0x75,0x73,0x74,0x20,0x50,0x72,0x65,0x6D,0x69,0x75,0x6D,0x30,0x82,0x02,0x22, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03, -0x82,0x02,0x0F,0x00,0x30,0x82,0x02,0x0A,0x02,0x82,0x02,0x01,0x00,0xC4,0x12,0xDF, -0xA9,0x5F,0xFE,0x41,0xDD,0xDD,0xF5,0x9F,0x8A,0xE3,0xF6,0xAC,0xE1,0x3C,0x78,0x9A, -0xBC,0xD8,0xF0,0x7F,0x7A,0xA0,0x33,0x2A,0xDC,0x8D,0x20,0x5B,0xAE,0x2D,0x6F,0xE7, -0x93,0xD9,0x36,0x70,0x6A,0x68,0xCF,0x8E,0x51,0xA3,0x85,0x5B,0x67,0x04,0xA0,0x10, -0x24,0x6F,0x5D,0x28,0x82,0xC1,0x97,0x57,0xD8,0x48,0x29,0x13,0xB6,0xE1,0xBE,0x91, -0x4D,0xDF,0x85,0x0C,0x53,0x18,0x9A,0x1E,0x24,0xA2,0x4F,0x8F,0xF0,0xA2,0x85,0x0B, -0xCB,0xF4,0x29,0x7F,0xD2,0xA4,0x58,0xEE,0x26,0x4D,0xC9,0xAA,0xA8,0x7B,0x9A,0xD9, -0xFA,0x38,0xDE,0x44,0x57,0x15,0xE5,0xF8,0x8C,0xC8,0xD9,0x48,0xE2,0x0D,0x16,0x27, -0x1D,0x1E,0xC8,0x83,0x85,0x25,0xB7,0xBA,0xAA,0x55,0x41,0xCC,0x03,0x22,0x4B,0x2D, -0x91,0x8D,0x8B,0xE6,0x89,0xAF,0x66,0xC7,0xE9,0xFF,0x2B,0xE9,0x3C,0xAC,0xDA,0xD2, -0xB3,0xC3,0xE1,0x68,0x9C,0x89,0xF8,0x7A,0x00,0x56,0xDE,0xF4,0x55,0x95,0x6C,0xFB, -0xBA,0x64,0xDD,0x62,0x8B,0xDF,0x0B,0x77,0x32,0xEB,0x62,0xCC,0x26,0x9A,0x9B,0xBB, -0xAA,0x62,0x83,0x4C,0xB4,0x06,0x7A,0x30,0xC8,0x29,0xBF,0xED,0x06,0x4D,0x97,0xB9, -0x1C,0xC4,0x31,0x2B,0xD5,0x5F,0xBC,0x53,0x12,0x17,0x9C,0x99,0x57,0x29,0x66,0x77, -0x61,0x21,0x31,0x07,0x2E,0x25,0x49,0x9D,0x18,0xF2,0xEE,0xF3,0x2B,0x71,0x8C,0xB5, -0xBA,0x39,0x07,0x49,0x77,0xFC,0xEF,0x2E,0x92,0x90,0x05,0x8D,0x2D,0x2F,0x77,0x7B, -0xEF,0x43,0xBF,0x35,0xBB,0x9A,0xD8,0xF9,0x73,0xA7,0x2C,0xF2,0xD0,0x57,0xEE,0x28, -0x4E,0x26,0x5F,0x8F,0x90,0x68,0x09,0x2F,0xB8,0xF8,0xDC,0x06,0xE9,0x2E,0x9A,0x3E, -0x51,0xA7,0xD1,0x22,0xC4,0x0A,0xA7,0x38,0x48,0x6C,0xB3,0xF9,0xFF,0x7D,0xAB,0x86, -0x57,0xE3,0xBA,0xD6,0x85,0x78,0x77,0xBA,0x43,0xEA,0x48,0x7F,0xF6,0xD8,0xBE,0x23, -0x6D,0x1E,0xBF,0xD1,0x36,0x6C,0x58,0x5C,0xF1,0xEE,0xA4,0x19,0x54,0x1A,0xF5,0x03, -0xD2,0x76,0xE6,0xE1,0x8C,0xBD,0x3C,0xB3,0xD3,0x48,0x4B,0xE2,0xC8,0xF8,0x7F,0x92, -0xA8,0x76,0x46,0x9C,0x42,0x65,0x3E,0xA4,0x1E,0xC1,0x07,0x03,0x5A,0x46,0x2D,0xB8, -0x97,0xF3,0xB7,0xD5,0xB2,0x55,0x21,0xEF,0xBA,0xDC,0x4C,0x00,0x97,0xFB,0x14,0x95, -0x27,0x33,0xBF,0xE8,0x43,0x47,0x46,0xD2,0x08,0x99,0x16,0x60,0x3B,0x9A,0x7E,0xD2, -0xE6,0xED,0x38,0xEA,0xEC,0x01,0x1E,0x3C,0x48,0x56,0x49,0x09,0xC7,0x4C,0x37,0x00, -0x9E,0x88,0x0E,0xC0,0x73,0xE1,0x6F,0x66,0xE9,0x72,0x47,0x30,0x3E,0x10,0xE5,0x0B, -0x03,0xC9,0x9A,0x42,0x00,0x6C,0xC5,0x94,0x7E,0x61,0xC4,0x8A,0xDF,0x7F,0x82,0x1A, -0x0B,0x59,0xC4,0x59,0x32,0x77,0xB3,0xBC,0x60,0x69,0x56,0x39,0xFD,0xB4,0x06,0x7B, -0x2C,0xD6,0x64,0x36,0xD9,0xBD,0x48,0xED,0x84,0x1F,0x7E,0xA5,0x22,0x8F,0x2A,0xB8, -0x42,0xF4,0x82,0xB7,0xD4,0x53,0x90,0x78,0x4E,0x2D,0x1A,0xFD,0x81,0x6F,0x44,0xD7, -0x3B,0x01,0x74,0x96,0x42,0xE0,0x00,0xE2,0x2E,0x6B,0xEA,0xC5,0xEE,0x72,0xAC,0xBB, -0xBF,0xFE,0xEA,0xAA,0xA8,0xF8,0xDC,0xF6,0xB2,0x79,0x8A,0xB6,0x67,0x02,0x03,0x01, -0x00,0x01,0xA3,0x42,0x30,0x40,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04, -0x14,0x9D,0xC0,0x67,0xA6,0x0C,0x22,0xD9,0x26,0xF5,0x45,0xAB,0xA6,0x65,0x52,0x11, -0x27,0xD8,0x45,0xAC,0x63,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04, -0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF, -0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D, -0x01,0x01,0x0C,0x05,0x00,0x03,0x82,0x02,0x01,0x00,0xB3,0x57,0x4D,0x10,0x62,0x4E, -0x3A,0xE4,0xAC,0xEA,0xB8,0x1C,0xAF,0x32,0x23,0xC8,0xB3,0x49,0x5A,0x51,0x9C,0x76, -0x28,0x8D,0x79,0xAA,0x57,0x46,0x17,0xD5,0xF5,0x52,0xF6,0xB7,0x44,0xE8,0x08,0x44, -0xBF,0x18,0x84,0xD2,0x0B,0x80,0xCD,0xC5,0x12,0xFD,0x00,0x55,0x05,0x61,0x87,0x41, -0xDC,0xB5,0x24,0x9E,0x3C,0xC4,0xD8,0xC8,0xFB,0x70,0x9E,0x2F,0x78,0x96,0x83,0x20, -0x36,0xDE,0x7C,0x0F,0x69,0x13,0x88,0xA5,0x75,0x36,0x98,0x08,0xA6,0xC6,0xDF,0xAC, -0xCE,0xE3,0x58,0xD6,0xB7,0x3E,0xDE,0xBA,0xF3,0xEB,0x34,0x40,0xD8,0xA2,0x81,0xF5, -0x78,0x3F,0x2F,0xD5,0xA5,0xFC,0xD9,0xA2,0xD4,0x5E,0x04,0x0E,0x17,0xAD,0xFE,0x41, -0xF0,0xE5,0xB2,0x72,0xFA,0x44,0x82,0x33,0x42,0xE8,0x2D,0x58,0xF7,0x56,0x8C,0x62, -0x3F,0xBA,0x42,0xB0,0x9C,0x0C,0x5C,0x7E,0x2E,0x65,0x26,0x5C,0x53,0x4F,0x00,0xB2, -0x78,0x7E,0xA1,0x0D,0x99,0x2D,0x8D,0xB8,0x1D,0x8E,0xA2,0xC4,0xB0,0xFD,0x60,0xD0, -0x30,0xA4,0x8E,0xC8,0x04,0x62,0xA9,0xC4,0xED,0x35,0xDE,0x7A,0x97,0xED,0x0E,0x38, -0x5E,0x92,0x2F,0x93,0x70,0xA5,0xA9,0x9C,0x6F,0xA7,0x7D,0x13,0x1D,0x7E,0xC6,0x08, -0x48,0xB1,0x5E,0x67,0xEB,0x51,0x08,0x25,0xE9,0xE6,0x25,0x6B,0x52,0x29,0x91,0x9C, -0xD2,0x39,0x73,0x08,0x57,0xDE,0x99,0x06,0xB4,0x5B,0x9D,0x10,0x06,0xE1,0xC2,0x00, -0xA8,0xB8,0x1C,0x4A,0x02,0x0A,0x14,0xD0,0xC1,0x41,0xCA,0xFB,0x8C,0x35,0x21,0x7D, -0x82,0x38,0xF2,0xA9,0x54,0x91,0x19,0x35,0x93,0x94,0x6D,0x6A,0x3A,0xC5,0xB2,0xD0, -0xBB,0x89,0x86,0x93,0xE8,0x9B,0xC9,0x0F,0x3A,0xA7,0x7A,0xB8,0xA1,0xF0,0x78,0x46, -0xFA,0xFC,0x37,0x2F,0xE5,0x8A,0x84,0xF3,0xDF,0xFE,0x04,0xD9,0xA1,0x68,0xA0,0x2F, -0x24,0xE2,0x09,0x95,0x06,0xD5,0x95,0xCA,0xE1,0x24,0x96,0xEB,0x7C,0xF6,0x93,0x05, -0xBB,0xED,0x73,0xE9,0x2D,0xD1,0x75,0x39,0xD7,0xE7,0x24,0xDB,0xD8,0x4E,0x5F,0x43, -0x8F,0x9E,0xD0,0x14,0x39,0xBF,0x55,0x70,0x48,0x99,0x57,0x31,0xB4,0x9C,0xEE,0x4A, -0x98,0x03,0x96,0x30,0x1F,0x60,0x06,0xEE,0x1B,0x23,0xFE,0x81,0x60,0x23,0x1A,0x47, -0x62,0x85,0xA5,0xCC,0x19,0x34,0x80,0x6F,0xB3,0xAC,0x1A,0xE3,0x9F,0xF0,0x7B,0x48, -0xAD,0xD5,0x01,0xD9,0x67,0xB6,0xA9,0x72,0x93,0xEA,0x2D,0x66,0xB5,0xB2,0xB8,0xE4, -0x3D,0x3C,0xB2,0xEF,0x4C,0x8C,0xEA,0xEB,0x07,0xBF,0xAB,0x35,0x9A,0x55,0x86,0xBC, -0x18,0xA6,0xB5,0xA8,0x5E,0xB4,0x83,0x6C,0x6B,0x69,0x40,0xD3,0x9F,0xDC,0xF1,0xC3, -0x69,0x6B,0xB9,0xE1,0x6D,0x09,0xF4,0xF1,0xAA,0x50,0x76,0x0A,0x7A,0x7D,0x7A,0x17, -0xA1,0x55,0x96,0x42,0x99,0x31,0x09,0xDD,0x60,0x11,0x8D,0x05,0x30,0x7E,0xE6,0x8E, -0x46,0xD1,0x9D,0x14,0xDA,0xC7,0x17,0xE4,0x05,0x96,0x8C,0xC4,0x24,0xB5,0x1B,0xCF, -0x14,0x07,0xB2,0x40,0xF8,0xA3,0x9E,0x41,0x86,0xBC,0x04,0xD0,0x6B,0x96,0xC8,0x2A, -0x80,0x34,0xFD,0xBF,0xEF,0x06,0xA3,0xDD,0x58,0xC5,0x85,0x3D,0x3E,0x8F,0xFE,0x9E, -0x29,0xE0,0xB6,0xB8,0x09,0x68,0x19,0x1C,0x18,0x43, -}; - - -/* subject:/C=US/O=AffirmTrust/CN=AffirmTrust Premium ECC */ -/* issuer :/C=US/O=AffirmTrust/CN=AffirmTrust Premium ECC */ - - -const unsigned char AffirmTrust_Premium_ECC_certificate[514]={ -0x30,0x82,0x01,0xFE,0x30,0x82,0x01,0x85,0xA0,0x03,0x02,0x01,0x02,0x02,0x08,0x74, -0x97,0x25,0x8A,0xC7,0x3F,0x7A,0x54,0x30,0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D, -0x04,0x03,0x03,0x30,0x45,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02, -0x55,0x53,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x0C,0x0B,0x41,0x66,0x66, -0x69,0x72,0x6D,0x54,0x72,0x75,0x73,0x74,0x31,0x20,0x30,0x1E,0x06,0x03,0x55,0x04, -0x03,0x0C,0x17,0x41,0x66,0x66,0x69,0x72,0x6D,0x54,0x72,0x75,0x73,0x74,0x20,0x50, -0x72,0x65,0x6D,0x69,0x75,0x6D,0x20,0x45,0x43,0x43,0x30,0x1E,0x17,0x0D,0x31,0x30, -0x30,0x31,0x32,0x39,0x31,0x34,0x32,0x30,0x32,0x34,0x5A,0x17,0x0D,0x34,0x30,0x31, -0x32,0x33,0x31,0x31,0x34,0x32,0x30,0x32,0x34,0x5A,0x30,0x45,0x31,0x0B,0x30,0x09, -0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x14,0x30,0x12,0x06,0x03,0x55, -0x04,0x0A,0x0C,0x0B,0x41,0x66,0x66,0x69,0x72,0x6D,0x54,0x72,0x75,0x73,0x74,0x31, -0x20,0x30,0x1E,0x06,0x03,0x55,0x04,0x03,0x0C,0x17,0x41,0x66,0x66,0x69,0x72,0x6D, -0x54,0x72,0x75,0x73,0x74,0x20,0x50,0x72,0x65,0x6D,0x69,0x75,0x6D,0x20,0x45,0x43, -0x43,0x30,0x76,0x30,0x10,0x06,0x07,0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,0x06,0x05, -0x2B,0x81,0x04,0x00,0x22,0x03,0x62,0x00,0x04,0x0D,0x30,0x5E,0x1B,0x15,0x9D,0x03, -0xD0,0xA1,0x79,0x35,0xB7,0x3A,0x3C,0x92,0x7A,0xCA,0x15,0x1C,0xCD,0x62,0xF3,0x9C, -0x26,0x5C,0x07,0x3D,0xE5,0x54,0xFA,0xA3,0xD6,0xCC,0x12,0xEA,0xF4,0x14,0x5F,0xE8, -0x8E,0x19,0xAB,0x2F,0x2E,0x48,0xE6,0xAC,0x18,0x43,0x78,0xAC,0xD0,0x37,0xC3,0xBD, -0xB2,0xCD,0x2C,0xE6,0x47,0xE2,0x1A,0xE6,0x63,0xB8,0x3D,0x2E,0x2F,0x78,0xC4,0x4F, -0xDB,0xF4,0x0F,0xA4,0x68,0x4C,0x55,0x72,0x6B,0x95,0x1D,0x4E,0x18,0x42,0x95,0x78, -0xCC,0x37,0x3C,0x91,0xE2,0x9B,0x65,0x2B,0x29,0xA3,0x42,0x30,0x40,0x30,0x1D,0x06, -0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x9A,0xAF,0x29,0x7A,0xC0,0x11,0x35,0x35, -0x26,0x51,0x30,0x00,0xC3,0x6A,0xFE,0x40,0xD5,0xAE,0xD6,0x3C,0x30,0x0F,0x06,0x03, -0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06, -0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0A,0x06, -0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,0x03,0x67,0x00,0x30,0x64,0x02,0x30, -0x17,0x09,0xF3,0x87,0x88,0x50,0x5A,0xAF,0xC8,0xC0,0x42,0xBF,0x47,0x5F,0xF5,0x6C, -0x6A,0x86,0xE0,0xC4,0x27,0x74,0xE4,0x38,0x53,0xD7,0x05,0x7F,0x1B,0x34,0xE3,0xC6, -0x2F,0xB3,0xCA,0x09,0x3C,0x37,0x9D,0xD7,0xE7,0xB8,0x46,0xF1,0xFD,0xA1,0xE2,0x71, -0x02,0x30,0x42,0x59,0x87,0x43,0xD4,0x51,0xDF,0xBA,0xD3,0x09,0x32,0x5A,0xCE,0x88, -0x7E,0x57,0x3D,0x9C,0x5F,0x42,0x6B,0xF5,0x07,0x2D,0xB5,0xF0,0x82,0x93,0xF9,0x59, -0x6F,0xAE,0x64,0xFA,0x58,0xE5,0x8B,0x1E,0xE3,0x63,0xBE,0xB5,0x81,0xCD,0x6F,0x02, -0x8C,0x79, -}; - - -/* subject:/C=US/O=America Online Inc./CN=America Online Root Certification Authority 1 */ -/* issuer :/C=US/O=America Online Inc./CN=America Online Root Certification Authority 1 */ - - -const unsigned char America_Online_Root_Certification_Authority_1_certificate[936]={ -0x30,0x82,0x03,0xA4,0x30,0x82,0x02,0x8C,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x63,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x1C, -0x30,0x1A,0x06,0x03,0x55,0x04,0x0A,0x13,0x13,0x41,0x6D,0x65,0x72,0x69,0x63,0x61, -0x20,0x4F,0x6E,0x6C,0x69,0x6E,0x65,0x20,0x49,0x6E,0x63,0x2E,0x31,0x36,0x30,0x34, -0x06,0x03,0x55,0x04,0x03,0x13,0x2D,0x41,0x6D,0x65,0x72,0x69,0x63,0x61,0x20,0x4F, -0x6E,0x6C,0x69,0x6E,0x65,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x65,0x72,0x74,0x69, -0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69, -0x74,0x79,0x20,0x31,0x30,0x1E,0x17,0x0D,0x30,0x32,0x30,0x35,0x32,0x38,0x30,0x36, -0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x37,0x31,0x31,0x31,0x39,0x32,0x30,0x34, -0x33,0x30,0x30,0x5A,0x30,0x63,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13, -0x02,0x55,0x53,0x31,0x1C,0x30,0x1A,0x06,0x03,0x55,0x04,0x0A,0x13,0x13,0x41,0x6D, -0x65,0x72,0x69,0x63,0x61,0x20,0x4F,0x6E,0x6C,0x69,0x6E,0x65,0x20,0x49,0x6E,0x63, -0x2E,0x31,0x36,0x30,0x34,0x06,0x03,0x55,0x04,0x03,0x13,0x2D,0x41,0x6D,0x65,0x72, -0x69,0x63,0x61,0x20,0x4F,0x6E,0x6C,0x69,0x6E,0x65,0x20,0x52,0x6F,0x6F,0x74,0x20, -0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75, -0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x20,0x31,0x30,0x82,0x01,0x22,0x30,0x0D,0x06, -0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F, -0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xA8,0x2F,0xE8,0xA4,0x69,0x06, -0x03,0x47,0xC3,0xE9,0x2A,0x98,0xFF,0x19,0xA2,0x70,0x9A,0xC6,0x50,0xB2,0x7E,0xA5, -0xDF,0x68,0x4D,0x1B,0x7C,0x0F,0xB6,0x97,0x68,0x7D,0x2D,0xA6,0x8B,0x97,0xE9,0x64, -0x86,0xC9,0xA3,0xEF,0xA0,0x86,0xBF,0x60,0x65,0x9C,0x4B,0x54,0x88,0xC2,0x48,0xC5, -0x4A,0x39,0xBF,0x14,0xE3,0x59,0x55,0xE5,0x19,0xB4,0x74,0xC8,0xB4,0x05,0x39,0x5C, -0x16,0xA5,0xE2,0x95,0x05,0xE0,0x12,0xAE,0x59,0x8B,0xA2,0x33,0x68,0x58,0x1C,0xA6, -0xD4,0x15,0xB7,0xD8,0x9F,0xD7,0xDC,0x71,0xAB,0x7E,0x9A,0xBF,0x9B,0x8E,0x33,0x0F, -0x22,0xFD,0x1F,0x2E,0xE7,0x07,0x36,0xEF,0x62,0x39,0xC5,0xDD,0xCB,0xBA,0x25,0x14, -0x23,0xDE,0x0C,0xC6,0x3D,0x3C,0xCE,0x82,0x08,0xE6,0x66,0x3E,0xDA,0x51,0x3B,0x16, -0x3A,0xA3,0x05,0x7F,0xA0,0xDC,0x87,0xD5,0x9C,0xFC,0x72,0xA9,0xA0,0x7D,0x78,0xE4, -0xB7,0x31,0x55,0x1E,0x65,0xBB,0xD4,0x61,0xB0,0x21,0x60,0xED,0x10,0x32,0x72,0xC5, -0x92,0x25,0x1E,0xF8,0x90,0x4A,0x18,0x78,0x47,0xDF,0x7E,0x30,0x37,0x3E,0x50,0x1B, -0xDB,0x1C,0xD3,0x6B,0x9A,0x86,0x53,0x07,0xB0,0xEF,0xAC,0x06,0x78,0xF8,0x84,0x99, -0xFE,0x21,0x8D,0x4C,0x80,0xB6,0x0C,0x82,0xF6,0x66,0x70,0x79,0x1A,0xD3,0x4F,0xA3, -0xCF,0xF1,0xCF,0x46,0xB0,0x4B,0x0F,0x3E,0xDD,0x88,0x62,0xB8,0x8C,0xA9,0x09,0x28, -0x3B,0x7A,0xC7,0x97,0xE1,0x1E,0xE5,0xF4,0x9F,0xC0,0xC0,0xAE,0x24,0xA0,0xC8,0xA1, -0xD9,0x0F,0xD6,0x7B,0x26,0x82,0x69,0x32,0x3D,0xA7,0x02,0x03,0x01,0x00,0x01,0xA3, -0x63,0x30,0x61,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30, -0x03,0x01,0x01,0xFF,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x00, -0xAD,0xD9,0xA3,0xF6,0x79,0xF6,0x6E,0x74,0xA9,0x7F,0x33,0x3D,0x81,0x17,0xD7,0x4C, -0xCF,0x33,0xDE,0x30,0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18,0x30,0x16,0x80,0x14, -0x00,0xAD,0xD9,0xA3,0xF6,0x79,0xF6,0x6E,0x74,0xA9,0x7F,0x33,0x3D,0x81,0x17,0xD7, -0x4C,0xCF,0x33,0xDE,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04, -0x03,0x02,0x01,0x86,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01, -0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x7C,0x8A,0xD1,0x1F,0x18,0x37,0x82,0xE0, -0xB8,0xB0,0xA3,0xED,0x56,0x95,0xC8,0x62,0x61,0x9C,0x05,0xA2,0xCD,0xC2,0x62,0x26, -0x61,0xCD,0x10,0x16,0xD7,0xCC,0xB4,0x65,0x34,0xD0,0x11,0x8A,0xAD,0xA8,0xA9,0x05, -0x66,0xEF,0x74,0xF3,0x6D,0x5F,0x9D,0x99,0xAF,0xF6,0x8B,0xFB,0xEB,0x52,0xB2,0x05, -0x98,0xA2,0x6F,0x2A,0xC5,0x54,0xBD,0x25,0xBD,0x5F,0xAE,0xC8,0x86,0xEA,0x46,0x2C, -0xC1,0xB3,0xBD,0xC1,0xE9,0x49,0x70,0x18,0x16,0x97,0x08,0x13,0x8C,0x20,0xE0,0x1B, -0x2E,0x3A,0x47,0xCB,0x1E,0xE4,0x00,0x30,0x95,0x5B,0xF4,0x45,0xA3,0xC0,0x1A,0xB0, -0x01,0x4E,0xAB,0xBD,0xC0,0x23,0x6E,0x63,0x3F,0x80,0x4A,0xC5,0x07,0xED,0xDC,0xE2, -0x6F,0xC7,0xC1,0x62,0xF1,0xE3,0x72,0xD6,0x04,0xC8,0x74,0x67,0x0B,0xFA,0x88,0xAB, -0xA1,0x01,0xC8,0x6F,0xF0,0x14,0xAF,0xD2,0x99,0xCD,0x51,0x93,0x7E,0xED,0x2E,0x38, -0xC7,0xBD,0xCE,0x46,0x50,0x3D,0x72,0xE3,0x79,0x25,0x9D,0x9B,0x88,0x2B,0x10,0x20, -0xDD,0xA5,0xB8,0x32,0x9F,0x8D,0xE0,0x29,0xDF,0x21,0x74,0x86,0x82,0xDB,0x2F,0x82, -0x30,0xC6,0xC7,0x35,0x86,0xB3,0xF9,0x96,0x5F,0x46,0xDB,0x0C,0x45,0xFD,0xF3,0x50, -0xC3,0x6F,0xC6,0xC3,0x48,0xAD,0x46,0xA6,0xE1,0x27,0x47,0x0A,0x1D,0x0E,0x9B,0xB6, -0xC2,0x77,0x7F,0x63,0xF2,0xE0,0x7D,0x1A,0xBE,0xFC,0xE0,0xDF,0xD7,0xC7,0xA7,0x6C, -0xB0,0xF9,0xAE,0xBA,0x3C,0xFD,0x74,0xB4,0x11,0xE8,0x58,0x0D,0x80,0xBC,0xD3,0xA8, -0x80,0x3A,0x99,0xED,0x75,0xCC,0x46,0x7B, -}; - - -/* subject:/C=US/O=America Online Inc./CN=America Online Root Certification Authority 2 */ -/* issuer :/C=US/O=America Online Inc./CN=America Online Root Certification Authority 2 */ - - -const unsigned char America_Online_Root_Certification_Authority_2_certificate[1448]={ -0x30,0x82,0x05,0xA4,0x30,0x82,0x03,0x8C,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x63,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x1C, -0x30,0x1A,0x06,0x03,0x55,0x04,0x0A,0x13,0x13,0x41,0x6D,0x65,0x72,0x69,0x63,0x61, -0x20,0x4F,0x6E,0x6C,0x69,0x6E,0x65,0x20,0x49,0x6E,0x63,0x2E,0x31,0x36,0x30,0x34, -0x06,0x03,0x55,0x04,0x03,0x13,0x2D,0x41,0x6D,0x65,0x72,0x69,0x63,0x61,0x20,0x4F, -0x6E,0x6C,0x69,0x6E,0x65,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x65,0x72,0x74,0x69, -0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69, -0x74,0x79,0x20,0x32,0x30,0x1E,0x17,0x0D,0x30,0x32,0x30,0x35,0x32,0x38,0x30,0x36, -0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x37,0x30,0x39,0x32,0x39,0x31,0x34,0x30, -0x38,0x30,0x30,0x5A,0x30,0x63,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13, -0x02,0x55,0x53,0x31,0x1C,0x30,0x1A,0x06,0x03,0x55,0x04,0x0A,0x13,0x13,0x41,0x6D, -0x65,0x72,0x69,0x63,0x61,0x20,0x4F,0x6E,0x6C,0x69,0x6E,0x65,0x20,0x49,0x6E,0x63, -0x2E,0x31,0x36,0x30,0x34,0x06,0x03,0x55,0x04,0x03,0x13,0x2D,0x41,0x6D,0x65,0x72, -0x69,0x63,0x61,0x20,0x4F,0x6E,0x6C,0x69,0x6E,0x65,0x20,0x52,0x6F,0x6F,0x74,0x20, -0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75, -0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x20,0x32,0x30,0x82,0x02,0x22,0x30,0x0D,0x06, -0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x02,0x0F, -0x00,0x30,0x82,0x02,0x0A,0x02,0x82,0x02,0x01,0x00,0xCC,0x41,0x45,0x1D,0xE9,0x3D, -0x4D,0x10,0xF6,0x8C,0xB1,0x41,0xC9,0xE0,0x5E,0xCB,0x0D,0xB7,0xBF,0x47,0x73,0xD3, -0xF0,0x55,0x4D,0xDD,0xC6,0x0C,0xFA,0xB1,0x66,0x05,0x6A,0xCD,0x78,0xB4,0xDC,0x02, -0xDB,0x4E,0x81,0xF3,0xD7,0xA7,0x7C,0x71,0xBC,0x75,0x63,0xA0,0x5D,0xE3,0x07,0x0C, -0x48,0xEC,0x25,0xC4,0x03,0x20,0xF4,0xFF,0x0E,0x3B,0x12,0xFF,0x9B,0x8D,0xE1,0xC6, -0xD5,0x1B,0xB4,0x6D,0x22,0xE3,0xB1,0xDB,0x7F,0x21,0x64,0xAF,0x86,0xBC,0x57,0x22, -0x2A,0xD6,0x47,0x81,0x57,0x44,0x82,0x56,0x53,0xBD,0x86,0x14,0x01,0x0B,0xFC,0x7F, -0x74,0xA4,0x5A,0xAE,0xF1,0xBA,0x11,0xB5,0x9B,0x58,0x5A,0x80,0xB4,0x37,0x78,0x09, -0x33,0x7C,0x32,0x47,0x03,0x5C,0xC4,0xA5,0x83,0x48,0xF4,0x57,0x56,0x6E,0x81,0x36, -0x27,0x18,0x4F,0xEC,0x9B,0x28,0xC2,0xD4,0xB4,0xD7,0x7C,0x0C,0x3E,0x0C,0x2B,0xDF, -0xCA,0x04,0xD7,0xC6,0x8E,0xEA,0x58,0x4E,0xA8,0xA4,0xA5,0x18,0x1C,0x6C,0x45,0x98, -0xA3,0x41,0xD1,0x2D,0xD2,0xC7,0x6D,0x8D,0x19,0xF1,0xAD,0x79,0xB7,0x81,0x3F,0xBD, -0x06,0x82,0x27,0x2D,0x10,0x58,0x05,0xB5,0x78,0x05,0xB9,0x2F,0xDB,0x0C,0x6B,0x90, -0x90,0x7E,0x14,0x59,0x38,0xBB,0x94,0x24,0x13,0xE5,0xD1,0x9D,0x14,0xDF,0xD3,0x82, -0x4D,0x46,0xF0,0x80,0x39,0x52,0x32,0x0F,0xE3,0x84,0xB2,0x7A,0x43,0xF2,0x5E,0xDE, -0x5F,0x3F,0x1D,0xDD,0xE3,0xB2,0x1B,0xA0,0xA1,0x2A,0x23,0x03,0x6E,0x2E,0x01,0x15, -0x87,0x5C,0xA6,0x75,0x75,0xC7,0x97,0x61,0xBE,0xDE,0x86,0xDC,0xD4,0x48,0xDB,0xBD, -0x2A,0xBF,0x4A,0x55,0xDA,0xE8,0x7D,0x50,0xFB,0xB4,0x80,0x17,0xB8,0x94,0xBF,0x01, -0x3D,0xEA,0xDA,0xBA,0x7C,0xE0,0x58,0x67,0x17,0xB9,0x58,0xE0,0x88,0x86,0x46,0x67, -0x6C,0x9D,0x10,0x47,0x58,0x32,0xD0,0x35,0x7C,0x79,0x2A,0x90,0xA2,0x5A,0x10,0x11, -0x23,0x35,0xAD,0x2F,0xCC,0xE4,0x4A,0x5B,0xA7,0xC8,0x27,0xF2,0x83,0xDE,0x5E,0xBB, -0x5E,0x77,0xE7,0xE8,0xA5,0x6E,0x63,0xC2,0x0D,0x5D,0x61,0xD0,0x8C,0xD2,0x6C,0x5A, -0x21,0x0E,0xCA,0x28,0xA3,0xCE,0x2A,0xE9,0x95,0xC7,0x48,0xCF,0x96,0x6F,0x1D,0x92, -0x25,0xC8,0xC6,0xC6,0xC1,0xC1,0x0C,0x05,0xAC,0x26,0xC4,0xD2,0x75,0xD2,0xE1,0x2A, -0x67,0xC0,0x3D,0x5B,0xA5,0x9A,0xEB,0xCF,0x7B,0x1A,0xA8,0x9D,0x14,0x45,0xE5,0x0F, -0xA0,0x9A,0x65,0xDE,0x2F,0x28,0xBD,0xCE,0x6F,0x94,0x66,0x83,0x48,0x29,0xD8,0xEA, -0x65,0x8C,0xAF,0x93,0xD9,0x64,0x9F,0x55,0x57,0x26,0xBF,0x6F,0xCB,0x37,0x31,0x99, -0xA3,0x60,0xBB,0x1C,0xAD,0x89,0x34,0x32,0x62,0xB8,0x43,0x21,0x06,0x72,0x0C,0xA1, -0x5C,0x6D,0x46,0xC5,0xFA,0x29,0xCF,0x30,0xDE,0x89,0xDC,0x71,0x5B,0xDD,0xB6,0x37, -0x3E,0xDF,0x50,0xF5,0xB8,0x07,0x25,0x26,0xE5,0xBC,0xB5,0xFE,0x3C,0x02,0xB3,0xB7, -0xF8,0xBE,0x43,0xC1,0x87,0x11,0x94,0x9E,0x23,0x6C,0x17,0x8A,0xB8,0x8A,0x27,0x0C, -0x54,0x47,0xF0,0xA9,0xB3,0xC0,0x80,0x8C,0xA0,0x27,0xEB,0x1D,0x19,0xE3,0x07,0x8E, -0x77,0x70,0xCA,0x2B,0xF4,0x7D,0x76,0xE0,0x78,0x67,0x02,0x03,0x01,0x00,0x01,0xA3, -0x63,0x30,0x61,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30, -0x03,0x01,0x01,0xFF,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x4D, -0x45,0xC1,0x68,0x38,0xBB,0x73,0xA9,0x69,0xA1,0x20,0xE7,0xED,0xF5,0x22,0xA1,0x23, -0x14,0xD7,0x9E,0x30,0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18,0x30,0x16,0x80,0x14, -0x4D,0x45,0xC1,0x68,0x38,0xBB,0x73,0xA9,0x69,0xA1,0x20,0xE7,0xED,0xF5,0x22,0xA1, -0x23,0x14,0xD7,0x9E,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04, -0x03,0x02,0x01,0x86,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01, -0x05,0x05,0x00,0x03,0x82,0x02,0x01,0x00,0x67,0x6B,0x06,0xB9,0x5F,0x45,0x3B,0x2A, -0x4B,0x33,0xB3,0xE6,0x1B,0x6B,0x59,0x4E,0x22,0xCC,0xB9,0xB7,0xA4,0x25,0xC9,0xA7, -0xC4,0xF0,0x54,0x96,0x0B,0x64,0xF3,0xB1,0x58,0x4F,0x5E,0x51,0xFC,0xB2,0x97,0x7B, -0x27,0x65,0xC2,0xE5,0xCA,0xE7,0x0D,0x0C,0x25,0x7B,0x62,0xE3,0xFA,0x9F,0xB4,0x87, -0xB7,0x45,0x46,0xAF,0x83,0xA5,0x97,0x48,0x8C,0xA5,0xBD,0xF1,0x16,0x2B,0x9B,0x76, -0x2C,0x7A,0x35,0x60,0x6C,0x11,0x80,0x97,0xCC,0xA9,0x92,0x52,0xE6,0x2B,0xE6,0x69, -0xED,0xA9,0xF8,0x36,0x2D,0x2C,0x77,0xBF,0x61,0x48,0xD1,0x63,0x0B,0xB9,0x5B,0x52, -0xED,0x18,0xB0,0x43,0x42,0x22,0xA6,0xB1,0x77,0xAE,0xDE,0x69,0xC5,0xCD,0xC7,0x1C, -0xA1,0xB1,0xA5,0x1C,0x10,0xFB,0x18,0xBE,0x1A,0x70,0xDD,0xC1,0x92,0x4B,0xBE,0x29, -0x5A,0x9D,0x3F,0x35,0xBE,0xE5,0x7D,0x51,0xF8,0x55,0xE0,0x25,0x75,0x23,0x87,0x1E, -0x5C,0xDC,0xBA,0x9D,0xB0,0xAC,0xB3,0x69,0xDB,0x17,0x83,0xC9,0xF7,0xDE,0x0C,0xBC, -0x08,0xDC,0x91,0x9E,0xA8,0xD0,0xD7,0x15,0x37,0x73,0xA5,0x35,0xB8,0xFC,0x7E,0xC5, -0x44,0x40,0x06,0xC3,0xEB,0xF8,0x22,0x80,0x5C,0x47,0xCE,0x02,0xE3,0x11,0x9F,0x44, -0xFF,0xFD,0x9A,0x32,0xCC,0x7D,0x64,0x51,0x0E,0xEB,0x57,0x26,0x76,0x3A,0xE3,0x1E, -0x22,0x3C,0xC2,0xA6,0x36,0xDD,0x19,0xEF,0xA7,0xFC,0x12,0xF3,0x26,0xC0,0x59,0x31, -0x85,0x4C,0x9C,0xD8,0xCF,0xDF,0xA4,0xCC,0xCC,0x29,0x93,0xFF,0x94,0x6D,0x76,0x5C, -0x13,0x08,0x97,0xF2,0xED,0xA5,0x0B,0x4D,0xDD,0xE8,0xC9,0x68,0x0E,0x66,0xD3,0x00, -0x0E,0x33,0x12,0x5B,0xBC,0x95,0xE5,0x32,0x90,0xA8,0xB3,0xC6,0x6C,0x83,0xAD,0x77, -0xEE,0x8B,0x7E,0x7E,0xB1,0xA9,0xAB,0xD3,0xE1,0xF1,0xB6,0xC0,0xB1,0xEA,0x88,0xC0, -0xE7,0xD3,0x90,0xE9,0x28,0x92,0x94,0x7B,0x68,0x7B,0x97,0x2A,0x0A,0x67,0x2D,0x85, -0x02,0x38,0x10,0xE4,0x03,0x61,0xD4,0xDA,0x25,0x36,0xC7,0x08,0x58,0x2D,0xA1,0xA7, -0x51,0xAF,0x30,0x0A,0x49,0xF5,0xA6,0x69,0x87,0x07,0x2D,0x44,0x46,0x76,0x8E,0x2A, -0xE5,0x9A,0x3B,0xD7,0x18,0xA2,0xFC,0x9C,0x38,0x10,0xCC,0xC6,0x3B,0xD2,0xB5,0x17, -0x3A,0x6F,0xFD,0xAE,0x25,0xBD,0xF5,0x72,0x59,0x64,0xB1,0x74,0x2A,0x38,0x5F,0x18, -0x4C,0xDF,0xCF,0x71,0x04,0x5A,0x36,0xD4,0xBF,0x2F,0x99,0x9C,0xE8,0xD9,0xBA,0xB1, -0x95,0xE6,0x02,0x4B,0x21,0xA1,0x5B,0xD5,0xC1,0x4F,0x8F,0xAE,0x69,0x6D,0x53,0xDB, -0x01,0x93,0xB5,0x5C,0x1E,0x18,0xDD,0x64,0x5A,0xCA,0x18,0x28,0x3E,0x63,0x04,0x11, -0xFD,0x1C,0x8D,0x00,0x0F,0xB8,0x37,0xDF,0x67,0x8A,0x9D,0x66,0xA9,0x02,0x6A,0x91, -0xFF,0x13,0xCA,0x2F,0x5D,0x83,0xBC,0x87,0x93,0x6C,0xDC,0x24,0x51,0x16,0x04,0x25, -0x66,0xFA,0xB3,0xD9,0xC2,0xBA,0x29,0xBE,0x9A,0x48,0x38,0x82,0x99,0xF4,0xBF,0x3B, -0x4A,0x31,0x19,0xF9,0xBF,0x8E,0x21,0x33,0x14,0xCA,0x4F,0x54,0x5F,0xFB,0xCE,0xFB, -0x8F,0x71,0x7F,0xFD,0x5E,0x19,0xA0,0x0F,0x4B,0x91,0xB8,0xC4,0x54,0xBC,0x06,0xB0, -0x45,0x8F,0x26,0x91,0xA2,0x8E,0xFE,0xA9, -}; - - -/* subject:/C=IE/O=Baltimore/OU=CyberTrust/CN=Baltimore CyberTrust Root */ -/* issuer :/C=IE/O=Baltimore/OU=CyberTrust/CN=Baltimore CyberTrust Root */ - - -const unsigned char Baltimore_CyberTrust_Root_certificate[891]={ -0x30,0x82,0x03,0x77,0x30,0x82,0x02,0x5F,0xA0,0x03,0x02,0x01,0x02,0x02,0x04,0x02, -0x00,0x00,0xB9,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05, -0x05,0x00,0x30,0x5A,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x49, -0x45,0x31,0x12,0x30,0x10,0x06,0x03,0x55,0x04,0x0A,0x13,0x09,0x42,0x61,0x6C,0x74, -0x69,0x6D,0x6F,0x72,0x65,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x0B,0x13,0x0A, -0x43,0x79,0x62,0x65,0x72,0x54,0x72,0x75,0x73,0x74,0x31,0x22,0x30,0x20,0x06,0x03, -0x55,0x04,0x03,0x13,0x19,0x42,0x61,0x6C,0x74,0x69,0x6D,0x6F,0x72,0x65,0x20,0x43, -0x79,0x62,0x65,0x72,0x54,0x72,0x75,0x73,0x74,0x20,0x52,0x6F,0x6F,0x74,0x30,0x1E, -0x17,0x0D,0x30,0x30,0x30,0x35,0x31,0x32,0x31,0x38,0x34,0x36,0x30,0x30,0x5A,0x17, -0x0D,0x32,0x35,0x30,0x35,0x31,0x32,0x32,0x33,0x35,0x39,0x30,0x30,0x5A,0x30,0x5A, -0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x49,0x45,0x31,0x12,0x30, -0x10,0x06,0x03,0x55,0x04,0x0A,0x13,0x09,0x42,0x61,0x6C,0x74,0x69,0x6D,0x6F,0x72, -0x65,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x0B,0x13,0x0A,0x43,0x79,0x62,0x65, -0x72,0x54,0x72,0x75,0x73,0x74,0x31,0x22,0x30,0x20,0x06,0x03,0x55,0x04,0x03,0x13, -0x19,0x42,0x61,0x6C,0x74,0x69,0x6D,0x6F,0x72,0x65,0x20,0x43,0x79,0x62,0x65,0x72, -0x54,0x72,0x75,0x73,0x74,0x20,0x52,0x6F,0x6F,0x74,0x30,0x82,0x01,0x22,0x30,0x0D, -0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01, -0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xA3,0x04,0xBB,0x22,0xAB, -0x98,0x3D,0x57,0xE8,0x26,0x72,0x9A,0xB5,0x79,0xD4,0x29,0xE2,0xE1,0xE8,0x95,0x80, -0xB1,0xB0,0xE3,0x5B,0x8E,0x2B,0x29,0x9A,0x64,0xDF,0xA1,0x5D,0xED,0xB0,0x09,0x05, -0x6D,0xDB,0x28,0x2E,0xCE,0x62,0xA2,0x62,0xFE,0xB4,0x88,0xDA,0x12,0xEB,0x38,0xEB, -0x21,0x9D,0xC0,0x41,0x2B,0x01,0x52,0x7B,0x88,0x77,0xD3,0x1C,0x8F,0xC7,0xBA,0xB9, -0x88,0xB5,0x6A,0x09,0xE7,0x73,0xE8,0x11,0x40,0xA7,0xD1,0xCC,0xCA,0x62,0x8D,0x2D, -0xE5,0x8F,0x0B,0xA6,0x50,0xD2,0xA8,0x50,0xC3,0x28,0xEA,0xF5,0xAB,0x25,0x87,0x8A, -0x9A,0x96,0x1C,0xA9,0x67,0xB8,0x3F,0x0C,0xD5,0xF7,0xF9,0x52,0x13,0x2F,0xC2,0x1B, -0xD5,0x70,0x70,0xF0,0x8F,0xC0,0x12,0xCA,0x06,0xCB,0x9A,0xE1,0xD9,0xCA,0x33,0x7A, -0x77,0xD6,0xF8,0xEC,0xB9,0xF1,0x68,0x44,0x42,0x48,0x13,0xD2,0xC0,0xC2,0xA4,0xAE, -0x5E,0x60,0xFE,0xB6,0xA6,0x05,0xFC,0xB4,0xDD,0x07,0x59,0x02,0xD4,0x59,0x18,0x98, -0x63,0xF5,0xA5,0x63,0xE0,0x90,0x0C,0x7D,0x5D,0xB2,0x06,0x7A,0xF3,0x85,0xEA,0xEB, -0xD4,0x03,0xAE,0x5E,0x84,0x3E,0x5F,0xFF,0x15,0xED,0x69,0xBC,0xF9,0x39,0x36,0x72, -0x75,0xCF,0x77,0x52,0x4D,0xF3,0xC9,0x90,0x2C,0xB9,0x3D,0xE5,0xC9,0x23,0x53,0x3F, -0x1F,0x24,0x98,0x21,0x5C,0x07,0x99,0x29,0xBD,0xC6,0x3A,0xEC,0xE7,0x6E,0x86,0x3A, -0x6B,0x97,0x74,0x63,0x33,0xBD,0x68,0x18,0x31,0xF0,0x78,0x8D,0x76,0xBF,0xFC,0x9E, -0x8E,0x5D,0x2A,0x86,0xA7,0x4D,0x90,0xDC,0x27,0x1A,0x39,0x02,0x03,0x01,0x00,0x01, -0xA3,0x45,0x30,0x43,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xE5, -0x9D,0x59,0x30,0x82,0x47,0x58,0xCC,0xAC,0xFA,0x08,0x54,0x36,0x86,0x7B,0x3A,0xB5, -0x04,0x4D,0xF0,0x30,0x12,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x08,0x30, -0x06,0x01,0x01,0xFF,0x02,0x01,0x03,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01, -0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7, -0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x85,0x0C,0x5D,0x8E,0xE4, -0x6F,0x51,0x68,0x42,0x05,0xA0,0xDD,0xBB,0x4F,0x27,0x25,0x84,0x03,0xBD,0xF7,0x64, -0xFD,0x2D,0xD7,0x30,0xE3,0xA4,0x10,0x17,0xEB,0xDA,0x29,0x29,0xB6,0x79,0x3F,0x76, -0xF6,0x19,0x13,0x23,0xB8,0x10,0x0A,0xF9,0x58,0xA4,0xD4,0x61,0x70,0xBD,0x04,0x61, -0x6A,0x12,0x8A,0x17,0xD5,0x0A,0xBD,0xC5,0xBC,0x30,0x7C,0xD6,0xE9,0x0C,0x25,0x8D, -0x86,0x40,0x4F,0xEC,0xCC,0xA3,0x7E,0x38,0xC6,0x37,0x11,0x4F,0xED,0xDD,0x68,0x31, -0x8E,0x4C,0xD2,0xB3,0x01,0x74,0xEE,0xBE,0x75,0x5E,0x07,0x48,0x1A,0x7F,0x70,0xFF, -0x16,0x5C,0x84,0xC0,0x79,0x85,0xB8,0x05,0xFD,0x7F,0xBE,0x65,0x11,0xA3,0x0F,0xC0, -0x02,0xB4,0xF8,0x52,0x37,0x39,0x04,0xD5,0xA9,0x31,0x7A,0x18,0xBF,0xA0,0x2A,0xF4, -0x12,0x99,0xF7,0xA3,0x45,0x82,0xE3,0x3C,0x5E,0xF5,0x9D,0x9E,0xB5,0xC8,0x9E,0x7C, -0x2E,0xC8,0xA4,0x9E,0x4E,0x08,0x14,0x4B,0x6D,0xFD,0x70,0x6D,0x6B,0x1A,0x63,0xBD, -0x64,0xE6,0x1F,0xB7,0xCE,0xF0,0xF2,0x9F,0x2E,0xBB,0x1B,0xB7,0xF2,0x50,0x88,0x73, -0x92,0xC2,0xE2,0xE3,0x16,0x8D,0x9A,0x32,0x02,0xAB,0x8E,0x18,0xDD,0xE9,0x10,0x11, -0xEE,0x7E,0x35,0xAB,0x90,0xAF,0x3E,0x30,0x94,0x7A,0xD0,0x33,0x3D,0xA7,0x65,0x0F, -0xF5,0xFC,0x8E,0x9E,0x62,0xCF,0x47,0x44,0x2C,0x01,0x5D,0xBB,0x1D,0xB5,0x32,0xD2, -0x47,0xD2,0x38,0x2E,0xD0,0xFE,0x81,0xDC,0x32,0x6A,0x1E,0xB5,0xEE,0x3C,0xD5,0xFC, -0xE7,0x81,0x1D,0x19,0xC3,0x24,0x42,0xEA,0x63,0x39,0xA9, -}; - - -/* subject:/C=GB/ST=Greater Manchester/L=Salford/O=Comodo CA Limited/CN=AAA Certificate Services */ -/* issuer :/C=GB/ST=Greater Manchester/L=Salford/O=Comodo CA Limited/CN=AAA Certificate Services */ - - -const unsigned char Comodo_AAA_Services_root_certificate[1078]={ -0x30,0x82,0x04,0x32,0x30,0x82,0x03,0x1A,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x7B,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x47,0x42,0x31,0x1B, -0x30,0x19,0x06,0x03,0x55,0x04,0x08,0x0C,0x12,0x47,0x72,0x65,0x61,0x74,0x65,0x72, -0x20,0x4D,0x61,0x6E,0x63,0x68,0x65,0x73,0x74,0x65,0x72,0x31,0x10,0x30,0x0E,0x06, -0x03,0x55,0x04,0x07,0x0C,0x07,0x53,0x61,0x6C,0x66,0x6F,0x72,0x64,0x31,0x1A,0x30, -0x18,0x06,0x03,0x55,0x04,0x0A,0x0C,0x11,0x43,0x6F,0x6D,0x6F,0x64,0x6F,0x20,0x43, -0x41,0x20,0x4C,0x69,0x6D,0x69,0x74,0x65,0x64,0x31,0x21,0x30,0x1F,0x06,0x03,0x55, -0x04,0x03,0x0C,0x18,0x41,0x41,0x41,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63, -0x61,0x74,0x65,0x20,0x53,0x65,0x72,0x76,0x69,0x63,0x65,0x73,0x30,0x1E,0x17,0x0D, -0x30,0x34,0x30,0x31,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x32, -0x38,0x31,0x32,0x33,0x31,0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x7B,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x47,0x42,0x31,0x1B,0x30,0x19,0x06, -0x03,0x55,0x04,0x08,0x0C,0x12,0x47,0x72,0x65,0x61,0x74,0x65,0x72,0x20,0x4D,0x61, -0x6E,0x63,0x68,0x65,0x73,0x74,0x65,0x72,0x31,0x10,0x30,0x0E,0x06,0x03,0x55,0x04, -0x07,0x0C,0x07,0x53,0x61,0x6C,0x66,0x6F,0x72,0x64,0x31,0x1A,0x30,0x18,0x06,0x03, -0x55,0x04,0x0A,0x0C,0x11,0x43,0x6F,0x6D,0x6F,0x64,0x6F,0x20,0x43,0x41,0x20,0x4C, -0x69,0x6D,0x69,0x74,0x65,0x64,0x31,0x21,0x30,0x1F,0x06,0x03,0x55,0x04,0x03,0x0C, -0x18,0x41,0x41,0x41,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65, -0x20,0x53,0x65,0x72,0x76,0x69,0x63,0x65,0x73,0x30,0x82,0x01,0x22,0x30,0x0D,0x06, -0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F, -0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xBE,0x40,0x9D,0xF4,0x6E,0xE1, -0xEA,0x76,0x87,0x1C,0x4D,0x45,0x44,0x8E,0xBE,0x46,0xC8,0x83,0x06,0x9D,0xC1,0x2A, -0xFE,0x18,0x1F,0x8E,0xE4,0x02,0xFA,0xF3,0xAB,0x5D,0x50,0x8A,0x16,0x31,0x0B,0x9A, -0x06,0xD0,0xC5,0x70,0x22,0xCD,0x49,0x2D,0x54,0x63,0xCC,0xB6,0x6E,0x68,0x46,0x0B, -0x53,0xEA,0xCB,0x4C,0x24,0xC0,0xBC,0x72,0x4E,0xEA,0xF1,0x15,0xAE,0xF4,0x54,0x9A, -0x12,0x0A,0xC3,0x7A,0xB2,0x33,0x60,0xE2,0xDA,0x89,0x55,0xF3,0x22,0x58,0xF3,0xDE, -0xDC,0xCF,0xEF,0x83,0x86,0xA2,0x8C,0x94,0x4F,0x9F,0x68,0xF2,0x98,0x90,0x46,0x84, -0x27,0xC7,0x76,0xBF,0xE3,0xCC,0x35,0x2C,0x8B,0x5E,0x07,0x64,0x65,0x82,0xC0,0x48, -0xB0,0xA8,0x91,0xF9,0x61,0x9F,0x76,0x20,0x50,0xA8,0x91,0xC7,0x66,0xB5,0xEB,0x78, -0x62,0x03,0x56,0xF0,0x8A,0x1A,0x13,0xEA,0x31,0xA3,0x1E,0xA0,0x99,0xFD,0x38,0xF6, -0xF6,0x27,0x32,0x58,0x6F,0x07,0xF5,0x6B,0xB8,0xFB,0x14,0x2B,0xAF,0xB7,0xAA,0xCC, -0xD6,0x63,0x5F,0x73,0x8C,0xDA,0x05,0x99,0xA8,0x38,0xA8,0xCB,0x17,0x78,0x36,0x51, -0xAC,0xE9,0x9E,0xF4,0x78,0x3A,0x8D,0xCF,0x0F,0xD9,0x42,0xE2,0x98,0x0C,0xAB,0x2F, -0x9F,0x0E,0x01,0xDE,0xEF,0x9F,0x99,0x49,0xF1,0x2D,0xDF,0xAC,0x74,0x4D,0x1B,0x98, -0xB5,0x47,0xC5,0xE5,0x29,0xD1,0xF9,0x90,0x18,0xC7,0x62,0x9C,0xBE,0x83,0xC7,0x26, -0x7B,0x3E,0x8A,0x25,0xC7,0xC0,0xDD,0x9D,0xE6,0x35,0x68,0x10,0x20,0x9D,0x8F,0xD8, -0xDE,0xD2,0xC3,0x84,0x9C,0x0D,0x5E,0xE8,0x2F,0xC9,0x02,0x03,0x01,0x00,0x01,0xA3, -0x81,0xC0,0x30,0x81,0xBD,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14, -0xA0,0x11,0x0A,0x23,0x3E,0x96,0xF1,0x07,0xEC,0xE2,0xAF,0x29,0xEF,0x82,0xA5,0x7F, -0xD0,0x30,0xA4,0xB4,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04, -0x03,0x02,0x01,0x06,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05, -0x30,0x03,0x01,0x01,0xFF,0x30,0x7B,0x06,0x03,0x55,0x1D,0x1F,0x04,0x74,0x30,0x72, -0x30,0x38,0xA0,0x36,0xA0,0x34,0x86,0x32,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x63, -0x72,0x6C,0x2E,0x63,0x6F,0x6D,0x6F,0x64,0x6F,0x63,0x61,0x2E,0x63,0x6F,0x6D,0x2F, -0x41,0x41,0x41,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x53,0x65, -0x72,0x76,0x69,0x63,0x65,0x73,0x2E,0x63,0x72,0x6C,0x30,0x36,0xA0,0x34,0xA0,0x32, -0x86,0x30,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x63,0x72,0x6C,0x2E,0x63,0x6F,0x6D, -0x6F,0x64,0x6F,0x2E,0x6E,0x65,0x74,0x2F,0x41,0x41,0x41,0x43,0x65,0x72,0x74,0x69, -0x66,0x69,0x63,0x61,0x74,0x65,0x53,0x65,0x72,0x76,0x69,0x63,0x65,0x73,0x2E,0x63, -0x72,0x6C,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05, -0x00,0x03,0x82,0x01,0x01,0x00,0x08,0x56,0xFC,0x02,0xF0,0x9B,0xE8,0xFF,0xA4,0xFA, -0xD6,0x7B,0xC6,0x44,0x80,0xCE,0x4F,0xC4,0xC5,0xF6,0x00,0x58,0xCC,0xA6,0xB6,0xBC, -0x14,0x49,0x68,0x04,0x76,0xE8,0xE6,0xEE,0x5D,0xEC,0x02,0x0F,0x60,0xD6,0x8D,0x50, -0x18,0x4F,0x26,0x4E,0x01,0xE3,0xE6,0xB0,0xA5,0xEE,0xBF,0xBC,0x74,0x54,0x41,0xBF, -0xFD,0xFC,0x12,0xB8,0xC7,0x4F,0x5A,0xF4,0x89,0x60,0x05,0x7F,0x60,0xB7,0x05,0x4A, -0xF3,0xF6,0xF1,0xC2,0xBF,0xC4,0xB9,0x74,0x86,0xB6,0x2D,0x7D,0x6B,0xCC,0xD2,0xF3, -0x46,0xDD,0x2F,0xC6,0xE0,0x6A,0xC3,0xC3,0x34,0x03,0x2C,0x7D,0x96,0xDD,0x5A,0xC2, -0x0E,0xA7,0x0A,0x99,0xC1,0x05,0x8B,0xAB,0x0C,0x2F,0xF3,0x5C,0x3A,0xCF,0x6C,0x37, -0x55,0x09,0x87,0xDE,0x53,0x40,0x6C,0x58,0xEF,0xFC,0xB6,0xAB,0x65,0x6E,0x04,0xF6, -0x1B,0xDC,0x3C,0xE0,0x5A,0x15,0xC6,0x9E,0xD9,0xF1,0x59,0x48,0x30,0x21,0x65,0x03, -0x6C,0xEC,0xE9,0x21,0x73,0xEC,0x9B,0x03,0xA1,0xE0,0x37,0xAD,0xA0,0x15,0x18,0x8F, -0xFA,0xBA,0x02,0xCE,0xA7,0x2C,0xA9,0x10,0x13,0x2C,0xD4,0xE5,0x08,0x26,0xAB,0x22, -0x97,0x60,0xF8,0x90,0x5E,0x74,0xD4,0xA2,0x9A,0x53,0xBD,0xF2,0xA9,0x68,0xE0,0xA2, -0x6E,0xC2,0xD7,0x6C,0xB1,0xA3,0x0F,0x9E,0xBF,0xEB,0x68,0xE7,0x56,0xF2,0xAE,0xF2, -0xE3,0x2B,0x38,0x3A,0x09,0x81,0xB5,0x6B,0x85,0xD7,0xBE,0x2D,0xED,0x3F,0x1A,0xB7, -0xB2,0x63,0xE2,0xF5,0x62,0x2C,0x82,0xD4,0x6A,0x00,0x41,0x50,0xF1,0x39,0x83,0x9F, -0x95,0xE9,0x36,0x96,0x98,0x6E, -}; - - -/* subject:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO Certification Authority */ -/* issuer :/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO Certification Authority */ - - -const unsigned char COMODO_Certification_Authority_certificate[1057]={ -0x30,0x82,0x04,0x1D,0x30,0x82,0x03,0x05,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x4E, -0x81,0x2D,0x8A,0x82,0x65,0xE0,0x0B,0x02,0xEE,0x3E,0x35,0x02,0x46,0xE5,0x3D,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x81, -0x81,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x47,0x42,0x31,0x1B, -0x30,0x19,0x06,0x03,0x55,0x04,0x08,0x13,0x12,0x47,0x72,0x65,0x61,0x74,0x65,0x72, -0x20,0x4D,0x61,0x6E,0x63,0x68,0x65,0x73,0x74,0x65,0x72,0x31,0x10,0x30,0x0E,0x06, -0x03,0x55,0x04,0x07,0x13,0x07,0x53,0x61,0x6C,0x66,0x6F,0x72,0x64,0x31,0x1A,0x30, -0x18,0x06,0x03,0x55,0x04,0x0A,0x13,0x11,0x43,0x4F,0x4D,0x4F,0x44,0x4F,0x20,0x43, -0x41,0x20,0x4C,0x69,0x6D,0x69,0x74,0x65,0x64,0x31,0x27,0x30,0x25,0x06,0x03,0x55, -0x04,0x03,0x13,0x1E,0x43,0x4F,0x4D,0x4F,0x44,0x4F,0x20,0x43,0x65,0x72,0x74,0x69, -0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69, -0x74,0x79,0x30,0x1E,0x17,0x0D,0x30,0x36,0x31,0x32,0x30,0x31,0x30,0x30,0x30,0x30, -0x30,0x30,0x5A,0x17,0x0D,0x32,0x39,0x31,0x32,0x33,0x31,0x32,0x33,0x35,0x39,0x35, -0x39,0x5A,0x30,0x81,0x81,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02, -0x47,0x42,0x31,0x1B,0x30,0x19,0x06,0x03,0x55,0x04,0x08,0x13,0x12,0x47,0x72,0x65, -0x61,0x74,0x65,0x72,0x20,0x4D,0x61,0x6E,0x63,0x68,0x65,0x73,0x74,0x65,0x72,0x31, -0x10,0x30,0x0E,0x06,0x03,0x55,0x04,0x07,0x13,0x07,0x53,0x61,0x6C,0x66,0x6F,0x72, -0x64,0x31,0x1A,0x30,0x18,0x06,0x03,0x55,0x04,0x0A,0x13,0x11,0x43,0x4F,0x4D,0x4F, -0x44,0x4F,0x20,0x43,0x41,0x20,0x4C,0x69,0x6D,0x69,0x74,0x65,0x64,0x31,0x27,0x30, -0x25,0x06,0x03,0x55,0x04,0x03,0x13,0x1E,0x43,0x4F,0x4D,0x4F,0x44,0x4F,0x20,0x43, -0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74, -0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82, -0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xD0,0x40,0x8B,0x8B,0x72,0xE3,0x91,0x1B,0xF7, -0x51,0xC1,0x1B,0x54,0x04,0x98,0xD3,0xA9,0xBF,0xC1,0xE6,0x8A,0x5D,0x3B,0x87,0xFB, -0xBB,0x88,0xCE,0x0D,0xE3,0x2F,0x3F,0x06,0x96,0xF0,0xA2,0x29,0x50,0x99,0xAE,0xDB, -0x3B,0xA1,0x57,0xB0,0x74,0x51,0x71,0xCD,0xED,0x42,0x91,0x4D,0x41,0xFE,0xA9,0xC8, -0xD8,0x6A,0x86,0x77,0x44,0xBB,0x59,0x66,0x97,0x50,0x5E,0xB4,0xD4,0x2C,0x70,0x44, -0xCF,0xDA,0x37,0x95,0x42,0x69,0x3C,0x30,0xC4,0x71,0xB3,0x52,0xF0,0x21,0x4D,0xA1, -0xD8,0xBA,0x39,0x7C,0x1C,0x9E,0xA3,0x24,0x9D,0xF2,0x83,0x16,0x98,0xAA,0x16,0x7C, -0x43,0x9B,0x15,0x5B,0xB7,0xAE,0x34,0x91,0xFE,0xD4,0x62,0x26,0x18,0x46,0x9A,0x3F, -0xEB,0xC1,0xF9,0xF1,0x90,0x57,0xEB,0xAC,0x7A,0x0D,0x8B,0xDB,0x72,0x30,0x6A,0x66, -0xD5,0xE0,0x46,0xA3,0x70,0xDC,0x68,0xD9,0xFF,0x04,0x48,0x89,0x77,0xDE,0xB5,0xE9, -0xFB,0x67,0x6D,0x41,0xE9,0xBC,0x39,0xBD,0x32,0xD9,0x62,0x02,0xF1,0xB1,0xA8,0x3D, -0x6E,0x37,0x9C,0xE2,0x2F,0xE2,0xD3,0xA2,0x26,0x8B,0xC6,0xB8,0x55,0x43,0x88,0xE1, -0x23,0x3E,0xA5,0xD2,0x24,0x39,0x6A,0x47,0xAB,0x00,0xD4,0xA1,0xB3,0xA9,0x25,0xFE, -0x0D,0x3F,0xA7,0x1D,0xBA,0xD3,0x51,0xC1,0x0B,0xA4,0xDA,0xAC,0x38,0xEF,0x55,0x50, -0x24,0x05,0x65,0x46,0x93,0x34,0x4F,0x2D,0x8D,0xAD,0xC6,0xD4,0x21,0x19,0xD2,0x8E, -0xCA,0x05,0x61,0x71,0x07,0x73,0x47,0xE5,0x8A,0x19,0x12,0xBD,0x04,0x4D,0xCE,0x4E, -0x9C,0xA5,0x48,0xAC,0xBB,0x26,0xF7,0x02,0x03,0x01,0x00,0x01,0xA3,0x81,0x8E,0x30, -0x81,0x8B,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x0B,0x58,0xE5, -0x8B,0xC6,0x4C,0x15,0x37,0xA4,0x40,0xA9,0x30,0xA9,0x21,0xBE,0x47,0x36,0x5A,0x56, -0xFF,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01, -0x06,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01, -0x01,0xFF,0x30,0x49,0x06,0x03,0x55,0x1D,0x1F,0x04,0x42,0x30,0x40,0x30,0x3E,0xA0, -0x3C,0xA0,0x3A,0x86,0x38,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x63,0x72,0x6C,0x2E, -0x63,0x6F,0x6D,0x6F,0x64,0x6F,0x63,0x61,0x2E,0x63,0x6F,0x6D,0x2F,0x43,0x4F,0x4D, -0x4F,0x44,0x4F,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E, -0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x2E,0x63,0x72,0x6C,0x30,0x0D,0x06, -0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01, -0x00,0x3E,0x98,0x9E,0x9B,0xF6,0x1B,0xE9,0xD7,0x39,0xB7,0x78,0xAE,0x1D,0x72,0x18, -0x49,0xD3,0x87,0xE4,0x43,0x82,0xEB,0x3F,0xC9,0xAA,0xF5,0xA8,0xB5,0xEF,0x55,0x7C, -0x21,0x52,0x65,0xF9,0xD5,0x0D,0xE1,0x6C,0xF4,0x3E,0x8C,0x93,0x73,0x91,0x2E,0x02, -0xC4,0x4E,0x07,0x71,0x6F,0xC0,0x8F,0x38,0x61,0x08,0xA8,0x1E,0x81,0x0A,0xC0,0x2F, -0x20,0x2F,0x41,0x8B,0x91,0xDC,0x48,0x45,0xBC,0xF1,0xC6,0xDE,0xBA,0x76,0x6B,0x33, -0xC8,0x00,0x2D,0x31,0x46,0x4C,0xED,0xE7,0x9D,0xCF,0x88,0x94,0xFF,0x33,0xC0,0x56, -0xE8,0x24,0x86,0x26,0xB8,0xD8,0x38,0x38,0xDF,0x2A,0x6B,0xDD,0x12,0xCC,0xC7,0x3F, -0x47,0x17,0x4C,0xA2,0xC2,0x06,0x96,0x09,0xD6,0xDB,0xFE,0x3F,0x3C,0x46,0x41,0xDF, -0x58,0xE2,0x56,0x0F,0x3C,0x3B,0xC1,0x1C,0x93,0x35,0xD9,0x38,0x52,0xAC,0xEE,0xC8, -0xEC,0x2E,0x30,0x4E,0x94,0x35,0xB4,0x24,0x1F,0x4B,0x78,0x69,0xDA,0xF2,0x02,0x38, -0xCC,0x95,0x52,0x93,0xF0,0x70,0x25,0x59,0x9C,0x20,0x67,0xC4,0xEE,0xF9,0x8B,0x57, -0x61,0xF4,0x92,0x76,0x7D,0x3F,0x84,0x8D,0x55,0xB7,0xE8,0xE5,0xAC,0xD5,0xF1,0xF5, -0x19,0x56,0xA6,0x5A,0xFB,0x90,0x1C,0xAF,0x93,0xEB,0xE5,0x1C,0xD4,0x67,0x97,0x5D, -0x04,0x0E,0xBE,0x0B,0x83,0xA6,0x17,0x83,0xB9,0x30,0x12,0xA0,0xC5,0x33,0x15,0x05, -0xB9,0x0D,0xFB,0xC7,0x05,0x76,0xE3,0xD8,0x4A,0x8D,0xFC,0x34,0x17,0xA3,0xC6,0x21, -0x28,0xBE,0x30,0x45,0x31,0x1E,0xC7,0x78,0xBE,0x58,0x61,0x38,0xAC,0x3B,0xE2,0x01, -0x65, -}; - - -/* subject:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO ECC Certification Authority */ -/* issuer :/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO ECC Certification Authority */ - - -const unsigned char COMODO_ECC_Certification_Authority_certificate[653]={ -0x30,0x82,0x02,0x89,0x30,0x82,0x02,0x0F,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x1F, -0x47,0xAF,0xAA,0x62,0x00,0x70,0x50,0x54,0x4C,0x01,0x9E,0x9B,0x63,0x99,0x2A,0x30, -0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,0x30,0x81,0x85,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x47,0x42,0x31,0x1B,0x30,0x19,0x06, -0x03,0x55,0x04,0x08,0x13,0x12,0x47,0x72,0x65,0x61,0x74,0x65,0x72,0x20,0x4D,0x61, -0x6E,0x63,0x68,0x65,0x73,0x74,0x65,0x72,0x31,0x10,0x30,0x0E,0x06,0x03,0x55,0x04, -0x07,0x13,0x07,0x53,0x61,0x6C,0x66,0x6F,0x72,0x64,0x31,0x1A,0x30,0x18,0x06,0x03, -0x55,0x04,0x0A,0x13,0x11,0x43,0x4F,0x4D,0x4F,0x44,0x4F,0x20,0x43,0x41,0x20,0x4C, -0x69,0x6D,0x69,0x74,0x65,0x64,0x31,0x2B,0x30,0x29,0x06,0x03,0x55,0x04,0x03,0x13, -0x22,0x43,0x4F,0x4D,0x4F,0x44,0x4F,0x20,0x45,0x43,0x43,0x20,0x43,0x65,0x72,0x74, -0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72, -0x69,0x74,0x79,0x30,0x1E,0x17,0x0D,0x30,0x38,0x30,0x33,0x30,0x36,0x30,0x30,0x30, -0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x38,0x30,0x31,0x31,0x38,0x32,0x33,0x35,0x39, -0x35,0x39,0x5A,0x30,0x81,0x85,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13, -0x02,0x47,0x42,0x31,0x1B,0x30,0x19,0x06,0x03,0x55,0x04,0x08,0x13,0x12,0x47,0x72, -0x65,0x61,0x74,0x65,0x72,0x20,0x4D,0x61,0x6E,0x63,0x68,0x65,0x73,0x74,0x65,0x72, -0x31,0x10,0x30,0x0E,0x06,0x03,0x55,0x04,0x07,0x13,0x07,0x53,0x61,0x6C,0x66,0x6F, -0x72,0x64,0x31,0x1A,0x30,0x18,0x06,0x03,0x55,0x04,0x0A,0x13,0x11,0x43,0x4F,0x4D, -0x4F,0x44,0x4F,0x20,0x43,0x41,0x20,0x4C,0x69,0x6D,0x69,0x74,0x65,0x64,0x31,0x2B, -0x30,0x29,0x06,0x03,0x55,0x04,0x03,0x13,0x22,0x43,0x4F,0x4D,0x4F,0x44,0x4F,0x20, -0x45,0x43,0x43,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F, -0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x76,0x30,0x10,0x06, -0x07,0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,0x06,0x05,0x2B,0x81,0x04,0x00,0x22,0x03, -0x62,0x00,0x04,0x03,0x47,0x7B,0x2F,0x75,0xC9,0x82,0x15,0x85,0xFB,0x75,0xE4,0x91, -0x16,0xD4,0xAB,0x62,0x99,0xF5,0x3E,0x52,0x0B,0x06,0xCE,0x41,0x00,0x7F,0x97,0xE1, -0x0A,0x24,0x3C,0x1D,0x01,0x04,0xEE,0x3D,0xD2,0x8D,0x09,0x97,0x0C,0xE0,0x75,0xE4, -0xFA,0xFB,0x77,0x8A,0x2A,0xF5,0x03,0x60,0x4B,0x36,0x8B,0x16,0x23,0x16,0xAD,0x09, -0x71,0xF4,0x4A,0xF4,0x28,0x50,0xB4,0xFE,0x88,0x1C,0x6E,0x3F,0x6C,0x2F,0x2F,0x09, -0x59,0x5B,0xA5,0x5B,0x0B,0x33,0x99,0xE2,0xC3,0x3D,0x89,0xF9,0x6A,0x2C,0xEF,0xB2, -0xD3,0x06,0xE9,0xA3,0x42,0x30,0x40,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16, -0x04,0x14,0x75,0x71,0xA7,0x19,0x48,0x19,0xBC,0x9D,0x9D,0xEA,0x41,0x47,0xDF,0x94, -0xC4,0x48,0x77,0x99,0xD3,0x79,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF, -0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF, -0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D, -0x04,0x03,0x03,0x03,0x68,0x00,0x30,0x65,0x02,0x31,0x00,0xEF,0x03,0x5B,0x7A,0xAC, -0xB7,0x78,0x0A,0x72,0xB7,0x88,0xDF,0xFF,0xB5,0x46,0x14,0x09,0x0A,0xFA,0xA0,0xE6, -0x7D,0x08,0xC6,0x1A,0x87,0xBD,0x18,0xA8,0x73,0xBD,0x26,0xCA,0x60,0x0C,0x9D,0xCE, -0x99,0x9F,0xCF,0x5C,0x0F,0x30,0xE1,0xBE,0x14,0x31,0xEA,0x02,0x30,0x14,0xF4,0x93, -0x3C,0x49,0xA7,0x33,0x7A,0x90,0x46,0x47,0xB3,0x63,0x7D,0x13,0x9B,0x4E,0xB7,0x6F, -0x18,0x37,0x80,0x53,0xFE,0xDD,0x20,0xE0,0x35,0x9A,0x36,0xD1,0xC7,0x01,0xB9,0xE6, -0xDC,0xDD,0xF3,0xFF,0x1D,0x2C,0x3A,0x16,0x57,0xD9,0x92,0x39,0xD6, -}; - - -/* subject:/C=GB/ST=Greater Manchester/L=Salford/O=Comodo CA Limited/CN=Secure Certificate Services */ -/* issuer :/C=GB/ST=Greater Manchester/L=Salford/O=Comodo CA Limited/CN=Secure Certificate Services */ - - -const unsigned char Comodo_Secure_Services_root_certificate[1091]={ -0x30,0x82,0x04,0x3F,0x30,0x82,0x03,0x27,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x7E,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x47,0x42,0x31,0x1B, -0x30,0x19,0x06,0x03,0x55,0x04,0x08,0x0C,0x12,0x47,0x72,0x65,0x61,0x74,0x65,0x72, -0x20,0x4D,0x61,0x6E,0x63,0x68,0x65,0x73,0x74,0x65,0x72,0x31,0x10,0x30,0x0E,0x06, -0x03,0x55,0x04,0x07,0x0C,0x07,0x53,0x61,0x6C,0x66,0x6F,0x72,0x64,0x31,0x1A,0x30, -0x18,0x06,0x03,0x55,0x04,0x0A,0x0C,0x11,0x43,0x6F,0x6D,0x6F,0x64,0x6F,0x20,0x43, -0x41,0x20,0x4C,0x69,0x6D,0x69,0x74,0x65,0x64,0x31,0x24,0x30,0x22,0x06,0x03,0x55, -0x04,0x03,0x0C,0x1B,0x53,0x65,0x63,0x75,0x72,0x65,0x20,0x43,0x65,0x72,0x74,0x69, -0x66,0x69,0x63,0x61,0x74,0x65,0x20,0x53,0x65,0x72,0x76,0x69,0x63,0x65,0x73,0x30, -0x1E,0x17,0x0D,0x30,0x34,0x30,0x31,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5A, -0x17,0x0D,0x32,0x38,0x31,0x32,0x33,0x31,0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30, -0x7E,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x47,0x42,0x31,0x1B, -0x30,0x19,0x06,0x03,0x55,0x04,0x08,0x0C,0x12,0x47,0x72,0x65,0x61,0x74,0x65,0x72, -0x20,0x4D,0x61,0x6E,0x63,0x68,0x65,0x73,0x74,0x65,0x72,0x31,0x10,0x30,0x0E,0x06, -0x03,0x55,0x04,0x07,0x0C,0x07,0x53,0x61,0x6C,0x66,0x6F,0x72,0x64,0x31,0x1A,0x30, -0x18,0x06,0x03,0x55,0x04,0x0A,0x0C,0x11,0x43,0x6F,0x6D,0x6F,0x64,0x6F,0x20,0x43, -0x41,0x20,0x4C,0x69,0x6D,0x69,0x74,0x65,0x64,0x31,0x24,0x30,0x22,0x06,0x03,0x55, -0x04,0x03,0x0C,0x1B,0x53,0x65,0x63,0x75,0x72,0x65,0x20,0x43,0x65,0x72,0x74,0x69, -0x66,0x69,0x63,0x61,0x74,0x65,0x20,0x53,0x65,0x72,0x76,0x69,0x63,0x65,0x73,0x30, -0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01, -0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00, -0xC0,0x71,0x33,0x82,0x8A,0xD0,0x70,0xEB,0x73,0x87,0x82,0x40,0xD5,0x1D,0xE4,0xCB, -0xC9,0x0E,0x42,0x90,0xF9,0xDE,0x34,0xB9,0xA1,0xBA,0x11,0xF4,0x25,0x85,0xF3,0xCC, -0x72,0x6D,0xF2,0x7B,0x97,0x6B,0xB3,0x07,0xF1,0x77,0x24,0x91,0x5F,0x25,0x8F,0xF6, -0x74,0x3D,0xE4,0x80,0xC2,0xF8,0x3C,0x0D,0xF3,0xBF,0x40,0xEA,0xF7,0xC8,0x52,0xD1, -0x72,0x6F,0xEF,0xC8,0xAB,0x41,0xB8,0x6E,0x2E,0x17,0x2A,0x95,0x69,0x0C,0xCD,0xD2, -0x1E,0x94,0x7B,0x2D,0x94,0x1D,0xAA,0x75,0xD7,0xB3,0x98,0xCB,0xAC,0xBC,0x64,0x53, -0x40,0xBC,0x8F,0xAC,0xAC,0x36,0xCB,0x5C,0xAD,0xBB,0xDD,0xE0,0x94,0x17,0xEC,0xD1, -0x5C,0xD0,0xBF,0xEF,0xA5,0x95,0xC9,0x90,0xC5,0xB0,0xAC,0xFB,0x1B,0x43,0xDF,0x7A, -0x08,0x5D,0xB7,0xB8,0xF2,0x40,0x1B,0x2B,0x27,0x9E,0x50,0xCE,0x5E,0x65,0x82,0x88, -0x8C,0x5E,0xD3,0x4E,0x0C,0x7A,0xEA,0x08,0x91,0xB6,0x36,0xAA,0x2B,0x42,0xFB,0xEA, -0xC2,0xA3,0x39,0xE5,0xDB,0x26,0x38,0xAD,0x8B,0x0A,0xEE,0x19,0x63,0xC7,0x1C,0x24, -0xDF,0x03,0x78,0xDA,0xE6,0xEA,0xC1,0x47,0x1A,0x0B,0x0B,0x46,0x09,0xDD,0x02,0xFC, -0xDE,0xCB,0x87,0x5F,0xD7,0x30,0x63,0x68,0xA1,0xAE,0xDC,0x32,0xA1,0xBA,0xBE,0xFE, -0x44,0xAB,0x68,0xB6,0xA5,0x17,0x15,0xFD,0xBD,0xD5,0xA7,0xA7,0x9A,0xE4,0x44,0x33, -0xE9,0x88,0x8E,0xFC,0xED,0x51,0xEB,0x93,0x71,0x4E,0xAD,0x01,0xE7,0x44,0x8E,0xAB, -0x2D,0xCB,0xA8,0xFE,0x01,0x49,0x48,0xF0,0xC0,0xDD,0xC7,0x68,0xD8,0x92,0xFE,0x3D, -0x02,0x03,0x01,0x00,0x01,0xA3,0x81,0xC7,0x30,0x81,0xC4,0x30,0x1D,0x06,0x03,0x55, -0x1D,0x0E,0x04,0x16,0x04,0x14,0x3C,0xD8,0x93,0x88,0xC2,0xC0,0x82,0x09,0xCC,0x01, -0x99,0x06,0x93,0x20,0xE9,0x9E,0x70,0x09,0x63,0x4F,0x30,0x0E,0x06,0x03,0x55,0x1D, -0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0F,0x06,0x03,0x55,0x1D, -0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x81,0x81,0x06,0x03, -0x55,0x1D,0x1F,0x04,0x7A,0x30,0x78,0x30,0x3B,0xA0,0x39,0xA0,0x37,0x86,0x35,0x68, -0x74,0x74,0x70,0x3A,0x2F,0x2F,0x63,0x72,0x6C,0x2E,0x63,0x6F,0x6D,0x6F,0x64,0x6F, -0x63,0x61,0x2E,0x63,0x6F,0x6D,0x2F,0x53,0x65,0x63,0x75,0x72,0x65,0x43,0x65,0x72, -0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x53,0x65,0x72,0x76,0x69,0x63,0x65,0x73, -0x2E,0x63,0x72,0x6C,0x30,0x39,0xA0,0x37,0xA0,0x35,0x86,0x33,0x68,0x74,0x74,0x70, -0x3A,0x2F,0x2F,0x63,0x72,0x6C,0x2E,0x63,0x6F,0x6D,0x6F,0x64,0x6F,0x2E,0x6E,0x65, -0x74,0x2F,0x53,0x65,0x63,0x75,0x72,0x65,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63, -0x61,0x74,0x65,0x53,0x65,0x72,0x76,0x69,0x63,0x65,0x73,0x2E,0x63,0x72,0x6C,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82, -0x01,0x01,0x00,0x87,0x01,0x6D,0x23,0x1D,0x7E,0x5B,0x17,0x7D,0xC1,0x61,0x32,0xCF, -0x8F,0xE7,0xF3,0x8A,0x94,0x59,0x66,0xE0,0x9E,0x28,0xA8,0x5E,0xD3,0xB7,0xF4,0x34, -0xE6,0xAA,0x39,0xB2,0x97,0x16,0xC5,0x82,0x6F,0x32,0xA4,0xE9,0x8C,0xE7,0xAF,0xFD, -0xEF,0xC2,0xE8,0xB9,0x4B,0xAA,0xA3,0xF4,0xE6,0xDA,0x8D,0x65,0x21,0xFB,0xBA,0x80, -0xEB,0x26,0x28,0x85,0x1A,0xFE,0x39,0x8C,0xDE,0x5B,0x04,0x04,0xB4,0x54,0xF9,0xA3, -0x67,0x9E,0x41,0xFA,0x09,0x52,0xCC,0x05,0x48,0xA8,0xC9,0x3F,0x21,0x04,0x1E,0xCE, -0x48,0x6B,0xFC,0x85,0xE8,0xC2,0x7B,0xAF,0x7F,0xB7,0xCC,0xF8,0x5F,0x3A,0xFD,0x35, -0xC6,0x0D,0xEF,0x97,0xDC,0x4C,0xAB,0x11,0xE1,0x6B,0xCB,0x31,0xD1,0x6C,0xFB,0x48, -0x80,0xAB,0xDC,0x9C,0x37,0xB8,0x21,0x14,0x4B,0x0D,0x71,0x3D,0xEC,0x83,0x33,0x6E, -0xD1,0x6E,0x32,0x16,0xEC,0x98,0xC7,0x16,0x8B,0x59,0xA6,0x34,0xAB,0x05,0x57,0x2D, -0x93,0xF7,0xAA,0x13,0xCB,0xD2,0x13,0xE2,0xB7,0x2E,0x3B,0xCD,0x6B,0x50,0x17,0x09, -0x68,0x3E,0xB5,0x26,0x57,0xEE,0xB6,0xE0,0xB6,0xDD,0xB9,0x29,0x80,0x79,0x7D,0x8F, -0xA3,0xF0,0xA4,0x28,0xA4,0x15,0xC4,0x85,0xF4,0x27,0xD4,0x6B,0xBF,0xE5,0x5C,0xE4, -0x65,0x02,0x76,0x54,0xB4,0xE3,0x37,0x66,0x24,0xD3,0x19,0x61,0xC8,0x52,0x10,0xE5, -0x8B,0x37,0x9A,0xB9,0xA9,0xF9,0x1D,0xBF,0xEA,0x99,0x92,0x61,0x96,0xFF,0x01,0xCD, -0xA1,0x5F,0x0D,0xBC,0x71,0xBC,0x0E,0xAC,0x0B,0x1D,0x47,0x45,0x1D,0xC1,0xEC,0x7C, -0xEC,0xFD,0x29, -}; - - -/* subject:/C=GB/ST=Greater Manchester/L=Salford/O=Comodo CA Limited/CN=Trusted Certificate Services */ -/* issuer :/C=GB/ST=Greater Manchester/L=Salford/O=Comodo CA Limited/CN=Trusted Certificate Services */ - - -const unsigned char Comodo_Trusted_Services_root_certificate[1095]={ -0x30,0x82,0x04,0x43,0x30,0x82,0x03,0x2B,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x7F,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x47,0x42,0x31,0x1B, -0x30,0x19,0x06,0x03,0x55,0x04,0x08,0x0C,0x12,0x47,0x72,0x65,0x61,0x74,0x65,0x72, -0x20,0x4D,0x61,0x6E,0x63,0x68,0x65,0x73,0x74,0x65,0x72,0x31,0x10,0x30,0x0E,0x06, -0x03,0x55,0x04,0x07,0x0C,0x07,0x53,0x61,0x6C,0x66,0x6F,0x72,0x64,0x31,0x1A,0x30, -0x18,0x06,0x03,0x55,0x04,0x0A,0x0C,0x11,0x43,0x6F,0x6D,0x6F,0x64,0x6F,0x20,0x43, -0x41,0x20,0x4C,0x69,0x6D,0x69,0x74,0x65,0x64,0x31,0x25,0x30,0x23,0x06,0x03,0x55, -0x04,0x03,0x0C,0x1C,0x54,0x72,0x75,0x73,0x74,0x65,0x64,0x20,0x43,0x65,0x72,0x74, -0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x20,0x53,0x65,0x72,0x76,0x69,0x63,0x65,0x73, -0x30,0x1E,0x17,0x0D,0x30,0x34,0x30,0x31,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30, -0x5A,0x17,0x0D,0x32,0x38,0x31,0x32,0x33,0x31,0x32,0x33,0x35,0x39,0x35,0x39,0x5A, -0x30,0x7F,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x47,0x42,0x31, -0x1B,0x30,0x19,0x06,0x03,0x55,0x04,0x08,0x0C,0x12,0x47,0x72,0x65,0x61,0x74,0x65, -0x72,0x20,0x4D,0x61,0x6E,0x63,0x68,0x65,0x73,0x74,0x65,0x72,0x31,0x10,0x30,0x0E, -0x06,0x03,0x55,0x04,0x07,0x0C,0x07,0x53,0x61,0x6C,0x66,0x6F,0x72,0x64,0x31,0x1A, -0x30,0x18,0x06,0x03,0x55,0x04,0x0A,0x0C,0x11,0x43,0x6F,0x6D,0x6F,0x64,0x6F,0x20, -0x43,0x41,0x20,0x4C,0x69,0x6D,0x69,0x74,0x65,0x64,0x31,0x25,0x30,0x23,0x06,0x03, -0x55,0x04,0x03,0x0C,0x1C,0x54,0x72,0x75,0x73,0x74,0x65,0x64,0x20,0x43,0x65,0x72, -0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x20,0x53,0x65,0x72,0x76,0x69,0x63,0x65, -0x73,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, -0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01, -0x01,0x00,0xDF,0x71,0x6F,0x36,0x58,0x53,0x5A,0xF2,0x36,0x54,0x57,0x80,0xC4,0x74, -0x08,0x20,0xED,0x18,0x7F,0x2A,0x1D,0xE6,0x35,0x9A,0x1E,0x25,0xAC,0x9C,0xE5,0x96, -0x7E,0x72,0x52,0xA0,0x15,0x42,0xDB,0x59,0xDD,0x64,0x7A,0x1A,0xD0,0xB8,0x7B,0xDD, -0x39,0x15,0xBC,0x55,0x48,0xC4,0xED,0x3A,0x00,0xEA,0x31,0x11,0xBA,0xF2,0x71,0x74, -0x1A,0x67,0xB8,0xCF,0x33,0xCC,0xA8,0x31,0xAF,0xA3,0xE3,0xD7,0x7F,0xBF,0x33,0x2D, -0x4C,0x6A,0x3C,0xEC,0x8B,0xC3,0x92,0xD2,0x53,0x77,0x24,0x74,0x9C,0x07,0x6E,0x70, -0xFC,0xBD,0x0B,0x5B,0x76,0xBA,0x5F,0xF2,0xFF,0xD7,0x37,0x4B,0x4A,0x60,0x78,0xF7, -0xF0,0xFA,0xCA,0x70,0xB4,0xEA,0x59,0xAA,0xA3,0xCE,0x48,0x2F,0xA9,0xC3,0xB2,0x0B, -0x7E,0x17,0x72,0x16,0x0C,0xA6,0x07,0x0C,0x1B,0x38,0xCF,0xC9,0x62,0xB7,0x3F,0xA0, -0x93,0xA5,0x87,0x41,0xF2,0xB7,0x70,0x40,0x77,0xD8,0xBE,0x14,0x7C,0xE3,0xA8,0xC0, -0x7A,0x8E,0xE9,0x63,0x6A,0xD1,0x0F,0x9A,0xC6,0xD2,0xF4,0x8B,0x3A,0x14,0x04,0x56, -0xD4,0xED,0xB8,0xCC,0x6E,0xF5,0xFB,0xE2,0x2C,0x58,0xBD,0x7F,0x4F,0x6B,0x2B,0xF7, -0x60,0x24,0x58,0x24,0xCE,0x26,0xEF,0x34,0x91,0x3A,0xD5,0xE3,0x81,0xD0,0xB2,0xF0, -0x04,0x02,0xD7,0x5B,0xB7,0x3E,0x92,0xAC,0x6B,0x12,0x8A,0xF9,0xE4,0x05,0xB0,0x3B, -0x91,0x49,0x5C,0xB2,0xEB,0x53,0xEA,0xF8,0x9F,0x47,0x86,0xEE,0xBF,0x95,0xC0,0xC0, -0x06,0x9F,0xD2,0x5B,0x5E,0x11,0x1B,0xF4,0xC7,0x04,0x35,0x29,0xD2,0x55,0x5C,0xE4, -0xED,0xEB,0x02,0x03,0x01,0x00,0x01,0xA3,0x81,0xC9,0x30,0x81,0xC6,0x30,0x1D,0x06, -0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xC5,0x7B,0x58,0xBD,0xED,0xDA,0x25,0x69, -0xD2,0xF7,0x59,0x16,0xA8,0xB3,0x32,0xC0,0x7B,0x27,0x5B,0xF4,0x30,0x0E,0x06,0x03, -0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x0F,0x06,0x03, -0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x81,0x83, -0x06,0x03,0x55,0x1D,0x1F,0x04,0x7C,0x30,0x7A,0x30,0x3C,0xA0,0x3A,0xA0,0x38,0x86, -0x36,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x63,0x72,0x6C,0x2E,0x63,0x6F,0x6D,0x6F, -0x64,0x6F,0x63,0x61,0x2E,0x63,0x6F,0x6D,0x2F,0x54,0x72,0x75,0x73,0x74,0x65,0x64, -0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x53,0x65,0x72,0x76,0x69, -0x63,0x65,0x73,0x2E,0x63,0x72,0x6C,0x30,0x3A,0xA0,0x38,0xA0,0x36,0x86,0x34,0x68, -0x74,0x74,0x70,0x3A,0x2F,0x2F,0x63,0x72,0x6C,0x2E,0x63,0x6F,0x6D,0x6F,0x64,0x6F, -0x2E,0x6E,0x65,0x74,0x2F,0x54,0x72,0x75,0x73,0x74,0x65,0x64,0x43,0x65,0x72,0x74, -0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x53,0x65,0x72,0x76,0x69,0x63,0x65,0x73,0x2E, -0x63,0x72,0x6C,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05, -0x05,0x00,0x03,0x82,0x01,0x01,0x00,0xC8,0x93,0x81,0x3B,0x89,0xB4,0xAF,0xB8,0x84, -0x12,0x4C,0x8D,0xD2,0xF0,0xDB,0x70,0xBA,0x57,0x86,0x15,0x34,0x10,0xB9,0x2F,0x7F, -0x1E,0xB0,0xA8,0x89,0x60,0xA1,0x8A,0xC2,0x77,0x0C,0x50,0x4A,0x9B,0x00,0x8B,0xD8, -0x8B,0xF4,0x41,0xE2,0xD0,0x83,0x8A,0x4A,0x1C,0x14,0x06,0xB0,0xA3,0x68,0x05,0x70, -0x31,0x30,0xA7,0x53,0x9B,0x0E,0xE9,0x4A,0xA0,0x58,0x69,0x67,0x0E,0xAE,0x9D,0xF6, -0xA5,0x2C,0x41,0xBF,0x3C,0x06,0x6B,0xE4,0x59,0xCC,0x6D,0x10,0xF1,0x96,0x6F,0x1F, -0xDF,0xF4,0x04,0x02,0xA4,0x9F,0x45,0x3E,0xC8,0xD8,0xFA,0x36,0x46,0x44,0x50,0x3F, -0x82,0x97,0x91,0x1F,0x28,0xDB,0x18,0x11,0x8C,0x2A,0xE4,0x65,0x83,0x57,0x12,0x12, -0x8C,0x17,0x3F,0x94,0x36,0xFE,0x5D,0xB0,0xC0,0x04,0x77,0x13,0xB8,0xF4,0x15,0xD5, -0x3F,0x38,0xCC,0x94,0x3A,0x55,0xD0,0xAC,0x98,0xF5,0xBA,0x00,0x5F,0xE0,0x86,0x19, -0x81,0x78,0x2F,0x28,0xC0,0x7E,0xD3,0xCC,0x42,0x0A,0xF5,0xAE,0x50,0xA0,0xD1,0x3E, -0xC6,0xA1,0x71,0xEC,0x3F,0xA0,0x20,0x8C,0x66,0x3A,0x89,0xB4,0x8E,0xD4,0xD8,0xB1, -0x4D,0x25,0x47,0xEE,0x2F,0x88,0xC8,0xB5,0xE1,0x05,0x45,0xC0,0xBE,0x14,0x71,0xDE, -0x7A,0xFD,0x8E,0x7B,0x7D,0x4D,0x08,0x96,0xA5,0x12,0x73,0xF0,0x2D,0xCA,0x37,0x27, -0x74,0x12,0x27,0x4C,0xCB,0xB6,0x97,0xE9,0xD9,0xAE,0x08,0x6D,0x5A,0x39,0x40,0xDD, -0x05,0x47,0x75,0x6A,0x5A,0x21,0xB3,0xA3,0x18,0xCF,0x4E,0xF7,0x2E,0x57,0xB7,0x98, -0x70,0x5E,0xC8,0xC4,0x78,0xB0,0x62, -}; - - -/* subject:/O=Cybertrust, Inc/CN=Cybertrust Global Root */ -/* issuer :/O=Cybertrust, Inc/CN=Cybertrust Global Root */ - - -const unsigned char Cybertrust_Global_Root_certificate[933]={ -0x30,0x82,0x03,0xA1,0x30,0x82,0x02,0x89,0xA0,0x03,0x02,0x01,0x02,0x02,0x0B,0x04, -0x00,0x00,0x00,0x00,0x01,0x0F,0x85,0xAA,0x2D,0x48,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x3B,0x31,0x18,0x30,0x16,0x06, -0x03,0x55,0x04,0x0A,0x13,0x0F,0x43,0x79,0x62,0x65,0x72,0x74,0x72,0x75,0x73,0x74, -0x2C,0x20,0x49,0x6E,0x63,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x03,0x13,0x16, -0x43,0x79,0x62,0x65,0x72,0x74,0x72,0x75,0x73,0x74,0x20,0x47,0x6C,0x6F,0x62,0x61, -0x6C,0x20,0x52,0x6F,0x6F,0x74,0x30,0x1E,0x17,0x0D,0x30,0x36,0x31,0x32,0x31,0x35, -0x30,0x38,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x32,0x31,0x31,0x32,0x31,0x35,0x30, -0x38,0x30,0x30,0x30,0x30,0x5A,0x30,0x3B,0x31,0x18,0x30,0x16,0x06,0x03,0x55,0x04, -0x0A,0x13,0x0F,0x43,0x79,0x62,0x65,0x72,0x74,0x72,0x75,0x73,0x74,0x2C,0x20,0x49, -0x6E,0x63,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x03,0x13,0x16,0x43,0x79,0x62, -0x65,0x72,0x74,0x72,0x75,0x73,0x74,0x20,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x20,0x52, -0x6F,0x6F,0x74,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7, -0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02, -0x82,0x01,0x01,0x00,0xF8,0xC8,0xBC,0xBD,0x14,0x50,0x66,0x13,0xFF,0xF0,0xD3,0x79, -0xEC,0x23,0xF2,0xB7,0x1A,0xC7,0x8E,0x85,0xF1,0x12,0x73,0xA6,0x19,0xAA,0x10,0xDB, -0x9C,0xA2,0x65,0x74,0x5A,0x77,0x3E,0x51,0x7D,0x56,0xF6,0xDC,0x23,0xB6,0xD4,0xED, -0x5F,0x58,0xB1,0x37,0x4D,0xD5,0x49,0x0E,0x6E,0xF5,0x6A,0x87,0xD6,0xD2,0x8C,0xD2, -0x27,0xC6,0xE2,0xFF,0x36,0x9F,0x98,0x65,0xA0,0x13,0x4E,0xC6,0x2A,0x64,0x9B,0xD5, -0x90,0x12,0xCF,0x14,0x06,0xF4,0x3B,0xE3,0xD4,0x28,0xBE,0xE8,0x0E,0xF8,0xAB,0x4E, -0x48,0x94,0x6D,0x8E,0x95,0x31,0x10,0x5C,0xED,0xA2,0x2D,0xBD,0xD5,0x3A,0x6D,0xB2, -0x1C,0xBB,0x60,0xC0,0x46,0x4B,0x01,0xF5,0x49,0xAE,0x7E,0x46,0x8A,0xD0,0x74,0x8D, -0xA1,0x0C,0x02,0xCE,0xEE,0xFC,0xE7,0x8F,0xB8,0x6B,0x66,0xF3,0x7F,0x44,0x00,0xBF, -0x66,0x25,0x14,0x2B,0xDD,0x10,0x30,0x1D,0x07,0x96,0x3F,0x4D,0xF6,0x6B,0xB8,0x8F, -0xB7,0x7B,0x0C,0xA5,0x38,0xEB,0xDE,0x47,0xDB,0xD5,0x5D,0x39,0xFC,0x88,0xA7,0xF3, -0xD7,0x2A,0x74,0xF1,0xE8,0x5A,0xA2,0x3B,0x9F,0x50,0xBA,0xA6,0x8C,0x45,0x35,0xC2, -0x50,0x65,0x95,0xDC,0x63,0x82,0xEF,0xDD,0xBF,0x77,0x4D,0x9C,0x62,0xC9,0x63,0x73, -0x16,0xD0,0x29,0x0F,0x49,0xA9,0x48,0xF0,0xB3,0xAA,0xB7,0x6C,0xC5,0xA7,0x30,0x39, -0x40,0x5D,0xAE,0xC4,0xE2,0x5D,0x26,0x53,0xF0,0xCE,0x1C,0x23,0x08,0x61,0xA8,0x94, -0x19,0xBA,0x04,0x62,0x40,0xEC,0x1F,0x38,0x70,0x77,0x12,0x06,0x71,0xA7,0x30,0x18, -0x5D,0x25,0x27,0xA5,0x02,0x03,0x01,0x00,0x01,0xA3,0x81,0xA5,0x30,0x81,0xA2,0x30, -0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30, -0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF, -0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xB6,0x08,0x7B,0x0D,0x7A, -0xCC,0xAC,0x20,0x4C,0x86,0x56,0x32,0x5E,0xCF,0xAB,0x6E,0x85,0x2D,0x70,0x57,0x30, -0x3F,0x06,0x03,0x55,0x1D,0x1F,0x04,0x38,0x30,0x36,0x30,0x34,0xA0,0x32,0xA0,0x30, -0x86,0x2E,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x77,0x77,0x77,0x32,0x2E,0x70,0x75, -0x62,0x6C,0x69,0x63,0x2D,0x74,0x72,0x75,0x73,0x74,0x2E,0x63,0x6F,0x6D,0x2F,0x63, -0x72,0x6C,0x2F,0x63,0x74,0x2F,0x63,0x74,0x72,0x6F,0x6F,0x74,0x2E,0x63,0x72,0x6C, -0x30,0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18,0x30,0x16,0x80,0x14,0xB6,0x08,0x7B, -0x0D,0x7A,0xCC,0xAC,0x20,0x4C,0x86,0x56,0x32,0x5E,0xCF,0xAB,0x6E,0x85,0x2D,0x70, -0x57,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00, -0x03,0x82,0x01,0x01,0x00,0x56,0xEF,0x0A,0x23,0xA0,0x54,0x4E,0x95,0x97,0xC9,0xF8, -0x89,0xDA,0x45,0xC1,0xD4,0xA3,0x00,0x25,0xF4,0x1F,0x13,0xAB,0xB7,0xA3,0x85,0x58, -0x69,0xC2,0x30,0xAD,0xD8,0x15,0x8A,0x2D,0xE3,0xC9,0xCD,0x81,0x5A,0xF8,0x73,0x23, -0x5A,0xA7,0x7C,0x05,0xF3,0xFD,0x22,0x3B,0x0E,0xD1,0x06,0xC4,0xDB,0x36,0x4C,0x73, -0x04,0x8E,0xE5,0xB0,0x22,0xE4,0xC5,0xF3,0x2E,0xA5,0xD9,0x23,0xE3,0xB8,0x4E,0x4A, -0x20,0xA7,0x6E,0x02,0x24,0x9F,0x22,0x60,0x67,0x7B,0x8B,0x1D,0x72,0x09,0xC5,0x31, -0x5C,0xE9,0x79,0x9F,0x80,0x47,0x3D,0xAD,0xA1,0x0B,0x07,0x14,0x3D,0x47,0xFF,0x03, -0x69,0x1A,0x0C,0x0B,0x44,0xE7,0x63,0x25,0xA7,0x7F,0xB2,0xC9,0xB8,0x76,0x84,0xED, -0x23,0xF6,0x7D,0x07,0xAB,0x45,0x7E,0xD3,0xDF,0xB3,0xBF,0xE9,0x8A,0xB6,0xCD,0xA8, -0xA2,0x67,0x2B,0x52,0xD5,0xB7,0x65,0xF0,0x39,0x4C,0x63,0xA0,0x91,0x79,0x93,0x52, -0x0F,0x54,0xDD,0x83,0xBB,0x9F,0xD1,0x8F,0xA7,0x53,0x73,0xC3,0xCB,0xFF,0x30,0xEC, -0x7C,0x04,0xB8,0xD8,0x44,0x1F,0x93,0x5F,0x71,0x09,0x22,0xB7,0x6E,0x3E,0xEA,0x1C, -0x03,0x4E,0x9D,0x1A,0x20,0x61,0xFB,0x81,0x37,0xEC,0x5E,0xFC,0x0A,0x45,0xAB,0xD7, -0xE7,0x17,0x55,0xD0,0xA0,0xEA,0x60,0x9B,0xA6,0xF6,0xE3,0x8C,0x5B,0x29,0xC2,0x06, -0x60,0x14,0x9D,0x2D,0x97,0x4C,0xA9,0x93,0x15,0x9D,0x61,0xC4,0x01,0x5F,0x48,0xD6, -0x58,0xBD,0x56,0x31,0x12,0x4E,0x11,0xC8,0x21,0xE0,0xB3,0x11,0x91,0x65,0xDB,0xB4, -0xA6,0x88,0x38,0xCE,0x55, -}; - - -/* subject:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Assured ID Root CA */ -/* issuer :/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Assured ID Root CA */ - - -const unsigned char DigiCert_Assured_ID_Root_CA_certificate[955]={ -0x30,0x82,0x03,0xB7,0x30,0x82,0x02,0x9F,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x0C, -0xE7,0xE0,0xE5,0x17,0xD8,0x46,0xFE,0x8F,0xE5,0x60,0xFC,0x1B,0xF0,0x30,0x39,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x65, -0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x15,0x30, -0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x44,0x69,0x67,0x69,0x43,0x65,0x72,0x74, -0x20,0x49,0x6E,0x63,0x31,0x19,0x30,0x17,0x06,0x03,0x55,0x04,0x0B,0x13,0x10,0x77, -0x77,0x77,0x2E,0x64,0x69,0x67,0x69,0x63,0x65,0x72,0x74,0x2E,0x63,0x6F,0x6D,0x31, -0x24,0x30,0x22,0x06,0x03,0x55,0x04,0x03,0x13,0x1B,0x44,0x69,0x67,0x69,0x43,0x65, -0x72,0x74,0x20,0x41,0x73,0x73,0x75,0x72,0x65,0x64,0x20,0x49,0x44,0x20,0x52,0x6F, -0x6F,0x74,0x20,0x43,0x41,0x30,0x1E,0x17,0x0D,0x30,0x36,0x31,0x31,0x31,0x30,0x30, -0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x31,0x31,0x31,0x31,0x30,0x30,0x30, -0x30,0x30,0x30,0x30,0x5A,0x30,0x65,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06, -0x13,0x02,0x55,0x53,0x31,0x15,0x30,0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x44, -0x69,0x67,0x69,0x43,0x65,0x72,0x74,0x20,0x49,0x6E,0x63,0x31,0x19,0x30,0x17,0x06, -0x03,0x55,0x04,0x0B,0x13,0x10,0x77,0x77,0x77,0x2E,0x64,0x69,0x67,0x69,0x63,0x65, -0x72,0x74,0x2E,0x63,0x6F,0x6D,0x31,0x24,0x30,0x22,0x06,0x03,0x55,0x04,0x03,0x13, -0x1B,0x44,0x69,0x67,0x69,0x43,0x65,0x72,0x74,0x20,0x41,0x73,0x73,0x75,0x72,0x65, -0x64,0x20,0x49,0x44,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x30,0x82,0x01,0x22, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03, -0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xAD,0x0E,0x15, -0xCE,0xE4,0x43,0x80,0x5C,0xB1,0x87,0xF3,0xB7,0x60,0xF9,0x71,0x12,0xA5,0xAE,0xDC, -0x26,0x94,0x88,0xAA,0xF4,0xCE,0xF5,0x20,0x39,0x28,0x58,0x60,0x0C,0xF8,0x80,0xDA, -0xA9,0x15,0x95,0x32,0x61,0x3C,0xB5,0xB1,0x28,0x84,0x8A,0x8A,0xDC,0x9F,0x0A,0x0C, -0x83,0x17,0x7A,0x8F,0x90,0xAC,0x8A,0xE7,0x79,0x53,0x5C,0x31,0x84,0x2A,0xF6,0x0F, -0x98,0x32,0x36,0x76,0xCC,0xDE,0xDD,0x3C,0xA8,0xA2,0xEF,0x6A,0xFB,0x21,0xF2,0x52, -0x61,0xDF,0x9F,0x20,0xD7,0x1F,0xE2,0xB1,0xD9,0xFE,0x18,0x64,0xD2,0x12,0x5B,0x5F, -0xF9,0x58,0x18,0x35,0xBC,0x47,0xCD,0xA1,0x36,0xF9,0x6B,0x7F,0xD4,0xB0,0x38,0x3E, -0xC1,0x1B,0xC3,0x8C,0x33,0xD9,0xD8,0x2F,0x18,0xFE,0x28,0x0F,0xB3,0xA7,0x83,0xD6, -0xC3,0x6E,0x44,0xC0,0x61,0x35,0x96,0x16,0xFE,0x59,0x9C,0x8B,0x76,0x6D,0xD7,0xF1, -0xA2,0x4B,0x0D,0x2B,0xFF,0x0B,0x72,0xDA,0x9E,0x60,0xD0,0x8E,0x90,0x35,0xC6,0x78, -0x55,0x87,0x20,0xA1,0xCF,0xE5,0x6D,0x0A,0xC8,0x49,0x7C,0x31,0x98,0x33,0x6C,0x22, -0xE9,0x87,0xD0,0x32,0x5A,0xA2,0xBA,0x13,0x82,0x11,0xED,0x39,0x17,0x9D,0x99,0x3A, -0x72,0xA1,0xE6,0xFA,0xA4,0xD9,0xD5,0x17,0x31,0x75,0xAE,0x85,0x7D,0x22,0xAE,0x3F, -0x01,0x46,0x86,0xF6,0x28,0x79,0xC8,0xB1,0xDA,0xE4,0x57,0x17,0xC4,0x7E,0x1C,0x0E, -0xB0,0xB4,0x92,0xA6,0x56,0xB3,0xBD,0xB2,0x97,0xED,0xAA,0xA7,0xF0,0xB7,0xC5,0xA8, -0x3F,0x95,0x16,0xD0,0xFF,0xA1,0x96,0xEB,0x08,0x5F,0x18,0x77,0x4F,0x02,0x03,0x01, -0x00,0x01,0xA3,0x63,0x30,0x61,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF, -0x04,0x04,0x03,0x02,0x01,0x86,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF, -0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16, -0x04,0x14,0x45,0xEB,0xA2,0xAF,0xF4,0x92,0xCB,0x82,0x31,0x2D,0x51,0x8B,0xA7,0xA7, -0x21,0x9D,0xF3,0x6D,0xC8,0x0F,0x30,0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18,0x30, -0x16,0x80,0x14,0x45,0xEB,0xA2,0xAF,0xF4,0x92,0xCB,0x82,0x31,0x2D,0x51,0x8B,0xA7, -0xA7,0x21,0x9D,0xF3,0x6D,0xC8,0x0F,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7, -0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0xA2,0x0E,0xBC,0xDF,0xE2, -0xED,0xF0,0xE3,0x72,0x73,0x7A,0x64,0x94,0xBF,0xF7,0x72,0x66,0xD8,0x32,0xE4,0x42, -0x75,0x62,0xAE,0x87,0xEB,0xF2,0xD5,0xD9,0xDE,0x56,0xB3,0x9F,0xCC,0xCE,0x14,0x28, -0xB9,0x0D,0x97,0x60,0x5C,0x12,0x4C,0x58,0xE4,0xD3,0x3D,0x83,0x49,0x45,0x58,0x97, -0x35,0x69,0x1A,0xA8,0x47,0xEA,0x56,0xC6,0x79,0xAB,0x12,0xD8,0x67,0x81,0x84,0xDF, -0x7F,0x09,0x3C,0x94,0xE6,0xB8,0x26,0x2C,0x20,0xBD,0x3D,0xB3,0x28,0x89,0xF7,0x5F, -0xFF,0x22,0xE2,0x97,0x84,0x1F,0xE9,0x65,0xEF,0x87,0xE0,0xDF,0xC1,0x67,0x49,0xB3, -0x5D,0xEB,0xB2,0x09,0x2A,0xEB,0x26,0xED,0x78,0xBE,0x7D,0x3F,0x2B,0xF3,0xB7,0x26, -0x35,0x6D,0x5F,0x89,0x01,0xB6,0x49,0x5B,0x9F,0x01,0x05,0x9B,0xAB,0x3D,0x25,0xC1, -0xCC,0xB6,0x7F,0xC2,0xF1,0x6F,0x86,0xC6,0xFA,0x64,0x68,0xEB,0x81,0x2D,0x94,0xEB, -0x42,0xB7,0xFA,0x8C,0x1E,0xDD,0x62,0xF1,0xBE,0x50,0x67,0xB7,0x6C,0xBD,0xF3,0xF1, -0x1F,0x6B,0x0C,0x36,0x07,0x16,0x7F,0x37,0x7C,0xA9,0x5B,0x6D,0x7A,0xF1,0x12,0x46, -0x60,0x83,0xD7,0x27,0x04,0xBE,0x4B,0xCE,0x97,0xBE,0xC3,0x67,0x2A,0x68,0x11,0xDF, -0x80,0xE7,0x0C,0x33,0x66,0xBF,0x13,0x0D,0x14,0x6E,0xF3,0x7F,0x1F,0x63,0x10,0x1E, -0xFA,0x8D,0x1B,0x25,0x6D,0x6C,0x8F,0xA5,0xB7,0x61,0x01,0xB1,0xD2,0xA3,0x26,0xA1, -0x10,0x71,0x9D,0xAD,0xE2,0xC3,0xF9,0xC3,0x99,0x51,0xB7,0x2B,0x07,0x08,0xCE,0x2E, -0xE6,0x50,0xB2,0xA7,0xFA,0x0A,0x45,0x2F,0xA2,0xF0,0xF2, -}; - - -/* subject:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Global Root CA */ -/* issuer :/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Global Root CA */ - - -const unsigned char DigiCert_Global_Root_CA_certificate[947]={ -0x30,0x82,0x03,0xAF,0x30,0x82,0x02,0x97,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x08, -0x3B,0xE0,0x56,0x90,0x42,0x46,0xB1,0xA1,0x75,0x6A,0xC9,0x59,0x91,0xC7,0x4A,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x61, -0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x15,0x30, -0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x44,0x69,0x67,0x69,0x43,0x65,0x72,0x74, -0x20,0x49,0x6E,0x63,0x31,0x19,0x30,0x17,0x06,0x03,0x55,0x04,0x0B,0x13,0x10,0x77, -0x77,0x77,0x2E,0x64,0x69,0x67,0x69,0x63,0x65,0x72,0x74,0x2E,0x63,0x6F,0x6D,0x31, -0x20,0x30,0x1E,0x06,0x03,0x55,0x04,0x03,0x13,0x17,0x44,0x69,0x67,0x69,0x43,0x65, -0x72,0x74,0x20,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43, -0x41,0x30,0x1E,0x17,0x0D,0x30,0x36,0x31,0x31,0x31,0x30,0x30,0x30,0x30,0x30,0x30, -0x30,0x5A,0x17,0x0D,0x33,0x31,0x31,0x31,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30, -0x5A,0x30,0x61,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53, -0x31,0x15,0x30,0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x44,0x69,0x67,0x69,0x43, -0x65,0x72,0x74,0x20,0x49,0x6E,0x63,0x31,0x19,0x30,0x17,0x06,0x03,0x55,0x04,0x0B, -0x13,0x10,0x77,0x77,0x77,0x2E,0x64,0x69,0x67,0x69,0x63,0x65,0x72,0x74,0x2E,0x63, -0x6F,0x6D,0x31,0x20,0x30,0x1E,0x06,0x03,0x55,0x04,0x03,0x13,0x17,0x44,0x69,0x67, -0x69,0x43,0x65,0x72,0x74,0x20,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x20,0x52,0x6F,0x6F, -0x74,0x20,0x43,0x41,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86, -0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A, -0x02,0x82,0x01,0x01,0x00,0xE2,0x3B,0xE1,0x11,0x72,0xDE,0xA8,0xA4,0xD3,0xA3,0x57, -0xAA,0x50,0xA2,0x8F,0x0B,0x77,0x90,0xC9,0xA2,0xA5,0xEE,0x12,0xCE,0x96,0x5B,0x01, -0x09,0x20,0xCC,0x01,0x93,0xA7,0x4E,0x30,0xB7,0x53,0xF7,0x43,0xC4,0x69,0x00,0x57, -0x9D,0xE2,0x8D,0x22,0xDD,0x87,0x06,0x40,0x00,0x81,0x09,0xCE,0xCE,0x1B,0x83,0xBF, -0xDF,0xCD,0x3B,0x71,0x46,0xE2,0xD6,0x66,0xC7,0x05,0xB3,0x76,0x27,0x16,0x8F,0x7B, -0x9E,0x1E,0x95,0x7D,0xEE,0xB7,0x48,0xA3,0x08,0xDA,0xD6,0xAF,0x7A,0x0C,0x39,0x06, -0x65,0x7F,0x4A,0x5D,0x1F,0xBC,0x17,0xF8,0xAB,0xBE,0xEE,0x28,0xD7,0x74,0x7F,0x7A, -0x78,0x99,0x59,0x85,0x68,0x6E,0x5C,0x23,0x32,0x4B,0xBF,0x4E,0xC0,0xE8,0x5A,0x6D, -0xE3,0x70,0xBF,0x77,0x10,0xBF,0xFC,0x01,0xF6,0x85,0xD9,0xA8,0x44,0x10,0x58,0x32, -0xA9,0x75,0x18,0xD5,0xD1,0xA2,0xBE,0x47,0xE2,0x27,0x6A,0xF4,0x9A,0x33,0xF8,0x49, -0x08,0x60,0x8B,0xD4,0x5F,0xB4,0x3A,0x84,0xBF,0xA1,0xAA,0x4A,0x4C,0x7D,0x3E,0xCF, -0x4F,0x5F,0x6C,0x76,0x5E,0xA0,0x4B,0x37,0x91,0x9E,0xDC,0x22,0xE6,0x6D,0xCE,0x14, -0x1A,0x8E,0x6A,0xCB,0xFE,0xCD,0xB3,0x14,0x64,0x17,0xC7,0x5B,0x29,0x9E,0x32,0xBF, -0xF2,0xEE,0xFA,0xD3,0x0B,0x42,0xD4,0xAB,0xB7,0x41,0x32,0xDA,0x0C,0xD4,0xEF,0xF8, -0x81,0xD5,0xBB,0x8D,0x58,0x3F,0xB5,0x1B,0xE8,0x49,0x28,0xA2,0x70,0xDA,0x31,0x04, -0xDD,0xF7,0xB2,0x16,0xF2,0x4C,0x0A,0x4E,0x07,0xA8,0xED,0x4A,0x3D,0x5E,0xB5,0x7F, -0xA3,0x90,0xC3,0xAF,0x27,0x02,0x03,0x01,0x00,0x01,0xA3,0x63,0x30,0x61,0x30,0x0E, -0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x86,0x30,0x0F, -0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30, -0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x03,0xDE,0x50,0x35,0x56,0xD1, -0x4C,0xBB,0x66,0xF0,0xA3,0xE2,0x1B,0x1B,0xC3,0x97,0xB2,0x3D,0xD1,0x55,0x30,0x1F, -0x06,0x03,0x55,0x1D,0x23,0x04,0x18,0x30,0x16,0x80,0x14,0x03,0xDE,0x50,0x35,0x56, -0xD1,0x4C,0xBB,0x66,0xF0,0xA3,0xE2,0x1B,0x1B,0xC3,0x97,0xB2,0x3D,0xD1,0x55,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82, -0x01,0x01,0x00,0xCB,0x9C,0x37,0xAA,0x48,0x13,0x12,0x0A,0xFA,0xDD,0x44,0x9C,0x4F, -0x52,0xB0,0xF4,0xDF,0xAE,0x04,0xF5,0x79,0x79,0x08,0xA3,0x24,0x18,0xFC,0x4B,0x2B, -0x84,0xC0,0x2D,0xB9,0xD5,0xC7,0xFE,0xF4,0xC1,0x1F,0x58,0xCB,0xB8,0x6D,0x9C,0x7A, -0x74,0xE7,0x98,0x29,0xAB,0x11,0xB5,0xE3,0x70,0xA0,0xA1,0xCD,0x4C,0x88,0x99,0x93, -0x8C,0x91,0x70,0xE2,0xAB,0x0F,0x1C,0xBE,0x93,0xA9,0xFF,0x63,0xD5,0xE4,0x07,0x60, -0xD3,0xA3,0xBF,0x9D,0x5B,0x09,0xF1,0xD5,0x8E,0xE3,0x53,0xF4,0x8E,0x63,0xFA,0x3F, -0xA7,0xDB,0xB4,0x66,0xDF,0x62,0x66,0xD6,0xD1,0x6E,0x41,0x8D,0xF2,0x2D,0xB5,0xEA, -0x77,0x4A,0x9F,0x9D,0x58,0xE2,0x2B,0x59,0xC0,0x40,0x23,0xED,0x2D,0x28,0x82,0x45, -0x3E,0x79,0x54,0x92,0x26,0x98,0xE0,0x80,0x48,0xA8,0x37,0xEF,0xF0,0xD6,0x79,0x60, -0x16,0xDE,0xAC,0xE8,0x0E,0xCD,0x6E,0xAC,0x44,0x17,0x38,0x2F,0x49,0xDA,0xE1,0x45, -0x3E,0x2A,0xB9,0x36,0x53,0xCF,0x3A,0x50,0x06,0xF7,0x2E,0xE8,0xC4,0x57,0x49,0x6C, -0x61,0x21,0x18,0xD5,0x04,0xAD,0x78,0x3C,0x2C,0x3A,0x80,0x6B,0xA7,0xEB,0xAF,0x15, -0x14,0xE9,0xD8,0x89,0xC1,0xB9,0x38,0x6C,0xE2,0x91,0x6C,0x8A,0xFF,0x64,0xB9,0x77, -0x25,0x57,0x30,0xC0,0x1B,0x24,0xA3,0xE1,0xDC,0xE9,0xDF,0x47,0x7C,0xB5,0xB4,0x24, -0x08,0x05,0x30,0xEC,0x2D,0xBD,0x0B,0xBF,0x45,0xBF,0x50,0xB9,0xA9,0xF3,0xEB,0x98, -0x01,0x12,0xAD,0xC8,0x88,0xC6,0x98,0x34,0x5F,0x8D,0x0A,0x3C,0xC6,0xE9,0xD5,0x95, -0x95,0x6D,0xDE, -}; - - -/* subject:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA */ -/* issuer :/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA */ - - -const unsigned char DigiCert_High_Assurance_EV_Root_CA_certificate[969]={ -0x30,0x82,0x03,0xC5,0x30,0x82,0x02,0xAD,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x02, -0xAC,0x5C,0x26,0x6A,0x0B,0x40,0x9B,0x8F,0x0B,0x79,0xF2,0xAE,0x46,0x25,0x77,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x6C, -0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x15,0x30, -0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x44,0x69,0x67,0x69,0x43,0x65,0x72,0x74, -0x20,0x49,0x6E,0x63,0x31,0x19,0x30,0x17,0x06,0x03,0x55,0x04,0x0B,0x13,0x10,0x77, -0x77,0x77,0x2E,0x64,0x69,0x67,0x69,0x63,0x65,0x72,0x74,0x2E,0x63,0x6F,0x6D,0x31, -0x2B,0x30,0x29,0x06,0x03,0x55,0x04,0x03,0x13,0x22,0x44,0x69,0x67,0x69,0x43,0x65, -0x72,0x74,0x20,0x48,0x69,0x67,0x68,0x20,0x41,0x73,0x73,0x75,0x72,0x61,0x6E,0x63, -0x65,0x20,0x45,0x56,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x30,0x1E,0x17,0x0D, -0x30,0x36,0x31,0x31,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33, -0x31,0x31,0x31,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x30,0x6C,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x15,0x30,0x13,0x06, -0x03,0x55,0x04,0x0A,0x13,0x0C,0x44,0x69,0x67,0x69,0x43,0x65,0x72,0x74,0x20,0x49, -0x6E,0x63,0x31,0x19,0x30,0x17,0x06,0x03,0x55,0x04,0x0B,0x13,0x10,0x77,0x77,0x77, -0x2E,0x64,0x69,0x67,0x69,0x63,0x65,0x72,0x74,0x2E,0x63,0x6F,0x6D,0x31,0x2B,0x30, -0x29,0x06,0x03,0x55,0x04,0x03,0x13,0x22,0x44,0x69,0x67,0x69,0x43,0x65,0x72,0x74, -0x20,0x48,0x69,0x67,0x68,0x20,0x41,0x73,0x73,0x75,0x72,0x61,0x6E,0x63,0x65,0x20, -0x45,0x56,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x30,0x82,0x01,0x22,0x30,0x0D, -0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01, -0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xC6,0xCC,0xE5,0x73,0xE6, -0xFB,0xD4,0xBB,0xE5,0x2D,0x2D,0x32,0xA6,0xDF,0xE5,0x81,0x3F,0xC9,0xCD,0x25,0x49, -0xB6,0x71,0x2A,0xC3,0xD5,0x94,0x34,0x67,0xA2,0x0A,0x1C,0xB0,0x5F,0x69,0xA6,0x40, -0xB1,0xC4,0xB7,0xB2,0x8F,0xD0,0x98,0xA4,0xA9,0x41,0x59,0x3A,0xD3,0xDC,0x94,0xD6, -0x3C,0xDB,0x74,0x38,0xA4,0x4A,0xCC,0x4D,0x25,0x82,0xF7,0x4A,0xA5,0x53,0x12,0x38, -0xEE,0xF3,0x49,0x6D,0x71,0x91,0x7E,0x63,0xB6,0xAB,0xA6,0x5F,0xC3,0xA4,0x84,0xF8, -0x4F,0x62,0x51,0xBE,0xF8,0xC5,0xEC,0xDB,0x38,0x92,0xE3,0x06,0xE5,0x08,0x91,0x0C, -0xC4,0x28,0x41,0x55,0xFB,0xCB,0x5A,0x89,0x15,0x7E,0x71,0xE8,0x35,0xBF,0x4D,0x72, -0x09,0x3D,0xBE,0x3A,0x38,0x50,0x5B,0x77,0x31,0x1B,0x8D,0xB3,0xC7,0x24,0x45,0x9A, -0xA7,0xAC,0x6D,0x00,0x14,0x5A,0x04,0xB7,0xBA,0x13,0xEB,0x51,0x0A,0x98,0x41,0x41, -0x22,0x4E,0x65,0x61,0x87,0x81,0x41,0x50,0xA6,0x79,0x5C,0x89,0xDE,0x19,0x4A,0x57, -0xD5,0x2E,0xE6,0x5D,0x1C,0x53,0x2C,0x7E,0x98,0xCD,0x1A,0x06,0x16,0xA4,0x68,0x73, -0xD0,0x34,0x04,0x13,0x5C,0xA1,0x71,0xD3,0x5A,0x7C,0x55,0xDB,0x5E,0x64,0xE1,0x37, -0x87,0x30,0x56,0x04,0xE5,0x11,0xB4,0x29,0x80,0x12,0xF1,0x79,0x39,0x88,0xA2,0x02, -0x11,0x7C,0x27,0x66,0xB7,0x88,0xB7,0x78,0xF2,0xCA,0x0A,0xA8,0x38,0xAB,0x0A,0x64, -0xC2,0xBF,0x66,0x5D,0x95,0x84,0xC1,0xA1,0x25,0x1E,0x87,0x5D,0x1A,0x50,0x0B,0x20, -0x12,0xCC,0x41,0xBB,0x6E,0x0B,0x51,0x38,0xB8,0x4B,0xCB,0x02,0x03,0x01,0x00,0x01, -0xA3,0x63,0x30,0x61,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04, -0x03,0x02,0x01,0x86,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05, -0x30,0x03,0x01,0x01,0xFF,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14, -0xB1,0x3E,0xC3,0x69,0x03,0xF8,0xBF,0x47,0x01,0xD4,0x98,0x26,0x1A,0x08,0x02,0xEF, -0x63,0x64,0x2B,0xC3,0x30,0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18,0x30,0x16,0x80, -0x14,0xB1,0x3E,0xC3,0x69,0x03,0xF8,0xBF,0x47,0x01,0xD4,0x98,0x26,0x1A,0x08,0x02, -0xEF,0x63,0x64,0x2B,0xC3,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, -0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x1C,0x1A,0x06,0x97,0xDC,0xD7,0x9C, -0x9F,0x3C,0x88,0x66,0x06,0x08,0x57,0x21,0xDB,0x21,0x47,0xF8,0x2A,0x67,0xAA,0xBF, -0x18,0x32,0x76,0x40,0x10,0x57,0xC1,0x8A,0xF3,0x7A,0xD9,0x11,0x65,0x8E,0x35,0xFA, -0x9E,0xFC,0x45,0xB5,0x9E,0xD9,0x4C,0x31,0x4B,0xB8,0x91,0xE8,0x43,0x2C,0x8E,0xB3, -0x78,0xCE,0xDB,0xE3,0x53,0x79,0x71,0xD6,0xE5,0x21,0x94,0x01,0xDA,0x55,0x87,0x9A, -0x24,0x64,0xF6,0x8A,0x66,0xCC,0xDE,0x9C,0x37,0xCD,0xA8,0x34,0xB1,0x69,0x9B,0x23, -0xC8,0x9E,0x78,0x22,0x2B,0x70,0x43,0xE3,0x55,0x47,0x31,0x61,0x19,0xEF,0x58,0xC5, -0x85,0x2F,0x4E,0x30,0xF6,0xA0,0x31,0x16,0x23,0xC8,0xE7,0xE2,0x65,0x16,0x33,0xCB, -0xBF,0x1A,0x1B,0xA0,0x3D,0xF8,0xCA,0x5E,0x8B,0x31,0x8B,0x60,0x08,0x89,0x2D,0x0C, -0x06,0x5C,0x52,0xB7,0xC4,0xF9,0x0A,0x98,0xD1,0x15,0x5F,0x9F,0x12,0xBE,0x7C,0x36, -0x63,0x38,0xBD,0x44,0xA4,0x7F,0xE4,0x26,0x2B,0x0A,0xC4,0x97,0x69,0x0D,0xE9,0x8C, -0xE2,0xC0,0x10,0x57,0xB8,0xC8,0x76,0x12,0x91,0x55,0xF2,0x48,0x69,0xD8,0xBC,0x2A, -0x02,0x5B,0x0F,0x44,0xD4,0x20,0x31,0xDB,0xF4,0xBA,0x70,0x26,0x5D,0x90,0x60,0x9E, -0xBC,0x4B,0x17,0x09,0x2F,0xB4,0xCB,0x1E,0x43,0x68,0xC9,0x07,0x27,0xC1,0xD2,0x5C, -0xF7,0xEA,0x21,0xB9,0x68,0x12,0x9C,0x3C,0x9C,0xBF,0x9E,0xFC,0x80,0x5C,0x9B,0x63, -0xCD,0xEC,0x47,0xAA,0x25,0x27,0x67,0xA0,0x37,0xF3,0x00,0x82,0x7D,0x54,0xD7,0xA9, -0xF8,0xE9,0x2E,0x13,0xA3,0x77,0xE8,0x1F,0x4A, -}; - - -/* subject:/O=Entrust.net/OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Certification Authority (2048) */ -/* issuer :/O=Entrust.net/OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Certification Authority (2048) */ - - -const unsigned char Entrust_net_Premium_2048_Secure_Server_CA_certificate[1120]={ -0x30,0x82,0x04,0x5C,0x30,0x82,0x03,0x44,0xA0,0x03,0x02,0x01,0x02,0x02,0x04,0x38, -0x63,0xB9,0x66,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05, -0x05,0x00,0x30,0x81,0xB4,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x13,0x0B, -0x45,0x6E,0x74,0x72,0x75,0x73,0x74,0x2E,0x6E,0x65,0x74,0x31,0x40,0x30,0x3E,0x06, -0x03,0x55,0x04,0x0B,0x14,0x37,0x77,0x77,0x77,0x2E,0x65,0x6E,0x74,0x72,0x75,0x73, -0x74,0x2E,0x6E,0x65,0x74,0x2F,0x43,0x50,0x53,0x5F,0x32,0x30,0x34,0x38,0x20,0x69, -0x6E,0x63,0x6F,0x72,0x70,0x2E,0x20,0x62,0x79,0x20,0x72,0x65,0x66,0x2E,0x20,0x28, -0x6C,0x69,0x6D,0x69,0x74,0x73,0x20,0x6C,0x69,0x61,0x62,0x2E,0x29,0x31,0x25,0x30, -0x23,0x06,0x03,0x55,0x04,0x0B,0x13,0x1C,0x28,0x63,0x29,0x20,0x31,0x39,0x39,0x39, -0x20,0x45,0x6E,0x74,0x72,0x75,0x73,0x74,0x2E,0x6E,0x65,0x74,0x20,0x4C,0x69,0x6D, -0x69,0x74,0x65,0x64,0x31,0x33,0x30,0x31,0x06,0x03,0x55,0x04,0x03,0x13,0x2A,0x45, -0x6E,0x74,0x72,0x75,0x73,0x74,0x2E,0x6E,0x65,0x74,0x20,0x43,0x65,0x72,0x74,0x69, -0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69, -0x74,0x79,0x20,0x28,0x32,0x30,0x34,0x38,0x29,0x30,0x1E,0x17,0x0D,0x39,0x39,0x31, -0x32,0x32,0x34,0x31,0x37,0x35,0x30,0x35,0x31,0x5A,0x17,0x0D,0x31,0x39,0x31,0x32, -0x32,0x34,0x31,0x38,0x32,0x30,0x35,0x31,0x5A,0x30,0x81,0xB4,0x31,0x14,0x30,0x12, -0x06,0x03,0x55,0x04,0x0A,0x13,0x0B,0x45,0x6E,0x74,0x72,0x75,0x73,0x74,0x2E,0x6E, -0x65,0x74,0x31,0x40,0x30,0x3E,0x06,0x03,0x55,0x04,0x0B,0x14,0x37,0x77,0x77,0x77, -0x2E,0x65,0x6E,0x74,0x72,0x75,0x73,0x74,0x2E,0x6E,0x65,0x74,0x2F,0x43,0x50,0x53, -0x5F,0x32,0x30,0x34,0x38,0x20,0x69,0x6E,0x63,0x6F,0x72,0x70,0x2E,0x20,0x62,0x79, -0x20,0x72,0x65,0x66,0x2E,0x20,0x28,0x6C,0x69,0x6D,0x69,0x74,0x73,0x20,0x6C,0x69, -0x61,0x62,0x2E,0x29,0x31,0x25,0x30,0x23,0x06,0x03,0x55,0x04,0x0B,0x13,0x1C,0x28, -0x63,0x29,0x20,0x31,0x39,0x39,0x39,0x20,0x45,0x6E,0x74,0x72,0x75,0x73,0x74,0x2E, -0x6E,0x65,0x74,0x20,0x4C,0x69,0x6D,0x69,0x74,0x65,0x64,0x31,0x33,0x30,0x31,0x06, -0x03,0x55,0x04,0x03,0x13,0x2A,0x45,0x6E,0x74,0x72,0x75,0x73,0x74,0x2E,0x6E,0x65, -0x74,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20, -0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x20,0x28,0x32,0x30,0x34,0x38,0x29, -0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01, -0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01, -0x00,0xAD,0x4D,0x4B,0xA9,0x12,0x86,0xB2,0xEA,0xA3,0x20,0x07,0x15,0x16,0x64,0x2A, -0x2B,0x4B,0xD1,0xBF,0x0B,0x4A,0x4D,0x8E,0xED,0x80,0x76,0xA5,0x67,0xB7,0x78,0x40, -0xC0,0x73,0x42,0xC8,0x68,0xC0,0xDB,0x53,0x2B,0xDD,0x5E,0xB8,0x76,0x98,0x35,0x93, -0x8B,0x1A,0x9D,0x7C,0x13,0x3A,0x0E,0x1F,0x5B,0xB7,0x1E,0xCF,0xE5,0x24,0x14,0x1E, -0xB1,0x81,0xA9,0x8D,0x7D,0xB8,0xCC,0x6B,0x4B,0x03,0xF1,0x02,0x0C,0xDC,0xAB,0xA5, -0x40,0x24,0x00,0x7F,0x74,0x94,0xA1,0x9D,0x08,0x29,0xB3,0x88,0x0B,0xF5,0x87,0x77, -0x9D,0x55,0xCD,0xE4,0xC3,0x7E,0xD7,0x6A,0x64,0xAB,0x85,0x14,0x86,0x95,0x5B,0x97, -0x32,0x50,0x6F,0x3D,0xC8,0xBA,0x66,0x0C,0xE3,0xFC,0xBD,0xB8,0x49,0xC1,0x76,0x89, -0x49,0x19,0xFD,0xC0,0xA8,0xBD,0x89,0xA3,0x67,0x2F,0xC6,0x9F,0xBC,0x71,0x19,0x60, -0xB8,0x2D,0xE9,0x2C,0xC9,0x90,0x76,0x66,0x7B,0x94,0xE2,0xAF,0x78,0xD6,0x65,0x53, -0x5D,0x3C,0xD6,0x9C,0xB2,0xCF,0x29,0x03,0xF9,0x2F,0xA4,0x50,0xB2,0xD4,0x48,0xCE, -0x05,0x32,0x55,0x8A,0xFD,0xB2,0x64,0x4C,0x0E,0xE4,0x98,0x07,0x75,0xDB,0x7F,0xDF, -0xB9,0x08,0x55,0x60,0x85,0x30,0x29,0xF9,0x7B,0x48,0xA4,0x69,0x86,0xE3,0x35,0x3F, -0x1E,0x86,0x5D,0x7A,0x7A,0x15,0xBD,0xEF,0x00,0x8E,0x15,0x22,0x54,0x17,0x00,0x90, -0x26,0x93,0xBC,0x0E,0x49,0x68,0x91,0xBF,0xF8,0x47,0xD3,0x9D,0x95,0x42,0xC1,0x0E, -0x4D,0xDF,0x6F,0x26,0xCF,0xC3,0x18,0x21,0x62,0x66,0x43,0x70,0xD6,0xD5,0xC0,0x07, -0xE1,0x02,0x03,0x01,0x00,0x01,0xA3,0x74,0x30,0x72,0x30,0x11,0x06,0x09,0x60,0x86, -0x48,0x01,0x86,0xF8,0x42,0x01,0x01,0x04,0x04,0x03,0x02,0x00,0x07,0x30,0x1F,0x06, -0x03,0x55,0x1D,0x23,0x04,0x18,0x30,0x16,0x80,0x14,0x55,0xE4,0x81,0xD1,0x11,0x80, -0xBE,0xD8,0x89,0xB9,0x08,0xA3,0x31,0xF9,0xA1,0x24,0x09,0x16,0xB9,0x70,0x30,0x1D, -0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x55,0xE4,0x81,0xD1,0x11,0x80,0xBE, -0xD8,0x89,0xB9,0x08,0xA3,0x31,0xF9,0xA1,0x24,0x09,0x16,0xB9,0x70,0x30,0x1D,0x06, -0x09,0x2A,0x86,0x48,0x86,0xF6,0x7D,0x07,0x41,0x00,0x04,0x10,0x30,0x0E,0x1B,0x08, -0x56,0x35,0x2E,0x30,0x3A,0x34,0x2E,0x30,0x03,0x02,0x04,0x90,0x30,0x0D,0x06,0x09, -0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00, -0x59,0x47,0xAC,0x21,0x84,0x8A,0x17,0xC9,0x9C,0x89,0x53,0x1E,0xBA,0x80,0x85,0x1A, -0xC6,0x3C,0x4E,0x3E,0xB1,0x9C,0xB6,0x7C,0xC6,0x92,0x5D,0x18,0x64,0x02,0xE3,0xD3, -0x06,0x08,0x11,0x61,0x7C,0x63,0xE3,0x2B,0x9D,0x31,0x03,0x70,0x76,0xD2,0xA3,0x28, -0xA0,0xF4,0xBB,0x9A,0x63,0x73,0xED,0x6D,0xE5,0x2A,0xDB,0xED,0x14,0xA9,0x2B,0xC6, -0x36,0x11,0xD0,0x2B,0xEB,0x07,0x8B,0xA5,0xDA,0x9E,0x5C,0x19,0x9D,0x56,0x12,0xF5, -0x54,0x29,0xC8,0x05,0xED,0xB2,0x12,0x2A,0x8D,0xF4,0x03,0x1B,0xFF,0xE7,0x92,0x10, -0x87,0xB0,0x3A,0xB5,0xC3,0x9D,0x05,0x37,0x12,0xA3,0xC7,0xF4,0x15,0xB9,0xD5,0xA4, -0x39,0x16,0x9B,0x53,0x3A,0x23,0x91,0xF1,0xA8,0x82,0xA2,0x6A,0x88,0x68,0xC1,0x79, -0x02,0x22,0xBC,0xAA,0xA6,0xD6,0xAE,0xDF,0xB0,0x14,0x5F,0xB8,0x87,0xD0,0xDD,0x7C, -0x7F,0x7B,0xFF,0xAF,0x1C,0xCF,0xE6,0xDB,0x07,0xAD,0x5E,0xDB,0x85,0x9D,0xD0,0x2B, -0x0D,0x33,0xDB,0x04,0xD1,0xE6,0x49,0x40,0x13,0x2B,0x76,0xFB,0x3E,0xE9,0x9C,0x89, -0x0F,0x15,0xCE,0x18,0xB0,0x85,0x78,0x21,0x4F,0x6B,0x4F,0x0E,0xFA,0x36,0x67,0xCD, -0x07,0xF2,0xFF,0x08,0xD0,0xE2,0xDE,0xD9,0xBF,0x2A,0xAF,0xB8,0x87,0x86,0x21,0x3C, -0x04,0xCA,0xB7,0x94,0x68,0x7F,0xCF,0x3C,0xE9,0x98,0xD7,0x38,0xFF,0xEC,0xC0,0xD9, -0x50,0xF0,0x2E,0x4B,0x58,0xAE,0x46,0x6F,0xD0,0x2E,0xC3,0x60,0xDA,0x72,0x55,0x72, -0xBD,0x4C,0x45,0x9E,0x61,0xBA,0xBF,0x84,0x81,0x92,0x03,0xD1,0xD2,0x69,0x7C,0xC5, -}; - - -/* subject:/C=US/O=Entrust.net/OU=www.entrust.net/CPS incorp. by ref. (limits liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Secure Server Certification Authority */ -/* issuer :/C=US/O=Entrust.net/OU=www.entrust.net/CPS incorp. by ref. (limits liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Secure Server Certification Authority */ - - -const unsigned char Entrust_net_Secure_Server_CA_certificate[1244]={ -0x30,0x82,0x04,0xD8,0x30,0x82,0x04,0x41,0xA0,0x03,0x02,0x01,0x02,0x02,0x04,0x37, -0x4A,0xD2,0x43,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05, -0x05,0x00,0x30,0x81,0xC3,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02, -0x55,0x53,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x13,0x0B,0x45,0x6E,0x74, -0x72,0x75,0x73,0x74,0x2E,0x6E,0x65,0x74,0x31,0x3B,0x30,0x39,0x06,0x03,0x55,0x04, -0x0B,0x13,0x32,0x77,0x77,0x77,0x2E,0x65,0x6E,0x74,0x72,0x75,0x73,0x74,0x2E,0x6E, -0x65,0x74,0x2F,0x43,0x50,0x53,0x20,0x69,0x6E,0x63,0x6F,0x72,0x70,0x2E,0x20,0x62, -0x79,0x20,0x72,0x65,0x66,0x2E,0x20,0x28,0x6C,0x69,0x6D,0x69,0x74,0x73,0x20,0x6C, -0x69,0x61,0x62,0x2E,0x29,0x31,0x25,0x30,0x23,0x06,0x03,0x55,0x04,0x0B,0x13,0x1C, -0x28,0x63,0x29,0x20,0x31,0x39,0x39,0x39,0x20,0x45,0x6E,0x74,0x72,0x75,0x73,0x74, -0x2E,0x6E,0x65,0x74,0x20,0x4C,0x69,0x6D,0x69,0x74,0x65,0x64,0x31,0x3A,0x30,0x38, -0x06,0x03,0x55,0x04,0x03,0x13,0x31,0x45,0x6E,0x74,0x72,0x75,0x73,0x74,0x2E,0x6E, -0x65,0x74,0x20,0x53,0x65,0x63,0x75,0x72,0x65,0x20,0x53,0x65,0x72,0x76,0x65,0x72, -0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41, -0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x1E,0x17,0x0D,0x39,0x39,0x30,0x35, -0x32,0x35,0x31,0x36,0x30,0x39,0x34,0x30,0x5A,0x17,0x0D,0x31,0x39,0x30,0x35,0x32, -0x35,0x31,0x36,0x33,0x39,0x34,0x30,0x5A,0x30,0x81,0xC3,0x31,0x0B,0x30,0x09,0x06, -0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04, -0x0A,0x13,0x0B,0x45,0x6E,0x74,0x72,0x75,0x73,0x74,0x2E,0x6E,0x65,0x74,0x31,0x3B, -0x30,0x39,0x06,0x03,0x55,0x04,0x0B,0x13,0x32,0x77,0x77,0x77,0x2E,0x65,0x6E,0x74, -0x72,0x75,0x73,0x74,0x2E,0x6E,0x65,0x74,0x2F,0x43,0x50,0x53,0x20,0x69,0x6E,0x63, -0x6F,0x72,0x70,0x2E,0x20,0x62,0x79,0x20,0x72,0x65,0x66,0x2E,0x20,0x28,0x6C,0x69, -0x6D,0x69,0x74,0x73,0x20,0x6C,0x69,0x61,0x62,0x2E,0x29,0x31,0x25,0x30,0x23,0x06, -0x03,0x55,0x04,0x0B,0x13,0x1C,0x28,0x63,0x29,0x20,0x31,0x39,0x39,0x39,0x20,0x45, -0x6E,0x74,0x72,0x75,0x73,0x74,0x2E,0x6E,0x65,0x74,0x20,0x4C,0x69,0x6D,0x69,0x74, -0x65,0x64,0x31,0x3A,0x30,0x38,0x06,0x03,0x55,0x04,0x03,0x13,0x31,0x45,0x6E,0x74, -0x72,0x75,0x73,0x74,0x2E,0x6E,0x65,0x74,0x20,0x53,0x65,0x63,0x75,0x72,0x65,0x20, -0x53,0x65,0x72,0x76,0x65,0x72,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61, -0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x81, -0x9D,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00, -0x03,0x81,0x8B,0x00,0x30,0x81,0x87,0x02,0x81,0x81,0x00,0xCD,0x28,0x83,0x34,0x54, -0x1B,0x89,0xF3,0x0F,0xAF,0x37,0x91,0x31,0xFF,0xAF,0x31,0x60,0xC9,0xA8,0xE8,0xB2, -0x10,0x68,0xED,0x9F,0xE7,0x93,0x36,0xF1,0x0A,0x64,0xBB,0x47,0xF5,0x04,0x17,0x3F, -0x23,0x47,0x4D,0xC5,0x27,0x19,0x81,0x26,0x0C,0x54,0x72,0x0D,0x88,0x2D,0xD9,0x1F, -0x9A,0x12,0x9F,0xBC,0xB3,0x71,0xD3,0x80,0x19,0x3F,0x47,0x66,0x7B,0x8C,0x35,0x28, -0xD2,0xB9,0x0A,0xDF,0x24,0xDA,0x9C,0xD6,0x50,0x79,0x81,0x7A,0x5A,0xD3,0x37,0xF7, -0xC2,0x4A,0xD8,0x29,0x92,0x26,0x64,0xD1,0xE4,0x98,0x6C,0x3A,0x00,0x8A,0xF5,0x34, -0x9B,0x65,0xF8,0xED,0xE3,0x10,0xFF,0xFD,0xB8,0x49,0x58,0xDC,0xA0,0xDE,0x82,0x39, -0x6B,0x81,0xB1,0x16,0x19,0x61,0xB9,0x54,0xB6,0xE6,0x43,0x02,0x01,0x03,0xA3,0x82, -0x01,0xD7,0x30,0x82,0x01,0xD3,0x30,0x11,0x06,0x09,0x60,0x86,0x48,0x01,0x86,0xF8, -0x42,0x01,0x01,0x04,0x04,0x03,0x02,0x00,0x07,0x30,0x82,0x01,0x19,0x06,0x03,0x55, -0x1D,0x1F,0x04,0x82,0x01,0x10,0x30,0x82,0x01,0x0C,0x30,0x81,0xDE,0xA0,0x81,0xDB, -0xA0,0x81,0xD8,0xA4,0x81,0xD5,0x30,0x81,0xD2,0x31,0x0B,0x30,0x09,0x06,0x03,0x55, -0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x14,0x30,0x12,0x06,0x03,0x55,0x04,0x0A,0x13, -0x0B,0x45,0x6E,0x74,0x72,0x75,0x73,0x74,0x2E,0x6E,0x65,0x74,0x31,0x3B,0x30,0x39, -0x06,0x03,0x55,0x04,0x0B,0x13,0x32,0x77,0x77,0x77,0x2E,0x65,0x6E,0x74,0x72,0x75, -0x73,0x74,0x2E,0x6E,0x65,0x74,0x2F,0x43,0x50,0x53,0x20,0x69,0x6E,0x63,0x6F,0x72, -0x70,0x2E,0x20,0x62,0x79,0x20,0x72,0x65,0x66,0x2E,0x20,0x28,0x6C,0x69,0x6D,0x69, -0x74,0x73,0x20,0x6C,0x69,0x61,0x62,0x2E,0x29,0x31,0x25,0x30,0x23,0x06,0x03,0x55, -0x04,0x0B,0x13,0x1C,0x28,0x63,0x29,0x20,0x31,0x39,0x39,0x39,0x20,0x45,0x6E,0x74, -0x72,0x75,0x73,0x74,0x2E,0x6E,0x65,0x74,0x20,0x4C,0x69,0x6D,0x69,0x74,0x65,0x64, -0x31,0x3A,0x30,0x38,0x06,0x03,0x55,0x04,0x03,0x13,0x31,0x45,0x6E,0x74,0x72,0x75, -0x73,0x74,0x2E,0x6E,0x65,0x74,0x20,0x53,0x65,0x63,0x75,0x72,0x65,0x20,0x53,0x65, -0x72,0x76,0x65,0x72,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69, -0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x31,0x0D,0x30,0x0B, -0x06,0x03,0x55,0x04,0x03,0x13,0x04,0x43,0x52,0x4C,0x31,0x30,0x29,0xA0,0x27,0xA0, -0x25,0x86,0x23,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x77,0x77,0x77,0x2E,0x65,0x6E, -0x74,0x72,0x75,0x73,0x74,0x2E,0x6E,0x65,0x74,0x2F,0x43,0x52,0x4C,0x2F,0x6E,0x65, -0x74,0x31,0x2E,0x63,0x72,0x6C,0x30,0x2B,0x06,0x03,0x55,0x1D,0x10,0x04,0x24,0x30, -0x22,0x80,0x0F,0x31,0x39,0x39,0x39,0x30,0x35,0x32,0x35,0x31,0x36,0x30,0x39,0x34, -0x30,0x5A,0x81,0x0F,0x32,0x30,0x31,0x39,0x30,0x35,0x32,0x35,0x31,0x36,0x30,0x39, -0x34,0x30,0x5A,0x30,0x0B,0x06,0x03,0x55,0x1D,0x0F,0x04,0x04,0x03,0x02,0x01,0x06, -0x30,0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18,0x30,0x16,0x80,0x14,0xF0,0x17,0x62, -0x13,0x55,0x3D,0xB3,0xFF,0x0A,0x00,0x6B,0xFB,0x50,0x84,0x97,0xF3,0xED,0x62,0xD0, -0x1A,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xF0,0x17,0x62,0x13, -0x55,0x3D,0xB3,0xFF,0x0A,0x00,0x6B,0xFB,0x50,0x84,0x97,0xF3,0xED,0x62,0xD0,0x1A, -0x30,0x0C,0x06,0x03,0x55,0x1D,0x13,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x19, -0x06,0x09,0x2A,0x86,0x48,0x86,0xF6,0x7D,0x07,0x41,0x00,0x04,0x0C,0x30,0x0A,0x1B, -0x04,0x56,0x34,0x2E,0x30,0x03,0x02,0x04,0x90,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48, -0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x81,0x81,0x00,0x90,0xDC,0x30,0x02, -0xFA,0x64,0x74,0xC2,0xA7,0x0A,0xA5,0x7C,0x21,0x8D,0x34,0x17,0xA8,0xFB,0x47,0x0E, -0xFF,0x25,0x7C,0x8D,0x13,0x0A,0xFB,0xE4,0x98,0xB5,0xEF,0x8C,0xF8,0xC5,0x10,0x0D, -0xF7,0x92,0xBE,0xF1,0xC3,0xD5,0xD5,0x95,0x6A,0x04,0xBB,0x2C,0xCE,0x26,0x36,0x65, -0xC8,0x31,0xC6,0xE7,0xEE,0x3F,0xE3,0x57,0x75,0x84,0x7A,0x11,0xEF,0x46,0x4F,0x18, -0xF4,0xD3,0x98,0xBB,0xA8,0x87,0x32,0xBA,0x72,0xF6,0x3C,0xE2,0x3D,0x9F,0xD7,0x1D, -0xD9,0xC3,0x60,0x43,0x8C,0x58,0x0E,0x22,0x96,0x2F,0x62,0xA3,0x2C,0x1F,0xBA,0xAD, -0x05,0xEF,0xAB,0x32,0x78,0x87,0xA0,0x54,0x73,0x19,0xB5,0x5C,0x05,0xF9,0x52,0x3E, -0x6D,0x2D,0x45,0x0B,0xF7,0x0A,0x93,0xEA,0xED,0x06,0xF9,0xB2, -}; - - -/* subject:/C=US/O=Entrust, Inc./OU=www.entrust.net/CPS is incorporated by reference/OU=(c) 2006 Entrust, Inc./CN=Entrust Root Certification Authority */ -/* issuer :/C=US/O=Entrust, Inc./OU=www.entrust.net/CPS is incorporated by reference/OU=(c) 2006 Entrust, Inc./CN=Entrust Root Certification Authority */ - - -const unsigned char Entrust_Root_Certification_Authority_certificate[1173]={ -0x30,0x82,0x04,0x91,0x30,0x82,0x03,0x79,0xA0,0x03,0x02,0x01,0x02,0x02,0x04,0x45, -0x6B,0x50,0x54,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05, -0x05,0x00,0x30,0x81,0xB0,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02, -0x55,0x53,0x31,0x16,0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D,0x45,0x6E,0x74, -0x72,0x75,0x73,0x74,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x39,0x30,0x37,0x06,0x03, -0x55,0x04,0x0B,0x13,0x30,0x77,0x77,0x77,0x2E,0x65,0x6E,0x74,0x72,0x75,0x73,0x74, -0x2E,0x6E,0x65,0x74,0x2F,0x43,0x50,0x53,0x20,0x69,0x73,0x20,0x69,0x6E,0x63,0x6F, -0x72,0x70,0x6F,0x72,0x61,0x74,0x65,0x64,0x20,0x62,0x79,0x20,0x72,0x65,0x66,0x65, -0x72,0x65,0x6E,0x63,0x65,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x0B,0x13,0x16, -0x28,0x63,0x29,0x20,0x32,0x30,0x30,0x36,0x20,0x45,0x6E,0x74,0x72,0x75,0x73,0x74, -0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x2D,0x30,0x2B,0x06,0x03,0x55,0x04,0x03,0x13, -0x24,0x45,0x6E,0x74,0x72,0x75,0x73,0x74,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x65, -0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68, -0x6F,0x72,0x69,0x74,0x79,0x30,0x1E,0x17,0x0D,0x30,0x36,0x31,0x31,0x32,0x37,0x32, -0x30,0x32,0x33,0x34,0x32,0x5A,0x17,0x0D,0x32,0x36,0x31,0x31,0x32,0x37,0x32,0x30, -0x35,0x33,0x34,0x32,0x5A,0x30,0x81,0xB0,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04, -0x06,0x13,0x02,0x55,0x53,0x31,0x16,0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D, -0x45,0x6E,0x74,0x72,0x75,0x73,0x74,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x39,0x30, -0x37,0x06,0x03,0x55,0x04,0x0B,0x13,0x30,0x77,0x77,0x77,0x2E,0x65,0x6E,0x74,0x72, -0x75,0x73,0x74,0x2E,0x6E,0x65,0x74,0x2F,0x43,0x50,0x53,0x20,0x69,0x73,0x20,0x69, -0x6E,0x63,0x6F,0x72,0x70,0x6F,0x72,0x61,0x74,0x65,0x64,0x20,0x62,0x79,0x20,0x72, -0x65,0x66,0x65,0x72,0x65,0x6E,0x63,0x65,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04, -0x0B,0x13,0x16,0x28,0x63,0x29,0x20,0x32,0x30,0x30,0x36,0x20,0x45,0x6E,0x74,0x72, -0x75,0x73,0x74,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x2D,0x30,0x2B,0x06,0x03,0x55, -0x04,0x03,0x13,0x24,0x45,0x6E,0x74,0x72,0x75,0x73,0x74,0x20,0x52,0x6F,0x6F,0x74, -0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41, -0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09, -0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00, -0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xB6,0x95,0xB6,0x43,0x42,0xFA,0xC6, -0x6D,0x2A,0x6F,0x48,0xDF,0x94,0x4C,0x39,0x57,0x05,0xEE,0xC3,0x79,0x11,0x41,0x68, -0x36,0xED,0xEC,0xFE,0x9A,0x01,0x8F,0xA1,0x38,0x28,0xFC,0xF7,0x10,0x46,0x66,0x2E, -0x4D,0x1E,0x1A,0xB1,0x1A,0x4E,0xC6,0xD1,0xC0,0x95,0x88,0xB0,0xC9,0xFF,0x31,0x8B, -0x33,0x03,0xDB,0xB7,0x83,0x7B,0x3E,0x20,0x84,0x5E,0xED,0xB2,0x56,0x28,0xA7,0xF8, -0xE0,0xB9,0x40,0x71,0x37,0xC5,0xCB,0x47,0x0E,0x97,0x2A,0x68,0xC0,0x22,0x95,0x62, -0x15,0xDB,0x47,0xD9,0xF5,0xD0,0x2B,0xFF,0x82,0x4B,0xC9,0xAD,0x3E,0xDE,0x4C,0xDB, -0x90,0x80,0x50,0x3F,0x09,0x8A,0x84,0x00,0xEC,0x30,0x0A,0x3D,0x18,0xCD,0xFB,0xFD, -0x2A,0x59,0x9A,0x23,0x95,0x17,0x2C,0x45,0x9E,0x1F,0x6E,0x43,0x79,0x6D,0x0C,0x5C, -0x98,0xFE,0x48,0xA7,0xC5,0x23,0x47,0x5C,0x5E,0xFD,0x6E,0xE7,0x1E,0xB4,0xF6,0x68, -0x45,0xD1,0x86,0x83,0x5B,0xA2,0x8A,0x8D,0xB1,0xE3,0x29,0x80,0xFE,0x25,0x71,0x88, -0xAD,0xBE,0xBC,0x8F,0xAC,0x52,0x96,0x4B,0xAA,0x51,0x8D,0xE4,0x13,0x31,0x19,0xE8, -0x4E,0x4D,0x9F,0xDB,0xAC,0xB3,0x6A,0xD5,0xBC,0x39,0x54,0x71,0xCA,0x7A,0x7A,0x7F, -0x90,0xDD,0x7D,0x1D,0x80,0xD9,0x81,0xBB,0x59,0x26,0xC2,0x11,0xFE,0xE6,0x93,0xE2, -0xF7,0x80,0xE4,0x65,0xFB,0x34,0x37,0x0E,0x29,0x80,0x70,0x4D,0xAF,0x38,0x86,0x2E, -0x9E,0x7F,0x57,0xAF,0x9E,0x17,0xAE,0xEB,0x1C,0xCB,0x28,0x21,0x5F,0xB6,0x1C,0xD8, -0xE7,0xA2,0x04,0x22,0xF9,0xD3,0xDA,0xD8,0xCB,0x02,0x03,0x01,0x00,0x01,0xA3,0x81, -0xB0,0x30,0x81,0xAD,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04, -0x03,0x02,0x01,0x06,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05, -0x30,0x03,0x01,0x01,0xFF,0x30,0x2B,0x06,0x03,0x55,0x1D,0x10,0x04,0x24,0x30,0x22, -0x80,0x0F,0x32,0x30,0x30,0x36,0x31,0x31,0x32,0x37,0x32,0x30,0x32,0x33,0x34,0x32, -0x5A,0x81,0x0F,0x32,0x30,0x32,0x36,0x31,0x31,0x32,0x37,0x32,0x30,0x35,0x33,0x34, -0x32,0x5A,0x30,0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18,0x30,0x16,0x80,0x14,0x68, -0x90,0xE4,0x67,0xA4,0xA6,0x53,0x80,0xC7,0x86,0x66,0xA4,0xF1,0xF7,0x4B,0x43,0xFB, -0x84,0xBD,0x6D,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x68,0x90, -0xE4,0x67,0xA4,0xA6,0x53,0x80,0xC7,0x86,0x66,0xA4,0xF1,0xF7,0x4B,0x43,0xFB,0x84, -0xBD,0x6D,0x30,0x1D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF6,0x7D,0x07,0x41,0x00,0x04, -0x10,0x30,0x0E,0x1B,0x08,0x56,0x37,0x2E,0x31,0x3A,0x34,0x2E,0x30,0x03,0x02,0x04, -0x90,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00, -0x03,0x82,0x01,0x01,0x00,0x93,0xD4,0x30,0xB0,0xD7,0x03,0x20,0x2A,0xD0,0xF9,0x63, -0xE8,0x91,0x0C,0x05,0x20,0xA9,0x5F,0x19,0xCA,0x7B,0x72,0x4E,0xD4,0xB1,0xDB,0xD0, -0x96,0xFB,0x54,0x5A,0x19,0x2C,0x0C,0x08,0xF7,0xB2,0xBC,0x85,0xA8,0x9D,0x7F,0x6D, -0x3B,0x52,0xB3,0x2A,0xDB,0xE7,0xD4,0x84,0x8C,0x63,0xF6,0x0F,0xCB,0x26,0x01,0x91, -0x50,0x6C,0xF4,0x5F,0x14,0xE2,0x93,0x74,0xC0,0x13,0x9E,0x30,0x3A,0x50,0xE3,0xB4, -0x60,0xC5,0x1C,0xF0,0x22,0x44,0x8D,0x71,0x47,0xAC,0xC8,0x1A,0xC9,0xE9,0x9B,0x9A, -0x00,0x60,0x13,0xFF,0x70,0x7E,0x5F,0x11,0x4D,0x49,0x1B,0xB3,0x15,0x52,0x7B,0xC9, -0x54,0xDA,0xBF,0x9D,0x95,0xAF,0x6B,0x9A,0xD8,0x9E,0xE9,0xF1,0xE4,0x43,0x8D,0xE2, -0x11,0x44,0x3A,0xBF,0xAF,0xBD,0x83,0x42,0x73,0x52,0x8B,0xAA,0xBB,0xA7,0x29,0xCF, -0xF5,0x64,0x1C,0x0A,0x4D,0xD1,0xBC,0xAA,0xAC,0x9F,0x2A,0xD0,0xFF,0x7F,0x7F,0xDA, -0x7D,0xEA,0xB1,0xED,0x30,0x25,0xC1,0x84,0xDA,0x34,0xD2,0x5B,0x78,0x83,0x56,0xEC, -0x9C,0x36,0xC3,0x26,0xE2,0x11,0xF6,0x67,0x49,0x1D,0x92,0xAB,0x8C,0xFB,0xEB,0xFF, -0x7A,0xEE,0x85,0x4A,0xA7,0x50,0x80,0xF0,0xA7,0x5C,0x4A,0x94,0x2E,0x5F,0x05,0x99, -0x3C,0x52,0x41,0xE0,0xCD,0xB4,0x63,0xCF,0x01,0x43,0xBA,0x9C,0x83,0xDC,0x8F,0x60, -0x3B,0xF3,0x5A,0xB4,0xB4,0x7B,0xAE,0xDA,0x0B,0x90,0x38,0x75,0xEF,0x81,0x1D,0x66, -0xD2,0xF7,0x57,0x70,0x36,0xB3,0xBF,0xFC,0x28,0xAF,0x71,0x25,0x85,0x5B,0x13,0xFE, -0x1E,0x7F,0x5A,0xB4,0x3C, -}; - - -/* subject:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority */ -/* issuer :/C=US/O=Equifax/OU=Equifax Secure Certificate Authority */ - - -const unsigned char Equifax_Secure_CA_certificate[804]={ -0x30,0x82,0x03,0x20,0x30,0x82,0x02,0x89,0xA0,0x03,0x02,0x01,0x02,0x02,0x04,0x35, -0xDE,0xF4,0xCF,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05, -0x05,0x00,0x30,0x4E,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55, -0x53,0x31,0x10,0x30,0x0E,0x06,0x03,0x55,0x04,0x0A,0x13,0x07,0x45,0x71,0x75,0x69, -0x66,0x61,0x78,0x31,0x2D,0x30,0x2B,0x06,0x03,0x55,0x04,0x0B,0x13,0x24,0x45,0x71, -0x75,0x69,0x66,0x61,0x78,0x20,0x53,0x65,0x63,0x75,0x72,0x65,0x20,0x43,0x65,0x72, -0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69, -0x74,0x79,0x30,0x1E,0x17,0x0D,0x39,0x38,0x30,0x38,0x32,0x32,0x31,0x36,0x34,0x31, -0x35,0x31,0x5A,0x17,0x0D,0x31,0x38,0x30,0x38,0x32,0x32,0x31,0x36,0x34,0x31,0x35, -0x31,0x5A,0x30,0x4E,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55, -0x53,0x31,0x10,0x30,0x0E,0x06,0x03,0x55,0x04,0x0A,0x13,0x07,0x45,0x71,0x75,0x69, -0x66,0x61,0x78,0x31,0x2D,0x30,0x2B,0x06,0x03,0x55,0x04,0x0B,0x13,0x24,0x45,0x71, -0x75,0x69,0x66,0x61,0x78,0x20,0x53,0x65,0x63,0x75,0x72,0x65,0x20,0x43,0x65,0x72, -0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69, -0x74,0x79,0x30,0x81,0x9F,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, -0x01,0x01,0x05,0x00,0x03,0x81,0x8D,0x00,0x30,0x81,0x89,0x02,0x81,0x81,0x00,0xC1, -0x5D,0xB1,0x58,0x67,0x08,0x62,0xEE,0xA0,0x9A,0x2D,0x1F,0x08,0x6D,0x91,0x14,0x68, -0x98,0x0A,0x1E,0xFE,0xDA,0x04,0x6F,0x13,0x84,0x62,0x21,0xC3,0xD1,0x7C,0xCE,0x9F, -0x05,0xE0,0xB8,0x01,0xF0,0x4E,0x34,0xEC,0xE2,0x8A,0x95,0x04,0x64,0xAC,0xF1,0x6B, -0x53,0x5F,0x05,0xB3,0xCB,0x67,0x80,0xBF,0x42,0x02,0x8E,0xFE,0xDD,0x01,0x09,0xEC, -0xE1,0x00,0x14,0x4F,0xFC,0xFB,0xF0,0x0C,0xDD,0x43,0xBA,0x5B,0x2B,0xE1,0x1F,0x80, -0x70,0x99,0x15,0x57,0x93,0x16,0xF1,0x0F,0x97,0x6A,0xB7,0xC2,0x68,0x23,0x1C,0xCC, -0x4D,0x59,0x30,0xAC,0x51,0x1E,0x3B,0xAF,0x2B,0xD6,0xEE,0x63,0x45,0x7B,0xC5,0xD9, -0x5F,0x50,0xD2,0xE3,0x50,0x0F,0x3A,0x88,0xE7,0xBF,0x14,0xFD,0xE0,0xC7,0xB9,0x02, -0x03,0x01,0x00,0x01,0xA3,0x82,0x01,0x09,0x30,0x82,0x01,0x05,0x30,0x70,0x06,0x03, -0x55,0x1D,0x1F,0x04,0x69,0x30,0x67,0x30,0x65,0xA0,0x63,0xA0,0x61,0xA4,0x5F,0x30, -0x5D,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x10, -0x30,0x0E,0x06,0x03,0x55,0x04,0x0A,0x13,0x07,0x45,0x71,0x75,0x69,0x66,0x61,0x78, -0x31,0x2D,0x30,0x2B,0x06,0x03,0x55,0x04,0x0B,0x13,0x24,0x45,0x71,0x75,0x69,0x66, -0x61,0x78,0x20,0x53,0x65,0x63,0x75,0x72,0x65,0x20,0x43,0x65,0x72,0x74,0x69,0x66, -0x69,0x63,0x61,0x74,0x65,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x31, -0x0D,0x30,0x0B,0x06,0x03,0x55,0x04,0x03,0x13,0x04,0x43,0x52,0x4C,0x31,0x30,0x1A, -0x06,0x03,0x55,0x1D,0x10,0x04,0x13,0x30,0x11,0x81,0x0F,0x32,0x30,0x31,0x38,0x30, -0x38,0x32,0x32,0x31,0x36,0x34,0x31,0x35,0x31,0x5A,0x30,0x0B,0x06,0x03,0x55,0x1D, -0x0F,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18, -0x30,0x16,0x80,0x14,0x48,0xE6,0x68,0xF9,0x2B,0xD2,0xB2,0x95,0xD7,0x47,0xD8,0x23, -0x20,0x10,0x4F,0x33,0x98,0x90,0x9F,0xD4,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04, -0x16,0x04,0x14,0x48,0xE6,0x68,0xF9,0x2B,0xD2,0xB2,0x95,0xD7,0x47,0xD8,0x23,0x20, -0x10,0x4F,0x33,0x98,0x90,0x9F,0xD4,0x30,0x0C,0x06,0x03,0x55,0x1D,0x13,0x04,0x05, -0x30,0x03,0x01,0x01,0xFF,0x30,0x1A,0x06,0x09,0x2A,0x86,0x48,0x86,0xF6,0x7D,0x07, -0x41,0x00,0x04,0x0D,0x30,0x0B,0x1B,0x05,0x56,0x33,0x2E,0x30,0x63,0x03,0x02,0x06, -0xC0,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00, -0x03,0x81,0x81,0x00,0x58,0xCE,0x29,0xEA,0xFC,0xF7,0xDE,0xB5,0xCE,0x02,0xB9,0x17, -0xB5,0x85,0xD1,0xB9,0xE3,0xE0,0x95,0xCC,0x25,0x31,0x0D,0x00,0xA6,0x92,0x6E,0x7F, -0xB6,0x92,0x63,0x9E,0x50,0x95,0xD1,0x9A,0x6F,0xE4,0x11,0xDE,0x63,0x85,0x6E,0x98, -0xEE,0xA8,0xFF,0x5A,0xC8,0xD3,0x55,0xB2,0x66,0x71,0x57,0xDE,0xC0,0x21,0xEB,0x3D, -0x2A,0xA7,0x23,0x49,0x01,0x04,0x86,0x42,0x7B,0xFC,0xEE,0x7F,0xA2,0x16,0x52,0xB5, -0x67,0x67,0xD3,0x40,0xDB,0x3B,0x26,0x58,0xB2,0x28,0x77,0x3D,0xAE,0x14,0x77,0x61, -0xD6,0xFA,0x2A,0x66,0x27,0xA0,0x0D,0xFA,0xA7,0x73,0x5C,0xEA,0x70,0xF1,0x94,0x21, -0x65,0x44,0x5F,0xFA,0xFC,0xEF,0x29,0x68,0xA9,0xA2,0x87,0x79,0xEF,0x79,0xEF,0x4F, -0xAC,0x07,0x77,0x38, -}; - - -/* subject:/C=US/O=Equifax Secure Inc./CN=Equifax Secure eBusiness CA-1 */ -/* issuer :/C=US/O=Equifax Secure Inc./CN=Equifax Secure eBusiness CA-1 */ - - -const unsigned char Equifax_Secure_eBusiness_CA_1_certificate[646]={ -0x30,0x82,0x02,0x82,0x30,0x82,0x01,0xEB,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x04, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x04,0x05,0x00,0x30, -0x53,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x1C, -0x30,0x1A,0x06,0x03,0x55,0x04,0x0A,0x13,0x13,0x45,0x71,0x75,0x69,0x66,0x61,0x78, -0x20,0x53,0x65,0x63,0x75,0x72,0x65,0x20,0x49,0x6E,0x63,0x2E,0x31,0x26,0x30,0x24, -0x06,0x03,0x55,0x04,0x03,0x13,0x1D,0x45,0x71,0x75,0x69,0x66,0x61,0x78,0x20,0x53, -0x65,0x63,0x75,0x72,0x65,0x20,0x65,0x42,0x75,0x73,0x69,0x6E,0x65,0x73,0x73,0x20, -0x43,0x41,0x2D,0x31,0x30,0x1E,0x17,0x0D,0x39,0x39,0x30,0x36,0x32,0x31,0x30,0x34, -0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x32,0x30,0x30,0x36,0x32,0x31,0x30,0x34,0x30, -0x30,0x30,0x30,0x5A,0x30,0x53,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13, -0x02,0x55,0x53,0x31,0x1C,0x30,0x1A,0x06,0x03,0x55,0x04,0x0A,0x13,0x13,0x45,0x71, -0x75,0x69,0x66,0x61,0x78,0x20,0x53,0x65,0x63,0x75,0x72,0x65,0x20,0x49,0x6E,0x63, -0x2E,0x31,0x26,0x30,0x24,0x06,0x03,0x55,0x04,0x03,0x13,0x1D,0x45,0x71,0x75,0x69, -0x66,0x61,0x78,0x20,0x53,0x65,0x63,0x75,0x72,0x65,0x20,0x65,0x42,0x75,0x73,0x69, -0x6E,0x65,0x73,0x73,0x20,0x43,0x41,0x2D,0x31,0x30,0x81,0x9F,0x30,0x0D,0x06,0x09, -0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x81,0x8D,0x00,0x30, -0x81,0x89,0x02,0x81,0x81,0x00,0xCE,0x2F,0x19,0xBC,0x17,0xB7,0x77,0xDE,0x93,0xA9, -0x5F,0x5A,0x0D,0x17,0x4F,0x34,0x1A,0x0C,0x98,0xF4,0x22,0xD9,0x59,0xD4,0xC4,0x68, -0x46,0xF0,0xB4,0x35,0xC5,0x85,0x03,0x20,0xC6,0xAF,0x45,0xA5,0x21,0x51,0x45,0x41, -0xEB,0x16,0x58,0x36,0x32,0x6F,0xE2,0x50,0x62,0x64,0xF9,0xFD,0x51,0x9C,0xAA,0x24, -0xD9,0xF4,0x9D,0x83,0x2A,0x87,0x0A,0x21,0xD3,0x12,0x38,0x34,0x6C,0x8D,0x00,0x6E, -0x5A,0xA0,0xD9,0x42,0xEE,0x1A,0x21,0x95,0xF9,0x52,0x4C,0x55,0x5A,0xC5,0x0F,0x38, -0x4F,0x46,0xFA,0x6D,0xF8,0x2E,0x35,0xD6,0x1D,0x7C,0xEB,0xE2,0xF0,0xB0,0x75,0x80, -0xC8,0xA9,0x13,0xAC,0xBE,0x88,0xEF,0x3A,0x6E,0xAB,0x5F,0x2A,0x38,0x62,0x02,0xB0, -0x12,0x7B,0xFE,0x8F,0xA6,0x03,0x02,0x03,0x01,0x00,0x01,0xA3,0x66,0x30,0x64,0x30, -0x11,0x06,0x09,0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x01,0x04,0x04,0x03,0x02, -0x00,0x07,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03, -0x01,0x01,0xFF,0x30,0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18,0x30,0x16,0x80,0x14, -0x4A,0x78,0x32,0x52,0x11,0xDB,0x59,0x16,0x36,0x5E,0xDF,0xC1,0x14,0x36,0x40,0x6A, -0x47,0x7C,0x4C,0xA1,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x4A, -0x78,0x32,0x52,0x11,0xDB,0x59,0x16,0x36,0x5E,0xDF,0xC1,0x14,0x36,0x40,0x6A,0x47, -0x7C,0x4C,0xA1,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x04, -0x05,0x00,0x03,0x81,0x81,0x00,0x75,0x5B,0xA8,0x9B,0x03,0x11,0xE6,0xE9,0x56,0x4C, -0xCD,0xF9,0xA9,0x4C,0xC0,0x0D,0x9A,0xF3,0xCC,0x65,0x69,0xE6,0x25,0x76,0xCC,0x59, -0xB7,0xD6,0x54,0xC3,0x1D,0xCD,0x99,0xAC,0x19,0xDD,0xB4,0x85,0xD5,0xE0,0x3D,0xFC, -0x62,0x20,0xA7,0x84,0x4B,0x58,0x65,0xF1,0xE2,0xF9,0x95,0x21,0x3F,0xF5,0xD4,0x7E, -0x58,0x1E,0x47,0x87,0x54,0x3E,0x58,0xA1,0xB5,0xB5,0xF8,0x2A,0xEF,0x71,0xE7,0xBC, -0xC3,0xF6,0xB1,0x49,0x46,0xE2,0xD7,0xA0,0x6B,0xE5,0x56,0x7A,0x9A,0x27,0x98,0x7C, -0x46,0x62,0x14,0xE7,0xC9,0xFC,0x6E,0x03,0x12,0x79,0x80,0x38,0x1D,0x48,0x82,0x8D, -0xFC,0x17,0xFE,0x2A,0x96,0x2B,0xB5,0x62,0xA6,0xA6,0x3D,0xBD,0x7F,0x92,0x59,0xCD, -0x5A,0x2A,0x82,0xB2,0x37,0x79, -}; - - -/* subject:/C=US/O=Equifax Secure/OU=Equifax Secure eBusiness CA-2 */ -/* issuer :/C=US/O=Equifax Secure/OU=Equifax Secure eBusiness CA-2 */ - - -const unsigned char Equifax_Secure_eBusiness_CA_2_certificate[804]={ -0x30,0x82,0x03,0x20,0x30,0x82,0x02,0x89,0xA0,0x03,0x02,0x01,0x02,0x02,0x04,0x37, -0x70,0xCF,0xB5,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05, -0x05,0x00,0x30,0x4E,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55, -0x53,0x31,0x17,0x30,0x15,0x06,0x03,0x55,0x04,0x0A,0x13,0x0E,0x45,0x71,0x75,0x69, -0x66,0x61,0x78,0x20,0x53,0x65,0x63,0x75,0x72,0x65,0x31,0x26,0x30,0x24,0x06,0x03, -0x55,0x04,0x0B,0x13,0x1D,0x45,0x71,0x75,0x69,0x66,0x61,0x78,0x20,0x53,0x65,0x63, -0x75,0x72,0x65,0x20,0x65,0x42,0x75,0x73,0x69,0x6E,0x65,0x73,0x73,0x20,0x43,0x41, -0x2D,0x32,0x30,0x1E,0x17,0x0D,0x39,0x39,0x30,0x36,0x32,0x33,0x31,0x32,0x31,0x34, -0x34,0x35,0x5A,0x17,0x0D,0x31,0x39,0x30,0x36,0x32,0x33,0x31,0x32,0x31,0x34,0x34, -0x35,0x5A,0x30,0x4E,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55, -0x53,0x31,0x17,0x30,0x15,0x06,0x03,0x55,0x04,0x0A,0x13,0x0E,0x45,0x71,0x75,0x69, -0x66,0x61,0x78,0x20,0x53,0x65,0x63,0x75,0x72,0x65,0x31,0x26,0x30,0x24,0x06,0x03, -0x55,0x04,0x0B,0x13,0x1D,0x45,0x71,0x75,0x69,0x66,0x61,0x78,0x20,0x53,0x65,0x63, -0x75,0x72,0x65,0x20,0x65,0x42,0x75,0x73,0x69,0x6E,0x65,0x73,0x73,0x20,0x43,0x41, -0x2D,0x32,0x30,0x81,0x9F,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, -0x01,0x01,0x05,0x00,0x03,0x81,0x8D,0x00,0x30,0x81,0x89,0x02,0x81,0x81,0x00,0xE4, -0x39,0x39,0x93,0x1E,0x52,0x06,0x1B,0x28,0x36,0xF8,0xB2,0xA3,0x29,0xC5,0xED,0x8E, -0xB2,0x11,0xBD,0xFE,0xEB,0xE7,0xB4,0x74,0xC2,0x8F,0xFF,0x05,0xE7,0xD9,0x9D,0x06, -0xBF,0x12,0xC8,0x3F,0x0E,0xF2,0xD6,0xD1,0x24,0xB2,0x11,0xDE,0xD1,0x73,0x09,0x8A, -0xD4,0xB1,0x2C,0x98,0x09,0x0D,0x1E,0x50,0x46,0xB2,0x83,0xA6,0x45,0x8D,0x62,0x68, -0xBB,0x85,0x1B,0x20,0x70,0x32,0xAA,0x40,0xCD,0xA6,0x96,0x5F,0xC4,0x71,0x37,0x3F, -0x04,0xF3,0xB7,0x41,0x24,0x39,0x07,0x1A,0x1E,0x2E,0x61,0x58,0xA0,0x12,0x0B,0xE5, -0xA5,0xDF,0xC5,0xAB,0xEA,0x37,0x71,0xCC,0x1C,0xC8,0x37,0x3A,0xB9,0x97,0x52,0xA7, -0xAC,0xC5,0x6A,0x24,0x94,0x4E,0x9C,0x7B,0xCF,0xC0,0x6A,0xD6,0xDF,0x21,0xBD,0x02, -0x03,0x01,0x00,0x01,0xA3,0x82,0x01,0x09,0x30,0x82,0x01,0x05,0x30,0x70,0x06,0x03, -0x55,0x1D,0x1F,0x04,0x69,0x30,0x67,0x30,0x65,0xA0,0x63,0xA0,0x61,0xA4,0x5F,0x30, -0x5D,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17, -0x30,0x15,0x06,0x03,0x55,0x04,0x0A,0x13,0x0E,0x45,0x71,0x75,0x69,0x66,0x61,0x78, -0x20,0x53,0x65,0x63,0x75,0x72,0x65,0x31,0x26,0x30,0x24,0x06,0x03,0x55,0x04,0x0B, -0x13,0x1D,0x45,0x71,0x75,0x69,0x66,0x61,0x78,0x20,0x53,0x65,0x63,0x75,0x72,0x65, -0x20,0x65,0x42,0x75,0x73,0x69,0x6E,0x65,0x73,0x73,0x20,0x43,0x41,0x2D,0x32,0x31, -0x0D,0x30,0x0B,0x06,0x03,0x55,0x04,0x03,0x13,0x04,0x43,0x52,0x4C,0x31,0x30,0x1A, -0x06,0x03,0x55,0x1D,0x10,0x04,0x13,0x30,0x11,0x81,0x0F,0x32,0x30,0x31,0x39,0x30, -0x36,0x32,0x33,0x31,0x32,0x31,0x34,0x34,0x35,0x5A,0x30,0x0B,0x06,0x03,0x55,0x1D, -0x0F,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18, -0x30,0x16,0x80,0x14,0x50,0x9E,0x0B,0xEA,0xAF,0x5E,0xB9,0x20,0x48,0xA6,0x50,0x6A, -0xCB,0xFD,0xD8,0x20,0x7A,0xA7,0x82,0x76,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04, -0x16,0x04,0x14,0x50,0x9E,0x0B,0xEA,0xAF,0x5E,0xB9,0x20,0x48,0xA6,0x50,0x6A,0xCB, -0xFD,0xD8,0x20,0x7A,0xA7,0x82,0x76,0x30,0x0C,0x06,0x03,0x55,0x1D,0x13,0x04,0x05, -0x30,0x03,0x01,0x01,0xFF,0x30,0x1A,0x06,0x09,0x2A,0x86,0x48,0x86,0xF6,0x7D,0x07, -0x41,0x00,0x04,0x0D,0x30,0x0B,0x1B,0x05,0x56,0x33,0x2E,0x30,0x63,0x03,0x02,0x06, -0xC0,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00, -0x03,0x81,0x81,0x00,0x0C,0x86,0x82,0xAD,0xE8,0x4E,0x1A,0xF5,0x8E,0x89,0x27,0xE2, -0x35,0x58,0x3D,0x29,0xB4,0x07,0x8F,0x36,0x50,0x95,0xBF,0x6E,0xC1,0x9E,0xEB,0xC4, -0x90,0xB2,0x85,0xA8,0xBB,0xB7,0x42,0xE0,0x0F,0x07,0x39,0xDF,0xFB,0x9E,0x90,0xB2, -0xD1,0xC1,0x3E,0x53,0x9F,0x03,0x44,0xB0,0x7E,0x4B,0xF4,0x6F,0xE4,0x7C,0x1F,0xE7, -0xE2,0xB1,0xE4,0xB8,0x9A,0xEF,0xC3,0xBD,0xCE,0xDE,0x0B,0x32,0x34,0xD9,0xDE,0x28, -0xED,0x33,0x6B,0xC4,0xD4,0xD7,0x3D,0x12,0x58,0xAB,0x7D,0x09,0x2D,0xCB,0x70,0xF5, -0x13,0x8A,0x94,0xA1,0x27,0xA4,0xD6,0x70,0xC5,0x6D,0x94,0xB5,0xC9,0x7D,0x9D,0xA0, -0xD2,0xC6,0x08,0x49,0xD9,0x66,0x9B,0xA6,0xD3,0xF4,0x0B,0xDC,0xC5,0x26,0x57,0xE1, -0x91,0x30,0xEA,0xCD, -}; - - -/* subject:/C=US/O=Equifax Secure Inc./CN=Equifax Secure Global eBusiness CA-1 */ -/* issuer :/C=US/O=Equifax Secure Inc./CN=Equifax Secure Global eBusiness CA-1 */ - - -const unsigned char Equifax_Secure_Global_eBusiness_CA_certificate[660]={ -0x30,0x82,0x02,0x90,0x30,0x82,0x01,0xF9,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x04,0x05,0x00,0x30, -0x5A,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x1C, -0x30,0x1A,0x06,0x03,0x55,0x04,0x0A,0x13,0x13,0x45,0x71,0x75,0x69,0x66,0x61,0x78, -0x20,0x53,0x65,0x63,0x75,0x72,0x65,0x20,0x49,0x6E,0x63,0x2E,0x31,0x2D,0x30,0x2B, -0x06,0x03,0x55,0x04,0x03,0x13,0x24,0x45,0x71,0x75,0x69,0x66,0x61,0x78,0x20,0x53, -0x65,0x63,0x75,0x72,0x65,0x20,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x20,0x65,0x42,0x75, -0x73,0x69,0x6E,0x65,0x73,0x73,0x20,0x43,0x41,0x2D,0x31,0x30,0x1E,0x17,0x0D,0x39, -0x39,0x30,0x36,0x32,0x31,0x30,0x34,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x32,0x30, -0x30,0x36,0x32,0x31,0x30,0x34,0x30,0x30,0x30,0x30,0x5A,0x30,0x5A,0x31,0x0B,0x30, -0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x1C,0x30,0x1A,0x06,0x03, -0x55,0x04,0x0A,0x13,0x13,0x45,0x71,0x75,0x69,0x66,0x61,0x78,0x20,0x53,0x65,0x63, -0x75,0x72,0x65,0x20,0x49,0x6E,0x63,0x2E,0x31,0x2D,0x30,0x2B,0x06,0x03,0x55,0x04, -0x03,0x13,0x24,0x45,0x71,0x75,0x69,0x66,0x61,0x78,0x20,0x53,0x65,0x63,0x75,0x72, -0x65,0x20,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x20,0x65,0x42,0x75,0x73,0x69,0x6E,0x65, -0x73,0x73,0x20,0x43,0x41,0x2D,0x31,0x30,0x81,0x9F,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x81,0x8D,0x00,0x30,0x81,0x89, -0x02,0x81,0x81,0x00,0xBA,0xE7,0x17,0x90,0x02,0x65,0xB1,0x34,0x55,0x3C,0x49,0xC2, -0x51,0xD5,0xDF,0xA7,0xD1,0x37,0x8F,0xD1,0xE7,0x81,0x73,0x41,0x52,0x60,0x9B,0x9D, -0xA1,0x17,0x26,0x78,0xAD,0xC7,0xB1,0xE8,0x26,0x94,0x32,0xB5,0xDE,0x33,0x8D,0x3A, -0x2F,0xDB,0xF2,0x9A,0x7A,0x5A,0x73,0x98,0xA3,0x5C,0xE9,0xFB,0x8A,0x73,0x1B,0x5C, -0xE7,0xC3,0xBF,0x80,0x6C,0xCD,0xA9,0xF4,0xD6,0x2B,0xC0,0xF7,0xF9,0x99,0xAA,0x63, -0xA2,0xB1,0x47,0x02,0x0F,0xD4,0xE4,0x51,0x3A,0x12,0x3C,0x6C,0x8A,0x5A,0x54,0x84, -0x70,0xDB,0xC1,0xC5,0x90,0xCF,0x72,0x45,0xCB,0xA8,0x59,0xC0,0xCD,0x33,0x9D,0x3F, -0xA3,0x96,0xEB,0x85,0x33,0x21,0x1C,0x3E,0x1E,0x3E,0x60,0x6E,0x76,0x9C,0x67,0x85, -0xC5,0xC8,0xC3,0x61,0x02,0x03,0x01,0x00,0x01,0xA3,0x66,0x30,0x64,0x30,0x11,0x06, -0x09,0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x01,0x04,0x04,0x03,0x02,0x00,0x07, -0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01, -0xFF,0x30,0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18,0x30,0x16,0x80,0x14,0xBE,0xA8, -0xA0,0x74,0x72,0x50,0x6B,0x44,0xB7,0xC9,0x23,0xD8,0xFB,0xA8,0xFF,0xB3,0x57,0x6B, -0x68,0x6C,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xBE,0xA8,0xA0, -0x74,0x72,0x50,0x6B,0x44,0xB7,0xC9,0x23,0xD8,0xFB,0xA8,0xFF,0xB3,0x57,0x6B,0x68, -0x6C,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x04,0x05,0x00, -0x03,0x81,0x81,0x00,0x30,0xE2,0x01,0x51,0xAA,0xC7,0xEA,0x5F,0xDA,0xB9,0xD0,0x65, -0x0F,0x30,0xD6,0x3E,0xDA,0x0D,0x14,0x49,0x6E,0x91,0x93,0x27,0x14,0x31,0xEF,0xC4, -0xF7,0x2D,0x45,0xF8,0xEC,0xC7,0xBF,0xA2,0x41,0x0D,0x23,0xB4,0x92,0xF9,0x19,0x00, -0x67,0xBD,0x01,0xAF,0xCD,0xE0,0x71,0xFC,0x5A,0xCF,0x64,0xC4,0xE0,0x96,0x98,0xD0, -0xA3,0x40,0xE2,0x01,0x8A,0xEF,0x27,0x07,0xF1,0x65,0x01,0x8A,0x44,0x2D,0x06,0x65, -0x75,0x52,0xC0,0x86,0x10,0x20,0x21,0x5F,0x6C,0x6B,0x0F,0x6C,0xAE,0x09,0x1C,0xAF, -0xF2,0xA2,0x18,0x34,0xC4,0x75,0xA4,0x73,0x1C,0xF1,0x8D,0xDC,0xEF,0xAD,0xF9,0xB3, -0x76,0xB4,0x92,0xBF,0xDC,0x95,0x10,0x1E,0xBE,0xCB,0xC8,0x3B,0x5A,0x84,0x60,0x19, -0x56,0x94,0xA9,0x55, -}; - - -/* subject:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA */ -/* issuer :/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA */ - - -const unsigned char GeoTrust_Global_CA_certificate[856]={ -0x30,0x82,0x03,0x54,0x30,0x82,0x02,0x3C,0xA0,0x03,0x02,0x01,0x02,0x02,0x03,0x02, -0x34,0x56,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05, -0x00,0x30,0x42,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53, -0x31,0x16,0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D,0x47,0x65,0x6F,0x54,0x72, -0x75,0x73,0x74,0x20,0x49,0x6E,0x63,0x2E,0x31,0x1B,0x30,0x19,0x06,0x03,0x55,0x04, -0x03,0x13,0x12,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x47,0x6C,0x6F,0x62, -0x61,0x6C,0x20,0x43,0x41,0x30,0x1E,0x17,0x0D,0x30,0x32,0x30,0x35,0x32,0x31,0x30, -0x34,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x32,0x32,0x30,0x35,0x32,0x31,0x30,0x34, -0x30,0x30,0x30,0x30,0x5A,0x30,0x42,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06, -0x13,0x02,0x55,0x53,0x31,0x16,0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D,0x47, -0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x49,0x6E,0x63,0x2E,0x31,0x1B,0x30,0x19, -0x06,0x03,0x55,0x04,0x03,0x13,0x12,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20, -0x47,0x6C,0x6F,0x62,0x61,0x6C,0x20,0x43,0x41,0x30,0x82,0x01,0x22,0x30,0x0D,0x06, -0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F, -0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xDA,0xCC,0x18,0x63,0x30,0xFD, -0xF4,0x17,0x23,0x1A,0x56,0x7E,0x5B,0xDF,0x3C,0x6C,0x38,0xE4,0x71,0xB7,0x78,0x91, -0xD4,0xBC,0xA1,0xD8,0x4C,0xF8,0xA8,0x43,0xB6,0x03,0xE9,0x4D,0x21,0x07,0x08,0x88, -0xDA,0x58,0x2F,0x66,0x39,0x29,0xBD,0x05,0x78,0x8B,0x9D,0x38,0xE8,0x05,0xB7,0x6A, -0x7E,0x71,0xA4,0xE6,0xC4,0x60,0xA6,0xB0,0xEF,0x80,0xE4,0x89,0x28,0x0F,0x9E,0x25, -0xD6,0xED,0x83,0xF3,0xAD,0xA6,0x91,0xC7,0x98,0xC9,0x42,0x18,0x35,0x14,0x9D,0xAD, -0x98,0x46,0x92,0x2E,0x4F,0xCA,0xF1,0x87,0x43,0xC1,0x16,0x95,0x57,0x2D,0x50,0xEF, -0x89,0x2D,0x80,0x7A,0x57,0xAD,0xF2,0xEE,0x5F,0x6B,0xD2,0x00,0x8D,0xB9,0x14,0xF8, -0x14,0x15,0x35,0xD9,0xC0,0x46,0xA3,0x7B,0x72,0xC8,0x91,0xBF,0xC9,0x55,0x2B,0xCD, -0xD0,0x97,0x3E,0x9C,0x26,0x64,0xCC,0xDF,0xCE,0x83,0x19,0x71,0xCA,0x4E,0xE6,0xD4, -0xD5,0x7B,0xA9,0x19,0xCD,0x55,0xDE,0xC8,0xEC,0xD2,0x5E,0x38,0x53,0xE5,0x5C,0x4F, -0x8C,0x2D,0xFE,0x50,0x23,0x36,0xFC,0x66,0xE6,0xCB,0x8E,0xA4,0x39,0x19,0x00,0xB7, -0x95,0x02,0x39,0x91,0x0B,0x0E,0xFE,0x38,0x2E,0xD1,0x1D,0x05,0x9A,0xF6,0x4D,0x3E, -0x6F,0x0F,0x07,0x1D,0xAF,0x2C,0x1E,0x8F,0x60,0x39,0xE2,0xFA,0x36,0x53,0x13,0x39, -0xD4,0x5E,0x26,0x2B,0xDB,0x3D,0xA8,0x14,0xBD,0x32,0xEB,0x18,0x03,0x28,0x52,0x04, -0x71,0xE5,0xAB,0x33,0x3D,0xE1,0x38,0xBB,0x07,0x36,0x84,0x62,0x9C,0x79,0xEA,0x16, -0x30,0xF4,0x5F,0xC0,0x2B,0xE8,0x71,0x6B,0xE4,0xF9,0x02,0x03,0x01,0x00,0x01,0xA3, -0x53,0x30,0x51,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30, -0x03,0x01,0x01,0xFF,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xC0, -0x7A,0x98,0x68,0x8D,0x89,0xFB,0xAB,0x05,0x64,0x0C,0x11,0x7D,0xAA,0x7D,0x65,0xB8, -0xCA,0xCC,0x4E,0x30,0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18,0x30,0x16,0x80,0x14, -0xC0,0x7A,0x98,0x68,0x8D,0x89,0xFB,0xAB,0x05,0x64,0x0C,0x11,0x7D,0xAA,0x7D,0x65, -0xB8,0xCA,0xCC,0x4E,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01, -0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x35,0xE3,0x29,0x6A,0xE5,0x2F,0x5D,0x54, -0x8E,0x29,0x50,0x94,0x9F,0x99,0x1A,0x14,0xE4,0x8F,0x78,0x2A,0x62,0x94,0xA2,0x27, -0x67,0x9E,0xD0,0xCF,0x1A,0x5E,0x47,0xE9,0xC1,0xB2,0xA4,0xCF,0xDD,0x41,0x1A,0x05, -0x4E,0x9B,0x4B,0xEE,0x4A,0x6F,0x55,0x52,0xB3,0x24,0xA1,0x37,0x0A,0xEB,0x64,0x76, -0x2A,0x2E,0x2C,0xF3,0xFD,0x3B,0x75,0x90,0xBF,0xFA,0x71,0xD8,0xC7,0x3D,0x37,0xD2, -0xB5,0x05,0x95,0x62,0xB9,0xA6,0xDE,0x89,0x3D,0x36,0x7B,0x38,0x77,0x48,0x97,0xAC, -0xA6,0x20,0x8F,0x2E,0xA6,0xC9,0x0C,0xC2,0xB2,0x99,0x45,0x00,0xC7,0xCE,0x11,0x51, -0x22,0x22,0xE0,0xA5,0xEA,0xB6,0x15,0x48,0x09,0x64,0xEA,0x5E,0x4F,0x74,0xF7,0x05, -0x3E,0xC7,0x8A,0x52,0x0C,0xDB,0x15,0xB4,0xBD,0x6D,0x9B,0xE5,0xC6,0xB1,0x54,0x68, -0xA9,0xE3,0x69,0x90,0xB6,0x9A,0xA5,0x0F,0xB8,0xB9,0x3F,0x20,0x7D,0xAE,0x4A,0xB5, -0xB8,0x9C,0xE4,0x1D,0xB6,0xAB,0xE6,0x94,0xA5,0xC1,0xC7,0x83,0xAD,0xDB,0xF5,0x27, -0x87,0x0E,0x04,0x6C,0xD5,0xFF,0xDD,0xA0,0x5D,0xED,0x87,0x52,0xB7,0x2B,0x15,0x02, -0xAE,0x39,0xA6,0x6A,0x74,0xE9,0xDA,0xC4,0xE7,0xBC,0x4D,0x34,0x1E,0xA9,0x5C,0x4D, -0x33,0x5F,0x92,0x09,0x2F,0x88,0x66,0x5D,0x77,0x97,0xC7,0x1D,0x76,0x13,0xA9,0xD5, -0xE5,0xF1,0x16,0x09,0x11,0x35,0xD5,0xAC,0xDB,0x24,0x71,0x70,0x2C,0x98,0x56,0x0B, -0xD9,0x17,0xB4,0xD1,0xE3,0x51,0x2B,0x5E,0x75,0xE8,0xD5,0xD0,0xDC,0x4F,0x34,0xED, -0xC2,0x05,0x66,0x80,0xA1,0xCB,0xE6,0x33, -}; - - -/* subject:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA 2 */ -/* issuer :/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA 2 */ - - -const unsigned char GeoTrust_Global_CA_2_certificate[874]={ -0x30,0x82,0x03,0x66,0x30,0x82,0x02,0x4E,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x44,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x16, -0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73, -0x74,0x20,0x49,0x6E,0x63,0x2E,0x31,0x1D,0x30,0x1B,0x06,0x03,0x55,0x04,0x03,0x13, -0x14,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x47,0x6C,0x6F,0x62,0x61,0x6C, -0x20,0x43,0x41,0x20,0x32,0x30,0x1E,0x17,0x0D,0x30,0x34,0x30,0x33,0x30,0x34,0x30, -0x35,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x31,0x39,0x30,0x33,0x30,0x34,0x30,0x35, -0x30,0x30,0x30,0x30,0x5A,0x30,0x44,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06, -0x13,0x02,0x55,0x53,0x31,0x16,0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D,0x47, -0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x49,0x6E,0x63,0x2E,0x31,0x1D,0x30,0x1B, -0x06,0x03,0x55,0x04,0x03,0x13,0x14,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20, -0x47,0x6C,0x6F,0x62,0x61,0x6C,0x20,0x43,0x41,0x20,0x32,0x30,0x82,0x01,0x22,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82, -0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xEF,0x3C,0x4D,0x40, -0x3D,0x10,0xDF,0x3B,0x53,0x00,0xE1,0x67,0xFE,0x94,0x60,0x15,0x3E,0x85,0x88,0xF1, -0x89,0x0D,0x90,0xC8,0x28,0x23,0x99,0x05,0xE8,0x2B,0x20,0x9D,0xC6,0xF3,0x60,0x46, -0xD8,0xC1,0xB2,0xD5,0x8C,0x31,0xD9,0xDC,0x20,0x79,0x24,0x81,0xBF,0x35,0x32,0xFC, -0x63,0x69,0xDB,0xB1,0x2A,0x6B,0xEE,0x21,0x58,0xF2,0x08,0xE9,0x78,0xCB,0x6F,0xCB, -0xFC,0x16,0x52,0xC8,0x91,0xC4,0xFF,0x3D,0x73,0xDE,0xB1,0x3E,0xA7,0xC2,0x7D,0x66, -0xC1,0xF5,0x7E,0x52,0x24,0x1A,0xE2,0xD5,0x67,0x91,0xD0,0x82,0x10,0xD7,0x78,0x4B, -0x4F,0x2B,0x42,0x39,0xBD,0x64,0x2D,0x40,0xA0,0xB0,0x10,0xD3,0x38,0x48,0x46,0x88, -0xA1,0x0C,0xBB,0x3A,0x33,0x2A,0x62,0x98,0xFB,0x00,0x9D,0x13,0x59,0x7F,0x6F,0x3B, -0x72,0xAA,0xEE,0xA6,0x0F,0x86,0xF9,0x05,0x61,0xEA,0x67,0x7F,0x0C,0x37,0x96,0x8B, -0xE6,0x69,0x16,0x47,0x11,0xC2,0x27,0x59,0x03,0xB3,0xA6,0x60,0xC2,0x21,0x40,0x56, -0xFA,0xA0,0xC7,0x7D,0x3A,0x13,0xE3,0xEC,0x57,0xC7,0xB3,0xD6,0xAE,0x9D,0x89,0x80, -0xF7,0x01,0xE7,0x2C,0xF6,0x96,0x2B,0x13,0x0D,0x79,0x2C,0xD9,0xC0,0xE4,0x86,0x7B, -0x4B,0x8C,0x0C,0x72,0x82,0x8A,0xFB,0x17,0xCD,0x00,0x6C,0x3A,0x13,0x3C,0xB0,0x84, -0x87,0x4B,0x16,0x7A,0x29,0xB2,0x4F,0xDB,0x1D,0xD4,0x0B,0xF3,0x66,0x37,0xBD,0xD8, -0xF6,0x57,0xBB,0x5E,0x24,0x7A,0xB8,0x3C,0x8B,0xB9,0xFA,0x92,0x1A,0x1A,0x84,0x9E, -0xD8,0x74,0x8F,0xAA,0x1B,0x7F,0x5E,0xF4,0xFE,0x45,0x22,0x21,0x02,0x03,0x01,0x00, -0x01,0xA3,0x63,0x30,0x61,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04, -0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04, -0x14,0x71,0x38,0x36,0xF2,0x02,0x31,0x53,0x47,0x2B,0x6E,0xBA,0x65,0x46,0xA9,0x10, -0x15,0x58,0x20,0x05,0x09,0x30,0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18,0x30,0x16, -0x80,0x14,0x71,0x38,0x36,0xF2,0x02,0x31,0x53,0x47,0x2B,0x6E,0xBA,0x65,0x46,0xA9, -0x10,0x15,0x58,0x20,0x05,0x09,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF, -0x04,0x04,0x03,0x02,0x01,0x86,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D, -0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x03,0xF7,0xB5,0x2B,0xAB,0x5D, -0x10,0xFC,0x7B,0xB2,0xB2,0x5E,0xAC,0x9B,0x0E,0x7E,0x53,0x78,0x59,0x3E,0x42,0x04, -0xFE,0x75,0xA3,0xAD,0xAC,0x81,0x4E,0xD7,0x02,0x8B,0x5E,0xC4,0x2D,0xC8,0x52,0x76, -0xC7,0x2C,0x1F,0xFC,0x81,0x32,0x98,0xD1,0x4B,0xC6,0x92,0x93,0x33,0x35,0x31,0x2F, -0xFC,0xD8,0x1D,0x44,0xDD,0xE0,0x81,0x7F,0x9D,0xE9,0x8B,0xE1,0x64,0x91,0x62,0x0B, -0x39,0x08,0x8C,0xAC,0x74,0x9D,0x59,0xD9,0x7A,0x59,0x52,0x97,0x11,0xB9,0x16,0x7B, -0x6F,0x45,0xD3,0x96,0xD9,0x31,0x7D,0x02,0x36,0x0F,0x9C,0x3B,0x6E,0xCF,0x2C,0x0D, -0x03,0x46,0x45,0xEB,0xA0,0xF4,0x7F,0x48,0x44,0xC6,0x08,0x40,0xCC,0xDE,0x1B,0x70, -0xB5,0x29,0xAD,0xBA,0x8B,0x3B,0x34,0x65,0x75,0x1B,0x71,0x21,0x1D,0x2C,0x14,0x0A, -0xB0,0x96,0x95,0xB8,0xD6,0xEA,0xF2,0x65,0xFB,0x29,0xBA,0x4F,0xEA,0x91,0x93,0x74, -0x69,0xB6,0xF2,0xFF,0xE1,0x1A,0xD0,0x0C,0xD1,0x76,0x85,0xCB,0x8A,0x25,0xBD,0x97, -0x5E,0x2C,0x6F,0x15,0x99,0x26,0xE7,0xB6,0x29,0xFF,0x22,0xEC,0xC9,0x02,0xC7,0x56, -0x00,0xCD,0x49,0xB9,0xB3,0x6C,0x7B,0x53,0x04,0x1A,0xE2,0xA8,0xC9,0xAA,0x12,0x05, -0x23,0xC2,0xCE,0xE7,0xBB,0x04,0x02,0xCC,0xC0,0x47,0xA2,0xE4,0xC4,0x29,0x2F,0x5B, -0x45,0x57,0x89,0x51,0xEE,0x3C,0xEB,0x52,0x08,0xFF,0x07,0x35,0x1E,0x9F,0x35,0x6A, -0x47,0x4A,0x56,0x98,0xD1,0x5A,0x85,0x1F,0x8C,0xF5,0x22,0xBF,0xAB,0xCE,0x83,0xF3, -0xE2,0x22,0x29,0xAE,0x7D,0x83,0x40,0xA8,0xBA,0x6C, -}; - - -/* subject:/C=US/O=GeoTrust Inc./CN=GeoTrust Primary Certification Authority */ -/* issuer :/C=US/O=GeoTrust Inc./CN=GeoTrust Primary Certification Authority */ - - -const unsigned char GeoTrust_Primary_Certification_Authority_certificate[896]={ -0x30,0x82,0x03,0x7C,0x30,0x82,0x02,0x64,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x18, -0xAC,0xB5,0x6A,0xFD,0x69,0xB6,0x15,0x3A,0x63,0x6C,0xAF,0xDA,0xFA,0xC4,0xA1,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x58, -0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x16,0x30, -0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74, -0x20,0x49,0x6E,0x63,0x2E,0x31,0x31,0x30,0x2F,0x06,0x03,0x55,0x04,0x03,0x13,0x28, -0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x50,0x72,0x69,0x6D,0x61,0x72,0x79, -0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41, -0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x1E,0x17,0x0D,0x30,0x36,0x31,0x31, -0x32,0x37,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x36,0x30,0x37,0x31, -0x36,0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x58,0x31,0x0B,0x30,0x09,0x06,0x03, -0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x16,0x30,0x14,0x06,0x03,0x55,0x04,0x0A, -0x13,0x0D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x49,0x6E,0x63,0x2E,0x31, -0x31,0x30,0x2F,0x06,0x03,0x55,0x04,0x03,0x13,0x28,0x47,0x65,0x6F,0x54,0x72,0x75, -0x73,0x74,0x20,0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74,0x69, -0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69, -0x74,0x79,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D, -0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82, -0x01,0x01,0x00,0xBE,0xB8,0x15,0x7B,0xFF,0xD4,0x7C,0x7D,0x67,0xAD,0x83,0x64,0x7B, -0xC8,0x42,0x53,0x2D,0xDF,0xF6,0x84,0x08,0x20,0x61,0xD6,0x01,0x59,0x6A,0x9C,0x44, -0x11,0xAF,0xEF,0x76,0xFD,0x95,0x7E,0xCE,0x61,0x30,0xBB,0x7A,0x83,0x5F,0x02,0xBD, -0x01,0x66,0xCA,0xEE,0x15,0x8D,0x6F,0xA1,0x30,0x9C,0xBD,0xA1,0x85,0x9E,0x94,0x3A, -0xF3,0x56,0x88,0x00,0x31,0xCF,0xD8,0xEE,0x6A,0x96,0x02,0xD9,0xED,0x03,0x8C,0xFB, -0x75,0x6D,0xE7,0xEA,0xB8,0x55,0x16,0x05,0x16,0x9A,0xF4,0xE0,0x5E,0xB1,0x88,0xC0, -0x64,0x85,0x5C,0x15,0x4D,0x88,0xC7,0xB7,0xBA,0xE0,0x75,0xE9,0xAD,0x05,0x3D,0x9D, -0xC7,0x89,0x48,0xE0,0xBB,0x28,0xC8,0x03,0xE1,0x30,0x93,0x64,0x5E,0x52,0xC0,0x59, -0x70,0x22,0x35,0x57,0x88,0x8A,0xF1,0x95,0x0A,0x83,0xD7,0xBC,0x31,0x73,0x01,0x34, -0xED,0xEF,0x46,0x71,0xE0,0x6B,0x02,0xA8,0x35,0x72,0x6B,0x97,0x9B,0x66,0xE0,0xCB, -0x1C,0x79,0x5F,0xD8,0x1A,0x04,0x68,0x1E,0x47,0x02,0xE6,0x9D,0x60,0xE2,0x36,0x97, -0x01,0xDF,0xCE,0x35,0x92,0xDF,0xBE,0x67,0xC7,0x6D,0x77,0x59,0x3B,0x8F,0x9D,0xD6, -0x90,0x15,0x94,0xBC,0x42,0x34,0x10,0xC1,0x39,0xF9,0xB1,0x27,0x3E,0x7E,0xD6,0x8A, -0x75,0xC5,0xB2,0xAF,0x96,0xD3,0xA2,0xDE,0x9B,0xE4,0x98,0xBE,0x7D,0xE1,0xE9,0x81, -0xAD,0xB6,0x6F,0xFC,0xD7,0x0E,0xDA,0xE0,0x34,0xB0,0x0D,0x1A,0x77,0xE7,0xE3,0x08, -0x98,0xEF,0x58,0xFA,0x9C,0x84,0xB7,0x36,0xAF,0xC2,0xDF,0xAC,0xD2,0xF4,0x10,0x06, -0x70,0x71,0x35,0x02,0x03,0x01,0x00,0x01,0xA3,0x42,0x30,0x40,0x30,0x0F,0x06,0x03, -0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06, -0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x1D,0x06, -0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x2C,0xD5,0x50,0x41,0x97,0x15,0x8B,0xF0, -0x8F,0x36,0x61,0x5B,0x4A,0xFB,0x6B,0xD9,0x99,0xC9,0x33,0x92,0x30,0x0D,0x06,0x09, -0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00, -0x5A,0x70,0x7F,0x2C,0xDD,0xB7,0x34,0x4F,0xF5,0x86,0x51,0xA9,0x26,0xBE,0x4B,0xB8, -0xAA,0xF1,0x71,0x0D,0xDC,0x61,0xC7,0xA0,0xEA,0x34,0x1E,0x7A,0x77,0x0F,0x04,0x35, -0xE8,0x27,0x8F,0x6C,0x90,0xBF,0x91,0x16,0x24,0x46,0x3E,0x4A,0x4E,0xCE,0x2B,0x16, -0xD5,0x0B,0x52,0x1D,0xFC,0x1F,0x67,0xA2,0x02,0x45,0x31,0x4F,0xCE,0xF3,0xFA,0x03, -0xA7,0x79,0x9D,0x53,0x6A,0xD9,0xDA,0x63,0x3A,0xF8,0x80,0xD7,0xD3,0x99,0xE1,0xA5, -0xE1,0xBE,0xD4,0x55,0x71,0x98,0x35,0x3A,0xBE,0x93,0xEA,0xAE,0xAD,0x42,0xB2,0x90, -0x6F,0xE0,0xFC,0x21,0x4D,0x35,0x63,0x33,0x89,0x49,0xD6,0x9B,0x4E,0xCA,0xC7,0xE7, -0x4E,0x09,0x00,0xF7,0xDA,0xC7,0xEF,0x99,0x62,0x99,0x77,0xB6,0x95,0x22,0x5E,0x8A, -0xA0,0xAB,0xF4,0xB8,0x78,0x98,0xCA,0x38,0x19,0x99,0xC9,0x72,0x9E,0x78,0xCD,0x4B, -0xAC,0xAF,0x19,0xA0,0x73,0x12,0x2D,0xFC,0xC2,0x41,0xBA,0x81,0x91,0xDA,0x16,0x5A, -0x31,0xB7,0xF9,0xB4,0x71,0x80,0x12,0x48,0x99,0x72,0x73,0x5A,0x59,0x53,0xC1,0x63, -0x52,0x33,0xED,0xA7,0xC9,0xD2,0x39,0x02,0x70,0xFA,0xE0,0xB1,0x42,0x66,0x29,0xAA, -0x9B,0x51,0xED,0x30,0x54,0x22,0x14,0x5F,0xD9,0xAB,0x1D,0xC1,0xE4,0x94,0xF0,0xF8, -0xF5,0x2B,0xF7,0xEA,0xCA,0x78,0x46,0xD6,0xB8,0x91,0xFD,0xA6,0x0D,0x2B,0x1A,0x14, -0x01,0x3E,0x80,0xF0,0x42,0xA0,0x95,0x07,0x5E,0x6D,0xCD,0xCC,0x4B,0xA4,0x45,0x8D, -0xAB,0x12,0xE8,0xB3,0xDE,0x5A,0xE5,0xA0,0x7C,0xE8,0x0F,0x22,0x1D,0x5A,0xE9,0x59, -}; - - -/* subject:/C=US/O=GeoTrust Inc./OU=(c) 2007 GeoTrust Inc. - For authorized use only/CN=GeoTrust Primary Certification Authority - G2 */ -/* issuer :/C=US/O=GeoTrust Inc./OU=(c) 2007 GeoTrust Inc. - For authorized use only/CN=GeoTrust Primary Certification Authority - G2 */ - - -const unsigned char GeoTrust_Primary_Certification_Authority___G2_certificate[690]={ -0x30,0x82,0x02,0xAE,0x30,0x82,0x02,0x35,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x3C, -0xB2,0xF4,0x48,0x0A,0x00,0xE2,0xFE,0xEB,0x24,0x3B,0x5E,0x60,0x3E,0xC3,0x6B,0x30, -0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,0x30,0x81,0x98,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x16,0x30,0x14,0x06, -0x03,0x55,0x04,0x0A,0x13,0x0D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x49, -0x6E,0x63,0x2E,0x31,0x39,0x30,0x37,0x06,0x03,0x55,0x04,0x0B,0x13,0x30,0x28,0x63, -0x29,0x20,0x32,0x30,0x30,0x37,0x20,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20, -0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74,0x68,0x6F, -0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79,0x31,0x36, -0x30,0x34,0x06,0x03,0x55,0x04,0x03,0x13,0x2D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73, -0x74,0x20,0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74,0x69,0x66, -0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74, -0x79,0x20,0x2D,0x20,0x47,0x32,0x30,0x1E,0x17,0x0D,0x30,0x37,0x31,0x31,0x30,0x35, -0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x38,0x30,0x31,0x31,0x38,0x32, -0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x81,0x98,0x31,0x0B,0x30,0x09,0x06,0x03,0x55, -0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x16,0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13, -0x0D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x49,0x6E,0x63,0x2E,0x31,0x39, -0x30,0x37,0x06,0x03,0x55,0x04,0x0B,0x13,0x30,0x28,0x63,0x29,0x20,0x32,0x30,0x30, -0x37,0x20,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x49,0x6E,0x63,0x2E,0x20, -0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74,0x68,0x6F,0x72,0x69,0x7A,0x65,0x64, -0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79,0x31,0x36,0x30,0x34,0x06,0x03,0x55, -0x04,0x03,0x13,0x2D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x50,0x72,0x69, -0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69, -0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x20,0x2D,0x20,0x47, -0x32,0x30,0x76,0x30,0x10,0x06,0x07,0x2A,0x86,0x48,0xCE,0x3D,0x02,0x01,0x06,0x05, -0x2B,0x81,0x04,0x00,0x22,0x03,0x62,0x00,0x04,0x15,0xB1,0xE8,0xFD,0x03,0x15,0x43, -0xE5,0xAC,0xEB,0x87,0x37,0x11,0x62,0xEF,0xD2,0x83,0x36,0x52,0x7D,0x45,0x57,0x0B, -0x4A,0x8D,0x7B,0x54,0x3B,0x3A,0x6E,0x5F,0x15,0x02,0xC0,0x50,0xA6,0xCF,0x25,0x2F, -0x7D,0xCA,0x48,0xB8,0xC7,0x50,0x63,0x1C,0x2A,0x21,0x08,0x7C,0x9A,0x36,0xD8,0x0B, -0xFE,0xD1,0x26,0xC5,0x58,0x31,0x30,0x28,0x25,0xF3,0x5D,0x5D,0xA3,0xB8,0xB6,0xA5, -0xB4,0x92,0xED,0x6C,0x2C,0x9F,0xEB,0xDD,0x43,0x89,0xA2,0x3C,0x4B,0x48,0x91,0x1D, -0x50,0xEC,0x26,0xDF,0xD6,0x60,0x2E,0xBD,0x21,0xA3,0x42,0x30,0x40,0x30,0x0F,0x06, -0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E, -0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x1D, -0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x15,0x5F,0x35,0x57,0x51,0x55,0xFB, -0x25,0xB2,0xAD,0x03,0x69,0xFC,0x01,0xA3,0xFA,0xBE,0x11,0x55,0xD5,0x30,0x0A,0x06, -0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,0x03,0x67,0x00,0x30,0x64,0x02,0x30, -0x64,0x96,0x59,0xA6,0xE8,0x09,0xDE,0x8B,0xBA,0xFA,0x5A,0x88,0x88,0xF0,0x1F,0x91, -0xD3,0x46,0xA8,0xF2,0x4A,0x4C,0x02,0x63,0xFB,0x6C,0x5F,0x38,0xDB,0x2E,0x41,0x93, -0xA9,0x0E,0xE6,0x9D,0xDC,0x31,0x1C,0xB2,0xA0,0xA7,0x18,0x1C,0x79,0xE1,0xC7,0x36, -0x02,0x30,0x3A,0x56,0xAF,0x9A,0x74,0x6C,0xF6,0xFB,0x83,0xE0,0x33,0xD3,0x08,0x5F, -0xA1,0x9C,0xC2,0x5B,0x9F,0x46,0xD6,0xB6,0xCB,0x91,0x06,0x63,0xA2,0x06,0xE7,0x33, -0xAC,0x3E,0xA8,0x81,0x12,0xD0,0xCB,0xBA,0xD0,0x92,0x0B,0xB6,0x9E,0x96,0xAA,0x04, -0x0F,0x8A, -}; - - -/* subject:/C=US/O=GeoTrust Inc./OU=(c) 2008 GeoTrust Inc. - For authorized use only/CN=GeoTrust Primary Certification Authority - G3 */ -/* issuer :/C=US/O=GeoTrust Inc./OU=(c) 2008 GeoTrust Inc. - For authorized use only/CN=GeoTrust Primary Certification Authority - G3 */ - - -const unsigned char GeoTrust_Primary_Certification_Authority___G3_certificate[1026]={ -0x30,0x82,0x03,0xFE,0x30,0x82,0x02,0xE6,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x15, -0xAC,0x6E,0x94,0x19,0xB2,0x79,0x4B,0x41,0xF6,0x27,0xA9,0xC3,0x18,0x0F,0x1F,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x30,0x81, -0x98,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x16, -0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73, -0x74,0x20,0x49,0x6E,0x63,0x2E,0x31,0x39,0x30,0x37,0x06,0x03,0x55,0x04,0x0B,0x13, -0x30,0x28,0x63,0x29,0x20,0x32,0x30,0x30,0x38,0x20,0x47,0x65,0x6F,0x54,0x72,0x75, -0x73,0x74,0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75, -0x74,0x68,0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C, -0x79,0x31,0x36,0x30,0x34,0x06,0x03,0x55,0x04,0x03,0x13,0x2D,0x47,0x65,0x6F,0x54, -0x72,0x75,0x73,0x74,0x20,0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72, -0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F, -0x72,0x69,0x74,0x79,0x20,0x2D,0x20,0x47,0x33,0x30,0x1E,0x17,0x0D,0x30,0x38,0x30, -0x34,0x30,0x32,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x37,0x31,0x32, -0x30,0x31,0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x81,0x98,0x31,0x0B,0x30,0x09, -0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x16,0x30,0x14,0x06,0x03,0x55, -0x04,0x0A,0x13,0x0D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x49,0x6E,0x63, -0x2E,0x31,0x39,0x30,0x37,0x06,0x03,0x55,0x04,0x0B,0x13,0x30,0x28,0x63,0x29,0x20, -0x32,0x30,0x30,0x38,0x20,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x49,0x6E, -0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74,0x68,0x6F,0x72,0x69, -0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79,0x31,0x36,0x30,0x34, -0x06,0x03,0x55,0x04,0x03,0x13,0x2D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20, -0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63, -0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x20, -0x2D,0x20,0x47,0x33,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86, -0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A, -0x02,0x82,0x01,0x01,0x00,0xDC,0xE2,0x5E,0x62,0x58,0x1D,0x33,0x57,0x39,0x32,0x33, -0xFA,0xEB,0xCB,0x87,0x8C,0xA7,0xD4,0x4A,0xDD,0x06,0x88,0xEA,0x64,0x8E,0x31,0x98, -0xA5,0x38,0x90,0x1E,0x98,0xCF,0x2E,0x63,0x2B,0xF0,0x46,0xBC,0x44,0xB2,0x89,0xA1, -0xC0,0x28,0x0C,0x49,0x70,0x21,0x95,0x9F,0x64,0xC0,0xA6,0x93,0x12,0x02,0x65,0x26, -0x86,0xC6,0xA5,0x89,0xF0,0xFA,0xD7,0x84,0xA0,0x70,0xAF,0x4F,0x1A,0x97,0x3F,0x06, -0x44,0xD5,0xC9,0xEB,0x72,0x10,0x7D,0xE4,0x31,0x28,0xFB,0x1C,0x61,0xE6,0x28,0x07, -0x44,0x73,0x92,0x22,0x69,0xA7,0x03,0x88,0x6C,0x9D,0x63,0xC8,0x52,0xDA,0x98,0x27, -0xE7,0x08,0x4C,0x70,0x3E,0xB4,0xC9,0x12,0xC1,0xC5,0x67,0x83,0x5D,0x33,0xF3,0x03, -0x11,0xEC,0x6A,0xD0,0x53,0xE2,0xD1,0xBA,0x36,0x60,0x94,0x80,0xBB,0x61,0x63,0x6C, -0x5B,0x17,0x7E,0xDF,0x40,0x94,0x1E,0xAB,0x0D,0xC2,0x21,0x28,0x70,0x88,0xFF,0xD6, -0x26,0x6C,0x6C,0x60,0x04,0x25,0x4E,0x55,0x7E,0x7D,0xEF,0xBF,0x94,0x48,0xDE,0xB7, -0x1D,0xDD,0x70,0x8D,0x05,0x5F,0x88,0xA5,0x9B,0xF2,0xC2,0xEE,0xEA,0xD1,0x40,0x41, -0x6D,0x62,0x38,0x1D,0x56,0x06,0xC5,0x03,0x47,0x51,0x20,0x19,0xFC,0x7B,0x10,0x0B, -0x0E,0x62,0xAE,0x76,0x55,0xBF,0x5F,0x77,0xBE,0x3E,0x49,0x01,0x53,0x3D,0x98,0x25, -0x03,0x76,0x24,0x5A,0x1D,0xB4,0xDB,0x89,0xEA,0x79,0xE5,0xB6,0xB3,0x3B,0x3F,0xBA, -0x4C,0x28,0x41,0x7F,0x06,0xAC,0x6A,0x8E,0xC1,0xD0,0xF6,0x05,0x1D,0x7D,0xE6,0x42, -0x86,0xE3,0xA5,0xD5,0x47,0x02,0x03,0x01,0x00,0x01,0xA3,0x42,0x30,0x40,0x30,0x0F, -0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30, -0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30, -0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xC4,0x79,0xCA,0x8E,0xA1,0x4E, -0x03,0x1D,0x1C,0xDC,0x6B,0xDB,0x31,0x5B,0x94,0x3E,0x3F,0x30,0x7F,0x2D,0x30,0x0D, -0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x03,0x82,0x01, -0x01,0x00,0x2D,0xC5,0x13,0xCF,0x56,0x80,0x7B,0x7A,0x78,0xBD,0x9F,0xAE,0x2C,0x99, -0xE7,0xEF,0xDA,0xDF,0x94,0x5E,0x09,0x69,0xA7,0xE7,0x6E,0x68,0x8C,0xBD,0x72,0xBE, -0x47,0xA9,0x0E,0x97,0x12,0xB8,0x4A,0xF1,0x64,0xD3,0x39,0xDF,0x25,0x34,0xD4,0xC1, -0xCD,0x4E,0x81,0xF0,0x0F,0x04,0xC4,0x24,0xB3,0x34,0x96,0xC6,0xA6,0xAA,0x30,0xDF, -0x68,0x61,0x73,0xD7,0xF9,0x8E,0x85,0x89,0xEF,0x0E,0x5E,0x95,0x28,0x4A,0x2A,0x27, -0x8F,0x10,0x8E,0x2E,0x7C,0x86,0xC4,0x02,0x9E,0xDA,0x0C,0x77,0x65,0x0E,0x44,0x0D, -0x92,0xFD,0xFD,0xB3,0x16,0x36,0xFA,0x11,0x0D,0x1D,0x8C,0x0E,0x07,0x89,0x6A,0x29, -0x56,0xF7,0x72,0xF4,0xDD,0x15,0x9C,0x77,0x35,0x66,0x57,0xAB,0x13,0x53,0xD8,0x8E, -0xC1,0x40,0xC5,0xD7,0x13,0x16,0x5A,0x72,0xC7,0xB7,0x69,0x01,0xC4,0x7A,0xB1,0x83, -0x01,0x68,0x7D,0x8D,0x41,0xA1,0x94,0x18,0xC1,0x25,0x5C,0xFC,0xF0,0xFE,0x83,0x02, -0x87,0x7C,0x0D,0x0D,0xCF,0x2E,0x08,0x5C,0x4A,0x40,0x0D,0x3E,0xEC,0x81,0x61,0xE6, -0x24,0xDB,0xCA,0xE0,0x0E,0x2D,0x07,0xB2,0x3E,0x56,0xDC,0x8D,0xF5,0x41,0x85,0x07, -0x48,0x9B,0x0C,0x0B,0xCB,0x49,0x3F,0x7D,0xEC,0xB7,0xFD,0xCB,0x8D,0x67,0x89,0x1A, -0xAB,0xED,0xBB,0x1E,0xA3,0x00,0x08,0x08,0x17,0x2A,0x82,0x5C,0x31,0x5D,0x46,0x8A, -0x2D,0x0F,0x86,0x9B,0x74,0xD9,0x45,0xFB,0xD4,0x40,0xB1,0x7A,0xAA,0x68,0x2D,0x86, -0xB2,0x99,0x22,0xE1,0xC1,0x2B,0xC7,0x9C,0xF8,0xF3,0x5F,0xA8,0x82,0x12,0xEB,0x19, -0x11,0x2D, -}; - - -/* subject:/C=US/O=GeoTrust Inc./CN=GeoTrust Universal CA */ -/* issuer :/C=US/O=GeoTrust Inc./CN=GeoTrust Universal CA */ - - -const unsigned char GeoTrust_Universal_CA_certificate[1388]={ -0x30,0x82,0x05,0x68,0x30,0x82,0x03,0x50,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x45,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x16, -0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73, -0x74,0x20,0x49,0x6E,0x63,0x2E,0x31,0x1E,0x30,0x1C,0x06,0x03,0x55,0x04,0x03,0x13, -0x15,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x55,0x6E,0x69,0x76,0x65,0x72, -0x73,0x61,0x6C,0x20,0x43,0x41,0x30,0x1E,0x17,0x0D,0x30,0x34,0x30,0x33,0x30,0x34, -0x30,0x35,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x32,0x39,0x30,0x33,0x30,0x34,0x30, -0x35,0x30,0x30,0x30,0x30,0x5A,0x30,0x45,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04, -0x06,0x13,0x02,0x55,0x53,0x31,0x16,0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D, -0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x49,0x6E,0x63,0x2E,0x31,0x1E,0x30, -0x1C,0x06,0x03,0x55,0x04,0x03,0x13,0x15,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74, -0x20,0x55,0x6E,0x69,0x76,0x65,0x72,0x73,0x61,0x6C,0x20,0x43,0x41,0x30,0x82,0x02, -0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00, -0x03,0x82,0x02,0x0F,0x00,0x30,0x82,0x02,0x0A,0x02,0x82,0x02,0x01,0x00,0xA6,0x15, -0x55,0xA0,0xA3,0xC6,0xE0,0x1F,0x8C,0x9D,0x21,0x50,0xD7,0xC1,0xBE,0x2B,0x5B,0xB5, -0xA4,0x9E,0xA1,0xD9,0x72,0x58,0xBD,0x00,0x1B,0x4C,0xBF,0x61,0xC9,0x14,0x1D,0x45, -0x82,0xAB,0xC6,0x1D,0x80,0xD6,0x3D,0xEB,0x10,0x9C,0x3A,0xAF,0x6D,0x24,0xF8,0xBC, -0x71,0x01,0x9E,0x06,0xF5,0x7C,0x5F,0x1E,0xC1,0x0E,0x55,0xCA,0x83,0x9A,0x59,0x30, -0xAE,0x19,0xCB,0x30,0x48,0x95,0xED,0x22,0x37,0x8D,0xF4,0x4A,0x9A,0x72,0x66,0x3E, -0xAD,0x95,0xC0,0xE0,0x16,0x00,0xE0,0x10,0x1F,0x2B,0x31,0x0E,0xD7,0x94,0x54,0xD3, -0x42,0x33,0xA0,0x34,0x1D,0x1E,0x45,0x76,0xDD,0x4F,0xCA,0x18,0x37,0xEC,0x85,0x15, -0x7A,0x19,0x08,0xFC,0xD5,0xC7,0x9C,0xF0,0xF2,0xA9,0x2E,0x10,0xA9,0x92,0xE6,0x3D, -0x58,0x3D,0xA9,0x16,0x68,0x3C,0x2F,0x75,0x21,0x18,0x7F,0x28,0x77,0xA5,0xE1,0x61, -0x17,0xB7,0xA6,0xE9,0xF8,0x1E,0x99,0xDB,0x73,0x6E,0xF4,0x0A,0xA2,0x21,0x6C,0xEE, -0xDA,0xAA,0x85,0x92,0x66,0xAF,0xF6,0x7A,0x6B,0x82,0xDA,0xBA,0x22,0x08,0x35,0x0F, -0xCF,0x42,0xF1,0x35,0xFA,0x6A,0xEE,0x7E,0x2B,0x25,0xCC,0x3A,0x11,0xE4,0x6D,0xAF, -0x73,0xB2,0x76,0x1D,0xAD,0xD0,0xB2,0x78,0x67,0x1A,0xA4,0x39,0x1C,0x51,0x0B,0x67, -0x56,0x83,0xFD,0x38,0x5D,0x0D,0xCE,0xDD,0xF0,0xBB,0x2B,0x96,0x1F,0xDE,0x7B,0x32, -0x52,0xFD,0x1D,0xBB,0xB5,0x06,0xA1,0xB2,0x21,0x5E,0xA5,0xD6,0x95,0x68,0x7F,0xF0, -0x99,0x9E,0xDC,0x45,0x08,0x3E,0xE7,0xD2,0x09,0x0D,0x35,0x94,0xDD,0x80,0x4E,0x53, -0x97,0xD7,0xB5,0x09,0x44,0x20,0x64,0x16,0x17,0x03,0x02,0x4C,0x53,0x0D,0x68,0xDE, -0xD5,0xAA,0x72,0x4D,0x93,0x6D,0x82,0x0E,0xDB,0x9C,0xBD,0xCF,0xB4,0xF3,0x5C,0x5D, -0x54,0x7A,0x69,0x09,0x96,0xD6,0xDB,0x11,0xC1,0x8D,0x75,0xA8,0xB4,0xCF,0x39,0xC8, -0xCE,0x3C,0xBC,0x24,0x7C,0xE6,0x62,0xCA,0xE1,0xBD,0x7D,0xA7,0xBD,0x57,0x65,0x0B, -0xE4,0xFE,0x25,0xED,0xB6,0x69,0x10,0xDC,0x28,0x1A,0x46,0xBD,0x01,0x1D,0xD0,0x97, -0xB5,0xE1,0x98,0x3B,0xC0,0x37,0x64,0xD6,0x3D,0x94,0xEE,0x0B,0xE1,0xF5,0x28,0xAE, -0x0B,0x56,0xBF,0x71,0x8B,0x23,0x29,0x41,0x8E,0x86,0xC5,0x4B,0x52,0x7B,0xD8,0x71, -0xAB,0x1F,0x8A,0x15,0xA6,0x3B,0x83,0x5A,0xD7,0x58,0x01,0x51,0xC6,0x4C,0x41,0xD9, -0x7F,0xD8,0x41,0x67,0x72,0xA2,0x28,0xDF,0x60,0x83,0xA9,0x9E,0xC8,0x7B,0xFC,0x53, -0x73,0x72,0x59,0xF5,0x93,0x7A,0x17,0x76,0x0E,0xCE,0xF7,0xE5,0x5C,0xD9,0x0B,0x55, -0x34,0xA2,0xAA,0x5B,0xB5,0x6A,0x54,0xE7,0x13,0xCA,0x57,0xEC,0x97,0x6D,0xF4,0x5E, -0x06,0x2F,0x45,0x8B,0x58,0xD4,0x23,0x16,0x92,0xE4,0x16,0x6E,0x28,0x63,0x59,0x30, -0xDF,0x50,0x01,0x9C,0x63,0x89,0x1A,0x9F,0xDB,0x17,0x94,0x82,0x70,0x37,0xC3,0x24, -0x9E,0x9A,0x47,0xD6,0x5A,0xCA,0x4E,0xA8,0x69,0x89,0x72,0x1F,0x91,0x6C,0xDB,0x7E, -0x9E,0x1B,0xAD,0xC7,0x1F,0x73,0xDD,0x2C,0x4F,0x19,0x65,0xFD,0x7F,0x93,0x40,0x10, -0x2E,0xD2,0xF0,0xED,0x3C,0x9E,0x2E,0x28,0x3E,0x69,0x26,0x33,0xC5,0x7B,0x02,0x03, -0x01,0x00,0x01,0xA3,0x63,0x30,0x61,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01, -0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04, -0x16,0x04,0x14,0xDA,0xBB,0x2E,0xAA,0xB0,0x0C,0xB8,0x88,0x26,0x51,0x74,0x5C,0x6D, -0x03,0xD3,0xC0,0xD8,0x8F,0x7A,0xD6,0x30,0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18, -0x30,0x16,0x80,0x14,0xDA,0xBB,0x2E,0xAA,0xB0,0x0C,0xB8,0x88,0x26,0x51,0x74,0x5C, -0x6D,0x03,0xD3,0xC0,0xD8,0x8F,0x7A,0xD6,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01, -0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x86,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86, -0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x02,0x01,0x00,0x31,0x78,0xE6,0xC7, -0xB5,0xDF,0xB8,0x94,0x40,0xC9,0x71,0xC4,0xA8,0x35,0xEC,0x46,0x1D,0xC2,0x85,0xF3, -0x28,0x58,0x86,0xB0,0x0B,0xFC,0x8E,0xB2,0x39,0x8F,0x44,0x55,0xAB,0x64,0x84,0x5C, -0x69,0xA9,0xD0,0x9A,0x38,0x3C,0xFA,0xE5,0x1F,0x35,0xE5,0x44,0xE3,0x80,0x79,0x94, -0x68,0xA4,0xBB,0xC4,0x9F,0x3D,0xE1,0x34,0xCD,0x30,0x46,0x8B,0x54,0x2B,0x95,0xA5, -0xEF,0xF7,0x3F,0x99,0x84,0xFD,0x35,0xE6,0xCF,0x31,0xC6,0xDC,0x6A,0xBF,0xA7,0xD7, -0x23,0x08,0xE1,0x98,0x5E,0xC3,0x5A,0x08,0x76,0xA9,0xA6,0xAF,0x77,0x2F,0xB7,0x60, -0xBD,0x44,0x46,0x6A,0xEF,0x97,0xFF,0x73,0x95,0xC1,0x8E,0xE8,0x93,0xFB,0xFD,0x31, -0xB7,0xEC,0x57,0x11,0x11,0x45,0x9B,0x30,0xF1,0x1A,0x88,0x39,0xC1,0x4F,0x3C,0xA7, -0x00,0xD5,0xC7,0xFC,0xAB,0x6D,0x80,0x22,0x70,0xA5,0x0C,0xE0,0x5D,0x04,0x29,0x02, -0xFB,0xCB,0xA0,0x91,0xD1,0x7C,0xD6,0xC3,0x7E,0x50,0xD5,0x9D,0x58,0xBE,0x41,0x38, -0xEB,0xB9,0x75,0x3C,0x15,0xD9,0x9B,0xC9,0x4A,0x83,0x59,0xC0,0xDA,0x53,0xFD,0x33, -0xBB,0x36,0x18,0x9B,0x85,0x0F,0x15,0xDD,0xEE,0x2D,0xAC,0x76,0x93,0xB9,0xD9,0x01, -0x8D,0x48,0x10,0xA8,0xFB,0xF5,0x38,0x86,0xF1,0xDB,0x0A,0xC6,0xBD,0x84,0xA3,0x23, -0x41,0xDE,0xD6,0x77,0x6F,0x85,0xD4,0x85,0x1C,0x50,0xE0,0xAE,0x51,0x8A,0xBA,0x8D, -0x3E,0x76,0xE2,0xB9,0xCA,0x27,0xF2,0x5F,0x9F,0xEF,0x6E,0x59,0x0D,0x06,0xD8,0x2B, -0x17,0xA4,0xD2,0x7C,0x6B,0xBB,0x5F,0x14,0x1A,0x48,0x8F,0x1A,0x4C,0xE7,0xB3,0x47, -0x1C,0x8E,0x4C,0x45,0x2B,0x20,0xEE,0x48,0xDF,0xE7,0xDD,0x09,0x8E,0x18,0xA8,0xDA, -0x40,0x8D,0x92,0x26,0x11,0x53,0x61,0x73,0x5D,0xEB,0xBD,0xE7,0xC4,0x4D,0x29,0x37, -0x61,0xEB,0xAC,0x39,0x2D,0x67,0x2E,0x16,0xD6,0xF5,0x00,0x83,0x85,0xA1,0xCC,0x7F, -0x76,0xC4,0x7D,0xE4,0xB7,0x4B,0x66,0xEF,0x03,0x45,0x60,0x69,0xB6,0x0C,0x52,0x96, -0x92,0x84,0x5E,0xA6,0xA3,0xB5,0xA4,0x3E,0x2B,0xD9,0xCC,0xD8,0x1B,0x47,0xAA,0xF2, -0x44,0xDA,0x4F,0xF9,0x03,0xE8,0xF0,0x14,0xCB,0x3F,0xF3,0x83,0xDE,0xD0,0xC1,0x54, -0xE3,0xB7,0xE8,0x0A,0x37,0x4D,0x8B,0x20,0x59,0x03,0x30,0x19,0xA1,0x2C,0xC8,0xBD, -0x11,0x1F,0xDF,0xAE,0xC9,0x4A,0xC5,0xF3,0x27,0x66,0x66,0x86,0xAC,0x68,0x91,0xFF, -0xD9,0xE6,0x53,0x1C,0x0F,0x8B,0x5C,0x69,0x65,0x0A,0x26,0xC8,0x1E,0x34,0xC3,0x5D, -0x51,0x7B,0xD7,0xA9,0x9C,0x06,0xA1,0x36,0xDD,0xD5,0x89,0x94,0xBC,0xD9,0xE4,0x2D, -0x0C,0x5E,0x09,0x6C,0x08,0x97,0x7C,0xA3,0x3D,0x7C,0x93,0xFF,0x3F,0xA1,0x14,0xA7, -0xCF,0xB5,0x5D,0xEB,0xDB,0xDB,0x1C,0xC4,0x76,0xDF,0x88,0xB9,0xBD,0x45,0x05,0x95, -0x1B,0xAE,0xFC,0x46,0x6A,0x4C,0xAF,0x48,0xE3,0xCE,0xAE,0x0F,0xD2,0x7E,0xEB,0xE6, -0x6C,0x9C,0x4F,0x81,0x6A,0x7A,0x64,0xAC,0xBB,0x3E,0xD5,0xE7,0xCB,0x76,0x2E,0xC5, -0xA7,0x48,0xC1,0x5C,0x90,0x0F,0xCB,0xC8,0x3F,0xFA,0xE6,0x32,0xE1,0x8D,0x1B,0x6F, -0xA4,0xE6,0x8E,0xD8,0xF9,0x29,0x48,0x8A,0xCE,0x73,0xFE,0x2C, -}; - - -/* subject:/C=US/O=GeoTrust Inc./CN=GeoTrust Universal CA 2 */ -/* issuer :/C=US/O=GeoTrust Inc./CN=GeoTrust Universal CA 2 */ - - -const unsigned char GeoTrust_Universal_CA_2_certificate[1392]={ -0x30,0x82,0x05,0x6C,0x30,0x82,0x03,0x54,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x47,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x16, -0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73, -0x74,0x20,0x49,0x6E,0x63,0x2E,0x31,0x20,0x30,0x1E,0x06,0x03,0x55,0x04,0x03,0x13, -0x17,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x55,0x6E,0x69,0x76,0x65,0x72, -0x73,0x61,0x6C,0x20,0x43,0x41,0x20,0x32,0x30,0x1E,0x17,0x0D,0x30,0x34,0x30,0x33, -0x30,0x34,0x30,0x35,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x32,0x39,0x30,0x33,0x30, -0x34,0x30,0x35,0x30,0x30,0x30,0x30,0x5A,0x30,0x47,0x31,0x0B,0x30,0x09,0x06,0x03, -0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x16,0x30,0x14,0x06,0x03,0x55,0x04,0x0A, -0x13,0x0D,0x47,0x65,0x6F,0x54,0x72,0x75,0x73,0x74,0x20,0x49,0x6E,0x63,0x2E,0x31, -0x20,0x30,0x1E,0x06,0x03,0x55,0x04,0x03,0x13,0x17,0x47,0x65,0x6F,0x54,0x72,0x75, -0x73,0x74,0x20,0x55,0x6E,0x69,0x76,0x65,0x72,0x73,0x61,0x6C,0x20,0x43,0x41,0x20, -0x32,0x30,0x82,0x02,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, -0x01,0x01,0x05,0x00,0x03,0x82,0x02,0x0F,0x00,0x30,0x82,0x02,0x0A,0x02,0x82,0x02, -0x01,0x00,0xB3,0x54,0x52,0xC1,0xC9,0x3E,0xF2,0xD9,0xDC,0xB1,0x53,0x1A,0x59,0x29, -0xE7,0xB1,0xC3,0x45,0x28,0xE5,0xD7,0xD1,0xED,0xC5,0xC5,0x4B,0xA1,0xAA,0x74,0x7B, -0x57,0xAF,0x4A,0x26,0xFC,0xD8,0xF5,0x5E,0xA7,0x6E,0x19,0xDB,0x74,0x0C,0x4F,0x35, -0x5B,0x32,0x0B,0x01,0xE3,0xDB,0xEB,0x7A,0x77,0x35,0xEA,0xAA,0x5A,0xE0,0xD6,0xE8, -0xA1,0x57,0x94,0xF0,0x90,0xA3,0x74,0x56,0x94,0x44,0x30,0x03,0x1E,0x5C,0x4E,0x2B, -0x85,0x26,0x74,0x82,0x7A,0x0C,0x76,0xA0,0x6F,0x4D,0xCE,0x41,0x2D,0xA0,0x15,0x06, -0x14,0x5F,0xB7,0x42,0xCD,0x7B,0x8F,0x58,0x61,0x34,0xDC,0x2A,0x08,0xF9,0x2E,0xC3, -0x01,0xA6,0x22,0x44,0x1C,0x4C,0x07,0x82,0xE6,0x5B,0xCE,0xD0,0x4A,0x7C,0x04,0xD3, -0x19,0x73,0x27,0xF0,0xAA,0x98,0x7F,0x2E,0xAF,0x4E,0xEB,0x87,0x1E,0x24,0x77,0x6A, -0x5D,0xB6,0xE8,0x5B,0x45,0xBA,0xDC,0xC3,0xA1,0x05,0x6F,0x56,0x8E,0x8F,0x10,0x26, -0xA5,0x49,0xC3,0x2E,0xD7,0x41,0x87,0x22,0xE0,0x4F,0x86,0xCA,0x60,0xB5,0xEA,0xA1, -0x63,0xC0,0x01,0x97,0x10,0x79,0xBD,0x00,0x3C,0x12,0x6D,0x2B,0x15,0xB1,0xAC,0x4B, -0xB1,0xEE,0x18,0xB9,0x4E,0x96,0xDC,0xDC,0x76,0xFF,0x3B,0xBE,0xCF,0x5F,0x03,0xC0, -0xFC,0x3B,0xE8,0xBE,0x46,0x1B,0xFF,0xDA,0x40,0xC2,0x52,0xF7,0xFE,0xE3,0x3A,0xF7, -0x6A,0x77,0x35,0xD0,0xDA,0x8D,0xEB,0x5E,0x18,0x6A,0x31,0xC7,0x1E,0xBA,0x3C,0x1B, -0x28,0xD6,0x6B,0x54,0xC6,0xAA,0x5B,0xD7,0xA2,0x2C,0x1B,0x19,0xCC,0xA2,0x02,0xF6, -0x9B,0x59,0xBD,0x37,0x6B,0x86,0xB5,0x6D,0x82,0xBA,0xD8,0xEA,0xC9,0x56,0xBC,0xA9, -0x36,0x58,0xFD,0x3E,0x19,0xF3,0xED,0x0C,0x26,0xA9,0x93,0x38,0xF8,0x4F,0xC1,0x5D, -0x22,0x06,0xD0,0x97,0xEA,0xE1,0xAD,0xC6,0x55,0xE0,0x81,0x2B,0x28,0x83,0x3A,0xFA, -0xF4,0x7B,0x21,0x51,0x00,0xBE,0x52,0x38,0xCE,0xCD,0x66,0x79,0xA8,0xF4,0x81,0x56, -0xE2,0xD0,0x83,0x09,0x47,0x51,0x5B,0x50,0x6A,0xCF,0xDB,0x48,0x1A,0x5D,0x3E,0xF7, -0xCB,0xF6,0x65,0xF7,0x6C,0xF1,0x95,0xF8,0x02,0x3B,0x32,0x56,0x82,0x39,0x7A,0x5B, -0xBD,0x2F,0x89,0x1B,0xBF,0xA1,0xB4,0xE8,0xFF,0x7F,0x8D,0x8C,0xDF,0x03,0xF1,0x60, -0x4E,0x58,0x11,0x4C,0xEB,0xA3,0x3F,0x10,0x2B,0x83,0x9A,0x01,0x73,0xD9,0x94,0x6D, -0x84,0x00,0x27,0x66,0xAC,0xF0,0x70,0x40,0x09,0x42,0x92,0xAD,0x4F,0x93,0x0D,0x61, -0x09,0x51,0x24,0xD8,0x92,0xD5,0x0B,0x94,0x61,0xB2,0x87,0xB2,0xED,0xFF,0x9A,0x35, -0xFF,0x85,0x54,0xCA,0xED,0x44,0x43,0xAC,0x1B,0x3C,0x16,0x6B,0x48,0x4A,0x0A,0x1C, -0x40,0x88,0x1F,0x92,0xC2,0x0B,0x00,0x05,0xFF,0xF2,0xC8,0x02,0x4A,0xA4,0xAA,0xA9, -0xCC,0x99,0x96,0x9C,0x2F,0x58,0xE0,0x7D,0xE1,0xBE,0xBB,0x07,0xDC,0x5F,0x04,0x72, -0x5C,0x31,0x34,0xC3,0xEC,0x5F,0x2D,0xE0,0x3D,0x64,0x90,0x22,0xE6,0xD1,0xEC,0xB8, -0x2E,0xDD,0x59,0xAE,0xD9,0xA1,0x37,0xBF,0x54,0x35,0xDC,0x73,0x32,0x4F,0x8C,0x04, -0x1E,0x33,0xB2,0xC9,0x46,0xF1,0xD8,0x5C,0xC8,0x55,0x50,0xC9,0x68,0xBD,0xA8,0xBA, -0x36,0x09,0x02,0x03,0x01,0x00,0x01,0xA3,0x63,0x30,0x61,0x30,0x0F,0x06,0x03,0x55, -0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x1D,0x06,0x03, -0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x76,0xF3,0x55,0xE1,0xFA,0xA4,0x36,0xFB,0xF0, -0x9F,0x5C,0x62,0x71,0xED,0x3C,0xF4,0x47,0x38,0x10,0x2B,0x30,0x1F,0x06,0x03,0x55, -0x1D,0x23,0x04,0x18,0x30,0x16,0x80,0x14,0x76,0xF3,0x55,0xE1,0xFA,0xA4,0x36,0xFB, -0xF0,0x9F,0x5C,0x62,0x71,0xED,0x3C,0xF4,0x47,0x38,0x10,0x2B,0x30,0x0E,0x06,0x03, -0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x86,0x30,0x0D,0x06,0x09, -0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x02,0x01,0x00, -0x66,0xC1,0xC6,0x23,0xF3,0xD9,0xE0,0x2E,0x6E,0x5F,0xE8,0xCF,0xAE,0xB0,0xB0,0x25, -0x4D,0x2B,0xF8,0x3B,0x58,0x9B,0x40,0x24,0x37,0x5A,0xCB,0xAB,0x16,0x49,0xFF,0xB3, -0x75,0x79,0x33,0xA1,0x2F,0x6D,0x70,0x17,0x34,0x91,0xFE,0x67,0x7E,0x8F,0xEC,0x9B, -0xE5,0x5E,0x82,0xA9,0x55,0x1F,0x2F,0xDC,0xD4,0x51,0x07,0x12,0xFE,0xAC,0x16,0x3E, -0x2C,0x35,0xC6,0x63,0xFC,0xDC,0x10,0xEB,0x0D,0xA3,0xAA,0xD0,0x7C,0xCC,0xD1,0xD0, -0x2F,0x51,0x2E,0xC4,0x14,0x5A,0xDE,0xE8,0x19,0xE1,0x3E,0xC6,0xCC,0xA4,0x29,0xE7, -0x2E,0x84,0xAA,0x06,0x30,0x78,0x76,0x54,0x73,0x28,0x98,0x59,0x38,0xE0,0x00,0x0D, -0x62,0xD3,0x42,0x7D,0x21,0x9F,0xAE,0x3D,0x3A,0x8C,0xD5,0xFA,0x77,0x0D,0x18,0x2B, -0x16,0x0E,0x5F,0x36,0xE1,0xFC,0x2A,0xB5,0x30,0x24,0xCF,0xE0,0x63,0x0C,0x7B,0x58, -0x1A,0xFE,0x99,0xBA,0x42,0x12,0xB1,0x91,0xF4,0x7C,0x68,0xE2,0xC8,0xE8,0xAF,0x2C, -0xEA,0xC9,0x7E,0xAE,0xBB,0x2A,0x3D,0x0D,0x15,0xDC,0x34,0x95,0xB6,0x18,0x74,0xA8, -0x6A,0x0F,0xC7,0xB4,0xF4,0x13,0xC4,0xE4,0x5B,0xED,0x0A,0xD2,0xA4,0x97,0x4C,0x2A, -0xED,0x2F,0x6C,0x12,0x89,0x3D,0xF1,0x27,0x70,0xAA,0x6A,0x03,0x52,0x21,0x9F,0x40, -0xA8,0x67,0x50,0xF2,0xF3,0x5A,0x1F,0xDF,0xDF,0x23,0xF6,0xDC,0x78,0x4E,0xE6,0x98, -0x4F,0x55,0x3A,0x53,0xE3,0xEF,0xF2,0xF4,0x9F,0xC7,0x7C,0xD8,0x58,0xAF,0x29,0x22, -0x97,0xB8,0xE0,0xBD,0x91,0x2E,0xB0,0x76,0xEC,0x57,0x11,0xCF,0xEF,0x29,0x44,0xF3, -0xE9,0x85,0x7A,0x60,0x63,0xE4,0x5D,0x33,0x89,0x17,0xD9,0x31,0xAA,0xDA,0xD6,0xF3, -0x18,0x35,0x72,0xCF,0x87,0x2B,0x2F,0x63,0x23,0x84,0x5D,0x84,0x8C,0x3F,0x57,0xA0, -0x88,0xFC,0x99,0x91,0x28,0x26,0x69,0x99,0xD4,0x8F,0x97,0x44,0xBE,0x8E,0xD5,0x48, -0xB1,0xA4,0x28,0x29,0xF1,0x15,0xB4,0xE1,0xE5,0x9E,0xDD,0xF8,0x8F,0xA6,0x6F,0x26, -0xD7,0x09,0x3C,0x3A,0x1C,0x11,0x0E,0xA6,0x6C,0x37,0xF7,0xAD,0x44,0x87,0x2C,0x28, -0xC7,0xD8,0x74,0x82,0xB3,0xD0,0x6F,0x4A,0x57,0xBB,0x35,0x29,0x27,0xA0,0x8B,0xE8, -0x21,0xA7,0x87,0x64,0x36,0x5D,0xCC,0xD8,0x16,0xAC,0xC7,0xB2,0x27,0x40,0x92,0x55, -0x38,0x28,0x8D,0x51,0x6E,0xDD,0x14,0x67,0x53,0x6C,0x71,0x5C,0x26,0x84,0x4D,0x75, -0x5A,0xB6,0x7E,0x60,0x56,0xA9,0x4D,0xAD,0xFB,0x9B,0x1E,0x97,0xF3,0x0D,0xD9,0xD2, -0x97,0x54,0x77,0xDA,0x3D,0x12,0xB7,0xE0,0x1E,0xEF,0x08,0x06,0xAC,0xF9,0x85,0x87, -0xE9,0xA2,0xDC,0xAF,0x7E,0x18,0x12,0x83,0xFD,0x56,0x17,0x41,0x2E,0xD5,0x29,0x82, -0x7D,0x99,0xF4,0x31,0xF6,0x71,0xA9,0xCF,0x2C,0x01,0x27,0xA5,0x05,0xB9,0xAA,0xB2, -0x48,0x4E,0x2A,0xEF,0x9F,0x93,0x52,0x51,0x95,0x3C,0x52,0x73,0x8E,0x56,0x4C,0x17, -0x40,0xC0,0x09,0x28,0xE4,0x8B,0x6A,0x48,0x53,0xDB,0xEC,0xCD,0x55,0x55,0xF1,0xC6, -0xF8,0xE9,0xA2,0x2C,0x4C,0xA6,0xD1,0x26,0x5F,0x7E,0xAF,0x5A,0x4C,0xDA,0x1F,0xA6, -0xF2,0x1C,0x2C,0x7E,0xAE,0x02,0x16,0xD2,0x56,0xD0,0x2F,0x57,0x53,0x47,0xE8,0x92, -}; - - -/* subject:/C=BE/O=GlobalSign nv-sa/OU=Root CA/CN=GlobalSign Root CA */ -/* issuer :/C=BE/O=GlobalSign nv-sa/OU=Root CA/CN=GlobalSign Root CA */ - - -const unsigned char GlobalSign_Root_CA_certificate[889]={ -0x30,0x82,0x03,0x75,0x30,0x82,0x02,0x5D,0xA0,0x03,0x02,0x01,0x02,0x02,0x0B,0x04, -0x00,0x00,0x00,0x00,0x01,0x15,0x4B,0x5A,0xC3,0x94,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x57,0x31,0x0B,0x30,0x09,0x06, -0x03,0x55,0x04,0x06,0x13,0x02,0x42,0x45,0x31,0x19,0x30,0x17,0x06,0x03,0x55,0x04, -0x0A,0x13,0x10,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,0x20,0x6E,0x76, -0x2D,0x73,0x61,0x31,0x10,0x30,0x0E,0x06,0x03,0x55,0x04,0x0B,0x13,0x07,0x52,0x6F, -0x6F,0x74,0x20,0x43,0x41,0x31,0x1B,0x30,0x19,0x06,0x03,0x55,0x04,0x03,0x13,0x12, -0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,0x20,0x52,0x6F,0x6F,0x74,0x20, -0x43,0x41,0x30,0x1E,0x17,0x0D,0x39,0x38,0x30,0x39,0x30,0x31,0x31,0x32,0x30,0x30, -0x30,0x30,0x5A,0x17,0x0D,0x32,0x38,0x30,0x31,0x32,0x38,0x31,0x32,0x30,0x30,0x30, -0x30,0x5A,0x30,0x57,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x42, -0x45,0x31,0x19,0x30,0x17,0x06,0x03,0x55,0x04,0x0A,0x13,0x10,0x47,0x6C,0x6F,0x62, -0x61,0x6C,0x53,0x69,0x67,0x6E,0x20,0x6E,0x76,0x2D,0x73,0x61,0x31,0x10,0x30,0x0E, -0x06,0x03,0x55,0x04,0x0B,0x13,0x07,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x31,0x1B, -0x30,0x19,0x06,0x03,0x55,0x04,0x03,0x13,0x12,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53, -0x69,0x67,0x6E,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x30,0x82,0x01,0x22,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82, -0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xDA,0x0E,0xE6,0x99, -0x8D,0xCE,0xA3,0xE3,0x4F,0x8A,0x7E,0xFB,0xF1,0x8B,0x83,0x25,0x6B,0xEA,0x48,0x1F, -0xF1,0x2A,0xB0,0xB9,0x95,0x11,0x04,0xBD,0xF0,0x63,0xD1,0xE2,0x67,0x66,0xCF,0x1C, -0xDD,0xCF,0x1B,0x48,0x2B,0xEE,0x8D,0x89,0x8E,0x9A,0xAF,0x29,0x80,0x65,0xAB,0xE9, -0xC7,0x2D,0x12,0xCB,0xAB,0x1C,0x4C,0x70,0x07,0xA1,0x3D,0x0A,0x30,0xCD,0x15,0x8D, -0x4F,0xF8,0xDD,0xD4,0x8C,0x50,0x15,0x1C,0xEF,0x50,0xEE,0xC4,0x2E,0xF7,0xFC,0xE9, -0x52,0xF2,0x91,0x7D,0xE0,0x6D,0xD5,0x35,0x30,0x8E,0x5E,0x43,0x73,0xF2,0x41,0xE9, -0xD5,0x6A,0xE3,0xB2,0x89,0x3A,0x56,0x39,0x38,0x6F,0x06,0x3C,0x88,0x69,0x5B,0x2A, -0x4D,0xC5,0xA7,0x54,0xB8,0x6C,0x89,0xCC,0x9B,0xF9,0x3C,0xCA,0xE5,0xFD,0x89,0xF5, -0x12,0x3C,0x92,0x78,0x96,0xD6,0xDC,0x74,0x6E,0x93,0x44,0x61,0xD1,0x8D,0xC7,0x46, -0xB2,0x75,0x0E,0x86,0xE8,0x19,0x8A,0xD5,0x6D,0x6C,0xD5,0x78,0x16,0x95,0xA2,0xE9, -0xC8,0x0A,0x38,0xEB,0xF2,0x24,0x13,0x4F,0x73,0x54,0x93,0x13,0x85,0x3A,0x1B,0xBC, -0x1E,0x34,0xB5,0x8B,0x05,0x8C,0xB9,0x77,0x8B,0xB1,0xDB,0x1F,0x20,0x91,0xAB,0x09, -0x53,0x6E,0x90,0xCE,0x7B,0x37,0x74,0xB9,0x70,0x47,0x91,0x22,0x51,0x63,0x16,0x79, -0xAE,0xB1,0xAE,0x41,0x26,0x08,0xC8,0x19,0x2B,0xD1,0x46,0xAA,0x48,0xD6,0x64,0x2A, -0xD7,0x83,0x34,0xFF,0x2C,0x2A,0xC1,0x6C,0x19,0x43,0x4A,0x07,0x85,0xE7,0xD3,0x7C, -0xF6,0x21,0x68,0xEF,0xEA,0xF2,0x52,0x9F,0x7F,0x93,0x90,0xCF,0x02,0x03,0x01,0x00, -0x01,0xA3,0x42,0x30,0x40,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04, -0x04,0x03,0x02,0x01,0x06,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04, -0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04, -0x14,0x60,0x7B,0x66,0x1A,0x45,0x0D,0x97,0xCA,0x89,0x50,0x2F,0x7D,0x04,0xCD,0x34, -0xA8,0xFF,0xFC,0xFD,0x4B,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, -0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0xD6,0x73,0xE7,0x7C,0x4F,0x76,0xD0, -0x8D,0xBF,0xEC,0xBA,0xA2,0xBE,0x34,0xC5,0x28,0x32,0xB5,0x7C,0xFC,0x6C,0x9C,0x2C, -0x2B,0xBD,0x09,0x9E,0x53,0xBF,0x6B,0x5E,0xAA,0x11,0x48,0xB6,0xE5,0x08,0xA3,0xB3, -0xCA,0x3D,0x61,0x4D,0xD3,0x46,0x09,0xB3,0x3E,0xC3,0xA0,0xE3,0x63,0x55,0x1B,0xF2, -0xBA,0xEF,0xAD,0x39,0xE1,0x43,0xB9,0x38,0xA3,0xE6,0x2F,0x8A,0x26,0x3B,0xEF,0xA0, -0x50,0x56,0xF9,0xC6,0x0A,0xFD,0x38,0xCD,0xC4,0x0B,0x70,0x51,0x94,0x97,0x98,0x04, -0xDF,0xC3,0x5F,0x94,0xD5,0x15,0xC9,0x14,0x41,0x9C,0xC4,0x5D,0x75,0x64,0x15,0x0D, -0xFF,0x55,0x30,0xEC,0x86,0x8F,0xFF,0x0D,0xEF,0x2C,0xB9,0x63,0x46,0xF6,0xAA,0xFC, -0xDF,0xBC,0x69,0xFD,0x2E,0x12,0x48,0x64,0x9A,0xE0,0x95,0xF0,0xA6,0xEF,0x29,0x8F, -0x01,0xB1,0x15,0xB5,0x0C,0x1D,0xA5,0xFE,0x69,0x2C,0x69,0x24,0x78,0x1E,0xB3,0xA7, -0x1C,0x71,0x62,0xEE,0xCA,0xC8,0x97,0xAC,0x17,0x5D,0x8A,0xC2,0xF8,0x47,0x86,0x6E, -0x2A,0xC4,0x56,0x31,0x95,0xD0,0x67,0x89,0x85,0x2B,0xF9,0x6C,0xA6,0x5D,0x46,0x9D, -0x0C,0xAA,0x82,0xE4,0x99,0x51,0xDD,0x70,0xB7,0xDB,0x56,0x3D,0x61,0xE4,0x6A,0xE1, -0x5C,0xD6,0xF6,0xFE,0x3D,0xDE,0x41,0xCC,0x07,0xAE,0x63,0x52,0xBF,0x53,0x53,0xF4, -0x2B,0xE9,0xC7,0xFD,0xB6,0xF7,0x82,0x5F,0x85,0xD2,0x41,0x18,0xDB,0x81,0xB3,0x04, -0x1C,0xC5,0x1F,0xA4,0x80,0x6F,0x15,0x20,0xC9,0xDE,0x0C,0x88,0x0A,0x1D,0xD6,0x66, -0x55,0xE2,0xFC,0x48,0xC9,0x29,0x26,0x69,0xE0, -}; - - -/* subject:/OU=GlobalSign Root CA - R2/O=GlobalSign/CN=GlobalSign */ -/* issuer :/OU=GlobalSign Root CA - R2/O=GlobalSign/CN=GlobalSign */ - - -const unsigned char GlobalSign_Root_CA___R2_certificate[958]={ -0x30,0x82,0x03,0xBA,0x30,0x82,0x02,0xA2,0xA0,0x03,0x02,0x01,0x02,0x02,0x0B,0x04, -0x00,0x00,0x00,0x00,0x01,0x0F,0x86,0x26,0xE6,0x0D,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x4C,0x31,0x20,0x30,0x1E,0x06, -0x03,0x55,0x04,0x0B,0x13,0x17,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E, -0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x20,0x2D,0x20,0x52,0x32,0x31,0x13,0x30, -0x11,0x06,0x03,0x55,0x04,0x0A,0x13,0x0A,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69, -0x67,0x6E,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0A,0x47,0x6C,0x6F, -0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,0x30,0x1E,0x17,0x0D,0x30,0x36,0x31,0x32,0x31, -0x35,0x30,0x38,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x32,0x31,0x31,0x32,0x31,0x35, -0x30,0x38,0x30,0x30,0x30,0x30,0x5A,0x30,0x4C,0x31,0x20,0x30,0x1E,0x06,0x03,0x55, -0x04,0x0B,0x13,0x17,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,0x20,0x52, -0x6F,0x6F,0x74,0x20,0x43,0x41,0x20,0x2D,0x20,0x52,0x32,0x31,0x13,0x30,0x11,0x06, -0x03,0x55,0x04,0x0A,0x13,0x0A,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E, -0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0A,0x47,0x6C,0x6F,0x62,0x61, -0x6C,0x53,0x69,0x67,0x6E,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48, -0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01, -0x0A,0x02,0x82,0x01,0x01,0x00,0xA6,0xCF,0x24,0x0E,0xBE,0x2E,0x6F,0x28,0x99,0x45, -0x42,0xC4,0xAB,0x3E,0x21,0x54,0x9B,0x0B,0xD3,0x7F,0x84,0x70,0xFA,0x12,0xB3,0xCB, -0xBF,0x87,0x5F,0xC6,0x7F,0x86,0xD3,0xB2,0x30,0x5C,0xD6,0xFD,0xAD,0xF1,0x7B,0xDC, -0xE5,0xF8,0x60,0x96,0x09,0x92,0x10,0xF5,0xD0,0x53,0xDE,0xFB,0x7B,0x7E,0x73,0x88, -0xAC,0x52,0x88,0x7B,0x4A,0xA6,0xCA,0x49,0xA6,0x5E,0xA8,0xA7,0x8C,0x5A,0x11,0xBC, -0x7A,0x82,0xEB,0xBE,0x8C,0xE9,0xB3,0xAC,0x96,0x25,0x07,0x97,0x4A,0x99,0x2A,0x07, -0x2F,0xB4,0x1E,0x77,0xBF,0x8A,0x0F,0xB5,0x02,0x7C,0x1B,0x96,0xB8,0xC5,0xB9,0x3A, -0x2C,0xBC,0xD6,0x12,0xB9,0xEB,0x59,0x7D,0xE2,0xD0,0x06,0x86,0x5F,0x5E,0x49,0x6A, -0xB5,0x39,0x5E,0x88,0x34,0xEC,0xBC,0x78,0x0C,0x08,0x98,0x84,0x6C,0xA8,0xCD,0x4B, -0xB4,0xA0,0x7D,0x0C,0x79,0x4D,0xF0,0xB8,0x2D,0xCB,0x21,0xCA,0xD5,0x6C,0x5B,0x7D, -0xE1,0xA0,0x29,0x84,0xA1,0xF9,0xD3,0x94,0x49,0xCB,0x24,0x62,0x91,0x20,0xBC,0xDD, -0x0B,0xD5,0xD9,0xCC,0xF9,0xEA,0x27,0x0A,0x2B,0x73,0x91,0xC6,0x9D,0x1B,0xAC,0xC8, -0xCB,0xE8,0xE0,0xA0,0xF4,0x2F,0x90,0x8B,0x4D,0xFB,0xB0,0x36,0x1B,0xF6,0x19,0x7A, -0x85,0xE0,0x6D,0xF2,0x61,0x13,0x88,0x5C,0x9F,0xE0,0x93,0x0A,0x51,0x97,0x8A,0x5A, -0xCE,0xAF,0xAB,0xD5,0xF7,0xAA,0x09,0xAA,0x60,0xBD,0xDC,0xD9,0x5F,0xDF,0x72,0xA9, -0x60,0x13,0x5E,0x00,0x01,0xC9,0x4A,0xFA,0x3F,0xA4,0xEA,0x07,0x03,0x21,0x02,0x8E, -0x82,0xCA,0x03,0xC2,0x9B,0x8F,0x02,0x03,0x01,0x00,0x01,0xA3,0x81,0x9C,0x30,0x81, -0x99,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01, -0x06,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01, -0x01,0xFF,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x9B,0xE2,0x07, -0x57,0x67,0x1C,0x1E,0xC0,0x6A,0x06,0xDE,0x59,0xB4,0x9A,0x2D,0xDF,0xDC,0x19,0x86, -0x2E,0x30,0x36,0x06,0x03,0x55,0x1D,0x1F,0x04,0x2F,0x30,0x2D,0x30,0x2B,0xA0,0x29, -0xA0,0x27,0x86,0x25,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x63,0x72,0x6C,0x2E,0x67, -0x6C,0x6F,0x62,0x61,0x6C,0x73,0x69,0x67,0x6E,0x2E,0x6E,0x65,0x74,0x2F,0x72,0x6F, -0x6F,0x74,0x2D,0x72,0x32,0x2E,0x63,0x72,0x6C,0x30,0x1F,0x06,0x03,0x55,0x1D,0x23, -0x04,0x18,0x30,0x16,0x80,0x14,0x9B,0xE2,0x07,0x57,0x67,0x1C,0x1E,0xC0,0x6A,0x06, -0xDE,0x59,0xB4,0x9A,0x2D,0xDF,0xDC,0x19,0x86,0x2E,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x99,0x81, -0x53,0x87,0x1C,0x68,0x97,0x86,0x91,0xEC,0xE0,0x4A,0xB8,0x44,0x0B,0xAB,0x81,0xAC, -0x27,0x4F,0xD6,0xC1,0xB8,0x1C,0x43,0x78,0xB3,0x0C,0x9A,0xFC,0xEA,0x2C,0x3C,0x6E, -0x61,0x1B,0x4D,0x4B,0x29,0xF5,0x9F,0x05,0x1D,0x26,0xC1,0xB8,0xE9,0x83,0x00,0x62, -0x45,0xB6,0xA9,0x08,0x93,0xB9,0xA9,0x33,0x4B,0x18,0x9A,0xC2,0xF8,0x87,0x88,0x4E, -0xDB,0xDD,0x71,0x34,0x1A,0xC1,0x54,0xDA,0x46,0x3F,0xE0,0xD3,0x2A,0xAB,0x6D,0x54, -0x22,0xF5,0x3A,0x62,0xCD,0x20,0x6F,0xBA,0x29,0x89,0xD7,0xDD,0x91,0xEE,0xD3,0x5C, -0xA2,0x3E,0xA1,0x5B,0x41,0xF5,0xDF,0xE5,0x64,0x43,0x2D,0xE9,0xD5,0x39,0xAB,0xD2, -0xA2,0xDF,0xB7,0x8B,0xD0,0xC0,0x80,0x19,0x1C,0x45,0xC0,0x2D,0x8C,0xE8,0xF8,0x2D, -0xA4,0x74,0x56,0x49,0xC5,0x05,0xB5,0x4F,0x15,0xDE,0x6E,0x44,0x78,0x39,0x87,0xA8, -0x7E,0xBB,0xF3,0x79,0x18,0x91,0xBB,0xF4,0x6F,0x9D,0xC1,0xF0,0x8C,0x35,0x8C,0x5D, -0x01,0xFB,0xC3,0x6D,0xB9,0xEF,0x44,0x6D,0x79,0x46,0x31,0x7E,0x0A,0xFE,0xA9,0x82, -0xC1,0xFF,0xEF,0xAB,0x6E,0x20,0xC4,0x50,0xC9,0x5F,0x9D,0x4D,0x9B,0x17,0x8C,0x0C, -0xE5,0x01,0xC9,0xA0,0x41,0x6A,0x73,0x53,0xFA,0xA5,0x50,0xB4,0x6E,0x25,0x0F,0xFB, -0x4C,0x18,0xF4,0xFD,0x52,0xD9,0x8E,0x69,0xB1,0xE8,0x11,0x0F,0xDE,0x88,0xD8,0xFB, -0x1D,0x49,0xF7,0xAA,0xDE,0x95,0xCF,0x20,0x78,0xC2,0x60,0x12,0xDB,0x25,0x40,0x8C, -0x6A,0xFC,0x7E,0x42,0x38,0x40,0x64,0x12,0xF7,0x9E,0x81,0xE1,0x93,0x2E, -}; - - -/* subject:/OU=GlobalSign Root CA - R3/O=GlobalSign/CN=GlobalSign */ -/* issuer :/OU=GlobalSign Root CA - R3/O=GlobalSign/CN=GlobalSign */ - - -const unsigned char GlobalSign_Root_CA___R3_certificate[867]={ -0x30,0x82,0x03,0x5F,0x30,0x82,0x02,0x47,0xA0,0x03,0x02,0x01,0x02,0x02,0x0B,0x04, -0x00,0x00,0x00,0x00,0x01,0x21,0x58,0x53,0x08,0xA2,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x30,0x4C,0x31,0x20,0x30,0x1E,0x06, -0x03,0x55,0x04,0x0B,0x13,0x17,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E, -0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x20,0x2D,0x20,0x52,0x33,0x31,0x13,0x30, -0x11,0x06,0x03,0x55,0x04,0x0A,0x13,0x0A,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69, -0x67,0x6E,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0A,0x47,0x6C,0x6F, -0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,0x30,0x1E,0x17,0x0D,0x30,0x39,0x30,0x33,0x31, -0x38,0x31,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x32,0x39,0x30,0x33,0x31,0x38, -0x31,0x30,0x30,0x30,0x30,0x30,0x5A,0x30,0x4C,0x31,0x20,0x30,0x1E,0x06,0x03,0x55, -0x04,0x0B,0x13,0x17,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E,0x20,0x52, -0x6F,0x6F,0x74,0x20,0x43,0x41,0x20,0x2D,0x20,0x52,0x33,0x31,0x13,0x30,0x11,0x06, -0x03,0x55,0x04,0x0A,0x13,0x0A,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x53,0x69,0x67,0x6E, -0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0A,0x47,0x6C,0x6F,0x62,0x61, -0x6C,0x53,0x69,0x67,0x6E,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48, -0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01, -0x0A,0x02,0x82,0x01,0x01,0x00,0xCC,0x25,0x76,0x90,0x79,0x06,0x78,0x22,0x16,0xF5, -0xC0,0x83,0xB6,0x84,0xCA,0x28,0x9E,0xFD,0x05,0x76,0x11,0xC5,0xAD,0x88,0x72,0xFC, -0x46,0x02,0x43,0xC7,0xB2,0x8A,0x9D,0x04,0x5F,0x24,0xCB,0x2E,0x4B,0xE1,0x60,0x82, -0x46,0xE1,0x52,0xAB,0x0C,0x81,0x47,0x70,0x6C,0xDD,0x64,0xD1,0xEB,0xF5,0x2C,0xA3, -0x0F,0x82,0x3D,0x0C,0x2B,0xAE,0x97,0xD7,0xB6,0x14,0x86,0x10,0x79,0xBB,0x3B,0x13, -0x80,0x77,0x8C,0x08,0xE1,0x49,0xD2,0x6A,0x62,0x2F,0x1F,0x5E,0xFA,0x96,0x68,0xDF, -0x89,0x27,0x95,0x38,0x9F,0x06,0xD7,0x3E,0xC9,0xCB,0x26,0x59,0x0D,0x73,0xDE,0xB0, -0xC8,0xE9,0x26,0x0E,0x83,0x15,0xC6,0xEF,0x5B,0x8B,0xD2,0x04,0x60,0xCA,0x49,0xA6, -0x28,0xF6,0x69,0x3B,0xF6,0xCB,0xC8,0x28,0x91,0xE5,0x9D,0x8A,0x61,0x57,0x37,0xAC, -0x74,0x14,0xDC,0x74,0xE0,0x3A,0xEE,0x72,0x2F,0x2E,0x9C,0xFB,0xD0,0xBB,0xBF,0xF5, -0x3D,0x00,0xE1,0x06,0x33,0xE8,0x82,0x2B,0xAE,0x53,0xA6,0x3A,0x16,0x73,0x8C,0xDD, -0x41,0x0E,0x20,0x3A,0xC0,0xB4,0xA7,0xA1,0xE9,0xB2,0x4F,0x90,0x2E,0x32,0x60,0xE9, -0x57,0xCB,0xB9,0x04,0x92,0x68,0x68,0xE5,0x38,0x26,0x60,0x75,0xB2,0x9F,0x77,0xFF, -0x91,0x14,0xEF,0xAE,0x20,0x49,0xFC,0xAD,0x40,0x15,0x48,0xD1,0x02,0x31,0x61,0x19, -0x5E,0xB8,0x97,0xEF,0xAD,0x77,0xB7,0x64,0x9A,0x7A,0xBF,0x5F,0xC1,0x13,0xEF,0x9B, -0x62,0xFB,0x0D,0x6C,0xE0,0x54,0x69,0x16,0xA9,0x03,0xDA,0x6E,0xE9,0x83,0x93,0x71, -0x76,0xC6,0x69,0x85,0x82,0x17,0x02,0x03,0x01,0x00,0x01,0xA3,0x42,0x30,0x40,0x30, -0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30, -0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF, -0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x8F,0xF0,0x4B,0x7F,0xA8, -0x2E,0x45,0x24,0xAE,0x4D,0x50,0xFA,0x63,0x9A,0x8B,0xDE,0xE2,0xDD,0x1B,0xBC,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x03,0x82, -0x01,0x01,0x00,0x4B,0x40,0xDB,0xC0,0x50,0xAA,0xFE,0xC8,0x0C,0xEF,0xF7,0x96,0x54, -0x45,0x49,0xBB,0x96,0x00,0x09,0x41,0xAC,0xB3,0x13,0x86,0x86,0x28,0x07,0x33,0xCA, -0x6B,0xE6,0x74,0xB9,0xBA,0x00,0x2D,0xAE,0xA4,0x0A,0xD3,0xF5,0xF1,0xF1,0x0F,0x8A, -0xBF,0x73,0x67,0x4A,0x83,0xC7,0x44,0x7B,0x78,0xE0,0xAF,0x6E,0x6C,0x6F,0x03,0x29, -0x8E,0x33,0x39,0x45,0xC3,0x8E,0xE4,0xB9,0x57,0x6C,0xAA,0xFC,0x12,0x96,0xEC,0x53, -0xC6,0x2D,0xE4,0x24,0x6C,0xB9,0x94,0x63,0xFB,0xDC,0x53,0x68,0x67,0x56,0x3E,0x83, -0xB8,0xCF,0x35,0x21,0xC3,0xC9,0x68,0xFE,0xCE,0xDA,0xC2,0x53,0xAA,0xCC,0x90,0x8A, -0xE9,0xF0,0x5D,0x46,0x8C,0x95,0xDD,0x7A,0x58,0x28,0x1A,0x2F,0x1D,0xDE,0xCD,0x00, -0x37,0x41,0x8F,0xED,0x44,0x6D,0xD7,0x53,0x28,0x97,0x7E,0xF3,0x67,0x04,0x1E,0x15, -0xD7,0x8A,0x96,0xB4,0xD3,0xDE,0x4C,0x27,0xA4,0x4C,0x1B,0x73,0x73,0x76,0xF4,0x17, -0x99,0xC2,0x1F,0x7A,0x0E,0xE3,0x2D,0x08,0xAD,0x0A,0x1C,0x2C,0xFF,0x3C,0xAB,0x55, -0x0E,0x0F,0x91,0x7E,0x36,0xEB,0xC3,0x57,0x49,0xBE,0xE1,0x2E,0x2D,0x7C,0x60,0x8B, -0xC3,0x41,0x51,0x13,0x23,0x9D,0xCE,0xF7,0x32,0x6B,0x94,0x01,0xA8,0x99,0xE7,0x2C, -0x33,0x1F,0x3A,0x3B,0x25,0xD2,0x86,0x40,0xCE,0x3B,0x2C,0x86,0x78,0xC9,0x61,0x2F, -0x14,0xBA,0xEE,0xDB,0x55,0x6F,0xDF,0x84,0xEE,0x05,0x09,0x4D,0xBD,0x28,0xD8,0x72, -0xCE,0xD3,0x62,0x50,0x65,0x1E,0xEB,0x92,0x97,0x83,0x31,0xD9,0xB3,0xB5,0xCA,0x47, -0x58,0x3F,0x5F, -}; - - -/* subject:/C=US/O=The Go Daddy Group, Inc./OU=Go Daddy Class 2 Certification Authority */ -/* issuer :/C=US/O=The Go Daddy Group, Inc./OU=Go Daddy Class 2 Certification Authority */ - - -const unsigned char Go_Daddy_Class_2_CA_certificate[1028]={ -0x30,0x82,0x04,0x00,0x30,0x82,0x02,0xE8,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x00, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x63,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x21, -0x30,0x1F,0x06,0x03,0x55,0x04,0x0A,0x13,0x18,0x54,0x68,0x65,0x20,0x47,0x6F,0x20, -0x44,0x61,0x64,0x64,0x79,0x20,0x47,0x72,0x6F,0x75,0x70,0x2C,0x20,0x49,0x6E,0x63, -0x2E,0x31,0x31,0x30,0x2F,0x06,0x03,0x55,0x04,0x0B,0x13,0x28,0x47,0x6F,0x20,0x44, -0x61,0x64,0x64,0x79,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x32,0x20,0x43,0x65,0x72, -0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F, -0x72,0x69,0x74,0x79,0x30,0x1E,0x17,0x0D,0x30,0x34,0x30,0x36,0x32,0x39,0x31,0x37, -0x30,0x36,0x32,0x30,0x5A,0x17,0x0D,0x33,0x34,0x30,0x36,0x32,0x39,0x31,0x37,0x30, -0x36,0x32,0x30,0x5A,0x30,0x63,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13, -0x02,0x55,0x53,0x31,0x21,0x30,0x1F,0x06,0x03,0x55,0x04,0x0A,0x13,0x18,0x54,0x68, -0x65,0x20,0x47,0x6F,0x20,0x44,0x61,0x64,0x64,0x79,0x20,0x47,0x72,0x6F,0x75,0x70, -0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x31,0x30,0x2F,0x06,0x03,0x55,0x04,0x0B,0x13, -0x28,0x47,0x6F,0x20,0x44,0x61,0x64,0x64,0x79,0x20,0x43,0x6C,0x61,0x73,0x73,0x20, -0x32,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20, -0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x82,0x01,0x20,0x30,0x0D,0x06, -0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0D, -0x00,0x30,0x82,0x01,0x08,0x02,0x82,0x01,0x01,0x00,0xDE,0x9D,0xD7,0xEA,0x57,0x18, -0x49,0xA1,0x5B,0xEB,0xD7,0x5F,0x48,0x86,0xEA,0xBE,0xDD,0xFF,0xE4,0xEF,0x67,0x1C, -0xF4,0x65,0x68,0xB3,0x57,0x71,0xA0,0x5E,0x77,0xBB,0xED,0x9B,0x49,0xE9,0x70,0x80, -0x3D,0x56,0x18,0x63,0x08,0x6F,0xDA,0xF2,0xCC,0xD0,0x3F,0x7F,0x02,0x54,0x22,0x54, -0x10,0xD8,0xB2,0x81,0xD4,0xC0,0x75,0x3D,0x4B,0x7F,0xC7,0x77,0xC3,0x3E,0x78,0xAB, -0x1A,0x03,0xB5,0x20,0x6B,0x2F,0x6A,0x2B,0xB1,0xC5,0x88,0x7E,0xC4,0xBB,0x1E,0xB0, -0xC1,0xD8,0x45,0x27,0x6F,0xAA,0x37,0x58,0xF7,0x87,0x26,0xD7,0xD8,0x2D,0xF6,0xA9, -0x17,0xB7,0x1F,0x72,0x36,0x4E,0xA6,0x17,0x3F,0x65,0x98,0x92,0xDB,0x2A,0x6E,0x5D, -0xA2,0xFE,0x88,0xE0,0x0B,0xDE,0x7F,0xE5,0x8D,0x15,0xE1,0xEB,0xCB,0x3A,0xD5,0xE2, -0x12,0xA2,0x13,0x2D,0xD8,0x8E,0xAF,0x5F,0x12,0x3D,0xA0,0x08,0x05,0x08,0xB6,0x5C, -0xA5,0x65,0x38,0x04,0x45,0x99,0x1E,0xA3,0x60,0x60,0x74,0xC5,0x41,0xA5,0x72,0x62, -0x1B,0x62,0xC5,0x1F,0x6F,0x5F,0x1A,0x42,0xBE,0x02,0x51,0x65,0xA8,0xAE,0x23,0x18, -0x6A,0xFC,0x78,0x03,0xA9,0x4D,0x7F,0x80,0xC3,0xFA,0xAB,0x5A,0xFC,0xA1,0x40,0xA4, -0xCA,0x19,0x16,0xFE,0xB2,0xC8,0xEF,0x5E,0x73,0x0D,0xEE,0x77,0xBD,0x9A,0xF6,0x79, -0x98,0xBC,0xB1,0x07,0x67,0xA2,0x15,0x0D,0xDD,0xA0,0x58,0xC6,0x44,0x7B,0x0A,0x3E, -0x62,0x28,0x5F,0xBA,0x41,0x07,0x53,0x58,0xCF,0x11,0x7E,0x38,0x74,0xC5,0xF8,0xFF, -0xB5,0x69,0x90,0x8F,0x84,0x74,0xEA,0x97,0x1B,0xAF,0x02,0x01,0x03,0xA3,0x81,0xC0, -0x30,0x81,0xBD,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xD2,0xC4, -0xB0,0xD2,0x91,0xD4,0x4C,0x11,0x71,0xB3,0x61,0xCB,0x3D,0xA1,0xFE,0xDD,0xA8,0x6A, -0xD4,0xE3,0x30,0x81,0x8D,0x06,0x03,0x55,0x1D,0x23,0x04,0x81,0x85,0x30,0x81,0x82, -0x80,0x14,0xD2,0xC4,0xB0,0xD2,0x91,0xD4,0x4C,0x11,0x71,0xB3,0x61,0xCB,0x3D,0xA1, -0xFE,0xDD,0xA8,0x6A,0xD4,0xE3,0xA1,0x67,0xA4,0x65,0x30,0x63,0x31,0x0B,0x30,0x09, -0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x21,0x30,0x1F,0x06,0x03,0x55, -0x04,0x0A,0x13,0x18,0x54,0x68,0x65,0x20,0x47,0x6F,0x20,0x44,0x61,0x64,0x64,0x79, -0x20,0x47,0x72,0x6F,0x75,0x70,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x31,0x30,0x2F, -0x06,0x03,0x55,0x04,0x0B,0x13,0x28,0x47,0x6F,0x20,0x44,0x61,0x64,0x64,0x79,0x20, -0x43,0x6C,0x61,0x73,0x73,0x20,0x32,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63, -0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x82, -0x01,0x00,0x30,0x0C,0x06,0x03,0x55,0x1D,0x13,0x04,0x05,0x30,0x03,0x01,0x01,0xFF, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03, -0x82,0x01,0x01,0x00,0x32,0x4B,0xF3,0xB2,0xCA,0x3E,0x91,0xFC,0x12,0xC6,0xA1,0x07, -0x8C,0x8E,0x77,0xA0,0x33,0x06,0x14,0x5C,0x90,0x1E,0x18,0xF7,0x08,0xA6,0x3D,0x0A, -0x19,0xF9,0x87,0x80,0x11,0x6E,0x69,0xE4,0x96,0x17,0x30,0xFF,0x34,0x91,0x63,0x72, -0x38,0xEE,0xCC,0x1C,0x01,0xA3,0x1D,0x94,0x28,0xA4,0x31,0xF6,0x7A,0xC4,0x54,0xD7, -0xF6,0xE5,0x31,0x58,0x03,0xA2,0xCC,0xCE,0x62,0xDB,0x94,0x45,0x73,0xB5,0xBF,0x45, -0xC9,0x24,0xB5,0xD5,0x82,0x02,0xAD,0x23,0x79,0x69,0x8D,0xB8,0xB6,0x4D,0xCE,0xCF, -0x4C,0xCA,0x33,0x23,0xE8,0x1C,0x88,0xAA,0x9D,0x8B,0x41,0x6E,0x16,0xC9,0x20,0xE5, -0x89,0x9E,0xCD,0x3B,0xDA,0x70,0xF7,0x7E,0x99,0x26,0x20,0x14,0x54,0x25,0xAB,0x6E, -0x73,0x85,0xE6,0x9B,0x21,0x9D,0x0A,0x6C,0x82,0x0E,0xA8,0xF8,0xC2,0x0C,0xFA,0x10, -0x1E,0x6C,0x96,0xEF,0x87,0x0D,0xC4,0x0F,0x61,0x8B,0xAD,0xEE,0x83,0x2B,0x95,0xF8, -0x8E,0x92,0x84,0x72,0x39,0xEB,0x20,0xEA,0x83,0xED,0x83,0xCD,0x97,0x6E,0x08,0xBC, -0xEB,0x4E,0x26,0xB6,0x73,0x2B,0xE4,0xD3,0xF6,0x4C,0xFE,0x26,0x71,0xE2,0x61,0x11, -0x74,0x4A,0xFF,0x57,0x1A,0x87,0x0F,0x75,0x48,0x2E,0xCF,0x51,0x69,0x17,0xA0,0x02, -0x12,0x61,0x95,0xD5,0xD1,0x40,0xB2,0x10,0x4C,0xEE,0xC4,0xAC,0x10,0x43,0xA6,0xA5, -0x9E,0x0A,0xD5,0x95,0x62,0x9A,0x0D,0xCF,0x88,0x82,0xC5,0x32,0x0C,0xE4,0x2B,0x9F, -0x45,0xE6,0x0D,0x9F,0x28,0x9C,0xB1,0xB9,0x2A,0x5A,0x57,0xAD,0x37,0x0F,0xAF,0x1D, -0x7F,0xDB,0xBD,0x9F, -}; - - -/* subject:/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./CN=Go Daddy Root Certificate Authority - G2 */ -/* issuer :/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./CN=Go Daddy Root Certificate Authority - G2 */ - - -const unsigned char Go_Daddy_Root_Certificate_Authority___G2_certificate[969]={ -0x30,0x82,0x03,0xC5,0x30,0x82,0x02,0xAD,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x00, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x30, -0x81,0x83,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31, -0x10,0x30,0x0E,0x06,0x03,0x55,0x04,0x08,0x13,0x07,0x41,0x72,0x69,0x7A,0x6F,0x6E, -0x61,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x07,0x13,0x0A,0x53,0x63,0x6F,0x74, -0x74,0x73,0x64,0x61,0x6C,0x65,0x31,0x1A,0x30,0x18,0x06,0x03,0x55,0x04,0x0A,0x13, -0x11,0x47,0x6F,0x44,0x61,0x64,0x64,0x79,0x2E,0x63,0x6F,0x6D,0x2C,0x20,0x49,0x6E, -0x63,0x2E,0x31,0x31,0x30,0x2F,0x06,0x03,0x55,0x04,0x03,0x13,0x28,0x47,0x6F,0x20, -0x44,0x61,0x64,0x64,0x79,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x65,0x72,0x74,0x69, -0x66,0x69,0x63,0x61,0x74,0x65,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79, -0x20,0x2D,0x20,0x47,0x32,0x30,0x1E,0x17,0x0D,0x30,0x39,0x30,0x39,0x30,0x31,0x30, -0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x37,0x31,0x32,0x33,0x31,0x32,0x33, -0x35,0x39,0x35,0x39,0x5A,0x30,0x81,0x83,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04, -0x06,0x13,0x02,0x55,0x53,0x31,0x10,0x30,0x0E,0x06,0x03,0x55,0x04,0x08,0x13,0x07, -0x41,0x72,0x69,0x7A,0x6F,0x6E,0x61,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x07, -0x13,0x0A,0x53,0x63,0x6F,0x74,0x74,0x73,0x64,0x61,0x6C,0x65,0x31,0x1A,0x30,0x18, -0x06,0x03,0x55,0x04,0x0A,0x13,0x11,0x47,0x6F,0x44,0x61,0x64,0x64,0x79,0x2E,0x63, -0x6F,0x6D,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x31,0x30,0x2F,0x06,0x03,0x55,0x04, -0x03,0x13,0x28,0x47,0x6F,0x20,0x44,0x61,0x64,0x64,0x79,0x20,0x52,0x6F,0x6F,0x74, -0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x20,0x41,0x75,0x74, -0x68,0x6F,0x72,0x69,0x74,0x79,0x20,0x2D,0x20,0x47,0x32,0x30,0x82,0x01,0x22,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82, -0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xBF,0x71,0x62,0x08, -0xF1,0xFA,0x59,0x34,0xF7,0x1B,0xC9,0x18,0xA3,0xF7,0x80,0x49,0x58,0xE9,0x22,0x83, -0x13,0xA6,0xC5,0x20,0x43,0x01,0x3B,0x84,0xF1,0xE6,0x85,0x49,0x9F,0x27,0xEA,0xF6, -0x84,0x1B,0x4E,0xA0,0xB4,0xDB,0x70,0x98,0xC7,0x32,0x01,0xB1,0x05,0x3E,0x07,0x4E, -0xEE,0xF4,0xFA,0x4F,0x2F,0x59,0x30,0x22,0xE7,0xAB,0x19,0x56,0x6B,0xE2,0x80,0x07, -0xFC,0xF3,0x16,0x75,0x80,0x39,0x51,0x7B,0xE5,0xF9,0x35,0xB6,0x74,0x4E,0xA9,0x8D, -0x82,0x13,0xE4,0xB6,0x3F,0xA9,0x03,0x83,0xFA,0xA2,0xBE,0x8A,0x15,0x6A,0x7F,0xDE, -0x0B,0xC3,0xB6,0x19,0x14,0x05,0xCA,0xEA,0xC3,0xA8,0x04,0x94,0x3B,0x46,0x7C,0x32, -0x0D,0xF3,0x00,0x66,0x22,0xC8,0x8D,0x69,0x6D,0x36,0x8C,0x11,0x18,0xB7,0xD3,0xB2, -0x1C,0x60,0xB4,0x38,0xFA,0x02,0x8C,0xCE,0xD3,0xDD,0x46,0x07,0xDE,0x0A,0x3E,0xEB, -0x5D,0x7C,0xC8,0x7C,0xFB,0xB0,0x2B,0x53,0xA4,0x92,0x62,0x69,0x51,0x25,0x05,0x61, -0x1A,0x44,0x81,0x8C,0x2C,0xA9,0x43,0x96,0x23,0xDF,0xAC,0x3A,0x81,0x9A,0x0E,0x29, -0xC5,0x1C,0xA9,0xE9,0x5D,0x1E,0xB6,0x9E,0x9E,0x30,0x0A,0x39,0xCE,0xF1,0x88,0x80, -0xFB,0x4B,0x5D,0xCC,0x32,0xEC,0x85,0x62,0x43,0x25,0x34,0x02,0x56,0x27,0x01,0x91, -0xB4,0x3B,0x70,0x2A,0x3F,0x6E,0xB1,0xE8,0x9C,0x88,0x01,0x7D,0x9F,0xD4,0xF9,0xDB, -0x53,0x6D,0x60,0x9D,0xBF,0x2C,0xE7,0x58,0xAB,0xB8,0x5F,0x46,0xFC,0xCE,0xC4,0x1B, -0x03,0x3C,0x09,0xEB,0x49,0x31,0x5C,0x69,0x46,0xB3,0xE0,0x47,0x02,0x03,0x01,0x00, -0x01,0xA3,0x42,0x30,0x40,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04, -0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF, -0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04, -0x14,0x3A,0x9A,0x85,0x07,0x10,0x67,0x28,0xB6,0xEF,0xF6,0xBD,0x05,0x41,0x6E,0x20, -0xC1,0x94,0xDA,0x0F,0xDE,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, -0x01,0x0B,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x99,0xDB,0x5D,0x79,0xD5,0xF9,0x97, -0x59,0x67,0x03,0x61,0xF1,0x7E,0x3B,0x06,0x31,0x75,0x2D,0xA1,0x20,0x8E,0x4F,0x65, -0x87,0xB4,0xF7,0xA6,0x9C,0xBC,0xD8,0xE9,0x2F,0xD0,0xDB,0x5A,0xEE,0xCF,0x74,0x8C, -0x73,0xB4,0x38,0x42,0xDA,0x05,0x7B,0xF8,0x02,0x75,0xB8,0xFD,0xA5,0xB1,0xD7,0xAE, -0xF6,0xD7,0xDE,0x13,0xCB,0x53,0x10,0x7E,0x8A,0x46,0xD1,0x97,0xFA,0xB7,0x2E,0x2B, -0x11,0xAB,0x90,0xB0,0x27,0x80,0xF9,0xE8,0x9F,0x5A,0xE9,0x37,0x9F,0xAB,0xE4,0xDF, -0x6C,0xB3,0x85,0x17,0x9D,0x3D,0xD9,0x24,0x4F,0x79,0x91,0x35,0xD6,0x5F,0x04,0xEB, -0x80,0x83,0xAB,0x9A,0x02,0x2D,0xB5,0x10,0xF4,0xD8,0x90,0xC7,0x04,0x73,0x40,0xED, -0x72,0x25,0xA0,0xA9,0x9F,0xEC,0x9E,0xAB,0x68,0x12,0x99,0x57,0xC6,0x8F,0x12,0x3A, -0x09,0xA4,0xBD,0x44,0xFD,0x06,0x15,0x37,0xC1,0x9B,0xE4,0x32,0xA3,0xED,0x38,0xE8, -0xD8,0x64,0xF3,0x2C,0x7E,0x14,0xFC,0x02,0xEA,0x9F,0xCD,0xFF,0x07,0x68,0x17,0xDB, -0x22,0x90,0x38,0x2D,0x7A,0x8D,0xD1,0x54,0xF1,0x69,0xE3,0x5F,0x33,0xCA,0x7A,0x3D, -0x7B,0x0A,0xE3,0xCA,0x7F,0x5F,0x39,0xE5,0xE2,0x75,0xBA,0xC5,0x76,0x18,0x33,0xCE, -0x2C,0xF0,0x2F,0x4C,0xAD,0xF7,0xB1,0xE7,0xCE,0x4F,0xA8,0xC4,0x9B,0x4A,0x54,0x06, -0xC5,0x7F,0x7D,0xD5,0x08,0x0F,0xE2,0x1C,0xFE,0x7E,0x17,0xB8,0xAC,0x5E,0xF6,0xD4, -0x16,0xB2,0x43,0x09,0x0C,0x4D,0xF6,0xA7,0x6B,0xB4,0x99,0x84,0x65,0xCA,0x7A,0x88, -0xE2,0xE2,0x44,0xBE,0x5C,0xF7,0xEA,0x1C,0xF5, -}; - - -/* subject:/C=US/O=GTE Corporation/OU=GTE CyberTrust Solutions, Inc./CN=GTE CyberTrust Global Root */ -/* issuer :/C=US/O=GTE Corporation/OU=GTE CyberTrust Solutions, Inc./CN=GTE CyberTrust Global Root */ - - -const unsigned char GTE_CyberTrust_Global_Root_certificate[606]={ -0x30,0x82,0x02,0x5A,0x30,0x82,0x01,0xC3,0x02,0x02,0x01,0xA5,0x30,0x0D,0x06,0x09, -0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x04,0x05,0x00,0x30,0x75,0x31,0x0B,0x30, -0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x18,0x30,0x16,0x06,0x03, -0x55,0x04,0x0A,0x13,0x0F,0x47,0x54,0x45,0x20,0x43,0x6F,0x72,0x70,0x6F,0x72,0x61, -0x74,0x69,0x6F,0x6E,0x31,0x27,0x30,0x25,0x06,0x03,0x55,0x04,0x0B,0x13,0x1E,0x47, -0x54,0x45,0x20,0x43,0x79,0x62,0x65,0x72,0x54,0x72,0x75,0x73,0x74,0x20,0x53,0x6F, -0x6C,0x75,0x74,0x69,0x6F,0x6E,0x73,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x23,0x30, -0x21,0x06,0x03,0x55,0x04,0x03,0x13,0x1A,0x47,0x54,0x45,0x20,0x43,0x79,0x62,0x65, -0x72,0x54,0x72,0x75,0x73,0x74,0x20,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x20,0x52,0x6F, -0x6F,0x74,0x30,0x1E,0x17,0x0D,0x39,0x38,0x30,0x38,0x31,0x33,0x30,0x30,0x32,0x39, -0x30,0x30,0x5A,0x17,0x0D,0x31,0x38,0x30,0x38,0x31,0x33,0x32,0x33,0x35,0x39,0x30, -0x30,0x5A,0x30,0x75,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55, -0x53,0x31,0x18,0x30,0x16,0x06,0x03,0x55,0x04,0x0A,0x13,0x0F,0x47,0x54,0x45,0x20, -0x43,0x6F,0x72,0x70,0x6F,0x72,0x61,0x74,0x69,0x6F,0x6E,0x31,0x27,0x30,0x25,0x06, -0x03,0x55,0x04,0x0B,0x13,0x1E,0x47,0x54,0x45,0x20,0x43,0x79,0x62,0x65,0x72,0x54, -0x72,0x75,0x73,0x74,0x20,0x53,0x6F,0x6C,0x75,0x74,0x69,0x6F,0x6E,0x73,0x2C,0x20, -0x49,0x6E,0x63,0x2E,0x31,0x23,0x30,0x21,0x06,0x03,0x55,0x04,0x03,0x13,0x1A,0x47, -0x54,0x45,0x20,0x43,0x79,0x62,0x65,0x72,0x54,0x72,0x75,0x73,0x74,0x20,0x47,0x6C, -0x6F,0x62,0x61,0x6C,0x20,0x52,0x6F,0x6F,0x74,0x30,0x81,0x9F,0x30,0x0D,0x06,0x09, -0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x81,0x8D,0x00,0x30, -0x81,0x89,0x02,0x81,0x81,0x00,0x95,0x0F,0xA0,0xB6,0xF0,0x50,0x9C,0xE8,0x7A,0xC7, -0x88,0xCD,0xDD,0x17,0x0E,0x2E,0xB0,0x94,0xD0,0x1B,0x3D,0x0E,0xF6,0x94,0xC0,0x8A, -0x94,0xC7,0x06,0xC8,0x90,0x97,0xC8,0xB8,0x64,0x1A,0x7A,0x7E,0x6C,0x3C,0x53,0xE1, -0x37,0x28,0x73,0x60,0x7F,0xB2,0x97,0x53,0x07,0x9F,0x53,0xF9,0x6D,0x58,0x94,0xD2, -0xAF,0x8D,0x6D,0x88,0x67,0x80,0xE6,0xED,0xB2,0x95,0xCF,0x72,0x31,0xCA,0xA5,0x1C, -0x72,0xBA,0x5C,0x02,0xE7,0x64,0x42,0xE7,0xF9,0xA9,0x2C,0xD6,0x3A,0x0D,0xAC,0x8D, -0x42,0xAA,0x24,0x01,0x39,0xE6,0x9C,0x3F,0x01,0x85,0x57,0x0D,0x58,0x87,0x45,0xF8, -0xD3,0x85,0xAA,0x93,0x69,0x26,0x85,0x70,0x48,0x80,0x3F,0x12,0x15,0xC7,0x79,0xB4, -0x1F,0x05,0x2F,0x3B,0x62,0x99,0x02,0x03,0x01,0x00,0x01,0x30,0x0D,0x06,0x09,0x2A, -0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x04,0x05,0x00,0x03,0x81,0x81,0x00,0x6D,0xEB, -0x1B,0x09,0xE9,0x5E,0xD9,0x51,0xDB,0x67,0x22,0x61,0xA4,0x2A,0x3C,0x48,0x77,0xE3, -0xA0,0x7C,0xA6,0xDE,0x73,0xA2,0x14,0x03,0x85,0x3D,0xFB,0xAB,0x0E,0x30,0xC5,0x83, -0x16,0x33,0x81,0x13,0x08,0x9E,0x7B,0x34,0x4E,0xDF,0x40,0xC8,0x74,0xD7,0xB9,0x7D, -0xDC,0xF4,0x76,0x55,0x7D,0x9B,0x63,0x54,0x18,0xE9,0xF0,0xEA,0xF3,0x5C,0xB1,0xD9, -0x8B,0x42,0x1E,0xB9,0xC0,0x95,0x4E,0xBA,0xFA,0xD5,0xE2,0x7C,0xF5,0x68,0x61,0xBF, -0x8E,0xEC,0x05,0x97,0x5F,0x5B,0xB0,0xD7,0xA3,0x85,0x34,0xC4,0x24,0xA7,0x0D,0x0F, -0x95,0x93,0xEF,0xCB,0x94,0xD8,0x9E,0x1F,0x9D,0x5C,0x85,0x6D,0xC7,0xAA,0xAE,0x4F, -0x1F,0x22,0xB5,0xCD,0x95,0xAD,0xBA,0xA7,0xCC,0xF9,0xAB,0x0B,0x7A,0x7F, -}; - - -/* subject:/C=US/O=Network Solutions L.L.C./CN=Network Solutions Certificate Authority */ -/* issuer :/C=US/O=Network Solutions L.L.C./CN=Network Solutions Certificate Authority */ - - -const unsigned char Network_Solutions_Certificate_Authority_certificate[1002]={ -0x30,0x82,0x03,0xE6,0x30,0x82,0x02,0xCE,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x57, -0xCB,0x33,0x6F,0xC2,0x5C,0x16,0xE6,0x47,0x16,0x17,0xE3,0x90,0x31,0x68,0xE0,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x62, -0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x21,0x30, -0x1F,0x06,0x03,0x55,0x04,0x0A,0x13,0x18,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x20, -0x53,0x6F,0x6C,0x75,0x74,0x69,0x6F,0x6E,0x73,0x20,0x4C,0x2E,0x4C,0x2E,0x43,0x2E, -0x31,0x30,0x30,0x2E,0x06,0x03,0x55,0x04,0x03,0x13,0x27,0x4E,0x65,0x74,0x77,0x6F, -0x72,0x6B,0x20,0x53,0x6F,0x6C,0x75,0x74,0x69,0x6F,0x6E,0x73,0x20,0x43,0x65,0x72, -0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69, -0x74,0x79,0x30,0x1E,0x17,0x0D,0x30,0x36,0x31,0x32,0x30,0x31,0x30,0x30,0x30,0x30, -0x30,0x30,0x5A,0x17,0x0D,0x32,0x39,0x31,0x32,0x33,0x31,0x32,0x33,0x35,0x39,0x35, -0x39,0x5A,0x30,0x62,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55, -0x53,0x31,0x21,0x30,0x1F,0x06,0x03,0x55,0x04,0x0A,0x13,0x18,0x4E,0x65,0x74,0x77, -0x6F,0x72,0x6B,0x20,0x53,0x6F,0x6C,0x75,0x74,0x69,0x6F,0x6E,0x73,0x20,0x4C,0x2E, -0x4C,0x2E,0x43,0x2E,0x31,0x30,0x30,0x2E,0x06,0x03,0x55,0x04,0x03,0x13,0x27,0x4E, -0x65,0x74,0x77,0x6F,0x72,0x6B,0x20,0x53,0x6F,0x6C,0x75,0x74,0x69,0x6F,0x6E,0x73, -0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x20,0x41,0x75,0x74, -0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82, -0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xE4,0xBC,0x7E,0x92,0x30,0x6D,0xC6,0xD8,0x8E, -0x2B,0x0B,0xBC,0x46,0xCE,0xE0,0x27,0x96,0xDE,0xDE,0xF9,0xFA,0x12,0xD3,0x3C,0x33, -0x73,0xB3,0x04,0x2F,0xBC,0x71,0x8C,0xE5,0x9F,0xB6,0x22,0x60,0x3E,0x5F,0x5D,0xCE, -0x09,0xFF,0x82,0x0C,0x1B,0x9A,0x51,0x50,0x1A,0x26,0x89,0xDD,0xD5,0x61,0x5D,0x19, -0xDC,0x12,0x0F,0x2D,0x0A,0xA2,0x43,0x5D,0x17,0xD0,0x34,0x92,0x20,0xEA,0x73,0xCF, -0x38,0x2C,0x06,0x26,0x09,0x7A,0x72,0xF7,0xFA,0x50,0x32,0xF8,0xC2,0x93,0xD3,0x69, -0xA2,0x23,0xCE,0x41,0xB1,0xCC,0xE4,0xD5,0x1F,0x36,0xD1,0x8A,0x3A,0xF8,0x8C,0x63, -0xE2,0x14,0x59,0x69,0xED,0x0D,0xD3,0x7F,0x6B,0xE8,0xB8,0x03,0xE5,0x4F,0x6A,0xE5, -0x98,0x63,0x69,0x48,0x05,0xBE,0x2E,0xFF,0x33,0xB6,0xE9,0x97,0x59,0x69,0xF8,0x67, -0x19,0xAE,0x93,0x61,0x96,0x44,0x15,0xD3,0x72,0xB0,0x3F,0xBC,0x6A,0x7D,0xEC,0x48, -0x7F,0x8D,0xC3,0xAB,0xAA,0x71,0x2B,0x53,0x69,0x41,0x53,0x34,0xB5,0xB0,0xB9,0xC5, -0x06,0x0A,0xC4,0xB0,0x45,0xF5,0x41,0x5D,0x6E,0x89,0x45,0x7B,0x3D,0x3B,0x26,0x8C, -0x74,0xC2,0xE5,0xD2,0xD1,0x7D,0xB2,0x11,0xD4,0xFB,0x58,0x32,0x22,0x9A,0x80,0xC9, -0xDC,0xFD,0x0C,0xE9,0x7F,0x5E,0x03,0x97,0xCE,0x3B,0x00,0x14,0x87,0x27,0x70,0x38, -0xA9,0x8E,0x6E,0xB3,0x27,0x76,0x98,0x51,0xE0,0x05,0xE3,0x21,0xAB,0x1A,0xD5,0x85, -0x22,0x3C,0x29,0xB5,0x9A,0x16,0xC5,0x80,0xA8,0xF4,0xBB,0x6B,0x30,0x8F,0x2F,0x46, -0x02,0xA2,0xB1,0x0C,0x22,0xE0,0xD3,0x02,0x03,0x01,0x00,0x01,0xA3,0x81,0x97,0x30, -0x81,0x94,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x21,0x30,0xC9, -0xFB,0x00,0xD7,0x4E,0x98,0xDA,0x87,0xAA,0x2A,0xD0,0xA7,0x2E,0xB1,0x40,0x31,0xA7, -0x4C,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01, -0x06,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01, -0x01,0xFF,0x30,0x52,0x06,0x03,0x55,0x1D,0x1F,0x04,0x4B,0x30,0x49,0x30,0x47,0xA0, -0x45,0xA0,0x43,0x86,0x41,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x63,0x72,0x6C,0x2E, -0x6E,0x65,0x74,0x73,0x6F,0x6C,0x73,0x73,0x6C,0x2E,0x63,0x6F,0x6D,0x2F,0x4E,0x65, -0x74,0x77,0x6F,0x72,0x6B,0x53,0x6F,0x6C,0x75,0x74,0x69,0x6F,0x6E,0x73,0x43,0x65, -0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x41,0x75,0x74,0x68,0x6F,0x72,0x69, -0x74,0x79,0x2E,0x63,0x72,0x6C,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D, -0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0xBB,0xAE,0x4B,0xE7,0xB7,0x57, -0xEB,0x7F,0xAA,0x2D,0xB7,0x73,0x47,0x85,0x6A,0xC1,0xE4,0xA5,0x1D,0xE4,0xE7,0x3C, -0xE9,0xF4,0x59,0x65,0x77,0xB5,0x7A,0x5B,0x5A,0x8D,0x25,0x36,0xE0,0x7A,0x97,0x2E, -0x38,0xC0,0x57,0x60,0x83,0x98,0x06,0x83,0x9F,0xB9,0x76,0x7A,0x6E,0x50,0xE0,0xBA, -0x88,0x2C,0xFC,0x45,0xCC,0x18,0xB0,0x99,0x95,0x51,0x0E,0xEC,0x1D,0xB8,0x88,0xFF, -0x87,0x50,0x1C,0x82,0xC2,0xE3,0xE0,0x32,0x80,0xBF,0xA0,0x0B,0x47,0xC8,0xC3,0x31, -0xEF,0x99,0x67,0x32,0x80,0x4F,0x17,0x21,0x79,0x0C,0x69,0x5C,0xDE,0x5E,0x34,0xAE, -0x02,0xB5,0x26,0xEA,0x50,0xDF,0x7F,0x18,0x65,0x2C,0xC9,0xF2,0x63,0xE1,0xA9,0x07, -0xFE,0x7C,0x71,0x1F,0x6B,0x33,0x24,0x6A,0x1E,0x05,0xF7,0x05,0x68,0xC0,0x6A,0x12, -0xCB,0x2E,0x5E,0x61,0xCB,0xAE,0x28,0xD3,0x7E,0xC2,0xB4,0x66,0x91,0x26,0x5F,0x3C, -0x2E,0x24,0x5F,0xCB,0x58,0x0F,0xEB,0x28,0xEC,0xAF,0x11,0x96,0xF3,0xDC,0x7B,0x6F, -0xC0,0xA7,0x88,0xF2,0x53,0x77,0xB3,0x60,0x5E,0xAE,0xAE,0x28,0xDA,0x35,0x2C,0x6F, -0x34,0x45,0xD3,0x26,0xE1,0xDE,0xEC,0x5B,0x4F,0x27,0x6B,0x16,0x7C,0xBD,0x44,0x04, -0x18,0x82,0xB3,0x89,0x79,0x17,0x10,0x71,0x3D,0x7A,0xA2,0x16,0x4E,0xF5,0x01,0xCD, -0xA4,0x6C,0x65,0x68,0xA1,0x49,0x76,0x5C,0x43,0xC9,0xD8,0xBC,0x36,0x67,0x6C,0xA5, -0x94,0xB5,0xD4,0xCC,0xB9,0xBD,0x6A,0x35,0x56,0x21,0xDE,0xD8,0xC3,0xEB,0xFB,0xCB, -0xA4,0x60,0x4C,0xB0,0x55,0xA0,0xA0,0x7B,0x57,0xB2, -}; - - -/* subject:/L=ValiCert Validation Network/O=ValiCert, Inc./OU=ValiCert Class 3 Policy Validation Authority/CN=http://www.valicert.com//emailAddress=info@valicert.com */ -/* issuer :/L=ValiCert Validation Network/O=ValiCert, Inc./OU=ValiCert Class 3 Policy Validation Authority/CN=http://www.valicert.com//emailAddress=info@valicert.com */ - - -const unsigned char RSA_Root_Certificate_1_certificate[747]={ -0x30,0x82,0x02,0xE7,0x30,0x82,0x02,0x50,0x02,0x01,0x01,0x30,0x0D,0x06,0x09,0x2A, -0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x81,0xBB,0x31,0x24,0x30, -0x22,0x06,0x03,0x55,0x04,0x07,0x13,0x1B,0x56,0x61,0x6C,0x69,0x43,0x65,0x72,0x74, -0x20,0x56,0x61,0x6C,0x69,0x64,0x61,0x74,0x69,0x6F,0x6E,0x20,0x4E,0x65,0x74,0x77, -0x6F,0x72,0x6B,0x31,0x17,0x30,0x15,0x06,0x03,0x55,0x04,0x0A,0x13,0x0E,0x56,0x61, -0x6C,0x69,0x43,0x65,0x72,0x74,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x35,0x30,0x33, -0x06,0x03,0x55,0x04,0x0B,0x13,0x2C,0x56,0x61,0x6C,0x69,0x43,0x65,0x72,0x74,0x20, -0x43,0x6C,0x61,0x73,0x73,0x20,0x33,0x20,0x50,0x6F,0x6C,0x69,0x63,0x79,0x20,0x56, -0x61,0x6C,0x69,0x64,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72, -0x69,0x74,0x79,0x31,0x21,0x30,0x1F,0x06,0x03,0x55,0x04,0x03,0x13,0x18,0x68,0x74, -0x74,0x70,0x3A,0x2F,0x2F,0x77,0x77,0x77,0x2E,0x76,0x61,0x6C,0x69,0x63,0x65,0x72, -0x74,0x2E,0x63,0x6F,0x6D,0x2F,0x31,0x20,0x30,0x1E,0x06,0x09,0x2A,0x86,0x48,0x86, -0xF7,0x0D,0x01,0x09,0x01,0x16,0x11,0x69,0x6E,0x66,0x6F,0x40,0x76,0x61,0x6C,0x69, -0x63,0x65,0x72,0x74,0x2E,0x63,0x6F,0x6D,0x30,0x1E,0x17,0x0D,0x39,0x39,0x30,0x36, -0x32,0x36,0x30,0x30,0x32,0x32,0x33,0x33,0x5A,0x17,0x0D,0x31,0x39,0x30,0x36,0x32, -0x36,0x30,0x30,0x32,0x32,0x33,0x33,0x5A,0x30,0x81,0xBB,0x31,0x24,0x30,0x22,0x06, -0x03,0x55,0x04,0x07,0x13,0x1B,0x56,0x61,0x6C,0x69,0x43,0x65,0x72,0x74,0x20,0x56, -0x61,0x6C,0x69,0x64,0x61,0x74,0x69,0x6F,0x6E,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72, -0x6B,0x31,0x17,0x30,0x15,0x06,0x03,0x55,0x04,0x0A,0x13,0x0E,0x56,0x61,0x6C,0x69, -0x43,0x65,0x72,0x74,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x35,0x30,0x33,0x06,0x03, -0x55,0x04,0x0B,0x13,0x2C,0x56,0x61,0x6C,0x69,0x43,0x65,0x72,0x74,0x20,0x43,0x6C, -0x61,0x73,0x73,0x20,0x33,0x20,0x50,0x6F,0x6C,0x69,0x63,0x79,0x20,0x56,0x61,0x6C, -0x69,0x64,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74, -0x79,0x31,0x21,0x30,0x1F,0x06,0x03,0x55,0x04,0x03,0x13,0x18,0x68,0x74,0x74,0x70, -0x3A,0x2F,0x2F,0x77,0x77,0x77,0x2E,0x76,0x61,0x6C,0x69,0x63,0x65,0x72,0x74,0x2E, -0x63,0x6F,0x6D,0x2F,0x31,0x20,0x30,0x1E,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D, -0x01,0x09,0x01,0x16,0x11,0x69,0x6E,0x66,0x6F,0x40,0x76,0x61,0x6C,0x69,0x63,0x65, -0x72,0x74,0x2E,0x63,0x6F,0x6D,0x30,0x81,0x9F,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48, -0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x81,0x8D,0x00,0x30,0x81,0x89,0x02, -0x81,0x81,0x00,0xE3,0x98,0x51,0x96,0x1C,0xE8,0xD5,0xB1,0x06,0x81,0x6A,0x57,0xC3, -0x72,0x75,0x93,0xAB,0xCF,0x9E,0xA6,0xFC,0xF3,0x16,0x52,0xD6,0x2D,0x4D,0x9F,0x35, -0x44,0xA8,0x2E,0x04,0x4D,0x07,0x49,0x8A,0x38,0x29,0xF5,0x77,0x37,0xE7,0xB7,0xAB, -0x5D,0xDF,0x36,0x71,0x14,0x99,0x8F,0xDC,0xC2,0x92,0xF1,0xE7,0x60,0x92,0x97,0xEC, -0xD8,0x48,0xDC,0xBF,0xC1,0x02,0x20,0xC6,0x24,0xA4,0x28,0x4C,0x30,0x5A,0x76,0x6D, -0xB1,0x5C,0xF3,0xDD,0xDE,0x9E,0x10,0x71,0xA1,0x88,0xC7,0x5B,0x9B,0x41,0x6D,0xCA, -0xB0,0xB8,0x8E,0x15,0xEE,0xAD,0x33,0x2B,0xCF,0x47,0x04,0x5C,0x75,0x71,0x0A,0x98, -0x24,0x98,0x29,0xA7,0x49,0x59,0xA5,0xDD,0xF8,0xB7,0x43,0x62,0x61,0xF3,0xD3,0xE2, -0xD0,0x55,0x3F,0x02,0x03,0x01,0x00,0x01,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86, -0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x81,0x81,0x00,0x56,0xBB,0x02,0x58,0x84, -0x67,0x08,0x2C,0xDF,0x1F,0xDB,0x7B,0x49,0x33,0xF5,0xD3,0x67,0x9D,0xF4,0xB4,0x0A, -0x10,0xB3,0xC9,0xC5,0x2C,0xE2,0x92,0x6A,0x71,0x78,0x27,0xF2,0x70,0x83,0x42,0xD3, -0x3E,0xCF,0xA9,0x54,0xF4,0xF1,0xD8,0x92,0x16,0x8C,0xD1,0x04,0xCB,0x4B,0xAB,0xC9, -0x9F,0x45,0xAE,0x3C,0x8A,0xA9,0xB0,0x71,0x33,0x5D,0xC8,0xC5,0x57,0xDF,0xAF,0xA8, -0x35,0xB3,0x7F,0x89,0x87,0xE9,0xE8,0x25,0x92,0xB8,0x7F,0x85,0x7A,0xAE,0xD6,0xBC, -0x1E,0x37,0x58,0x2A,0x67,0xC9,0x91,0xCF,0x2A,0x81,0x3E,0xED,0xC6,0x39,0xDF,0xC0, -0x3E,0x19,0x9C,0x19,0xCC,0x13,0x4D,0x82,0x41,0xB5,0x8C,0xDE,0xE0,0x3D,0x60,0x08, -0x20,0x0F,0x45,0x7E,0x6B,0xA2,0x7F,0xA3,0x8C,0x15,0xEE, -}; - - -/* subject:/C=US/O=Starfield Technologies, Inc./OU=Starfield Class 2 Certification Authority */ -/* issuer :/C=US/O=Starfield Technologies, Inc./OU=Starfield Class 2 Certification Authority */ - - -const unsigned char Starfield_Class_2_CA_certificate[1043]={ -0x30,0x82,0x04,0x0F,0x30,0x82,0x02,0xF7,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x00, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30, -0x68,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x25, -0x30,0x23,0x06,0x03,0x55,0x04,0x0A,0x13,0x1C,0x53,0x74,0x61,0x72,0x66,0x69,0x65, -0x6C,0x64,0x20,0x54,0x65,0x63,0x68,0x6E,0x6F,0x6C,0x6F,0x67,0x69,0x65,0x73,0x2C, -0x20,0x49,0x6E,0x63,0x2E,0x31,0x32,0x30,0x30,0x06,0x03,0x55,0x04,0x0B,0x13,0x29, -0x53,0x74,0x61,0x72,0x66,0x69,0x65,0x6C,0x64,0x20,0x43,0x6C,0x61,0x73,0x73,0x20, -0x32,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20, -0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x1E,0x17,0x0D,0x30,0x34,0x30, -0x36,0x32,0x39,0x31,0x37,0x33,0x39,0x31,0x36,0x5A,0x17,0x0D,0x33,0x34,0x30,0x36, -0x32,0x39,0x31,0x37,0x33,0x39,0x31,0x36,0x5A,0x30,0x68,0x31,0x0B,0x30,0x09,0x06, -0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x25,0x30,0x23,0x06,0x03,0x55,0x04, -0x0A,0x13,0x1C,0x53,0x74,0x61,0x72,0x66,0x69,0x65,0x6C,0x64,0x20,0x54,0x65,0x63, -0x68,0x6E,0x6F,0x6C,0x6F,0x67,0x69,0x65,0x73,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31, -0x32,0x30,0x30,0x06,0x03,0x55,0x04,0x0B,0x13,0x29,0x53,0x74,0x61,0x72,0x66,0x69, -0x65,0x6C,0x64,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x32,0x20,0x43,0x65,0x72,0x74, -0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72, -0x69,0x74,0x79,0x30,0x82,0x01,0x20,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7, -0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0D,0x00,0x30,0x82,0x01,0x08,0x02, -0x82,0x01,0x01,0x00,0xB7,0x32,0xC8,0xFE,0xE9,0x71,0xA6,0x04,0x85,0xAD,0x0C,0x11, -0x64,0xDF,0xCE,0x4D,0xEF,0xC8,0x03,0x18,0x87,0x3F,0xA1,0xAB,0xFB,0x3C,0xA6,0x9F, -0xF0,0xC3,0xA1,0xDA,0xD4,0xD8,0x6E,0x2B,0x53,0x90,0xFB,0x24,0xA4,0x3E,0x84,0xF0, -0x9E,0xE8,0x5F,0xEC,0xE5,0x27,0x44,0xF5,0x28,0xA6,0x3F,0x7B,0xDE,0xE0,0x2A,0xF0, -0xC8,0xAF,0x53,0x2F,0x9E,0xCA,0x05,0x01,0x93,0x1E,0x8F,0x66,0x1C,0x39,0xA7,0x4D, -0xFA,0x5A,0xB6,0x73,0x04,0x25,0x66,0xEB,0x77,0x7F,0xE7,0x59,0xC6,0x4A,0x99,0x25, -0x14,0x54,0xEB,0x26,0xC7,0xF3,0x7F,0x19,0xD5,0x30,0x70,0x8F,0xAF,0xB0,0x46,0x2A, -0xFF,0xAD,0xEB,0x29,0xED,0xD7,0x9F,0xAA,0x04,0x87,0xA3,0xD4,0xF9,0x89,0xA5,0x34, -0x5F,0xDB,0x43,0x91,0x82,0x36,0xD9,0x66,0x3C,0xB1,0xB8,0xB9,0x82,0xFD,0x9C,0x3A, -0x3E,0x10,0xC8,0x3B,0xEF,0x06,0x65,0x66,0x7A,0x9B,0x19,0x18,0x3D,0xFF,0x71,0x51, -0x3C,0x30,0x2E,0x5F,0xBE,0x3D,0x77,0x73,0xB2,0x5D,0x06,0x6C,0xC3,0x23,0x56,0x9A, -0x2B,0x85,0x26,0x92,0x1C,0xA7,0x02,0xB3,0xE4,0x3F,0x0D,0xAF,0x08,0x79,0x82,0xB8, -0x36,0x3D,0xEA,0x9C,0xD3,0x35,0xB3,0xBC,0x69,0xCA,0xF5,0xCC,0x9D,0xE8,0xFD,0x64, -0x8D,0x17,0x80,0x33,0x6E,0x5E,0x4A,0x5D,0x99,0xC9,0x1E,0x87,0xB4,0x9D,0x1A,0xC0, -0xD5,0x6E,0x13,0x35,0x23,0x5E,0xDF,0x9B,0x5F,0x3D,0xEF,0xD6,0xF7,0x76,0xC2,0xEA, -0x3E,0xBB,0x78,0x0D,0x1C,0x42,0x67,0x6B,0x04,0xD8,0xF8,0xD6,0xDA,0x6F,0x8B,0xF2, -0x44,0xA0,0x01,0xAB,0x02,0x01,0x03,0xA3,0x81,0xC5,0x30,0x81,0xC2,0x30,0x1D,0x06, -0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xBF,0x5F,0xB7,0xD1,0xCE,0xDD,0x1F,0x86, -0xF4,0x5B,0x55,0xAC,0xDC,0xD7,0x10,0xC2,0x0E,0xA9,0x88,0xE7,0x30,0x81,0x92,0x06, -0x03,0x55,0x1D,0x23,0x04,0x81,0x8A,0x30,0x81,0x87,0x80,0x14,0xBF,0x5F,0xB7,0xD1, -0xCE,0xDD,0x1F,0x86,0xF4,0x5B,0x55,0xAC,0xDC,0xD7,0x10,0xC2,0x0E,0xA9,0x88,0xE7, -0xA1,0x6C,0xA4,0x6A,0x30,0x68,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13, -0x02,0x55,0x53,0x31,0x25,0x30,0x23,0x06,0x03,0x55,0x04,0x0A,0x13,0x1C,0x53,0x74, -0x61,0x72,0x66,0x69,0x65,0x6C,0x64,0x20,0x54,0x65,0x63,0x68,0x6E,0x6F,0x6C,0x6F, -0x67,0x69,0x65,0x73,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x32,0x30,0x30,0x06,0x03, -0x55,0x04,0x0B,0x13,0x29,0x53,0x74,0x61,0x72,0x66,0x69,0x65,0x6C,0x64,0x20,0x43, -0x6C,0x61,0x73,0x73,0x20,0x32,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61, -0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x82,0x01, -0x00,0x30,0x0C,0x06,0x03,0x55,0x1D,0x13,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82, -0x01,0x01,0x00,0x05,0x9D,0x3F,0x88,0x9D,0xD1,0xC9,0x1A,0x55,0xA1,0xAC,0x69,0xF3, -0xF3,0x59,0xDA,0x9B,0x01,0x87,0x1A,0x4F,0x57,0xA9,0xA1,0x79,0x09,0x2A,0xDB,0xF7, -0x2F,0xB2,0x1E,0xCC,0xC7,0x5E,0x6A,0xD8,0x83,0x87,0xA1,0x97,0xEF,0x49,0x35,0x3E, -0x77,0x06,0x41,0x58,0x62,0xBF,0x8E,0x58,0xB8,0x0A,0x67,0x3F,0xEC,0xB3,0xDD,0x21, -0x66,0x1F,0xC9,0x54,0xFA,0x72,0xCC,0x3D,0x4C,0x40,0xD8,0x81,0xAF,0x77,0x9E,0x83, -0x7A,0xBB,0xA2,0xC7,0xF5,0x34,0x17,0x8E,0xD9,0x11,0x40,0xF4,0xFC,0x2C,0x2A,0x4D, -0x15,0x7F,0xA7,0x62,0x5D,0x2E,0x25,0xD3,0x00,0x0B,0x20,0x1A,0x1D,0x68,0xF9,0x17, -0xB8,0xF4,0xBD,0x8B,0xED,0x28,0x59,0xDD,0x4D,0x16,0x8B,0x17,0x83,0xC8,0xB2,0x65, -0xC7,0x2D,0x7A,0xA5,0xAA,0xBC,0x53,0x86,0x6D,0xDD,0x57,0xA4,0xCA,0xF8,0x20,0x41, -0x0B,0x68,0xF0,0xF4,0xFB,0x74,0xBE,0x56,0x5D,0x7A,0x79,0xF5,0xF9,0x1D,0x85,0xE3, -0x2D,0x95,0xBE,0xF5,0x71,0x90,0x43,0xCC,0x8D,0x1F,0x9A,0x00,0x0A,0x87,0x29,0xE9, -0x55,0x22,0x58,0x00,0x23,0xEA,0xE3,0x12,0x43,0x29,0x5B,0x47,0x08,0xDD,0x8C,0x41, -0x6A,0x65,0x06,0xA8,0xE5,0x21,0xAA,0x41,0xB4,0x95,0x21,0x95,0xB9,0x7D,0xD1,0x34, -0xAB,0x13,0xD6,0xAD,0xBC,0xDC,0xE2,0x3D,0x39,0xCD,0xBD,0x3E,0x75,0x70,0xA1,0x18, -0x59,0x03,0xC9,0x22,0xB4,0x8F,0x9C,0xD5,0x5E,0x2A,0xD7,0xA5,0xB6,0xD4,0x0A,0x6D, -0xF8,0xB7,0x40,0x11,0x46,0x9A,0x1F,0x79,0x0E,0x62,0xBF,0x0F,0x97,0xEC,0xE0,0x2F, -0x1F,0x17,0x94, -}; - - -/* subject:/C=US/ST=Arizona/L=Scottsdale/O=Starfield Technologies, Inc./CN=Starfield Root Certificate Authority - G2 */ -/* issuer :/C=US/ST=Arizona/L=Scottsdale/O=Starfield Technologies, Inc./CN=Starfield Root Certificate Authority - G2 */ - - -const unsigned char Starfield_Root_Certificate_Authority___G2_certificate[993]={ -0x30,0x82,0x03,0xDD,0x30,0x82,0x02,0xC5,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x00, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x30, -0x81,0x8F,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31, -0x10,0x30,0x0E,0x06,0x03,0x55,0x04,0x08,0x13,0x07,0x41,0x72,0x69,0x7A,0x6F,0x6E, -0x61,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x07,0x13,0x0A,0x53,0x63,0x6F,0x74, -0x74,0x73,0x64,0x61,0x6C,0x65,0x31,0x25,0x30,0x23,0x06,0x03,0x55,0x04,0x0A,0x13, -0x1C,0x53,0x74,0x61,0x72,0x66,0x69,0x65,0x6C,0x64,0x20,0x54,0x65,0x63,0x68,0x6E, -0x6F,0x6C,0x6F,0x67,0x69,0x65,0x73,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x32,0x30, -0x30,0x06,0x03,0x55,0x04,0x03,0x13,0x29,0x53,0x74,0x61,0x72,0x66,0x69,0x65,0x6C, -0x64,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61, -0x74,0x65,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x20,0x2D,0x20,0x47, -0x32,0x30,0x1E,0x17,0x0D,0x30,0x39,0x30,0x39,0x30,0x31,0x30,0x30,0x30,0x30,0x30, -0x30,0x5A,0x17,0x0D,0x33,0x37,0x31,0x32,0x33,0x31,0x32,0x33,0x35,0x39,0x35,0x39, -0x5A,0x30,0x81,0x8F,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55, -0x53,0x31,0x10,0x30,0x0E,0x06,0x03,0x55,0x04,0x08,0x13,0x07,0x41,0x72,0x69,0x7A, -0x6F,0x6E,0x61,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x07,0x13,0x0A,0x53,0x63, -0x6F,0x74,0x74,0x73,0x64,0x61,0x6C,0x65,0x31,0x25,0x30,0x23,0x06,0x03,0x55,0x04, -0x0A,0x13,0x1C,0x53,0x74,0x61,0x72,0x66,0x69,0x65,0x6C,0x64,0x20,0x54,0x65,0x63, -0x68,0x6E,0x6F,0x6C,0x6F,0x67,0x69,0x65,0x73,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31, -0x32,0x30,0x30,0x06,0x03,0x55,0x04,0x03,0x13,0x29,0x53,0x74,0x61,0x72,0x66,0x69, -0x65,0x6C,0x64,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69, -0x63,0x61,0x74,0x65,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x20,0x2D, -0x20,0x47,0x32,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7, -0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02, -0x82,0x01,0x01,0x00,0xBD,0xED,0xC1,0x03,0xFC,0xF6,0x8F,0xFC,0x02,0xB1,0x6F,0x5B, -0x9F,0x48,0xD9,0x9D,0x79,0xE2,0xA2,0xB7,0x03,0x61,0x56,0x18,0xC3,0x47,0xB6,0xD7, -0xCA,0x3D,0x35,0x2E,0x89,0x43,0xF7,0xA1,0x69,0x9B,0xDE,0x8A,0x1A,0xFD,0x13,0x20, -0x9C,0xB4,0x49,0x77,0x32,0x29,0x56,0xFD,0xB9,0xEC,0x8C,0xDD,0x22,0xFA,0x72,0xDC, -0x27,0x61,0x97,0xEE,0xF6,0x5A,0x84,0xEC,0x6E,0x19,0xB9,0x89,0x2C,0xDC,0x84,0x5B, -0xD5,0x74,0xFB,0x6B,0x5F,0xC5,0x89,0xA5,0x10,0x52,0x89,0x46,0x55,0xF4,0xB8,0x75, -0x1C,0xE6,0x7F,0xE4,0x54,0xAE,0x4B,0xF8,0x55,0x72,0x57,0x02,0x19,0xF8,0x17,0x71, -0x59,0xEB,0x1E,0x28,0x07,0x74,0xC5,0x9D,0x48,0xBE,0x6C,0xB4,0xF4,0xA4,0xB0,0xF3, -0x64,0x37,0x79,0x92,0xC0,0xEC,0x46,0x5E,0x7F,0xE1,0x6D,0x53,0x4C,0x62,0xAF,0xCD, -0x1F,0x0B,0x63,0xBB,0x3A,0x9D,0xFB,0xFC,0x79,0x00,0x98,0x61,0x74,0xCF,0x26,0x82, -0x40,0x63,0xF3,0xB2,0x72,0x6A,0x19,0x0D,0x99,0xCA,0xD4,0x0E,0x75,0xCC,0x37,0xFB, -0x8B,0x89,0xC1,0x59,0xF1,0x62,0x7F,0x5F,0xB3,0x5F,0x65,0x30,0xF8,0xA7,0xB7,0x4D, -0x76,0x5A,0x1E,0x76,0x5E,0x34,0xC0,0xE8,0x96,0x56,0x99,0x8A,0xB3,0xF0,0x7F,0xA4, -0xCD,0xBD,0xDC,0x32,0x31,0x7C,0x91,0xCF,0xE0,0x5F,0x11,0xF8,0x6B,0xAA,0x49,0x5C, -0xD1,0x99,0x94,0xD1,0xA2,0xE3,0x63,0x5B,0x09,0x76,0xB5,0x56,0x62,0xE1,0x4B,0x74, -0x1D,0x96,0xD4,0x26,0xD4,0x08,0x04,0x59,0xD0,0x98,0x0E,0x0E,0xE6,0xDE,0xFC,0xC3, -0xEC,0x1F,0x90,0xF1,0x02,0x03,0x01,0x00,0x01,0xA3,0x42,0x30,0x40,0x30,0x0F,0x06, -0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E, -0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x1D, -0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x7C,0x0C,0x32,0x1F,0xA7,0xD9,0x30, -0x7F,0xC4,0x7D,0x68,0xA3,0x62,0xA8,0xA1,0xCE,0xAB,0x07,0x5B,0x27,0x30,0x0D,0x06, -0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x03,0x82,0x01,0x01, -0x00,0x11,0x59,0xFA,0x25,0x4F,0x03,0x6F,0x94,0x99,0x3B,0x9A,0x1F,0x82,0x85,0x39, -0xD4,0x76,0x05,0x94,0x5E,0xE1,0x28,0x93,0x6D,0x62,0x5D,0x09,0xC2,0xA0,0xA8,0xD4, -0xB0,0x75,0x38,0xF1,0x34,0x6A,0x9D,0xE4,0x9F,0x8A,0x86,0x26,0x51,0xE6,0x2C,0xD1, -0xC6,0x2D,0x6E,0x95,0x20,0x4A,0x92,0x01,0xEC,0xB8,0x8A,0x67,0x7B,0x31,0xE2,0x67, -0x2E,0x8C,0x95,0x03,0x26,0x2E,0x43,0x9D,0x4A,0x31,0xF6,0x0E,0xB5,0x0C,0xBB,0xB7, -0xE2,0x37,0x7F,0x22,0xBA,0x00,0xA3,0x0E,0x7B,0x52,0xFB,0x6B,0xBB,0x3B,0xC4,0xD3, -0x79,0x51,0x4E,0xCD,0x90,0xF4,0x67,0x07,0x19,0xC8,0x3C,0x46,0x7A,0x0D,0x01,0x7D, -0xC5,0x58,0xE7,0x6D,0xE6,0x85,0x30,0x17,0x9A,0x24,0xC4,0x10,0xE0,0x04,0xF7,0xE0, -0xF2,0x7F,0xD4,0xAA,0x0A,0xFF,0x42,0x1D,0x37,0xED,0x94,0xE5,0x64,0x59,0x12,0x20, -0x77,0x38,0xD3,0x32,0x3E,0x38,0x81,0x75,0x96,0x73,0xFA,0x68,0x8F,0xB1,0xCB,0xCE, -0x1F,0xC5,0xEC,0xFA,0x9C,0x7E,0xCF,0x7E,0xB1,0xF1,0x07,0x2D,0xB6,0xFC,0xBF,0xCA, -0xA4,0xBF,0xD0,0x97,0x05,0x4A,0xBC,0xEA,0x18,0x28,0x02,0x90,0xBD,0x54,0x78,0x09, -0x21,0x71,0xD3,0xD1,0x7D,0x1D,0xD9,0x16,0xB0,0xA9,0x61,0x3D,0xD0,0x0A,0x00,0x22, -0xFC,0xC7,0x7B,0xCB,0x09,0x64,0x45,0x0B,0x3B,0x40,0x81,0xF7,0x7D,0x7C,0x32,0xF5, -0x98,0xCA,0x58,0x8E,0x7D,0x2A,0xEE,0x90,0x59,0x73,0x64,0xF9,0x36,0x74,0x5E,0x25, -0xA1,0xF5,0x66,0x05,0x2E,0x7F,0x39,0x15,0xA9,0x2A,0xFB,0x50,0x8B,0x8E,0x85,0x69, -0xF4, -}; - - -/* subject:/C=US/ST=Arizona/L=Scottsdale/O=Starfield Technologies, Inc./CN=Starfield Services Root Certificate Authority - G2 */ -/* issuer :/C=US/ST=Arizona/L=Scottsdale/O=Starfield Technologies, Inc./CN=Starfield Services Root Certificate Authority - G2 */ - - -const unsigned char Starfield_Services_Root_Certificate_Authority___G2_certificate[1011]={ -0x30,0x82,0x03,0xEF,0x30,0x82,0x02,0xD7,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x00, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x30, -0x81,0x98,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31, -0x10,0x30,0x0E,0x06,0x03,0x55,0x04,0x08,0x13,0x07,0x41,0x72,0x69,0x7A,0x6F,0x6E, -0x61,0x31,0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x07,0x13,0x0A,0x53,0x63,0x6F,0x74, -0x74,0x73,0x64,0x61,0x6C,0x65,0x31,0x25,0x30,0x23,0x06,0x03,0x55,0x04,0x0A,0x13, -0x1C,0x53,0x74,0x61,0x72,0x66,0x69,0x65,0x6C,0x64,0x20,0x54,0x65,0x63,0x68,0x6E, -0x6F,0x6C,0x6F,0x67,0x69,0x65,0x73,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x3B,0x30, -0x39,0x06,0x03,0x55,0x04,0x03,0x13,0x32,0x53,0x74,0x61,0x72,0x66,0x69,0x65,0x6C, -0x64,0x20,0x53,0x65,0x72,0x76,0x69,0x63,0x65,0x73,0x20,0x52,0x6F,0x6F,0x74,0x20, -0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x20,0x41,0x75,0x74,0x68, -0x6F,0x72,0x69,0x74,0x79,0x20,0x2D,0x20,0x47,0x32,0x30,0x1E,0x17,0x0D,0x30,0x39, -0x30,0x39,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x37,0x31, -0x32,0x33,0x31,0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x81,0x98,0x31,0x0B,0x30, -0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x10,0x30,0x0E,0x06,0x03, -0x55,0x04,0x08,0x13,0x07,0x41,0x72,0x69,0x7A,0x6F,0x6E,0x61,0x31,0x13,0x30,0x11, -0x06,0x03,0x55,0x04,0x07,0x13,0x0A,0x53,0x63,0x6F,0x74,0x74,0x73,0x64,0x61,0x6C, -0x65,0x31,0x25,0x30,0x23,0x06,0x03,0x55,0x04,0x0A,0x13,0x1C,0x53,0x74,0x61,0x72, -0x66,0x69,0x65,0x6C,0x64,0x20,0x54,0x65,0x63,0x68,0x6E,0x6F,0x6C,0x6F,0x67,0x69, -0x65,0x73,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x3B,0x30,0x39,0x06,0x03,0x55,0x04, -0x03,0x13,0x32,0x53,0x74,0x61,0x72,0x66,0x69,0x65,0x6C,0x64,0x20,0x53,0x65,0x72, -0x76,0x69,0x63,0x65,0x73,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x65,0x72,0x74,0x69, -0x66,0x69,0x63,0x61,0x74,0x65,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79, -0x20,0x2D,0x20,0x47,0x32,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48, -0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01, -0x0A,0x02,0x82,0x01,0x01,0x00,0xD5,0x0C,0x3A,0xC4,0x2A,0xF9,0x4E,0xE2,0xF5,0xBE, -0x19,0x97,0x5F,0x8E,0x88,0x53,0xB1,0x1F,0x3F,0xCB,0xCF,0x9F,0x20,0x13,0x6D,0x29, -0x3A,0xC8,0x0F,0x7D,0x3C,0xF7,0x6B,0x76,0x38,0x63,0xD9,0x36,0x60,0xA8,0x9B,0x5E, -0x5C,0x00,0x80,0xB2,0x2F,0x59,0x7F,0xF6,0x87,0xF9,0x25,0x43,0x86,0xE7,0x69,0x1B, -0x52,0x9A,0x90,0xE1,0x71,0xE3,0xD8,0x2D,0x0D,0x4E,0x6F,0xF6,0xC8,0x49,0xD9,0xB6, -0xF3,0x1A,0x56,0xAE,0x2B,0xB6,0x74,0x14,0xEB,0xCF,0xFB,0x26,0xE3,0x1A,0xBA,0x1D, -0x96,0x2E,0x6A,0x3B,0x58,0x94,0x89,0x47,0x56,0xFF,0x25,0xA0,0x93,0x70,0x53,0x83, -0xDA,0x84,0x74,0x14,0xC3,0x67,0x9E,0x04,0x68,0x3A,0xDF,0x8E,0x40,0x5A,0x1D,0x4A, -0x4E,0xCF,0x43,0x91,0x3B,0xE7,0x56,0xD6,0x00,0x70,0xCB,0x52,0xEE,0x7B,0x7D,0xAE, -0x3A,0xE7,0xBC,0x31,0xF9,0x45,0xF6,0xC2,0x60,0xCF,0x13,0x59,0x02,0x2B,0x80,0xCC, -0x34,0x47,0xDF,0xB9,0xDE,0x90,0x65,0x6D,0x02,0xCF,0x2C,0x91,0xA6,0xA6,0xE7,0xDE, -0x85,0x18,0x49,0x7C,0x66,0x4E,0xA3,0x3A,0x6D,0xA9,0xB5,0xEE,0x34,0x2E,0xBA,0x0D, -0x03,0xB8,0x33,0xDF,0x47,0xEB,0xB1,0x6B,0x8D,0x25,0xD9,0x9B,0xCE,0x81,0xD1,0x45, -0x46,0x32,0x96,0x70,0x87,0xDE,0x02,0x0E,0x49,0x43,0x85,0xB6,0x6C,0x73,0xBB,0x64, -0xEA,0x61,0x41,0xAC,0xC9,0xD4,0x54,0xDF,0x87,0x2F,0xC7,0x22,0xB2,0x26,0xCC,0x9F, -0x59,0x54,0x68,0x9F,0xFC,0xBE,0x2A,0x2F,0xC4,0x55,0x1C,0x75,0x40,0x60,0x17,0x85, -0x02,0x55,0x39,0x8B,0x7F,0x05,0x02,0x03,0x01,0x00,0x01,0xA3,0x42,0x30,0x40,0x30, -0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF, -0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06, -0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x9C,0x5F,0x00,0xDF,0xAA, -0x01,0xD7,0x30,0x2B,0x38,0x88,0xA2,0xB8,0x6D,0x4A,0x9C,0xF2,0x11,0x91,0x83,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x03,0x82, -0x01,0x01,0x00,0x4B,0x36,0xA6,0x84,0x77,0x69,0xDD,0x3B,0x19,0x9F,0x67,0x23,0x08, -0x6F,0x0E,0x61,0xC9,0xFD,0x84,0xDC,0x5F,0xD8,0x36,0x81,0xCD,0xD8,0x1B,0x41,0x2D, -0x9F,0x60,0xDD,0xC7,0x1A,0x68,0xD9,0xD1,0x6E,0x86,0xE1,0x88,0x23,0xCF,0x13,0xDE, -0x43,0xCF,0xE2,0x34,0xB3,0x04,0x9D,0x1F,0x29,0xD5,0xBF,0xF8,0x5E,0xC8,0xD5,0xC1, -0xBD,0xEE,0x92,0x6F,0x32,0x74,0xF2,0x91,0x82,0x2F,0xBD,0x82,0x42,0x7A,0xAD,0x2A, -0xB7,0x20,0x7D,0x4D,0xBC,0x7A,0x55,0x12,0xC2,0x15,0xEA,0xBD,0xF7,0x6A,0x95,0x2E, -0x6C,0x74,0x9F,0xCF,0x1C,0xB4,0xF2,0xC5,0x01,0xA3,0x85,0xD0,0x72,0x3E,0xAD,0x73, -0xAB,0x0B,0x9B,0x75,0x0C,0x6D,0x45,0xB7,0x8E,0x94,0xAC,0x96,0x37,0xB5,0xA0,0xD0, -0x8F,0x15,0x47,0x0E,0xE3,0xE8,0x83,0xDD,0x8F,0xFD,0xEF,0x41,0x01,0x77,0xCC,0x27, -0xA9,0x62,0x85,0x33,0xF2,0x37,0x08,0xEF,0x71,0xCF,0x77,0x06,0xDE,0xC8,0x19,0x1D, -0x88,0x40,0xCF,0x7D,0x46,0x1D,0xFF,0x1E,0xC7,0xE1,0xCE,0xFF,0x23,0xDB,0xC6,0xFA, -0x8D,0x55,0x4E,0xA9,0x02,0xE7,0x47,0x11,0x46,0x3E,0xF4,0xFD,0xBD,0x7B,0x29,0x26, -0xBB,0xA9,0x61,0x62,0x37,0x28,0xB6,0x2D,0x2A,0xF6,0x10,0x86,0x64,0xC9,0x70,0xA7, -0xD2,0xAD,0xB7,0x29,0x70,0x79,0xEA,0x3C,0xDA,0x63,0x25,0x9F,0xFD,0x68,0xB7,0x30, -0xEC,0x70,0xFB,0x75,0x8A,0xB7,0x6D,0x60,0x67,0xB2,0x1E,0xC8,0xB9,0xE9,0xD8,0xA8, -0x6F,0x02,0x8B,0x67,0x0D,0x4D,0x26,0x57,0x71,0xDA,0x20,0xFC,0xC1,0x4A,0x50,0x8D, -0xB1,0x28,0xBA, -}; - - -/* subject:/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Certification Authority */ -/* issuer :/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Certification Authority */ - - -const unsigned char StartCom_Certification_Authority_certificate[1931]={ -0x30,0x82,0x07,0x87,0x30,0x82,0x05,0x6F,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x2D, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x30, -0x7D,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x49,0x4C,0x31,0x16, -0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D,0x53,0x74,0x61,0x72,0x74,0x43,0x6F, -0x6D,0x20,0x4C,0x74,0x64,0x2E,0x31,0x2B,0x30,0x29,0x06,0x03,0x55,0x04,0x0B,0x13, -0x22,0x53,0x65,0x63,0x75,0x72,0x65,0x20,0x44,0x69,0x67,0x69,0x74,0x61,0x6C,0x20, -0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x20,0x53,0x69,0x67,0x6E, -0x69,0x6E,0x67,0x31,0x29,0x30,0x27,0x06,0x03,0x55,0x04,0x03,0x13,0x20,0x53,0x74, -0x61,0x72,0x74,0x43,0x6F,0x6D,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61, -0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x1E, -0x17,0x0D,0x30,0x36,0x30,0x39,0x31,0x37,0x31,0x39,0x34,0x36,0x33,0x37,0x5A,0x17, -0x0D,0x33,0x36,0x30,0x39,0x31,0x37,0x31,0x39,0x34,0x36,0x33,0x36,0x5A,0x30,0x7D, -0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x49,0x4C,0x31,0x16,0x30, -0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D,0x53,0x74,0x61,0x72,0x74,0x43,0x6F,0x6D, -0x20,0x4C,0x74,0x64,0x2E,0x31,0x2B,0x30,0x29,0x06,0x03,0x55,0x04,0x0B,0x13,0x22, -0x53,0x65,0x63,0x75,0x72,0x65,0x20,0x44,0x69,0x67,0x69,0x74,0x61,0x6C,0x20,0x43, -0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x65,0x20,0x53,0x69,0x67,0x6E,0x69, -0x6E,0x67,0x31,0x29,0x30,0x27,0x06,0x03,0x55,0x04,0x03,0x13,0x20,0x53,0x74,0x61, -0x72,0x74,0x43,0x6F,0x6D,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74, -0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x82,0x02, -0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00, -0x03,0x82,0x02,0x0F,0x00,0x30,0x82,0x02,0x0A,0x02,0x82,0x02,0x01,0x00,0xC1,0x88, -0xDB,0x09,0xBC,0x6C,0x46,0x7C,0x78,0x9F,0x95,0x7B,0xB5,0x33,0x90,0xF2,0x72,0x62, -0xD6,0xC1,0x36,0x20,0x22,0x24,0x5E,0xCE,0xE9,0x77,0xF2,0x43,0x0A,0xA2,0x06,0x64, -0xA4,0xCC,0x8E,0x36,0xF8,0x38,0xE6,0x23,0xF0,0x6E,0x6D,0xB1,0x3C,0xDD,0x72,0xA3, -0x85,0x1C,0xA1,0xD3,0x3D,0xB4,0x33,0x2B,0xD3,0x2F,0xAF,0xFE,0xEA,0xB0,0x41,0x59, -0x67,0xB6,0xC4,0x06,0x7D,0x0A,0x9E,0x74,0x85,0xD6,0x79,0x4C,0x80,0x37,0x7A,0xDF, -0x39,0x05,0x52,0x59,0xF7,0xF4,0x1B,0x46,0x43,0xA4,0xD2,0x85,0x85,0xD2,0xC3,0x71, -0xF3,0x75,0x62,0x34,0xBA,0x2C,0x8A,0x7F,0x1E,0x8F,0xEE,0xED,0x34,0xD0,0x11,0xC7, -0x96,0xCD,0x52,0x3D,0xBA,0x33,0xD6,0xDD,0x4D,0xDE,0x0B,0x3B,0x4A,0x4B,0x9F,0xC2, -0x26,0x2F,0xFA,0xB5,0x16,0x1C,0x72,0x35,0x77,0xCA,0x3C,0x5D,0xE6,0xCA,0xE1,0x26, -0x8B,0x1A,0x36,0x76,0x5C,0x01,0xDB,0x74,0x14,0x25,0xFE,0xED,0xB5,0xA0,0x88,0x0F, -0xDD,0x78,0xCA,0x2D,0x1F,0x07,0x97,0x30,0x01,0x2D,0x72,0x79,0xFA,0x46,0xD6,0x13, -0x2A,0xA8,0xB9,0xA6,0xAB,0x83,0x49,0x1D,0xE5,0xF2,0xEF,0xDD,0xE4,0x01,0x8E,0x18, -0x0A,0x8F,0x63,0x53,0x16,0x85,0x62,0xA9,0x0E,0x19,0x3A,0xCC,0xB5,0x66,0xA6,0xC2, -0x6B,0x74,0x07,0xE4,0x2B,0xE1,0x76,0x3E,0xB4,0x6D,0xD8,0xF6,0x44,0xE1,0x73,0x62, -0x1F,0x3B,0xC4,0xBE,0xA0,0x53,0x56,0x25,0x6C,0x51,0x09,0xF7,0xAA,0xAB,0xCA,0xBF, -0x76,0xFD,0x6D,0x9B,0xF3,0x9D,0xDB,0xBF,0x3D,0x66,0xBC,0x0C,0x56,0xAA,0xAF,0x98, -0x48,0x95,0x3A,0x4B,0xDF,0xA7,0x58,0x50,0xD9,0x38,0x75,0xA9,0x5B,0xEA,0x43,0x0C, -0x02,0xFF,0x99,0xEB,0xE8,0x6C,0x4D,0x70,0x5B,0x29,0x65,0x9C,0xDD,0xAA,0x5D,0xCC, -0xAF,0x01,0x31,0xEC,0x0C,0xEB,0xD2,0x8D,0xE8,0xEA,0x9C,0x7B,0xE6,0x6E,0xF7,0x27, -0x66,0x0C,0x1A,0x48,0xD7,0x6E,0x42,0xE3,0x3F,0xDE,0x21,0x3E,0x7B,0xE1,0x0D,0x70, -0xFB,0x63,0xAA,0xA8,0x6C,0x1A,0x54,0xB4,0x5C,0x25,0x7A,0xC9,0xA2,0xC9,0x8B,0x16, -0xA6,0xBB,0x2C,0x7E,0x17,0x5E,0x05,0x4D,0x58,0x6E,0x12,0x1D,0x01,0xEE,0x12,0x10, -0x0D,0xC6,0x32,0x7F,0x18,0xFF,0xFC,0xF4,0xFA,0xCD,0x6E,0x91,0xE8,0x36,0x49,0xBE, -0x1A,0x48,0x69,0x8B,0xC2,0x96,0x4D,0x1A,0x12,0xB2,0x69,0x17,0xC1,0x0A,0x90,0xD6, -0xFA,0x79,0x22,0x48,0xBF,0xBA,0x7B,0x69,0xF8,0x70,0xC7,0xFA,0x7A,0x37,0xD8,0xD8, -0x0D,0xD2,0x76,0x4F,0x57,0xFF,0x90,0xB7,0xE3,0x91,0xD2,0xDD,0xEF,0xC2,0x60,0xB7, -0x67,0x3A,0xDD,0xFE,0xAA,0x9C,0xF0,0xD4,0x8B,0x7F,0x72,0x22,0xCE,0xC6,0x9F,0x97, -0xB6,0xF8,0xAF,0x8A,0xA0,0x10,0xA8,0xD9,0xFB,0x18,0xC6,0xB6,0xB5,0x5C,0x52,0x3C, -0x89,0xB6,0x19,0x2A,0x73,0x01,0x0A,0x0F,0x03,0xB3,0x12,0x60,0xF2,0x7A,0x2F,0x81, -0xDB,0xA3,0x6E,0xFF,0x26,0x30,0x97,0xF5,0x8B,0xDD,0x89,0x57,0xB6,0xAD,0x3D,0xB3, -0xAF,0x2B,0xC5,0xB7,0x76,0x02,0xF0,0xA5,0xD6,0x2B,0x9A,0x86,0x14,0x2A,0x72,0xF6, -0xE3,0x33,0x8C,0x5D,0x09,0x4B,0x13,0xDF,0xBB,0x8C,0x74,0x13,0x52,0x4B,0x02,0x03, -0x01,0x00,0x01,0xA3,0x82,0x02,0x10,0x30,0x82,0x02,0x0C,0x30,0x0F,0x06,0x03,0x55, -0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06,0x03, -0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x1D,0x06,0x03, -0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x4E,0x0B,0xEF,0x1A,0xA4,0x40,0x5B,0xA5,0x17, -0x69,0x87,0x30,0xCA,0x34,0x68,0x43,0xD0,0x41,0xAE,0xF2,0x30,0x1F,0x06,0x03,0x55, -0x1D,0x23,0x04,0x18,0x30,0x16,0x80,0x14,0x4E,0x0B,0xEF,0x1A,0xA4,0x40,0x5B,0xA5, -0x17,0x69,0x87,0x30,0xCA,0x34,0x68,0x43,0xD0,0x41,0xAE,0xF2,0x30,0x82,0x01,0x5A, -0x06,0x03,0x55,0x1D,0x20,0x04,0x82,0x01,0x51,0x30,0x82,0x01,0x4D,0x30,0x82,0x01, -0x49,0x06,0x0B,0x2B,0x06,0x01,0x04,0x01,0x81,0xB5,0x37,0x01,0x01,0x01,0x30,0x82, -0x01,0x38,0x30,0x2E,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x02,0x01,0x16,0x22, -0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x77,0x77,0x77,0x2E,0x73,0x74,0x61,0x72,0x74, -0x73,0x73,0x6C,0x2E,0x63,0x6F,0x6D,0x2F,0x70,0x6F,0x6C,0x69,0x63,0x79,0x2E,0x70, -0x64,0x66,0x30,0x34,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x02,0x01,0x16,0x28, -0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x77,0x77,0x77,0x2E,0x73,0x74,0x61,0x72,0x74, -0x73,0x73,0x6C,0x2E,0x63,0x6F,0x6D,0x2F,0x69,0x6E,0x74,0x65,0x72,0x6D,0x65,0x64, -0x69,0x61,0x74,0x65,0x2E,0x70,0x64,0x66,0x30,0x81,0xCF,0x06,0x08,0x2B,0x06,0x01, -0x05,0x05,0x07,0x02,0x02,0x30,0x81,0xC2,0x30,0x27,0x16,0x20,0x53,0x74,0x61,0x72, -0x74,0x20,0x43,0x6F,0x6D,0x6D,0x65,0x72,0x63,0x69,0x61,0x6C,0x20,0x28,0x53,0x74, -0x61,0x72,0x74,0x43,0x6F,0x6D,0x29,0x20,0x4C,0x74,0x64,0x2E,0x30,0x03,0x02,0x01, -0x01,0x1A,0x81,0x96,0x4C,0x69,0x6D,0x69,0x74,0x65,0x64,0x20,0x4C,0x69,0x61,0x62, -0x69,0x6C,0x69,0x74,0x79,0x2C,0x20,0x72,0x65,0x61,0x64,0x20,0x74,0x68,0x65,0x20, -0x73,0x65,0x63,0x74,0x69,0x6F,0x6E,0x20,0x2A,0x4C,0x65,0x67,0x61,0x6C,0x20,0x4C, -0x69,0x6D,0x69,0x74,0x61,0x74,0x69,0x6F,0x6E,0x73,0x2A,0x20,0x6F,0x66,0x20,0x74, -0x68,0x65,0x20,0x53,0x74,0x61,0x72,0x74,0x43,0x6F,0x6D,0x20,0x43,0x65,0x72,0x74, -0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72, -0x69,0x74,0x79,0x20,0x50,0x6F,0x6C,0x69,0x63,0x79,0x20,0x61,0x76,0x61,0x69,0x6C, -0x61,0x62,0x6C,0x65,0x20,0x61,0x74,0x20,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x77, -0x77,0x77,0x2E,0x73,0x74,0x61,0x72,0x74,0x73,0x73,0x6C,0x2E,0x63,0x6F,0x6D,0x2F, -0x70,0x6F,0x6C,0x69,0x63,0x79,0x2E,0x70,0x64,0x66,0x30,0x11,0x06,0x09,0x60,0x86, -0x48,0x01,0x86,0xF8,0x42,0x01,0x01,0x04,0x04,0x03,0x02,0x00,0x07,0x30,0x38,0x06, -0x09,0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x0D,0x04,0x2B,0x16,0x29,0x53,0x74, -0x61,0x72,0x74,0x43,0x6F,0x6D,0x20,0x46,0x72,0x65,0x65,0x20,0x53,0x53,0x4C,0x20, -0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75, -0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7, -0x0D,0x01,0x01,0x0B,0x05,0x00,0x03,0x82,0x02,0x01,0x00,0x8E,0x8F,0xE7,0xDC,0x94, -0x79,0x7C,0xF1,0x85,0x7F,0x9F,0x49,0x6F,0x6B,0xCA,0x5D,0xFB,0x8C,0xFE,0x04,0xC5, -0xC1,0x62,0xD1,0x7D,0x42,0x8A,0xBC,0x53,0xB7,0x94,0x03,0x66,0x30,0x3F,0xB1,0xE7, -0x0A,0xA7,0x50,0x20,0x55,0x25,0x7F,0x76,0x7A,0x14,0x0D,0xEB,0x04,0x0E,0x40,0xE6, -0x3E,0xD8,0x88,0xAB,0x07,0x27,0x83,0xA9,0x75,0xA6,0x37,0x73,0xC7,0xFD,0x4B,0xD2, -0x4D,0xAD,0x17,0x40,0xC8,0x46,0xBE,0x3B,0x7F,0x51,0xFC,0xC3,0xB6,0x05,0x31,0xDC, -0xCD,0x85,0x22,0x4E,0x71,0xB7,0xF2,0x71,0x5E,0xB0,0x1A,0xC6,0xBA,0x93,0x8B,0x78, -0x92,0x4A,0x85,0xF8,0x78,0x0F,0x83,0xFE,0x2F,0xAD,0x2C,0xF7,0xE4,0xA4,0xBB,0x2D, -0xD0,0xE7,0x0D,0x3A,0xB8,0x3E,0xCE,0xF6,0x78,0xF6,0xAE,0x47,0x24,0xCA,0xA3,0x35, -0x36,0xCE,0xC7,0xC6,0x87,0x98,0xDA,0xEC,0xFB,0xE9,0xB2,0xCE,0x27,0x9B,0x88,0xC3, -0x04,0xA1,0xF6,0x0B,0x59,0x68,0xAF,0xC9,0xDB,0x10,0x0F,0x4D,0xF6,0x64,0x63,0x5C, -0xA5,0x12,0x6F,0x92,0xB2,0x93,0x94,0xC7,0x88,0x17,0x0E,0x93,0xB6,0x7E,0x62,0x8B, -0x90,0x7F,0xAB,0x4E,0x9F,0xFC,0xE3,0x75,0x14,0x4F,0x2A,0x32,0xDF,0x5B,0x0D,0xE0, -0xF5,0x7B,0x93,0x0D,0xAB,0xA1,0xCF,0x87,0xE1,0xA5,0x04,0x45,0xE8,0x3C,0x12,0xA5, -0x09,0xC5,0xB0,0xD1,0xB7,0x53,0xF3,0x60,0x14,0xBA,0x85,0x69,0x6A,0x21,0x7C,0x1F, -0x75,0x61,0x17,0x20,0x17,0x7B,0x6C,0x3B,0x41,0x29,0x5C,0xE1,0xAC,0x5A,0xD1,0xCD, -0x8C,0x9B,0xEB,0x60,0x1D,0x19,0xEC,0xF7,0xE5,0xB0,0xDA,0xF9,0x79,0x18,0xA5,0x45, -0x3F,0x49,0x43,0x57,0xD2,0xDD,0x24,0xD5,0x2C,0xA3,0xFD,0x91,0x8D,0x27,0xB5,0xE5, -0xEB,0x14,0x06,0x9A,0x4C,0x7B,0x21,0xBB,0x3A,0xAD,0x30,0x06,0x18,0xC0,0xD8,0xC1, -0x6B,0x2C,0x7F,0x59,0x5C,0x5D,0x91,0xB1,0x70,0x22,0x57,0xEB,0x8A,0x6B,0x48,0x4A, -0xD5,0x0F,0x29,0xEC,0xC6,0x40,0xC0,0x2F,0x88,0x4C,0x68,0x01,0x17,0x77,0xF4,0x24, -0x19,0x4F,0xBD,0xFA,0xE1,0xB2,0x20,0x21,0x4B,0xDD,0x1A,0xD8,0x29,0x7D,0xAA,0xB8, -0xDE,0x54,0xEC,0x21,0x55,0x80,0x6C,0x1E,0xF5,0x30,0xC8,0xA3,0x10,0xE5,0xB2,0xE6, -0x2A,0x14,0x31,0xC3,0x85,0x2D,0x8C,0x98,0xB1,0x86,0x5A,0x4F,0x89,0x59,0x2D,0xB9, -0xC7,0xF7,0x1C,0xC8,0x8A,0x7F,0xC0,0x9D,0x05,0x4A,0xE6,0x42,0x4F,0x62,0xA3,0x6D, -0x29,0xA4,0x1F,0x85,0xAB,0xDB,0xE5,0x81,0xC8,0xAD,0x2A,0x3D,0x4C,0x5D,0x5B,0x84, -0x26,0x71,0xC4,0x85,0x5E,0x71,0x24,0xCA,0xA5,0x1B,0x6C,0xD8,0x61,0xD3,0x1A,0xE0, -0x54,0xDB,0xCE,0xBA,0xA9,0x32,0xB5,0x22,0xF6,0x73,0x41,0x09,0x5D,0xB8,0x17,0x5D, -0x0E,0x0F,0x99,0x90,0xD6,0x47,0xDA,0x6F,0x0A,0x3A,0x62,0x28,0x14,0x67,0x82,0xD9, -0xF1,0xD0,0x80,0x59,0x9B,0xCB,0x31,0xD8,0x9B,0x0F,0x8C,0x77,0x4E,0xB5,0x68,0x8A, -0xF2,0x6C,0xF6,0x24,0x0E,0x2D,0x6C,0x70,0xC5,0x73,0xD1,0xDE,0x14,0xD0,0x71,0x8F, -0xB6,0xD3,0x7B,0x02,0xF6,0xE3,0xB8,0xD4,0x09,0x6E,0x6B,0x9E,0x75,0x84,0x39,0xE6, -0x7F,0x25,0xA5,0xF2,0x48,0x00,0xC0,0xA4,0x01,0xDA,0x3F, -}; - - -/* subject:/C=IL/O=StartCom Ltd./CN=StartCom Certification Authority G2 */ -/* issuer :/C=IL/O=StartCom Ltd./CN=StartCom Certification Authority G2 */ - - -const unsigned char StartCom_Certification_Authority_G2_certificate[1383]={ -0x30,0x82,0x05,0x63,0x30,0x82,0x03,0x4B,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x3B, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x30, -0x53,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x49,0x4C,0x31,0x16, -0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D,0x53,0x74,0x61,0x72,0x74,0x43,0x6F, -0x6D,0x20,0x4C,0x74,0x64,0x2E,0x31,0x2C,0x30,0x2A,0x06,0x03,0x55,0x04,0x03,0x13, -0x23,0x53,0x74,0x61,0x72,0x74,0x43,0x6F,0x6D,0x20,0x43,0x65,0x72,0x74,0x69,0x66, -0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74, -0x79,0x20,0x47,0x32,0x30,0x1E,0x17,0x0D,0x31,0x30,0x30,0x31,0x30,0x31,0x30,0x31, -0x30,0x30,0x30,0x31,0x5A,0x17,0x0D,0x33,0x39,0x31,0x32,0x33,0x31,0x32,0x33,0x35, -0x39,0x30,0x31,0x5A,0x30,0x53,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13, -0x02,0x49,0x4C,0x31,0x16,0x30,0x14,0x06,0x03,0x55,0x04,0x0A,0x13,0x0D,0x53,0x74, -0x61,0x72,0x74,0x43,0x6F,0x6D,0x20,0x4C,0x74,0x64,0x2E,0x31,0x2C,0x30,0x2A,0x06, -0x03,0x55,0x04,0x03,0x13,0x23,0x53,0x74,0x61,0x72,0x74,0x43,0x6F,0x6D,0x20,0x43, -0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74, -0x68,0x6F,0x72,0x69,0x74,0x79,0x20,0x47,0x32,0x30,0x82,0x02,0x22,0x30,0x0D,0x06, -0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x02,0x0F, -0x00,0x30,0x82,0x02,0x0A,0x02,0x82,0x02,0x01,0x00,0xB6,0x89,0x36,0x5B,0x07,0xB7, -0x20,0x36,0xBD,0x82,0xBB,0xE1,0x16,0x20,0x03,0x95,0x7A,0xAF,0x0E,0xA3,0x55,0xC9, -0x25,0x99,0x4A,0xC5,0xD0,0x56,0x41,0x87,0x90,0x4D,0x21,0x60,0xA4,0x14,0x87,0x3B, -0xCD,0xFD,0xB2,0x3E,0xB4,0x67,0x03,0x6A,0xED,0xE1,0x0F,0x4B,0xC0,0x91,0x85,0x70, -0x45,0xE0,0x42,0x9E,0xDE,0x29,0x23,0xD4,0x01,0x0D,0xA0,0x10,0x79,0xB8,0xDB,0x03, -0xBD,0xF3,0xA9,0x2F,0xD1,0xC6,0xE0,0x0F,0xCB,0x9E,0x8A,0x14,0x0A,0xB8,0xBD,0xF6, -0x56,0x62,0xF1,0xC5,0x72,0xB6,0x32,0x25,0xD9,0xB2,0xF3,0xBD,0x65,0xC5,0x0D,0x2C, -0x6E,0xD5,0x92,0x6F,0x18,0x8B,0x00,0x41,0x14,0x82,0x6F,0x40,0x20,0x26,0x7A,0x28, -0x0F,0xF5,0x1E,0x7F,0x27,0xF7,0x94,0xB1,0x37,0x3D,0xB7,0xC7,0x91,0xF7,0xE2,0x01, -0xEC,0xFD,0x94,0x89,0xE1,0xCC,0x6E,0xD3,0x36,0xD6,0x0A,0x19,0x79,0xAE,0xD7,0x34, -0x82,0x65,0xFF,0x7C,0x42,0xBB,0xB6,0xDD,0x0B,0xA6,0x34,0xAF,0x4B,0x60,0xFE,0x7F, -0x43,0x49,0x06,0x8B,0x8C,0x43,0xB8,0x56,0xF2,0xD9,0x7F,0x21,0x43,0x17,0xEA,0xA7, -0x48,0x95,0x01,0x75,0x75,0xEA,0x2B,0xA5,0x43,0x95,0xEA,0x15,0x84,0x9D,0x08,0x8D, -0x26,0x6E,0x55,0x9B,0xAB,0xDC,0xD2,0x39,0xD2,0x31,0x1D,0x60,0xE2,0xAC,0xCC,0x56, -0x45,0x24,0xF5,0x1C,0x54,0xAB,0xEE,0x86,0xDD,0x96,0x32,0x85,0xF8,0x4C,0x4F,0xE8, -0x95,0x76,0xB6,0x05,0xDD,0x36,0x23,0x67,0xBC,0xFF,0x15,0xE2,0xCA,0x3B,0xE6,0xA6, -0xEC,0x3B,0xEC,0x26,0x11,0x34,0x48,0x8D,0xF6,0x80,0x2B,0x1A,0x23,0x02,0xEB,0x8A, -0x1C,0x3A,0x76,0x2A,0x7B,0x56,0x16,0x1C,0x72,0x2A,0xB3,0xAA,0xE3,0x60,0xA5,0x00, -0x9F,0x04,0x9B,0xE2,0x6F,0x1E,0x14,0x58,0x5B,0xA5,0x6C,0x8B,0x58,0x3C,0xC3,0xBA, -0x4E,0x3A,0x5C,0xF7,0xE1,0x96,0x2B,0x3E,0xEF,0x07,0xBC,0xA4,0xE5,0x5D,0xCC,0x4D, -0x9F,0x0D,0xE1,0xDC,0xAA,0xBB,0xE1,0x6E,0x1A,0xEC,0x8F,0xE1,0xB6,0x4C,0x4D,0x79, -0x72,0x5D,0x17,0x35,0x0B,0x1D,0xD7,0xC1,0x47,0xDA,0x96,0x24,0xE0,0xD0,0x72,0xA8, -0x5A,0x5F,0x66,0x2D,0x10,0xDC,0x2F,0x2A,0x13,0xAE,0x26,0xFE,0x0A,0x1C,0x19,0xCC, -0xD0,0x3E,0x0B,0x9C,0xC8,0x09,0x2E,0xF9,0x5B,0x96,0x7A,0x47,0x9C,0xE9,0x7A,0xF3, -0x05,0x50,0x74,0x95,0x73,0x9E,0x30,0x09,0xF3,0x97,0x82,0x5E,0xE6,0x8F,0x39,0x08, -0x1E,0x59,0xE5,0x35,0x14,0x42,0x13,0xFF,0x00,0x9C,0xF7,0xBE,0xAA,0x50,0xCF,0xE2, -0x51,0x48,0xD7,0xB8,0x6F,0xAF,0xF8,0x4E,0x7E,0x33,0x98,0x92,0x14,0x62,0x3A,0x75, -0x63,0xCF,0x7B,0xFA,0xDE,0x82,0x3B,0xA9,0xBB,0x39,0xE2,0xC4,0xBD,0x2C,0x00,0x0E, -0xC8,0x17,0xAC,0x13,0xEF,0x4D,0x25,0x8E,0xD8,0xB3,0x90,0x2F,0xA9,0xDA,0x29,0x7D, -0x1D,0xAF,0x74,0x3A,0xB2,0x27,0xC0,0xC1,0x1E,0x3E,0x75,0xA3,0x16,0xA9,0xAF,0x7A, -0x22,0x5D,0x9F,0x13,0x1A,0xCF,0xA7,0xA0,0xEB,0xE3,0x86,0x0A,0xD3,0xFD,0xE6,0x96, -0x95,0xD7,0x23,0xC8,0x37,0xDD,0xC4,0x7C,0xAA,0x36,0xAC,0x98,0x1A,0x12,0xB1,0xE0, -0x4E,0xE8,0xB1,0x3B,0xF5,0xD6,0x6F,0xF1,0x30,0xD7,0x02,0x03,0x01,0x00,0x01,0xA3, -0x42,0x30,0x40,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30, -0x03,0x01,0x01,0xFF,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04, -0x03,0x02,0x01,0x06,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x4B, -0xC5,0xB4,0x40,0x6B,0xAD,0x1C,0xB3,0xA5,0x1C,0x65,0x6E,0x46,0x36,0x89,0x87,0x05, -0x0C,0x0E,0xB6,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B, -0x05,0x00,0x03,0x82,0x02,0x01,0x00,0x73,0x57,0x3F,0x2C,0xD5,0x95,0x32,0x7E,0x37, -0xDB,0x96,0x92,0xEB,0x19,0x5E,0x7E,0x53,0xE7,0x41,0xEC,0x11,0xB6,0x47,0xEF,0xB5, -0xDE,0xED,0x74,0x5C,0xC5,0xF1,0x8E,0x49,0xE0,0xFC,0x6E,0x99,0x13,0xCD,0x9F,0x8A, -0xDA,0xCD,0x3A,0x0A,0xD8,0x3A,0x5A,0x09,0x3F,0x5F,0x34,0xD0,0x2F,0x03,0xD2,0x66, -0x1D,0x1A,0xBD,0x9C,0x90,0x37,0xC8,0x0C,0x8E,0x07,0x5A,0x94,0x45,0x46,0x2A,0xE6, -0xBE,0x7A,0xDA,0xA1,0xA9,0xA4,0x69,0x12,0x92,0xB0,0x7D,0x36,0xD4,0x44,0x87,0xD7, -0x51,0xF1,0x29,0x63,0xD6,0x75,0xCD,0x16,0xE4,0x27,0x89,0x1D,0xF8,0xC2,0x32,0x48, -0xFD,0xDB,0x99,0xD0,0x8F,0x5F,0x54,0x74,0xCC,0xAC,0x67,0x34,0x11,0x62,0xD9,0x0C, -0x0A,0x37,0x87,0xD1,0xA3,0x17,0x48,0x8E,0xD2,0x17,0x1D,0xF6,0xD7,0xFD,0xDB,0x65, -0xEB,0xFD,0xA8,0xD4,0xF5,0xD6,0x4F,0xA4,0x5B,0x75,0xE8,0xC5,0xD2,0x60,0xB2,0xDB, -0x09,0x7E,0x25,0x8B,0x7B,0xBA,0x52,0x92,0x9E,0x3E,0xE8,0xC5,0x77,0xA1,0x3C,0xE0, -0x4A,0x73,0x6B,0x61,0xCF,0x86,0xDC,0x43,0xFF,0xFF,0x21,0xFE,0x23,0x5D,0x24,0x4A, -0xF5,0xD3,0x6D,0x0F,0x62,0x04,0x05,0x57,0x82,0xDA,0x6E,0xA4,0x33,0x25,0x79,0x4B, -0x2E,0x54,0x19,0x8B,0xCC,0x2C,0x3D,0x30,0xE9,0xD1,0x06,0xFF,0xE8,0x32,0x46,0xBE, -0xB5,0x33,0x76,0x77,0xA8,0x01,0x5D,0x96,0xC1,0xC1,0xD5,0xBE,0xAE,0x25,0xC0,0xC9, -0x1E,0x0A,0x09,0x20,0x88,0xA1,0x0E,0xC9,0xF3,0x6F,0x4D,0x82,0x54,0x00,0x20,0xA7, -0xD2,0x8F,0xE4,0x39,0x54,0x17,0x2E,0x8D,0x1E,0xB8,0x1B,0xBB,0x1B,0xBD,0x9A,0x4E, -0x3B,0x10,0x34,0xDC,0x9C,0x88,0x53,0xEF,0xA2,0x31,0x5B,0x58,0x4F,0x91,0x62,0xC8, -0xC2,0x9A,0x9A,0xCD,0x15,0x5D,0x38,0xA9,0xD6,0xBE,0xF8,0x13,0xB5,0x9F,0x12,0x69, -0xF2,0x50,0x62,0xAC,0xFB,0x17,0x37,0xF4,0xEE,0xB8,0x75,0x67,0x60,0x10,0xFB,0x83, -0x50,0xF9,0x44,0xB5,0x75,0x9C,0x40,0x17,0xB2,0xFE,0xFD,0x79,0x5D,0x6E,0x58,0x58, -0x5F,0x30,0xFC,0x00,0xAE,0xAF,0x33,0xC1,0x0E,0x4E,0x6C,0xBA,0xA7,0xA6,0xA1,0x7F, -0x32,0xDB,0x38,0xE0,0xB1,0x72,0x17,0x0A,0x2B,0x91,0xEC,0x6A,0x63,0x26,0xED,0x89, -0xD4,0x78,0xCC,0x74,0x1E,0x05,0xF8,0x6B,0xFE,0x8C,0x6A,0x76,0x39,0x29,0xAE,0x65, -0x23,0x12,0x95,0x08,0x22,0x1C,0x97,0xCE,0x5B,0x06,0xEE,0x0C,0xE2,0xBB,0xBC,0x1F, -0x44,0x93,0xF6,0xD8,0x38,0x45,0x05,0x21,0xED,0xE4,0xAD,0xAB,0x12,0xB6,0x03,0xA4, -0x42,0x2E,0x2D,0xC4,0x09,0x3A,0x03,0x67,0x69,0x84,0x9A,0xE1,0x59,0x90,0x8A,0x28, -0x85,0xD5,0x5D,0x74,0xB1,0xD1,0x0E,0x20,0x58,0x9B,0x13,0xA5,0xB0,0x63,0xA6,0xED, -0x7B,0x47,0xFD,0x45,0x55,0x30,0xA4,0xEE,0x9A,0xD4,0xE6,0xE2,0x87,0xEF,0x98,0xC9, -0x32,0x82,0x11,0x29,0x22,0xBC,0x00,0x0A,0x31,0x5E,0x2D,0x0F,0xC0,0x8E,0xE9,0x6B, -0xB2,0x8F,0x2E,0x06,0xD8,0xD1,0x91,0xC7,0xC6,0x12,0xF4,0x4C,0xFD,0x30,0x17,0xC3, -0xC1,0xDA,0x38,0x5B,0xE3,0xA9,0xEA,0xE6,0xA1,0xBA,0x79,0xEF,0x73,0xD8,0xB6,0x53, -0x57,0x2D,0xF6,0xD0,0xE1,0xD7,0x48, -}; - - -/* subject:/C=DE/O=TC TrustCenter GmbH/OU=TC TrustCenter Class 2 CA/CN=TC TrustCenter Class 2 CA II */ -/* issuer :/C=DE/O=TC TrustCenter GmbH/OU=TC TrustCenter Class 2 CA/CN=TC TrustCenter Class 2 CA II */ - - -const unsigned char TC_TrustCenter_Class_2_CA_II_certificate[1198]={ -0x30,0x82,0x04,0xAA,0x30,0x82,0x03,0x92,0xA0,0x03,0x02,0x01,0x02,0x02,0x0E,0x2E, -0x6A,0x00,0x01,0x00,0x02,0x1F,0xD7,0x52,0x21,0x2C,0x11,0x5C,0x3B,0x30,0x0D,0x06, -0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x76,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x44,0x45,0x31,0x1C,0x30,0x1A,0x06, -0x03,0x55,0x04,0x0A,0x13,0x13,0x54,0x43,0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65, -0x6E,0x74,0x65,0x72,0x20,0x47,0x6D,0x62,0x48,0x31,0x22,0x30,0x20,0x06,0x03,0x55, -0x04,0x0B,0x13,0x19,0x54,0x43,0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65,0x6E,0x74, -0x65,0x72,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x32,0x20,0x43,0x41,0x31,0x25,0x30, -0x23,0x06,0x03,0x55,0x04,0x03,0x13,0x1C,0x54,0x43,0x20,0x54,0x72,0x75,0x73,0x74, -0x43,0x65,0x6E,0x74,0x65,0x72,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x32,0x20,0x43, -0x41,0x20,0x49,0x49,0x30,0x1E,0x17,0x0D,0x30,0x36,0x30,0x31,0x31,0x32,0x31,0x34, -0x33,0x38,0x34,0x33,0x5A,0x17,0x0D,0x32,0x35,0x31,0x32,0x33,0x31,0x32,0x32,0x35, -0x39,0x35,0x39,0x5A,0x30,0x76,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13, -0x02,0x44,0x45,0x31,0x1C,0x30,0x1A,0x06,0x03,0x55,0x04,0x0A,0x13,0x13,0x54,0x43, -0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65,0x6E,0x74,0x65,0x72,0x20,0x47,0x6D,0x62, -0x48,0x31,0x22,0x30,0x20,0x06,0x03,0x55,0x04,0x0B,0x13,0x19,0x54,0x43,0x20,0x54, -0x72,0x75,0x73,0x74,0x43,0x65,0x6E,0x74,0x65,0x72,0x20,0x43,0x6C,0x61,0x73,0x73, -0x20,0x32,0x20,0x43,0x41,0x31,0x25,0x30,0x23,0x06,0x03,0x55,0x04,0x03,0x13,0x1C, -0x54,0x43,0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65,0x6E,0x74,0x65,0x72,0x20,0x43, -0x6C,0x61,0x73,0x73,0x20,0x32,0x20,0x43,0x41,0x20,0x49,0x49,0x30,0x82,0x01,0x22, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03, -0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xAB,0x80,0x87, -0x9B,0x8E,0xF0,0xC3,0x7C,0x87,0xD7,0xE8,0x24,0x82,0x11,0xB3,0x3C,0xDD,0x43,0x62, -0xEE,0xF8,0xC3,0x45,0xDA,0xE8,0xE1,0xA0,0x5F,0xD1,0x2A,0xB2,0xEA,0x93,0x68,0xDF, -0xB4,0xC8,0xD6,0x43,0xE9,0xC4,0x75,0x59,0x7F,0xFC,0xE1,0x1D,0xF8,0x31,0x70,0x23, -0x1B,0x88,0x9E,0x27,0xB9,0x7B,0xFD,0x3A,0xD2,0xC9,0xA9,0xE9,0x14,0x2F,0x90,0xBE, -0x03,0x52,0xC1,0x49,0xCD,0xF6,0xFD,0xE4,0x08,0x66,0x0B,0x57,0x8A,0xA2,0x42,0xA0, -0xB8,0xD5,0x7F,0x69,0x5C,0x90,0x32,0xB2,0x97,0x0D,0xCA,0x4A,0xDC,0x46,0x3E,0x02, -0x55,0x89,0x53,0xE3,0x1A,0x5A,0xCB,0x36,0xC6,0x07,0x56,0xF7,0x8C,0xCF,0x11,0xF4, -0x4C,0xBB,0x30,0x70,0x04,0x95,0xA5,0xF6,0x39,0x8C,0xFD,0x73,0x81,0x08,0x7D,0x89, -0x5E,0x32,0x1E,0x22,0xA9,0x22,0x45,0x4B,0xB0,0x66,0x2E,0x30,0xCC,0x9F,0x65,0xFD, -0xFC,0xCB,0x81,0xA9,0xF1,0xE0,0x3B,0xAF,0xA3,0x86,0xD1,0x89,0xEA,0xC4,0x45,0x79, -0x50,0x5D,0xAE,0xE9,0x21,0x74,0x92,0x4D,0x8B,0x59,0x82,0x8F,0x94,0xE3,0xE9,0x4A, -0xF1,0xE7,0x49,0xB0,0x14,0xE3,0xF5,0x62,0xCB,0xD5,0x72,0xBD,0x1F,0xB9,0xD2,0x9F, -0xA0,0xCD,0xA8,0xFA,0x01,0xC8,0xD9,0x0D,0xDF,0xDA,0xFC,0x47,0x9D,0xB3,0xC8,0x54, -0xDF,0x49,0x4A,0xF1,0x21,0xA9,0xFE,0x18,0x4E,0xEE,0x48,0xD4,0x19,0xBB,0xEF,0x7D, -0xE4,0xE2,0x9D,0xCB,0x5B,0xB6,0x6E,0xFF,0xE3,0xCD,0x5A,0xE7,0x74,0x82,0x05,0xBA, -0x80,0x25,0x38,0xCB,0xE4,0x69,0x9E,0xAF,0x41,0xAA,0x1A,0x84,0xF5,0x02,0x03,0x01, -0x00,0x01,0xA3,0x82,0x01,0x34,0x30,0x82,0x01,0x30,0x30,0x0F,0x06,0x03,0x55,0x1D, -0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06,0x03,0x55, -0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x1D,0x06,0x03,0x55, -0x1D,0x0E,0x04,0x16,0x04,0x14,0xE3,0xAB,0x54,0x4C,0x80,0xA1,0xDB,0x56,0x43,0xB7, -0x91,0x4A,0xCB,0xF3,0x82,0x7A,0x13,0x5C,0x08,0xAB,0x30,0x81,0xED,0x06,0x03,0x55, -0x1D,0x1F,0x04,0x81,0xE5,0x30,0x81,0xE2,0x30,0x81,0xDF,0xA0,0x81,0xDC,0xA0,0x81, -0xD9,0x86,0x35,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x77,0x77,0x77,0x2E,0x74,0x72, -0x75,0x73,0x74,0x63,0x65,0x6E,0x74,0x65,0x72,0x2E,0x64,0x65,0x2F,0x63,0x72,0x6C, -0x2F,0x76,0x32,0x2F,0x74,0x63,0x5F,0x63,0x6C,0x61,0x73,0x73,0x5F,0x32,0x5F,0x63, -0x61,0x5F,0x49,0x49,0x2E,0x63,0x72,0x6C,0x86,0x81,0x9F,0x6C,0x64,0x61,0x70,0x3A, -0x2F,0x2F,0x77,0x77,0x77,0x2E,0x74,0x72,0x75,0x73,0x74,0x63,0x65,0x6E,0x74,0x65, -0x72,0x2E,0x64,0x65,0x2F,0x43,0x4E,0x3D,0x54,0x43,0x25,0x32,0x30,0x54,0x72,0x75, -0x73,0x74,0x43,0x65,0x6E,0x74,0x65,0x72,0x25,0x32,0x30,0x43,0x6C,0x61,0x73,0x73, -0x25,0x32,0x30,0x32,0x25,0x32,0x30,0x43,0x41,0x25,0x32,0x30,0x49,0x49,0x2C,0x4F, -0x3D,0x54,0x43,0x25,0x32,0x30,0x54,0x72,0x75,0x73,0x74,0x43,0x65,0x6E,0x74,0x65, -0x72,0x25,0x32,0x30,0x47,0x6D,0x62,0x48,0x2C,0x4F,0x55,0x3D,0x72,0x6F,0x6F,0x74, -0x63,0x65,0x72,0x74,0x73,0x2C,0x44,0x43,0x3D,0x74,0x72,0x75,0x73,0x74,0x63,0x65, -0x6E,0x74,0x65,0x72,0x2C,0x44,0x43,0x3D,0x64,0x65,0x3F,0x63,0x65,0x72,0x74,0x69, -0x66,0x69,0x63,0x61,0x74,0x65,0x52,0x65,0x76,0x6F,0x63,0x61,0x74,0x69,0x6F,0x6E, -0x4C,0x69,0x73,0x74,0x3F,0x62,0x61,0x73,0x65,0x3F,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x8C,0xD7, -0xDF,0x7E,0xEE,0x1B,0x80,0x10,0xB3,0x83,0xF5,0xDB,0x11,0xEA,0x6B,0x4B,0xA8,0x92, -0x18,0xD9,0xF7,0x07,0x39,0xF5,0x2C,0xBE,0x06,0x75,0x7A,0x68,0x53,0x15,0x1C,0xEA, -0x4A,0xED,0x5E,0xFC,0x23,0xB2,0x13,0xA0,0xD3,0x09,0xFF,0xF6,0xF6,0x2E,0x6B,0x41, -0x71,0x79,0xCD,0xE2,0x6D,0xFD,0xAE,0x59,0x6B,0x85,0x1D,0xB8,0x4E,0x22,0x9A,0xED, -0x66,0x39,0x6E,0x4B,0x94,0xE6,0x55,0xFC,0x0B,0x1B,0x8B,0x77,0xC1,0x53,0x13,0x66, -0x89,0xD9,0x28,0xD6,0x8B,0xF3,0x45,0x4A,0x63,0xB7,0xFD,0x7B,0x0B,0x61,0x5D,0xB8, -0x6D,0xBE,0xC3,0xDC,0x5B,0x79,0xD2,0xED,0x86,0xE5,0xA2,0x4D,0xBE,0x5E,0x74,0x7C, -0x6A,0xED,0x16,0x38,0x1F,0x7F,0x58,0x81,0x5A,0x1A,0xEB,0x32,0x88,0x2D,0xB2,0xF3, -0x39,0x77,0x80,0xAF,0x5E,0xB6,0x61,0x75,0x29,0xDB,0x23,0x4D,0x88,0xCA,0x50,0x28, -0xCB,0x85,0xD2,0xD3,0x10,0xA2,0x59,0x6E,0xD3,0x93,0x54,0x00,0x7A,0xA2,0x46,0x95, -0x86,0x05,0x9C,0xA9,0x19,0x98,0xE5,0x31,0x72,0x0C,0x00,0xE2,0x67,0xD9,0x40,0xE0, -0x24,0x33,0x7B,0x6F,0x2C,0xB9,0x5C,0xAB,0x65,0x9D,0x2C,0xAC,0x76,0xEA,0x35,0x99, -0xF5,0x97,0xB9,0x0F,0x24,0xEC,0xC7,0x76,0x21,0x28,0x65,0xAE,0x57,0xE8,0x07,0x88, -0x75,0x4A,0x56,0xA0,0xD2,0x05,0x3A,0xA4,0xE6,0x8D,0x92,0x88,0x2C,0xF3,0xF2,0xE1, -0xC1,0xC6,0x61,0xDB,0x41,0xC5,0xC7,0x9B,0xF7,0x0E,0x1A,0x51,0x45,0xC2,0x61,0x6B, -0xDC,0x64,0x27,0x17,0x8C,0x5A,0xB7,0xDA,0x74,0x28,0xCD,0x97,0xE4,0xBD, -}; - - -/* subject:/C=DE/O=TC TrustCenter GmbH/OU=TC TrustCenter Class 3 CA/CN=TC TrustCenter Class 3 CA II */ -/* issuer :/C=DE/O=TC TrustCenter GmbH/OU=TC TrustCenter Class 3 CA/CN=TC TrustCenter Class 3 CA II */ - - -const unsigned char TC_TrustCenter_Class_3_CA_II_certificate[1198]={ -0x30,0x82,0x04,0xAA,0x30,0x82,0x03,0x92,0xA0,0x03,0x02,0x01,0x02,0x02,0x0E,0x4A, -0x47,0x00,0x01,0x00,0x02,0xE5,0xA0,0x5D,0xD6,0x3F,0x00,0x51,0xBF,0x30,0x0D,0x06, -0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x76,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x44,0x45,0x31,0x1C,0x30,0x1A,0x06, -0x03,0x55,0x04,0x0A,0x13,0x13,0x54,0x43,0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65, -0x6E,0x74,0x65,0x72,0x20,0x47,0x6D,0x62,0x48,0x31,0x22,0x30,0x20,0x06,0x03,0x55, -0x04,0x0B,0x13,0x19,0x54,0x43,0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65,0x6E,0x74, -0x65,0x72,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x33,0x20,0x43,0x41,0x31,0x25,0x30, -0x23,0x06,0x03,0x55,0x04,0x03,0x13,0x1C,0x54,0x43,0x20,0x54,0x72,0x75,0x73,0x74, -0x43,0x65,0x6E,0x74,0x65,0x72,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x33,0x20,0x43, -0x41,0x20,0x49,0x49,0x30,0x1E,0x17,0x0D,0x30,0x36,0x30,0x31,0x31,0x32,0x31,0x34, -0x34,0x31,0x35,0x37,0x5A,0x17,0x0D,0x32,0x35,0x31,0x32,0x33,0x31,0x32,0x32,0x35, -0x39,0x35,0x39,0x5A,0x30,0x76,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13, -0x02,0x44,0x45,0x31,0x1C,0x30,0x1A,0x06,0x03,0x55,0x04,0x0A,0x13,0x13,0x54,0x43, -0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65,0x6E,0x74,0x65,0x72,0x20,0x47,0x6D,0x62, -0x48,0x31,0x22,0x30,0x20,0x06,0x03,0x55,0x04,0x0B,0x13,0x19,0x54,0x43,0x20,0x54, -0x72,0x75,0x73,0x74,0x43,0x65,0x6E,0x74,0x65,0x72,0x20,0x43,0x6C,0x61,0x73,0x73, -0x20,0x33,0x20,0x43,0x41,0x31,0x25,0x30,0x23,0x06,0x03,0x55,0x04,0x03,0x13,0x1C, -0x54,0x43,0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65,0x6E,0x74,0x65,0x72,0x20,0x43, -0x6C,0x61,0x73,0x73,0x20,0x33,0x20,0x43,0x41,0x20,0x49,0x49,0x30,0x82,0x01,0x22, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03, -0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xB4,0xE0,0xBB, -0x51,0xBB,0x39,0x5C,0x8B,0x04,0xC5,0x4C,0x79,0x1C,0x23,0x86,0x31,0x10,0x63,0x43, -0x55,0x27,0x3F,0xC6,0x45,0xC7,0xA4,0x3D,0xEC,0x09,0x0D,0x1A,0x1E,0x20,0xC2,0x56, -0x1E,0xDE,0x1B,0x37,0x07,0x30,0x22,0x2F,0x6F,0xF1,0x06,0xF1,0xAB,0xAD,0xD6,0xC8, -0xAB,0x61,0xA3,0x2F,0x43,0xC4,0xB0,0xB2,0x2D,0xFC,0xC3,0x96,0x69,0x7B,0x7E,0x8A, -0xE4,0xCC,0xC0,0x39,0x12,0x90,0x42,0x60,0xC9,0xCC,0x35,0x68,0xEE,0xDA,0x5F,0x90, -0x56,0x5F,0xCD,0x1C,0x4D,0x5B,0x58,0x49,0xEB,0x0E,0x01,0x4F,0x64,0xFA,0x2C,0x3C, -0x89,0x58,0xD8,0x2F,0x2E,0xE2,0xB0,0x68,0xE9,0x22,0x3B,0x75,0x89,0xD6,0x44,0x1A, -0x65,0xF2,0x1B,0x97,0x26,0x1D,0x28,0x6D,0xAC,0xE8,0xBD,0x59,0x1D,0x2B,0x24,0xF6, -0xD6,0x84,0x03,0x66,0x88,0x24,0x00,0x78,0x60,0xF1,0xF8,0xAB,0xFE,0x02,0xB2,0x6B, -0xFB,0x22,0xFB,0x35,0xE6,0x16,0xD1,0xAD,0xF6,0x2E,0x12,0xE4,0xFA,0x35,0x6A,0xE5, -0x19,0xB9,0x5D,0xDB,0x3B,0x1E,0x1A,0xFB,0xD3,0xFF,0x15,0x14,0x08,0xD8,0x09,0x6A, -0xBA,0x45,0x9D,0x14,0x79,0x60,0x7D,0xAF,0x40,0x8A,0x07,0x73,0xB3,0x93,0x96,0xD3, -0x74,0x34,0x8D,0x3A,0x37,0x29,0xDE,0x5C,0xEC,0xF5,0xEE,0x2E,0x31,0xC2,0x20,0xDC, -0xBE,0xF1,0x4F,0x7F,0x23,0x52,0xD9,0x5B,0xE2,0x64,0xD9,0x9C,0xAA,0x07,0x08,0xB5, -0x45,0xBD,0xD1,0xD0,0x31,0xC1,0xAB,0x54,0x9F,0xA9,0xD2,0xC3,0x62,0x60,0x03,0xF1, -0xBB,0x39,0x4A,0x92,0x4A,0x3D,0x0A,0xB9,0x9D,0xC5,0xA0,0xFE,0x37,0x02,0x03,0x01, -0x00,0x01,0xA3,0x82,0x01,0x34,0x30,0x82,0x01,0x30,0x30,0x0F,0x06,0x03,0x55,0x1D, -0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06,0x03,0x55, -0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x1D,0x06,0x03,0x55, -0x1D,0x0E,0x04,0x16,0x04,0x14,0xD4,0xA2,0xFC,0x9F,0xB3,0xC3,0xD8,0x03,0xD3,0x57, -0x5C,0x07,0xA4,0xD0,0x24,0xA7,0xC0,0xF2,0x00,0xD4,0x30,0x81,0xED,0x06,0x03,0x55, -0x1D,0x1F,0x04,0x81,0xE5,0x30,0x81,0xE2,0x30,0x81,0xDF,0xA0,0x81,0xDC,0xA0,0x81, -0xD9,0x86,0x35,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x77,0x77,0x77,0x2E,0x74,0x72, -0x75,0x73,0x74,0x63,0x65,0x6E,0x74,0x65,0x72,0x2E,0x64,0x65,0x2F,0x63,0x72,0x6C, -0x2F,0x76,0x32,0x2F,0x74,0x63,0x5F,0x63,0x6C,0x61,0x73,0x73,0x5F,0x33,0x5F,0x63, -0x61,0x5F,0x49,0x49,0x2E,0x63,0x72,0x6C,0x86,0x81,0x9F,0x6C,0x64,0x61,0x70,0x3A, -0x2F,0x2F,0x77,0x77,0x77,0x2E,0x74,0x72,0x75,0x73,0x74,0x63,0x65,0x6E,0x74,0x65, -0x72,0x2E,0x64,0x65,0x2F,0x43,0x4E,0x3D,0x54,0x43,0x25,0x32,0x30,0x54,0x72,0x75, -0x73,0x74,0x43,0x65,0x6E,0x74,0x65,0x72,0x25,0x32,0x30,0x43,0x6C,0x61,0x73,0x73, -0x25,0x32,0x30,0x33,0x25,0x32,0x30,0x43,0x41,0x25,0x32,0x30,0x49,0x49,0x2C,0x4F, -0x3D,0x54,0x43,0x25,0x32,0x30,0x54,0x72,0x75,0x73,0x74,0x43,0x65,0x6E,0x74,0x65, -0x72,0x25,0x32,0x30,0x47,0x6D,0x62,0x48,0x2C,0x4F,0x55,0x3D,0x72,0x6F,0x6F,0x74, -0x63,0x65,0x72,0x74,0x73,0x2C,0x44,0x43,0x3D,0x74,0x72,0x75,0x73,0x74,0x63,0x65, -0x6E,0x74,0x65,0x72,0x2C,0x44,0x43,0x3D,0x64,0x65,0x3F,0x63,0x65,0x72,0x74,0x69, -0x66,0x69,0x63,0x61,0x74,0x65,0x52,0x65,0x76,0x6F,0x63,0x61,0x74,0x69,0x6F,0x6E, -0x4C,0x69,0x73,0x74,0x3F,0x62,0x61,0x73,0x65,0x3F,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x36,0x60, -0xE4,0x70,0xF7,0x06,0x20,0x43,0xD9,0x23,0x1A,0x42,0xF2,0xF8,0xA3,0xB2,0xB9,0x4D, -0x8A,0xB4,0xF3,0xC2,0x9A,0x55,0x31,0x7C,0xC4,0x3B,0x67,0x9A,0xB4,0xDF,0x4D,0x0E, -0x8A,0x93,0x4A,0x17,0x8B,0x1B,0x8D,0xCA,0x89,0xE1,0xCF,0x3A,0x1E,0xAC,0x1D,0xF1, -0x9C,0x32,0xB4,0x8E,0x59,0x76,0xA2,0x41,0x85,0x25,0x37,0xA0,0x13,0xD0,0xF5,0x7C, -0x4E,0xD5,0xEA,0x96,0xE2,0x6E,0x72,0xC1,0xBB,0x2A,0xFE,0x6C,0x6E,0xF8,0x91,0x98, -0x46,0xFC,0xC9,0x1B,0x57,0x5B,0xEA,0xC8,0x1A,0x3B,0x3F,0xB0,0x51,0x98,0x3C,0x07, -0xDA,0x2C,0x59,0x01,0xDA,0x8B,0x44,0xE8,0xE1,0x74,0xFD,0xA7,0x68,0xDD,0x54,0xBA, -0x83,0x46,0xEC,0xC8,0x46,0xB5,0xF8,0xAF,0x97,0xC0,0x3B,0x09,0x1C,0x8F,0xCE,0x72, -0x96,0x3D,0x33,0x56,0x70,0xBC,0x96,0xCB,0xD8,0xD5,0x7D,0x20,0x9A,0x83,0x9F,0x1A, -0xDC,0x39,0xF1,0xC5,0x72,0xA3,0x11,0x03,0xFD,0x3B,0x42,0x52,0x29,0xDB,0xE8,0x01, -0xF7,0x9B,0x5E,0x8C,0xD6,0x8D,0x86,0x4E,0x19,0xFA,0xBC,0x1C,0xBE,0xC5,0x21,0xA5, -0x87,0x9E,0x78,0x2E,0x36,0xDB,0x09,0x71,0xA3,0x72,0x34,0xF8,0x6C,0xE3,0x06,0x09, -0xF2,0x5E,0x56,0xA5,0xD3,0xDD,0x98,0xFA,0xD4,0xE6,0x06,0xF4,0xF0,0xB6,0x20,0x63, -0x4B,0xEA,0x29,0xBD,0xAA,0x82,0x66,0x1E,0xFB,0x81,0xAA,0xA7,0x37,0xAD,0x13,0x18, -0xE6,0x92,0xC3,0x81,0xC1,0x33,0xBB,0x88,0x1E,0xA1,0xE7,0xE2,0xB4,0xBD,0x31,0x6C, -0x0E,0x51,0x3D,0x6F,0xFB,0x96,0x56,0x80,0xE2,0x36,0x17,0xD1,0xDC,0xE4, -}; - - -/* subject:/C=DE/O=TC TrustCenter GmbH/OU=TC TrustCenter Universal CA/CN=TC TrustCenter Universal CA I */ -/* issuer :/C=DE/O=TC TrustCenter GmbH/OU=TC TrustCenter Universal CA/CN=TC TrustCenter Universal CA I */ - - -const unsigned char TC_TrustCenter_Universal_CA_I_certificate[993]={ -0x30,0x82,0x03,0xDD,0x30,0x82,0x02,0xC5,0xA0,0x03,0x02,0x01,0x02,0x02,0x0E,0x1D, -0xA2,0x00,0x01,0x00,0x02,0xEC,0xB7,0x60,0x80,0x78,0x8D,0xB6,0x06,0x30,0x0D,0x06, -0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x79,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x44,0x45,0x31,0x1C,0x30,0x1A,0x06, -0x03,0x55,0x04,0x0A,0x13,0x13,0x54,0x43,0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65, -0x6E,0x74,0x65,0x72,0x20,0x47,0x6D,0x62,0x48,0x31,0x24,0x30,0x22,0x06,0x03,0x55, -0x04,0x0B,0x13,0x1B,0x54,0x43,0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65,0x6E,0x74, -0x65,0x72,0x20,0x55,0x6E,0x69,0x76,0x65,0x72,0x73,0x61,0x6C,0x20,0x43,0x41,0x31, -0x26,0x30,0x24,0x06,0x03,0x55,0x04,0x03,0x13,0x1D,0x54,0x43,0x20,0x54,0x72,0x75, -0x73,0x74,0x43,0x65,0x6E,0x74,0x65,0x72,0x20,0x55,0x6E,0x69,0x76,0x65,0x72,0x73, -0x61,0x6C,0x20,0x43,0x41,0x20,0x49,0x30,0x1E,0x17,0x0D,0x30,0x36,0x30,0x33,0x32, -0x32,0x31,0x35,0x35,0x34,0x32,0x38,0x5A,0x17,0x0D,0x32,0x35,0x31,0x32,0x33,0x31, -0x32,0x32,0x35,0x39,0x35,0x39,0x5A,0x30,0x79,0x31,0x0B,0x30,0x09,0x06,0x03,0x55, -0x04,0x06,0x13,0x02,0x44,0x45,0x31,0x1C,0x30,0x1A,0x06,0x03,0x55,0x04,0x0A,0x13, -0x13,0x54,0x43,0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65,0x6E,0x74,0x65,0x72,0x20, -0x47,0x6D,0x62,0x48,0x31,0x24,0x30,0x22,0x06,0x03,0x55,0x04,0x0B,0x13,0x1B,0x54, -0x43,0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65,0x6E,0x74,0x65,0x72,0x20,0x55,0x6E, -0x69,0x76,0x65,0x72,0x73,0x61,0x6C,0x20,0x43,0x41,0x31,0x26,0x30,0x24,0x06,0x03, -0x55,0x04,0x03,0x13,0x1D,0x54,0x43,0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65,0x6E, -0x74,0x65,0x72,0x20,0x55,0x6E,0x69,0x76,0x65,0x72,0x73,0x61,0x6C,0x20,0x43,0x41, -0x20,0x49,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D, -0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82, -0x01,0x01,0x00,0xA4,0x77,0x23,0x96,0x44,0xAF,0x90,0xF4,0x31,0xA7,0x10,0xF4,0x26, -0x87,0x9C,0xF3,0x38,0xD9,0x0F,0x5E,0xDE,0xCF,0x41,0xE8,0x31,0xAD,0xC6,0x74,0x91, -0x24,0x96,0x78,0x1E,0x09,0xA0,0x9B,0x9A,0x95,0x4A,0x4A,0xF5,0x62,0x7C,0x02,0xA8, -0xCA,0xAC,0xFB,0x5A,0x04,0x76,0x39,0xDE,0x5F,0xF1,0xF9,0xB3,0xBF,0xF3,0x03,0x58, -0x55,0xD2,0xAA,0xB7,0xE3,0x04,0x22,0xD1,0xF8,0x94,0xDA,0x22,0x08,0x00,0x8D,0xD3, -0x7C,0x26,0x5D,0xCC,0x77,0x79,0xE7,0x2C,0x78,0x39,0xA8,0x26,0x73,0x0E,0xA2,0x5D, -0x25,0x69,0x85,0x4F,0x55,0x0E,0x9A,0xEF,0xC6,0xB9,0x44,0xE1,0x57,0x3D,0xDF,0x1F, -0x54,0x22,0xE5,0x6F,0x65,0xAA,0x33,0x84,0x3A,0xF3,0xCE,0x7A,0xBE,0x55,0x97,0xAE, -0x8D,0x12,0x0F,0x14,0x33,0xE2,0x50,0x70,0xC3,0x49,0x87,0x13,0xBC,0x51,0xDE,0xD7, -0x98,0x12,0x5A,0xEF,0x3A,0x83,0x33,0x92,0x06,0x75,0x8B,0x92,0x7C,0x12,0x68,0x7B, -0x70,0x6A,0x0F,0xB5,0x9B,0xB6,0x77,0x5B,0x48,0x59,0x9D,0xE4,0xEF,0x5A,0xAD,0xF3, -0xC1,0x9E,0xD4,0xD7,0x45,0x4E,0xCA,0x56,0x34,0x21,0xBC,0x3E,0x17,0x5B,0x6F,0x77, -0x0C,0x48,0x01,0x43,0x29,0xB0,0xDD,0x3F,0x96,0x6E,0xE6,0x95,0xAA,0x0C,0xC0,0x20, -0xB6,0xFD,0x3E,0x36,0x27,0x9C,0xE3,0x5C,0xCF,0x4E,0x81,0xDC,0x19,0xBB,0x91,0x90, -0x7D,0xEC,0xE6,0x97,0x04,0x1E,0x93,0xCC,0x22,0x49,0xD7,0x97,0x86,0xB6,0x13,0x0A, -0x3C,0x43,0x23,0x77,0x7E,0xF0,0xDC,0xE6,0xCD,0x24,0x1F,0x3B,0x83,0x9B,0x34,0x3A, -0x83,0x34,0xE3,0x02,0x03,0x01,0x00,0x01,0xA3,0x63,0x30,0x61,0x30,0x1F,0x06,0x03, -0x55,0x1D,0x23,0x04,0x18,0x30,0x16,0x80,0x14,0x92,0xA4,0x75,0x2C,0xA4,0x9E,0xBE, -0x81,0x44,0xEB,0x79,0xFC,0x8A,0xC5,0x95,0xA5,0xEB,0x10,0x75,0x73,0x30,0x0F,0x06, -0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E, -0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x86,0x30,0x1D, -0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x92,0xA4,0x75,0x2C,0xA4,0x9E,0xBE, -0x81,0x44,0xEB,0x79,0xFC,0x8A,0xC5,0x95,0xA5,0xEB,0x10,0x75,0x73,0x30,0x0D,0x06, -0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01, -0x00,0x28,0xD2,0xE0,0x86,0xD5,0xE6,0xF8,0x7B,0xF0,0x97,0xDC,0x22,0x6B,0x3B,0x95, -0x14,0x56,0x0F,0x11,0x30,0xA5,0x9A,0x4F,0x3A,0xB0,0x3A,0xE0,0x06,0xCB,0x65,0xF5, -0xED,0xC6,0x97,0x27,0xFE,0x25,0xF2,0x57,0xE6,0x5E,0x95,0x8C,0x3E,0x64,0x60,0x15, -0x5A,0x7F,0x2F,0x0D,0x01,0xC5,0xB1,0x60,0xFD,0x45,0x35,0xCF,0xF0,0xB2,0xBF,0x06, -0xD9,0xEF,0x5A,0xBE,0xB3,0x62,0x21,0xB4,0xD7,0xAB,0x35,0x7C,0x53,0x3E,0xA6,0x27, -0xF1,0xA1,0x2D,0xDA,0x1A,0x23,0x9D,0xCC,0xDD,0xEC,0x3C,0x2D,0x9E,0x27,0x34,0x5D, -0x0F,0xC2,0x36,0x79,0xBC,0xC9,0x4A,0x62,0x2D,0xED,0x6B,0xD9,0x7D,0x41,0x43,0x7C, -0xB6,0xAA,0xCA,0xED,0x61,0xB1,0x37,0x82,0x15,0x09,0x1A,0x8A,0x16,0x30,0xD8,0xEC, -0xC9,0xD6,0x47,0x72,0x78,0x4B,0x10,0x46,0x14,0x8E,0x5F,0x0E,0xAF,0xEC,0xC7,0x2F, -0xAB,0x10,0xD7,0xB6,0xF1,0x6E,0xEC,0x86,0xB2,0xC2,0xE8,0x0D,0x92,0x73,0xDC,0xA2, -0xF4,0x0F,0x3A,0xBF,0x61,0x23,0x10,0x89,0x9C,0x48,0x40,0x6E,0x70,0x00,0xB3,0xD3, -0xBA,0x37,0x44,0x58,0x11,0x7A,0x02,0x6A,0x88,0xF0,0x37,0x34,0xF0,0x19,0xE9,0xAC, -0xD4,0x65,0x73,0xF6,0x69,0x8C,0x64,0x94,0x3A,0x79,0x85,0x29,0xB0,0x16,0x2B,0x0C, -0x82,0x3F,0x06,0x9C,0xC7,0xFD,0x10,0x2B,0x9E,0x0F,0x2C,0xB6,0x9E,0xE3,0x15,0xBF, -0xD9,0x36,0x1C,0xBA,0x25,0x1A,0x52,0x3D,0x1A,0xEC,0x22,0x0C,0x1C,0xE0,0xA4,0xA2, -0x3D,0xF0,0xE8,0x39,0xCF,0x81,0xC0,0x7B,0xED,0x5D,0x1F,0x6F,0xC5,0xD0,0x0B,0xD7, -0x98, -}; - - -/* subject:/C=DE/O=TC TrustCenter GmbH/OU=TC TrustCenter Universal CA/CN=TC TrustCenter Universal CA III */ -/* issuer :/C=DE/O=TC TrustCenter GmbH/OU=TC TrustCenter Universal CA/CN=TC TrustCenter Universal CA III */ - - -const unsigned char TC_TrustCenter_Universal_CA_III_certificate[997]={ -0x30,0x82,0x03,0xE1,0x30,0x82,0x02,0xC9,0xA0,0x03,0x02,0x01,0x02,0x02,0x0E,0x63, -0x25,0x00,0x01,0x00,0x02,0x14,0x8D,0x33,0x15,0x02,0xE4,0x6C,0xF4,0x30,0x0D,0x06, -0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x7B,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x44,0x45,0x31,0x1C,0x30,0x1A,0x06, -0x03,0x55,0x04,0x0A,0x13,0x13,0x54,0x43,0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65, -0x6E,0x74,0x65,0x72,0x20,0x47,0x6D,0x62,0x48,0x31,0x24,0x30,0x22,0x06,0x03,0x55, -0x04,0x0B,0x13,0x1B,0x54,0x43,0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65,0x6E,0x74, -0x65,0x72,0x20,0x55,0x6E,0x69,0x76,0x65,0x72,0x73,0x61,0x6C,0x20,0x43,0x41,0x31, -0x28,0x30,0x26,0x06,0x03,0x55,0x04,0x03,0x13,0x1F,0x54,0x43,0x20,0x54,0x72,0x75, -0x73,0x74,0x43,0x65,0x6E,0x74,0x65,0x72,0x20,0x55,0x6E,0x69,0x76,0x65,0x72,0x73, -0x61,0x6C,0x20,0x43,0x41,0x20,0x49,0x49,0x49,0x30,0x1E,0x17,0x0D,0x30,0x39,0x30, -0x39,0x30,0x39,0x30,0x38,0x31,0x35,0x32,0x37,0x5A,0x17,0x0D,0x32,0x39,0x31,0x32, -0x33,0x31,0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x7B,0x31,0x0B,0x30,0x09,0x06, -0x03,0x55,0x04,0x06,0x13,0x02,0x44,0x45,0x31,0x1C,0x30,0x1A,0x06,0x03,0x55,0x04, -0x0A,0x13,0x13,0x54,0x43,0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65,0x6E,0x74,0x65, -0x72,0x20,0x47,0x6D,0x62,0x48,0x31,0x24,0x30,0x22,0x06,0x03,0x55,0x04,0x0B,0x13, -0x1B,0x54,0x43,0x20,0x54,0x72,0x75,0x73,0x74,0x43,0x65,0x6E,0x74,0x65,0x72,0x20, -0x55,0x6E,0x69,0x76,0x65,0x72,0x73,0x61,0x6C,0x20,0x43,0x41,0x31,0x28,0x30,0x26, -0x06,0x03,0x55,0x04,0x03,0x13,0x1F,0x54,0x43,0x20,0x54,0x72,0x75,0x73,0x74,0x43, -0x65,0x6E,0x74,0x65,0x72,0x20,0x55,0x6E,0x69,0x76,0x65,0x72,0x73,0x61,0x6C,0x20, -0x43,0x41,0x20,0x49,0x49,0x49,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82, -0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xC2,0xDA,0x9C,0x62,0xB0,0xB9,0x71,0x12,0xB0, -0x0B,0xC8,0x1A,0x57,0xB2,0xAE,0x83,0x14,0x99,0xB3,0x34,0x4B,0x9B,0x90,0xA2,0xC5, -0xE7,0xE7,0x2F,0x02,0xA0,0x4D,0x2D,0xA4,0xFA,0x85,0xDA,0x9B,0x25,0x85,0x2D,0x40, -0x28,0x20,0x6D,0xEA,0xE0,0xBD,0xB1,0x48,0x83,0x22,0x29,0x44,0x9F,0x4E,0x83,0xEE, -0x35,0x51,0x13,0x73,0x74,0xD5,0xBC,0xF2,0x30,0x66,0x94,0x53,0xC0,0x40,0x36,0x2F, -0x0C,0x84,0x65,0xCE,0x0F,0x6E,0xC2,0x58,0x93,0xE8,0x2C,0x0B,0x3A,0xE9,0xC1,0x8E, -0xFB,0xF2,0x6B,0xCA,0x3C,0xE2,0x9C,0x4E,0x8E,0xE4,0xF9,0x7D,0xD3,0x27,0x9F,0x1B, -0xD5,0x67,0x78,0x87,0x2D,0x7F,0x0B,0x47,0xB3,0xC7,0xE8,0xC9,0x48,0x7C,0xAF,0x2F, -0xCC,0x0A,0xD9,0x41,0xEF,0x9F,0xFE,0x9A,0xE1,0xB2,0xAE,0xF9,0x53,0xB5,0xE5,0xE9, -0x46,0x9F,0x60,0xE3,0xDF,0x8D,0xD3,0x7F,0xFB,0x96,0x7E,0xB3,0xB5,0x72,0xF8,0x4B, -0xAD,0x08,0x79,0xCD,0x69,0x89,0x40,0x27,0xF5,0x2A,0xC1,0xAD,0x43,0xEC,0xA4,0x53, -0xC8,0x61,0xB6,0xF7,0xD2,0x79,0x2A,0x67,0x18,0x76,0x48,0x6D,0x5B,0x25,0x01,0xD1, -0x26,0xC5,0xB7,0x57,0x69,0x23,0x15,0x5B,0x61,0x8A,0xAD,0xF0,0x1B,0x2D,0xD9,0xAF, -0x5C,0xF1,0x26,0x90,0x69,0xA9,0xD5,0x0C,0x40,0xF5,0x33,0x80,0x43,0x8F,0x9C,0xA3, -0x76,0x2A,0x45,0xB4,0xAF,0xBF,0x7F,0x3E,0x87,0x3F,0x76,0xC5,0xCD,0x2A,0xDE,0x20, -0xC5,0x16,0x58,0xCB,0xF9,0x1B,0xF5,0x0F,0xCB,0x0D,0x11,0x52,0x64,0xB8,0xD2,0x76, -0x62,0x77,0x83,0xF1,0x58,0x9F,0xFF,0x02,0x03,0x01,0x00,0x01,0xA3,0x63,0x30,0x61, -0x30,0x1F,0x06,0x03,0x55,0x1D,0x23,0x04,0x18,0x30,0x16,0x80,0x14,0x56,0xE7,0xE1, -0x5B,0x25,0x43,0x80,0xE0,0xF6,0x8C,0xE1,0x71,0xBC,0x8E,0xE5,0x80,0x2F,0xC4,0x48, -0xE2,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01, -0x01,0xFF,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02, -0x01,0x06,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x56,0xE7,0xE1, -0x5B,0x25,0x43,0x80,0xE0,0xF6,0x8C,0xE1,0x71,0xBC,0x8E,0xE5,0x80,0x2F,0xC4,0x48, -0xE2,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00, -0x03,0x82,0x01,0x01,0x00,0x83,0xC7,0xAF,0xEA,0x7F,0x4D,0x0A,0x3C,0x39,0xB1,0x68, -0xBE,0x7B,0x6D,0x89,0x2E,0xE9,0xB3,0x09,0xE7,0x18,0x57,0x8D,0x85,0x9A,0x17,0xF3, -0x76,0x42,0x50,0x13,0x0F,0xC7,0x90,0x6F,0x33,0xAD,0xC5,0x49,0x60,0x2B,0x6C,0x49, -0x58,0x19,0xD4,0xE2,0xBE,0xB7,0xBF,0xAB,0x49,0xBC,0x94,0xC8,0xAB,0xBE,0x28,0x6C, -0x16,0x68,0xE0,0xC8,0x97,0x46,0x20,0xA0,0x68,0x67,0x60,0x88,0x39,0x20,0x51,0xD8, -0x68,0x01,0x11,0xCE,0xA7,0xF6,0x11,0x07,0xF6,0xEC,0xEC,0xAC,0x1A,0x1F,0xB2,0x66, -0x6E,0x56,0x67,0x60,0x7A,0x74,0x5E,0xC0,0x6D,0x97,0x36,0xAE,0xB5,0x0D,0x5D,0x66, -0x73,0xC0,0x25,0x32,0x45,0xD8,0x4A,0x06,0x07,0x8F,0xC4,0xB7,0x07,0xB1,0x4D,0x06, -0x0D,0xE1,0xA5,0xEB,0xF4,0x75,0xCA,0xBA,0x9C,0xD0,0xBD,0xB3,0xD3,0x32,0x24,0x4C, -0xEE,0x7E,0xE2,0x76,0x04,0x4B,0x49,0x53,0xD8,0xF2,0xE9,0x54,0x33,0xFC,0xE5,0x71, -0x1F,0x3D,0x14,0x5C,0x96,0x4B,0xF1,0x3A,0xF2,0x00,0xBB,0x6C,0xB4,0xFA,0x96,0x55, -0x08,0x88,0x09,0xC1,0xCC,0x91,0x19,0x29,0xB0,0x20,0x2D,0xFF,0xCB,0x38,0xA4,0x40, -0xE1,0x17,0xBE,0x79,0x61,0x80,0xFF,0x07,0x03,0x86,0x4C,0x4E,0x7B,0x06,0x9F,0x11, -0x86,0x8D,0x89,0xEE,0x27,0xC4,0xDB,0xE2,0xBC,0x19,0x8E,0x0B,0xC3,0xC3,0x13,0xC7, -0x2D,0x03,0x63,0x3B,0xD3,0xE8,0xE4,0xA2,0x2A,0xC2,0x82,0x08,0x94,0x16,0x54,0xF0, -0xEF,0x1F,0x27,0x90,0x25,0xB8,0x0D,0x0E,0x28,0x1B,0x47,0x77,0x47,0xBD,0x1C,0xA8, -0x25,0xF1,0x94,0xB4,0x66, -}; - - -/* subject:/C=ZA/ST=Western Cape/L=Cape Town/O=Thawte Consulting cc/OU=Certification Services Division/CN=Thawte Premium Server CA/emailAddress=premium-server@thawte.com */ -/* issuer :/C=ZA/ST=Western Cape/L=Cape Town/O=Thawte Consulting cc/OU=Certification Services Division/CN=Thawte Premium Server CA/emailAddress=premium-server@thawte.com */ - - -const unsigned char Thawte_Premium_Server_CA_certificate[811]={ -0x30,0x82,0x03,0x27,0x30,0x82,0x02,0x90,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x04,0x05,0x00,0x30, -0x81,0xCE,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x5A,0x41,0x31, -0x15,0x30,0x13,0x06,0x03,0x55,0x04,0x08,0x13,0x0C,0x57,0x65,0x73,0x74,0x65,0x72, -0x6E,0x20,0x43,0x61,0x70,0x65,0x31,0x12,0x30,0x10,0x06,0x03,0x55,0x04,0x07,0x13, -0x09,0x43,0x61,0x70,0x65,0x20,0x54,0x6F,0x77,0x6E,0x31,0x1D,0x30,0x1B,0x06,0x03, -0x55,0x04,0x0A,0x13,0x14,0x54,0x68,0x61,0x77,0x74,0x65,0x20,0x43,0x6F,0x6E,0x73, -0x75,0x6C,0x74,0x69,0x6E,0x67,0x20,0x63,0x63,0x31,0x28,0x30,0x26,0x06,0x03,0x55, -0x04,0x0B,0x13,0x1F,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F, -0x6E,0x20,0x53,0x65,0x72,0x76,0x69,0x63,0x65,0x73,0x20,0x44,0x69,0x76,0x69,0x73, -0x69,0x6F,0x6E,0x31,0x21,0x30,0x1F,0x06,0x03,0x55,0x04,0x03,0x13,0x18,0x54,0x68, -0x61,0x77,0x74,0x65,0x20,0x50,0x72,0x65,0x6D,0x69,0x75,0x6D,0x20,0x53,0x65,0x72, -0x76,0x65,0x72,0x20,0x43,0x41,0x31,0x28,0x30,0x26,0x06,0x09,0x2A,0x86,0x48,0x86, -0xF7,0x0D,0x01,0x09,0x01,0x16,0x19,0x70,0x72,0x65,0x6D,0x69,0x75,0x6D,0x2D,0x73, -0x65,0x72,0x76,0x65,0x72,0x40,0x74,0x68,0x61,0x77,0x74,0x65,0x2E,0x63,0x6F,0x6D, -0x30,0x1E,0x17,0x0D,0x39,0x36,0x30,0x38,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30, -0x5A,0x17,0x0D,0x32,0x30,0x31,0x32,0x33,0x31,0x32,0x33,0x35,0x39,0x35,0x39,0x5A, -0x30,0x81,0xCE,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x5A,0x41, -0x31,0x15,0x30,0x13,0x06,0x03,0x55,0x04,0x08,0x13,0x0C,0x57,0x65,0x73,0x74,0x65, -0x72,0x6E,0x20,0x43,0x61,0x70,0x65,0x31,0x12,0x30,0x10,0x06,0x03,0x55,0x04,0x07, -0x13,0x09,0x43,0x61,0x70,0x65,0x20,0x54,0x6F,0x77,0x6E,0x31,0x1D,0x30,0x1B,0x06, -0x03,0x55,0x04,0x0A,0x13,0x14,0x54,0x68,0x61,0x77,0x74,0x65,0x20,0x43,0x6F,0x6E, -0x73,0x75,0x6C,0x74,0x69,0x6E,0x67,0x20,0x63,0x63,0x31,0x28,0x30,0x26,0x06,0x03, -0x55,0x04,0x0B,0x13,0x1F,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69, -0x6F,0x6E,0x20,0x53,0x65,0x72,0x76,0x69,0x63,0x65,0x73,0x20,0x44,0x69,0x76,0x69, -0x73,0x69,0x6F,0x6E,0x31,0x21,0x30,0x1F,0x06,0x03,0x55,0x04,0x03,0x13,0x18,0x54, -0x68,0x61,0x77,0x74,0x65,0x20,0x50,0x72,0x65,0x6D,0x69,0x75,0x6D,0x20,0x53,0x65, -0x72,0x76,0x65,0x72,0x20,0x43,0x41,0x31,0x28,0x30,0x26,0x06,0x09,0x2A,0x86,0x48, -0x86,0xF7,0x0D,0x01,0x09,0x01,0x16,0x19,0x70,0x72,0x65,0x6D,0x69,0x75,0x6D,0x2D, -0x73,0x65,0x72,0x76,0x65,0x72,0x40,0x74,0x68,0x61,0x77,0x74,0x65,0x2E,0x63,0x6F, -0x6D,0x30,0x81,0x9F,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01, -0x01,0x05,0x00,0x03,0x81,0x8D,0x00,0x30,0x81,0x89,0x02,0x81,0x81,0x00,0xD2,0x36, -0x36,0x6A,0x8B,0xD7,0xC2,0x5B,0x9E,0xDA,0x81,0x41,0x62,0x8F,0x38,0xEE,0x49,0x04, -0x55,0xD6,0xD0,0xEF,0x1C,0x1B,0x95,0x16,0x47,0xEF,0x18,0x48,0x35,0x3A,0x52,0xF4, -0x2B,0x6A,0x06,0x8F,0x3B,0x2F,0xEA,0x56,0xE3,0xAF,0x86,0x8D,0x9E,0x17,0xF7,0x9E, -0xB4,0x65,0x75,0x02,0x4D,0xEF,0xCB,0x09,0xA2,0x21,0x51,0xD8,0x9B,0xD0,0x67,0xD0, -0xBA,0x0D,0x92,0x06,0x14,0x73,0xD4,0x93,0xCB,0x97,0x2A,0x00,0x9C,0x5C,0x4E,0x0C, -0xBC,0xFA,0x15,0x52,0xFC,0xF2,0x44,0x6E,0xDA,0x11,0x4A,0x6E,0x08,0x9F,0x2F,0x2D, -0xE3,0xF9,0xAA,0x3A,0x86,0x73,0xB6,0x46,0x53,0x58,0xC8,0x89,0x05,0xBD,0x83,0x11, -0xB8,0x73,0x3F,0xAA,0x07,0x8D,0xF4,0x42,0x4D,0xE7,0x40,0x9D,0x1C,0x37,0x02,0x03, -0x01,0x00,0x01,0xA3,0x13,0x30,0x11,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01, -0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86, -0xF7,0x0D,0x01,0x01,0x04,0x05,0x00,0x03,0x81,0x81,0x00,0x26,0x48,0x2C,0x16,0xC2, -0x58,0xFA,0xE8,0x16,0x74,0x0C,0xAA,0xAA,0x5F,0x54,0x3F,0xF2,0xD7,0xC9,0x78,0x60, -0x5E,0x5E,0x6E,0x37,0x63,0x22,0x77,0x36,0x7E,0xB2,0x17,0xC4,0x34,0xB9,0xF5,0x08, -0x85,0xFC,0xC9,0x01,0x38,0xFF,0x4D,0xBE,0xF2,0x16,0x42,0x43,0xE7,0xBB,0x5A,0x46, -0xFB,0xC1,0xC6,0x11,0x1F,0xF1,0x4A,0xB0,0x28,0x46,0xC9,0xC3,0xC4,0x42,0x7D,0xBC, -0xFA,0xAB,0x59,0x6E,0xD5,0xB7,0x51,0x88,0x11,0xE3,0xA4,0x85,0x19,0x6B,0x82,0x4C, -0xA4,0x0C,0x12,0xAD,0xE9,0xA4,0xAE,0x3F,0xF1,0xC3,0x49,0x65,0x9A,0x8C,0xC5,0xC8, -0x3E,0x25,0xB7,0x94,0x99,0xBB,0x92,0x32,0x71,0x07,0xF0,0x86,0x5E,0xED,0x50,0x27, -0xA6,0x0D,0xA6,0x23,0xF9,0xBB,0xCB,0xA6,0x07,0x14,0x42, -}; - - -/* subject:/C=US/O=thawte, Inc./OU=Certification Services Division/OU=(c) 2006 thawte, Inc. - For authorized use only/CN=thawte Primary Root CA */ -/* issuer :/C=US/O=thawte, Inc./OU=Certification Services Division/OU=(c) 2006 thawte, Inc. - For authorized use only/CN=thawte Primary Root CA */ - - -const unsigned char thawte_Primary_Root_CA_certificate[1060]={ -0x30,0x82,0x04,0x20,0x30,0x82,0x03,0x08,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x34, -0x4E,0xD5,0x57,0x20,0xD5,0xED,0xEC,0x49,0xF4,0x2F,0xCE,0x37,0xDB,0x2B,0x6D,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x81, -0xA9,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x15, -0x30,0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x74,0x68,0x61,0x77,0x74,0x65,0x2C, -0x20,0x49,0x6E,0x63,0x2E,0x31,0x28,0x30,0x26,0x06,0x03,0x55,0x04,0x0B,0x13,0x1F, -0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x53,0x65, -0x72,0x76,0x69,0x63,0x65,0x73,0x20,0x44,0x69,0x76,0x69,0x73,0x69,0x6F,0x6E,0x31, -0x38,0x30,0x36,0x06,0x03,0x55,0x04,0x0B,0x13,0x2F,0x28,0x63,0x29,0x20,0x32,0x30, -0x30,0x36,0x20,0x74,0x68,0x61,0x77,0x74,0x65,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20, -0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74,0x68,0x6F,0x72,0x69,0x7A,0x65,0x64, -0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55, -0x04,0x03,0x13,0x16,0x74,0x68,0x61,0x77,0x74,0x65,0x20,0x50,0x72,0x69,0x6D,0x61, -0x72,0x79,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x30,0x1E,0x17,0x0D,0x30,0x36, -0x31,0x31,0x31,0x37,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x36,0x30, -0x37,0x31,0x36,0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x81,0xA9,0x31,0x0B,0x30, -0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x15,0x30,0x13,0x06,0x03, -0x55,0x04,0x0A,0x13,0x0C,0x74,0x68,0x61,0x77,0x74,0x65,0x2C,0x20,0x49,0x6E,0x63, -0x2E,0x31,0x28,0x30,0x26,0x06,0x03,0x55,0x04,0x0B,0x13,0x1F,0x43,0x65,0x72,0x74, -0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x53,0x65,0x72,0x76,0x69,0x63, -0x65,0x73,0x20,0x44,0x69,0x76,0x69,0x73,0x69,0x6F,0x6E,0x31,0x38,0x30,0x36,0x06, -0x03,0x55,0x04,0x0B,0x13,0x2F,0x28,0x63,0x29,0x20,0x32,0x30,0x30,0x36,0x20,0x74, -0x68,0x61,0x77,0x74,0x65,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F, -0x72,0x20,0x61,0x75,0x74,0x68,0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65, -0x20,0x6F,0x6E,0x6C,0x79,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x03,0x13,0x16, -0x74,0x68,0x61,0x77,0x74,0x65,0x20,0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x52, -0x6F,0x6F,0x74,0x20,0x43,0x41,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82, -0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xAC,0xA0,0xF0,0xFB,0x80,0x59,0xD4,0x9C,0xC7, -0xA4,0xCF,0x9D,0xA1,0x59,0x73,0x09,0x10,0x45,0x0C,0x0D,0x2C,0x6E,0x68,0xF1,0x6C, -0x5B,0x48,0x68,0x49,0x59,0x37,0xFC,0x0B,0x33,0x19,0xC2,0x77,0x7F,0xCC,0x10,0x2D, -0x95,0x34,0x1C,0xE6,0xEB,0x4D,0x09,0xA7,0x1C,0xD2,0xB8,0xC9,0x97,0x36,0x02,0xB7, -0x89,0xD4,0x24,0x5F,0x06,0xC0,0xCC,0x44,0x94,0x94,0x8D,0x02,0x62,0x6F,0xEB,0x5A, -0xDD,0x11,0x8D,0x28,0x9A,0x5C,0x84,0x90,0x10,0x7A,0x0D,0xBD,0x74,0x66,0x2F,0x6A, -0x38,0xA0,0xE2,0xD5,0x54,0x44,0xEB,0x1D,0x07,0x9F,0x07,0xBA,0x6F,0xEE,0xE9,0xFD, -0x4E,0x0B,0x29,0xF5,0x3E,0x84,0xA0,0x01,0xF1,0x9C,0xAB,0xF8,0x1C,0x7E,0x89,0xA4, -0xE8,0xA1,0xD8,0x71,0x65,0x0D,0xA3,0x51,0x7B,0xEE,0xBC,0xD2,0x22,0x60,0x0D,0xB9, -0x5B,0x9D,0xDF,0xBA,0xFC,0x51,0x5B,0x0B,0xAF,0x98,0xB2,0xE9,0x2E,0xE9,0x04,0xE8, -0x62,0x87,0xDE,0x2B,0xC8,0xD7,0x4E,0xC1,0x4C,0x64,0x1E,0xDD,0xCF,0x87,0x58,0xBA, -0x4A,0x4F,0xCA,0x68,0x07,0x1D,0x1C,0x9D,0x4A,0xC6,0xD5,0x2F,0x91,0xCC,0x7C,0x71, -0x72,0x1C,0xC5,0xC0,0x67,0xEB,0x32,0xFD,0xC9,0x92,0x5C,0x94,0xDA,0x85,0xC0,0x9B, -0xBF,0x53,0x7D,0x2B,0x09,0xF4,0x8C,0x9D,0x91,0x1F,0x97,0x6A,0x52,0xCB,0xDE,0x09, -0x36,0xA4,0x77,0xD8,0x7B,0x87,0x50,0x44,0xD5,0x3E,0x6E,0x29,0x69,0xFB,0x39,0x49, -0x26,0x1E,0x09,0xA5,0x80,0x7B,0x40,0x2D,0xEB,0xE8,0x27,0x85,0xC9,0xFE,0x61,0xFD, -0x7E,0xE6,0x7C,0x97,0x1D,0xD5,0x9D,0x02,0x03,0x01,0x00,0x01,0xA3,0x42,0x30,0x40, -0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01, -0xFF,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01, -0x06,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x7B,0x5B,0x45,0xCF, -0xAF,0xCE,0xCB,0x7A,0xFD,0x31,0x92,0x1A,0x6A,0xB6,0xF3,0x46,0xEB,0x57,0x48,0x50, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03, -0x82,0x01,0x01,0x00,0x79,0x11,0xC0,0x4B,0xB3,0x91,0xB6,0xFC,0xF0,0xE9,0x67,0xD4, -0x0D,0x6E,0x45,0xBE,0x55,0xE8,0x93,0xD2,0xCE,0x03,0x3F,0xED,0xDA,0x25,0xB0,0x1D, -0x57,0xCB,0x1E,0x3A,0x76,0xA0,0x4C,0xEC,0x50,0x76,0xE8,0x64,0x72,0x0C,0xA4,0xA9, -0xF1,0xB8,0x8B,0xD6,0xD6,0x87,0x84,0xBB,0x32,0xE5,0x41,0x11,0xC0,0x77,0xD9,0xB3, -0x60,0x9D,0xEB,0x1B,0xD5,0xD1,0x6E,0x44,0x44,0xA9,0xA6,0x01,0xEC,0x55,0x62,0x1D, -0x77,0xB8,0x5C,0x8E,0x48,0x49,0x7C,0x9C,0x3B,0x57,0x11,0xAC,0xAD,0x73,0x37,0x8E, -0x2F,0x78,0x5C,0x90,0x68,0x47,0xD9,0x60,0x60,0xE6,0xFC,0x07,0x3D,0x22,0x20,0x17, -0xC4,0xF7,0x16,0xE9,0xC4,0xD8,0x72,0xF9,0xC8,0x73,0x7C,0xDF,0x16,0x2F,0x15,0xA9, -0x3E,0xFD,0x6A,0x27,0xB6,0xA1,0xEB,0x5A,0xBA,0x98,0x1F,0xD5,0xE3,0x4D,0x64,0x0A, -0x9D,0x13,0xC8,0x61,0xBA,0xF5,0x39,0x1C,0x87,0xBA,0xB8,0xBD,0x7B,0x22,0x7F,0xF6, -0xFE,0xAC,0x40,0x79,0xE5,0xAC,0x10,0x6F,0x3D,0x8F,0x1B,0x79,0x76,0x8B,0xC4,0x37, -0xB3,0x21,0x18,0x84,0xE5,0x36,0x00,0xEB,0x63,0x20,0x99,0xB9,0xE9,0xFE,0x33,0x04, -0xBB,0x41,0xC8,0xC1,0x02,0xF9,0x44,0x63,0x20,0x9E,0x81,0xCE,0x42,0xD3,0xD6,0x3F, -0x2C,0x76,0xD3,0x63,0x9C,0x59,0xDD,0x8F,0xA6,0xE1,0x0E,0xA0,0x2E,0x41,0xF7,0x2E, -0x95,0x47,0xCF,0xBC,0xFD,0x33,0xF3,0xF6,0x0B,0x61,0x7E,0x7E,0x91,0x2B,0x81,0x47, -0xC2,0x27,0x30,0xEE,0xA7,0x10,0x5D,0x37,0x8F,0x5C,0x39,0x2B,0xE4,0x04,0xF0,0x7B, -0x8D,0x56,0x8C,0x68, -}; - - -/* subject:/C=US/O=thawte, Inc./OU=(c) 2007 thawte, Inc. - For authorized use only/CN=thawte Primary Root CA - G2 */ -/* issuer :/C=US/O=thawte, Inc./OU=(c) 2007 thawte, Inc. - For authorized use only/CN=thawte Primary Root CA - G2 */ - - -const unsigned char thawte_Primary_Root_CA___G2_certificate[652]={ -0x30,0x82,0x02,0x88,0x30,0x82,0x02,0x0D,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x35, -0xFC,0x26,0x5C,0xD9,0x84,0x4F,0xC9,0x3D,0x26,0x3D,0x57,0x9B,0xAE,0xD7,0x56,0x30, -0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,0x30,0x81,0x84,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x15,0x30,0x13,0x06, -0x03,0x55,0x04,0x0A,0x13,0x0C,0x74,0x68,0x61,0x77,0x74,0x65,0x2C,0x20,0x49,0x6E, -0x63,0x2E,0x31,0x38,0x30,0x36,0x06,0x03,0x55,0x04,0x0B,0x13,0x2F,0x28,0x63,0x29, -0x20,0x32,0x30,0x30,0x37,0x20,0x74,0x68,0x61,0x77,0x74,0x65,0x2C,0x20,0x49,0x6E, -0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74,0x68,0x6F,0x72,0x69, -0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79,0x31,0x24,0x30,0x22, -0x06,0x03,0x55,0x04,0x03,0x13,0x1B,0x74,0x68,0x61,0x77,0x74,0x65,0x20,0x50,0x72, -0x69,0x6D,0x61,0x72,0x79,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x20,0x2D,0x20, -0x47,0x32,0x30,0x1E,0x17,0x0D,0x30,0x37,0x31,0x31,0x30,0x35,0x30,0x30,0x30,0x30, -0x30,0x30,0x5A,0x17,0x0D,0x33,0x38,0x30,0x31,0x31,0x38,0x32,0x33,0x35,0x39,0x35, -0x39,0x5A,0x30,0x81,0x84,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02, -0x55,0x53,0x31,0x15,0x30,0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x74,0x68,0x61, -0x77,0x74,0x65,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x38,0x30,0x36,0x06,0x03,0x55, -0x04,0x0B,0x13,0x2F,0x28,0x63,0x29,0x20,0x32,0x30,0x30,0x37,0x20,0x74,0x68,0x61, -0x77,0x74,0x65,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20, -0x61,0x75,0x74,0x68,0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F, -0x6E,0x6C,0x79,0x31,0x24,0x30,0x22,0x06,0x03,0x55,0x04,0x03,0x13,0x1B,0x74,0x68, -0x61,0x77,0x74,0x65,0x20,0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x52,0x6F,0x6F, -0x74,0x20,0x43,0x41,0x20,0x2D,0x20,0x47,0x32,0x30,0x76,0x30,0x10,0x06,0x07,0x2A, -0x86,0x48,0xCE,0x3D,0x02,0x01,0x06,0x05,0x2B,0x81,0x04,0x00,0x22,0x03,0x62,0x00, -0x04,0xA2,0xD5,0x9C,0x82,0x7B,0x95,0x9D,0xF1,0x52,0x78,0x87,0xFE,0x8A,0x16,0xBF, -0x05,0xE6,0xDF,0xA3,0x02,0x4F,0x0D,0x07,0xC6,0x00,0x51,0xBA,0x0C,0x02,0x52,0x2D, -0x22,0xA4,0x42,0x39,0xC4,0xFE,0x8F,0xEA,0xC9,0xC1,0xBE,0xD4,0x4D,0xFF,0x9F,0x7A, -0x9E,0xE2,0xB1,0x7C,0x9A,0xAD,0xA7,0x86,0x09,0x73,0x87,0xD1,0xE7,0x9A,0xE3,0x7A, -0xA5,0xAA,0x6E,0xFB,0xBA,0xB3,0x70,0xC0,0x67,0x88,0xA2,0x35,0xD4,0xA3,0x9A,0xB1, -0xFD,0xAD,0xC2,0xEF,0x31,0xFA,0xA8,0xB9,0xF3,0xFB,0x08,0xC6,0x91,0xD1,0xFB,0x29, -0x95,0xA3,0x42,0x30,0x40,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04, -0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF, -0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04, -0x14,0x9A,0xD8,0x00,0x30,0x00,0xE7,0x6B,0x7F,0x85,0x18,0xEE,0x8B,0xB6,0xCE,0x8A, -0x0C,0xF8,0x11,0xE1,0xBB,0x30,0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03, -0x03,0x03,0x69,0x00,0x30,0x66,0x02,0x31,0x00,0xDD,0xF8,0xE0,0x57,0x47,0x5B,0xA7, -0xE6,0x0A,0xC3,0xBD,0xF5,0x80,0x8A,0x97,0x35,0x0D,0x1B,0x89,0x3C,0x54,0x86,0x77, -0x28,0xCA,0xA1,0xF4,0x79,0xDE,0xB5,0xE6,0x38,0xB0,0xF0,0x65,0x70,0x8C,0x7F,0x02, -0x54,0xC2,0xBF,0xFF,0xD8,0xA1,0x3E,0xD9,0xCF,0x02,0x31,0x00,0xC4,0x8D,0x94,0xFC, -0xDC,0x53,0xD2,0xDC,0x9D,0x78,0x16,0x1F,0x15,0x33,0x23,0x53,0x52,0xE3,0x5A,0x31, -0x5D,0x9D,0xCA,0xAE,0xBD,0x13,0x29,0x44,0x0D,0x27,0x5B,0xA8,0xE7,0x68,0x9C,0x12, -0xF7,0x58,0x3F,0x2E,0x72,0x02,0x57,0xA3,0x8F,0xA1,0x14,0x2E, -}; - - -/* subject:/C=US/O=thawte, Inc./OU=Certification Services Division/OU=(c) 2008 thawte, Inc. - For authorized use only/CN=thawte Primary Root CA - G3 */ -/* issuer :/C=US/O=thawte, Inc./OU=Certification Services Division/OU=(c) 2008 thawte, Inc. - For authorized use only/CN=thawte Primary Root CA - G3 */ - - -const unsigned char thawte_Primary_Root_CA___G3_certificate[1070]={ -0x30,0x82,0x04,0x2A,0x30,0x82,0x03,0x12,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x60, -0x01,0x97,0xB7,0x46,0xA7,0xEA,0xB4,0xB4,0x9A,0xD6,0x4B,0x2F,0xF7,0x90,0xFB,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x30,0x81, -0xAE,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x15, -0x30,0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x74,0x68,0x61,0x77,0x74,0x65,0x2C, -0x20,0x49,0x6E,0x63,0x2E,0x31,0x28,0x30,0x26,0x06,0x03,0x55,0x04,0x0B,0x13,0x1F, -0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x53,0x65, -0x72,0x76,0x69,0x63,0x65,0x73,0x20,0x44,0x69,0x76,0x69,0x73,0x69,0x6F,0x6E,0x31, -0x38,0x30,0x36,0x06,0x03,0x55,0x04,0x0B,0x13,0x2F,0x28,0x63,0x29,0x20,0x32,0x30, -0x30,0x38,0x20,0x74,0x68,0x61,0x77,0x74,0x65,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20, -0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74,0x68,0x6F,0x72,0x69,0x7A,0x65,0x64, -0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79,0x31,0x24,0x30,0x22,0x06,0x03,0x55, -0x04,0x03,0x13,0x1B,0x74,0x68,0x61,0x77,0x74,0x65,0x20,0x50,0x72,0x69,0x6D,0x61, -0x72,0x79,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x20,0x2D,0x20,0x47,0x33,0x30, -0x1E,0x17,0x0D,0x30,0x38,0x30,0x34,0x30,0x32,0x30,0x30,0x30,0x30,0x30,0x30,0x5A, -0x17,0x0D,0x33,0x37,0x31,0x32,0x30,0x31,0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30, -0x81,0xAE,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31, -0x15,0x30,0x13,0x06,0x03,0x55,0x04,0x0A,0x13,0x0C,0x74,0x68,0x61,0x77,0x74,0x65, -0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x28,0x30,0x26,0x06,0x03,0x55,0x04,0x0B,0x13, -0x1F,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x53, -0x65,0x72,0x76,0x69,0x63,0x65,0x73,0x20,0x44,0x69,0x76,0x69,0x73,0x69,0x6F,0x6E, -0x31,0x38,0x30,0x36,0x06,0x03,0x55,0x04,0x0B,0x13,0x2F,0x28,0x63,0x29,0x20,0x32, -0x30,0x30,0x38,0x20,0x74,0x68,0x61,0x77,0x74,0x65,0x2C,0x20,0x49,0x6E,0x63,0x2E, -0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74,0x68,0x6F,0x72,0x69,0x7A,0x65, -0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79,0x31,0x24,0x30,0x22,0x06,0x03, -0x55,0x04,0x03,0x13,0x1B,0x74,0x68,0x61,0x77,0x74,0x65,0x20,0x50,0x72,0x69,0x6D, -0x61,0x72,0x79,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x41,0x20,0x2D,0x20,0x47,0x33, -0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01, -0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01, -0x00,0xB2,0xBF,0x27,0x2C,0xFB,0xDB,0xD8,0x5B,0xDD,0x78,0x7B,0x1B,0x9E,0x77,0x66, -0x81,0xCB,0x3E,0xBC,0x7C,0xAE,0xF3,0xA6,0x27,0x9A,0x34,0xA3,0x68,0x31,0x71,0x38, -0x33,0x62,0xE4,0xF3,0x71,0x66,0x79,0xB1,0xA9,0x65,0xA3,0xA5,0x8B,0xD5,0x8F,0x60, -0x2D,0x3F,0x42,0xCC,0xAA,0x6B,0x32,0xC0,0x23,0xCB,0x2C,0x41,0xDD,0xE4,0xDF,0xFC, -0x61,0x9C,0xE2,0x73,0xB2,0x22,0x95,0x11,0x43,0x18,0x5F,0xC4,0xB6,0x1F,0x57,0x6C, -0x0A,0x05,0x58,0x22,0xC8,0x36,0x4C,0x3A,0x7C,0xA5,0xD1,0xCF,0x86,0xAF,0x88,0xA7, -0x44,0x02,0x13,0x74,0x71,0x73,0x0A,0x42,0x59,0x02,0xF8,0x1B,0x14,0x6B,0x42,0xDF, -0x6F,0x5F,0xBA,0x6B,0x82,0xA2,0x9D,0x5B,0xE7,0x4A,0xBD,0x1E,0x01,0x72,0xDB,0x4B, -0x74,0xE8,0x3B,0x7F,0x7F,0x7D,0x1F,0x04,0xB4,0x26,0x9B,0xE0,0xB4,0x5A,0xAC,0x47, -0x3D,0x55,0xB8,0xD7,0xB0,0x26,0x52,0x28,0x01,0x31,0x40,0x66,0xD8,0xD9,0x24,0xBD, -0xF6,0x2A,0xD8,0xEC,0x21,0x49,0x5C,0x9B,0xF6,0x7A,0xE9,0x7F,0x55,0x35,0x7E,0x96, -0x6B,0x8D,0x93,0x93,0x27,0xCB,0x92,0xBB,0xEA,0xAC,0x40,0xC0,0x9F,0xC2,0xF8,0x80, -0xCF,0x5D,0xF4,0x5A,0xDC,0xCE,0x74,0x86,0xA6,0x3E,0x6C,0x0B,0x53,0xCA,0xBD,0x92, -0xCE,0x19,0x06,0x72,0xE6,0x0C,0x5C,0x38,0x69,0xC7,0x04,0xD6,0xBC,0x6C,0xCE,0x5B, -0xF6,0xF7,0x68,0x9C,0xDC,0x25,0x15,0x48,0x88,0xA1,0xE9,0xA9,0xF8,0x98,0x9C,0xE0, -0xF3,0xD5,0x31,0x28,0x61,0x11,0x6C,0x67,0x96,0x8D,0x39,0x99,0xCB,0xC2,0x45,0x24, -0x39,0x02,0x03,0x01,0x00,0x01,0xA3,0x42,0x30,0x40,0x30,0x0F,0x06,0x03,0x55,0x1D, -0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06,0x03,0x55, -0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x1D,0x06,0x03,0x55, -0x1D,0x0E,0x04,0x16,0x04,0x14,0xAD,0x6C,0xAA,0x94,0x60,0x9C,0xED,0xE4,0xFF,0xFA, -0x3E,0x0A,0x74,0x2B,0x63,0x03,0xF7,0xB6,0x59,0xBF,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x1A,0x40, -0xD8,0x95,0x65,0xAC,0x09,0x92,0x89,0xC6,0x39,0xF4,0x10,0xE5,0xA9,0x0E,0x66,0x53, -0x5D,0x78,0xDE,0xFA,0x24,0x91,0xBB,0xE7,0x44,0x51,0xDF,0xC6,0x16,0x34,0x0A,0xEF, -0x6A,0x44,0x51,0xEA,0x2B,0x07,0x8A,0x03,0x7A,0xC3,0xEB,0x3F,0x0A,0x2C,0x52,0x16, -0xA0,0x2B,0x43,0xB9,0x25,0x90,0x3F,0x70,0xA9,0x33,0x25,0x6D,0x45,0x1A,0x28,0x3B, -0x27,0xCF,0xAA,0xC3,0x29,0x42,0x1B,0xDF,0x3B,0x4C,0xC0,0x33,0x34,0x5B,0x41,0x88, -0xBF,0x6B,0x2B,0x65,0xAF,0x28,0xEF,0xB2,0xF5,0xC3,0xAA,0x66,0xCE,0x7B,0x56,0xEE, -0xB7,0xC8,0xCB,0x67,0xC1,0xC9,0x9C,0x1A,0x18,0xB8,0xC4,0xC3,0x49,0x03,0xF1,0x60, -0x0E,0x50,0xCD,0x46,0xC5,0xF3,0x77,0x79,0xF7,0xB6,0x15,0xE0,0x38,0xDB,0xC7,0x2F, -0x28,0xA0,0x0C,0x3F,0x77,0x26,0x74,0xD9,0x25,0x12,0xDA,0x31,0xDA,0x1A,0x1E,0xDC, -0x29,0x41,0x91,0x22,0x3C,0x69,0xA7,0xBB,0x02,0xF2,0xB6,0x5C,0x27,0x03,0x89,0xF4, -0x06,0xEA,0x9B,0xE4,0x72,0x82,0xE3,0xA1,0x09,0xC1,0xE9,0x00,0x19,0xD3,0x3E,0xD4, -0x70,0x6B,0xBA,0x71,0xA6,0xAA,0x58,0xAE,0xF4,0xBB,0xE9,0x6C,0xB6,0xEF,0x87,0xCC, -0x9B,0xBB,0xFF,0x39,0xE6,0x56,0x61,0xD3,0x0A,0xA7,0xC4,0x5C,0x4C,0x60,0x7B,0x05, -0x77,0x26,0x7A,0xBF,0xD8,0x07,0x52,0x2C,0x62,0xF7,0x70,0x63,0xD9,0x39,0xBC,0x6F, -0x1C,0xC2,0x79,0xDC,0x76,0x29,0xAF,0xCE,0xC5,0x2C,0x64,0x04,0x5E,0x88,0x36,0x6E, -0x31,0xD4,0x40,0x1A,0x62,0x34,0x36,0x3F,0x35,0x01,0xAE,0xAC,0x63,0xA0, -}; - - -/* subject:/C=ZA/ST=Western Cape/L=Cape Town/O=Thawte Consulting cc/OU=Certification Services Division/CN=Thawte Server CA/emailAddress=server-certs@thawte.com */ -/* issuer :/C=ZA/ST=Western Cape/L=Cape Town/O=Thawte Consulting cc/OU=Certification Services Division/CN=Thawte Server CA/emailAddress=server-certs@thawte.com */ - - -const unsigned char Thawte_Server_CA_certificate[791]={ -0x30,0x82,0x03,0x13,0x30,0x82,0x02,0x7C,0xA0,0x03,0x02,0x01,0x02,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x04,0x05,0x00,0x30, -0x81,0xC4,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x5A,0x41,0x31, -0x15,0x30,0x13,0x06,0x03,0x55,0x04,0x08,0x13,0x0C,0x57,0x65,0x73,0x74,0x65,0x72, -0x6E,0x20,0x43,0x61,0x70,0x65,0x31,0x12,0x30,0x10,0x06,0x03,0x55,0x04,0x07,0x13, -0x09,0x43,0x61,0x70,0x65,0x20,0x54,0x6F,0x77,0x6E,0x31,0x1D,0x30,0x1B,0x06,0x03, -0x55,0x04,0x0A,0x13,0x14,0x54,0x68,0x61,0x77,0x74,0x65,0x20,0x43,0x6F,0x6E,0x73, -0x75,0x6C,0x74,0x69,0x6E,0x67,0x20,0x63,0x63,0x31,0x28,0x30,0x26,0x06,0x03,0x55, -0x04,0x0B,0x13,0x1F,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F, -0x6E,0x20,0x53,0x65,0x72,0x76,0x69,0x63,0x65,0x73,0x20,0x44,0x69,0x76,0x69,0x73, -0x69,0x6F,0x6E,0x31,0x19,0x30,0x17,0x06,0x03,0x55,0x04,0x03,0x13,0x10,0x54,0x68, -0x61,0x77,0x74,0x65,0x20,0x53,0x65,0x72,0x76,0x65,0x72,0x20,0x43,0x41,0x31,0x26, -0x30,0x24,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,0x16,0x17,0x73, -0x65,0x72,0x76,0x65,0x72,0x2D,0x63,0x65,0x72,0x74,0x73,0x40,0x74,0x68,0x61,0x77, -0x74,0x65,0x2E,0x63,0x6F,0x6D,0x30,0x1E,0x17,0x0D,0x39,0x36,0x30,0x38,0x30,0x31, -0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x32,0x30,0x31,0x32,0x33,0x31,0x32, -0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x81,0xC4,0x31,0x0B,0x30,0x09,0x06,0x03,0x55, -0x04,0x06,0x13,0x02,0x5A,0x41,0x31,0x15,0x30,0x13,0x06,0x03,0x55,0x04,0x08,0x13, -0x0C,0x57,0x65,0x73,0x74,0x65,0x72,0x6E,0x20,0x43,0x61,0x70,0x65,0x31,0x12,0x30, -0x10,0x06,0x03,0x55,0x04,0x07,0x13,0x09,0x43,0x61,0x70,0x65,0x20,0x54,0x6F,0x77, -0x6E,0x31,0x1D,0x30,0x1B,0x06,0x03,0x55,0x04,0x0A,0x13,0x14,0x54,0x68,0x61,0x77, -0x74,0x65,0x20,0x43,0x6F,0x6E,0x73,0x75,0x6C,0x74,0x69,0x6E,0x67,0x20,0x63,0x63, -0x31,0x28,0x30,0x26,0x06,0x03,0x55,0x04,0x0B,0x13,0x1F,0x43,0x65,0x72,0x74,0x69, -0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x53,0x65,0x72,0x76,0x69,0x63,0x65, -0x73,0x20,0x44,0x69,0x76,0x69,0x73,0x69,0x6F,0x6E,0x31,0x19,0x30,0x17,0x06,0x03, -0x55,0x04,0x03,0x13,0x10,0x54,0x68,0x61,0x77,0x74,0x65,0x20,0x53,0x65,0x72,0x76, -0x65,0x72,0x20,0x43,0x41,0x31,0x26,0x30,0x24,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7, -0x0D,0x01,0x09,0x01,0x16,0x17,0x73,0x65,0x72,0x76,0x65,0x72,0x2D,0x63,0x65,0x72, -0x74,0x73,0x40,0x74,0x68,0x61,0x77,0x74,0x65,0x2E,0x63,0x6F,0x6D,0x30,0x81,0x9F, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03, -0x81,0x8D,0x00,0x30,0x81,0x89,0x02,0x81,0x81,0x00,0xD3,0xA4,0x50,0x6E,0xC8,0xFF, -0x56,0x6B,0xE6,0xCF,0x5D,0xB6,0xEA,0x0C,0x68,0x75,0x47,0xA2,0xAA,0xC2,0xDA,0x84, -0x25,0xFC,0xA8,0xF4,0x47,0x51,0xDA,0x85,0xB5,0x20,0x74,0x94,0x86,0x1E,0x0F,0x75, -0xC9,0xE9,0x08,0x61,0xF5,0x06,0x6D,0x30,0x6E,0x15,0x19,0x02,0xE9,0x52,0xC0,0x62, -0xDB,0x4D,0x99,0x9E,0xE2,0x6A,0x0C,0x44,0x38,0xCD,0xFE,0xBE,0xE3,0x64,0x09,0x70, -0xC5,0xFE,0xB1,0x6B,0x29,0xB6,0x2F,0x49,0xC8,0x3B,0xD4,0x27,0x04,0x25,0x10,0x97, -0x2F,0xE7,0x90,0x6D,0xC0,0x28,0x42,0x99,0xD7,0x4C,0x43,0xDE,0xC3,0xF5,0x21,0x6D, -0x54,0x9F,0x5D,0xC3,0x58,0xE1,0xC0,0xE4,0xD9,0x5B,0xB0,0xB8,0xDC,0xB4,0x7B,0xDF, -0x36,0x3A,0xC2,0xB5,0x66,0x22,0x12,0xD6,0x87,0x0D,0x02,0x03,0x01,0x00,0x01,0xA3, -0x13,0x30,0x11,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30, -0x03,0x01,0x01,0xFF,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01, -0x04,0x05,0x00,0x03,0x81,0x81,0x00,0x07,0xFA,0x4C,0x69,0x5C,0xFB,0x95,0xCC,0x46, -0xEE,0x85,0x83,0x4D,0x21,0x30,0x8E,0xCA,0xD9,0xA8,0x6F,0x49,0x1A,0xE6,0xDA,0x51, -0xE3,0x60,0x70,0x6C,0x84,0x61,0x11,0xA1,0x1A,0xC8,0x48,0x3E,0x59,0x43,0x7D,0x4F, -0x95,0x3D,0xA1,0x8B,0xB7,0x0B,0x62,0x98,0x7A,0x75,0x8A,0xDD,0x88,0x4E,0x4E,0x9E, -0x40,0xDB,0xA8,0xCC,0x32,0x74,0xB9,0x6F,0x0D,0xC6,0xE3,0xB3,0x44,0x0B,0xD9,0x8A, -0x6F,0x9A,0x29,0x9B,0x99,0x18,0x28,0x3B,0xD1,0xE3,0x40,0x28,0x9A,0x5A,0x3C,0xD5, -0xB5,0xE7,0x20,0x1B,0x8B,0xCA,0xA4,0xAB,0x8D,0xE9,0x51,0xD9,0xE2,0x4C,0x2C,0x59, -0xA9,0xDA,0xB9,0xB2,0x75,0x1B,0xF6,0x42,0xF2,0xEF,0xC7,0xF2,0x18,0xF9,0x89,0xBC, -0xA3,0xFF,0x8A,0x23,0x2E,0x70,0x47, -}; - - -/* subject:/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST Network/OU=http://www.usertrust.com/CN=UTN - DATACorp SGC */ -/* issuer :/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST Network/OU=http://www.usertrust.com/CN=UTN - DATACorp SGC */ - - -const unsigned char UTN_DATACorp_SGC_Root_CA_certificate[1122]={ -0x30,0x82,0x04,0x5E,0x30,0x82,0x03,0x46,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x44, -0xBE,0x0C,0x8B,0x50,0x00,0x21,0xB4,0x11,0xD3,0x2A,0x68,0x06,0xA9,0xAD,0x69,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x81, -0x93,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x08,0x13,0x02,0x55,0x54,0x31,0x17,0x30,0x15,0x06, -0x03,0x55,0x04,0x07,0x13,0x0E,0x53,0x61,0x6C,0x74,0x20,0x4C,0x61,0x6B,0x65,0x20, -0x43,0x69,0x74,0x79,0x31,0x1E,0x30,0x1C,0x06,0x03,0x55,0x04,0x0A,0x13,0x15,0x54, -0x68,0x65,0x20,0x55,0x53,0x45,0x52,0x54,0x52,0x55,0x53,0x54,0x20,0x4E,0x65,0x74, -0x77,0x6F,0x72,0x6B,0x31,0x21,0x30,0x1F,0x06,0x03,0x55,0x04,0x0B,0x13,0x18,0x68, -0x74,0x74,0x70,0x3A,0x2F,0x2F,0x77,0x77,0x77,0x2E,0x75,0x73,0x65,0x72,0x74,0x72, -0x75,0x73,0x74,0x2E,0x63,0x6F,0x6D,0x31,0x1B,0x30,0x19,0x06,0x03,0x55,0x04,0x03, -0x13,0x12,0x55,0x54,0x4E,0x20,0x2D,0x20,0x44,0x41,0x54,0x41,0x43,0x6F,0x72,0x70, -0x20,0x53,0x47,0x43,0x30,0x1E,0x17,0x0D,0x39,0x39,0x30,0x36,0x32,0x34,0x31,0x38, -0x35,0x37,0x32,0x31,0x5A,0x17,0x0D,0x31,0x39,0x30,0x36,0x32,0x34,0x31,0x39,0x30, -0x36,0x33,0x30,0x5A,0x30,0x81,0x93,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06, -0x13,0x02,0x55,0x53,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x08,0x13,0x02,0x55, -0x54,0x31,0x17,0x30,0x15,0x06,0x03,0x55,0x04,0x07,0x13,0x0E,0x53,0x61,0x6C,0x74, -0x20,0x4C,0x61,0x6B,0x65,0x20,0x43,0x69,0x74,0x79,0x31,0x1E,0x30,0x1C,0x06,0x03, -0x55,0x04,0x0A,0x13,0x15,0x54,0x68,0x65,0x20,0x55,0x53,0x45,0x52,0x54,0x52,0x55, -0x53,0x54,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x21,0x30,0x1F,0x06,0x03, -0x55,0x04,0x0B,0x13,0x18,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x77,0x77,0x77,0x2E, -0x75,0x73,0x65,0x72,0x74,0x72,0x75,0x73,0x74,0x2E,0x63,0x6F,0x6D,0x31,0x1B,0x30, -0x19,0x06,0x03,0x55,0x04,0x03,0x13,0x12,0x55,0x54,0x4E,0x20,0x2D,0x20,0x44,0x41, -0x54,0x41,0x43,0x6F,0x72,0x70,0x20,0x53,0x47,0x43,0x30,0x82,0x01,0x22,0x30,0x0D, -0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01, -0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xDF,0xEE,0x58,0x10,0xA2, -0x2B,0x6E,0x55,0xC4,0x8E,0xBF,0x2E,0x46,0x09,0xE7,0xE0,0x08,0x0F,0x2E,0x2B,0x7A, -0x13,0x94,0x1B,0xBD,0xF6,0xB6,0x80,0x8E,0x65,0x05,0x93,0x00,0x1E,0xBC,0xAF,0xE2, -0x0F,0x8E,0x19,0x0D,0x12,0x47,0xEC,0xAC,0xAD,0xA3,0xFA,0x2E,0x70,0xF8,0xDE,0x6E, -0xFB,0x56,0x42,0x15,0x9E,0x2E,0x5C,0xEF,0x23,0xDE,0x21,0xB9,0x05,0x76,0x27,0x19, -0x0F,0x4F,0xD6,0xC3,0x9C,0xB4,0xBE,0x94,0x19,0x63,0xF2,0xA6,0x11,0x0A,0xEB,0x53, -0x48,0x9C,0xBE,0xF2,0x29,0x3B,0x16,0xE8,0x1A,0xA0,0x4C,0xA6,0xC9,0xF4,0x18,0x59, -0x68,0xC0,0x70,0xF2,0x53,0x00,0xC0,0x5E,0x50,0x82,0xA5,0x56,0x6F,0x36,0xF9,0x4A, -0xE0,0x44,0x86,0xA0,0x4D,0x4E,0xD6,0x47,0x6E,0x49,0x4A,0xCB,0x67,0xD7,0xA6,0xC4, -0x05,0xB9,0x8E,0x1E,0xF4,0xFC,0xFF,0xCD,0xE7,0x36,0xE0,0x9C,0x05,0x6C,0xB2,0x33, -0x22,0x15,0xD0,0xB4,0xE0,0xCC,0x17,0xC0,0xB2,0xC0,0xF4,0xFE,0x32,0x3F,0x29,0x2A, -0x95,0x7B,0xD8,0xF2,0xA7,0x4E,0x0F,0x54,0x7C,0xA1,0x0D,0x80,0xB3,0x09,0x03,0xC1, -0xFF,0x5C,0xDD,0x5E,0x9A,0x3E,0xBC,0xAE,0xBC,0x47,0x8A,0x6A,0xAE,0x71,0xCA,0x1F, -0xB1,0x2A,0xB8,0x5F,0x42,0x05,0x0B,0xEC,0x46,0x30,0xD1,0x72,0x0B,0xCA,0xE9,0x56, -0x6D,0xF5,0xEF,0xDF,0x78,0xBE,0x61,0xBA,0xB2,0xA5,0xAE,0x04,0x4C,0xBC,0xA8,0xAC, -0x69,0x15,0x97,0xBD,0xEF,0xEB,0xB4,0x8C,0xBF,0x35,0xF8,0xD4,0xC3,0xD1,0x28,0x0E, -0x5C,0x3A,0x9F,0x70,0x18,0x33,0x20,0x77,0xC4,0xA2,0xAF,0x02,0x03,0x01,0x00,0x01, -0xA3,0x81,0xAB,0x30,0x81,0xA8,0x30,0x0B,0x06,0x03,0x55,0x1D,0x0F,0x04,0x04,0x03, -0x02,0x01,0xC6,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30, -0x03,0x01,0x01,0xFF,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x53, -0x32,0xD1,0xB3,0xCF,0x7F,0xFA,0xE0,0xF1,0xA0,0x5D,0x85,0x4E,0x92,0xD2,0x9E,0x45, -0x1D,0xB4,0x4F,0x30,0x3D,0x06,0x03,0x55,0x1D,0x1F,0x04,0x36,0x30,0x34,0x30,0x32, -0xA0,0x30,0xA0,0x2E,0x86,0x2C,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x63,0x72,0x6C, -0x2E,0x75,0x73,0x65,0x72,0x74,0x72,0x75,0x73,0x74,0x2E,0x63,0x6F,0x6D,0x2F,0x55, -0x54,0x4E,0x2D,0x44,0x41,0x54,0x41,0x43,0x6F,0x72,0x70,0x53,0x47,0x43,0x2E,0x63, -0x72,0x6C,0x30,0x2A,0x06,0x03,0x55,0x1D,0x25,0x04,0x23,0x30,0x21,0x06,0x08,0x2B, -0x06,0x01,0x05,0x05,0x07,0x03,0x01,0x06,0x0A,0x2B,0x06,0x01,0x04,0x01,0x82,0x37, -0x0A,0x03,0x03,0x06,0x09,0x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x04,0x01,0x30,0x0D, -0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01, -0x01,0x00,0x27,0x35,0x97,0x00,0x8A,0x8B,0x28,0xBD,0xC6,0x33,0x30,0x1E,0x29,0xFC, -0xE2,0xF7,0xD5,0x98,0xD4,0x40,0xBB,0x60,0xCA,0xBF,0xAB,0x17,0x2C,0x09,0x36,0x7F, -0x50,0xFA,0x41,0xDC,0xAE,0x96,0x3A,0x0A,0x23,0x3E,0x89,0x59,0xC9,0xA3,0x07,0xED, -0x1B,0x37,0xAD,0xFC,0x7C,0xBE,0x51,0x49,0x5A,0xDE,0x3A,0x0A,0x54,0x08,0x16,0x45, -0xC2,0x99,0xB1,0x87,0xCD,0x8C,0x68,0xE0,0x69,0x03,0xE9,0xC4,0x4E,0x98,0xB2,0x3B, -0x8C,0x16,0xB3,0x0E,0xA0,0x0C,0x98,0x50,0x9B,0x93,0xA9,0x70,0x09,0xC8,0x2C,0xA3, -0x8F,0xDF,0x02,0xE4,0xE0,0x71,0x3A,0xF1,0xB4,0x23,0x72,0xA0,0xAA,0x01,0xDF,0xDF, -0x98,0x3E,0x14,0x50,0xA0,0x31,0x26,0xBD,0x28,0xE9,0x5A,0x30,0x26,0x75,0xF9,0x7B, -0x60,0x1C,0x8D,0xF3,0xCD,0x50,0x26,0x6D,0x04,0x27,0x9A,0xDF,0xD5,0x0D,0x45,0x47, -0x29,0x6B,0x2C,0xE6,0x76,0xD9,0xA9,0x29,0x7D,0x32,0xDD,0xC9,0x36,0x3C,0xBD,0xAE, -0x35,0xF1,0x11,0x9E,0x1D,0xBB,0x90,0x3F,0x12,0x47,0x4E,0x8E,0xD7,0x7E,0x0F,0x62, -0x73,0x1D,0x52,0x26,0x38,0x1C,0x18,0x49,0xFD,0x30,0x74,0x9A,0xC4,0xE5,0x22,0x2F, -0xD8,0xC0,0x8D,0xED,0x91,0x7A,0x4C,0x00,0x8F,0x72,0x7F,0x5D,0xDA,0xDD,0x1B,0x8B, -0x45,0x6B,0xE7,0xDD,0x69,0x97,0xA8,0xC5,0x56,0x4C,0x0F,0x0C,0xF6,0x9F,0x7A,0x91, -0x37,0xF6,0x97,0x82,0xE0,0xDD,0x71,0x69,0xFF,0x76,0x3F,0x60,0x4D,0x3C,0xCF,0xF7, -0x99,0xF9,0xC6,0x57,0xF4,0xC9,0x55,0x39,0x78,0xBA,0x2C,0x79,0xC9,0xA6,0x88,0x2B, -0xF4,0x08, -}; - - -/* subject:/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST Network/OU=http://www.usertrust.com/CN=UTN-USERFirst-Hardware */ -/* issuer :/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST Network/OU=http://www.usertrust.com/CN=UTN-USERFirst-Hardware */ - - -const unsigned char UTN_USERFirst_Hardware_Root_CA_certificate[1144]={ -0x30,0x82,0x04,0x74,0x30,0x82,0x03,0x5C,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x44, -0xBE,0x0C,0x8B,0x50,0x00,0x24,0xB4,0x11,0xD3,0x36,0x2A,0xFE,0x65,0x0A,0xFD,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x81, -0x97,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x08,0x13,0x02,0x55,0x54,0x31,0x17,0x30,0x15,0x06, -0x03,0x55,0x04,0x07,0x13,0x0E,0x53,0x61,0x6C,0x74,0x20,0x4C,0x61,0x6B,0x65,0x20, -0x43,0x69,0x74,0x79,0x31,0x1E,0x30,0x1C,0x06,0x03,0x55,0x04,0x0A,0x13,0x15,0x54, -0x68,0x65,0x20,0x55,0x53,0x45,0x52,0x54,0x52,0x55,0x53,0x54,0x20,0x4E,0x65,0x74, -0x77,0x6F,0x72,0x6B,0x31,0x21,0x30,0x1F,0x06,0x03,0x55,0x04,0x0B,0x13,0x18,0x68, -0x74,0x74,0x70,0x3A,0x2F,0x2F,0x77,0x77,0x77,0x2E,0x75,0x73,0x65,0x72,0x74,0x72, -0x75,0x73,0x74,0x2E,0x63,0x6F,0x6D,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x03, -0x13,0x16,0x55,0x54,0x4E,0x2D,0x55,0x53,0x45,0x52,0x46,0x69,0x72,0x73,0x74,0x2D, -0x48,0x61,0x72,0x64,0x77,0x61,0x72,0x65,0x30,0x1E,0x17,0x0D,0x39,0x39,0x30,0x37, -0x30,0x39,0x31,0x38,0x31,0x30,0x34,0x32,0x5A,0x17,0x0D,0x31,0x39,0x30,0x37,0x30, -0x39,0x31,0x38,0x31,0x39,0x32,0x32,0x5A,0x30,0x81,0x97,0x31,0x0B,0x30,0x09,0x06, -0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04, -0x08,0x13,0x02,0x55,0x54,0x31,0x17,0x30,0x15,0x06,0x03,0x55,0x04,0x07,0x13,0x0E, -0x53,0x61,0x6C,0x74,0x20,0x4C,0x61,0x6B,0x65,0x20,0x43,0x69,0x74,0x79,0x31,0x1E, -0x30,0x1C,0x06,0x03,0x55,0x04,0x0A,0x13,0x15,0x54,0x68,0x65,0x20,0x55,0x53,0x45, -0x52,0x54,0x52,0x55,0x53,0x54,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x21, -0x30,0x1F,0x06,0x03,0x55,0x04,0x0B,0x13,0x18,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F, -0x77,0x77,0x77,0x2E,0x75,0x73,0x65,0x72,0x74,0x72,0x75,0x73,0x74,0x2E,0x63,0x6F, -0x6D,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x03,0x13,0x16,0x55,0x54,0x4E,0x2D, -0x55,0x53,0x45,0x52,0x46,0x69,0x72,0x73,0x74,0x2D,0x48,0x61,0x72,0x64,0x77,0x61, -0x72,0x65,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D, -0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82, -0x01,0x01,0x00,0xB1,0xF7,0xC3,0x38,0x3F,0xB4,0xA8,0x7F,0xCF,0x39,0x82,0x51,0x67, -0xD0,0x6D,0x9F,0xD2,0xFF,0x58,0xF3,0xE7,0x9F,0x2B,0xEC,0x0D,0x89,0x54,0x99,0xB9, -0x38,0x99,0x16,0xF7,0xE0,0x21,0x79,0x48,0xC2,0xBB,0x61,0x74,0x12,0x96,0x1D,0x3C, -0x6A,0x72,0xD5,0x3C,0x10,0x67,0x3A,0x39,0xED,0x2B,0x13,0xCD,0x66,0xEB,0x95,0x09, -0x33,0xA4,0x6C,0x97,0xB1,0xE8,0xC6,0xEC,0xC1,0x75,0x79,0x9C,0x46,0x5E,0x8D,0xAB, -0xD0,0x6A,0xFD,0xB9,0x2A,0x55,0x17,0x10,0x54,0xB3,0x19,0xF0,0x9A,0xF6,0xF1,0xB1, -0x5D,0xB6,0xA7,0x6D,0xFB,0xE0,0x71,0x17,0x6B,0xA2,0x88,0xFB,0x00,0xDF,0xFE,0x1A, -0x31,0x77,0x0C,0x9A,0x01,0x7A,0xB1,0x32,0xE3,0x2B,0x01,0x07,0x38,0x6E,0xC3,0xA5, -0x5E,0x23,0xBC,0x45,0x9B,0x7B,0x50,0xC1,0xC9,0x30,0x8F,0xDB,0xE5,0x2B,0x7A,0xD3, -0x5B,0xFB,0x33,0x40,0x1E,0xA0,0xD5,0x98,0x17,0xBC,0x8B,0x87,0xC3,0x89,0xD3,0x5D, -0xA0,0x8E,0xB2,0xAA,0xAA,0xF6,0x8E,0x69,0x88,0x06,0xC5,0xFA,0x89,0x21,0xF3,0x08, -0x9D,0x69,0x2E,0x09,0x33,0x9B,0x29,0x0D,0x46,0x0F,0x8C,0xCC,0x49,0x34,0xB0,0x69, -0x51,0xBD,0xF9,0x06,0xCD,0x68,0xAD,0x66,0x4C,0xBC,0x3E,0xAC,0x61,0xBD,0x0A,0x88, -0x0E,0xC8,0xDF,0x3D,0xEE,0x7C,0x04,0x4C,0x9D,0x0A,0x5E,0x6B,0x91,0xD6,0xEE,0xC7, -0xED,0x28,0x8D,0xAB,0x4D,0x87,0x89,0x73,0xD0,0x6E,0xA4,0xD0,0x1E,0x16,0x8B,0x14, -0xE1,0x76,0x44,0x03,0x7F,0x63,0xAC,0xE4,0xCD,0x49,0x9C,0xC5,0x92,0xF4,0xAB,0x32, -0xA1,0x48,0x5B,0x02,0x03,0x01,0x00,0x01,0xA3,0x81,0xB9,0x30,0x81,0xB6,0x30,0x0B, -0x06,0x03,0x55,0x1D,0x0F,0x04,0x04,0x03,0x02,0x01,0xC6,0x30,0x0F,0x06,0x03,0x55, -0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x1D,0x06,0x03, -0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xA1,0x72,0x5F,0x26,0x1B,0x28,0x98,0x43,0x95, -0x5D,0x07,0x37,0xD5,0x85,0x96,0x9D,0x4B,0xD2,0xC3,0x45,0x30,0x44,0x06,0x03,0x55, -0x1D,0x1F,0x04,0x3D,0x30,0x3B,0x30,0x39,0xA0,0x37,0xA0,0x35,0x86,0x33,0x68,0x74, -0x74,0x70,0x3A,0x2F,0x2F,0x63,0x72,0x6C,0x2E,0x75,0x73,0x65,0x72,0x74,0x72,0x75, -0x73,0x74,0x2E,0x63,0x6F,0x6D,0x2F,0x55,0x54,0x4E,0x2D,0x55,0x53,0x45,0x52,0x46, -0x69,0x72,0x73,0x74,0x2D,0x48,0x61,0x72,0x64,0x77,0x61,0x72,0x65,0x2E,0x63,0x72, -0x6C,0x30,0x31,0x06,0x03,0x55,0x1D,0x25,0x04,0x2A,0x30,0x28,0x06,0x08,0x2B,0x06, -0x01,0x05,0x05,0x07,0x03,0x01,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x05, -0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x06,0x06,0x08,0x2B,0x06,0x01,0x05, -0x05,0x07,0x03,0x07,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01, -0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x47,0x19,0x0F,0xDE,0x74,0xC6,0x99,0x97, -0xAF,0xFC,0xAD,0x28,0x5E,0x75,0x8E,0xEB,0x2D,0x67,0xEE,0x4E,0x7B,0x2B,0xD7,0x0C, -0xFF,0xF6,0xDE,0xCB,0x55,0xA2,0x0A,0xE1,0x4C,0x54,0x65,0x93,0x60,0x6B,0x9F,0x12, -0x9C,0xAD,0x5E,0x83,0x2C,0xEB,0x5A,0xAE,0xC0,0xE4,0x2D,0xF4,0x00,0x63,0x1D,0xB8, -0xC0,0x6C,0xF2,0xCF,0x49,0xBB,0x4D,0x93,0x6F,0x06,0xA6,0x0A,0x22,0xB2,0x49,0x62, -0x08,0x4E,0xFF,0xC8,0xC8,0x14,0xB2,0x88,0x16,0x5D,0xE7,0x01,0xE4,0x12,0x95,0xE5, -0x45,0x34,0xB3,0x8B,0x69,0xBD,0xCF,0xB4,0x85,0x8F,0x75,0x51,0x9E,0x7D,0x3A,0x38, -0x3A,0x14,0x48,0x12,0xC6,0xFB,0xA7,0x3B,0x1A,0x8D,0x0D,0x82,0x40,0x07,0xE8,0x04, -0x08,0x90,0xA1,0x89,0xCB,0x19,0x50,0xDF,0xCA,0x1C,0x01,0xBC,0x1D,0x04,0x19,0x7B, -0x10,0x76,0x97,0x3B,0xEE,0x90,0x90,0xCA,0xC4,0x0E,0x1F,0x16,0x6E,0x75,0xEF,0x33, -0xF8,0xD3,0x6F,0x5B,0x1E,0x96,0xE3,0xE0,0x74,0x77,0x74,0x7B,0x8A,0xA2,0x6E,0x2D, -0xDD,0x76,0xD6,0x39,0x30,0x82,0xF0,0xAB,0x9C,0x52,0xF2,0x2A,0xC7,0xAF,0x49,0x5E, -0x7E,0xC7,0x68,0xE5,0x82,0x81,0xC8,0x6A,0x27,0xF9,0x27,0x88,0x2A,0xD5,0x58,0x50, -0x95,0x1F,0xF0,0x3B,0x1C,0x57,0xBB,0x7D,0x14,0x39,0x62,0x2B,0x9A,0xC9,0x94,0x92, -0x2A,0xA3,0x22,0x0C,0xFF,0x89,0x26,0x7D,0x5F,0x23,0x2B,0x47,0xD7,0x15,0x1D,0xA9, -0x6A,0x9E,0x51,0x0D,0x2A,0x51,0x9E,0x81,0xF9,0xD4,0x3B,0x5E,0x70,0x12,0x7F,0x10, -0x32,0x9C,0x1E,0xBB,0x9D,0xF8,0x66,0xA8, -}; - - -/* subject:/L=ValiCert Validation Network/O=ValiCert, Inc./OU=ValiCert Class 1 Policy Validation Authority/CN=http://www.valicert.com//emailAddress=info@valicert.com */ -/* issuer :/L=ValiCert Validation Network/O=ValiCert, Inc./OU=ValiCert Class 1 Policy Validation Authority/CN=http://www.valicert.com//emailAddress=info@valicert.com */ - - -const unsigned char ValiCert_Class_1_VA_certificate[747]={ -0x30,0x82,0x02,0xE7,0x30,0x82,0x02,0x50,0x02,0x01,0x01,0x30,0x0D,0x06,0x09,0x2A, -0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x81,0xBB,0x31,0x24,0x30, -0x22,0x06,0x03,0x55,0x04,0x07,0x13,0x1B,0x56,0x61,0x6C,0x69,0x43,0x65,0x72,0x74, -0x20,0x56,0x61,0x6C,0x69,0x64,0x61,0x74,0x69,0x6F,0x6E,0x20,0x4E,0x65,0x74,0x77, -0x6F,0x72,0x6B,0x31,0x17,0x30,0x15,0x06,0x03,0x55,0x04,0x0A,0x13,0x0E,0x56,0x61, -0x6C,0x69,0x43,0x65,0x72,0x74,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x35,0x30,0x33, -0x06,0x03,0x55,0x04,0x0B,0x13,0x2C,0x56,0x61,0x6C,0x69,0x43,0x65,0x72,0x74,0x20, -0x43,0x6C,0x61,0x73,0x73,0x20,0x31,0x20,0x50,0x6F,0x6C,0x69,0x63,0x79,0x20,0x56, -0x61,0x6C,0x69,0x64,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72, -0x69,0x74,0x79,0x31,0x21,0x30,0x1F,0x06,0x03,0x55,0x04,0x03,0x13,0x18,0x68,0x74, -0x74,0x70,0x3A,0x2F,0x2F,0x77,0x77,0x77,0x2E,0x76,0x61,0x6C,0x69,0x63,0x65,0x72, -0x74,0x2E,0x63,0x6F,0x6D,0x2F,0x31,0x20,0x30,0x1E,0x06,0x09,0x2A,0x86,0x48,0x86, -0xF7,0x0D,0x01,0x09,0x01,0x16,0x11,0x69,0x6E,0x66,0x6F,0x40,0x76,0x61,0x6C,0x69, -0x63,0x65,0x72,0x74,0x2E,0x63,0x6F,0x6D,0x30,0x1E,0x17,0x0D,0x39,0x39,0x30,0x36, -0x32,0x35,0x32,0x32,0x32,0x33,0x34,0x38,0x5A,0x17,0x0D,0x31,0x39,0x30,0x36,0x32, -0x35,0x32,0x32,0x32,0x33,0x34,0x38,0x5A,0x30,0x81,0xBB,0x31,0x24,0x30,0x22,0x06, -0x03,0x55,0x04,0x07,0x13,0x1B,0x56,0x61,0x6C,0x69,0x43,0x65,0x72,0x74,0x20,0x56, -0x61,0x6C,0x69,0x64,0x61,0x74,0x69,0x6F,0x6E,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72, -0x6B,0x31,0x17,0x30,0x15,0x06,0x03,0x55,0x04,0x0A,0x13,0x0E,0x56,0x61,0x6C,0x69, -0x43,0x65,0x72,0x74,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x35,0x30,0x33,0x06,0x03, -0x55,0x04,0x0B,0x13,0x2C,0x56,0x61,0x6C,0x69,0x43,0x65,0x72,0x74,0x20,0x43,0x6C, -0x61,0x73,0x73,0x20,0x31,0x20,0x50,0x6F,0x6C,0x69,0x63,0x79,0x20,0x56,0x61,0x6C, -0x69,0x64,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74, -0x79,0x31,0x21,0x30,0x1F,0x06,0x03,0x55,0x04,0x03,0x13,0x18,0x68,0x74,0x74,0x70, -0x3A,0x2F,0x2F,0x77,0x77,0x77,0x2E,0x76,0x61,0x6C,0x69,0x63,0x65,0x72,0x74,0x2E, -0x63,0x6F,0x6D,0x2F,0x31,0x20,0x30,0x1E,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D, -0x01,0x09,0x01,0x16,0x11,0x69,0x6E,0x66,0x6F,0x40,0x76,0x61,0x6C,0x69,0x63,0x65, -0x72,0x74,0x2E,0x63,0x6F,0x6D,0x30,0x81,0x9F,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48, -0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x81,0x8D,0x00,0x30,0x81,0x89,0x02, -0x81,0x81,0x00,0xD8,0x59,0x82,0x7A,0x89,0xB8,0x96,0xBA,0xA6,0x2F,0x68,0x6F,0x58, -0x2E,0xA7,0x54,0x1C,0x06,0x6E,0xF4,0xEA,0x8D,0x48,0xBC,0x31,0x94,0x17,0xF0,0xF3, -0x4E,0xBC,0xB2,0xB8,0x35,0x92,0x76,0xB0,0xD0,0xA5,0xA5,0x01,0xD7,0x00,0x03,0x12, -0x22,0x19,0x08,0xF8,0xFF,0x11,0x23,0x9B,0xCE,0x07,0xF5,0xBF,0x69,0x1A,0x26,0xFE, -0x4E,0xE9,0xD1,0x7F,0x9D,0x2C,0x40,0x1D,0x59,0x68,0x6E,0xA6,0xF8,0x58,0xB0,0x9D, -0x1A,0x8F,0xD3,0x3F,0xF1,0xDC,0x19,0x06,0x81,0xA8,0x0E,0xE0,0x3A,0xDD,0xC8,0x53, -0x45,0x09,0x06,0xE6,0x0F,0x70,0xC3,0xFA,0x40,0xA6,0x0E,0xE2,0x56,0x05,0x0F,0x18, -0x4D,0xFC,0x20,0x82,0xD1,0x73,0x55,0x74,0x8D,0x76,0x72,0xA0,0x1D,0x9D,0x1D,0xC0, -0xDD,0x3F,0x71,0x02,0x03,0x01,0x00,0x01,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86, -0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x81,0x81,0x00,0x50,0x68,0x3D,0x49,0xF4, -0x2C,0x1C,0x06,0x94,0xDF,0x95,0x60,0x7F,0x96,0x7B,0x17,0xFE,0x4F,0x71,0xAD,0x64, -0xC8,0xDD,0x77,0xD2,0xEF,0x59,0x55,0xE8,0x3F,0xE8,0x8E,0x05,0x2A,0x21,0xF2,0x07, -0xD2,0xB5,0xA7,0x52,0xFE,0x9C,0xB1,0xB6,0xE2,0x5B,0x77,0x17,0x40,0xEA,0x72,0xD6, -0x23,0xCB,0x28,0x81,0x32,0xC3,0x00,0x79,0x18,0xEC,0x59,0x17,0x89,0xC9,0xC6,0x6A, -0x1E,0x71,0xC9,0xFD,0xB7,0x74,0xA5,0x25,0x45,0x69,0xC5,0x48,0xAB,0x19,0xE1,0x45, -0x8A,0x25,0x6B,0x19,0xEE,0xE5,0xBB,0x12,0xF5,0x7F,0xF7,0xA6,0x8D,0x51,0xC3,0xF0, -0x9D,0x74,0xB7,0xA9,0x3E,0xA0,0xA5,0xFF,0xB6,0x49,0x03,0x13,0xDA,0x22,0xCC,0xED, -0x71,0x82,0x2B,0x99,0xCF,0x3A,0xB7,0xF5,0x2D,0x72,0xC8, -}; - - -/* subject:/L=ValiCert Validation Network/O=ValiCert, Inc./OU=ValiCert Class 2 Policy Validation Authority/CN=http://www.valicert.com//emailAddress=info@valicert.com */ -/* issuer :/L=ValiCert Validation Network/O=ValiCert, Inc./OU=ValiCert Class 2 Policy Validation Authority/CN=http://www.valicert.com//emailAddress=info@valicert.com */ - - -const unsigned char ValiCert_Class_2_VA_certificate[747]={ -0x30,0x82,0x02,0xE7,0x30,0x82,0x02,0x50,0x02,0x01,0x01,0x30,0x0D,0x06,0x09,0x2A, -0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x81,0xBB,0x31,0x24,0x30, -0x22,0x06,0x03,0x55,0x04,0x07,0x13,0x1B,0x56,0x61,0x6C,0x69,0x43,0x65,0x72,0x74, -0x20,0x56,0x61,0x6C,0x69,0x64,0x61,0x74,0x69,0x6F,0x6E,0x20,0x4E,0x65,0x74,0x77, -0x6F,0x72,0x6B,0x31,0x17,0x30,0x15,0x06,0x03,0x55,0x04,0x0A,0x13,0x0E,0x56,0x61, -0x6C,0x69,0x43,0x65,0x72,0x74,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x35,0x30,0x33, -0x06,0x03,0x55,0x04,0x0B,0x13,0x2C,0x56,0x61,0x6C,0x69,0x43,0x65,0x72,0x74,0x20, -0x43,0x6C,0x61,0x73,0x73,0x20,0x32,0x20,0x50,0x6F,0x6C,0x69,0x63,0x79,0x20,0x56, -0x61,0x6C,0x69,0x64,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72, -0x69,0x74,0x79,0x31,0x21,0x30,0x1F,0x06,0x03,0x55,0x04,0x03,0x13,0x18,0x68,0x74, -0x74,0x70,0x3A,0x2F,0x2F,0x77,0x77,0x77,0x2E,0x76,0x61,0x6C,0x69,0x63,0x65,0x72, -0x74,0x2E,0x63,0x6F,0x6D,0x2F,0x31,0x20,0x30,0x1E,0x06,0x09,0x2A,0x86,0x48,0x86, -0xF7,0x0D,0x01,0x09,0x01,0x16,0x11,0x69,0x6E,0x66,0x6F,0x40,0x76,0x61,0x6C,0x69, -0x63,0x65,0x72,0x74,0x2E,0x63,0x6F,0x6D,0x30,0x1E,0x17,0x0D,0x39,0x39,0x30,0x36, -0x32,0x36,0x30,0x30,0x31,0x39,0x35,0x34,0x5A,0x17,0x0D,0x31,0x39,0x30,0x36,0x32, -0x36,0x30,0x30,0x31,0x39,0x35,0x34,0x5A,0x30,0x81,0xBB,0x31,0x24,0x30,0x22,0x06, -0x03,0x55,0x04,0x07,0x13,0x1B,0x56,0x61,0x6C,0x69,0x43,0x65,0x72,0x74,0x20,0x56, -0x61,0x6C,0x69,0x64,0x61,0x74,0x69,0x6F,0x6E,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72, -0x6B,0x31,0x17,0x30,0x15,0x06,0x03,0x55,0x04,0x0A,0x13,0x0E,0x56,0x61,0x6C,0x69, -0x43,0x65,0x72,0x74,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x35,0x30,0x33,0x06,0x03, -0x55,0x04,0x0B,0x13,0x2C,0x56,0x61,0x6C,0x69,0x43,0x65,0x72,0x74,0x20,0x43,0x6C, -0x61,0x73,0x73,0x20,0x32,0x20,0x50,0x6F,0x6C,0x69,0x63,0x79,0x20,0x56,0x61,0x6C, -0x69,0x64,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74, -0x79,0x31,0x21,0x30,0x1F,0x06,0x03,0x55,0x04,0x03,0x13,0x18,0x68,0x74,0x74,0x70, -0x3A,0x2F,0x2F,0x77,0x77,0x77,0x2E,0x76,0x61,0x6C,0x69,0x63,0x65,0x72,0x74,0x2E, -0x63,0x6F,0x6D,0x2F,0x31,0x20,0x30,0x1E,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D, -0x01,0x09,0x01,0x16,0x11,0x69,0x6E,0x66,0x6F,0x40,0x76,0x61,0x6C,0x69,0x63,0x65, -0x72,0x74,0x2E,0x63,0x6F,0x6D,0x30,0x81,0x9F,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48, -0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x81,0x8D,0x00,0x30,0x81,0x89,0x02, -0x81,0x81,0x00,0xCE,0x3A,0x71,0xCA,0xE5,0xAB,0xC8,0x59,0x92,0x55,0xD7,0xAB,0xD8, -0x74,0x0E,0xF9,0xEE,0xD9,0xF6,0x55,0x47,0x59,0x65,0x47,0x0E,0x05,0x55,0xDC,0xEB, -0x98,0x36,0x3C,0x5C,0x53,0x5D,0xD3,0x30,0xCF,0x38,0xEC,0xBD,0x41,0x89,0xED,0x25, -0x42,0x09,0x24,0x6B,0x0A,0x5E,0xB3,0x7C,0xDD,0x52,0x2D,0x4C,0xE6,0xD4,0xD6,0x7D, -0x5A,0x59,0xA9,0x65,0xD4,0x49,0x13,0x2D,0x24,0x4D,0x1C,0x50,0x6F,0xB5,0xC1,0x85, -0x54,0x3B,0xFE,0x71,0xE4,0xD3,0x5C,0x42,0xF9,0x80,0xE0,0x91,0x1A,0x0A,0x5B,0x39, -0x36,0x67,0xF3,0x3F,0x55,0x7C,0x1B,0x3F,0xB4,0x5F,0x64,0x73,0x34,0xE3,0xB4,0x12, -0xBF,0x87,0x64,0xF8,0xDA,0x12,0xFF,0x37,0x27,0xC1,0xB3,0x43,0xBB,0xEF,0x7B,0x6E, -0x2E,0x69,0xF7,0x02,0x03,0x01,0x00,0x01,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86, -0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x81,0x81,0x00,0x3B,0x7F,0x50,0x6F,0x6F, -0x50,0x94,0x99,0x49,0x62,0x38,0x38,0x1F,0x4B,0xF8,0xA5,0xC8,0x3E,0xA7,0x82,0x81, -0xF6,0x2B,0xC7,0xE8,0xC5,0xCE,0xE8,0x3A,0x10,0x82,0xCB,0x18,0x00,0x8E,0x4D,0xBD, -0xA8,0x58,0x7F,0xA1,0x79,0x00,0xB5,0xBB,0xE9,0x8D,0xAF,0x41,0xD9,0x0F,0x34,0xEE, -0x21,0x81,0x19,0xA0,0x32,0x49,0x28,0xF4,0xC4,0x8E,0x56,0xD5,0x52,0x33,0xFD,0x50, -0xD5,0x7E,0x99,0x6C,0x03,0xE4,0xC9,0x4C,0xFC,0xCB,0x6C,0xAB,0x66,0xB3,0x4A,0x21, -0x8C,0xE5,0xB5,0x0C,0x32,0x3E,0x10,0xB2,0xCC,0x6C,0xA1,0xDC,0x9A,0x98,0x4C,0x02, -0x5B,0xF3,0xCE,0xB9,0x9E,0xA5,0x72,0x0E,0x4A,0xB7,0x3F,0x3C,0xE6,0x16,0x68,0xF8, -0xBE,0xED,0x74,0x4C,0xBC,0x5B,0xD5,0x62,0x1F,0x43,0xDD, -}; - - -/* subject:/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority */ -/* issuer :/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority */ - - -const unsigned char Verisign_Class_3_Public_Primary_Certification_Authority_certificate[576]={ -0x30,0x82,0x02,0x3C,0x30,0x82,0x01,0xA5,0x02,0x10,0x3C,0x91,0x31,0xCB,0x1F,0xF6, -0xD0,0x1B,0x0E,0x9A,0xB8,0xD0,0x44,0xBF,0x12,0xBE,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x5F,0x31,0x0B,0x30,0x09,0x06, -0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17,0x30,0x15,0x06,0x03,0x55,0x04, -0x0A,0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20,0x49,0x6E,0x63, -0x2E,0x31,0x37,0x30,0x35,0x06,0x03,0x55,0x04,0x0B,0x13,0x2E,0x43,0x6C,0x61,0x73, -0x73,0x20,0x33,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x20,0x50,0x72,0x69,0x6D,0x61, -0x72,0x79,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E, -0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x1E,0x17,0x0D,0x39,0x36, -0x30,0x31,0x32,0x39,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x32,0x38,0x30, -0x38,0x30,0x32,0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x5F,0x31,0x0B,0x30,0x09, -0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17,0x30,0x15,0x06,0x03,0x55, -0x04,0x0A,0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20,0x49,0x6E, -0x63,0x2E,0x31,0x37,0x30,0x35,0x06,0x03,0x55,0x04,0x0B,0x13,0x2E,0x43,0x6C,0x61, -0x73,0x73,0x20,0x33,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x20,0x50,0x72,0x69,0x6D, -0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F, -0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x81,0x9F,0x30,0x0D, -0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x81,0x8D, -0x00,0x30,0x81,0x89,0x02,0x81,0x81,0x00,0xC9,0x5C,0x59,0x9E,0xF2,0x1B,0x8A,0x01, -0x14,0xB4,0x10,0xDF,0x04,0x40,0xDB,0xE3,0x57,0xAF,0x6A,0x45,0x40,0x8F,0x84,0x0C, -0x0B,0xD1,0x33,0xD9,0xD9,0x11,0xCF,0xEE,0x02,0x58,0x1F,0x25,0xF7,0x2A,0xA8,0x44, -0x05,0xAA,0xEC,0x03,0x1F,0x78,0x7F,0x9E,0x93,0xB9,0x9A,0x00,0xAA,0x23,0x7D,0xD6, -0xAC,0x85,0xA2,0x63,0x45,0xC7,0x72,0x27,0xCC,0xF4,0x4C,0xC6,0x75,0x71,0xD2,0x39, -0xEF,0x4F,0x42,0xF0,0x75,0xDF,0x0A,0x90,0xC6,0x8E,0x20,0x6F,0x98,0x0F,0xF8,0xAC, -0x23,0x5F,0x70,0x29,0x36,0xA4,0xC9,0x86,0xE7,0xB1,0x9A,0x20,0xCB,0x53,0xA5,0x85, -0xE7,0x3D,0xBE,0x7D,0x9A,0xFE,0x24,0x45,0x33,0xDC,0x76,0x15,0xED,0x0F,0xA2,0x71, -0x64,0x4C,0x65,0x2E,0x81,0x68,0x45,0xA7,0x02,0x03,0x01,0x00,0x01,0x30,0x0D,0x06, -0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x81,0x81,0x00, -0x10,0x72,0x52,0xA9,0x05,0x14,0x19,0x32,0x08,0x41,0xF0,0xC5,0x6B,0x0A,0xCC,0x7E, -0x0F,0x21,0x19,0xCD,0xE4,0x67,0xDC,0x5F,0xA9,0x1B,0xE6,0xCA,0xE8,0x73,0x9D,0x22, -0xD8,0x98,0x6E,0x73,0x03,0x61,0x91,0xC5,0x7C,0xB0,0x45,0x40,0x6E,0x44,0x9D,0x8D, -0xB0,0xB1,0x96,0x74,0x61,0x2D,0x0D,0xA9,0x45,0xD2,0xA4,0x92,0x2A,0xD6,0x9A,0x75, -0x97,0x6E,0x3F,0x53,0xFD,0x45,0x99,0x60,0x1D,0xA8,0x2B,0x4C,0xF9,0x5E,0xA7,0x09, -0xD8,0x75,0x30,0xD7,0xD2,0x65,0x60,0x3D,0x67,0xD6,0x48,0x55,0x75,0x69,0x3F,0x91, -0xF5,0x48,0x0B,0x47,0x69,0x22,0x69,0x82,0x96,0xBE,0xC9,0xC8,0x38,0x86,0x4A,0x7A, -0x2C,0x73,0x19,0x48,0x69,0x4E,0x6B,0x7C,0x65,0xBF,0x0F,0xFC,0x70,0xCE,0x88,0x90, -}; - - -/* subject:/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority - G2/OU=(c) 1998 VeriSign, Inc. - For authorized use only/OU=VeriSign Trust Network */ -/* issuer :/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority - G2/OU=(c) 1998 VeriSign, Inc. - For authorized use only/OU=VeriSign Trust Network */ - - -const unsigned char Verisign_Class_3_Public_Primary_Certification_Authority___G2_certificate[774]={ -0x30,0x82,0x03,0x02,0x30,0x82,0x02,0x6B,0x02,0x10,0x7D,0xD9,0xFE,0x07,0xCF,0xA8, -0x1E,0xB7,0x10,0x79,0x67,0xFB,0xA7,0x89,0x34,0xC6,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x81,0xC1,0x31,0x0B,0x30,0x09, -0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17,0x30,0x15,0x06,0x03,0x55, -0x04,0x0A,0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20,0x49,0x6E, -0x63,0x2E,0x31,0x3C,0x30,0x3A,0x06,0x03,0x55,0x04,0x0B,0x13,0x33,0x43,0x6C,0x61, -0x73,0x73,0x20,0x33,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x20,0x50,0x72,0x69,0x6D, -0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F, -0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x20,0x2D,0x20,0x47,0x32, -0x31,0x3A,0x30,0x38,0x06,0x03,0x55,0x04,0x0B,0x13,0x31,0x28,0x63,0x29,0x20,0x31, -0x39,0x39,0x38,0x20,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20,0x49,0x6E, -0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74,0x68,0x6F,0x72,0x69, -0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79,0x31,0x1F,0x30,0x1D, -0x06,0x03,0x55,0x04,0x0B,0x13,0x16,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x20, -0x54,0x72,0x75,0x73,0x74,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x30,0x1E,0x17, -0x0D,0x39,0x38,0x30,0x35,0x31,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D, -0x32,0x38,0x30,0x38,0x30,0x31,0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x81,0xC1, -0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17,0x30, -0x15,0x06,0x03,0x55,0x04,0x0A,0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E, -0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x3C,0x30,0x3A,0x06,0x03,0x55,0x04,0x0B,0x13, -0x33,0x43,0x6C,0x61,0x73,0x73,0x20,0x33,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x20, -0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63, -0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x20, -0x2D,0x20,0x47,0x32,0x31,0x3A,0x30,0x38,0x06,0x03,0x55,0x04,0x0B,0x13,0x31,0x28, -0x63,0x29,0x20,0x31,0x39,0x39,0x38,0x20,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E, -0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74, -0x68,0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79, -0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x0B,0x13,0x16,0x56,0x65,0x72,0x69,0x53, -0x69,0x67,0x6E,0x20,0x54,0x72,0x75,0x73,0x74,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72, -0x6B,0x30,0x81,0x9F,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01, -0x01,0x05,0x00,0x03,0x81,0x8D,0x00,0x30,0x81,0x89,0x02,0x81,0x81,0x00,0xCC,0x5E, -0xD1,0x11,0x5D,0x5C,0x69,0xD0,0xAB,0xD3,0xB9,0x6A,0x4C,0x99,0x1F,0x59,0x98,0x30, -0x8E,0x16,0x85,0x20,0x46,0x6D,0x47,0x3F,0xD4,0x85,0x20,0x84,0xE1,0x6D,0xB3,0xF8, -0xA4,0xED,0x0C,0xF1,0x17,0x0F,0x3B,0xF9,0xA7,0xF9,0x25,0xD7,0xC1,0xCF,0x84,0x63, -0xF2,0x7C,0x63,0xCF,0xA2,0x47,0xF2,0xC6,0x5B,0x33,0x8E,0x64,0x40,0x04,0x68,0xC1, -0x80,0xB9,0x64,0x1C,0x45,0x77,0xC7,0xD8,0x6E,0xF5,0x95,0x29,0x3C,0x50,0xE8,0x34, -0xD7,0x78,0x1F,0xA8,0xBA,0x6D,0x43,0x91,0x95,0x8F,0x45,0x57,0x5E,0x7E,0xC5,0xFB, -0xCA,0xA4,0x04,0xEB,0xEA,0x97,0x37,0x54,0x30,0x6F,0xBB,0x01,0x47,0x32,0x33,0xCD, -0xDC,0x57,0x9B,0x64,0x69,0x61,0xF8,0x9B,0x1D,0x1C,0x89,0x4F,0x5C,0x67,0x02,0x03, -0x01,0x00,0x01,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05, -0x05,0x00,0x03,0x81,0x81,0x00,0x51,0x4D,0xCD,0xBE,0x5C,0xCB,0x98,0x19,0x9C,0x15, -0xB2,0x01,0x39,0x78,0x2E,0x4D,0x0F,0x67,0x70,0x70,0x99,0xC6,0x10,0x5A,0x94,0xA4, -0x53,0x4D,0x54,0x6D,0x2B,0xAF,0x0D,0x5D,0x40,0x8B,0x64,0xD3,0xD7,0xEE,0xDE,0x56, -0x61,0x92,0x5F,0xA6,0xC4,0x1D,0x10,0x61,0x36,0xD3,0x2C,0x27,0x3C,0xE8,0x29,0x09, -0xB9,0x11,0x64,0x74,0xCC,0xB5,0x73,0x9F,0x1C,0x48,0xA9,0xBC,0x61,0x01,0xEE,0xE2, -0x17,0xA6,0x0C,0xE3,0x40,0x08,0x3B,0x0E,0xE7,0xEB,0x44,0x73,0x2A,0x9A,0xF1,0x69, -0x92,0xEF,0x71,0x14,0xC3,0x39,0xAC,0x71,0xA7,0x91,0x09,0x6F,0xE4,0x71,0x06,0xB3, -0xBA,0x59,0x57,0x26,0x79,0x00,0xF6,0xF8,0x0D,0xA2,0x33,0x30,0x28,0xD4,0xAA,0x58, -0xA0,0x9D,0x9D,0x69,0x91,0xFD, -}; - - -/* subject:/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 1999 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 3 Public Primary Certification Authority - G3 */ -/* issuer :/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 1999 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 3 Public Primary Certification Authority - G3 */ - - -const unsigned char Verisign_Class_3_Public_Primary_Certification_Authority___G3_certificate[1054]={ -0x30,0x82,0x04,0x1A,0x30,0x82,0x03,0x02,0x02,0x11,0x00,0x9B,0x7E,0x06,0x49,0xA3, -0x3E,0x62,0xB9,0xD5,0xEE,0x90,0x48,0x71,0x29,0xEF,0x57,0x30,0x0D,0x06,0x09,0x2A, -0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x81,0xCA,0x31,0x0B,0x30, -0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17,0x30,0x15,0x06,0x03, -0x55,0x04,0x0A,0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20,0x49, -0x6E,0x63,0x2E,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x0B,0x13,0x16,0x56,0x65, -0x72,0x69,0x53,0x69,0x67,0x6E,0x20,0x54,0x72,0x75,0x73,0x74,0x20,0x4E,0x65,0x74, -0x77,0x6F,0x72,0x6B,0x31,0x3A,0x30,0x38,0x06,0x03,0x55,0x04,0x0B,0x13,0x31,0x28, -0x63,0x29,0x20,0x31,0x39,0x39,0x39,0x20,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E, -0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74, -0x68,0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79, -0x31,0x45,0x30,0x43,0x06,0x03,0x55,0x04,0x03,0x13,0x3C,0x56,0x65,0x72,0x69,0x53, -0x69,0x67,0x6E,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x33,0x20,0x50,0x75,0x62,0x6C, -0x69,0x63,0x20,0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74,0x69, -0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69, -0x74,0x79,0x20,0x2D,0x20,0x47,0x33,0x30,0x1E,0x17,0x0D,0x39,0x39,0x31,0x30,0x30, -0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x36,0x30,0x37,0x31,0x36, -0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x81,0xCA,0x31,0x0B,0x30,0x09,0x06,0x03, -0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17,0x30,0x15,0x06,0x03,0x55,0x04,0x0A, -0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20,0x49,0x6E,0x63,0x2E, -0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x0B,0x13,0x16,0x56,0x65,0x72,0x69,0x53, -0x69,0x67,0x6E,0x20,0x54,0x72,0x75,0x73,0x74,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72, -0x6B,0x31,0x3A,0x30,0x38,0x06,0x03,0x55,0x04,0x0B,0x13,0x31,0x28,0x63,0x29,0x20, -0x31,0x39,0x39,0x39,0x20,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20,0x49, -0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74,0x68,0x6F,0x72, -0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79,0x31,0x45,0x30, -0x43,0x06,0x03,0x55,0x04,0x03,0x13,0x3C,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E, -0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x33,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x20, -0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63, -0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x20, -0x2D,0x20,0x47,0x33,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86, -0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A, -0x02,0x82,0x01,0x01,0x00,0xCB,0xBA,0x9C,0x52,0xFC,0x78,0x1F,0x1A,0x1E,0x6F,0x1B, -0x37,0x73,0xBD,0xF8,0xC9,0x6B,0x94,0x12,0x30,0x4F,0xF0,0x36,0x47,0xF5,0xD0,0x91, -0x0A,0xF5,0x17,0xC8,0xA5,0x61,0xC1,0x16,0x40,0x4D,0xFB,0x8A,0x61,0x90,0xE5,0x76, -0x20,0xC1,0x11,0x06,0x7D,0xAB,0x2C,0x6E,0xA6,0xF5,0x11,0x41,0x8E,0xFA,0x2D,0xAD, -0x2A,0x61,0x59,0xA4,0x67,0x26,0x4C,0xD0,0xE8,0xBC,0x52,0x5B,0x70,0x20,0x04,0x58, -0xD1,0x7A,0xC9,0xA4,0x69,0xBC,0x83,0x17,0x64,0xAD,0x05,0x8B,0xBC,0xD0,0x58,0xCE, -0x8D,0x8C,0xF5,0xEB,0xF0,0x42,0x49,0x0B,0x9D,0x97,0x27,0x67,0x32,0x6E,0xE1,0xAE, -0x93,0x15,0x1C,0x70,0xBC,0x20,0x4D,0x2F,0x18,0xDE,0x92,0x88,0xE8,0x6C,0x85,0x57, -0x11,0x1A,0xE9,0x7E,0xE3,0x26,0x11,0x54,0xA2,0x45,0x96,0x55,0x83,0xCA,0x30,0x89, -0xE8,0xDC,0xD8,0xA3,0xED,0x2A,0x80,0x3F,0x7F,0x79,0x65,0x57,0x3E,0x15,0x20,0x66, -0x08,0x2F,0x95,0x93,0xBF,0xAA,0x47,0x2F,0xA8,0x46,0x97,0xF0,0x12,0xE2,0xFE,0xC2, -0x0A,0x2B,0x51,0xE6,0x76,0xE6,0xB7,0x46,0xB7,0xE2,0x0D,0xA6,0xCC,0xA8,0xC3,0x4C, -0x59,0x55,0x89,0xE6,0xE8,0x53,0x5C,0x1C,0xEA,0x9D,0xF0,0x62,0x16,0x0B,0xA7,0xC9, -0x5F,0x0C,0xF0,0xDE,0xC2,0x76,0xCE,0xAF,0xF7,0x6A,0xF2,0xFA,0x41,0xA6,0xA2,0x33, -0x14,0xC9,0xE5,0x7A,0x63,0xD3,0x9E,0x62,0x37,0xD5,0x85,0x65,0x9E,0x0E,0xE6,0x53, -0x24,0x74,0x1B,0x5E,0x1D,0x12,0x53,0x5B,0xC7,0x2C,0xE7,0x83,0x49,0x3B,0x15,0xAE, -0x8A,0x68,0xB9,0x57,0x97,0x02,0x03,0x01,0x00,0x01,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x11,0x14, -0x96,0xC1,0xAB,0x92,0x08,0xF7,0x3F,0x2F,0xC9,0xB2,0xFE,0xE4,0x5A,0x9F,0x64,0xDE, -0xDB,0x21,0x4F,0x86,0x99,0x34,0x76,0x36,0x57,0xDD,0xD0,0x15,0x2F,0xC5,0xAD,0x7F, -0x15,0x1F,0x37,0x62,0x73,0x3E,0xD4,0xE7,0x5F,0xCE,0x17,0x03,0xDB,0x35,0xFA,0x2B, -0xDB,0xAE,0x60,0x09,0x5F,0x1E,0x5F,0x8F,0x6E,0xBB,0x0B,0x3D,0xEA,0x5A,0x13,0x1E, -0x0C,0x60,0x6F,0xB5,0xC0,0xB5,0x23,0x22,0x2E,0x07,0x0B,0xCB,0xA9,0x74,0xCB,0x47, -0xBB,0x1D,0xC1,0xD7,0xA5,0x6B,0xCC,0x2F,0xD2,0x42,0xFD,0x49,0xDD,0xA7,0x89,0xCF, -0x53,0xBA,0xDA,0x00,0x5A,0x28,0xBF,0x82,0xDF,0xF8,0xBA,0x13,0x1D,0x50,0x86,0x82, -0xFD,0x8E,0x30,0x8F,0x29,0x46,0xB0,0x1E,0x3D,0x35,0xDA,0x38,0x62,0x16,0x18,0x4A, -0xAD,0xE6,0xB6,0x51,0x6C,0xDE,0xAF,0x62,0xEB,0x01,0xD0,0x1E,0x24,0xFE,0x7A,0x8F, -0x12,0x1A,0x12,0x68,0xB8,0xFB,0x66,0x99,0x14,0x14,0x45,0x5C,0xAE,0xE7,0xAE,0x69, -0x17,0x81,0x2B,0x5A,0x37,0xC9,0x5E,0x2A,0xF4,0xC6,0xE2,0xA1,0x5C,0x54,0x9B,0xA6, -0x54,0x00,0xCF,0xF0,0xF1,0xC1,0xC7,0x98,0x30,0x1A,0x3B,0x36,0x16,0xDB,0xA3,0x6E, -0xEA,0xFD,0xAD,0xB2,0xC2,0xDA,0xEF,0x02,0x47,0x13,0x8A,0xC0,0xF1,0xB3,0x31,0xAD, -0x4F,0x1C,0xE1,0x4F,0x9C,0xAF,0x0F,0x0C,0x9D,0xF7,0x78,0x0D,0xD8,0xF4,0x35,0x56, -0x80,0xDA,0xB7,0x6D,0x17,0x8F,0x9D,0x1E,0x81,0x64,0xE1,0xFE,0xC5,0x45,0xBA,0xAD, -0x6B,0xB9,0x0A,0x7A,0x4E,0x4F,0x4B,0x84,0xEE,0x4B,0xF1,0x7D,0xDD,0x11, -}; - - -/* subject:/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2007 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 3 Public Primary Certification Authority - G4 */ -/* issuer :/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2007 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 3 Public Primary Certification Authority - G4 */ - - -const unsigned char VeriSign_Class_3_Public_Primary_Certification_Authority___G4_certificate[904]={ -0x30,0x82,0x03,0x84,0x30,0x82,0x03,0x0A,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x2F, -0x80,0xFE,0x23,0x8C,0x0E,0x22,0x0F,0x48,0x67,0x12,0x28,0x91,0x87,0xAC,0xB3,0x30, -0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,0x30,0x81,0xCA,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17,0x30,0x15,0x06, -0x03,0x55,0x04,0x0A,0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20, -0x49,0x6E,0x63,0x2E,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x0B,0x13,0x16,0x56, -0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x20,0x54,0x72,0x75,0x73,0x74,0x20,0x4E,0x65, -0x74,0x77,0x6F,0x72,0x6B,0x31,0x3A,0x30,0x38,0x06,0x03,0x55,0x04,0x0B,0x13,0x31, -0x28,0x63,0x29,0x20,0x32,0x30,0x30,0x37,0x20,0x56,0x65,0x72,0x69,0x53,0x69,0x67, -0x6E,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75, -0x74,0x68,0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C, -0x79,0x31,0x45,0x30,0x43,0x06,0x03,0x55,0x04,0x03,0x13,0x3C,0x56,0x65,0x72,0x69, -0x53,0x69,0x67,0x6E,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x33,0x20,0x50,0x75,0x62, -0x6C,0x69,0x63,0x20,0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74, -0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72, -0x69,0x74,0x79,0x20,0x2D,0x20,0x47,0x34,0x30,0x1E,0x17,0x0D,0x30,0x37,0x31,0x31, -0x30,0x35,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x38,0x30,0x31,0x31, -0x38,0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x81,0xCA,0x31,0x0B,0x30,0x09,0x06, -0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17,0x30,0x15,0x06,0x03,0x55,0x04, -0x0A,0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20,0x49,0x6E,0x63, -0x2E,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x0B,0x13,0x16,0x56,0x65,0x72,0x69, -0x53,0x69,0x67,0x6E,0x20,0x54,0x72,0x75,0x73,0x74,0x20,0x4E,0x65,0x74,0x77,0x6F, -0x72,0x6B,0x31,0x3A,0x30,0x38,0x06,0x03,0x55,0x04,0x0B,0x13,0x31,0x28,0x63,0x29, -0x20,0x32,0x30,0x30,0x37,0x20,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20, -0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74,0x68,0x6F, -0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79,0x31,0x45, -0x30,0x43,0x06,0x03,0x55,0x04,0x03,0x13,0x3C,0x56,0x65,0x72,0x69,0x53,0x69,0x67, -0x6E,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x33,0x20,0x50,0x75,0x62,0x6C,0x69,0x63, -0x20,0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69, -0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79, -0x20,0x2D,0x20,0x47,0x34,0x30,0x76,0x30,0x10,0x06,0x07,0x2A,0x86,0x48,0xCE,0x3D, -0x02,0x01,0x06,0x05,0x2B,0x81,0x04,0x00,0x22,0x03,0x62,0x00,0x04,0xA7,0x56,0x7A, -0x7C,0x52,0xDA,0x64,0x9B,0x0E,0x2D,0x5C,0xD8,0x5E,0xAC,0x92,0x3D,0xFE,0x01,0xE6, -0x19,0x4A,0x3D,0x14,0x03,0x4B,0xFA,0x60,0x27,0x20,0xD9,0x83,0x89,0x69,0xFA,0x54, -0xC6,0x9A,0x18,0x5E,0x55,0x2A,0x64,0xDE,0x06,0xF6,0x8D,0x4A,0x3B,0xAD,0x10,0x3C, -0x65,0x3D,0x90,0x88,0x04,0x89,0xE0,0x30,0x61,0xB3,0xAE,0x5D,0x01,0xA7,0x7B,0xDE, -0x7C,0xB2,0xBE,0xCA,0x65,0x61,0x00,0x86,0xAE,0xDA,0x8F,0x7B,0xD0,0x89,0xAD,0x4D, -0x1D,0x59,0x9A,0x41,0xB1,0xBC,0x47,0x80,0xDC,0x9E,0x62,0xC3,0xF9,0xA3,0x81,0xB2, -0x30,0x81,0xAF,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05,0x30, -0x03,0x01,0x01,0xFF,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04, -0x03,0x02,0x01,0x06,0x30,0x6D,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x0C, -0x04,0x61,0x30,0x5F,0xA1,0x5D,0xA0,0x5B,0x30,0x59,0x30,0x57,0x30,0x55,0x16,0x09, -0x69,0x6D,0x61,0x67,0x65,0x2F,0x67,0x69,0x66,0x30,0x21,0x30,0x1F,0x30,0x07,0x06, -0x05,0x2B,0x0E,0x03,0x02,0x1A,0x04,0x14,0x8F,0xE5,0xD3,0x1A,0x86,0xAC,0x8D,0x8E, -0x6B,0xC3,0xCF,0x80,0x6A,0xD4,0x48,0x18,0x2C,0x7B,0x19,0x2E,0x30,0x25,0x16,0x23, -0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x6C,0x6F,0x67,0x6F,0x2E,0x76,0x65,0x72,0x69, -0x73,0x69,0x67,0x6E,0x2E,0x63,0x6F,0x6D,0x2F,0x76,0x73,0x6C,0x6F,0x67,0x6F,0x2E, -0x67,0x69,0x66,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0xB3,0x16, -0x91,0xFD,0xEE,0xA6,0x6E,0xE4,0xB5,0x2E,0x49,0x8F,0x87,0x78,0x81,0x80,0xEC,0xE5, -0xB1,0xB5,0x30,0x0A,0x06,0x08,0x2A,0x86,0x48,0xCE,0x3D,0x04,0x03,0x03,0x03,0x68, -0x00,0x30,0x65,0x02,0x30,0x66,0x21,0x0C,0x18,0x26,0x60,0x5A,0x38,0x7B,0x56,0x42, -0xE0,0xA7,0xFC,0x36,0x84,0x51,0x91,0x20,0x2C,0x76,0x4D,0x43,0x3D,0xC4,0x1D,0x84, -0x23,0xD0,0xAC,0xD6,0x7C,0x35,0x06,0xCE,0xCD,0x69,0xBD,0x90,0x0D,0xDB,0x6C,0x48, -0x42,0x1D,0x0E,0xAA,0x42,0x02,0x31,0x00,0x9C,0x3D,0x48,0x39,0x23,0x39,0x58,0x1A, -0x15,0x12,0x59,0x6A,0x9E,0xEF,0xD5,0x59,0xB2,0x1D,0x52,0x2C,0x99,0x71,0xCD,0xC7, -0x29,0xDF,0x1B,0x2A,0x61,0x7B,0x71,0xD1,0xDE,0xF3,0xC0,0xE5,0x0D,0x3A,0x4A,0xAA, -0x2D,0xA7,0xD8,0x86,0x2A,0xDD,0x2E,0x10, -}; - - -/* subject:/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2006 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 3 Public Primary Certification Authority - G5 */ -/* issuer :/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2006 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 3 Public Primary Certification Authority - G5 */ - - -const unsigned char VeriSign_Class_3_Public_Primary_Certification_Authority___G5_certificate[1239]={ -0x30,0x82,0x04,0xD3,0x30,0x82,0x03,0xBB,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x18, -0xDA,0xD1,0x9E,0x26,0x7D,0xE8,0xBB,0x4A,0x21,0x58,0xCD,0xCC,0x6B,0x3B,0x4A,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x81, -0xCA,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17, -0x30,0x15,0x06,0x03,0x55,0x04,0x0A,0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67, -0x6E,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x0B, -0x13,0x16,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x20,0x54,0x72,0x75,0x73,0x74, -0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x3A,0x30,0x38,0x06,0x03,0x55,0x04, -0x0B,0x13,0x31,0x28,0x63,0x29,0x20,0x32,0x30,0x30,0x36,0x20,0x56,0x65,0x72,0x69, -0x53,0x69,0x67,0x6E,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72, -0x20,0x61,0x75,0x74,0x68,0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20, -0x6F,0x6E,0x6C,0x79,0x31,0x45,0x30,0x43,0x06,0x03,0x55,0x04,0x03,0x13,0x3C,0x56, -0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x33,0x20, -0x50,0x75,0x62,0x6C,0x69,0x63,0x20,0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43, -0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74, -0x68,0x6F,0x72,0x69,0x74,0x79,0x20,0x2D,0x20,0x47,0x35,0x30,0x1E,0x17,0x0D,0x30, -0x36,0x31,0x31,0x30,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x36, -0x30,0x37,0x31,0x36,0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x81,0xCA,0x31,0x0B, -0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17,0x30,0x15,0x06, -0x03,0x55,0x04,0x0A,0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20, -0x49,0x6E,0x63,0x2E,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x0B,0x13,0x16,0x56, -0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x20,0x54,0x72,0x75,0x73,0x74,0x20,0x4E,0x65, -0x74,0x77,0x6F,0x72,0x6B,0x31,0x3A,0x30,0x38,0x06,0x03,0x55,0x04,0x0B,0x13,0x31, -0x28,0x63,0x29,0x20,0x32,0x30,0x30,0x36,0x20,0x56,0x65,0x72,0x69,0x53,0x69,0x67, -0x6E,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75, -0x74,0x68,0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C, -0x79,0x31,0x45,0x30,0x43,0x06,0x03,0x55,0x04,0x03,0x13,0x3C,0x56,0x65,0x72,0x69, -0x53,0x69,0x67,0x6E,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x33,0x20,0x50,0x75,0x62, -0x6C,0x69,0x63,0x20,0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74, -0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72, -0x69,0x74,0x79,0x20,0x2D,0x20,0x47,0x35,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09, -0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00, -0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xAF,0x24,0x08,0x08,0x29,0x7A,0x35, -0x9E,0x60,0x0C,0xAA,0xE7,0x4B,0x3B,0x4E,0xDC,0x7C,0xBC,0x3C,0x45,0x1C,0xBB,0x2B, -0xE0,0xFE,0x29,0x02,0xF9,0x57,0x08,0xA3,0x64,0x85,0x15,0x27,0xF5,0xF1,0xAD,0xC8, -0x31,0x89,0x5D,0x22,0xE8,0x2A,0xAA,0xA6,0x42,0xB3,0x8F,0xF8,0xB9,0x55,0xB7,0xB1, -0xB7,0x4B,0xB3,0xFE,0x8F,0x7E,0x07,0x57,0xEC,0xEF,0x43,0xDB,0x66,0x62,0x15,0x61, -0xCF,0x60,0x0D,0xA4,0xD8,0xDE,0xF8,0xE0,0xC3,0x62,0x08,0x3D,0x54,0x13,0xEB,0x49, -0xCA,0x59,0x54,0x85,0x26,0xE5,0x2B,0x8F,0x1B,0x9F,0xEB,0xF5,0xA1,0x91,0xC2,0x33, -0x49,0xD8,0x43,0x63,0x6A,0x52,0x4B,0xD2,0x8F,0xE8,0x70,0x51,0x4D,0xD1,0x89,0x69, -0x7B,0xC7,0x70,0xF6,0xB3,0xDC,0x12,0x74,0xDB,0x7B,0x5D,0x4B,0x56,0xD3,0x96,0xBF, -0x15,0x77,0xA1,0xB0,0xF4,0xA2,0x25,0xF2,0xAF,0x1C,0x92,0x67,0x18,0xE5,0xF4,0x06, -0x04,0xEF,0x90,0xB9,0xE4,0x00,0xE4,0xDD,0x3A,0xB5,0x19,0xFF,0x02,0xBA,0xF4,0x3C, -0xEE,0xE0,0x8B,0xEB,0x37,0x8B,0xEC,0xF4,0xD7,0xAC,0xF2,0xF6,0xF0,0x3D,0xAF,0xDD, -0x75,0x91,0x33,0x19,0x1D,0x1C,0x40,0xCB,0x74,0x24,0x19,0x21,0x93,0xD9,0x14,0xFE, -0xAC,0x2A,0x52,0xC7,0x8F,0xD5,0x04,0x49,0xE4,0x8D,0x63,0x47,0x88,0x3C,0x69,0x83, -0xCB,0xFE,0x47,0xBD,0x2B,0x7E,0x4F,0xC5,0x95,0xAE,0x0E,0x9D,0xD4,0xD1,0x43,0xC0, -0x67,0x73,0xE3,0x14,0x08,0x7E,0xE5,0x3F,0x9F,0x73,0xB8,0x33,0x0A,0xCF,0x5D,0x3F, -0x34,0x87,0x96,0x8A,0xEE,0x53,0xE8,0x25,0x15,0x02,0x03,0x01,0x00,0x01,0xA3,0x81, -0xB2,0x30,0x81,0xAF,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF,0x04,0x05, -0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06,0x03,0x55,0x1D,0x0F,0x01,0x01,0xFF,0x04, -0x04,0x03,0x02,0x01,0x06,0x30,0x6D,0x06,0x08,0x2B,0x06,0x01,0x05,0x05,0x07,0x01, -0x0C,0x04,0x61,0x30,0x5F,0xA1,0x5D,0xA0,0x5B,0x30,0x59,0x30,0x57,0x30,0x55,0x16, -0x09,0x69,0x6D,0x61,0x67,0x65,0x2F,0x67,0x69,0x66,0x30,0x21,0x30,0x1F,0x30,0x07, -0x06,0x05,0x2B,0x0E,0x03,0x02,0x1A,0x04,0x14,0x8F,0xE5,0xD3,0x1A,0x86,0xAC,0x8D, -0x8E,0x6B,0xC3,0xCF,0x80,0x6A,0xD4,0x48,0x18,0x2C,0x7B,0x19,0x2E,0x30,0x25,0x16, -0x23,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x6C,0x6F,0x67,0x6F,0x2E,0x76,0x65,0x72, -0x69,0x73,0x69,0x67,0x6E,0x2E,0x63,0x6F,0x6D,0x2F,0x76,0x73,0x6C,0x6F,0x67,0x6F, -0x2E,0x67,0x69,0x66,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16,0x04,0x14,0x7F, -0xD3,0x65,0xA7,0xC2,0xDD,0xEC,0xBB,0xF0,0x30,0x09,0xF3,0x43,0x39,0xFA,0x02,0xAF, -0x33,0x31,0x33,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05, -0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x93,0x24,0x4A,0x30,0x5F,0x62,0xCF,0xD8,0x1A, -0x98,0x2F,0x3D,0xEA,0xDC,0x99,0x2D,0xBD,0x77,0xF6,0xA5,0x79,0x22,0x38,0xEC,0xC4, -0xA7,0xA0,0x78,0x12,0xAD,0x62,0x0E,0x45,0x70,0x64,0xC5,0xE7,0x97,0x66,0x2D,0x98, -0x09,0x7E,0x5F,0xAF,0xD6,0xCC,0x28,0x65,0xF2,0x01,0xAA,0x08,0x1A,0x47,0xDE,0xF9, -0xF9,0x7C,0x92,0x5A,0x08,0x69,0x20,0x0D,0xD9,0x3E,0x6D,0x6E,0x3C,0x0D,0x6E,0xD8, -0xE6,0x06,0x91,0x40,0x18,0xB9,0xF8,0xC1,0xED,0xDF,0xDB,0x41,0xAA,0xE0,0x96,0x20, -0xC9,0xCD,0x64,0x15,0x38,0x81,0xC9,0x94,0xEE,0xA2,0x84,0x29,0x0B,0x13,0x6F,0x8E, -0xDB,0x0C,0xDD,0x25,0x02,0xDB,0xA4,0x8B,0x19,0x44,0xD2,0x41,0x7A,0x05,0x69,0x4A, -0x58,0x4F,0x60,0xCA,0x7E,0x82,0x6A,0x0B,0x02,0xAA,0x25,0x17,0x39,0xB5,0xDB,0x7F, -0xE7,0x84,0x65,0x2A,0x95,0x8A,0xBD,0x86,0xDE,0x5E,0x81,0x16,0x83,0x2D,0x10,0xCC, -0xDE,0xFD,0xA8,0x82,0x2A,0x6D,0x28,0x1F,0x0D,0x0B,0xC4,0xE5,0xE7,0x1A,0x26,0x19, -0xE1,0xF4,0x11,0x6F,0x10,0xB5,0x95,0xFC,0xE7,0x42,0x05,0x32,0xDB,0xCE,0x9D,0x51, -0x5E,0x28,0xB6,0x9E,0x85,0xD3,0x5B,0xEF,0xA5,0x7D,0x45,0x40,0x72,0x8E,0xB7,0x0E, -0x6B,0x0E,0x06,0xFB,0x33,0x35,0x48,0x71,0xB8,0x9D,0x27,0x8B,0xC4,0x65,0x5F,0x0D, -0x86,0x76,0x9C,0x44,0x7A,0xF6,0x95,0x5C,0xF6,0x5D,0x32,0x08,0x33,0xA4,0x54,0xB6, -0x18,0x3F,0x68,0x5C,0xF2,0x42,0x4A,0x85,0x38,0x54,0x83,0x5F,0xD1,0xE8,0x2C,0xF2, -0xAC,0x11,0xD6,0xA8,0xED,0x63,0x6A, -}; - - -/* subject:/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 1999 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 4 Public Primary Certification Authority - G3 */ -/* issuer :/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 1999 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 4 Public Primary Certification Authority - G3 */ - - -const unsigned char Verisign_Class_4_Public_Primary_Certification_Authority___G3_certificate[1054]={ -0x30,0x82,0x04,0x1A,0x30,0x82,0x03,0x02,0x02,0x11,0x00,0xEC,0xA0,0xA7,0x8B,0x6E, -0x75,0x6A,0x01,0xCF,0xC4,0x7C,0xCC,0x2F,0x94,0x5E,0xD7,0x30,0x0D,0x06,0x09,0x2A, -0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x81,0xCA,0x31,0x0B,0x30, -0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17,0x30,0x15,0x06,0x03, -0x55,0x04,0x0A,0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20,0x49, -0x6E,0x63,0x2E,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x0B,0x13,0x16,0x56,0x65, -0x72,0x69,0x53,0x69,0x67,0x6E,0x20,0x54,0x72,0x75,0x73,0x74,0x20,0x4E,0x65,0x74, -0x77,0x6F,0x72,0x6B,0x31,0x3A,0x30,0x38,0x06,0x03,0x55,0x04,0x0B,0x13,0x31,0x28, -0x63,0x29,0x20,0x31,0x39,0x39,0x39,0x20,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E, -0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74, -0x68,0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79, -0x31,0x45,0x30,0x43,0x06,0x03,0x55,0x04,0x03,0x13,0x3C,0x56,0x65,0x72,0x69,0x53, -0x69,0x67,0x6E,0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x34,0x20,0x50,0x75,0x62,0x6C, -0x69,0x63,0x20,0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74,0x69, -0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69, -0x74,0x79,0x20,0x2D,0x20,0x47,0x33,0x30,0x1E,0x17,0x0D,0x39,0x39,0x31,0x30,0x30, -0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17,0x0D,0x33,0x36,0x30,0x37,0x31,0x36, -0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x81,0xCA,0x31,0x0B,0x30,0x09,0x06,0x03, -0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17,0x30,0x15,0x06,0x03,0x55,0x04,0x0A, -0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20,0x49,0x6E,0x63,0x2E, -0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x0B,0x13,0x16,0x56,0x65,0x72,0x69,0x53, -0x69,0x67,0x6E,0x20,0x54,0x72,0x75,0x73,0x74,0x20,0x4E,0x65,0x74,0x77,0x6F,0x72, -0x6B,0x31,0x3A,0x30,0x38,0x06,0x03,0x55,0x04,0x0B,0x13,0x31,0x28,0x63,0x29,0x20, -0x31,0x39,0x39,0x39,0x20,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x2C,0x20,0x49, -0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72,0x20,0x61,0x75,0x74,0x68,0x6F,0x72, -0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20,0x6F,0x6E,0x6C,0x79,0x31,0x45,0x30, -0x43,0x06,0x03,0x55,0x04,0x03,0x13,0x3C,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E, -0x20,0x43,0x6C,0x61,0x73,0x73,0x20,0x34,0x20,0x50,0x75,0x62,0x6C,0x69,0x63,0x20, -0x50,0x72,0x69,0x6D,0x61,0x72,0x79,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63, -0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x20, -0x2D,0x20,0x47,0x33,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86, -0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A, -0x02,0x82,0x01,0x01,0x00,0xAD,0xCB,0xA5,0x11,0x69,0xC6,0x59,0xAB,0xF1,0x8F,0xB5, -0x19,0x0F,0x56,0xCE,0xCC,0xB5,0x1F,0x20,0xE4,0x9E,0x26,0x25,0x4B,0xE0,0x73,0x65, -0x89,0x59,0xDE,0xD0,0x83,0xE4,0xF5,0x0F,0xB5,0xBB,0xAD,0xF1,0x7C,0xE8,0x21,0xFC, -0xE4,0xE8,0x0C,0xEE,0x7C,0x45,0x22,0x19,0x76,0x92,0xB4,0x13,0xB7,0x20,0x5B,0x09, -0xFA,0x61,0xAE,0xA8,0xF2,0xA5,0x8D,0x85,0xC2,0x2A,0xD6,0xDE,0x66,0x36,0xD2,0x9B, -0x02,0xF4,0xA8,0x92,0x60,0x7C,0x9C,0x69,0xB4,0x8F,0x24,0x1E,0xD0,0x86,0x52,0xF6, -0x32,0x9C,0x41,0x58,0x1E,0x22,0xBD,0xCD,0x45,0x62,0x95,0x08,0x6E,0xD0,0x66,0xDD, -0x53,0xA2,0xCC,0xF0,0x10,0xDC,0x54,0x73,0x8B,0x04,0xA1,0x46,0x33,0x33,0x5C,0x17, -0x40,0xB9,0x9E,0x4D,0xD3,0xF3,0xBE,0x55,0x83,0xE8,0xB1,0x89,0x8E,0x5A,0x7C,0x9A, -0x96,0x22,0x90,0x3B,0x88,0x25,0xF2,0xD2,0x53,0x88,0x02,0x0C,0x0B,0x78,0xF2,0xE6, -0x37,0x17,0x4B,0x30,0x46,0x07,0xE4,0x80,0x6D,0xA6,0xD8,0x96,0x2E,0xE8,0x2C,0xF8, -0x11,0xB3,0x38,0x0D,0x66,0xA6,0x9B,0xEA,0xC9,0x23,0x5B,0xDB,0x8E,0xE2,0xF3,0x13, -0x8E,0x1A,0x59,0x2D,0xAA,0x02,0xF0,0xEC,0xA4,0x87,0x66,0xDC,0xC1,0x3F,0xF5,0xD8, -0xB9,0xF4,0xEC,0x82,0xC6,0xD2,0x3D,0x95,0x1D,0xE5,0xC0,0x4F,0x84,0xC9,0xD9,0xA3, -0x44,0x28,0x06,0x6A,0xD7,0x45,0xAC,0xF0,0x6B,0x6A,0xEF,0x4E,0x5F,0xF8,0x11,0x82, -0x1E,0x38,0x63,0x34,0x66,0x50,0xD4,0x3E,0x93,0x73,0xFA,0x30,0xC3,0x66,0xAD,0xFF, -0x93,0x2D,0x97,0xEF,0x03,0x02,0x03,0x01,0x00,0x01,0x30,0x0D,0x06,0x09,0x2A,0x86, -0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x8F,0xFA, -0x25,0x6B,0x4F,0x5B,0xE4,0xA4,0x4E,0x27,0x55,0xAB,0x22,0x15,0x59,0x3C,0xCA,0xB5, -0x0A,0xD4,0x4A,0xDB,0xAB,0xDD,0xA1,0x5F,0x53,0xC5,0xA0,0x57,0x39,0xC2,0xCE,0x47, -0x2B,0xBE,0x3A,0xC8,0x56,0xBF,0xC2,0xD9,0x27,0x10,0x3A,0xB1,0x05,0x3C,0xC0,0x77, -0x31,0xBB,0x3A,0xD3,0x05,0x7B,0x6D,0x9A,0x1C,0x30,0x8C,0x80,0xCB,0x93,0x93,0x2A, -0x83,0xAB,0x05,0x51,0x82,0x02,0x00,0x11,0x67,0x6B,0xF3,0x88,0x61,0x47,0x5F,0x03, -0x93,0xD5,0x5B,0x0D,0xE0,0xF1,0xD4,0xA1,0x32,0x35,0x85,0xB2,0x3A,0xDB,0xB0,0x82, -0xAB,0xD1,0xCB,0x0A,0xBC,0x4F,0x8C,0x5B,0xC5,0x4B,0x00,0x3B,0x1F,0x2A,0x82,0xA6, -0x7E,0x36,0x85,0xDC,0x7E,0x3C,0x67,0x00,0xB5,0xE4,0x3B,0x52,0xE0,0xA8,0xEB,0x5D, -0x15,0xF9,0xC6,0x6D,0xF0,0xAD,0x1D,0x0E,0x85,0xB7,0xA9,0x9A,0x73,0x14,0x5A,0x5B, -0x8F,0x41,0x28,0xC0,0xD5,0xE8,0x2D,0x4D,0xA4,0x5E,0xCD,0xAA,0xD9,0xED,0xCE,0xDC, -0xD8,0xD5,0x3C,0x42,0x1D,0x17,0xC1,0x12,0x5D,0x45,0x38,0xC3,0x38,0xF3,0xFC,0x85, -0x2E,0x83,0x46,0x48,0xB2,0xD7,0x20,0x5F,0x92,0x36,0x8F,0xE7,0x79,0x0F,0x98,0x5E, -0x99,0xE8,0xF0,0xD0,0xA4,0xBB,0xF5,0x53,0xBD,0x2A,0xCE,0x59,0xB0,0xAF,0x6E,0x7F, -0x6C,0xBB,0xD2,0x1E,0x00,0xB0,0x21,0xED,0xF8,0x41,0x62,0x82,0xB9,0xD8,0xB2,0xC4, -0xBB,0x46,0x50,0xF3,0x31,0xC5,0x8F,0x01,0xA8,0x74,0xEB,0xF5,0x78,0x27,0xDA,0xE7, -0xF7,0x66,0x43,0xF3,0x9E,0x83,0x3E,0x20,0xAA,0xC3,0x35,0x60,0x91,0xCE, -}; - - -/* subject:/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2008 VeriSign, Inc. - For authorized use only/CN=VeriSign Universal Root Certification Authority */ -/* issuer :/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2008 VeriSign, Inc. - For authorized use only/CN=VeriSign Universal Root Certification Authority */ - - -const unsigned char VeriSign_Universal_Root_Certification_Authority_certificate[1213]={ -0x30,0x82,0x04,0xB9,0x30,0x82,0x03,0xA1,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x40, -0x1A,0xC4,0x64,0x21,0xB3,0x13,0x21,0x03,0x0E,0xBB,0xE4,0x12,0x1A,0xC5,0x1D,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x30,0x81, -0xBD,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17, -0x30,0x15,0x06,0x03,0x55,0x04,0x0A,0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67, -0x6E,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x0B, -0x13,0x16,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x20,0x54,0x72,0x75,0x73,0x74, -0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x3A,0x30,0x38,0x06,0x03,0x55,0x04, -0x0B,0x13,0x31,0x28,0x63,0x29,0x20,0x32,0x30,0x30,0x38,0x20,0x56,0x65,0x72,0x69, -0x53,0x69,0x67,0x6E,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72, -0x20,0x61,0x75,0x74,0x68,0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20, -0x6F,0x6E,0x6C,0x79,0x31,0x38,0x30,0x36,0x06,0x03,0x55,0x04,0x03,0x13,0x2F,0x56, -0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x20,0x55,0x6E,0x69,0x76,0x65,0x72,0x73,0x61, -0x6C,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61, -0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x1E, -0x17,0x0D,0x30,0x38,0x30,0x34,0x30,0x32,0x30,0x30,0x30,0x30,0x30,0x30,0x5A,0x17, -0x0D,0x33,0x37,0x31,0x32,0x30,0x31,0x32,0x33,0x35,0x39,0x35,0x39,0x5A,0x30,0x81, -0xBD,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x17, -0x30,0x15,0x06,0x03,0x55,0x04,0x0A,0x13,0x0E,0x56,0x65,0x72,0x69,0x53,0x69,0x67, -0x6E,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x31,0x1F,0x30,0x1D,0x06,0x03,0x55,0x04,0x0B, -0x13,0x16,0x56,0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x20,0x54,0x72,0x75,0x73,0x74, -0x20,0x4E,0x65,0x74,0x77,0x6F,0x72,0x6B,0x31,0x3A,0x30,0x38,0x06,0x03,0x55,0x04, -0x0B,0x13,0x31,0x28,0x63,0x29,0x20,0x32,0x30,0x30,0x38,0x20,0x56,0x65,0x72,0x69, -0x53,0x69,0x67,0x6E,0x2C,0x20,0x49,0x6E,0x63,0x2E,0x20,0x2D,0x20,0x46,0x6F,0x72, -0x20,0x61,0x75,0x74,0x68,0x6F,0x72,0x69,0x7A,0x65,0x64,0x20,0x75,0x73,0x65,0x20, -0x6F,0x6E,0x6C,0x79,0x31,0x38,0x30,0x36,0x06,0x03,0x55,0x04,0x03,0x13,0x2F,0x56, -0x65,0x72,0x69,0x53,0x69,0x67,0x6E,0x20,0x55,0x6E,0x69,0x76,0x65,0x72,0x73,0x61, -0x6C,0x20,0x52,0x6F,0x6F,0x74,0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61, -0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x82, -0x01,0x22,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05, -0x00,0x03,0x82,0x01,0x0F,0x00,0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0xC7, -0x61,0x37,0x5E,0xB1,0x01,0x34,0xDB,0x62,0xD7,0x15,0x9B,0xFF,0x58,0x5A,0x8C,0x23, -0x23,0xD6,0x60,0x8E,0x91,0xD7,0x90,0x98,0x83,0x7A,0xE6,0x58,0x19,0x38,0x8C,0xC5, -0xF6,0xE5,0x64,0x85,0xB4,0xA2,0x71,0xFB,0xED,0xBD,0xB9,0xDA,0xCD,0x4D,0x00,0xB4, -0xC8,0x2D,0x73,0xA5,0xC7,0x69,0x71,0x95,0x1F,0x39,0x3C,0xB2,0x44,0x07,0x9C,0xE8, -0x0E,0xFA,0x4D,0x4A,0xC4,0x21,0xDF,0x29,0x61,0x8F,0x32,0x22,0x61,0x82,0xC5,0x87, -0x1F,0x6E,0x8C,0x7C,0x5F,0x16,0x20,0x51,0x44,0xD1,0x70,0x4F,0x57,0xEA,0xE3,0x1C, -0xE3,0xCC,0x79,0xEE,0x58,0xD8,0x0E,0xC2,0xB3,0x45,0x93,0xC0,0x2C,0xE7,0x9A,0x17, -0x2B,0x7B,0x00,0x37,0x7A,0x41,0x33,0x78,0xE1,0x33,0xE2,0xF3,0x10,0x1A,0x7F,0x87, -0x2C,0xBE,0xF6,0xF5,0xF7,0x42,0xE2,0xE5,0xBF,0x87,0x62,0x89,0x5F,0x00,0x4B,0xDF, -0xC5,0xDD,0xE4,0x75,0x44,0x32,0x41,0x3A,0x1E,0x71,0x6E,0x69,0xCB,0x0B,0x75,0x46, -0x08,0xD1,0xCA,0xD2,0x2B,0x95,0xD0,0xCF,0xFB,0xB9,0x40,0x6B,0x64,0x8C,0x57,0x4D, -0xFC,0x13,0x11,0x79,0x84,0xED,0x5E,0x54,0xF6,0x34,0x9F,0x08,0x01,0xF3,0x10,0x25, -0x06,0x17,0x4A,0xDA,0xF1,0x1D,0x7A,0x66,0x6B,0x98,0x60,0x66,0xA4,0xD9,0xEF,0xD2, -0x2E,0x82,0xF1,0xF0,0xEF,0x09,0xEA,0x44,0xC9,0x15,0x6A,0xE2,0x03,0x6E,0x33,0xD3, -0xAC,0x9F,0x55,0x00,0xC7,0xF6,0x08,0x6A,0x94,0xB9,0x5F,0xDC,0xE0,0x33,0xF1,0x84, -0x60,0xF9,0x5B,0x27,0x11,0xB4,0xFC,0x16,0xF2,0xBB,0x56,0x6A,0x80,0x25,0x8D,0x02, -0x03,0x01,0x00,0x01,0xA3,0x81,0xB2,0x30,0x81,0xAF,0x30,0x0F,0x06,0x03,0x55,0x1D, -0x13,0x01,0x01,0xFF,0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x0E,0x06,0x03,0x55, -0x1D,0x0F,0x01,0x01,0xFF,0x04,0x04,0x03,0x02,0x01,0x06,0x30,0x6D,0x06,0x08,0x2B, -0x06,0x01,0x05,0x05,0x07,0x01,0x0C,0x04,0x61,0x30,0x5F,0xA1,0x5D,0xA0,0x5B,0x30, -0x59,0x30,0x57,0x30,0x55,0x16,0x09,0x69,0x6D,0x61,0x67,0x65,0x2F,0x67,0x69,0x66, -0x30,0x21,0x30,0x1F,0x30,0x07,0x06,0x05,0x2B,0x0E,0x03,0x02,0x1A,0x04,0x14,0x8F, -0xE5,0xD3,0x1A,0x86,0xAC,0x8D,0x8E,0x6B,0xC3,0xCF,0x80,0x6A,0xD4,0x48,0x18,0x2C, -0x7B,0x19,0x2E,0x30,0x25,0x16,0x23,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F,0x6C,0x6F, -0x67,0x6F,0x2E,0x76,0x65,0x72,0x69,0x73,0x69,0x67,0x6E,0x2E,0x63,0x6F,0x6D,0x2F, -0x76,0x73,0x6C,0x6F,0x67,0x6F,0x2E,0x67,0x69,0x66,0x30,0x1D,0x06,0x03,0x55,0x1D, -0x0E,0x04,0x16,0x04,0x14,0xB6,0x77,0xFA,0x69,0x48,0x47,0x9F,0x53,0x12,0xD5,0xC2, -0xEA,0x07,0x32,0x76,0x07,0xD1,0x97,0x07,0x19,0x30,0x0D,0x06,0x09,0x2A,0x86,0x48, -0x86,0xF7,0x0D,0x01,0x01,0x0B,0x05,0x00,0x03,0x82,0x01,0x01,0x00,0x4A,0xF8,0xF8, -0xB0,0x03,0xE6,0x2C,0x67,0x7B,0xE4,0x94,0x77,0x63,0xCC,0x6E,0x4C,0xF9,0x7D,0x0E, -0x0D,0xDC,0xC8,0xB9,0x35,0xB9,0x70,0x4F,0x63,0xFA,0x24,0xFA,0x6C,0x83,0x8C,0x47, -0x9D,0x3B,0x63,0xF3,0x9A,0xF9,0x76,0x32,0x95,0x91,0xB1,0x77,0xBC,0xAC,0x9A,0xBE, -0xB1,0xE4,0x31,0x21,0xC6,0x81,0x95,0x56,0x5A,0x0E,0xB1,0xC2,0xD4,0xB1,0xA6,0x59, -0xAC,0xF1,0x63,0xCB,0xB8,0x4C,0x1D,0x59,0x90,0x4A,0xEF,0x90,0x16,0x28,0x1F,0x5A, -0xAE,0x10,0xFB,0x81,0x50,0x38,0x0C,0x6C,0xCC,0xF1,0x3D,0xC3,0xF5,0x63,0xE3,0xB3, -0xE3,0x21,0xC9,0x24,0x39,0xE9,0xFD,0x15,0x66,0x46,0xF4,0x1B,0x11,0xD0,0x4D,0x73, -0xA3,0x7D,0x46,0xF9,0x3D,0xED,0xA8,0x5F,0x62,0xD4,0xF1,0x3F,0xF8,0xE0,0x74,0x57, -0x2B,0x18,0x9D,0x81,0xB4,0xC4,0x28,0xDA,0x94,0x97,0xA5,0x70,0xEB,0xAC,0x1D,0xBE, -0x07,0x11,0xF0,0xD5,0xDB,0xDD,0xE5,0x8C,0xF0,0xD5,0x32,0xB0,0x83,0xE6,0x57,0xE2, -0x8F,0xBF,0xBE,0xA1,0xAA,0xBF,0x3D,0x1D,0xB5,0xD4,0x38,0xEA,0xD7,0xB0,0x5C,0x3A, -0x4F,0x6A,0x3F,0x8F,0xC0,0x66,0x6C,0x63,0xAA,0xE9,0xD9,0xA4,0x16,0xF4,0x81,0xD1, -0x95,0x14,0x0E,0x7D,0xCD,0x95,0x34,0xD9,0xD2,0x8F,0x70,0x73,0x81,0x7B,0x9C,0x7E, -0xBD,0x98,0x61,0xD8,0x45,0x87,0x98,0x90,0xC5,0xEB,0x86,0x30,0xC6,0x35,0xBF,0xF0, -0xFF,0xC3,0x55,0x88,0x83,0x4B,0xEF,0x05,0x92,0x06,0x71,0xF2,0xB8,0x98,0x93,0xB7, -0xEC,0xCD,0x82,0x61,0xF1,0x38,0xE6,0x4F,0x97,0x98,0x2A,0x5A,0x8D, -}; - - -/* subject:/C=US/OU=www.xrampsecurity.com/O=XRamp Security Services Inc/CN=XRamp Global Certification Authority */ -/* issuer :/C=US/OU=www.xrampsecurity.com/O=XRamp Security Services Inc/CN=XRamp Global Certification Authority */ - - -const unsigned char XRamp_Global_CA_Root_certificate[1076]={ -0x30,0x82,0x04,0x30,0x30,0x82,0x03,0x18,0xA0,0x03,0x02,0x01,0x02,0x02,0x10,0x50, -0x94,0x6C,0xEC,0x18,0xEA,0xD5,0x9C,0x4D,0xD5,0x97,0xEF,0x75,0x8F,0xA0,0xAD,0x30, -0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x30,0x81, -0x82,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13,0x02,0x55,0x53,0x31,0x1E, -0x30,0x1C,0x06,0x03,0x55,0x04,0x0B,0x13,0x15,0x77,0x77,0x77,0x2E,0x78,0x72,0x61, -0x6D,0x70,0x73,0x65,0x63,0x75,0x72,0x69,0x74,0x79,0x2E,0x63,0x6F,0x6D,0x31,0x24, -0x30,0x22,0x06,0x03,0x55,0x04,0x0A,0x13,0x1B,0x58,0x52,0x61,0x6D,0x70,0x20,0x53, -0x65,0x63,0x75,0x72,0x69,0x74,0x79,0x20,0x53,0x65,0x72,0x76,0x69,0x63,0x65,0x73, -0x20,0x49,0x6E,0x63,0x31,0x2D,0x30,0x2B,0x06,0x03,0x55,0x04,0x03,0x13,0x24,0x58, -0x52,0x61,0x6D,0x70,0x20,0x47,0x6C,0x6F,0x62,0x61,0x6C,0x20,0x43,0x65,0x72,0x74, -0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41,0x75,0x74,0x68,0x6F,0x72, -0x69,0x74,0x79,0x30,0x1E,0x17,0x0D,0x30,0x34,0x31,0x31,0x30,0x31,0x31,0x37,0x31, -0x34,0x30,0x34,0x5A,0x17,0x0D,0x33,0x35,0x30,0x31,0x30,0x31,0x30,0x35,0x33,0x37, -0x31,0x39,0x5A,0x30,0x81,0x82,0x31,0x0B,0x30,0x09,0x06,0x03,0x55,0x04,0x06,0x13, -0x02,0x55,0x53,0x31,0x1E,0x30,0x1C,0x06,0x03,0x55,0x04,0x0B,0x13,0x15,0x77,0x77, -0x77,0x2E,0x78,0x72,0x61,0x6D,0x70,0x73,0x65,0x63,0x75,0x72,0x69,0x74,0x79,0x2E, -0x63,0x6F,0x6D,0x31,0x24,0x30,0x22,0x06,0x03,0x55,0x04,0x0A,0x13,0x1B,0x58,0x52, -0x61,0x6D,0x70,0x20,0x53,0x65,0x63,0x75,0x72,0x69,0x74,0x79,0x20,0x53,0x65,0x72, -0x76,0x69,0x63,0x65,0x73,0x20,0x49,0x6E,0x63,0x31,0x2D,0x30,0x2B,0x06,0x03,0x55, -0x04,0x03,0x13,0x24,0x58,0x52,0x61,0x6D,0x70,0x20,0x47,0x6C,0x6F,0x62,0x61,0x6C, -0x20,0x43,0x65,0x72,0x74,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6F,0x6E,0x20,0x41, -0x75,0x74,0x68,0x6F,0x72,0x69,0x74,0x79,0x30,0x82,0x01,0x22,0x30,0x0D,0x06,0x09, -0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,0x05,0x00,0x03,0x82,0x01,0x0F,0x00, -0x30,0x82,0x01,0x0A,0x02,0x82,0x01,0x01,0x00,0x98,0x24,0x1E,0xBD,0x15,0xB4,0xBA, -0xDF,0xC7,0x8C,0xA5,0x27,0xB6,0x38,0x0B,0x69,0xF3,0xB6,0x4E,0xA8,0x2C,0x2E,0x21, -0x1D,0x5C,0x44,0xDF,0x21,0x5D,0x7E,0x23,0x74,0xFE,0x5E,0x7E,0xB4,0x4A,0xB7,0xA6, -0xAD,0x1F,0xAE,0xE0,0x06,0x16,0xE2,0x9B,0x5B,0xD9,0x67,0x74,0x6B,0x5D,0x80,0x8F, -0x29,0x9D,0x86,0x1B,0xD9,0x9C,0x0D,0x98,0x6D,0x76,0x10,0x28,0x58,0xE4,0x65,0xB0, -0x7F,0x4A,0x98,0x79,0x9F,0xE0,0xC3,0x31,0x7E,0x80,0x2B,0xB5,0x8C,0xC0,0x40,0x3B, -0x11,0x86,0xD0,0xCB,0xA2,0x86,0x36,0x60,0xA4,0xD5,0x30,0x82,0x6D,0xD9,0x6E,0xD0, -0x0F,0x12,0x04,0x33,0x97,0x5F,0x4F,0x61,0x5A,0xF0,0xE4,0xF9,0x91,0xAB,0xE7,0x1D, -0x3B,0xBC,0xE8,0xCF,0xF4,0x6B,0x2D,0x34,0x7C,0xE2,0x48,0x61,0x1C,0x8E,0xF3,0x61, -0x44,0xCC,0x6F,0xA0,0x4A,0xA9,0x94,0xB0,0x4D,0xDA,0xE7,0xA9,0x34,0x7A,0x72,0x38, -0xA8,0x41,0xCC,0x3C,0x94,0x11,0x7D,0xEB,0xC8,0xA6,0x8C,0xB7,0x86,0xCB,0xCA,0x33, -0x3B,0xD9,0x3D,0x37,0x8B,0xFB,0x7A,0x3E,0x86,0x2C,0xE7,0x73,0xD7,0x0A,0x57,0xAC, -0x64,0x9B,0x19,0xEB,0xF4,0x0F,0x04,0x08,0x8A,0xAC,0x03,0x17,0x19,0x64,0xF4,0x5A, -0x25,0x22,0x8D,0x34,0x2C,0xB2,0xF6,0x68,0x1D,0x12,0x6D,0xD3,0x8A,0x1E,0x14,0xDA, -0xC4,0x8F,0xA6,0xE2,0x23,0x85,0xD5,0x7A,0x0D,0xBD,0x6A,0xE0,0xE9,0xEC,0xEC,0x17, -0xBB,0x42,0x1B,0x67,0xAA,0x25,0xED,0x45,0x83,0x21,0xFC,0xC1,0xC9,0x7C,0xD5,0x62, -0x3E,0xFA,0xF2,0xC5,0x2D,0xD3,0xFD,0xD4,0x65,0x02,0x03,0x01,0x00,0x01,0xA3,0x81, -0x9F,0x30,0x81,0x9C,0x30,0x13,0x06,0x09,0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x14, -0x02,0x04,0x06,0x1E,0x04,0x00,0x43,0x00,0x41,0x30,0x0B,0x06,0x03,0x55,0x1D,0x0F, -0x04,0x04,0x03,0x02,0x01,0x86,0x30,0x0F,0x06,0x03,0x55,0x1D,0x13,0x01,0x01,0xFF, -0x04,0x05,0x30,0x03,0x01,0x01,0xFF,0x30,0x1D,0x06,0x03,0x55,0x1D,0x0E,0x04,0x16, -0x04,0x14,0xC6,0x4F,0xA2,0x3D,0x06,0x63,0x84,0x09,0x9C,0xCE,0x62,0xE4,0x04,0xAC, -0x8D,0x5C,0xB5,0xE9,0xB6,0x1B,0x30,0x36,0x06,0x03,0x55,0x1D,0x1F,0x04,0x2F,0x30, -0x2D,0x30,0x2B,0xA0,0x29,0xA0,0x27,0x86,0x25,0x68,0x74,0x74,0x70,0x3A,0x2F,0x2F, -0x63,0x72,0x6C,0x2E,0x78,0x72,0x61,0x6D,0x70,0x73,0x65,0x63,0x75,0x72,0x69,0x74, -0x79,0x2E,0x63,0x6F,0x6D,0x2F,0x58,0x47,0x43,0x41,0x2E,0x63,0x72,0x6C,0x30,0x10, -0x06,0x09,0x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x15,0x01,0x04,0x03,0x02,0x01,0x01, -0x30,0x0D,0x06,0x09,0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,0x05,0x00,0x03, -0x82,0x01,0x01,0x00,0x91,0x15,0x39,0x03,0x01,0x1B,0x67,0xFB,0x4A,0x1C,0xF9,0x0A, -0x60,0x5B,0xA1,0xDA,0x4D,0x97,0x62,0xF9,0x24,0x53,0x27,0xD7,0x82,0x64,0x4E,0x90, -0x2E,0xC3,0x49,0x1B,0x2B,0x9A,0xDC,0xFC,0xA8,0x78,0x67,0x35,0xF1,0x1D,0xF0,0x11, -0xBD,0xB7,0x48,0xE3,0x10,0xF6,0x0D,0xDF,0x3F,0xD2,0xC9,0xB6,0xAA,0x55,0xA4,0x48, -0xBA,0x02,0xDB,0xDE,0x59,0x2E,0x15,0x5B,0x3B,0x9D,0x16,0x7D,0x47,0xD7,0x37,0xEA, -0x5F,0x4D,0x76,0x12,0x36,0xBB,0x1F,0xD7,0xA1,0x81,0x04,0x46,0x20,0xA3,0x2C,0x6D, -0xA9,0x9E,0x01,0x7E,0x3F,0x29,0xCE,0x00,0x93,0xDF,0xFD,0xC9,0x92,0x73,0x89,0x89, -0x64,0x9E,0xE7,0x2B,0xE4,0x1C,0x91,0x2C,0xD2,0xB9,0xCE,0x7D,0xCE,0x6F,0x31,0x99, -0xD3,0xE6,0xBE,0xD2,0x1E,0x90,0xF0,0x09,0x14,0x79,0x5C,0x23,0xAB,0x4D,0xD2,0xDA, -0x21,0x1F,0x4D,0x99,0x79,0x9D,0xE1,0xCF,0x27,0x9F,0x10,0x9B,0x1C,0x88,0x0D,0xB0, -0x8A,0x64,0x41,0x31,0xB8,0x0E,0x6C,0x90,0x24,0xA4,0x9B,0x5C,0x71,0x8F,0xBA,0xBB, -0x7E,0x1C,0x1B,0xDB,0x6A,0x80,0x0F,0x21,0xBC,0xE9,0xDB,0xA6,0xB7,0x40,0xF4,0xB2, -0x8B,0xA9,0xB1,0xE4,0xEF,0x9A,0x1A,0xD0,0x3D,0x69,0x99,0xEE,0xA8,0x28,0xA3,0xE1, -0x3C,0xB3,0xF0,0xB2,0x11,0x9C,0xCF,0x7C,0x40,0xE6,0xDD,0xE7,0x43,0x7D,0xA2,0xD8, -0x3A,0xB5,0xA9,0x8D,0xF2,0x34,0x99,0xC4,0xD4,0x10,0xE1,0x06,0xFD,0x09,0x84,0x10, -0x3B,0xEE,0xC4,0x4C,0xF4,0xEC,0x27,0x7C,0x42,0xC2,0x74,0x7C,0x82,0x8A,0x09,0xC9, -0xB4,0x03,0x25,0xBC, -}; - - -const unsigned char* kSSLCertCertificateList[] = { - AddTrust_External_Root_certificate, - AddTrust_Low_Value_Services_Root_certificate, - AddTrust_Public_Services_Root_certificate, - AddTrust_Qualified_Certificates_Root_certificate, - AffirmTrust_Commercial_certificate, - AffirmTrust_Networking_certificate, - AffirmTrust_Premium_certificate, - AffirmTrust_Premium_ECC_certificate, - America_Online_Root_Certification_Authority_1_certificate, - America_Online_Root_Certification_Authority_2_certificate, - Baltimore_CyberTrust_Root_certificate, - Comodo_AAA_Services_root_certificate, - COMODO_Certification_Authority_certificate, - COMODO_ECC_Certification_Authority_certificate, - Comodo_Secure_Services_root_certificate, - Comodo_Trusted_Services_root_certificate, - Cybertrust_Global_Root_certificate, - DigiCert_Assured_ID_Root_CA_certificate, - DigiCert_Global_Root_CA_certificate, - DigiCert_High_Assurance_EV_Root_CA_certificate, - Entrust_net_Premium_2048_Secure_Server_CA_certificate, - Entrust_net_Secure_Server_CA_certificate, - Entrust_Root_Certification_Authority_certificate, - Equifax_Secure_CA_certificate, - Equifax_Secure_eBusiness_CA_1_certificate, - Equifax_Secure_eBusiness_CA_2_certificate, - Equifax_Secure_Global_eBusiness_CA_certificate, - GeoTrust_Global_CA_certificate, - GeoTrust_Global_CA_2_certificate, - GeoTrust_Primary_Certification_Authority_certificate, - GeoTrust_Primary_Certification_Authority___G2_certificate, - GeoTrust_Primary_Certification_Authority___G3_certificate, - GeoTrust_Universal_CA_certificate, - GeoTrust_Universal_CA_2_certificate, - GlobalSign_Root_CA_certificate, - GlobalSign_Root_CA___R2_certificate, - GlobalSign_Root_CA___R3_certificate, - Go_Daddy_Class_2_CA_certificate, - Go_Daddy_Root_Certificate_Authority___G2_certificate, - GTE_CyberTrust_Global_Root_certificate, - Network_Solutions_Certificate_Authority_certificate, - RSA_Root_Certificate_1_certificate, - Starfield_Class_2_CA_certificate, - Starfield_Root_Certificate_Authority___G2_certificate, - Starfield_Services_Root_Certificate_Authority___G2_certificate, - StartCom_Certification_Authority_certificate, - StartCom_Certification_Authority_G2_certificate, - TC_TrustCenter_Class_2_CA_II_certificate, - TC_TrustCenter_Class_3_CA_II_certificate, - TC_TrustCenter_Universal_CA_I_certificate, - TC_TrustCenter_Universal_CA_III_certificate, - Thawte_Premium_Server_CA_certificate, - thawte_Primary_Root_CA_certificate, - thawte_Primary_Root_CA___G2_certificate, - thawte_Primary_Root_CA___G3_certificate, - Thawte_Server_CA_certificate, - UTN_DATACorp_SGC_Root_CA_certificate, - UTN_USERFirst_Hardware_Root_CA_certificate, - ValiCert_Class_1_VA_certificate, - ValiCert_Class_2_VA_certificate, - Verisign_Class_3_Public_Primary_Certification_Authority_certificate, - Verisign_Class_3_Public_Primary_Certification_Authority___G2_certificate, - Verisign_Class_3_Public_Primary_Certification_Authority___G3_certificate, - VeriSign_Class_3_Public_Primary_Certification_Authority___G4_certificate, - VeriSign_Class_3_Public_Primary_Certification_Authority___G5_certificate, - Verisign_Class_4_Public_Primary_Certification_Authority___G3_certificate, - VeriSign_Universal_Root_Certification_Authority_certificate, - XRamp_Global_CA_Root_certificate, -}; - -const size_t kSSLCertCertificateSizeList[] = { - 1082, - 1052, - 1049, - 1058, - 848, - 848, - 1354, - 514, - 936, - 1448, - 891, - 1078, - 1057, - 653, - 1091, - 1095, - 933, - 955, - 947, - 969, - 1120, - 1244, - 1173, - 804, - 646, - 804, - 660, - 856, - 874, - 896, - 690, - 1026, - 1388, - 1392, - 889, - 958, - 867, - 1028, - 969, - 606, - 1002, - 747, - 1043, - 993, - 1011, - 1931, - 1383, - 1198, - 1198, - 993, - 997, - 811, - 1060, - 652, - 1070, - 791, - 1122, - 1144, - 747, - 747, - 576, - 774, - 1054, - 904, - 1239, - 1054, - 1213, - 1076, -}; - diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/sslsocketfactory.h b/thirdparties/common/include/webrtc-sdk/talk/base/sslsocketfactory.h deleted file mode 100755 index e6ec318..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/sslsocketfactory.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * libjingle - * Copyright 2007, 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_BASE_SSLSOCKETFACTORY_H__ -#define TALK_BASE_SSLSOCKETFACTORY_H__ - -#include "talk/base/proxyinfo.h" -#include "talk/base/socketserver.h" - -namespace talk_base { - -/////////////////////////////////////////////////////////////////////////////// -// SslSocketFactory -/////////////////////////////////////////////////////////////////////////////// - -class SslSocketFactory : public SocketFactory { - public: - SslSocketFactory(SocketFactory* factory, const std::string& user_agent) - : factory_(factory), agent_(user_agent), autodetect_proxy_(true), - force_connect_(false), logging_level_(LS_VERBOSE), binary_mode_(false), - ignore_bad_cert_(false) { - } - - void SetAutoDetectProxy() { - autodetect_proxy_ = true; - } - void SetForceConnect(bool force) { - force_connect_ = force; - } - void SetProxy(const ProxyInfo& proxy) { - autodetect_proxy_ = false; - proxy_ = proxy; - } - bool autodetect_proxy() const { return autodetect_proxy_; } - const ProxyInfo& proxy() const { return proxy_; } - - void UseSSL(const char* hostname) { hostname_ = hostname; } - void DisableSSL() { hostname_.clear(); } - void SetIgnoreBadCert(bool ignore) { ignore_bad_cert_ = ignore; } - bool ignore_bad_cert() const { return ignore_bad_cert_; } - - void SetLogging(LoggingSeverity level, const std::string& label, - bool binary_mode = false) { - logging_level_ = level; - logging_label_ = label; - binary_mode_ = binary_mode; - } - - // SocketFactory Interface - virtual Socket* CreateSocket(int type); - virtual Socket* CreateSocket(int family, int type); - - virtual AsyncSocket* CreateAsyncSocket(int type); - virtual AsyncSocket* CreateAsyncSocket(int family, int type); - - private: - friend class ProxySocketAdapter; - AsyncSocket* CreateProxySocket(const ProxyInfo& proxy, int family, int type); - - SocketFactory* factory_; - std::string agent_; - bool autodetect_proxy_, force_connect_; - ProxyInfo proxy_; - std::string hostname_, logging_label_; - LoggingSeverity logging_level_; - bool binary_mode_; - bool ignore_bad_cert_; -}; - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace talk_base - -#endif // TALK_BASE_SSLSOCKETFACTORY_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/sslstreamadapter.h b/thirdparties/common/include/webrtc-sdk/talk/base/sslstreamadapter.h deleted file mode 100755 index 856eeb0..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/sslstreamadapter.h +++ /dev/null @@ -1,179 +0,0 @@ -/* - * libjingle - * Copyright 2004--2008, 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_BASE_SSLSTREAMADAPTER_H_ -#define TALK_BASE_SSLSTREAMADAPTER_H_ - -#include -#include - -#include "talk/base/stream.h" -#include "talk/base/sslidentity.h" - -namespace talk_base { - -// SSLStreamAdapter : A StreamInterfaceAdapter that does SSL/TLS. -// After SSL has been started, the stream will only open on successful -// SSL verification of certificates, and the communication is -// encrypted of course. -// -// This class was written with SSLAdapter as a starting point. It -// offers a similar interface, with two differences: there is no -// support for a restartable SSL connection, and this class has a -// peer-to-peer mode. -// -// The SSL library requires initialization and cleanup. Static method -// for doing this are in SSLAdapter. They should possibly be moved out -// to a neutral class. - - -enum SSLRole { SSL_CLIENT, SSL_SERVER }; -enum SSLMode { SSL_MODE_TLS, SSL_MODE_DTLS }; - -// Errors for Read -- in the high range so no conflict with OpenSSL. -enum { SSE_MSG_TRUNC = 0xff0001 }; - -class SSLStreamAdapter : public StreamAdapterInterface { - public: - // Instantiate an SSLStreamAdapter wrapping the given stream, - // (using the selected implementation for the platform). - // Caller is responsible for freeing the returned object. - static SSLStreamAdapter* Create(StreamInterface* stream); - - explicit SSLStreamAdapter(StreamInterface* stream) - : StreamAdapterInterface(stream), ignore_bad_cert_(false) { } - - void set_ignore_bad_cert(bool ignore) { ignore_bad_cert_ = ignore; } - bool ignore_bad_cert() const { return ignore_bad_cert_; } - - // Specify our SSL identity: key and certificate. Mostly this is - // only used in the peer-to-peer mode (unless we actually want to - // provide a client certificate to a server). - // SSLStream takes ownership of the SSLIdentity object and will - // free it when appropriate. Should be called no more than once on a - // given SSLStream instance. - virtual void SetIdentity(SSLIdentity* identity) = 0; - - // Call this to indicate that we are to play the server's role in - // the peer-to-peer mode. - // The default argument is for backward compatibility - // TODO(ekr@rtfm.com): rename this SetRole to reflect its new function - virtual void SetServerRole(SSLRole role = SSL_SERVER) = 0; - - // Do DTLS or TLS - virtual void SetMode(SSLMode mode) = 0; - - // The mode of operation is selected by calling either - // StartSSLWithServer or StartSSLWithPeer. - // Use of the stream prior to calling either of these functions will - // pass data in clear text. - // Calling one of these functions causes SSL negotiation to begin as - // soon as possible: right away if the underlying wrapped stream is - // already opened, or else as soon as it opens. - // - // These functions return a negative error code on failure. - // Returning 0 means success so far, but negotiation is probably not - // complete and will continue asynchronously. In that case, the - // exposed stream will open after successful negotiation and - // verification, or an SE_CLOSE event will be raised if negotiation - // fails. - - // StartSSLWithServer starts SSL negotiation with a server in - // traditional mode. server_name specifies the expected server name - // which the server's certificate needs to specify. - virtual int StartSSLWithServer(const char* server_name) = 0; - - // StartSSLWithPeer starts negotiation in the special peer-to-peer - // mode. - // Generally, SetIdentity() and possibly SetServerRole() should have - // been called before this. - // SetPeerCertificate() or SetPeerCertificateDigest() must also be called. - // It may be called after StartSSLWithPeer() but must be called before the - // underlying stream opens. - virtual int StartSSLWithPeer() = 0; - - // Specify the digest of the certificate that our peer is expected to use in - // peer-to-peer mode. Only this certificate will be accepted during - // SSL verification. The certificate is assumed to have been - // obtained through some other secure channel (such as the XMPP - // channel). Unlike SetPeerCertificate(), this must specify the - // terminal certificate, not just a CA. - // SSLStream makes a copy of the digest value. - virtual bool SetPeerCertificateDigest(const std::string& digest_alg, - const unsigned char* digest_val, - size_t digest_len) = 0; - - // Retrieves the peer's X.509 certificate, if a connection has been - // established. It returns the transmitted over SSL, including the entire - // chain. The returned certificate is owned by the caller. - virtual bool GetPeerCertificate(SSLCertificate** cert) const = 0; - - // Key Exporter interface from RFC 5705 - // Arguments are: - // label -- the exporter label. - // part of the RFC defining each exporter - // usage (IN) - // context/context_len -- a context to bind to for this connection; - // optional, can be NULL, 0 (IN) - // use_context -- whether to use the context value - // (needed to distinguish no context from - // zero-length ones). - // result -- where to put the computed value - // result_len -- the length of the computed value - virtual bool ExportKeyingMaterial(const std::string& label, - const uint8* context, - size_t context_len, - bool use_context, - uint8* result, - size_t result_len) { - return false; // Default is unsupported - } - - - // DTLS-SRTP interface - virtual bool SetDtlsSrtpCiphers(const std::vector& ciphers) { - return false; - } - - virtual bool GetDtlsSrtpCipher(std::string* cipher) { - return false; - } - - // Capabilities testing - static bool HaveDtls(); - static bool HaveDtlsSrtp(); - static bool HaveExporter(); - - // If true, the server certificate need not match the configured - // server_name, and in fact missing certificate authority and other - // verification errors are ignored. - bool ignore_bad_cert_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_SSLSTREAMADAPTER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/sslstreamadapterhelper.h b/thirdparties/common/include/webrtc-sdk/talk/base/sslstreamadapterhelper.h deleted file mode 100755 index ad4e870..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/sslstreamadapterhelper.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - * libjingle - * Copyright 2004--2008, 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_BASE_SSLSTREAMADAPTERHELPER_H_ -#define TALK_BASE_SSLSTREAMADAPTERHELPER_H_ - -#include -#include - -#include "talk/base/buffer.h" -#include "talk/base/stream.h" -#include "talk/base/sslidentity.h" -#include "talk/base/sslstreamadapter.h" - -namespace talk_base { - -// SSLStreamAdapterHelper : A stream adapter which implements much -// of the logic that is common between the known implementations -// (NSS and OpenSSL) -class SSLStreamAdapterHelper : public SSLStreamAdapter { - public: - explicit SSLStreamAdapterHelper(StreamInterface* stream) - : SSLStreamAdapter(stream), - state_(SSL_NONE), - role_(SSL_CLIENT), - ssl_error_code_(0), // Not meaningful yet - ssl_mode_(SSL_MODE_TLS) {} - - - // Overrides of SSLStreamAdapter - virtual void SetIdentity(SSLIdentity* identity); - virtual void SetServerRole(SSLRole role = SSL_SERVER); - virtual void SetMode(SSLMode mode); - - virtual int StartSSLWithServer(const char* server_name); - virtual int StartSSLWithPeer(); - - virtual bool SetPeerCertificateDigest(const std::string& digest_alg, - const unsigned char* digest_val, - size_t digest_len); - virtual bool GetPeerCertificate(SSLCertificate** cert) const; - virtual StreamState GetState() const; - virtual void Close(); - - protected: - // Internal helper methods - // The following method returns 0 on success and a negative - // error code on failure. The error code may be either -1 or - // from the impl on some other error cases, so it can't really be - // interpreted unfortunately. - - // Perform SSL negotiation steps. - int ContinueSSL(); - - // Error handler helper. signal is given as true for errors in - // asynchronous contexts (when an error code was not returned - // through some other method), and in that case an SE_CLOSE event is - // raised on the stream with the specified error. - // A 0 error means a graceful close, otherwise there is not really enough - // context to interpret the error code. - virtual void Error(const char* context, int err, bool signal); - - // Must be implemented by descendents - virtual int BeginSSL() = 0; - virtual void Cleanup() = 0; - virtual bool GetDigestLength(const std::string& algorithm, - size_t* length) = 0; - - enum SSLState { - // Before calling one of the StartSSL methods, data flows - // in clear text. - SSL_NONE, - SSL_WAIT, // waiting for the stream to open to start SSL negotiation - SSL_CONNECTING, // SSL negotiation in progress - SSL_CONNECTED, // SSL stream successfully established - SSL_ERROR, // some SSL error occurred, stream is closed - SSL_CLOSED // Clean close - }; - - // MSG_MAX is the maximum generic stream message number. - enum { MSG_DTLS_TIMEOUT = MSG_MAX + 1 }; - - SSLState state_; - SSLRole role_; - int ssl_error_code_; // valid when state_ == SSL_ERROR - - // Our key and certificate, mostly useful in peer-to-peer mode. - scoped_ptr identity_; - // in traditional mode, the server name that the server's certificate - // must specify. Empty in peer-to-peer mode. - std::string ssl_server_name_; - // The peer's certificate. Only used for GetPeerCertificate. - scoped_ptr peer_certificate_; - - // The digest of the certificate that the peer must present. - Buffer peer_certificate_digest_value_; - std::string peer_certificate_digest_algorithm_; - - // Do DTLS or not - SSLMode ssl_mode_; - - private: - // Go from state SSL_NONE to either SSL_CONNECTING or SSL_WAIT, - // depending on whether the underlying stream is already open or - // not. Returns 0 on success and a negative value on error. - int StartSSL(); -}; - -} // namespace talk_base - -#endif // TALK_BASE_SSLSTREAMADAPTERHELPER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/stream.h b/thirdparties/common/include/webrtc-sdk/talk/base/stream.h deleted file mode 100755 index 35935b8..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/stream.h +++ /dev/null @@ -1,837 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_BASE_STREAM_H_ -#define TALK_BASE_STREAM_H_ - -#include - -#include "talk/base/basictypes.h" -#include "talk/base/buffer.h" -#include "talk/base/criticalsection.h" -#include "talk/base/logging.h" -#include "talk/base/messagehandler.h" -#include "talk/base/messagequeue.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/sigslot.h" - -namespace talk_base { - -/////////////////////////////////////////////////////////////////////////////// -// StreamInterface is a generic asynchronous stream interface, supporting read, -// write, and close operations, and asynchronous signalling of state changes. -// The interface is designed with file, memory, and socket implementations in -// mind. Some implementations offer extended operations, such as seeking. -/////////////////////////////////////////////////////////////////////////////// - -// The following enumerations are declared outside of the StreamInterface -// class for brevity in use. - -// The SS_OPENING state indicates that the stream will signal open or closed -// in the future. -enum StreamState { SS_CLOSED, SS_OPENING, SS_OPEN }; - -// Stream read/write methods return this value to indicate various success -// and failure conditions described below. -enum StreamResult { SR_ERROR, SR_SUCCESS, SR_BLOCK, SR_EOS }; - -// StreamEvents are used to asynchronously signal state transitionss. The flags -// may be combined. -// SE_OPEN: The stream has transitioned to the SS_OPEN state -// SE_CLOSE: The stream has transitioned to the SS_CLOSED state -// SE_READ: Data is available, so Read is likely to not return SR_BLOCK -// SE_WRITE: Data can be written, so Write is likely to not return SR_BLOCK -enum StreamEvent { SE_OPEN = 1, SE_READ = 2, SE_WRITE = 4, SE_CLOSE = 8 }; - -class Thread; - -struct StreamEventData : public MessageData { - int events, error; - StreamEventData(int ev, int er) : events(ev), error(er) { } -}; - -class StreamInterface : public MessageHandler { - public: - enum { - MSG_POST_EVENT = 0xF1F1, MSG_MAX = MSG_POST_EVENT - }; - - virtual ~StreamInterface(); - - virtual StreamState GetState() const = 0; - - // Read attempts to fill buffer of size buffer_len. Write attempts to send - // data_len bytes stored in data. The variables read and write are set only - // on SR_SUCCESS (see below). Likewise, error is only set on SR_ERROR. - // Read and Write return a value indicating: - // SR_ERROR: an error occurred, which is returned in a non-null error - // argument. Interpretation of the error requires knowledge of the - // stream's concrete type, which limits its usefulness. - // SR_SUCCESS: some number of bytes were successfully written, which is - // returned in a non-null read/write argument. - // SR_BLOCK: the stream is in non-blocking mode, and the operation would - // block, or the stream is in SS_OPENING state. - // SR_EOS: the end-of-stream has been reached, or the stream is in the - // SS_CLOSED state. - virtual StreamResult Read(void* buffer, size_t buffer_len, - size_t* read, int* error) = 0; - virtual StreamResult Write(const void* data, size_t data_len, - size_t* written, int* error) = 0; - // Attempt to transition to the SS_CLOSED state. SE_CLOSE will not be - // signalled as a result of this call. - virtual void Close() = 0; - - // Streams may signal one or more StreamEvents to indicate state changes. - // The first argument identifies the stream on which the state change occured. - // The second argument is a bit-wise combination of StreamEvents. - // If SE_CLOSE is signalled, then the third argument is the associated error - // code. Otherwise, the value is undefined. - // Note: Not all streams will support asynchronous event signalling. However, - // SS_OPENING and SR_BLOCK returned from stream member functions imply that - // certain events will be raised in the future. - sigslot::signal3 SignalEvent; - - // Like calling SignalEvent, but posts a message to the specified thread, - // which will call SignalEvent. This helps unroll the stack and prevent - // re-entrancy. - void PostEvent(Thread* t, int events, int err); - // Like the aforementioned method, but posts to the current thread. - void PostEvent(int events, int err); - - // - // OPTIONAL OPERATIONS - // - // Not all implementations will support the following operations. In general, - // a stream will only support an operation if it reasonably efficient to do - // so. For example, while a socket could buffer incoming data to support - // seeking, it will not do so. Instead, a buffering stream adapter should - // be used. - // - // Even though several of these operations are related, you should - // always use whichever operation is most relevant. For example, you may - // be tempted to use GetSize() and GetPosition() to deduce the result of - // GetAvailable(). However, a stream which is read-once may support the - // latter operation but not the former. - // - - // The following four methods are used to avoid copying data multiple times. - - // GetReadData returns a pointer to a buffer which is owned by the stream. - // The buffer contains data_len bytes. NULL is returned if no data is - // available, or if the method fails. If the caller processes the data, it - // must call ConsumeReadData with the number of processed bytes. GetReadData - // does not require a matching call to ConsumeReadData if the data is not - // processed. Read and ConsumeReadData invalidate the buffer returned by - // GetReadData. - virtual const void* GetReadData(size_t* data_len) { return NULL; } - virtual void ConsumeReadData(size_t used) {} - - // GetWriteBuffer returns a pointer to a buffer which is owned by the stream. - // The buffer has a capacity of buf_len bytes. NULL is returned if there is - // no buffer available, or if the method fails. The call may write data to - // the buffer, and then call ConsumeWriteBuffer with the number of bytes - // written. GetWriteBuffer does not require a matching call to - // ConsumeWriteData if no data is written. Write, ForceWrite, and - // ConsumeWriteData invalidate the buffer returned by GetWriteBuffer. - // TODO: Allow the caller to specify a minimum buffer size. If the specified - // amount of buffer is not yet available, return NULL and Signal SE_WRITE - // when it is available. If the requested amount is too large, return an - // error. - virtual void* GetWriteBuffer(size_t* buf_len) { return NULL; } - virtual void ConsumeWriteBuffer(size_t used) {} - - // Write data_len bytes found in data, circumventing any throttling which - // would could cause SR_BLOCK to be returned. Returns true if all the data - // was written. Otherwise, the method is unsupported, or an unrecoverable - // error occurred, and the error value is set. This method should be used - // sparingly to write critical data which should not be throttled. A stream - // which cannot circumvent its blocking constraints should not implement this - // method. - // NOTE: This interface is being considered experimentally at the moment. It - // would be used by JUDP and BandwidthStream as a way to circumvent certain - // soft limits in writing. - //virtual bool ForceWrite(const void* data, size_t data_len, int* error) { - // if (error) *error = -1; - // return false; - //} - - // Seek to a byte offset from the beginning of the stream. Returns false if - // the stream does not support seeking, or cannot seek to the specified - // position. - virtual bool SetPosition(size_t position) { return false; } - - // Get the byte offset of the current position from the start of the stream. - // Returns false if the position is not known. - virtual bool GetPosition(size_t* position) const { return false; } - - // Get the byte length of the entire stream. Returns false if the length - // is not known. - virtual bool GetSize(size_t* size) const { return false; } - - // Return the number of Read()-able bytes remaining before end-of-stream. - // Returns false if not known. - virtual bool GetAvailable(size_t* size) const { return false; } - - // Return the number of Write()-able bytes remaining before end-of-stream. - // Returns false if not known. - virtual bool GetWriteRemaining(size_t* size) const { return false; } - - // Return true if flush is successful. - virtual bool Flush() { return false; } - - // Communicates the amount of data which will be written to the stream. The - // stream may choose to preallocate memory to accomodate this data. The - // stream may return false to indicate that there is not enough room (ie, - // Write will return SR_EOS/SR_ERROR at some point). Note that calling this - // function should not affect the existing state of data in the stream. - virtual bool ReserveSize(size_t size) { return true; } - - // - // CONVENIENCE METHODS - // - // These methods are implemented in terms of other methods, for convenience. - // - - // Seek to the start of the stream. - inline bool Rewind() { return SetPosition(0); } - - // WriteAll is a helper function which repeatedly calls Write until all the - // data is written, or something other than SR_SUCCESS is returned. Note that - // unlike Write, the argument 'written' is always set, and may be non-zero - // on results other than SR_SUCCESS. The remaining arguments have the - // same semantics as Write. - StreamResult WriteAll(const void* data, size_t data_len, - size_t* written, int* error); - - // Similar to ReadAll. Calls Read until buffer_len bytes have been read, or - // until a non-SR_SUCCESS result is returned. 'read' is always set. - StreamResult ReadAll(void* buffer, size_t buffer_len, - size_t* read, int* error); - - // ReadLine is a helper function which repeatedly calls Read until it hits - // the end-of-line character, or something other than SR_SUCCESS. - // TODO: this is too inefficient to keep here. Break this out into a buffered - // readline object or adapter - StreamResult ReadLine(std::string* line); - - protected: - StreamInterface(); - - // MessageHandler Interface - virtual void OnMessage(Message* msg); - - private: - DISALLOW_EVIL_CONSTRUCTORS(StreamInterface); -}; - -/////////////////////////////////////////////////////////////////////////////// -// StreamAdapterInterface is a convenient base-class for adapting a stream. -// By default, all operations are pass-through. Override the methods that you -// require adaptation. Streams should really be upgraded to reference-counted. -// In the meantime, use the owned flag to indicate whether the adapter should -// own the adapted stream. -/////////////////////////////////////////////////////////////////////////////// - -class StreamAdapterInterface : public StreamInterface, - public sigslot::has_slots<> { - public: - explicit StreamAdapterInterface(StreamInterface* stream, bool owned = true); - - // Core Stream Interface - virtual StreamState GetState() const { - return stream_->GetState(); - } - virtual StreamResult Read(void* buffer, size_t buffer_len, - size_t* read, int* error) { - return stream_->Read(buffer, buffer_len, read, error); - } - virtual StreamResult Write(const void* data, size_t data_len, - size_t* written, int* error) { - return stream_->Write(data, data_len, written, error); - } - virtual void Close() { - stream_->Close(); - } - - // Optional Stream Interface - /* Note: Many stream adapters were implemented prior to this Read/Write - interface. Therefore, a simple pass through of data in those cases may - be broken. At a later time, we should do a once-over pass of all - adapters, and make them compliant with these interfaces, after which this - code can be uncommented. - virtual const void* GetReadData(size_t* data_len) { - return stream_->GetReadData(data_len); - } - virtual void ConsumeReadData(size_t used) { - stream_->ConsumeReadData(used); - } - - virtual void* GetWriteBuffer(size_t* buf_len) { - return stream_->GetWriteBuffer(buf_len); - } - virtual void ConsumeWriteBuffer(size_t used) { - stream_->ConsumeWriteBuffer(used); - } - */ - - /* Note: This interface is currently undergoing evaluation. - virtual bool ForceWrite(const void* data, size_t data_len, int* error) { - return stream_->ForceWrite(data, data_len, error); - } - */ - - virtual bool SetPosition(size_t position) { - return stream_->SetPosition(position); - } - virtual bool GetPosition(size_t* position) const { - return stream_->GetPosition(position); - } - virtual bool GetSize(size_t* size) const { - return stream_->GetSize(size); - } - virtual bool GetAvailable(size_t* size) const { - return stream_->GetAvailable(size); - } - virtual bool GetWriteRemaining(size_t* size) const { - return stream_->GetWriteRemaining(size); - } - virtual bool ReserveSize(size_t size) { - return stream_->ReserveSize(size); - } - virtual bool Flush() { - return stream_->Flush(); - } - - void Attach(StreamInterface* stream, bool owned = true); - StreamInterface* Detach(); - - protected: - virtual ~StreamAdapterInterface(); - - // Note that the adapter presents itself as the origin of the stream events, - // since users of the adapter may not recognize the adapted object. - virtual void OnEvent(StreamInterface* stream, int events, int err) { - SignalEvent(this, events, err); - } - StreamInterface* stream() { return stream_; } - - private: - StreamInterface* stream_; - bool owned_; - DISALLOW_EVIL_CONSTRUCTORS(StreamAdapterInterface); -}; - -/////////////////////////////////////////////////////////////////////////////// -// StreamTap is a non-modifying, pass-through adapter, which copies all data -// in either direction to the tap. Note that errors or blocking on writing to -// the tap will prevent further tap writes from occurring. -/////////////////////////////////////////////////////////////////////////////// - -class StreamTap : public StreamAdapterInterface { - public: - explicit StreamTap(StreamInterface* stream, StreamInterface* tap); - - void AttachTap(StreamInterface* tap); - StreamInterface* DetachTap(); - StreamResult GetTapResult(int* error); - - // StreamAdapterInterface Interface - virtual StreamResult Read(void* buffer, size_t buffer_len, - size_t* read, int* error); - virtual StreamResult Write(const void* data, size_t data_len, - size_t* written, int* error); - - private: - scoped_ptr tap_; - StreamResult tap_result_; - int tap_error_; - DISALLOW_EVIL_CONSTRUCTORS(StreamTap); -}; - -/////////////////////////////////////////////////////////////////////////////// -// StreamSegment adapts a read stream, to expose a subset of the adapted -// stream's data. This is useful for cases where a stream contains multiple -// documents concatenated together. StreamSegment can expose a subset of -// the data as an independent stream, including support for rewinding and -// seeking. -/////////////////////////////////////////////////////////////////////////////// - -class StreamSegment : public StreamAdapterInterface { - public: - // The current position of the adapted stream becomes the beginning of the - // segment. If a length is specified, it bounds the length of the segment. - explicit StreamSegment(StreamInterface* stream); - explicit StreamSegment(StreamInterface* stream, size_t length); - - // StreamAdapterInterface Interface - virtual StreamResult Read(void* buffer, size_t buffer_len, - size_t* read, int* error); - virtual bool SetPosition(size_t position); - virtual bool GetPosition(size_t* position) const; - virtual bool GetSize(size_t* size) const; - virtual bool GetAvailable(size_t* size) const; - - private: - size_t start_, pos_, length_; - DISALLOW_EVIL_CONSTRUCTORS(StreamSegment); -}; - -/////////////////////////////////////////////////////////////////////////////// -// NullStream gives errors on read, and silently discards all written data. -/////////////////////////////////////////////////////////////////////////////// - -class NullStream : public StreamInterface { - public: - NullStream(); - virtual ~NullStream(); - - // StreamInterface Interface - virtual StreamState GetState() const; - virtual StreamResult Read(void* buffer, size_t buffer_len, - size_t* read, int* error); - virtual StreamResult Write(const void* data, size_t data_len, - size_t* written, int* error); - virtual void Close(); -}; - -/////////////////////////////////////////////////////////////////////////////// -// FileStream is a simple implementation of a StreamInterface, which does not -// support asynchronous notification. -/////////////////////////////////////////////////////////////////////////////// - -class FileStream : public StreamInterface { - public: - FileStream(); - virtual ~FileStream(); - - // The semantics of filename and mode are the same as stdio's fopen - virtual bool Open(const std::string& filename, const char* mode, int* error); - virtual bool OpenShare(const std::string& filename, const char* mode, - int shflag, int* error); - - // By default, reads and writes are buffered for efficiency. Disabling - // buffering causes writes to block until the bytes on disk are updated. - virtual bool DisableBuffering(); - - virtual StreamState GetState() const; - virtual StreamResult Read(void* buffer, size_t buffer_len, - size_t* read, int* error); - virtual StreamResult Write(const void* data, size_t data_len, - size_t* written, int* error); - virtual void Close(); - virtual bool SetPosition(size_t position); - virtual bool GetPosition(size_t* position) const; - virtual bool GetSize(size_t* size) const; - virtual bool GetAvailable(size_t* size) const; - virtual bool ReserveSize(size_t size); - - virtual bool Flush(); - -#if defined(POSIX) && !defined(__native_client__) - // Tries to aquire an exclusive lock on the file. - // Use OpenShare(...) on win32 to get similar functionality. - bool TryLock(); - bool Unlock(); -#endif - - // Note: Deprecated in favor of Filesystem::GetFileSize(). - static bool GetSize(const std::string& filename, size_t* size); - - protected: - virtual void DoClose(); - - FILE* file_; - - private: - DISALLOW_EVIL_CONSTRUCTORS(FileStream); -}; - -// A stream that caps the output at a certain size, dropping content from the -// middle of the logical stream and maintaining equal parts of the start/end of -// the logical stream. -class CircularFileStream : public FileStream { - public: - explicit CircularFileStream(size_t max_size); - - virtual bool Open(const std::string& filename, const char* mode, int* error); - virtual StreamResult Read(void* buffer, size_t buffer_len, - size_t* read, int* error); - virtual StreamResult Write(const void* data, size_t data_len, - size_t* written, int* error); - - private: - enum ReadSegment { - READ_MARKED, // Read 0 .. marked_position_ - READ_MIDDLE, // Read position_ .. file_size - READ_LATEST, // Read marked_position_ .. position_ if the buffer was - // overwritten or 0 .. position_ otherwise. - }; - - size_t max_write_size_; - size_t position_; - size_t marked_position_; - size_t last_write_position_; - ReadSegment read_segment_; - size_t read_segment_available_; -}; - -// A stream which pushes writes onto a separate thread and -// returns from the write call immediately. -class AsyncWriteStream : public StreamInterface { - public: - // Takes ownership of the stream, but not the thread. - AsyncWriteStream(StreamInterface* stream, talk_base::Thread* write_thread) - : stream_(stream), - write_thread_(write_thread), - state_(stream ? stream->GetState() : SS_CLOSED) { - } - - virtual ~AsyncWriteStream(); - - // StreamInterface Interface - virtual StreamState GetState() const { return state_; } - // This is needed by some stream writers, such as RtpDumpWriter. - virtual bool GetPosition(size_t* position) const; - virtual StreamResult Read(void* buffer, size_t buffer_len, - size_t* read, int* error); - virtual StreamResult Write(const void* data, size_t data_len, - size_t* written, int* error); - virtual void Close(); - virtual bool Flush(); - - protected: - // From MessageHandler - virtual void OnMessage(talk_base::Message* pmsg); - virtual void ClearBufferAndWrite(); - - private: - talk_base::scoped_ptr stream_; - Thread* write_thread_; - StreamState state_; - Buffer buffer_; - mutable CriticalSection crit_stream_; - CriticalSection crit_buffer_; - - DISALLOW_EVIL_CONSTRUCTORS(AsyncWriteStream); -}; - - -#if defined(POSIX) && !defined(__native_client__) -// A FileStream that is actually not a file, but the output or input of a -// sub-command. See "man 3 popen" for documentation of the underlying OS popen() -// function. -class POpenStream : public FileStream { - public: - POpenStream() : wait_status_(-1) {} - virtual ~POpenStream(); - - virtual bool Open(const std::string& subcommand, const char* mode, - int* error); - // Same as Open(). shflag is ignored. - virtual bool OpenShare(const std::string& subcommand, const char* mode, - int shflag, int* error); - - // Returns the wait status from the last Close() of an Open()'ed stream, or - // -1 if no Open()+Close() has been done on this object. Meaning of the number - // is documented in "man 2 wait". - int GetWaitStatus() const { return wait_status_; } - - protected: - virtual void DoClose(); - - private: - int wait_status_; -}; -#endif // POSIX - -/////////////////////////////////////////////////////////////////////////////// -// MemoryStream is a simple implementation of a StreamInterface over in-memory -// data. Data is read and written at the current seek position. Reads return -// end-of-stream when they reach the end of data. Writes actually extend the -// end of data mark. -/////////////////////////////////////////////////////////////////////////////// - -class MemoryStreamBase : public StreamInterface { - public: - virtual StreamState GetState() const; - virtual StreamResult Read(void* buffer, size_t bytes, size_t* bytes_read, - int* error); - virtual StreamResult Write(const void* buffer, size_t bytes, - size_t* bytes_written, int* error); - virtual void Close(); - virtual bool SetPosition(size_t position); - virtual bool GetPosition(size_t* position) const; - virtual bool GetSize(size_t* size) const; - virtual bool GetAvailable(size_t* size) const; - virtual bool ReserveSize(size_t size); - - char* GetBuffer() { return buffer_; } - const char* GetBuffer() const { return buffer_; } - - protected: - MemoryStreamBase(); - - virtual StreamResult DoReserve(size_t size, int* error); - - // Invariant: 0 <= seek_position <= data_length_ <= buffer_length_ - char* buffer_; - size_t buffer_length_; - size_t data_length_; - size_t seek_position_; - - private: - DISALLOW_EVIL_CONSTRUCTORS(MemoryStreamBase); -}; - -// MemoryStream dynamically resizes to accomodate written data. - -class MemoryStream : public MemoryStreamBase { - public: - MemoryStream(); - explicit MemoryStream(const char* data); // Calls SetData(data, strlen(data)) - MemoryStream(const void* data, size_t length); // Calls SetData(data, length) - virtual ~MemoryStream(); - - void SetData(const void* data, size_t length); - - protected: - virtual StreamResult DoReserve(size_t size, int* error); - // Memory Streams are aligned for efficiency. - static const int kAlignment = 16; - char* buffer_alloc_; -}; - -// ExternalMemoryStream adapts an external memory buffer, so writes which would -// extend past the end of the buffer will return end-of-stream. - -class ExternalMemoryStream : public MemoryStreamBase { - public: - ExternalMemoryStream(); - ExternalMemoryStream(void* data, size_t length); - virtual ~ExternalMemoryStream(); - - void SetData(void* data, size_t length); -}; - -// FifoBuffer allows for efficient, thread-safe buffering of data between -// writer and reader. As the data can wrap around the end of the buffer, -// MemoryStreamBase can't help us here. - -class FifoBuffer : public StreamInterface { - public: - // Creates a FIFO buffer with the specified capacity. - explicit FifoBuffer(size_t length); - // Creates a FIFO buffer with the specified capacity and owner - FifoBuffer(size_t length, Thread* owner); - virtual ~FifoBuffer(); - // Gets the amount of data currently readable from the buffer. - bool GetBuffered(size_t* data_len) const; - // Resizes the buffer to the specified capacity. Fails if data_length_ > size - bool SetCapacity(size_t length); - - // Read into |buffer| with an offset from the current read position, offset - // is specified in number of bytes. - // This method doesn't adjust read position nor the number of available - // bytes, user has to call ConsumeReadData() to do this. - StreamResult ReadOffset(void* buffer, size_t bytes, size_t offset, - size_t* bytes_read); - - // Write |buffer| with an offset from the current write position, offset is - // specified in number of bytes. - // This method doesn't adjust the number of buffered bytes, user has to call - // ConsumeWriteBuffer() to do this. - StreamResult WriteOffset(const void* buffer, size_t bytes, size_t offset, - size_t* bytes_written); - - // StreamInterface methods - virtual StreamState GetState() const; - virtual StreamResult Read(void* buffer, size_t bytes, - size_t* bytes_read, int* error); - virtual StreamResult Write(const void* buffer, size_t bytes, - size_t* bytes_written, int* error); - virtual void Close(); - virtual const void* GetReadData(size_t* data_len); - virtual void ConsumeReadData(size_t used); - virtual void* GetWriteBuffer(size_t* buf_len); - virtual void ConsumeWriteBuffer(size_t used); - virtual bool GetWriteRemaining(size_t* size) const; - - private: - // Helper method that implements ReadOffset. Caller must acquire a lock - // when calling this method. - StreamResult ReadOffsetLocked(void* buffer, size_t bytes, size_t offset, - size_t* bytes_read); - - // Helper method that implements WriteOffset. Caller must acquire a lock - // when calling this method. - StreamResult WriteOffsetLocked(const void* buffer, size_t bytes, - size_t offset, size_t* bytes_written); - - StreamState state_; // keeps the opened/closed state of the stream - scoped_ptr buffer_; // the allocated buffer - size_t buffer_length_; // size of the allocated buffer - size_t data_length_; // amount of readable data in the buffer - size_t read_position_; // offset to the readable data - Thread* owner_; // stream callbacks are dispatched on this thread - mutable CriticalSection crit_; // object lock - DISALLOW_EVIL_CONSTRUCTORS(FifoBuffer); -}; - -/////////////////////////////////////////////////////////////////////////////// - -class LoggingAdapter : public StreamAdapterInterface { - public: - LoggingAdapter(StreamInterface* stream, LoggingSeverity level, - const std::string& label, bool hex_mode = false); - - void set_label(const std::string& label); - - virtual StreamResult Read(void* buffer, size_t buffer_len, - size_t* read, int* error); - virtual StreamResult Write(const void* data, size_t data_len, - size_t* written, int* error); - virtual void Close(); - - protected: - virtual void OnEvent(StreamInterface* stream, int events, int err); - - private: - LoggingSeverity level_; - std::string label_; - bool hex_mode_; - LogMultilineState lms_; - - DISALLOW_EVIL_CONSTRUCTORS(LoggingAdapter); -}; - -/////////////////////////////////////////////////////////////////////////////// -// StringStream - Reads/Writes to an external std::string -/////////////////////////////////////////////////////////////////////////////// - -class StringStream : public StreamInterface { - public: - explicit StringStream(std::string& str); - explicit StringStream(const std::string& str); - - virtual StreamState GetState() const; - virtual StreamResult Read(void* buffer, size_t buffer_len, - size_t* read, int* error); - virtual StreamResult Write(const void* data, size_t data_len, - size_t* written, int* error); - virtual void Close(); - virtual bool SetPosition(size_t position); - virtual bool GetPosition(size_t* position) const; - virtual bool GetSize(size_t* size) const; - virtual bool GetAvailable(size_t* size) const; - virtual bool ReserveSize(size_t size); - - private: - std::string& str_; - size_t read_pos_; - bool read_only_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// StreamReference - A reference counting stream adapter -/////////////////////////////////////////////////////////////////////////////// - -// Keep in mind that the streams and adapters defined in this file are -// not thread-safe, so this has limited uses. - -// A StreamRefCount holds the reference count and a pointer to the -// wrapped stream. It deletes the wrapped stream when there are no -// more references. We can then have multiple StreamReference -// instances pointing to one StreamRefCount, all wrapping the same -// stream. - -class StreamReference : public StreamAdapterInterface { - class StreamRefCount; - public: - // Constructor for the first reference to a stream - // Note: get more references through NewReference(). Use this - // constructor only once on a given stream. - explicit StreamReference(StreamInterface* stream); - StreamInterface* GetStream() { return stream(); } - StreamInterface* NewReference(); - virtual ~StreamReference(); - - private: - class StreamRefCount { - public: - explicit StreamRefCount(StreamInterface* stream) - : stream_(stream), ref_count_(1) { - } - void AddReference() { - CritScope lock(&cs_); - ++ref_count_; - } - void Release() { - int ref_count; - { // Atomic ops would have been a better fit here. - CritScope lock(&cs_); - ref_count = --ref_count_; - } - if (ref_count == 0) { - delete stream_; - delete this; - } - } - private: - StreamInterface* stream_; - int ref_count_; - CriticalSection cs_; - DISALLOW_EVIL_CONSTRUCTORS(StreamRefCount); - }; - - // Constructor for adding references - explicit StreamReference(StreamRefCount* stream_ref_count, - StreamInterface* stream); - - StreamRefCount* stream_ref_count_; - DISALLOW_EVIL_CONSTRUCTORS(StreamReference); -}; - -/////////////////////////////////////////////////////////////////////////////// - -// Flow attempts to move bytes from source to sink via buffer of size -// buffer_len. The function returns SR_SUCCESS when source reaches -// end-of-stream (returns SR_EOS), and all the data has been written successful -// to sink. Alternately, if source returns SR_BLOCK or SR_ERROR, or if sink -// returns SR_BLOCK, SR_ERROR, or SR_EOS, then the function immediately returns -// with the unexpected StreamResult value. -// data_len is the length of the valid data in buffer. in case of error -// this is the data that read from source but can't move to destination. -// as a pass in parameter, it indicates data in buffer that should move to sink -StreamResult Flow(StreamInterface* source, - char* buffer, size_t buffer_len, - StreamInterface* sink, size_t* data_len = NULL); - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace talk_base - -#endif // TALK_BASE_STREAM_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/stringdigest.h b/thirdparties/common/include/webrtc-sdk/talk/base/stringdigest.h deleted file mode 100755 index e065048..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/stringdigest.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * libjingle - * Copyright 2004, 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_BASE_STRINGDIGEST_H_ -#define TALK_BASE_STRINGDIGEST_H_ - -// TODO: Update remaining callers to use messagedigest.h instead -#include "talk/base/messagedigest.h" - -#endif // TALK_BASE_STRINGDIGEST_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/stringencode.h b/thirdparties/common/include/webrtc-sdk/talk/base/stringencode.h deleted file mode 100755 index 5a42554..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/stringencode.h +++ /dev/null @@ -1,227 +0,0 @@ -/* - * libjingle - * Copyright 2004, 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_BASE_STRINGENCODE_H_ -#define TALK_BASE_STRINGENCODE_H_ - -#include -#include -#include - -#include "talk/base/common.h" - -namespace talk_base { - -////////////////////////////////////////////////////////////////////// -// String Encoding Utilities -////////////////////////////////////////////////////////////////////// - -// Convert an unsigned value to it's utf8 representation. Returns the length -// of the encoded string, or 0 if the encoding is longer than buflen - 1. -size_t utf8_encode(char* buffer, size_t buflen, unsigned long value); -// Decode the utf8 encoded value pointed to by source. Returns the number of -// bytes used by the encoding, or 0 if the encoding is invalid. -size_t utf8_decode(const char* source, size_t srclen, unsigned long* value); - -// Escaping prefixes illegal characters with the escape character. Compact, but -// illegal characters still appear in the string. -size_t escape(char * buffer, size_t buflen, - const char * source, size_t srclen, - const char * illegal, char escape); -// Note: in-place unescaping (buffer == source) is allowed. -size_t unescape(char * buffer, size_t buflen, - const char * source, size_t srclen, - char escape); - -// Encoding replaces illegal characters with the escape character and 2 hex -// chars, so it's a little less compact than escape, but completely removes -// illegal characters. note that hex digits should not be used as illegal -// characters. -size_t encode(char * buffer, size_t buflen, - const char * source, size_t srclen, - const char * illegal, char escape); -// Note: in-place decoding (buffer == source) is allowed. -size_t decode(char * buffer, size_t buflen, - const char * source, size_t srclen, - char escape); - -// Returns a list of characters that may be unsafe for use in the name of a -// file, suitable for passing to the 'illegal' member of escape or encode. -const char* unsafe_filename_characters(); - -// url_encode is an encode operation with a predefined set of illegal characters -// and escape character (for use in URLs, obviously). -size_t url_encode(char * buffer, size_t buflen, - const char * source, size_t srclen); -// Note: in-place decoding (buffer == source) is allowed. -size_t url_decode(char * buffer, size_t buflen, - const char * source, size_t srclen); - -// html_encode prevents data embedded in html from containing markup. -size_t html_encode(char * buffer, size_t buflen, - const char * source, size_t srclen); -// Note: in-place decoding (buffer == source) is allowed. -size_t html_decode(char * buffer, size_t buflen, - const char * source, size_t srclen); - -// xml_encode makes data suitable for inside xml attributes and values. -size_t xml_encode(char * buffer, size_t buflen, - const char * source, size_t srclen); -// Note: in-place decoding (buffer == source) is allowed. -size_t xml_decode(char * buffer, size_t buflen, - const char * source, size_t srclen); - -// Convert an unsigned value from 0 to 15 to the hex character equivalent... -char hex_encode(unsigned char val); -// ...and vice-versa. -bool hex_decode(char ch, unsigned char* val); - -// hex_encode shows the hex representation of binary data in ascii. -size_t hex_encode(char* buffer, size_t buflen, - const char* source, size_t srclen); - -// hex_encode, but separate each byte representation with a delimiter. -// |delimiter| == 0 means no delimiter -// If the buffer is too short, we return 0 -size_t hex_encode_with_delimiter(char* buffer, size_t buflen, - const char* source, size_t srclen, - char delimiter); - -// Helper functions for hex_encode. -std::string hex_encode(const char* source, size_t srclen); -std::string hex_encode_with_delimiter(const char* source, size_t srclen, - char delimiter); - -// hex_decode converts ascii hex to binary. -size_t hex_decode(char* buffer, size_t buflen, - const char* source, size_t srclen); - -// hex_decode, assuming that there is a delimiter between every byte -// pair. -// |delimiter| == 0 means no delimiter -// If the buffer is too short or the data is invalid, we return 0. -size_t hex_decode_with_delimiter(char* buffer, size_t buflen, - const char* source, size_t srclen, - char delimiter); - -// Helper functions for hex_decode. -size_t hex_decode(char* buffer, size_t buflen, const std::string& source); -size_t hex_decode_with_delimiter(char* buffer, size_t buflen, - const std::string& source, char delimiter); - -// Apply any suitable string transform (including the ones above) to an STL -// string. Stack-allocated temporary space is used for the transformation, -// so value and source may refer to the same string. -typedef size_t (*Transform)(char * buffer, size_t buflen, - const char * source, size_t srclen); -size_t transform(std::string& value, size_t maxlen, const std::string& source, - Transform t); - -// Return the result of applying transform t to source. -std::string s_transform(const std::string& source, Transform t); - -// Convenience wrappers. -inline std::string s_url_encode(const std::string& source) { - return s_transform(source, url_encode); -} -inline std::string s_url_decode(const std::string& source) { - return s_transform(source, url_decode); -} - -// Splits the source string into multiple fields separated by delimiter, -// with duplicates of delimiter creating empty fields. -size_t split(const std::string& source, char delimiter, - std::vector* fields); - -// Splits the source string into multiple fields separated by delimiter, -// with duplicates of delimiter ignored. Trailing delimiter ignored. -size_t tokenize(const std::string& source, char delimiter, - std::vector* fields); - -// Tokenize and append the tokens to fields. Return the new size of fields. -size_t tokenize_append(const std::string& source, char delimiter, - std::vector* fields); - -// Splits the source string into multiple fields separated by delimiter, with -// duplicates of delimiter ignored. Trailing delimiter ignored. A substring in -// between the start_mark and the end_mark is treated as a single field. Return -// the size of fields. For example, if source is "filename -// \"/Library/Application Support/media content.txt\"", delimiter is ' ', and -// the start_mark and end_mark are '"', this method returns two fields: -// "filename" and "/Library/Application Support/media content.txt". -size_t tokenize(const std::string& source, char delimiter, char start_mark, - char end_mark, std::vector* fields); - -// Safe sprintf to std::string -//void sprintf(std::string& value, size_t maxlen, const char * format, ...) -// PRINTF_FORMAT(3); - -// Convert arbitrary values to/from a string. - -template -static bool ToString(const T &t, std::string* s) { - ASSERT(NULL != s); - std::ostringstream oss; - oss << std::boolalpha << t; - *s = oss.str(); - return !oss.fail(); -} - -template -static bool FromString(const std::string& s, T* t) { - ASSERT(NULL != t); - std::istringstream iss(s); - iss >> std::boolalpha >> *t; - return !iss.fail(); -} - -// Inline versions of the string conversion routines. - -template -static inline std::string ToString(const T& val) { - std::string str; ToString(val, &str); return str; -} - -template -static inline T FromString(const std::string& str) { - T val; FromString(str, &val); return val; -} - -template -static inline T FromString(const T& defaultValue, const std::string& str) { - T val(defaultValue); FromString(str, &val); return val; -} - -// simple function to strip out characters which shouldn't be -// used in filenames -char make_char_safe_for_filename(char c); - -////////////////////////////////////////////////////////////////////// - -} // namespace talk_base - -#endif // TALK_BASE_STRINGENCODE_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/stringutils.h b/thirdparties/common/include/webrtc-sdk/talk/base/stringutils.h deleted file mode 100755 index 7c9275b..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/stringutils.h +++ /dev/null @@ -1,335 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_STRINGUTILS_H__ -#define TALK_BASE_STRINGUTILS_H__ - -#include -#include -#include -#include - -#ifdef WIN32 -#include -#include -#define alloca _alloca -#endif // WIN32 - -#ifdef POSIX -#ifdef BSD -#include -#else // BSD -#include -#endif // !BSD -#endif // POSIX - -#include - -#include "talk/base/basictypes.h" - -/////////////////////////////////////////////////////////////////////////////// -// Generic string/memory utilities -/////////////////////////////////////////////////////////////////////////////// - -#define STACK_ARRAY(TYPE, LEN) static_cast(::alloca((LEN)*sizeof(TYPE))) - -namespace talk_base { - -// Complement to memset. Verifies memory consists of count bytes of value c. -bool memory_check(const void* memory, int c, size_t count); - -// Determines whether the simple wildcard pattern matches target. -// Alpha characters in pattern match case-insensitively. -// Asterisks in pattern match 0 or more characters. -// Ex: string_match("www.TEST.GOOGLE.COM", "www.*.com") -> true -bool string_match(const char* target, const char* pattern); - -} // namespace talk_base - -/////////////////////////////////////////////////////////////////////////////// -// Rename a bunch of common string functions so they are consistent across -// platforms and between char and wchar_t variants. -// Here is the full list of functions that are unified: -// strlen, strcmp, stricmp, strncmp, strnicmp -// strchr, vsnprintf, strtoul, tolowercase -// tolowercase is like tolower, but not compatible with end-of-file value -// -// It's not clear if we will ever use wchar_t strings on unix. In theory, -// all strings should be Utf8 all the time, except when interfacing with Win32 -// APIs that require Utf16. -/////////////////////////////////////////////////////////////////////////////// - -inline char tolowercase(char c) { - return static_cast(tolower(c)); -} - -#ifdef WIN32 - -inline size_t strlen(const wchar_t* s) { - return wcslen(s); -} -inline int strcmp(const wchar_t* s1, const wchar_t* s2) { - return wcscmp(s1, s2); -} -inline int stricmp(const wchar_t* s1, const wchar_t* s2) { - return _wcsicmp(s1, s2); -} -inline int strncmp(const wchar_t* s1, const wchar_t* s2, size_t n) { - return wcsncmp(s1, s2, n); -} -inline int strnicmp(const wchar_t* s1, const wchar_t* s2, size_t n) { - return _wcsnicmp(s1, s2, n); -} -inline const wchar_t* strchr(const wchar_t* s, wchar_t c) { - return wcschr(s, c); -} -inline const wchar_t* strstr(const wchar_t* haystack, const wchar_t* needle) { - return wcsstr(haystack, needle); -} -#ifndef vsnprintf -inline int vsnprintf(wchar_t* buf, size_t n, const wchar_t* fmt, va_list args) { - return _vsnwprintf(buf, n, fmt, args); -} -#endif // !vsnprintf -inline unsigned long strtoul(const wchar_t* snum, wchar_t** end, int base) { - return wcstoul(snum, end, base); -} -inline wchar_t tolowercase(wchar_t c) { - return static_cast(towlower(c)); -} - -#endif // WIN32 - -#ifdef POSIX - -inline int _stricmp(const char* s1, const char* s2) { - return strcasecmp(s1, s2); -} -inline int _strnicmp(const char* s1, const char* s2, size_t n) { - return strncasecmp(s1, s2, n); -} - -#endif // POSIX - -/////////////////////////////////////////////////////////////////////////////// -// Traits simplifies porting string functions to be CTYPE-agnostic -/////////////////////////////////////////////////////////////////////////////// - -namespace talk_base { - -const size_t SIZE_UNKNOWN = static_cast(-1); - -template -struct Traits { - // STL string type - //typedef XXX string; - // Null-terminated string - //inline static const CTYPE* empty_str(); -}; - -/////////////////////////////////////////////////////////////////////////////// -// String utilities which work with char or wchar_t -/////////////////////////////////////////////////////////////////////////////// - -template -inline const CTYPE* nonnull(const CTYPE* str, const CTYPE* def_str = NULL) { - return str ? str : (def_str ? def_str : Traits::empty_str()); -} - -template -const CTYPE* strchr(const CTYPE* str, const CTYPE* chs) { - for (size_t i=0; str[i]; ++i) { - for (size_t j=0; chs[j]; ++j) { - if (str[i] == chs[j]) { - return str + i; - } - } - } - return 0; -} - -template -const CTYPE* strchrn(const CTYPE* str, size_t slen, CTYPE ch) { - for (size_t i=0; i -size_t strlenn(const CTYPE* buffer, size_t buflen) { - size_t bufpos = 0; - while (buffer[bufpos] && (bufpos < buflen)) { - ++bufpos; - } - return bufpos; -} - -// Safe versions of strncpy, strncat, snprintf and vsnprintf that always -// null-terminate. - -template -size_t strcpyn(CTYPE* buffer, size_t buflen, - const CTYPE* source, size_t srclen = SIZE_UNKNOWN) { - if (buflen <= 0) - return 0; - - if (srclen == SIZE_UNKNOWN) { - srclen = strlenn(source, buflen - 1); - } else if (srclen >= buflen) { - srclen = buflen - 1; - } - memcpy(buffer, source, srclen * sizeof(CTYPE)); - buffer[srclen] = 0; - return srclen; -} - -template -size_t strcatn(CTYPE* buffer, size_t buflen, - const CTYPE* source, size_t srclen = SIZE_UNKNOWN) { - if (buflen <= 0) - return 0; - - size_t bufpos = strlenn(buffer, buflen - 1); - return bufpos + strcpyn(buffer + bufpos, buflen - bufpos, source, srclen); -} - -// Some compilers (clang specifically) require vsprintfn be defined before -// sprintfn. -template -size_t vsprintfn(CTYPE* buffer, size_t buflen, const CTYPE* format, - va_list args) { - int len = vsnprintf(buffer, buflen, format, args); - if ((len < 0) || (static_cast(len) >= buflen)) { - len = static_cast(buflen - 1); - buffer[len] = 0; - } - return len; -} - -template -size_t sprintfn(CTYPE* buffer, size_t buflen, const CTYPE* format, ...); -template -size_t sprintfn(CTYPE* buffer, size_t buflen, const CTYPE* format, ...) { - va_list args; - va_start(args, format); - size_t len = vsprintfn(buffer, buflen, format, args); - va_end(args); - return len; -} - -/////////////////////////////////////////////////////////////////////////////// -// Allow safe comparing and copying ascii (not UTF-8) with both wide and -// non-wide character strings. -/////////////////////////////////////////////////////////////////////////////// - -inline int asccmp(const char* s1, const char* s2) { - return strcmp(s1, s2); -} -inline int ascicmp(const char* s1, const char* s2) { - return _stricmp(s1, s2); -} -inline int ascncmp(const char* s1, const char* s2, size_t n) { - return strncmp(s1, s2, n); -} -inline int ascnicmp(const char* s1, const char* s2, size_t n) { - return _strnicmp(s1, s2, n); -} -inline size_t asccpyn(char* buffer, size_t buflen, - const char* source, size_t srclen = SIZE_UNKNOWN) { - return strcpyn(buffer, buflen, source, srclen); -} - -#ifdef WIN32 - -typedef wchar_t(*CharacterTransformation)(wchar_t); -inline wchar_t identity(wchar_t c) { return c; } -int ascii_string_compare(const wchar_t* s1, const char* s2, size_t n, - CharacterTransformation transformation); - -inline int asccmp(const wchar_t* s1, const char* s2) { - return ascii_string_compare(s1, s2, static_cast(-1), identity); -} -inline int ascicmp(const wchar_t* s1, const char* s2) { - return ascii_string_compare(s1, s2, static_cast(-1), tolowercase); -} -inline int ascncmp(const wchar_t* s1, const char* s2, size_t n) { - return ascii_string_compare(s1, s2, n, identity); -} -inline int ascnicmp(const wchar_t* s1, const char* s2, size_t n) { - return ascii_string_compare(s1, s2, n, tolowercase); -} -size_t asccpyn(wchar_t* buffer, size_t buflen, - const char* source, size_t srclen = SIZE_UNKNOWN); - -#endif // WIN32 - -/////////////////////////////////////////////////////////////////////////////// -// Traits specializations -/////////////////////////////////////////////////////////////////////////////// - -template<> -struct Traits { - typedef std::string string; - inline static const char* empty_str() { return ""; } -}; - -/////////////////////////////////////////////////////////////////////////////// -// Traits specializations (Windows only, currently) -/////////////////////////////////////////////////////////////////////////////// - -#ifdef WIN32 - -template<> -struct Traits { - typedef std::wstring string; - inline static const wchar_t* Traits::empty_str() { return L""; } -}; - -#endif // WIN32 - -// Replaces all occurrences of "search" with "replace". -void replace_substrs(const char *search, - size_t search_len, - const char *replace, - size_t replace_len, - std::string *s); - -// True iff s1 starts with s2. -bool starts_with(const char *s1, const char *s2); - -// True iff s1 ends with s2. -bool ends_with(const char *s1, const char *s2); - -// Remove leading and trailing whitespaces. -std::string string_trim(const std::string& s); - -} // namespace talk_base - -#endif // TALK_BASE_STRINGUTILS_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/systeminfo.h b/thirdparties/common/include/webrtc-sdk/talk/base/systeminfo.h deleted file mode 100755 index 5c0e8ea..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/systeminfo.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * libjingle - * Copyright 2008 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_BASE_SYSTEMINFO_H__ -#define TALK_BASE_SYSTEMINFO_H__ - -#include - -#include "talk/base/basictypes.h" - -namespace talk_base { - -class SystemInfo { - public: - enum Architecture { - SI_ARCH_UNKNOWN = -1, - SI_ARCH_X86 = 0, - SI_ARCH_X64 = 1, - SI_ARCH_ARM = 2 - }; - - SystemInfo(); - - // The number of CPU Cores in the system. - int GetMaxPhysicalCpus(); - // The number of CPU Threads in the system. - int GetMaxCpus(); - // The number of CPU Threads currently available to this process. - int GetCurCpus(); - // Identity of the CPUs. - Architecture GetCpuArchitecture(); - std::string GetCpuVendor(); - int GetCpuFamily(); - int GetCpuModel(); - int GetCpuStepping(); - // Return size of CPU cache in bytes. Uses largest available cache (L3). - int GetCpuCacheSize(); - // Estimated speed of the CPUs, in MHz. e.g. 2400 for 2.4 GHz - int GetMaxCpuSpeed(); - int GetCurCpuSpeed(); - // Total amount of physical memory, in bytes. - int64 GetMemorySize(); - // The model name of the machine, e.g. "MacBookAir1,1" - std::string GetMachineModel(); - - // The gpu identifier - struct GpuInfo { - GpuInfo() : vendor_id(0), device_id(0) {} - std::string device_name; - std::string description; - int vendor_id; - int device_id; - std::string driver; - std::string driver_version; - }; - bool GetGpuInfo(GpuInfo *info); - - private: - int physical_cpus_; - int logical_cpus_; - int cache_size_; - Architecture cpu_arch_; - std::string cpu_vendor_; - int cpu_family_; - int cpu_model_; - int cpu_stepping_; - int cpu_speed_; - int64 memory_; - std::string machine_model_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_SYSTEMINFO_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/task.h b/thirdparties/common/include/webrtc-sdk/talk/base/task.h deleted file mode 100755 index 775fa49..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/task.h +++ /dev/null @@ -1,194 +0,0 @@ -/* - * libjingle - * Copyright 2004--2006, 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_BASE_TASK_H__ -#define TALK_BASE_TASK_H__ - -#include -#include "talk/base/basictypes.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/sigslot.h" -#include "talk/base/taskparent.h" - -///////////////////////////////////////////////////////////////////// -// -// TASK -// -///////////////////////////////////////////////////////////////////// -// -// Task is a state machine infrastructure. States are pushed forward by -// pushing forwards a TaskRunner that holds on to all Tasks. The purpose -// of Task is threefold: -// -// (1) It manages ongoing work on the UI thread. Multitasking without -// threads, keeping it easy, keeping it real. :-) It does this by -// organizing a set of states for each task. When you return from your -// Process*() function, you return an integer for the next state. You do -// not go onto the next state yourself. Every time you enter a state, -// you check to see if you can do anything yet. If not, you return -// STATE_BLOCKED. If you _could_ do anything, do not return -// STATE_BLOCKED - even if you end up in the same state, return -// STATE_mysamestate. When you are done, return STATE_DONE and then the -// task will self-delete sometime afterwards. -// -// (2) It helps you avoid all those reentrancy problems when you chain -// too many triggers on one thread. Basically if you want to tell a task -// to process something for you, you feed your task some information and -// then you Wake() it. Don't tell it to process it right away. If it -// might be working on something as you send it information, you may want -// to have a queue in the task. -// -// (3) Finally it helps manage parent tasks and children. If a parent -// task gets aborted, all the children tasks are too. The nice thing -// about this, for example, is if you have one parent task that -// represents, say, and Xmpp connection, then you can spawn a whole bunch -// of infinite lifetime child tasks and now worry about cleaning them up. -// When the parent task goes to STATE_DONE, the task engine will make -// sure all those children are aborted and get deleted. -// -// Notice that Task has a few built-in states, e.g., -// -// STATE_INIT - the task isn't running yet -// STATE_START - the task is in its first state -// STATE_RESPONSE - the task is in its second state -// STATE_DONE - the task is done -// -// STATE_ERROR - indicates an error - we should audit the error code in -// light of any usage of it to see if it should be improved. When I -// first put down the task stuff I didn't have a good sense of what was -// needed for Abort and Error, and now the subclasses of Task will ground -// the design in a stronger way. -// -// STATE_NEXT - the first undefined state number. (like WM_USER) - you -// can start defining more task states there. -// -// When you define more task states, just override Process(int state) and -// add your own switch statement. If you want to delegate to -// Task::Process, you can effectively delegate to its switch statement. -// No fancy method pointers or such - this is all just pretty low tech, -// easy to debug, and fast. -// -// Also notice that Task has some primitive built-in timeout functionality. -// -// A timeout is defined as "the task stays in STATE_BLOCKED longer than -// timeout_seconds_." -// -// Descendant classes can override this behavior by calling the -// various protected methods to change the timeout behavior. For -// instance, a descendand might call SuspendTimeout() when it knows -// that it isn't waiting for anything that might timeout, but isn't -// yet in the STATE_DONE state. -// - -namespace talk_base { - -// Executes a sequence of steps -class Task : public TaskParent { - public: - Task(TaskParent *parent); - virtual ~Task(); - - int32 unique_id() { return unique_id_; } - - void Start(); - void Step(); - int GetState() const { return state_; } - bool HasError() const { return (GetState() == STATE_ERROR); } - bool Blocked() const { return blocked_; } - bool IsDone() const { return done_; } - int64 ElapsedTime(); - - // Called from outside to stop task without any more callbacks - void Abort(bool nowake = false); - - bool TimedOut(); - - int64 timeout_time() const { return timeout_time_; } - int timeout_seconds() const { return timeout_seconds_; } - void set_timeout_seconds(int timeout_seconds); - - sigslot::signal0<> SignalTimeout; - - // Called inside the task to signal that the task may be unblocked - void Wake(); - - protected: - - enum { - STATE_BLOCKED = -1, - STATE_INIT = 0, - STATE_START = 1, - STATE_DONE = 2, - STATE_ERROR = 3, - STATE_RESPONSE = 4, - STATE_NEXT = 5, // Subclasses which need more states start here and higher - }; - - // Called inside to advise that the task should wake and signal an error - void Error(); - - int64 CurrentTime(); - - virtual std::string GetStateName(int state) const; - virtual int Process(int state); - virtual void Stop(); - virtual int ProcessStart() = 0; - virtual int ProcessResponse() { return STATE_DONE; } - - void ResetTimeout(); - void ClearTimeout(); - - void SuspendTimeout(); - void ResumeTimeout(); - - protected: - virtual int OnTimeout() { - // by default, we are finished after timing out - return STATE_DONE; - } - - private: - void Done(); - - int state_; - bool blocked_; - bool done_; - bool aborted_; - bool busy_; - bool error_; - int64 start_time_; - int64 timeout_time_; - int timeout_seconds_; - bool timeout_suspended_; - int32 unique_id_; - - static int32 unique_id_seed_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_TASK_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/taskparent.h b/thirdparties/common/include/webrtc-sdk/talk/base/taskparent.h deleted file mode 100755 index 005f7c2..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/taskparent.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * libjingle - * Copyright 2004--2006, 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_BASE_TASKPARENT_H__ -#define TALK_BASE_TASKPARENT_H__ - -#include - -#include "talk/base/basictypes.h" -#include "talk/base/scoped_ptr.h" - -namespace talk_base { - -class Task; -class TaskRunner; - -class TaskParent { - public: - TaskParent(Task *derived_instance, TaskParent *parent); - explicit TaskParent(TaskRunner *derived_instance); - virtual ~TaskParent() { } - - TaskParent *GetParent() { return parent_; } - TaskRunner *GetRunner() { return runner_; } - - bool AllChildrenDone(); - bool AnyChildError(); -#ifdef _DEBUG - bool IsChildTask(Task *task); -#endif - - protected: - void OnStopped(Task *task); - void AbortAllChildren(); - TaskParent *parent() { - return parent_; - } - - private: - void Initialize(); - void OnChildStopped(Task *child); - void AddChild(Task *child); - - TaskParent *parent_; - TaskRunner *runner_; - bool child_error_; - typedef std::set ChildSet; - scoped_ptr children_; - DISALLOW_EVIL_CONSTRUCTORS(TaskParent); -}; - - -} // namespace talk_base - -#endif // TALK_BASE_TASKPARENT_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/taskrunner.h b/thirdparties/common/include/webrtc-sdk/talk/base/taskrunner.h deleted file mode 100755 index acefda5..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/taskrunner.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * libjingle - * Copyright 2004--2006, 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_BASE_TASKRUNNER_H__ -#define TALK_BASE_TASKRUNNER_H__ - -#include - -#include "talk/base/basictypes.h" -#include "talk/base/sigslot.h" -#include "talk/base/taskparent.h" - -namespace talk_base { -class Task; - -const int64 kSecToMsec = 1000; -const int64 kMsecTo100ns = 10000; -const int64 kSecTo100ns = kSecToMsec * kMsecTo100ns; - -class TaskRunner : public TaskParent, public sigslot::has_slots<> { - public: - TaskRunner(); - virtual ~TaskRunner(); - - virtual void WakeTasks() = 0; - - // Returns the current time in 100ns units. It is used for - // determining timeouts. The origin is not important, only - // the units and that rollover while the computer is running. - // - // On Windows, GetSystemTimeAsFileTime is the typical implementation. - virtual int64 CurrentTime() = 0 ; - - void StartTask(Task *task); - void RunTasks(); - void PollTasks(); - - void UpdateTaskTimeout(Task *task, int64 previous_task_timeout_time); - -#ifdef _DEBUG - bool is_ok_to_delete(Task* task) { - return task == deleting_task_; - } - - void IncrementAbortCount() { - ++abort_count_; - } - - void DecrementAbortCount() { - --abort_count_; - } -#endif - - // Returns the next absolute time when a task times out - // OR "0" if there is no next timeout. - int64 next_task_timeout() const; - - protected: - // The primary usage of this method is to know if - // a callback timer needs to be set-up or adjusted. - // This method will be called - // * when the next_task_timeout() becomes a smaller value OR - // * when next_task_timeout() has changed values and the previous - // value is in the past. - // - // If the next_task_timeout moves to the future, this method will *not* - // get called (because it subclass should check next_task_timeout() - // when its timer goes off up to see if it needs to set-up a new timer). - // - // Note that this maybe called conservatively. In that it may be - // called when no time change has happened. - virtual void OnTimeoutChange() { - // by default, do nothing. - } - - private: - void InternalRunTasks(bool in_destructor); - void CheckForTimeoutChange(int64 previous_timeout_time); - - std::vector tasks_; - Task *next_timeout_task_; - bool tasks_running_; -#ifdef _DEBUG - int abort_count_; - Task* deleting_task_; -#endif - - void RecalcNextTimeout(Task *exclude_task); -}; - -} // namespace talk_base - -#endif // TASK_BASE_TASKRUNNER_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/template_util.h b/thirdparties/common/include/webrtc-sdk/talk/base/template_util.h deleted file mode 100755 index 82857c6..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/template_util.h +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef TALK_BASE_TEMPLATE_UTIL_H_ -#define TALK_BASE_TEMPLATE_UTIL_H_ - -#include // For size_t. - -namespace talk_base { - -// template definitions from tr1 - -template -struct integral_constant { - static const T value = v; - typedef T value_type; - typedef integral_constant type; -}; - -template const T integral_constant::value; - -typedef integral_constant true_type; -typedef integral_constant false_type; - -template struct is_pointer : false_type {}; -template struct is_pointer : true_type {}; - -template struct is_same : public false_type {}; -template struct is_same : true_type {}; - -template struct is_array : public false_type {}; -template struct is_array : public true_type {}; -template struct is_array : public true_type {}; - -template struct is_non_const_reference : false_type {}; -template struct is_non_const_reference : true_type {}; -template struct is_non_const_reference : false_type {}; - -template struct is_void : false_type {}; -template <> struct is_void : true_type {}; - -namespace internal { - -// Types YesType and NoType are guaranteed such that sizeof(YesType) < -// sizeof(NoType). -typedef char YesType; - -struct NoType { - YesType dummy[2]; -}; - -// This class is an implementation detail for is_convertible, and you -// don't need to know how it works to use is_convertible. For those -// who care: we declare two different functions, one whose argument is -// of type To and one with a variadic argument list. We give them -// return types of different size, so we can use sizeof to trick the -// compiler into telling us which function it would have chosen if we -// had called it with an argument of type From. See Alexandrescu's -// _Modern C++ Design_ for more details on this sort of trick. - -struct ConvertHelper { - template - static YesType Test(To); - - template - static NoType Test(...); - - template - static From& Create(); -}; - -// Used to determine if a type is a struct/union/class. Inspired by Boost's -// is_class type_trait implementation. -struct IsClassHelper { - template - static YesType Test(void(C::*)(void)); - - template - static NoType Test(...); -}; - -} // namespace internal - -// Inherits from true_type if From is convertible to To, false_type otherwise. -// -// Note that if the type is convertible, this will be a true_type REGARDLESS -// of whether or not the conversion would emit a warning. -template -struct is_convertible - : integral_constant( - internal::ConvertHelper::Create())) == - sizeof(internal::YesType)> { -}; - -template -struct is_class - : integral_constant(0)) == - sizeof(internal::YesType)> { -}; - -} // namespace talk_base - -#endif // TALK_BASE_TEMPLATE_UTIL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/testbase64.h b/thirdparties/common/include/webrtc-sdk/talk/base/testbase64.h deleted file mode 100755 index ec05f72..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/testbase64.h +++ /dev/null @@ -1,5 +0,0 @@ -/* This file was generated by googleclient/talk/binary2header.sh */ - -static unsigned char testbase64[] = { -0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x02, 0x01, 0x00, 0x48, 0x00, 0x48, 0x00, 0x00, 0xff, 0xe1, 0x0d, 0x07, 0x45, 0x78, 0x69, 0x66, 0x00, 0x00, 0x4d, 0x4d, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0c, 0x01, 0x0e, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x9e, 0x01, 0x0f, 0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xbe, 0x01, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0xc3, 0x01, 0x12, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x1a, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xcc, 0x01, 0x1b, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xd4, 0x01, 0x28, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x01, 0x31, 0x00, 0x02, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0xdc, 0x01, 0x32, 0x00, 0x02, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x3c, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x01, 0x04, 0x02, 0x13, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x87, 0x69, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x14, 0x00, 0x00, 0x02, 0xc4, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x53, 0x4f, 0x4e, 0x59, 0x00, 0x44, 0x53, 0x43, 0x2d, 0x50, 0x32, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x41, 0x64, 0x6f, 0x62, 0x65, 0x20, 0x50, 0x68, 0x6f, 0x74, 0x6f, 0x73, 0x68, 0x6f, 0x70, 0x20, 0x37, 0x2e, 0x30, 0x00, 0x32, 0x30, 0x30, 0x37, 0x3a, 0x30, 0x31, 0x3a, 0x33, 0x30, 0x20, 0x32, 0x33, 0x3a, 0x31, 0x30, 0x3a, 0x30, 0x34, 0x00, 0x4d, 0x61, 0x63, 0x20, 0x4f, 0x53, 0x20, 0x58, 0x20, 0x31, 0x30, 0x2e, 0x34, 0x2e, 0x38, 0x00, 0x00, 0x1c, 0x82, 0x9a, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x6a, 0x82, 0x9d, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x72, 0x88, 0x22, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x88, 0x27, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x64, 0x00, 0x00, 0x90, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x30, 0x32, 0x32, 0x30, 0x90, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x02, 0x7a, 0x90, 0x04, 0x00, 0x02, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x02, 0x8e, 0x91, 0x01, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x01, 0x02, 0x03, 0x00, 0x91, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0xa2, 0x92, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0xaa, 0x92, 0x05, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0xb2, 0x92, 0x07, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00, 0x92, 0x08, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x92, 0x09, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x92, 0x0a, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0xba, 0xa0, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x30, 0x31, 0x30, 0x30, 0xa0, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0xa0, 0x03, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0xa3, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0xa3, 0x01, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0xa4, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x02, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x06, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x08, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x09, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xa4, 0x0a, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x90, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x0a, 0x32, 0x30, 0x30, 0x37, 0x3a, 0x30, 0x31, 0x3a, 0x32, 0x30, 0x20, 0x32, 0x33, 0x3a, 0x30, 0x35, 0x3a, 0x35, 0x32, 0x00, 0x32, 0x30, 0x30, 0x37, 0x3a, 0x30, 0x31, 0x3a, 0x32, 0x30, 0x20, 0x32, 0x33, 0x3a, 0x30, 0x35, 0x3a, 0x35, 0x32, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x06, 0x01, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x06, 0x00, 0x00, 0x01, 0x1a, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x03, 0x12, 0x01, 0x1b, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x03, 0x1a, 0x01, 0x28, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x02, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x03, 0x22, 0x02, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x09, 0xdd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x02, 0x01, 0x00, 0x48, 0x00, 0x48, 0x00, 0x00, 0xff, 0xed, 0x00, 0x0c, 0x41, 0x64, 0x6f, 0x62, 0x65, 0x5f, 0x43, 0x4d, 0x00, 0x02, 0xff, 0xee, 0x00, 0x0e, 0x41, 0x64, 0x6f, 0x62, 0x65, 0x00, 0x64, 0x80, 0x00, 0x00, 0x00, 0x01, 0xff, 0xdb, 0x00, 0x84, 0x00, 0x0c, 0x08, 0x08, 0x08, 0x09, 0x08, 0x0c, 0x09, 0x09, 0x0c, 0x11, 0x0b, 0x0a, 0x0b, 0x11, 0x15, 0x0f, 0x0c, 0x0c, 0x0f, 0x15, 0x18, 0x13, 0x13, 0x15, 0x13, 0x13, 0x18, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x01, 0x0d, 0x0b, 0x0b, 0x0d, 0x0e, 0x0d, 0x10, 0x0e, 0x0e, 0x10, 0x14, 0x0e, 0x0e, 0x0e, 0x14, 0x14, 0x0e, 0x0e, 0x0e, 0x0e, 0x14, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x11, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xff, 0xc0, 0x00, 0x11, 0x08, 0x00, 0x64, 0x00, 0x64, 0x03, 0x01, 0x22, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xff, 0xdd, 0x00, 0x04, 0x00, 0x07, 0xff, 0xc4, 0x01, 0x3f, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x01, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x10, 0x00, 0x01, 0x04, 0x01, 0x03, 0x02, 0x04, 0x02, 0x05, 0x07, 0x06, 0x08, 0x05, 0x03, 0x0c, 0x33, 0x01, 0x00, 0x02, 0x11, 0x03, 0x04, 0x21, 0x12, 0x31, 0x05, 0x41, 0x51, 0x61, 0x13, 0x22, 0x71, 0x81, 0x32, 0x06, 0x14, 0x91, 0xa1, 0xb1, 0x42, 0x23, 0x24, 0x15, 0x52, 0xc1, 0x62, 0x33, 0x34, 0x72, 0x82, 0xd1, 0x43, 0x07, 0x25, 0x92, 0x53, 0xf0, 0xe1, 0xf1, 0x63, 0x73, 0x35, 0x16, 0xa2, 0xb2, 0x83, 0x26, 0x44, 0x93, 0x54, 0x64, 0x45, 0xc2, 0xa3, 0x74, 0x36, 0x17, 0xd2, 0x55, 0xe2, 0x65, 0xf2, 0xb3, 0x84, 0xc3, 0xd3, 0x75, 0xe3, 0xf3, 0x46, 0x27, 0x94, 0xa4, 0x85, 0xb4, 0x95, 0xc4, 0xd4, 0xe4, 0xf4, 0xa5, 0xb5, 0xc5, 0xd5, 0xe5, 0xf5, 0x56, 0x66, 0x76, 0x86, 0x96, 0xa6, 0xb6, 0xc6, 0xd6, 0xe6, 0xf6, 0x37, 0x47, 0x57, 0x67, 0x77, 0x87, 0x97, 0xa7, 0xb7, 0xc7, 0xd7, 0xe7, 0xf7, 0x11, 0x00, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x05, 0x06, 0x07, 0x07, 0x06, 0x05, 0x35, 0x01, 0x00, 0x02, 0x11, 0x03, 0x21, 0x31, 0x12, 0x04, 0x41, 0x51, 0x61, 0x71, 0x22, 0x13, 0x05, 0x32, 0x81, 0x91, 0x14, 0xa1, 0xb1, 0x42, 0x23, 0xc1, 0x52, 0xd1, 0xf0, 0x33, 0x24, 0x62, 0xe1, 0x72, 0x82, 0x92, 0x43, 0x53, 0x15, 0x63, 0x73, 0x34, 0xf1, 0x25, 0x06, 0x16, 0xa2, 0xb2, 0x83, 0x07, 0x26, 0x35, 0xc2, 0xd2, 0x44, 0x93, 0x54, 0xa3, 0x17, 0x64, 0x45, 0x55, 0x36, 0x74, 0x65, 0xe2, 0xf2, 0xb3, 0x84, 0xc3, 0xd3, 0x75, 0xe3, 0xf3, 0x46, 0x94, 0xa4, 0x85, 0xb4, 0x95, 0xc4, 0xd4, 0xe4, 0xf4, 0xa5, 0xb5, 0xc5, 0xd5, 0xe5, 0xf5, 0x56, 0x66, 0x76, 0x86, 0x96, 0xa6, 0xb6, 0xc6, 0xd6, 0xe6, 0xf6, 0x27, 0x37, 0x47, 0x57, 0x67, 0x77, 0x87, 0x97, 0xa7, 0xb7, 0xc7, 0xff, 0xda, 0x00, 0x0c, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3f, 0x00, 0xf2, 0xed, 0xb2, 0x8d, 0x4d, 0x45, 0xcd, 0x2f, 0x3f, 0x44, 0x68, 0x93, 0xc3, 0x58, 0xc8, 0xf1, 0x1f, 0x8a, 0x33, 0x86, 0xda, 0x58, 0xc1, 0xa0, 0x02, 0x4f, 0xc4, 0xa1, 0x69, 0xa5, 0x9b, 0x5b, 0x4b, 0x84, 0x73, 0xdf, 0xc9, 0x15, 0xf8, 0xe3, 0xd1, 0x0e, 0x07, 0x93, 0xf3, 0xd1, 0x0f, 0x1c, 0x17, 0xef, 0x2e, 0x3b, 0x5b, 0xdc, 0xff, 0x00, 0xdf, 0x42, 0xbf, 0x8f, 0x8e, 0xdc, 0x82, 0xca, 0xd8, 0x37, 0x11, 0xa9, 0x3d, 0x82, 0x69, 0x2b, 0xc4, 0x6d, 0xc9, 0x75, 0x25, 0xbc, 0xf7, 0xec, 0xa1, 0xb5, 0x74, 0x19, 0x5d, 0x2e, 0x8a, 0x9a, 0x4b, 0x89, 0x7d, 0xc4, 0x68, 0xc6, 0xf6, 0xfe, 0xb2, 0xa0, 0x30, 0x1d, 0x60, 0x86, 0x88, 0x8d, 0x49, 0x3e, 0x01, 0x11, 0x20, 0xa3, 0x8c, 0xb9, 0xb1, 0xaa, 0x62, 0xad, 0xbf, 0x18, 0x97, 0x43, 0x47, 0x1d, 0xd2, 0xaf, 0x04, 0xd9, 0xb8, 0xc8, 0x0d, 0x68, 0xe4, 0xf7, 0x3e, 0x48, 0xf1, 0x05, 0xbc, 0x25, 0xaa, 0x07, 0x71, 0xd9, 0x14, 0x78, 0xf6, 0x49, 0xb5, 0x90, 0xfd, 0xa7, 0xc6, 0x14, 0xfd, 0x1b, 0x1c, 0xff, 0x00, 0x4d, 0x8d, 0x2e, 0x73, 0x8c, 0x35, 0xa3, 0x52, 0x4f, 0x92, 0x48, 0xa6, 0x1a, 0x24, 0xb6, 0x2a, 0xfa, 0xa5, 0x9e, 0x60, 0x64, 0x39, 0x94, 0x13, 0xcb, 0x27, 0x73, 0x80, 0xf3, 0x0c, 0xf6, 0xff, 0x00, 0xd2, 0x5a, 0x78, 0xbf, 0x53, 0x71, 0xf6, 0x01, 0x75, 0xb6, 0x97, 0x6a, 0x25, 0xa1, 0xad, 0x1f, 0xf4, 0xb7, 0x23, 0x48, 0xb7, 0x94, 0x84, 0x97, 0x5b, 0xff, 0x00, 0x32, 0xa9, 0xdd, 0xfc, 0xed, 0x9b, 0x7e, 0x0d, 0x9e, 0x52, 0x4a, 0x95, 0x61, 0xff, 0xd0, 0xf3, 0x3b, 0xa7, 0x70, 0xee, 0x01, 0x8f, 0xb9, 0x59, 0xfa, 0x7e, 0xdf, 0xe4, 0xc8, 0xf9, 0x2a, 0xc2, 0x5c, 0x63, 0xc3, 0x54, 0x67, 0x87, 0x6e, 0x10, 0x35, 0x68, 0xd4, 0x79, 0x1e, 0x53, 0x4a, 0xe0, 0xdc, 0xe9, 0xb8, 0x1f, 0x6a, 0xda, 0x6c, 0x25, 0x94, 0x37, 0xb0, 0xd0, 0xb8, 0xad, 0x67, 0xe4, 0x55, 0x8a, 0x5b, 0x8b, 0x82, 0xc0, 0x6f, 0x76, 0x80, 0x34, 0x49, 0x05, 0x2e, 0x9e, 0xc6, 0x1c, 0x66, 0x31, 0xba, 0x10, 0x23, 0xe0, 0xaf, 0xe1, 0x61, 0x53, 0x43, 0x8d, 0x81, 0xb3, 0x67, 0xef, 0x9e, 0x49, 0x2a, 0x12, 0x6c, 0xb6, 0x63, 0x1a, 0x0c, 0x31, 0xba, 0x55, 0xcd, 0xac, 0xfa, 0x8e, 0xdf, 0x91, 0x6e, 0x91, 0xd9, 0xb3, 0xc9, 0x73, 0x90, 0x7a, 0xab, 0x6a, 0xc2, 0xa4, 0x60, 0xe2, 0x8f, 0xd2, 0x38, 0x03, 0x7d, 0x9e, 0x0d, 0xff, 0x00, 0xcc, 0xd6, 0xd3, 0x6b, 0x71, 0x67, 0xd2, 0x3e, 0x64, 0x72, 0xab, 0xdb, 0x8d, 0x54, 0x39, 0xc5, 0x83, 0x6b, 0x3d, 0xee, 0x2e, 0xd4, 0x92, 0x3c, 0x4a, 0x56, 0xba, 0xb4, 0x79, 0x5c, 0xf7, 0xb2, 0x96, 0x6c, 0x8d, 0xaf, 0x80, 0x48, 0x3c, 0xf0, 0xb2, 0x1f, 0x63, 0x9c, 0xe9, 0x3f, 0x24, 0x5c, 0xdb, 0xdd, 0x76, 0x43, 0xde, 0xfd, 0x5c, 0xe3, 0x24, 0xfc, 0x50, 0x00, 0x93, 0x0a, 0x78, 0x8a, 0x0d, 0x49, 0xca, 0xcf, 0x93, 0x63, 0x1b, 0x7d, 0xd7, 0x57, 0x50, 0xd5, 0xef, 0x70, 0x6b, 0x4f, 0xc7, 0x45, 0xdb, 0x74, 0x9e, 0x8d, 0x5e, 0x33, 0x83, 0xd8, 0x37, 0xdd, 0xc3, 0xac, 0x3d, 0xbf, 0x92, 0xc5, 0x5b, 0xea, 0xbf, 0xd5, 0x62, 0xc0, 0xdc, 0xbc, 0xbd, 0x2d, 0x22, 0x5a, 0xcf, 0xdd, 0x69, 0xff, 0x00, 0xd1, 0x8e, 0x5d, 0xa5, 0x38, 0xb5, 0xb0, 0x00, 0xc6, 0xc4, 0x24, 0x4a, 0xd6, 0x8d, 0x18, 0x04, 0x49, 0x88, 0x9e, 0x55, 0xd6, 0x61, 0xb0, 0xc1, 0x70, 0x32, 0xdd, 0x3c, 0x95, 0xda, 0xf1, 0xfe, 0xf5, 0x62, 0xbc, 0x76, 0x8e, 0x75, 0x28, 0x02, 0xa2, 0xe7, 0x7d, 0x92, 0xb9, 0x84, 0x96, 0x96, 0xda, 0xf7, 0x70, 0x12, 0x4e, 0x5a, 0xff, 0x00, 0xff, 0xd1, 0xf3, 0x7a, 0x21, 0xaf, 0xde, 0xef, 0xa2, 0x22, 0x55, 0xfc, 0x5a, 0xbd, 0x42, 0xfb, 0x08, 0xfa, 0x67, 0x4f, 0x82, 0xcd, 0x6d, 0x85, 0xc0, 0x56, 0x3b, 0x90, 0xb7, 0xf0, 0x2a, 0x0e, 0x63, 0x58, 0x3b, 0xf2, 0xa3, 0x9e, 0x8c, 0xb8, 0x86, 0xbe, 0x49, 0xf1, 0x2c, 0x0c, 0x86, 0xb4, 0x4c, 0x69, 0xe4, 0xaf, 0x6e, 0xcc, 0x6b, 0x7d, 0x46, 0xb3, 0x70, 0xec, 0x38, 0x51, 0x7d, 0x02, 0x8a, 0xc7, 0xa6, 0xd9, 0x20, 0x68, 0x0f, 0x8f, 0x8a, 0xcf, 0xc9, 0xc2, 0xea, 0x59, 0x5b, 0x48, 0xb0, 0x91, 0xae, 0xe6, 0xc9, 0x03, 0xc9, 0x30, 0x51, 0x66, 0xd4, 0x0d, 0xad, 0xbd, 0x5f, 0x53, 0xcc, 0x6b, 0xb6, 0x90, 0x5a, 0x3b, 0x83, 0x0b, 0x43, 0x17, 0x31, 0xd6, 0xc3, 0x6e, 0x12, 0x3b, 0x79, 0xac, 0xc1, 0x89, 0x47, 0xd9, 0xe8, 0x63, 0x98, 0x45, 0xed, 0x6c, 0x5a, 0xf1, 0xa0, 0x27, 0xc5, 0x5b, 0xc3, 0x6f, 0xa6, 0xe0, 0x1c, 0x7d, 0xb3, 0xa2, 0x69, 0x34, 0x7b, 0xae, 0x1a, 0x8d, 0x45, 0x17, 0x9d, 0xeb, 0xfd, 0x21, 0xd8, 0xb9, 0xae, 0xb5, 0x80, 0xbb, 0x1e, 0xd2, 0x5c, 0xd7, 0x78, 0x13, 0xf9, 0xae, 0x4b, 0xea, 0xc7, 0x4a, 0x39, 0xbd, 0x55, 0xb3, 0xed, 0x66, 0x38, 0xf5, 0x09, 0x22, 0x41, 0x23, 0xe8, 0x37, 0xfb, 0x4b, 0xa1, 0xeb, 0xd6, 0xfe, 0x88, 0x31, 0xbf, 0x41, 0xc0, 0xee, 0xd2, 0x74, 0x02, 0x78, 0x53, 0xfa, 0x97, 0x43, 0x19, 0x85, 0x65, 0xff, 0x00, 0x9d, 0x71, 0x33, 0xe4, 0x1a, 0x7d, 0x8d, 0x53, 0x42, 0x56, 0x35, 0x6b, 0xe5, 0x80, 0x06, 0xc7, 0x57, 0xa7, 0xc4, 0xa9, 0xdb, 0xb6, 0x81, 0x1f, 0xeb, 0xd9, 0x69, 0x56, 0xc2, 0xd0, 0x00, 0xe5, 0x55, 0xc0, 0x12, 0xc2, 0xd7, 0x4e, 0xa2, 0x5a, 0x7c, 0x0a, 0xd0, 0x63, 0x9a, 0xd1, 0xaf, 0xd2, 0xe2, 0x3c, 0x12, 0x62, 0x66, 0xc6, 0x42, 0x23, 0x5a, 0x49, 0x8f, 0x10, 0xa2, 0xd2, 0x3e, 0x28, 0x9d, 0xc4, 0x88, 0x09, 0x29, 0x16, 0xc3, 0x3c, 0x24, 0x8d, 0xe6, 0x92, 0x72, 0x1f, 0xff, 0xd2, 0xf3, 0xbb, 0xb0, 0xfe, 0xcb, 0x99, 0xe9, 0xce, 0xf6, 0x88, 0x2d, 0x77, 0x91, 0x5b, 0x3d, 0x3d, 0xd0, 0xe6, 0x90, 0xa9, 0x65, 0x57, 0x38, 0x95, 0xdd, 0xcb, 0x9a, 0x7d, 0xce, 0xf2, 0x3f, 0x44, 0x23, 0x60, 0x58, 0x76, 0xe9, 0xca, 0x8c, 0xea, 0x1b, 0x31, 0x02, 0x32, 0x23, 0xea, 0xee, 0xb1, 0xcd, 0xb0, 0xc7, 0x87, 0x74, 0x7a, 0xeb, 0x70, 0x1a, 0x71, 0xe1, 0xfe, 0xe4, 0x1c, 0x1d, 0xae, 0xe5, 0x69, 0xd8, 0xfa, 0x99, 0x50, 0x0d, 0x1a, 0xf7, 0x2a, 0x3a, 0x0c, 0xf4, 0x1a, 0x8e, 0xc7, 0x27, 0x5d, 0xbf, 0x18, 0x41, 0xdc, 0xc2, 0xf0, 0x7f, 0x74, 0xf6, 0x3a, 0x22, 0x66, 0xdb, 0x68, 0xc6, 0x80, 0x48, 0x6b, 0x88, 0x06, 0x39, 0x0d, 0xee, 0xaa, 0x1f, 0xb3, 0xd5, 0x1b, 0x83, 0xd8, 0x3b, 0x38, 0x8f, 0x69, 0xfe, 0xdf, 0xd1, 0x4d, 0x29, 0xa1, 0x4c, 0x7a, 0xf4, 0xbf, 0xa7, 0x92, 0xcf, 0xa5, 0x20, 0x08, 0xf3, 0xf6, 0xff, 0x00, 0x15, 0xbb, 0xd1, 0x31, 0xd9, 0x5e, 0x3d, 0x75, 0x56, 0x36, 0x88, 0x00, 0x81, 0xe0, 0x16, 0x5e, 0x55, 0x74, 0x3f, 0x00, 0x9d, 0xe0, 0xcc, 0x69, 0xe7, 0x3a, 0x2d, 0xbe, 0x90, 0x00, 0xa9, 0xae, 0xef, 0x1f, 0x95, 0x4b, 0x0d, 0x9a, 0xdc, 0xc7, 0x45, 0xfe, 0xb1, 0x7d, 0x60, 0xa7, 0xa1, 0xe0, 0x1f, 0x4e, 0x1d, 0x99, 0x69, 0x02, 0x9a, 0xcf, 0x1f, 0xca, 0x7b, 0xbf, 0x90, 0xc5, 0xc2, 0xb3, 0xeb, 0x57, 0xd6, 0x03, 0x6b, 0xae, 0x39, 0xb6, 0x82, 0xe3, 0x31, 0xa1, 0x68, 0xf2, 0x6b, 0x5c, 0x12, 0xfa, 0xe1, 0x91, 0x66, 0x47, 0x5d, 0xb8, 0x3b, 0x4f, 0x44, 0x36, 0xb6, 0x8f, 0x28, 0xdd, 0xff, 0x00, 0x7e, 0x46, 0xab, 0x12, 0x2b, 0x65, 0x55, 0x32, 0xa7, 0x62, 0xb6, 0xbd, 0xf7, 0x64, 0x10, 0xdb, 0x03, 0x9f, 0x1b, 0x9e, 0xc7, 0xd9, 0xb8, 0x3b, 0x1f, 0x67, 0xf3, 0x6c, 0x52, 0x80, 0xd7, 0x7d, 0x0f, 0xea, 0x7f, 0x5d, 0x1d, 0x67, 0xa6, 0x0b, 0x1e, 0x47, 0xda, 0x69, 0x3b, 0x2e, 0x03, 0xc7, 0xf3, 0x5f, 0x1f, 0xf0, 0x8b, 0xa1, 0x02, 0x46, 0xba, 0x79, 0xaf, 0x32, 0xff, 0x00, 0x16, 0xad, 0xca, 0x1d, 0x57, 0x2a, 0xdc, 0x79, 0x18, 0x41, 0xb0, 0xf6, 0x9e, 0xe4, 0x9f, 0xd0, 0x8f, 0xeb, 0x31, 0xab, 0xd2, 0x83, 0xa4, 0xcb, 0x8c, 0xb8, 0xa0, 0x42, 0x12, 0x7b, 0x67, 0x9f, 0x2f, 0xf5, 0x09, 0x26, 0x96, 0xc4, 0xce, 0xa9, 0x20, 0xa7, 0xff, 0xd3, 0xf3, 0x2f, 0xb4, 0x5d, 0xe9, 0x0a, 0xb7, 0x9f, 0x4c, 0x19, 0xdb, 0x3a, 0x2d, 0x5e, 0x94, 0xfd, 0xc4, 0xb7, 0xc5, 0x62, 0xf9, 0x2b, 0xfd, 0x2e, 0xe3, 0x5d, 0xe0, 0x7c, 0x13, 0x48, 0xd1, 0x92, 0x12, 0xa9, 0x0b, 0x7a, 0xbc, 0x2d, 0xc2, 0x7f, 0x92, 0x60, 0xab, 0x4e, 0x79, 0x2e, 0x00, 0xf0, 0xaa, 0xe1, 0xda, 0x3d, 0x43, 0xfc, 0xad, 0x55, 0xbb, 0x80, 0x79, 0x81, 0xa0, 0xe6, 0x54, 0x32, 0x6d, 0x02, 0xbe, 0xf3, 0x61, 0x81, 0xa8, 0x44, 0x14, 0x03, 0x59, 0x0e, 0x1c, 0xf6, 0x1f, 0xdc, 0xb2, 0xec, 0xa3, 0x23, 0x77, 0xe8, 0x6e, 0x70, 0xf2, 0x25, 0x1f, 0x1f, 0x17, 0xa9, 0x6d, 0x71, 0x36, 0x97, 0x47, 0x00, 0xa4, 0x02, 0xe0, 0x2c, 0x7c, 0xc1, 0xab, 0xd5, 0x31, 0x85, 0x35, 0xd4, 0xe6, 0x13, 0x02, 0xd6, 0x4b, 0x67, 0x48, 0x2b, 0xa9, 0xe9, 0x2e, 0x02, 0xb6, 0x4f, 0x82, 0xe5, 0x7a, 0x95, 0x19, 0xc6, 0x87, 0x3d, 0xfb, 0xa2, 0xb8, 0x79, 0x1e, 0x4d, 0x3b, 0x96, 0xcf, 0x4f, 0xbd, 0xcd, 0xa2, 0xa2, 0x1f, 0xa0, 0x82, 0xd3, 0xfc, 0x97, 0x05, 0x24, 0x36, 0x6b, 0xf3, 0x31, 0xa2, 0x35, 0x79, 0xef, 0xad, 0xf8, 0xae, 0xaf, 0xaf, 0xd8, 0xf2, 0xd8, 0x6d, 0xed, 0x6b, 0xda, 0x7b, 0x18, 0x1b, 0x5d, 0xff, 0x00, 0x52, 0xb1, 0x6d, 0xf0, 0x81, 0x31, 0xca, 0xf4, 0x6e, 0xb1, 0x80, 0xce, 0xb1, 0x84, 0xc0, 0x21, 0xb7, 0xd6, 0x77, 0x31, 0xd1, 0x27, 0xc1, 0xcd, 0xfe, 0xd2, 0xe3, 0xec, 0xe8, 0x1d, 0x45, 0x96, 0xb0, 0x9a, 0xb7, 0x87, 0x3f, 0x68, 0x2d, 0xf7, 0x01, 0x1f, 0xbe, 0xd1, 0xf4, 0x7f, 0xb4, 0xa4, 0x0d, 0x77, 0xbb, 0xfa, 0x8f, 0x80, 0x3a, 0x7f, 0x43, 0xaa, 0xe2, 0xdf, 0xd2, 0x65, 0x7e, 0x95, 0xe4, 0x0f, 0x1f, 0xa1, 0xfe, 0x6b, 0x16, 0x9f, 0x52, 0xfa, 0xc1, 0xd3, 0xba, 0x6d, 0x26, 0xdc, 0xac, 0x86, 0xd4, 0xd9, 0x0d, 0x31, 0x2e, 0x74, 0x9e, 0xdb, 0x59, 0x2e, 0x55, 0xe8, 0xc9, 0xb2, 0x96, 0xd5, 0x4b, 0x9f, 0xb8, 0x6d, 0xda, 0x1c, 0x04, 0x09, 0x03, 0xfe, 0x8a, 0xc6, 0xfa, 0xd3, 0xf5, 0x6a, 0xbe, 0xbb, 0x5b, 0x2e, 0xc6, 0xb5, 0x94, 0xe6, 0xd5, 0x20, 0x97, 0x7d, 0x1b, 0x1b, 0xf9, 0xad, 0x7c, 0x7d, 0x17, 0xb7, 0xf3, 0x1e, 0x92, 0x1b, 0x7f, 0xf8, 0xe0, 0x7d, 0x59, 0xdd, 0xfd, 0x32, 0xd8, 0x8f, 0xa5, 0xe8, 0x3a, 0x12, 0x5c, 0x3f, 0xfc, 0xc4, 0xfa, 0xc3, 0xb3, 0x77, 0xa7, 0x56, 0xed, 0xdb, 0x76, 0x7a, 0x8d, 0xdd, 0x1f, 0xbf, 0xfd, 0x44, 0x92, 0x56, 0x8f, 0xff, 0xd4, 0xf2, 0xe8, 0x86, 0x17, 0x1e, 0xfa, 0x04, 0x56, 0x4b, 0x43, 0x6c, 0x6f, 0x2d, 0xe5, 0x46, 0x01, 0x64, 0x2b, 0x14, 0x32, 0x5b, 0xb4, 0xa0, 0x52, 0x1d, 0xde, 0x9b, 0x94, 0xdb, 0xab, 0x6b, 0x81, 0xf7, 0x05, 0xb0, 0xd7, 0x07, 0xb2, 0x27, 0x55, 0xc6, 0x57, 0x65, 0xd8, 0x76, 0x6e, 0x64, 0xed, 0xee, 0x16, 0xce, 0x27, 0x57, 0x63, 0xda, 0x0c, 0xc2, 0x8e, 0x51, 0x67, 0x84, 0xfa, 0x1d, 0xdd, 0x62, 0xc7, 0x07, 0xe9, 0xf7, 0xa3, 0xd6, 0x6c, 0x02, 0x41, 0x55, 0x31, 0xf3, 0x2b, 0xb3, 0xba, 0x2b, 0x2e, 0x68, 0x24, 0x1d, 0x47, 0x64, 0xca, 0xa6, 0x50, 0x41, 0x65, 0x90, 0x6c, 0xb1, 0xa5, 0xae, 0x33, 0x23, 0x51, 0xe4, 0xab, 0x7d, 0x5d, 0xcb, 0xb6, 0xcc, 0x37, 0xd0, 0x40, 0x73, 0x71, 0xde, 0x58, 0x09, 0xe7, 0x6f, 0x2c, 0x44, 0xc9, 0xc9, 0xae, 0xba, 0x9d, 0x63, 0x88, 0x01, 0xa0, 0x95, 0x9d, 0xf5, 0x3f, 0x2a, 0xe6, 0x67, 0xdb, 0x50, 0x83, 0x55, 0xad, 0x36, 0x3e, 0x78, 0x10, 0x74, 0x77, 0xfd, 0x2d, 0xaa, 0x4c, 0x7d, 0x58, 0x73, 0x91, 0xa0, 0x0f, 0x51, 0x45, 0xb7, 0x33, 0xdd, 0x58, 0x69, 0x1d, 0xd8, 0x0c, 0x9f, 0x96, 0x88, 0x19, 0x99, 0x19, 0xac, 0xcf, 0xa3, 0xd2, 0xad, 0xb5, 0xdb, 0x76, 0x8f, 0xad, 0xc4, 0xea, 0xcf, 0xdf, 0x7e, 0xdf, 0xdd, 0xfc, 0xd5, 0xa3, 0x5e, 0x43, 0x2b, 0x6b, 0xb2, 0xad, 0x3b, 0x6a, 0xa4, 0x13, 0xa7, 0x04, 0xac, 0x7a, 0x6f, 0xb3, 0x23, 0x26, 0xcc, 0xfb, 0xb4, 0x75, 0x8e, 0x01, 0x83, 0xf7, 0x58, 0x3e, 0x8b, 0x53, 0xa7, 0x2a, 0x1a, 0x31, 0x42, 0x36, 0x5d, 0x4c, 0x9a, 0xf2, 0xdc, 0xc6, 0xfe, 0x98, 0xb4, 0x34, 0xcb, 0x48, 0x0a, 0x8f, 0xdb, 0xb2, 0xeb, 0x76, 0xd6, 0x07, 0x5c, 0x59, 0xc9, 0x64, 0x8f, 0x93, 0xa7, 0x73, 0x16, 0x83, 0xaf, 0x0e, 0xa4, 0x33, 0xef, 0x50, 0xc5, 0x0c, 0xda, 0x59, 0x10, 0x06, 0x8a, 0x2e, 0x29, 0x0e, 0xac, 0xc2, 0x31, 0x3d, 0x36, 0x69, 0x7e, 0xd6, 0xcc, 0xf5, 0x3d, 0x6f, 0xb3, 0xeb, 0x1b, 0x76, 0xef, 0x3b, 0xa3, 0xfa, 0xc9, 0x2b, 0x5f, 0x66, 0x6f, 0xa9, 0x1e, 0x73, 0xf2, 0x49, 0x2e, 0x39, 0xf7, 0x4f, 0xb7, 0x8d, 0xff, 0xd5, 0xf3, 0x26, 0xfe, 0x0a, 0xc5, 0x1b, 0xa7, 0xcb, 0xb2, 0xcf, 0x49, 0x03, 0xb2, 0x46, 0xee, 0xd9, 0xd9, 0xb3, 0xf4, 0x9f, 0x25, 0x4a, 0xdf, 0x4b, 0x77, 0xe8, 0x27, 0xd4, 0xef, 0x1c, 0x2a, 0x29, 0x26, 0xc5, 0x7c, 0x9d, 0x6c, 0x7f, 0xb7, 0x6e, 0x1b, 0x26, 0x7f, 0x05, 0xa3, 0xfe, 0x53, 0x8d, 0x62, 0x57, 0x30, 0x92, 0x12, 0xfa, 0x2f, 0x86, 0xdf, 0xa4, 0xec, 0x67, 0xfe, 0xd0, 0xf4, 0xff, 0x00, 0x4d, 0xfc, 0xdf, 0x78, 0xe1, 0x68, 0x7d, 0x54, 0x99, 0xbf, 0x6f, 0xf3, 0xbe, 0xdf, 0x8e, 0xdd, 0x7f, 0xef, 0xeb, 0x97, 0x49, 0x3e, 0x3b, 0x7f, 0x06, 0x2c, 0x9f, 0x37, 0x5f, 0xf0, 0x9f, 0x4c, 0xeb, 0x7b, 0xbf, 0x67, 0x55, 0xe8, 0xff, 0x00, 0x31, 0xbc, 0x7a, 0x9e, 0x31, 0xdb, 0xfe, 0x92, 0xae, 0x37, 0x7a, 0x4d, 0xdb, 0xe2, 0x17, 0x9d, 0xa4, 0xa3, 0xc9, 0xba, 0xfc, 0x7b, 0x7d, 0x5f, 0x52, 0xa7, 0x7e, 0xd1, 0x28, 0xf8, 0xf3, 0xb0, 0xc7, 0x32, 0xbc, 0x99, 0x24, 0xc5, 0xe3, 0xab, 0xeb, 0x1f, 0xa4, 0xf5, 0xfc, 0xe1, 0x25, 0xe4, 0xe9, 0x24, 0x97, 0xff, 0xd9, 0xff, 0xed, 0x2e, 0x1c, 0x50, 0x68, 0x6f, 0x74, 0x6f, 0x73, 0x68, 0x6f, 0x70, 0x20, 0x33, 0x2e, 0x30, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x1c, 0x02, 0x00, 0x00, 0x02, 0x00, 0x02, 0x1c, 0x02, 0x78, 0x00, 0x1f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xfb, 0x09, 0xa6, 0xbd, 0x07, 0x4c, 0x2a, 0x36, 0x9d, 0x8f, 0xe2, 0xcc, 0x57, 0xa9, 0xac, 0x85, 0x38, 0x42, 0x49, 0x4d, 0x03, 0xea, 0x00, 0x00, 0x00, 0x00, 0x1d, 0xb0, 0x3c, 0x3f, 0x78, 0x6d, 0x6c, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x31, 0x2e, 0x30, 0x22, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x3d, 0x22, 0x55, 0x54, 0x46, 0x2d, 0x38, 0x22, 0x3f, 0x3e, 0x0a, 0x3c, 0x21, 0x44, 0x4f, 0x43, 0x54, 0x59, 0x50, 0x45, 0x20, 0x70, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x20, 0x22, 0x2d, 0x2f, 0x2f, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x72, 0x2f, 0x2f, 0x44, 0x54, 0x44, 0x20, 0x50, 0x4c, 0x49, 0x53, 0x54, 0x20, 0x31, 0x2e, 0x30, 0x2f, 0x2f, 0x45, 0x4e, 0x22, 0x20, 0x22, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x44, 0x54, 0x44, 0x73, 0x2f, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x2d, 0x31, 0x2e, 0x30, 0x2e, 0x64, 0x74, 0x64, 0x22, 0x3e, 0x0a, 0x3c, 0x70, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x31, 0x2e, 0x30, 0x22, 0x3e, 0x0a, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x48, 0x6f, 0x72, 0x69, 0x7a, 0x6f, 0x6e, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x48, 0x6f, 0x72, 0x69, 0x7a, 0x6f, 0x6e, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x37, 0x32, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x4f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x4f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x31, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x53, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x53, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x31, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x56, 0x65, 0x72, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x56, 0x65, 0x72, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x37, 0x32, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x56, 0x65, 0x72, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x56, 0x65, 0x72, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x63, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x31, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x73, 0x75, 0x62, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x61, 0x70, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x30, 0x2e, 0x30, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x30, 0x2e, 0x30, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x37, 0x33, 0x34, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x35, 0x37, 0x36, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x50, 0x61, 0x70, 0x65, 0x72, 0x52, 0x65, 0x63, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x50, 0x4d, 0x41, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x50, 0x61, 0x70, 0x65, 0x72, 0x52, 0x65, 0x63, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x2d, 0x31, 0x38, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x2d, 0x31, 0x38, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x37, 0x37, 0x34, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x35, 0x39, 0x34, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x4d, 0x50, 0x61, 0x70, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x6d, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x4d, 0x50, 0x61, 0x70, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x6e, 0x61, 0x2d, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x6d, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x33, 0x2d, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x54, 0x31, 0x37, 0x3a, 0x34, 0x39, 0x3a, 0x33, 0x36, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x31, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x4d, 0x55, 0x6e, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x6d, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x4d, 0x55, 0x6e, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x30, 0x2e, 0x30, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x30, 0x2e, 0x30, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x37, 0x33, 0x34, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x35, 0x37, 0x36, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x4d, 0x55, 0x6e, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x50, 0x61, 0x70, 0x65, 0x72, 0x52, 0x65, 0x63, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x6d, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x50, 0x4d, 0x55, 0x6e, 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x50, 0x61, 0x70, 0x65, 0x72, 0x52, 0x65, 0x63, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x2d, 0x31, 0x38, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x2d, 0x31, 0x38, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x37, 0x37, 0x34, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x35, 0x39, 0x34, 0x3c, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x33, 0x30, 0x54, 0x32, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x31, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x30, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x70, 0x70, 0x64, 0x2e, 0x50, 0x4d, 0x50, 0x61, 0x70, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x6d, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x70, 0x70, 0x64, 0x2e, 0x50, 0x4d, 0x50, 0x61, 0x70, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x55, 0x53, 0x20, 0x4c, 0x65, 0x74, 0x74, 0x65, 0x72, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x70, 0x6d, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x44, 0x61, 0x74, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x32, 0x30, 0x30, 0x33, 0x2d, 0x30, 0x37, 0x2d, 0x30, 0x31, 0x54, 0x31, 0x37, 0x3a, 0x34, 0x39, 0x3a, 0x33, 0x36, 0x5a, 0x3c, 0x2f, 0x64, 0x61, 0x74, 0x65, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x61, 0x67, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x31, 0x3c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x09, 0x3c, 0x2f, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x41, 0x50, 0x49, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x30, 0x30, 0x2e, 0x32, 0x30, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x63, 0x6b, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2f, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x70, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x41, 0x50, 0x49, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x30, 0x30, 0x2e, 0x32, 0x30, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x63, 0x6b, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2f, 0x3e, 0x0a, 0x09, 0x3c, 0x6b, 0x65, 0x79, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x3c, 0x2f, 0x6b, 0x65, 0x79, 0x3e, 0x0a, 0x09, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x3c, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x3c, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x3e, 0x0a, 0x3c, 0x2f, 0x70, 0x6c, 0x69, 0x73, 0x74, 0x3e, 0x0a, 0x38, 0x42, 0x49, 0x4d, 0x03, 0xe9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x03, 0x00, 0x00, 0x00, 0x48, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x02, 0xde, 0x02, 0x40, 0xff, 0xee, 0xff, 0xee, 0x03, 0x06, 0x02, 0x52, 0x03, 0x67, 0x05, 0x28, 0x03, 0xfc, 0x00, 0x02, 0x00, 0x00, 0x00, 0x48, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x02, 0xd8, 0x02, 0x28, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x01, 0x7f, 0xff, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x08, 0x00, 0x19, 0x01, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x03, 0xed, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1e, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1e, 0x38, 0x42, 0x49, 0x4d, 0x03, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x27, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x38, 0x42, 0x49, 0x4d, 0x03, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x2f, 0x66, 0x66, 0x00, 0x01, 0x00, 0x6c, 0x66, 0x66, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x2f, 0x66, 0x66, 0x00, 0x01, 0x00, 0xa1, 0x99, 0x9a, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x32, 0x00, 0x00, 0x00, 0x01, 0x00, 0x5a, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x35, 0x00, 0x00, 0x00, 0x01, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x38, 0x42, 0x49, 0x4d, 0x03, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xe8, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xe8, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xe8, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xe8, 0x00, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x03, 0x45, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x08, 0x00, 0x44, 0x00, 0x53, 0x00, 0x43, 0x00, 0x30, 0x00, 0x32, 0x00, 0x33, 0x00, 0x32, 0x00, 0x35, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x75, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x4f, 0x62, 0x6a, 0x63, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x63, 0x74, 0x31, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x54, 0x6f, 0x70, 0x20, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x65, 0x66, 0x74, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x74, 0x6f, 0x6d, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x52, 0x67, 0x68, 0x74, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x06, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x73, 0x56, 0x6c, 0x4c, 0x73, 0x00, 0x00, 0x00, 0x01, 0x4f, 0x62, 0x6a, 0x63, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x07, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x49, 0x44, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x65, 0x6e, 0x75, 0x6d, 0x00, 0x00, 0x00, 0x0c, 0x45, 0x53, 0x6c, 0x69, 0x63, 0x65, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x0d, 0x61, 0x75, 0x74, 0x6f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x00, 0x00, 0x00, 0x00, 0x54, 0x79, 0x70, 0x65, 0x65, 0x6e, 0x75, 0x6d, 0x00, 0x00, 0x00, 0x0a, 0x45, 0x53, 0x6c, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x00, 0x00, 0x00, 0x00, 0x49, 0x6d, 0x67, 0x20, 0x00, 0x00, 0x00, 0x06, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x4f, 0x62, 0x6a, 0x63, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x63, 0x74, 0x31, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x54, 0x6f, 0x70, 0x20, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x65, 0x66, 0x74, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x74, 0x6f, 0x6d, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x52, 0x67, 0x68, 0x74, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x03, 0x75, 0x72, 0x6c, 0x54, 0x45, 0x58, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x75, 0x6c, 0x6c, 0x54, 0x45, 0x58, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x73, 0x67, 0x65, 0x54, 0x45, 0x58, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x61, 0x6c, 0x74, 0x54, 0x61, 0x67, 0x54, 0x45, 0x58, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x63, 0x65, 0x6c, 0x6c, 0x54, 0x65, 0x78, 0x74, 0x49, 0x73, 0x48, 0x54, 0x4d, 0x4c, 0x62, 0x6f, 0x6f, 0x6c, 0x01, 0x00, 0x00, 0x00, 0x08, 0x63, 0x65, 0x6c, 0x6c, 0x54, 0x65, 0x78, 0x74, 0x54, 0x45, 0x58, 0x54, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x68, 0x6f, 0x72, 0x7a, 0x41, 0x6c, 0x69, 0x67, 0x6e, 0x65, 0x6e, 0x75, 0x6d, 0x00, 0x00, 0x00, 0x0f, 0x45, 0x53, 0x6c, 0x69, 0x63, 0x65, 0x48, 0x6f, 0x72, 0x7a, 0x41, 0x6c, 0x69, 0x67, 0x6e, 0x00, 0x00, 0x00, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x00, 0x00, 0x00, 0x09, 0x76, 0x65, 0x72, 0x74, 0x41, 0x6c, 0x69, 0x67, 0x6e, 0x65, 0x6e, 0x75, 0x6d, 0x00, 0x00, 0x00, 0x0f, 0x45, 0x53, 0x6c, 0x69, 0x63, 0x65, 0x56, 0x65, 0x72, 0x74, 0x41, 0x6c, 0x69, 0x67, 0x6e, 0x00, 0x00, 0x00, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x00, 0x00, 0x00, 0x0b, 0x62, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x65, 0x6e, 0x75, 0x6d, 0x00, 0x00, 0x00, 0x11, 0x45, 0x53, 0x6c, 0x69, 0x63, 0x65, 0x42, 0x47, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x79, 0x70, 0x65, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x6f, 0x6e, 0x65, 0x00, 0x00, 0x00, 0x09, 0x74, 0x6f, 0x70, 0x4f, 0x75, 0x74, 0x73, 0x65, 0x74, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x6c, 0x65, 0x66, 0x74, 0x4f, 0x75, 0x74, 0x73, 0x65, 0x74, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x4f, 0x75, 0x74, 0x73, 0x65, 0x74, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x72, 0x69, 0x67, 0x68, 0x74, 0x4f, 0x75, 0x74, 0x73, 0x65, 0x74, 0x6c, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x09, 0xf9, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x01, 0x2c, 0x00, 0x00, 0x75, 0x30, 0x00, 0x00, 0x09, 0xdd, 0x00, 0x18, 0x00, 0x01, 0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x02, 0x01, 0x00, 0x48, 0x00, 0x48, 0x00, 0x00, 0xff, 0xed, 0x00, 0x0c, 0x41, 0x64, 0x6f, 0x62, 0x65, 0x5f, 0x43, 0x4d, 0x00, 0x02, 0xff, 0xee, 0x00, 0x0e, 0x41, 0x64, 0x6f, 0x62, 0x65, 0x00, 0x64, 0x80, 0x00, 0x00, 0x00, 0x01, 0xff, 0xdb, 0x00, 0x84, 0x00, 0x0c, 0x08, 0x08, 0x08, 0x09, 0x08, 0x0c, 0x09, 0x09, 0x0c, 0x11, 0x0b, 0x0a, 0x0b, 0x11, 0x15, 0x0f, 0x0c, 0x0c, 0x0f, 0x15, 0x18, 0x13, 0x13, 0x15, 0x13, 0x13, 0x18, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x01, 0x0d, 0x0b, 0x0b, 0x0d, 0x0e, 0x0d, 0x10, 0x0e, 0x0e, 0x10, 0x14, 0x0e, 0x0e, 0x0e, 0x14, 0x14, 0x0e, 0x0e, 0x0e, 0x0e, 0x14, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x11, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xff, 0xc0, 0x00, 0x11, 0x08, 0x00, 0x64, 0x00, 0x64, 0x03, 0x01, 0x22, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xff, 0xdd, 0x00, 0x04, 0x00, 0x07, 0xff, 0xc4, 0x01, 0x3f, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x01, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x10, 0x00, 0x01, 0x04, 0x01, 0x03, 0x02, 0x04, 0x02, 0x05, 0x07, 0x06, 0x08, 0x05, 0x03, 0x0c, 0x33, 0x01, 0x00, 0x02, 0x11, 0x03, 0x04, 0x21, 0x12, 0x31, 0x05, 0x41, 0x51, 0x61, 0x13, 0x22, 0x71, 0x81, 0x32, 0x06, 0x14, 0x91, 0xa1, 0xb1, 0x42, 0x23, 0x24, 0x15, 0x52, 0xc1, 0x62, 0x33, 0x34, 0x72, 0x82, 0xd1, 0x43, 0x07, 0x25, 0x92, 0x53, 0xf0, 0xe1, 0xf1, 0x63, 0x73, 0x35, 0x16, 0xa2, 0xb2, 0x83, 0x26, 0x44, 0x93, 0x54, 0x64, 0x45, 0xc2, 0xa3, 0x74, 0x36, 0x17, 0xd2, 0x55, 0xe2, 0x65, 0xf2, 0xb3, 0x84, 0xc3, 0xd3, 0x75, 0xe3, 0xf3, 0x46, 0x27, 0x94, 0xa4, 0x85, 0xb4, 0x95, 0xc4, 0xd4, 0xe4, 0xf4, 0xa5, 0xb5, 0xc5, 0xd5, 0xe5, 0xf5, 0x56, 0x66, 0x76, 0x86, 0x96, 0xa6, 0xb6, 0xc6, 0xd6, 0xe6, 0xf6, 0x37, 0x47, 0x57, 0x67, 0x77, 0x87, 0x97, 0xa7, 0xb7, 0xc7, 0xd7, 0xe7, 0xf7, 0x11, 0x00, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x05, 0x06, 0x07, 0x07, 0x06, 0x05, 0x35, 0x01, 0x00, 0x02, 0x11, 0x03, 0x21, 0x31, 0x12, 0x04, 0x41, 0x51, 0x61, 0x71, 0x22, 0x13, 0x05, 0x32, 0x81, 0x91, 0x14, 0xa1, 0xb1, 0x42, 0x23, 0xc1, 0x52, 0xd1, 0xf0, 0x33, 0x24, 0x62, 0xe1, 0x72, 0x82, 0x92, 0x43, 0x53, 0x15, 0x63, 0x73, 0x34, 0xf1, 0x25, 0x06, 0x16, 0xa2, 0xb2, 0x83, 0x07, 0x26, 0x35, 0xc2, 0xd2, 0x44, 0x93, 0x54, 0xa3, 0x17, 0x64, 0x45, 0x55, 0x36, 0x74, 0x65, 0xe2, 0xf2, 0xb3, 0x84, 0xc3, 0xd3, 0x75, 0xe3, 0xf3, 0x46, 0x94, 0xa4, 0x85, 0xb4, 0x95, 0xc4, 0xd4, 0xe4, 0xf4, 0xa5, 0xb5, 0xc5, 0xd5, 0xe5, 0xf5, 0x56, 0x66, 0x76, 0x86, 0x96, 0xa6, 0xb6, 0xc6, 0xd6, 0xe6, 0xf6, 0x27, 0x37, 0x47, 0x57, 0x67, 0x77, 0x87, 0x97, 0xa7, 0xb7, 0xc7, 0xff, 0xda, 0x00, 0x0c, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3f, 0x00, 0xf2, 0xed, 0xb2, 0x8d, 0x4d, 0x45, 0xcd, 0x2f, 0x3f, 0x44, 0x68, 0x93, 0xc3, 0x58, 0xc8, 0xf1, 0x1f, 0x8a, 0x33, 0x86, 0xda, 0x58, 0xc1, 0xa0, 0x02, 0x4f, 0xc4, 0xa1, 0x69, 0xa5, 0x9b, 0x5b, 0x4b, 0x84, 0x73, 0xdf, 0xc9, 0x15, 0xf8, 0xe3, 0xd1, 0x0e, 0x07, 0x93, 0xf3, 0xd1, 0x0f, 0x1c, 0x17, 0xef, 0x2e, 0x3b, 0x5b, 0xdc, 0xff, 0x00, 0xdf, 0x42, 0xbf, 0x8f, 0x8e, 0xdc, 0x82, 0xca, 0xd8, 0x37, 0x11, 0xa9, 0x3d, 0x82, 0x69, 0x2b, 0xc4, 0x6d, 0xc9, 0x75, 0x25, 0xbc, 0xf7, 0xec, 0xa1, 0xb5, 0x74, 0x19, 0x5d, 0x2e, 0x8a, 0x9a, 0x4b, 0x89, 0x7d, 0xc4, 0x68, 0xc6, 0xf6, 0xfe, 0xb2, 0xa0, 0x30, 0x1d, 0x60, 0x86, 0x88, 0x8d, 0x49, 0x3e, 0x01, 0x11, 0x20, 0xa3, 0x8c, 0xb9, 0xb1, 0xaa, 0x62, 0xad, 0xbf, 0x18, 0x97, 0x43, 0x47, 0x1d, 0xd2, 0xaf, 0x04, 0xd9, 0xb8, 0xc8, 0x0d, 0x68, 0xe4, 0xf7, 0x3e, 0x48, 0xf1, 0x05, 0xbc, 0x25, 0xaa, 0x07, 0x71, 0xd9, 0x14, 0x78, 0xf6, 0x49, 0xb5, 0x90, 0xfd, 0xa7, 0xc6, 0x14, 0xfd, 0x1b, 0x1c, 0xff, 0x00, 0x4d, 0x8d, 0x2e, 0x73, 0x8c, 0x35, 0xa3, 0x52, 0x4f, 0x92, 0x48, 0xa6, 0x1a, 0x24, 0xb6, 0x2a, 0xfa, 0xa5, 0x9e, 0x60, 0x64, 0x39, 0x94, 0x13, 0xcb, 0x27, 0x73, 0x80, 0xf3, 0x0c, 0xf6, 0xff, 0x00, 0xd2, 0x5a, 0x78, 0xbf, 0x53, 0x71, 0xf6, 0x01, 0x75, 0xb6, 0x97, 0x6a, 0x25, 0xa1, 0xad, 0x1f, 0xf4, 0xb7, 0x23, 0x48, 0xb7, 0x94, 0x84, 0x97, 0x5b, 0xff, 0x00, 0x32, 0xa9, 0xdd, 0xfc, 0xed, 0x9b, 0x7e, 0x0d, 0x9e, 0x52, 0x4a, 0x95, 0x61, 0xff, 0xd0, 0xf3, 0x3b, 0xa7, 0x70, 0xee, 0x01, 0x8f, 0xb9, 0x59, 0xfa, 0x7e, 0xdf, 0xe4, 0xc8, 0xf9, 0x2a, 0xc2, 0x5c, 0x63, 0xc3, 0x54, 0x67, 0x87, 0x6e, 0x10, 0x35, 0x68, 0xd4, 0x79, 0x1e, 0x53, 0x4a, 0xe0, 0xdc, 0xe9, 0xb8, 0x1f, 0x6a, 0xda, 0x6c, 0x25, 0x94, 0x37, 0xb0, 0xd0, 0xb8, 0xad, 0x67, 0xe4, 0x55, 0x8a, 0x5b, 0x8b, 0x82, 0xc0, 0x6f, 0x76, 0x80, 0x34, 0x49, 0x05, 0x2e, 0x9e, 0xc6, 0x1c, 0x66, 0x31, 0xba, 0x10, 0x23, 0xe0, 0xaf, 0xe1, 0x61, 0x53, 0x43, 0x8d, 0x81, 0xb3, 0x67, 0xef, 0x9e, 0x49, 0x2a, 0x12, 0x6c, 0xb6, 0x63, 0x1a, 0x0c, 0x31, 0xba, 0x55, 0xcd, 0xac, 0xfa, 0x8e, 0xdf, 0x91, 0x6e, 0x91, 0xd9, 0xb3, 0xc9, 0x73, 0x90, 0x7a, 0xab, 0x6a, 0xc2, 0xa4, 0x60, 0xe2, 0x8f, 0xd2, 0x38, 0x03, 0x7d, 0x9e, 0x0d, 0xff, 0x00, 0xcc, 0xd6, 0xd3, 0x6b, 0x71, 0x67, 0xd2, 0x3e, 0x64, 0x72, 0xab, 0xdb, 0x8d, 0x54, 0x39, 0xc5, 0x83, 0x6b, 0x3d, 0xee, 0x2e, 0xd4, 0x92, 0x3c, 0x4a, 0x56, 0xba, 0xb4, 0x79, 0x5c, 0xf7, 0xb2, 0x96, 0x6c, 0x8d, 0xaf, 0x80, 0x48, 0x3c, 0xf0, 0xb2, 0x1f, 0x63, 0x9c, 0xe9, 0x3f, 0x24, 0x5c, 0xdb, 0xdd, 0x76, 0x43, 0xde, 0xfd, 0x5c, 0xe3, 0x24, 0xfc, 0x50, 0x00, 0x93, 0x0a, 0x78, 0x8a, 0x0d, 0x49, 0xca, 0xcf, 0x93, 0x63, 0x1b, 0x7d, 0xd7, 0x57, 0x50, 0xd5, 0xef, 0x70, 0x6b, 0x4f, 0xc7, 0x45, 0xdb, 0x74, 0x9e, 0x8d, 0x5e, 0x33, 0x83, 0xd8, 0x37, 0xdd, 0xc3, 0xac, 0x3d, 0xbf, 0x92, 0xc5, 0x5b, 0xea, 0xbf, 0xd5, 0x62, 0xc0, 0xdc, 0xbc, 0xbd, 0x2d, 0x22, 0x5a, 0xcf, 0xdd, 0x69, 0xff, 0x00, 0xd1, 0x8e, 0x5d, 0xa5, 0x38, 0xb5, 0xb0, 0x00, 0xc6, 0xc4, 0x24, 0x4a, 0xd6, 0x8d, 0x18, 0x04, 0x49, 0x88, 0x9e, 0x55, 0xd6, 0x61, 0xb0, 0xc1, 0x70, 0x32, 0xdd, 0x3c, 0x95, 0xda, 0xf1, 0xfe, 0xf5, 0x62, 0xbc, 0x76, 0x8e, 0x75, 0x28, 0x02, 0xa2, 0xe7, 0x7d, 0x92, 0xb9, 0x84, 0x96, 0x96, 0xda, 0xf7, 0x70, 0x12, 0x4e, 0x5a, 0xff, 0x00, 0xff, 0xd1, 0xf3, 0x7a, 0x21, 0xaf, 0xde, 0xef, 0xa2, 0x22, 0x55, 0xfc, 0x5a, 0xbd, 0x42, 0xfb, 0x08, 0xfa, 0x67, 0x4f, 0x82, 0xcd, 0x6d, 0x85, 0xc0, 0x56, 0x3b, 0x90, 0xb7, 0xf0, 0x2a, 0x0e, 0x63, 0x58, 0x3b, 0xf2, 0xa3, 0x9e, 0x8c, 0xb8, 0x86, 0xbe, 0x49, 0xf1, 0x2c, 0x0c, 0x86, 0xb4, 0x4c, 0x69, 0xe4, 0xaf, 0x6e, 0xcc, 0x6b, 0x7d, 0x46, 0xb3, 0x70, 0xec, 0x38, 0x51, 0x7d, 0x02, 0x8a, 0xc7, 0xa6, 0xd9, 0x20, 0x68, 0x0f, 0x8f, 0x8a, 0xcf, 0xc9, 0xc2, 0xea, 0x59, 0x5b, 0x48, 0xb0, 0x91, 0xae, 0xe6, 0xc9, 0x03, 0xc9, 0x30, 0x51, 0x66, 0xd4, 0x0d, 0xad, 0xbd, 0x5f, 0x53, 0xcc, 0x6b, 0xb6, 0x90, 0x5a, 0x3b, 0x83, 0x0b, 0x43, 0x17, 0x31, 0xd6, 0xc3, 0x6e, 0x12, 0x3b, 0x79, 0xac, 0xc1, 0x89, 0x47, 0xd9, 0xe8, 0x63, 0x98, 0x45, 0xed, 0x6c, 0x5a, 0xf1, 0xa0, 0x27, 0xc5, 0x5b, 0xc3, 0x6f, 0xa6, 0xe0, 0x1c, 0x7d, 0xb3, 0xa2, 0x69, 0x34, 0x7b, 0xae, 0x1a, 0x8d, 0x45, 0x17, 0x9d, 0xeb, 0xfd, 0x21, 0xd8, 0xb9, 0xae, 0xb5, 0x80, 0xbb, 0x1e, 0xd2, 0x5c, 0xd7, 0x78, 0x13, 0xf9, 0xae, 0x4b, 0xea, 0xc7, 0x4a, 0x39, 0xbd, 0x55, 0xb3, 0xed, 0x66, 0x38, 0xf5, 0x09, 0x22, 0x41, 0x23, 0xe8, 0x37, 0xfb, 0x4b, 0xa1, 0xeb, 0xd6, 0xfe, 0x88, 0x31, 0xbf, 0x41, 0xc0, 0xee, 0xd2, 0x74, 0x02, 0x78, 0x53, 0xfa, 0x97, 0x43, 0x19, 0x85, 0x65, 0xff, 0x00, 0x9d, 0x71, 0x33, 0xe4, 0x1a, 0x7d, 0x8d, 0x53, 0x42, 0x56, 0x35, 0x6b, 0xe5, 0x80, 0x06, 0xc7, 0x57, 0xa7, 0xc4, 0xa9, 0xdb, 0xb6, 0x81, 0x1f, 0xeb, 0xd9, 0x69, 0x56, 0xc2, 0xd0, 0x00, 0xe5, 0x55, 0xc0, 0x12, 0xc2, 0xd7, 0x4e, 0xa2, 0x5a, 0x7c, 0x0a, 0xd0, 0x63, 0x9a, 0xd1, 0xaf, 0xd2, 0xe2, 0x3c, 0x12, 0x62, 0x66, 0xc6, 0x42, 0x23, 0x5a, 0x49, 0x8f, 0x10, 0xa2, 0xd2, 0x3e, 0x28, 0x9d, 0xc4, 0x88, 0x09, 0x29, 0x16, 0xc3, 0x3c, 0x24, 0x8d, 0xe6, 0x92, 0x72, 0x1f, 0xff, 0xd2, 0xf3, 0xbb, 0xb0, 0xfe, 0xcb, 0x99, 0xe9, 0xce, 0xf6, 0x88, 0x2d, 0x77, 0x91, 0x5b, 0x3d, 0x3d, 0xd0, 0xe6, 0x90, 0xa9, 0x65, 0x57, 0x38, 0x95, 0xdd, 0xcb, 0x9a, 0x7d, 0xce, 0xf2, 0x3f, 0x44, 0x23, 0x60, 0x58, 0x76, 0xe9, 0xca, 0x8c, 0xea, 0x1b, 0x31, 0x02, 0x32, 0x23, 0xea, 0xee, 0xb1, 0xcd, 0xb0, 0xc7, 0x87, 0x74, 0x7a, 0xeb, 0x70, 0x1a, 0x71, 0xe1, 0xfe, 0xe4, 0x1c, 0x1d, 0xae, 0xe5, 0x69, 0xd8, 0xfa, 0x99, 0x50, 0x0d, 0x1a, 0xf7, 0x2a, 0x3a, 0x0c, 0xf4, 0x1a, 0x8e, 0xc7, 0x27, 0x5d, 0xbf, 0x18, 0x41, 0xdc, 0xc2, 0xf0, 0x7f, 0x74, 0xf6, 0x3a, 0x22, 0x66, 0xdb, 0x68, 0xc6, 0x80, 0x48, 0x6b, 0x88, 0x06, 0x39, 0x0d, 0xee, 0xaa, 0x1f, 0xb3, 0xd5, 0x1b, 0x83, 0xd8, 0x3b, 0x38, 0x8f, 0x69, 0xfe, 0xdf, 0xd1, 0x4d, 0x29, 0xa1, 0x4c, 0x7a, 0xf4, 0xbf, 0xa7, 0x92, 0xcf, 0xa5, 0x20, 0x08, 0xf3, 0xf6, 0xff, 0x00, 0x15, 0xbb, 0xd1, 0x31, 0xd9, 0x5e, 0x3d, 0x75, 0x56, 0x36, 0x88, 0x00, 0x81, 0xe0, 0x16, 0x5e, 0x55, 0x74, 0x3f, 0x00, 0x9d, 0xe0, 0xcc, 0x69, 0xe7, 0x3a, 0x2d, 0xbe, 0x90, 0x00, 0xa9, 0xae, 0xef, 0x1f, 0x95, 0x4b, 0x0d, 0x9a, 0xdc, 0xc7, 0x45, 0xfe, 0xb1, 0x7d, 0x60, 0xa7, 0xa1, 0xe0, 0x1f, 0x4e, 0x1d, 0x99, 0x69, 0x02, 0x9a, 0xcf, 0x1f, 0xca, 0x7b, 0xbf, 0x90, 0xc5, 0xc2, 0xb3, 0xeb, 0x57, 0xd6, 0x03, 0x6b, 0xae, 0x39, 0xb6, 0x82, 0xe3, 0x31, 0xa1, 0x68, 0xf2, 0x6b, 0x5c, 0x12, 0xfa, 0xe1, 0x91, 0x66, 0x47, 0x5d, 0xb8, 0x3b, 0x4f, 0x44, 0x36, 0xb6, 0x8f, 0x28, 0xdd, 0xff, 0x00, 0x7e, 0x46, 0xab, 0x12, 0x2b, 0x65, 0x55, 0x32, 0xa7, 0x62, 0xb6, 0xbd, 0xf7, 0x64, 0x10, 0xdb, 0x03, 0x9f, 0x1b, 0x9e, 0xc7, 0xd9, 0xb8, 0x3b, 0x1f, 0x67, 0xf3, 0x6c, 0x52, 0x80, 0xd7, 0x7d, 0x0f, 0xea, 0x7f, 0x5d, 0x1d, 0x67, 0xa6, 0x0b, 0x1e, 0x47, 0xda, 0x69, 0x3b, 0x2e, 0x03, 0xc7, 0xf3, 0x5f, 0x1f, 0xf0, 0x8b, 0xa1, 0x02, 0x46, 0xba, 0x79, 0xaf, 0x32, 0xff, 0x00, 0x16, 0xad, 0xca, 0x1d, 0x57, 0x2a, 0xdc, 0x79, 0x18, 0x41, 0xb0, 0xf6, 0x9e, 0xe4, 0x9f, 0xd0, 0x8f, 0xeb, 0x31, 0xab, 0xd2, 0x83, 0xa4, 0xcb, 0x8c, 0xb8, 0xa0, 0x42, 0x12, 0x7b, 0x67, 0x9f, 0x2f, 0xf5, 0x09, 0x26, 0x96, 0xc4, 0xce, 0xa9, 0x20, 0xa7, 0xff, 0xd3, 0xf3, 0x2f, 0xb4, 0x5d, 0xe9, 0x0a, 0xb7, 0x9f, 0x4c, 0x19, 0xdb, 0x3a, 0x2d, 0x5e, 0x94, 0xfd, 0xc4, 0xb7, 0xc5, 0x62, 0xf9, 0x2b, 0xfd, 0x2e, 0xe3, 0x5d, 0xe0, 0x7c, 0x13, 0x48, 0xd1, 0x92, 0x12, 0xa9, 0x0b, 0x7a, 0xbc, 0x2d, 0xc2, 0x7f, 0x92, 0x60, 0xab, 0x4e, 0x79, 0x2e, 0x00, 0xf0, 0xaa, 0xe1, 0xda, 0x3d, 0x43, 0xfc, 0xad, 0x55, 0xbb, 0x80, 0x79, 0x81, 0xa0, 0xe6, 0x54, 0x32, 0x6d, 0x02, 0xbe, 0xf3, 0x61, 0x81, 0xa8, 0x44, 0x14, 0x03, 0x59, 0x0e, 0x1c, 0xf6, 0x1f, 0xdc, 0xb2, 0xec, 0xa3, 0x23, 0x77, 0xe8, 0x6e, 0x70, 0xf2, 0x25, 0x1f, 0x1f, 0x17, 0xa9, 0x6d, 0x71, 0x36, 0x97, 0x47, 0x00, 0xa4, 0x02, 0xe0, 0x2c, 0x7c, 0xc1, 0xab, 0xd5, 0x31, 0x85, 0x35, 0xd4, 0xe6, 0x13, 0x02, 0xd6, 0x4b, 0x67, 0x48, 0x2b, 0xa9, 0xe9, 0x2e, 0x02, 0xb6, 0x4f, 0x82, 0xe5, 0x7a, 0x95, 0x19, 0xc6, 0x87, 0x3d, 0xfb, 0xa2, 0xb8, 0x79, 0x1e, 0x4d, 0x3b, 0x96, 0xcf, 0x4f, 0xbd, 0xcd, 0xa2, 0xa2, 0x1f, 0xa0, 0x82, 0xd3, 0xfc, 0x97, 0x05, 0x24, 0x36, 0x6b, 0xf3, 0x31, 0xa2, 0x35, 0x79, 0xef, 0xad, 0xf8, 0xae, 0xaf, 0xaf, 0xd8, 0xf2, 0xd8, 0x6d, 0xed, 0x6b, 0xda, 0x7b, 0x18, 0x1b, 0x5d, 0xff, 0x00, 0x52, 0xb1, 0x6d, 0xf0, 0x81, 0x31, 0xca, 0xf4, 0x6e, 0xb1, 0x80, 0xce, 0xb1, 0x84, 0xc0, 0x21, 0xb7, 0xd6, 0x77, 0x31, 0xd1, 0x27, 0xc1, 0xcd, 0xfe, 0xd2, 0xe3, 0xec, 0xe8, 0x1d, 0x45, 0x96, 0xb0, 0x9a, 0xb7, 0x87, 0x3f, 0x68, 0x2d, 0xf7, 0x01, 0x1f, 0xbe, 0xd1, 0xf4, 0x7f, 0xb4, 0xa4, 0x0d, 0x77, 0xbb, 0xfa, 0x8f, 0x80, 0x3a, 0x7f, 0x43, 0xaa, 0xe2, 0xdf, 0xd2, 0x65, 0x7e, 0x95, 0xe4, 0x0f, 0x1f, 0xa1, 0xfe, 0x6b, 0x16, 0x9f, 0x52, 0xfa, 0xc1, 0xd3, 0xba, 0x6d, 0x26, 0xdc, 0xac, 0x86, 0xd4, 0xd9, 0x0d, 0x31, 0x2e, 0x74, 0x9e, 0xdb, 0x59, 0x2e, 0x55, 0xe8, 0xc9, 0xb2, 0x96, 0xd5, 0x4b, 0x9f, 0xb8, 0x6d, 0xda, 0x1c, 0x04, 0x09, 0x03, 0xfe, 0x8a, 0xc6, 0xfa, 0xd3, 0xf5, 0x6a, 0xbe, 0xbb, 0x5b, 0x2e, 0xc6, 0xb5, 0x94, 0xe6, 0xd5, 0x20, 0x97, 0x7d, 0x1b, 0x1b, 0xf9, 0xad, 0x7c, 0x7d, 0x17, 0xb7, 0xf3, 0x1e, 0x92, 0x1b, 0x7f, 0xf8, 0xe0, 0x7d, 0x59, 0xdd, 0xfd, 0x32, 0xd8, 0x8f, 0xa5, 0xe8, 0x3a, 0x12, 0x5c, 0x3f, 0xfc, 0xc4, 0xfa, 0xc3, 0xb3, 0x77, 0xa7, 0x56, 0xed, 0xdb, 0x76, 0x7a, 0x8d, 0xdd, 0x1f, 0xbf, 0xfd, 0x44, 0x92, 0x56, 0x8f, 0xff, 0xd4, 0xf2, 0xe8, 0x86, 0x17, 0x1e, 0xfa, 0x04, 0x56, 0x4b, 0x43, 0x6c, 0x6f, 0x2d, 0xe5, 0x46, 0x01, 0x64, 0x2b, 0x14, 0x32, 0x5b, 0xb4, 0xa0, 0x52, 0x1d, 0xde, 0x9b, 0x94, 0xdb, 0xab, 0x6b, 0x81, 0xf7, 0x05, 0xb0, 0xd7, 0x07, 0xb2, 0x27, 0x55, 0xc6, 0x57, 0x65, 0xd8, 0x76, 0x6e, 0x64, 0xed, 0xee, 0x16, 0xce, 0x27, 0x57, 0x63, 0xda, 0x0c, 0xc2, 0x8e, 0x51, 0x67, 0x84, 0xfa, 0x1d, 0xdd, 0x62, 0xc7, 0x07, 0xe9, 0xf7, 0xa3, 0xd6, 0x6c, 0x02, 0x41, 0x55, 0x31, 0xf3, 0x2b, 0xb3, 0xba, 0x2b, 0x2e, 0x68, 0x24, 0x1d, 0x47, 0x64, 0xca, 0xa6, 0x50, 0x41, 0x65, 0x90, 0x6c, 0xb1, 0xa5, 0xae, 0x33, 0x23, 0x51, 0xe4, 0xab, 0x7d, 0x5d, 0xcb, 0xb6, 0xcc, 0x37, 0xd0, 0x40, 0x73, 0x71, 0xde, 0x58, 0x09, 0xe7, 0x6f, 0x2c, 0x44, 0xc9, 0xc9, 0xae, 0xba, 0x9d, 0x63, 0x88, 0x01, 0xa0, 0x95, 0x9d, 0xf5, 0x3f, 0x2a, 0xe6, 0x67, 0xdb, 0x50, 0x83, 0x55, 0xad, 0x36, 0x3e, 0x78, 0x10, 0x74, 0x77, 0xfd, 0x2d, 0xaa, 0x4c, 0x7d, 0x58, 0x73, 0x91, 0xa0, 0x0f, 0x51, 0x45, 0xb7, 0x33, 0xdd, 0x58, 0x69, 0x1d, 0xd8, 0x0c, 0x9f, 0x96, 0x88, 0x19, 0x99, 0x19, 0xac, 0xcf, 0xa3, 0xd2, 0xad, 0xb5, 0xdb, 0x76, 0x8f, 0xad, 0xc4, 0xea, 0xcf, 0xdf, 0x7e, 0xdf, 0xdd, 0xfc, 0xd5, 0xa3, 0x5e, 0x43, 0x2b, 0x6b, 0xb2, 0xad, 0x3b, 0x6a, 0xa4, 0x13, 0xa7, 0x04, 0xac, 0x7a, 0x6f, 0xb3, 0x23, 0x26, 0xcc, 0xfb, 0xb4, 0x75, 0x8e, 0x01, 0x83, 0xf7, 0x58, 0x3e, 0x8b, 0x53, 0xa7, 0x2a, 0x1a, 0x31, 0x42, 0x36, 0x5d, 0x4c, 0x9a, 0xf2, 0xdc, 0xc6, 0xfe, 0x98, 0xb4, 0x34, 0xcb, 0x48, 0x0a, 0x8f, 0xdb, 0xb2, 0xeb, 0x76, 0xd6, 0x07, 0x5c, 0x59, 0xc9, 0x64, 0x8f, 0x93, 0xa7, 0x73, 0x16, 0x83, 0xaf, 0x0e, 0xa4, 0x33, 0xef, 0x50, 0xc5, 0x0c, 0xda, 0x59, 0x10, 0x06, 0x8a, 0x2e, 0x29, 0x0e, 0xac, 0xc2, 0x31, 0x3d, 0x36, 0x69, 0x7e, 0xd6, 0xcc, 0xf5, 0x3d, 0x6f, 0xb3, 0xeb, 0x1b, 0x76, 0xef, 0x3b, 0xa3, 0xfa, 0xc9, 0x2b, 0x5f, 0x66, 0x6f, 0xa9, 0x1e, 0x73, 0xf2, 0x49, 0x2e, 0x39, 0xf7, 0x4f, 0xb7, 0x8d, 0xff, 0xd5, 0xf3, 0x26, 0xfe, 0x0a, 0xc5, 0x1b, 0xa7, 0xcb, 0xb2, 0xcf, 0x49, 0x03, 0xb2, 0x46, 0xee, 0xd9, 0xd9, 0xb3, 0xf4, 0x9f, 0x25, 0x4a, 0xdf, 0x4b, 0x77, 0xe8, 0x27, 0xd4, 0xef, 0x1c, 0x2a, 0x29, 0x26, 0xc5, 0x7c, 0x9d, 0x6c, 0x7f, 0xb7, 0x6e, 0x1b, 0x26, 0x7f, 0x05, 0xa3, 0xfe, 0x53, 0x8d, 0x62, 0x57, 0x30, 0x92, 0x12, 0xfa, 0x2f, 0x86, 0xdf, 0xa4, 0xec, 0x67, 0xfe, 0xd0, 0xf4, 0xff, 0x00, 0x4d, 0xfc, 0xdf, 0x78, 0xe1, 0x68, 0x7d, 0x54, 0x99, 0xbf, 0x6f, 0xf3, 0xbe, 0xdf, 0x8e, 0xdd, 0x7f, 0xef, 0xeb, 0x97, 0x49, 0x3e, 0x3b, 0x7f, 0x06, 0x2c, 0x9f, 0x37, 0x5f, 0xf0, 0x9f, 0x4c, 0xeb, 0x7b, 0xbf, 0x67, 0x55, 0xe8, 0xff, 0x00, 0x31, 0xbc, 0x7a, 0x9e, 0x31, 0xdb, 0xfe, 0x92, 0xae, 0x37, 0x7a, 0x4d, 0xdb, 0xe2, 0x17, 0x9d, 0xa4, 0xa3, 0xc9, 0xba, 0xfc, 0x7b, 0x7d, 0x5f, 0x52, 0xa7, 0x7e, 0xd1, 0x28, 0xf8, 0xf3, 0xb0, 0xc7, 0x32, 0xbc, 0x99, 0x24, 0xc5, 0xe3, 0xab, 0xeb, 0x1f, 0xa4, 0xf5, 0xfc, 0xe1, 0x25, 0xe4, 0xe9, 0x24, 0x97, 0xff, 0xd9, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x41, 0x00, 0x64, 0x00, 0x6f, 0x00, 0x62, 0x00, 0x65, 0x00, 0x20, 0x00, 0x50, 0x00, 0x68, 0x00, 0x6f, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x73, 0x00, 0x68, 0x00, 0x6f, 0x00, 0x70, 0x00, 0x00, 0x00, 0x13, 0x00, 0x41, 0x00, 0x64, 0x00, 0x6f, 0x00, 0x62, 0x00, 0x65, 0x00, 0x20, 0x00, 0x50, 0x00, 0x68, 0x00, 0x6f, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x73, 0x00, 0x68, 0x00, 0x6f, 0x00, 0x70, 0x00, 0x20, 0x00, 0x37, 0x00, 0x2e, 0x00, 0x30, 0x00, 0x00, 0x00, 0x01, 0x00, 0x38, 0x42, 0x49, 0x4d, 0x04, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0xff, 0xe1, 0x15, 0x67, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6e, 0x73, 0x2e, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x61, 0x70, 0x2f, 0x31, 0x2e, 0x30, 0x2f, 0x00, 0x3c, 0x3f, 0x78, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x20, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x3d, 0x27, 0xef, 0xbb, 0xbf, 0x27, 0x20, 0x69, 0x64, 0x3d, 0x27, 0x57, 0x35, 0x4d, 0x30, 0x4d, 0x70, 0x43, 0x65, 0x68, 0x69, 0x48, 0x7a, 0x72, 0x65, 0x53, 0x7a, 0x4e, 0x54, 0x63, 0x7a, 0x6b, 0x63, 0x39, 0x64, 0x27, 0x3f, 0x3e, 0x0a, 0x3c, 0x3f, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2d, 0x78, 0x61, 0x70, 0x2d, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x20, 0x65, 0x73, 0x63, 0x3d, 0x22, 0x43, 0x52, 0x22, 0x3f, 0x3e, 0x0a, 0x3c, 0x78, 0x3a, 0x78, 0x61, 0x70, 0x6d, 0x65, 0x74, 0x61, 0x20, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3a, 0x78, 0x3d, 0x27, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x3a, 0x6e, 0x73, 0x3a, 0x6d, 0x65, 0x74, 0x61, 0x2f, 0x27, 0x20, 0x78, 0x3a, 0x78, 0x61, 0x70, 0x74, 0x6b, 0x3d, 0x27, 0x58, 0x4d, 0x50, 0x20, 0x74, 0x6f, 0x6f, 0x6c, 0x6b, 0x69, 0x74, 0x20, 0x32, 0x2e, 0x38, 0x2e, 0x32, 0x2d, 0x33, 0x33, 0x2c, 0x20, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x31, 0x2e, 0x35, 0x27, 0x3e, 0x0a, 0x3c, 0x72, 0x64, 0x66, 0x3a, 0x52, 0x44, 0x46, 0x20, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3a, 0x72, 0x64, 0x66, 0x3d, 0x27, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x77, 0x33, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x31, 0x39, 0x39, 0x39, 0x2f, 0x30, 0x32, 0x2f, 0x32, 0x32, 0x2d, 0x72, 0x64, 0x66, 0x2d, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x2d, 0x6e, 0x73, 0x23, 0x27, 0x20, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3a, 0x69, 0x58, 0x3d, 0x27, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6e, 0x73, 0x2e, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x58, 0x2f, 0x31, 0x2e, 0x30, 0x2f, 0x27, 0x3e, 0x0a, 0x0a, 0x20, 0x3c, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x3d, 0x27, 0x75, 0x75, 0x69, 0x64, 0x3a, 0x32, 0x32, 0x64, 0x30, 0x32, 0x62, 0x30, 0x61, 0x2d, 0x62, 0x32, 0x34, 0x39, 0x2d, 0x31, 0x31, 0x64, 0x62, 0x2d, 0x38, 0x61, 0x66, 0x38, 0x2d, 0x39, 0x31, 0x64, 0x35, 0x34, 0x30, 0x33, 0x66, 0x39, 0x32, 0x66, 0x39, 0x27, 0x0a, 0x20, 0x20, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3a, 0x70, 0x64, 0x66, 0x3d, 0x27, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6e, 0x73, 0x2e, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x64, 0x66, 0x2f, 0x31, 0x2e, 0x33, 0x2f, 0x27, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x21, 0x2d, 0x2d, 0x20, 0x70, 0x64, 0x66, 0x3a, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x69, 0x73, 0x20, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x64, 0x20, 0x2d, 0x2d, 0x3e, 0x0a, 0x20, 0x3c, 0x2f, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3e, 0x0a, 0x0a, 0x20, 0x3c, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x3d, 0x27, 0x75, 0x75, 0x69, 0x64, 0x3a, 0x32, 0x32, 0x64, 0x30, 0x32, 0x62, 0x30, 0x61, 0x2d, 0x62, 0x32, 0x34, 0x39, 0x2d, 0x31, 0x31, 0x64, 0x62, 0x2d, 0x38, 0x61, 0x66, 0x38, 0x2d, 0x39, 0x31, 0x64, 0x35, 0x34, 0x30, 0x33, 0x66, 0x39, 0x32, 0x66, 0x39, 0x27, 0x0a, 0x20, 0x20, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3a, 0x70, 0x68, 0x6f, 0x74, 0x6f, 0x73, 0x68, 0x6f, 0x70, 0x3d, 0x27, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6e, 0x73, 0x2e, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x68, 0x6f, 0x74, 0x6f, 0x73, 0x68, 0x6f, 0x70, 0x2f, 0x31, 0x2e, 0x30, 0x2f, 0x27, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x21, 0x2d, 0x2d, 0x20, 0x70, 0x68, 0x6f, 0x74, 0x6f, 0x73, 0x68, 0x6f, 0x70, 0x3a, 0x43, 0x61, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x64, 0x20, 0x2d, 0x2d, 0x3e, 0x0a, 0x20, 0x3c, 0x2f, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3e, 0x0a, 0x0a, 0x20, 0x3c, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x3d, 0x27, 0x75, 0x75, 0x69, 0x64, 0x3a, 0x32, 0x32, 0x64, 0x30, 0x32, 0x62, 0x30, 0x61, 0x2d, 0x62, 0x32, 0x34, 0x39, 0x2d, 0x31, 0x31, 0x64, 0x62, 0x2d, 0x38, 0x61, 0x66, 0x38, 0x2d, 0x39, 0x31, 0x64, 0x35, 0x34, 0x30, 0x33, 0x66, 0x39, 0x32, 0x66, 0x39, 0x27, 0x0a, 0x20, 0x20, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3a, 0x78, 0x61, 0x70, 0x3d, 0x27, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6e, 0x73, 0x2e, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x61, 0x70, 0x2f, 0x31, 0x2e, 0x30, 0x2f, 0x27, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x21, 0x2d, 0x2d, 0x20, 0x78, 0x61, 0x70, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x65, 0x64, 0x20, 0x2d, 0x2d, 0x3e, 0x0a, 0x20, 0x3c, 0x2f, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3e, 0x0a, 0x0a, 0x20, 0x3c, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x3d, 0x27, 0x75, 0x75, 0x69, 0x64, 0x3a, 0x32, 0x32, 0x64, 0x30, 0x32, 0x62, 0x30, 0x61, 0x2d, 0x62, 0x32, 0x34, 0x39, 0x2d, 0x31, 0x31, 0x64, 0x62, 0x2d, 0x38, 0x61, 0x66, 0x38, 0x2d, 0x39, 0x31, 0x64, 0x35, 0x34, 0x30, 0x33, 0x66, 0x39, 0x32, 0x66, 0x39, 0x27, 0x0a, 0x20, 0x20, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3a, 0x78, 0x61, 0x70, 0x4d, 0x4d, 0x3d, 0x27, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6e, 0x73, 0x2e, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x61, 0x70, 0x2f, 0x31, 0x2e, 0x30, 0x2f, 0x6d, 0x6d, 0x2f, 0x27, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x78, 0x61, 0x70, 0x4d, 0x4d, 0x3a, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x3e, 0x61, 0x64, 0x6f, 0x62, 0x65, 0x3a, 0x64, 0x6f, 0x63, 0x69, 0x64, 0x3a, 0x70, 0x68, 0x6f, 0x74, 0x6f, 0x73, 0x68, 0x6f, 0x70, 0x3a, 0x32, 0x32, 0x64, 0x30, 0x32, 0x62, 0x30, 0x36, 0x2d, 0x62, 0x32, 0x34, 0x39, 0x2d, 0x31, 0x31, 0x64, 0x62, 0x2d, 0x38, 0x61, 0x66, 0x38, 0x2d, 0x39, 0x31, 0x64, 0x35, 0x34, 0x30, 0x33, 0x66, 0x39, 0x32, 0x66, 0x39, 0x3c, 0x2f, 0x78, 0x61, 0x70, 0x4d, 0x4d, 0x3a, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x3e, 0x0a, 0x20, 0x3c, 0x2f, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3e, 0x0a, 0x0a, 0x20, 0x3c, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x3d, 0x27, 0x75, 0x75, 0x69, 0x64, 0x3a, 0x32, 0x32, 0x64, 0x30, 0x32, 0x62, 0x30, 0x61, 0x2d, 0x62, 0x32, 0x34, 0x39, 0x2d, 0x31, 0x31, 0x64, 0x62, 0x2d, 0x38, 0x61, 0x66, 0x38, 0x2d, 0x39, 0x31, 0x64, 0x35, 0x34, 0x30, 0x33, 0x66, 0x39, 0x32, 0x66, 0x39, 0x27, 0x0a, 0x20, 0x20, 0x78, 0x6d, 0x6c, 0x6e, 0x73, 0x3a, 0x64, 0x63, 0x3d, 0x27, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x70, 0x75, 0x72, 0x6c, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x64, 0x63, 0x2f, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x31, 0x2e, 0x31, 0x2f, 0x27, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x64, 0x63, 0x3a, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x3c, 0x72, 0x64, 0x66, 0x3a, 0x41, 0x6c, 0x74, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x72, 0x64, 0x66, 0x3a, 0x6c, 0x69, 0x20, 0x78, 0x6d, 0x6c, 0x3a, 0x6c, 0x61, 0x6e, 0x67, 0x3d, 0x27, 0x78, 0x2d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x27, 0x3e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x2f, 0x72, 0x64, 0x66, 0x3a, 0x6c, 0x69, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x3c, 0x2f, 0x72, 0x64, 0x66, 0x3a, 0x41, 0x6c, 0x74, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x2f, 0x64, 0x63, 0x3a, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3e, 0x0a, 0x20, 0x3c, 0x2f, 0x72, 0x64, 0x66, 0x3a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3e, 0x0a, 0x0a, 0x3c, 0x2f, 0x72, 0x64, 0x66, 0x3a, 0x52, 0x44, 0x46, 0x3e, 0x0a, 0x3c, 0x2f, 0x78, 0x3a, 0x78, 0x61, 0x70, 0x6d, 0x65, 0x74, 0x61, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x3c, 0x3f, 0x78, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x20, 0x65, 0x6e, 0x64, 0x3d, 0x27, 0x77, 0x27, 0x3f, 0x3e, 0xff, 0xee, 0x00, 0x0e, 0x41, 0x64, 0x6f, 0x62, 0x65, 0x00, 0x64, 0x40, 0x00, 0x00, 0x00, 0x01, 0xff, 0xdb, 0x00, 0x84, 0x00, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, 0x03, 0x04, 0x06, 0x04, 0x03, 0x04, 0x06, 0x07, 0x05, 0x04, 0x04, 0x05, 0x07, 0x08, 0x06, 0x06, 0x07, 0x06, 0x06, 0x08, 0x0a, 0x08, 0x09, 0x09, 0x09, 0x09, 0x08, 0x0a, 0x0a, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0a, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x01, 0x04, 0x05, 0x05, 0x08, 0x07, 0x08, 0x0f, 0x0a, 0x0a, 0x0f, 0x14, 0x0e, 0x0e, 0x0e, 0x14, 0x14, 0x0e, 0x0e, 0x0e, 0x0e, 0x14, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x11, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x11, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xff, 0xc0, 0x00, 0x11, 0x08, 0x00, 0x64, 0x00, 0x64, 0x03, 0x01, 0x11, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xff, 0xdd, 0x00, 0x04, 0x00, 0x0d, 0xff, 0xc4, 0x01, 0xa2, 0x00, 0x00, 0x00, 0x07, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x03, 0x02, 0x06, 0x01, 0x00, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x01, 0x00, 0x02, 0x02, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x02, 0x06, 0x07, 0x03, 0x04, 0x02, 0x06, 0x02, 0x73, 0x01, 0x02, 0x03, 0x11, 0x04, 0x00, 0x05, 0x21, 0x12, 0x31, 0x41, 0x51, 0x06, 0x13, 0x61, 0x22, 0x71, 0x81, 0x14, 0x32, 0x91, 0xa1, 0x07, 0x15, 0xb1, 0x42, 0x23, 0xc1, 0x52, 0xd1, 0xe1, 0x33, 0x16, 0x62, 0xf0, 0x24, 0x72, 0x82, 0xf1, 0x25, 0x43, 0x34, 0x53, 0x92, 0xa2, 0xb2, 0x63, 0x73, 0xc2, 0x35, 0x44, 0x27, 0x93, 0xa3, 0xb3, 0x36, 0x17, 0x54, 0x64, 0x74, 0xc3, 0xd2, 0xe2, 0x08, 0x26, 0x83, 0x09, 0x0a, 0x18, 0x19, 0x84, 0x94, 0x45, 0x46, 0xa4, 0xb4, 0x56, 0xd3, 0x55, 0x28, 0x1a, 0xf2, 0xe3, 0xf3, 0xc4, 0xd4, 0xe4, 0xf4, 0x65, 0x75, 0x85, 0x95, 0xa5, 0xb5, 0xc5, 0xd5, 0xe5, 0xf5, 0x66, 0x76, 0x86, 0x96, 0xa6, 0xb6, 0xc6, 0xd6, 0xe6, 0xf6, 0x37, 0x47, 0x57, 0x67, 0x77, 0x87, 0x97, 0xa7, 0xb7, 0xc7, 0xd7, 0xe7, 0xf7, 0x38, 0x48, 0x58, 0x68, 0x78, 0x88, 0x98, 0xa8, 0xb8, 0xc8, 0xd8, 0xe8, 0xf8, 0x29, 0x39, 0x49, 0x59, 0x69, 0x79, 0x89, 0x99, 0xa9, 0xb9, 0xc9, 0xd9, 0xe9, 0xf9, 0x2a, 0x3a, 0x4a, 0x5a, 0x6a, 0x7a, 0x8a, 0x9a, 0xaa, 0xba, 0xca, 0xda, 0xea, 0xfa, 0x11, 0x00, 0x02, 0x02, 0x01, 0x02, 0x03, 0x05, 0x05, 0x04, 0x05, 0x06, 0x04, 0x08, 0x03, 0x03, 0x6d, 0x01, 0x00, 0x02, 0x11, 0x03, 0x04, 0x21, 0x12, 0x31, 0x41, 0x05, 0x51, 0x13, 0x61, 0x22, 0x06, 0x71, 0x81, 0x91, 0x32, 0xa1, 0xb1, 0xf0, 0x14, 0xc1, 0xd1, 0xe1, 0x23, 0x42, 0x15, 0x52, 0x62, 0x72, 0xf1, 0x33, 0x24, 0x34, 0x43, 0x82, 0x16, 0x92, 0x53, 0x25, 0xa2, 0x63, 0xb2, 0xc2, 0x07, 0x73, 0xd2, 0x35, 0xe2, 0x44, 0x83, 0x17, 0x54, 0x93, 0x08, 0x09, 0x0a, 0x18, 0x19, 0x26, 0x36, 0x45, 0x1a, 0x27, 0x64, 0x74, 0x55, 0x37, 0xf2, 0xa3, 0xb3, 0xc3, 0x28, 0x29, 0xd3, 0xe3, 0xf3, 0x84, 0x94, 0xa4, 0xb4, 0xc4, 0xd4, 0xe4, 0xf4, 0x65, 0x75, 0x85, 0x95, 0xa5, 0xb5, 0xc5, 0xd5, 0xe5, 0xf5, 0x46, 0x56, 0x66, 0x76, 0x86, 0x96, 0xa6, 0xb6, 0xc6, 0xd6, 0xe6, 0xf6, 0x47, 0x57, 0x67, 0x77, 0x87, 0x97, 0xa7, 0xb7, 0xc7, 0xd7, 0xe7, 0xf7, 0x38, 0x48, 0x58, 0x68, 0x78, 0x88, 0x98, 0xa8, 0xb8, 0xc8, 0xd8, 0xe8, 0xf8, 0x39, 0x49, 0x59, 0x69, 0x79, 0x89, 0x99, 0xa9, 0xb9, 0xc9, 0xd9, 0xe9, 0xf9, 0x2a, 0x3a, 0x4a, 0x5a, 0x6a, 0x7a, 0x8a, 0x9a, 0xaa, 0xba, 0xca, 0xda, 0xea, 0xfa, 0xff, 0xda, 0x00, 0x0c, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3f, 0x00, 0xf0, 0x67, 0xa6, 0x5c, 0x0f, 0x01, 0xd4, 0x7e, 0x18, 0x12, 0x98, 0xe9, 0xd6, 0x2d, 0x34, 0x6d, 0x70, 0xdf, 0xdc, 0xa1, 0xe3, 0xec, 0x5b, 0xfb, 0x32, 0x24, 0xb2, 0x01, 0x1f, 0x15, 0xa4, 0x52, 0x4a, 0x82, 0x31, 0xf1, 0xfe, 0xd1, 0x3d, 0x14, 0x64, 0x49, 0x64, 0x22, 0x98, 0xcf, 0xa5, 0x46, 0x6c, 0x16, 0x55, 0x71, 0x56, 0x62, 0x28, 0x07, 0xc5, 0x45, 0x15, 0xa0, 0xc8, 0x89, 0x33, 0xe1, 0x63, 0xd2, 0xd8, 0x34, 0x44, 0x17, 0xa0, 0x2c, 0x4d, 0x16, 0xbb, 0xed, 0xdc, 0xf8, 0x64, 0xc1, 0x6b, 0x31, 0x42, 0x18, 0x8e, 0xc7, 0xb5, 0x2a, 0x7d, 0xb2, 0x56, 0xc5, 0x61, 0x8c, 0xf2, 0xa0, 0x1b, 0x1e, 0x83, 0x0d, 0xa1, 0x63, 0x50, 0x1f, 0x97, 0x7c, 0x2a, 0xa9, 0x1a, 0x9a, 0x86, 0x4f, 0xb4, 0xb4, 0x38, 0x0a, 0xa6, 0x0b, 0xb8, 0x0c, 0x05, 0x14, 0xf8, 0x76, 0x3e, 0x19, 0x14, 0xb6, 0x78, 0xf8, 0x8c, 0x2a, 0xd5, 0x01, 0xdc, 0x6f, 0x8a, 0x1a, 0xe3, 0x8d, 0xab, 0xff, 0xd0, 0xf0, 0xec, 0xe9, 0x15, 0xb5, 0xb9, 0x5a, 0x7c, 0x4c, 0xa2, 0x9e, 0x24, 0xf5, 0xca, 0xc6, 0xe5, 0x99, 0xd9, 0x34, 0x99, 0x04, 0x3a, 0x7d, 0xb5, 0xba, 0xd5, 0x51, 0x63, 0x0e, 0xc7, 0xc5, 0x9b, 0x73, 0xf8, 0xe4, 0x6f, 0x76, 0xca, 0xd9, 0xda, 0x54, 0x6d, 0x72, 0x2e, 0x1a, 0x57, 0x11, 0x44, 0x40, 0x0d, 0x27, 0x7a, 0x0f, 0xd9, 0x5f, 0x12, 0x69, 0x4c, 0x84, 0xcd, 0x36, 0xe3, 0x85, 0xb2, 0xcd, 0x2f, 0x4a, 0x8b, 0x58, 0x36, 0xf6, 0x76, 0xa8, 0x64, 0x64, 0x3c, 0xa4, 0x93, 0xaa, 0x25, 0x3c, 0x49, 0xda, 0xa4, 0xe5, 0x26, 0x54, 0xe4, 0x8c, 0x7c, 0x5c, 0x93, 0x4d, 0x67, 0xc9, 0x3a, 0x6e, 0x9f, 0x13, 0xb4, 0xce, 0xf7, 0x3a, 0x9b, 0xad, 0x52, 0xd6, 0x2a, 0xd1, 0x49, 0xee, 0xc7, 0xf8, 0x64, 0x46, 0x42, 0x4e, 0xcd, 0x92, 0xc2, 0x00, 0xdd, 0x8a, 0x47, 0xe5, 0x69, 0x6e, 0xd4, 0xa4, 0x08, 0x16, 0x83, 0x9c, 0x8c, 0xdd, 0x95, 0x6b, 0xb9, 0xf6, 0xef, 0x97, 0x78, 0x94, 0xe3, 0x78, 0x04, 0xa4, 0xf3, 0xe8, 0xee, 0x64, 0xe1, 0x12, 0x10, 0x05, 0x6a, 0xc7, 0xc0, 0x6f, 0x53, 0xf3, 0xc9, 0x89, 0xb4, 0x9c, 0x4e, 0xb4, 0xf2, 0xd3, 0xde, 0x7a, 0xd2, 0x19, 0x16, 0x38, 0x61, 0x5d, 0xd9, 0x88, 0x05, 0x9c, 0xf4, 0x0a, 0x0f, 0x5f, 0x73, 0x84, 0xe4, 0xa4, 0xc7, 0x0d, 0xa5, 0xf1, 0x59, 0xba, 0x5c, 0x08, 0x98, 0x6f, 0xc8, 0x20, 0xfa, 0x4e, 0x4e, 0xf6, 0x69, 0xe1, 0xa2, 0x89, 0xfd, 0x1f, 0x77, 0x2c, 0xe6, 0xce, 0xd6, 0x17, 0x9a, 0x69, 0xdb, 0xd3, 0x86, 0x18, 0xc1, 0x67, 0x77, 0x26, 0x80, 0x28, 0x1b, 0x93, 0x88, 0x41, 0x0f, 0x40, 0xb0, 0xfc, 0x87, 0xf3, 0x43, 0x98, 0xd7, 0x58, 0x96, 0xdb, 0x4d, 0x91, 0x88, 0xe5, 0x6c, 0x58, 0xdc, 0x5c, 0x2a, 0xf7, 0x2c, 0xb1, 0xfc, 0x20, 0x8f, 0x02, 0xd9, 0x65, 0x06, 0xbe, 0x26, 0x6f, 0xa2, 0x7f, 0xce, 0x3d, 0x69, 0x26, 0xdd, 0x13, 0x52, 0xbf, 0xbd, 0x92, 0x62, 0x59, 0x4c, 0x90, 0xac, 0x50, 0x45, 0x5e, 0xbb, 0x09, 0x03, 0x12, 0x29, 0x84, 0x00, 0xc4, 0xc9, 0x11, 0xff, 0x00, 0x42, 0xe7, 0xa7, 0x7a, 0xd4, 0xfd, 0x21, 0x79, 0xe9, 0x78, 0x71, 0x8b, 0x95, 0x39, 0x75, 0xaf, 0x4e, 0x98, 0x78, 0x42, 0x38, 0xdf, 0xff, 0xd1, 0xf0, 0xe6, 0xa0, 0x58, 0xc8, 0x84, 0x9a, 0xaa, 0x30, 0x55, 0xf9, 0x0a, 0x6f, 0x90, 0x0c, 0xca, 0x72, 0x48, 0xb8, 0x1e, 0x89, 0xa7, 0x23, 0x17, 0x24, 0xff, 0x00, 0x61, 0xb6, 0x54, 0x76, 0x6e, 0x1b, 0xa7, 0xbe, 0x50, 0xf2, 0xc1, 0xd7, 0x4c, 0x52, 0x5e, 0x33, 0x5b, 0xe9, 0x10, 0xf4, 0x54, 0x3c, 0x5e, 0x77, 0xee, 0x49, 0xec, 0x2b, 0xb6, 0x63, 0xe4, 0xc9, 0xc3, 0xef, 0x73, 0xf0, 0xe1, 0x32, 0x1b, 0xf2, 0x7a, 0x05, 0xce, 0xad, 0x65, 0xa1, 0x98, 0xb4, 0x0f, 0x2a, 0x5b, 0x23, 0xeb, 0x12, 0x00, 0x88, 0xb0, 0xa8, 0x66, 0x46, 0x3d, 0xea, 0x7b, 0xfb, 0x9e, 0x99, 0x89, 0xbc, 0x8d, 0x97, 0x3a, 0x34, 0x05, 0x32, 0x5d, 0x1f, 0xc9, 0x1a, 0x8c, 0x36, 0x8c, 0x6f, 0x66, 0xfa, 0xc6, 0xb7, 0x7d, 0xf0, 0x94, 0x04, 0xf0, 0x88, 0xc9, 0xd5, 0x9d, 0x8d, 0x4b, 0x11, 0xd4, 0x9f, 0xbb, 0x25, 0xc5, 0xdc, 0xa2, 0x03, 0x99, 0x4b, 0xbc, 0xf3, 0x0d, 0x97, 0x96, 0x74, 0xe5, 0xf2, 0xb6, 0x80, 0x95, 0xbd, 0x99, 0x15, 0xf5, 0x4b, 0xd2, 0x37, 0x58, 0x46, 0xd4, 0x27, 0xc5, 0xce, 0xc1, 0x7c, 0x30, 0x8e, 0x68, 0x94, 0x7b, 0x9e, 0x6d, 0xe6, 0x7b, 0x9b, 0x5d, 0x3a, 0xd8, 0xdb, 0x32, 0xfa, 0x77, 0x65, 0x15, 0xe4, 0x57, 0xa7, 0x21, 0x55, 0x04, 0x57, 0xef, 0xd8, 0x66, 0x56, 0x38, 0x19, 0x1b, 0xe8, 0xe0, 0x67, 0x98, 0xc7, 0x1a, 0x1c, 0xde, 0x71, 0x71, 0x79, 0x2c, 0xf2, 0xfa, 0x8c, 0x48, 0xec, 0xb5, 0x24, 0x9a, 0x0c, 0xce, 0x75, 0x29, 0xae, 0x8c, 0x67, 0xd4, 0xb5, 0x0b, 0x4b, 0x04, 0x05, 0xef, 0x2e, 0x66, 0x8e, 0x18, 0x08, 0x15, 0xdd, 0x8f, 0x11, 0xb0, 0xeb, 0x4c, 0x04, 0x5b, 0x21, 0x2a, 0x7d, 0x41, 0xe4, 0x4f, 0xcb, 0xcb, 0x5d, 0x12, 0x45, 0xb8, 0xb7, 0x53, 0x71, 0xaa, 0x9f, 0x86, 0x5b, 0xd6, 0x50, 0x4a, 0xed, 0xba, 0x46, 0x77, 0x00, 0x13, 0xd4, 0x8c, 0x85, 0xd3, 0x12, 0x6d, 0xeb, 0x1a, 0x67, 0x95, 0xd9, 0x39, 0x39, 0x50, 0xac, 0xff, 0x00, 0x6f, 0xc4, 0xff, 0x00, 0x1c, 0x81, 0x92, 0xb2, 0x6b, 0x6d, 0x02, 0xdd, 0xbd, 0x36, 0x92, 0x36, 0x2d, 0x1f, 0xc0, 0x2a, 0x0b, 0x28, 0x1b, 0x91, 0x41, 0xf4, 0x9c, 0xb6, 0x25, 0x81, 0x46, 0xfe, 0x81, 0xb5, 0xad, 0x3d, 0xba, 0x57, 0xb7, 0xf9, 0xf6, 0xc9, 0xb0, 0x7f, 0xff, 0xd2, 0xf0, 0xe2, 0x86, 0x95, 0xc4, 0x67, 0x7e, 0x3f, 0x11, 0xf7, 0xa8, 0x19, 0x06, 0x69, 0x8d, 0xca, 0xca, 0x24, 0x8f, 0xd3, 0x52, 0x24, 0x89, 0x47, 0x25, 0x1f, 0xcb, 0x20, 0xf8, 0xb2, 0xb2, 0x76, 0x6e, 0x88, 0x36, 0xf6, 0x6f, 0x2a, 0xc1, 0x6e, 0xfa, 0x45, 0xad, 0xbc, 0x3f, 0x0b, 0x46, 0x81, 0x4d, 0x46, 0xea, 0x7a, 0x9a, 0x83, 0x9a, 0xa9, 0xdd, 0xbb, 0xec, 0x7b, 0x06, 0x5b, 0xe5, 0xcf, 0x2e, 0x69, 0xfa, 0x5c, 0xcd, 0x7b, 0x14, 0x5e, 0xa5, 0xee, 0xf5, 0xb8, 0x7d, 0xdd, 0x99, 0xba, 0xef, 0x91, 0x16, 0x5b, 0x36, 0xb6, 0x65, 0x0d, 0xac, 0xb2, 0x5b, 0xed, 0x34, 0x81, 0x7a, 0xbb, 0x46, 0x40, 0x6a, 0x9e, 0xb4, 0x39, 0x31, 0x13, 0x49, 0xda, 0xd2, 0x9b, 0xed, 0x1e, 0xc4, 0x24, 0xb3, 0x35, 0xb2, 0x88, 0x60, 0x06, 0xe6, 0x56, 0x98, 0x96, 0x79, 0x1e, 0x31, 0x51, 0xc9, 0x8f, 0xcb, 0x00, 0xe6, 0xb3, 0xe4, 0xf9, 0x2b, 0xcc, 0x7a, 0x94, 0xda, 0x96, 0xa9, 0x71, 0x77, 0x70, 0x79, 0xcd, 0x33, 0x97, 0x76, 0x3f, 0xcc, 0xc6, 0xa6, 0x9f, 0x2e, 0x99, 0xb9, 0xc6, 0x2a, 0x21, 0xe6, 0x73, 0xca, 0xe6, 0x4a, 0x51, 0x1a, 0x99, 0x1c, 0x28, 0x04, 0x93, 0xd0, 0x0e, 0xa4, 0xe4, 0xda, 0x5f, 0x50, 0xfe, 0x4a, 0xfe, 0x48, 0xb5, 0xb2, 0xc1, 0xe6, 0x1f, 0x31, 0x7e, 0xef, 0x52, 0x91, 0x43, 0xc3, 0x6e, 0x77, 0xf4, 0x22, 0x6d, 0xbf, 0xe4, 0x63, 0x0e, 0xbf, 0xca, 0x36, 0xeb, 0x5c, 0x84, 0xa5, 0x48, 0x7d, 0x3b, 0x61, 0xa1, 0xdb, 0x5b, 0x2c, 0x71, 0xda, 0x45, 0xc4, 0x28, 0x00, 0x81, 0xdb, 0x31, 0xc9, 0xb4, 0xb2, 0x3b, 0x5d, 0x27, 0xa5, 0x05, 0x1b, 0xc7, 0xdb, 0x10, 0xa9, 0xbd, 0xa6, 0x93, 0x0c, 0x75, 0xe4, 0x39, 0x35, 0x41, 0x3d, 0xc5, 0x06, 0xdb, 0x8e, 0xfd, 0x46, 0x5b, 0x1d, 0x98, 0x95, 0x4f, 0x46, 0xdb, 0xd5, 0xfb, 0x29, 0x5e, 0x9d, 0x0d, 0x32, 0xeb, 0x61, 0x4f, 0xff, 0xd3, 0xf1, 0x46, 0x9a, 0x16, 0x1b, 0x91, 0x71, 0x28, 0xac, 0x4a, 0x14, 0x30, 0x3e, 0x19, 0x54, 0xb9, 0x36, 0xc7, 0x9b, 0x2d, 0xd1, 0x6c, 0x45, 0xe3, 0xdc, 0xde, 0xc8, 0x95, 0x5b, 0x87, 0xf8, 0x41, 0x1d, 0x10, 0x54, 0x01, 0x98, 0x79, 0x25, 0xd1, 0xda, 0xe9, 0xe1, 0xb5, 0x9e, 0xac, 0xeb, 0x42, 0xba, 0x8e, 0xdf, 0x8c, 0x31, 0x21, 0x70, 0xb4, 0x5d, 0xbe, 0xc5, 0x7c, 0x2b, 0xed, 0xe1, 0x94, 0x18, 0xb9, 0x51, 0x3d, 0x03, 0x2c, 0x13, 0x6b, 0xf1, 0x42, 0x6e, 0xe2, 0xb7, 0x12, 0xa0, 0xdd, 0x50, 0x9f, 0x4f, 0x6f, 0xa7, 0x6f, 0xc7, 0x03, 0x61, 0xa0, 0x83, 0xb5, 0xf3, 0x97, 0x98, 0x20, 0x9c, 0x44, 0xea, 0xd0, 0xad, 0x48, 0x64, 0x90, 0x21, 0xd8, 0x9f, 0xa7, 0xa6, 0x44, 0xca, 0x99, 0xc6, 0x36, 0xcb, 0x74, 0x5d, 0x7e, 0x5b, 0xfe, 0x31, 0x6a, 0x31, 0xf3, 0x8c, 0xd0, 0xad, 0x40, 0xa3, 0x1f, 0x7c, 0x44, 0xd6, 0x51, 0xd9, 0xe0, 0x5f, 0x9a, 0x7e, 0x41, 0x9f, 0x40, 0xf3, 0x14, 0xba, 0x85, 0xba, 0x34, 0xba, 0x2d, 0xfb, 0x34, 0xd0, 0xcf, 0x4f, 0xb0, 0xce, 0x6a, 0x51, 0xe9, 0xb0, 0x20, 0xf4, 0xf1, 0x19, 0xb2, 0xc3, 0x90, 0x11, 0x4e, 0x97, 0x55, 0x80, 0x83, 0xc4, 0x17, 0x7e, 0x4c, 0x79, 0x19, 0xfc, 0xd1, 0xe7, 0x78, 0x4b, 0x91, 0x1d, 0xae, 0x92, 0xa6, 0xf6, 0x46, 0x75, 0xe4, 0xad, 0x22, 0x1f, 0xdd, 0xa1, 0x07, 0xb3, 0x1e, 0xfe, 0xd9, 0x92, 0xeb, 0x4b, 0xed, 0xfd, 0x0a, 0xc2, 0x63, 0x27, 0xa4, 0x88, 0x17, 0x60, 0x49, 0x35, 0xdc, 0x8e, 0xa5, 0x7d, 0xab, 0xd3, 0x28, 0x90, 0x50, 0xcd, 0xed, 0x2d, 0xda, 0x15, 0x55, 0x51, 0xf1, 0x1a, 0x0a, 0xf7, 0x39, 0x5d, 0xaa, 0x77, 0x6f, 0x01, 0x8e, 0xa7, 0x7d, 0xfa, 0xff, 0x00, 0x66, 0x10, 0xa8, 0xb8, 0x63, 0x76, 0x90, 0xa8, 0x20, 0x06, 0x56, 0xdb, 0x61, 0xda, 0xbd, 0x4f, 0xcb, 0x24, 0x15, 0x0f, 0xf5, 0x66, 0xe5, 0x5f, 0x4c, 0x53, 0xc3, 0xb7, 0xce, 0x99, 0x6b, 0x17, 0xff, 0xd4, 0xf0, 0xec, 0x57, 0x6f, 0x32, 0xa5, 0xa4, 0x43, 0x76, 0x75, 0xa9, 0xf1, 0x03, 0xfa, 0x64, 0x08, 0x6c, 0x8e, 0xfb, 0x3d, 0x7f, 0xcb, 0x16, 0x2b, 0x3d, 0xbc, 0x16, 0xa3, 0x66, 0x6d, 0x98, 0xfb, 0x1e, 0xb9, 0xac, 0xc8, 0x77, 0xb7, 0x7d, 0x01, 0xb3, 0x37, 0xb8, 0xd3, 0x46, 0x95, 0x68, 0x86, 0xd2, 0x2e, 0x4e, 0xab, 0xf0, 0x23, 0x11, 0x4e, 0x5f, 0xcd, 0x98, 0xe7, 0x25, 0x96, 0x71, 0x83, 0x0f, 0xd6, 0x3c, 0xb9, 0xe7, 0x0d, 0x7c, 0x41, 0x22, 0x5e, 0xb3, 0x20, 0x0c, 0x65, 0x80, 0xc8, 0x63, 0x8e, 0xbb, 0x95, 0xa5, 0x07, 0xeb, 0xcc, 0xac, 0x73, 0x83, 0x4e, 0x5c, 0x59, 0x09, 0xd8, 0xec, 0xc8, 0x57, 0x41, 0xd3, 0x4e, 0x95, 0xa5, 0x5b, 0x4b, 0x6a, 0xcb, 0xab, 0x43, 0x10, 0x4b, 0xeb, 0x85, 0xa2, 0x2c, 0x8e, 0x3f, 0x68, 0x54, 0xf5, 0x00, 0xd3, 0x97, 0x7a, 0x65, 0x79, 0xa6, 0x24, 0x76, 0x6f, 0xd3, 0x62, 0x96, 0x30, 0x78, 0xcb, 0x21, 0xf2, 0xf4, 0x22, 0xce, 0x54, 0x8e, 0x46, 0x26, 0x10, 0x7e, 0x0a, 0xf5, 0xd8, 0xf5, 0x1f, 0x31, 0x98, 0x83, 0x73, 0xb3, 0x91, 0xcd, 0x67, 0xe6, 0x7d, 0xe8, 0x16, 0x69, 0x6f, 0x10, 0x1f, 0x54, 0x9a, 0x37, 0xf5, 0x41, 0x5e, 0x7f, 0x0a, 0x29, 0x62, 0x02, 0xf8, 0x9c, 0xc8, 0x8c, 0x77, 0x6a, 0x99, 0xa0, 0x89, 0xff, 0x00, 0x9c, 0x74, 0xd2, 0xed, 0xed, 0xfc, 0xbb, 0x7b, 0xaa, 0x9a, 0x7d, 0x62, 0xfe, 0x46, 0x2d, 0xfe, 0x4c, 0x51, 0x31, 0x11, 0xa9, 0xf6, 0xef, 0x9b, 0x30, 0x5e, 0x7b, 0x38, 0xdd, 0xf4, 0x7f, 0x95, 0x94, 0xbc, 0x12, 0x43, 0x30, 0x6a, 0xb2, 0xf3, 0x86, 0x40, 0x3e, 0xcb, 0xd7, 0x6a, 0xd7, 0xb1, 0xe9, 0x8f, 0x37, 0x19, 0x97, 0x41, 0x2c, 0x71, 0x20, 0xf5, 0x36, 0x9c, 0x55, 0x78, 0x1d, 0x8a, 0x91, 0xd7, 0x11, 0x14, 0x5a, 0x3e, 0x19, 0x03, 0x10, 0x6b, 0xca, 0xbd, 0x86, 0xf8, 0x9d, 0x95, 0x18, 0x36, 0x65, 0x2e, 0xbc, 0x54, 0x1f, 0xa2, 0x99, 0x00, 0x59, 0x2a, 0x6f, 0x5e, 0x55, 0x15, 0xe9, 0x5f, 0xc3, 0x2f, 0xb6, 0x14, 0xff, 0x00, 0xff, 0xd5, 0xf1, 0x95, 0xfe, 0x80, 0x74, 0x0d, 0x7c, 0xd9, 0x89, 0x3d, 0x78, 0x57, 0x8b, 0xc5, 0x28, 0xe8, 0x55, 0xf7, 0x1f, 0x48, 0xca, 0x38, 0xb8, 0x83, 0x9f, 0x93, 0x07, 0x85, 0x3a, 0x7a, 0x6f, 0x95, 0x66, 0x2b, 0x2c, 0x4c, 0x0d, 0x14, 0x00, 0x3e, 0x9c, 0xc3, 0x98, 0x76, 0xb8, 0x45, 0xbd, 0x02, 0xde, 0x48, 0xee, 0xdc, 0xa0, 0x15, 0xe2, 0x2b, 0xc8, 0x8a, 0x8a, 0xfd, 0x3b, 0x66, 0x3f, 0x00, 0x73, 0x84, 0x2d, 0x36, 0xb5, 0xb5, 0x9e, 0x35, 0x1c, 0x29, 0xc4, 0xfe, 0xc8, 0x04, 0x7f, 0xc4, 0x69, 0x91, 0xe1, 0x67, 0x2c, 0x4a, 0xd2, 0xe9, 0x4e, 0xe3, 0xd4, 0xf4, 0x81, 0x5a, 0x12, 0xc5, 0x41, 0x3f, 0x79, 0x38, 0x9b, 0x60, 0x20, 0x07, 0x34, 0xb0, 0xc9, 0x03, 0x5c, 0x23, 0x03, 0x53, 0x13, 0x56, 0x88, 0xdf, 0x09, 0xda, 0x9b, 0xd3, 0xb6, 0x52, 0x0e, 0xec, 0xe4, 0x29, 0x24, 0xfc, 0xd0, 0xe7, 0x75, 0xe5, 0x57, 0x6b, 0x61, 0xfb, 0xf0, 0xca, 0xaa, 0x57, 0xa8, 0xe6, 0x78, 0x1a, 0x7d, 0xf9, 0x95, 0x8a, 0x5e, 0xa0, 0xe3, 0x67, 0x8f, 0xa0, 0xbd, 0x5b, 0xf2, 0xdf, 0x4a, 0x82, 0xcb, 0x4a, 0xb3, 0xb0, 0xb4, 0x41, 0x0a, 0x70, 0x48, 0xd9, 0x57, 0x60, 0x51, 0x3a, 0x8f, 0xbc, 0xe6, 0x7b, 0xcb, 0xe4, 0x3b, 0xa7, 0x3f, 0x9b, 0x9f, 0x9a, 0xba, 0x77, 0xe5, 0x5f, 0x95, 0x9c, 0x59, 0x94, 0x9f, 0xcd, 0x37, 0x8c, 0xa9, 0xa6, 0xd9, 0x39, 0xaa, 0xd0, 0x7d, 0xa9, 0x1c, 0x03, 0x5e, 0x09, 0xff, 0x00, 0x0c, 0x76, 0xcb, 0x62, 0x2d, 0xa5, 0xf2, 0x85, 0xbf, 0xe7, 0x87, 0xe6, 0xa3, 0x5e, 0x4d, 0xa8, 0xc9, 0xe6, 0x8b, 0xd5, 0x69, 0x5c, 0xb0, 0x4a, 0xab, 0xc4, 0xb5, 0x35, 0x0a, 0xaa, 0xea, 0x40, 0x03, 0xa0, 0xf6, 0xcb, 0x40, 0x4d, 0x3e, 0xdb, 0xff, 0x00, 0x9c, 0x7f, 0xfc, 0xce, 0x4f, 0xcc, 0xbf, 0x26, 0x25, 0xe5, 0xd3, 0x2f, 0xe9, 0xdd, 0x3d, 0xfe, 0xab, 0xa9, 0xaa, 0xd2, 0xa6, 0x40, 0x2a, 0xb2, 0x71, 0x00, 0x01, 0xea, 0x0d, 0xe8, 0x3a, 0x64, 0x25, 0x16, 0x1c, 0x8b, 0xd9, 0x51, 0x39, 0x28, 0x12, 0x51, 0x41, 0xfd, 0xa3, 0xd2, 0xb9, 0x4f, 0x0d, 0x33, 0xb5, 0xf4, 0x87, 0x9d, 0x79, 0x0e, 0xb4, 0xaf, 0x6a, 0xf8, 0xf1, 0xf0, 0xc9, 0xda, 0xbf, 0xff, 0xd6, 0xf2, 0xc6, 0xb5, 0x68, 0x64, 0xd0, 0x6d, 0x35, 0x20, 0x39, 0xcd, 0x13, 0x0f, 0x5e, 0x61, 0xfc, 0x8f, 0x40, 0x8b, 0x5e, 0xe0, 0x66, 0x1c, 0x4f, 0xaa, 0x9d, 0xe6, 0xa6, 0x1e, 0x91, 0x2e, 0xa9, 0x87, 0x95, 0xee, 0x9c, 0xc5, 0x55, 0x34, 0x60, 0x40, 0xae, 0x57, 0x30, 0xd9, 0xa7, 0x95, 0xbd, 0x6f, 0xcb, 0x26, 0x39, 0x40, 0x0d, 0x4e, 0xc0, 0x9f, 0x9e, 0x50, 0x5d, 0xac, 0x79, 0x33, 0x8b, 0xbb, 0x9b, 0x3b, 0x6b, 0x35, 0x48, 0x54, 0x09, 0x29, 0x56, 0x7f, 0xe1, 0x86, 0x72, 0x00, 0x2c, 0x6e, 0xf7, 0x63, 0x3e, 0x63, 0xbd, 0xbd, 0x5d, 0x20, 0x2a, 0xb3, 0xa4, 0x33, 0x48, 0xab, 0x21, 0x43, 0xf1, 0x2c, 0x47, 0xed, 0x1d, 0xbc, 0x73, 0x18, 0x9b, 0x64, 0x28, 0x96, 0x3a, 0xc7, 0x49, 0xb0, 0xf4, 0xcc, 0xe9, 0x73, 0x6c, 0xb4, 0xf8, 0x67, 0x92, 0x32, 0x21, 0x70, 0x7b, 0x89, 0x05, 0x57, 0xef, 0x38, 0x28, 0x94, 0x4a, 0x7d, 0x13, 0x7d, 0x6a, 0xd3, 0x4c, 0xb8, 0xf2, 0xc3, 0xc8, 0x2e, 0x03, 0xf3, 0xe2, 0x7d, 0x33, 0xb7, 0xc5, 0xcc, 0x71, 0x03, 0xc6, 0xb9, 0x64, 0x06, 0xe2, 0x9a, 0xf2, 0x4f, 0xd2, 0x6d, 0xe9, 0xfe, 0x41, 0x45, 0x5b, 0x18, 0x66, 0xa5, 0x64, 0x09, 0xf4, 0xd5, 0xb7, 0xcd, 0x93, 0xc7, 0xcf, 0x9b, 0xe5, 0x6f, 0xf9, 0xc8, 0x0d, 0x56, 0xeb, 0x59, 0xfc, 0xce, 0xd5, 0x12, 0x61, 0xc4, 0x69, 0xe9, 0x0d, 0xa4, 0x4b, 0xfe, 0x48, 0x40, 0xd5, 0x3e, 0xe4, 0xb6, 0x64, 0x8e, 0x4c, 0x02, 0x61, 0x65, 0xa0, 0x14, 0xb4, 0xb6, 0xb0, 0xb1, 0xb6, 0xb2, 0x97, 0xcb, 0xf1, 0x5a, 0x2d, 0xc6, 0xa5, 0xac, 0xb4, 0x70, 0x5d, 0xc7, 0x3d, 0xc1, 0x51, 0x24, 0x91, 0xc9, 0x31, 0x75, 0x6b, 0x70, 0x9f, 0x14, 0x68, 0x01, 0x46, 0xe4, 0xb5, 0xa3, 0x17, 0xcb, 0x40, 0x61, 0x6f, 0x47, 0xff, 0x00, 0x9c, 0x3a, 0x8f, 0x5b, 0x4f, 0x3c, 0x6b, 0xb7, 0xfa, 0x30, 0x91, 0x3c, 0xa4, 0xb1, 0x95, 0xb9, 0x82, 0x42, 0x0a, 0xbc, 0x8e, 0xe4, 0xdb, 0xa9, 0xef, 0xc9, 0x17, 0x91, 0x24, 0x7c, 0xb2, 0x05, 0x64, 0xfb, 0x75, 0x64, 0x32, 0x39, 0x69, 0x5b, 0x9c, 0xad, 0xb9, 0xdb, 0xa7, 0xb5, 0x3b, 0x53, 0x2a, 0x21, 0x41, 0x44, 0xf3, 0x8b, 0x8f, 0x2e, 0x43, 0x9d, 0x2b, 0xd4, 0x57, 0x23, 0x41, 0x36, 0xff, 0x00, 0xff, 0xd7, 0xf0, 0xc0, 0xd5, 0xb5, 0x11, 0x64, 0xb6, 0x3f, 0x59, 0x90, 0xd9, 0xab, 0x06, 0xf4, 0x79, 0x7c, 0x3b, 0x74, 0xc8, 0x08, 0x8b, 0xb6, 0xe3, 0x96, 0x55, 0x57, 0xb3, 0x3e, 0xf2, 0x35, 0xc7, 0xd6, 0x0b, 0x45, 0x5d, 0xdc, 0x8a, 0x7d, 0xd9, 0x8d, 0x94, 0x3b, 0x3d, 0x1c, 0x9e, 0xc3, 0xe5, 0xc3, 0x2c, 0x7c, 0xc5, 0x0f, 0xee, 0xdb, 0x8b, 0x0c, 0xc4, 0x26, 0x9d, 0xa0, 0x9a, 0x7d, 0x2c, 0xe5, 0xe4, 0x55, 0x7f, 0xee, 0xc1, 0x15, 0x04, 0xd0, 0x12, 0x3c, 0x72, 0x89, 0x1b, 0x2c, 0xcc, 0xa8, 0x2a, 0x8b, 0x87, 0xbb, 0x63, 0x1a, 0x28, 0x65, 0xf0, 0xed, 0xf2, 0xc3, 0xc2, 0x0a, 0x06, 0x4a, 0x46, 0xc7, 0xa5, 0xa3, 0x59, 0xc8, 0xb2, 0xc7, 0x45, 0x22, 0x9c, 0x14, 0x54, 0x10, 0x46, 0xf5, 0x1d, 0x32, 0x5c, 0x14, 0x14, 0xe4, 0x32, 0x2f, 0x3a, 0xf3, 0xb6, 0x90, 0x9a, 0x6d, 0xae, 0x9f, 0x3d, 0xab, 0xb8, 0x8a, 0x3b, 0xf8, 0x39, 0x44, 0x58, 0xf0, 0x08, 0xd5, 0x14, 0xa5, 0x7b, 0x65, 0x98, 0x8e, 0xfb, 0xb5, 0x67, 0x87, 0xa5, 0xef, 0x5e, 0x44, 0x96, 0x35, 0xb5, 0xb6, 0x59, 0x36, 0xfd, 0xd8, 0xa0, 0xf1, 0x20, 0x53, 0x33, 0xc0, 0x79, 0x59, 0x73, 0x7c, 0xd7, 0xf9, 0xfb, 0xa2, 0xcd, 0x67, 0xf9, 0xa7, 0x7b, 0x72, 0xf1, 0x71, 0x83, 0x53, 0x86, 0x0b, 0x98, 0x24, 0x22, 0x8a, 0xcc, 0x88, 0x23, 0x7f, 0xb8, 0xae, 0xf9, 0x7c, 0x50, 0x1e, 0x5f, 0x7c, 0x48, 0x21, 0x44, 0x6b, 0xce, 0x9b, 0xb0, 0x1b, 0x9e, 0xf5, 0xaf, 0x8e, 0x4d, 0x5f, 0x7a, 0x7f, 0xce, 0x34, 0xf9, 0x5d, 0x3c, 0xa3, 0xf9, 0x69, 0x63, 0xa9, 0x3c, 0x27, 0xeb, 0xda, 0xe1, 0x37, 0xd7, 0x2e, 0xaa, 0xdb, 0x06, 0xda, 0x30, 0x49, 0xfe, 0x54, 0x03, 0x03, 0x49, 0xdc, 0xb3, 0xaf, 0x38, 0xfe, 0x6a, 0xf9, 0x47, 0xc9, 0x3a, 0x74, 0x97, 0xfa, 0xf6, 0xaf, 0x15, 0x85, 0xb8, 0x75, 0x89, 0xb8, 0x87, 0x9a, 0x72, 0xee, 0x2a, 0x14, 0x24, 0x60, 0xb1, 0xa8, 0xdf, 0x07, 0x0b, 0x2d, 0xcb, 0xcf, 0x7f, 0xe8, 0x6a, 0xff, 0x00, 0x26, 0xbd, 0x6a, 0x7f, 0x89, 0x2f, 0xf8, 0x52, 0x9e, 0xb7, 0xe8, 0xb9, 0xb8, 0x57, 0xc2, 0x95, 0xe9, 0x8f, 0x08, 0x5a, 0x2f, 0xff, 0xd0, 0xf0, 0x4d, 0x40, 0xaa, 0xd7, 0x00, 0x64, 0xcb, 0x3c, 0x97, 0xa8, 0xb5, 0x9e, 0xa3, 0x1a, 0xd6, 0x84, 0x95, 0x3f, 0x45, 0x72, 0x9c, 0xa2, 0xc3, 0x99, 0xa5, 0x9d, 0x49, 0xf4, 0x17, 0x97, 0xaf, 0x63, 0x17, 0x52, 0x6f, 0xf0, 0xc8, 0x43, 0x6f, 0x9a, 0xe9, 0x07, 0x70, 0x0e, 0xec, 0x83, 0x51, 0x44, 0xb8, 0x61, 0x1a, 0x9e, 0x11, 0xd3, 0x91, 0x60, 0x68, 0x6b, 0xd3, 0x31, 0x4f, 0x36, 0xd3, 0x4c, 0x52, 0xef, 0x4c, 0xd5, 0x0c, 0xc4, 0x69, 0xda, 0x94, 0xc8, 0x3a, 0xf0, 0x66, 0x07, 0x73, 0xe0, 0x40, 0xfd, 0x79, 0x93, 0x12, 0x1c, 0x9c, 0x32, 0xc7, 0xfc, 0x41, 0x33, 0xd2, 0xb4, 0x6f, 0x38, 0x98, 0x65, 0x76, 0xbf, 0x69, 0x42, 0xd0, 0xaa, 0xc9, 0xde, 0x95, 0xad, 0x28, 0x46, 0x4e, 0xac, 0x39, 0x77, 0x80, 0x11, 0xbf, 0xd8, 0xc7, 0x7c, 0xe1, 0xa5, 0xf9, 0x92, 0x4d, 0x32, 0x5b, 0x8b, 0x93, 0x27, 0xa7, 0x68, 0x56, 0xe2, 0x45, 0xda, 0x85, 0x61, 0x6e, 0x67, 0xad, 0x6b, 0xb0, 0x38, 0xc2, 0x81, 0xe4, 0xc7, 0x52, 0x31, 0x1c, 0x67, 0x86, 0x5b, 0xbd, 0x37, 0xca, 0x7a, 0x94, 0xb1, 0x69, 0xb6, 0x2e, 0xb7, 0x15, 0x48, 0xc2, 0xb4, 0x52, 0x53, 0xac, 0x32, 0xaf, 0xb1, 0xed, 0x9b, 0x10, 0x36, 0x78, 0x5c, 0x9f, 0x51, 0x64, 0x1f, 0x98, 0x3e, 0x58, 0xb6, 0xfc, 0xc8, 0xf2, 0xe5, 0xbc, 0x68, 0x52, 0x2d, 0x5a, 0xd1, 0x84, 0xb6, 0xf3, 0x95, 0x0e, 0xc0, 0x85, 0xe2, 0xcb, 0xd8, 0xd1, 0xbb, 0xe4, 0xc1, 0xa6, 0x97, 0xce, 0x17, 0x5f, 0x95, 0xde, 0x6d, 0xb6, 0xbe, 0xb7, 0x69, 0x34, 0xf3, 0x3c, 0x72, 0xcf, 0xe8, 0xa3, 0x45, 0x49, 0x95, 0x4a, 0x90, 0x3e, 0x35, 0x5a, 0x95, 0x1d, 0xfe, 0x21, 0x93, 0x4d, 0xbe, 0xd2, 0xd2, 0xf5, 0x8b, 0xbd, 0x32, 0x2d, 0x3f, 0x4c, 0x9a, 0xe4, 0xca, 0x9e, 0x90, 0x85, 0x65, 0x55, 0x08, 0x85, 0x91, 0x01, 0x3b, 0x0a, 0x05, 0xe9, 0xb0, 0xc0, 0x5a, 0xc3, 0xcd, 0x3f, 0x3b, 0x7f, 0x26, 0xec, 0xff, 0x00, 0x35, 0x6d, 0x6d, 0xb5, 0x3d, 0x16, 0xfe, 0x0d, 0x3b, 0xcd, 0x96, 0x01, 0x92, 0x46, 0x9e, 0xa2, 0x0b, 0xc8, 0xb7, 0x28, 0x92, 0x71, 0xfb, 0x2e, 0xa7, 0xec, 0x3d, 0x0f, 0xc2, 0x68, 0x71, 0x05, 0x95, 0xd3, 0xe7, 0x9f, 0xfa, 0x16, 0x2f, 0xcd, 0x7f, 0x43, 0xd6, 0xfa, 0xa5, 0x97, 0xab, 0xeb, 0x7a, 0x5f, 0x55, 0xfa, 0xec, 0x5e, 0xaf, 0x0f, 0xf7, 0xed, 0x2b, 0x4e, 0x15, 0xff, 0x00, 0x65, 0xdf, 0x8e, 0x14, 0xf1, 0xbf, 0xff, 0xd1, 0xf0, 0x5a, 0xa7, 0x18, 0x5e, 0x56, 0x1f, 0x68, 0x71, 0x5f, 0xa7, 0xbe, 0x2a, 0x98, 0xdb, 0xfa, 0x90, 0x24, 0x37, 0xb0, 0xfd, 0xb8, 0xa8, 0x58, 0x78, 0xae, 0x43, 0xc9, 0xb4, 0x6d, 0xbb, 0xda, 0x3c, 0xa1, 0xad, 0x43, 0xa8, 0xda, 0xc5, 0x2a, 0x3d, 0x26, 0x5a, 0x02, 0x2b, 0xbe, 0x60, 0x64, 0x8d, 0x17, 0x6f, 0x8b, 0x20, 0x90, 0x7a, 0x3c, 0x32, 0x8b, 0xa8, 0x02, 0xf3, 0xfd, 0xe0, 0x1b, 0x11, 0x98, 0x66, 0x3b, 0xb9, 0x62, 0x54, 0x83, 0x36, 0xf2, 0xa4, 0xe4, 0x29, 0x34, 0xeb, 0xc8, 0x74, 0xae, 0x0d, 0xc3, 0x65, 0x82, 0x13, 0x6b, 0x57, 0xba, 0x54, 0xe4, 0x8c, 0x41, 0x1b, 0x75, 0xa7, 0xe0, 0x72, 0x5c, 0x4c, 0x84, 0x50, 0x5a, 0xb3, 0xdd, 0xdd, 0xc3, 0x24, 0x33, 0xb1, 0x60, 0xe0, 0x86, 0x52, 0x45, 0x38, 0xd2, 0x87, 0x24, 0x26, 0x6d, 0x8c, 0xe1, 0x41, 0x25, 0xfc, 0xa3, 0xd7, 0x2f, 0x6f, 0x3c, 0xbf, 0x73, 0xa5, 0xb2, 0x2c, 0xd1, 0x69, 0x17, 0x2f, 0x6b, 0x14, 0x8c, 0x0f, 0x21, 0x0d, 0x79, 0x46, 0x09, 0x15, 0xed, 0xb7, 0x4e, 0xd9, 0xb9, 0x8b, 0xcb, 0xe4, 0xa2, 0x5e, 0xa3, 0xa6, 0xdf, 0x6a, 0x36, 0xe4, 0xcd, 0x69, 0x1c, 0x4e, 0x84, 0x7c, 0x76, 0xab, 0x21, 0x67, 0xa8, 0xa7, 0xd9, 0xf8, 0x4d, 0x2b, 0xf3, 0xc3, 0x4d, 0x49, 0x57, 0x98, 0x75, 0x6f, 0x31, 0xda, 0xf9, 0xa3, 0x4b, 0xfd, 0x1f, 0x69, 0x1d, 0xae, 0xa1, 0xa9, 0x7e, 0xee, 0xe6, 0xd2, 0x79, 0x18, 0xf3, 0xb5, 0x1f, 0xee, 0xd9, 0x0a, 0x01, 0x4e, 0x3f, 0xb3, 0x4d, 0xf2, 0x9c, 0xb9, 0x04, 0x05, 0xb7, 0xe2, 0x87, 0x1e, 0xdd, 0x19, 0x3e, 0xaf, 0x6b, 0xae, 0xcb, 0x6d, 0x13, 0x0d, 0x45, 0xa2, 0x8e, 0x06, 0xe5, 0x13, 0x2a, 0x02, 0x01, 0x5e, 0x82, 0xb5, 0x04, 0xe6, 0x11, 0xd4, 0xcd, 0xda, 0x43, 0x49, 0x8e, 0xb7, 0xdc, 0xb1, 0x51, 0xe6, 0x4d, 0x76, 0xd2, 0x61, 0x15, 0xaa, 0x4b, 0xa8, 0xc9, 0x6e, 0x49, 0x79, 0x20, 0xe6, 0x8c, 0x49, 0xad, 0x43, 0x16, 0xe4, 0xa7, 0xaf, 0x43, 0xd3, 0x26, 0x35, 0x75, 0xcd, 0xa8, 0xe8, 0x87, 0x46, 0xbf, 0xc7, 0x9a, 0xff, 0x00, 0xd6, 0xbf, 0x48, 0xfe, 0x88, 0xfd, 0xe7, 0x0f, 0xab, 0xfa, 0x3f, 0x58, 0x7f, 0x5f, 0x8d, 0x3f, 0x9f, 0xa7, 0x5e, 0xd4, 0xc3, 0xf9, 0xd1, 0x7c, 0xb6, 0x47, 0xe4, 0x3a, 0x5b, 0xff, 0xd2, 0xf0, 0xb7, 0xa6, 0x1e, 0xdf, 0xd3, 0xf6, 0xa5, 0x71, 0x54, 0xdb, 0x4b, 0x80, 0x3c, 0x42, 0x26, 0xee, 0x29, 0xbe, 0x51, 0x23, 0x4e, 0x44, 0x05, 0x84, 0x45, 0xa5, 0xd5, 0xf7, 0x97, 0x2e, 0xfd, 0x6b, 0x6a, 0x98, 0x09, 0xab, 0xc7, 0xfc, 0x46, 0x3b, 0x4c, 0x26, 0x32, 0x30, 0x3e, 0x4f, 0x49, 0xd0, 0xfc, 0xfb, 0x05, 0xd4, 0x4a, 0x7d, 0x40, 0xac, 0x3a, 0x8e, 0x84, 0x1c, 0xc5, 0x96, 0x2a, 0x73, 0xe1, 0x9c, 0x16, 0x6d, 0xa5, 0x79, 0x86, 0xd6, 0xec, 0x80, 0x5a, 0xa0, 0xf5, 0xca, 0xcc, 0x5c, 0xa1, 0x2b, 0x1b, 0x26, 0x30, 0x6a, 0x31, 0x46, 0xcf, 0x1c, 0x87, 0x94, 0x64, 0x9e, 0x3d, 0xb6, 0xf0, 0xca, 0xa8, 0x39, 0x51, 0x99, 0x42, 0x6b, 0x1a, 0xc5, 0xa5, 0xa5, 0x94, 0xf7, 0x92, 0xc8, 0xaa, 0xb1, 0x23, 0x30, 0x04, 0xf8, 0x0e, 0x9f, 0x4e, 0x4a, 0x11, 0xb2, 0xd5, 0x9b, 0x25, 0x06, 0x1b, 0xff, 0x00, 0x38, 0xfd, 0xad, 0xdf, 0xda, 0xf9, 0xa2, 0xfe, 0xc5, 0x42, 0xbe, 0x9b, 0x7f, 0x0b, 0xdd, 0xdd, 0x07, 0xaf, 0x14, 0x68, 0xd8, 0x71, 0x6d, 0xbb, 0x90, 0xfc, 0x73, 0x6e, 0xf2, 0xf2, 0xdd, 0xf4, 0xad, 0xa6, 0xab, 0x6d, 0x69, 0x14, 0xfa, 0xee, 0xa0, 0xe2, 0x0b, 0x0d, 0x39, 0x19, 0xfe, 0x11, 0xc5, 0x1a, 0x4a, 0x1d, 0x8f, 0x73, 0x4f, 0xf8, 0x96, 0x0b, 0x40, 0x8d, 0xec, 0xf3, 0x6d, 0x3f, 0x52, 0xba, 0xd6, 0x35, 0x8b, 0xbf, 0x36, 0x6a, 0x5f, 0x0d, 0xc5, 0xdc, 0xa8, 0xb6, 0xa8, 0x7a, 0xc5, 0x6c, 0x9b, 0x22, 0x0f, 0xa3, 0x73, 0x9a, 0xbc, 0xb3, 0xe2, 0x36, 0xed, 0xb1, 0x43, 0x80, 0x53, 0xd0, 0xa7, 0xd4, 0x44, 0xfa, 0x7a, 0xda, 0x83, 0xbd, 0x3e, 0x2f, 0xa7, 0x2b, 0xad, 0x9b, 0xb8, 0x8d, 0xa8, 0xe8, 0x91, 0xdb, 0xfa, 0x2d, 0x6f, 0xc3, 0x8a, 0x2d, 0x56, 0xa3, 0xad, 0x4f, 0x5c, 0xa4, 0x0d, 0xdc, 0xa3, 0xca, 0xd0, 0xbf, 0xa1, 0xe3, 0xfa, 0xe7, 0x0f, 0xf2, 0xb9, 0x57, 0xbf, 0x1a, 0xe4, 0xb8, 0x57, 0xc5, 0xdd, 0xff, 0xd3, 0xf0, 0xcc, 0x5d, 0x7b, 0x70, 0xc5, 0x53, 0x6d, 0x2f, 0xd5, 0xe4, 0x69, 0xfd, 0xdf, 0xec, 0xd7, 0xad, 0x7d, 0xb2, 0x8c, 0x8d, 0xd8, 0xed, 0x91, 0x9f, 0x43, 0xea, 0xe7, 0xeb, 0x94, 0xad, 0x3e, 0x1e, 0x95, 0xfc, 0x72, 0x81, 0x7d, 0x1c, 0x9d, 0xba, 0xb1, 0x7b, 0xdf, 0xa9, 0x7a, 0xdf, 0xee, 0x2f, 0xd4, 0xfa, 0xe7, 0xed, 0x7a, 0x7f, 0xdd, 0xff, 0x00, 0xb2, 0xae, 0x64, 0x0b, 0xea, 0xe3, 0x9a, 0xbf, 0x4a, 0x6f, 0xa4, 0xff, 0x00, 0x89, 0xbd, 0x45, 0xfa, 0xb5, 0x79, 0xf7, 0xeb, 0xc7, 0xe9, 0xae, 0x57, 0x2e, 0x17, 0x23, 0x1f, 0x89, 0xd1, 0x99, 0x8f, 0xf1, 0xa7, 0x11, 0xcf, 0xd3, 0xf5, 0x29, 0xb5, 0x6b, 0xd3, 0xe8, 0xcc, 0x7f, 0x45, 0xb9, 0xa3, 0xc5, 0x62, 0xbe, 0x68, 0xff, 0x00, 0x15, 0xfd, 0x4c, 0xfe, 0x90, 0xaf, 0xd4, 0xab, 0xf1, 0x7a, 0x7f, 0x62, 0x9d, 0xab, 0xdf, 0x32, 0xb1, 0x70, 0x5e, 0xdc, 0xdc, 0x2d, 0x47, 0x8b, 0x5e, 0xae, 0x4c, 0xbf, 0xf2, 0x37, 0x9f, 0x3d, 0x5b, 0xd2, 0xff, 0x00, 0x8e, 0x87, 0xee, 0x29, 0x5a, 0xf2, 0xf4, 0xaa, 0xd4, 0xa5, 0x36, 0xa7, 0x3a, 0x57, 0xfd, 0x8e, 0x64, 0x3a, 0xf2, 0xf6, 0xbf, 0xcc, 0x7f, 0x5b, 0xfc, 0x23, 0xa7, 0xfe, 0x8e, 0xff, 0x00, 0x8e, 0x37, 0xd6, 0x63, 0xfa, 0xe5, 0x2b, 0xcb, 0x87, 0xec, 0xd6, 0xbd, 0xb9, 0x7d, 0xac, 0xc7, 0xcd, 0x7c, 0x2d, 0xf8, 0x2b, 0x89, 0x26, 0x8f, 0xd4, 0xfa, 0x94, 0x3e, 0x85, 0x29, 0xc9, 0x69, 0xfc, 0x33, 0x58, 0x5d, 0x9c, 0x79, 0xb2, 0xbb, 0x0f, 0xac, 0x7a, 0x2b, 0xea, 0x75, 0xef, 0x92, 0x0c, 0x53, 0x3d, 0x2f, 0xd4, 0xfa, 0xbb, 0xfa, 0x74, 0xf5, 0x39, 0x9a, 0xd7, 0xe7, 0x80, 0x53, 0x79, 0xba, 0x5b, 0xfe, 0x97, 0xfa, 0x4b, 0xfc, 0xba, 0x7f, 0xb1, 0xc7, 0xab, 0x1e, 0x8f, 0xff, 0xd9 -}; diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/testclient.h b/thirdparties/common/include/webrtc-sdk/talk/base/testclient.h deleted file mode 100755 index 2cce91e..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/testclient.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_TESTCLIENT_H_ -#define TALK_BASE_TESTCLIENT_H_ - -#include -#include "talk/base/asyncudpsocket.h" -#include "talk/base/criticalsection.h" - -namespace talk_base { - -// A simple client that can send TCP or UDP data and check that it receives -// what it expects to receive. Useful for testing server functionality. -class TestClient : public sigslot::has_slots<> { - public: - // Records the contents of a packet that was received. - struct Packet { - Packet(const SocketAddress& a, const char* b, size_t s); - Packet(const Packet& p); - virtual ~Packet(); - - SocketAddress addr; - char* buf; - size_t size; - }; - - // Creates a client that will send and receive with the given socket and - // will post itself messages with the given thread. - explicit TestClient(AsyncPacketSocket* socket); - ~TestClient(); - - SocketAddress address() const { return socket_->GetLocalAddress(); } - SocketAddress remote_address() const { return socket_->GetRemoteAddress(); } - - // Checks that the socket moves to the specified connect state. - bool CheckConnState(AsyncPacketSocket::State state); - - // Checks that the socket is connected to the remote side. - bool CheckConnected() { - return CheckConnState(AsyncPacketSocket::STATE_CONNECTED); - } - - // Sends using the clients socket. - int Send(const char* buf, size_t size); - - // Sends using the clients socket to the given destination. - int SendTo(const char* buf, size_t size, const SocketAddress& dest); - - // Returns the next packet received by the client or 0 if none is received - // within a reasonable amount of time. The caller must delete the packet - // when done with it. - Packet* NextPacket(); - - // Checks that the next packet has the given contents. Returns the remote - // address that the packet was sent from. - bool CheckNextPacket(const char* buf, size_t len, SocketAddress* addr); - - // Checks that no packets have arrived or will arrive in the next second. - bool CheckNoPacket(); - - int GetError(); - int SetOption(Socket::Option opt, int value); - - bool ready_to_send() const; - - private: - static const int kTimeout = 1000; - // Workaround for the fact that AsyncPacketSocket::GetConnState doesn't exist. - Socket::ConnState GetState(); - // Slot for packets read on the socket. - void OnPacket(AsyncPacketSocket* socket, const char* buf, size_t len, - const SocketAddress& remote_addr, - const PacketTime& packet_time); - void OnReadyToSend(AsyncPacketSocket* socket); - - CriticalSection crit_; - AsyncPacketSocket* socket_; - std::vector* packets_; - bool ready_to_send_; - DISALLOW_EVIL_CONSTRUCTORS(TestClient); -}; - -} // namespace talk_base - -#endif // TALK_BASE_TESTCLIENT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/testechoserver.h b/thirdparties/common/include/webrtc-sdk/talk/base/testechoserver.h deleted file mode 100755 index 62b42c4..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/testechoserver.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * libjingle - * Copyright 2004--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_BASE_TESTECHOSERVER_H_ -#define TALK_BASE_TESTECHOSERVER_H_ - -#include -#include "talk/base/asynctcpsocket.h" -#include "talk/base/socketaddress.h" -#include "talk/base/sigslot.h" -#include "talk/base/thread.h" - -namespace talk_base { - -// A test echo server, echoes back any packets sent to it. -// Useful for unit tests. -class TestEchoServer : public sigslot::has_slots<> { - public: - TestEchoServer(Thread* thread, const SocketAddress& addr) - : server_socket_(thread->socketserver()->CreateAsyncSocket(addr.family(), - SOCK_STREAM)) { - server_socket_->Bind(addr); - server_socket_->Listen(5); - server_socket_->SignalReadEvent.connect(this, &TestEchoServer::OnAccept); - } - ~TestEchoServer() { - for (ClientList::iterator it = client_sockets_.begin(); - it != client_sockets_.end(); ++it) { - delete *it; - } - } - - SocketAddress address() const { return server_socket_->GetLocalAddress(); } - - private: - void OnAccept(AsyncSocket* socket) { - AsyncSocket* raw_socket = socket->Accept(NULL); - if (raw_socket) { - AsyncTCPSocket* packet_socket = new AsyncTCPSocket(raw_socket, false); - packet_socket->SignalReadPacket.connect(this, &TestEchoServer::OnPacket); - packet_socket->SignalClose.connect(this, &TestEchoServer::OnClose); - client_sockets_.push_back(packet_socket); - } - } - void OnPacket(AsyncPacketSocket* socket, const char* buf, size_t size, - const SocketAddress& remote_addr, - const PacketTime& packet_time) { - talk_base::PacketOptions options; - socket->Send(buf, size, options); - } - void OnClose(AsyncPacketSocket* socket, int err) { - ClientList::iterator it = - std::find(client_sockets_.begin(), client_sockets_.end(), socket); - client_sockets_.erase(it); - Thread::Current()->Dispose(socket); - } - - typedef std::list ClientList; - scoped_ptr server_socket_; - ClientList client_sockets_; - DISALLOW_EVIL_CONSTRUCTORS(TestEchoServer); -}; - -} // namespace talk_base - -#endif // TALK_BASE_TESTECHOSERVER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/testutils.h b/thirdparties/common/include/webrtc-sdk/talk/base/testutils.h deleted file mode 100755 index c137cd3..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/testutils.h +++ /dev/null @@ -1,646 +0,0 @@ -/* - * libjingle - * Copyright 2004--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_BASE_TESTUTILS_H__ -#define TALK_BASE_TESTUTILS_H__ - -// Utilities for testing talk_base infrastructure in unittests - -#ifdef LINUX -#include -#include - -// X defines a few macros that stomp on types that gunit.h uses. -#undef None -#undef Bool -#endif - -#include -#include -#include "talk/base/asyncsocket.h" -#include "talk/base/common.h" -#include "talk/base/gunit.h" -#include "talk/base/nethelpers.h" -#include "talk/base/pathutils.h" -#include "talk/base/stream.h" -#include "talk/base/stringencode.h" -#include "talk/base/stringutils.h" -#include "talk/base/thread.h" - -namespace testing { - -using namespace talk_base; - -/////////////////////////////////////////////////////////////////////////////// -// StreamSink - Monitor asynchronously signalled events from StreamInterface -// or AsyncSocket (which should probably be a StreamInterface. -/////////////////////////////////////////////////////////////////////////////// - -// Note: Any event that is an error is treaded as SSE_ERROR instead of that -// event. - -enum StreamSinkEvent { - SSE_OPEN = SE_OPEN, - SSE_READ = SE_READ, - SSE_WRITE = SE_WRITE, - SSE_CLOSE = SE_CLOSE, - SSE_ERROR = 16 -}; - -class StreamSink : public sigslot::has_slots<> { - public: - void Monitor(StreamInterface* stream) { - stream->SignalEvent.connect(this, &StreamSink::OnEvent); - events_.erase(stream); - } - void Unmonitor(StreamInterface* stream) { - stream->SignalEvent.disconnect(this); - // In case you forgot to unmonitor a previous object with this address - events_.erase(stream); - } - bool Check(StreamInterface* stream, StreamSinkEvent event, bool reset = true) { - return DoCheck(stream, event, reset); - } - int Events(StreamInterface* stream, bool reset = true) { - return DoEvents(stream, reset); - } - - void Monitor(AsyncSocket* socket) { - socket->SignalConnectEvent.connect(this, &StreamSink::OnConnectEvent); - socket->SignalReadEvent.connect(this, &StreamSink::OnReadEvent); - socket->SignalWriteEvent.connect(this, &StreamSink::OnWriteEvent); - socket->SignalCloseEvent.connect(this, &StreamSink::OnCloseEvent); - // In case you forgot to unmonitor a previous object with this address - events_.erase(socket); - } - void Unmonitor(AsyncSocket* socket) { - socket->SignalConnectEvent.disconnect(this); - socket->SignalReadEvent.disconnect(this); - socket->SignalWriteEvent.disconnect(this); - socket->SignalCloseEvent.disconnect(this); - events_.erase(socket); - } - bool Check(AsyncSocket* socket, StreamSinkEvent event, bool reset = true) { - return DoCheck(socket, event, reset); - } - int Events(AsyncSocket* socket, bool reset = true) { - return DoEvents(socket, reset); - } - - private: - typedef std::map EventMap; - - void OnEvent(StreamInterface* stream, int events, int error) { - if (error) { - events = SSE_ERROR; - } - AddEvents(stream, events); - } - void OnConnectEvent(AsyncSocket* socket) { - AddEvents(socket, SSE_OPEN); - } - void OnReadEvent(AsyncSocket* socket) { - AddEvents(socket, SSE_READ); - } - void OnWriteEvent(AsyncSocket* socket) { - AddEvents(socket, SSE_WRITE); - } - void OnCloseEvent(AsyncSocket* socket, int error) { - AddEvents(socket, (0 == error) ? SSE_CLOSE : SSE_ERROR); - } - - void AddEvents(void* obj, int events) { - EventMap::iterator it = events_.find(obj); - if (events_.end() == it) { - events_.insert(EventMap::value_type(obj, events)); - } else { - it->second |= events; - } - } - bool DoCheck(void* obj, StreamSinkEvent event, bool reset) { - EventMap::iterator it = events_.find(obj); - if ((events_.end() == it) || (0 == (it->second & event))) { - return false; - } - if (reset) { - it->second &= ~event; - } - return true; - } - int DoEvents(void* obj, bool reset) { - EventMap::iterator it = events_.find(obj); - if (events_.end() == it) - return 0; - int events = it->second; - if (reset) { - it->second = 0; - } - return events; - } - - EventMap events_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// StreamSource - Implements stream interface and simulates asynchronous -// events on the stream, without a network. Also buffers written data. -/////////////////////////////////////////////////////////////////////////////// - -class StreamSource : public StreamInterface { -public: - StreamSource() { - Clear(); - } - - void Clear() { - readable_data_.clear(); - written_data_.clear(); - state_ = SS_CLOSED; - read_block_ = 0; - write_block_ = SIZE_UNKNOWN; - } - void QueueString(const char* data) { - QueueData(data, strlen(data)); - } - void QueueStringF(const char* format, ...) { - va_list args; - va_start(args, format); - char buffer[1024]; - size_t len = vsprintfn(buffer, sizeof(buffer), format, args); - ASSERT(len < sizeof(buffer) - 1); - va_end(args); - QueueData(buffer, len); - } - void QueueData(const char* data, size_t len) { - readable_data_.insert(readable_data_.end(), data, data + len); - if ((SS_OPEN == state_) && (readable_data_.size() == len)) { - SignalEvent(this, SE_READ, 0); - } - } - std::string ReadData() { - std::string data; - // avoid accessing written_data_[0] if it is undefined - if (written_data_.size() > 0) { - data.insert(0, &written_data_[0], written_data_.size()); - } - written_data_.clear(); - return data; - } - void SetState(StreamState state) { - int events = 0; - if ((SS_OPENING == state_) && (SS_OPEN == state)) { - events |= SE_OPEN; - if (!readable_data_.empty()) { - events |= SE_READ; - } - } else if ((SS_CLOSED != state_) && (SS_CLOSED == state)) { - events |= SE_CLOSE; - } - state_ = state; - if (events) { - SignalEvent(this, events, 0); - } - } - // Will cause Read to block when there are pos bytes in the read queue. - void SetReadBlock(size_t pos) { read_block_ = pos; } - // Will cause Write to block when there are pos bytes in the write queue. - void SetWriteBlock(size_t pos) { write_block_ = pos; } - - virtual StreamState GetState() const { return state_; } - virtual StreamResult Read(void* buffer, size_t buffer_len, - size_t* read, int* error) { - if (SS_CLOSED == state_) { - if (error) *error = -1; - return SR_ERROR; - } - if ((SS_OPENING == state_) || (readable_data_.size() <= read_block_)) { - return SR_BLOCK; - } - size_t count = _min(buffer_len, readable_data_.size() - read_block_); - memcpy(buffer, &readable_data_[0], count); - size_t new_size = readable_data_.size() - count; - // Avoid undefined access beyond the last element of the vector. - // This only happens when new_size is 0. - if (count < readable_data_.size()) { - memmove(&readable_data_[0], &readable_data_[count], new_size); - } - readable_data_.resize(new_size); - if (read) *read = count; - return SR_SUCCESS; - } - virtual StreamResult Write(const void* data, size_t data_len, - size_t* written, int* error) { - if (SS_CLOSED == state_) { - if (error) *error = -1; - return SR_ERROR; - } - if (SS_OPENING == state_) { - return SR_BLOCK; - } - if (SIZE_UNKNOWN != write_block_) { - if (written_data_.size() >= write_block_) { - return SR_BLOCK; - } - if (data_len > (write_block_ - written_data_.size())) { - data_len = write_block_ - written_data_.size(); - } - } - if (written) *written = data_len; - const char* cdata = static_cast(data); - written_data_.insert(written_data_.end(), cdata, cdata + data_len); - return SR_SUCCESS; - } - virtual void Close() { state_ = SS_CLOSED; } - -private: - typedef std::vector Buffer; - Buffer readable_data_, written_data_; - StreamState state_; - size_t read_block_, write_block_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// SocketTestClient -// Creates a simulated client for testing. Works on real and virtual networks. -/////////////////////////////////////////////////////////////////////////////// - -class SocketTestClient : public sigslot::has_slots<> { -public: - SocketTestClient() { - Init(NULL, AF_INET); - } - SocketTestClient(AsyncSocket* socket) { - Init(socket, socket->GetLocalAddress().family()); - } - SocketTestClient(const SocketAddress& address) { - Init(NULL, address.family()); - socket_->Connect(address); - } - - AsyncSocket* socket() { return socket_.get(); } - - void QueueString(const char* data) { - QueueData(data, strlen(data)); - } - void QueueStringF(const char* format, ...) { - va_list args; - va_start(args, format); - char buffer[1024]; - size_t len = vsprintfn(buffer, sizeof(buffer), format, args); - ASSERT(len < sizeof(buffer) - 1); - va_end(args); - QueueData(buffer, len); - } - void QueueData(const char* data, size_t len) { - send_buffer_.insert(send_buffer_.end(), data, data + len); - if (Socket::CS_CONNECTED == socket_->GetState()) { - Flush(); - } - } - std::string ReadData() { - std::string data(&recv_buffer_[0], recv_buffer_.size()); - recv_buffer_.clear(); - return data; - } - - bool IsConnected() const { - return (Socket::CS_CONNECTED == socket_->GetState()); - } - bool IsClosed() const { - return (Socket::CS_CLOSED == socket_->GetState()); - } - -private: - typedef std::vector Buffer; - - void Init(AsyncSocket* socket, int family) { - if (!socket) { - socket = Thread::Current()->socketserver() - ->CreateAsyncSocket(family, SOCK_STREAM); - } - socket_.reset(socket); - socket_->SignalConnectEvent.connect(this, - &SocketTestClient::OnConnectEvent); - socket_->SignalReadEvent.connect(this, &SocketTestClient::OnReadEvent); - socket_->SignalWriteEvent.connect(this, &SocketTestClient::OnWriteEvent); - socket_->SignalCloseEvent.connect(this, &SocketTestClient::OnCloseEvent); - } - - void Flush() { - size_t sent = 0; - while (sent < send_buffer_.size()) { - int result = socket_->Send(&send_buffer_[sent], - send_buffer_.size() - sent); - if (result > 0) { - sent += result; - } else { - break; - } - } - size_t new_size = send_buffer_.size() - sent; - memmove(&send_buffer_[0], &send_buffer_[sent], new_size); - send_buffer_.resize(new_size); - } - - void OnConnectEvent(AsyncSocket* socket) { - if (!send_buffer_.empty()) { - Flush(); - } - } - void OnReadEvent(AsyncSocket* socket) { - char data[64 * 1024]; - int result = socket_->Recv(data, ARRAY_SIZE(data)); - if (result > 0) { - recv_buffer_.insert(recv_buffer_.end(), data, data + result); - } - } - void OnWriteEvent(AsyncSocket* socket) { - if (!send_buffer_.empty()) { - Flush(); - } - } - void OnCloseEvent(AsyncSocket* socket, int error) { - } - - scoped_ptr socket_; - Buffer send_buffer_, recv_buffer_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// SocketTestServer -// Creates a simulated server for testing. Works on real and virtual networks. -/////////////////////////////////////////////////////////////////////////////// - -class SocketTestServer : public sigslot::has_slots<> { - public: - SocketTestServer(const SocketAddress& address) - : socket_(Thread::Current()->socketserver() - ->CreateAsyncSocket(address.family(), SOCK_STREAM)) - { - socket_->SignalReadEvent.connect(this, &SocketTestServer::OnReadEvent); - socket_->Bind(address); - socket_->Listen(5); - } - virtual ~SocketTestServer() { - clear(); - } - - size_t size() const { return clients_.size(); } - SocketTestClient* client(size_t index) const { return clients_[index]; } - SocketTestClient* operator[](size_t index) const { return client(index); } - - void clear() { - for (size_t i=0; i(socket_->Accept(NULL)); - if (!accepted) - return; - clients_.push_back(new SocketTestClient(accepted)); - } - - scoped_ptr socket_; - std::vector clients_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// Generic Utilities -/////////////////////////////////////////////////////////////////////////////// - -inline bool ReadFile(const char* filename, std::string* contents) { - FILE* fp = fopen(filename, "rb"); - if (!fp) - return false; - char buffer[1024*64]; - size_t read; - contents->clear(); - while ((read = fread(buffer, 1, sizeof(buffer), fp))) { - contents->append(buffer, read); - } - bool success = (0 != feof(fp)); - fclose(fp); - return success; -} - -// Look in parent dir for parallel directory. -inline talk_base::Pathname GetSiblingDirectory( - const std::string& parallel_dir) { - talk_base::Pathname path = talk_base::Filesystem::GetCurrentDirectory(); - while (!path.empty()) { - talk_base::Pathname potential_parallel_dir = path; - potential_parallel_dir.AppendFolder(parallel_dir); - if (talk_base::Filesystem::IsFolder(potential_parallel_dir)) { - return potential_parallel_dir; - } - - path.SetFolder(path.parent_folder()); - } - return path; -} - -inline talk_base::Pathname GetGoogle3Directory() { - return GetSiblingDirectory("google3"); -} - -inline talk_base::Pathname GetTalkDirectory() { - return GetSiblingDirectory("talk"); -} - -/////////////////////////////////////////////////////////////////////////////// -// Unittest predicates which are similar to STREQ, but for raw memory -/////////////////////////////////////////////////////////////////////////////// - -inline AssertionResult CmpHelperMemEq(const char* expected_expression, - const char* expected_length_expression, - const char* actual_expression, - const char* actual_length_expression, - const void* expected, - size_t expected_length, - const void* actual, - size_t actual_length) -{ - if ((expected_length == actual_length) - && (0 == memcmp(expected, actual, expected_length))) { - return AssertionSuccess(); - } - - Message msg; - msg << "Value of: " << actual_expression - << " [" << actual_length_expression << "]"; - if (true) { //!actual_value.Equals(actual_expression)) { - size_t buffer_size = actual_length * 2 + 1; - char* buffer = STACK_ARRAY(char, buffer_size); - hex_encode(buffer, buffer_size, - reinterpret_cast(actual), actual_length); - msg << "\n Actual: " << buffer << " [" << actual_length << "]"; - } - - msg << "\nExpected: " << expected_expression - << " [" << expected_length_expression << "]"; - if (true) { //!expected_value.Equals(expected_expression)) { - size_t buffer_size = expected_length * 2 + 1; - char* buffer = STACK_ARRAY(char, buffer_size); - hex_encode(buffer, buffer_size, - reinterpret_cast(expected), expected_length); - msg << "\nWhich is: " << buffer << " [" << expected_length << "]"; - } - - return AssertionFailure(msg); -} - -inline AssertionResult CmpHelperFileEq(const char* expected_expression, - const char* expected_length_expression, - const char* actual_filename, - const void* expected, - size_t expected_length, - const char* filename) -{ - std::string contents; - if (!ReadFile(filename, &contents)) { - Message msg; - msg << "File '" << filename << "' could not be read."; - return AssertionFailure(msg); - } - return CmpHelperMemEq(expected_expression, expected_length_expression, - actual_filename, "", - expected, expected_length, - contents.c_str(), contents.size()); -} - -#define EXPECT_MEMEQ(expected, expected_length, actual, actual_length) \ - EXPECT_PRED_FORMAT4(::testing::CmpHelperMemEq, expected, expected_length, \ - actual, actual_length) - -#define ASSERT_MEMEQ(expected, expected_length, actual, actual_length) \ - ASSERT_PRED_FORMAT4(::testing::CmpHelperMemEq, expected, expected_length, \ - actual, actual_length) - -#define EXPECT_FILEEQ(expected, expected_length, filename) \ - EXPECT_PRED_FORMAT3(::testing::CmpHelperFileEq, expected, expected_length, \ - filename) - -#define ASSERT_FILEEQ(expected, expected_length, filename) \ - ASSERT_PRED_FORMAT3(::testing::CmpHelperFileEq, expected, expected_length, \ - filename) - -/////////////////////////////////////////////////////////////////////////////// -// Helpers for initializing constant memory with integers in a particular byte -// order -/////////////////////////////////////////////////////////////////////////////// - -#define BYTE_CAST(x) static_cast((x) & 0xFF) - -// Declare a N-bit integer as a little-endian sequence of bytes -#define LE16(x) BYTE_CAST(((uint16)x) >> 0), BYTE_CAST(((uint16)x) >> 8) - -#define LE32(x) BYTE_CAST(((uint32)x) >> 0), BYTE_CAST(((uint32)x) >> 8), \ - BYTE_CAST(((uint32)x) >> 16), BYTE_CAST(((uint32)x) >> 24) - -#define LE64(x) BYTE_CAST(((uint64)x) >> 0), BYTE_CAST(((uint64)x) >> 8), \ - BYTE_CAST(((uint64)x) >> 16), BYTE_CAST(((uint64)x) >> 24), \ - BYTE_CAST(((uint64)x) >> 32), BYTE_CAST(((uint64)x) >> 40), \ - BYTE_CAST(((uint64)x) >> 48), BYTE_CAST(((uint64)x) >> 56) - -// Declare a N-bit integer as a big-endian (Internet) sequence of bytes -#define BE16(x) BYTE_CAST(((uint16)x) >> 8), BYTE_CAST(((uint16)x) >> 0) - -#define BE32(x) BYTE_CAST(((uint32)x) >> 24), BYTE_CAST(((uint32)x) >> 16), \ - BYTE_CAST(((uint32)x) >> 8), BYTE_CAST(((uint32)x) >> 0) - -#define BE64(x) BYTE_CAST(((uint64)x) >> 56), BYTE_CAST(((uint64)x) >> 48), \ - BYTE_CAST(((uint64)x) >> 40), BYTE_CAST(((uint64)x) >> 32), \ - BYTE_CAST(((uint64)x) >> 24), BYTE_CAST(((uint64)x) >> 16), \ - BYTE_CAST(((uint64)x) >> 8), BYTE_CAST(((uint64)x) >> 0) - -// Declare a N-bit integer as a this-endian (local machine) sequence of bytes -#ifndef BIG_ENDIAN -#define BIG_ENDIAN 1 -#endif // BIG_ENDIAN - -#if BIG_ENDIAN -#define TE16 BE16 -#define TE32 BE32 -#define TE64 BE64 -#else // !BIG_ENDIAN -#define TE16 LE16 -#define TE32 LE32 -#define TE64 LE64 -#endif // !BIG_ENDIAN - -/////////////////////////////////////////////////////////////////////////////// - -// Helpers for determining if X/screencasting is available (on linux). - -#define MAYBE_SKIP_SCREENCAST_TEST() \ - if (!testing::IsScreencastingAvailable()) { \ - LOG(LS_WARNING) << "Skipping test, since it doesn't have the requisite " \ - << "X environment for screen capture."; \ - return; \ - } \ - -#ifdef LINUX -struct XDisplay { - XDisplay() : display_(XOpenDisplay(NULL)) { } - ~XDisplay() { if (display_) XCloseDisplay(display_); } - bool IsValid() const { return display_ != NULL; } - operator Display*() { return display_; } - private: - Display* display_; -}; -#endif - -// Returns true if screencasting is available. When false, anything that uses -// screencasting features may fail. -inline bool IsScreencastingAvailable() { -#ifdef LINUX - XDisplay display; - if (!display.IsValid()) { - LOG(LS_WARNING) << "No X Display available."; - return false; - } - int ignored_int, major_version, minor_version; - if (!XRRQueryExtension(display, &ignored_int, &ignored_int) || - !XRRQueryVersion(display, &major_version, &minor_version) || - major_version < 1 || - (major_version < 2 && minor_version < 3)) { - LOG(LS_WARNING) << "XRandr version: " << major_version << "." - << minor_version; - LOG(LS_WARNING) << "XRandr is not supported or is too old (pre 1.3)."; - return false; - } -#endif - return true; -} -} // namespace testing - -#endif // TALK_BASE_TESTUTILS_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/thread.h b/thirdparties/common/include/webrtc-sdk/talk/base/thread.h deleted file mode 100755 index 18bf31c..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/thread.h +++ /dev/null @@ -1,311 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_BASE_THREAD_H_ -#define TALK_BASE_THREAD_H_ - -#include -#include -#include -#include - -#ifdef POSIX -#include -#endif -#include "talk/base/constructormagic.h" -#include "talk/base/event.h" -#include "talk/base/messagequeue.h" - -#ifdef WIN32 -#include "talk/base/win32.h" -#endif - -namespace talk_base { - -class Thread; - -class ThreadManager { - public: - ThreadManager(); - ~ThreadManager(); - - static ThreadManager* Instance(); - - Thread* CurrentThread(); - void SetCurrentThread(Thread* thread); - - // Returns a thread object with its thread_ ivar set - // to whatever the OS uses to represent the thread. - // If there already *is* a Thread object corresponding to this thread, - // this method will return that. Otherwise it creates a new Thread - // object whose wrapped() method will return true, and whose - // handle will, on Win32, be opened with only synchronization privileges - - // if you need more privilegs, rather than changing this method, please - // write additional code to adjust the privileges, or call a different - // factory method of your own devising, because this one gets used in - // unexpected contexts (like inside browser plugins) and it would be a - // shame to break it. It is also conceivable on Win32 that we won't even - // be able to get synchronization privileges, in which case the result - // will have a NULL handle. - Thread *WrapCurrentThread(); - void UnwrapCurrentThread(); - - private: -#ifdef POSIX - pthread_key_t key_; -#endif - -#ifdef WIN32 - DWORD key_; -#endif - - DISALLOW_COPY_AND_ASSIGN(ThreadManager); -}; - -struct _SendMessage { - _SendMessage() {} - Thread *thread; - Message msg; - bool *ready; -}; - -enum ThreadPriority { - PRIORITY_IDLE = -1, - PRIORITY_NORMAL = 0, - PRIORITY_ABOVE_NORMAL = 1, - PRIORITY_HIGH = 2, -}; - -class Runnable { - public: - virtual ~Runnable() {} - virtual void Run(Thread* thread) = 0; - - protected: - Runnable() {} - - private: - DISALLOW_COPY_AND_ASSIGN(Runnable); -}; - -// WARNING! SUBCLASSES MUST CALL Stop() IN THEIR DESTRUCTORS! See ~Thread(). - -class Thread : public MessageQueue { - public: - explicit Thread(SocketServer* ss = NULL); - // NOTE: ALL SUBCLASSES OF Thread MUST CALL Stop() IN THEIR DESTRUCTORS (or - // guarantee Stop() is explicitly called before the subclass is destroyed). - // This is required to avoid a data race between the destructor modifying the - // vtable, and the Thread::PreRun calling the virtual method Run(). - virtual ~Thread(); - - static Thread* Current(); - - bool IsCurrent() const { - return Current() == this; - } - - // Sleeps the calling thread for the specified number of milliseconds, during - // which time no processing is performed. Returns false if sleeping was - // interrupted by a signal (POSIX only). - static bool SleepMs(int millis); - - // Sets the thread's name, for debugging. Must be called before Start(). - // If |obj| is non-NULL, its value is appended to |name|. - const std::string& name() const { return name_; } - bool SetName(const std::string& name, const void* obj); - - // Sets the thread's priority. Must be called before Start(). - ThreadPriority priority() const { return priority_; } - bool SetPriority(ThreadPriority priority); - - // Starts the execution of the thread. - bool Start(Runnable* runnable = NULL); - - // Tells the thread to stop and waits until it is joined. - // Never call Stop on the current thread. Instead use the inherited Quit - // function which will exit the base MessageQueue without terminating the - // underlying OS thread. - virtual void Stop(); - - // By default, Thread::Run() calls ProcessMessages(kForever). To do other - // work, override Run(). To receive and dispatch messages, call - // ProcessMessages occasionally. - virtual void Run(); - - virtual void Send(MessageHandler *phandler, uint32 id = 0, - MessageData *pdata = NULL); - - // Convenience method to invoke a functor on another thread. Caller must - // provide the |ReturnT| template argument, which cannot (easily) be deduced. - // Uses Send() internally, which blocks the current thread until execution - // is complete. - // Ex: bool result = thread.Invoke(&MyFunctionReturningBool); - template - ReturnT Invoke(const FunctorT& functor) { - FunctorMessageHandler handler(functor); - Send(&handler); - return handler.result(); - } - - // From MessageQueue - virtual void Clear(MessageHandler *phandler, uint32 id = MQID_ANY, - MessageList* removed = NULL); - virtual void ReceiveSends(); - - // ProcessMessages will process I/O and dispatch messages until: - // 1) cms milliseconds have elapsed (returns true) - // 2) Stop() is called (returns false) - bool ProcessMessages(int cms); - - // Returns true if this is a thread that we created using the standard - // constructor, false if it was created by a call to - // ThreadManager::WrapCurrentThread(). The main thread of an application - // is generally not owned, since the OS representation of the thread - // obviously exists before we can get to it. - // You cannot call Start on non-owned threads. - bool IsOwned(); - -#ifdef WIN32 - HANDLE GetHandle() const { - return thread_; - } - DWORD GetId() const { - return thread_id_; - } -#elif POSIX - pthread_t GetPThread() { - return thread_; - } -#endif - - // This method should be called when thread is created using non standard - // method, like derived implementation of talk_base::Thread and it can not be - // started by calling Start(). This will set started flag to true and - // owned to false. This must be called from the current thread. - // NOTE: These methods should be used by the derived classes only, added here - // only for testing. - bool WrapCurrent(); - void UnwrapCurrent(); - - // Expose private method running() for tests. - // - // DANGER: this is a terrible public API. Most callers that might want to - // call this likely do not have enough control/knowledge of the Thread in - // question to guarantee that the returned value remains true for the duration - // of whatever code is conditionally executing because of the return value! - bool RunningForTest() { return running(); } - // This is a legacy call-site that probably doesn't need to exist in the first - // place. - // TODO(fischman): delete once the ASSERT added in channelmanager.cc sticks - // for a month (ETA 2014/06/22). - bool RunningForChannelManager() { return running(); } - - protected: - // Blocks the calling thread until this thread has terminated. - void Join(); - - private: - static void *PreRun(void *pv); - - // ThreadManager calls this instead WrapCurrent() because - // ThreadManager::Instance() cannot be used while ThreadManager is - // being created. - bool WrapCurrentWithThreadManager(ThreadManager* thread_manager); - - // Return true if the thread was started and hasn't yet stopped. - bool running() { return running_.Wait(0); } - - std::list<_SendMessage> sendlist_; - std::string name_; - ThreadPriority priority_; - Event running_; // Signalled means running. - -#ifdef POSIX - pthread_t thread_; -#endif - -#ifdef WIN32 - HANDLE thread_; - DWORD thread_id_; -#endif - - bool owned_; - - friend class ThreadManager; - - DISALLOW_COPY_AND_ASSIGN(Thread); -}; - -// AutoThread automatically installs itself at construction -// uninstalls at destruction, if a Thread object is -// _not already_ associated with the current OS thread. - -class AutoThread : public Thread { - public: - explicit AutoThread(SocketServer* ss = 0); - virtual ~AutoThread(); - - private: - DISALLOW_COPY_AND_ASSIGN(AutoThread); -}; - -// Win32 extension for threads that need to use COM -#ifdef WIN32 -class ComThread : public Thread { - public: - ComThread() {} - virtual ~ComThread() { Stop(); } - - protected: - virtual void Run(); - - private: - DISALLOW_COPY_AND_ASSIGN(ComThread); -}; -#endif - -// Provides an easy way to install/uninstall a socketserver on a thread. -class SocketServerScope { - public: - explicit SocketServerScope(SocketServer* ss) { - old_ss_ = Thread::Current()->socketserver(); - Thread::Current()->set_socketserver(ss); - } - ~SocketServerScope() { - Thread::Current()->set_socketserver(old_ss_); - } - - private: - SocketServer* old_ss_; - - DISALLOW_IMPLICIT_CONSTRUCTORS(SocketServerScope); -}; - -} // namespace talk_base - -#endif // TALK_BASE_THREAD_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/timeutils.h b/thirdparties/common/include/webrtc-sdk/talk/base/timeutils.h deleted file mode 100755 index d04435c..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/timeutils.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * libjingle - * Copyright 2005 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_BASE_TIMEUTILS_H_ -#define TALK_BASE_TIMEUTILS_H_ - -#include - -#include "talk/base/basictypes.h" - -namespace talk_base { - -static const int64 kNumMillisecsPerSec = INT64_C(1000); -static const int64 kNumMicrosecsPerSec = INT64_C(1000000); -static const int64 kNumNanosecsPerSec = INT64_C(1000000000); - -static const int64 kNumMicrosecsPerMillisec = kNumMicrosecsPerSec / - kNumMillisecsPerSec; -static const int64 kNumNanosecsPerMillisec = kNumNanosecsPerSec / - kNumMillisecsPerSec; -static const int64 kNumNanosecsPerMicrosec = kNumNanosecsPerSec / - kNumMicrosecsPerSec; - -// January 1970, in NTP milliseconds. -static const int64 kJan1970AsNtpMillisecs = INT64_C(2208988800000); - -typedef uint32 TimeStamp; - -// Returns the current time in milliseconds. -uint32 Time(); -// Returns the current time in microseconds. -uint64 TimeMicros(); -// Returns the current time in nanoseconds. -uint64 TimeNanos(); - -// Stores current time in *tm and microseconds in *microseconds. -void CurrentTmTime(struct tm *tm, int *microseconds); - -// Returns a future timestamp, 'elapsed' milliseconds from now. -uint32 TimeAfter(int32 elapsed); - -// Comparisons between time values, which can wrap around. -bool TimeIsBetween(uint32 earlier, uint32 middle, uint32 later); // Inclusive -bool TimeIsLaterOrEqual(uint32 earlier, uint32 later); // Inclusive -bool TimeIsLater(uint32 earlier, uint32 later); // Exclusive - -// Returns the later of two timestamps. -inline uint32 TimeMax(uint32 ts1, uint32 ts2) { - return TimeIsLaterOrEqual(ts1, ts2) ? ts2 : ts1; -} - -// Returns the earlier of two timestamps. -inline uint32 TimeMin(uint32 ts1, uint32 ts2) { - return TimeIsLaterOrEqual(ts1, ts2) ? ts1 : ts2; -} - -// Number of milliseconds that would elapse between 'earlier' and 'later' -// timestamps. The value is negative if 'later' occurs before 'earlier'. -int32 TimeDiff(uint32 later, uint32 earlier); - -// The number of milliseconds that have elapsed since 'earlier'. -inline int32 TimeSince(uint32 earlier) { - return TimeDiff(Time(), earlier); -} - -// The number of milliseconds that will elapse between now and 'later'. -inline int32 TimeUntil(uint32 later) { - return TimeDiff(later, Time()); -} - -// Converts a unix timestamp in nanoseconds to an NTP timestamp in ms. -inline int64 UnixTimestampNanosecsToNtpMillisecs(int64 unix_ts_ns) { - return unix_ts_ns / kNumNanosecsPerMillisec + kJan1970AsNtpMillisecs; -} - -class TimestampWrapAroundHandler { - public: - TimestampWrapAroundHandler(); - - int64 Unwrap(uint32 ts); - - private: - uint32 last_ts_; - int64 num_wrap_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_TIMEUTILS_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/timing.h b/thirdparties/common/include/webrtc-sdk/talk/base/timing.h deleted file mode 100755 index b2b9278..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/timing.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * libjingle - * Copyright 2008, 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_BASE_TIMING_H_ -#define TALK_BASE_TIMING_H_ - -#if defined(WIN32) -#include "talk/base/win32.h" -#endif - -namespace talk_base { - -class Timing { - public: - Timing(); - virtual ~Timing(); - - // WallTimeNow() returns the current wall-clock time in seconds, - // within 10 milliseconds resolution. - virtual double WallTimeNow(); - - // TimerNow() is like WallTimeNow(), but is monotonically - // increasing. It returns seconds in resolution of 10 microseconds - // or better. Although timer and wall-clock time have the same - // timing unit, they do not necessarily correlate because wall-clock - // time may be adjusted backwards, hence not monotonic. - // Made virtual so we can make a fake one. - virtual double TimerNow(); - - // BusyWait() exhausts CPU as long as the time elapsed is less than - // the specified interval in seconds. Returns the actual waiting - // time based on TimerNow() measurement. - double BusyWait(double period); - - // IdleWait() relinquishes control of CPU for specified period in - // seconds. It uses highest resolution sleep mechanism as possible, - // but does not otherwise guarantee the accuracy. Returns the - // actual waiting time based on TimerNow() measurement. - // - // This function is not re-entrant for an object. Create a fresh - // Timing object for each thread. - double IdleWait(double period); - - private: -#if defined(WIN32) - HANDLE timer_handle_; -#endif -}; - -} // namespace talk_base - -#endif // TALK_BASE_TIMING_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/transformadapter.h b/thirdparties/common/include/webrtc-sdk/talk/base/transformadapter.h deleted file mode 100755 index 1b22135..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/transformadapter.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_TRANSFORMADAPTER_H__ -#define TALK_BASE_TRANSFORMADAPTER_H__ - -#include "talk/base/stream.h" - -namespace talk_base { -/////////////////////////////////////////////////////////////////////////////// - -class TransformInterface { -public: - virtual ~TransformInterface() { } - - // Transform should convert the in_len bytes of input into the out_len-sized - // output buffer. If flush is true, there will be no more data following - // input. - // After the transformation, in_len contains the number of bytes consumed, and - // out_len contains the number of bytes ready in output. - // Note: Transform should not return SR_BLOCK, as there is no asynchronous - // notification available. - virtual StreamResult Transform(const void * input, size_t * in_len, - void * output, size_t * out_len, - bool flush) = 0; -}; - -/////////////////////////////////////////////////////////////////////////////// - -// TransformAdapter causes all data passed through to be transformed by the -// supplied TransformInterface object, which may apply compression, encryption, -// etc. - -class TransformAdapter : public StreamAdapterInterface { -public: - // Note that the transformation is unidirectional, in the direction specified - // by the constructor. Operations in the opposite direction result in SR_EOS. - TransformAdapter(StreamInterface * stream, - TransformInterface * transform, - bool direction_read); - virtual ~TransformAdapter(); - - virtual StreamResult Read(void * buffer, size_t buffer_len, - size_t * read, int * error); - virtual StreamResult Write(const void * data, size_t data_len, - size_t * written, int * error); - virtual void Close(); - - // Apriori, we can't tell what the transformation does to the stream length. - virtual bool GetAvailable(size_t* size) const { return false; } - virtual bool ReserveSize(size_t size) { return true; } - - // Transformations might not be restartable - virtual bool Rewind() { return false; } - -private: - enum State { ST_PROCESSING, ST_FLUSHING, ST_COMPLETE, ST_ERROR }; - enum { BUFFER_SIZE = 1024 }; - - TransformInterface * transform_; - bool direction_read_; - State state_; - int error_; - - char buffer_[BUFFER_SIZE]; - size_t len_; -}; - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace talk_base - -#endif // TALK_BASE_TRANSFORMADAPTER_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/unixfilesystem.h b/thirdparties/common/include/webrtc-sdk/talk/base/unixfilesystem.h deleted file mode 100755 index c5c530e..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/unixfilesystem.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - * libjingle - * Copyright 2004--2006, 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_BASE_UNIXFILESYSTEM_H_ -#define TALK_BASE_UNIXFILESYSTEM_H_ - -#include - -#include "talk/base/fileutils.h" - -namespace talk_base { - -class UnixFilesystem : public FilesystemInterface { - public: - UnixFilesystem(); - virtual ~UnixFilesystem(); - -#if defined(ANDROID) || defined(IOS) - // Android does not have a native code API to fetch the app data or temp - // folders. That needs to be passed into this class from Java. Similarly, iOS - // only supports an Objective-C API for fetching the folder locations, so that - // needs to be passed in here from Objective-C. Or at least that used to be - // the case; now the ctor will do the work if necessary and possible. - // TODO(fischman): add an Android version that uses JNI and drop the - // SetApp*Folder() APIs once external users stop using them. - static void SetAppDataFolder(const std::string& folder); - static void SetAppTempFolder(const std::string& folder); -#endif - - // Opens a file. Returns an open StreamInterface if function succeeds. - // Otherwise, returns NULL. - virtual FileStream *OpenFile(const Pathname &filename, - const std::string &mode); - - // Atomically creates an empty file accessible only to the current user if one - // does not already exist at the given path, otherwise fails. - virtual bool CreatePrivateFile(const Pathname &filename); - - // This will attempt to delete the file located at filename. - // It will fail with VERIY if you pass it a non-existant file, or a directory. - virtual bool DeleteFile(const Pathname &filename); - - // This will attempt to delete the folder located at 'folder' - // It ASSERTs and returns false if you pass it a non-existant folder or a - // plain file. - virtual bool DeleteEmptyFolder(const Pathname &folder); - - // Creates a directory. This will call itself recursively to create /foo/bar - // even if /foo does not exist. All created directories are created with the - // given mode. - // Returns TRUE if function succeeds - virtual bool CreateFolder(const Pathname &pathname, mode_t mode); - - // As above, with mode = 0755. - virtual bool CreateFolder(const Pathname &pathname); - - // This moves a file from old_path to new_path, where "file" can be a plain - // file or directory, which will be moved recursively. - // Returns true if function succeeds. - virtual bool MoveFile(const Pathname &old_path, const Pathname &new_path); - virtual bool MoveFolder(const Pathname &old_path, const Pathname &new_path); - - // This copies a file from old_path to _new_path where "file" can be a plain - // file or directory, which will be copied recursively. - // Returns true if function succeeds - virtual bool CopyFile(const Pathname &old_path, const Pathname &new_path); - - // Returns true if a pathname is a directory - virtual bool IsFolder(const Pathname& pathname); - - // Returns true if pathname represents a temporary location on the system. - virtual bool IsTemporaryPath(const Pathname& pathname); - - // Returns true of pathname represents an existing file - virtual bool IsFile(const Pathname& pathname); - - // Returns true if pathname refers to no filesystem object, every parent - // directory either exists, or is also absent. - virtual bool IsAbsent(const Pathname& pathname); - - virtual std::string TempFilename(const Pathname &dir, - const std::string &prefix); - - // A folder appropriate for storing temporary files (Contents are - // automatically deleted when the program exists) - virtual bool GetTemporaryFolder(Pathname &path, bool create, - const std::string *append); - - virtual bool GetFileSize(const Pathname& path, size_t* size); - virtual bool GetFileTime(const Pathname& path, FileTimeType which, - time_t* time); - - // Returns the path to the running application. - virtual bool GetAppPathname(Pathname* path); - - virtual bool GetAppDataFolder(Pathname* path, bool per_user); - - // Get a temporary folder that is unique to the current user and application. - virtual bool GetAppTempFolder(Pathname* path); - - virtual bool GetDiskFreeSpace(const Pathname& path, int64 *freebytes); - - // Returns the absolute path of the current directory. - virtual Pathname GetCurrentDirectory(); - - private: -#if defined(ANDROID) || defined(IOS) - static char* provided_app_data_folder_; - static char* provided_app_temp_folder_; -#else - static char* app_temp_path_; -#endif - - static char* CopyString(const std::string& str); -}; - -} // namespace talk_base - -#endif // TALK_BASE_UNIXFILESYSTEM_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/urlencode.h b/thirdparties/common/include/webrtc-sdk/talk/base/urlencode.h deleted file mode 100755 index d26e3e5..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/urlencode.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * libjingle - * Copyright 2008, 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 _URLENCODE_H_ -#define _URLENCODE_H_ - -#include - -// Decode all encoded characters. Also decode + as space. -int UrlDecode(const char *source, char *dest); - -// Decode all encoded characters. -int UrlDecodeWithoutEncodingSpaceAsPlus(const char *source, char *dest); - -// Encode all characters except alphas, numbers, and -_.!~*'() -// Also encode space as +. -int UrlEncode(const char *source, char *dest, unsigned max); - -// Encode all characters except alphas, numbers, and -_.!~*'() -int UrlEncodeWithoutEncodingSpaceAsPlus(const char *source, char *dest, - unsigned max); - -// Encode only unsafe chars, including \ "^&`<>[]{} -// Also encode space as %20, instead of + -int UrlEncodeOnlyUnsafeChars(const char *source, char *dest, unsigned max); - -std::string UrlDecodeString(const std::string & encoded); -std::string UrlDecodeStringWithoutEncodingSpaceAsPlus( - const std::string & encoded); -std::string UrlEncodeString(const std::string & decoded); -std::string UrlEncodeStringWithoutEncodingSpaceAsPlus( - const std::string & decoded); -std::string UrlEncodeStringForOnlyUnsafeChars(const std::string & decoded); - -#endif - diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/versionparsing.h b/thirdparties/common/include/webrtc-sdk/talk/base/versionparsing.h deleted file mode 100755 index 6eb4494..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/versionparsing.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_BASE_VERSIONPARSING_H_ -#define TALK_BASE_VERSIONPARSING_H_ - -#include - -namespace talk_base { - -// Parses a version string into an array. "num_expected_segments" must be the -// number of numerical segments that the version is expected to have (e.g., -// "1.1.2.0" has 4). "version" must be an array of that length to hold the -// parsed numbers. -// Returns "true" iff successful. -bool ParseVersionString(const std::string& version_str, - int num_expected_segments, - int version[]); - -// Computes the lexicographical order of two versions. The return value -// indicates the order in the standard way (e.g., see strcmp()). -int CompareVersions(const int version1[], - const int version2[], - int num_segments); - -} // namespace talk_base - -#endif // TALK_BASE_VERSIONPARSING_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/virtualsocketserver.h b/thirdparties/common/include/webrtc-sdk/talk/base/virtualsocketserver.h deleted file mode 100755 index d01347b..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/virtualsocketserver.h +++ /dev/null @@ -1,251 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_VIRTUALSOCKETSERVER_H_ -#define TALK_BASE_VIRTUALSOCKETSERVER_H_ - -#include - -#include -#include - -#include "talk/base/messagequeue.h" -#include "talk/base/socketserver.h" - -namespace talk_base { - -class VirtualSocket; -class SocketAddressPair; - -// Simulates a network in the same manner as a loopback interface. The -// interface can create as many addresses as you want. All of the sockets -// created by this network will be able to communicate with one another, unless -// they are bound to addresses from incompatible families. -class VirtualSocketServer : public SocketServer, public sigslot::has_slots<> { - public: - // TODO: Add "owned" parameter. - // If "owned" is set, the supplied socketserver will be deleted later. - explicit VirtualSocketServer(SocketServer* ss); - virtual ~VirtualSocketServer(); - - SocketServer* socketserver() { return server_; } - - // Limits the network bandwidth (maximum bytes per second). Zero means that - // all sends occur instantly. Defaults to 0. - uint32 bandwidth() const { return bandwidth_; } - void set_bandwidth(uint32 bandwidth) { bandwidth_ = bandwidth; } - - // Limits the amount of data which can be in flight on the network without - // packet loss (on a per sender basis). Defaults to 64 KB. - uint32 network_capacity() const { return network_capacity_; } - void set_network_capacity(uint32 capacity) { - network_capacity_ = capacity; - } - - // The amount of data which can be buffered by tcp on the sender's side - uint32 send_buffer_capacity() const { return send_buffer_capacity_; } - void set_send_buffer_capacity(uint32 capacity) { - send_buffer_capacity_ = capacity; - } - - // The amount of data which can be buffered by tcp on the receiver's side - uint32 recv_buffer_capacity() const { return recv_buffer_capacity_; } - void set_recv_buffer_capacity(uint32 capacity) { - recv_buffer_capacity_ = capacity; - } - - // Controls the (transit) delay for packets sent in the network. This does - // not inclue the time required to sit in the send queue. Both of these - // values are measured in milliseconds. Defaults to no delay. - uint32 delay_mean() const { return delay_mean_; } - uint32 delay_stddev() const { return delay_stddev_; } - uint32 delay_samples() const { return delay_samples_; } - void set_delay_mean(uint32 delay_mean) { delay_mean_ = delay_mean; } - void set_delay_stddev(uint32 delay_stddev) { - delay_stddev_ = delay_stddev; - } - void set_delay_samples(uint32 delay_samples) { - delay_samples_ = delay_samples; - } - - // If the (transit) delay parameters are modified, this method should be - // called to recompute the new distribution. - void UpdateDelayDistribution(); - - // Controls the (uniform) probability that any sent packet is dropped. This - // is separate from calculations to drop based on queue size. - double drop_probability() { return drop_prob_; } - void set_drop_probability(double drop_prob) { - assert((0 <= drop_prob) && (drop_prob <= 1)); - drop_prob_ = drop_prob; - } - - // SocketFactory: - virtual Socket* CreateSocket(int type); - virtual Socket* CreateSocket(int family, int type); - - virtual AsyncSocket* CreateAsyncSocket(int type); - virtual AsyncSocket* CreateAsyncSocket(int family, int type); - - // SocketServer: - virtual void SetMessageQueue(MessageQueue* queue); - virtual bool Wait(int cms, bool process_io); - virtual void WakeUp(); - - typedef std::pair Point; - typedef std::vector Function; - - static Function* CreateDistribution(uint32 mean, uint32 stddev, - uint32 samples); - - // Similar to Thread::ProcessMessages, but it only processes messages until - // there are no immediate messages or pending network traffic. Returns false - // if Thread::Stop() was called. - bool ProcessMessagesUntilIdle(); - - protected: - // Returns a new IP not used before in this network. - IPAddress GetNextIP(int family); - uint16 GetNextPort(); - - VirtualSocket* CreateSocketInternal(int family, int type); - - // Binds the given socket to addr, assigning and IP and Port if necessary - int Bind(VirtualSocket* socket, SocketAddress* addr); - - // Binds the given socket to the given (fully-defined) address. - int Bind(VirtualSocket* socket, const SocketAddress& addr); - - // Find the socket bound to the given address - VirtualSocket* LookupBinding(const SocketAddress& addr); - - int Unbind(const SocketAddress& addr, VirtualSocket* socket); - - // Adds a mapping between this socket pair and the socket. - void AddConnection(const SocketAddress& client, - const SocketAddress& server, - VirtualSocket* socket); - - // Find the socket pair corresponding to this server address. - VirtualSocket* LookupConnection(const SocketAddress& client, - const SocketAddress& server); - - void RemoveConnection(const SocketAddress& client, - const SocketAddress& server); - - // Connects the given socket to the socket at the given address - int Connect(VirtualSocket* socket, const SocketAddress& remote_addr, - bool use_delay); - - // Sends a disconnect message to the socket at the given address - bool Disconnect(VirtualSocket* socket); - - // Sends the given packet to the socket at the given address (if one exists). - int SendUdp(VirtualSocket* socket, const char* data, size_t data_size, - const SocketAddress& remote_addr); - - // Moves as much data as possible from the sender's buffer to the network - void SendTcp(VirtualSocket* socket); - - // Places a packet on the network. - void AddPacketToNetwork(VirtualSocket* socket, VirtualSocket* recipient, - uint32 cur_time, const char* data, size_t data_size, - size_t header_size, bool ordered); - - // Removes stale packets from the network - void PurgeNetworkPackets(VirtualSocket* socket, uint32 cur_time); - - // Computes the number of milliseconds required to send a packet of this size. - uint32 SendDelay(uint32 size); - - // Returns a random transit delay chosen from the appropriate distribution. - uint32 GetRandomTransitDelay(); - - // Basic operations on functions. Those that return a function also take - // ownership of the function given (and hence, may modify or delete it). - static Function* Accumulate(Function* f); - static Function* Invert(Function* f); - static Function* Resample(Function* f, double x1, double x2, uint32 samples); - static double Evaluate(Function* f, double x); - - // NULL out our message queue if it goes away. Necessary in the case where - // our lifetime is greater than that of the thread we are using, since we - // try to send Close messages for all connected sockets when we shutdown. - void OnMessageQueueDestroyed() { msg_queue_ = NULL; } - - // Determine if two sockets should be able to communicate. - // We don't (currently) specify an address family for sockets; instead, - // the currently bound address is used to infer the address family. - // Any socket that is not explicitly bound to an IPv4 address is assumed to be - // dual-stack capable. - // This function tests if two addresses can communicate, as well as the - // sockets to which they may be bound (the addresses may or may not yet be - // bound to the sockets). - // First the addresses are tested (after normalization): - // If both have the same family, then communication is OK. - // If only one is IPv4 then false, unless the other is bound to ::. - // This applies even if the IPv4 address is 0.0.0.0. - // The socket arguments are optional; the sockets are checked to see if they - // were explicitly bound to IPv6-any ('::'), and if so communication is - // permitted. - // NB: This scheme doesn't permit non-dualstack IPv6 sockets. - static bool CanInteractWith(VirtualSocket* local, VirtualSocket* remote); - - private: - friend class VirtualSocket; - - typedef std::map AddressMap; - typedef std::map ConnectionMap; - - SocketServer* server_; - bool server_owned_; - MessageQueue* msg_queue_; - bool stop_on_idle_; - uint32 network_delay_; - in_addr next_ipv4_; - in6_addr next_ipv6_; - uint16 next_port_; - AddressMap* bindings_; - ConnectionMap* connections_; - - uint32 bandwidth_; - uint32 network_capacity_; - uint32 send_buffer_capacity_; - uint32 recv_buffer_capacity_; - uint32 delay_mean_; - uint32 delay_stddev_; - uint32 delay_samples_; - Function* delay_dist_; - CriticalSection delay_crit_; - - double drop_prob_; - DISALLOW_EVIL_CONSTRUCTORS(VirtualSocketServer); -}; - -} // namespace talk_base - -#endif // TALK_BASE_VIRTUALSOCKETSERVER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/win32.h b/thirdparties/common/include/webrtc-sdk/talk/base/win32.h deleted file mode 100755 index 515ad46..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/win32.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_WIN32_H_ -#define TALK_BASE_WIN32_H_ - -#ifdef WIN32 - -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif - -// Make sure we don't get min/max macros -#ifndef NOMINMAX -#define NOMINMAX -#endif - -#include -#include - -#ifndef SECURITY_MANDATORY_LABEL_AUTHORITY -// Add defines that we use if we are compiling against older sdks -#define SECURITY_MANDATORY_MEDIUM_RID (0x00002000L) -#define TokenIntegrityLevel static_cast(0x19) -typedef struct _TOKEN_MANDATORY_LABEL { - SID_AND_ATTRIBUTES Label; -} TOKEN_MANDATORY_LABEL, *PTOKEN_MANDATORY_LABEL; -#endif // SECURITY_MANDATORY_LABEL_AUTHORITY - -#undef SetPort - -#include - -#include "talk/base/stringutils.h" -#include "talk/base/basictypes.h" - -namespace talk_base { - -const char* win32_inet_ntop(int af, const void *src, char* dst, socklen_t size); -int win32_inet_pton(int af, const char* src, void *dst); - -/////////////////////////////////////////////////////////////////////////////// - -inline std::wstring ToUtf16(const char* utf8, size_t len) { - int len16 = ::MultiByteToWideChar(CP_UTF8, 0, utf8, static_cast(len), - NULL, 0); - wchar_t* ws = STACK_ARRAY(wchar_t, len16); - ::MultiByteToWideChar(CP_UTF8, 0, utf8, static_cast(len), ws, len16); - return std::wstring(ws, len16); -} - -inline std::wstring ToUtf16(const std::string& str) { - return ToUtf16(str.data(), str.length()); -} - -inline std::string ToUtf8(const wchar_t* wide, size_t len) { - int len8 = ::WideCharToMultiByte(CP_UTF8, 0, wide, static_cast(len), - NULL, 0, NULL, NULL); - char* ns = STACK_ARRAY(char, len8); - ::WideCharToMultiByte(CP_UTF8, 0, wide, static_cast(len), ns, len8, - NULL, NULL); - return std::string(ns, len8); -} - -inline std::string ToUtf8(const wchar_t* wide) { - return ToUtf8(wide, wcslen(wide)); -} - -inline std::string ToUtf8(const std::wstring& wstr) { - return ToUtf8(wstr.data(), wstr.length()); -} - -// Convert FILETIME to time_t -void FileTimeToUnixTime(const FILETIME& ft, time_t* ut); - -// Convert time_t to FILETIME -void UnixTimeToFileTime(const time_t& ut, FILETIME * ft); - -// Convert a Utf8 path representation to a non-length-limited Unicode pathname. -bool Utf8ToWindowsFilename(const std::string& utf8, std::wstring* filename); - -// Convert a FILETIME to a UInt64 -inline uint64 ToUInt64(const FILETIME& ft) { - ULARGE_INTEGER r = {ft.dwLowDateTime, ft.dwHighDateTime}; - return r.QuadPart; -} - -enum WindowsMajorVersions { - kWindows2000 = 5, - kWindowsVista = 6, -}; -bool GetOsVersion(int* major, int* minor, int* build); - -inline bool IsWindowsVistaOrLater() { - int major; - return (GetOsVersion(&major, NULL, NULL) && major >= kWindowsVista); -} - -inline bool IsWindowsXpOrLater() { - int major, minor; - return (GetOsVersion(&major, &minor, NULL) && - (major >= kWindowsVista || - (major == kWindows2000 && minor >= 1))); -} - -// Determine the current integrity level of the process. -bool GetCurrentProcessIntegrityLevel(int* level); - -inline bool IsCurrentProcessLowIntegrity() { - int level; - return (GetCurrentProcessIntegrityLevel(&level) && - level < SECURITY_MANDATORY_MEDIUM_RID); -} - -bool AdjustCurrentProcessPrivilege(const TCHAR* privilege, bool to_enable); - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace talk_base - -#endif // WIN32 -#endif // TALK_BASE_WIN32_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/win32filesystem.h b/thirdparties/common/include/webrtc-sdk/talk/base/win32filesystem.h deleted file mode 100755 index 24ea081..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/win32filesystem.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - * libjingle - * Copyright 2004--2006, 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_BASE_WIN32FILESYSTEM_H__ -#define _TALK_BASE_WIN32FILESYSTEM_H__ - -#include "fileutils.h" - -namespace talk_base { - -class Win32Filesystem : public FilesystemInterface { - public: - // Opens a file. Returns an open StreamInterface if function succeeds. Otherwise, - // returns NULL. - virtual FileStream *OpenFile(const Pathname &filename, - const std::string &mode); - - // Atomically creates an empty file accessible only to the current user if one - // does not already exist at the given path, otherwise fails. - virtual bool CreatePrivateFile(const Pathname &filename); - - // This will attempt to delete the path located at filename. - // If the path points to a folder, it will fail with VERIFY - virtual bool DeleteFile(const Pathname &filename); - - // This will attempt to delete an empty folder. If the path does not point to - // a folder, it fails with VERIFY. If the folder is not empty, it fails normally - virtual bool DeleteEmptyFolder(const Pathname &folder); - - // Creates a directory. This will call itself recursively to create /foo/bar even if - // /foo does not exist. - // Returns TRUE if function succeeds - virtual bool CreateFolder(const Pathname &pathname); - - // This moves a file from old_path to new_path. If the new path is on a - // different volume than the old, it will attempt to copy and then delete - // the folder - // Returns true if the file is successfully moved - virtual bool MoveFile(const Pathname &old_path, const Pathname &new_path); - - // Moves a folder from old_path to new_path. If the new path is on a different - // volume from the old, it will attempt to Copy and then Delete the folder - // Returns true if the folder is successfully moved - virtual bool MoveFolder(const Pathname &old_path, const Pathname &new_path); - - // This copies a file from old_path to _new_path - // Returns true if function succeeds - virtual bool CopyFile(const Pathname &old_path, const Pathname &new_path); - - // Returns true if a pathname is a directory - virtual bool IsFolder(const Pathname& pathname); - - // Returns true if a file exists at path - virtual bool IsFile(const Pathname &path); - - // Returns true if pathname refers to no filesystem object, every parent - // directory either exists, or is also absent. - virtual bool IsAbsent(const Pathname& pathname); - - // Returns true if pathname represents a temporary location on the system. - virtual bool IsTemporaryPath(const Pathname& pathname); - - // All of the following functions set pathname and return true if successful. - // Returned paths always include a trailing backslash. - // If create is true, the path will be recursively created. - // If append is non-NULL, it will be appended (and possibly created). - - virtual std::string TempFilename(const Pathname &dir, const std::string &prefix); - - virtual bool GetFileSize(const Pathname& path, size_t* size); - virtual bool GetFileTime(const Pathname& path, FileTimeType which, - time_t* time); - - // A folder appropriate for storing temporary files (Contents are - // automatically deleted when the program exists) - virtual bool GetTemporaryFolder(Pathname &path, bool create, - const std::string *append); - - // Returns the path to the running application. - virtual bool GetAppPathname(Pathname* path); - - virtual bool GetAppDataFolder(Pathname* path, bool per_user); - - // Get a temporary folder that is unique to the current user and application. - virtual bool GetAppTempFolder(Pathname* path); - - virtual bool GetDiskFreeSpace(const Pathname& path, int64 *freebytes); - - virtual Pathname GetCurrentDirectory(); -}; - -} // namespace talk_base - -#endif // _WIN32FILESYSTEM_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/win32regkey.h b/thirdparties/common/include/webrtc-sdk/talk/base/win32regkey.h deleted file mode 100755 index f780b50..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/win32regkey.h +++ /dev/null @@ -1,354 +0,0 @@ -/* - * libjingle - * Copyright 2003-2007, 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. - */ - -// Registry configuration wrappers class -// -// Offers static functions for convenient -// fast access for individual values -// -// Also provides a wrapper class for efficient -// batch operations on values of a given registry key. -// - -#ifndef TALK_BASE_WIN32REGKEY_H_ -#define TALK_BASE_WIN32REGKEY_H_ - -#include -#include - -#include "talk/base/basictypes.h" -#include "talk/base/win32.h" - -namespace talk_base { - -// maximum sizes registry key and value names -const int kMaxKeyNameChars = 255 + 1; -const int kMaxValueNameChars = 16383 + 1; - -class RegKey { - public: - // constructor - RegKey(); - - // destructor - ~RegKey(); - - // create a reg key - HRESULT Create(HKEY parent_key, const wchar_t* key_name); - - HRESULT Create(HKEY parent_key, - const wchar_t* key_name, - wchar_t* reg_class, - DWORD options, - REGSAM sam_desired, - LPSECURITY_ATTRIBUTES lp_sec_attr, - LPDWORD lp_disposition); - - // open an existing reg key - HRESULT Open(HKEY parent_key, const wchar_t* key_name); - - HRESULT Open(HKEY parent_key, const wchar_t* key_name, REGSAM sam_desired); - - // close this reg key - HRESULT Close(); - - // check if the key has a specified value - bool HasValue(const wchar_t* value_name) const; - - // get the number of values for this key - uint32 GetValueCount(); - - // Called to get the value name for the given value name index - // Use GetValueCount() to get the total value_name count for this key - // Returns failure if no key at the specified index - // If you modify the key while enumerating, the indexes will be out of order. - // Since the index order is not guaranteed, you need to reset your counting - // loop. - // 'type' refers to REG_DWORD, REG_QWORD, etc.. - // 'type' can be NULL if not interested in the value type - HRESULT GetValueNameAt(int index, std::wstring* value_name, DWORD* type); - - // check if the current key has the specified subkey - bool HasSubkey(const wchar_t* key_name) const; - - // get the number of subkeys for this key - uint32 GetSubkeyCount(); - - // Called to get the key name for the given key index - // Use GetSubkeyCount() to get the total count for this key - // Returns failure if no key at the specified index - // If you modify the key while enumerating, the indexes will be out of order. - // Since the index order is not guaranteed, you need to reset your counting - // loop. - HRESULT GetSubkeyNameAt(int index, std::wstring* key_name); - - // SETTERS - - // set an int32 value - use when reading multiple values from a key - HRESULT SetValue(const wchar_t* value_name, DWORD value) const; - - // set an int64 value - HRESULT SetValue(const wchar_t* value_name, DWORD64 value) const; - - // set a string value - HRESULT SetValue(const wchar_t* value_name, const wchar_t* value) const; - - // set binary data - HRESULT SetValue(const wchar_t* value_name, - const uint8* value, - DWORD byte_count) const; - - // set raw data, including type - HRESULT SetValue(const wchar_t* value_name, - const uint8* value, - DWORD byte_count, - DWORD type) const; - - // GETTERS - - // get an int32 value - HRESULT GetValue(const wchar_t* value_name, DWORD* value) const; - - // get an int64 value - HRESULT GetValue(const wchar_t* value_name, DWORD64* value) const; - - // get a string value - the caller must free the return buffer - HRESULT GetValue(const wchar_t* value_name, wchar_t** value) const; - - // get a string value - HRESULT GetValue(const wchar_t* value_name, std::wstring* value) const; - - // get a std::vector value from REG_MULTI_SZ type - HRESULT GetValue(const wchar_t* value_name, - std::vector* value) const; - - // get binary data - the caller must free the return buffer - HRESULT GetValue(const wchar_t* value_name, - uint8** value, - DWORD* byte_count) const; - - // get raw data, including type - the caller must free the return buffer - HRESULT GetValue(const wchar_t* value_name, - uint8** value, - DWORD* byte_count, - DWORD* type) const; - - // STATIC VERSIONS - - // flush - static HRESULT FlushKey(const wchar_t* full_key_name); - - // check if a key exists - static bool HasKey(const wchar_t* full_key_name); - - // check if the key has a specified value - static bool HasValue(const wchar_t* full_key_name, const wchar_t* value_name); - - // SETTERS - - // STATIC int32 set - static HRESULT SetValue(const wchar_t* full_key_name, - const wchar_t* value_name, - DWORD value); - - // STATIC int64 set - static HRESULT SetValue(const wchar_t* full_key_name, - const wchar_t* value_name, - DWORD64 value); - - // STATIC float set - static HRESULT SetValue(const wchar_t* full_key_name, - const wchar_t* value_name, - float value); - - // STATIC double set - static HRESULT SetValue(const wchar_t* full_key_name, - const wchar_t* value_name, - double value); - - // STATIC string set - static HRESULT SetValue(const wchar_t* full_key_name, - const wchar_t* value_name, - const wchar_t* value); - - // STATIC binary data set - static HRESULT SetValue(const wchar_t* full_key_name, - const wchar_t* value_name, - const uint8* value, - DWORD byte_count); - - // STATIC multi-string set - static HRESULT SetValueMultiSZ(const wchar_t* full_key_name, - const TCHAR* value_name, - const uint8* value, - DWORD byte_count); - - // GETTERS - - // STATIC int32 get - static HRESULT GetValue(const wchar_t* full_key_name, - const wchar_t* value_name, - DWORD* value); - - // STATIC int64 get - // - // Note: if you are using time64 you should - // likely use GetLimitedTimeValue (util.h) instead of this method. - static HRESULT GetValue(const wchar_t* full_key_name, - const wchar_t* value_name, - DWORD64* value); - - // STATIC float get - static HRESULT GetValue(const wchar_t* full_key_name, - const wchar_t* value_name, - float* value); - - // STATIC double get - static HRESULT GetValue(const wchar_t* full_key_name, - const wchar_t* value_name, - double* value); - - // STATIC string get - // Note: the caller must free the return buffer for wchar_t* version - static HRESULT GetValue(const wchar_t* full_key_name, - const wchar_t* value_name, - wchar_t** value); - static HRESULT GetValue(const wchar_t* full_key_name, - const wchar_t* value_name, - std::wstring* value); - - // STATIC REG_MULTI_SZ get - static HRESULT GetValue(const wchar_t* full_key_name, - const wchar_t* value_name, - std::vector* value); - - // STATIC get binary data - the caller must free the return buffer - static HRESULT GetValue(const wchar_t* full_key_name, - const wchar_t* value_name, - uint8** value, - DWORD* byte_count); - - // Get type of a registry value - static HRESULT GetValueType(const wchar_t* full_key_name, - const wchar_t* value_name, - DWORD* value_type); - - // delete a subkey of the current key (with no subkeys) - HRESULT DeleteSubKey(const wchar_t* key_name); - - // recursively delete a sub key of the current key (and all its subkeys) - HRESULT RecurseDeleteSubKey(const wchar_t* key_name); - - // STATIC version of delete key - handles nested keys also - // delete a key and all its sub-keys recursively - // Returns S_FALSE if key didn't exist, S_OK if deletion was successful, - // and failure otherwise. - static HRESULT DeleteKey(const wchar_t* full_key_name); - - // STATIC version of delete key - // delete a key recursively or non-recursively - // Returns S_FALSE if key didn't exist, S_OK if deletion was successful, - // and failure otherwise. - static HRESULT DeleteKey(const wchar_t* full_key_name, bool recursive); - - // delete the specified value - HRESULT DeleteValue(const wchar_t* value_name); - - // STATIC version of delete value - // Returns S_FALSE if key didn't exist, S_OK if deletion was successful, - // and failure otherwise. - static HRESULT DeleteValue(const wchar_t* full_key_name, - const wchar_t* value_name); - - // Peek inside (use a RegKey as a smart wrapper around a registry handle) - HKEY key() { return h_key_; } - - // helper function to get the HKEY and the root key from a string - // modifies the argument in place and returns the key name - // e.g. HKLM\\Software\\Google\... returns HKLM, "Software\\Google\..." - // Necessary for the static versions that use the full name of the reg key - static HKEY GetRootKeyInfo(std::wstring* full_key_name); - - // Returns true if this key name is 'safe' for deletion (doesn't specify a key - // root) - static bool SafeKeyNameForDeletion(const wchar_t* key_name); - - // save the key and all of its subkeys and values to a file - static HRESULT Save(const wchar_t* full_key_name, const wchar_t* file_name); - - // restore the key and all of its subkeys and values which are saved into a - // file - static HRESULT Restore(const wchar_t* full_key_name, - const wchar_t* file_name); - - // Is the key empty: having no sub-keys and values - static bool IsKeyEmpty(const wchar_t* full_key_name); - - private: - - // helper function to get any value from the registry - // used when the size of the data is unknown - HRESULT GetValueHelper(const wchar_t* value_name, - DWORD* type, uint8** value, - DWORD* byte_count) const; - - // helper function to get the parent key name and the subkey from a string - // modifies the argument in place and returns the key name - // Necessary for the static versions that use the full name of the reg key - static std::wstring GetParentKeyInfo(std::wstring* key_name); - - // common SET Helper for the static case - static HRESULT SetValueStaticHelper(const wchar_t* full_key_name, - const wchar_t* value_name, - DWORD type, - LPVOID value, - DWORD byte_count = 0); - - // common GET Helper for the static case - static HRESULT GetValueStaticHelper(const wchar_t* full_key_name, - const wchar_t* value_name, - DWORD type, - LPVOID value, - DWORD* byte_count = NULL); - - // convert REG_MULTI_SZ bytes to string array - static HRESULT MultiSZBytesToStringArray(const uint8* buffer, - DWORD byte_count, - std::vector* value); - - // the HKEY for the current key - HKEY h_key_; - - // for unittest - friend void RegKeyHelperFunctionsTest(); - - DISALLOW_EVIL_CONSTRUCTORS(RegKey); -}; - -} // namespace talk_base - -#endif // TALK_BASE_WIN32REGKEY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/win32socketinit.h b/thirdparties/common/include/webrtc-sdk/talk/base/win32socketinit.h deleted file mode 100755 index 53edb1b..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/win32socketinit.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * libjingle - * Copyright 2009, 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_BASE_WIN32SOCKETINIT_H_ -#define TALK_BASE_WIN32SOCKETINIT_H_ - -namespace talk_base { - -void EnsureWinsockInit(); - -} // namespace talk_base - -#endif // TALK_BASE_WIN32SOCKETINIT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/win32socketserver.h b/thirdparties/common/include/webrtc-sdk/talk/base/win32socketserver.h deleted file mode 100755 index 910f959..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/win32socketserver.h +++ /dev/null @@ -1,181 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_WIN32SOCKETSERVER_H_ -#define TALK_BASE_WIN32SOCKETSERVER_H_ - -#ifdef WIN32 -#include "talk/base/asyncsocket.h" -#include "talk/base/criticalsection.h" -#include "talk/base/messagequeue.h" -#include "talk/base/socketserver.h" -#include "talk/base/socketfactory.h" -#include "talk/base/socket.h" -#include "talk/base/thread.h" -#include "talk/base/win32window.h" - -namespace talk_base { - -/////////////////////////////////////////////////////////////////////////////// -// Win32Socket -/////////////////////////////////////////////////////////////////////////////// - -class Win32Socket : public AsyncSocket { - public: - Win32Socket(); - virtual ~Win32Socket(); - - bool CreateT(int family, int type); - - int Attach(SOCKET s); - void SetTimeout(int ms); - - // AsyncSocket Interface - virtual SocketAddress GetLocalAddress() const; - virtual SocketAddress GetRemoteAddress() const; - virtual int Bind(const SocketAddress& addr); - virtual int Connect(const SocketAddress& addr); - virtual int Send(const void *buffer, size_t length); - virtual int SendTo(const void *buffer, size_t length, const SocketAddress& addr); - virtual int Recv(void *buffer, size_t length); - virtual int RecvFrom(void *buffer, size_t length, SocketAddress *out_addr); - virtual int Listen(int backlog); - virtual Win32Socket *Accept(SocketAddress *out_addr); - virtual int Close(); - virtual int GetError() const; - virtual void SetError(int error); - virtual ConnState GetState() const; - virtual int EstimateMTU(uint16* mtu); - virtual int GetOption(Option opt, int* value); - virtual int SetOption(Option opt, int value); - - private: - void CreateSink(); - bool SetAsync(int events); - int DoConnect(const SocketAddress& addr); - bool HandleClosed(int close_error); - void PostClosed(); - void UpdateLastError(); - static int TranslateOption(Option opt, int* slevel, int* sopt); - - void OnSocketNotify(SOCKET socket, int event, int error); - void OnDnsNotify(HANDLE task, int error); - - SOCKET socket_; - int error_; - ConnState state_; - SocketAddress addr_; // address that we connected to (see DoConnect) - uint32 connect_time_; - bool closing_; - int close_error_; - - class EventSink; - friend class EventSink; - EventSink * sink_; - - struct DnsLookup; - DnsLookup * dns_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// Win32SocketServer -/////////////////////////////////////////////////////////////////////////////// - -class Win32SocketServer : public SocketServer { - public: - explicit Win32SocketServer(MessageQueue* message_queue); - virtual ~Win32SocketServer(); - - void set_modeless_dialog(HWND hdlg) { - hdlg_ = hdlg; - } - - // SocketServer Interface - virtual Socket* CreateSocket(int type); - virtual Socket* CreateSocket(int family, int type); - - virtual AsyncSocket* CreateAsyncSocket(int type); - virtual AsyncSocket* CreateAsyncSocket(int family, int type); - - virtual void SetMessageQueue(MessageQueue* queue); - virtual bool Wait(int cms, bool process_io); - virtual void WakeUp(); - - void Pump(); - - HWND handle() { return wnd_.handle(); } - - private: - class MessageWindow : public Win32Window { - public: - explicit MessageWindow(Win32SocketServer* ss) : ss_(ss) {} - private: - virtual bool OnMessage(UINT msg, WPARAM wp, LPARAM lp, LRESULT& result); - Win32SocketServer* ss_; - }; - - static const TCHAR kWindowName[]; - MessageQueue *message_queue_; - MessageWindow wnd_; - CriticalSection cs_; - bool posted_; - HWND hdlg_; -}; - -/////////////////////////////////////////////////////////////////////////////// -// Win32Thread. Automatically pumps Windows messages. -/////////////////////////////////////////////////////////////////////////////// - -class Win32Thread : public Thread { - public: - Win32Thread() : ss_(this), id_(0) { - set_socketserver(&ss_); - } - virtual ~Win32Thread() { - Stop(); - set_socketserver(NULL); - } - virtual void Run() { - id_ = GetCurrentThreadId(); - Thread::Run(); - id_ = 0; - } - virtual void Quit() { - PostThreadMessage(id_, WM_QUIT, 0, 0); - } - private: - Win32SocketServer ss_; - DWORD id_; -}; - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace talk_base - -#endif // WIN32 - -#endif // TALK_BASE_WIN32SOCKETSERVER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/win32toolhelp.h b/thirdparties/common/include/webrtc-sdk/talk/base/win32toolhelp.h deleted file mode 100755 index b532fd7..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/win32toolhelp.h +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved. - - -#ifndef TALK_BASE_WIN32TOOLHELP_H_ -#define TALK_BASE_WIN32TOOLHELP_H_ - -#ifndef WIN32 -#error WIN32 Only -#endif - -#include "talk/base/win32.h" - -// Should be included first, but that causes redefinitions. -#include - -#include "talk/base/constructormagic.h" - -namespace talk_base { - -// The toolhelp api used to enumerate processes and their modules -// on Windows is very repetetive and clunky to use. This little -// template wraps it to make it a little more programmer friendly. -// -// Traits: Traits type that adapts the enumerator to the corresponding -// win32 toolhelp api. Each traits class need to: -// - define the type of the enumerated data as a public symbol Type -// -// - implement bool First(HANDLE, T*) normally calls a -// Xxxx32First method in the toolhelp API. Ex Process32First(...) -// -// - implement bool Next(HANDLE, T*) normally calls a -// Xxxx32Next method in the toolhelp API. Ex Process32Next(...) -// -// - implement bool CloseHandle(HANDLE) -// -template -class ToolhelpEnumeratorBase { - public: - ToolhelpEnumeratorBase(HANDLE snapshot) - : snapshot_(snapshot), broken_(false), first_(true) { - - // Clear out the Traits::Type structure instance. - Zero(¤t_); - } - - virtual ~ToolhelpEnumeratorBase() { - Close(); - } - - // Moves forward to the next object using the First and Next - // pointers. If either First or Next ever indicates an failure - // all subsequent calls to this method will fail; the enumerator - // object is considered broken. - bool Next() { - if (!Valid()) { - return false; - } - - // Move the iteration forward. - current_.dwSize = sizeof(typename Traits::Type); - bool incr_ok = false; - if (first_) { - incr_ok = Traits::First(snapshot_, ¤t_); - first_ = false; - } else { - incr_ok = Traits::Next(snapshot_, ¤t_); - } - - if (!incr_ok) { - Zero(¤t_); - broken_ = true; - } - - return incr_ok; - } - - const typename Traits::Type& current() const { - return current_; - } - - void Close() { - if (snapshot_ != INVALID_HANDLE_VALUE) { - Traits::CloseHandle(snapshot_); - snapshot_ = INVALID_HANDLE_VALUE; - } - } - - private: - // Checks the state of the snapshot handle. - bool Valid() { - return snapshot_ != INVALID_HANDLE_VALUE && !broken_; - } - - static void Zero(typename Traits::Type* buff) { - ZeroMemory(buff, sizeof(typename Traits::Type)); - } - - HANDLE snapshot_; - typename Traits::Type current_; - bool broken_; - bool first_; -}; - -class ToolhelpTraits { - public: - static HANDLE CreateSnapshot(uint32 flags, uint32 process_id) { - return CreateToolhelp32Snapshot(flags, process_id); - } - - static bool CloseHandle(HANDLE handle) { - return ::CloseHandle(handle) == TRUE; - } -}; - -class ToolhelpProcessTraits : public ToolhelpTraits { - public: - typedef PROCESSENTRY32 Type; - - static bool First(HANDLE handle, Type* t) { - return ::Process32First(handle, t) == TRUE; - } - - static bool Next(HANDLE handle, Type* t) { - return ::Process32Next(handle, t) == TRUE; - } -}; - -class ProcessEnumerator : public ToolhelpEnumeratorBase { - public: - ProcessEnumerator() - : ToolhelpEnumeratorBase( - ToolhelpProcessTraits::CreateSnapshot(TH32CS_SNAPPROCESS, 0)) { - } - - private: - DISALLOW_EVIL_CONSTRUCTORS(ProcessEnumerator); -}; - -class ToolhelpModuleTraits : public ToolhelpTraits { - public: - typedef MODULEENTRY32 Type; - - static bool First(HANDLE handle, Type* t) { - return ::Module32First(handle, t) == TRUE; - } - - static bool Next(HANDLE handle, Type* t) { - return ::Module32Next(handle, t) == TRUE; - } -}; - -class ModuleEnumerator : public ToolhelpEnumeratorBase { - public: - explicit ModuleEnumerator(uint32 process_id) - : ToolhelpEnumeratorBase( - ToolhelpModuleTraits::CreateSnapshot(TH32CS_SNAPMODULE, - process_id)) { - } - - private: - DISALLOW_EVIL_CONSTRUCTORS(ModuleEnumerator); -}; - -} // namespace talk_base - -#endif // TALK_BASE_WIN32TOOLHELP_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/win32window.h b/thirdparties/common/include/webrtc-sdk/talk/base/win32window.h deleted file mode 100755 index d1bcc81..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/win32window.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_WIN32WINDOW_H_ -#define TALK_BASE_WIN32WINDOW_H_ - -#ifdef WIN32 - -#include "talk/base/win32.h" - -namespace talk_base { - -/////////////////////////////////////////////////////////////////////////////// -// Win32Window -/////////////////////////////////////////////////////////////////////////////// - -class Win32Window { - public: - Win32Window(); - virtual ~Win32Window(); - - HWND handle() const { return wnd_; } - - bool Create(HWND parent, const wchar_t* title, DWORD style, DWORD exstyle, - int x, int y, int cx, int cy); - void Destroy(); - - // Call this when your DLL unloads. - static void Shutdown(); - - protected: - virtual bool OnMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, - LRESULT& result); - - virtual bool OnClose() { return true; } - virtual void OnNcDestroy() { } - - private: - static LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, - LPARAM lParam); - - HWND wnd_; - static HINSTANCE instance_; - static ATOM window_class_; -}; - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace talk_base - -#endif // WIN32 - -#endif // TALK_BASE_WIN32WINDOW_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/win32windowpicker.h b/thirdparties/common/include/webrtc-sdk/talk/base/win32windowpicker.h deleted file mode 100755 index db0f488..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/win32windowpicker.h +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved - - -#ifndef TALK_BASE_WIN32WINDOWPICKER_H_ -#define TALK_BASE_WIN32WINDOWPICKER_H_ - -#include "talk/base/win32.h" -#include "talk/base/windowpicker.h" - -namespace talk_base { - -class Win32WindowPicker : public WindowPicker { - public: - Win32WindowPicker(); - virtual bool Init(); - virtual bool IsVisible(const WindowId& id); - virtual bool MoveToFront(const WindowId& id); - virtual bool GetWindowList(WindowDescriptionList* descriptions); - virtual bool GetDesktopList(DesktopDescriptionList* descriptions); - virtual bool GetDesktopDimensions(const DesktopId& id, int* width, - int* height); - - protected: - static BOOL CALLBACK EnumProc(HWND hwnd, LPARAM l_param); - static BOOL CALLBACK MonitorEnumProc(HMONITOR h_monitor, - HDC hdc_monitor, - LPRECT lprc_monitor, - LPARAM l_param); -}; - -} // namespace talk_base - -#endif // TALK_BASE_WIN32WINDOWPICKER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/window.h b/thirdparties/common/include/webrtc-sdk/talk/base/window.h deleted file mode 100755 index af7039c..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/window.h +++ /dev/null @@ -1,141 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_WINDOW_H_ -#define TALK_BASE_WINDOW_H_ - -#include "talk/base/stringencode.h" - -// Define platform specific window types. -#if defined(LINUX) -typedef unsigned long Window; // Avoid include . -#elif defined(WIN32) -// We commonly include win32.h in talk/base so just include it here. -#include "talk/base/win32.h" // Include HWND, HMONITOR. -#elif defined(OSX) -typedef unsigned int CGWindowID; -typedef unsigned int CGDirectDisplayID; -#endif - -namespace talk_base { - -class WindowId { - public: - // Define WindowT for each platform. -#if defined(LINUX) - typedef Window WindowT; -#elif defined(WIN32) - typedef HWND WindowT; -#elif defined(OSX) - typedef CGWindowID WindowT; -#else - typedef unsigned int WindowT; -#endif - - static WindowId Cast(uint64 id) { -#if defined(WIN32) - return WindowId(reinterpret_cast(id)); -#else - return WindowId(static_cast(id)); -#endif - } - - static uint64 Format(const WindowT& id) { -#if defined(WIN32) - return static_cast(reinterpret_cast(id)); -#else - return static_cast(id); -#endif - } - - WindowId() : id_(0) {} - WindowId(const WindowT& id) : id_(id) {} // NOLINT - const WindowT& id() const { return id_; } - bool IsValid() const { return id_ != 0; } - bool Equals(const WindowId& other) const { - return id_ == other.id(); - } - - private: - WindowT id_; -}; - -class DesktopId { - public: - // Define DesktopT for each platform. -#if defined(LINUX) - typedef Window DesktopT; -#elif defined(WIN32) - typedef HMONITOR DesktopT; -#elif defined(OSX) - typedef CGDirectDisplayID DesktopT; -#else - typedef unsigned int DesktopT; -#endif - - static DesktopId Cast(int id, int index) { -#if defined(WIN32) - return DesktopId(reinterpret_cast(id), index); -#else - return DesktopId(static_cast(id), index); -#endif - } - - DesktopId() : id_(0), index_(-1) {} - DesktopId(const DesktopT& id, int index) // NOLINT - : id_(id), index_(index) { - } - const DesktopT& id() const { return id_; } - int index() const { return index_; } - bool IsValid() const { return index_ != -1; } - bool Equals(const DesktopId& other) const { - return id_ == other.id() && index_ == other.index(); - } - - private: - // Id is the platform specific desktop identifier. - DesktopT id_; - // Index is the desktop index as enumerated by each platform. - // Desktop capturer typically takes the index instead of id. - int index_; -}; - -// Window event types. -enum WindowEvent { - WE_RESIZE = 0, - WE_CLOSE = 1, - WE_MINIMIZE = 2, - WE_RESTORE = 3, -}; - -inline std::string ToString(const WindowId& window) { - return ToString(window.id()); -} - -} // namespace talk_base - -#endif // TALK_BASE_WINDOW_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/windowpicker.h b/thirdparties/common/include/webrtc-sdk/talk/base/windowpicker.h deleted file mode 100755 index 2ff4769..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/windowpicker.h +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved - -// thorcarpenter@google.com (Thor Carpenter) - -#ifndef TALK_BASE_WINDOWPICKER_H_ -#define TALK_BASE_WINDOWPICKER_H_ - -#include -#include - -#include "talk/base/window.h" - -namespace talk_base { - -class WindowDescription { - public: - WindowDescription() : id_() {} - WindowDescription(const WindowId& id, const std::string& title) - : id_(id), title_(title) { - } - const WindowId& id() const { return id_; } - void set_id(const WindowId& id) { id_ = id; } - const std::string& title() const { return title_; } - void set_title(const std::string& title) { title_ = title; } - - private: - WindowId id_; - std::string title_; -}; - -class DesktopDescription { - public: - DesktopDescription() : id_() {} - DesktopDescription(const DesktopId& id, const std::string& title) - : id_(id), title_(title), primary_(false) { - } - const DesktopId& id() const { return id_; } - void set_id(const DesktopId& id) { id_ = id; } - const std::string& title() const { return title_; } - void set_title(const std::string& title) { title_ = title; } - // Indicates whether it is the primary desktop in the system. - bool primary() const { return primary_; } - void set_primary(bool primary) { primary_ = primary; } - - private: - DesktopId id_; - std::string title_; - bool primary_; -}; - -typedef std::vector WindowDescriptionList; -typedef std::vector DesktopDescriptionList; - -class WindowPicker { - public: - virtual ~WindowPicker() {} - virtual bool Init() = 0; - - // TODO: Move this two methods to window.h when we no longer need to load - // CoreGraphics dynamically. - virtual bool IsVisible(const WindowId& id) = 0; - virtual bool MoveToFront(const WindowId& id) = 0; - - // Gets a list of window description and appends to descriptions. - // Returns true if successful. - virtual bool GetWindowList(WindowDescriptionList* descriptions) = 0; - // Gets a list of desktop descriptions and appends to descriptions. - // Returns true if successful. - virtual bool GetDesktopList(DesktopDescriptionList* descriptions) = 0; - // Gets the width and height of a desktop. - // Returns true if successful. - virtual bool GetDesktopDimensions(const DesktopId& id, int* width, - int* height) = 0; -}; - -} // namespace talk_base - -#endif // TALK_BASE_WINDOWPICKER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/windowpickerfactory.h b/thirdparties/common/include/webrtc-sdk/talk/base/windowpickerfactory.h deleted file mode 100755 index ade5a53..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/windowpickerfactory.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * libjingle - * Copyright 2010 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_BASE_WINDOWPICKERFACTORY_H_ -#define TALK_BASE_WINDOWPICKERFACTORY_H_ - -#if defined(WIN32) -#include "talk/base/win32windowpicker.h" -#elif defined(OSX) -#include "talk/base/macutils.h" -#include "talk/base/macwindowpicker.h" -#elif defined(LINUX) -#include "talk/base/linuxwindowpicker.h" -#endif - -#include "talk/base/windowpicker.h" - -namespace talk_base { - -class WindowPickerFactory { - public: - virtual ~WindowPickerFactory() {} - - // Instance method for dependency injection. - virtual WindowPicker* Create() { - return CreateWindowPicker(); - } - - static WindowPicker* CreateWindowPicker() { -#if defined(WIN32) - return new Win32WindowPicker(); -#elif defined(OSX) - return new MacWindowPicker(); -#elif defined(LINUX) && defined(HAVE_X11) - return new LinuxWindowPicker(); -#else - return NULL; -#endif - } - - static bool IsSupported() { -#ifdef OSX - return GetOSVersionName() >= kMacOSLeopard; -#else - return true; -#endif - } -}; - -} // namespace talk_base - -#endif // TALK_BASE_WINDOWPICKERFACTORY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/winfirewall.h b/thirdparties/common/include/webrtc-sdk/talk/base/winfirewall.h deleted file mode 100755 index c564c81..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/winfirewall.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_WINFIREWALL_H_ -#define TALK_BASE_WINFIREWALL_H_ - -#ifndef _HRESULT_DEFINED -#define _HRESULT_DEFINED -typedef long HRESULT; // Can't forward declare typedef, but don't need all win -#endif // !_HRESULT_DEFINED - -struct INetFwMgr; -struct INetFwPolicy; -struct INetFwProfile; - -namespace talk_base { - -////////////////////////////////////////////////////////////////////// -// WinFirewall -////////////////////////////////////////////////////////////////////// - -class WinFirewall { - public: - WinFirewall(); - ~WinFirewall(); - - bool Initialize(HRESULT* result); - void Shutdown(); - - bool Enabled() const; - bool QueryAuthorized(const char* filename, bool* authorized) const; - bool QueryAuthorizedW(const wchar_t* filename, bool* authorized) const; - - bool AddApplication(const char* filename, const char* friendly_name, - bool authorized, HRESULT* result); - bool AddApplicationW(const wchar_t* filename, const wchar_t* friendly_name, - bool authorized, HRESULT* result); - - private: - INetFwMgr* mgr_; - INetFwPolicy* policy_; - INetFwProfile* profile_; -}; - -////////////////////////////////////////////////////////////////////// - -} // namespace talk_base - -#endif // TALK_BASE_WINFIREWALL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/winping.h b/thirdparties/common/include/webrtc-sdk/talk/base/winping.h deleted file mode 100755 index 5d1d18d..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/winping.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_BASE_WINPING_H__ -#define TALK_BASE_WINPING_H__ - -#ifdef WIN32 - -#include "talk/base/win32.h" -#include "talk/base/basictypes.h" -#include "talk/base/IPAddress.h" - -namespace talk_base { - -// This class wraps a Win32 API for doing ICMP pinging. This API, unlike the -// the normal socket APIs (as implemented on Win9x), will return an error if -// an ICMP packet with the dont-fragment bit set is too large. This means this -// class can be used to detect the MTU to a given address. - -typedef struct ip_option_information { - UCHAR Ttl; // Time To Live - UCHAR Tos; // Type Of Service - UCHAR Flags; // IP header flags - UCHAR OptionsSize; // Size in bytes of options data - PUCHAR OptionsData; // Pointer to options data -} IP_OPTION_INFORMATION, * PIP_OPTION_INFORMATION; - -typedef HANDLE (WINAPI *PIcmpCreateFile)(); - -typedef BOOL (WINAPI *PIcmpCloseHandle)(HANDLE icmp_handle); - -typedef HANDLE (WINAPI *PIcmp6CreateFile)(); - -typedef BOOL (WINAPI *PIcmp6CloseHandle)(HANDLE icmp_handle); - -typedef DWORD (WINAPI *PIcmpSendEcho)( - HANDLE IcmpHandle, - ULONG DestinationAddress, - LPVOID RequestData, - WORD RequestSize, - PIP_OPTION_INFORMATION RequestOptions, - LPVOID ReplyBuffer, - DWORD ReplySize, - DWORD Timeout); - -typedef DWORD (WINAPI *PIcmp6SendEcho2)( - HANDLE IcmpHandle, - HANDLE Event, - FARPROC ApcRoutine, - PVOID ApcContext, - struct sockaddr_in6 *SourceAddress, - struct sockaddr_in6 *DestinationAddress, - LPVOID RequestData, - WORD RequestSize, - PIP_OPTION_INFORMATION RequestOptions, - LPVOID ReplyBuffer, - DWORD ReplySize, - DWORD Timeout -); - -class WinPing { -public: - WinPing(); - ~WinPing(); - - // Determines whether the class was initialized correctly. - bool IsValid() { return valid_; } - - // Attempts to send a ping with the given parameters. - enum PingResult { PING_FAIL, PING_INVALID_PARAMS, - PING_TOO_LARGE, PING_TIMEOUT, PING_SUCCESS }; - PingResult Ping( - IPAddress ip, uint32 data_size, uint32 timeout_millis, uint8 ttl, - bool allow_fragments); - -private: - HMODULE dll_; - HANDLE hping_; - HANDLE hping6_; - PIcmpCreateFile create_; - PIcmpCloseHandle close_; - PIcmpSendEcho send_; - PIcmp6CreateFile create6_; - PIcmp6SendEcho2 send6_; - char* data_; - uint32 dlen_; - char* reply_; - uint32 rlen_; - bool valid_; -}; - -} // namespace talk_base - -#endif // WIN32 - -#endif // TALK_BASE_WINPING_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/base/worker.h b/thirdparties/common/include/webrtc-sdk/talk/base/worker.h deleted file mode 100755 index b75e970..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/base/worker.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_BASE_WORKER_H_ -#define TALK_BASE_WORKER_H_ - -#include "talk/base/constructormagic.h" -#include "talk/base/messagehandler.h" - -namespace talk_base { - -class Thread; - -// A worker is an object that performs some specific long-lived task in an -// event-driven manner. -// The only method that should be considered thread-safe is HaveWork(), which -// allows you to signal the availability of work from any thread. All other -// methods are thread-hostile. Specifically: -// StartWork()/StopWork() should not be called concurrently with themselves or -// each other, and it is an error to call them while the worker is running on -// a different thread. -// The destructor may not be called if the worker is currently running -// (regardless of the thread), but you can call StopWork() in a subclass's -// destructor. -class Worker : private MessageHandler { - public: - Worker(); - - // Destroys this Worker, but it must have already been stopped via StopWork(). - virtual ~Worker(); - - // Attaches the worker to the current thread and begins processing work if not - // already doing so. - bool StartWork(); - // Stops processing work if currently doing so and detaches from the current - // thread. - bool StopWork(); - - protected: - // Signal that work is available to be done. May only be called within the - // lifetime of a OnStart()/OnStop() pair. - void HaveWork(); - - // These must be implemented by a subclass. - // Called on the worker thread to start working. - virtual void OnStart() = 0; - // Called on the worker thread when work has been signalled via HaveWork(). - virtual void OnHaveWork() = 0; - // Called on the worker thread to stop working. Upon return, any pending - // OnHaveWork() calls are cancelled. - virtual void OnStop() = 0; - - private: - // Inherited from MessageHandler. - virtual void OnMessage(Message *msg); - - // The thread that is currently doing the work. - Thread *worker_thread_; - - DISALLOW_COPY_AND_ASSIGN(Worker); -}; - -} // namespace talk_base - -#endif // TALK_BASE_WORKER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/audioframe.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/audioframe.h deleted file mode 100755 index 929bc6b..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/audioframe.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_AUDIOFRAME_H_ -#define TALK_MEDIA_BASE_AUDIOFRAME_H_ - -namespace cricket { - -class AudioFrame { - public: - AudioFrame() - : audio10ms_(NULL), - length_(0), - sampling_frequency_(8000), - stereo_(false) { - } - AudioFrame(int16* audio, size_t audio_length, int sample_freq, bool stereo) - : audio10ms_(audio), - length_(audio_length), - sampling_frequency_(sample_freq), - stereo_(stereo) { - } - - int16* GetData() { return audio10ms_; } - size_t GetSize() const { return length_; } - int GetSamplingFrequency() const { return sampling_frequency_; } - bool GetStereo() const { return stereo_; } - - private: - // TODO(janahan): currently the data is not owned by this class. - // add ownership when we come up with the first use case that requires it. - int16* audio10ms_; - size_t length_; - int sampling_frequency_; - bool stereo_; -}; - -} // namespace cricket -#endif // TALK_MEDIA_BASE_AUDIOFRAME_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/audiorenderer.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/audiorenderer.h deleted file mode 100755 index 6bd6251..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/audiorenderer.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * libjingle - * Copyright 2013 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_AUDIORENDERER_H_ -#define TALK_MEDIA_BASE_AUDIORENDERER_H_ - -namespace cricket { - -// Abstract interface for rendering the audio data. -class AudioRenderer { - public: - class Sink { - public: - // Callback to receive data from the AudioRenderer. - virtual void OnData(const void* audio_data, - int bits_per_sample, - int sample_rate, - int number_of_channels, - int number_of_frames) = 0; - - // Called when the AudioRenderer is going away. - virtual void OnClose() = 0; - - protected: - virtual ~Sink() {} - }; - - // Sets a sink to the AudioRenderer. There can be only one sink connected - // to the renderer at a time. - virtual void SetSink(Sink* sink) {} - - // Add the WebRtc VoE channel to the renderer. - // For local stream, multiple WebRtc VoE channels can be connected to the - // renderer. While for remote stream, only one WebRtc VoE channel can be - // connected to the renderer. - // TODO(xians): Remove this interface after Chrome switches to the - // AudioRenderer::Sink interface. - virtual void AddChannel(int channel_id) {} - - // Remove the WebRtc VoE channel from the renderer. - // This method is called when the VoE channel is going away. - // TODO(xians): Remove this interface after Chrome switches to the - // AudioRenderer::Sink interface. - virtual void RemoveChannel(int channel_id) {} - - protected: - virtual ~AudioRenderer() {} -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_AUDIORENDERER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/capturemanager.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/capturemanager.h deleted file mode 100755 index d3a818e..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/capturemanager.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - * 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. - */ - -// The CaptureManager class manages VideoCapturers to make it possible to share -// the same VideoCapturers across multiple instances. E.g. if two instances of -// some class want to listen to same VideoCapturer they can't individually stop -// and start capturing as doing so will affect the other instance. -// The class employs reference counting on starting and stopping of capturing of -// frames such that if anyone is still listening it will not be stopped. The -// class also provides APIs for attaching VideoRenderers to a specific capturer -// such that the VideoRenderers are fed frames directly from the capturer. In -// addition, these frames can be altered before being sent to the capturers by -// way of VideoProcessors. -// CaptureManager is Thread-unsafe. This means that none of its APIs may be -// called concurrently. Note that callbacks are called by the VideoCapturer's -// thread which is normally a separate unmarshalled thread and thus normally -// require lock protection. - -#ifndef TALK_MEDIA_BASE_CAPTUREMANAGER_H_ -#define TALK_MEDIA_BASE_CAPTUREMANAGER_H_ - -#include -#include - -#include "talk/base/sigslotrepeater.h" -#include "talk/media/base/capturerenderadapter.h" -#include "talk/media/base/videocommon.h" - -namespace cricket { - -class VideoCapturer; -class VideoProcessor; -class VideoRenderer; -class VideoCapturerState; - -class CaptureManager : public sigslot::has_slots<> { - public: - enum RestartOptions { - kRequestRestart, - kForceRestart - }; - - CaptureManager() {} - virtual ~CaptureManager(); - - virtual bool StartVideoCapture(VideoCapturer* video_capturer, - const VideoFormat& desired_format); - virtual bool StopVideoCapture(VideoCapturer* video_capturer, - const VideoFormat& format); - - // Possibly restarts the capturer. If |options| is set to kRequestRestart, - // the CaptureManager chooses whether this request can be handled with the - // current state or if a restart is actually needed. If |options| is set to - // kForceRestart, the capturer is restarted. - virtual bool RestartVideoCapture(VideoCapturer* video_capturer, - const VideoFormat& previous_format, - const VideoFormat& desired_format, - RestartOptions options); - - virtual bool AddVideoRenderer(VideoCapturer* video_capturer, - VideoRenderer* video_renderer); - virtual bool RemoveVideoRenderer(VideoCapturer* video_capturer, - VideoRenderer* video_renderer); - - virtual bool AddVideoProcessor(VideoCapturer* video_capturer, - VideoProcessor* video_processor); - virtual bool RemoveVideoProcessor(VideoCapturer* video_capturer, - VideoProcessor* video_processor); - - sigslot::repeater2 SignalCapturerStateChange; - - private: - typedef std::map CaptureStates; - - bool IsCapturerRegistered(VideoCapturer* video_capturer) const; - bool RegisterVideoCapturer(VideoCapturer* video_capturer); - void UnregisterVideoCapturer(VideoCapturerState* capture_state); - - bool StartWithBestCaptureFormat(VideoCapturerState* capture_info, - VideoCapturer* video_capturer); - - VideoCapturerState* GetCaptureState(VideoCapturer* video_capturer) const; - CaptureRenderAdapter* GetAdapter(VideoCapturer* video_capturer) const; - - CaptureStates capture_states_; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_CAPTUREMANAGER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/capturerenderadapter.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/capturerenderadapter.h deleted file mode 100755 index 2b4168a..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/capturerenderadapter.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * 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. - */ - -// This file contains the class CaptureRenderAdapter. The class connects a -// VideoCapturer to any number of VideoRenders such that the former feeds the -// latter. -// CaptureRenderAdapter is Thread-unsafe. This means that none of its APIs may -// be called concurrently. - -#ifndef TALK_MEDIA_BASE_CAPTURERENDERADAPTER_H_ -#define TALK_MEDIA_BASE_CAPTURERENDERADAPTER_H_ - -#include - -#include "talk/base/criticalsection.h" -#include "talk/base/sigslot.h" -#include "talk/media/base/videocapturer.h" - -namespace cricket { - -class VideoCapturer; -class VideoProcessor; -class VideoRenderer; - -class CaptureRenderAdapter : public sigslot::has_slots<> { - public: - static CaptureRenderAdapter* Create(VideoCapturer* video_capturer); - ~CaptureRenderAdapter(); - - bool AddRenderer(VideoRenderer* video_renderer); - bool RemoveRenderer(VideoRenderer* video_renderer); - - VideoCapturer* video_capturer() { return video_capturer_; } - private: - struct VideoRendererInfo { - explicit VideoRendererInfo(VideoRenderer* r) - : renderer(r), - render_width(0), - render_height(0) { - } - VideoRenderer* renderer; - size_t render_width; - size_t render_height; - }; - - // Just pointers since ownership is not handed over to this class. - typedef std::vector VideoRenderers; - - explicit CaptureRenderAdapter(VideoCapturer* video_capturer); - void Init(); - - // Callback for frames received from the capturer. - void OnVideoFrame(VideoCapturer* capturer, const VideoFrame* video_frame); - - void MaybeSetRenderingSize(const VideoFrame* frame); - - bool IsRendererRegistered(const VideoRenderer& video_renderer) const; - - VideoRenderers video_renderers_; - VideoCapturer* video_capturer_; - // Critical section synchronizing the capture thread. - mutable talk_base::CriticalSection capture_crit_; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_CAPTURERENDERADAPTER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/codec.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/codec.h deleted file mode 100755 index c243efe..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/codec.h +++ /dev/null @@ -1,325 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_CODEC_H_ -#define TALK_MEDIA_BASE_CODEC_H_ - -#include -#include -#include -#include - -#include "talk/media/base/constants.h" - -namespace cricket { - -typedef std::map CodecParameterMap; - -class FeedbackParam { - public: - FeedbackParam(const std::string& id, const std::string& param) - : id_(id), - param_(param) { - } - explicit FeedbackParam(const std::string& id) - : id_(id), - param_(kParamValueEmpty) { - } - bool operator==(const FeedbackParam& other) const; - - const std::string& id() const { return id_; } - const std::string& param() const { return param_; } - - private: - std::string id_; // e.g. "nack", "ccm" - std::string param_; // e.g. "", "rpsi", "fir" -}; - -class FeedbackParams { - public: - bool operator==(const FeedbackParams& other) const; - - bool Has(const FeedbackParam& param) const; - void Add(const FeedbackParam& param); - - void Intersect(const FeedbackParams& from); - - const std::vector& params() const { return params_; } - private: - bool HasDuplicateEntries() const; - - std::vector params_; -}; - -struct Codec { - int id; - std::string name; - int clockrate; - int preference; - CodecParameterMap params; - FeedbackParams feedback_params; - - // Creates a codec with the given parameters. - Codec(int id, const std::string& name, int clockrate, int preference) - : id(id), - name(name), - clockrate(clockrate), - preference(preference) { - } - - // Creates an empty codec. - Codec() : id(0), clockrate(0), preference(0) {} - - // Indicates if this codec is compatible with the specified codec. - bool Matches(const Codec& codec) const; - - // Find the parameter for |name| and write the value to |out|. - bool GetParam(const std::string& name, std::string* out) const; - bool GetParam(const std::string& name, int* out) const; - - void SetParam(const std::string& name, const std::string& value); - void SetParam(const std::string& name, int value); - - bool HasFeedbackParam(const FeedbackParam& param) const; - void AddFeedbackParam(const FeedbackParam& param); - - static bool Preferable(const Codec& first, const Codec& other) { - return first.preference > other.preference; - } - - // Filter |this| feedbacks params such that only those shared by both |this| - // and |other| are kept. - void IntersectFeedbackParams(const Codec& other); - - Codec& operator=(const Codec& c) { - this->id = c.id; // id is reserved in objective-c - name = c.name; - clockrate = c.clockrate; - preference = c.preference; - params = c.params; - feedback_params = c.feedback_params; - return *this; - } - - bool operator==(const Codec& c) const { - return this->id == c.id && // id is reserved in objective-c - name == c.name && - clockrate == c.clockrate && - preference == c.preference && - params == c.params && - feedback_params == c.feedback_params; - } - - bool operator!=(const Codec& c) const { - return !(*this == c); - } -}; - -struct AudioCodec : public Codec { - int bitrate; - int channels; - - // Creates a codec with the given parameters. - AudioCodec(int pt, const std::string& nm, int cr, int br, int cs, int pr) - : Codec(pt, nm, cr, pr), - bitrate(br), - channels(cs) { - } - - // Creates an empty codec. - AudioCodec() : Codec(), bitrate(0), channels(0) {} - - // Indicates if this codec is compatible with the specified codec. - bool Matches(const AudioCodec& codec) const; - - static bool Preferable(const AudioCodec& first, const AudioCodec& other) { - return first.preference > other.preference; - } - - std::string ToString() const; - - AudioCodec& operator=(const AudioCodec& c) { - this->id = c.id; // id is reserved in objective-c - name = c.name; - clockrate = c.clockrate; - bitrate = c.bitrate; - channels = c.channels; - preference = c.preference; - params = c.params; - feedback_params = c.feedback_params; - return *this; - } - - bool operator==(const AudioCodec& c) const { - return this->id == c.id && // id is reserved in objective-c - name == c.name && - clockrate == c.clockrate && - bitrate == c.bitrate && - channels == c.channels && - preference == c.preference && - params == c.params && - feedback_params == c.feedback_params; - } - - bool operator!=(const AudioCodec& c) const { - return !(*this == c); - } -}; - -struct VideoCodec : public Codec { - int width; - int height; - int framerate; - - // Creates a codec with the given parameters. - VideoCodec(int pt, const std::string& nm, int w, int h, int fr, int pr) - : Codec(pt, nm, kVideoCodecClockrate, pr), - width(w), - height(h), - framerate(fr) { - } - - // Creates an empty codec. - VideoCodec() - : Codec(), - width(0), - height(0), - framerate(0) { - clockrate = kVideoCodecClockrate; - } - - static bool Preferable(const VideoCodec& first, const VideoCodec& other) { - return first.preference > other.preference; - } - - std::string ToString() const; - - VideoCodec& operator=(const VideoCodec& c) { - this->id = c.id; // id is reserved in objective-c - name = c.name; - clockrate = c.clockrate; - width = c.width; - height = c.height; - framerate = c.framerate; - preference = c.preference; - params = c.params; - feedback_params = c.feedback_params; - return *this; - } - - bool operator==(const VideoCodec& c) const { - return this->id == c.id && // id is reserved in objective-c - name == c.name && - clockrate == c.clockrate && - width == c.width && - height == c.height && - framerate == c.framerate && - preference == c.preference && - params == c.params && - feedback_params == c.feedback_params; - } - - bool operator!=(const VideoCodec& c) const { - return !(*this == c); - } - - static VideoCodec CreateRtxCodec(int rtx_payload_type, - int associated_payload_type); - - enum CodecType { - CODEC_VIDEO, - CODEC_RED, - CODEC_ULPFEC, - CODEC_RTX, - }; - - CodecType GetCodecType() const; - // Validates a VideoCodec's payload type, dimensions and bitrates etc. If they - // don't make sense (such as max < min bitrate), and error is logged and - // ValidateCodecFormat returns false. - bool ValidateCodecFormat() const; -}; - -struct DataCodec : public Codec { - DataCodec(int id, const std::string& name, int preference) - : Codec(id, name, kDataCodecClockrate, preference) { - } - - DataCodec() : Codec() { - clockrate = kDataCodecClockrate; - } - - std::string ToString() const; -}; - -struct VideoEncoderConfig { - static const int kDefaultMaxThreads = -1; - static const int kDefaultCpuProfile = -1; - - VideoEncoderConfig() - : max_codec(), - num_threads(kDefaultMaxThreads), - cpu_profile(kDefaultCpuProfile) { - } - - VideoEncoderConfig(const VideoCodec& c) - : max_codec(c), - num_threads(kDefaultMaxThreads), - cpu_profile(kDefaultCpuProfile) { - } - - VideoEncoderConfig(const VideoCodec& c, int t, int p) - : max_codec(c), - num_threads(t), - cpu_profile(p) { - } - - VideoEncoderConfig& operator=(const VideoEncoderConfig& config) { - max_codec = config.max_codec; - num_threads = config.num_threads; - cpu_profile = config.cpu_profile; - return *this; - } - - bool operator==(const VideoEncoderConfig& config) const { - return max_codec == config.max_codec && - num_threads == config.num_threads && - cpu_profile == config.cpu_profile; - } - - bool operator!=(const VideoEncoderConfig& config) const { - return !(*this == config); - } - - VideoCodec max_codec; - int num_threads; - int cpu_profile; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_CODEC_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/constants.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/constants.h deleted file mode 100755 index f337c3c..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/constants.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - * 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_CONSTANTS_H_ -#define TALK_MEDIA_BASE_CONSTANTS_H_ - -#include - -// This file contains constants related to media. - -namespace cricket { - -extern const int kVideoCodecClockrate; -extern const int kDataCodecClockrate; -extern const int kDataMaxBandwidth; // bps - -// Default CPU thresholds. -extern const float kHighSystemCpuThreshold; -extern const float kLowSystemCpuThreshold; -extern const float kProcessCpuThreshold; - -extern const char kRtxCodecName[]; -extern const char kRedCodecName[]; -extern const char kUlpfecCodecName[]; - - -// Codec parameters -extern const int kWildcardPayloadType; -extern const char kCodecParamAssociatedPayloadType[]; - -extern const char kOpusCodecName[]; - -// Attribute parameters -extern const char kCodecParamPTime[]; -extern const char kCodecParamMaxPTime[]; -// fmtp parameters -extern const char kCodecParamMinPTime[]; -extern const char kCodecParamSPropStereo[]; -extern const char kCodecParamStereo[]; -extern const char kCodecParamUseInbandFec[]; -extern const char kCodecParamMaxAverageBitrate[]; -extern const char kCodecParamSctpProtocol[]; -extern const char kCodecParamSctpStreams[]; - -extern const char kParamValueTrue[]; -// Parameters are stored as parameter/value pairs. For parameters who do not -// have a value, |kParamValueEmpty| should be used as value. -extern const char kParamValueEmpty[]; - -// opus parameters. -// Default value for maxptime according to -// http://tools.ietf.org/html/draft-spittka-payload-rtp-opus-03 -extern const int kOpusDefaultMaxPTime; -extern const int kOpusDefaultPTime; -extern const int kOpusDefaultMinPTime; -extern const int kOpusDefaultSPropStereo; -extern const int kOpusDefaultStereo; -extern const int kOpusDefaultUseInbandFec; -// Prefered values in this code base. Note that they may differ from the default -// values in http://tools.ietf.org/html/draft-spittka-payload-rtp-opus-03 -// Only frames larger or equal to 10 ms are currently supported in this code -// base. -extern const int kPreferredMaxPTime; -extern const int kPreferredMinPTime; -extern const int kPreferredSPropStereo; -extern const int kPreferredStereo; -extern const int kPreferredUseInbandFec; - -// rtcp-fb messages according to RFC 4585 -extern const char kRtcpFbParamNack[]; -extern const char kRtcpFbNackParamPli[]; -// rtcp-fb messages according to -// http://tools.ietf.org/html/draft-alvestrand-rmcat-remb-00 -extern const char kRtcpFbParamRemb[]; -// ccm submessages according to RFC 5104 -extern const char kRtcpFbParamCcm[]; -extern const char kRtcpFbCcmParamFir[]; -// Google specific parameters -extern const char kCodecParamMaxBitrate[]; -extern const char kCodecParamMinBitrate[]; -extern const char kCodecParamStartBitrate[]; -extern const char kCodecParamMaxQuantization[]; -extern const char kCodecParamPort[]; - -// We put the data codec names here so callers of -// DataEngine::CreateChannel don't have to import rtpdataengine.h or -// sctpdataengine.h to get the codec names they want to pass in. -extern const int kGoogleRtpDataCodecId; -extern const char kGoogleRtpDataCodecName[]; - -// TODO(pthatcher): Find an id that won't conflict with anything. On -// the other hand, it really shouldn't matter since the id won't be -// used on the wire. -extern const int kGoogleSctpDataCodecId; -extern const char kGoogleSctpDataCodecName[]; - -extern const char kComfortNoiseCodecName[]; - -// Extension header for audio levels, as defined in -// http://tools.ietf.org/html/draft-ietf-avtext-client-to-mixer-audio-level-03 -extern const int kRtpAudioLevelHeaderExtensionDefaultId; -extern const char kRtpAudioLevelHeaderExtension[]; - -// Extension header for RTP timestamp offset, see RFC 5450 for details: -// http://tools.ietf.org/html/rfc5450 -extern const int kRtpTimestampOffsetHeaderExtensionDefaultId; -extern const char kRtpTimestampOffsetHeaderExtension[]; - -// Extension header for absolute send time, see url for details: -// http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time -extern const int kRtpAbsoluteSenderTimeHeaderExtensionDefaultId; -extern const char kRtpAbsoluteSenderTimeHeaderExtension[]; - -extern const int kNumDefaultUnsignalledVideoRecvStreams; -} // namespace cricket - -#endif // TALK_MEDIA_BASE_CONSTANTS_H_ - diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/cpuid.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/cpuid.h deleted file mode 100755 index ad072af..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/cpuid.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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_MEDIA_BASE_CPUID_H_ -#define TALK_MEDIA_BASE_CPUID_H_ - -#include "talk/base/basictypes.h" // For DISALLOW_IMPLICIT_CONSTRUCTORS - -namespace cricket { - -class CpuInfo { - public: - // The following flags must match libyuv/cpu_id.h values. - // Internal flag to indicate cpuid requires initialization. - static const int kCpuInit = 0x1; - - // These flags are only valid on ARM processors. - static const int kCpuHasARM = 0x2; - static const int kCpuHasNEON = 0x4; - // 0x8 reserved for future ARM flag. - - // These flags are only valid on x86 processors. - static const int kCpuHasX86 = 0x10; - static const int kCpuHasSSE2 = 0x20; - static const int kCpuHasSSSE3 = 0x40; - static const int kCpuHasSSE41 = 0x80; - static const int kCpuHasSSE42 = 0x100; - static const int kCpuHasAVX = 0x200; - static const int kCpuHasAVX2 = 0x400; - static const int kCpuHasERMS = 0x800; - - // These flags are only valid on MIPS processors. - static const int kCpuHasMIPS = 0x1000; - static const int kCpuHasMIPS_DSP = 0x2000; - static const int kCpuHasMIPS_DSPR2 = 0x4000; - - // Detect CPU has SSE2 etc. - static bool TestCpuFlag(int flag); - - // For testing, allow CPU flags to be disabled. - static void MaskCpuFlagsForTest(int enable_flags); - - private: - DISALLOW_IMPLICIT_CONSTRUCTORS(CpuInfo); -}; - -// Detect an Intel Core I5 or better such as 4th generation Macbook Air. -bool IsCoreIOrBetter(); - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_CPUID_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/cryptoparams.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/cryptoparams.h deleted file mode 100755 index 535891f..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/cryptoparams.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_CRYPTOPARAMS_H_ -#define TALK_MEDIA_BASE_CRYPTOPARAMS_H_ - -#include - -namespace cricket { - -// Parameters for SRTP negotiation, as described in RFC 4568. -struct CryptoParams { - CryptoParams() : tag(0) {} - CryptoParams(int t, const std::string& cs, - const std::string& kp, const std::string& sp) - : tag(t), cipher_suite(cs), key_params(kp), session_params(sp) {} - - bool Matches(const CryptoParams& params) const { - return (tag == params.tag && cipher_suite == params.cipher_suite); - } - - int tag; - std::string cipher_suite; - std::string key_params; - std::string session_params; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_CRYPTOPARAMS_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/fakecapturemanager.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/fakecapturemanager.h deleted file mode 100755 index b7aa173..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/fakecapturemanager.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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_FAKECAPTUREMANAGER_H_ -#define TALK_MEDIA_BASE_FAKECAPTUREMANAGER_H_ - -#include "talk/media/base/capturemanager.h" - -namespace cricket { - -class FakeCaptureManager : public CaptureManager { - public: - FakeCaptureManager() {} - ~FakeCaptureManager() {} - - virtual bool AddVideoRenderer(VideoCapturer* video_capturer, - VideoRenderer* video_renderer) { - return true; - } - virtual bool RemoveVideoRenderer(VideoCapturer* video_capturer, - VideoRenderer* video_renderer) { - return true; - } -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_FAKECAPTUREMANAGER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/fakemediaengine.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/fakemediaengine.h deleted file mode 100755 index 54fdae7..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/fakemediaengine.h +++ /dev/null @@ -1,1086 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_FAKEMEDIAENGINE_H_ -#define TALK_MEDIA_BASE_FAKEMEDIAENGINE_H_ - -#include -#include -#include -#include -#include - -#include "talk/base/buffer.h" -#include "talk/base/stringutils.h" -#include "talk/media/base/audiorenderer.h" -#include "talk/media/base/mediaengine.h" -#include "talk/media/base/rtputils.h" -#include "talk/media/base/streamparams.h" -#include "talk/p2p/base/sessiondescription.h" - -namespace cricket { - -class FakeMediaEngine; -class FakeVideoEngine; -class FakeVoiceEngine; - -// A common helper class that handles sending and receiving RTP/RTCP packets. -template class RtpHelper : public Base { - public: - RtpHelper() - : sending_(false), - playout_(false), - fail_set_send_codecs_(false), - fail_set_recv_codecs_(false), - send_ssrc_(0), - ready_to_send_(false) {} - const std::vector& recv_extensions() { - return recv_extensions_; - } - const std::vector& send_extensions() { - return send_extensions_; - } - bool sending() const { return sending_; } - bool playout() const { return playout_; } - const std::list& rtp_packets() const { return rtp_packets_; } - const std::list& rtcp_packets() const { return rtcp_packets_; } - - bool SendRtp(const void* data, int len) { - if (!sending_) { - return false; - } - talk_base::Buffer packet(data, len, kMaxRtpPacketLen); - return Base::SendPacket(&packet); - } - bool SendRtcp(const void* data, int len) { - talk_base::Buffer packet(data, len, kMaxRtpPacketLen); - return Base::SendRtcp(&packet); - } - - bool CheckRtp(const void* data, int len) { - bool success = !rtp_packets_.empty(); - if (success) { - std::string packet = rtp_packets_.front(); - rtp_packets_.pop_front(); - success = (packet == std::string(static_cast(data), len)); - } - return success; - } - bool CheckRtcp(const void* data, int len) { - bool success = !rtcp_packets_.empty(); - if (success) { - std::string packet = rtcp_packets_.front(); - rtcp_packets_.pop_front(); - success = (packet == std::string(static_cast(data), len)); - } - return success; - } - bool CheckNoRtp() { return rtp_packets_.empty(); } - bool CheckNoRtcp() { return rtcp_packets_.empty(); } - virtual bool SetRecvRtpHeaderExtensions( - const std::vector& extensions) { - recv_extensions_ = extensions; - return true; - } - virtual bool SetSendRtpHeaderExtensions( - const std::vector& extensions) { - send_extensions_ = extensions; - return true; - } - void set_fail_set_send_codecs(bool fail) { fail_set_send_codecs_ = fail; } - void set_fail_set_recv_codecs(bool fail) { fail_set_recv_codecs_ = fail; } - virtual bool AddSendStream(const StreamParams& sp) { - if (std::find(send_streams_.begin(), send_streams_.end(), sp) != - send_streams_.end()) { - return false; - } - send_streams_.push_back(sp); - return true; - } - virtual bool RemoveSendStream(uint32 ssrc) { - return RemoveStreamBySsrc(&send_streams_, ssrc); - } - virtual bool AddRecvStream(const StreamParams& sp) { - if (std::find(receive_streams_.begin(), receive_streams_.end(), sp) != - receive_streams_.end()) { - return false; - } - receive_streams_.push_back(sp); - return true; - } - virtual bool RemoveRecvStream(uint32 ssrc) { - return RemoveStreamBySsrc(&receive_streams_, ssrc); - } - virtual bool MuteStream(uint32 ssrc, bool on) { - if (!HasSendStream(ssrc) && ssrc != 0) - return false; - if (on) - muted_streams_.insert(ssrc); - else - muted_streams_.erase(ssrc); - return true; - } - bool IsStreamMuted(uint32 ssrc) const { - bool ret = muted_streams_.find(ssrc) != muted_streams_.end(); - // If |ssrc = 0| check if the first send stream is muted. - if (!ret && ssrc == 0 && !send_streams_.empty()) { - return muted_streams_.find(send_streams_[0].first_ssrc()) != - muted_streams_.end(); - } - return ret; - } - const std::vector& send_streams() const { - return send_streams_; - } - const std::vector& recv_streams() const { - return receive_streams_; - } - bool HasRecvStream(uint32 ssrc) const { - return GetStreamBySsrc(receive_streams_, ssrc, NULL); - } - bool HasSendStream(uint32 ssrc) const { - return GetStreamBySsrc(send_streams_, ssrc, NULL); - } - // TODO(perkj): This is to support legacy unit test that only check one - // sending stream. - const uint32 send_ssrc() { - if (send_streams_.empty()) - return 0; - return send_streams_[0].first_ssrc(); - } - - // TODO(perkj): This is to support legacy unit test that only check one - // sending stream. - const std::string rtcp_cname() { - if (send_streams_.empty()) - return ""; - return send_streams_[0].cname; - } - - bool ready_to_send() const { - return ready_to_send_; - } - - protected: - bool set_sending(bool send) { - sending_ = send; - return true; - } - void set_playout(bool playout) { playout_ = playout; } - virtual void OnPacketReceived(talk_base::Buffer* packet, - const talk_base::PacketTime& packet_time) { - rtp_packets_.push_back(std::string(packet->data(), packet->length())); - } - virtual void OnRtcpReceived(talk_base::Buffer* packet, - const talk_base::PacketTime& packet_time) { - rtcp_packets_.push_back(std::string(packet->data(), packet->length())); - } - virtual void OnReadyToSend(bool ready) { - ready_to_send_ = ready; - } - bool fail_set_send_codecs() const { return fail_set_send_codecs_; } - bool fail_set_recv_codecs() const { return fail_set_recv_codecs_; } - - private: - bool sending_; - bool playout_; - std::vector recv_extensions_; - std::vector send_extensions_; - std::list rtp_packets_; - std::list rtcp_packets_; - std::vector send_streams_; - std::vector receive_streams_; - std::set muted_streams_; - bool fail_set_send_codecs_; - bool fail_set_recv_codecs_; - uint32 send_ssrc_; - std::string rtcp_cname_; - bool ready_to_send_; -}; - -class FakeVoiceMediaChannel : public RtpHelper { - public: - struct DtmfInfo { - DtmfInfo(uint32 ssrc, int event_code, int duration, int flags) - : ssrc(ssrc), event_code(event_code), duration(duration), flags(flags) { - } - uint32 ssrc; - int event_code; - int duration; - int flags; - }; - explicit FakeVoiceMediaChannel(FakeVoiceEngine* engine) - : engine_(engine), - fail_set_send_(false), - ringback_tone_ssrc_(0), - ringback_tone_play_(false), - ringback_tone_loop_(false), - time_since_last_typing_(-1) { - output_scalings_[0] = OutputScaling(); // For default channel. - } - ~FakeVoiceMediaChannel(); - const std::vector& recv_codecs() const { return recv_codecs_; } - const std::vector& send_codecs() const { return send_codecs_; } - const std::vector& codecs() const { return send_codecs(); } - const std::vector& dtmf_info_queue() const { - return dtmf_info_queue_; - } - const AudioOptions& options() const { return options_; } - - uint32 ringback_tone_ssrc() const { return ringback_tone_ssrc_; } - bool ringback_tone_play() const { return ringback_tone_play_; } - bool ringback_tone_loop() const { return ringback_tone_loop_; } - - virtual bool SetRecvCodecs(const std::vector& codecs) { - if (fail_set_recv_codecs()) { - // Fake the failure in SetRecvCodecs. - return false; - } - recv_codecs_ = codecs; - return true; - } - virtual bool SetSendCodecs(const std::vector& codecs) { - if (fail_set_send_codecs()) { - // Fake the failure in SetSendCodecs. - return false; - } - send_codecs_ = codecs; - return true; - } - virtual bool SetPlayout(bool playout) { - set_playout(playout); - return true; - } - virtual bool SetSend(SendFlags flag) { - if (fail_set_send_) { - return false; - } - return set_sending(flag != SEND_NOTHING); - } - virtual bool SetStartSendBandwidth(int bps) { return true; } - virtual bool SetMaxSendBandwidth(int bps) { return true; } - virtual bool AddRecvStream(const StreamParams& sp) { - if (!RtpHelper::AddRecvStream(sp)) - return false; - output_scalings_[sp.first_ssrc()] = OutputScaling(); - return true; - } - virtual bool RemoveRecvStream(uint32 ssrc) { - if (!RtpHelper::RemoveRecvStream(ssrc)) - return false; - output_scalings_.erase(ssrc); - return true; - } - virtual bool SetRemoteRenderer(uint32 ssrc, AudioRenderer* renderer) { - std::map::iterator it = - remote_renderers_.find(ssrc); - if (renderer) { - if (it != remote_renderers_.end()) { - ASSERT(it->second == renderer); - } else { - remote_renderers_.insert(std::make_pair(ssrc, renderer)); - renderer->AddChannel(0); - } - } else { - if (it != remote_renderers_.end()) { - it->second->RemoveChannel(0); - remote_renderers_.erase(it); - } else { - return false; - } - } - return true; - } - virtual bool SetLocalRenderer(uint32 ssrc, AudioRenderer* renderer) { - std::map::iterator it = - local_renderers_.find(ssrc); - if (renderer) { - if (it != local_renderers_.end()) { - ASSERT(it->second->renderer() == renderer); - } else { - local_renderers_.insert(std::make_pair( - ssrc, new VoiceChannelAudioSink(renderer))); - } - } else { - if (it != local_renderers_.end()) { - delete it->second; - local_renderers_.erase(it); - } else { - return false; - } - } - return true; - } - - virtual bool GetActiveStreams(AudioInfo::StreamList* streams) { return true; } - virtual int GetOutputLevel() { return 0; } - void set_time_since_last_typing(int ms) { time_since_last_typing_ = ms; } - virtual int GetTimeSinceLastTyping() { return time_since_last_typing_; } - virtual void SetTypingDetectionParameters( - int time_window, int cost_per_typing, int reporting_threshold, - int penalty_decay, int type_event_delay) {} - - virtual bool SetRingbackTone(const char* buf, int len) { return true; } - virtual bool PlayRingbackTone(uint32 ssrc, bool play, bool loop) { - ringback_tone_ssrc_ = ssrc; - ringback_tone_play_ = play; - ringback_tone_loop_ = loop; - return true; - } - - virtual bool CanInsertDtmf() { - for (std::vector::const_iterator it = send_codecs_.begin(); - it != send_codecs_.end(); ++it) { - // Find the DTMF telephone event "codec". - if (_stricmp(it->name.c_str(), "telephone-event") == 0) { - return true; - } - } - return false; - } - virtual bool InsertDtmf(uint32 ssrc, int event_code, int duration, - int flags) { - dtmf_info_queue_.push_back(DtmfInfo(ssrc, event_code, duration, flags)); - return true; - } - - virtual bool SetOutputScaling(uint32 ssrc, double left, double right) { - if (0 == ssrc) { - std::map::iterator it; - for (it = output_scalings_.begin(); it != output_scalings_.end(); ++it) { - it->second.left = left; - it->second.right = right; - } - return true; - } else if (output_scalings_.find(ssrc) != output_scalings_.end()) { - output_scalings_[ssrc].left = left; - output_scalings_[ssrc].right = right; - return true; - } - return false; - } - virtual bool GetOutputScaling(uint32 ssrc, double* left, double* right) { - if (output_scalings_.find(ssrc) == output_scalings_.end()) - return false; - *left = output_scalings_[ssrc].left; - *right = output_scalings_[ssrc].right; - return true; - } - - virtual bool GetStats(VoiceMediaInfo* info) { return false; } - virtual void GetLastMediaError(uint32* ssrc, - VoiceMediaChannel::Error* error) { - *ssrc = 0; - *error = fail_set_send_ ? VoiceMediaChannel::ERROR_REC_DEVICE_OPEN_FAILED - : VoiceMediaChannel::ERROR_NONE; - } - - void set_fail_set_send(bool fail) { fail_set_send_ = fail; } - void TriggerError(uint32 ssrc, VoiceMediaChannel::Error error) { - VoiceMediaChannel::SignalMediaError(ssrc, error); - } - - virtual bool SetOptions(const AudioOptions& options) { - // Does a "merge" of current options and set options. - options_.SetAll(options); - return true; - } - virtual bool GetOptions(AudioOptions* options) const { - *options = options_; - return true; - } - - private: - struct OutputScaling { - OutputScaling() : left(1.0), right(1.0) {} - double left, right; - }; - - class VoiceChannelAudioSink : public AudioRenderer::Sink { - public: - explicit VoiceChannelAudioSink(AudioRenderer* renderer) - : renderer_(renderer) { - renderer_->AddChannel(0); - renderer_->SetSink(this); - } - virtual ~VoiceChannelAudioSink() { - if (renderer_) { - renderer_->RemoveChannel(0); - renderer_->SetSink(NULL); - } - } - virtual void OnData(const void* audio_data, - int bits_per_sample, - int sample_rate, - int number_of_channels, - int number_of_frames) OVERRIDE {} - virtual void OnClose() OVERRIDE { - renderer_ = NULL; - } - AudioRenderer* renderer() const { return renderer_; } - - private: - AudioRenderer* renderer_; - }; - - - FakeVoiceEngine* engine_; - std::vector recv_codecs_; - std::vector send_codecs_; - std::map output_scalings_; - std::vector dtmf_info_queue_; - bool fail_set_send_; - uint32 ringback_tone_ssrc_; - bool ringback_tone_play_; - bool ringback_tone_loop_; - int time_since_last_typing_; - AudioOptions options_; - std::map local_renderers_; - std::map remote_renderers_; -}; - -// A helper function to compare the FakeVoiceMediaChannel::DtmfInfo. -inline bool CompareDtmfInfo(const FakeVoiceMediaChannel::DtmfInfo& info, - uint32 ssrc, int event_code, int duration, - int flags) { - return (info.duration == duration && info.event_code == event_code && - info.flags == flags && info.ssrc == ssrc); -} - -class FakeVideoMediaChannel : public RtpHelper { - public: - explicit FakeVideoMediaChannel(FakeVideoEngine* engine) - : engine_(engine), - sent_intra_frame_(false), - requested_intra_frame_(false), - start_bps_(-1), - max_bps_(-1) {} - ~FakeVideoMediaChannel(); - - const std::vector& recv_codecs() const { return recv_codecs_; } - const std::vector& send_codecs() const { return send_codecs_; } - const std::vector& codecs() const { return send_codecs(); } - bool rendering() const { return playout(); } - const VideoOptions& options() const { return options_; } - const std::map& renderers() const { - return renderers_; - } - int start_bps() const { return start_bps_; } - int max_bps() const { return max_bps_; } - bool GetSendStreamFormat(uint32 ssrc, VideoFormat* format) { - if (send_formats_.find(ssrc) == send_formats_.end()) { - return false; - } - *format = send_formats_[ssrc]; - return true; - } - virtual bool SetSendStreamFormat(uint32 ssrc, const VideoFormat& format) { - if (send_formats_.find(ssrc) == send_formats_.end()) { - return false; - } - send_formats_[ssrc] = format; - return true; - } - - virtual bool AddSendStream(const StreamParams& sp) { - if (!RtpHelper::AddSendStream(sp)) { - return false; - } - SetSendStreamDefaultFormat(sp.first_ssrc()); - return true; - } - virtual bool RemoveSendStream(uint32 ssrc) { - send_formats_.erase(ssrc); - return RtpHelper::RemoveSendStream(ssrc); - } - - virtual bool SetRecvCodecs(const std::vector& codecs) { - if (fail_set_recv_codecs()) { - // Fake the failure in SetRecvCodecs. - return false; - } - recv_codecs_ = codecs; - return true; - } - virtual bool SetSendCodecs(const std::vector& codecs) { - if (fail_set_send_codecs()) { - // Fake the failure in SetSendCodecs. - return false; - } - send_codecs_ = codecs; - - for (std::vector::const_iterator it = send_streams().begin(); - it != send_streams().end(); ++it) { - SetSendStreamDefaultFormat(it->first_ssrc()); - } - return true; - } - virtual bool GetSendCodec(VideoCodec* send_codec) { - if (send_codecs_.empty()) { - return false; - } - *send_codec = send_codecs_[0]; - return true; - } - virtual bool SetRender(bool render) { - set_playout(render); - return true; - } - virtual bool SetRenderer(uint32 ssrc, VideoRenderer* r) { - if (ssrc != 0 && renderers_.find(ssrc) == renderers_.end()) { - return false; - } - if (ssrc != 0) { - renderers_[ssrc] = r; - } - return true; - } - - virtual bool SetSend(bool send) { return set_sending(send); } - virtual bool SetCapturer(uint32 ssrc, VideoCapturer* capturer) { - capturers_[ssrc] = capturer; - return true; - } - bool HasCapturer(uint32 ssrc) const { - return capturers_.find(ssrc) != capturers_.end(); - } - virtual bool SetStartSendBandwidth(int bps) { - start_bps_ = bps; - return true; - } - virtual bool SetMaxSendBandwidth(int bps) { - max_bps_ = bps; - return true; - } - virtual bool AddRecvStream(const StreamParams& sp) { - if (!RtpHelper::AddRecvStream(sp)) - return false; - renderers_[sp.first_ssrc()] = NULL; - return true; - } - virtual bool RemoveRecvStream(uint32 ssrc) { - if (!RtpHelper::RemoveRecvStream(ssrc)) - return false; - renderers_.erase(ssrc); - return true; - } - - virtual bool GetStats(const StatsOptions& options, - VideoMediaInfo* info) { return false; } - virtual bool SendIntraFrame() { - sent_intra_frame_ = true; - return true; - } - virtual bool RequestIntraFrame() { - requested_intra_frame_ = true; - return true; - } - virtual bool SetOptions(const VideoOptions& options) { - options_ = options; - return true; - } - virtual bool GetOptions(VideoOptions* options) const { - *options = options_; - return true; - } - virtual void UpdateAspectRatio(int ratio_w, int ratio_h) {} - void set_sent_intra_frame(bool v) { sent_intra_frame_ = v; } - bool sent_intra_frame() const { return sent_intra_frame_; } - void set_requested_intra_frame(bool v) { requested_intra_frame_ = v; } - bool requested_intra_frame() const { return requested_intra_frame_; } - - private: - // Be default, each send stream uses the first send codec format. - void SetSendStreamDefaultFormat(uint32 ssrc) { - if (!send_codecs_.empty()) { - send_formats_[ssrc] = VideoFormat( - send_codecs_[0].width, send_codecs_[0].height, - cricket::VideoFormat::FpsToInterval(send_codecs_[0].framerate), - cricket::FOURCC_I420); - } - } - - FakeVideoEngine* engine_; - std::vector recv_codecs_; - std::vector send_codecs_; - std::map renderers_; - std::map send_formats_; - std::map capturers_; - bool sent_intra_frame_; - bool requested_intra_frame_; - VideoOptions options_; - int start_bps_; - int max_bps_; -}; - -class FakeSoundclipMedia : public SoundclipMedia { - public: - virtual bool PlaySound(const char* buf, int len, int flags) { return true; } -}; - -class FakeDataMediaChannel : public RtpHelper { - public: - explicit FakeDataMediaChannel(void* unused) - : send_blocked_(false), max_bps_(-1) {} - ~FakeDataMediaChannel() {} - const std::vector& recv_codecs() const { return recv_codecs_; } - const std::vector& send_codecs() const { return send_codecs_; } - const std::vector& codecs() const { return send_codecs(); } - int max_bps() const { return max_bps_; } - - virtual bool SetRecvCodecs(const std::vector& codecs) { - if (fail_set_recv_codecs()) { - // Fake the failure in SetRecvCodecs. - return false; - } - recv_codecs_ = codecs; - return true; - } - virtual bool SetSendCodecs(const std::vector& codecs) { - if (fail_set_send_codecs()) { - // Fake the failure in SetSendCodecs. - return false; - } - send_codecs_ = codecs; - return true; - } - virtual bool SetSend(bool send) { return set_sending(send); } - virtual bool SetReceive(bool receive) { - set_playout(receive); - return true; - } - virtual bool SetStartSendBandwidth(int bps) { return true; } - virtual bool SetMaxSendBandwidth(int bps) { - max_bps_ = bps; - return true; - } - virtual bool AddRecvStream(const StreamParams& sp) { - if (!RtpHelper::AddRecvStream(sp)) - return false; - return true; - } - virtual bool RemoveRecvStream(uint32 ssrc) { - if (!RtpHelper::RemoveRecvStream(ssrc)) - return false; - return true; - } - - virtual bool SendData(const SendDataParams& params, - const talk_base::Buffer& payload, - SendDataResult* result) { - if (send_blocked_) { - *result = SDR_BLOCK; - return false; - } else { - last_sent_data_params_ = params; - last_sent_data_ = std::string(payload.data(), payload.length()); - return true; - } - } - - SendDataParams last_sent_data_params() { return last_sent_data_params_; } - std::string last_sent_data() { return last_sent_data_; } - bool is_send_blocked() { return send_blocked_; } - void set_send_blocked(bool blocked) { send_blocked_ = blocked; } - - private: - std::vector recv_codecs_; - std::vector send_codecs_; - SendDataParams last_sent_data_params_; - std::string last_sent_data_; - bool send_blocked_; - int max_bps_; -}; - -// A base class for all of the shared parts between FakeVoiceEngine -// and FakeVideoEngine. -class FakeBaseEngine { - public: - FakeBaseEngine() - : loglevel_(-1), - options_changed_(false), - fail_create_channel_(false) {} - bool Init(talk_base::Thread* worker_thread) { return true; } - void Terminate() {} - - void SetLogging(int level, const char* filter) { - loglevel_ = level; - logfilter_ = filter; - } - - void set_fail_create_channel(bool fail) { fail_create_channel_ = fail; } - - const std::vector& rtp_header_extensions() const { - return rtp_header_extensions_; - } - void set_rtp_header_extensions( - const std::vector& extensions) { - rtp_header_extensions_ = extensions; - } - - protected: - int loglevel_; - std::string logfilter_; - // Flag used by optionsmessagehandler_unittest for checking whether any - // relevant setting has been updated. - // TODO(thaloun): Replace with explicit checks of before & after values. - bool options_changed_; - bool fail_create_channel_; - std::vector rtp_header_extensions_; -}; - -class FakeVoiceEngine : public FakeBaseEngine { - public: - FakeVoiceEngine() - : output_volume_(-1), - delay_offset_(0), - rx_processor_(NULL), - tx_processor_(NULL) { - // Add a fake audio codec. Note that the name must not be "" as there are - // sanity checks against that. - codecs_.push_back(AudioCodec(101, "fake_audio_codec", 0, 0, 1, 0)); - } - int GetCapabilities() { return AUDIO_SEND | AUDIO_RECV; } - AudioOptions GetAudioOptions() const { - return options_; - } - AudioOptions GetOptions() const { - return options_; - } - bool SetOptions(const AudioOptions& options) { - options_ = options; - options_changed_ = true; - return true; - } - - VoiceMediaChannel* CreateChannel() { - if (fail_create_channel_) { - return NULL; - } - - FakeVoiceMediaChannel* ch = new FakeVoiceMediaChannel(this); - channels_.push_back(ch); - return ch; - } - FakeVoiceMediaChannel* GetChannel(size_t index) { - return (channels_.size() > index) ? channels_[index] : NULL; - } - void UnregisterChannel(VoiceMediaChannel* channel) { - channels_.erase(std::find(channels_.begin(), channels_.end(), channel)); - } - SoundclipMedia* CreateSoundclip() { return new FakeSoundclipMedia(); } - - const std::vector& codecs() { return codecs_; } - void SetCodecs(const std::vector codecs) { codecs_ = codecs; } - - bool SetDelayOffset(int offset) { - delay_offset_ = offset; - return true; - } - - bool SetDevices(const Device* in_device, const Device* out_device) { - in_device_ = (in_device) ? in_device->name : ""; - out_device_ = (out_device) ? out_device->name : ""; - options_changed_ = true; - return true; - } - - bool GetOutputVolume(int* level) { - *level = output_volume_; - return true; - } - - bool SetOutputVolume(int level) { - output_volume_ = level; - options_changed_ = true; - return true; - } - - int GetInputLevel() { return 0; } - - bool SetLocalMonitor(bool enable) { return true; } - - bool StartAecDump(talk_base::PlatformFile file) { return false; } - - bool RegisterProcessor(uint32 ssrc, VoiceProcessor* voice_processor, - MediaProcessorDirection direction) { - if (direction == MPD_RX) { - rx_processor_ = voice_processor; - return true; - } else if (direction == MPD_TX) { - tx_processor_ = voice_processor; - return true; - } - return false; - } - - bool UnregisterProcessor(uint32 ssrc, VoiceProcessor* voice_processor, - MediaProcessorDirection direction) { - bool unregistered = false; - if (direction & MPD_RX) { - rx_processor_ = NULL; - unregistered = true; - } - if (direction & MPD_TX) { - tx_processor_ = NULL; - unregistered = true; - } - return unregistered; - } - - private: - std::vector channels_; - std::vector codecs_; - int output_volume_; - int delay_offset_; - std::string in_device_; - std::string out_device_; - VoiceProcessor* rx_processor_; - VoiceProcessor* tx_processor_; - AudioOptions options_; - - friend class FakeMediaEngine; -}; - -class FakeVideoEngine : public FakeBaseEngine { - public: - FakeVideoEngine() : renderer_(NULL), capture_(false), processor_(NULL) { - // Add a fake video codec. Note that the name must not be "" as there are - // sanity checks against that. - codecs_.push_back(VideoCodec(0, "fake_video_codec", 0, 0, 0, 0)); - } - bool GetOptions(VideoOptions* options) const { - *options = options_; - return true; - } - bool SetOptions(const VideoOptions& options) { - options_ = options; - options_changed_ = true; - return true; - } - int GetCapabilities() { return VIDEO_SEND | VIDEO_RECV; } - bool SetDefaultEncoderConfig(const VideoEncoderConfig& config) { - default_encoder_config_ = config; - return true; - } - VideoEncoderConfig GetDefaultEncoderConfig() const { - return default_encoder_config_; - } - const VideoEncoderConfig& default_encoder_config() const { - return default_encoder_config_; - } - - VideoMediaChannel* CreateChannel(VoiceMediaChannel* channel) { - if (fail_create_channel_) { - return NULL; - } - - FakeVideoMediaChannel* ch = new FakeVideoMediaChannel(this); - channels_.push_back(ch); - return ch; - } - FakeVideoMediaChannel* GetChannel(size_t index) { - return (channels_.size() > index) ? channels_[index] : NULL; - } - void UnregisterChannel(VideoMediaChannel* channel) { - channels_.erase(std::find(channels_.begin(), channels_.end(), channel)); - } - - const std::vector& codecs() const { return codecs_; } - bool FindCodec(const VideoCodec& in) { - for (size_t i = 0; i < codecs_.size(); ++i) { - if (codecs_[i].Matches(in)) { - return true; - } - } - return false; - } - void SetCodecs(const std::vector codecs) { codecs_ = codecs; } - - bool SetCaptureDevice(const Device* device) { - in_device_ = (device) ? device->name : ""; - options_changed_ = true; - return true; - } - bool SetLocalRenderer(VideoRenderer* r) { - renderer_ = r; - return true; - } - bool SetCapture(bool capture) { - capture_ = capture; - return true; - } - VideoFormat GetStartCaptureFormat() const { - return VideoFormat(640, 480, cricket::VideoFormat::FpsToInterval(30), - FOURCC_I420); - } - - sigslot::repeater2 SignalCaptureStateChange; - - private: - std::vector channels_; - std::vector codecs_; - VideoEncoderConfig default_encoder_config_; - std::string in_device_; - VideoRenderer* renderer_; - bool capture_; - VideoProcessor* processor_; - VideoOptions options_; - - friend class FakeMediaEngine; -}; - -class FakeMediaEngine : - public CompositeMediaEngine { - public: - FakeMediaEngine() { - voice_ = FakeVoiceEngine(); - video_ = FakeVideoEngine(); - } - virtual ~FakeMediaEngine() {} - - void SetAudioCodecs(const std::vector& codecs) { - voice_.SetCodecs(codecs); - } - void SetVideoCodecs(const std::vector& codecs) { - video_.SetCodecs(codecs); - } - - void SetAudioRtpHeaderExtensions( - const std::vector& extensions) { - voice_.set_rtp_header_extensions(extensions); - } - void SetVideoRtpHeaderExtensions( - const std::vector& extensions) { - video_.set_rtp_header_extensions(extensions); - } - - FakeVoiceMediaChannel* GetVoiceChannel(size_t index) { - return voice_.GetChannel(index); - } - FakeVideoMediaChannel* GetVideoChannel(size_t index) { - return video_.GetChannel(index); - } - - AudioOptions audio_options() const { return voice_.options_; } - int audio_delay_offset() const { return voice_.delay_offset_; } - int output_volume() const { return voice_.output_volume_; } - const VideoEncoderConfig& default_video_encoder_config() const { - return video_.default_encoder_config_; - } - const std::string& audio_in_device() const { return voice_.in_device_; } - const std::string& audio_out_device() const { return voice_.out_device_; } - VideoRenderer* local_renderer() { return video_.renderer_; } - int voice_loglevel() const { return voice_.loglevel_; } - const std::string& voice_logfilter() const { return voice_.logfilter_; } - int video_loglevel() const { return video_.loglevel_; } - const std::string& video_logfilter() const { return video_.logfilter_; } - bool capture() const { return video_.capture_; } - bool options_changed() const { - return voice_.options_changed_ || video_.options_changed_; - } - void clear_options_changed() { - video_.options_changed_ = false; - voice_.options_changed_ = false; - } - void set_fail_create_channel(bool fail) { - voice_.set_fail_create_channel(fail); - video_.set_fail_create_channel(fail); - } - bool voice_processor_registered(MediaProcessorDirection direction) const { - if (direction == MPD_RX) { - return voice_.rx_processor_ != NULL; - } else if (direction == MPD_TX) { - return voice_.tx_processor_ != NULL; - } - return false; - } -}; - -// CompositeMediaEngine with FakeVoiceEngine to expose SetAudioCodecs to -// establish a media connectionwith minimum set of audio codes required -template -class CompositeMediaEngineWithFakeVoiceEngine : - public CompositeMediaEngine { - public: - CompositeMediaEngineWithFakeVoiceEngine() {} - virtual ~CompositeMediaEngineWithFakeVoiceEngine() {} - - virtual void SetAudioCodecs(const std::vector& codecs) { - CompositeMediaEngine::voice_.SetCodecs(codecs); - } -}; - -// Have to come afterwards due to declaration order -inline FakeVoiceMediaChannel::~FakeVoiceMediaChannel() { - if (engine_) { - engine_->UnregisterChannel(this); - } -} - -inline FakeVideoMediaChannel::~FakeVideoMediaChannel() { - if (engine_) { - engine_->UnregisterChannel(this); - } -} - -class FakeDataEngine : public DataEngineInterface { - public: - FakeDataEngine() : last_channel_type_(DCT_NONE) {} - - virtual DataMediaChannel* CreateChannel(DataChannelType data_channel_type) { - last_channel_type_ = data_channel_type; - FakeDataMediaChannel* ch = new FakeDataMediaChannel(this); - channels_.push_back(ch); - return ch; - } - - FakeDataMediaChannel* GetChannel(size_t index) { - return (channels_.size() > index) ? channels_[index] : NULL; - } - - void UnregisterChannel(DataMediaChannel* channel) { - channels_.erase(std::find(channels_.begin(), channels_.end(), channel)); - } - - virtual void SetDataCodecs(const std::vector& data_codecs) { - data_codecs_ = data_codecs; - } - - virtual const std::vector& data_codecs() { return data_codecs_; } - - DataChannelType last_channel_type() const { return last_channel_type_; } - - private: - std::vector channels_; - std::vector data_codecs_; - DataChannelType last_channel_type_; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_FAKEMEDIAENGINE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/fakemediaprocessor.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/fakemediaprocessor.h deleted file mode 100755 index f600e80..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/fakemediaprocessor.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_FAKEMEDIAPROCESSOR_H_ -#define TALK_MEDIA_BASE_FAKEMEDIAPROCESSOR_H_ - -#include "talk/media/base/videoprocessor.h" -#include "talk/media/base/voiceprocessor.h" - -namespace cricket { - -class AudioFrame; - -class FakeMediaProcessor : public VoiceProcessor, public VideoProcessor { - public: - FakeMediaProcessor() - : voice_frame_count_(0), - video_frame_count_(0), - drop_frames_(false), - dropped_frame_count_(0) { - } - virtual ~FakeMediaProcessor() {} - - virtual void OnFrame(uint32 ssrc, - MediaProcessorDirection direction, - AudioFrame* frame) { - ++voice_frame_count_; - } - virtual void OnFrame(uint32 ssrc, VideoFrame* frame_ptr, bool* drop_frame) { - ++video_frame_count_; - if (drop_frames_) { - *drop_frame = true; - ++dropped_frame_count_; - } - } - virtual void OnVoiceMute(uint32 ssrc, bool muted) {} - virtual void OnVideoMute(uint32 ssrc, bool muted) {} - - int voice_frame_count() const { return voice_frame_count_; } - int video_frame_count() const { return video_frame_count_; } - - void set_drop_frames(bool b) { drop_frames_ = b; } - int dropped_frame_count() const { return dropped_frame_count_; } - - private: - // TODO(janahan): make is a map so that we can multiple ssrcs - int voice_frame_count_; - int video_frame_count_; - bool drop_frames_; - int dropped_frame_count_; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_FAKEMEDIAPROCESSOR_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/fakenetworkinterface.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/fakenetworkinterface.h deleted file mode 100755 index d284a1d..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/fakenetworkinterface.h +++ /dev/null @@ -1,259 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_FAKENETWORKINTERFACE_H_ -#define TALK_MEDIA_BASE_FAKENETWORKINTERFACE_H_ - -#include -#include - -#include "talk/base/buffer.h" -#include "talk/base/byteorder.h" -#include "talk/base/criticalsection.h" -#include "talk/base/dscp.h" -#include "talk/base/messagehandler.h" -#include "talk/base/messagequeue.h" -#include "talk/base/thread.h" -#include "talk/media/base/mediachannel.h" -#include "talk/media/base/rtputils.h" - -namespace cricket { - -// Fake NetworkInterface that sends/receives RTP/RTCP packets. -class FakeNetworkInterface : public MediaChannel::NetworkInterface, - public talk_base::MessageHandler { - public: - FakeNetworkInterface() - : thread_(talk_base::Thread::Current()), - dest_(NULL), - conf_(false), - sendbuf_size_(-1), - recvbuf_size_(-1), - dscp_(talk_base::DSCP_NO_CHANGE) { - } - - void SetDestination(MediaChannel* dest) { dest_ = dest; } - - // Conference mode is a mode where instead of simply forwarding the packets, - // the transport will send multiple copies of the packet with the specified - // SSRCs. This allows us to simulate receiving media from multiple sources. - void SetConferenceMode(bool conf, const std::vector& ssrcs) { - talk_base::CritScope cs(&crit_); - conf_ = conf; - conf_sent_ssrcs_ = ssrcs; - } - - int NumRtpBytes() { - talk_base::CritScope cs(&crit_); - int bytes = 0; - for (size_t i = 0; i < rtp_packets_.size(); ++i) { - bytes += static_cast(rtp_packets_[i].length()); - } - return bytes; - } - - int NumRtpBytes(uint32 ssrc) { - talk_base::CritScope cs(&crit_); - int bytes = 0; - GetNumRtpBytesAndPackets(ssrc, &bytes, NULL); - return bytes; - } - - int NumRtpPackets() { - talk_base::CritScope cs(&crit_); - return static_cast(rtp_packets_.size()); - } - - int NumRtpPackets(uint32 ssrc) { - talk_base::CritScope cs(&crit_); - int packets = 0; - GetNumRtpBytesAndPackets(ssrc, NULL, &packets); - return packets; - } - - int NumSentSsrcs() { - talk_base::CritScope cs(&crit_); - return static_cast(sent_ssrcs_.size()); - } - - // Note: callers are responsible for deleting the returned buffer. - const talk_base::Buffer* GetRtpPacket(int index) { - talk_base::CritScope cs(&crit_); - if (index >= NumRtpPackets()) { - return NULL; - } - return new talk_base::Buffer(rtp_packets_[index]); - } - - int NumRtcpPackets() { - talk_base::CritScope cs(&crit_); - return static_cast(rtcp_packets_.size()); - } - - // Note: callers are responsible for deleting the returned buffer. - const talk_base::Buffer* GetRtcpPacket(int index) { - talk_base::CritScope cs(&crit_); - if (index >= NumRtcpPackets()) { - return NULL; - } - return new talk_base::Buffer(rtcp_packets_[index]); - } - - // Indicate that |n|'th packet for |ssrc| should be dropped. - void AddPacketDrop(uint32 ssrc, uint32 n) { - drop_map_[ssrc].insert(n); - } - - int sendbuf_size() const { return sendbuf_size_; } - int recvbuf_size() const { return recvbuf_size_; } - talk_base::DiffServCodePoint dscp() const { return dscp_; } - - protected: - virtual bool SendPacket(talk_base::Buffer* packet, - talk_base::DiffServCodePoint dscp) { - talk_base::CritScope cs(&crit_); - - uint32 cur_ssrc = 0; - if (!GetRtpSsrc(packet->data(), packet->length(), &cur_ssrc)) { - return false; - } - sent_ssrcs_[cur_ssrc]++; - - // Check if we need to drop this packet. - std::map >::iterator itr = - drop_map_.find(cur_ssrc); - if (itr != drop_map_.end() && - itr->second.count(sent_ssrcs_[cur_ssrc]) > 0) { - // "Drop" the packet. - return true; - } - - rtp_packets_.push_back(*packet); - if (conf_) { - talk_base::Buffer buffer_copy(*packet); - for (size_t i = 0; i < conf_sent_ssrcs_.size(); ++i) { - if (!SetRtpSsrc(buffer_copy.data(), buffer_copy.length(), - conf_sent_ssrcs_[i])) { - return false; - } - PostMessage(ST_RTP, buffer_copy); - } - } else { - PostMessage(ST_RTP, *packet); - } - return true; - } - - virtual bool SendRtcp(talk_base::Buffer* packet, - talk_base::DiffServCodePoint dscp) { - talk_base::CritScope cs(&crit_); - rtcp_packets_.push_back(*packet); - if (!conf_) { - // don't worry about RTCP in conf mode for now - PostMessage(ST_RTCP, *packet); - } - return true; - } - - virtual int SetOption(SocketType type, talk_base::Socket::Option opt, - int option) { - if (opt == talk_base::Socket::OPT_SNDBUF) { - sendbuf_size_ = option; - } else if (opt == talk_base::Socket::OPT_RCVBUF) { - recvbuf_size_ = option; - } else if (opt == talk_base::Socket::OPT_DSCP) { - dscp_ = static_cast(option); - } - return 0; - } - - void PostMessage(int id, const talk_base::Buffer& packet) { - thread_->Post(this, id, talk_base::WrapMessageData(packet)); - } - - virtual void OnMessage(talk_base::Message* msg) { - talk_base::TypedMessageData* msg_data = - static_cast*>( - msg->pdata); - if (dest_) { - if (msg->message_id == ST_RTP) { - dest_->OnPacketReceived(&msg_data->data(), - talk_base::CreatePacketTime(0)); - } else { - dest_->OnRtcpReceived(&msg_data->data(), - talk_base::CreatePacketTime(0)); - } - } - delete msg_data; - } - - private: - void GetNumRtpBytesAndPackets(uint32 ssrc, int* bytes, int* packets) { - if (bytes) { - *bytes = 0; - } - if (packets) { - *packets = 0; - } - uint32 cur_ssrc = 0; - for (size_t i = 0; i < rtp_packets_.size(); ++i) { - if (!GetRtpSsrc(rtp_packets_[i].data(), - rtp_packets_[i].length(), &cur_ssrc)) { - return; - } - if (ssrc == cur_ssrc) { - if (bytes) { - *bytes += static_cast(rtp_packets_[i].length()); - } - if (packets) { - ++(*packets); - } - } - } - } - - talk_base::Thread* thread_; - MediaChannel* dest_; - bool conf_; - // The ssrcs used in sending out packets in conference mode. - std::vector conf_sent_ssrcs_; - // Map to track counts of packets that have been sent per ssrc. - // This includes packets that are dropped. - std::map sent_ssrcs_; - // Map to track packet-number that needs to be dropped per ssrc. - std::map > drop_map_; - talk_base::CriticalSection crit_; - std::vector rtp_packets_; - std::vector rtcp_packets_; - int sendbuf_size_; - int recvbuf_size_; - talk_base::DiffServCodePoint dscp_; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_FAKENETWORKINTERFACE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/fakertp.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/fakertp.h deleted file mode 100755 index ae3ffbd..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/fakertp.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * libjingle - * Copyright 2004 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. - */ - -// Fake RTP and RTCP packets to use in unit tests. - -#ifndef TALK_MEDIA_BASE_FAKERTP_H_ -#define TALK_MEDIA_BASE_FAKERTP_H_ - -// A typical PCMU RTP packet. -// PT=0, SN=1, TS=0, SSRC=1 -// all data FF -static const unsigned char kPcmuFrame[] = { - 0x80, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, -}; - -// A typical Receiver Report RTCP packet. -// PT=RR, LN=1, SSRC=1 -// send SSRC=2, all other fields 0 -static const unsigned char kRtcpReport[] = { - 0x80, 0xc9, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -// PT = 97, TS = 0, Seq = 1, SSRC = 2 -// H264 - NRI = 1, Type = 1, bit stream = FF - -static const unsigned char kH264Packet[] = { - 0x80, 0x61, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, - 0x21, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, -}; - -// PT= 101, SN=2, TS=3, SSRC = 4 -static const unsigned char kDataPacket[] = { - 0x80, 0x65, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, - 0x00, 0x00, 0x00, 0x00, - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, -}; - -#endif // TALK_MEDIA_BASE_FAKERTP_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/fakevideocapturer.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/fakevideocapturer.h deleted file mode 100755 index e035a7e..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/fakevideocapturer.h +++ /dev/null @@ -1,154 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_FAKEVIDEOCAPTURER_H_ -#define TALK_MEDIA_BASE_FAKEVIDEOCAPTURER_H_ - -#include - -#include - -#include "talk/base/timeutils.h" -#include "talk/media/base/videocapturer.h" -#include "talk/media/base/videocommon.h" -#include "talk/media/base/videoframe.h" - -namespace cricket { - -// Fake video capturer that allows the test to manually pump in frames. -class FakeVideoCapturer : public cricket::VideoCapturer { - public: - FakeVideoCapturer() - : running_(false), - initial_unix_timestamp_(time(NULL) * talk_base::kNumNanosecsPerSec), - next_timestamp_(talk_base::kNumNanosecsPerMillisec), - is_screencast_(false) { - // Default supported formats. Use ResetSupportedFormats to over write. - std::vector formats; - formats.push_back(cricket::VideoFormat(1280, 720, - cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420)); - formats.push_back(cricket::VideoFormat(640, 480, - cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420)); - formats.push_back(cricket::VideoFormat(320, 240, - cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420)); - formats.push_back(cricket::VideoFormat(160, 120, - cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420)); - ResetSupportedFormats(formats); - } - ~FakeVideoCapturer() { - SignalDestroyed(this); - } - - void ResetSupportedFormats(const std::vector& formats) { - SetSupportedFormats(formats); - } - bool CaptureFrame() { - if (!GetCaptureFormat()) { - return false; - } - return CaptureCustomFrame(GetCaptureFormat()->width, - GetCaptureFormat()->height, - GetCaptureFormat()->fourcc); - } - bool CaptureCustomFrame(int width, int height, uint32 fourcc) { - if (!running_) { - return false; - } - // Currently, |fourcc| is always I420 or ARGB. - // TODO(fbarchard): Extend SizeOf to take fourcc. - uint32 size = 0u; - if (fourcc == cricket::FOURCC_ARGB) { - size = width * 4 * height; - } else if (fourcc == cricket::FOURCC_I420) { - size = static_cast(cricket::VideoFrame::SizeOf(width, height)); - } else { - return false; // Unsupported FOURCC. - } - if (size == 0u) { - return false; // Width and/or Height were zero. - } - - cricket::CapturedFrame frame; - frame.width = width; - frame.height = height; - frame.fourcc = fourcc; - frame.data_size = size; - frame.elapsed_time = next_timestamp_; - frame.time_stamp = initial_unix_timestamp_ + next_timestamp_; - next_timestamp_ += 33333333; // 30 fps - - talk_base::scoped_ptr data(new char[size]); - frame.data = data.get(); - // Copy something non-zero into the buffer so Validate wont complain that - // the frame is all duplicate. - memset(frame.data, 1, size / 2); - memset(reinterpret_cast(frame.data) + (size / 2), 2, - size - (size / 2)); - memcpy(frame.data, reinterpret_cast(&fourcc), 4); - // TODO(zhurunz): SignalFrameCaptured carry returned value to be able to - // capture results from downstream. - SignalFrameCaptured(this, &frame); - return true; - } - - sigslot::signal1 SignalDestroyed; - - virtual cricket::CaptureState Start(const cricket::VideoFormat& format) { - cricket::VideoFormat supported; - if (GetBestCaptureFormat(format, &supported)) { - SetCaptureFormat(&supported); - } - running_ = true; - SetCaptureState(cricket::CS_RUNNING); - return cricket::CS_RUNNING; - } - virtual void Stop() { - running_ = false; - SetCaptureFormat(NULL); - SetCaptureState(cricket::CS_STOPPED); - } - virtual bool IsRunning() { return running_; } - void SetScreencast(bool is_screencast) { - is_screencast_ = is_screencast; - } - virtual bool IsScreencast() const { return is_screencast_; } - bool GetPreferredFourccs(std::vector* fourccs) { - fourccs->push_back(cricket::FOURCC_I420); - fourccs->push_back(cricket::FOURCC_MJPG); - return true; - } - - private: - bool running_; - int64 initial_unix_timestamp_; - int64 next_timestamp_; - bool is_screencast_; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_FAKEVIDEOCAPTURER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/fakevideorenderer.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/fakevideorenderer.h deleted file mode 100755 index 619de46..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/fakevideorenderer.h +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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_MEDIA_BASE_FAKEVIDEORENDERER_H_ -#define TALK_MEDIA_BASE_FAKEVIDEORENDERER_H_ - -#include "talk/base/logging.h" -#include "talk/base/sigslot.h" -#include "talk/media/base/videoframe.h" -#include "talk/media/base/videorenderer.h" - -namespace cricket { - -// Faked video renderer that has a callback for actions on rendering. -class FakeVideoRenderer : public VideoRenderer { - public: - FakeVideoRenderer() - : errors_(0), - width_(0), - height_(0), - num_set_sizes_(0), - num_rendered_frames_(0), - black_frame_(false) { - } - - virtual bool SetSize(int width, int height, int reserved) { - talk_base::CritScope cs(&crit_); - width_ = width; - height_ = height; - ++num_set_sizes_; - SignalSetSize(width, height, reserved); - return true; - } - - virtual bool RenderFrame(const VideoFrame* frame) { - talk_base::CritScope cs(&crit_); - // TODO(zhurunz) Check with VP8 team to see if we can remove this - // tolerance on Y values. - black_frame_ = CheckFrameColorYuv(6, 48, 128, 128, 128, 128, frame); - // Treat unexpected frame size as error. - if (!frame || - frame->GetWidth() != static_cast(width_) || - frame->GetHeight() != static_cast(height_)) { - if (!frame) { - LOG(LS_WARNING) << "RenderFrame expected non-null frame."; - } else { - LOG(LS_WARNING) << "RenderFrame expected frame of size " << width_ - << "x" << height_ << " but received frame of size " - << frame->GetWidth() << "x" << frame->GetHeight(); - } - ++errors_; - return false; - } - ++num_rendered_frames_; - SignalRenderFrame(frame); - return true; - } - - int errors() const { return errors_; } - int width() const { - talk_base::CritScope cs(&crit_); - return width_; - } - int height() const { - talk_base::CritScope cs(&crit_); - return height_; - } - int num_set_sizes() const { - talk_base::CritScope cs(&crit_); - return num_set_sizes_; - } - int num_rendered_frames() const { - talk_base::CritScope cs(&crit_); - return num_rendered_frames_; - } - bool black_frame() const { - talk_base::CritScope cs(&crit_); - return black_frame_; - } - - sigslot::signal3 SignalSetSize; - sigslot::signal1 SignalRenderFrame; - - private: - static bool CheckFrameColorYuv(uint8 y_min, uint8 y_max, - uint8 u_min, uint8 u_max, - uint8 v_min, uint8 v_max, - const cricket::VideoFrame* frame) { - if (!frame) { - return false; - } - // Y - size_t y_width = frame->GetWidth(); - size_t y_height = frame->GetHeight(); - const uint8* y_plane = frame->GetYPlane(); - const uint8* y_pos = y_plane; - int32 y_pitch = frame->GetYPitch(); - for (size_t i = 0; i < y_height; ++i) { - for (size_t j = 0; j < y_width; ++j) { - uint8 y_value = *(y_pos + j); - if (y_value < y_min || y_value > y_max) { - return false; - } - } - y_pos += y_pitch; - } - // U and V - size_t chroma_width = frame->GetChromaWidth(); - size_t chroma_height = frame->GetChromaHeight(); - const uint8* u_plane = frame->GetUPlane(); - const uint8* v_plane = frame->GetVPlane(); - const uint8* u_pos = u_plane; - const uint8* v_pos = v_plane; - int32 u_pitch = frame->GetUPitch(); - int32 v_pitch = frame->GetVPitch(); - for (size_t i = 0; i < chroma_height; ++i) { - for (size_t j = 0; j < chroma_width; ++j) { - uint8 u_value = *(u_pos + j); - if (u_value < u_min || u_value > u_max) { - return false; - } - uint8 v_value = *(v_pos + j); - if (v_value < v_min || v_value > v_max) { - return false; - } - } - u_pos += u_pitch; - v_pos += v_pitch; - } - return true; - } - - int errors_; - int width_; - int height_; - int num_set_sizes_; - int num_rendered_frames_; - bool black_frame_; - mutable talk_base::CriticalSection crit_; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_FAKEVIDEORENDERER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/filemediaengine.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/filemediaengine.h deleted file mode 100755 index e8a65f9..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/filemediaengine.h +++ /dev/null @@ -1,339 +0,0 @@ -// libjingle -// Copyright 2004 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_FILEMEDIAENGINE_H_ -#define TALK_MEDIA_BASE_FILEMEDIAENGINE_H_ - -#include -#include - -#include "talk/base/scoped_ptr.h" -#include "talk/base/stream.h" -#include "talk/media/base/codec.h" -#include "talk/media/base/mediachannel.h" -#include "talk/media/base/mediaengine.h" - -namespace talk_base { -class StreamInterface; -} - -namespace cricket { - -// A media engine contains a capturer, an encoder, and a sender in the sender -// side and a receiver, a decoder, and a renderer in the receiver side. -// FileMediaEngine simulates the capturer and the encoder via an input RTP dump -// stream and simulates the decoder and the renderer via an output RTP dump -// stream. Depending on the parameters of the constructor, FileMediaEngine can -// act as file voice engine, file video engine, or both. Currently, we use -// only the RTP dump packets. TODO(whyuan): Enable RTCP packets. -class FileMediaEngine : public MediaEngineInterface { - public: - FileMediaEngine() : rtp_sender_thread_(NULL) {} - virtual ~FileMediaEngine() {} - - // Set the file name of the input or output RTP dump for voice or video. - // Should be called before the channel is created. - void set_voice_input_filename(const std::string& filename) { - voice_input_filename_ = filename; - } - void set_voice_output_filename(const std::string& filename) { - voice_output_filename_ = filename; - } - void set_video_input_filename(const std::string& filename) { - video_input_filename_ = filename; - } - void set_video_output_filename(const std::string& filename) { - video_output_filename_ = filename; - } - - // Should be called before codecs() and video_codecs() are called. We need to - // set the voice and video codecs; otherwise, Jingle initiation will fail. - void set_voice_codecs(const std::vector& codecs) { - voice_codecs_ = codecs; - } - void set_video_codecs(const std::vector& codecs) { - video_codecs_ = codecs; - } - - // Implement pure virtual methods of MediaEngine. - virtual bool Init(talk_base::Thread* worker_thread) { - return true; - } - virtual void Terminate() {} - virtual int GetCapabilities(); - virtual VoiceMediaChannel* CreateChannel(); - virtual VideoMediaChannel* CreateVideoChannel(VoiceMediaChannel* voice_ch); - virtual SoundclipMedia* CreateSoundclip() { return NULL; } - virtual AudioOptions GetAudioOptions() const { return AudioOptions(); } - virtual bool SetAudioOptions(const AudioOptions& options) { return true; } - virtual bool SetVideoOptions(const VideoOptions& options) { return true; } - virtual bool SetAudioDelayOffset(int offset) { return true; } - virtual bool SetDefaultVideoEncoderConfig(const VideoEncoderConfig& config) { - return true; - } - virtual VideoEncoderConfig GetDefaultVideoEncoderConfig() const { - return VideoEncoderConfig(); - } - virtual bool SetSoundDevices(const Device* in_dev, const Device* out_dev) { - return true; - } - virtual bool SetVideoCaptureDevice(const Device* cam_device) { return true; } - virtual bool SetVideoCapturer(VideoCapturer* /*capturer*/) { - return true; - } - virtual VideoCapturer* GetVideoCapturer() const { - return NULL; - } - virtual bool GetOutputVolume(int* level) { - *level = 0; - return true; - } - virtual bool SetOutputVolume(int level) { return true; } - virtual int GetInputLevel() { return 0; } - virtual bool SetLocalMonitor(bool enable) { return true; } - virtual bool SetLocalRenderer(VideoRenderer* renderer) { return true; } - // TODO(whyuan): control channel send? - virtual bool SetVideoCapture(bool capture) { return true; } - virtual const std::vector& audio_codecs() { - return voice_codecs_; - } - virtual const std::vector& video_codecs() { - return video_codecs_; - } - virtual const std::vector& audio_rtp_header_extensions() { - return audio_rtp_header_extensions_; - } - virtual const std::vector& video_rtp_header_extensions() { - return video_rtp_header_extensions_; - } - - virtual bool FindAudioCodec(const AudioCodec& codec) { return true; } - virtual bool FindVideoCodec(const VideoCodec& codec) { return true; } - virtual void SetVoiceLogging(int min_sev, const char* filter) {} - virtual void SetVideoLogging(int min_sev, const char* filter) {} - virtual bool StartAecDump(talk_base::PlatformFile) { return false; } - - virtual bool RegisterVideoProcessor(VideoProcessor* processor) { - return true; - } - virtual bool UnregisterVideoProcessor(VideoProcessor* processor) { - return true; - } - virtual bool RegisterVoiceProcessor(uint32 ssrc, - VoiceProcessor* processor, - MediaProcessorDirection direction) { - return true; - } - virtual bool UnregisterVoiceProcessor(uint32 ssrc, - VoiceProcessor* processor, - MediaProcessorDirection direction) { - return true; - } - VideoFormat GetStartCaptureFormat() const { - return VideoFormat(); - } - - virtual sigslot::repeater2& - SignalVideoCaptureStateChange() { - return signal_state_change_; - } - - void set_rtp_sender_thread(talk_base::Thread* thread) { - rtp_sender_thread_ = thread; - } - - private: - std::string voice_input_filename_; - std::string voice_output_filename_; - std::string video_input_filename_; - std::string video_output_filename_; - std::vector voice_codecs_; - std::vector video_codecs_; - std::vector audio_rtp_header_extensions_; - std::vector video_rtp_header_extensions_; - sigslot::repeater2 - signal_state_change_; - talk_base::Thread* rtp_sender_thread_; - - DISALLOW_COPY_AND_ASSIGN(FileMediaEngine); -}; - -class RtpSenderReceiver; // Forward declaration. Defined in the .cc file. - -class FileVoiceChannel : public VoiceMediaChannel { - public: - FileVoiceChannel(talk_base::StreamInterface* input_file_stream, - talk_base::StreamInterface* output_file_stream, - talk_base::Thread* rtp_sender_thread); - virtual ~FileVoiceChannel(); - - // Implement pure virtual methods of VoiceMediaChannel. - virtual bool SetRecvCodecs(const std::vector& codecs) { - return true; - } - virtual bool SetSendCodecs(const std::vector& codecs); - virtual bool SetRecvRtpHeaderExtensions( - const std::vector& extensions) { - return true; - } - virtual bool SetSendRtpHeaderExtensions( - const std::vector& extensions) { - return true; - } - virtual bool SetPlayout(bool playout) { return true; } - virtual bool SetSend(SendFlags flag); - virtual bool SetRemoteRenderer(uint32 ssrc, AudioRenderer* renderer) { - return false; - } - virtual bool SetLocalRenderer(uint32 ssrc, AudioRenderer* renderer) { - return false; - } - virtual bool GetActiveStreams(AudioInfo::StreamList* actives) { return true; } - virtual int GetOutputLevel() { return 0; } - virtual int GetTimeSinceLastTyping() { return -1; } - virtual void SetTypingDetectionParameters(int time_window, - int cost_per_typing, int reporting_threshold, int penalty_decay, - int type_event_delay) {} - - virtual bool SetOutputScaling(uint32 ssrc, double left, double right) { - return false; - } - virtual bool GetOutputScaling(uint32 ssrc, double* left, double* right) { - return false; - } - virtual bool SetRingbackTone(const char* buf, int len) { return true; } - virtual bool PlayRingbackTone(uint32 ssrc, bool play, bool loop) { - return true; - } - virtual bool InsertDtmf(uint32 ssrc, int event, int duration, int flags) { - return false; - } - virtual bool GetStats(VoiceMediaInfo* info) { return true; } - - // Implement pure virtual methods of MediaChannel. - virtual void OnPacketReceived(talk_base::Buffer* packet, - const talk_base::PacketTime& packet_time); - virtual void OnRtcpReceived(talk_base::Buffer* packet, - const talk_base::PacketTime& packet_time) {} - virtual void OnReadyToSend(bool ready) {} - virtual bool AddSendStream(const StreamParams& sp); - virtual bool RemoveSendStream(uint32 ssrc); - virtual bool AddRecvStream(const StreamParams& sp) { return true; } - virtual bool RemoveRecvStream(uint32 ssrc) { return true; } - virtual bool MuteStream(uint32 ssrc, bool on) { return false; } - virtual bool SetStartSendBandwidth(int bps) { return true; } - virtual bool SetMaxSendBandwidth(int bps) { return true; } - virtual bool SetOptions(const AudioOptions& options) { - options_ = options; - return true; - } - virtual bool GetOptions(AudioOptions* options) const { - *options = options_; - return true; - } - - private: - uint32 send_ssrc_; - talk_base::scoped_ptr rtp_sender_receiver_; - AudioOptions options_; - - DISALLOW_COPY_AND_ASSIGN(FileVoiceChannel); -}; - -class FileVideoChannel : public VideoMediaChannel { - public: - FileVideoChannel(talk_base::StreamInterface* input_file_stream, - talk_base::StreamInterface* output_file_stream, - talk_base::Thread* rtp_sender_thread); - virtual ~FileVideoChannel(); - - // Implement pure virtual methods of VideoMediaChannel. - virtual bool SetRecvCodecs(const std::vector& codecs) { - return true; - } - virtual bool SetSendCodecs(const std::vector& codecs); - virtual bool GetSendCodec(VideoCodec* send_codec) { - *send_codec = VideoCodec(); - return true; - } - virtual bool SetSendStreamFormat(uint32 ssrc, const VideoFormat& format) { - return true; - } - virtual bool SetRecvRtpHeaderExtensions( - const std::vector& extensions) { - return true; - } - virtual bool SetSendRtpHeaderExtensions( - const std::vector& extensions) { - return true; - } - virtual bool SetRender(bool render) { return true; } - virtual bool SetSend(bool send); - virtual bool SetRenderer(uint32 ssrc, VideoRenderer* renderer) { - return true; - } - virtual bool SetCapturer(uint32 ssrc, VideoCapturer* capturer) { - return false; - } - virtual bool GetStats(const StatsOptions& options, VideoMediaInfo* info) { - return true; - } - virtual bool SendIntraFrame() { return false; } - virtual bool RequestIntraFrame() { return false; } - - // Implement pure virtual methods of MediaChannel. - virtual void OnPacketReceived(talk_base::Buffer* packet, - const talk_base::PacketTime& packet_time); - virtual void OnRtcpReceived(talk_base::Buffer* packet, - const talk_base::PacketTime& packet_time) {} - virtual void OnReadyToSend(bool ready) {} - virtual bool AddSendStream(const StreamParams& sp); - virtual bool RemoveSendStream(uint32 ssrc); - virtual bool AddRecvStream(const StreamParams& sp) { return true; } - virtual bool RemoveRecvStream(uint32 ssrc) { return true; } - virtual bool MuteStream(uint32 ssrc, bool on) { return false; } - virtual bool SetStartSendBandwidth(int bps) { return true; } - virtual bool SetMaxSendBandwidth(int bps) { return true; } - virtual bool SetOptions(const VideoOptions& options) { - options_ = options; - return true; - } - virtual bool GetOptions(VideoOptions* options) const { - *options = options_; - return true; - } - virtual void UpdateAspectRatio(int ratio_w, int ratio_h) {} - - private: - uint32 send_ssrc_; - talk_base::scoped_ptr rtp_sender_receiver_; - VideoOptions options_; - - DISALLOW_COPY_AND_ASSIGN(FileVideoChannel); -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_FILEMEDIAENGINE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/hybriddataengine.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/hybriddataengine.h deleted file mode 100755 index c18da67..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/hybriddataengine.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * libjingle - * Copyright 2012 Google Inc, and Robin Seggelmann - * - * 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_SCTP_HYBRIDDATAENGINE_H_ -#define TALK_MEDIA_SCTP_HYBRIDDATAENGINE_H_ - -#include -#include - -#include "talk/base/scoped_ptr.h" -#include "talk/media/base/codec.h" -#include "talk/media/base/mediachannel.h" -#include "talk/media/base/mediaengine.h" - -namespace cricket { - -class HybridDataEngine : public DataEngineInterface { - public: - // Takes ownership. - HybridDataEngine(DataEngineInterface* first, - DataEngineInterface* second) - : first_(first), - second_(second) { - codecs_ = first_->data_codecs(); - codecs_.insert( - codecs_.end(), - second_->data_codecs().begin(), - second_->data_codecs().end()); - } - - virtual DataMediaChannel* CreateChannel(DataChannelType data_channel_type) { - DataMediaChannel* channel = NULL; - if (first_) { - channel = first_->CreateChannel(data_channel_type); - } - if (!channel && second_) { - channel = second_->CreateChannel(data_channel_type); - } - return channel; - } - - virtual const std::vector& data_codecs() { return codecs_; } - - private: - talk_base::scoped_ptr first_; - talk_base::scoped_ptr second_; - std::vector codecs_; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_SCTP_HYBRIDDATAENGINE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/hybridvideoengine.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/hybridvideoengine.h deleted file mode 100755 index 3f9164d..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/hybridvideoengine.h +++ /dev/null @@ -1,286 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_HYBRIDVIDEOENGINE_H_ -#define TALK_MEDIA_BASE_HYBRIDVIDEOENGINE_H_ - -#include -#include - -#include "talk/base/logging.h" -#include "talk/base/sigslotrepeater.h" -#include "talk/media/base/codec.h" -#include "talk/media/base/mediachannel.h" -#include "talk/media/base/videocapturer.h" -#include "talk/media/base/videocommon.h" - -namespace cricket { - -struct Device; -struct VideoFormat; -class HybridVideoEngineInterface; -class VideoCapturer; -class VideoFrame; -class VideoRenderer; - -// HybridVideoMediaChannels work with a HybridVideoEngine to combine -// two unrelated VideoMediaChannel implementations into a single class. -class HybridVideoMediaChannel : public VideoMediaChannel { - public: - HybridVideoMediaChannel(HybridVideoEngineInterface* engine, - VideoMediaChannel* channel1, - VideoMediaChannel* channel2); - virtual ~HybridVideoMediaChannel(); - - // VideoMediaChannel methods - virtual void SetInterface(NetworkInterface* iface); - virtual bool SetOptions(const VideoOptions& options); - virtual bool GetOptions(VideoOptions* options) const; - virtual bool AddSendStream(const StreamParams& sp); - virtual bool RemoveSendStream(uint32 ssrc); - virtual bool SetRenderer(uint32 ssrc, VideoRenderer* renderer); - virtual bool SetRender(bool render); - virtual bool MuteStream(uint32 ssrc, bool muted); - - virtual bool SetRecvCodecs(const std::vector& codecs); - virtual bool SetRecvRtpHeaderExtensions( - const std::vector& extensions); - - virtual bool SetSendCodecs(const std::vector& codecs); - virtual bool GetSendCodec(VideoCodec* codec); - virtual bool SetSendStreamFormat(uint32 ssrc, const VideoFormat& format); - virtual bool SetSendRtpHeaderExtensions( - const std::vector& extensions); - virtual bool SetStartSendBandwidth(int bps); - virtual bool SetMaxSendBandwidth(int bps); - virtual bool SetSend(bool send); - - virtual bool AddRecvStream(const StreamParams& sp); - virtual bool RemoveRecvStream(uint32 ssrc); - virtual bool SetCapturer(uint32 ssrc, VideoCapturer* capturer); - - virtual bool SendIntraFrame(); - virtual bool RequestIntraFrame(); - - virtual bool GetStats(const StatsOptions& options, VideoMediaInfo* info); - - virtual void OnPacketReceived(talk_base::Buffer* packet, - const talk_base::PacketTime& packet_time); - virtual void OnRtcpReceived(talk_base::Buffer* packet, - const talk_base::PacketTime& packet_time); - virtual void OnReadyToSend(bool ready); - - virtual void UpdateAspectRatio(int ratio_w, int ratio_h); - - void OnLocalFrame(VideoCapturer*, const VideoFrame*); - void OnLocalFrameFormat(VideoCapturer*, const VideoFormat*); - - bool sending() const { return sending_; } - - private: - bool SelectActiveChannel(const std::vector& codecs); - void SplitCodecs(const std::vector& codecs, - std::vector* codecs1, - std::vector* codecs2); - - void OnMediaError(uint32 ssrc, Error error); - - HybridVideoEngineInterface* engine_; - talk_base::scoped_ptr channel1_; - talk_base::scoped_ptr channel2_; - VideoMediaChannel* active_channel_; - bool sending_; -}; - -// Interface class for HybridVideoChannels to talk to the engine. -class HybridVideoEngineInterface { - public: - virtual ~HybridVideoEngineInterface() {} - virtual bool HasCodec1(const VideoCodec& codec) = 0; - virtual bool HasCodec2(const VideoCodec& codec) = 0; - virtual void OnSendChange1(VideoMediaChannel* channel1, bool send) = 0; - virtual void OnSendChange2(VideoMediaChannel* channel1, bool send) = 0; - virtual void OnNewSendResolution(int width, int height) = 0; -}; - -// The HybridVideoEngine class combines two unrelated VideoEngine impls -// into a single class. It creates HybridVideoMediaChannels that also contain -// a VideoMediaChannel implementation from each engine. Policy is then used -// during call setup to determine which VideoMediaChannel should be used. -// Currently, this policy is based on what codec the remote side wants to use. -template -class HybridVideoEngine : public HybridVideoEngineInterface { - public: - HybridVideoEngine() { - // Unify the codec lists. - codecs_ = video1_.codecs(); - codecs_.insert(codecs_.end(), video2_.codecs().begin(), - video2_.codecs().end()); - - rtp_header_extensions_ = video1_.rtp_header_extensions(); - rtp_header_extensions_.insert(rtp_header_extensions_.end(), - video2_.rtp_header_extensions().begin(), - video2_.rtp_header_extensions().end()); - - SignalCaptureStateChange.repeat(video2_.SignalCaptureStateChange); - } - - bool Init(talk_base::Thread* worker_thread) { - if (!video1_.Init(worker_thread)) { - LOG(LS_ERROR) << "Failed to init VideoEngine1"; - return false; - } - if (!video2_.Init(worker_thread)) { - LOG(LS_ERROR) << "Failed to init VideoEngine2"; - video1_.Terminate(); - return false; - } - return true; - } - void Terminate() { - video1_.Terminate(); - video2_.Terminate(); - } - - int GetCapabilities() { - return (video1_.GetCapabilities() | video2_.GetCapabilities()); - } - HybridVideoMediaChannel* CreateChannel(VoiceMediaChannel* channel) { - talk_base::scoped_ptr channel1( - video1_.CreateChannel(channel)); - if (!channel1) { - LOG(LS_ERROR) << "Failed to create VideoMediaChannel1"; - return NULL; - } - talk_base::scoped_ptr channel2( - video2_.CreateChannel(channel)); - if (!channel2) { - LOG(LS_ERROR) << "Failed to create VideoMediaChannel2"; - return NULL; - } - return new HybridVideoMediaChannel(this, - channel1.release(), channel2.release()); - } - - bool SetOptions(const VideoOptions& options) { - return video1_.SetOptions(options) && video2_.SetOptions(options); - } - bool SetDefaultEncoderConfig(const VideoEncoderConfig& config) { - VideoEncoderConfig conf = config; - if (video1_.codecs().size() > 0) { - conf.max_codec.name = video1_.codecs()[0].name; - if (!video1_.SetDefaultEncoderConfig(conf)) { - LOG(LS_ERROR) << "Failed to SetDefaultEncoderConfig for video1"; - return false; - } - } - if (video2_.codecs().size() > 0) { - conf.max_codec.name = video2_.codecs()[0].name; - if (!video2_.SetDefaultEncoderConfig(conf)) { - LOG(LS_ERROR) << "Failed to SetDefaultEncoderConfig for video2"; - return false; - } - } - return true; - } - VideoEncoderConfig GetDefaultEncoderConfig() const { - // This looks pretty strange, but, in practice, it'll do sane things if - // GetDefaultEncoderConfig is only called after SetDefaultEncoderConfig, - // since both engines should be essentially equivalent at that point. If it - // hasn't been called, though, we'll use the first meaningful encoder - // config, or the config from the second video engine if neither are - // meaningful. - VideoEncoderConfig config = video1_.GetDefaultEncoderConfig(); - if (config.max_codec.width != 0) { - return config; - } else { - return video2_.GetDefaultEncoderConfig(); - } - } - const std::vector& codecs() const { - return codecs_; - } - const std::vector& rtp_header_extensions() const { - return rtp_header_extensions_; - } - void SetLogging(int min_sev, const char* filter) { - video1_.SetLogging(min_sev, filter); - video2_.SetLogging(min_sev, filter); - } - - VideoFormat GetStartCaptureFormat() const { - return video2_.GetStartCaptureFormat(); - } - - // TODO(juberti): Remove these functions after we do the capturer refactoring. - // For now they are set to always use the second engine for capturing, which - // is convenient given our intended use case. - bool SetCaptureDevice(const Device* device) { - return video2_.SetCaptureDevice(device); - } - VideoCapturer* GetVideoCapturer() const { - return video2_.GetVideoCapturer(); - } - bool SetLocalRenderer(VideoRenderer* renderer) { - return video2_.SetLocalRenderer(renderer); - } - sigslot::repeater2 SignalCaptureStateChange; - - virtual bool HasCodec1(const VideoCodec& codec) { - return HasCodec(video1_, codec); - } - virtual bool HasCodec2(const VideoCodec& codec) { - return HasCodec(video2_, codec); - } - template - bool HasCodec(const VIDEO& engine, const VideoCodec& codec) const { - for (std::vector::const_iterator i = engine.codecs().begin(); - i != engine.codecs().end(); - ++i) { - if (i->Matches(codec)) { - return true; - } - } - return false; - } - virtual void OnSendChange1(VideoMediaChannel* channel1, bool send) { - } - virtual void OnSendChange2(VideoMediaChannel* channel2, bool send) { - } - virtual void OnNewSendResolution(int width, int height) { - } - - protected: - VIDEO1 video1_; - VIDEO2 video2_; - std::vector codecs_; - std::vector rtp_header_extensions_; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_HYBRIDVIDEOENGINE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/mediachannel.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/mediachannel.h deleted file mode 100755 index d163479..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/mediachannel.h +++ /dev/null @@ -1,1284 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_MEDIACHANNEL_H_ -#define TALK_MEDIA_BASE_MEDIACHANNEL_H_ - -#include -#include - -#include "talk/base/basictypes.h" -#include "talk/base/buffer.h" -#include "talk/base/dscp.h" -#include "talk/base/logging.h" -#include "talk/base/sigslot.h" -#include "talk/base/socket.h" -#include "talk/base/window.h" -#include "talk/media/base/codec.h" -#include "talk/media/base/constants.h" -#include "talk/media/base/streamparams.h" -// TODO(juberti): re-evaluate this include -#include "talk/session/media/audiomonitor.h" - -namespace talk_base { -class Buffer; -class RateLimiter; -class Timing; -} - -namespace cricket { - -class AudioRenderer; -struct RtpHeader; -class ScreencastId; -struct VideoFormat; -class VideoCapturer; -class VideoRenderer; - -const int kMinRtpHeaderExtensionId = 1; -const int kMaxRtpHeaderExtensionId = 255; -const int kScreencastDefaultFps = 5; -const int kHighStartBitrate = 1500; - -// Used in AudioOptions and VideoOptions to signify "unset" values. -template -class Settable { - public: - Settable() : set_(false), val_() {} - explicit Settable(T val) : set_(true), val_(val) {} - - bool IsSet() const { - return set_; - } - - bool Get(T* out) const { - *out = val_; - return set_; - } - - T GetWithDefaultIfUnset(const T& default_value) const { - return set_ ? val_ : default_value; - } - - virtual void Set(T val) { - set_ = true; - val_ = val; - } - - void Clear() { - Set(T()); - set_ = false; - } - - void SetFrom(const Settable& o) { - // Set this value based on the value of o, iff o is set. If this value is - // set and o is unset, the current value will be unchanged. - T val; - if (o.Get(&val)) { - Set(val); - } - } - - std::string ToString() const { - return set_ ? talk_base::ToString(val_) : ""; - } - - bool operator==(const Settable& o) const { - // Equal if both are unset with any value or both set with the same value. - return (set_ == o.set_) && (!set_ || (val_ == o.val_)); - } - - bool operator!=(const Settable& o) const { - return !operator==(o); - } - - protected: - void InitializeValue(const T &val) { - val_ = val; - } - - private: - bool set_; - T val_; -}; - -class SettablePercent : public Settable { - public: - virtual void Set(float val) { - if (val < 0) { - val = 0; - } - if (val > 1.0) { - val = 1.0; - } - Settable::Set(val); - } -}; - -template -static std::string ToStringIfSet(const char* key, const Settable& val) { - std::string str; - if (val.IsSet()) { - str = key; - str += ": "; - str += val.ToString(); - str += ", "; - } - return str; -} - -// Options that can be applied to a VoiceMediaChannel or a VoiceMediaEngine. -// Used to be flags, but that makes it hard to selectively apply options. -// We are moving all of the setting of options to structs like this, -// but some things currently still use flags. -struct AudioOptions { - void SetAll(const AudioOptions& change) { - echo_cancellation.SetFrom(change.echo_cancellation); - auto_gain_control.SetFrom(change.auto_gain_control); - rx_auto_gain_control.SetFrom(change.rx_auto_gain_control); - noise_suppression.SetFrom(change.noise_suppression); - highpass_filter.SetFrom(change.highpass_filter); - stereo_swapping.SetFrom(change.stereo_swapping); - typing_detection.SetFrom(change.typing_detection); - aecm_generate_comfort_noise.SetFrom(change.aecm_generate_comfort_noise); - conference_mode.SetFrom(change.conference_mode); - adjust_agc_delta.SetFrom(change.adjust_agc_delta); - experimental_agc.SetFrom(change.experimental_agc); - experimental_aec.SetFrom(change.experimental_aec); - experimental_ns.SetFrom(change.experimental_ns); - aec_dump.SetFrom(change.aec_dump); - tx_agc_target_dbov.SetFrom(change.tx_agc_target_dbov); - tx_agc_digital_compression_gain.SetFrom( - change.tx_agc_digital_compression_gain); - tx_agc_limiter.SetFrom(change.tx_agc_limiter); - rx_agc_target_dbov.SetFrom(change.rx_agc_target_dbov); - rx_agc_digital_compression_gain.SetFrom( - change.rx_agc_digital_compression_gain); - rx_agc_limiter.SetFrom(change.rx_agc_limiter); - recording_sample_rate.SetFrom(change.recording_sample_rate); - playout_sample_rate.SetFrom(change.playout_sample_rate); - dscp.SetFrom(change.dscp); - } - - bool operator==(const AudioOptions& o) const { - return echo_cancellation == o.echo_cancellation && - auto_gain_control == o.auto_gain_control && - rx_auto_gain_control == o.rx_auto_gain_control && - noise_suppression == o.noise_suppression && - highpass_filter == o.highpass_filter && - stereo_swapping == o.stereo_swapping && - typing_detection == o.typing_detection && - aecm_generate_comfort_noise == o.aecm_generate_comfort_noise && - conference_mode == o.conference_mode && - experimental_agc == o.experimental_agc && - experimental_aec == o.experimental_aec && - experimental_ns == o.experimental_ns && - adjust_agc_delta == o.adjust_agc_delta && - aec_dump == o.aec_dump && - tx_agc_target_dbov == o.tx_agc_target_dbov && - tx_agc_digital_compression_gain == o.tx_agc_digital_compression_gain && - tx_agc_limiter == o.tx_agc_limiter && - rx_agc_target_dbov == o.rx_agc_target_dbov && - rx_agc_digital_compression_gain == o.rx_agc_digital_compression_gain && - rx_agc_limiter == o.rx_agc_limiter && - recording_sample_rate == o.recording_sample_rate && - playout_sample_rate == o.playout_sample_rate && - dscp == o.dscp; - } - - std::string ToString() const { - std::ostringstream ost; - ost << "AudioOptions {"; - ost << ToStringIfSet("aec", echo_cancellation); - ost << ToStringIfSet("agc", auto_gain_control); - ost << ToStringIfSet("rx_agc", rx_auto_gain_control); - ost << ToStringIfSet("ns", noise_suppression); - ost << ToStringIfSet("hf", highpass_filter); - ost << ToStringIfSet("swap", stereo_swapping); - ost << ToStringIfSet("typing", typing_detection); - ost << ToStringIfSet("comfort_noise", aecm_generate_comfort_noise); - ost << ToStringIfSet("conference", conference_mode); - ost << ToStringIfSet("agc_delta", adjust_agc_delta); - ost << ToStringIfSet("experimental_agc", experimental_agc); - ost << ToStringIfSet("experimental_aec", experimental_aec); - ost << ToStringIfSet("experimental_ns", experimental_ns); - ost << ToStringIfSet("aec_dump", aec_dump); - ost << ToStringIfSet("tx_agc_target_dbov", tx_agc_target_dbov); - ost << ToStringIfSet("tx_agc_digital_compression_gain", - tx_agc_digital_compression_gain); - ost << ToStringIfSet("tx_agc_limiter", tx_agc_limiter); - ost << ToStringIfSet("rx_agc_target_dbov", rx_agc_target_dbov); - ost << ToStringIfSet("rx_agc_digital_compression_gain", - rx_agc_digital_compression_gain); - ost << ToStringIfSet("rx_agc_limiter", rx_agc_limiter); - ost << ToStringIfSet("recording_sample_rate", recording_sample_rate); - ost << ToStringIfSet("playout_sample_rate", playout_sample_rate); - ost << ToStringIfSet("dscp", dscp); - ost << "}"; - return ost.str(); - } - - // Audio processing that attempts to filter away the output signal from - // later inbound pickup. - Settable echo_cancellation; - // Audio processing to adjust the sensitivity of the local mic dynamically. - Settable auto_gain_control; - // Audio processing to apply gain to the remote audio. - Settable rx_auto_gain_control; - // Audio processing to filter out background noise. - Settable noise_suppression; - // Audio processing to remove background noise of lower frequencies. - Settable highpass_filter; - // Audio processing to swap the left and right channels. - Settable stereo_swapping; - // Audio processing to detect typing. - Settable typing_detection; - Settable aecm_generate_comfort_noise; - Settable conference_mode; - Settable adjust_agc_delta; - Settable experimental_agc; - Settable experimental_aec; - Settable experimental_ns; - Settable aec_dump; - // Note that tx_agc_* only applies to non-experimental AGC. - Settable tx_agc_target_dbov; - Settable tx_agc_digital_compression_gain; - Settable tx_agc_limiter; - Settable rx_agc_target_dbov; - Settable rx_agc_digital_compression_gain; - Settable rx_agc_limiter; - Settable recording_sample_rate; - Settable playout_sample_rate; - // Set DSCP value for packet sent from audio channel. - Settable dscp; -}; - -// Options that can be applied to a VideoMediaChannel or a VideoMediaEngine. -// Used to be flags, but that makes it hard to selectively apply options. -// We are moving all of the setting of options to structs like this, -// but some things currently still use flags. -struct VideoOptions { - enum HighestBitrate { - NORMAL, - HIGH, - VERY_HIGH - }; - - VideoOptions() { - process_adaptation_threshhold.Set(kProcessCpuThreshold); - system_low_adaptation_threshhold.Set(kLowSystemCpuThreshold); - system_high_adaptation_threshhold.Set(kHighSystemCpuThreshold); - unsignalled_recv_stream_limit.Set(kNumDefaultUnsignalledVideoRecvStreams); - } - - void SetAll(const VideoOptions& change) { - adapt_input_to_encoder.SetFrom(change.adapt_input_to_encoder); - adapt_input_to_cpu_usage.SetFrom(change.adapt_input_to_cpu_usage); - adapt_cpu_with_smoothing.SetFrom(change.adapt_cpu_with_smoothing); - adapt_view_switch.SetFrom(change.adapt_view_switch); - video_adapt_third.SetFrom(change.video_adapt_third); - video_noise_reduction.SetFrom(change.video_noise_reduction); - video_one_layer_screencast.SetFrom(change.video_one_layer_screencast); - video_high_bitrate.SetFrom(change.video_high_bitrate); - video_start_bitrate.SetFrom(change.video_start_bitrate); - video_temporal_layer_screencast.SetFrom( - change.video_temporal_layer_screencast); - video_temporal_layer_realtime.SetFrom( - change.video_temporal_layer_realtime); - video_leaky_bucket.SetFrom(change.video_leaky_bucket); - video_highest_bitrate.SetFrom(change.video_highest_bitrate); - cpu_overuse_detection.SetFrom(change.cpu_overuse_detection); - cpu_underuse_threshold.SetFrom(change.cpu_underuse_threshold); - cpu_overuse_threshold.SetFrom(change.cpu_overuse_threshold); - cpu_overuse_encode_usage.SetFrom(change.cpu_overuse_encode_usage); - conference_mode.SetFrom(change.conference_mode); - process_adaptation_threshhold.SetFrom(change.process_adaptation_threshhold); - system_low_adaptation_threshhold.SetFrom( - change.system_low_adaptation_threshhold); - system_high_adaptation_threshhold.SetFrom( - change.system_high_adaptation_threshhold); - buffered_mode_latency.SetFrom(change.buffered_mode_latency); - lower_min_bitrate.SetFrom(change.lower_min_bitrate); - dscp.SetFrom(change.dscp); - suspend_below_min_bitrate.SetFrom(change.suspend_below_min_bitrate); - unsignalled_recv_stream_limit.SetFrom(change.unsignalled_recv_stream_limit); - use_simulcast_adapter.SetFrom(change.use_simulcast_adapter); - skip_encoding_unused_streams.SetFrom(change.skip_encoding_unused_streams); - screencast_min_bitrate.SetFrom(change.screencast_min_bitrate); - use_improved_wifi_bandwidth_estimator.SetFrom( - change.use_improved_wifi_bandwidth_estimator); - } - - bool operator==(const VideoOptions& o) const { - return adapt_input_to_encoder == o.adapt_input_to_encoder && - adapt_input_to_cpu_usage == o.adapt_input_to_cpu_usage && - adapt_cpu_with_smoothing == o.adapt_cpu_with_smoothing && - adapt_view_switch == o.adapt_view_switch && - video_adapt_third == o.video_adapt_third && - video_noise_reduction == o.video_noise_reduction && - video_one_layer_screencast == o.video_one_layer_screencast && - video_high_bitrate == o.video_high_bitrate && - video_start_bitrate == o.video_start_bitrate && - video_temporal_layer_screencast == o.video_temporal_layer_screencast && - video_temporal_layer_realtime == o.video_temporal_layer_realtime && - video_leaky_bucket == o.video_leaky_bucket && - video_highest_bitrate == o.video_highest_bitrate && - cpu_overuse_detection == o.cpu_overuse_detection && - cpu_underuse_threshold == o.cpu_underuse_threshold && - cpu_overuse_threshold == o.cpu_overuse_threshold && - cpu_overuse_encode_usage == o.cpu_overuse_encode_usage && - conference_mode == o.conference_mode && - process_adaptation_threshhold == o.process_adaptation_threshhold && - system_low_adaptation_threshhold == - o.system_low_adaptation_threshhold && - system_high_adaptation_threshhold == - o.system_high_adaptation_threshhold && - buffered_mode_latency == o.buffered_mode_latency && - lower_min_bitrate == o.lower_min_bitrate && - dscp == o.dscp && - suspend_below_min_bitrate == o.suspend_below_min_bitrate && - unsignalled_recv_stream_limit == o.unsignalled_recv_stream_limit && - use_simulcast_adapter == o.use_simulcast_adapter && - skip_encoding_unused_streams == o.skip_encoding_unused_streams && - screencast_min_bitrate == o.screencast_min_bitrate && - use_improved_wifi_bandwidth_estimator == - o.use_improved_wifi_bandwidth_estimator; - } - - std::string ToString() const { - std::ostringstream ost; - ost << "VideoOptions {"; - ost << ToStringIfSet("encoder adaption", adapt_input_to_encoder); - ost << ToStringIfSet("cpu adaption", adapt_input_to_cpu_usage); - ost << ToStringIfSet("cpu adaptation smoothing", adapt_cpu_with_smoothing); - ost << ToStringIfSet("adapt view switch", adapt_view_switch); - ost << ToStringIfSet("video adapt third", video_adapt_third); - ost << ToStringIfSet("noise reduction", video_noise_reduction); - ost << ToStringIfSet("1 layer screencast", video_one_layer_screencast); - ost << ToStringIfSet("high bitrate", video_high_bitrate); - ost << ToStringIfSet("start bitrate", video_start_bitrate); - ost << ToStringIfSet("video temporal layer screencast", - video_temporal_layer_screencast); - ost << ToStringIfSet("video temporal layer realtime", - video_temporal_layer_realtime); - ost << ToStringIfSet("leaky bucket", video_leaky_bucket); - ost << ToStringIfSet("highest video bitrate", video_highest_bitrate); - ost << ToStringIfSet("cpu overuse detection", cpu_overuse_detection); - ost << ToStringIfSet("cpu underuse threshold", cpu_underuse_threshold); - ost << ToStringIfSet("cpu overuse threshold", cpu_overuse_threshold); - ost << ToStringIfSet("cpu overuse encode usage", - cpu_overuse_encode_usage); - ost << ToStringIfSet("conference mode", conference_mode); - ost << ToStringIfSet("process", process_adaptation_threshhold); - ost << ToStringIfSet("low", system_low_adaptation_threshhold); - ost << ToStringIfSet("high", system_high_adaptation_threshhold); - ost << ToStringIfSet("buffered mode latency", buffered_mode_latency); - ost << ToStringIfSet("lower min bitrate", lower_min_bitrate); - ost << ToStringIfSet("dscp", dscp); - ost << ToStringIfSet("suspend below min bitrate", - suspend_below_min_bitrate); - ost << ToStringIfSet("num channels for early receive", - unsignalled_recv_stream_limit); - ost << ToStringIfSet("use simulcast adapter", use_simulcast_adapter); - ost << ToStringIfSet("skip encoding unused streams", - skip_encoding_unused_streams); - ost << ToStringIfSet("screencast min bitrate", screencast_min_bitrate); - ost << ToStringIfSet("improved wifi bwe", - use_improved_wifi_bandwidth_estimator); - ost << "}"; - return ost.str(); - } - - // Encoder adaption, which is the gd callback in LMI, and TBA in WebRTC. - Settable adapt_input_to_encoder; - // Enable CPU adaptation? - Settable adapt_input_to_cpu_usage; - // Enable CPU adaptation smoothing? - Settable adapt_cpu_with_smoothing; - // Enable Adapt View Switch? - Settable adapt_view_switch; - // Enable video adapt third? - Settable video_adapt_third; - // Enable denoising? - Settable video_noise_reduction; - // Experimental: Enable one layer screencast? - Settable video_one_layer_screencast; - // Experimental: Enable WebRtc higher bitrate? - Settable video_high_bitrate; - // Experimental: Enable WebRtc higher start bitrate? - Settable video_start_bitrate; - // Experimental: Enable WebRTC layered screencast. - Settable video_temporal_layer_screencast; - // Experimental: Enable WebRTC temporal layer strategy for realtime video. - Settable video_temporal_layer_realtime; - // Enable WebRTC leaky bucket when sending media packets. - Settable video_leaky_bucket; - // Set highest bitrate mode for video. - Settable video_highest_bitrate; - // Enable WebRTC Cpu Overuse Detection, which is a new version of the CPU - // adaptation algorithm. So this option will override the - // |adapt_input_to_cpu_usage|. - Settable cpu_overuse_detection; - // Low threshold for cpu overuse adaptation in ms. (Adapt up) - Settable cpu_underuse_threshold; - // High threshold for cpu overuse adaptation in ms. (Adapt down) - Settable cpu_overuse_threshold; - // Use encode usage for cpu detection. - Settable cpu_overuse_encode_usage; - // Use conference mode? - Settable conference_mode; - // Threshhold for process cpu adaptation. (Process limit) - SettablePercent process_adaptation_threshhold; - // Low threshhold for cpu adaptation. (Adapt up) - SettablePercent system_low_adaptation_threshhold; - // High threshhold for cpu adaptation. (Adapt down) - SettablePercent system_high_adaptation_threshhold; - // Specify buffered mode latency in milliseconds. - Settable buffered_mode_latency; - // Make minimum configured send bitrate even lower than usual, at 30kbit. - Settable lower_min_bitrate; - // Set DSCP value for packet sent from video channel. - Settable dscp; - // Enable WebRTC suspension of video. No video frames will be sent when the - // bitrate is below the configured minimum bitrate. - Settable suspend_below_min_bitrate; - // Limit on the number of early receive channels that can be created. - Settable unsignalled_recv_stream_limit; - // Enable use of simulcast adapter. - Settable use_simulcast_adapter; - // Enables the encoder to skip encoding stream not actually sent due to too - // low available bit rate. - Settable skip_encoding_unused_streams; - // Force screencast to use a minimum bitrate - Settable screencast_min_bitrate; - // Enable improved bandwidth estiamtor on wifi. - Settable use_improved_wifi_bandwidth_estimator; -}; - -// A class for playing out soundclips. -class SoundclipMedia { - public: - enum SoundclipFlags { - SF_LOOP = 1, - }; - - virtual ~SoundclipMedia() {} - - // Plays a sound out to the speakers with the given audio stream. The stream - // must be 16-bit little-endian 16 kHz PCM. If a stream is already playing - // on this SoundclipMedia, it is stopped. If clip is NULL, nothing is played. - // Returns whether it was successful. - virtual bool PlaySound(const char *clip, int len, int flags) = 0; -}; - -struct RtpHeaderExtension { - RtpHeaderExtension() : id(0) {} - RtpHeaderExtension(const std::string& u, int i) : uri(u), id(i) {} - std::string uri; - int id; - // TODO(juberti): SendRecv direction; - - bool operator==(const RtpHeaderExtension& ext) const { - // id is a reserved word in objective-c. Therefore the id attribute has to - // be a fully qualified name in order to compile on IOS. - return this->id == ext.id && - uri == ext.uri; - } -}; - -// Returns the named header extension if found among all extensions, NULL -// otherwise. -inline const RtpHeaderExtension* FindHeaderExtension( - const std::vector& extensions, - const std::string& name) { - for (std::vector::const_iterator it = extensions.begin(); - it != extensions.end(); ++it) { - if (it->uri == name) - return &(*it); - } - return NULL; -} - -enum MediaChannelOptions { - // Tune the stream for conference mode. - OPT_CONFERENCE = 0x0001 -}; - -enum VoiceMediaChannelOptions { - // Tune the audio stream for vcs with different target levels. - OPT_AGC_MINUS_10DB = 0x80000000 -}; - -// DTMF flags to control if a DTMF tone should be played and/or sent. -enum DtmfFlags { - DF_PLAY = 0x01, - DF_SEND = 0x02, -}; - -class MediaChannel : public sigslot::has_slots<> { - public: - class NetworkInterface { - public: - enum SocketType { ST_RTP, ST_RTCP }; - virtual bool SendPacket( - talk_base::Buffer* packet, - talk_base::DiffServCodePoint dscp = talk_base::DSCP_NO_CHANGE) = 0; - virtual bool SendRtcp( - talk_base::Buffer* packet, - talk_base::DiffServCodePoint dscp = talk_base::DSCP_NO_CHANGE) = 0; - virtual int SetOption(SocketType type, talk_base::Socket::Option opt, - int option) = 0; - virtual ~NetworkInterface() {} - }; - - MediaChannel() : network_interface_(NULL) {} - virtual ~MediaChannel() {} - - // Sets the abstract interface class for sending RTP/RTCP data. - virtual void SetInterface(NetworkInterface *iface) { - talk_base::CritScope cs(&network_interface_crit_); - network_interface_ = iface; - } - - // Called when a RTP packet is received. - virtual void OnPacketReceived(talk_base::Buffer* packet, - const talk_base::PacketTime& packet_time) = 0; - // Called when a RTCP packet is received. - virtual void OnRtcpReceived(talk_base::Buffer* packet, - const talk_base::PacketTime& packet_time) = 0; - // Called when the socket's ability to send has changed. - virtual void OnReadyToSend(bool ready) = 0; - // Creates a new outgoing media stream with SSRCs and CNAME as described - // by sp. - virtual bool AddSendStream(const StreamParams& sp) = 0; - // Removes an outgoing media stream. - // ssrc must be the first SSRC of the media stream if the stream uses - // multiple SSRCs. - virtual bool RemoveSendStream(uint32 ssrc) = 0; - // Creates a new incoming media stream with SSRCs and CNAME as described - // by sp. - virtual bool AddRecvStream(const StreamParams& sp) = 0; - // Removes an incoming media stream. - // ssrc must be the first SSRC of the media stream if the stream uses - // multiple SSRCs. - virtual bool RemoveRecvStream(uint32 ssrc) = 0; - - // Mutes the channel. - virtual bool MuteStream(uint32 ssrc, bool on) = 0; - - // Sets the RTP extension headers and IDs to use when sending RTP. - virtual bool SetRecvRtpHeaderExtensions( - const std::vector& extensions) = 0; - virtual bool SetSendRtpHeaderExtensions( - const std::vector& extensions) = 0; - // Returns the absoulte sendtime extension id value from media channel. - virtual int GetRtpSendTimeExtnId() const { - return -1; - } - // Sets the initial bandwidth to use when sending starts. - virtual bool SetStartSendBandwidth(int bps) = 0; - // Sets the maximum allowed bandwidth to use when sending data. - virtual bool SetMaxSendBandwidth(int bps) = 0; - - // Base method to send packet using NetworkInterface. - bool SendPacket(talk_base::Buffer* packet) { - return DoSendPacket(packet, false); - } - - bool SendRtcp(talk_base::Buffer* packet) { - return DoSendPacket(packet, true); - } - - int SetOption(NetworkInterface::SocketType type, - talk_base::Socket::Option opt, - int option) { - talk_base::CritScope cs(&network_interface_crit_); - if (!network_interface_) - return -1; - - return network_interface_->SetOption(type, opt, option); - } - - protected: - // This method sets DSCP |value| on both RTP and RTCP channels. - int SetDscp(talk_base::DiffServCodePoint value) { - int ret; - ret = SetOption(NetworkInterface::ST_RTP, - talk_base::Socket::OPT_DSCP, - value); - if (ret == 0) { - ret = SetOption(NetworkInterface::ST_RTCP, - talk_base::Socket::OPT_DSCP, - value); - } - return ret; - } - - private: - bool DoSendPacket(talk_base::Buffer* packet, bool rtcp) { - talk_base::CritScope cs(&network_interface_crit_); - if (!network_interface_) - return false; - - return (!rtcp) ? network_interface_->SendPacket(packet) : - network_interface_->SendRtcp(packet); - } - - // |network_interface_| can be accessed from the worker_thread and - // from any MediaEngine threads. This critical section is to protect accessing - // of network_interface_ object. - talk_base::CriticalSection network_interface_crit_; - NetworkInterface* network_interface_; -}; - -enum SendFlags { - SEND_NOTHING, - SEND_RINGBACKTONE, - SEND_MICROPHONE -}; - -// The stats information is structured as follows: -// Media are represented by either MediaSenderInfo or MediaReceiverInfo. -// Media contains a vector of SSRC infos that are exclusively used by this -// media. (SSRCs shared between media streams can't be represented.) - -// Information about an SSRC. -// This data may be locally recorded, or received in an RTCP SR or RR. -struct SsrcSenderInfo { - SsrcSenderInfo() - : ssrc(0), - timestamp(0) { - } - uint32 ssrc; - double timestamp; // NTP timestamp, represented as seconds since epoch. -}; - -struct SsrcReceiverInfo { - SsrcReceiverInfo() - : ssrc(0), - timestamp(0) { - } - uint32 ssrc; - double timestamp; -}; - -struct MediaSenderInfo { - MediaSenderInfo() - : bytes_sent(0), - packets_sent(0), - packets_lost(0), - fraction_lost(0.0), - rtt_ms(0) { - } - void add_ssrc(const SsrcSenderInfo& stat) { - local_stats.push_back(stat); - } - // Temporary utility function for call sites that only provide SSRC. - // As more info is added into SsrcSenderInfo, this function should go away. - void add_ssrc(uint32 ssrc) { - SsrcSenderInfo stat; - stat.ssrc = ssrc; - add_ssrc(stat); - } - // Utility accessor for clients that are only interested in ssrc numbers. - std::vector ssrcs() const { - std::vector retval; - for (std::vector::const_iterator it = local_stats.begin(); - it != local_stats.end(); ++it) { - retval.push_back(it->ssrc); - } - return retval; - } - // Utility accessor for clients that make the assumption only one ssrc - // exists per media. - // This will eventually go away. - uint32 ssrc() const { - if (local_stats.size() > 0) { - return local_stats[0].ssrc; - } else { - return 0; - } - } - int64 bytes_sent; - int packets_sent; - int packets_lost; - float fraction_lost; - int rtt_ms; - std::string codec_name; - std::vector local_stats; - std::vector remote_stats; -}; - -template -struct VariableInfo { - VariableInfo() - : min_val(), - mean(0.0), - max_val(), - variance(0.0) { - } - T min_val; - double mean; - T max_val; - double variance; -}; - -struct MediaReceiverInfo { - MediaReceiverInfo() - : bytes_rcvd(0), - packets_rcvd(0), - packets_lost(0), - fraction_lost(0.0) { - } - void add_ssrc(const SsrcReceiverInfo& stat) { - local_stats.push_back(stat); - } - // Temporary utility function for call sites that only provide SSRC. - // As more info is added into SsrcSenderInfo, this function should go away. - void add_ssrc(uint32 ssrc) { - SsrcReceiverInfo stat; - stat.ssrc = ssrc; - add_ssrc(stat); - } - std::vector ssrcs() const { - std::vector retval; - for (std::vector::const_iterator it = local_stats.begin(); - it != local_stats.end(); ++it) { - retval.push_back(it->ssrc); - } - return retval; - } - // Utility accessor for clients that make the assumption only one ssrc - // exists per media. - // This will eventually go away. - uint32 ssrc() const { - if (local_stats.size() > 0) { - return local_stats[0].ssrc; - } else { - return 0; - } - } - - int64 bytes_rcvd; - int packets_rcvd; - int packets_lost; - float fraction_lost; - std::vector local_stats; - std::vector remote_stats; -}; - -struct VoiceSenderInfo : public MediaSenderInfo { - VoiceSenderInfo() - : ext_seqnum(0), - jitter_ms(0), - audio_level(0), - aec_quality_min(0.0), - echo_delay_median_ms(0), - echo_delay_std_ms(0), - echo_return_loss(0), - echo_return_loss_enhancement(0), - typing_noise_detected(false) { - } - - int ext_seqnum; - int jitter_ms; - int audio_level; - float aec_quality_min; - int echo_delay_median_ms; - int echo_delay_std_ms; - int echo_return_loss; - int echo_return_loss_enhancement; - bool typing_noise_detected; -}; - -struct VoiceReceiverInfo : public MediaReceiverInfo { - VoiceReceiverInfo() - : ext_seqnum(0), - jitter_ms(0), - jitter_buffer_ms(0), - jitter_buffer_preferred_ms(0), - delay_estimate_ms(0), - audio_level(0), - expand_rate(0), - decoding_calls_to_silence_generator(0), - decoding_calls_to_neteq(0), - decoding_normal(0), - decoding_plc(0), - decoding_cng(0), - decoding_plc_cng(0) { - } - - int ext_seqnum; - int jitter_ms; - int jitter_buffer_ms; - int jitter_buffer_preferred_ms; - int delay_estimate_ms; - int audio_level; - // fraction of synthesized speech inserted through pre-emptive expansion - float expand_rate; - int decoding_calls_to_silence_generator; - int decoding_calls_to_neteq; - int decoding_normal; - int decoding_plc; - int decoding_cng; - int decoding_plc_cng; -}; - -struct VideoSenderInfo : public MediaSenderInfo { - VideoSenderInfo() - : packets_cached(0), - firs_rcvd(0), - plis_rcvd(0), - nacks_rcvd(0), - input_frame_width(0), - input_frame_height(0), - send_frame_width(0), - send_frame_height(0), - framerate_input(0), - framerate_sent(0), - nominal_bitrate(0), - preferred_bitrate(0), - adapt_reason(0), - capture_jitter_ms(0), - avg_encode_ms(0), - encode_usage_percent(0), - capture_queue_delay_ms_per_s(0) { - } - - std::vector ssrc_groups; - int packets_cached; - int firs_rcvd; - int plis_rcvd; - int nacks_rcvd; - int input_frame_width; - int input_frame_height; - int send_frame_width; - int send_frame_height; - int framerate_input; - int framerate_sent; - int nominal_bitrate; - int preferred_bitrate; - int adapt_reason; - int capture_jitter_ms; - int avg_encode_ms; - int encode_usage_percent; - int capture_queue_delay_ms_per_s; - VariableInfo adapt_frame_drops; - VariableInfo effects_frame_drops; - VariableInfo capturer_frame_time; -}; - -struct VideoReceiverInfo : public MediaReceiverInfo { - VideoReceiverInfo() - : packets_concealed(0), - firs_sent(0), - plis_sent(0), - nacks_sent(0), - frame_width(0), - frame_height(0), - framerate_rcvd(0), - framerate_decoded(0), - framerate_output(0), - framerate_render_input(0), - framerate_render_output(0), - decode_ms(0), - max_decode_ms(0), - jitter_buffer_ms(0), - min_playout_delay_ms(0), - render_delay_ms(0), - target_delay_ms(0), - current_delay_ms(0), - capture_start_ntp_time_ms(0) { - } - - std::vector ssrc_groups; - int packets_concealed; - int firs_sent; - int plis_sent; - int nacks_sent; - int frame_width; - int frame_height; - int framerate_rcvd; - int framerate_decoded; - int framerate_output; - // Framerate as sent to the renderer. - int framerate_render_input; - // Framerate that the renderer reports. - int framerate_render_output; - - // All stats below are gathered per-VideoReceiver, but some will be correlated - // across MediaStreamTracks. NOTE(hta): when sinking stats into per-SSRC - // structures, reflect this in the new layout. - - // Current frame decode latency. - int decode_ms; - // Maximum observed frame decode latency. - int max_decode_ms; - // Jitter (network-related) latency. - int jitter_buffer_ms; - // Requested minimum playout latency. - int min_playout_delay_ms; - // Requested latency to account for rendering delay. - int render_delay_ms; - // Target overall delay: network+decode+render, accounting for - // min_playout_delay_ms. - int target_delay_ms; - // Current overall delay, possibly ramping towards target_delay_ms. - int current_delay_ms; - - // Estimated capture start time in NTP time in ms. - int64 capture_start_ntp_time_ms; -}; - -struct DataSenderInfo : public MediaSenderInfo { - DataSenderInfo() - : ssrc(0) { - } - - uint32 ssrc; -}; - -struct DataReceiverInfo : public MediaReceiverInfo { - DataReceiverInfo() - : ssrc(0) { - } - - uint32 ssrc; -}; - -struct BandwidthEstimationInfo { - BandwidthEstimationInfo() - : available_send_bandwidth(0), - available_recv_bandwidth(0), - target_enc_bitrate(0), - actual_enc_bitrate(0), - retransmit_bitrate(0), - transmit_bitrate(0), - bucket_delay(0), - total_received_propagation_delta_ms(0) { - } - - int available_send_bandwidth; - int available_recv_bandwidth; - int target_enc_bitrate; - int actual_enc_bitrate; - int retransmit_bitrate; - int transmit_bitrate; - int bucket_delay; - // The following stats are only valid when - // StatsOptions::include_received_propagation_stats is true. - int total_received_propagation_delta_ms; - std::vector recent_received_propagation_delta_ms; - std::vector recent_received_packet_group_arrival_time_ms; -}; - -struct VoiceMediaInfo { - void Clear() { - senders.clear(); - receivers.clear(); - } - std::vector senders; - std::vector receivers; -}; - -struct VideoMediaInfo { - void Clear() { - senders.clear(); - receivers.clear(); - bw_estimations.clear(); - } - std::vector senders; - std::vector receivers; - std::vector bw_estimations; -}; - -struct DataMediaInfo { - void Clear() { - senders.clear(); - receivers.clear(); - } - std::vector senders; - std::vector receivers; -}; - -struct StatsOptions { - StatsOptions() : include_received_propagation_stats(false) {} - - bool include_received_propagation_stats; -}; - -class VoiceMediaChannel : public MediaChannel { - public: - enum Error { - ERROR_NONE = 0, // No error. - ERROR_OTHER, // Other errors. - ERROR_REC_DEVICE_OPEN_FAILED = 100, // Could not open mic. - ERROR_REC_DEVICE_MUTED, // Mic was muted by OS. - ERROR_REC_DEVICE_SILENT, // No background noise picked up. - ERROR_REC_DEVICE_SATURATION, // Mic input is clipping. - ERROR_REC_DEVICE_REMOVED, // Mic was removed while active. - ERROR_REC_RUNTIME_ERROR, // Processing is encountering errors. - ERROR_REC_SRTP_ERROR, // Generic SRTP failure. - ERROR_REC_SRTP_AUTH_FAILED, // Failed to authenticate packets. - ERROR_REC_TYPING_NOISE_DETECTED, // Typing noise is detected. - ERROR_PLAY_DEVICE_OPEN_FAILED = 200, // Could not open playout. - ERROR_PLAY_DEVICE_MUTED, // Playout muted by OS. - ERROR_PLAY_DEVICE_REMOVED, // Playout removed while active. - ERROR_PLAY_RUNTIME_ERROR, // Errors in voice processing. - ERROR_PLAY_SRTP_ERROR, // Generic SRTP failure. - ERROR_PLAY_SRTP_AUTH_FAILED, // Failed to authenticate packets. - ERROR_PLAY_SRTP_REPLAY, // Packet replay detected. - }; - - VoiceMediaChannel() {} - virtual ~VoiceMediaChannel() {} - // Sets the codecs/payload types to be used for incoming media. - virtual bool SetRecvCodecs(const std::vector& codecs) = 0; - // Sets the codecs/payload types to be used for outgoing media. - virtual bool SetSendCodecs(const std::vector& codecs) = 0; - // Starts or stops playout of received audio. - virtual bool SetPlayout(bool playout) = 0; - // Starts or stops sending (and potentially capture) of local audio. - virtual bool SetSend(SendFlags flag) = 0; - // Sets the renderer object to be used for the specified remote audio stream. - virtual bool SetRemoteRenderer(uint32 ssrc, AudioRenderer* renderer) = 0; - // Sets the renderer object to be used for the specified local audio stream. - virtual bool SetLocalRenderer(uint32 ssrc, AudioRenderer* renderer) = 0; - // Gets current energy levels for all incoming streams. - virtual bool GetActiveStreams(AudioInfo::StreamList* actives) = 0; - // Get the current energy level of the stream sent to the speaker. - virtual int GetOutputLevel() = 0; - // Get the time in milliseconds since last recorded keystroke, or negative. - virtual int GetTimeSinceLastTyping() = 0; - // Temporarily exposed field for tuning typing detect options. - virtual void SetTypingDetectionParameters(int time_window, - int cost_per_typing, int reporting_threshold, int penalty_decay, - int type_event_delay) = 0; - // Set left and right scale for speaker output volume of the specified ssrc. - virtual bool SetOutputScaling(uint32 ssrc, double left, double right) = 0; - // Get left and right scale for speaker output volume of the specified ssrc. - virtual bool GetOutputScaling(uint32 ssrc, double* left, double* right) = 0; - // Specifies a ringback tone to be played during call setup. - virtual bool SetRingbackTone(const char *buf, int len) = 0; - // Plays or stops the aforementioned ringback tone - virtual bool PlayRingbackTone(uint32 ssrc, bool play, bool loop) = 0; - // Returns if the telephone-event has been negotiated. - virtual bool CanInsertDtmf() { return false; } - // Send and/or play a DTMF |event| according to the |flags|. - // The DTMF out-of-band signal will be used on sending. - // The |ssrc| should be either 0 or a valid send stream ssrc. - // The valid value for the |event| are 0 to 15 which corresponding to - // DTMF event 0-9, *, #, A-D. - virtual bool InsertDtmf(uint32 ssrc, int event, int duration, int flags) = 0; - // Gets quality stats for the channel. - virtual bool GetStats(VoiceMediaInfo* info) = 0; - // Gets last reported error for this media channel. - virtual void GetLastMediaError(uint32* ssrc, - VoiceMediaChannel::Error* error) { - ASSERT(error != NULL); - *error = ERROR_NONE; - } - // Sets the media options to use. - virtual bool SetOptions(const AudioOptions& options) = 0; - virtual bool GetOptions(AudioOptions* options) const = 0; - - // Signal errors from MediaChannel. Arguments are: - // ssrc(uint32), and error(VoiceMediaChannel::Error). - sigslot::signal2 SignalMediaError; -}; - -class VideoMediaChannel : public MediaChannel { - public: - enum Error { - ERROR_NONE = 0, // No error. - ERROR_OTHER, // Other errors. - ERROR_REC_DEVICE_OPEN_FAILED = 100, // Could not open camera. - ERROR_REC_DEVICE_NO_DEVICE, // No camera. - ERROR_REC_DEVICE_IN_USE, // Device is in already use. - ERROR_REC_DEVICE_REMOVED, // Device is removed. - ERROR_REC_SRTP_ERROR, // Generic sender SRTP failure. - ERROR_REC_SRTP_AUTH_FAILED, // Failed to authenticate packets. - ERROR_REC_CPU_MAX_CANT_DOWNGRADE, // Can't downgrade capture anymore. - ERROR_PLAY_SRTP_ERROR = 200, // Generic receiver SRTP failure. - ERROR_PLAY_SRTP_AUTH_FAILED, // Failed to authenticate packets. - ERROR_PLAY_SRTP_REPLAY, // Packet replay detected. - }; - - VideoMediaChannel() : renderer_(NULL) {} - virtual ~VideoMediaChannel() {} - // Sets the codecs/payload types to be used for incoming media. - virtual bool SetRecvCodecs(const std::vector& codecs) = 0; - // Sets the codecs/payload types to be used for outgoing media. - virtual bool SetSendCodecs(const std::vector& codecs) = 0; - // Gets the currently set codecs/payload types to be used for outgoing media. - virtual bool GetSendCodec(VideoCodec* send_codec) = 0; - // Sets the format of a specified outgoing stream. - virtual bool SetSendStreamFormat(uint32 ssrc, const VideoFormat& format) = 0; - // Starts or stops playout of received video. - virtual bool SetRender(bool render) = 0; - // Starts or stops transmission (and potentially capture) of local video. - virtual bool SetSend(bool send) = 0; - // Sets the renderer object to be used for the specified stream. - // If SSRC is 0, the renderer is used for the 'default' stream. - virtual bool SetRenderer(uint32 ssrc, VideoRenderer* renderer) = 0; - // If |ssrc| is 0, replace the default capturer (engine capturer) with - // |capturer|. If |ssrc| is non zero create a new stream with |ssrc| as SSRC. - virtual bool SetCapturer(uint32 ssrc, VideoCapturer* capturer) = 0; - // Gets quality stats for the channel. - virtual bool GetStats(const StatsOptions& options, VideoMediaInfo* info) = 0; - // This is needed for MediaMonitor to use the same template for voice, video - // and data MediaChannels. - bool GetStats(VideoMediaInfo* info) { - return GetStats(StatsOptions(), info); - } - - // Send an intra frame to the receivers. - virtual bool SendIntraFrame() = 0; - // Reuqest each of the remote senders to send an intra frame. - virtual bool RequestIntraFrame() = 0; - // Sets the media options to use. - virtual bool SetOptions(const VideoOptions& options) = 0; - virtual bool GetOptions(VideoOptions* options) const = 0; - virtual void UpdateAspectRatio(int ratio_w, int ratio_h) = 0; - - // Signal errors from MediaChannel. Arguments are: - // ssrc(uint32), and error(VideoMediaChannel::Error). - sigslot::signal2 SignalMediaError; - - protected: - VideoRenderer *renderer_; -}; - -enum DataMessageType { - // Chrome-Internal use only. See SctpDataMediaChannel for the actual PPID - // values. - DMT_NONE = 0, - DMT_CONTROL = 1, - DMT_BINARY = 2, - DMT_TEXT = 3, -}; - -// Info about data received in DataMediaChannel. For use in -// DataMediaChannel::SignalDataReceived and in all of the signals that -// signal fires, on up the chain. -struct ReceiveDataParams { - // The in-packet stream indentifier. - // For SCTP, this is really SID, not SSRC. - uint32 ssrc; - // The type of message (binary, text, or control). - DataMessageType type; - // A per-stream value incremented per packet in the stream. - int seq_num; - // A per-stream value monotonically increasing with time. - int timestamp; - - ReceiveDataParams() : - ssrc(0), - type(DMT_TEXT), - seq_num(0), - timestamp(0) { - } -}; - -struct SendDataParams { - // The in-packet stream indentifier. - // For SCTP, this is really SID, not SSRC. - uint32 ssrc; - // The type of message (binary, text, or control). - DataMessageType type; - - // For SCTP, whether to send messages flagged as ordered or not. - // If false, messages can be received out of order. - bool ordered; - // For SCTP, whether the messages are sent reliably or not. - // If false, messages may be lost. - bool reliable; - // For SCTP, if reliable == false, provide partial reliability by - // resending up to this many times. Either count or millis - // is supported, not both at the same time. - int max_rtx_count; - // For SCTP, if reliable == false, provide partial reliability by - // resending for up to this many milliseconds. Either count or millis - // is supported, not both at the same time. - int max_rtx_ms; - - SendDataParams() : - ssrc(0), - type(DMT_TEXT), - // TODO(pthatcher): Make these true by default? - ordered(false), - reliable(false), - max_rtx_count(0), - max_rtx_ms(0) { - } -}; - -enum SendDataResult { SDR_SUCCESS, SDR_ERROR, SDR_BLOCK }; - -class DataMediaChannel : public MediaChannel { - public: - enum Error { - ERROR_NONE = 0, // No error. - ERROR_OTHER, // Other errors. - ERROR_SEND_SRTP_ERROR = 200, // Generic SRTP failure. - ERROR_SEND_SRTP_AUTH_FAILED, // Failed to authenticate packets. - ERROR_RECV_SRTP_ERROR, // Generic SRTP failure. - ERROR_RECV_SRTP_AUTH_FAILED, // Failed to authenticate packets. - ERROR_RECV_SRTP_REPLAY, // Packet replay detected. - }; - - virtual ~DataMediaChannel() {} - - virtual bool SetSendCodecs(const std::vector& codecs) = 0; - virtual bool SetRecvCodecs(const std::vector& codecs) = 0; - - virtual bool MuteStream(uint32 ssrc, bool on) { return false; } - // TODO(pthatcher): Implement this. - virtual bool GetStats(DataMediaInfo* info) { return true; } - - virtual bool SetSend(bool send) = 0; - virtual bool SetReceive(bool receive) = 0; - - virtual bool SendData( - const SendDataParams& params, - const talk_base::Buffer& payload, - SendDataResult* result = NULL) = 0; - // Signals when data is received (params, data, len) - sigslot::signal3 SignalDataReceived; - // Signal errors from MediaChannel. Arguments are: - // ssrc(uint32), and error(DataMediaChannel::Error). - sigslot::signal2 SignalMediaError; - // Signal when the media channel is ready to send the stream. Arguments are: - // writable(bool) - sigslot::signal1 SignalReadyToSend; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_MEDIACHANNEL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/mediacommon.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/mediacommon.h deleted file mode 100755 index 323c39c..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/mediacommon.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_MEDIACOMMON_H_ -#define TALK_MEDIA_BASE_MEDIACOMMON_H_ - -#include "talk/base/stringencode.h" - -namespace cricket { - -enum MediaCapabilities { - AUDIO_RECV = 1 << 0, - AUDIO_SEND = 1 << 1, - VIDEO_RECV = 1 << 2, - VIDEO_SEND = 1 << 3, -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_MEDIACOMMON_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/mediaengine.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/mediaengine.h deleted file mode 100755 index 2b9d810..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/mediaengine.h +++ /dev/null @@ -1,395 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_MEDIAENGINE_H_ -#define TALK_MEDIA_BASE_MEDIAENGINE_H_ - -#ifdef OSX -#include -#endif - -#include - -#include -#include - -#include "talk/base/fileutils.h" -#include "talk/base/sigslotrepeater.h" -#include "talk/media/base/codec.h" -#include "talk/media/base/mediachannel.h" -#include "talk/media/base/mediacommon.h" -#include "talk/media/base/videocapturer.h" -#include "talk/media/base/videocommon.h" -#include "talk/media/base/videoprocessor.h" -#include "talk/media/base/voiceprocessor.h" -#include "talk/media/devices/devicemanager.h" - -#if defined(GOOGLE_CHROME_BUILD) || defined(CHROMIUM_BUILD) -#define DISABLE_MEDIA_ENGINE_FACTORY -#endif - -namespace cricket { - -class VideoCapturer; - -// MediaEngineInterface is an abstraction of a media engine which can be -// subclassed to support different media componentry backends. -// It supports voice and video operations in the same class to facilitate -// proper synchronization between both media types. -class MediaEngineInterface { - public: - // Default value to be used for SetAudioDelayOffset(). - static const int kDefaultAudioDelayOffset; - - virtual ~MediaEngineInterface() {} - - // Initialization - // Starts the engine. - virtual bool Init(talk_base::Thread* worker_thread) = 0; - // Shuts down the engine. - virtual void Terminate() = 0; - // Returns what the engine is capable of, as a set of Capabilities, above. - virtual int GetCapabilities() = 0; - - // MediaChannel creation - // Creates a voice media channel. Returns NULL on failure. - virtual VoiceMediaChannel *CreateChannel() = 0; - // Creates a video media channel, paired with the specified voice channel. - // Returns NULL on failure. - virtual VideoMediaChannel *CreateVideoChannel( - VoiceMediaChannel* voice_media_channel) = 0; - - // Creates a soundclip object for playing sounds on. Returns NULL on failure. - virtual SoundclipMedia *CreateSoundclip() = 0; - - // Configuration - // Gets global audio options. - virtual AudioOptions GetAudioOptions() const = 0; - // Sets global audio options. "options" are from AudioOptions, above. - virtual bool SetAudioOptions(const AudioOptions& options) = 0; - // Sets global video options. "options" are from VideoOptions, above. - virtual bool SetVideoOptions(const VideoOptions& options) = 0; - // Sets the value used by the echo canceller to offset delay values obtained - // from the OS. - virtual bool SetAudioDelayOffset(int offset) = 0; - // Sets the default (maximum) codec/resolution and encoder option to capture - // and encode video. - virtual bool SetDefaultVideoEncoderConfig(const VideoEncoderConfig& config) - = 0; - // Gets the default (maximum) codec/resolution and encoder option used to - // capture and encode video, as set by SetDefaultVideoEncoderConfig or the - // default from the video engine if not previously set. - virtual VideoEncoderConfig GetDefaultVideoEncoderConfig() const = 0; - - // Device selection - // TODO(tschmelcher): Add method for selecting the soundclip device. - virtual bool SetSoundDevices(const Device* in_device, - const Device* out_device) = 0; - - // Device configuration - // Gets the current speaker volume, as a value between 0 and 255. - virtual bool GetOutputVolume(int* level) = 0; - // Sets the current speaker volume, as a value between 0 and 255. - virtual bool SetOutputVolume(int level) = 0; - - // Local monitoring - // Gets the current microphone level, as a value between 0 and 10. - virtual int GetInputLevel() = 0; - // Starts or stops the local microphone. Useful if local mic info is needed - // prior to a call being connected; the mic will be started automatically - // when a VoiceMediaChannel starts sending. - virtual bool SetLocalMonitor(bool enable) = 0; - // Installs a callback for raw frames from the local camera. - virtual bool SetLocalRenderer(VideoRenderer* renderer) = 0; - - virtual const std::vector& audio_codecs() = 0; - virtual const std::vector& - audio_rtp_header_extensions() = 0; - virtual const std::vector& video_codecs() = 0; - virtual const std::vector& - video_rtp_header_extensions() = 0; - - // Logging control - virtual void SetVoiceLogging(int min_sev, const char* filter) = 0; - virtual void SetVideoLogging(int min_sev, const char* filter) = 0; - - // Starts AEC dump using existing file. - virtual bool StartAecDump(talk_base::PlatformFile file) = 0; - - // Voice processors for effects. - virtual bool RegisterVoiceProcessor(uint32 ssrc, - VoiceProcessor* video_processor, - MediaProcessorDirection direction) = 0; - virtual bool UnregisterVoiceProcessor(uint32 ssrc, - VoiceProcessor* video_processor, - MediaProcessorDirection direction) = 0; - - virtual VideoFormat GetStartCaptureFormat() const = 0; - - virtual sigslot::repeater2& - SignalVideoCaptureStateChange() = 0; -}; - - -#if !defined(DISABLE_MEDIA_ENGINE_FACTORY) -class MediaEngineFactory { - public: - typedef cricket::MediaEngineInterface* (*MediaEngineCreateFunction)(); - // Creates a media engine, using either the compiled system default or the - // creation function specified in SetCreateFunction, if specified. - static MediaEngineInterface* Create(); - // Sets the function used when calling Create. If unset, the compiled system - // default will be used. Returns the old create function, or NULL if one - // wasn't set. Likewise, NULL can be used as the |function| parameter to - // reset to the default behavior. - static MediaEngineCreateFunction SetCreateFunction( - MediaEngineCreateFunction function); - private: - static MediaEngineCreateFunction create_function_; -}; -#endif - -// CompositeMediaEngine constructs a MediaEngine from separate -// voice and video engine classes. -template -class CompositeMediaEngine : public MediaEngineInterface { - public: - CompositeMediaEngine() {} - virtual ~CompositeMediaEngine() {} - virtual bool Init(talk_base::Thread* worker_thread) { - if (!voice_.Init(worker_thread)) - return false; - if (!video_.Init(worker_thread)) { - voice_.Terminate(); - return false; - } - SignalVideoCaptureStateChange().repeat(video_.SignalCaptureStateChange); - return true; - } - virtual void Terminate() { - video_.Terminate(); - voice_.Terminate(); - } - - virtual int GetCapabilities() { - return (voice_.GetCapabilities() | video_.GetCapabilities()); - } - virtual VoiceMediaChannel *CreateChannel() { - return voice_.CreateChannel(); - } - virtual VideoMediaChannel *CreateVideoChannel(VoiceMediaChannel* channel) { - return video_.CreateChannel(channel); - } - virtual SoundclipMedia *CreateSoundclip() { - return voice_.CreateSoundclip(); - } - - virtual AudioOptions GetAudioOptions() const { - return voice_.GetOptions(); - } - virtual bool SetAudioOptions(const AudioOptions& options) { - return voice_.SetOptions(options); - } - virtual bool SetVideoOptions(const VideoOptions& options) { - return video_.SetOptions(options); - } - virtual bool SetAudioDelayOffset(int offset) { - return voice_.SetDelayOffset(offset); - } - virtual bool SetDefaultVideoEncoderConfig(const VideoEncoderConfig& config) { - return video_.SetDefaultEncoderConfig(config); - } - virtual VideoEncoderConfig GetDefaultVideoEncoderConfig() const { - return video_.GetDefaultEncoderConfig(); - } - - virtual bool SetSoundDevices(const Device* in_device, - const Device* out_device) { - return voice_.SetDevices(in_device, out_device); - } - - virtual bool GetOutputVolume(int* level) { - return voice_.GetOutputVolume(level); - } - virtual bool SetOutputVolume(int level) { - return voice_.SetOutputVolume(level); - } - - virtual int GetInputLevel() { - return voice_.GetInputLevel(); - } - virtual bool SetLocalMonitor(bool enable) { - return voice_.SetLocalMonitor(enable); - } - virtual bool SetLocalRenderer(VideoRenderer* renderer) { - return video_.SetLocalRenderer(renderer); - } - - virtual const std::vector& audio_codecs() { - return voice_.codecs(); - } - virtual const std::vector& audio_rtp_header_extensions() { - return voice_.rtp_header_extensions(); - } - virtual const std::vector& video_codecs() { - return video_.codecs(); - } - virtual const std::vector& video_rtp_header_extensions() { - return video_.rtp_header_extensions(); - } - - virtual void SetVoiceLogging(int min_sev, const char* filter) { - voice_.SetLogging(min_sev, filter); - } - virtual void SetVideoLogging(int min_sev, const char* filter) { - video_.SetLogging(min_sev, filter); - } - - virtual bool StartAecDump(talk_base::PlatformFile file) { - return voice_.StartAecDump(file); - } - - virtual bool RegisterVoiceProcessor(uint32 ssrc, - VoiceProcessor* processor, - MediaProcessorDirection direction) { - return voice_.RegisterProcessor(ssrc, processor, direction); - } - virtual bool UnregisterVoiceProcessor(uint32 ssrc, - VoiceProcessor* processor, - MediaProcessorDirection direction) { - return voice_.UnregisterProcessor(ssrc, processor, direction); - } - virtual VideoFormat GetStartCaptureFormat() const { - return video_.GetStartCaptureFormat(); - } - virtual sigslot::repeater2& - SignalVideoCaptureStateChange() { - return signal_state_change_; - } - - protected: - VOICE voice_; - VIDEO video_; - sigslot::repeater2 signal_state_change_; -}; - -// NullVoiceEngine can be used with CompositeMediaEngine in the case where only -// a video engine is desired. -class NullVoiceEngine { - public: - bool Init(talk_base::Thread* worker_thread) { return true; } - void Terminate() {} - int GetCapabilities() { return 0; } - // If you need this to return an actual channel, use FakeMediaEngine instead. - VoiceMediaChannel* CreateChannel() { - return NULL; - } - SoundclipMedia* CreateSoundclip() { - return NULL; - } - bool SetDelayOffset(int offset) { return true; } - AudioOptions GetOptions() const { return AudioOptions(); } - bool SetOptions(const AudioOptions& options) { return true; } - bool SetDevices(const Device* in_device, const Device* out_device) { - return true; - } - bool GetOutputVolume(int* level) { - *level = 0; - return true; - } - bool SetOutputVolume(int level) { return true; } - int GetInputLevel() { return 0; } - bool SetLocalMonitor(bool enable) { return true; } - const std::vector& codecs() { return codecs_; } - const std::vector& rtp_header_extensions() { - return rtp_header_extensions_; - } - void SetLogging(int min_sev, const char* filter) {} - bool StartAecDump(talk_base::PlatformFile file) { return false; } - bool RegisterProcessor(uint32 ssrc, - VoiceProcessor* voice_processor, - MediaProcessorDirection direction) { return true; } - bool UnregisterProcessor(uint32 ssrc, - VoiceProcessor* voice_processor, - MediaProcessorDirection direction) { return true; } - - private: - std::vector codecs_; - std::vector rtp_header_extensions_; -}; - -// NullVideoEngine can be used with CompositeMediaEngine in the case where only -// a voice engine is desired. -class NullVideoEngine { - public: - bool Init(talk_base::Thread* worker_thread) { return true; } - void Terminate() {} - int GetCapabilities() { return 0; } - // If you need this to return an actual channel, use FakeMediaEngine instead. - VideoMediaChannel* CreateChannel( - VoiceMediaChannel* voice_media_channel) { - return NULL; - } - bool SetOptions(const VideoOptions& options) { return true; } - VideoEncoderConfig GetDefaultEncoderConfig() const { - return VideoEncoderConfig(); - } - bool SetDefaultEncoderConfig(const VideoEncoderConfig& config) { - return true; - } - bool SetLocalRenderer(VideoRenderer* renderer) { return true; } - const std::vector& codecs() { return codecs_; } - const std::vector& rtp_header_extensions() { - return rtp_header_extensions_; - } - void SetLogging(int min_sev, const char* filter) {} - VideoFormat GetStartCaptureFormat() const { return VideoFormat(); } - - sigslot::signal2 SignalCaptureStateChange; - private: - std::vector codecs_; - std::vector rtp_header_extensions_; -}; - -typedef CompositeMediaEngine NullMediaEngine; - -enum DataChannelType { - DCT_NONE = 0, - DCT_RTP = 1, - DCT_SCTP = 2 -}; - -class DataEngineInterface { - public: - virtual ~DataEngineInterface() {} - virtual DataMediaChannel* CreateChannel(DataChannelType type) = 0; - virtual const std::vector& data_codecs() = 0; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_MEDIAENGINE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/mutedvideocapturer.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/mutedvideocapturer.h deleted file mode 100755 index 8e8ea4b..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/mutedvideocapturer.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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_MUTEDVIDEOCAPTURER_H_ -#define TALK_MEDIA_BASE_MUTEDVIDEOCAPTURER_H_ - -#include "talk/base/thread.h" -#include "talk/media/base/videocapturer.h" - -namespace cricket { - -class MutedFramesGenerator; - -class MutedVideoCapturer : public VideoCapturer { - public: - static const char kCapturerId[]; - - MutedVideoCapturer(); - virtual ~MutedVideoCapturer(); - virtual bool GetBestCaptureFormat(const VideoFormat& desired, - VideoFormat* best_format); - virtual CaptureState Start(const VideoFormat& capture_format); - virtual void Stop(); - virtual bool IsRunning(); - virtual bool IsScreencast() const { return false; } - virtual bool GetPreferredFourccs(std::vector* fourccs); - - protected: - void OnMutedFrame(VideoFrame* muted_frame); - - talk_base::scoped_ptr frame_generator_; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_MUTEDVIDEOCAPTURER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/nullvideoframe.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/nullvideoframe.h deleted file mode 100755 index 7582c4b..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/nullvideoframe.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_NULLVIDEOFRAME_H_ -#define TALK_MEDIA_BASE_NULLVIDEOFRAME_H_ - -#include "talk/media/base/videoframe.h" - -namespace cricket { - -// Simple subclass for use in mocks. -class NullVideoFrame : public VideoFrame { - public: - virtual bool Reset(uint32 format, int w, int h, int dw, int dh, uint8 *sample, - size_t sample_size, size_t pixel_width, - size_t pixel_height, int64 elapsed_time, int64 time_stamp, - int rotation) { - return false; - } - virtual bool InitToBlack(int w, int h, size_t pixel_width, - size_t pixel_height, int64 elapsed_time, - int64 time_stamp) { - return false; - } - virtual size_t GetWidth() const { return 0; } - virtual size_t GetHeight() const { return 0; } - virtual const uint8 *GetYPlane() const { return NULL; } - virtual const uint8 *GetUPlane() const { return NULL; } - virtual const uint8 *GetVPlane() const { return NULL; } - virtual uint8 *GetYPlane() { return NULL; } - virtual uint8 *GetUPlane() { return NULL; } - virtual uint8 *GetVPlane() { return NULL; } - virtual int32 GetYPitch() const { return 0; } - virtual int32 GetUPitch() const { return 0; } - virtual int32 GetVPitch() const { return 0; } - virtual void* GetNativeHandle() const { return NULL; } - - virtual size_t GetPixelWidth() const { return 1; } - virtual size_t GetPixelHeight() const { return 1; } - virtual int64 GetElapsedTime() const { return 0; } - virtual int64 GetTimeStamp() const { return 0; } - virtual void SetElapsedTime(int64 elapsed_time) {} - virtual void SetTimeStamp(int64 time_stamp) {} - virtual int GetRotation() const { return 0; } - - virtual VideoFrame *Copy() const { return NULL; } - - virtual bool MakeExclusive() { return false; } - - virtual size_t CopyToBuffer(uint8 *buffer, size_t size) const { return 0; } - - virtual size_t ConvertToRgbBuffer(uint32 to_fourcc, uint8 *buffer, - size_t size, int stride_rgb) const { - return 0; - } - - virtual void StretchToPlanes( - uint8 *y, uint8 *u, uint8 *v, int32 pitchY, int32 pitchU, int32 pitchV, - size_t width, size_t height, bool interpolate, bool crop) const {} - - virtual VideoFrame *CreateEmptyFrame(int w, int h, size_t pixel_width, - size_t pixel_height, int64 elapsed_time, - int64 time_stamp) const { - return NULL; - } -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_NULLVIDEOFRAME_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/nullvideorenderer.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/nullvideorenderer.h deleted file mode 100755 index a2fd124..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/nullvideorenderer.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_NULLVIDEORENDERER_H_ -#define TALK_MEDIA_BASE_NULLVIDEORENDERER_H_ - -#include "talk/media/base/videorenderer.h" - -namespace cricket { - -// Simple implementation for use in tests. -class NullVideoRenderer : public VideoRenderer { - virtual bool SetSize(int width, int height, int reserved) { - return true; - } - // Called when a new frame is available for display. - virtual bool RenderFrame(const VideoFrame *frame) { - return true; - } -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_NULLVIDEORENDERER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/rtpdataengine.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/rtpdataengine.h deleted file mode 100755 index 23a3c3e..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/rtpdataengine.h +++ /dev/null @@ -1,145 +0,0 @@ -/* - * 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_RTPDATAENGINE_H_ -#define TALK_MEDIA_BASE_RTPDATAENGINE_H_ - -#include -#include - -#include "talk/base/timing.h" -#include "talk/media/base/constants.h" -#include "talk/media/base/mediachannel.h" -#include "talk/media/base/mediaengine.h" - -namespace cricket { - -struct DataCodec; - -class RtpDataEngine : public DataEngineInterface { - public: - RtpDataEngine(); - - virtual DataMediaChannel* CreateChannel(DataChannelType data_channel_type); - - virtual const std::vector& data_codecs() { - return data_codecs_; - } - - // Mostly for testing with a fake clock. Ownership is passed in. - void SetTiming(talk_base::Timing* timing) { - timing_.reset(timing); - } - - private: - std::vector data_codecs_; - talk_base::scoped_ptr timing_; -}; - -// Keep track of sequence number and timestamp of an RTP stream. The -// sequence number starts with a "random" value and increments. The -// timestamp starts with a "random" value and increases monotonically -// according to the clockrate. -class RtpClock { - public: - RtpClock(int clockrate, uint16 first_seq_num, uint32 timestamp_offset) - : clockrate_(clockrate), - last_seq_num_(first_seq_num), - timestamp_offset_(timestamp_offset) { - } - - // Given the current time (in number of seconds which must be - // monotonically increasing), Return the next sequence number and - // timestamp. - void Tick(double now, int* seq_num, uint32* timestamp); - - private: - int clockrate_; - uint16 last_seq_num_; - uint32 timestamp_offset_; -}; - -class RtpDataMediaChannel : public DataMediaChannel { - public: - // Timing* Used for the RtpClock - explicit RtpDataMediaChannel(talk_base::Timing* timing); - // Sets Timing == NULL, so you'll need to call set_timer() before - // using it. This is needed by FakeMediaEngine. - RtpDataMediaChannel(); - virtual ~RtpDataMediaChannel(); - - void set_timing(talk_base::Timing* timing) { - timing_ = timing; - } - - virtual bool SetStartSendBandwidth(int bps) { return true; } - virtual bool SetMaxSendBandwidth(int bps); - virtual bool SetRecvRtpHeaderExtensions( - const std::vector& extensions) { return true; } - virtual bool SetSendRtpHeaderExtensions( - const std::vector& extensions) { return true; } - virtual bool SetSendCodecs(const std::vector& codecs); - virtual bool SetRecvCodecs(const std::vector& codecs); - virtual bool AddSendStream(const StreamParams& sp); - virtual bool RemoveSendStream(uint32 ssrc); - virtual bool AddRecvStream(const StreamParams& sp); - virtual bool RemoveRecvStream(uint32 ssrc); - virtual bool SetSend(bool send) { - sending_ = send; - return true; - } - virtual bool SetReceive(bool receive) { - receiving_ = receive; - return true; - } - virtual void OnPacketReceived(talk_base::Buffer* packet, - const talk_base::PacketTime& packet_time); - virtual void OnRtcpReceived(talk_base::Buffer* packet, - const talk_base::PacketTime& packet_time) {} - virtual void OnReadyToSend(bool ready) {} - virtual bool SendData( - const SendDataParams& params, - const talk_base::Buffer& payload, - SendDataResult* result); - - private: - void Construct(talk_base::Timing* timing); - - bool sending_; - bool receiving_; - talk_base::Timing* timing_; - std::vector send_codecs_; - std::vector recv_codecs_; - std::vector send_streams_; - std::vector recv_streams_; - std::map rtp_clock_by_send_ssrc_; - talk_base::scoped_ptr send_limiter_; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_RTPDATAENGINE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/rtpdump.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/rtpdump.h deleted file mode 100755 index 0807899..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/rtpdump.h +++ /dev/null @@ -1,233 +0,0 @@ -/* - * libjingle - * Copyright 2010 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_RTPDUMP_H_ -#define TALK_MEDIA_BASE_RTPDUMP_H_ - -#include - -#include -#include - -#include "talk/base/basictypes.h" -#include "talk/base/bytebuffer.h" -#include "talk/base/stream.h" - -namespace cricket { - -// We use the RTP dump file format compatible to the format used by rtptools -// (http://www.cs.columbia.edu/irt/software/rtptools/) and Wireshark -// (http://wiki.wireshark.org/rtpdump). In particular, the file starts with the -// first line "#!rtpplay1.0 address/port\n", followed by a 16 byte file header. -// For each packet, the file contains a 8 byte dump packet header, followed by -// the actual RTP or RTCP packet. - -enum RtpDumpPacketFilter { - PF_NONE = 0x0, - PF_RTPHEADER = 0x1, - PF_RTPPACKET = 0x3, // includes header - // PF_RTCPHEADER = 0x4, // TODO(juberti) - PF_RTCPPACKET = 0xC, // includes header - PF_ALL = 0xF -}; - -struct RtpDumpFileHeader { - RtpDumpFileHeader(uint32 start_ms, uint32 s, uint16 p); - void WriteToByteBuffer(talk_base::ByteBuffer* buf); - - static const char kFirstLine[]; - static const size_t kHeaderLength = 16; - uint32 start_sec; // start of recording, the seconds part. - uint32 start_usec; // start of recording, the microseconds part. - uint32 source; // network source (multicast address). - uint16 port; // UDP port. - uint16 padding; // 2 bytes padding. -}; - -struct RtpDumpPacket { - RtpDumpPacket() {} - - RtpDumpPacket(const void* d, size_t s, uint32 elapsed, bool rtcp) - : elapsed_time(elapsed), - original_data_len((rtcp) ? 0 : s) { - data.resize(s); - memcpy(&data[0], d, s); - } - - // In the rtpdump file format, RTCP packets have their data len set to zero, - // since RTCP has an internal length field. - bool is_rtcp() const { return original_data_len == 0; } - bool IsValidRtpPacket() const; - bool IsValidRtcpPacket() const; - // Get the payload type, sequence number, timestampe, and SSRC of the RTP - // packet. Return true and set the output parameter if successful. - bool GetRtpPayloadType(int* pt) const; - bool GetRtpSeqNum(int* seq_num) const; - bool GetRtpTimestamp(uint32* ts) const; - bool GetRtpSsrc(uint32* ssrc) const; - bool GetRtpHeaderLen(size_t* len) const; - // Get the type of the RTCP packet. Return true and set the output parameter - // if successful. - bool GetRtcpType(int* type) const; - - static const size_t kHeaderLength = 8; - uint32 elapsed_time; // Milliseconds since the start of recording. - std::vector data; // The actual RTP or RTCP packet. - size_t original_data_len; // The original length of the packet; may be - // greater than data.size() if only part of the - // packet was recorded. -}; - -class RtpDumpReader { - public: - explicit RtpDumpReader(talk_base::StreamInterface* stream) - : stream_(stream), - file_header_read_(false), - first_line_and_file_header_len_(0), - start_time_ms_(0), - ssrc_override_(0) { - } - virtual ~RtpDumpReader() {} - - // Use the specified ssrc, rather than the ssrc from dump, for RTP packets. - void SetSsrc(uint32 ssrc); - virtual talk_base::StreamResult ReadPacket(RtpDumpPacket* packet); - - protected: - talk_base::StreamResult ReadFileHeader(); - bool RewindToFirstDumpPacket() { - return stream_->SetPosition(first_line_and_file_header_len_); - } - - private: - // Check if its matches "#!rtpplay1.0 address/port\n". - bool CheckFirstLine(const std::string& first_line); - - talk_base::StreamInterface* stream_; - bool file_header_read_; - size_t first_line_and_file_header_len_; - uint32 start_time_ms_; - uint32 ssrc_override_; - - DISALLOW_COPY_AND_ASSIGN(RtpDumpReader); -}; - -// RtpDumpLoopReader reads RTP dump packets from the input stream and rewinds -// the stream when it ends. RtpDumpLoopReader maintains the elapsed time, the -// RTP sequence number and the RTP timestamp properly. RtpDumpLoopReader can -// handle both RTP dump and RTCP dump. We assume that the dump does not mix -// RTP packets and RTCP packets. -class RtpDumpLoopReader : public RtpDumpReader { - public: - explicit RtpDumpLoopReader(talk_base::StreamInterface* stream); - virtual talk_base::StreamResult ReadPacket(RtpDumpPacket* packet); - - private: - // During the first loop, update the statistics, including packet count, frame - // count, timestamps, and sequence number, of the input stream. - void UpdateStreamStatistics(const RtpDumpPacket& packet); - - // At the end of first loop, calculate elapsed_time_increases_, - // rtp_seq_num_increase_, and rtp_timestamp_increase_. - void CalculateIncreases(); - - // During the second and later loops, update the elapsed time of the dump - // packet. If the dumped packet is a RTP packet, update its RTP sequence - // number and timestamp as well. - void UpdateDumpPacket(RtpDumpPacket* packet); - - int loop_count_; - // How much to increase the elapsed time, RTP sequence number, RTP timestampe - // for each loop. They are calcualted with the variables below during the - // first loop. - uint32 elapsed_time_increases_; - int rtp_seq_num_increase_; - uint32 rtp_timestamp_increase_; - // How many RTP packets and how many payload frames in the input stream. RTP - // packets belong to the same frame have the same RTP timestamp, different - // dump timestamp, and different RTP sequence number. - uint32 packet_count_; - uint32 frame_count_; - // The elapsed time, RTP sequence number, and RTP timestamp of the first and - // the previous dump packets in the input stream. - uint32 first_elapsed_time_; - int first_rtp_seq_num_; - uint32 first_rtp_timestamp_; - uint32 prev_elapsed_time_; - int prev_rtp_seq_num_; - uint32 prev_rtp_timestamp_; - - DISALLOW_COPY_AND_ASSIGN(RtpDumpLoopReader); -}; - -class RtpDumpWriter { - public: - explicit RtpDumpWriter(talk_base::StreamInterface* stream); - - // Filter to control what packets we actually record. - void set_packet_filter(int filter); - // Write a RTP or RTCP packet. The parameters data points to the packet and - // data_len is its length. - talk_base::StreamResult WriteRtpPacket(const void* data, size_t data_len) { - return WritePacket(data, data_len, GetElapsedTime(), false); - } - talk_base::StreamResult WriteRtcpPacket(const void* data, size_t data_len) { - return WritePacket(data, data_len, GetElapsedTime(), true); - } - talk_base::StreamResult WritePacket(const RtpDumpPacket& packet) { - return WritePacket(&packet.data[0], packet.data.size(), packet.elapsed_time, - packet.is_rtcp()); - } - uint32 GetElapsedTime() const; - - bool GetDumpSize(size_t* size) { - // Note that we use GetPosition(), rather than GetSize(), to avoid flush the - // stream per write. - return stream_ && size && stream_->GetPosition(size); - } - - protected: - talk_base::StreamResult WriteFileHeader(); - - private: - talk_base::StreamResult WritePacket(const void* data, size_t data_len, - uint32 elapsed, bool rtcp); - size_t FilterPacket(const void* data, size_t data_len, bool rtcp); - talk_base::StreamResult WriteToStream(const void* data, size_t data_len); - - talk_base::StreamInterface* stream_; - int packet_filter_; - bool file_header_written_; - uint32 start_time_ms_; // Time when the record starts. - // If writing to the stream takes longer than this many ms, log a warning. - uint32 warn_slow_writes_delay_; - DISALLOW_COPY_AND_ASSIGN(RtpDumpWriter); -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_RTPDUMP_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/rtputils.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/rtputils.h deleted file mode 100755 index 4d1e13e..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/rtputils.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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_MEDIA_BASE_RTPUTILS_H_ -#define TALK_MEDIA_BASE_RTPUTILS_H_ - -#include "talk/base/byteorder.h" - -namespace cricket { - -const size_t kMinRtpPacketLen = 12; -const size_t kMaxRtpPacketLen = 2048; -const size_t kMinRtcpPacketLen = 4; - -struct RtpHeader { - int payload_type; - int seq_num; - uint32 timestamp; - uint32 ssrc; -}; - -enum RtcpTypes { - kRtcpTypeSR = 200, // Sender report payload type. - kRtcpTypeRR = 201, // Receiver report payload type. - kRtcpTypeSDES = 202, // SDES payload type. - kRtcpTypeBye = 203, // BYE payload type. - kRtcpTypeApp = 204, // APP payload type. - kRtcpTypeRTPFB = 205, // Transport layer Feedback message payload type. - kRtcpTypePSFB = 206, // Payload-specific Feedback message payload type. -}; - -bool GetRtpVersion(const void* data, size_t len, int* version); -bool GetRtpPayloadType(const void* data, size_t len, int* value); -bool GetRtpSeqNum(const void* data, size_t len, int* value); -bool GetRtpTimestamp(const void* data, size_t len, uint32* value); -bool GetRtpSsrc(const void* data, size_t len, uint32* value); -bool GetRtpHeaderLen(const void* data, size_t len, size_t* value); -bool GetRtcpType(const void* data, size_t len, int* value); -bool GetRtcpSsrc(const void* data, size_t len, uint32* value); -bool GetRtpHeader(const void* data, size_t len, RtpHeader* header); - -// Assumes marker bit is 0. -bool SetRtpHeaderFlags( - void* data, size_t len, - bool padding, bool extension, int csrc_count); -bool SetRtpPayloadType(void* data, size_t len, int value); -bool SetRtpSeqNum(void* data, size_t len, int value); -bool SetRtpTimestamp(void* data, size_t len, uint32 value); -bool SetRtpSsrc(void* data, size_t len, uint32 value); -// Assumes version 2, no padding, no extensions, no csrcs. -bool SetRtpHeader(void* data, size_t len, const RtpHeader& header); - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_RTPUTILS_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/screencastid.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/screencastid.h deleted file mode 100755 index 4b01e59..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/screencastid.h +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2012 Google Inc. -// Author: thorcarpenter@google.com (Thor Carpenter) -// -// Defines variant class ScreencastId that combines WindowId and DesktopId. - -#ifndef TALK_MEDIA_BASE_SCREENCASTID_H_ -#define TALK_MEDIA_BASE_SCREENCASTID_H_ - -#include -#include - -#include "talk/base/window.h" -#include "talk/base/windowpicker.h" - -namespace cricket { - -class ScreencastId; -typedef std::vector ScreencastIdList; - -// Used for identifying a window or desktop to be screencast. -class ScreencastId { - public: - enum Type { INVALID, WINDOW, DESKTOP }; - - // Default constructor indicates invalid ScreencastId. - ScreencastId() : type_(INVALID) {} - explicit ScreencastId(const talk_base::WindowId& id) - : type_(WINDOW), window_(id) { - } - explicit ScreencastId(const talk_base::DesktopId& id) - : type_(DESKTOP), desktop_(id) { - } - - Type type() const { return type_; } - const talk_base::WindowId& window() const { return window_; } - const talk_base::DesktopId& desktop() const { return desktop_; } - - // Title is an optional parameter. - const std::string& title() const { return title_; } - void set_title(const std::string& desc) { title_ = desc; } - - bool IsValid() const { - if (type_ == INVALID) { - return false; - } else if (type_ == WINDOW) { - return window_.IsValid(); - } else { - return desktop_.IsValid(); - } - } - bool IsWindow() const { return type_ == WINDOW; } - bool IsDesktop() const { return type_ == DESKTOP; } - bool EqualsId(const ScreencastId& other) const { - if (type_ != other.type_) { - return false; - } - if (type_ == INVALID) { - return true; - } else if (type_ == WINDOW) { - return window_.Equals(other.window()); - } - return desktop_.Equals(other.desktop()); - } - - // T is assumed to be WindowDescription or DesktopDescription. - template - static cricket::ScreencastIdList Convert(const std::vector& list) { - ScreencastIdList screencast_list; - screencast_list.reserve(list.size()); - for (typename std::vector::const_iterator it = list.begin(); - it != list.end(); ++it) { - ScreencastId id(it->id()); - id.set_title(it->title()); - screencast_list.push_back(id); - } - return screencast_list; - } - - private: - Type type_; - talk_base::WindowId window_; - talk_base::DesktopId desktop_; - std::string title_; // Optional. -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_SCREENCASTID_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/streamparams.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/streamparams.h deleted file mode 100755 index 7e5ea12..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/streamparams.h +++ /dev/null @@ -1,228 +0,0 @@ -/* - * 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. - */ - -// This file contains structures for describing SSRCs from a media source such -// as a MediaStreamTrack when it is sent across an RTP session. Multiple media -// sources may be sent across the same RTP session, each of them will be -// described by one StreamParams object -// SsrcGroup is used to describe the relationship between the SSRCs that -// are used for this media source. -// E.x: Consider a source that is sent as 3 simulcast streams -// Let the simulcast elements have SSRC 10, 20, 30. -// Let each simulcast element use FEC and let the protection packets have -// SSRC 11,21,31. -// To describe this 4 SsrcGroups are needed, -// StreamParams would then contain ssrc = {10,11,20,21,30,31} and -// ssrc_groups = {{SIM,{10,20,30}, {FEC,{10,11}, {FEC, {20,21}, {FEC {30,31}}} -// Please see RFC 5576. - -#ifndef TALK_MEDIA_BASE_STREAMPARAMS_H_ -#define TALK_MEDIA_BASE_STREAMPARAMS_H_ - -#include -#include -#include -#include - -#include "talk/base/basictypes.h" - -namespace cricket { - -extern const char kFecSsrcGroupSemantics[]; -extern const char kFidSsrcGroupSemantics[]; -extern const char kSimSsrcGroupSemantics[]; - -struct SsrcGroup { - SsrcGroup(const std::string& usage, const std::vector& ssrcs) - : semantics(usage), ssrcs(ssrcs) { - } - - bool operator==(const SsrcGroup& other) const { - return (semantics == other.semantics && ssrcs == other.ssrcs); - } - bool operator!=(const SsrcGroup &other) const { - return !(*this == other); - } - - bool has_semantics(const std::string& semantics) const; - - std::string ToString() const; - - std::string semantics; // e.g FIX, FEC, SIM. - std::vector ssrcs; // SSRCs of this type. -}; - -struct StreamParams { - static StreamParams CreateLegacy(uint32 ssrc) { - StreamParams stream; - stream.ssrcs.push_back(ssrc); - return stream; - } - - bool operator==(const StreamParams& other) const { - return (groupid == other.groupid && - id == other.id && - ssrcs == other.ssrcs && - ssrc_groups == other.ssrc_groups && - type == other.type && - display == other.display && - cname == other.cname && - sync_label == other.sync_label); - } - bool operator!=(const StreamParams &other) const { - return !(*this == other); - } - - uint32 first_ssrc() const { - if (ssrcs.empty()) { - return 0; - } - - return ssrcs[0]; - } - bool has_ssrcs() const { - return !ssrcs.empty(); - } - bool has_ssrc(uint32 ssrc) const { - return std::find(ssrcs.begin(), ssrcs.end(), ssrc) != ssrcs.end(); - } - void add_ssrc(uint32 ssrc) { - ssrcs.push_back(ssrc); - } - bool has_ssrc_groups() const { - return !ssrc_groups.empty(); - } - bool has_ssrc_group(const std::string& semantics) const { - return (get_ssrc_group(semantics) != NULL); - } - const SsrcGroup* get_ssrc_group(const std::string& semantics) const { - for (std::vector::const_iterator it = ssrc_groups.begin(); - it != ssrc_groups.end(); ++it) { - if (it->has_semantics(semantics)) { - return &(*it); - } - } - return NULL; - } - - // Convenience function to add an FID ssrc for a primary_ssrc - // that's already been added. - inline bool AddFidSsrc(uint32 primary_ssrc, uint32 fid_ssrc) { - return AddSecondarySsrc(kFidSsrcGroupSemantics, primary_ssrc, fid_ssrc); - } - - // Convenience function to lookup the FID ssrc for a primary_ssrc. - // Returns false if primary_ssrc not found or FID not defined for it. - inline bool GetFidSsrc(uint32 primary_ssrc, uint32* fid_ssrc) const { - return GetSecondarySsrc(kFidSsrcGroupSemantics, primary_ssrc, fid_ssrc); - } - - std::string ToString() const; - - // Resource of the MUC jid of the participant of with this stream. - // For 1:1 calls, should be left empty (which means remote streams - // and local streams should not be mixed together). - std::string groupid; - // Unique per-groupid, not across all groupids - std::string id; - std::vector ssrcs; // All SSRCs for this source - std::vector ssrc_groups; // e.g. FID, FEC, SIM - // Examples: "camera", "screencast" - std::string type; - // Friendly name describing stream - std::string display; - std::string cname; // RTCP CNAME - std::string sync_label; // Friendly name of cname. - - private: - bool AddSecondarySsrc(const std::string& semantics, uint32 primary_ssrc, - uint32 secondary_ssrc); - bool GetSecondarySsrc(const std::string& semantics, uint32 primary_ssrc, - uint32* secondary_ssrc) const; -}; - -// A Stream can be selected by either groupid+id or ssrc. -struct StreamSelector { - explicit StreamSelector(uint32 ssrc) : - ssrc(ssrc) { - } - - StreamSelector(const std::string& groupid, - const std::string& streamid) : - ssrc(0), - groupid(groupid), - streamid(streamid) { - } - - bool Matches(const StreamParams& stream) const { - if (ssrc == 0) { - return stream.groupid == groupid && stream.id == streamid; - } else { - return stream.has_ssrc(ssrc); - } - } - - uint32 ssrc; - std::string groupid; - std::string streamid; -}; - -typedef std::vector StreamParamsVec; - -// Finds the stream in streams. Returns true if found. -bool GetStream(const StreamParamsVec& streams, - const StreamSelector& selector, - StreamParams* stream_out); -bool GetStreamBySsrc(const StreamParamsVec& streams, uint32 ssrc, - StreamParams* stream_out); -bool GetStreamByIds(const StreamParamsVec& streams, - const std::string& groupid, - const std::string& id, - StreamParams* stream_out); - -// Removes the stream from streams. Returns true if a stream is -// found and removed. -bool RemoveStream(StreamParamsVec* streams, - const StreamSelector& selector); -bool RemoveStreamBySsrc(StreamParamsVec* streams, uint32 ssrc); -bool RemoveStreamByIds(StreamParamsVec* streams, - const std::string& groupid, - const std::string& id); - -// Checks if |sp| defines parameters for a single primary stream. There may -// be an RTX stream associated with the primary stream. Leaving as non-static so -// we can test this function. -bool IsOneSsrcStream(const StreamParams& sp); - -// Checks if |sp| defines parameters for one Simulcast stream. There may be RTX -// streams associated with the simulcast streams. Leaving as non-static so we -// can test this function. -bool IsSimulcastStream(const StreamParams& sp); - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_STREAMPARAMS_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/testutils.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/testutils.h deleted file mode 100755 index 6c2b873..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/testutils.h +++ /dev/null @@ -1,252 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_TESTUTILS_H_ -#define TALK_MEDIA_BASE_TESTUTILS_H_ - -#include -#include - -#if !defined(DISABLE_YUV) -#include "libyuv/compare.h" -#endif -#include "talk/base/basictypes.h" -#include "talk/base/sigslot.h" -#include "talk/base/window.h" -#include "talk/media/base/mediachannel.h" -#include "talk/media/base/videocapturer.h" -#include "talk/media/base/videocommon.h" - -namespace talk_base { -class ByteBuffer; -class StreamInterface; -} - -namespace cricket { - -// Returns size of 420 image with rounding on chroma for odd sizes. -#define I420_SIZE(w, h) (w * h + (((w + 1) / 2) * ((h + 1) / 2)) * 2) -// Returns size of ARGB image. -#define ARGB_SIZE(w, h) (w * h * 4) - -template inline std::vector MakeVector(const T a[], size_t s) { - return std::vector(a, a + s); -} -#define MAKE_VECTOR(a) cricket::MakeVector(a, ARRAY_SIZE(a)) - -struct RtpDumpPacket; -class RtpDumpWriter; -class VideoFrame; - -struct RawRtpPacket { - void WriteToByteBuffer(uint32 in_ssrc, talk_base::ByteBuffer* buf) const; - bool ReadFromByteBuffer(talk_base::ByteBuffer* buf); - // Check if this packet is the same as the specified packet except the - // sequence number and timestamp, which should be the same as the specified - // parameters. - bool SameExceptSeqNumTimestampSsrc( - const RawRtpPacket& packet, uint16 seq, uint32 ts, uint32 ssc) const; - int size() const { return 28; } - - uint8 ver_to_cc; - uint8 m_to_pt; - uint16 sequence_number; - uint32 timestamp; - uint32 ssrc; - char payload[16]; -}; - -struct RawRtcpPacket { - void WriteToByteBuffer(talk_base::ByteBuffer* buf) const; - bool ReadFromByteBuffer(talk_base::ByteBuffer* buf); - bool EqualsTo(const RawRtcpPacket& packet) const; - - uint8 ver_to_count; - uint8 type; - uint16 length; - char payload[16]; -}; - -class RtpTestUtility { - public: - static size_t GetTestPacketCount(); - - // Write the first count number of kTestRawRtcpPackets or kTestRawRtpPackets, - // depending on the flag rtcp. If it is RTP, use the specified SSRC. Return - // true if successful. - static bool WriteTestPackets( - size_t count, bool rtcp, uint32 rtp_ssrc, RtpDumpWriter* writer); - - // Loop read the first count number of packets from the specified stream. - // Verify the elapsed time of the dump packets increase monotonically. If the - // stream is a RTP stream, verify the RTP sequence number, timestamp, and - // payload. If the stream is a RTCP stream, verify the RTCP header and - // payload. - static bool VerifyTestPacketsFromStream( - size_t count, talk_base::StreamInterface* stream, uint32 ssrc); - - // Verify the dump packet is the same as the raw RTP packet. - static bool VerifyPacket(const RtpDumpPacket* dump, - const RawRtpPacket* raw, - bool header_only); - - static const uint32 kDefaultSsrc = 1; - static const uint32 kRtpTimestampIncrease = 90; - static const uint32 kDefaultTimeIncrease = 30; - static const uint32 kElapsedTimeInterval = 10; - static const RawRtpPacket kTestRawRtpPackets[]; - static const RawRtcpPacket kTestRawRtcpPackets[]; - - private: - RtpTestUtility() {} -}; - -// Test helper for testing VideoCapturer implementations. -class VideoCapturerListener : public sigslot::has_slots<> { - public: - explicit VideoCapturerListener(VideoCapturer* cap); - - CaptureState last_capture_state() const { return last_capture_state_; } - int frame_count() const { return frame_count_; } - uint32 frame_fourcc() const { return frame_fourcc_; } - int frame_width() const { return frame_width_; } - int frame_height() const { return frame_height_; } - uint32 frame_size() const { return frame_size_; } - bool resolution_changed() const { return resolution_changed_; } - - void OnStateChange(VideoCapturer* capturer, CaptureState state); - void OnFrameCaptured(VideoCapturer* capturer, const CapturedFrame* frame); - - private: - CaptureState last_capture_state_; - int frame_count_; - uint32 frame_fourcc_; - int frame_width_; - int frame_height_; - uint32 frame_size_; - bool resolution_changed_; -}; - -class ScreencastEventCatcher : public sigslot::has_slots<> { - public: - ScreencastEventCatcher() : ssrc_(0), ev_(talk_base::WE_RESIZE) { } - uint32 ssrc() const { return ssrc_; } - talk_base::WindowEvent event() const { return ev_; } - void OnEvent(uint32 ssrc, talk_base::WindowEvent ev) { - ssrc_ = ssrc; - ev_ = ev; - } - private: - uint32 ssrc_; - talk_base::WindowEvent ev_; -}; - -class VideoMediaErrorCatcher : public sigslot::has_slots<> { - public: - VideoMediaErrorCatcher() : ssrc_(0), error_(VideoMediaChannel::ERROR_NONE) { } - uint32 ssrc() const { return ssrc_; } - VideoMediaChannel::Error error() const { return error_; } - void OnError(uint32 ssrc, VideoMediaChannel::Error error) { - ssrc_ = ssrc; - error_ = error; - } - private: - uint32 ssrc_; - VideoMediaChannel::Error error_; -}; - -// Returns the absolute path to a file in the testdata/ directory. -std::string GetTestFilePath(const std::string& filename); - -// PSNR formula: psnr = 10 * log10 (Peak Signal^2 / mse) -// sse is set to a small number for identical frames or sse == 0 -static inline double ComputePSNR(double sse, double count) { -#if !defined(DISABLE_YUV) - return libyuv::SumSquareErrorToPsnr(static_cast(sse), - static_cast(count)); -#else - if (sse <= 0.) - sse = 65025.0 * count / pow(10., 128./10.); // produces max PSNR of 128 - return 10.0 * log10(65025.0 * count / sse); -#endif -} - -static inline double ComputeSumSquareError(const uint8 *org, const uint8 *rec, - int size) { -#if !defined(DISABLE_YUV) - return static_cast(libyuv::ComputeSumSquareError(org, rec, size)); -#else - double sse = 0.; - for (int j = 0; j < size; ++j) { - const int diff = static_cast(org[j]) - static_cast(rec[j]); - sse += static_cast(diff * diff); - } - return sse; -#endif -} - -// Loads the image with the specified prefix and size into |out|. -bool LoadPlanarYuvTestImage(const std::string& prefix, - int width, int height, uint8* out); - -// Dumps the YUV image out to a file, for visual inspection. -// PYUV tool can be used to view dump files. -void DumpPlanarYuvTestImage(const std::string& prefix, const uint8* img, - int w, int h); - -// Dumps the ARGB image out to a file, for visual inspection. -// ffplay tool can be used to view dump files. -void DumpPlanarArgbTestImage(const std::string& prefix, const uint8* img, - int w, int h); - -// Compare two I420 frames. -bool VideoFrameEqual(const VideoFrame* frame0, const VideoFrame* frame1); - -// Checks whether |codecs| contains |codec|; checks using Codec::Matches(). -template -bool ContainsMatchingCodec(const std::vector& codecs, const C& codec) { - typename std::vector::const_iterator it; - for (it = codecs.begin(); it != codecs.end(); ++it) { - if (it->Matches(codec)) { - return true; - } - } - return false; -} - -// Create Simulcast StreamParams with given |ssrcs| and |cname|. -cricket::StreamParams CreateSimStreamParams( - const std::string& cname, const std::vector& ssrcs); -// Create Simulcast stream with given |ssrcs| and |rtx_ssrcs|. -// The number of |rtx_ssrcs| must match number of |ssrcs|. -cricket::StreamParams CreateSimWithRtxStreamParams( - const std::string& cname, const std::vector& ssrcs, - const std::vector& rtx_ssrcs); - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_TESTUTILS_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/videoadapter.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/videoadapter.h deleted file mode 100755 index 0742956..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/videoadapter.h +++ /dev/null @@ -1,214 +0,0 @@ -// libjingle -// Copyright 2010 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_VIDEOADAPTER_H_ // NOLINT -#define TALK_MEDIA_BASE_VIDEOADAPTER_H_ - -#include "talk/base/common.h" // For ASSERT -#include "talk/base/criticalsection.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/sigslot.h" -#include "talk/media/base/videocommon.h" - -namespace cricket { - -class VideoFrame; - -// VideoAdapter adapts an input video frame to an output frame based on the -// specified input and output formats. The adaptation includes dropping frames -// to reduce frame rate and scaling frames. VideoAdapter is thread safe. -class VideoAdapter { - public: - VideoAdapter(); - virtual ~VideoAdapter(); - - virtual void SetInputFormat(const VideoFormat& format); - void SetOutputFormat(const VideoFormat& format); - // Constrain output resolution to this many pixels overall - void SetOutputNumPixels(int num_pixels); - int GetOutputNumPixels() const; - - const VideoFormat& input_format(); - // Returns true if the adapter is dropping frames in calls to AdaptFrame. - bool drops_all_frames() const; - const VideoFormat& output_format(); - // If the parameter black is true, the adapted frames will be black. - void SetBlackOutput(bool black); - - // Adapt the input frame from the input format to the output format. Return - // true and set the output frame to NULL if the input frame is dropped. Return - // true and set the out frame to output_frame_ if the input frame is adapted - // successfully. Return false otherwise. - // output_frame_ is owned by the VideoAdapter that has the best knowledge on - // the output frame. - bool AdaptFrame(const VideoFrame* in_frame, VideoFrame** out_frame); - - void set_scale_third(bool enable); - bool scale_third() const { return scale_third_; } - - protected: - float FindClosestScale(int width, int height, int target_num_pixels); - float FindClosestViewScale(int width, int height, int target_num_pixels); - float FindLowerScale(int width, int height, int target_num_pixels); - - private: - const float* GetViewScaleFactors() const; - float FindScale(const float* scale_factors, - const float upbias, int width, int height, - int target_num_pixels); - bool StretchToOutputFrame(const VideoFrame* in_frame); - - VideoFormat input_format_; - VideoFormat output_format_; - int output_num_pixels_; - bool scale_third_; // True if adapter allows scaling to 1/3 and 2/3. - int frames_in_; // Number of input frames. - int frames_out_; // Number of output frames. - int frames_scaled_; // Number of frames scaled. - int adaption_changes_; // Number of changes in scale factor. - size_t previous_width_; // Previous adapter output width. - size_t previous_height_; // Previous adapter output height. - bool black_output_; // Flag to tell if we need to black output_frame_. - bool is_black_; // Flag to tell if output_frame_ is currently black. - int64 interval_next_frame_; - talk_base::scoped_ptr output_frame_; - // The critical section to protect the above variables. - talk_base::CriticalSection critical_section_; - - DISALLOW_COPY_AND_ASSIGN(VideoAdapter); -}; - -// CoordinatedVideoAdapter adapts the video input to the encoder by coordinating -// the format request from the server, the resolution request from the encoder, -// and the CPU load. -class CoordinatedVideoAdapter - : public VideoAdapter, public sigslot::has_slots<> { - public: - enum AdaptRequest { UPGRADE, KEEP, DOWNGRADE }; - enum AdaptReasonEnum { - ADAPTREASON_NONE = 0, - ADAPTREASON_CPU = 1, - ADAPTREASON_BANDWIDTH = 2, - ADAPTREASON_VIEW = 4 - }; - typedef int AdaptReason; - - CoordinatedVideoAdapter(); - virtual ~CoordinatedVideoAdapter() {} - - virtual void SetInputFormat(const VideoFormat& format); - - // Enable or disable video adaptation due to the change of the CPU load. - void set_cpu_adaptation(bool enable) { cpu_adaptation_ = enable; } - bool cpu_adaptation() const { return cpu_adaptation_; } - // Enable or disable smoothing when doing CPU adaptation. When smoothing is - // enabled, system CPU load is tracked using an exponential weighted - // average. - void set_cpu_smoothing(bool enable); - bool cpu_smoothing() const { return cpu_smoothing_; } - // Enable or disable video adaptation due to the change of the GD - void set_gd_adaptation(bool enable) { gd_adaptation_ = enable; } - bool gd_adaptation() const { return gd_adaptation_; } - // Enable or disable video adaptation due to the change of the View - void set_view_adaptation(bool enable) { view_adaptation_ = enable; } - bool view_adaptation() const { return view_adaptation_; } - // Enable or disable video adaptation to fast switch View - void set_view_switch(bool enable) { view_switch_ = enable; } - bool view_switch() const { return view_switch_; } - - CoordinatedVideoAdapter::AdaptReason adapt_reason() const { - return adapt_reason_; - } - - // When the video is decreased, set the waiting time for CPU adaptation to - // decrease video again. - void set_cpu_load_min_samples(int cpu_load_min_samples); - int cpu_load_min_samples() const { return cpu_load_min_samples_; } - // CPU system load high threshold for reducing resolution. e.g. 0.85f - void set_high_system_threshold(float high_system_threshold); - float high_system_threshold() const { return high_system_threshold_; } - // CPU system load low threshold for increasing resolution. e.g. 0.70f - void set_low_system_threshold(float low_system_threshold); - float low_system_threshold() const { return low_system_threshold_; } - // CPU process load threshold for reducing resolution. e.g. 0.10f - void set_process_threshold(float process_threshold); - float process_threshold() const { return process_threshold_; } - - // Handle the format request from the server via Jingle update message. - void OnOutputFormatRequest(const VideoFormat& format); - // Handle the resolution request from the encoder due to bandwidth changes. - void OnEncoderResolutionRequest(int width, int height, AdaptRequest request); - // Handle the resolution request for CPU overuse. - void OnCpuResolutionRequest(AdaptRequest request); - // Handle the CPU load provided by a CPU monitor. - void OnCpuLoadUpdated(int current_cpus, int max_cpus, - float process_load, float system_load); - - sigslot::signal0<> SignalCpuAdaptationUnable; - - private: - // Adapt to the minimum of the formats the server requests, the CPU wants, and - // the encoder wants. Returns true if resolution changed. - bool AdaptToMinimumFormat(int* new_width, int* new_height); - bool IsMinimumFormat(int pixels); - void StepPixelCount(CoordinatedVideoAdapter::AdaptRequest request, - int* num_pixels); - CoordinatedVideoAdapter::AdaptRequest FindCpuRequest( - int current_cpus, int max_cpus, - float process_load, float system_load); - - bool cpu_adaptation_; // True if cpu adaptation is enabled. - bool cpu_smoothing_; // True if cpu smoothing is enabled (with adaptation). - bool gd_adaptation_; // True if gd adaptation is enabled. - bool view_adaptation_; // True if view adaptation is enabled. - bool view_switch_; // True if view switch is enabled. - int cpu_downgrade_count_; - int cpu_load_min_samples_; - int cpu_load_num_samples_; - // cpu system load thresholds relative to max cpus. - float high_system_threshold_; - float low_system_threshold_; - // cpu process load thresholds relative to current cpus. - float process_threshold_; - // Video formats that the server view requests, the CPU wants, and the encoder - // wants respectively. The adapted output format is the minimum of these. - int view_desired_num_pixels_; - int64 view_desired_interval_; - int encoder_desired_num_pixels_; - int cpu_desired_num_pixels_; - CoordinatedVideoAdapter::AdaptReason adapt_reason_; - // The critical section to protect handling requests. - talk_base::CriticalSection request_critical_section_; - - // The weighted average of cpu load over time. It's always updated (if cpu - // adaptation is on), but only used if cpu_smoothing_ is set. - float system_load_average_; - - DISALLOW_COPY_AND_ASSIGN(CoordinatedVideoAdapter); -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_VIDEOADAPTER_H_ // NOLINT diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/videocapturer.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/videocapturer.h deleted file mode 100755 index 77ed0d4..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/videocapturer.h +++ /dev/null @@ -1,402 +0,0 @@ -// libjingle -// Copyright 2010 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. -// -// Declaration of abstract class VideoCapturer - -#ifndef TALK_MEDIA_BASE_VIDEOCAPTURER_H_ -#define TALK_MEDIA_BASE_VIDEOCAPTURER_H_ - -#include -#include - -#include "talk/base/basictypes.h" -#include "talk/base/criticalsection.h" -#include "talk/base/messagehandler.h" -#include "talk/base/rollingaccumulator.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/sigslot.h" -#include "talk/base/thread.h" -#include "talk/base/timing.h" -#include "talk/media/base/mediachannel.h" -#include "talk/media/base/videoadapter.h" -#include "talk/media/base/videocommon.h" -#include "talk/media/devices/devicemanager.h" - - -namespace cricket { - -class VideoProcessor; - -// Current state of the capturer. -// TODO(hellner): CS_NO_DEVICE is an error code not a capture state. Separate -// error codes and states. -enum CaptureState { - CS_STOPPED, // The capturer has been stopped or hasn't started yet. - CS_STARTING, // The capturer is in the process of starting. Note, it may - // still fail to start. - CS_RUNNING, // The capturer has been started successfully and is now - // capturing. - CS_PAUSED, // The capturer has been paused. - CS_FAILED, // The capturer failed to start. - CS_NO_DEVICE, // The capturer has no device and consequently failed to start. -}; - -class VideoFrame; - -struct CapturedFrame { - static const uint32 kFrameHeaderSize = 40; // Size from width to data_size. - static const uint32 kUnknownDataSize = 0xFFFFFFFF; - - CapturedFrame(); - - // Get the number of bytes of the frame data. If data_size is known, return - // it directly. Otherwise, calculate the size based on width, height, and - // fourcc. Return true if succeeded. - bool GetDataSize(uint32* size) const; - - // The width and height of the captured frame could be different from those - // of VideoFormat. Once the first frame is captured, the width, height, - // fourcc, pixel_width, and pixel_height should keep the same over frames. - int width; // in number of pixels - int height; // in number of pixels - uint32 fourcc; // compression - uint32 pixel_width; // width of a pixel, default is 1 - uint32 pixel_height; // height of a pixel, default is 1 - int64 elapsed_time; // elapsed time since the creation of the frame - // source (that is, the camera), in nanoseconds. - int64 time_stamp; // timestamp of when the frame was captured, in unix - // time with nanosecond units. - uint32 data_size; // number of bytes of the frame data - int rotation; // rotation in degrees of the frame (0, 90, 180, 270) - void* data; // pointer to the frame data. This object allocates the - // memory or points to an existing memory. - - private: - DISALLOW_COPY_AND_ASSIGN(CapturedFrame); -}; - -// VideoCapturer is an abstract class that defines the interfaces for video -// capturing. The subclasses implement the video capturer for various types of -// capturers and various platforms. -// -// The captured frames may need to be adapted (for example, cropping). -// Video adaptation is built into and enabled by default. After a frame has -// been captured from the device, it is sent to the video adapter, then video -// processors, then out to the encoder. -// -// Programming model: -// Create an object of a subclass of VideoCapturer -// Initialize -// SignalStateChange.connect() -// SignalFrameCaptured.connect() -// Find the capture format for Start() by either calling GetSupportedFormats() -// and selecting one of the supported or calling GetBestCaptureFormat(). -// video_adapter()->OnOutputFormatRequest(desired_encoding_format) -// Start() -// GetCaptureFormat() optionally -// Stop() -// -// Assumption: -// The Start() and Stop() methods are called by a single thread (E.g., the -// media engine thread). Hence, the VideoCapture subclasses dont need to be -// thread safe. -// -class VideoCapturer - : public sigslot::has_slots<>, - public talk_base::MessageHandler { - public: - typedef std::vector VideoProcessors; - - // All signals are marshalled to |thread| or the creating thread if - // none is provided. - VideoCapturer(); - explicit VideoCapturer(talk_base::Thread* thread); - virtual ~VideoCapturer() {} - - // Gets the id of the underlying device, which is available after the capturer - // is initialized. Can be used to determine if two capturers reference the - // same device. - const std::string& GetId() const { return id_; } - - // Get the capture formats supported by the video capturer. The supported - // formats are non empty after the device has been opened successfully. - const std::vector* GetSupportedFormats() const; - - // Get the best capture format for the desired format. The best format is the - // same as one of the supported formats except that the frame interval may be - // different. If the application asks for 16x9 and the camera does not support - // 16x9 HD or the application asks for 16x10, we find the closest 4x3 and then - // crop; Otherwise, we find what the application asks for. Note that we assume - // that for HD, the desired format is always 16x9. The subclasses can override - // the default implementation. - // Parameters - // desired: the input desired format. If desired.fourcc is not kAnyFourcc, - // the best capture format has the exactly same fourcc. Otherwise, - // the best capture format uses a fourcc in GetPreferredFourccs(). - // best_format: the output of the best capture format. - // Return false if there is no such a best format, that is, the desired format - // is not supported. - virtual bool GetBestCaptureFormat(const VideoFormat& desired, - VideoFormat* best_format); - - // TODO(hellner): deprecate (make private) the Start API in favor of this one. - // Also remove CS_STARTING as it is implied by the return - // value of StartCapturing(). - bool StartCapturing(const VideoFormat& capture_format); - // Start the video capturer with the specified capture format. - // Parameter - // capture_format: The caller got this parameter by either calling - // GetSupportedFormats() and selecting one of the supported - // or calling GetBestCaptureFormat(). - // Return - // CS_STARTING: The capturer is trying to start. Success or failure will - // be notified via the |SignalStateChange| callback. - // CS_RUNNING: if the capturer is started and capturing. - // CS_PAUSED: Will never be returned. - // CS_FAILED: if the capturer failes to start.. - // CS_NO_DEVICE: if the capturer has no device and fails to start. - virtual CaptureState Start(const VideoFormat& capture_format) = 0; - // Sets the desired aspect ratio. If the capturer is capturing at another - // aspect ratio it will crop the width or the height so that asked for - // aspect ratio is acheived. Note that ratio_w and ratio_h do not need to be - // relatively prime. - void UpdateAspectRatio(int ratio_w, int ratio_h); - void ClearAspectRatio(); - - // Get the current capture format, which is set by the Start() call. - // Note that the width and height of the captured frames may differ from the - // capture format. For example, the capture format is HD but the captured - // frames may be smaller than HD. - const VideoFormat* GetCaptureFormat() const { - return capture_format_.get(); - } - - // Pause the video capturer. - virtual bool Pause(bool paused); - // Stop the video capturer. - virtual void Stop() = 0; - // Check if the video capturer is running. - virtual bool IsRunning() = 0; - // Restart the video capturer with the new |capture_format|. - // Default implementation stops and starts the capturer. - virtual bool Restart(const VideoFormat& capture_format); - // TODO(thorcarpenter): This behavior of keeping the camera open just to emit - // black frames is a total hack and should be fixed. - // When muting, produce black frames then pause the camera. - // When unmuting, start the camera. Camera starts unmuted. - virtual bool MuteToBlackThenPause(bool muted); - virtual bool IsMuted() const { - return muted_; - } - CaptureState capture_state() const { - return capture_state_; - } - - // Adds a video processor that will be applied on VideoFrames returned by - // |SignalVideoFrame|. Multiple video processors can be added. The video - // processors will be applied in the order they were added. - void AddVideoProcessor(VideoProcessor* video_processor); - // Removes the |video_processor| from the list of video processors or - // returns false. - bool RemoveVideoProcessor(VideoProcessor* video_processor); - - // Returns true if the capturer is screencasting. This can be used to - // implement screencast specific behavior. - virtual bool IsScreencast() const = 0; - - // Caps the VideoCapturer's format according to max_format. It can e.g. be - // used to prevent cameras from capturing at a resolution or framerate that - // the capturer is capable of but not performing satisfactorily at. - // The capping is an upper bound for each component of the capturing format. - // The fourcc component is ignored. - void ConstrainSupportedFormats(const VideoFormat& max_format); - - void set_enable_camera_list(bool enable_camera_list) { - enable_camera_list_ = enable_camera_list; - } - bool enable_camera_list() { - return enable_camera_list_; - } - - // Enable scaling to ensure square pixels. - void set_square_pixel_aspect_ratio(bool square_pixel_aspect_ratio) { - square_pixel_aspect_ratio_ = square_pixel_aspect_ratio; - } - bool square_pixel_aspect_ratio() { - return square_pixel_aspect_ratio_; - } - - // Signal all capture state changes that are not a direct result of calling - // Start(). - sigslot::signal2 SignalStateChange; - // Frame callbacks are multithreaded to allow disconnect and connect to be - // called concurrently. It also ensures that it is safe to call disconnect - // at any time which is needed since the signal may be called from an - // unmarshalled thread owned by the VideoCapturer. - // Signal the captured frame to downstream. - sigslot::signal2 SignalFrameCaptured; - // Signal the captured and possibly adapted frame to downstream consumers - // such as the encoder. - sigslot::signal2 SignalVideoFrame; - - const VideoProcessors& video_processors() const { return video_processors_; } - - // If 'screencast_max_pixels' is set greater than zero, screencasts will be - // scaled to be no larger than this value. - // If set to zero, the max pixels will be limited to - // Retina MacBookPro 15" resolution of 2880 x 1800. - // For high fps, maximum pixels limit is set based on common 24" monitor - // resolution of 2048 x 1280. - int screencast_max_pixels() const { return screencast_max_pixels_; } - void set_screencast_max_pixels(int p) { - screencast_max_pixels_ = talk_base::_max(0, p); - } - - // If true, run video adaptation. By default, video adaptation is enabled - // and users must call video_adapter()->OnOutputFormatRequest() - // to receive frames. - bool enable_video_adapter() const { return enable_video_adapter_; } - void set_enable_video_adapter(bool enable_video_adapter) { - enable_video_adapter_ = enable_video_adapter; - } - - CoordinatedVideoAdapter* video_adapter() { return &video_adapter_; } - const CoordinatedVideoAdapter* video_adapter() const { - return &video_adapter_; - } - - // Gets statistics for tracked variables recorded since the last call to - // GetStats. Note that calling GetStats resets any gathered data so it - // should be called only periodically to log statistics. - void GetStats(VariableInfo* adapt_drop_stats, - VariableInfo* effect_drop_stats, - VariableInfo* frame_time_stats, - VideoFormat* last_captured_frame_format); - - protected: - // Callback attached to SignalFrameCaptured where SignalVideoFrames is called. - void OnFrameCaptured(VideoCapturer* video_capturer, - const CapturedFrame* captured_frame); - void SetCaptureState(CaptureState state); - - // Marshals SignalStateChange onto thread_. - void OnMessage(talk_base::Message* message); - - // subclasses override this virtual method to provide a vector of fourccs, in - // order of preference, that are expected by the media engine. - virtual bool GetPreferredFourccs(std::vector* fourccs) = 0; - - // mutators to set private attributes - void SetId(const std::string& id) { - id_ = id; - } - - void SetCaptureFormat(const VideoFormat* format) { - capture_format_.reset(format ? new VideoFormat(*format) : NULL); - if (capture_format_) { - ASSERT(capture_format_->interval > 0 && - "Capture format expected to have positive interval."); - // Video adapter really only cares about capture format interval. - video_adapter_.SetInputFormat(*capture_format_); - } - } - - void SetSupportedFormats(const std::vector& formats); - - private: - void Construct(); - // Get the distance between the desired format and the supported format. - // Return the max distance if they mismatch. See the implementation for - // details. - int64 GetFormatDistance(const VideoFormat& desired, - const VideoFormat& supported); - - // Convert captured frame to readable string for LOG messages. - std::string ToString(const CapturedFrame* frame) const; - - // Applies all registered processors. If any of the processors signal that - // the frame should be dropped the return value will be false. Note that - // this frame should be dropped as it has not applied all processors. - bool ApplyProcessors(VideoFrame* video_frame); - - // Updates filtered_supported_formats_ so that it contains the formats in - // supported_formats_ that fulfill all applied restrictions. - void UpdateFilteredSupportedFormats(); - // Returns true if format doesn't fulfill all applied restrictions. - bool ShouldFilterFormat(const VideoFormat& format) const; - - void UpdateStats(const CapturedFrame* captured_frame); - - // Helper function to save statistics on the current data from a - // RollingAccumulator into stats. - template - static void GetVariableSnapshot( - const talk_base::RollingAccumulator& data, - VariableInfo* stats); - - talk_base::Thread* thread_; - std::string id_; - CaptureState capture_state_; - talk_base::scoped_ptr capture_format_; - std::vector supported_formats_; - talk_base::scoped_ptr max_format_; - std::vector filtered_supported_formats_; - - int ratio_w_; // View resolution. e.g. 1280 x 720. - int ratio_h_; - bool enable_camera_list_; - bool square_pixel_aspect_ratio_; // Enable scaling to square pixels. - int scaled_width_; // Current output size from ComputeScale. - int scaled_height_; - int screencast_max_pixels_; // Downscale screencasts further if requested. - bool muted_; - int black_frame_count_down_; - - bool enable_video_adapter_; - CoordinatedVideoAdapter video_adapter_; - - talk_base::Timing frame_length_time_reporter_; - talk_base::CriticalSection frame_stats_crit_; - - int adapt_frame_drops_; - talk_base::RollingAccumulator adapt_frame_drops_data_; - int effect_frame_drops_; - talk_base::RollingAccumulator effect_frame_drops_data_; - double previous_frame_time_; - talk_base::RollingAccumulator frame_time_data_; - // The captured frame format before potential adapation. - VideoFormat last_captured_frame_format_; - - talk_base::CriticalSection crit_; - VideoProcessors video_processors_; - - DISALLOW_COPY_AND_ASSIGN(VideoCapturer); -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_VIDEOCAPTURER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/videocommon.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/videocommon.h deleted file mode 100755 index a6926a4..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/videocommon.h +++ /dev/null @@ -1,265 +0,0 @@ -// libjingle -// Copyright 2004 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. -// -// Common definition for video, including fourcc and VideoFormat. - -#ifndef TALK_MEDIA_BASE_VIDEOCOMMON_H_ // NOLINT -#define TALK_MEDIA_BASE_VIDEOCOMMON_H_ - -#include - -#include "talk/base/basictypes.h" -#include "talk/base/timeutils.h" - -namespace cricket { - -// TODO(janahan): For now, a hard-coded ssrc is used as the video ssrc. -// This is because when the video frame is passed to the mediaprocessor for -// processing, it doesn't have the correct ssrc. Since currently only Tx -// Video processing is supported, this is ok. When we switch over to trigger -// from capturer, this should be fixed and this const removed. -const uint32 kDummyVideoSsrc = 0xFFFFFFFF; - -// Minimum interval is 10k fps. -#define FPS_TO_INTERVAL(fps) \ - (fps ? talk_base::kNumNanosecsPerSec / fps : \ - talk_base::kNumNanosecsPerSec / 10000) - -////////////////////////////////////////////////////////////////////////////// -// Definition of FourCC codes -////////////////////////////////////////////////////////////////////////////// -// Convert four characters to a FourCC code. -// Needs to be a macro otherwise the OS X compiler complains when the kFormat* -// constants are used in a switch. -#define FOURCC(a, b, c, d) ( \ - (static_cast(a)) | (static_cast(b) << 8) | \ - (static_cast(c) << 16) | (static_cast(d) << 24)) -// Some pages discussing FourCC codes: -// http://www.fourcc.org/yuv.php -// http://v4l2spec.bytesex.org/spec/book1.htm -// http://developer.apple.com/quicktime/icefloe/dispatch020.html -// http://msdn.microsoft.com/library/windows/desktop/dd206750.aspx#nv12 -// http://people.xiph.org/~xiphmont/containers/nut/nut4cc.txt - -// FourCC codes grouped according to implementation efficiency. -// Primary formats should convert in 1 efficient step. -// Secondary formats are converted in 2 steps. -// Auxilliary formats call primary converters. -enum FourCC { - // 9 Primary YUV formats: 5 planar, 2 biplanar, 2 packed. - FOURCC_I420 = FOURCC('I', '4', '2', '0'), - FOURCC_I422 = FOURCC('I', '4', '2', '2'), - FOURCC_I444 = FOURCC('I', '4', '4', '4'), - FOURCC_I411 = FOURCC('I', '4', '1', '1'), - FOURCC_I400 = FOURCC('I', '4', '0', '0'), - FOURCC_NV21 = FOURCC('N', 'V', '2', '1'), - FOURCC_NV12 = FOURCC('N', 'V', '1', '2'), - FOURCC_YUY2 = FOURCC('Y', 'U', 'Y', '2'), - FOURCC_UYVY = FOURCC('U', 'Y', 'V', 'Y'), - - // 2 Secondary YUV formats: row biplanar. - FOURCC_M420 = FOURCC('M', '4', '2', '0'), - FOURCC_Q420 = FOURCC('Q', '4', '2', '0'), - - // 9 Primary RGB formats: 4 32 bpp, 2 24 bpp, 3 16 bpp. - FOURCC_ARGB = FOURCC('A', 'R', 'G', 'B'), - FOURCC_BGRA = FOURCC('B', 'G', 'R', 'A'), - FOURCC_ABGR = FOURCC('A', 'B', 'G', 'R'), - FOURCC_24BG = FOURCC('2', '4', 'B', 'G'), - FOURCC_RAW = FOURCC('r', 'a', 'w', ' '), - FOURCC_RGBA = FOURCC('R', 'G', 'B', 'A'), - FOURCC_RGBP = FOURCC('R', 'G', 'B', 'P'), // bgr565. - FOURCC_RGBO = FOURCC('R', 'G', 'B', 'O'), // abgr1555. - FOURCC_R444 = FOURCC('R', '4', '4', '4'), // argb4444. - - // 4 Secondary RGB formats: 4 Bayer Patterns. - FOURCC_RGGB = FOURCC('R', 'G', 'G', 'B'), - FOURCC_BGGR = FOURCC('B', 'G', 'G', 'R'), - FOURCC_GRBG = FOURCC('G', 'R', 'B', 'G'), - FOURCC_GBRG = FOURCC('G', 'B', 'R', 'G'), - - // 1 Primary Compressed YUV format. - FOURCC_MJPG = FOURCC('M', 'J', 'P', 'G'), - - // 5 Auxiliary YUV variations: 3 with U and V planes are swapped, 1 Alias. - FOURCC_YV12 = FOURCC('Y', 'V', '1', '2'), - FOURCC_YV16 = FOURCC('Y', 'V', '1', '6'), - FOURCC_YV24 = FOURCC('Y', 'V', '2', '4'), - FOURCC_YU12 = FOURCC('Y', 'U', '1', '2'), // Linux version of I420. - FOURCC_J420 = FOURCC('J', '4', '2', '0'), - FOURCC_J400 = FOURCC('J', '4', '0', '0'), - - // 14 Auxiliary aliases. CanonicalFourCC() maps these to canonical fourcc. - FOURCC_IYUV = FOURCC('I', 'Y', 'U', 'V'), // Alias for I420. - FOURCC_YU16 = FOURCC('Y', 'U', '1', '6'), // Alias for I422. - FOURCC_YU24 = FOURCC('Y', 'U', '2', '4'), // Alias for I444. - FOURCC_YUYV = FOURCC('Y', 'U', 'Y', 'V'), // Alias for YUY2. - FOURCC_YUVS = FOURCC('y', 'u', 'v', 's'), // Alias for YUY2 on Mac. - FOURCC_HDYC = FOURCC('H', 'D', 'Y', 'C'), // Alias for UYVY. - FOURCC_2VUY = FOURCC('2', 'v', 'u', 'y'), // Alias for UYVY on Mac. - FOURCC_JPEG = FOURCC('J', 'P', 'E', 'G'), // Alias for MJPG. - FOURCC_DMB1 = FOURCC('d', 'm', 'b', '1'), // Alias for MJPG on Mac. - FOURCC_BA81 = FOURCC('B', 'A', '8', '1'), // Alias for BGGR. - FOURCC_RGB3 = FOURCC('R', 'G', 'B', '3'), // Alias for RAW. - FOURCC_BGR3 = FOURCC('B', 'G', 'R', '3'), // Alias for 24BG. - FOURCC_CM32 = FOURCC(0, 0, 0, 32), // Alias for BGRA kCMPixelFormat_32ARGB - FOURCC_CM24 = FOURCC(0, 0, 0, 24), // Alias for RAW kCMPixelFormat_24RGB - - // 1 Auxiliary compressed YUV format set aside for capturer. - FOURCC_H264 = FOURCC('H', '2', '6', '4'), - - // Match any fourcc. - FOURCC_ANY = 0xFFFFFFFF, -}; - -// Converts fourcc aliases into canonical ones. -uint32 CanonicalFourCC(uint32 fourcc); - -// Get FourCC code as a string. -inline std::string GetFourccName(uint32 fourcc) { - std::string name; - name.push_back(static_cast(fourcc & 0xFF)); - name.push_back(static_cast((fourcc >> 8) & 0xFF)); - name.push_back(static_cast((fourcc >> 16) & 0xFF)); - name.push_back(static_cast((fourcc >> 24) & 0xFF)); - return name; -} - -// Computes a scale less to fit in max_pixels while maintaining aspect ratio. -void ComputeScaleMaxPixels(int frame_width, int frame_height, int max_pixels, - int* scaled_width, int* scaled_height); - -// For low fps, max pixels limit is set to Retina MacBookPro 15" resolution of -// 2880 x 1800 as of 4/18/2013. -// For high fps, maximum pixels limit is set based on common 24" monitor -// resolution of 2048 x 1280 as of 6/13/2013. The Retina resolution is -// therefore reduced to 1440 x 900. -void ComputeScale(int frame_width, int frame_height, int fps, - int* scaled_width, int* scaled_height); - -// Compute the frame size that conversion should crop to based on aspect ratio. -// Ensures size is multiple of 2 due to I420 and conversion limitations. -void ComputeCrop(int cropped_format_width, int cropped_format_height, - int frame_width, int frame_height, - int pixel_width, int pixel_height, - int rotation, - int* cropped_width, int* cropped_height); - -// Compute the frame size that makes pixels square pixel aspect ratio. -void ComputeScaleToSquarePixels(int in_width, int in_height, - int pixel_width, int pixel_height, - int* scaled_width, int* scaled_height); - -////////////////////////////////////////////////////////////////////////////// -// Definition of VideoFormat. -////////////////////////////////////////////////////////////////////////////// - -// VideoFormat with Plain Old Data for global variables. -struct VideoFormatPod { - int width; // Number of pixels. - int height; // Number of pixels. - int64 interval; // Nanoseconds. - uint32 fourcc; // Color space. FOURCC_ANY means that any color space is OK. -}; - -struct VideoFormat : VideoFormatPod { - static const int64 kMinimumInterval = - talk_base::kNumNanosecsPerSec / 10000; // 10k fps. - - VideoFormat() { - Construct(0, 0, 0, 0); - } - - VideoFormat(int w, int h, int64 interval_ns, uint32 cc) { - Construct(w, h, interval_ns, cc); - } - - explicit VideoFormat(const VideoFormatPod& format) { - Construct(format.width, format.height, format.interval, format.fourcc); - } - - void Construct(int w, int h, int64 interval_ns, uint32 cc) { - width = w; - height = h; - interval = interval_ns; - fourcc = cc; - } - - static int64 FpsToInterval(int fps) { - return fps ? talk_base::kNumNanosecsPerSec / fps : kMinimumInterval; - } - - static int IntervalToFps(int64 interval) { - if (!interval) { - return 0; - } - return static_cast(talk_base::kNumNanosecsPerSec / interval); - } - - static float IntervalToFpsFloat(int64 interval) { - if (!interval) { - return 0.f; - } - return static_cast(talk_base::kNumNanosecsPerSec) / - static_cast(interval); - } - - bool operator==(const VideoFormat& format) const { - return width == format.width && height == format.height && - interval == format.interval && fourcc == format.fourcc; - } - - bool operator!=(const VideoFormat& format) const { - return !(*this == format); - } - - bool operator<(const VideoFormat& format) const { - return (fourcc < format.fourcc) || - (fourcc == format.fourcc && width < format.width) || - (fourcc == format.fourcc && width == format.width && - height < format.height) || - (fourcc == format.fourcc && width == format.width && - height == format.height && interval > format.interval); - } - - int framerate() const { return IntervalToFps(interval); } - - // Check if both width and height are 0. - bool IsSize0x0() const { return 0 == width && 0 == height; } - - // Check if this format is less than another one by comparing the resolution - // and frame rate. - bool IsPixelRateLess(const VideoFormat& format) const { - return width * height * framerate() < - format.width * format.height * format.framerate(); - } - - // Get a string presentation in the form of "fourcc width x height x fps" - std::string ToString() const; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_VIDEOCOMMON_H_ // NOLINT diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/videoengine_unittest.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/videoengine_unittest.h deleted file mode 100755 index 856966b..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/videoengine_unittest.h +++ /dev/null @@ -1,1834 +0,0 @@ -// libjingle -// Copyright 2004 Google Inc. All rights reserved. -// -// 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_VIDEOENGINE_UNITTEST_H_ // NOLINT -#define TALK_MEDIA_BASE_VIDEOENGINE_UNITTEST_H_ - -#include -#include - -#include "talk/base/bytebuffer.h" -#include "talk/base/gunit.h" -#include "talk/base/timeutils.h" -#include "talk/media/base/fakenetworkinterface.h" -#include "talk/media/base/fakevideocapturer.h" -#include "talk/media/base/fakevideorenderer.h" -#include "talk/media/base/mediachannel.h" -#include "talk/media/base/streamparams.h" - -#ifdef WIN32 -#include // NOLINT -#endif - -#define EXPECT_FRAME_WAIT(c, w, h, t) \ - EXPECT_EQ_WAIT((c), renderer_.num_rendered_frames(), (t)); \ - EXPECT_EQ((w), renderer_.width()); \ - EXPECT_EQ((h), renderer_.height()); \ - EXPECT_EQ(0, renderer_.errors()); \ - -#define EXPECT_FRAME_ON_RENDERER_WAIT(r, c, w, h, t) \ - EXPECT_EQ_WAIT((c), (r).num_rendered_frames(), (t)); \ - EXPECT_EQ((w), (r).width()); \ - EXPECT_EQ((h), (r).height()); \ - EXPECT_EQ(0, (r).errors()); \ - -#define EXPECT_GT_FRAME_ON_RENDERER_WAIT(r, c, w, h, t) \ - EXPECT_TRUE_WAIT((r).num_rendered_frames() >= (c) && \ - (w) == (r).width() && \ - (h) == (r).height(), (t)); \ - EXPECT_EQ(0, (r).errors()); \ - -static const uint32 kTimeout = 5000U; -static const uint32 kSsrc = 1234u; -static const uint32 kRtxSsrc = 4321u; -static const uint32 kSsrcs4[] = {1, 2, 3, 4}; - -inline bool IsEqualRes(const cricket::VideoCodec& a, int w, int h, int fps) { - return a.width == w && a.height == h && a.framerate == fps; -} - -inline bool IsEqualCodec(const cricket::VideoCodec& a, - const cricket::VideoCodec& b) { - return a.id == b.id && a.name == b.name && - IsEqualRes(a, b.width, b.height, b.framerate); -} - -namespace std { -inline std::ostream& operator<<(std::ostream& s, const cricket::VideoCodec& c) { - s << "{" << c.name << "(" << c.id << "), " - << c.width << "x" << c.height << "x" << c.framerate << "}"; - return s; -} -} // namespace std - -inline int TimeBetweenSend(const cricket::VideoCodec& codec) { - return static_cast( - cricket::VideoFormat::FpsToInterval(codec.framerate) / - talk_base::kNumNanosecsPerMillisec); -} - -// Fake video engine that makes it possible to test enabling and disabling -// capturer (checking that the engine state is updated and that the capturer -// is indeed capturing) without having to create a channel. It also makes it -// possible to test that the media processors are indeed being called when -// registered. -template -class VideoEngineOverride : public T { - public: - VideoEngineOverride() { - } - virtual ~VideoEngineOverride() { - } - bool is_camera_on() const { return T::GetVideoCapturer()->IsRunning(); } - void set_has_senders(bool has_senders) { - cricket::VideoCapturer* video_capturer = T::GetVideoCapturer(); - if (has_senders) { - video_capturer->SignalVideoFrame.connect(this, - &VideoEngineOverride::OnLocalFrame); - } else { - video_capturer->SignalVideoFrame.disconnect(this); - } - } - void OnLocalFrame(cricket::VideoCapturer*, - const cricket::VideoFrame*) { - } - void OnLocalFrameFormat(cricket::VideoCapturer*, - const cricket::VideoFormat*) { - } - - void TriggerMediaFrame( - uint32 ssrc, cricket::VideoFrame* frame, bool* drop_frame) { - T::SignalMediaFrame(ssrc, frame, drop_frame); - } -}; - -// Macroes that declare test functions for a given test class, before and after -// Init(). -// To use, define a test function called FooBody and pass Foo to the macro. -#define TEST_PRE_VIDEOENGINE_INIT(TestClass, func) \ - TEST_F(TestClass, func##PreInit) { \ - func##Body(); \ - } -#define TEST_POST_VIDEOENGINE_INIT(TestClass, func) \ - TEST_F(TestClass, func##PostInit) { \ - EXPECT_TRUE(engine_.Init(talk_base::Thread::Current())); \ - func##Body(); \ - engine_.Terminate(); \ - } - -template -class VideoEngineTest : public testing::Test { - protected: - // Tests starting and stopping the engine, and creating a channel. - void StartupShutdown() { - EXPECT_TRUE(engine_.Init(talk_base::Thread::Current())); - cricket::VideoMediaChannel* channel = engine_.CreateChannel(NULL); - EXPECT_TRUE(channel != NULL); - delete channel; - engine_.Terminate(); - } - -#ifdef WIN32 - // Tests that the COM reference count is not munged by the engine. - // Test to make sure LMI does not munge the CoInitialize reference count. - void CheckCoInitialize() { - // Initial refcount should be 0. - EXPECT_EQ(S_OK, CoInitializeEx(NULL, COINIT_MULTITHREADED)); - - // Engine should start even with COM already inited. - EXPECT_TRUE(engine_.Init(talk_base::Thread::Current())); - engine_.Terminate(); - // Refcount after terminate should be 1; this tests if it is nonzero. - EXPECT_EQ(S_FALSE, CoInitializeEx(NULL, COINIT_MULTITHREADED)); - // Decrement refcount to (hopefully) 0. - CoUninitialize(); - CoUninitialize(); - - // Ensure refcount is 0. - EXPECT_EQ(S_OK, CoInitializeEx(NULL, COINIT_MULTITHREADED)); - CoUninitialize(); - } -#endif - - void ConstrainNewCodecBody() { - cricket::VideoCodec empty, in, out; - cricket::VideoCodec max_settings(engine_.codecs()[0].id, - engine_.codecs()[0].name, - 1280, 800, 30, 0); - - // set max settings of 1280x960x30 - EXPECT_TRUE(engine_.SetDefaultEncoderConfig( - cricket::VideoEncoderConfig(max_settings))); - - // don't constrain the max resolution - in = max_settings; - EXPECT_TRUE(engine_.CanSendCodec(in, empty, &out)); - EXPECT_PRED2(IsEqualCodec, out, in); - - // constrain resolution greater than the max and wider aspect, - // picking best aspect (16:10) - in.width = 1380; - in.height = 800; - EXPECT_TRUE(engine_.CanSendCodec(in, empty, &out)); - EXPECT_PRED4(IsEqualRes, out, 1280, 720, 30); - - // constrain resolution greater than the max and narrow aspect, - // picking best aspect (16:9) - in.width = 1280; - in.height = 740; - EXPECT_TRUE(engine_.CanSendCodec(in, empty, &out)); - EXPECT_PRED4(IsEqualRes, out, 1280, 720, 30); - - // constrain resolution greater than the max, picking equal aspect (4:3) - in.width = 1280; - in.height = 960; - EXPECT_TRUE(engine_.CanSendCodec(in, empty, &out)); - EXPECT_PRED4(IsEqualRes, out, 1280, 800, 30); - - // constrain resolution greater than the max, picking equal aspect (16:10) - in.width = 1280; - in.height = 800; - EXPECT_TRUE(engine_.CanSendCodec(in, empty, &out)); - EXPECT_PRED4(IsEqualRes, out, 1280, 800, 30); - - // reduce max settings to 640x480x30 - max_settings.width = 640; - max_settings.height = 480; - EXPECT_TRUE(engine_.SetDefaultEncoderConfig( - cricket::VideoEncoderConfig(max_settings))); - - // don't constrain the max resolution - in = max_settings; - in.width = 640; - in.height = 480; - EXPECT_TRUE(engine_.CanSendCodec(in, empty, &out)); - EXPECT_PRED2(IsEqualCodec, out, in); - - // keep 16:10 if they request it - in.height = 400; - EXPECT_TRUE(engine_.CanSendCodec(in, empty, &out)); - EXPECT_PRED2(IsEqualCodec, out, in); - - // don't constrain lesser 4:3 resolutions - in.width = 320; - in.height = 240; - EXPECT_TRUE(engine_.CanSendCodec(in, empty, &out)); - EXPECT_PRED2(IsEqualCodec, out, in); - - // don't constrain lesser 16:10 resolutions - in.width = 320; - in.height = 200; - EXPECT_TRUE(engine_.CanSendCodec(in, empty, &out)); - EXPECT_PRED2(IsEqualCodec, out, in); - - // requested resolution of 0x0 succeeds - in.width = 0; - in.height = 0; - EXPECT_TRUE(engine_.CanSendCodec(in, empty, &out)); - EXPECT_PRED2(IsEqualCodec, out, in); - - // constrain resolution lesser than the max and wider aspect, - // picking best aspect (16:9) - in.width = 350; - in.height = 201; - EXPECT_TRUE(engine_.CanSendCodec(in, empty, &out)); - EXPECT_PRED4(IsEqualRes, out, 320, 180, 30); - - // constrain resolution greater than the max and narrow aspect, - // picking best aspect (4:3) - in.width = 350; - in.height = 300; - EXPECT_TRUE(engine_.CanSendCodec(in, empty, &out)); - EXPECT_PRED4(IsEqualRes, out, 320, 240, 30); - - // constrain resolution greater than the max and wider aspect, - // picking best aspect (16:9) - in.width = 1380; - in.height = 800; - EXPECT_TRUE(engine_.CanSendCodec(in, empty, &out)); - EXPECT_PRED4(IsEqualRes, out, 640, 360, 30); - - // constrain resolution greater than the max and narrow aspect, - // picking best aspect (4:3) - in.width = 1280; - in.height = 900; - EXPECT_TRUE(engine_.CanSendCodec(in, empty, &out)); - EXPECT_PRED4(IsEqualRes, out, 640, 480, 30); - - // constrain resolution greater than the max, picking equal aspect (4:3) - in.width = 1280; - in.height = 960; - EXPECT_TRUE(engine_.CanSendCodec(in, empty, &out)); - EXPECT_PRED4(IsEqualRes, out, 640, 480, 30); - - // constrain resolution greater than the max, picking equal aspect (16:10) - in.width = 1280; - in.height = 800; - EXPECT_TRUE(engine_.CanSendCodec(in, empty, &out)); - EXPECT_PRED4(IsEqualRes, out, 640, 400, 30); - - // constrain res & fps greater than the max - in.framerate = 50; - EXPECT_TRUE(engine_.CanSendCodec(in, empty, &out)); - EXPECT_PRED4(IsEqualRes, out, 640, 400, 30); - - // reduce max settings to 160x100x10 - max_settings.width = 160; - max_settings.height = 100; - max_settings.framerate = 10; - EXPECT_TRUE(engine_.SetDefaultEncoderConfig( - cricket::VideoEncoderConfig(max_settings))); - - // constrain res & fps to new max - EXPECT_TRUE(engine_.CanSendCodec(in, empty, &out)); - EXPECT_PRED4(IsEqualRes, out, 160, 100, 10); - - // allow 4:3 "comparable" resolutions - in.width = 160; - in.height = 120; - in.framerate = 10; - EXPECT_TRUE(engine_.CanSendCodec(in, empty, &out)); - EXPECT_PRED4(IsEqualRes, out, 160, 120, 10); - } - - void ConstrainRunningCodecBody() { - cricket::VideoCodec in, out, current; - cricket::VideoCodec max_settings(engine_.codecs()[0].id, - engine_.codecs()[0].name, - 1280, 800, 30, 0); - - // set max settings of 1280x960x30 - EXPECT_TRUE(engine_.SetDefaultEncoderConfig( - cricket::VideoEncoderConfig(max_settings))); - - // establish current call at 1280x800x30 (16:10) - current = max_settings; - current.height = 800; - - // Don't constrain current resolution - in = current; - EXPECT_TRUE(engine_.CanSendCodec(in, current, &out)); - EXPECT_PRED2(IsEqualCodec, out, in); - - // requested resolution of 0x0 succeeds - in.width = 0; - in.height = 0; - EXPECT_TRUE(engine_.CanSendCodec(in, current, &out)); - EXPECT_PRED2(IsEqualCodec, out, in); - - // Reduce an intermediate resolution down to the next lowest one, preserving - // aspect ratio. - in.width = 800; - in.height = 600; - EXPECT_TRUE(engine_.CanSendCodec(in, current, &out)); - EXPECT_PRED4(IsEqualRes, out, 640, 400, 30); - - // Clamping by aspect ratio, but still never return a dimension higher than - // requested. - in.width = 1280; - in.height = 720; - EXPECT_TRUE(engine_.CanSendCodec(in, current, &out)); - EXPECT_PRED4(IsEqualRes, out, 1280, 720, 30); - - in.width = 1279; - EXPECT_TRUE(engine_.CanSendCodec(in, current, &out)); - EXPECT_PRED4(IsEqualRes, out, 960, 600, 30); - - in.width = 1281; - EXPECT_TRUE(engine_.CanSendCodec(in, current, &out)); - EXPECT_PRED4(IsEqualRes, out, 1280, 720, 30); - - // Clamp large resolutions down, always preserving aspect - in.width = 1920; - in.height = 1080; - EXPECT_TRUE(engine_.CanSendCodec(in, current, &out)); - EXPECT_PRED4(IsEqualRes, out, 1280, 800, 30); - - in.width = 1921; - EXPECT_TRUE(engine_.CanSendCodec(in, current, &out)); - EXPECT_PRED4(IsEqualRes, out, 1280, 800, 30); - - in.width = 1919; - EXPECT_TRUE(engine_.CanSendCodec(in, current, &out)); - EXPECT_PRED4(IsEqualRes, out, 1280, 800, 30); - - // reduce max settings to 640x480x30 - max_settings.width = 640; - max_settings.height = 480; - EXPECT_TRUE(engine_.SetDefaultEncoderConfig( - cricket::VideoEncoderConfig(max_settings))); - - // establish current call at 640x400x30 (16:10) - current = max_settings; - current.height = 400; - - // Don't constrain current resolution - in = current; - EXPECT_TRUE(engine_.CanSendCodec(in, current, &out)); - EXPECT_PRED2(IsEqualCodec, out, in); - - // requested resolution of 0x0 succeeds - in.width = 0; - in.height = 0; - EXPECT_TRUE(engine_.CanSendCodec(in, current, &out)); - EXPECT_PRED2(IsEqualCodec, out, in); - - // Reduce an intermediate resolution down to the next lowest one, preserving - // aspect ratio. - in.width = 400; - in.height = 300; - EXPECT_TRUE(engine_.CanSendCodec(in, current, &out)); - EXPECT_PRED4(IsEqualRes, out, 320, 200, 30); - - // Clamping by aspect ratio, but still never return a dimension higher than - // requested. - in.width = 640; - in.height = 360; - EXPECT_TRUE(engine_.CanSendCodec(in, current, &out)); - EXPECT_PRED4(IsEqualRes, out, 640, 360, 30); - - in.width = 639; - EXPECT_TRUE(engine_.CanSendCodec(in, current, &out)); - EXPECT_PRED4(IsEqualRes, out, 480, 300, 30); - - in.width = 641; - EXPECT_TRUE(engine_.CanSendCodec(in, current, &out)); - EXPECT_PRED4(IsEqualRes, out, 640, 360, 30); - - // Clamp large resolutions down, always preserving aspect - in.width = 1280; - in.height = 800; - EXPECT_TRUE(engine_.CanSendCodec(in, current, &out)); - EXPECT_PRED4(IsEqualRes, out, 640, 400, 30); - - in.width = 1281; - EXPECT_TRUE(engine_.CanSendCodec(in, current, &out)); - EXPECT_PRED4(IsEqualRes, out, 640, 400, 30); - - in.width = 1279; - EXPECT_TRUE(engine_.CanSendCodec(in, current, &out)); - EXPECT_PRED4(IsEqualRes, out, 640, 400, 30); - - // Should fail for any that are smaller than our supported formats - in.width = 80; - in.height = 80; - EXPECT_FALSE(engine_.CanSendCodec(in, current, &out)); - - in.height = 50; - EXPECT_FALSE(engine_.CanSendCodec(in, current, &out)); - } - - VideoEngineOverride engine_; - talk_base::scoped_ptr video_capturer_; -}; - -template -class VideoMediaChannelTest : public testing::Test, - public sigslot::has_slots<> { - protected: - virtual cricket::VideoCodec DefaultCodec() = 0; - - virtual cricket::StreamParams DefaultSendStreamParams() { - return cricket::StreamParams::CreateLegacy(kSsrc); - } - - virtual void SetUp() { - cricket::Device device("test", "device"); - EXPECT_TRUE(engine_.Init(talk_base::Thread::Current())); - channel_.reset(engine_.CreateChannel(NULL)); - EXPECT_TRUE(channel_.get() != NULL); - ConnectVideoChannelError(); - network_interface_.SetDestination(channel_.get()); - channel_->SetInterface(&network_interface_); - SetRendererAsDefault(); - media_error_ = cricket::VideoMediaChannel::ERROR_NONE; - channel_->SetRecvCodecs(engine_.codecs()); - EXPECT_TRUE(channel_->AddSendStream(DefaultSendStreamParams())); - - video_capturer_.reset(new cricket::FakeVideoCapturer); - cricket::VideoFormat format(640, 480, - cricket::VideoFormat::FpsToInterval(30), - cricket::FOURCC_I420); - EXPECT_EQ(cricket::CS_RUNNING, video_capturer_->Start(format)); - EXPECT_TRUE(channel_->SetCapturer(kSsrc, video_capturer_.get())); - } - // Utility method to setup an additional stream to send and receive video. - // Used to test send and recv between two streams. - void SetUpSecondStream() { - SetUpSecondStreamWithNoRecv(); - // Setup recv for second stream. - EXPECT_TRUE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(kSsrc + 2))); - // Make the second renderer available for use by a new stream. - EXPECT_TRUE(channel_->SetRenderer(kSsrc + 2, &renderer2_)); - } - // Setup an additional stream just to send video. Defer add recv stream. - // This is required if you want to test unsignalled recv of video rtp packets. - void SetUpSecondStreamWithNoRecv() { - // SetUp() already added kSsrc make sure duplicate SSRCs cant be added. - EXPECT_TRUE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(kSsrc))); - EXPECT_FALSE(channel_->AddSendStream( - cricket::StreamParams::CreateLegacy(kSsrc))); - EXPECT_TRUE(channel_->AddSendStream( - cricket::StreamParams::CreateLegacy(kSsrc + 2))); - // We dont add recv for the second stream. - - // Setup the receive and renderer for second stream after send. - video_capturer_2_.reset(new cricket::FakeVideoCapturer()); - cricket::VideoFormat format(640, 480, - cricket::VideoFormat::FpsToInterval(30), - cricket::FOURCC_I420); - EXPECT_EQ(cricket::CS_RUNNING, video_capturer_2_->Start(format)); - - EXPECT_TRUE(channel_->SetCapturer(kSsrc + 2, video_capturer_2_.get())); - } - virtual void TearDown() { - channel_.reset(); - engine_.Terminate(); - } - void ConnectVideoChannelError() { - channel_->SignalMediaError.connect(this, - &VideoMediaChannelTest::OnVideoChannelError); - } - bool SetDefaultCodec() { - return SetOneCodec(DefaultCodec()); - } - void SetRendererAsDefault() { - EXPECT_TRUE(channel_->SetRenderer(0, &renderer_)); - } - - bool SetOneCodec(int pt, const char* name, int w, int h, int fr) { - return SetOneCodec(cricket::VideoCodec(pt, name, w, h, fr, 0)); - } - bool SetOneCodec(const cricket::VideoCodec& codec) { - std::vector codecs; - codecs.push_back(codec); - - cricket::VideoFormat capture_format(codec.width, codec.height, - cricket::VideoFormat::FpsToInterval(codec.framerate), - cricket::FOURCC_I420); - - if (video_capturer_) { - EXPECT_EQ(cricket::CS_RUNNING, video_capturer_->Start(capture_format)); - } - if (video_capturer_2_) { - EXPECT_EQ(cricket::CS_RUNNING, video_capturer_2_->Start(capture_format)); - } - - bool sending = channel_->sending(); - bool success = SetSend(false); - if (success) - success = channel_->SetSendCodecs(codecs); - if (success) - success = SetSend(sending); - return success; - } - bool SetSend(bool send) { - return channel_->SetSend(send); - } - bool SetSendStreamFormat(uint32 ssrc, const cricket::VideoCodec& codec) { - return channel_->SetSendStreamFormat(ssrc, cricket::VideoFormat( - codec.width, codec.height, - cricket::VideoFormat::FpsToInterval(codec.framerate), - cricket::FOURCC_ANY)); - } - int DrainOutgoingPackets() { - int packets = 0; - do { - packets = NumRtpPackets(); - // 100 ms should be long enough. - talk_base::Thread::Current()->ProcessMessages(100); - } while (NumRtpPackets() > packets); - return NumRtpPackets(); - } - bool SendFrame() { - if (video_capturer_2_) { - video_capturer_2_->CaptureFrame(); - } - return video_capturer_.get() && - video_capturer_->CaptureFrame(); - } - bool WaitAndSendFrame(int wait_ms) { - bool ret = talk_base::Thread::Current()->ProcessMessages(wait_ms); - ret &= SendFrame(); - return ret; - } - // Sends frames and waits for the decoder to be fully initialized. - // Returns the number of frames that were sent. - int WaitForDecoder() { -#if defined(HAVE_OPENMAX) - // Send enough frames for the OpenMAX decoder to continue processing, and - // return the number of frames sent. - // Send frames for a full kTimeout's worth of 15fps video. - int frame_count = 0; - while (frame_count < static_cast(kTimeout) / 66) { - EXPECT_TRUE(WaitAndSendFrame(66)); - ++frame_count; - } - return frame_count; -#else - return 0; -#endif - } - bool SendCustomVideoFrame(int w, int h) { - if (!video_capturer_.get()) return false; - return video_capturer_->CaptureCustomFrame(w, h, cricket::FOURCC_I420); - } - int NumRtpBytes() { - return network_interface_.NumRtpBytes(); - } - int NumRtpBytes(uint32 ssrc) { - return network_interface_.NumRtpBytes(ssrc); - } - int NumRtpPackets() { - return network_interface_.NumRtpPackets(); - } - int NumRtpPackets(uint32 ssrc) { - return network_interface_.NumRtpPackets(ssrc); - } - int NumSentSsrcs() { - return network_interface_.NumSentSsrcs(); - } - const talk_base::Buffer* GetRtpPacket(int index) { - return network_interface_.GetRtpPacket(index); - } - int NumRtcpPackets() { - return network_interface_.NumRtcpPackets(); - } - const talk_base::Buffer* GetRtcpPacket(int index) { - return network_interface_.GetRtcpPacket(index); - } - static int GetPayloadType(const talk_base::Buffer* p) { - int pt = -1; - ParseRtpPacket(p, NULL, &pt, NULL, NULL, NULL, NULL); - return pt; - } - static bool ParseRtpPacket(const talk_base::Buffer* p, bool* x, int* pt, - int* seqnum, uint32* tstamp, uint32* ssrc, - std::string* payload) { - talk_base::ByteBuffer buf(p->data(), p->length()); - uint8 u08 = 0; - uint16 u16 = 0; - uint32 u32 = 0; - - // Read X and CC fields. - if (!buf.ReadUInt8(&u08)) return false; - bool extension = ((u08 & 0x10) != 0); - uint8 cc = (u08 & 0x0F); - if (x) *x = extension; - - // Read PT field. - if (!buf.ReadUInt8(&u08)) return false; - if (pt) *pt = (u08 & 0x7F); - - // Read Sequence Number field. - if (!buf.ReadUInt16(&u16)) return false; - if (seqnum) *seqnum = u16; - - // Read Timestamp field. - if (!buf.ReadUInt32(&u32)) return false; - if (tstamp) *tstamp = u32; - - // Read SSRC field. - if (!buf.ReadUInt32(&u32)) return false; - if (ssrc) *ssrc = u32; - - // Skip CSRCs. - for (uint8 i = 0; i < cc; ++i) { - if (!buf.ReadUInt32(&u32)) return false; - } - - // Skip extension header. - if (extension) { - // Read Profile-specific extension header ID - if (!buf.ReadUInt16(&u16)) return false; - - // Read Extension header length - if (!buf.ReadUInt16(&u16)) return false; - uint16 ext_header_len = u16; - - // Read Extension header - for (uint16 i = 0; i < ext_header_len; ++i) { - if (!buf.ReadUInt32(&u32)) return false; - } - } - - if (payload) { - return buf.ReadString(payload, buf.Length()); - } - return true; - } - - // Parse all RTCP packet, from start_index to stop_index, and count how many - // FIR (PT=206 and FMT=4 according to RFC 5104). If successful, set the count - // and return true. - bool CountRtcpFir(int start_index, int stop_index, int* fir_count) { - int count = 0; - for (int i = start_index; i < stop_index; ++i) { - talk_base::scoped_ptr p(GetRtcpPacket(i)); - talk_base::ByteBuffer buf(p->data(), p->length()); - size_t total_len = 0; - // The packet may be a compound RTCP packet. - while (total_len < p->length()) { - // Read FMT, type and length. - uint8 fmt = 0; - uint8 type = 0; - uint16 length = 0; - if (!buf.ReadUInt8(&fmt)) return false; - fmt &= 0x1F; - if (!buf.ReadUInt8(&type)) return false; - if (!buf.ReadUInt16(&length)) return false; - buf.Consume(length * 4); // Skip RTCP data. - total_len += (length + 1) * 4; - if ((192 == type) || ((206 == type) && (4 == fmt))) { - ++count; - } - } - } - - if (fir_count) { - *fir_count = count; - } - return true; - } - - void OnVideoChannelError(uint32 ssrc, - cricket::VideoMediaChannel::Error error) { - media_error_ = error; - } - - // Test that SetSend works. - void SetSend() { - EXPECT_FALSE(channel_->sending()); - EXPECT_TRUE(channel_->SetCapturer(kSsrc, video_capturer_.get())); - EXPECT_TRUE(SetOneCodec(DefaultCodec())); - EXPECT_FALSE(channel_->sending()); - EXPECT_TRUE(SetSend(true)); - EXPECT_TRUE(channel_->sending()); - EXPECT_TRUE(SendFrame()); - EXPECT_TRUE_WAIT(NumRtpPackets() > 0, kTimeout); - EXPECT_TRUE(SetSend(false)); - EXPECT_FALSE(channel_->sending()); - } - // Test that SetSend fails without codecs being set. - void SetSendWithoutCodecs() { - EXPECT_FALSE(channel_->sending()); - EXPECT_FALSE(SetSend(true)); - EXPECT_FALSE(channel_->sending()); - } - // Test that we properly set the send and recv buffer sizes by the time - // SetSend is called. - void SetSendSetsTransportBufferSizes() { - EXPECT_TRUE(SetOneCodec(DefaultCodec())); - EXPECT_TRUE(SetSend(true)); - // TODO(sriniv): Remove or re-enable this. - // As part of b/8030474, send-buffer is size now controlled through - // portallocator flags. Its not set by channels. - // EXPECT_EQ(64 * 1024, network_interface_.sendbuf_size()); - EXPECT_EQ(64 * 1024, network_interface_.recvbuf_size()); - } - // Tests that we can send frames and the right payload type is used. - void Send(const cricket::VideoCodec& codec) { - EXPECT_TRUE(SetOneCodec(codec)); - EXPECT_TRUE(SetSend(true)); - EXPECT_TRUE(SendFrame()); - EXPECT_TRUE_WAIT(NumRtpPackets() > 0, kTimeout); - talk_base::scoped_ptr p(GetRtpPacket(0)); - EXPECT_EQ(codec.id, GetPayloadType(p.get())); - } - // Tests that we can send and receive frames. - void SendAndReceive(const cricket::VideoCodec& codec) { - EXPECT_TRUE(SetOneCodec(codec)); - EXPECT_TRUE(SetSend(true)); - EXPECT_TRUE(channel_->SetRender(true)); - EXPECT_EQ(0, renderer_.num_rendered_frames()); - EXPECT_TRUE(SendFrame()); - EXPECT_FRAME_WAIT(1, codec.width, codec.height, kTimeout); - talk_base::scoped_ptr p(GetRtpPacket(0)); - EXPECT_EQ(codec.id, GetPayloadType(p.get())); - } - // Tests that we only get a VideoRenderer::SetSize() callback when needed. - void SendManyResizeOnce() { - cricket::VideoCodec codec(DefaultCodec()); - EXPECT_TRUE(SetOneCodec(codec)); - EXPECT_TRUE(SetSend(true)); - EXPECT_TRUE(channel_->SetRender(true)); - EXPECT_EQ(0, renderer_.num_rendered_frames()); - EXPECT_TRUE(WaitAndSendFrame(30)); - EXPECT_FRAME_WAIT(1, codec.width, codec.height, kTimeout); - EXPECT_TRUE(WaitAndSendFrame(30)); - EXPECT_FRAME_WAIT(2, codec.width, codec.height, kTimeout); - talk_base::scoped_ptr p(GetRtpPacket(0)); - EXPECT_EQ(codec.id, GetPayloadType(p.get())); - EXPECT_EQ(1, renderer_.num_set_sizes()); - - codec.width /= 2; - codec.height /= 2; - EXPECT_TRUE(SetOneCodec(codec)); - EXPECT_TRUE(WaitAndSendFrame(30)); - EXPECT_FRAME_WAIT(3, codec.width, codec.height, kTimeout); - EXPECT_EQ(2, renderer_.num_set_sizes()); - } - // Test that stats work properly for a 1-1 call. - void GetStats() { - SendAndReceive(DefaultCodec()); - cricket::VideoMediaInfo info; - EXPECT_TRUE(channel_->GetStats(cricket::StatsOptions(), &info)); - - ASSERT_EQ(1U, info.senders.size()); - // TODO(whyuan): bytes_sent and bytes_rcvd are different. Are both payload? - EXPECT_GT(info.senders[0].bytes_sent, 0); - EXPECT_EQ(NumRtpPackets(), info.senders[0].packets_sent); - EXPECT_EQ(0.0, info.senders[0].fraction_lost); - EXPECT_EQ(0, info.senders[0].firs_rcvd); - EXPECT_EQ(0, info.senders[0].plis_rcvd); - EXPECT_EQ(0, info.senders[0].nacks_rcvd); - EXPECT_EQ(DefaultCodec().width, info.senders[0].send_frame_width); - EXPECT_EQ(DefaultCodec().height, info.senders[0].send_frame_height); - EXPECT_GT(info.senders[0].framerate_input, 0); - EXPECT_GT(info.senders[0].framerate_sent, 0); - - ASSERT_EQ(1U, info.receivers.size()); - EXPECT_EQ(1U, info.senders[0].ssrcs().size()); - EXPECT_EQ(1U, info.receivers[0].ssrcs().size()); - EXPECT_EQ(info.senders[0].ssrcs()[0], info.receivers[0].ssrcs()[0]); - EXPECT_EQ(NumRtpBytes(), info.receivers[0].bytes_rcvd); - EXPECT_EQ(NumRtpPackets(), info.receivers[0].packets_rcvd); - EXPECT_EQ(0.0, info.receivers[0].fraction_lost); - EXPECT_EQ(0, info.receivers[0].packets_lost); - EXPECT_EQ(0, info.receivers[0].packets_concealed); - EXPECT_EQ(0, info.receivers[0].firs_sent); - EXPECT_EQ(0, info.receivers[0].plis_sent); - EXPECT_EQ(0, info.receivers[0].nacks_sent); - EXPECT_EQ(DefaultCodec().width, info.receivers[0].frame_width); - EXPECT_EQ(DefaultCodec().height, info.receivers[0].frame_height); - EXPECT_GT(info.receivers[0].framerate_rcvd, 0); - EXPECT_GT(info.receivers[0].framerate_decoded, 0); - EXPECT_GT(info.receivers[0].framerate_output, 0); - } - // Test that stats work properly for a conf call with multiple recv streams. - void GetStatsMultipleRecvStreams() { - cricket::FakeVideoRenderer renderer1, renderer2; - EXPECT_TRUE(SetOneCodec(DefaultCodec())); - cricket::VideoOptions vmo; - vmo.conference_mode.Set(true); - EXPECT_TRUE(channel_->SetOptions(vmo)); - EXPECT_TRUE(SetSend(true)); - EXPECT_TRUE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(1))); - EXPECT_TRUE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(2))); - EXPECT_TRUE(channel_->SetRenderer(1, &renderer1)); - EXPECT_TRUE(channel_->SetRenderer(2, &renderer2)); - EXPECT_TRUE(channel_->SetRender(true)); - EXPECT_EQ(0, renderer1.num_rendered_frames()); - EXPECT_EQ(0, renderer2.num_rendered_frames()); - std::vector ssrcs; - ssrcs.push_back(1); - ssrcs.push_back(2); - network_interface_.SetConferenceMode(true, ssrcs); - EXPECT_TRUE(SendFrame()); - EXPECT_FRAME_ON_RENDERER_WAIT( - renderer1, 1, DefaultCodec().width, DefaultCodec().height, kTimeout); - EXPECT_FRAME_ON_RENDERER_WAIT( - renderer2, 1, DefaultCodec().width, DefaultCodec().height, kTimeout); - cricket::VideoMediaInfo info; - EXPECT_TRUE(channel_->GetStats(cricket::StatsOptions(), &info)); - - ASSERT_EQ(1U, info.senders.size()); - // TODO(whyuan): bytes_sent and bytes_rcvd are different. Are both payload? - EXPECT_GT(info.senders[0].bytes_sent, 0); - EXPECT_EQ(NumRtpPackets(), info.senders[0].packets_sent); - EXPECT_EQ(0.0, info.senders[0].fraction_lost); - EXPECT_EQ(0, info.senders[0].firs_rcvd); - EXPECT_EQ(0, info.senders[0].plis_rcvd); - EXPECT_EQ(0, info.senders[0].nacks_rcvd); - EXPECT_EQ(DefaultCodec().width, info.senders[0].send_frame_width); - EXPECT_EQ(DefaultCodec().height, info.senders[0].send_frame_height); - EXPECT_GT(info.senders[0].framerate_input, 0); - EXPECT_GT(info.senders[0].framerate_sent, 0); - - ASSERT_EQ(2U, info.receivers.size()); - for (size_t i = 0; i < info.receivers.size(); ++i) { - EXPECT_EQ(1U, info.receivers[i].ssrcs().size()); - EXPECT_EQ(i + 1, info.receivers[i].ssrcs()[0]); - EXPECT_EQ(NumRtpBytes(), info.receivers[i].bytes_rcvd); - EXPECT_EQ(NumRtpPackets(), info.receivers[i].packets_rcvd); - EXPECT_EQ(0.0, info.receivers[i].fraction_lost); - EXPECT_EQ(0, info.receivers[i].packets_lost); - EXPECT_EQ(0, info.receivers[i].packets_concealed); - EXPECT_EQ(0, info.receivers[i].firs_sent); - EXPECT_EQ(0, info.receivers[i].plis_sent); - EXPECT_EQ(0, info.receivers[i].nacks_sent); - EXPECT_EQ(DefaultCodec().width, info.receivers[i].frame_width); - EXPECT_EQ(DefaultCodec().height, info.receivers[i].frame_height); - EXPECT_GT(info.receivers[i].framerate_rcvd, 0); - EXPECT_GT(info.receivers[i].framerate_decoded, 0); - EXPECT_GT(info.receivers[i].framerate_output, 0); - } - } - // Test that stats work properly for a conf call with multiple send streams. - void GetStatsMultipleSendStreams() { - // Normal setup; note that we set the SSRC explicitly to ensure that - // it will come first in the senders map. - EXPECT_TRUE(SetOneCodec(DefaultCodec())); - cricket::VideoOptions vmo; - vmo.conference_mode.Set(true); - EXPECT_TRUE(channel_->SetOptions(vmo)); - EXPECT_TRUE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(1234))); - channel_->UpdateAspectRatio(640, 400); - EXPECT_TRUE(SetSend(true)); - EXPECT_TRUE(channel_->SetRender(true)); - EXPECT_TRUE(SendFrame()); - EXPECT_TRUE_WAIT(NumRtpPackets() > 0, kTimeout); - EXPECT_FRAME_WAIT(1, DefaultCodec().width, DefaultCodec().height, kTimeout); - - // Add an additional capturer, and hook up a renderer to receive it. - cricket::FakeVideoRenderer renderer1; - talk_base::scoped_ptr capturer( - new cricket::FakeVideoCapturer); - capturer->SetScreencast(true); - const int kTestWidth = 160; - const int kTestHeight = 120; - cricket::VideoFormat format(kTestWidth, kTestHeight, - cricket::VideoFormat::FpsToInterval(5), - cricket::FOURCC_I420); - EXPECT_EQ(cricket::CS_RUNNING, capturer->Start(format)); - EXPECT_TRUE(channel_->AddSendStream( - cricket::StreamParams::CreateLegacy(5678))); - EXPECT_TRUE(channel_->SetCapturer(5678, capturer.get())); - EXPECT_TRUE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(5678))); - EXPECT_TRUE(channel_->SetRenderer(5678, &renderer1)); - EXPECT_TRUE(capturer->CaptureCustomFrame( - kTestWidth, kTestHeight, cricket::FOURCC_I420)); - EXPECT_FRAME_ON_RENDERER_WAIT( - renderer1, 1, kTestWidth, kTestHeight, kTimeout); - - // Get stats, and make sure they are correct for two senders. - cricket::VideoMediaInfo info; - EXPECT_TRUE(channel_->GetStats(cricket::StatsOptions(), &info)); - ASSERT_EQ(2U, info.senders.size()); - EXPECT_EQ(NumRtpPackets(), - info.senders[0].packets_sent + info.senders[1].packets_sent); - EXPECT_EQ(1U, info.senders[0].ssrcs().size()); - EXPECT_EQ(1234U, info.senders[0].ssrcs()[0]); - EXPECT_EQ(DefaultCodec().width, info.senders[0].send_frame_width); - EXPECT_EQ(DefaultCodec().height, info.senders[0].send_frame_height); - EXPECT_EQ(1U, info.senders[1].ssrcs().size()); - EXPECT_EQ(5678U, info.senders[1].ssrcs()[0]); - EXPECT_EQ(kTestWidth, info.senders[1].send_frame_width); - EXPECT_EQ(kTestHeight, info.senders[1].send_frame_height); - // The capturer must be unregistered here as it runs out of it's scope next. - EXPECT_TRUE(channel_->SetCapturer(5678, NULL)); - } - - // Test that we can set the bandwidth. - void SetSendBandwidth() { - EXPECT_TRUE(channel_->SetStartSendBandwidth(64 * 1024)); - EXPECT_TRUE(channel_->SetMaxSendBandwidth(-1)); // <= 0 means unlimited. - EXPECT_TRUE(channel_->SetMaxSendBandwidth(128 * 1024)); - } - // Test that we can set the SSRC for the default send source. - void SetSendSsrc() { - EXPECT_TRUE(SetDefaultCodec()); - EXPECT_TRUE(SetSendStreamFormat(kSsrc, DefaultCodec())); - EXPECT_TRUE(SetSend(true)); - EXPECT_TRUE(SendFrame()); - EXPECT_TRUE_WAIT(NumRtpPackets() > 0, kTimeout); - uint32 ssrc = 0; - talk_base::scoped_ptr p(GetRtpPacket(0)); - ParseRtpPacket(p.get(), NULL, NULL, NULL, NULL, &ssrc, NULL); - EXPECT_EQ(kSsrc, ssrc); - EXPECT_EQ(NumRtpPackets(), NumRtpPackets(ssrc)); - EXPECT_EQ(NumRtpBytes(), NumRtpBytes(ssrc)); - EXPECT_EQ(1, NumSentSsrcs()); - EXPECT_EQ(0, NumRtpPackets(kSsrc - 1)); - EXPECT_EQ(0, NumRtpBytes(kSsrc - 1)); - } - // Test that we can set the SSRC even after codecs are set. - void SetSendSsrcAfterSetCodecs() { - // Remove stream added in Setup. - EXPECT_TRUE(channel_->RemoveSendStream(kSsrc)); - EXPECT_TRUE(SetDefaultCodec()); - EXPECT_TRUE(channel_->AddSendStream( - cricket::StreamParams::CreateLegacy(999))); - EXPECT_TRUE(channel_->SetCapturer(999u, video_capturer_.get())); - EXPECT_TRUE(SetSendStreamFormat(999u, DefaultCodec())); - EXPECT_TRUE(SetSend(true)); - EXPECT_TRUE(WaitAndSendFrame(0)); - EXPECT_TRUE_WAIT(NumRtpPackets() > 0, kTimeout); - uint32 ssrc = 0; - talk_base::scoped_ptr p(GetRtpPacket(0)); - ParseRtpPacket(p.get(), NULL, NULL, NULL, NULL, &ssrc, NULL); - EXPECT_EQ(999u, ssrc); - EXPECT_EQ(NumRtpPackets(), NumRtpPackets(ssrc)); - EXPECT_EQ(NumRtpBytes(), NumRtpBytes(ssrc)); - EXPECT_EQ(1, NumSentSsrcs()); - EXPECT_EQ(0, NumRtpPackets(kSsrc)); - EXPECT_EQ(0, NumRtpBytes(kSsrc)); - } - // Test that we can set the default video renderer before and after - // media is received. - void SetRenderer() { - uint8 data1[] = { - 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - }; - - talk_base::Buffer packet1(data1, sizeof(data1)); - talk_base::SetBE32(packet1.data() + 8, kSsrc); - channel_->SetRenderer(0, NULL); - EXPECT_TRUE(SetDefaultCodec()); - EXPECT_TRUE(SetSend(true)); - EXPECT_TRUE(channel_->SetRender(true)); - EXPECT_EQ(0, renderer_.num_rendered_frames()); - channel_->OnPacketReceived(&packet1, talk_base::PacketTime()); - SetRendererAsDefault(); - EXPECT_TRUE(SendFrame()); - EXPECT_FRAME_WAIT(1, DefaultCodec().width, DefaultCodec().height, kTimeout); - } - - // Tests empty StreamParams is rejected. - void RejectEmptyStreamParams() { - // Remove the send stream that was added during Setup. - EXPECT_TRUE(channel_->RemoveSendStream(kSsrc)); - - cricket::StreamParams empty; - EXPECT_FALSE(channel_->AddSendStream(empty)); - EXPECT_TRUE(channel_->AddSendStream( - cricket::StreamParams::CreateLegacy(789u))); - } - - // Tests setting up and configuring a send stream. - void AddRemoveSendStreams() { - EXPECT_TRUE(SetOneCodec(DefaultCodec())); - EXPECT_TRUE(SetSend(true)); - EXPECT_TRUE(channel_->SetRender(true)); - EXPECT_TRUE(SendFrame()); - EXPECT_FRAME_WAIT(1, DefaultCodec().width, DefaultCodec().height, kTimeout); - EXPECT_GE(2, NumRtpPackets()); - uint32 ssrc = 0; - size_t last_packet = NumRtpPackets() - 1; - talk_base::scoped_ptr - p(GetRtpPacket(static_cast(last_packet))); - ParseRtpPacket(p.get(), NULL, NULL, NULL, NULL, &ssrc, NULL); - EXPECT_EQ(kSsrc, ssrc); - - // Remove the send stream that was added during Setup. - EXPECT_TRUE(channel_->RemoveSendStream(kSsrc)); - int rtp_packets = NumRtpPackets(); - - EXPECT_TRUE(channel_->AddSendStream( - cricket::StreamParams::CreateLegacy(789u))); - EXPECT_TRUE(channel_->SetCapturer(789u, video_capturer_.get())); - EXPECT_EQ(rtp_packets, NumRtpPackets()); - // Wait 30ms to guarantee the engine does not drop the frame. - EXPECT_TRUE(WaitAndSendFrame(30)); - EXPECT_TRUE_WAIT(NumRtpPackets() > rtp_packets, kTimeout); - - last_packet = NumRtpPackets() - 1; - p.reset(GetRtpPacket(static_cast(last_packet))); - ParseRtpPacket(p.get(), NULL, NULL, NULL, NULL, &ssrc, NULL); - EXPECT_EQ(789u, ssrc); - } - - // Tests adding streams already exists returns false. - void AddRecvStreamsAlreadyExist() { - cricket::VideoOptions vmo; - vmo.conference_mode.Set(true); - EXPECT_TRUE(channel_->SetOptions(vmo)); - - EXPECT_FALSE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(0))); - - EXPECT_TRUE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(1))); - EXPECT_FALSE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(1))); - - EXPECT_TRUE(channel_->RemoveRecvStream(1)); - EXPECT_FALSE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(0))); - EXPECT_TRUE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(1))); - } - - // Tests setting up and configuring multiple incoming streams. - void AddRemoveRecvStreams() { - cricket::FakeVideoRenderer renderer1, renderer2; - cricket::VideoOptions vmo; - vmo.conference_mode.Set(true); - EXPECT_TRUE(channel_->SetOptions(vmo)); - // Ensure we can't set the renderer on a non-existent stream. - EXPECT_FALSE(channel_->SetRenderer(1, &renderer1)); - EXPECT_FALSE(channel_->SetRenderer(2, &renderer2)); - cricket::VideoRenderer* renderer; - EXPECT_FALSE(channel_->GetRenderer(1, &renderer)); - EXPECT_FALSE(channel_->GetRenderer(2, &renderer)); - - // Ensure we can add streams. - EXPECT_TRUE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(1))); - EXPECT_TRUE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(2))); - EXPECT_TRUE(channel_->GetRenderer(1, &renderer)); - // Verify the first AddRecvStream hook up to the default renderer. - EXPECT_EQ(&renderer_, renderer); - EXPECT_TRUE(channel_->GetRenderer(2, &renderer)); - EXPECT_TRUE(NULL == renderer); - - // Ensure we can now set the renderers. - EXPECT_TRUE(channel_->SetRenderer(1, &renderer1)); - EXPECT_TRUE(channel_->SetRenderer(2, &renderer2)); - EXPECT_TRUE(channel_->GetRenderer(1, &renderer)); - EXPECT_TRUE(&renderer1 == renderer); - EXPECT_TRUE(channel_->GetRenderer(2, &renderer)); - EXPECT_TRUE(&renderer2 == renderer); - - // Ensure we can change the renderers if needed. - EXPECT_TRUE(channel_->SetRenderer(1, &renderer2)); - EXPECT_TRUE(channel_->SetRenderer(2, &renderer1)); - EXPECT_TRUE(channel_->GetRenderer(1, &renderer)); - EXPECT_TRUE(&renderer2 == renderer); - EXPECT_TRUE(channel_->GetRenderer(2, &renderer)); - EXPECT_TRUE(&renderer1 == renderer); - - EXPECT_TRUE(channel_->RemoveRecvStream(2)); - EXPECT_TRUE(channel_->RemoveRecvStream(1)); - EXPECT_FALSE(channel_->GetRenderer(1, &renderer)); - EXPECT_FALSE(channel_->GetRenderer(2, &renderer)); - } - - // Tests setting up and configuring multiple incoming streams in a - // non-conference call. - void AddRemoveRecvStreamsNoConference() { - cricket::FakeVideoRenderer renderer1, renderer2; - // Ensure we can't set the renderer on a non-existent stream. - EXPECT_FALSE(channel_->SetRenderer(1, &renderer1)); - EXPECT_FALSE(channel_->SetRenderer(2, &renderer2)); - cricket::VideoRenderer* renderer; - EXPECT_FALSE(channel_->GetRenderer(1, &renderer)); - EXPECT_FALSE(channel_->GetRenderer(2, &renderer)); - - // Ensure we can add streams. - EXPECT_TRUE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(1))); - EXPECT_TRUE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(2))); - EXPECT_TRUE(channel_->GetRenderer(1, &renderer)); - // Verify the first AddRecvStream hook up to the default renderer. - EXPECT_EQ(&renderer_, renderer); - EXPECT_TRUE(channel_->GetRenderer(2, &renderer)); - EXPECT_TRUE(NULL == renderer); - - // Ensure we can now set the renderers. - EXPECT_TRUE(channel_->SetRenderer(1, &renderer1)); - EXPECT_TRUE(channel_->SetRenderer(2, &renderer2)); - EXPECT_TRUE(channel_->GetRenderer(1, &renderer)); - EXPECT_TRUE(&renderer1 == renderer); - EXPECT_TRUE(channel_->GetRenderer(2, &renderer)); - EXPECT_TRUE(&renderer2 == renderer); - - // Ensure we can change the renderers if needed. - EXPECT_TRUE(channel_->SetRenderer(1, &renderer2)); - EXPECT_TRUE(channel_->SetRenderer(2, &renderer1)); - EXPECT_TRUE(channel_->GetRenderer(1, &renderer)); - EXPECT_TRUE(&renderer2 == renderer); - EXPECT_TRUE(channel_->GetRenderer(2, &renderer)); - EXPECT_TRUE(&renderer1 == renderer); - - EXPECT_TRUE(channel_->RemoveRecvStream(2)); - EXPECT_TRUE(channel_->RemoveRecvStream(1)); - EXPECT_FALSE(channel_->GetRenderer(1, &renderer)); - EXPECT_FALSE(channel_->GetRenderer(2, &renderer)); - } - - // Test that no frames are rendered after the receive stream have been - // removed. - void AddRemoveRecvStreamAndRender() { - cricket::FakeVideoRenderer renderer1; - EXPECT_TRUE(SetDefaultCodec()); - EXPECT_TRUE(SetSend(true)); - EXPECT_TRUE(channel_->SetRender(true)); - EXPECT_TRUE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(kSsrc))); - EXPECT_TRUE(channel_->SetRenderer(kSsrc, &renderer1)); - - EXPECT_TRUE(SendFrame()); - EXPECT_FRAME_ON_RENDERER_WAIT( - renderer1, 1, DefaultCodec().width, DefaultCodec().height, kTimeout); - EXPECT_TRUE(channel_->RemoveRecvStream(kSsrc)); - // Send three more frames. This is to avoid that the test might be flaky - // due to frame dropping. - for (size_t i = 0; i < 3; ++i) - EXPECT_TRUE(WaitAndSendFrame(100)); - - // Test that no more frames have been rendered. - EXPECT_EQ(1, renderer1.num_rendered_frames()); - - // Re-add the stream again and make sure it renders. - EXPECT_TRUE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(kSsrc))); - // Force the next frame to be a key frame to make the receiving - // decoder happy. - EXPECT_TRUE(channel_->SendIntraFrame()); - - EXPECT_TRUE(channel_->SetRenderer(kSsrc, &renderer1)); - EXPECT_TRUE(SendFrame()); - // Because the default channel is used, RemoveRecvStream above is not going - // to delete the channel. As a result the engine will continue to receive - // and decode the 3 frames sent above. So it is possible we will receive - // some (e.g. 1) of these 3 frames after the renderer is set again. - EXPECT_GT_FRAME_ON_RENDERER_WAIT( - renderer1, 2, DefaultCodec().width, DefaultCodec().height, kTimeout); - // Detach |renderer1| before exit as there might be frames come late. - EXPECT_TRUE(channel_->SetRenderer(kSsrc, NULL)); - } - - // Tests the behavior of incoming streams in a conference scenario. - void SimulateConference() { - cricket::FakeVideoRenderer renderer1, renderer2; - EXPECT_TRUE(SetDefaultCodec()); - cricket::VideoOptions vmo; - vmo.conference_mode.Set(true); - EXPECT_TRUE(channel_->SetOptions(vmo)); - EXPECT_TRUE(SetSend(true)); - EXPECT_TRUE(channel_->SetRender(true)); - EXPECT_TRUE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(1))); - EXPECT_TRUE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(2))); - EXPECT_TRUE(channel_->SetRenderer(1, &renderer1)); - EXPECT_TRUE(channel_->SetRenderer(2, &renderer2)); - EXPECT_EQ(0, renderer1.num_rendered_frames()); - EXPECT_EQ(0, renderer2.num_rendered_frames()); - std::vector ssrcs; - ssrcs.push_back(1); - ssrcs.push_back(2); - network_interface_.SetConferenceMode(true, ssrcs); - EXPECT_TRUE(SendFrame()); - EXPECT_FRAME_ON_RENDERER_WAIT( - renderer1, 1, DefaultCodec().width, DefaultCodec().height, kTimeout); - EXPECT_FRAME_ON_RENDERER_WAIT( - renderer2, 1, DefaultCodec().width, DefaultCodec().height, kTimeout); - - talk_base::scoped_ptr p(GetRtpPacket(0)); - EXPECT_EQ(DefaultCodec().id, GetPayloadType(p.get())); - EXPECT_EQ(DefaultCodec().width, renderer1.width()); - EXPECT_EQ(DefaultCodec().height, renderer1.height()); - EXPECT_EQ(DefaultCodec().width, renderer2.width()); - EXPECT_EQ(DefaultCodec().height, renderer2.height()); - EXPECT_TRUE(channel_->RemoveRecvStream(2)); - EXPECT_TRUE(channel_->RemoveRecvStream(1)); - } - - // Tests that we can add and remove capturers and frames are sent out properly - void AddRemoveCapturer() { - cricket::VideoCodec codec = DefaultCodec(); - codec.width = 320; - codec.height = 240; - const int time_between_send = TimeBetweenSend(codec); - EXPECT_TRUE(SetOneCodec(codec)); - EXPECT_TRUE(SetSend(true)); - EXPECT_TRUE(channel_->SetRender(true)); - EXPECT_EQ(0, renderer_.num_rendered_frames()); - EXPECT_TRUE(SendFrame()); - EXPECT_FRAME_WAIT(1, codec.width, codec.height, kTimeout); - talk_base::scoped_ptr capturer( - new cricket::FakeVideoCapturer); - capturer->SetScreencast(true); - cricket::VideoFormat format(480, 360, - cricket::VideoFormat::FpsToInterval(30), - cricket::FOURCC_I420); - EXPECT_EQ(cricket::CS_RUNNING, capturer->Start(format)); - // All capturers start generating frames with the same timestamp. ViE does - // not allow the same timestamp to be used. Capture one frame before - // associating the capturer with the channel. - EXPECT_TRUE(capturer->CaptureCustomFrame(format.width, format.height, - cricket::FOURCC_I420)); - - int captured_frames = 1; - for (int iterations = 0; iterations < 2; ++iterations) { - EXPECT_TRUE(channel_->SetCapturer(kSsrc, capturer.get())); - talk_base::Thread::Current()->ProcessMessages(time_between_send); - EXPECT_TRUE(capturer->CaptureCustomFrame(format.width, format.height, - cricket::FOURCC_I420)); - ++captured_frames; - // Wait until frame of right size is captured. - EXPECT_TRUE_WAIT(renderer_.num_rendered_frames() >= captured_frames && - format.width == renderer_.width() && - format.height == renderer_.height() && - !renderer_.black_frame(), kTimeout); - EXPECT_GE(renderer_.num_rendered_frames(), captured_frames); - EXPECT_EQ(format.width, renderer_.width()); - EXPECT_EQ(format.height, renderer_.height()); - captured_frames = renderer_.num_rendered_frames() + 1; - EXPECT_FALSE(renderer_.black_frame()); - EXPECT_TRUE(channel_->SetCapturer(kSsrc, NULL)); - // Make sure a black frame is generated within the specified timeout. - // The black frame should be the resolution of the send codec. - EXPECT_TRUE_WAIT(renderer_.num_rendered_frames() >= captured_frames && - codec.width == renderer_.width() && - codec.height == renderer_.height() && - renderer_.black_frame(), kTimeout); - EXPECT_GE(renderer_.num_rendered_frames(), captured_frames); - EXPECT_EQ(codec.width, renderer_.width()); - EXPECT_EQ(codec.height, renderer_.height()); - EXPECT_TRUE(renderer_.black_frame()); - - // The black frame has the same timestamp as the next frame since it's - // timestamp is set to the last frame's timestamp + interval. WebRTC will - // not render a frame with the same timestamp so capture another frame - // with the frame capturer to increment the next frame's timestamp. - EXPECT_TRUE(capturer->CaptureCustomFrame(format.width, format.height, - cricket::FOURCC_I420)); - } - } - - // Tests that if RemoveCapturer is called without a capturer ever being - // added, the plugin shouldn't crash (and no black frame should be sent). - void RemoveCapturerWithoutAdd() { - EXPECT_TRUE(SetOneCodec(DefaultCodec())); - EXPECT_TRUE(SetSend(true)); - EXPECT_TRUE(channel_->SetRender(true)); - EXPECT_EQ(0, renderer_.num_rendered_frames()); - EXPECT_TRUE(SendFrame()); - EXPECT_FRAME_WAIT(1, 640, 400, kTimeout); - // Remove the capturer. - EXPECT_TRUE(channel_->SetCapturer(kSsrc, NULL)); - // Wait for one black frame for removing the capturer. - EXPECT_FRAME_WAIT(2, 640, 400, kTimeout); - - // No capturer was added, so this RemoveCapturer should - // fail. - EXPECT_FALSE(channel_->SetCapturer(kSsrc, NULL)); - talk_base::Thread::Current()->ProcessMessages(300); - // Verify no more frames were sent. - EXPECT_EQ(2, renderer_.num_rendered_frames()); - } - - // Tests that we can add and remove capturer as unique sources. - void AddRemoveCapturerMultipleSources() { - // WebRTC implementation will drop frames if pushed to quickly. Wait the - // interval time to avoid that. - // WebRTC implementation will drop frames if pushed to quickly. Wait the - // interval time to avoid that. - // Set up the stream associated with the engine. - EXPECT_TRUE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(kSsrc))); - EXPECT_TRUE(channel_->SetRenderer(kSsrc, &renderer_)); - cricket::VideoFormat capture_format; // default format - capture_format.interval = cricket::VideoFormat::FpsToInterval(30); - // Set up additional stream 1. - cricket::FakeVideoRenderer renderer1; - EXPECT_FALSE(channel_->SetRenderer(1, &renderer1)); - EXPECT_TRUE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(1))); - EXPECT_TRUE(channel_->SetRenderer(1, &renderer1)); - EXPECT_TRUE(channel_->AddSendStream( - cricket::StreamParams::CreateLegacy(1))); - talk_base::scoped_ptr capturer1( - new cricket::FakeVideoCapturer); - capturer1->SetScreencast(true); - EXPECT_EQ(cricket::CS_RUNNING, capturer1->Start(capture_format)); - // Set up additional stream 2. - cricket::FakeVideoRenderer renderer2; - EXPECT_FALSE(channel_->SetRenderer(2, &renderer2)); - EXPECT_TRUE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(2))); - EXPECT_TRUE(channel_->SetRenderer(2, &renderer2)); - EXPECT_TRUE(channel_->AddSendStream( - cricket::StreamParams::CreateLegacy(2))); - talk_base::scoped_ptr capturer2( - new cricket::FakeVideoCapturer); - capturer2->SetScreencast(true); - EXPECT_EQ(cricket::CS_RUNNING, capturer2->Start(capture_format)); - // State for all the streams. - EXPECT_TRUE(SetOneCodec(DefaultCodec())); - // A limitation in the lmi implementation requires that SetCapturer() is - // called after SetOneCodec(). - // TODO(hellner): this seems like an unnecessary constraint, fix it. - EXPECT_TRUE(channel_->SetCapturer(1, capturer1.get())); - EXPECT_TRUE(channel_->SetCapturer(2, capturer2.get())); - EXPECT_TRUE(SetSend(true)); - EXPECT_TRUE(channel_->SetRender(true)); - // Test capturer associated with engine. - const int kTestWidth = 160; - const int kTestHeight = 120; - EXPECT_TRUE(capturer1->CaptureCustomFrame( - kTestWidth, kTestHeight, cricket::FOURCC_I420)); - EXPECT_FRAME_ON_RENDERER_WAIT( - renderer1, 1, kTestWidth, kTestHeight, kTimeout); - // Capture a frame with additional capturer2, frames should be received - EXPECT_TRUE(capturer2->CaptureCustomFrame( - kTestWidth, kTestHeight, cricket::FOURCC_I420)); - EXPECT_FRAME_ON_RENDERER_WAIT( - renderer2, 1, kTestWidth, kTestHeight, kTimeout); - // Successfully remove the capturer. - EXPECT_TRUE(channel_->SetCapturer(kSsrc, NULL)); - // Fail to re-remove the capturer. - EXPECT_FALSE(channel_->SetCapturer(kSsrc, NULL)); - // The capturers must be unregistered here as it runs out of it's scope - // next. - EXPECT_TRUE(channel_->SetCapturer(1, NULL)); - EXPECT_TRUE(channel_->SetCapturer(2, NULL)); - } - - void HighAspectHighHeightCapturer() { - const int kWidth = 80; - const int kHeight = 10000; - const int kScaledWidth = 20; - const int kScaledHeight = 2500; - - cricket::VideoCodec codec(DefaultCodec()); - EXPECT_TRUE(SetOneCodec(codec)); - EXPECT_TRUE(SetSend(true)); - - cricket::FakeVideoRenderer renderer; - EXPECT_TRUE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(kSsrc))); - EXPECT_TRUE(channel_->SetRenderer(kSsrc, &renderer)); - EXPECT_TRUE(channel_->SetRender(true)); - EXPECT_EQ(0, renderer.num_rendered_frames()); - - EXPECT_TRUE(SendFrame()); - EXPECT_GT_FRAME_ON_RENDERER_WAIT( - renderer, 1, codec.width, codec.height, kTimeout); - - // Registering an external capturer is currently the same as screen casting - // (update the test when this changes). - talk_base::scoped_ptr capturer( - new cricket::FakeVideoCapturer); - capturer->SetScreencast(true); - const std::vector* formats = - capturer->GetSupportedFormats(); - cricket::VideoFormat capture_format = (*formats)[0]; - EXPECT_EQ(cricket::CS_RUNNING, capturer->Start(capture_format)); - // Capture frame to not get same frame timestamps as previous capturer. - capturer->CaptureFrame(); - EXPECT_TRUE(channel_->SetCapturer(kSsrc, capturer.get())); - EXPECT_TRUE(talk_base::Thread::Current()->ProcessMessages(30)); - EXPECT_TRUE(capturer->CaptureCustomFrame(kWidth, kHeight, - cricket::FOURCC_ARGB)); - EXPECT_TRUE(capturer->CaptureFrame()); - EXPECT_GT_FRAME_ON_RENDERER_WAIT( - renderer, 2, kScaledWidth, kScaledHeight, kTimeout); - EXPECT_TRUE(channel_->SetCapturer(kSsrc, NULL)); - } - - // Tests that we can adapt video resolution with 16:10 aspect ratio properly. - void AdaptResolution16x10() { - cricket::VideoCodec codec(DefaultCodec()); - codec.width = 640; - codec.height = 400; - SendAndReceive(codec); - codec.width /= 2; - codec.height /= 2; - // Adapt the resolution. - EXPECT_TRUE(SetOneCodec(codec)); - EXPECT_TRUE(WaitAndSendFrame(30)); - EXPECT_FRAME_WAIT(2, codec.width, codec.height, kTimeout); - } - // Tests that we can adapt video resolution with 4:3 aspect ratio properly. - void AdaptResolution4x3() { - cricket::VideoCodec codec(DefaultCodec()); - codec.width = 640; - codec.height = 400; - SendAndReceive(codec); - codec.width /= 2; - codec.height /= 2; - // Adapt the resolution. - EXPECT_TRUE(SetOneCodec(codec)); - EXPECT_TRUE(WaitAndSendFrame(30)); - EXPECT_FRAME_WAIT(2, codec.width, codec.height, kTimeout); - } - // Tests that we can drop all frames properly. - void AdaptDropAllFrames() { - // Set the channel codec's resolution to 0, which will require the adapter - // to drop all frames. - cricket::VideoCodec codec(DefaultCodec()); - codec.width = codec.height = codec.framerate = 0; - EXPECT_TRUE(SetOneCodec(codec)); - EXPECT_TRUE(SetSend(true)); - EXPECT_TRUE(channel_->SetRender(true)); - EXPECT_EQ(0, renderer_.num_rendered_frames()); - EXPECT_TRUE(SendFrame()); - EXPECT_TRUE(SendFrame()); - talk_base::Thread::Current()->ProcessMessages(500); - EXPECT_EQ(0, renderer_.num_rendered_frames()); - } - // Tests that we can reduce the frame rate on demand properly. - // TODO(fbarchard): This test is flakey on pulse. Fix and re-enable - void AdaptFramerate() { - cricket::VideoCodec codec(DefaultCodec()); - int frame_count = 0; - // The capturer runs at 30 fps. The channel requires 30 fps. - EXPECT_TRUE(SetOneCodec(codec)); - EXPECT_TRUE(SetSend(true)); - EXPECT_TRUE(channel_->SetRender(true)); - EXPECT_EQ(frame_count, renderer_.num_rendered_frames()); - EXPECT_TRUE(WaitAndSendFrame(0)); // Should be rendered. - EXPECT_TRUE(WaitAndSendFrame(30)); // Should be rendered. - frame_count += 2; - EXPECT_FRAME_WAIT(frame_count, codec.width, codec.height, kTimeout); - talk_base::scoped_ptr p(GetRtpPacket(0)); - EXPECT_EQ(codec.id, GetPayloadType(p.get())); - - // The channel requires 15 fps. - codec.framerate = 15; - EXPECT_TRUE(SetOneCodec(codec)); - EXPECT_TRUE(WaitAndSendFrame(0)); // Should be rendered. - EXPECT_TRUE(WaitAndSendFrame(30)); // Should be dropped. - EXPECT_TRUE(WaitAndSendFrame(30)); // Should be rendered. - frame_count += 2; - EXPECT_EQ_WAIT(frame_count, renderer_.num_rendered_frames(), kTimeout); - - // The channel requires 10 fps. - codec.framerate = 10; - EXPECT_TRUE(SetOneCodec(codec)); - EXPECT_TRUE(WaitAndSendFrame(0)); // Should be rendered. - EXPECT_TRUE(WaitAndSendFrame(30)); // Should be dropped. - EXPECT_TRUE(WaitAndSendFrame(30)); // Should be dropped. - EXPECT_TRUE(WaitAndSendFrame(30)); // Should be rendered. - frame_count += 2; - EXPECT_EQ_WAIT(frame_count, renderer_.num_rendered_frames(), kTimeout); - - // The channel requires 8 fps. The adapter adapts to 10 fps, which is the - // closest factor of 30. - codec.framerate = 8; - EXPECT_TRUE(SetOneCodec(codec)); - EXPECT_TRUE(WaitAndSendFrame(0)); // Should be rendered. - EXPECT_TRUE(WaitAndSendFrame(30)); // Should be dropped. - EXPECT_TRUE(WaitAndSendFrame(30)); // Should be dropped. - EXPECT_TRUE(WaitAndSendFrame(30)); // Should be rendered. - frame_count += 2; - EXPECT_EQ_WAIT(frame_count, renderer_.num_rendered_frames(), kTimeout); - } - // Tests that we can set the send stream format properly. - void SetSendStreamFormat() { - cricket::VideoCodec codec(DefaultCodec()); - SendAndReceive(codec); - int frame_count = 1; - EXPECT_FRAME_WAIT(frame_count, codec.width, codec.height, kTimeout); - - // Adapt the resolution and frame rate to half. - cricket::VideoFormat format( - codec.width / 2, - codec.height / 2, - cricket::VideoFormat::FpsToInterval(codec.framerate / 2), - cricket::FOURCC_I420); - // The SSRC differs from the send SSRC. - EXPECT_FALSE(channel_->SetSendStreamFormat(kSsrc - 1, format)); - EXPECT_TRUE(channel_->SetSendStreamFormat(kSsrc, format)); - - EXPECT_TRUE(WaitAndSendFrame(30)); // Should be dropped. - EXPECT_TRUE(WaitAndSendFrame(30)); // Should be rendered. - EXPECT_TRUE(WaitAndSendFrame(30)); // Should be dropped. - frame_count += 1; - EXPECT_FRAME_WAIT(frame_count, format.width, format.height, kTimeout); - - // Adapt the resolution to 0x0, which should drop all frames. - format.width = 0; - format.height = 0; - EXPECT_TRUE(channel_->SetSendStreamFormat(kSsrc, format)); - EXPECT_TRUE(SendFrame()); - EXPECT_TRUE(SendFrame()); - talk_base::Thread::Current()->ProcessMessages(500); - EXPECT_EQ(frame_count, renderer_.num_rendered_frames()); - } - // Test that setting send stream format to 0x0 resolution will result in - // frames being dropped. - void SetSendStreamFormat0x0() { - EXPECT_TRUE(SetOneCodec(DefaultCodec())); - EXPECT_TRUE(SetSendStreamFormat(kSsrc, DefaultCodec())); - EXPECT_TRUE(SetSend(true)); - EXPECT_TRUE(channel_->SetRender(true)); - EXPECT_EQ(0, renderer_.num_rendered_frames()); - // This frame should be received. - EXPECT_TRUE(SendFrame()); - EXPECT_FRAME_WAIT(1, DefaultCodec().width, DefaultCodec().height, kTimeout); - const int64 interval = cricket::VideoFormat::FpsToInterval( - DefaultCodec().framerate); - cricket::VideoFormat format( - 0, - 0, - interval, - cricket::FOURCC_I420); - EXPECT_TRUE(channel_->SetSendStreamFormat(kSsrc, format)); - // This frame should not be received. - EXPECT_TRUE(WaitAndSendFrame( - static_cast(interval/talk_base::kNumNanosecsPerMillisec))); - talk_base::Thread::Current()->ProcessMessages(500); - EXPECT_EQ(1, renderer_.num_rendered_frames()); - } - - // Tests that we can mute and unmute the channel properly. - void MuteStream() { - int frame_count = 0; - EXPECT_TRUE(SetDefaultCodec()); - cricket::FakeVideoCapturer video_capturer; - video_capturer.Start( - cricket::VideoFormat( - 640, 480, - cricket::VideoFormat::FpsToInterval(30), - cricket::FOURCC_I420)); - EXPECT_TRUE(channel_->SetCapturer(kSsrc, &video_capturer)); - EXPECT_TRUE(SetSend(true)); - EXPECT_TRUE(channel_->SetRender(true)); - EXPECT_EQ(frame_count, renderer_.num_rendered_frames()); - - // Mute the channel and expect black output frame. - EXPECT_TRUE(channel_->MuteStream(kSsrc, true)); - EXPECT_TRUE(video_capturer.CaptureFrame()); - ++frame_count; - EXPECT_EQ_WAIT(frame_count, renderer_.num_rendered_frames(), kTimeout); - EXPECT_TRUE(renderer_.black_frame()); - - // Unmute the channel and expect non-black output frame. - EXPECT_TRUE(channel_->MuteStream(kSsrc, false)); - EXPECT_TRUE(talk_base::Thread::Current()->ProcessMessages(30)); - EXPECT_TRUE(video_capturer.CaptureFrame()); - ++frame_count; - EXPECT_EQ_WAIT(frame_count, renderer_.num_rendered_frames(), kTimeout); - EXPECT_FALSE(renderer_.black_frame()); - - // Test that we can also Mute using the correct send stream SSRC. - EXPECT_TRUE(channel_->MuteStream(kSsrc, true)); - EXPECT_TRUE(talk_base::Thread::Current()->ProcessMessages(30)); - EXPECT_TRUE(video_capturer.CaptureFrame()); - ++frame_count; - EXPECT_EQ_WAIT(frame_count, renderer_.num_rendered_frames(), kTimeout); - EXPECT_TRUE(renderer_.black_frame()); - - EXPECT_TRUE(channel_->MuteStream(kSsrc, false)); - EXPECT_TRUE(talk_base::Thread::Current()->ProcessMessages(30)); - EXPECT_TRUE(video_capturer.CaptureFrame()); - ++frame_count; - EXPECT_EQ_WAIT(frame_count, renderer_.num_rendered_frames(), kTimeout); - EXPECT_FALSE(renderer_.black_frame()); - - // Test that muting an invalid stream fails. - EXPECT_FALSE(channel_->MuteStream(kSsrc+1, true)); - EXPECT_TRUE(channel_->SetCapturer(kSsrc, NULL)); - } - - // Test that multiple send streams can be created and deleted properly. - void MultipleSendStreams() { - // Remove stream added in Setup. I.e. remove stream corresponding to default - // channel. - EXPECT_TRUE(channel_->RemoveSendStream(kSsrc)); - const unsigned int kSsrcsSize = sizeof(kSsrcs4)/sizeof(kSsrcs4[0]); - for (unsigned int i = 0; i < kSsrcsSize; ++i) { - EXPECT_TRUE(channel_->AddSendStream( - cricket::StreamParams::CreateLegacy(kSsrcs4[i]))); - } - // Delete one of the non default channel streams, let the destructor delete - // the remaining ones. - EXPECT_TRUE(channel_->RemoveSendStream(kSsrcs4[kSsrcsSize - 1])); - // Stream should already be deleted. - EXPECT_FALSE(channel_->RemoveSendStream(kSsrcs4[kSsrcsSize - 1])); - } - - - // Two streams one channel tests. - - // Tests that we can send and receive frames. - void TwoStreamsSendAndReceive(const cricket::VideoCodec& codec) { - SetUpSecondStream(); - // Test sending and receiving on first stream. - SendAndReceive(codec); - // Test sending and receiving on second stream. - EXPECT_EQ_WAIT(1, renderer2_.num_rendered_frames(), kTimeout); - EXPECT_EQ(2, NumRtpPackets()); - EXPECT_EQ(1, renderer2_.num_rendered_frames()); - } - - // Set up 2 streams where the first stream uses the default channel. - // Then disconnect the first stream and verify default channel becomes - // available. - // Then add a new stream with |new_ssrc|. The new stream should re-use the - // default channel. - void TwoStreamsReUseFirstStream(const cricket::VideoCodec& codec) { - SetUpSecondStream(); - // Default channel used by the first stream. - EXPECT_EQ(kSsrc, channel_->GetDefaultChannelSsrc()); - EXPECT_TRUE(channel_->RemoveRecvStream(kSsrc)); - EXPECT_FALSE(channel_->RemoveRecvStream(kSsrc)); - EXPECT_TRUE(channel_->RemoveSendStream(kSsrc)); - EXPECT_FALSE(channel_->RemoveSendStream(kSsrc)); - // Default channel is no longer used by a stream. - EXPECT_EQ(0u, channel_->GetDefaultChannelSsrc()); - SetRendererAsDefault(); - uint32 new_ssrc = kSsrc + 100; - EXPECT_TRUE(channel_->AddSendStream( - cricket::StreamParams::CreateLegacy(new_ssrc))); - // Re-use default channel. - EXPECT_EQ(new_ssrc, channel_->GetDefaultChannelSsrc()); - EXPECT_FALSE(channel_->AddSendStream( - cricket::StreamParams::CreateLegacy(new_ssrc))); - EXPECT_TRUE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(new_ssrc))); - EXPECT_FALSE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(new_ssrc))); - - EXPECT_TRUE(channel_->SetCapturer(new_ssrc, video_capturer_.get())); - - SendAndReceive(codec); - EXPECT_TRUE(channel_->RemoveSendStream(new_ssrc)); - EXPECT_EQ(0u, channel_->GetDefaultChannelSsrc()); - } - - // Tests that we can send and receive frames with early receive. - void TwoStreamsSendAndUnsignalledRecv(const cricket::VideoCodec& codec) { - cricket::VideoOptions vmo; - vmo.conference_mode.Set(true); - vmo.unsignalled_recv_stream_limit.Set(1); - EXPECT_TRUE(channel_->SetOptions(vmo)); - SetUpSecondStreamWithNoRecv(); - // Test sending and receiving on first stream. - EXPECT_TRUE(channel_->SetRender(true)); - Send(codec); - EXPECT_EQ_WAIT(2, NumRtpPackets(), kTimeout); - EXPECT_EQ_WAIT(1, renderer_.num_rendered_frames(), kTimeout); - // The first send is not expected to yield frames, because the ssrc - // is not signalled yet. With unsignalled recv enabled, we will drop frames - // instead of packets. - EXPECT_EQ(0, renderer2_.num_rendered_frames()); - // Give a chance for the decoder to process before adding the receiver. - talk_base::Thread::Current()->ProcessMessages(100); - // Test sending and receiving on second stream. - EXPECT_TRUE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(kSsrc + 2))); - EXPECT_TRUE(channel_->SetRenderer(kSsrc + 2, &renderer2_)); - SendFrame(); - EXPECT_EQ_WAIT(2, renderer_.num_rendered_frames(), kTimeout); - EXPECT_EQ(4, NumRtpPackets()); - // The second send is expected to yield frame as the ssrc is signalled now. - // Decode should succeed here, though we received the key frame earlier. - // Without early recv, we would have dropped it and decoding would have - // failed. - EXPECT_EQ_WAIT(1, renderer2_.num_rendered_frames(), kTimeout); - } - - // Tests that we cannot receive key frames with unsignalled recv disabled. - void TwoStreamsSendAndFailUnsignalledRecv(const cricket::VideoCodec& codec) { - cricket::VideoOptions vmo; - vmo.conference_mode.Set(true); - vmo.unsignalled_recv_stream_limit.Set(0); - EXPECT_TRUE(channel_->SetOptions(vmo)); - SetUpSecondStreamWithNoRecv(); - // Test sending and receiving on first stream. - EXPECT_TRUE(channel_->SetRender(true)); - Send(codec); - EXPECT_EQ_WAIT(2, NumRtpPackets(), kTimeout); - talk_base::Thread::Current()->ProcessMessages(100); - EXPECT_EQ_WAIT(1, renderer_.num_rendered_frames(), kTimeout); - EXPECT_EQ_WAIT(0, renderer2_.num_rendered_frames(), kTimeout); - // Give a chance for the decoder to process before adding the receiver. - talk_base::Thread::Current()->ProcessMessages(10); - // Test sending and receiving on second stream. - EXPECT_TRUE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(kSsrc + 2))); - EXPECT_TRUE(channel_->SetRenderer(kSsrc + 2, &renderer2_)); - SendFrame(); - EXPECT_TRUE_WAIT(renderer_.num_rendered_frames() >= 1, kTimeout); - EXPECT_EQ_WAIT(4, NumRtpPackets(), kTimeout); - // We dont expect any frames here, because the key frame would have been - // lost in the earlier packet. This is the case we want to solve with early - // receive. - EXPECT_EQ(0, renderer2_.num_rendered_frames()); - } - - // Tests that we drop key frames when conference mode is disabled and we - // receive rtp packets on unsignalled streams. - void TwoStreamsSendAndFailUnsignalledRecvInOneToOne( - const cricket::VideoCodec& codec) { - cricket::VideoOptions vmo; - vmo.conference_mode.Set(false); - vmo.unsignalled_recv_stream_limit.Set(1); - EXPECT_TRUE(channel_->SetOptions(vmo)); - SetUpSecondStreamWithNoRecv(); - // Test sending and receiving on first stream. - EXPECT_TRUE(channel_->SetRender(true)); - Send(codec); - EXPECT_EQ_WAIT(2, NumRtpPackets(), kTimeout); - // In one-to-one mode, we deliver frames to the default channel if there - // is no registered recv channel for the ssrc. - EXPECT_TRUE_WAIT(renderer_.num_rendered_frames() >= 1, kTimeout); - // Give a chance for the decoder to process before adding the receiver. - talk_base::Thread::Current()->ProcessMessages(100); - // Test sending and receiving on second stream. - EXPECT_TRUE(channel_->AddRecvStream( - cricket::StreamParams::CreateLegacy(kSsrc + 2))); - EXPECT_TRUE(channel_->SetRenderer(kSsrc + 2, &renderer2_)); - SendFrame(); - EXPECT_TRUE_WAIT(renderer_.num_rendered_frames() >= 1, kTimeout); - EXPECT_EQ_WAIT(4, NumRtpPackets(), kTimeout); - // We dont expect any frames here, because the key frame would have been - // delivered to default channel. - EXPECT_EQ(0, renderer2_.num_rendered_frames()); - } - - // Tests that we drop key frames when conference mode is enabled and we - // receive rtp packets on unsignalled streams. Removal of a unsignalled recv - // stream is successful. - void TwoStreamsAddAndRemoveUnsignalledRecv( - const cricket::VideoCodec& codec) { - cricket::VideoOptions vmo; - vmo.conference_mode.Set(true); - vmo.unsignalled_recv_stream_limit.Set(1); - EXPECT_TRUE(channel_->SetOptions(vmo)); - SetUpSecondStreamWithNoRecv(); - // Sending and receiving on first stream. - EXPECT_TRUE(channel_->SetRender(true)); - Send(codec); - EXPECT_EQ_WAIT(2, NumRtpPackets(), kTimeout); - EXPECT_EQ_WAIT(1, renderer_.num_rendered_frames(), kTimeout); - // The first send is not expected to yield frames, because the ssrc - // is no signalled yet. With unsignalled recv enabled, we will drop frames - // instead of packets. - EXPECT_EQ(0, renderer2_.num_rendered_frames()); - // Give a chance for the decoder to process before adding the receiver. - talk_base::Thread::Current()->ProcessMessages(100); - // Ensure that we can remove the unsignalled recv stream that was created - // when the first video packet with unsignalled recv ssrc is received. - EXPECT_TRUE(channel_->RemoveRecvStream(kSsrc + 2)); - } - - VideoEngineOverride engine_; - talk_base::scoped_ptr video_capturer_; - talk_base::scoped_ptr video_capturer_2_; - talk_base::scoped_ptr channel_; - cricket::FakeNetworkInterface network_interface_; - cricket::FakeVideoRenderer renderer_; - cricket::VideoMediaChannel::Error media_error_; - - // Used by test cases where 2 streams are run on the same channel. - cricket::FakeVideoRenderer renderer2_; -}; - -#endif // TALK_MEDIA_BASE_VIDEOENGINE_UNITTEST_H_ NOLINT diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/videoframe.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/videoframe.h deleted file mode 100755 index 69cb753..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/videoframe.h +++ /dev/null @@ -1,195 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_VIDEOFRAME_H_ -#define TALK_MEDIA_BASE_VIDEOFRAME_H_ - -#include "talk/base/basictypes.h" -#include "talk/base/stream.h" - -namespace cricket { - -// Simple rotation constants. -enum { - ROTATION_0 = 0, - ROTATION_90 = 90, - ROTATION_180 = 180, - ROTATION_270 = 270 -}; - -// Represents a YUV420 (a.k.a. I420) video frame. -class VideoFrame { - public: - VideoFrame() {} - virtual ~VideoFrame() {} - - virtual bool InitToBlack(int w, int h, size_t pixel_width, - size_t pixel_height, int64 elapsed_time, - int64 time_stamp) = 0; - // Creates a frame from a raw sample with FourCC |format| and size |w| x |h|. - // |h| can be negative indicating a vertically flipped image. - // |dw| is destination width; can be less than |w| if cropping is desired. - // |dh| is destination height, like |dw|, but must be a positive number. - // Returns whether the function succeeded or failed. - virtual bool Reset(uint32 fourcc, int w, int h, int dw, int dh, uint8 *sample, - size_t sample_size, size_t pixel_width, - size_t pixel_height, int64 elapsed_time, int64 time_stamp, - int rotation) = 0; - - // Basic accessors. - virtual size_t GetWidth() const = 0; - virtual size_t GetHeight() const = 0; - size_t GetChromaWidth() const { return (GetWidth() + 1) / 2; } - size_t GetChromaHeight() const { return (GetHeight() + 1) / 2; } - size_t GetChromaSize() const { return GetUPitch() * GetChromaHeight(); } - // These can return NULL if the object is not backed by a buffer. - virtual const uint8 *GetYPlane() const = 0; - virtual const uint8 *GetUPlane() const = 0; - virtual const uint8 *GetVPlane() const = 0; - virtual uint8 *GetYPlane() = 0; - virtual uint8 *GetUPlane() = 0; - virtual uint8 *GetVPlane() = 0; - - virtual int32 GetYPitch() const = 0; - virtual int32 GetUPitch() const = 0; - virtual int32 GetVPitch() const = 0; - - // Returns the handle of the underlying video frame. This is used when the - // frame is backed by a texture. The object should be destroyed when it is no - // longer in use, so the underlying resource can be freed. - virtual void* GetNativeHandle() const = 0; - - // For retrieving the aspect ratio of each pixel. Usually this is 1x1, but - // the aspect_ratio_idc parameter of H.264 can specify non-square pixels. - virtual size_t GetPixelWidth() const = 0; - virtual size_t GetPixelHeight() const = 0; - - virtual int64 GetElapsedTime() const = 0; - virtual int64 GetTimeStamp() const = 0; - virtual void SetElapsedTime(int64 elapsed_time) = 0; - virtual void SetTimeStamp(int64 time_stamp) = 0; - - // Indicates the rotation angle in degrees. - virtual int GetRotation() const = 0; - - // Make a shallow copy of the frame. The frame buffer itself is not copied. - // Both the current and new VideoFrame will share a single reference-counted - // frame buffer. - virtual VideoFrame *Copy() const = 0; - - // Since VideoFrame supports shallow copy and the internal frame buffer might - // be shared, in case VideoFrame needs exclusive access of the frame buffer, - // user can call MakeExclusive() to make sure the frame buffer is exclusive - // accessable to the current object. This might mean a deep copy of the frame - // buffer if it is currently shared by other objects. - virtual bool MakeExclusive() = 0; - - // Writes the frame into the given frame buffer, provided that it is of - // sufficient size. Returns the frame's actual size, regardless of whether - // it was written or not (like snprintf). If there is insufficient space, - // nothing is written. - virtual size_t CopyToBuffer(uint8 *buffer, size_t size) const = 0; - - // Writes the frame into the given planes, stretched to the given width and - // height. The parameter "interpolate" controls whether to interpolate or just - // take the nearest-point. The parameter "crop" controls whether to crop this - // frame to the aspect ratio of the given dimensions before stretching. - virtual bool CopyToPlanes( - uint8* dst_y, uint8* dst_u, uint8* dst_v, - int32 dst_pitch_y, int32 dst_pitch_u, int32 dst_pitch_v) const; - - // Writes the frame into the target VideoFrame. - virtual void CopyToFrame(VideoFrame* target) const; - - // Writes the frame into the given stream and returns the StreamResult. - // See talk/base/stream.h for a description of StreamResult and error. - // Error may be NULL. If a non-success value is returned from - // StreamInterface::Write(), we immediately return with that value. - virtual talk_base::StreamResult Write(talk_base::StreamInterface *stream, - int *error); - - // Converts the I420 data to RGB of a certain type such as ARGB and ABGR. - // Returns the frame's actual size, regardless of whether it was written or - // not (like snprintf). Parameters size and stride_rgb are in units of bytes. - // If there is insufficient space, nothing is written. - virtual size_t ConvertToRgbBuffer(uint32 to_fourcc, uint8 *buffer, - size_t size, int stride_rgb) const = 0; - - // Writes the frame into the given planes, stretched to the given width and - // height. The parameter "interpolate" controls whether to interpolate or just - // take the nearest-point. The parameter "crop" controls whether to crop this - // frame to the aspect ratio of the given dimensions before stretching. - virtual void StretchToPlanes( - uint8 *y, uint8 *u, uint8 *v, int32 pitchY, int32 pitchU, int32 pitchV, - size_t width, size_t height, bool interpolate, bool crop) const; - - // Writes the frame into the given frame buffer, stretched to the given width - // and height, provided that it is of sufficient size. Returns the frame's - // actual size, regardless of whether it was written or not (like snprintf). - // If there is insufficient space, nothing is written. The parameter - // "interpolate" controls whether to interpolate or just take the - // nearest-point. The parameter "crop" controls whether to crop this frame to - // the aspect ratio of the given dimensions before stretching. - virtual size_t StretchToBuffer(size_t w, size_t h, uint8 *buffer, size_t size, - bool interpolate, bool crop) const; - - // Writes the frame into the target VideoFrame, stretched to the size of that - // frame. The parameter "interpolate" controls whether to interpolate or just - // take the nearest-point. The parameter "crop" controls whether to crop this - // frame to the aspect ratio of the target frame before stretching. - virtual void StretchToFrame(VideoFrame *target, bool interpolate, - bool crop) const; - - // Stretches the frame to the given size, creating a new VideoFrame object to - // hold it. The parameter "interpolate" controls whether to interpolate or - // just take the nearest-point. The parameter "crop" controls whether to crop - // this frame to the aspect ratio of the given dimensions before stretching. - virtual VideoFrame *Stretch(size_t w, size_t h, bool interpolate, - bool crop) const; - - // Sets the video frame to black. - virtual bool SetToBlack(); - - // Tests if sample is valid. Returns true if valid. - static bool Validate(uint32 fourcc, int w, int h, const uint8 *sample, - size_t sample_size); - - // Size of an I420 image of given dimensions when stored as a frame buffer. - static size_t SizeOf(size_t w, size_t h) { - return w * h + ((w + 1) / 2) * ((h + 1) / 2) * 2; - } - - protected: - // Creates an empty frame. - virtual VideoFrame *CreateEmptyFrame(int w, int h, size_t pixel_width, - size_t pixel_height, int64 elapsed_time, - int64 time_stamp) const = 0; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_VIDEOFRAME_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/videoframe_unittest.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/videoframe_unittest.h deleted file mode 100755 index 0ff6f49..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/videoframe_unittest.h +++ /dev/null @@ -1,2107 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_VIDEOFRAME_UNITTEST_H_ -#define TALK_MEDIA_BASE_VIDEOFRAME_UNITTEST_H_ - -#include - -#include "libyuv/convert.h" -#include "libyuv/convert_from.h" -#include "libyuv/format_conversion.h" -#include "libyuv/planar_functions.h" -#include "libyuv/rotate.h" -#include "talk/base/gunit.h" -#include "talk/base/pathutils.h" -#include "talk/base/stream.h" -#include "talk/base/stringutils.h" -#include "talk/media/base/testutils.h" -#include "talk/media/base/videocommon.h" -#include "talk/media/base/videoframe.h" - -#if defined(_MSC_VER) -#define ALIGN16(var) __declspec(align(16)) var -#else -#define ALIGN16(var) var __attribute__((aligned(16))) -#endif - -#define kImageFilename "faces.1280x720_P420.yuv" -#define kJpeg420Filename "faces_I420.jpg" -#define kJpeg422Filename "faces_I422.jpg" -#define kJpeg444Filename "faces_I444.jpg" -#define kJpeg411Filename "faces_I411.jpg" -#define kJpeg400Filename "faces_I400.jpg" - -// Generic test class for testing various video frame implementations. -template -class VideoFrameTest : public testing::Test { - public: - VideoFrameTest() : repeat_(1) {} - - protected: - static const int kWidth = 1280; - static const int kHeight = 720; - static const int kAlignment = 16; - static const int kMinWidthAll = 1; // Constants for ConstructYUY2AllSizes. - static const int kMinHeightAll = 1; - static const int kMaxWidthAll = 17; - static const int kMaxHeightAll = 23; - - // Load a video frame from disk. - bool LoadFrameNoRepeat(T* frame) { - int save_repeat = repeat_; // This LoadFrame disables repeat. - repeat_ = 1; - bool success = LoadFrame(kImageFilename, cricket::FOURCC_I420, - kWidth, kHeight, frame); - repeat_ = save_repeat; - return success; - } - - bool LoadFrame(const std::string& filename, uint32 format, - int32 width, int32 height, T* frame) { - return LoadFrame(filename, format, width, height, - width, abs(height), 0, frame); - } - bool LoadFrame(const std::string& filename, uint32 format, - int32 width, int32 height, int dw, int dh, int rotation, - T* frame) { - talk_base::scoped_ptr ms(LoadSample(filename)); - return LoadFrame(ms.get(), format, width, height, dw, dh, rotation, frame); - } - // Load a video frame from a memory stream. - bool LoadFrame(talk_base::MemoryStream* ms, uint32 format, - int32 width, int32 height, T* frame) { - return LoadFrame(ms, format, width, height, - width, abs(height), 0, frame); - } - bool LoadFrame(talk_base::MemoryStream* ms, uint32 format, - int32 width, int32 height, int dw, int dh, int rotation, - T* frame) { - if (!ms) { - return false; - } - size_t data_size; - bool ret = ms->GetSize(&data_size); - EXPECT_TRUE(ret); - if (ret) { - ret = LoadFrame(reinterpret_cast(ms->GetBuffer()), data_size, - format, width, height, dw, dh, rotation, frame); - } - return ret; - } - // Load a frame from a raw buffer. - bool LoadFrame(uint8* sample, size_t sample_size, uint32 format, - int32 width, int32 height, T* frame) { - return LoadFrame(sample, sample_size, format, width, height, - width, abs(height), 0, frame); - } - bool LoadFrame(uint8* sample, size_t sample_size, uint32 format, - int32 width, int32 height, int dw, int dh, int rotation, - T* frame) { - bool ret = false; - for (int i = 0; i < repeat_; ++i) { - ret = frame->Init(format, width, height, dw, dh, - sample, sample_size, 1, 1, 0, 0, rotation); - } - return ret; - } - - talk_base::MemoryStream* LoadSample(const std::string& filename) { - talk_base::Pathname path(cricket::GetTestFilePath(filename)); - talk_base::scoped_ptr fs( - talk_base::Filesystem::OpenFile(path, "rb")); - if (!fs.get()) { - return NULL; - } - - char buf[4096]; - talk_base::scoped_ptr ms( - new talk_base::MemoryStream()); - talk_base::StreamResult res = Flow(fs.get(), buf, sizeof(buf), ms.get()); - if (res != talk_base::SR_SUCCESS) { - return NULL; - } - - return ms.release(); - } - - // Write an I420 frame out to disk. - bool DumpFrame(const std::string& prefix, - const cricket::VideoFrame& frame) { - char filename[256]; - talk_base::sprintfn(filename, sizeof(filename), "%s.%dx%d_P420.yuv", - prefix.c_str(), frame.GetWidth(), frame.GetHeight()); - size_t out_size = cricket::VideoFrame::SizeOf(frame.GetWidth(), - frame.GetHeight()); - talk_base::scoped_ptr out(new uint8[out_size]); - frame.CopyToBuffer(out.get(), out_size); - return DumpSample(filename, out.get(), out_size); - } - - bool DumpSample(const std::string& filename, const void* buffer, int size) { - talk_base::Pathname path(filename); - talk_base::scoped_ptr fs( - talk_base::Filesystem::OpenFile(path, "wb")); - if (!fs.get()) { - return false; - } - - return (fs->Write(buffer, size, NULL, NULL) == talk_base::SR_SUCCESS); - } - - // Create a test image in the desired color space. - // The image is a checkerboard pattern with 63x63 squares, which allows - // I420 chroma artifacts to easily be seen on the square boundaries. - // The pattern is { { green, orange }, { blue, purple } } - // There is also a gradient within each square to ensure that the luma - // values are handled properly. - talk_base::MemoryStream* CreateYuv422Sample(uint32 fourcc, - uint32 width, uint32 height) { - int y1_pos, y2_pos, u_pos, v_pos; - if (!GetYuv422Packing(fourcc, &y1_pos, &y2_pos, &u_pos, &v_pos)) { - return NULL; - } - - talk_base::scoped_ptr ms( - new talk_base::MemoryStream); - int awidth = (width + 1) & ~1; - int size = awidth * 2 * height; - if (!ms->ReserveSize(size)) { - return NULL; - } - for (uint32 y = 0; y < height; ++y) { - for (int x = 0; x < awidth; x += 2) { - uint8 quad[4]; - quad[y1_pos] = (x % 63 + y % 63) + 64; - quad[y2_pos] = ((x + 1) % 63 + y % 63) + 64; - quad[u_pos] = ((x / 63) & 1) ? 192 : 64; - quad[v_pos] = ((y / 63) & 1) ? 192 : 64; - ms->Write(quad, sizeof(quad), NULL, NULL); - } - } - return ms.release(); - } - - // Create a test image for YUV 420 formats with 12 bits per pixel. - talk_base::MemoryStream* CreateYuvSample(uint32 width, uint32 height, - uint32 bpp) { - talk_base::scoped_ptr ms( - new talk_base::MemoryStream); - if (!ms->ReserveSize(width * height * bpp / 8)) { - return NULL; - } - - for (uint32 i = 0; i < width * height * bpp / 8; ++i) { - char value = ((i / 63) & 1) ? 192 : 64; - ms->Write(&value, sizeof(value), NULL, NULL); - } - return ms.release(); - } - - talk_base::MemoryStream* CreateRgbSample(uint32 fourcc, - uint32 width, uint32 height) { - int r_pos, g_pos, b_pos, bytes; - if (!GetRgbPacking(fourcc, &r_pos, &g_pos, &b_pos, &bytes)) { - return NULL; - } - - talk_base::scoped_ptr ms( - new talk_base::MemoryStream); - if (!ms->ReserveSize(width * height * bytes)) { - return NULL; - } - - for (uint32 y = 0; y < height; ++y) { - for (uint32 x = 0; x < width; ++x) { - uint8 rgb[4] = { 255, 255, 255, 255 }; - rgb[r_pos] = ((x / 63) & 1) ? 224 : 32; - rgb[g_pos] = (x % 63 + y % 63) + 96; - rgb[b_pos] = ((y / 63) & 1) ? 224 : 32; - ms->Write(rgb, bytes, NULL, NULL); - } - } - return ms.release(); - } - - // Simple conversion routines to verify the optimized VideoFrame routines. - // Converts from the specified colorspace to I420. - bool ConvertYuv422(const talk_base::MemoryStream* ms, - uint32 fourcc, uint32 width, uint32 height, - T* frame) { - int y1_pos, y2_pos, u_pos, v_pos; - if (!GetYuv422Packing(fourcc, &y1_pos, &y2_pos, &u_pos, &v_pos)) { - return false; - } - - const uint8* start = reinterpret_cast(ms->GetBuffer()); - int awidth = (width + 1) & ~1; - frame->InitToBlack(width, height, 1, 1, 0, 0); - int stride_y = frame->GetYPitch(); - int stride_u = frame->GetUPitch(); - int stride_v = frame->GetVPitch(); - for (uint32 y = 0; y < height; ++y) { - for (uint32 x = 0; x < width; x += 2) { - const uint8* quad1 = start + (y * awidth + x) * 2; - frame->GetYPlane()[stride_y * y + x] = quad1[y1_pos]; - if ((x + 1) < width) { - frame->GetYPlane()[stride_y * y + x + 1] = quad1[y2_pos]; - } - if ((y & 1) == 0) { - const uint8* quad2 = quad1 + awidth * 2; - if ((y + 1) >= height) { - quad2 = quad1; - } - frame->GetUPlane()[stride_u * (y / 2) + x / 2] = - (quad1[u_pos] + quad2[u_pos] + 1) / 2; - frame->GetVPlane()[stride_v * (y / 2) + x / 2] = - (quad1[v_pos] + quad2[v_pos] + 1) / 2; - } - } - } - return true; - } - - // Convert RGB to 420. - // A negative height inverts the image. - bool ConvertRgb(const talk_base::MemoryStream* ms, - uint32 fourcc, int32 width, int32 height, - T* frame) { - int r_pos, g_pos, b_pos, bytes; - if (!GetRgbPacking(fourcc, &r_pos, &g_pos, &b_pos, &bytes)) { - return false; - } - int pitch = width * bytes; - const uint8* start = reinterpret_cast(ms->GetBuffer()); - if (height < 0) { - height = -height; - start = start + pitch * (height - 1); - pitch = -pitch; - } - frame->InitToBlack(width, height, 1, 1, 0, 0); - int stride_y = frame->GetYPitch(); - int stride_u = frame->GetUPitch(); - int stride_v = frame->GetVPitch(); - for (int32 y = 0; y < height; y += 2) { - for (int32 x = 0; x < width; x += 2) { - const uint8* rgb[4]; - uint8 yuv[4][3]; - rgb[0] = start + y * pitch + x * bytes; - rgb[1] = rgb[0] + ((x + 1) < width ? bytes : 0); - rgb[2] = rgb[0] + ((y + 1) < height ? pitch : 0); - rgb[3] = rgb[2] + ((x + 1) < width ? bytes : 0); - for (size_t i = 0; i < 4; ++i) { - ConvertRgbPixel(rgb[i][r_pos], rgb[i][g_pos], rgb[i][b_pos], - &yuv[i][0], &yuv[i][1], &yuv[i][2]); - } - frame->GetYPlane()[stride_y * y + x] = yuv[0][0]; - if ((x + 1) < width) { - frame->GetYPlane()[stride_y * y + x + 1] = yuv[1][0]; - } - if ((y + 1) < height) { - frame->GetYPlane()[stride_y * (y + 1) + x] = yuv[2][0]; - if ((x + 1) < width) { - frame->GetYPlane()[stride_y * (y + 1) + x + 1] = yuv[3][0]; - } - } - frame->GetUPlane()[stride_u * (y / 2) + x / 2] = - (yuv[0][1] + yuv[1][1] + yuv[2][1] + yuv[3][1] + 2) / 4; - frame->GetVPlane()[stride_v * (y / 2) + x / 2] = - (yuv[0][2] + yuv[1][2] + yuv[2][2] + yuv[3][2] + 2) / 4; - } - } - return true; - } - - // Simple and slow RGB->YUV conversion. From NTSC standard, c/o Wikipedia. - void ConvertRgbPixel(uint8 r, uint8 g, uint8 b, - uint8* y, uint8* u, uint8* v) { - *y = static_cast(.257 * r + .504 * g + .098 * b) + 16; - *u = static_cast(-.148 * r - .291 * g + .439 * b) + 128; - *v = static_cast(.439 * r - .368 * g - .071 * b) + 128; - } - - bool GetYuv422Packing(uint32 fourcc, - int* y1_pos, int* y2_pos, int* u_pos, int* v_pos) { - if (fourcc == cricket::FOURCC_YUY2) { - *y1_pos = 0; *u_pos = 1; *y2_pos = 2; *v_pos = 3; - } else if (fourcc == cricket::FOURCC_UYVY) { - *u_pos = 0; *y1_pos = 1; *v_pos = 2; *y2_pos = 3; - } else { - return false; - } - return true; - } - - bool GetRgbPacking(uint32 fourcc, - int* r_pos, int* g_pos, int* b_pos, int* bytes) { - if (fourcc == cricket::FOURCC_RAW) { - *r_pos = 0; *g_pos = 1; *b_pos = 2; *bytes = 3; // RGB in memory. - } else if (fourcc == cricket::FOURCC_24BG) { - *r_pos = 2; *g_pos = 1; *b_pos = 0; *bytes = 3; // BGR in memory. - } else if (fourcc == cricket::FOURCC_ABGR) { - *r_pos = 0; *g_pos = 1; *b_pos = 2; *bytes = 4; // RGBA in memory. - } else if (fourcc == cricket::FOURCC_BGRA) { - *r_pos = 1; *g_pos = 2; *b_pos = 3; *bytes = 4; // ARGB in memory. - } else if (fourcc == cricket::FOURCC_ARGB) { - *r_pos = 2; *g_pos = 1; *b_pos = 0; *bytes = 4; // BGRA in memory. - } else { - return false; - } - return true; - } - - // Comparison functions for testing. - static bool IsNull(const cricket::VideoFrame& frame) { - return !frame.GetYPlane(); - } - - static bool IsSize(const cricket::VideoFrame& frame, - uint32 width, uint32 height) { - return !IsNull(frame) && - frame.GetYPitch() >= static_cast(width) && - frame.GetUPitch() >= static_cast(width) / 2 && - frame.GetVPitch() >= static_cast(width) / 2 && - frame.GetWidth() == width && frame.GetHeight() == height; - } - - static bool IsPlaneEqual(const std::string& name, - const uint8* plane1, uint32 pitch1, - const uint8* plane2, uint32 pitch2, - uint32 width, uint32 height, - int max_error) { - const uint8* r1 = plane1; - const uint8* r2 = plane2; - for (uint32 y = 0; y < height; ++y) { - for (uint32 x = 0; x < width; ++x) { - if (abs(static_cast(r1[x] - r2[x])) > max_error) { - LOG(LS_INFO) << "IsPlaneEqual(" << name << "): pixel[" - << x << "," << y << "] differs: " - << static_cast(r1[x]) << " vs " - << static_cast(r2[x]); - return false; - } - } - r1 += pitch1; - r2 += pitch2; - } - return true; - } - - static bool IsEqual(const cricket::VideoFrame& frame, - size_t width, size_t height, - size_t pixel_width, size_t pixel_height, - int64 elapsed_time, int64 time_stamp, - const uint8* y, uint32 ypitch, - const uint8* u, uint32 upitch, - const uint8* v, uint32 vpitch, - int max_error) { - return IsSize(frame, width, height) && - frame.GetPixelWidth() == pixel_width && - frame.GetPixelHeight() == pixel_height && - frame.GetElapsedTime() == elapsed_time && - frame.GetTimeStamp() == time_stamp && - IsPlaneEqual("y", frame.GetYPlane(), frame.GetYPitch(), y, ypitch, - width, height, max_error) && - IsPlaneEqual("u", frame.GetUPlane(), frame.GetUPitch(), u, upitch, - (width + 1) / 2, (height + 1) / 2, max_error) && - IsPlaneEqual("v", frame.GetVPlane(), frame.GetVPitch(), v, vpitch, - (width + 1) / 2, (height + 1) / 2, max_error); - } - - static bool IsEqual(const cricket::VideoFrame& frame1, - const cricket::VideoFrame& frame2, - int max_error) { - return IsEqual(frame1, - frame2.GetWidth(), frame2.GetHeight(), - frame2.GetPixelWidth(), frame2.GetPixelHeight(), - frame2.GetElapsedTime(), frame2.GetTimeStamp(), - frame2.GetYPlane(), frame2.GetYPitch(), - frame2.GetUPlane(), frame2.GetUPitch(), - frame2.GetVPlane(), frame2.GetVPitch(), - max_error); - } - - static bool IsEqualWithCrop(const cricket::VideoFrame& frame1, - const cricket::VideoFrame& frame2, - int hcrop, int vcrop, int max_error) { - return frame1.GetWidth() <= frame2.GetWidth() && - frame1.GetHeight() <= frame2.GetHeight() && - IsEqual(frame1, - frame2.GetWidth() - hcrop * 2, - frame2.GetHeight() - vcrop * 2, - frame2.GetPixelWidth(), frame2.GetPixelHeight(), - frame2.GetElapsedTime(), frame2.GetTimeStamp(), - frame2.GetYPlane() + vcrop * frame2.GetYPitch() - + hcrop, - frame2.GetYPitch(), - frame2.GetUPlane() + vcrop * frame2.GetUPitch() / 2 - + hcrop / 2, - frame2.GetUPitch(), - frame2.GetVPlane() + vcrop * frame2.GetVPitch() / 2 - + hcrop / 2, - frame2.GetVPitch(), - max_error); - } - - static bool IsBlack(const cricket::VideoFrame& frame) { - return !IsNull(frame) && - *frame.GetYPlane() == 16 && - *frame.GetUPlane() == 128 && - *frame.GetVPlane() == 128; - } - - //////////////////////// - // Construction tests // - //////////////////////// - - // Test constructing an image from a I420 buffer. - void ConstructI420() { - T frame; - EXPECT_TRUE(IsNull(frame)); - talk_base::scoped_ptr ms( - CreateYuvSample(kWidth, kHeight, 12)); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_I420, - kWidth, kHeight, &frame)); - - const uint8* y = reinterpret_cast(ms.get()->GetBuffer()); - const uint8* u = y + kWidth * kHeight; - const uint8* v = u + kWidth * kHeight / 4; - EXPECT_TRUE(IsEqual(frame, kWidth, kHeight, 1, 1, 0, 0, - y, kWidth, u, kWidth / 2, v, kWidth / 2, 0)); - } - - // Test constructing an image from a YV12 buffer. - void ConstructYV12() { - T frame; - talk_base::scoped_ptr ms( - CreateYuvSample(kWidth, kHeight, 12)); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_YV12, - kWidth, kHeight, &frame)); - - const uint8* y = reinterpret_cast(ms.get()->GetBuffer()); - const uint8* v = y + kWidth * kHeight; - const uint8* u = v + kWidth * kHeight / 4; - EXPECT_TRUE(IsEqual(frame, kWidth, kHeight, 1, 1, 0, 0, - y, kWidth, u, kWidth / 2, v, kWidth / 2, 0)); - } - - // Test constructing an image from a I422 buffer. - void ConstructI422() { - T frame1, frame2; - ASSERT_TRUE(LoadFrameNoRepeat(&frame1)); - size_t buf_size = kWidth * kHeight * 2; - talk_base::scoped_ptr buf(new uint8[buf_size + kAlignment]); - uint8* y = ALIGNP(buf.get(), kAlignment); - uint8* u = y + kWidth * kHeight; - uint8* v = u + (kWidth / 2) * kHeight; - EXPECT_EQ(0, libyuv::I420ToI422(frame1.GetYPlane(), frame1.GetYPitch(), - frame1.GetUPlane(), frame1.GetUPitch(), - frame1.GetVPlane(), frame1.GetVPitch(), - y, kWidth, - u, kWidth / 2, - v, kWidth / 2, - kWidth, kHeight)); - EXPECT_TRUE(LoadFrame(y, buf_size, cricket::FOURCC_I422, - kWidth, kHeight, &frame2)); - EXPECT_TRUE(IsEqual(frame1, frame2, 1)); - } - - // Test constructing an image from a YUY2 buffer. - void ConstructYuy2() { - T frame1, frame2; - ASSERT_TRUE(LoadFrameNoRepeat(&frame1)); - size_t buf_size = kWidth * kHeight * 2; - talk_base::scoped_ptr buf(new uint8[buf_size + kAlignment]); - uint8* yuy2 = ALIGNP(buf.get(), kAlignment); - EXPECT_EQ(0, libyuv::I420ToYUY2(frame1.GetYPlane(), frame1.GetYPitch(), - frame1.GetUPlane(), frame1.GetUPitch(), - frame1.GetVPlane(), frame1.GetVPitch(), - yuy2, kWidth * 2, - kWidth, kHeight)); - EXPECT_TRUE(LoadFrame(yuy2, buf_size, cricket::FOURCC_YUY2, - kWidth, kHeight, &frame2)); - EXPECT_TRUE(IsEqual(frame1, frame2, 0)); - } - - // Test constructing an image from a YUY2 buffer with buffer unaligned. - void ConstructYuy2Unaligned() { - T frame1, frame2; - ASSERT_TRUE(LoadFrameNoRepeat(&frame1)); - size_t buf_size = kWidth * kHeight * 2; - talk_base::scoped_ptr buf(new uint8[buf_size + kAlignment + 1]); - uint8* yuy2 = ALIGNP(buf.get(), kAlignment) + 1; - EXPECT_EQ(0, libyuv::I420ToYUY2(frame1.GetYPlane(), frame1.GetYPitch(), - frame1.GetUPlane(), frame1.GetUPitch(), - frame1.GetVPlane(), frame1.GetVPitch(), - yuy2, kWidth * 2, - kWidth, kHeight)); - EXPECT_TRUE(LoadFrame(yuy2, buf_size, cricket::FOURCC_YUY2, - kWidth, kHeight, &frame2)); - EXPECT_TRUE(IsEqual(frame1, frame2, 0)); - } - - // Test constructing an image from a wide YUY2 buffer. - // Normal is 1280x720. Wide is 12800x72 - void ConstructYuy2Wide() { - T frame1, frame2; - talk_base::scoped_ptr ms( - CreateYuv422Sample(cricket::FOURCC_YUY2, kWidth * 10, kHeight / 10)); - ASSERT_TRUE(ms.get() != NULL); - EXPECT_TRUE(ConvertYuv422(ms.get(), cricket::FOURCC_YUY2, - kWidth * 10, kHeight / 10, - &frame1)); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_YUY2, - kWidth * 10, kHeight / 10, &frame2)); - EXPECT_TRUE(IsEqual(frame1, frame2, 0)); - } - - // Test constructing an image from a UYVY buffer. - void ConstructUyvy() { - T frame1, frame2; - talk_base::scoped_ptr ms( - CreateYuv422Sample(cricket::FOURCC_UYVY, kWidth, kHeight)); - ASSERT_TRUE(ms.get() != NULL); - EXPECT_TRUE(ConvertYuv422(ms.get(), cricket::FOURCC_UYVY, kWidth, kHeight, - &frame1)); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_UYVY, - kWidth, kHeight, &frame2)); - EXPECT_TRUE(IsEqual(frame1, frame2, 0)); - } - - // Test constructing an image from a random buffer. - // We are merely verifying that the code succeeds and is free of crashes. - void ConstructM420() { - T frame; - talk_base::scoped_ptr ms( - CreateYuvSample(kWidth, kHeight, 12)); - ASSERT_TRUE(ms.get() != NULL); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_M420, - kWidth, kHeight, &frame)); - } - - void ConstructQ420() { - T frame; - talk_base::scoped_ptr ms( - CreateYuvSample(kWidth, kHeight, 12)); - ASSERT_TRUE(ms.get() != NULL); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_Q420, - kWidth, kHeight, &frame)); - } - - void ConstructNV21() { - T frame; - talk_base::scoped_ptr ms( - CreateYuvSample(kWidth, kHeight, 12)); - ASSERT_TRUE(ms.get() != NULL); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_NV21, - kWidth, kHeight, &frame)); - } - - void ConstructNV12() { - T frame; - talk_base::scoped_ptr ms( - CreateYuvSample(kWidth, kHeight, 12)); - ASSERT_TRUE(ms.get() != NULL); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_NV12, - kWidth, kHeight, &frame)); - } - - // Test constructing an image from a ABGR buffer - // Due to rounding, some pixels may differ slightly from the VideoFrame impl. - void ConstructABGR() { - T frame1, frame2; - talk_base::scoped_ptr ms( - CreateRgbSample(cricket::FOURCC_ABGR, kWidth, kHeight)); - ASSERT_TRUE(ms.get() != NULL); - EXPECT_TRUE(ConvertRgb(ms.get(), cricket::FOURCC_ABGR, kWidth, kHeight, - &frame1)); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_ABGR, - kWidth, kHeight, &frame2)); - EXPECT_TRUE(IsEqual(frame1, frame2, 2)); - } - - // Test constructing an image from a ARGB buffer - // Due to rounding, some pixels may differ slightly from the VideoFrame impl. - void ConstructARGB() { - T frame1, frame2; - talk_base::scoped_ptr ms( - CreateRgbSample(cricket::FOURCC_ARGB, kWidth, kHeight)); - ASSERT_TRUE(ms.get() != NULL); - EXPECT_TRUE(ConvertRgb(ms.get(), cricket::FOURCC_ARGB, kWidth, kHeight, - &frame1)); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_ARGB, - kWidth, kHeight, &frame2)); - EXPECT_TRUE(IsEqual(frame1, frame2, 2)); - } - - // Test constructing an image from a wide ARGB buffer - // Normal is 1280x720. Wide is 12800x72 - void ConstructARGBWide() { - T frame1, frame2; - talk_base::scoped_ptr ms( - CreateRgbSample(cricket::FOURCC_ARGB, kWidth * 10, kHeight / 10)); - ASSERT_TRUE(ms.get() != NULL); - EXPECT_TRUE(ConvertRgb(ms.get(), cricket::FOURCC_ARGB, - kWidth * 10, kHeight / 10, &frame1)); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_ARGB, - kWidth * 10, kHeight / 10, &frame2)); - EXPECT_TRUE(IsEqual(frame1, frame2, 2)); - } - - // Test constructing an image from an BGRA buffer. - // Due to rounding, some pixels may differ slightly from the VideoFrame impl. - void ConstructBGRA() { - T frame1, frame2; - talk_base::scoped_ptr ms( - CreateRgbSample(cricket::FOURCC_BGRA, kWidth, kHeight)); - ASSERT_TRUE(ms.get() != NULL); - EXPECT_TRUE(ConvertRgb(ms.get(), cricket::FOURCC_BGRA, kWidth, kHeight, - &frame1)); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_BGRA, - kWidth, kHeight, &frame2)); - EXPECT_TRUE(IsEqual(frame1, frame2, 2)); - } - - // Test constructing an image from a 24BG buffer. - // Due to rounding, some pixels may differ slightly from the VideoFrame impl. - void Construct24BG() { - T frame1, frame2; - talk_base::scoped_ptr ms( - CreateRgbSample(cricket::FOURCC_24BG, kWidth, kHeight)); - ASSERT_TRUE(ms.get() != NULL); - EXPECT_TRUE(ConvertRgb(ms.get(), cricket::FOURCC_24BG, kWidth, kHeight, - &frame1)); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_24BG, - kWidth, kHeight, &frame2)); - EXPECT_TRUE(IsEqual(frame1, frame2, 2)); - } - - // Test constructing an image from a raw RGB buffer. - // Due to rounding, some pixels may differ slightly from the VideoFrame impl. - void ConstructRaw() { - T frame1, frame2; - talk_base::scoped_ptr ms( - CreateRgbSample(cricket::FOURCC_RAW, kWidth, kHeight)); - ASSERT_TRUE(ms.get() != NULL); - EXPECT_TRUE(ConvertRgb(ms.get(), cricket::FOURCC_RAW, kWidth, kHeight, - &frame1)); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_RAW, - kWidth, kHeight, &frame2)); - EXPECT_TRUE(IsEqual(frame1, frame2, 2)); - } - - // Test constructing an image from a RGB565 buffer - void ConstructRGB565() { - T frame1, frame2; - size_t out_size = kWidth * kHeight * 2; - talk_base::scoped_ptr outbuf(new uint8[out_size + kAlignment]); - uint8 *out = ALIGNP(outbuf.get(), kAlignment); - T frame; - ASSERT_TRUE(LoadFrameNoRepeat(&frame1)); - EXPECT_EQ(out_size, frame1.ConvertToRgbBuffer(cricket::FOURCC_RGBP, - out, - out_size, kWidth * 2)); - EXPECT_TRUE(LoadFrame(out, out_size, cricket::FOURCC_RGBP, - kWidth, kHeight, &frame2)); - EXPECT_TRUE(IsEqual(frame1, frame2, 20)); - } - - // Test constructing an image from a ARGB1555 buffer - void ConstructARGB1555() { - T frame1, frame2; - size_t out_size = kWidth * kHeight * 2; - talk_base::scoped_ptr outbuf(new uint8[out_size + kAlignment]); - uint8 *out = ALIGNP(outbuf.get(), kAlignment); - T frame; - ASSERT_TRUE(LoadFrameNoRepeat(&frame1)); - EXPECT_EQ(out_size, frame1.ConvertToRgbBuffer(cricket::FOURCC_RGBO, - out, - out_size, kWidth * 2)); - EXPECT_TRUE(LoadFrame(out, out_size, cricket::FOURCC_RGBO, - kWidth, kHeight, &frame2)); - EXPECT_TRUE(IsEqual(frame1, frame2, 20)); - } - - // Test constructing an image from a ARGB4444 buffer - void ConstructARGB4444() { - T frame1, frame2; - size_t out_size = kWidth * kHeight * 2; - talk_base::scoped_ptr outbuf(new uint8[out_size + kAlignment]); - uint8 *out = ALIGNP(outbuf.get(), kAlignment); - T frame; - ASSERT_TRUE(LoadFrameNoRepeat(&frame1)); - EXPECT_EQ(out_size, frame1.ConvertToRgbBuffer(cricket::FOURCC_R444, - out, - out_size, kWidth * 2)); - EXPECT_TRUE(LoadFrame(out, out_size, cricket::FOURCC_R444, - kWidth, kHeight, &frame2)); - EXPECT_TRUE(IsEqual(frame1, frame2, 20)); - } - - // Macro to help test different Bayer formats. - // Error threshold of 60 allows for Bayer format subsampling. - // TODO(fbarchard): Refactor this test to go from Bayer to I420 and - // back to bayer, which would be less lossy. - #define TEST_BYR(NAME, BAYER) \ - void NAME() { \ - size_t bayer_size = kWidth * kHeight; \ - talk_base::scoped_ptr bayerbuf(new uint8[ \ - bayer_size + kAlignment]); \ - uint8 *bayer = ALIGNP(bayerbuf.get(), kAlignment); \ - T frame1, frame2; \ - talk_base::scoped_ptr ms( \ - CreateRgbSample(cricket::FOURCC_ARGB, kWidth, kHeight)); \ - ASSERT_TRUE(ms.get() != NULL); \ - libyuv::ARGBToBayer##BAYER(reinterpret_cast(ms->GetBuffer()), \ - kWidth * 4, \ - bayer, kWidth, \ - kWidth, kHeight); \ - EXPECT_TRUE(LoadFrame(bayer, bayer_size, cricket::FOURCC_##BAYER, \ - kWidth, kHeight, &frame1)); \ - EXPECT_TRUE(ConvertRgb(ms.get(), cricket::FOURCC_ARGB, kWidth, kHeight, \ - &frame2)); \ - EXPECT_TRUE(IsEqual(frame1, frame2, 60)); \ - } - - // Test constructing an image from Bayer formats. - TEST_BYR(ConstructBayerGRBG, GRBG) - TEST_BYR(ConstructBayerGBRG, GBRG) - TEST_BYR(ConstructBayerBGGR, BGGR) - TEST_BYR(ConstructBayerRGGB, RGGB) - - -// Macro to help test different rotations -#define TEST_MIRROR(FOURCC, BPP) \ -void Construct##FOURCC##Mirror() { \ - T frame1, frame2, frame3; \ - talk_base::scoped_ptr ms( \ - CreateYuvSample(kWidth, kHeight, BPP)); \ - ASSERT_TRUE(ms.get() != NULL); \ - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_##FOURCC, \ - kWidth, -kHeight, kWidth, kHeight, \ - cricket::ROTATION_180, &frame1)); \ - size_t data_size; \ - bool ret = ms->GetSize(&data_size); \ - EXPECT_TRUE(ret); \ - EXPECT_TRUE(frame2.Init(cricket::FOURCC_##FOURCC, \ - kWidth, kHeight, kWidth, kHeight, \ - reinterpret_cast(ms->GetBuffer()), \ - data_size, \ - 1, 1, 0, 0, 0)); \ - int width_rotate = frame1.GetWidth(); \ - int height_rotate = frame1.GetHeight(); \ - EXPECT_TRUE(frame3.InitToBlack(width_rotate, height_rotate, 1, 1, 0, 0)); \ - libyuv::I420Mirror(frame2.GetYPlane(), frame2.GetYPitch(), \ - frame2.GetUPlane(), frame2.GetUPitch(), \ - frame2.GetVPlane(), frame2.GetVPitch(), \ - frame3.GetYPlane(), frame3.GetYPitch(), \ - frame3.GetUPlane(), frame3.GetUPitch(), \ - frame3.GetVPlane(), frame3.GetVPitch(), \ - kWidth, kHeight); \ - EXPECT_TRUE(IsEqual(frame1, frame3, 0)); \ - } - - TEST_MIRROR(I420, 420) - -// Macro to help test different rotations -#define TEST_ROTATE(FOURCC, BPP, ROTATE) \ -void Construct##FOURCC##Rotate##ROTATE() { \ - T frame1, frame2, frame3; \ - talk_base::scoped_ptr ms( \ - CreateYuvSample(kWidth, kHeight, BPP)); \ - ASSERT_TRUE(ms.get() != NULL); \ - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_##FOURCC, \ - kWidth, kHeight, kWidth, kHeight, \ - cricket::ROTATION_##ROTATE, &frame1)); \ - size_t data_size; \ - bool ret = ms->GetSize(&data_size); \ - EXPECT_TRUE(ret); \ - EXPECT_TRUE(frame2.Init(cricket::FOURCC_##FOURCC, \ - kWidth, kHeight, kWidth, kHeight, \ - reinterpret_cast(ms->GetBuffer()), \ - data_size, \ - 1, 1, 0, 0, 0)); \ - int width_rotate = frame1.GetWidth(); \ - int height_rotate = frame1.GetHeight(); \ - EXPECT_TRUE(frame3.InitToBlack(width_rotate, height_rotate, 1, 1, 0, 0)); \ - libyuv::I420Rotate(frame2.GetYPlane(), frame2.GetYPitch(), \ - frame2.GetUPlane(), frame2.GetUPitch(), \ - frame2.GetVPlane(), frame2.GetVPitch(), \ - frame3.GetYPlane(), frame3.GetYPitch(), \ - frame3.GetUPlane(), frame3.GetUPitch(), \ - frame3.GetVPlane(), frame3.GetVPitch(), \ - kWidth, kHeight, libyuv::kRotate##ROTATE); \ - EXPECT_TRUE(IsEqual(frame1, frame3, 0)); \ - } - - // Test constructing an image with rotation. - TEST_ROTATE(I420, 12, 0) - TEST_ROTATE(I420, 12, 90) - TEST_ROTATE(I420, 12, 180) - TEST_ROTATE(I420, 12, 270) - TEST_ROTATE(YV12, 12, 0) - TEST_ROTATE(YV12, 12, 90) - TEST_ROTATE(YV12, 12, 180) - TEST_ROTATE(YV12, 12, 270) - TEST_ROTATE(NV12, 12, 0) - TEST_ROTATE(NV12, 12, 90) - TEST_ROTATE(NV12, 12, 180) - TEST_ROTATE(NV12, 12, 270) - TEST_ROTATE(NV21, 12, 0) - TEST_ROTATE(NV21, 12, 90) - TEST_ROTATE(NV21, 12, 180) - TEST_ROTATE(NV21, 12, 270) - TEST_ROTATE(UYVY, 16, 0) - TEST_ROTATE(UYVY, 16, 90) - TEST_ROTATE(UYVY, 16, 180) - TEST_ROTATE(UYVY, 16, 270) - TEST_ROTATE(YUY2, 16, 0) - TEST_ROTATE(YUY2, 16, 90) - TEST_ROTATE(YUY2, 16, 180) - TEST_ROTATE(YUY2, 16, 270) - - // Test constructing an image from a UYVY buffer rotated 90 degrees. - void ConstructUyvyRotate90() { - T frame2; - talk_base::scoped_ptr ms( - CreateYuv422Sample(cricket::FOURCC_UYVY, kWidth, kHeight)); - ASSERT_TRUE(ms.get() != NULL); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_UYVY, - kWidth, kHeight, kWidth, kHeight, - cricket::ROTATION_90, &frame2)); - } - - // Test constructing an image from a UYVY buffer rotated 180 degrees. - void ConstructUyvyRotate180() { - T frame2; - talk_base::scoped_ptr ms( - CreateYuv422Sample(cricket::FOURCC_UYVY, kWidth, kHeight)); - ASSERT_TRUE(ms.get() != NULL); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_UYVY, - kWidth, kHeight, kWidth, kHeight, - cricket::ROTATION_180, &frame2)); - } - - // Test constructing an image from a UYVY buffer rotated 270 degrees. - void ConstructUyvyRotate270() { - T frame2; - talk_base::scoped_ptr ms( - CreateYuv422Sample(cricket::FOURCC_UYVY, kWidth, kHeight)); - ASSERT_TRUE(ms.get() != NULL); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_UYVY, - kWidth, kHeight, kWidth, kHeight, - cricket::ROTATION_270, &frame2)); - } - - // Test constructing an image from a YUY2 buffer rotated 90 degrees. - void ConstructYuy2Rotate90() { - T frame2; - talk_base::scoped_ptr ms( - CreateYuv422Sample(cricket::FOURCC_YUY2, kWidth, kHeight)); - ASSERT_TRUE(ms.get() != NULL); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_YUY2, - kWidth, kHeight, kWidth, kHeight, - cricket::ROTATION_90, &frame2)); - } - - // Test constructing an image from a YUY2 buffer rotated 180 degrees. - void ConstructYuy2Rotate180() { - T frame2; - talk_base::scoped_ptr ms( - CreateYuv422Sample(cricket::FOURCC_YUY2, kWidth, kHeight)); - ASSERT_TRUE(ms.get() != NULL); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_YUY2, - kWidth, kHeight, kWidth, kHeight, - cricket::ROTATION_180, &frame2)); - } - - // Test constructing an image from a YUY2 buffer rotated 270 degrees. - void ConstructYuy2Rotate270() { - T frame2; - talk_base::scoped_ptr ms( - CreateYuv422Sample(cricket::FOURCC_YUY2, kWidth, kHeight)); - ASSERT_TRUE(ms.get() != NULL); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_YUY2, - kWidth, kHeight, kWidth, kHeight, - cricket::ROTATION_270, &frame2)); - } - - // Test 1 pixel edge case image I420 buffer. - void ConstructI4201Pixel() { - T frame; - uint8 pixel[3] = { 1, 2, 3 }; - for (int i = 0; i < repeat_; ++i) { - EXPECT_TRUE(frame.Init(cricket::FOURCC_I420, 1, 1, 1, 1, - pixel, sizeof(pixel), - 1, 1, 0, 0, 0)); - } - const uint8* y = pixel; - const uint8* u = y + 1; - const uint8* v = u + 1; - EXPECT_TRUE(IsEqual(frame, 1, 1, 1, 1, 0, 0, - y, 1, u, 1, v, 1, 0)); - } - - // Test 5 pixel edge case image I420 buffer rounds down to 4. - void ConstructI4205Pixel() { - T frame; - uint8 pixels5x5[5 * 5 + ((5 + 1) / 2 * (5 + 1) / 2) * 2]; - memset(pixels5x5, 1, 5 * 5 + ((5 + 1) / 2 * (5 + 1) / 2) * 2); - for (int i = 0; i < repeat_; ++i) { - EXPECT_TRUE(frame.Init(cricket::FOURCC_I420, 5, 5, 5, 5, - pixels5x5, sizeof(pixels5x5), - 1, 1, 0, 0, 0)); - } - EXPECT_EQ(4u, frame.GetWidth()); - EXPECT_EQ(4u, frame.GetHeight()); - EXPECT_EQ(4, frame.GetYPitch()); - EXPECT_EQ(2, frame.GetUPitch()); - EXPECT_EQ(2, frame.GetVPitch()); - } - - // Test 1 pixel edge case image ARGB buffer. - void ConstructARGB1Pixel() { - T frame; - uint8 pixel[4] = { 64, 128, 192, 255 }; - for (int i = 0; i < repeat_; ++i) { - EXPECT_TRUE(frame.Init(cricket::FOURCC_ARGB, 1, 1, 1, 1, - pixel, sizeof(pixel), - 1, 1, 0, 0, 0)); - } - // Convert back to ARGB. - size_t out_size = 4; - talk_base::scoped_ptr outbuf(new uint8[out_size + kAlignment]); - uint8 *out = ALIGNP(outbuf.get(), kAlignment); - - EXPECT_EQ(out_size, frame.ConvertToRgbBuffer(cricket::FOURCC_ARGB, - out, - out_size, // buffer size - out_size)); // stride - #ifdef USE_LMI_CONVERT - // TODO(fbarchard): Expected to fail, but not crash. - EXPECT_FALSE(IsPlaneEqual("argb", pixel, 4, out, 4, 3, 1, 2)); - #else - // TODO(fbarchard): Check for overwrite. - EXPECT_TRUE(IsPlaneEqual("argb", pixel, 4, out, 4, 3, 1, 2)); - #endif - } - - // Test Black, White and Grey pixels. - void ConstructARGBBlackWhitePixel() { - T frame; - uint8 pixel[10 * 4] = { 0, 0, 0, 255, // Black. - 0, 0, 0, 255, - 64, 64, 64, 255, // Dark Grey. - 64, 64, 64, 255, - 128, 128, 128, 255, // Grey. - 128, 128, 128, 255, - 196, 196, 196, 255, // Light Grey. - 196, 196, 196, 255, - 255, 255, 255, 255, // White. - 255, 255, 255, 255 }; - - for (int i = 0; i < repeat_; ++i) { - EXPECT_TRUE(frame.Init(cricket::FOURCC_ARGB, 10, 1, 10, 1, - pixel, sizeof(pixel), - 1, 1, 0, 0, 0)); - } - // Convert back to ARGB - size_t out_size = 10 * 4; - talk_base::scoped_ptr outbuf(new uint8[out_size + kAlignment]); - uint8 *out = ALIGNP(outbuf.get(), kAlignment); - - EXPECT_EQ(out_size, frame.ConvertToRgbBuffer(cricket::FOURCC_ARGB, - out, - out_size, // buffer size. - out_size)); // stride. - EXPECT_TRUE(IsPlaneEqual("argb", pixel, out_size, - out, out_size, - out_size, 1, 2)); - } - - // Test constructing an image from an I420 buffer with horizontal cropping. - void ConstructI420CropHorizontal() { - T frame1, frame2; - ASSERT_TRUE(LoadFrameNoRepeat(&frame1)); - ASSERT_TRUE(LoadFrame(kImageFilename, cricket::FOURCC_I420, kWidth, kHeight, - kWidth * 3 / 4, kHeight, 0, &frame2)); - EXPECT_TRUE(IsEqualWithCrop(frame2, frame1, kWidth / 8, 0, 0)); - } - - // Test constructing an image from a YUY2 buffer with horizontal cropping. - void ConstructYuy2CropHorizontal() { - T frame1, frame2; - talk_base::scoped_ptr ms( - CreateYuv422Sample(cricket::FOURCC_YUY2, kWidth, kHeight)); - ASSERT_TRUE(ms.get() != NULL); - EXPECT_TRUE(ConvertYuv422(ms.get(), cricket::FOURCC_YUY2, kWidth, kHeight, - &frame1)); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_YUY2, kWidth, kHeight, - kWidth * 3 / 4, kHeight, 0, &frame2)); - EXPECT_TRUE(IsEqualWithCrop(frame2, frame1, kWidth / 8, 0, 0)); - } - - // Test constructing an image from an ARGB buffer with horizontal cropping. - void ConstructARGBCropHorizontal() { - T frame1, frame2; - talk_base::scoped_ptr ms( - CreateRgbSample(cricket::FOURCC_ARGB, kWidth, kHeight)); - ASSERT_TRUE(ms.get() != NULL); - EXPECT_TRUE(ConvertRgb(ms.get(), cricket::FOURCC_ARGB, kWidth, kHeight, - &frame1)); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_ARGB, kWidth, kHeight, - kWidth * 3 / 4, kHeight, 0, &frame2)); - EXPECT_TRUE(IsEqualWithCrop(frame2, frame1, kWidth / 8, 0, 2)); - } - - // Test constructing an image from an I420 buffer, cropping top and bottom. - void ConstructI420CropVertical() { - T frame1, frame2; - ASSERT_TRUE(LoadFrameNoRepeat(&frame1)); - ASSERT_TRUE(LoadFrame(kImageFilename, cricket::FOURCC_I420, kWidth, kHeight, - kWidth, kHeight * 3 / 4, 0, &frame2)); - EXPECT_TRUE(IsEqualWithCrop(frame2, frame1, 0, kHeight / 8, 0)); - } - - // Test constructing an image from I420 synonymous formats. - void ConstructI420Aliases() { - T frame1, frame2, frame3; - ASSERT_TRUE(LoadFrame(kImageFilename, cricket::FOURCC_I420, kWidth, kHeight, - &frame1)); - ASSERT_TRUE(LoadFrame(kImageFilename, cricket::FOURCC_IYUV, kWidth, kHeight, - &frame2)); - ASSERT_TRUE(LoadFrame(kImageFilename, cricket::FOURCC_YU12, kWidth, kHeight, - &frame3)); - EXPECT_TRUE(IsEqual(frame1, frame2, 0)); - EXPECT_TRUE(IsEqual(frame1, frame3, 0)); - } - - // Test constructing an image from an I420 MJPG buffer. - void ConstructMjpgI420() { - T frame1, frame2; - ASSERT_TRUE(LoadFrameNoRepeat(&frame1)); - ASSERT_TRUE(LoadFrame(kJpeg420Filename, - cricket::FOURCC_MJPG, kWidth, kHeight, &frame2)); - EXPECT_TRUE(IsEqual(frame1, frame2, 32)); - } - - // Test constructing an image from an I422 MJPG buffer. - void ConstructMjpgI422() { - T frame1, frame2; - ASSERT_TRUE(LoadFrameNoRepeat(&frame1)); - ASSERT_TRUE(LoadFrame(kJpeg422Filename, - cricket::FOURCC_MJPG, kWidth, kHeight, &frame2)); - EXPECT_TRUE(IsEqual(frame1, frame2, 32)); - } - - // Test constructing an image from an I444 MJPG buffer. - void ConstructMjpgI444() { - T frame1, frame2; - ASSERT_TRUE(LoadFrameNoRepeat(&frame1)); - ASSERT_TRUE(LoadFrame(kJpeg444Filename, - cricket::FOURCC_MJPG, kWidth, kHeight, &frame2)); - EXPECT_TRUE(IsEqual(frame1, frame2, 32)); - } - - // Test constructing an image from an I444 MJPG buffer. - void ConstructMjpgI411() { - T frame1, frame2; - ASSERT_TRUE(LoadFrameNoRepeat(&frame1)); - ASSERT_TRUE(LoadFrame(kJpeg411Filename, - cricket::FOURCC_MJPG, kWidth, kHeight, &frame2)); - EXPECT_TRUE(IsEqual(frame1, frame2, 32)); - } - - // Test constructing an image from an I400 MJPG buffer. - // TODO(fbarchard): Stronger compare on chroma. Compare agaisnt a grey image. - void ConstructMjpgI400() { - T frame1, frame2; - ASSERT_TRUE(LoadFrameNoRepeat(&frame1)); - ASSERT_TRUE(LoadFrame(kJpeg400Filename, - cricket::FOURCC_MJPG, kWidth, kHeight, &frame2)); - EXPECT_TRUE(IsPlaneEqual("y", frame1.GetYPlane(), frame1.GetYPitch(), - frame2.GetYPlane(), frame2.GetYPitch(), - kWidth, kHeight, 32)); - EXPECT_TRUE(IsEqual(frame1, frame2, 128)); - } - - // Test constructing an image from an I420 MJPG buffer. - void ValidateFrame(const char* name, uint32 fourcc, int data_adjust, - int size_adjust, bool expected_result) { - T frame; - talk_base::scoped_ptr ms(LoadSample(name)); - ASSERT_TRUE(ms.get() != NULL); - const uint8* sample = reinterpret_cast(ms.get()->GetBuffer()); - size_t sample_size; - ms->GetSize(&sample_size); - // Optional adjust size to test invalid size. - size_t data_size = sample_size + data_adjust; - - // Allocate a buffer with end page aligned. - const int kPadToHeapSized = 16 * 1024 * 1024; - talk_base::scoped_ptr page_buffer( - new uint8[((data_size + kPadToHeapSized + 4095) & ~4095)]); - uint8* data_ptr = page_buffer.get(); - if (!data_ptr) { - LOG(LS_WARNING) << "Failed to allocate memory for ValidateFrame test."; - EXPECT_FALSE(expected_result); // NULL is okay if failure was expected. - return; - } - data_ptr += kPadToHeapSized + (-(static_cast(data_size)) & 4095); - memcpy(data_ptr, sample, talk_base::_min(data_size, sample_size)); - for (int i = 0; i < repeat_; ++i) { - EXPECT_EQ(expected_result, frame.Validate(fourcc, kWidth, kHeight, - data_ptr, - sample_size + size_adjust)); - } - } - - // Test validate for I420 MJPG buffer. - void ValidateMjpgI420() { - ValidateFrame(kJpeg420Filename, cricket::FOURCC_MJPG, 0, 0, true); - } - - // Test validate for I422 MJPG buffer. - void ValidateMjpgI422() { - ValidateFrame(kJpeg422Filename, cricket::FOURCC_MJPG, 0, 0, true); - } - - // Test validate for I444 MJPG buffer. - void ValidateMjpgI444() { - ValidateFrame(kJpeg444Filename, cricket::FOURCC_MJPG, 0, 0, true); - } - - // Test validate for I411 MJPG buffer. - void ValidateMjpgI411() { - ValidateFrame(kJpeg411Filename, cricket::FOURCC_MJPG, 0, 0, true); - } - - // Test validate for I400 MJPG buffer. - void ValidateMjpgI400() { - ValidateFrame(kJpeg400Filename, cricket::FOURCC_MJPG, 0, 0, true); - } - - // Test validate for I420 buffer. - void ValidateI420() { - ValidateFrame(kImageFilename, cricket::FOURCC_I420, 0, 0, true); - } - - // Test validate for I420 buffer where size is too small - void ValidateI420SmallSize() { - ValidateFrame(kImageFilename, cricket::FOURCC_I420, 0, -16384, false); - } - - // Test validate for I420 buffer where size is too large (16 MB) - // Will produce warning but pass. - void ValidateI420LargeSize() { - ValidateFrame(kImageFilename, cricket::FOURCC_I420, 16000000, 16000000, - true); - } - - // Test validate for I420 buffer where size is 1 GB (not reasonable). - void ValidateI420HugeSize() { -#ifndef WIN32 // TODO(fbarchard): Reenable when fixing bug 9603762. - ValidateFrame(kImageFilename, cricket::FOURCC_I420, 1000000000u, - 1000000000u, false); -#endif - } - - // The following test that Validate crashes if the size is greater than the - // actual buffer size. - // TODO(fbarchard): Consider moving a filter into the capturer/plugin. -#if defined(_MSC_VER) && defined(_DEBUG) - int ExceptionFilter(unsigned int code, struct _EXCEPTION_POINTERS *ep) { - if (code == EXCEPTION_ACCESS_VIOLATION) { - LOG(LS_INFO) << "Caught EXCEPTION_ACCESS_VIOLATION as expected."; - return EXCEPTION_EXECUTE_HANDLER; - } else { - LOG(LS_INFO) << "Did not catch EXCEPTION_ACCESS_VIOLATION. Unexpected."; - return EXCEPTION_CONTINUE_SEARCH; - } - } - - // Test validate fails for truncated MJPG data buffer. If ValidateFrame - // crashes the exception handler will return and unittest passes with OK. - void ValidateMjpgI420InvalidSize() { - __try { - ValidateFrame(kJpeg420Filename, cricket::FOURCC_MJPG, -16384, 0, false); - FAIL() << "Validate was expected to cause EXCEPTION_ACCESS_VIOLATION."; - } __except(ExceptionFilter(GetExceptionCode(), GetExceptionInformation())) { - return; // Successfully crashed in ValidateFrame. - } - } - - // Test validate fails for truncated I420 buffer. - void ValidateI420InvalidSize() { - __try { - ValidateFrame(kImageFilename, cricket::FOURCC_I420, -16384, 0, false); - FAIL() << "Validate was expected to cause EXCEPTION_ACCESS_VIOLATION."; - } __except(ExceptionFilter(GetExceptionCode(), GetExceptionInformation())) { - return; // Successfully crashed in ValidateFrame. - } - } -#endif - - // Test constructing an image from a YUY2 buffer (and synonymous formats). - void ConstructYuy2Aliases() { - T frame1, frame2, frame3, frame4; - talk_base::scoped_ptr ms( - CreateYuv422Sample(cricket::FOURCC_YUY2, kWidth, kHeight)); - ASSERT_TRUE(ms.get() != NULL); - EXPECT_TRUE(ConvertYuv422(ms.get(), cricket::FOURCC_YUY2, kWidth, kHeight, - &frame1)); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_YUY2, - kWidth, kHeight, &frame2)); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_YUVS, - kWidth, kHeight, &frame3)); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_YUYV, - kWidth, kHeight, &frame4)); - EXPECT_TRUE(IsEqual(frame1, frame2, 0)); - EXPECT_TRUE(IsEqual(frame1, frame3, 0)); - EXPECT_TRUE(IsEqual(frame1, frame4, 0)); - } - - // Test constructing an image from a UYVY buffer (and synonymous formats). - void ConstructUyvyAliases() { - T frame1, frame2, frame3, frame4; - talk_base::scoped_ptr ms( - CreateYuv422Sample(cricket::FOURCC_UYVY, kWidth, kHeight)); - ASSERT_TRUE(ms.get() != NULL); - EXPECT_TRUE(ConvertYuv422(ms.get(), cricket::FOURCC_UYVY, kWidth, kHeight, - &frame1)); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_UYVY, - kWidth, kHeight, &frame2)); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_2VUY, - kWidth, kHeight, &frame3)); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_HDYC, - kWidth, kHeight, &frame4)); - EXPECT_TRUE(IsEqual(frame1, frame2, 0)); - EXPECT_TRUE(IsEqual(frame1, frame3, 0)); - EXPECT_TRUE(IsEqual(frame1, frame4, 0)); - } - - // Test creating a copy. - void ConstructCopy() { - T frame1, frame2; - ASSERT_TRUE(LoadFrameNoRepeat(&frame1)); - for (int i = 0; i < repeat_; ++i) { - EXPECT_TRUE(frame2.Init(frame1)); - } - EXPECT_TRUE(IsEqual(frame1, frame2, 0)); - } - - // Test creating a copy and check that it just increments the refcount. - void ConstructCopyIsRef() { - T frame1, frame2; - ASSERT_TRUE(LoadFrameNoRepeat(&frame1)); - for (int i = 0; i < repeat_; ++i) { - EXPECT_TRUE(frame2.Init(frame1)); - } - EXPECT_TRUE(IsEqual(frame1, frame2, 0)); - EXPECT_EQ(frame1.GetYPlane(), frame2.GetYPlane()); - EXPECT_EQ(frame1.GetUPlane(), frame2.GetUPlane()); - EXPECT_EQ(frame1.GetVPlane(), frame2.GetVPlane()); - } - - // Test creating an empty image and initing it to black. - void ConstructBlack() { - T frame; - for (int i = 0; i < repeat_; ++i) { - EXPECT_TRUE(frame.InitToBlack(kWidth, kHeight, 1, 1, 0, 0)); - } - EXPECT_TRUE(IsSize(frame, kWidth, kHeight)); - EXPECT_TRUE(IsBlack(frame)); - } - - // Test constructing an image from a YUY2 buffer with a range of sizes. - // Only tests that conversion does not crash or corrupt heap. - void ConstructYuy2AllSizes() { - T frame1, frame2; - for (int height = kMinHeightAll; height <= kMaxHeightAll; ++height) { - for (int width = kMinWidthAll; width <= kMaxWidthAll; ++width) { - talk_base::scoped_ptr ms( - CreateYuv422Sample(cricket::FOURCC_YUY2, width, height)); - ASSERT_TRUE(ms.get() != NULL); - EXPECT_TRUE(ConvertYuv422(ms.get(), cricket::FOURCC_YUY2, width, height, - &frame1)); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_YUY2, - width, height, &frame2)); - EXPECT_TRUE(IsEqual(frame1, frame2, 0)); - } - } - } - - // Test constructing an image from a ARGB buffer with a range of sizes. - // Only tests that conversion does not crash or corrupt heap. - void ConstructARGBAllSizes() { - T frame1, frame2; - for (int height = kMinHeightAll; height <= kMaxHeightAll; ++height) { - for (int width = kMinWidthAll; width <= kMaxWidthAll; ++width) { - talk_base::scoped_ptr ms( - CreateRgbSample(cricket::FOURCC_ARGB, width, height)); - ASSERT_TRUE(ms.get() != NULL); - EXPECT_TRUE(ConvertRgb(ms.get(), cricket::FOURCC_ARGB, width, height, - &frame1)); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_ARGB, - width, height, &frame2)); - EXPECT_TRUE(IsEqual(frame1, frame2, 64)); - } - } - // Test a practical window size for screencasting usecase. - const int kOddWidth = 1228; - const int kOddHeight = 260; - for (int j = 0; j < 2; ++j) { - for (int i = 0; i < 2; ++i) { - talk_base::scoped_ptr ms( - CreateRgbSample(cricket::FOURCC_ARGB, kOddWidth + i, kOddHeight + j)); - ASSERT_TRUE(ms.get() != NULL); - EXPECT_TRUE(ConvertRgb(ms.get(), cricket::FOURCC_ARGB, - kOddWidth + i, kOddHeight + j, - &frame1)); - EXPECT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_ARGB, - kOddWidth + i, kOddHeight + j, &frame2)); - EXPECT_TRUE(IsEqual(frame1, frame2, 64)); - } - } - } - - // Tests re-initing an existing image. - void Reset() { - T frame1, frame2; - talk_base::scoped_ptr ms( - LoadSample(kImageFilename)); - ASSERT_TRUE(ms.get() != NULL); - size_t data_size; - ms->GetSize(&data_size); - EXPECT_TRUE(frame1.InitToBlack(kWidth, kHeight, 1, 1, 0, 0)); - EXPECT_TRUE(frame2.InitToBlack(kWidth, kHeight, 1, 1, 0, 0)); - EXPECT_TRUE(IsBlack(frame1)); - EXPECT_TRUE(IsEqual(frame1, frame2, 0)); - EXPECT_TRUE(frame1.Reset(cricket::FOURCC_I420, - kWidth, kHeight, kWidth, kHeight, - reinterpret_cast(ms->GetBuffer()), - data_size, 1, 1, 0, 0, 0)); - EXPECT_FALSE(IsBlack(frame1)); - EXPECT_FALSE(IsEqual(frame1, frame2, 0)); - } - - ////////////////////// - // Conversion tests // - ////////////////////// - - enum ToFrom { TO, FROM }; - - // Helper function for test converting from I420 to packed formats. - inline void ConvertToBuffer(int bpp, int rowpad, bool invert, ToFrom to_from, - int error, uint32 fourcc, - int (*RGBToI420)(const uint8* src_frame, int src_stride_frame, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height)) { - T frame1, frame2; - int repeat_to = (to_from == TO) ? repeat_ : 1; - int repeat_from = (to_from == FROM) ? repeat_ : 1; - - int astride = kWidth * bpp + rowpad; - size_t out_size = astride * kHeight; - talk_base::scoped_ptr outbuf(new uint8[out_size + kAlignment + 1]); - memset(outbuf.get(), 0, out_size + kAlignment + 1); - uint8 *outtop = ALIGNP(outbuf.get(), kAlignment); - uint8 *out = outtop; - int stride = astride; - if (invert) { - out += (kHeight - 1) * stride; // Point to last row. - stride = -stride; - } - ASSERT_TRUE(LoadFrameNoRepeat(&frame1)); - - for (int i = 0; i < repeat_to; ++i) { - EXPECT_EQ(out_size, frame1.ConvertToRgbBuffer(fourcc, - out, - out_size, stride)); - } - EXPECT_TRUE(frame2.InitToBlack(kWidth, kHeight, 1, 1, 0, 0)); - for (int i = 0; i < repeat_from; ++i) { - EXPECT_EQ(0, RGBToI420(out, stride, - frame2.GetYPlane(), frame2.GetYPitch(), - frame2.GetUPlane(), frame2.GetUPitch(), - frame2.GetVPlane(), frame2.GetVPitch(), - kWidth, kHeight)); - } - if (rowpad) { - EXPECT_EQ(0, outtop[kWidth * bpp]); // Ensure stride skipped end of row. - EXPECT_NE(0, outtop[astride]); // Ensure pixel at start of 2nd row. - } else { - EXPECT_NE(0, outtop[kWidth * bpp]); // Expect something to be here. - } - EXPECT_EQ(0, outtop[out_size]); // Ensure no overrun. - EXPECT_TRUE(IsEqual(frame1, frame2, error)); - } - - static const int kError = 20; - static const int kErrorHigh = 40; - static const int kOddStride = 23; - - // Tests ConvertToRGBBuffer formats. - void ConvertToARGBBuffer() { - ConvertToBuffer(4, 0, false, TO, kError, - cricket::FOURCC_ARGB, libyuv::ARGBToI420); - } - void ConvertToBGRABuffer() { - ConvertToBuffer(4, 0, false, TO, kError, - cricket::FOURCC_BGRA, libyuv::BGRAToI420); - } - void ConvertToABGRBuffer() { - ConvertToBuffer(4, 0, false, TO, kError, - cricket::FOURCC_ABGR, libyuv::ABGRToI420); - } - void ConvertToRGB24Buffer() { - ConvertToBuffer(3, 0, false, TO, kError, - cricket::FOURCC_24BG, libyuv::RGB24ToI420); - } - void ConvertToRAWBuffer() { - ConvertToBuffer(3, 0, false, TO, kError, - cricket::FOURCC_RAW, libyuv::RAWToI420); - } - void ConvertToRGB565Buffer() { - ConvertToBuffer(2, 0, false, TO, kError, - cricket::FOURCC_RGBP, libyuv::RGB565ToI420); - } - void ConvertToARGB1555Buffer() { - ConvertToBuffer(2, 0, false, TO, kError, - cricket::FOURCC_RGBO, libyuv::ARGB1555ToI420); - } - void ConvertToARGB4444Buffer() { - ConvertToBuffer(2, 0, false, TO, kError, - cricket::FOURCC_R444, libyuv::ARGB4444ToI420); - } - void ConvertToBayerBGGRBuffer() { - ConvertToBuffer(1, 0, false, TO, kErrorHigh, - cricket::FOURCC_BGGR, libyuv::BayerBGGRToI420); - } - void ConvertToBayerGBRGBuffer() { - ConvertToBuffer(1, 0, false, TO, kErrorHigh, - cricket::FOURCC_GBRG, libyuv::BayerGBRGToI420); - } - void ConvertToBayerGRBGBuffer() { - ConvertToBuffer(1, 0, false, TO, kErrorHigh, - cricket::FOURCC_GRBG, libyuv::BayerGRBGToI420); - } - void ConvertToBayerRGGBBuffer() { - ConvertToBuffer(1, 0, false, TO, kErrorHigh, - cricket::FOURCC_RGGB, libyuv::BayerRGGBToI420); - } - void ConvertToI400Buffer() { - ConvertToBuffer(1, 0, false, TO, 128, - cricket::FOURCC_I400, libyuv::I400ToI420); - } - void ConvertToYUY2Buffer() { - ConvertToBuffer(2, 0, false, TO, kError, - cricket::FOURCC_YUY2, libyuv::YUY2ToI420); - } - void ConvertToUYVYBuffer() { - ConvertToBuffer(2, 0, false, TO, kError, - cricket::FOURCC_UYVY, libyuv::UYVYToI420); - } - - // Tests ConvertToRGBBuffer formats with odd stride. - void ConvertToARGBBufferStride() { - ConvertToBuffer(4, kOddStride, false, TO, kError, - cricket::FOURCC_ARGB, libyuv::ARGBToI420); - } - void ConvertToBGRABufferStride() { - ConvertToBuffer(4, kOddStride, false, TO, kError, - cricket::FOURCC_BGRA, libyuv::BGRAToI420); - } - void ConvertToABGRBufferStride() { - ConvertToBuffer(4, kOddStride, false, TO, kError, - cricket::FOURCC_ABGR, libyuv::ABGRToI420); - } - void ConvertToRGB24BufferStride() { - ConvertToBuffer(3, kOddStride, false, TO, kError, - cricket::FOURCC_24BG, libyuv::RGB24ToI420); - } - void ConvertToRAWBufferStride() { - ConvertToBuffer(3, kOddStride, false, TO, kError, - cricket::FOURCC_RAW, libyuv::RAWToI420); - } - void ConvertToRGB565BufferStride() { - ConvertToBuffer(2, kOddStride, false, TO, kError, - cricket::FOURCC_RGBP, libyuv::RGB565ToI420); - } - void ConvertToARGB1555BufferStride() { - ConvertToBuffer(2, kOddStride, false, TO, kError, - cricket::FOURCC_RGBO, libyuv::ARGB1555ToI420); - } - void ConvertToARGB4444BufferStride() { - ConvertToBuffer(2, kOddStride, false, TO, kError, - cricket::FOURCC_R444, libyuv::ARGB4444ToI420); - } - void ConvertToBayerBGGRBufferStride() { - ConvertToBuffer(1, kOddStride, false, TO, kErrorHigh, - cricket::FOURCC_BGGR, libyuv::BayerBGGRToI420); - } - void ConvertToBayerGBRGBufferStride() { - ConvertToBuffer(1, kOddStride, false, TO, kErrorHigh, - cricket::FOURCC_GBRG, libyuv::BayerGBRGToI420); - } - void ConvertToBayerGRBGBufferStride() { - ConvertToBuffer(1, kOddStride, false, TO, kErrorHigh, - cricket::FOURCC_GRBG, libyuv::BayerGRBGToI420); - } - void ConvertToBayerRGGBBufferStride() { - ConvertToBuffer(1, kOddStride, false, TO, kErrorHigh, - cricket::FOURCC_RGGB, libyuv::BayerRGGBToI420); - } - void ConvertToI400BufferStride() { - ConvertToBuffer(1, kOddStride, false, TO, 128, - cricket::FOURCC_I400, libyuv::I400ToI420); - } - void ConvertToYUY2BufferStride() { - ConvertToBuffer(2, kOddStride, false, TO, kError, - cricket::FOURCC_YUY2, libyuv::YUY2ToI420); - } - void ConvertToUYVYBufferStride() { - ConvertToBuffer(2, kOddStride, false, TO, kError, - cricket::FOURCC_UYVY, libyuv::UYVYToI420); - } - - // Tests ConvertToRGBBuffer formats with negative stride to invert image. - void ConvertToARGBBufferInverted() { - ConvertToBuffer(4, 0, true, TO, kError, - cricket::FOURCC_ARGB, libyuv::ARGBToI420); - } - void ConvertToBGRABufferInverted() { - ConvertToBuffer(4, 0, true, TO, kError, - cricket::FOURCC_BGRA, libyuv::BGRAToI420); - } - void ConvertToABGRBufferInverted() { - ConvertToBuffer(4, 0, true, TO, kError, - cricket::FOURCC_ABGR, libyuv::ABGRToI420); - } - void ConvertToRGB24BufferInverted() { - ConvertToBuffer(3, 0, true, TO, kError, - cricket::FOURCC_24BG, libyuv::RGB24ToI420); - } - void ConvertToRAWBufferInverted() { - ConvertToBuffer(3, 0, true, TO, kError, - cricket::FOURCC_RAW, libyuv::RAWToI420); - } - void ConvertToRGB565BufferInverted() { - ConvertToBuffer(2, 0, true, TO, kError, - cricket::FOURCC_RGBP, libyuv::RGB565ToI420); - } - void ConvertToARGB1555BufferInverted() { - ConvertToBuffer(2, 0, true, TO, kError, - cricket::FOURCC_RGBO, libyuv::ARGB1555ToI420); - } - void ConvertToARGB4444BufferInverted() { - ConvertToBuffer(2, 0, true, TO, kError, - cricket::FOURCC_R444, libyuv::ARGB4444ToI420); - } - void ConvertToBayerBGGRBufferInverted() { - ConvertToBuffer(1, 0, true, TO, kErrorHigh, - cricket::FOURCC_BGGR, libyuv::BayerBGGRToI420); - } - void ConvertToBayerGBRGBufferInverted() { - ConvertToBuffer(1, 0, true, TO, kErrorHigh, - cricket::FOURCC_GBRG, libyuv::BayerGBRGToI420); - } - void ConvertToBayerGRBGBufferInverted() { - ConvertToBuffer(1, 0, true, TO, kErrorHigh, - cricket::FOURCC_GRBG, libyuv::BayerGRBGToI420); - } - void ConvertToBayerRGGBBufferInverted() { - ConvertToBuffer(1, 0, true, TO, kErrorHigh, - cricket::FOURCC_RGGB, libyuv::BayerRGGBToI420); - } - void ConvertToI400BufferInverted() { - ConvertToBuffer(1, 0, true, TO, 128, - cricket::FOURCC_I400, libyuv::I400ToI420); - } - void ConvertToYUY2BufferInverted() { - ConvertToBuffer(2, 0, true, TO, kError, - cricket::FOURCC_YUY2, libyuv::YUY2ToI420); - } - void ConvertToUYVYBufferInverted() { - ConvertToBuffer(2, 0, true, TO, kError, - cricket::FOURCC_UYVY, libyuv::UYVYToI420); - } - - // Tests ConvertFrom formats. - void ConvertFromARGBBuffer() { - ConvertToBuffer(4, 0, false, FROM, kError, - cricket::FOURCC_ARGB, libyuv::ARGBToI420); - } - void ConvertFromBGRABuffer() { - ConvertToBuffer(4, 0, false, FROM, kError, - cricket::FOURCC_BGRA, libyuv::BGRAToI420); - } - void ConvertFromABGRBuffer() { - ConvertToBuffer(4, 0, false, FROM, kError, - cricket::FOURCC_ABGR, libyuv::ABGRToI420); - } - void ConvertFromRGB24Buffer() { - ConvertToBuffer(3, 0, false, FROM, kError, - cricket::FOURCC_24BG, libyuv::RGB24ToI420); - } - void ConvertFromRAWBuffer() { - ConvertToBuffer(3, 0, false, FROM, kError, - cricket::FOURCC_RAW, libyuv::RAWToI420); - } - void ConvertFromRGB565Buffer() { - ConvertToBuffer(2, 0, false, FROM, kError, - cricket::FOURCC_RGBP, libyuv::RGB565ToI420); - } - void ConvertFromARGB1555Buffer() { - ConvertToBuffer(2, 0, false, FROM, kError, - cricket::FOURCC_RGBO, libyuv::ARGB1555ToI420); - } - void ConvertFromARGB4444Buffer() { - ConvertToBuffer(2, 0, false, FROM, kError, - cricket::FOURCC_R444, libyuv::ARGB4444ToI420); - } - void ConvertFromBayerBGGRBuffer() { - ConvertToBuffer(1, 0, false, FROM, kErrorHigh, - cricket::FOURCC_BGGR, libyuv::BayerBGGRToI420); - } - void ConvertFromBayerGBRGBuffer() { - ConvertToBuffer(1, 0, false, FROM, kErrorHigh, - cricket::FOURCC_GBRG, libyuv::BayerGBRGToI420); - } - void ConvertFromBayerGRBGBuffer() { - ConvertToBuffer(1, 0, false, FROM, kErrorHigh, - cricket::FOURCC_GRBG, libyuv::BayerGRBGToI420); - } - void ConvertFromBayerRGGBBuffer() { - ConvertToBuffer(1, 0, false, FROM, kErrorHigh, - cricket::FOURCC_RGGB, libyuv::BayerRGGBToI420); - } - void ConvertFromI400Buffer() { - ConvertToBuffer(1, 0, false, FROM, 128, - cricket::FOURCC_I400, libyuv::I400ToI420); - } - void ConvertFromYUY2Buffer() { - ConvertToBuffer(2, 0, false, FROM, kError, - cricket::FOURCC_YUY2, libyuv::YUY2ToI420); - } - void ConvertFromUYVYBuffer() { - ConvertToBuffer(2, 0, false, FROM, kError, - cricket::FOURCC_UYVY, libyuv::UYVYToI420); - } - - // Tests ConvertFrom formats with odd stride. - void ConvertFromARGBBufferStride() { - ConvertToBuffer(4, kOddStride, false, FROM, kError, - cricket::FOURCC_ARGB, libyuv::ARGBToI420); - } - void ConvertFromBGRABufferStride() { - ConvertToBuffer(4, kOddStride, false, FROM, kError, - cricket::FOURCC_BGRA, libyuv::BGRAToI420); - } - void ConvertFromABGRBufferStride() { - ConvertToBuffer(4, kOddStride, false, FROM, kError, - cricket::FOURCC_ABGR, libyuv::ABGRToI420); - } - void ConvertFromRGB24BufferStride() { - ConvertToBuffer(3, kOddStride, false, FROM, kError, - cricket::FOURCC_24BG, libyuv::RGB24ToI420); - } - void ConvertFromRAWBufferStride() { - ConvertToBuffer(3, kOddStride, false, FROM, kError, - cricket::FOURCC_RAW, libyuv::RAWToI420); - } - void ConvertFromRGB565BufferStride() { - ConvertToBuffer(2, kOddStride, false, FROM, kError, - cricket::FOURCC_RGBP, libyuv::RGB565ToI420); - } - void ConvertFromARGB1555BufferStride() { - ConvertToBuffer(2, kOddStride, false, FROM, kError, - cricket::FOURCC_RGBO, libyuv::ARGB1555ToI420); - } - void ConvertFromARGB4444BufferStride() { - ConvertToBuffer(2, kOddStride, false, FROM, kError, - cricket::FOURCC_R444, libyuv::ARGB4444ToI420); - } - void ConvertFromBayerBGGRBufferStride() { - ConvertToBuffer(1, kOddStride, false, FROM, kErrorHigh, - cricket::FOURCC_BGGR, libyuv::BayerBGGRToI420); - } - void ConvertFromBayerGBRGBufferStride() { - ConvertToBuffer(1, kOddStride, false, FROM, kErrorHigh, - cricket::FOURCC_GBRG, libyuv::BayerGBRGToI420); - } - void ConvertFromBayerGRBGBufferStride() { - ConvertToBuffer(1, kOddStride, false, FROM, kErrorHigh, - cricket::FOURCC_GRBG, libyuv::BayerGRBGToI420); - } - void ConvertFromBayerRGGBBufferStride() { - ConvertToBuffer(1, kOddStride, false, FROM, kErrorHigh, - cricket::FOURCC_RGGB, libyuv::BayerRGGBToI420); - } - void ConvertFromI400BufferStride() { - ConvertToBuffer(1, kOddStride, false, FROM, 128, - cricket::FOURCC_I400, libyuv::I400ToI420); - } - void ConvertFromYUY2BufferStride() { - ConvertToBuffer(2, kOddStride, false, FROM, kError, - cricket::FOURCC_YUY2, libyuv::YUY2ToI420); - } - void ConvertFromUYVYBufferStride() { - ConvertToBuffer(2, kOddStride, false, FROM, kError, - cricket::FOURCC_UYVY, libyuv::UYVYToI420); - } - - // Tests ConvertFrom formats with negative stride to invert image. - void ConvertFromARGBBufferInverted() { - ConvertToBuffer(4, 0, true, FROM, kError, - cricket::FOURCC_ARGB, libyuv::ARGBToI420); - } - void ConvertFromBGRABufferInverted() { - ConvertToBuffer(4, 0, true, FROM, kError, - cricket::FOURCC_BGRA, libyuv::BGRAToI420); - } - void ConvertFromABGRBufferInverted() { - ConvertToBuffer(4, 0, true, FROM, kError, - cricket::FOURCC_ABGR, libyuv::ABGRToI420); - } - void ConvertFromRGB24BufferInverted() { - ConvertToBuffer(3, 0, true, FROM, kError, - cricket::FOURCC_24BG, libyuv::RGB24ToI420); - } - void ConvertFromRAWBufferInverted() { - ConvertToBuffer(3, 0, true, FROM, kError, - cricket::FOURCC_RAW, libyuv::RAWToI420); - } - void ConvertFromRGB565BufferInverted() { - ConvertToBuffer(2, 0, true, FROM, kError, - cricket::FOURCC_RGBP, libyuv::RGB565ToI420); - } - void ConvertFromARGB1555BufferInverted() { - ConvertToBuffer(2, 0, true, FROM, kError, - cricket::FOURCC_RGBO, libyuv::ARGB1555ToI420); - } - void ConvertFromARGB4444BufferInverted() { - ConvertToBuffer(2, 0, true, FROM, kError, - cricket::FOURCC_R444, libyuv::ARGB4444ToI420); - } - void ConvertFromBayerBGGRBufferInverted() { - ConvertToBuffer(1, 0, true, FROM, kErrorHigh, - cricket::FOURCC_BGGR, libyuv::BayerBGGRToI420); - } - void ConvertFromBayerGBRGBufferInverted() { - ConvertToBuffer(1, 0, true, FROM, kErrorHigh, - cricket::FOURCC_GBRG, libyuv::BayerGBRGToI420); - } - void ConvertFromBayerGRBGBufferInverted() { - ConvertToBuffer(1, 0, true, FROM, kErrorHigh, - cricket::FOURCC_GRBG, libyuv::BayerGRBGToI420); - } - void ConvertFromBayerRGGBBufferInverted() { - ConvertToBuffer(1, 0, true, FROM, kErrorHigh, - cricket::FOURCC_RGGB, libyuv::BayerRGGBToI420); - } - void ConvertFromI400BufferInverted() { - ConvertToBuffer(1, 0, true, FROM, 128, - cricket::FOURCC_I400, libyuv::I400ToI420); - } - void ConvertFromYUY2BufferInverted() { - ConvertToBuffer(2, 0, true, FROM, kError, - cricket::FOURCC_YUY2, libyuv::YUY2ToI420); - } - void ConvertFromUYVYBufferInverted() { - ConvertToBuffer(2, 0, true, FROM, kError, - cricket::FOURCC_UYVY, libyuv::UYVYToI420); - } - - // Test converting from I420 to I422. - void ConvertToI422Buffer() { - T frame1, frame2; - size_t out_size = kWidth * kHeight * 2; - talk_base::scoped_ptr buf(new uint8[out_size + kAlignment]); - uint8* y = ALIGNP(buf.get(), kAlignment); - uint8* u = y + kWidth * kHeight; - uint8* v = u + (kWidth / 2) * kHeight; - ASSERT_TRUE(LoadFrameNoRepeat(&frame1)); - for (int i = 0; i < repeat_; ++i) { - EXPECT_EQ(0, libyuv::I420ToI422(frame1.GetYPlane(), frame1.GetYPitch(), - frame1.GetUPlane(), frame1.GetUPitch(), - frame1.GetVPlane(), frame1.GetVPitch(), - y, kWidth, - u, kWidth / 2, - v, kWidth / 2, - kWidth, kHeight)); - } - EXPECT_TRUE(frame2.Init(cricket::FOURCC_I422, - kWidth, kHeight, kWidth, kHeight, - y, - out_size, 1, 1, 0, 0, cricket::ROTATION_0)); - EXPECT_TRUE(IsEqual(frame1, frame2, 1)); - } - - #define TEST_TOBYR(NAME, BAYER) \ - void NAME() { \ - size_t bayer_size = kWidth * kHeight; \ - talk_base::scoped_ptr bayerbuf(new uint8[ \ - bayer_size + kAlignment]); \ - uint8 *bayer = ALIGNP(bayerbuf.get(), kAlignment); \ - T frame; \ - talk_base::scoped_ptr ms( \ - CreateRgbSample(cricket::FOURCC_ARGB, kWidth, kHeight)); \ - ASSERT_TRUE(ms.get() != NULL); \ - for (int i = 0; i < repeat_; ++i) { \ - libyuv::ARGBToBayer##BAYER(reinterpret_cast(ms->GetBuffer()), \ - kWidth * 4, \ - bayer, kWidth, \ - kWidth, kHeight); \ - } \ - talk_base::scoped_ptr ms2( \ - CreateRgbSample(cricket::FOURCC_ARGB, kWidth, kHeight)); \ - size_t data_size; \ - bool ret = ms2->GetSize(&data_size); \ - EXPECT_TRUE(ret); \ - libyuv::Bayer##BAYER##ToARGB(bayer, kWidth, \ - reinterpret_cast(ms2->GetBuffer()), \ - kWidth * 4, \ - kWidth, kHeight); \ - EXPECT_TRUE(IsPlaneEqual("argb", \ - reinterpret_cast(ms->GetBuffer()), kWidth * 4, \ - reinterpret_cast(ms2->GetBuffer()), kWidth * 4, \ - kWidth * 4, kHeight, 240)); \ - } \ - void NAME##Unaligned() { \ - size_t bayer_size = kWidth * kHeight; \ - talk_base::scoped_ptr bayerbuf(new uint8[ \ - bayer_size + 1 + kAlignment]); \ - uint8 *bayer = ALIGNP(bayerbuf.get(), kAlignment) + 1; \ - T frame; \ - talk_base::scoped_ptr ms( \ - CreateRgbSample(cricket::FOURCC_ARGB, kWidth, kHeight)); \ - ASSERT_TRUE(ms.get() != NULL); \ - for (int i = 0; i < repeat_; ++i) { \ - libyuv::ARGBToBayer##BAYER(reinterpret_cast(ms->GetBuffer()), \ - kWidth * 4, \ - bayer, kWidth, \ - kWidth, kHeight); \ - } \ - talk_base::scoped_ptr ms2( \ - CreateRgbSample(cricket::FOURCC_ARGB, kWidth, kHeight)); \ - size_t data_size; \ - bool ret = ms2->GetSize(&data_size); \ - EXPECT_TRUE(ret); \ - libyuv::Bayer##BAYER##ToARGB(bayer, kWidth, \ - reinterpret_cast(ms2->GetBuffer()), \ - kWidth * 4, \ - kWidth, kHeight); \ - EXPECT_TRUE(IsPlaneEqual("argb", \ - reinterpret_cast(ms->GetBuffer()), kWidth * 4, \ - reinterpret_cast(ms2->GetBuffer()), kWidth * 4, \ - kWidth * 4, kHeight, 240)); \ - } - - // Tests ARGB to Bayer formats. - TEST_TOBYR(ConvertARGBToBayerGRBG, GRBG) - TEST_TOBYR(ConvertARGBToBayerGBRG, GBRG) - TEST_TOBYR(ConvertARGBToBayerBGGR, BGGR) - TEST_TOBYR(ConvertARGBToBayerRGGB, RGGB) - - #define TEST_BYRTORGB(NAME, BAYER) \ - void NAME() { \ - size_t bayer_size = kWidth * kHeight; \ - talk_base::scoped_ptr bayerbuf(new uint8[ \ - bayer_size + kAlignment]); \ - uint8 *bayer1 = ALIGNP(bayerbuf.get(), kAlignment); \ - for (int i = 0; i < kWidth * kHeight; ++i) { \ - bayer1[i] = static_cast(i * 33u + 183u); \ - } \ - T frame; \ - talk_base::scoped_ptr ms( \ - CreateRgbSample(cricket::FOURCC_ARGB, kWidth, kHeight)); \ - ASSERT_TRUE(ms.get() != NULL); \ - for (int i = 0; i < repeat_; ++i) { \ - libyuv::Bayer##BAYER##ToARGB(bayer1, kWidth, \ - reinterpret_cast(ms->GetBuffer()), \ - kWidth * 4, \ - kWidth, kHeight); \ - } \ - talk_base::scoped_ptr bayer2buf(new uint8[ \ - bayer_size + kAlignment]); \ - uint8 *bayer2 = ALIGNP(bayer2buf.get(), kAlignment); \ - libyuv::ARGBToBayer##BAYER(reinterpret_cast(ms->GetBuffer()), \ - kWidth * 4, \ - bayer2, kWidth, \ - kWidth, kHeight); \ - EXPECT_TRUE(IsPlaneEqual("bayer", \ - bayer1, kWidth, \ - bayer2, kWidth, \ - kWidth, kHeight, 0)); \ - } - - // Tests Bayer formats to ARGB. - TEST_BYRTORGB(ConvertBayerGRBGToARGB, GRBG) - TEST_BYRTORGB(ConvertBayerGBRGToARGB, GBRG) - TEST_BYRTORGB(ConvertBayerBGGRToARGB, BGGR) - TEST_BYRTORGB(ConvertBayerRGGBToARGB, RGGB) - - /////////////////// - // General tests // - /////////////////// - - void Copy() { - talk_base::scoped_ptr source(new T); - talk_base::scoped_ptr target; - ASSERT_TRUE(LoadFrameNoRepeat(source.get())); - target.reset(source->Copy()); - EXPECT_TRUE(IsEqual(*source, *target, 0)); - source.reset(); - EXPECT_TRUE(target->GetYPlane() != NULL); - } - - void CopyIsRef() { - talk_base::scoped_ptr source(new T); - talk_base::scoped_ptr target; - ASSERT_TRUE(LoadFrameNoRepeat(source.get())); - target.reset(source->Copy()); - EXPECT_TRUE(IsEqual(*source, *target, 0)); - EXPECT_EQ(source->GetYPlane(), target->GetYPlane()); - EXPECT_EQ(source->GetUPlane(), target->GetUPlane()); - EXPECT_EQ(source->GetVPlane(), target->GetVPlane()); - } - - void MakeExclusive() { - talk_base::scoped_ptr source(new T); - talk_base::scoped_ptr target; - ASSERT_TRUE(LoadFrameNoRepeat(source.get())); - target.reset(source->Copy()); - EXPECT_TRUE(target->MakeExclusive()); - EXPECT_TRUE(IsEqual(*source, *target, 0)); - EXPECT_NE(target->GetYPlane(), source->GetYPlane()); - EXPECT_NE(target->GetUPlane(), source->GetUPlane()); - EXPECT_NE(target->GetVPlane(), source->GetVPlane()); - } - - void CopyToBuffer() { - T frame; - talk_base::scoped_ptr ms( - LoadSample(kImageFilename)); - ASSERT_TRUE(ms.get() != NULL); - ASSERT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_I420, kWidth, kHeight, - &frame)); - size_t out_size = kWidth * kHeight * 3 / 2; - talk_base::scoped_ptr out(new uint8[out_size]); - for (int i = 0; i < repeat_; ++i) { - EXPECT_EQ(out_size, frame.CopyToBuffer(out.get(), out_size)); - } - EXPECT_EQ(0, memcmp(out.get(), ms->GetBuffer(), out_size)); - } - - void CopyToFrame() { - T source; - talk_base::scoped_ptr ms( - LoadSample(kImageFilename)); - ASSERT_TRUE(ms.get() != NULL); - ASSERT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_I420, kWidth, kHeight, - &source)); - - // Create the target frame by loading from a file. - T target; - ASSERT_TRUE(LoadFrameNoRepeat(&target)); - EXPECT_FALSE(IsBlack(target)); - - // Stretch and check if the stretched target is black. - source.CopyToFrame(&target); - - EXPECT_TRUE(IsEqual(source, target, 0)); - } - - void Write() { - T frame; - talk_base::scoped_ptr ms( - LoadSample(kImageFilename)); - ASSERT_TRUE(ms.get() != NULL); - talk_base::MemoryStream ms2; - size_t size; - ASSERT_TRUE(ms->GetSize(&size)); - ASSERT_TRUE(ms2.ReserveSize(size)); - ASSERT_TRUE(LoadFrame(ms.get(), cricket::FOURCC_I420, kWidth, kHeight, - &frame)); - for (int i = 0; i < repeat_; ++i) { - ms2.SetPosition(0u); // Useful when repeat_ > 1. - int error; - EXPECT_EQ(talk_base::SR_SUCCESS, frame.Write(&ms2, &error)); - } - size_t out_size = cricket::VideoFrame::SizeOf(kWidth, kHeight); - EXPECT_EQ(0, memcmp(ms2.GetBuffer(), ms->GetBuffer(), out_size)); - } - - void CopyToBuffer1Pixel() { - size_t out_size = 3; - talk_base::scoped_ptr out(new uint8[out_size + 1]); - memset(out.get(), 0xfb, out_size + 1); // Fill buffer - uint8 pixel[3] = { 1, 2, 3 }; - T frame; - EXPECT_TRUE(frame.Init(cricket::FOURCC_I420, 1, 1, 1, 1, - pixel, sizeof(pixel), - 1, 1, 0, 0, 0)); - for (int i = 0; i < repeat_; ++i) { - EXPECT_EQ(out_size, frame.CopyToBuffer(out.get(), out_size)); - } - EXPECT_EQ(1, out.get()[0]); // Check Y. Should be 1. - EXPECT_EQ(2, out.get()[1]); // Check U. Should be 2. - EXPECT_EQ(3, out.get()[2]); // Check V. Should be 3. - EXPECT_EQ(0xfb, out.get()[3]); // Check sentinel is still intact. - } - - void StretchToFrame() { - // Create the source frame as a black frame. - T source; - EXPECT_TRUE(source.InitToBlack(kWidth * 2, kHeight * 2, 1, 1, 0, 0)); - EXPECT_TRUE(IsSize(source, kWidth * 2, kHeight * 2)); - - // Create the target frame by loading from a file. - T target1; - ASSERT_TRUE(LoadFrameNoRepeat(&target1)); - EXPECT_FALSE(IsBlack(target1)); - - // Stretch and check if the stretched target is black. - source.StretchToFrame(&target1, true, false); - EXPECT_TRUE(IsBlack(target1)); - - // Crop and stretch and check if the stretched target is black. - T target2; - ASSERT_TRUE(LoadFrameNoRepeat(&target2)); - source.StretchToFrame(&target2, true, true); - EXPECT_TRUE(IsBlack(target2)); - EXPECT_EQ(source.GetElapsedTime(), target2.GetElapsedTime()); - EXPECT_EQ(source.GetTimeStamp(), target2.GetTimeStamp()); - } - - int repeat_; -}; - -#endif // TALK_MEDIA_BASE_VIDEOFRAME_UNITTEST_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/videoprocessor.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/videoprocessor.h deleted file mode 100755 index 8285678..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/videoprocessor.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_VIDEOPROCESSOR_H_ -#define TALK_MEDIA_BASE_VIDEOPROCESSOR_H_ - -#include "talk/base/sigslot.h" -#include "talk/media/base/videoframe.h" - -namespace cricket { - -class VideoProcessor : public sigslot::has_slots<> { - public: - virtual ~VideoProcessor() {} - // Contents of frame may be manipulated by the processor. - // The processed data is expected to be the same size as the - // original data. VideoProcessors may be chained together and may decide - // that the current frame should be dropped. If *drop_frame is true, - // the current processor should skip processing. If the current processor - // decides it cannot process the current frame in a timely manner, it may set - // *drop_frame = true and the frame will be dropped. - virtual void OnFrame(uint32 ssrc, VideoFrame* frame, bool* drop_frame) = 0; -}; - -} // namespace cricket -#endif // TALK_MEDIA_BASE_VIDEOPROCESSOR_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/videorenderer.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/videorenderer.h deleted file mode 100755 index ed490e5..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/videorenderer.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_VIDEORENDERER_H_ -#define TALK_MEDIA_BASE_VIDEORENDERER_H_ - -#ifdef _DEBUG -#include -#endif // _DEBUG - -#include "talk/base/sigslot.h" - -namespace cricket { - -class VideoFrame; - -// Abstract interface for rendering VideoFrames. -class VideoRenderer { - public: - virtual ~VideoRenderer() {} - // Called when the video has changed size. - virtual bool SetSize(int width, int height, int reserved) = 0; - // Called when a new frame is available for display. - virtual bool RenderFrame(const VideoFrame *frame) = 0; - -#ifdef _DEBUG - // Allow renderer dumping out rendered frames. - virtual bool SetDumpPath(const std::string &path) { return true; } -#endif // _DEBUG -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_VIDEORENDERER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/voiceprocessor.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/voiceprocessor.h deleted file mode 100755 index be626c4..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/voiceprocessor.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_VOICEPROCESSOR_H_ -#define TALK_MEDIA_BASE_VOICEPROCESSOR_H_ - -#include "talk/base/basictypes.h" -#include "talk/base/sigslot.h" -#include "talk/media/base/audioframe.h" - -namespace cricket { - -enum MediaProcessorDirection { - MPD_INVALID = 0, - MPD_RX = 1 << 0, - MPD_TX = 1 << 1, - MPD_RX_AND_TX = MPD_RX | MPD_TX, -}; - -class VoiceProcessor : public sigslot::has_slots<> { - public: - virtual ~VoiceProcessor() {} - // Contents of frame may be manipulated by the processor. - // The processed data is expected to be the same size as the - // original data. - virtual void OnFrame(uint32 ssrc, - MediaProcessorDirection direction, - AudioFrame* frame) = 0; -}; - -} // namespace cricket -#endif // TALK_MEDIA_BASE_VOICEPROCESSOR_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/base/yuvframegenerator.h b/thirdparties/common/include/webrtc-sdk/talk/media/base/yuvframegenerator.h deleted file mode 100755 index 8f99cdc..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/base/yuvframegenerator.h +++ /dev/null @@ -1,78 +0,0 @@ -// Generates YUV420 frames with a "landscape with striped crosshair" in the -// Y-plane, plus a horizontal gradient in the U-plane and a vertical one in the -// V-plane. This makes for a nice mix of colours that is suited for both -// catching visual errors and making sure e.g. YUV->RGB/BGR conversion looks -// the same on different platforms. -// There is also a solid box bouncing around in the Y-plane, and two differently -// coloured lines bouncing horizontally and vertically in the U and V plane. -// This helps illustrating how the frame boundary goes, and can aid as a quite -// handy visual help for noticing e.g. packet loss if the frames are encoded -// and sent over the network. - -#ifndef TALK_MEDIA_BASE_YUVFRAMEGENERATOR_H_ -#define TALK_MEDIA_BASE_YUVFRAMEGENERATOR_H_ - -#include "talk/base/basictypes.h" - -namespace cricket { - -class YuvFrameGenerator { - public: - // Constructs a frame-generator that produces frames of size |width|x|height|. - // If |enable_barcode| is specified, barcodes can be included in the frames - // when calling |GenerateNextFrame(uint8*, uint32)|. If |enable_barcode| is - // |true| then |width|x|height| should be at least 160x100; otherwise this - // constructor will abort. - YuvFrameGenerator(int width, int height, bool enable_barcode); - ~YuvFrameGenerator(); - - int GetFrameSize() { return frame_data_size_; } - - // Generate the next frame and return it in the provided |frame_buffer|. If - // barcode_value is not |nullptr| the value referred by it will be encoded - // into a barcode in the frame. The value should in the range: - // [0..9,999,999]. If the value exceeds this range or barcodes were not - // requested in the constructor, this function will abort. - void GenerateNextFrame(uint8* frame_buffer, int32 barcode_value); - - int GetHeight() { return height_; } - int GetWidth() { return width_; } - - // Fetch the bounds of the barcode from the generator. The barcode will - // always be at this location. This function will abort if barcodes were not - // requested in the constructor. - void GetBarcodeBounds(int* top, int* left, int* width, int* height); - - private: - void DrawLandscape(uint8 *p, int w, int h); - void DrawGradientX(uint8 *p, int w, int h); - void DrawGradientY(uint8 *p, int w, int h); - void DrawMovingLineX(uint8 *p, int w, int h, int n); - void DrawMovingLineY(uint8 *p, int w, int h, int n); - void DrawBouncingCube(uint8 *p, int w, int h, int n); - - void DrawBarcode(uint32 value); - int DrawSideGuardBars(int x, int y, int height); - int DrawMiddleGuardBars(int x, int y, int height); - int DrawEanEncodedDigit(int digit, int x, int y, int height, bool r_code); - void DrawBlockRectangle(uint8* p, int x_start, int y_start, - int width, int height, int pitch, uint8 value); - - private: - int width_; - int height_; - int frame_index_; - int frame_data_size_; - uint8* y_data_; - uint8* u_data_; - uint8* v_data_; - - int barcode_start_x_; - int barcode_start_y_; - - DISALLOW_COPY_AND_ASSIGN(YuvFrameGenerator); -}; - -} // namespace cricket - -#endif // TALK_MEDIA_BASE_YUVFRAMEGENERATOR_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/devices/carbonvideorenderer.h b/thirdparties/common/include/webrtc-sdk/talk/media/devices/carbonvideorenderer.h deleted file mode 100755 index 3ebc174..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/devices/carbonvideorenderer.h +++ /dev/null @@ -1,72 +0,0 @@ -// 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. -// -// Definition of class CarbonVideoRenderer that implements the abstract class -// cricket::VideoRenderer via Carbon. - -#ifndef TALK_MEDIA_DEVICES_CARBONVIDEORENDERER_H_ -#define TALK_MEDIA_DEVICES_CARBONVIDEORENDERER_H_ - -#include - -#include "talk/base/criticalsection.h" -#include "talk/base/scoped_ptr.h" -#include "talk/media/base/videorenderer.h" - -namespace cricket { - -class CarbonVideoRenderer : public VideoRenderer { - public: - CarbonVideoRenderer(int x, int y); - virtual ~CarbonVideoRenderer(); - - // Implementation of pure virtual methods of VideoRenderer. - // These two methods may be executed in different threads. - // SetSize is called before RenderFrame. - virtual bool SetSize(int width, int height, int reserved); - virtual bool RenderFrame(const VideoFrame* frame); - - // Needs to be called on the main thread. - bool Initialize(); - - private: - bool DrawFrame(); - - static OSStatus DrawEventHandler(EventHandlerCallRef handler, - EventRef event, - void* data); - talk_base::scoped_ptr image_; - talk_base::CriticalSection image_crit_; - int image_width_; - int image_height_; - int x_; - int y_; - CGImageRef image_ref_; - WindowRef window_ref_; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_DEVICES_CARBONVIDEORENDERER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/devices/deviceinfo.h b/thirdparties/common/include/webrtc-sdk/talk/media/devices/deviceinfo.h deleted file mode 100755 index a069dd8..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/devices/deviceinfo.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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_DEVICES_DEVICEINFO_H_ -#define TALK_MEDIA_DEVICES_DEVICEINFO_H_ - -#include - -#include "talk/media/devices/devicemanager.h" - -namespace cricket { - -bool GetUsbId(const Device& device, std::string* usb_id); -bool GetUsbVersion(const Device& device, std::string* usb_version); - -} // namespace cricket - -#endif // TALK_MEDIA_DEVICES_DEVICEINFO_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/devices/devicemanager.h b/thirdparties/common/include/webrtc-sdk/talk/media/devices/devicemanager.h deleted file mode 100755 index 5950143..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/devices/devicemanager.h +++ /dev/null @@ -1,216 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_DEVICES_DEVICEMANAGER_H_ -#define TALK_MEDIA_DEVICES_DEVICEMANAGER_H_ - -#include -#include -#include - -#include "talk/base/scoped_ptr.h" -#include "talk/base/sigslot.h" -#include "talk/base/stringencode.h" -#include "talk/base/window.h" -#include "talk/media/base/videocommon.h" - -namespace talk_base { - -class DesktopDescription; -class WindowDescription; -class WindowPicker; - -} -namespace cricket { - -class VideoCapturer; - -// Used to represent an audio or video capture or render device. -struct Device { - Device() {} - Device(const std::string& first, int second) - : name(first), - id(talk_base::ToString(second)) { - } - Device(const std::string& first, const std::string& second) - : name(first), id(second) {} - - std::string name; - std::string id; -}; - -class VideoCapturerFactory { - public: - VideoCapturerFactory() {} - virtual ~VideoCapturerFactory() {} - - virtual VideoCapturer* Create(const Device& device) = 0; -}; - -// DeviceManagerInterface - interface to manage the audio and -// video devices on the system. -class DeviceManagerInterface { - public: - virtual ~DeviceManagerInterface() { } - - // Initialization - virtual bool Init() = 0; - virtual void Terminate() = 0; - - // Capabilities - virtual int GetCapabilities() = 0; - - // Device enumeration - virtual bool GetAudioInputDevices(std::vector* devices) = 0; - virtual bool GetAudioOutputDevices(std::vector* devices) = 0; - - virtual bool GetAudioInputDevice(const std::string& name, Device* out) = 0; - virtual bool GetAudioOutputDevice(const std::string& name, Device* out) = 0; - - virtual bool GetVideoCaptureDevices(std::vector* devs) = 0; - virtual bool GetVideoCaptureDevice(const std::string& name, Device* out) = 0; - - // Caps the capture format according to max format for capturers created - // by CreateVideoCapturer(). See ConstrainSupportedFormats() in - // videocapturer.h for more detail. - // Note that once a VideoCapturer has been created, calling this API will - // not affect it. - virtual void SetVideoCaptureDeviceMaxFormat( - const std::string& usb_id, - const VideoFormat& max_format) = 0; - virtual void ClearVideoCaptureDeviceMaxFormat(const std::string& usb_id) = 0; - - // Device creation - virtual VideoCapturer* CreateVideoCapturer(const Device& device) const = 0; - - virtual bool GetWindows( - std::vector* descriptions) = 0; - virtual VideoCapturer* CreateWindowCapturer(talk_base::WindowId window) = 0; - - virtual bool GetDesktops( - std::vector* descriptions) = 0; - virtual VideoCapturer* CreateDesktopCapturer( - talk_base::DesktopId desktop) = 0; - - sigslot::signal0<> SignalDevicesChange; - - static const char kDefaultDeviceName[]; -}; - -class DeviceWatcher { - public: - explicit DeviceWatcher(DeviceManagerInterface* dm) {} - virtual ~DeviceWatcher() {} - virtual bool Start() { return true; } - virtual void Stop() {} -}; - -class DeviceManagerFactory { - public: - static DeviceManagerInterface* Create(); - - private: - DeviceManagerFactory() {} -}; - -class DeviceManager : public DeviceManagerInterface { - public: - DeviceManager(); - virtual ~DeviceManager(); - - void set_device_video_capturer_factory( - VideoCapturerFactory* device_video_capturer_factory) { - device_video_capturer_factory_.reset(device_video_capturer_factory); - } - - // Initialization - virtual bool Init(); - virtual void Terminate(); - - // Capabilities - virtual int GetCapabilities(); - - // Device enumeration - virtual bool GetAudioInputDevices(std::vector* devices); - virtual bool GetAudioOutputDevices(std::vector* devices); - - virtual bool GetAudioInputDevice(const std::string& name, Device* out); - virtual bool GetAudioOutputDevice(const std::string& name, Device* out); - - virtual bool GetVideoCaptureDevices(std::vector* devs); - virtual bool GetVideoCaptureDevice(const std::string& name, Device* out); - - virtual void SetVideoCaptureDeviceMaxFormat(const std::string& usb_id, - const VideoFormat& max_format); - virtual void ClearVideoCaptureDeviceMaxFormat(const std::string& usb_id); - - virtual VideoCapturer* CreateVideoCapturer(const Device& device) const; - - virtual bool GetWindows( - std::vector* descriptions); - virtual VideoCapturer* CreateWindowCapturer(talk_base::WindowId window); - - virtual bool GetDesktops( - std::vector* descriptions); - virtual VideoCapturer* CreateDesktopCapturer(talk_base::DesktopId desktop); - - // The exclusion_list MUST be a NULL terminated list. - static bool FilterDevices(std::vector* devices, - const char* const exclusion_list[]); - bool initialized() const { return initialized_; } - - protected: - virtual bool GetAudioDevices(bool input, std::vector* devs); - virtual bool GetAudioDevice(bool is_input, const std::string& name, - Device* out); - virtual bool GetDefaultVideoCaptureDevice(Device* device); - bool IsInWhitelist(const std::string& key, VideoFormat* video_format) const; - virtual bool GetMaxFormat(const Device& device, - VideoFormat* video_format) const; - - void set_initialized(bool initialized) { initialized_ = initialized; } - - void set_watcher(DeviceWatcher* watcher) { watcher_.reset(watcher); } - DeviceWatcher* watcher() { return watcher_.get(); } - - private: - // The exclusion_list MUST be a NULL terminated list. - static bool ShouldDeviceBeIgnored(const std::string& device_name, - const char* const exclusion_list[]); - bool GetFakeVideoCaptureDevice(const std::string& name, Device* out) const; - VideoCapturer* ConstructFakeVideoCapturer(const Device& device) const; - - bool initialized_; - talk_base::scoped_ptr device_video_capturer_factory_; - std::map max_formats_; - talk_base::scoped_ptr watcher_; - talk_base::scoped_ptr window_picker_; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_DEVICES_DEVICEMANAGER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/devices/dummydevicemanager.h b/thirdparties/common/include/webrtc-sdk/talk/media/devices/dummydevicemanager.h deleted file mode 100755 index 85b67d9..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/devices/dummydevicemanager.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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_MEDIA_DEVICES_DUMMYDEVICEMANAGER_H_ -#define TALK_MEDIA_DEVICES_DUMMYDEVICEMANAGER_H_ - -#include - -#include "talk/media/base/mediacommon.h" -#include "talk/media/devices/fakedevicemanager.h" - -namespace cricket { - -class DummyDeviceManager : public FakeDeviceManager { - public: - DummyDeviceManager() { - std::vector devices; - devices.push_back(DeviceManagerInterface::kDefaultDeviceName); - SetAudioInputDevices(devices); - SetAudioOutputDevices(devices); - SetVideoCaptureDevices(devices); - } -}; - -} // namespace cricket - -#endif // TALK_MEDIA_DEVICES_DUMMYDEVICEMANAGER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/devices/fakedevicemanager.h b/thirdparties/common/include/webrtc-sdk/talk/media/devices/fakedevicemanager.h deleted file mode 100755 index 14ea0b8..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/devices/fakedevicemanager.h +++ /dev/null @@ -1,222 +0,0 @@ -/* - * libjingle - * Copyright 2008 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_DEVICES_FAKEDEVICEMANAGER_H_ -#define TALK_MEDIA_DEVICES_FAKEDEVICEMANAGER_H_ - -#include -#include - -#include "talk/base/window.h" -#include "talk/base/windowpicker.h" -#include "talk/media/base/fakevideocapturer.h" -#include "talk/media/base/mediacommon.h" -#include "talk/media/devices/devicemanager.h" - -namespace cricket { - -class FakeDeviceManager : public DeviceManagerInterface { - public: - FakeDeviceManager() {} - virtual bool Init() { - return true; - } - virtual void Terminate() { - } - virtual int GetCapabilities() { - std::vector devices; - int caps = VIDEO_RECV; - if (!input_devices_.empty()) { - caps |= AUDIO_SEND; - } - if (!output_devices_.empty()) { - caps |= AUDIO_RECV; - } - if (!vidcap_devices_.empty()) { - caps |= VIDEO_SEND; - } - return caps; - } - virtual bool GetAudioInputDevices(std::vector* devs) { - *devs = input_devices_; - return true; - } - virtual bool GetAudioOutputDevices(std::vector* devs) { - *devs = output_devices_; - return true; - } - virtual bool GetAudioInputDevice(const std::string& name, Device* out) { - return GetAudioDevice(true, name, out); - } - virtual bool GetAudioOutputDevice(const std::string& name, Device* out) { - return GetAudioDevice(false, name, out); - } - virtual bool GetVideoCaptureDevices(std::vector* devs) { - *devs = vidcap_devices_; - return true; - } - virtual void SetVideoCaptureDeviceMaxFormat(const std::string& usb_id, - const VideoFormat& max_format) { - max_formats_[usb_id] = max_format; - } - bool IsMaxFormatForDevice(const std::string& usb_id, - const VideoFormat& max_format) const { - std::map::const_iterator found = - max_formats_.find(usb_id); - return (found != max_formats_.end()) ? - max_format == found->second : - false; - } - virtual void ClearVideoCaptureDeviceMaxFormat(const std::string& usb_id) { - max_formats_.erase(usb_id); - } - virtual VideoCapturer* CreateVideoCapturer(const Device& device) const { - return new FakeVideoCapturer(); - } - virtual bool GetWindows( - std::vector* descriptions) { - descriptions->clear(); - const uint32_t id = 1u; // Note that 0 is not a valid ID. - const talk_base::WindowId window_id = - talk_base::WindowId::Cast(id); - std::string title = "FakeWindow"; - talk_base::WindowDescription window_description(window_id, title); - descriptions->push_back(window_description); - return true; - } - virtual VideoCapturer* CreateWindowCapturer(talk_base::WindowId window) { - if (!window.IsValid()) { - return NULL; - } - return new FakeVideoCapturer; - } - virtual bool GetDesktops( - std::vector* descriptions) { - descriptions->clear(); - const int id = 0; - const int valid_index = 0; - const talk_base::DesktopId desktop_id = - talk_base::DesktopId::Cast(id, valid_index); - std::string title = "FakeDesktop"; - talk_base::DesktopDescription desktop_description(desktop_id, title); - descriptions->push_back(desktop_description); - return true; - } - virtual VideoCapturer* CreateDesktopCapturer(talk_base::DesktopId desktop) { - if (!desktop.IsValid()) { - return NULL; - } - return new FakeVideoCapturer; - } - - virtual bool GetDefaultVideoCaptureDevice(Device* device) { - if (vidcap_devices_.empty()) { - return false; - } - *device = vidcap_devices_[0]; - return true; - } - -#ifdef OSX - bool QtKitToSgDevice(const std::string& qtkit_name, Device* out) { - out->name = qtkit_name; - out->id = "sg:" + qtkit_name; - return true; - } -#endif - - void SetAudioInputDevices(const std::vector& devices) { - input_devices_.clear(); - for (size_t i = 0; i < devices.size(); ++i) { - input_devices_.push_back(Device(devices[i], - static_cast(i))); - } - SignalDevicesChange(); - } - void SetAudioOutputDevices(const std::vector& devices) { - output_devices_.clear(); - for (size_t i = 0; i < devices.size(); ++i) { - output_devices_.push_back(Device(devices[i], - static_cast(i))); - } - SignalDevicesChange(); - } - void SetVideoCaptureDevices(const std::vector& devices) { - vidcap_devices_.clear(); - for (size_t i = 0; i < devices.size(); ++i) { - vidcap_devices_.push_back(Device(devices[i], - static_cast(i))); - } - SignalDevicesChange(); - } - virtual bool GetVideoCaptureDevice(const std::string& name, - Device* out) { - if (vidcap_devices_.empty()) - return false; - - // If the name is empty, return the default device. - if (name.empty() || name == kDefaultDeviceName) { - *out = vidcap_devices_[0]; - return true; - } - - return FindDeviceByName(vidcap_devices_, name, out); - } - bool GetAudioDevice(bool is_input, const std::string& name, - Device* out) { - // If the name is empty, return the default device. - if (name.empty() || name == kDefaultDeviceName) { - *out = Device(name, -1); - return true; - } - - return FindDeviceByName((is_input ? input_devices_ : output_devices_), - name, out); - } - static bool FindDeviceByName(const std::vector& devices, - const std::string& name, - Device* out) { - for (std::vector::const_iterator it = devices.begin(); - it != devices.end(); ++it) { - if (name == it->name) { - *out = *it; - return true; - } - } - return false; - } - - private: - std::vector input_devices_; - std::vector output_devices_; - std::vector vidcap_devices_; - std::map max_formats_; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_DEVICES_FAKEDEVICEMANAGER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/devices/filevideocapturer.h b/thirdparties/common/include/webrtc-sdk/talk/media/devices/filevideocapturer.h deleted file mode 100755 index f7956a8..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/devices/filevideocapturer.h +++ /dev/null @@ -1,156 +0,0 @@ -// libjingle -// Copyright 2004 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. -// -// This file contains two classes, VideoRecorder and FileVideoCapturer. -// VideoRecorder records the captured frames into a file. The file stores a -// sequence of captured frames; each frame has a header defined in struct -// CapturedFrame, followed by the frame data. -// -// FileVideoCapturer, a subclass of VideoCapturer, is a simulated video capturer -// that periodically reads images from a previously recorded file. - -#ifndef TALK_MEDIA_DEVICES_FILEVIDEOCAPTURER_H_ -#define TALK_MEDIA_DEVICES_FILEVIDEOCAPTURER_H_ - -#include -#include - -#include "talk/base/stream.h" -#include "talk/base/stringutils.h" -#include "talk/media/base/videocapturer.h" - -namespace talk_base { -class FileStream; -} - -namespace cricket { - -// Utility class to record the frames captured by a video capturer into a file. -class VideoRecorder { - public: - VideoRecorder() {} - ~VideoRecorder() { Stop(); } - - // Start the recorder by opening the specified file. Return true if the file - // is opened successfully. write_header should normally be true; false means - // write raw frame pixel data to file without any headers. - bool Start(const std::string& filename, bool write_header); - // Stop the recorder by closing the file. - void Stop(); - // Record a video frame to the file. Return true if the frame is written to - // the file successfully. This method needs to be called after Start() and - // before Stop(). - bool RecordFrame(const CapturedFrame& frame); - - private: - talk_base::FileStream video_file_; - bool write_header_; - - DISALLOW_COPY_AND_ASSIGN(VideoRecorder); -}; - -// Simulated video capturer that periodically reads frames from a file. -class FileVideoCapturer : public VideoCapturer { - public: - FileVideoCapturer(); - virtual ~FileVideoCapturer(); - - // Determines if the given device is actually a video file, to be captured - // with a FileVideoCapturer. - static bool IsFileVideoCapturerDevice(const Device& device) { - return talk_base::starts_with(device.id.c_str(), kVideoFileDevicePrefix); - } - - // Creates a fake device for the given filename. - static Device CreateFileVideoCapturerDevice(const std::string& filename) { - std::stringstream id; - id << kVideoFileDevicePrefix << filename; - return Device(filename, id.str()); - } - - // Set how many times to repeat reading the file. Repeat forever if the - // parameter is talk_base::kForever(-1); no repeat if the parameter is 0 or - // less than -1. - void set_repeat(int repeat) { repeat_ = repeat; } - - // If ignore_framerate is true, file is read as quickly as possible. If - // false, read rate is controlled by the timestamps in the video file - // (thus simulating camera capture). Default value set to false. - void set_ignore_framerate(bool ignore_framerate) { - ignore_framerate_ = ignore_framerate; - } - - // Initializes the capturer with the given file. - bool Init(const std::string& filename); - - // Initializes the capturer with the given device. This should only be used - // if IsFileVideoCapturerDevice returned true for the given device. - bool Init(const Device& device); - - // Override virtual methods of parent class VideoCapturer. - virtual CaptureState Start(const VideoFormat& capture_format); - virtual void Stop(); - virtual bool IsRunning(); - virtual bool IsScreencast() const { return false; } - - protected: - // Override virtual methods of parent class VideoCapturer. - virtual bool GetPreferredFourccs(std::vector* fourccs); - - // Read the frame header from the file stream, video_file_. - talk_base::StreamResult ReadFrameHeader(CapturedFrame* frame); - - // Read a frame and determine how long to wait for the next frame. If the - // frame is read successfully, Set the output parameter, wait_time_ms and - // return true. Otherwise, do not change wait_time_ms and return false. - bool ReadFrame(bool first_frame, int* wait_time_ms); - - // Return the CapturedFrame - useful for extracting contents after reading - // a frame. Should be used only while still reading a file (i.e. only while - // the CapturedFrame object still exists). - const CapturedFrame* frame() const { - return &captured_frame_; - } - - private: - class FileReadThread; // Forward declaration, defined in .cc. - - static const char* kVideoFileDevicePrefix; - talk_base::FileStream video_file_; - CapturedFrame captured_frame_; - // The number of bytes allocated buffer for captured_frame_.data. - uint32 frame_buffer_size_; - FileReadThread* file_read_thread_; - int repeat_; // How many times to repeat the file. - int64 start_time_ns_; // Time when the file video capturer starts. - int64 last_frame_timestamp_ns_; // Timestamp of last read frame. - bool ignore_framerate_; - - DISALLOW_COPY_AND_ASSIGN(FileVideoCapturer); -}; - -} // namespace cricket - -#endif // TALK_MEDIA_DEVICES_FILEVIDEOCAPTURER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/devices/gdivideorenderer.h b/thirdparties/common/include/webrtc-sdk/talk/media/devices/gdivideorenderer.h deleted file mode 100755 index 82fe99c..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/devices/gdivideorenderer.h +++ /dev/null @@ -1,60 +0,0 @@ -// libjingle -// Copyright 2004 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. -// -// Definition of class GdiVideoRenderer that implements the abstract class -// cricket::VideoRenderer via GDI on Windows. - -#ifndef TALK_MEDIA_DEVICES_GDIVIDEORENDERER_H_ -#define TALK_MEDIA_DEVICES_GDIVIDEORENDERER_H_ - -#ifdef WIN32 -#include "talk/base/scoped_ptr.h" -#include "talk/media/base/videorenderer.h" - -namespace cricket { - -class GdiVideoRenderer : public VideoRenderer { - public: - GdiVideoRenderer(int x, int y); - virtual ~GdiVideoRenderer(); - - // Implementation of pure virtual methods of VideoRenderer. - // These two methods may be executed in different threads. - // SetSize is called before RenderFrame. - virtual bool SetSize(int width, int height, int reserved); - virtual bool RenderFrame(const VideoFrame* frame); - - private: - class VideoWindow; // forward declaration, defined in the .cc file - talk_base::scoped_ptr window_; - // The initial position of the window. - int initial_x_; - int initial_y_; -}; - -} // namespace cricket - -#endif // WIN32 -#endif // TALK_MEDIA_DEVICES_GDIVIDEORENDERER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/devices/gtkvideorenderer.h b/thirdparties/common/include/webrtc-sdk/talk/media/devices/gtkvideorenderer.h deleted file mode 100755 index 522e05d..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/devices/gtkvideorenderer.h +++ /dev/null @@ -1,69 +0,0 @@ -// libjingle -// Copyright 2004 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. -// -// Definition of class GtkVideoRenderer that implements the abstract class -// cricket::VideoRenderer via GTK. - -#ifndef TALK_MEDIA_DEVICES_GTKVIDEORENDERER_H_ -#define TALK_MEDIA_DEVICES_GTKVIDEORENDERER_H_ - -#include "talk/base/basictypes.h" -#include "talk/base/scoped_ptr.h" -#include "talk/media/base/videorenderer.h" - -typedef struct _GtkWidget GtkWidget; // forward declaration, defined in gtk.h - -namespace cricket { - -class GtkVideoRenderer : public VideoRenderer { - public: - GtkVideoRenderer(int x, int y); - virtual ~GtkVideoRenderer(); - - // Implementation of pure virtual methods of VideoRenderer. - // These two methods may be executed in different threads. - // SetSize is called before RenderFrame. - virtual bool SetSize(int width, int height, int reserved); - virtual bool RenderFrame(const VideoFrame* frame); - - private: - // Initialize the attributes when the first frame arrives. - bool Initialize(int width, int height); - // Pump the Gtk event loop until there are no events left. - void Pump(); - // Check if the window has been closed. - bool IsClosed() const; - - talk_base::scoped_ptr image_; - GtkWidget* window_; - GtkWidget* draw_area_; - // The initial position of the window. - int initial_x_; - int initial_y_; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_DEVICES_GTKVIDEORENDERER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/devices/libudevsymboltable.h b/thirdparties/common/include/webrtc-sdk/talk/media/devices/libudevsymboltable.h deleted file mode 100755 index 7190a70..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/devices/libudevsymboltable.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_DEVICES_LIBUDEVSYMBOLTABLE_H_ -#define TALK_MEDIA_DEVICES_LIBUDEVSYMBOLTABLE_H_ - -#include - -#include "talk/base/latebindingsymboltable.h" - -namespace cricket { - -#define LIBUDEV_SYMBOLS_CLASS_NAME LibUDevSymbolTable -// The libudev symbols we need, as an X-Macro list. -// This list must contain precisely every libudev function that is used in -// linuxdevicemanager.cc. -#define LIBUDEV_SYMBOLS_LIST \ - X(udev_device_get_devnode) \ - X(udev_device_get_parent_with_subsystem_devtype) \ - X(udev_device_get_sysattr_value) \ - X(udev_device_new_from_syspath) \ - X(udev_device_unref) \ - X(udev_enumerate_add_match_subsystem) \ - X(udev_enumerate_get_list_entry) \ - X(udev_enumerate_new) \ - X(udev_enumerate_scan_devices) \ - X(udev_enumerate_unref) \ - X(udev_list_entry_get_name) \ - X(udev_list_entry_get_next) \ - X(udev_monitor_enable_receiving) \ - X(udev_monitor_filter_add_match_subsystem_devtype) \ - X(udev_monitor_get_fd) \ - X(udev_monitor_new_from_netlink) \ - X(udev_monitor_receive_device) \ - X(udev_monitor_unref) \ - X(udev_new) \ - X(udev_unref) - -#define LATE_BINDING_SYMBOL_TABLE_CLASS_NAME LIBUDEV_SYMBOLS_CLASS_NAME -#define LATE_BINDING_SYMBOL_TABLE_SYMBOLS_LIST LIBUDEV_SYMBOLS_LIST -#include "talk/base/latebindingsymboltable.h.def" -#undef LATE_BINDING_SYMBOL_TABLE_CLASS_NAME -#undef LATE_BINDING_SYMBOL_TABLE_SYMBOLS_LIST - -// libudev has changed ABIs to libudev.so.1 in recent distros and lots of users -// and/or software (including Google Chrome) are symlinking the old to the new. -// The entire point of ABI versions is that you can't safely do that, and -// it has caused crashes in the wild. This function checks if the DllHandle that -// we got back for libudev.so.0 is actually for libudev.so.1. If so, the library -// cannot safely be used. -bool IsWrongLibUDevAbiVersion(talk_base::DllHandle libudev_0); - -} // namespace cricket - -#endif // TALK_MEDIA_DEVICES_LIBUDEVSYMBOLTABLE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/devices/linuxdevicemanager.h b/thirdparties/common/include/webrtc-sdk/talk/media/devices/linuxdevicemanager.h deleted file mode 100755 index 65e558d..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/devices/linuxdevicemanager.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_DEVICES_LINUXDEVICEMANAGER_H_ -#define TALK_MEDIA_DEVICES_LINUXDEVICEMANAGER_H_ - -#include -#include - -#include "talk/base/sigslot.h" -#include "talk/base/stringencode.h" -#include "talk/media/devices/devicemanager.h" -#include "talk/sound/soundsystemfactory.h" - -namespace cricket { - -class LinuxDeviceManager : public DeviceManager { - public: - LinuxDeviceManager(); - virtual ~LinuxDeviceManager(); - - virtual bool GetVideoCaptureDevices(std::vector* devs); - - private: - virtual bool GetAudioDevices(bool input, std::vector* devs); - SoundSystemHandle sound_system_; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_DEVICES_LINUXDEVICEMANAGER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/devices/macdevicemanager.h b/thirdparties/common/include/webrtc-sdk/talk/media/devices/macdevicemanager.h deleted file mode 100755 index a93524f..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/devices/macdevicemanager.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_DEVICES_MACDEVICEMANAGER_H_ -#define TALK_MEDIA_DEVICES_MACDEVICEMANAGER_H_ - -#include -#include - -#include "talk/base/sigslot.h" -#include "talk/base/stringencode.h" -#include "talk/media/devices/devicemanager.h" - -namespace cricket { - -class DeviceWatcher; - -class MacDeviceManager : public DeviceManager { - public: - MacDeviceManager(); - virtual ~MacDeviceManager(); - - virtual bool GetVideoCaptureDevices(std::vector* devs); - - private: - virtual bool GetAudioDevices(bool input, std::vector* devs); - bool FilterDevice(const Device& d); -}; - -} // namespace cricket - -#endif // TALK_MEDIA_DEVICES_MACDEVICEMANAGER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/devices/v4llookup.h b/thirdparties/common/include/webrtc-sdk/talk/media/devices/v4llookup.h deleted file mode 100755 index 72e8cc0..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/devices/v4llookup.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2009 Google Inc. - * Author: lexnikitin@google.com (Alexey Nikitin) - * - * V4LLookup provides basic functionality to work with V2L2 devices in Linux - * The functionality is implemented as a class with virtual methods for - * the purpose of unit testing. - */ -#ifndef TALK_MEDIA_DEVICES_V4LLOOKUP_H_ -#define TALK_MEDIA_DEVICES_V4LLOOKUP_H_ - -#include - -#ifdef LINUX -namespace cricket { -class V4LLookup { - public: - virtual ~V4LLookup() {} - - static bool IsV4L2Device(const std::string& device_path) { - return GetV4LLookup()->CheckIsV4L2Device(device_path); - } - - static void SetV4LLookup(V4LLookup* v4l_lookup) { - v4l_lookup_ = v4l_lookup; - } - - static V4LLookup* GetV4LLookup() { - if (!v4l_lookup_) { - v4l_lookup_ = new V4LLookup(); - } - return v4l_lookup_; - } - - protected: - static V4LLookup* v4l_lookup_; - // Making virtual so it is easier to mock - virtual bool CheckIsV4L2Device(const std::string& device_path); -}; - -} // namespace cricket - -#endif // LINUX -#endif // TALK_MEDIA_DEVICES_V4LLOOKUP_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/devices/videorendererfactory.h b/thirdparties/common/include/webrtc-sdk/talk/media/devices/videorendererfactory.h deleted file mode 100755 index b3811a9..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/devices/videorendererfactory.h +++ /dev/null @@ -1,66 +0,0 @@ -// libjingle -// Copyright 2010 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. -// -// A factory to create a GUI video renderer. - -#ifndef TALK_MEDIA_DEVICES_VIDEORENDERERFACTORY_H_ -#define TALK_MEDIA_DEVICES_VIDEORENDERERFACTORY_H_ - -#include "talk/media/base/videorenderer.h" -#if defined(LINUX) && defined(HAVE_GTK) -#include "talk/media/devices/gtkvideorenderer.h" -#elif defined(OSX) && !defined(CARBON_DEPRECATED) -#include "talk/media/devices/carbonvideorenderer.h" -#elif defined(WIN32) -#include "talk/media/devices/gdivideorenderer.h" -#endif - -namespace cricket { - -class VideoRendererFactory { - public: - static VideoRenderer* CreateGuiVideoRenderer(int x, int y) { - #if defined(LINUX) && defined(HAVE_GTK) - return new GtkVideoRenderer(x, y); - #elif defined(OSX) && !defined(CARBON_DEPRECATED) - CarbonVideoRenderer* renderer = new CarbonVideoRenderer(x, y); - // Needs to be initialized on the main thread. - if (renderer->Initialize()) { - return renderer; - } else { - delete renderer; - return NULL; - } - #elif defined(WIN32) - return new GdiVideoRenderer(x, y); - #else - return NULL; - #endif - } -}; - -} // namespace cricket - -#endif // TALK_MEDIA_DEVICES_VIDEORENDERERFACTORY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/devices/win32devicemanager.h b/thirdparties/common/include/webrtc-sdk/talk/media/devices/win32devicemanager.h deleted file mode 100755 index 6617a7d..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/devices/win32devicemanager.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_DEVICES_WIN32DEVICEMANAGER_H_ -#define TALK_MEDIA_DEVICES_WIN32DEVICEMANAGER_H_ - -#include -#include - -#include "talk/base/sigslot.h" -#include "talk/base/stringencode.h" -#include "talk/media/devices/devicemanager.h" - -namespace cricket { - -class Win32DeviceManager : public DeviceManager { - public: - Win32DeviceManager(); - virtual ~Win32DeviceManager(); - - // Initialization - virtual bool Init(); - virtual void Terminate(); - - virtual bool GetVideoCaptureDevices(std::vector* devs); - - private: - virtual bool GetAudioDevices(bool input, std::vector* devs); - virtual bool GetDefaultVideoCaptureDevice(Device* device); - - bool need_couninitialize_; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_DEVICES_WIN32DEVICEMANAGER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/devices/yuvframescapturer.h b/thirdparties/common/include/webrtc-sdk/talk/media/devices/yuvframescapturer.h deleted file mode 100755 index f91faaf..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/devices/yuvframescapturer.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef TALK_MEDIA_DEVICES_YUVFRAMESCAPTURER_H_ -#define TALK_MEDIA_DEVICES_YUVFRAMESCAPTURER_H_ - -#include -#include - -#include "talk/base/stream.h" -#include "talk/base/stringutils.h" -#include "talk/media/base/videocapturer.h" -#include "talk/media/base/yuvframegenerator.h" - - -namespace talk_base { -class FileStream; -} - -namespace cricket { - - -// Simulated video capturer that periodically reads frames from a file. -class YuvFramesCapturer : public VideoCapturer { - public: - YuvFramesCapturer(); - YuvFramesCapturer(int width, int height); - virtual ~YuvFramesCapturer(); - - static const char* kYuvFrameDeviceName; - static Device CreateYuvFramesCapturerDevice() { - std::stringstream id; - id << kYuvFrameDeviceName; - return Device(id.str(), id.str()); - } - static bool IsYuvFramesCapturerDevice(const Device& device) { - return talk_base::starts_with(device.id.c_str(), kYuvFrameDeviceName); - } - - void Init(); - // Override virtual methods of parent class VideoCapturer. - virtual CaptureState Start(const VideoFormat& capture_format); - virtual void Stop(); - virtual bool IsRunning(); - virtual bool IsScreencast() const { return false; } - - protected: - // Override virtual methods of parent class VideoCapturer. - virtual bool GetPreferredFourccs(std::vector* fourccs); - - // Read a frame and determine how long to wait for the next frame. - void ReadFrame(bool first_frame); - - private: - class YuvFramesThread; // Forward declaration, defined in .cc. - - YuvFrameGenerator* frame_generator_; - CapturedFrame captured_frame_; - YuvFramesThread* frames_generator_thread; - int width_; - int height_; - uint32 frame_data_size_; - uint32 frame_index_; - - int64 barcode_reference_timestamp_millis_; - int32 barcode_interval_; - int32 GetBarcodeValue(); - - DISALLOW_COPY_AND_ASSIGN(YuvFramesCapturer); -}; - -} // namespace cricket - -#endif // TALK_MEDIA_DEVICES_YUVFRAMESCAPTURER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/other/linphonemediaengine.h b/thirdparties/common/include/webrtc-sdk/talk/media/other/linphonemediaengine.h deleted file mode 100755 index ef0ddb2..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/other/linphonemediaengine.h +++ /dev/null @@ -1,174 +0,0 @@ -/* - * libjingle - * Copyright 2010 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. - */ - -// LinphoneMediaEngine is a Linphone implementation of MediaEngine - -#ifndef TALK_SESSION_PHONE_LINPHONEMEDIAENGINE_H_ -#define TALK_SESSION_PHONE_LINPHONEMEDIAENGINE_H_ - -#include -#include - -extern "C" { -#include -} - -#include "talk/base/scoped_ptr.h" -#include "talk/media/base/codec.h" -#include "talk/media/base/mediachannel.h" -#include "talk/media/base/mediaengine.h" - -namespace talk_base { -class StreamInterface; -} - -namespace cricket { - -class LinphoneMediaEngine : public MediaEngineInterface { - public: - LinphoneMediaEngine(const std::string& ringWav, const std::string& callWav); - virtual ~LinphoneMediaEngine() {} - - // Should be called before codecs() and video_codecs() are called. We need to - // set the voice and video codecs; otherwise, Jingle initiation will fail. - void set_voice_codecs(const std::vector& codecs) { - voice_codecs_ = codecs; - } - void set_video_codecs(const std::vector& codecs) { - video_codecs_ = codecs; - } - - // Implement pure virtual methods of MediaEngine. - virtual bool Init(); - virtual void Terminate(); - virtual int GetCapabilities(); - virtual VoiceMediaChannel* CreateChannel(); - virtual VideoMediaChannel* CreateVideoChannel(VoiceMediaChannel* voice_ch); - virtual SoundclipMedia* CreateSoundclip() { return NULL; } - virtual bool SetAudioOptions(int options) { return true; } - virtual bool SetVideoOptions(int options) { return true; } - virtual bool SetDefaultVideoEncoderConfig(const VideoEncoderConfig& config) { - return true; - } - virtual bool SetSoundDevices(const Device* in_dev, const Device* out_dev) { - return true; - } - virtual bool SetVideoCaptureDevice(const Device* cam_device) { return true; } - virtual bool SetOutputVolume(int level) { return true; } - virtual int GetInputLevel() { return 0; } - virtual bool SetLocalMonitor(bool enable) { return true; } - virtual bool SetLocalRenderer(VideoRenderer* renderer) { return true; } - // TODO: control channel send? - virtual bool SetVideoCapture(bool capture) { return true; } - virtual const std::vector& audio_codecs() { - return voice_codecs_; - } - virtual const std::vector& video_codecs() { - return video_codecs_; - } - virtual bool FindAudioCodec(const AudioCodec& codec); - virtual bool FindVideoCodec(const VideoCodec& codec) { return true; } - virtual void SetVoiceLogging(int min_sev, const char* filter) {} - virtual void SetVideoLogging(int min_sev, const char* filter) {} - - std::string GetRingWav(){return ring_wav_;} - std::string GetCallWav(){return call_wav_;} - - int have_ilbc; - - private: - std::string voice_input_filename_; - std::string voice_output_filename_; - std::string video_input_filename_; - std::string video_output_filename_; - std::vector voice_codecs_; - std::vector video_codecs_; - - std::string ring_wav_; - std::string call_wav_; - - DISALLOW_COPY_AND_ASSIGN(LinphoneMediaEngine); -}; - -class LinphoneVoiceChannel : public VoiceMediaChannel { - public: - LinphoneVoiceChannel(LinphoneMediaEngine *eng); - virtual ~LinphoneVoiceChannel(); - - // Implement pure virtual methods of VoiceMediaChannel. - virtual bool SetRecvCodecs(const std::vector& codecs) { return true; } - virtual bool SetSendCodecs(const std::vector& codecs); - virtual bool SetPlayout(bool playout); - virtual bool SetSend(SendFlags flag); - virtual bool AddStream(uint32 ssrc) { return true; } - virtual bool RemoveStream(uint32 ssrc) { return true; } - virtual bool GetActiveStreams(AudioInfo::StreamList* actives) { return true; } - virtual int GetOutputLevel() { return 0; } - virtual bool SetOutputScaling(uint32 ssrc, double left, double right) { - return false; - } - virtual bool GetOutputScaling(uint32 ssrc, double* left, double* right) { - return false; - } - virtual void SetRingbackTone(const char* buf, int len) {} - virtual bool PlayRingbackTone(bool play, bool loop) { return true; } - virtual bool PressDTMF(int event, bool playout) { return true; } - virtual bool GetStats(VoiceMediaInfo* info) { return true; } - - // Implement pure virtual methods of MediaChannel. - virtual void OnPacketReceived(talk_base::Buffer* packet); - virtual void OnRtcpReceived(talk_base::Buffer* packet) {} - virtual void SetSendSsrc(uint32 id) {} // TODO: change RTP packet? - virtual bool SetRtcpCName(const std::string& cname) { return true; } - virtual bool Mute(bool on) { return mute_; } - virtual bool SetStartSendBandwidth(int bps) { return true; } - virtual bool SetMaxSendBandwidth(int bps) { return true; } - virtual bool SetOptions(int options) { return true; } - virtual bool SetRecvRtpHeaderExtensions( - const std::vector& extensions) { return true; } - virtual bool SetSendRtpHeaderExtensions( - const std::vector& extensions) { return true; } - - virtual void StartRing(bool bIncomingCall); - virtual void StopRing(); - - private: - int pt_; - bool mute_; - bool play_; - AudioStream *audio_stream_; - LinphoneMediaEngine *engine_; - RingStream* ring_stream_; - talk_base::scoped_ptr socket_; - void OnIncomingData(talk_base::AsyncSocket *s); - - DISALLOW_COPY_AND_ASSIGN(LinphoneVoiceChannel); -}; - -} // namespace cricket - -#endif // TALK_SESSION_PHONE_LINPHONEMEDIAENGINE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/sctp/sctpdataengine.h b/thirdparties/common/include/webrtc-sdk/talk/media/sctp/sctpdataengine.h deleted file mode 100755 index 9568b3e..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/sctp/sctpdataengine.h +++ /dev/null @@ -1,262 +0,0 @@ -/* - * libjingle SCTP - * Copyright 2012 Google Inc, and Robin Seggelmann - * - * 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_SCTP_SCTPDATAENGINE_H_ -#define TALK_MEDIA_SCTP_SCTPDATAENGINE_H_ - -#include -#include -#include - -namespace cricket { -// Some ERRNO values get re-#defined to WSA* equivalents in some talk/ -// headers. We save the original ones in an enum. -enum PreservedErrno { - SCTP_EINPROGRESS = EINPROGRESS, - SCTP_EWOULDBLOCK = EWOULDBLOCK -}; -} // namespace cricket - -#include "talk/base/buffer.h" -#include "talk/base/scoped_ptr.h" -#include "talk/media/base/codec.h" -#include "talk/media/base/mediachannel.h" -#include "talk/media/base/mediaengine.h" - -// Defined by "usrsctplib/usrsctp.h" -struct sockaddr_conn; -struct sctp_assoc_change; -struct sctp_stream_reset_event; -// Defined by -struct socket; -namespace cricket { -// The highest stream ID (Sid) that SCTP allows, and the number of streams we -// tell SCTP we're going to use. -const uint32 kMaxSctpSid = 1023; - -// This is the default SCTP port to use. It is passed along the wire and the -// connectee and connector must be using the same port. It is not related to the -// ports at the IP level. (Corresponds to: sockaddr_conn.sconn_port in -// usrsctp.h) -const int kSctpDefaultPort = 5000; - -// A DataEngine that interacts with usrsctp. -// -// From channel calls, data flows like this: -// [worker thread (although it can in princple be another thread)] -// 1. SctpDataMediaChannel::SendData(data) -// 2. usrsctp_sendv(data) -// [worker thread returns; sctp thread then calls the following] -// 3. OnSctpOutboundPacket(wrapped_data) -// [sctp thread returns having posted a message for the worker thread] -// 4. SctpDataMediaChannel::OnMessage(wrapped_data) -// 5. SctpDataMediaChannel::OnPacketFromSctpToNetwork(wrapped_data) -// 6. NetworkInterface::SendPacket(wrapped_data) -// 7. ... across network ... a packet is sent back ... -// 8. SctpDataMediaChannel::OnPacketReceived(wrapped_data) -// 9. usrsctp_conninput(wrapped_data) -// [worker thread returns; sctp thread then calls the following] -// 10. OnSctpInboundData(data) -// [sctp thread returns having posted a message fot the worker thread] -// 11. SctpDataMediaChannel::OnMessage(inboundpacket) -// 12. SctpDataMediaChannel::OnInboundPacketFromSctpToChannel(inboundpacket) -// 13. SctpDataMediaChannel::OnDataFromSctpToChannel(data) -// 14. SctpDataMediaChannel::SignalDataReceived(data) -// [from the same thread, methods registered/connected to -// SctpDataMediaChannel are called with the recieved data] -class SctpDataEngine : public DataEngineInterface { - public: - SctpDataEngine(); - virtual ~SctpDataEngine(); - - virtual DataMediaChannel* CreateChannel(DataChannelType data_channel_type); - - virtual const std::vector& data_codecs() { return codecs_; } - - private: - static int usrsctp_engines_count; - std::vector codecs_; -}; - -// TODO(ldixon): Make into a special type of TypedMessageData. -// Holds data to be passed on to a channel. -struct SctpInboundPacket; - -class SctpDataMediaChannel : public DataMediaChannel, - public talk_base::MessageHandler { - public: - // DataMessageType is used for the SCTP "Payload Protocol Identifier", as - // defined in http://tools.ietf.org/html/rfc4960#section-14.4 - // - // For the list of IANA approved values see: - // http://www.iana.org/assignments/sctp-parameters/sctp-parameters.xml - // The value is not used by SCTP itself. It indicates the protocol running - // on top of SCTP. - enum PayloadProtocolIdentifier { - PPID_NONE = 0, // No protocol is specified. - // Matches the PPIDs in mozilla source and - // https://datatracker.ietf.org/doc/draft-ietf-rtcweb-data-protocol Sec. 9 - // They're not yet assigned by IANA. - PPID_CONTROL = 50, - PPID_BINARY_PARTIAL = 52, - PPID_BINARY_LAST = 53, - PPID_TEXT_PARTIAL = 54, - PPID_TEXT_LAST = 51 - }; - - typedef std::set StreamSet; - - // Given a thread which will be used to post messages (received data) to this - // SctpDataMediaChannel instance. - explicit SctpDataMediaChannel(talk_base::Thread* thread); - virtual ~SctpDataMediaChannel(); - - // When SetSend is set to true, connects. When set to false, disconnects. - // Calling: "SetSend(true); SetSend(false); SetSend(true);" will connect, - // disconnect, and reconnect. - virtual bool SetSend(bool send); - // Unless SetReceive(true) is called, received packets will be discarded. - virtual bool SetReceive(bool receive); - - virtual bool AddSendStream(const StreamParams& sp); - virtual bool RemoveSendStream(uint32 ssrc); - virtual bool AddRecvStream(const StreamParams& sp); - virtual bool RemoveRecvStream(uint32 ssrc); - - // Called when Sctp gets data. The data may be a notification or data for - // OnSctpInboundData. Called from the worker thread. - virtual void OnMessage(talk_base::Message* msg); - // Send data down this channel (will be wrapped as SCTP packets then given to - // sctp that will then post the network interface by OnMessage). - // Returns true iff successful data somewhere on the send-queue/network. - virtual bool SendData(const SendDataParams& params, - const talk_base::Buffer& payload, - SendDataResult* result = NULL); - // A packet is received from the network interface. Posted to OnMessage. - virtual void OnPacketReceived(talk_base::Buffer* packet, - const talk_base::PacketTime& packet_time); - - // Exposed to allow Post call from c-callbacks. - talk_base::Thread* worker_thread() const { return worker_thread_; } - - // TODO(ldixon): add a DataOptions class to mediachannel.h - virtual bool SetOptions(int options) { return false; } - virtual int GetOptions() const { return 0; } - - // Many of these things are unused by SCTP, but are needed to fulfill - // the MediaChannel interface. - // TODO(pthatcher): Cleanup MediaChannel interface, or at least - // don't try calling these and return false. Right now, things - // don't work if we return false. - virtual bool SetStartSendBandwidth(int bps) { return true; } - virtual bool SetMaxSendBandwidth(int bps) { return true; } - virtual bool SetRecvRtpHeaderExtensions( - const std::vector& extensions) { return true; } - virtual bool SetSendRtpHeaderExtensions( - const std::vector& extensions) { return true; } - virtual bool SetSendCodecs(const std::vector& codecs); - virtual bool SetRecvCodecs(const std::vector& codecs); - virtual void OnRtcpReceived(talk_base::Buffer* packet, - const talk_base::PacketTime& packet_time) {} - virtual void OnReadyToSend(bool ready) {} - - // Helper for debugging. - void set_debug_name(const std::string& debug_name) { - debug_name_ = debug_name; - } - const std::string& debug_name() const { return debug_name_; } - - // Called with the SSID of a remote stream that's been closed. - sigslot::signal1 SignalStreamClosed; - - private: - sockaddr_conn GetSctpSockAddr(int port); - - // Creates the socket and connects. Sets sending_ to true. - bool Connect(); - // Closes the socket. Sets sending_ to false. - void Disconnect(); - - // Returns false when openning the socket failed; when successfull sets - // sending_ to true - bool OpenSctpSocket(); - // Sets sending_ to false and sock_ to NULL. - void CloseSctpSocket(); - - // Sends a SCTP_RESET_STREAM for all streams in closing_ssids_. - bool SendQueuedStreamResets(); - - // Adds a stream. - bool AddStream(const StreamParams &sp); - // Queues a stream for reset. - bool ResetStream(uint32 ssrc); - - // Called by OnMessage to send packet on the network. - void OnPacketFromSctpToNetwork(talk_base::Buffer* buffer); - // Called by OnMessage to decide what to do with the packet. - void OnInboundPacketFromSctpToChannel(SctpInboundPacket* packet); - void OnDataFromSctpToChannel(const ReceiveDataParams& params, - talk_base::Buffer* buffer); - void OnNotificationFromSctp(talk_base::Buffer* buffer); - void OnNotificationAssocChange(const sctp_assoc_change& change); - - void OnStreamResetEvent(const struct sctp_stream_reset_event* evt); - - // Responsible for marshalling incoming data to the channels listeners, and - // outgoing data to the network interface. - talk_base::Thread* worker_thread_; - // The local and remote SCTP port to use. These are passed along the wire - // and the listener and connector must be using the same port. It is not - // related to the ports at the IP level. If set to -1, we default to - // kSctpDefaultPort. - int local_port_; - int remote_port_; - struct socket* sock_; // The socket created by usrsctp_socket(...). - - // sending_ is true iff there is a connected socket. - bool sending_; - // receiving_ controls whether inbound packets are thrown away. - bool receiving_; - - // When a data channel opens a stream, it goes into open_streams_. When we - // want to close it, the stream's ID goes into queued_reset_streams_. When - // we actually transmit a RE-CONFIG chunk with that stream ID, the ID goes - // into sent_reset_streams_. When we get a response RE-CONFIG chunk back - // acknowledging the reset, we remove the stream ID from - // sent_reset_streams_. We use sent_reset_streams_ to differentiate - // between acknowledgment RE-CONFIG and peer-initiated RE-CONFIGs. - StreamSet open_streams_; - StreamSet queued_reset_streams_; - StreamSet sent_reset_streams_; - - // A human-readable name for debugging messages. - std::string debug_name_; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_SCTP_SCTPDATAENGINE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/fakewebrtccommon.h b/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/fakewebrtccommon.h deleted file mode 100755 index d82ef64..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/fakewebrtccommon.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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_SESSION_PHONE_FAKEWEBRTCCOMMON_H_ -#define TALK_SESSION_PHONE_FAKEWEBRTCCOMMON_H_ - -#include "talk/base/common.h" - -namespace cricket { - -#define WEBRTC_STUB(method, args) \ - virtual int method args OVERRIDE { return 0; } - -#define WEBRTC_STUB_CONST(method, args) \ - virtual int method args const OVERRIDE { return 0; } - -#define WEBRTC_BOOL_STUB(method, args) \ - virtual bool method args OVERRIDE { return true; } - -#define WEBRTC_VOID_STUB(method, args) \ - virtual void method args OVERRIDE {} - -#define WEBRTC_FUNC(method, args) \ - virtual int method args OVERRIDE - -#define WEBRTC_FUNC_CONST(method, args) \ - virtual int method args const OVERRIDE - -#define WEBRTC_BOOL_FUNC(method, args) \ - virtual bool method args OVERRIDE - -#define WEBRTC_VOID_FUNC(method, args) \ - virtual void method args OVERRIDE - -#define WEBRTC_CHECK_CHANNEL(channel) \ - if (channels_.find(channel) == channels_.end()) return -1; - -#define WEBRTC_ASSERT_CHANNEL(channel) \ - ASSERT(channels_.find(channel) != channels_.end()); -} // namespace cricket - -#endif // TALK_SESSION_PHONE_FAKEWEBRTCCOMMON_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/fakewebrtcdeviceinfo.h b/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/fakewebrtcdeviceinfo.h deleted file mode 100755 index 9cdffee..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/fakewebrtcdeviceinfo.h +++ /dev/null @@ -1,123 +0,0 @@ -// libjingle -// Copyright 2004 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_SESSION_PHONE_FAKEWEBRTCDEVICEINFO_H_ -#define TALK_SESSION_PHONE_FAKEWEBRTCDEVICEINFO_H_ - -#include - -#include "talk/base/stringutils.h" -#include "talk/media/webrtc/webrtcvideocapturer.h" - -// Fake class for mocking out webrtc::VideoCaptureModule::DeviceInfo. -class FakeWebRtcDeviceInfo : public webrtc::VideoCaptureModule::DeviceInfo { - public: - struct Device { - Device(const std::string& n, const std::string& i) : name(n), id(i) {} - std::string name; - std::string id; - std::string product; - std::vector caps; - }; - FakeWebRtcDeviceInfo() {} - void AddDevice(const std::string& device_name, const std::string& device_id) { - devices_.push_back(Device(device_name, device_id)); - } - void AddCapability(const std::string& device_id, - const webrtc::VideoCaptureCapability& cap) { - Device* dev = GetDeviceById( - reinterpret_cast(device_id.c_str())); - if (!dev) return; - dev->caps.push_back(cap); - } - virtual uint32_t NumberOfDevices() { - return static_cast(devices_.size()); - } - virtual int32_t GetDeviceName(uint32_t device_num, - char* device_name, - uint32_t device_name_len, - char* device_id, - uint32_t device_id_len, - char* product_id, - uint32_t product_id_len) { - Device* dev = GetDeviceByIndex(device_num); - if (!dev) return -1; - talk_base::strcpyn(reinterpret_cast(device_name), device_name_len, - dev->name.c_str()); - talk_base::strcpyn(reinterpret_cast(device_id), device_id_len, - dev->id.c_str()); - if (product_id) { - talk_base::strcpyn(reinterpret_cast(product_id), product_id_len, - dev->product.c_str()); - } - return 0; - } - virtual int32_t NumberOfCapabilities(const char* device_id) { - Device* dev = GetDeviceById(device_id); - if (!dev) return -1; - return static_cast(dev->caps.size()); - } - virtual int32_t GetCapability(const char* device_id, - const uint32_t device_cap_num, - webrtc::VideoCaptureCapability& cap) { - Device* dev = GetDeviceById(device_id); - if (!dev) return -1; - if (device_cap_num >= dev->caps.size()) return -1; - cap = dev->caps[device_cap_num]; - return 0; - } - virtual int32_t GetOrientation(const char* device_id, - webrtc::VideoCaptureRotation& rotation) { - return -1; // not implemented - } - virtual int32_t GetBestMatchedCapability( - const char* device_id, - const webrtc::VideoCaptureCapability& requested, - webrtc::VideoCaptureCapability& resulting) { - return -1; // not implemented - } - virtual int32_t DisplayCaptureSettingsDialogBox( - const char* device_id, const char* dialog_title, - void* parent, uint32_t x, uint32_t y) { - return -1; // not implemented - } - - Device* GetDeviceByIndex(size_t num) { - return (num < devices_.size()) ? &devices_[num] : NULL; - } - Device* GetDeviceById(const char* device_id) { - for (size_t i = 0; i < devices_.size(); ++i) { - if (devices_[i].id == reinterpret_cast(device_id)) { - return &devices_[i]; - } - } - return NULL; - } - - private: - std::vector devices_; -}; - -#endif // TALK_SESSION_PHONE_FAKEWEBRTCDEVICEINFO_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/fakewebrtcvcmfactory.h b/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/fakewebrtcvcmfactory.h deleted file mode 100755 index 03c806e..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/fakewebrtcvcmfactory.h +++ /dev/null @@ -1,63 +0,0 @@ -// libjingle -// Copyright 2004 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_SESSION_PHONE_FAKEWEBRTCVCMFACTORY_H_ -#define TALK_SESSION_PHONE_FAKEWEBRTCVCMFACTORY_H_ - -#include - -#include "talk/media/webrtc/fakewebrtcvideocapturemodule.h" -#include "talk/media/webrtc/webrtcvideocapturer.h" - -// Factory class to allow the fakes above to be injected into -// WebRtcVideoCapturer. -class FakeWebRtcVcmFactory : public cricket::WebRtcVcmFactoryInterface { - public: - virtual webrtc::VideoCaptureModule* Create(int module_id, - const char* device_id) { - if (!device_info.GetDeviceById(device_id)) return NULL; - FakeWebRtcVideoCaptureModule* module = - new FakeWebRtcVideoCaptureModule(this, module_id); - modules.push_back(module); - return module; - } - virtual webrtc::VideoCaptureModule::DeviceInfo* CreateDeviceInfo(int id) { - return &device_info; - } - virtual void DestroyDeviceInfo(webrtc::VideoCaptureModule::DeviceInfo* info) { - } - void OnDestroyed(webrtc::VideoCaptureModule* module) { - std::remove(modules.begin(), modules.end(), module); - } - FakeWebRtcDeviceInfo device_info; - std::vector modules; -}; - -FakeWebRtcVideoCaptureModule::~FakeWebRtcVideoCaptureModule() { - if (factory_) - factory_->OnDestroyed(this); -} - -#endif // TALK_SESSION_PHONE_FAKEWEBRTCVCMFACTORY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/fakewebrtcvideocapturemodule.h b/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/fakewebrtcvideocapturemodule.h deleted file mode 100755 index 156f7fc..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/fakewebrtcvideocapturemodule.h +++ /dev/null @@ -1,150 +0,0 @@ -// libjingle -// Copyright 2004 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_SESSION_PHONE_FAKEWEBRTCVIDEOCAPTUREMODULE_H_ -#define TALK_SESSION_PHONE_FAKEWEBRTCVIDEOCAPTUREMODULE_H_ - -#include - -#include "talk/media/base/testutils.h" -#include "talk/media/webrtc/fakewebrtcdeviceinfo.h" -#include "talk/media/webrtc/webrtcvideocapturer.h" - -class FakeWebRtcVcmFactory; - -// Fake class for mocking out webrtc::VideoCaptureModule. -class FakeWebRtcVideoCaptureModule : public webrtc::VideoCaptureModule { - public: - FakeWebRtcVideoCaptureModule(FakeWebRtcVcmFactory* factory, int32_t id) - : factory_(factory), - id_(id), - callback_(NULL), - running_(false), - delay_(0) { - } - virtual int32_t Version(char* version, - uint32_t& remaining_buffer_in_bytes, - uint32_t& position) const { - return 0; - } - virtual int32_t TimeUntilNextProcess() { - return 0; - } - virtual int32_t Process() { - return 0; - } - virtual int32_t ChangeUniqueId(const int32_t id) { - id_ = id; - return 0; - } - virtual void RegisterCaptureDataCallback( - webrtc::VideoCaptureDataCallback& callback) { - callback_ = &callback; - } - virtual void DeRegisterCaptureDataCallback() { callback_ = NULL; } - virtual void RegisterCaptureCallback(webrtc::VideoCaptureFeedBack& callback) { - // Not implemented. - } - virtual void DeRegisterCaptureCallback() { - // Not implemented. - } - virtual void SetCaptureDelay(int32_t delay) { delay_ = delay; } - virtual int32_t CaptureDelay() { return delay_; } - virtual void EnableFrameRateCallback(const bool enable) { - // not implemented - } - virtual void EnableNoPictureAlarm(const bool enable) { - // not implemented - } - virtual int32_t StartCapture( - const webrtc::VideoCaptureCapability& cap) { - if (running_) return -1; - cap_ = cap; - running_ = true; - return 0; - } - virtual int32_t StopCapture() { - running_ = false; - return 0; - } - virtual const char* CurrentDeviceName() const { - return NULL; // not implemented - } - virtual bool CaptureStarted() { - return running_; - } - virtual int32_t CaptureSettings( - webrtc::VideoCaptureCapability& settings) { - if (!running_) return -1; - settings = cap_; - return 0; - } - - virtual int32_t SetCaptureRotation( - webrtc::VideoCaptureRotation rotation) { - return -1; // not implemented - } - virtual VideoCaptureEncodeInterface* GetEncodeInterface( - const webrtc::VideoCodec& codec) { - return NULL; // not implemented - } - virtual int32_t AddRef() { - return 0; - } - virtual int32_t Release() { - delete this; - return 0; - } - - bool SendFrame(int w, int h) { - if (!running_) return false; - webrtc::I420VideoFrame sample; - // Setting stride based on width. - if (sample.CreateEmptyFrame(w, h, w, (w + 1) / 2, (w + 1) / 2) < 0) { - return false; - } - if (callback_) { - callback_->OnIncomingCapturedFrame(id_, sample); - } - return true; - } - - const webrtc::VideoCaptureCapability& cap() const { - return cap_; - } - - private: - // Ref-counted, use Release() instead. - ~FakeWebRtcVideoCaptureModule(); - - FakeWebRtcVcmFactory* factory_; - int id_; - webrtc::VideoCaptureDataCallback* callback_; - bool running_; - webrtc::VideoCaptureCapability cap_; - int delay_; -}; - -#endif // TALK_SESSION_PHONE_FAKEWEBRTCVIDEOCAPTUREMODULE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/fakewebrtcvideoengine.h b/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/fakewebrtcvideoengine.h deleted file mode 100755 index 1b31f05..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/fakewebrtcvideoengine.h +++ /dev/null @@ -1,1283 +0,0 @@ -/* - * libjingle - * Copyright 2010 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_WEBRTC_FAKEWEBRTCVIDEOENGINE_H_ -#define TALK_MEDIA_WEBRTC_FAKEWEBRTCVIDEOENGINE_H_ - -#include -#include -#include - -#include "talk/base/basictypes.h" -#include "talk/base/gunit.h" -#include "talk/base/stringutils.h" -#include "talk/media/base/codec.h" -#include "talk/media/webrtc/fakewebrtccommon.h" -#include "talk/media/webrtc/webrtcvideodecoderfactory.h" -#include "talk/media/webrtc/webrtcvideoencoderfactory.h" -#include "talk/media/webrtc/webrtcvie.h" - -namespace cricket { - -#define WEBRTC_CHECK_CAPTURER(capturer) \ - if (capturers_.find(capturer) == capturers_.end()) return -1; - -#define WEBRTC_ASSERT_CAPTURER(capturer) \ - ASSERT(capturers_.find(capturer) != capturers_.end()); - -static const int kMinVideoBitrate = 100; -static const int kStartVideoBitrate = 300; -static const int kMaxVideoBitrate = 1000; - -// WebRtc channel id and capture id share the same number space. -// This is how AddRenderer(renderId, ...) is able to tell if it is adding a -// renderer for a channel or it is adding a renderer for a capturer. -static const int kViEChannelIdBase = 0; -static const int kViEChannelIdMax = 1000; -static const int kViECaptureIdBase = 10000; // Make sure there is a gap. -static const int kViECaptureIdMax = 11000; - -// Fake class for mocking out webrtc::VideoDecoder -class FakeWebRtcVideoDecoder : public webrtc::VideoDecoder { - public: - FakeWebRtcVideoDecoder() - : num_frames_received_(0) { - } - - virtual int32 InitDecode(const webrtc::VideoCodec*, int32) { - return WEBRTC_VIDEO_CODEC_OK; - } - - virtual int32 Decode( - const webrtc::EncodedImage&, bool, const webrtc::RTPFragmentationHeader*, - const webrtc::CodecSpecificInfo*, int64) { - num_frames_received_++; - return WEBRTC_VIDEO_CODEC_OK; - } - - virtual int32 RegisterDecodeCompleteCallback( - webrtc::DecodedImageCallback*) { - return WEBRTC_VIDEO_CODEC_OK; - } - - virtual int32 Release() { - return WEBRTC_VIDEO_CODEC_OK; - } - - virtual int32 Reset() { - return WEBRTC_VIDEO_CODEC_OK; - } - - int GetNumFramesReceived() const { - return num_frames_received_; - } - - private: - int num_frames_received_; -}; - -// Fake class for mocking out WebRtcVideoDecoderFactory. -class FakeWebRtcVideoDecoderFactory : public WebRtcVideoDecoderFactory { - public: - FakeWebRtcVideoDecoderFactory() - : num_created_decoders_(0) { - } - - virtual webrtc::VideoDecoder* CreateVideoDecoder( - webrtc::VideoCodecType type) { - if (supported_codec_types_.count(type) == 0) { - return NULL; - } - FakeWebRtcVideoDecoder* decoder = new FakeWebRtcVideoDecoder(); - decoders_.push_back(decoder); - num_created_decoders_++; - return decoder; - } - - virtual void DestroyVideoDecoder(webrtc::VideoDecoder* decoder) { - decoders_.erase( - std::remove(decoders_.begin(), decoders_.end(), decoder), - decoders_.end()); - delete decoder; - } - - void AddSupportedVideoCodecType(webrtc::VideoCodecType type) { - supported_codec_types_.insert(type); - } - - int GetNumCreatedDecoders() { - return num_created_decoders_; - } - - const std::vector& decoders() { - return decoders_; - } - - private: - std::set supported_codec_types_; - std::vector decoders_; - int num_created_decoders_; -}; - -// Fake class for mocking out webrtc::VideoEnoder -class FakeWebRtcVideoEncoder : public webrtc::VideoEncoder { - public: - FakeWebRtcVideoEncoder() {} - - virtual int32 InitEncode(const webrtc::VideoCodec* codecSettings, - int32 numberOfCores, - uint32 maxPayloadSize) { - return WEBRTC_VIDEO_CODEC_OK; - } - - virtual int32 Encode( - const webrtc::I420VideoFrame& inputImage, - const webrtc::CodecSpecificInfo* codecSpecificInfo, - const std::vector* frame_types) { - return WEBRTC_VIDEO_CODEC_OK; - } - - virtual int32 RegisterEncodeCompleteCallback( - webrtc::EncodedImageCallback* callback) { - return WEBRTC_VIDEO_CODEC_OK; - } - - virtual int32 Release() { - return WEBRTC_VIDEO_CODEC_OK; - } - - virtual int32 SetChannelParameters(uint32 packetLoss, - int rtt) { - return WEBRTC_VIDEO_CODEC_OK; - } - - virtual int32 SetRates(uint32 newBitRate, - uint32 frameRate) { - return WEBRTC_VIDEO_CODEC_OK; - } -}; - -// Fake class for mocking out WebRtcVideoEncoderFactory. -class FakeWebRtcVideoEncoderFactory : public WebRtcVideoEncoderFactory { - public: - FakeWebRtcVideoEncoderFactory() - : num_created_encoders_(0) { - } - - virtual webrtc::VideoEncoder* CreateVideoEncoder( - webrtc::VideoCodecType type) { - if (supported_codec_types_.count(type) == 0) { - return NULL; - } - FakeWebRtcVideoEncoder* encoder = new FakeWebRtcVideoEncoder(); - encoders_.push_back(encoder); - num_created_encoders_++; - return encoder; - } - - virtual void DestroyVideoEncoder(webrtc::VideoEncoder* encoder) { - encoders_.erase( - std::remove(encoders_.begin(), encoders_.end(), encoder), - encoders_.end()); - delete encoder; - } - - virtual void AddObserver(WebRtcVideoEncoderFactory::Observer* observer) { - bool inserted = observers_.insert(observer).second; - EXPECT_TRUE(inserted); - } - - virtual void RemoveObserver(WebRtcVideoEncoderFactory::Observer* observer) { - size_t erased = observers_.erase(observer); - EXPECT_EQ(erased, 1UL); - } - - virtual const std::vector& codecs() - const { - return codecs_; - } - - void AddSupportedVideoCodecType(webrtc::VideoCodecType type, - const std::string& name) { - supported_codec_types_.insert(type); - codecs_.push_back( - WebRtcVideoEncoderFactory::VideoCodec(type, name, 1280, 720, 30)); - } - - void NotifyCodecsAvailable() { - std::set::iterator it; - for (it = observers_.begin(); it != observers_.end(); ++it) - (*it)->OnCodecsAvailable(); - } - - int GetNumCreatedEncoders() { - return num_created_encoders_; - } - - const std::vector& encoders() { - return encoders_; - } - - private: - std::set supported_codec_types_; - std::vector codecs_; - std::vector encoders_; - std::set observers_; - int num_created_encoders_; -}; - -class FakeWebRtcVideoEngine - : public webrtc::ViEBase, - public webrtc::ViECodec, - public webrtc::ViECapture, - public webrtc::ViENetwork, - public webrtc::ViERender, - public webrtc::ViERTP_RTCP, - public webrtc::ViEImageProcess, - public webrtc::ViEExternalCodec { - public: - struct Channel { - Channel() - : capture_id_(-1), - original_channel_id_(-1), - has_renderer_(false), - render_started_(false), - send(false), - receive_(false), - can_transmit_(true), - remote_rtx_ssrc_(-1), - rtx_send_payload_type(-1), - rtx_recv_payload_type(-1), - rtcp_status_(webrtc::kRtcpNone), - key_frame_request_method_(webrtc::kViEKeyFrameRequestNone), - tmmbr_(false), - remb_contribute_(false), - remb_bw_partition_(false), - rtp_offset_send_id_(-1), - rtp_offset_receive_id_(-1), - rtp_absolute_send_time_send_id_(-1), - rtp_absolute_send_time_receive_id_(-1), - sender_target_delay_(0), - receiver_target_delay_(0), - transmission_smoothing_(false), - nack_(false), - hybrid_nack_fec_(false), - send_video_bitrate_(0), - send_fec_bitrate_(0), - send_nack_bitrate_(0), - send_bandwidth_(0), - receive_bandwidth_(0), - reserved_transmit_bitrate_bps_(0), - suspend_below_min_bitrate_(false), - overuse_observer_(NULL), - last_recvd_payload_type_(-1) { - ssrcs_[0] = 0; // default ssrc. - memset(&send_codec, 0, sizeof(send_codec)); - memset(&overuse_options_, 0, sizeof(overuse_options_)); - } - int capture_id_; - int original_channel_id_; - bool has_renderer_; - bool render_started_; - bool send; - bool receive_; - bool can_transmit_; - std::map ssrcs_; - std::map rtx_ssrcs_; - int remote_rtx_ssrc_; - int rtx_send_payload_type; - int rtx_recv_payload_type; - std::string cname_; - webrtc::ViERTCPMode rtcp_status_; - webrtc::ViEKeyFrameRequestMethod key_frame_request_method_; - bool tmmbr_; - bool remb_contribute_; // This channel contributes to the remb report. - bool remb_bw_partition_; // This channel is allocated part of total bw. - int rtp_offset_send_id_; - int rtp_offset_receive_id_; - int rtp_absolute_send_time_send_id_; - int rtp_absolute_send_time_receive_id_; - int sender_target_delay_; - int receiver_target_delay_; - bool transmission_smoothing_; - bool nack_; - bool hybrid_nack_fec_; - std::vector recv_codecs; - std::set ext_decoder_pl_types_; - std::set ext_encoder_pl_types_; - webrtc::VideoCodec send_codec; - unsigned int send_video_bitrate_; - unsigned int send_fec_bitrate_; - unsigned int send_nack_bitrate_; - unsigned int send_bandwidth_; - unsigned int receive_bandwidth_; - unsigned int reserved_transmit_bitrate_bps_; - bool suspend_below_min_bitrate_; - webrtc::CpuOveruseObserver* overuse_observer_; - webrtc::CpuOveruseOptions overuse_options_; - int last_recvd_payload_type_; - }; - class Capturer : public webrtc::ViEExternalCapture { - public: - Capturer() : channel_id_(-1), denoising_(false), - last_capture_time_(0), incoming_frame_num_(0) { } - int channel_id() const { return channel_id_; } - void set_channel_id(int channel_id) { channel_id_ = channel_id; } - bool denoising() const { return denoising_; } - void set_denoising(bool denoising) { denoising_ = denoising; } - int64 last_capture_time() const { return last_capture_time_; } - int incoming_frame_num() const { return incoming_frame_num_; } - - // From ViEExternalCapture - virtual int IncomingFrame(unsigned char* videoFrame, - unsigned int videoFrameLength, - unsigned short width, - unsigned short height, - webrtc::RawVideoType videoType, - unsigned long long captureTime) { - return 0; - } - virtual int IncomingFrameI420( - const webrtc::ViEVideoFrameI420& video_frame, - unsigned long long captureTime) { - last_capture_time_ = captureTime; - ++incoming_frame_num_; - return 0; - } - - private: - int channel_id_; - bool denoising_; - int64 last_capture_time_; - int incoming_frame_num_; - }; - - FakeWebRtcVideoEngine(const cricket::VideoCodec* const* codecs, - int num_codecs) - : inited_(false), - last_channel_(kViEChannelIdBase - 1), - fail_create_channel_(false), - last_capturer_(kViECaptureIdBase - 1), - fail_alloc_capturer_(false), - codecs_(codecs), - num_codecs_(num_codecs), - num_set_send_codecs_(0) { - } - - ~FakeWebRtcVideoEngine() { - ASSERT(0 == channels_.size()); - ASSERT(0 == capturers_.size()); - } - bool IsInited() const { return inited_; } - - int GetLastChannel() const { return last_channel_; } - int GetChannelFromLocalSsrc(int local_ssrc) const { - // ssrcs_[0] is the default local ssrc. - for (std::map::const_iterator iter = channels_.begin(); - iter != channels_.end(); ++iter) { - if (local_ssrc == iter->second->ssrcs_[0]) { - return iter->first; - } - } - return -1; - } - - int GetNumChannels() const { return static_cast(channels_.size()); } - bool IsChannel(int channel) const { - return (channels_.find(channel) != channels_.end()); - } - void set_fail_create_channel(bool fail_create_channel) { - fail_create_channel_ = fail_create_channel; - } - - int GetLastCapturer() const { return last_capturer_; } - int GetNumCapturers() const { return static_cast(capturers_.size()); } - int GetIncomingFrameNum(int channel_id) const { - for (std::map::const_iterator iter = capturers_.begin(); - iter != capturers_.end(); ++iter) { - Capturer* capturer = iter->second; - if (capturer->channel_id() == channel_id) { - return capturer->incoming_frame_num(); - } - } - return -1; - } - void set_fail_alloc_capturer(bool fail_alloc_capturer) { - fail_alloc_capturer_ = fail_alloc_capturer; - } - int GetNumSetSendCodecs() const { return num_set_send_codecs_; } - - int GetCaptureId(int channel) const { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_.find(channel)->second->capture_id_; - } - int GetOriginalChannelId(int channel) const { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_.find(channel)->second->original_channel_id_; - } - bool GetHasRenderer(int channel) const { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_.find(channel)->second->has_renderer_; - } - bool GetRenderStarted(int channel) const { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_.find(channel)->second->render_started_; - } - bool GetSend(int channel) const { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_.find(channel)->second->send; - } - bool GetReceive(int channel) const { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_.find(channel)->second->receive_; - } - int GetCaptureChannelId(int capture_id) const { - WEBRTC_ASSERT_CAPTURER(capture_id); - return capturers_.find(capture_id)->second->channel_id(); - } - bool GetCaptureDenoising(int capture_id) const { - WEBRTC_ASSERT_CAPTURER(capture_id); - return capturers_.find(capture_id)->second->denoising(); - } - int64 GetCaptureLastTimestamp(int capture_id) const { - WEBRTC_ASSERT_CAPTURER(capture_id); - return capturers_.find(capture_id)->second->last_capture_time(); - } - webrtc::ViERTCPMode GetRtcpStatus(int channel) const { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_.find(channel)->second->rtcp_status_; - } - webrtc::ViEKeyFrameRequestMethod GetKeyFrameRequestMethod(int channel) const { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_.find(channel)->second->key_frame_request_method_; - } - bool GetTmmbrStatus(int channel) const { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_.find(channel)->second->tmmbr_; - } - bool GetRembStatusBwPartition(int channel) const { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_.find(channel)->second->remb_bw_partition_; - } - bool GetRembStatusContribute(int channel) const { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_.find(channel)->second->remb_contribute_; - } - int GetSendRtpExtensionId(int channel, const std::string& extension) { - WEBRTC_ASSERT_CHANNEL(channel); - if (extension == kRtpTimestampOffsetHeaderExtension) { - return channels_.find(channel)->second->rtp_offset_send_id_; - } else if (extension == kRtpAbsoluteSenderTimeHeaderExtension) { - return channels_.find(channel)->second->rtp_absolute_send_time_send_id_; - } - return -1; - } - int GetReceiveRtpExtensionId(int channel, const std::string& extension) { - WEBRTC_ASSERT_CHANNEL(channel); - if (extension == kRtpTimestampOffsetHeaderExtension) { - return channels_.find(channel)->second->rtp_offset_receive_id_; - } else if (extension == kRtpAbsoluteSenderTimeHeaderExtension) { - return - channels_.find(channel)->second->rtp_absolute_send_time_receive_id_; - } - return -1; - } - bool GetTransmissionSmoothingStatus(int channel) { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_.find(channel)->second->transmission_smoothing_; - } - int GetSenderTargetDelay(int channel) { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_.find(channel)->second->sender_target_delay_; - } - int GetReceiverTargetDelay(int channel) { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_.find(channel)->second->receiver_target_delay_; - } - bool GetNackStatus(int channel) const { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_.find(channel)->second->nack_; - } - bool GetHybridNackFecStatus(int channel) const { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_.find(channel)->second->hybrid_nack_fec_; - } - int GetNumSsrcs(int channel) const { - WEBRTC_ASSERT_CHANNEL(channel); - return static_cast( - channels_.find(channel)->second->ssrcs_.size()); - } - int GetNumRtxSsrcs(int channel) const { - WEBRTC_ASSERT_CHANNEL(channel); - return static_cast( - channels_.find(channel)->second->rtx_ssrcs_.size()); - } - bool GetIsTransmitting(int channel) const { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_.find(channel)->second->can_transmit_; - } - webrtc::CpuOveruseObserver* GetCpuOveruseObserver(int channel) const { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_.find(channel)->second->overuse_observer_; - } - webrtc::CpuOveruseOptions GetCpuOveruseOptions(int channel) const { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_.find(channel)->second->overuse_options_; - } - int GetRtxSsrc(int channel, int simulcast_idx) const { - WEBRTC_ASSERT_CHANNEL(channel); - if (channels_.find(channel)->second->rtx_ssrcs_.find(simulcast_idx) == - channels_.find(channel)->second->rtx_ssrcs_.end()) { - return -1; - } - return channels_.find(channel)->second->rtx_ssrcs_[simulcast_idx]; - } - bool ReceiveCodecRegistered(int channel, - const webrtc::VideoCodec& codec) const { - WEBRTC_ASSERT_CHANNEL(channel); - const std::vector& codecs = - channels_.find(channel)->second->recv_codecs; - return std::find(codecs.begin(), codecs.end(), codec) != codecs.end(); - }; - bool ExternalDecoderRegistered(int channel, - unsigned int pl_type) const { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_.find(channel)->second-> - ext_decoder_pl_types_.count(pl_type) != 0; - }; - int GetNumExternalDecoderRegistered(int channel) const { - WEBRTC_ASSERT_CHANNEL(channel); - return static_cast( - channels_.find(channel)->second->ext_decoder_pl_types_.size()); - }; - bool ExternalEncoderRegistered(int channel, - unsigned int pl_type) const { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_.find(channel)->second-> - ext_encoder_pl_types_.count(pl_type) != 0; - }; - int GetNumExternalEncoderRegistered(int channel) const { - WEBRTC_ASSERT_CHANNEL(channel); - return static_cast( - channels_.find(channel)->second->ext_encoder_pl_types_.size()); - }; - int GetTotalNumExternalEncoderRegistered() const { - std::map::const_iterator it; - int total_num_registered = 0; - for (it = channels_.begin(); it != channels_.end(); ++it) - total_num_registered += - static_cast(it->second->ext_encoder_pl_types_.size()); - return total_num_registered; - } - void SetSendBitrates(int channel, unsigned int video_bitrate, - unsigned int fec_bitrate, unsigned int nack_bitrate) { - WEBRTC_ASSERT_CHANNEL(channel); - channels_[channel]->send_video_bitrate_ = video_bitrate; - channels_[channel]->send_fec_bitrate_ = fec_bitrate; - channels_[channel]->send_nack_bitrate_ = nack_bitrate; - } - void SetSendBandwidthEstimate(int channel, unsigned int send_bandwidth) { - WEBRTC_ASSERT_CHANNEL(channel); - channels_[GetOriginalChannelId(channel)]->send_bandwidth_ = send_bandwidth; - } - void SetReceiveBandwidthEstimate(int channel, - unsigned int receive_bandwidth) { - WEBRTC_ASSERT_CHANNEL(channel); - channels_[GetOriginalChannelId(channel)]->receive_bandwidth_ = - receive_bandwidth; - }; - int GetRtxSendPayloadType(int channel) { - WEBRTC_CHECK_CHANNEL(channel); - return channels_[channel]->rtx_send_payload_type; - } - int GetRtxRecvPayloadType(int channel) { - WEBRTC_CHECK_CHANNEL(channel); - return channels_[channel]->rtx_recv_payload_type; - } - int GetRemoteRtxSsrc(int channel) { - WEBRTC_CHECK_CHANNEL(channel); - return channels_.find(channel)->second->remote_rtx_ssrc_; - } - bool GetSuspendBelowMinBitrateStatus(int channel) { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_.find(channel)->second->suspend_below_min_bitrate_; - } - int GetLastRecvdPayloadType(int channel) const { - WEBRTC_CHECK_CHANNEL(channel); - return channels_.find(channel)->second->last_recvd_payload_type_; - } - unsigned int GetReservedTransmitBitrate(int channel) { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_.find(channel)->second->reserved_transmit_bitrate_bps_; - } - - WEBRTC_STUB(Release, ()); - - // webrtc::ViEBase - WEBRTC_FUNC(Init, ()) { - inited_ = true; - return 0; - }; - WEBRTC_STUB(SetVoiceEngine, (webrtc::VoiceEngine*)); - WEBRTC_FUNC(CreateChannel, (int& channel)) { // NOLINT - if (fail_create_channel_) { - return -1; - } - if (kViEChannelIdMax == last_channel_) { - return -1; - } - Channel* ch = new Channel(); - ++last_channel_; - // The original channel of the first channel in a group refers to itself - // for code simplicity. - ch->original_channel_id_ = last_channel_; - channels_[last_channel_] = ch; - channel = last_channel_; - return 0; - }; - WEBRTC_FUNC(CreateChannel, (int& channel, int original_channel)) { - WEBRTC_CHECK_CHANNEL(original_channel); - if (CreateChannel(channel) != 0) { - return -1; - } - channels_[channel]->original_channel_id_ = original_channel; - return 0; - } - WEBRTC_FUNC(CreateReceiveChannel, (int& channel, int original_channel)) { - return CreateChannel(channel, original_channel); - } - WEBRTC_FUNC(DeleteChannel, (const int channel)) { - WEBRTC_CHECK_CHANNEL(channel); - // Make sure we deregister all the decoders before deleting a channel. - EXPECT_EQ(0, GetNumExternalDecoderRegistered(channel)); - delete channels_[channel]; - channels_.erase(channel); - return 0; - } - WEBRTC_FUNC(RegisterCpuOveruseObserver, - (int channel, webrtc::CpuOveruseObserver* observer)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->overuse_observer_ = observer; - return 0; - } - WEBRTC_STUB(CpuOveruseMeasures, (int, int*, int*, int*, int*)); - WEBRTC_FUNC(SetCpuOveruseOptions, - (int channel, const webrtc::CpuOveruseOptions& options)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->overuse_options_ = options; - return 0; - } - WEBRTC_STUB(ConnectAudioChannel, (const int, const int)); - WEBRTC_STUB(DisconnectAudioChannel, (const int)); - WEBRTC_FUNC(StartSend, (const int channel)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->send = true; - return 0; - } - WEBRTC_FUNC(StopSend, (const int channel)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->send = false; - return 0; - } - WEBRTC_FUNC(StartReceive, (const int channel)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->receive_ = true; - return 0; - } - WEBRTC_FUNC(StopReceive, (const int channel)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->receive_ = false; - return 0; - } - WEBRTC_STUB(GetVersion, (char version[1024])); - WEBRTC_STUB(LastError, ()); - - // webrtc::ViECodec - WEBRTC_FUNC_CONST(NumberOfCodecs, ()) { - return num_codecs_; - }; - WEBRTC_FUNC_CONST(GetCodec, (const unsigned char list_number, - webrtc::VideoCodec& out_codec)) { - if (list_number >= NumberOfCodecs()) { - return -1; - } - memset(&out_codec, 0, sizeof(out_codec)); - const cricket::VideoCodec& c(*codecs_[list_number]); - if ("I420" == c.name) { - out_codec.codecType = webrtc::kVideoCodecI420; - } else if ("VP8" == c.name) { - out_codec.codecType = webrtc::kVideoCodecVP8; - } else if ("red" == c.name) { - out_codec.codecType = webrtc::kVideoCodecRED; - } else if ("ulpfec" == c.name) { - out_codec.codecType = webrtc::kVideoCodecULPFEC; - } else { - out_codec.codecType = webrtc::kVideoCodecUnknown; - } - talk_base::strcpyn(out_codec.plName, sizeof(out_codec.plName), - c.name.c_str()); - out_codec.plType = c.id; - out_codec.width = c.width; - out_codec.height = c.height; - out_codec.startBitrate = kStartVideoBitrate; - out_codec.maxBitrate = kMaxVideoBitrate; - out_codec.minBitrate = kMinVideoBitrate; - out_codec.maxFramerate = c.framerate; - return 0; - }; - WEBRTC_FUNC(SetSendCodec, (const int channel, - const webrtc::VideoCodec& codec)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->send_codec = codec; - ++num_set_send_codecs_; - return 0; - }; - WEBRTC_FUNC_CONST(GetSendCodec, (const int channel, - webrtc::VideoCodec& codec)) { // NOLINT - WEBRTC_CHECK_CHANNEL(channel); - codec = channels_.find(channel)->second->send_codec; - return 0; - }; - WEBRTC_FUNC(SetReceiveCodec, (const int channel, - const webrtc::VideoCodec& codec)) { // NOLINT - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->recv_codecs.push_back(codec); - return 0; - }; - WEBRTC_STUB_CONST(GetReceiveCodec, (const int, webrtc::VideoCodec&)); - WEBRTC_STUB_CONST(GetCodecConfigParameters, (const int, - unsigned char*, unsigned char&)); - WEBRTC_STUB(SetImageScaleStatus, (const int, const bool)); - WEBRTC_STUB_CONST(GetSendCodecStastistics, (const int, - unsigned int&, unsigned int&)); - WEBRTC_STUB_CONST(GetReceiveCodecStastistics, (const int, - unsigned int&, unsigned int&)); - WEBRTC_STUB_CONST(GetReceiveSideDelay, (const int video_channel, - int* delay_ms)); - WEBRTC_FUNC_CONST(GetCodecTargetBitrate, (const int channel, - unsigned int* codec_target_bitrate)) { - WEBRTC_CHECK_CHANNEL(channel); - - std::map::const_iterator it = channels_.find(channel); - if (it->second->send) { - // Assume the encoder produces the expected rate. - *codec_target_bitrate = it->second->send_video_bitrate_; - } else { - *codec_target_bitrate = 0; - } - return 0; - } - virtual unsigned int GetDiscardedPackets(const int channel) const { - return 0; - } - - WEBRTC_STUB(SetKeyFrameRequestCallbackStatus, (const int, const bool)); - WEBRTC_STUB(SetSignalKeyPacketLossStatus, (const int, const bool, - const bool)); - WEBRTC_STUB(RegisterEncoderObserver, (const int, - webrtc::ViEEncoderObserver&)); - WEBRTC_STUB(DeregisterEncoderObserver, (const int)); - WEBRTC_STUB(RegisterDecoderObserver, (const int, - webrtc::ViEDecoderObserver&)); - WEBRTC_STUB(DeregisterDecoderObserver, (const int)); - WEBRTC_STUB(SendKeyFrame, (const int)); - WEBRTC_STUB(WaitForFirstKeyFrame, (const int, const bool)); - WEBRTC_STUB(StartDebugRecording, (int, const char*)); - WEBRTC_STUB(StopDebugRecording, (int)); - WEBRTC_VOID_FUNC(SuspendBelowMinBitrate, (int channel)) { - WEBRTC_ASSERT_CHANNEL(channel); - channels_[channel]->suspend_below_min_bitrate_ = true; - } - - // webrtc::ViECapture - WEBRTC_STUB(NumberOfCaptureDevices, ()); - WEBRTC_STUB(GetCaptureDevice, (unsigned int, char*, - const unsigned int, char*, const unsigned int)); - WEBRTC_STUB(AllocateCaptureDevice, (const char*, const unsigned int, int&)); - WEBRTC_FUNC(AllocateExternalCaptureDevice, - (int& capture_id, webrtc::ViEExternalCapture*& capture)) { - if (fail_alloc_capturer_) { - return -1; - } - if (kViECaptureIdMax == last_capturer_) { - return -1; - } - Capturer* cap = new Capturer(); - capturers_[++last_capturer_] = cap; - capture_id = last_capturer_; - capture = cap; - return 0; - } - WEBRTC_STUB(AllocateCaptureDevice, (webrtc::VideoCaptureModule&, int&)); - WEBRTC_FUNC(ReleaseCaptureDevice, (const int capture_id)) { - WEBRTC_CHECK_CAPTURER(capture_id); - delete capturers_[capture_id]; - capturers_.erase(capture_id); - return 0; - } - WEBRTC_FUNC(ConnectCaptureDevice, (const int capture_id, - const int channel)) { - WEBRTC_CHECK_CHANNEL(channel); - WEBRTC_CHECK_CAPTURER(capture_id); - channels_[channel]->capture_id_ = capture_id; - capturers_[capture_id]->set_channel_id(channel); - return 0; - } - WEBRTC_FUNC(DisconnectCaptureDevice, (const int channel)) { - WEBRTC_CHECK_CHANNEL(channel); - int capture_id = channels_[channel]->capture_id_; - WEBRTC_CHECK_CAPTURER(capture_id); - channels_[channel]->capture_id_ = -1; - capturers_[capture_id]->set_channel_id(-1); - return 0; - } - WEBRTC_STUB(StartCapture, (const int, const webrtc::CaptureCapability&)); - WEBRTC_STUB(StopCapture, (const int)); - WEBRTC_STUB(SetRotateCapturedFrames, (const int, - const webrtc::RotateCapturedFrame)); - WEBRTC_STUB(SetCaptureDelay, (const int, const unsigned int)); - WEBRTC_STUB(NumberOfCapabilities, (const char*, const unsigned int)); - WEBRTC_STUB(GetCaptureCapability, (const char*, const unsigned int, - const unsigned int, webrtc::CaptureCapability&)); - WEBRTC_STUB(ShowCaptureSettingsDialogBox, (const char*, const unsigned int, - const char*, void*, const unsigned int, const unsigned int)); - WEBRTC_STUB(GetOrientation, (const char*, webrtc::RotateCapturedFrame&)); - WEBRTC_STUB(EnableBrightnessAlarm, (const int, const bool)); - WEBRTC_STUB(RegisterObserver, (const int, webrtc::ViECaptureObserver&)); - WEBRTC_STUB(DeregisterObserver, (const int)); - - // webrtc::ViENetwork - WEBRTC_VOID_FUNC(SetNetworkTransmissionState, (const int channel, - const bool is_transmitting)) { - WEBRTC_ASSERT_CHANNEL(channel); - channels_[channel]->can_transmit_ = is_transmitting; - } - WEBRTC_STUB(RegisterSendTransport, (const int, webrtc::Transport&)); - WEBRTC_STUB(DeregisterSendTransport, (const int)); - - WEBRTC_FUNC(ReceivedRTPPacket, (const int channel, - const void* packet, - const int length, - const webrtc::PacketTime& packet_time)) { - WEBRTC_ASSERT_CHANNEL(channel); - ASSERT(length > 1); - uint8_t payload_type = static_cast(packet)[1] & 0x7F; - channels_[channel]->last_recvd_payload_type_ = payload_type; - return 0; - } - - WEBRTC_STUB(ReceivedRTCPPacket, (const int, const void*, const int)); - // Not using WEBRTC_STUB due to bool return value - virtual bool IsIPv6Enabled(int channel) { return true; } - WEBRTC_STUB(SetMTU, (int, unsigned int)); - WEBRTC_STUB(ReceivedBWEPacket, (const int, int64_t, int, - const webrtc::RTPHeader&)); - - // webrtc::ViERender - WEBRTC_STUB(RegisterVideoRenderModule, (webrtc::VideoRender&)); - WEBRTC_STUB(DeRegisterVideoRenderModule, (webrtc::VideoRender&)); - WEBRTC_STUB(AddRenderer, (const int, void*, const unsigned int, const float, - const float, const float, const float)); - WEBRTC_FUNC(RemoveRenderer, (const int render_id)) { - if (IsCapturerId(render_id)) { - WEBRTC_CHECK_CAPTURER(render_id); - return 0; - } else if (IsChannelId(render_id)) { - WEBRTC_CHECK_CHANNEL(render_id); - channels_[render_id]->has_renderer_ = false; - return 0; - } - return -1; - } - WEBRTC_FUNC(StartRender, (const int render_id)) { - if (IsCapturerId(render_id)) { - WEBRTC_CHECK_CAPTURER(render_id); - return 0; - } else if (IsChannelId(render_id)) { - WEBRTC_CHECK_CHANNEL(render_id); - channels_[render_id]->render_started_ = true; - return 0; - } - return -1; - } - WEBRTC_FUNC(StopRender, (const int render_id)) { - if (IsCapturerId(render_id)) { - WEBRTC_CHECK_CAPTURER(render_id); - return 0; - } else if (IsChannelId(render_id)) { - WEBRTC_CHECK_CHANNEL(render_id); - channels_[render_id]->render_started_ = false; - return 0; - } - return -1; - } - WEBRTC_STUB(SetExpectedRenderDelay, (int render_id, int render_delay)); - WEBRTC_STUB(ConfigureRender, (int, const unsigned int, const float, - const float, const float, const float)); - WEBRTC_STUB(MirrorRenderStream, (const int, const bool, const bool, - const bool)); - WEBRTC_FUNC(AddRenderer, (const int render_id, - webrtc::RawVideoType video_type, - webrtc::ExternalRenderer* renderer)) { - if (IsCapturerId(render_id)) { - WEBRTC_CHECK_CAPTURER(render_id); - return 0; - } else if (IsChannelId(render_id)) { - WEBRTC_CHECK_CHANNEL(render_id); - channels_[render_id]->has_renderer_ = true; - return 0; - } - return -1; - } - - // webrtc::ViERTP_RTCP - WEBRTC_FUNC(SetLocalSSRC, (const int channel, - const unsigned int ssrc, - const webrtc::StreamType usage, - const unsigned char idx)) { - WEBRTC_CHECK_CHANNEL(channel); - switch (usage) { - case webrtc::kViEStreamTypeNormal: - channels_[channel]->ssrcs_[idx] = ssrc; - break; - case webrtc::kViEStreamTypeRtx: - channels_[channel]->rtx_ssrcs_[idx] = ssrc; - break; - default: - return -1; - } - return 0; - } - - WEBRTC_FUNC_CONST(SetRemoteSSRCType, (const int channel, - const webrtc::StreamType usage, const unsigned int ssrc)) { - WEBRTC_CHECK_CHANNEL(channel); - if (usage == webrtc::kViEStreamTypeRtx) { - channels_.find(channel)->second->remote_rtx_ssrc_ = ssrc; - return 0; - } - return -1; - } - - WEBRTC_FUNC_CONST(GetLocalSSRC, (const int channel, - unsigned int& ssrc)) { - // ssrcs_[0] is the default local ssrc. - WEBRTC_CHECK_CHANNEL(channel); - ssrc = channels_.find(channel)->second->ssrcs_[0]; - return 0; - } - WEBRTC_STUB_CONST(GetRemoteSSRC, (const int, unsigned int&)); - WEBRTC_STUB_CONST(GetRemoteCSRCs, (const int, unsigned int*)); - - WEBRTC_FUNC(SetRtxSendPayloadType, (const int channel, - const uint8 payload_type)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->rtx_send_payload_type = payload_type; - return 0; - } - - WEBRTC_FUNC(SetRtxReceivePayloadType, (const int channel, - const uint8 payload_type)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->rtx_recv_payload_type = payload_type; - return 0; - } - - WEBRTC_STUB(SetStartSequenceNumber, (const int, unsigned short)); - WEBRTC_FUNC(SetRTCPStatus, - (const int channel, const webrtc::ViERTCPMode mode)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->rtcp_status_ = mode; - return 0; - } - WEBRTC_STUB_CONST(GetRTCPStatus, (const int, webrtc::ViERTCPMode&)); - WEBRTC_FUNC(SetRTCPCName, (const int channel, - const char rtcp_cname[KMaxRTCPCNameLength])) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->cname_.assign(rtcp_cname); - return 0; - } - WEBRTC_FUNC_CONST(GetRTCPCName, (const int channel, - char rtcp_cname[KMaxRTCPCNameLength])) { - WEBRTC_CHECK_CHANNEL(channel); - talk_base::strcpyn(rtcp_cname, KMaxRTCPCNameLength, - channels_.find(channel)->second->cname_.c_str()); - return 0; - } - WEBRTC_STUB_CONST(GetRemoteRTCPCName, (const int, char*)); - WEBRTC_STUB(SendApplicationDefinedRTCPPacket, (const int, const unsigned char, - unsigned int, const char*, unsigned short)); - WEBRTC_FUNC(SetNACKStatus, (const int channel, const bool enable)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->nack_ = enable; - channels_[channel]->hybrid_nack_fec_ = false; - return 0; - } - WEBRTC_STUB(SetFECStatus, (const int, const bool, const unsigned char, - const unsigned char)); - WEBRTC_FUNC(SetHybridNACKFECStatus, (const int channel, const bool enable, - const unsigned char red_type, const unsigned char fec_type)) { - WEBRTC_CHECK_CHANNEL(channel); - if (red_type == fec_type || - red_type == channels_[channel]->send_codec.plType || - fec_type == channels_[channel]->send_codec.plType) { - return -1; - } - channels_[channel]->nack_ = false; - channels_[channel]->hybrid_nack_fec_ = enable; - return 0; - } - WEBRTC_FUNC(SetKeyFrameRequestMethod, - (const int channel, - const webrtc::ViEKeyFrameRequestMethod method)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->key_frame_request_method_ = method; - return 0; - } - WEBRTC_FUNC(SetSenderBufferingMode, (int channel, int target_delay)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->sender_target_delay_ = target_delay; - return 0; - } - WEBRTC_FUNC(SetReceiverBufferingMode, (int channel, int target_delay)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->receiver_target_delay_ = target_delay; - return 0; - } - // |Send| and |receive| are stored locally in variables that more clearly - // explain what they mean. - WEBRTC_FUNC(SetRembStatus, (int channel, bool send, bool receive)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->remb_contribute_ = receive; - channels_[channel]->remb_bw_partition_ = send; - return 0; - } - WEBRTC_FUNC(SetTMMBRStatus, (const int channel, const bool enable)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->tmmbr_ = enable; - return 0; - } - WEBRTC_FUNC(SetSendTimestampOffsetStatus, (int channel, bool enable, - int id)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->rtp_offset_send_id_ = (enable) ? id : -1; - return 0; - } - WEBRTC_FUNC(SetReceiveTimestampOffsetStatus, (int channel, bool enable, - int id)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->rtp_offset_receive_id_ = (enable) ? id : -1; - return 0; - } - WEBRTC_FUNC(SetSendAbsoluteSendTimeStatus, (int channel, bool enable, - int id)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->rtp_absolute_send_time_send_id_ = (enable) ? id : -1; - return 0; - } - WEBRTC_FUNC(SetReceiveAbsoluteSendTimeStatus, (int channel, bool enable, - int id)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->rtp_absolute_send_time_receive_id_ = (enable) ? id : -1; - return 0; - } - WEBRTC_STUB(SetRtcpXrRrtrStatus, (int, bool)); - WEBRTC_FUNC(SetTransmissionSmoothingStatus, (int channel, bool enable)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->transmission_smoothing_ = enable; - return 0; - } - WEBRTC_FUNC(SetReservedTransmitBitrate, (int channel, - unsigned int reserved_transmit_bitrate_bps)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->reserved_transmit_bitrate_bps_ = - reserved_transmit_bitrate_bps; - return 0; - } - WEBRTC_STUB_CONST(GetRtcpPacketTypeCounters, (int, - webrtc::RtcpPacketTypeCounter*, webrtc::RtcpPacketTypeCounter*)); - WEBRTC_STUB_CONST(GetReceivedRTCPStatistics, (const int, unsigned short&, - unsigned int&, unsigned int&, unsigned int&, int&)); - WEBRTC_STUB_CONST(GetSentRTCPStatistics, (const int, unsigned short&, - unsigned int&, unsigned int&, unsigned int&, int&)); - WEBRTC_STUB_CONST(GetRTPStatistics, (const int, unsigned int&, unsigned int&, - unsigned int&, unsigned int&)); - WEBRTC_STUB_CONST(GetReceiveChannelRtcpStatistics, (const int, - webrtc::RtcpStatistics&, int&)); - WEBRTC_STUB_CONST(GetSendChannelRtcpStatistics, (const int, - webrtc::RtcpStatistics&, int&)); - WEBRTC_STUB_CONST(GetRtpStatistics, (const int, webrtc::StreamDataCounters&, - webrtc::StreamDataCounters&)); - WEBRTC_FUNC_CONST(GetBandwidthUsage, (const int channel, - unsigned int& total_bitrate, unsigned int& video_bitrate, - unsigned int& fec_bitrate, unsigned int& nack_bitrate)) { - WEBRTC_CHECK_CHANNEL(channel); - std::map::const_iterator it = channels_.find(channel); - if (it->second->send) { - video_bitrate = it->second->send_video_bitrate_; - fec_bitrate = it->second->send_fec_bitrate_; - nack_bitrate = it->second->send_nack_bitrate_; - total_bitrate = video_bitrate + fec_bitrate + nack_bitrate; - } else { - total_bitrate = 0; - video_bitrate = 0; - fec_bitrate = 0; - nack_bitrate = 0; - } - return 0; - } - WEBRTC_FUNC_CONST(GetEstimatedSendBandwidth, (const int channel, - unsigned int* send_bandwidth_estimate)) { - WEBRTC_CHECK_CHANNEL(channel); - std::map::const_iterator it = channels_.find(channel); - // Assume the current video, fec and nack bitrate sums up to our estimate. - if (it->second->send) { - it = channels_.find(GetOriginalChannelId(channel)); - *send_bandwidth_estimate = it->second->send_bandwidth_; - } else { - *send_bandwidth_estimate = 0; - } - return 0; - } - WEBRTC_FUNC_CONST(GetEstimatedReceiveBandwidth, (const int channel, - unsigned int* receive_bandwidth_estimate)) { - WEBRTC_CHECK_CHANNEL(channel); - std::map::const_iterator it = channels_.find(channel); - if (it->second->receive_) { - it = channels_.find(GetOriginalChannelId(channel)); - *receive_bandwidth_estimate = it->second->receive_bandwidth_; - } else { - *receive_bandwidth_estimate = 0; - } - return 0; - } - WEBRTC_STUB(RegisterSendChannelRtcpStatisticsCallback, - (int, webrtc::RtcpStatisticsCallback*)); - WEBRTC_STUB(DeregisterSendChannelRtcpStatisticsCallback, - (int, webrtc::RtcpStatisticsCallback*)); - WEBRTC_STUB(RegisterReceiveChannelRtcpStatisticsCallback, - (int, webrtc::RtcpStatisticsCallback*)); - WEBRTC_STUB(DeregisterReceiveChannelRtcpStatisticsCallback, - (int, webrtc::RtcpStatisticsCallback*)); - WEBRTC_STUB(RegisterSendChannelRtpStatisticsCallback, - (int, webrtc::StreamDataCountersCallback*)); - WEBRTC_STUB(DeregisterSendChannelRtpStatisticsCallback, - (int, webrtc::StreamDataCountersCallback*)); - WEBRTC_STUB(RegisterReceiveChannelRtpStatisticsCallback, - (int, webrtc::StreamDataCountersCallback*)); - WEBRTC_STUB(DeregisterReceiveChannelRtpStatisticsCallback, - (int, webrtc::StreamDataCountersCallback*)); - WEBRTC_STUB(RegisterSendBitrateObserver, - (int, webrtc::BitrateStatisticsObserver*)); - WEBRTC_STUB(DeregisterSendBitrateObserver, - (int, webrtc::BitrateStatisticsObserver*)); - WEBRTC_STUB(RegisterSendFrameCountObserver, - (int, webrtc::FrameCountObserver*)); - WEBRTC_STUB(DeregisterSendFrameCountObserver, - (int, webrtc::FrameCountObserver*)); - - WEBRTC_STUB(StartRTPDump, (const int, const char*, webrtc::RTPDirections)); - WEBRTC_STUB(StopRTPDump, (const int, webrtc::RTPDirections)); - WEBRTC_STUB(RegisterRTPObserver, (const int, webrtc::ViERTPObserver&)); - WEBRTC_STUB(DeregisterRTPObserver, (const int)); - WEBRTC_STUB(RegisterRTCPObserver, (const int, webrtc::ViERTCPObserver&)); - WEBRTC_STUB(DeregisterRTCPObserver, (const int)); - - // webrtc::ViEImageProcess - WEBRTC_STUB(RegisterCaptureEffectFilter, (const int, - webrtc::ViEEffectFilter&)); - WEBRTC_STUB(DeregisterCaptureEffectFilter, (const int)); - WEBRTC_STUB(RegisterSendEffectFilter, (const int, - webrtc::ViEEffectFilter&)); - WEBRTC_STUB(DeregisterSendEffectFilter, (const int)); - WEBRTC_STUB(RegisterRenderEffectFilter, (const int, - webrtc::ViEEffectFilter&)); - WEBRTC_STUB(DeregisterRenderEffectFilter, (const int)); - WEBRTC_STUB(EnableDeflickering, (const int, const bool)); - WEBRTC_FUNC(EnableDenoising, (const int capture_id, const bool denoising)) { - WEBRTC_CHECK_CAPTURER(capture_id); - capturers_[capture_id]->set_denoising(denoising); - return 0; - } - WEBRTC_STUB(EnableColorEnhancement, (const int, const bool)); - WEBRTC_VOID_STUB(RegisterPreEncodeCallback, - (int, webrtc::I420FrameCallback*)); - WEBRTC_VOID_STUB(DeRegisterPreEncodeCallback, (int)); - WEBRTC_VOID_STUB(RegisterPreRenderCallback, - (int, webrtc::I420FrameCallback*)); - WEBRTC_VOID_STUB(DeRegisterPreRenderCallback, (int)); - // webrtc::ViEExternalCodec - WEBRTC_FUNC(RegisterExternalSendCodec, - (const int channel, const unsigned char pl_type, webrtc::VideoEncoder*, - bool)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->ext_encoder_pl_types_.insert(pl_type); - return 0; - } - WEBRTC_FUNC(DeRegisterExternalSendCodec, - (const int channel, const unsigned char pl_type)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->ext_encoder_pl_types_.erase(pl_type); - return 0; - } - WEBRTC_FUNC(RegisterExternalReceiveCodec, - (const int channel, const unsigned int pl_type, webrtc::VideoDecoder*, - bool, int)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->ext_decoder_pl_types_.insert(pl_type); - return 0; - } - WEBRTC_FUNC(DeRegisterExternalReceiveCodec, - (const int channel, const unsigned char pl_type)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->ext_decoder_pl_types_.erase(pl_type); - return 0; - } - - private: - bool IsChannelId(int id) const { - return (id >= kViEChannelIdBase && id <= kViEChannelIdMax); - } - bool IsCapturerId(int id) const { - return (id >= kViECaptureIdBase && id <= kViECaptureIdMax); - } - - bool inited_; - int last_channel_; - std::map channels_; - bool fail_create_channel_; - int last_capturer_; - std::map capturers_; - bool fail_alloc_capturer_; - const cricket::VideoCodec* const* codecs_; - int num_codecs_; - int num_set_send_codecs_; // how many times we call SetSendCodec(). -}; - -} // namespace cricket - -#endif // TALK_MEDIA_WEBRTC_FAKEWEBRTCVIDEOENGINE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/fakewebrtcvoiceengine.h b/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/fakewebrtcvoiceengine.h deleted file mode 100755 index 11151bb..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/fakewebrtcvoiceengine.h +++ /dev/null @@ -1,1152 +0,0 @@ -/* - * libjingle - * Copyright 2010 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_SESSION_PHONE_FAKEWEBRTCVOICEENGINE_H_ -#define TALK_SESSION_PHONE_FAKEWEBRTCVOICEENGINE_H_ - -#include -#include -#include - -#include "talk/base/basictypes.h" -#include "talk/base/gunit.h" -#include "talk/base/stringutils.h" -#include "talk/media/base/codec.h" -#include "talk/media/base/voiceprocessor.h" -#include "talk/media/webrtc/fakewebrtccommon.h" -#include "talk/media/webrtc/webrtcvoe.h" - -namespace webrtc { -class ViENetwork; -} - -namespace cricket { - -// Function returning stats will return these values -// for all values based on type. -const int kIntStatValue = 123; -const float kFractionLostStatValue = 0.5; - -static const char kFakeDefaultDeviceName[] = "Fake Default"; -static const int kFakeDefaultDeviceId = -1; -static const char kFakeDeviceName[] = "Fake Device"; -#ifdef WIN32 -static const int kFakeDeviceId = 0; -#else -static const int kFakeDeviceId = 1; -#endif - -// Verify the header extension ID, if enabled, is within the bounds specified in -// [RFC5285]: 1-14 inclusive. -#define WEBRTC_CHECK_HEADER_EXTENSION_ID(enable, id) \ - do { \ - if (enable && (id < 1 || id > 14)) { \ - return -1; \ - } \ - } while (0); - -class FakeWebRtcVoiceEngine - : public webrtc::VoEAudioProcessing, - public webrtc::VoEBase, public webrtc::VoECodec, public webrtc::VoEDtmf, - public webrtc::VoEFile, public webrtc::VoEHardware, - public webrtc::VoEExternalMedia, public webrtc::VoENetEqStats, - public webrtc::VoENetwork, public webrtc::VoERTP_RTCP, - public webrtc::VoEVideoSync, public webrtc::VoEVolumeControl { - public: - struct DtmfInfo { - DtmfInfo() - : dtmf_event_code(-1), - dtmf_out_of_band(false), - dtmf_length_ms(-1) {} - int dtmf_event_code; - bool dtmf_out_of_band; - int dtmf_length_ms; - }; - struct Channel { - explicit Channel() - : external_transport(false), - send(false), - playout(false), - volume_scale(1.0), - volume_pan_left(1.0), - volume_pan_right(1.0), - file(false), - vad(false), - fec(false), - nack(false), - media_processor_registered(false), - rx_agc_enabled(false), - rx_agc_mode(webrtc::kAgcDefault), - cn8_type(13), - cn16_type(105), - dtmf_type(106), - fec_type(117), - nack_max_packets(0), - vie_network(NULL), - video_channel(-1), - send_ssrc(0), - send_audio_level_ext_(-1), - receive_audio_level_ext_(-1), - send_absolute_sender_time_ext_(-1), - receive_absolute_sender_time_ext_(-1) { - memset(&send_codec, 0, sizeof(send_codec)); - memset(&rx_agc_config, 0, sizeof(rx_agc_config)); - } - bool external_transport; - bool send; - bool playout; - float volume_scale; - float volume_pan_left; - float volume_pan_right; - bool file; - bool vad; - bool fec; - bool nack; - bool media_processor_registered; - bool rx_agc_enabled; - webrtc::AgcModes rx_agc_mode; - webrtc::AgcConfig rx_agc_config; - int cn8_type; - int cn16_type; - int dtmf_type; - int fec_type; - int nack_max_packets; - webrtc::ViENetwork* vie_network; - int video_channel; - uint32 send_ssrc; - int send_audio_level_ext_; - int receive_audio_level_ext_; - int send_absolute_sender_time_ext_; - int receive_absolute_sender_time_ext_; - DtmfInfo dtmf_info; - std::vector recv_codecs; - webrtc::CodecInst send_codec; - webrtc::PacketTime last_rtp_packet_time; - std::list packets; - }; - - FakeWebRtcVoiceEngine(const cricket::AudioCodec* const* codecs, - int num_codecs) - : inited_(false), - last_channel_(-1), - fail_create_channel_(false), - codecs_(codecs), - num_codecs_(num_codecs), - num_set_send_codecs_(0), - ec_enabled_(false), - ec_metrics_enabled_(false), - cng_enabled_(false), - ns_enabled_(false), - agc_enabled_(false), - highpass_filter_enabled_(false), - stereo_swapping_enabled_(false), - typing_detection_enabled_(false), - ec_mode_(webrtc::kEcDefault), - aecm_mode_(webrtc::kAecmSpeakerphone), - ns_mode_(webrtc::kNsDefault), - agc_mode_(webrtc::kAgcDefault), - observer_(NULL), - playout_fail_channel_(-1), - send_fail_channel_(-1), - fail_start_recording_microphone_(false), - recording_microphone_(false), - recording_sample_rate_(-1), - playout_sample_rate_(-1), - media_processor_(NULL) { - memset(&agc_config_, 0, sizeof(agc_config_)); - } - ~FakeWebRtcVoiceEngine() { - // Ought to have all been deleted by the WebRtcVoiceMediaChannel - // destructors, but just in case ... - for (std::map::const_iterator i = channels_.begin(); - i != channels_.end(); ++i) { - delete i->second; - } - } - - bool IsExternalMediaProcessorRegistered() const { - return media_processor_ != NULL; - } - bool IsInited() const { return inited_; } - int GetLastChannel() const { return last_channel_; } - int GetChannelFromLocalSsrc(uint32 local_ssrc) const { - for (std::map::const_iterator iter = channels_.begin(); - iter != channels_.end(); ++iter) { - if (local_ssrc == iter->second->send_ssrc) - return iter->first; - } - return -1; - } - int GetNumChannels() const { return static_cast(channels_.size()); } - bool GetPlayout(int channel) { - return channels_[channel]->playout; - } - bool GetSend(int channel) { - return channels_[channel]->send; - } - bool GetRecordingMicrophone() { - return recording_microphone_; - } - bool GetVAD(int channel) { - return channels_[channel]->vad; - } - bool GetFEC(int channel) { - return channels_[channel]->fec; - } - bool GetNACK(int channel) { - return channels_[channel]->nack; - } - int GetNACKMaxPackets(int channel) { - return channels_[channel]->nack_max_packets; - } - webrtc::ViENetwork* GetViENetwork(int channel) { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_[channel]->vie_network; - } - int GetVideoChannel(int channel) { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_[channel]->video_channel; - } - const webrtc::PacketTime& GetLastRtpPacketTime(int channel) { - WEBRTC_ASSERT_CHANNEL(channel); - return channels_[channel]->last_rtp_packet_time; - } - int GetSendCNPayloadType(int channel, bool wideband) { - return (wideband) ? - channels_[channel]->cn16_type : - channels_[channel]->cn8_type; - } - int GetSendTelephoneEventPayloadType(int channel) { - return channels_[channel]->dtmf_type; - } - int GetSendFECPayloadType(int channel) { - return channels_[channel]->fec_type; - } - bool CheckPacket(int channel, const void* data, size_t len) { - bool result = !CheckNoPacket(channel); - if (result) { - std::string packet = channels_[channel]->packets.front(); - result = (packet == std::string(static_cast(data), len)); - channels_[channel]->packets.pop_front(); - } - return result; - } - bool CheckNoPacket(int channel) { - return channels_[channel]->packets.empty(); - } - void TriggerCallbackOnError(int channel_num, int err_code) { - ASSERT(observer_ != NULL); - observer_->CallbackOnError(channel_num, err_code); - } - void set_playout_fail_channel(int channel) { - playout_fail_channel_ = channel; - } - void set_send_fail_channel(int channel) { - send_fail_channel_ = channel; - } - void set_fail_start_recording_microphone( - bool fail_start_recording_microphone) { - fail_start_recording_microphone_ = fail_start_recording_microphone; - } - void set_fail_create_channel(bool fail_create_channel) { - fail_create_channel_ = fail_create_channel; - } - void TriggerProcessPacket(MediaProcessorDirection direction) { - webrtc::ProcessingTypes pt = - (direction == cricket::MPD_TX) ? - webrtc::kRecordingPerChannel : webrtc::kPlaybackAllChannelsMixed; - if (media_processor_ != NULL) { - media_processor_->Process(0, - pt, - NULL, - 0, - 0, - true); - } - } - int AddChannel() { - if (fail_create_channel_) { - return -1; - } - Channel* ch = new Channel(); - for (int i = 0; i < NumOfCodecs(); ++i) { - webrtc::CodecInst codec; - GetCodec(i, codec); - ch->recv_codecs.push_back(codec); - } - channels_[++last_channel_] = ch; - return last_channel_; - } - int GetSendRtpExtensionId(int channel, const std::string& extension) { - WEBRTC_ASSERT_CHANNEL(channel); - if (extension == kRtpAudioLevelHeaderExtension) { - return channels_[channel]->send_audio_level_ext_; - } else if (extension == kRtpAbsoluteSenderTimeHeaderExtension) { - return channels_[channel]->send_absolute_sender_time_ext_; - } - return -1; - } - int GetReceiveRtpExtensionId(int channel, const std::string& extension) { - WEBRTC_ASSERT_CHANNEL(channel); - if (extension == kRtpAudioLevelHeaderExtension) { - return channels_[channel]->receive_audio_level_ext_; - } else if (extension == kRtpAbsoluteSenderTimeHeaderExtension) { - return channels_[channel]->receive_absolute_sender_time_ext_; - } - return -1; - } - - int GetNumSetSendCodecs() const { return num_set_send_codecs_; } - - WEBRTC_STUB(Release, ()); - - // webrtc::VoEBase - WEBRTC_FUNC(RegisterVoiceEngineObserver, ( - webrtc::VoiceEngineObserver& observer)) { - observer_ = &observer; - return 0; - } - WEBRTC_STUB(DeRegisterVoiceEngineObserver, ()); - WEBRTC_FUNC(Init, (webrtc::AudioDeviceModule* adm, - webrtc::AudioProcessing* audioproc)) { - inited_ = true; - return 0; - } - WEBRTC_FUNC(Terminate, ()) { - inited_ = false; - return 0; - } - virtual webrtc::AudioProcessing* audio_processing() OVERRIDE { - return NULL; - } - WEBRTC_FUNC(CreateChannel, ()) { - return AddChannel(); - } - WEBRTC_FUNC(CreateChannel, (const webrtc::Config& /*config*/)) { - return AddChannel(); - } - WEBRTC_FUNC(DeleteChannel, (int channel)) { - WEBRTC_CHECK_CHANNEL(channel); - delete channels_[channel]; - channels_.erase(channel); - return 0; - } - WEBRTC_STUB(StartReceive, (int channel)); - WEBRTC_FUNC(StartPlayout, (int channel)) { - if (playout_fail_channel_ != channel) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->playout = true; - return 0; - } else { - // When playout_fail_channel_ == channel, fail the StartPlayout on this - // channel. - return -1; - } - } - WEBRTC_FUNC(StartSend, (int channel)) { - if (send_fail_channel_ != channel) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->send = true; - return 0; - } else { - // When send_fail_channel_ == channel, fail the StartSend on this - // channel. - return -1; - } - } - WEBRTC_STUB(StopReceive, (int channel)); - WEBRTC_FUNC(StopPlayout, (int channel)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->playout = false; - return 0; - } - WEBRTC_FUNC(StopSend, (int channel)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->send = false; - return 0; - } - WEBRTC_STUB(GetVersion, (char version[1024])); - WEBRTC_STUB(LastError, ()); - WEBRTC_STUB(SetOnHoldStatus, (int, bool, webrtc::OnHoldModes)); - WEBRTC_STUB(GetOnHoldStatus, (int, bool&, webrtc::OnHoldModes&)); - WEBRTC_STUB(SetNetEQPlayoutMode, (int, webrtc::NetEqModes)); - WEBRTC_STUB(GetNetEQPlayoutMode, (int, webrtc::NetEqModes&)); - - // webrtc::VoECodec - WEBRTC_FUNC(NumOfCodecs, ()) { - return num_codecs_; - } - WEBRTC_FUNC(GetCodec, (int index, webrtc::CodecInst& codec)) { - if (index < 0 || index >= NumOfCodecs()) { - return -1; - } - const cricket::AudioCodec& c(*codecs_[index]); - codec.pltype = c.id; - talk_base::strcpyn(codec.plname, sizeof(codec.plname), c.name.c_str()); - codec.plfreq = c.clockrate; - codec.pacsize = 0; - codec.channels = c.channels; - codec.rate = c.bitrate; - return 0; - } - WEBRTC_FUNC(SetSendCodec, (int channel, const webrtc::CodecInst& codec)) { - WEBRTC_CHECK_CHANNEL(channel); - // To match the behavior of the real implementation. - if (_stricmp(codec.plname, "telephone-event") == 0 || - _stricmp(codec.plname, "audio/telephone-event") == 0 || - _stricmp(codec.plname, "CN") == 0 || - _stricmp(codec.plname, "red") == 0 ) { - return -1; - } - channels_[channel]->send_codec = codec; - ++num_set_send_codecs_; - return 0; - } - WEBRTC_FUNC(GetSendCodec, (int channel, webrtc::CodecInst& codec)) { - WEBRTC_CHECK_CHANNEL(channel); - codec = channels_[channel]->send_codec; - return 0; - } - WEBRTC_STUB(SetSecondarySendCodec, (int channel, - const webrtc::CodecInst& codec, - int red_payload_type)); - WEBRTC_STUB(RemoveSecondarySendCodec, (int channel)); - WEBRTC_STUB(GetSecondarySendCodec, (int channel, - webrtc::CodecInst& codec)); - WEBRTC_STUB(GetRecCodec, (int channel, webrtc::CodecInst& codec)); - WEBRTC_STUB(SetAMREncFormat, (int channel, webrtc::AmrMode mode)); - WEBRTC_STUB(SetAMRDecFormat, (int channel, webrtc::AmrMode mode)); - WEBRTC_STUB(SetAMRWbEncFormat, (int channel, webrtc::AmrMode mode)); - WEBRTC_STUB(SetAMRWbDecFormat, (int channel, webrtc::AmrMode mode)); - WEBRTC_STUB(SetISACInitTargetRate, (int channel, int rateBps, - bool useFixedFrameSize)); - WEBRTC_STUB(SetISACMaxRate, (int channel, int rateBps)); - WEBRTC_STUB(SetISACMaxPayloadSize, (int channel, int sizeBytes)); - WEBRTC_FUNC(SetRecPayloadType, (int channel, - const webrtc::CodecInst& codec)) { - WEBRTC_CHECK_CHANNEL(channel); - Channel* ch = channels_[channel]; - if (ch->playout) - return -1; // Channel is in use. - // Check if something else already has this slot. - if (codec.pltype != -1) { - for (std::vector::iterator it = - ch->recv_codecs.begin(); it != ch->recv_codecs.end(); ++it) { - if (it->pltype == codec.pltype && - _stricmp(it->plname, codec.plname) != 0) { - return -1; - } - } - } - // Otherwise try to find this codec and update its payload type. - for (std::vector::iterator it = ch->recv_codecs.begin(); - it != ch->recv_codecs.end(); ++it) { - if (strcmp(it->plname, codec.plname) == 0 && - it->plfreq == codec.plfreq) { - it->pltype = codec.pltype; - it->channels = codec.channels; - return 0; - } - } - return -1; // not found - } - WEBRTC_FUNC(SetSendCNPayloadType, (int channel, int type, - webrtc::PayloadFrequencies frequency)) { - WEBRTC_CHECK_CHANNEL(channel); - if (frequency == webrtc::kFreq8000Hz) { - channels_[channel]->cn8_type = type; - } else if (frequency == webrtc::kFreq16000Hz) { - channels_[channel]->cn16_type = type; - } - return 0; - } - WEBRTC_FUNC(GetRecPayloadType, (int channel, webrtc::CodecInst& codec)) { - WEBRTC_CHECK_CHANNEL(channel); - Channel* ch = channels_[channel]; - for (std::vector::iterator it = ch->recv_codecs.begin(); - it != ch->recv_codecs.end(); ++it) { - if (strcmp(it->plname, codec.plname) == 0 && - it->plfreq == codec.plfreq && - it->channels == codec.channels && - it->pltype != -1) { - codec.pltype = it->pltype; - return 0; - } - } - return -1; // not found - } - WEBRTC_FUNC(SetVADStatus, (int channel, bool enable, webrtc::VadModes mode, - bool disableDTX)) { - WEBRTC_CHECK_CHANNEL(channel); - if (channels_[channel]->send_codec.channels == 2) { - // Replicating VoE behavior; VAD cannot be enabled for stereo. - return -1; - } - channels_[channel]->vad = enable; - return 0; - } - WEBRTC_STUB(GetVADStatus, (int channel, bool& enabled, - webrtc::VadModes& mode, bool& disabledDTX)); - - // webrtc::VoEDtmf - WEBRTC_FUNC(SendTelephoneEvent, (int channel, int event_code, - bool out_of_band = true, int length_ms = 160, int attenuation_db = 10)) { - channels_[channel]->dtmf_info.dtmf_event_code = event_code; - channels_[channel]->dtmf_info.dtmf_out_of_band = out_of_band; - channels_[channel]->dtmf_info.dtmf_length_ms = length_ms; - return 0; - } - - WEBRTC_FUNC(SetSendTelephoneEventPayloadType, - (int channel, unsigned char type)) { - channels_[channel]->dtmf_type = type; - return 0; - }; - WEBRTC_STUB(GetSendTelephoneEventPayloadType, - (int channel, unsigned char& type)); - - WEBRTC_STUB(SetDtmfFeedbackStatus, (bool enable, bool directFeedback)); - WEBRTC_STUB(GetDtmfFeedbackStatus, (bool& enabled, bool& directFeedback)); - WEBRTC_STUB(SetDtmfPlayoutStatus, (int channel, bool enable)); - WEBRTC_STUB(GetDtmfPlayoutStatus, (int channel, bool& enabled)); - - WEBRTC_FUNC(PlayDtmfTone, - (int event_code, int length_ms = 200, int attenuation_db = 10)) { - dtmf_info_.dtmf_event_code = event_code; - dtmf_info_.dtmf_length_ms = length_ms; - return 0; - } - WEBRTC_STUB(StartPlayingDtmfTone, - (int eventCode, int attenuationDb = 10)); - WEBRTC_STUB(StopPlayingDtmfTone, ()); - - // webrtc::VoEFile - WEBRTC_FUNC(StartPlayingFileLocally, (int channel, const char* fileNameUTF8, - bool loop, webrtc::FileFormats format, - float volumeScaling, int startPointMs, - int stopPointMs)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->file = true; - return 0; - } - WEBRTC_FUNC(StartPlayingFileLocally, (int channel, webrtc::InStream* stream, - webrtc::FileFormats format, - float volumeScaling, int startPointMs, - int stopPointMs)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->file = true; - return 0; - } - WEBRTC_FUNC(StopPlayingFileLocally, (int channel)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->file = false; - return 0; - } - WEBRTC_FUNC(IsPlayingFileLocally, (int channel)) { - WEBRTC_CHECK_CHANNEL(channel); - return (channels_[channel]->file) ? 1 : 0; - } - WEBRTC_STUB(ScaleLocalFilePlayout, (int channel, float scale)); - WEBRTC_STUB(StartPlayingFileAsMicrophone, (int channel, - const char* fileNameUTF8, - bool loop, - bool mixWithMicrophone, - webrtc::FileFormats format, - float volumeScaling)); - WEBRTC_STUB(StartPlayingFileAsMicrophone, (int channel, - webrtc::InStream* stream, - bool mixWithMicrophone, - webrtc::FileFormats format, - float volumeScaling)); - WEBRTC_STUB(StopPlayingFileAsMicrophone, (int channel)); - WEBRTC_STUB(IsPlayingFileAsMicrophone, (int channel)); - WEBRTC_STUB(ScaleFileAsMicrophonePlayout, (int channel, float scale)); - WEBRTC_STUB(StartRecordingPlayout, (int channel, const char* fileNameUTF8, - webrtc::CodecInst* compression, - int maxSizeBytes)); - WEBRTC_STUB(StartRecordingPlayout, (int channel, webrtc::OutStream* stream, - webrtc::CodecInst* compression)); - WEBRTC_STUB(StopRecordingPlayout, (int channel)); - WEBRTC_FUNC(StartRecordingMicrophone, (const char* fileNameUTF8, - webrtc::CodecInst* compression, - int maxSizeBytes)) { - if (fail_start_recording_microphone_) { - return -1; - } - recording_microphone_ = true; - return 0; - } - WEBRTC_FUNC(StartRecordingMicrophone, (webrtc::OutStream* stream, - webrtc::CodecInst* compression)) { - if (fail_start_recording_microphone_) { - return -1; - } - recording_microphone_ = true; - return 0; - } - WEBRTC_FUNC(StopRecordingMicrophone, ()) { - if (!recording_microphone_) { - return -1; - } - recording_microphone_ = false; - return 0; - } - WEBRTC_STUB(ConvertPCMToWAV, (const char* fileNameInUTF8, - const char* fileNameOutUTF8)); - WEBRTC_STUB(ConvertPCMToWAV, (webrtc::InStream* streamIn, - webrtc::OutStream* streamOut)); - WEBRTC_STUB(ConvertWAVToPCM, (const char* fileNameInUTF8, - const char* fileNameOutUTF8)); - WEBRTC_STUB(ConvertWAVToPCM, (webrtc::InStream* streamIn, - webrtc::OutStream* streamOut)); - WEBRTC_STUB(ConvertPCMToCompressed, (const char* fileNameInUTF8, - const char* fileNameOutUTF8, - webrtc::CodecInst* compression)); - WEBRTC_STUB(ConvertPCMToCompressed, (webrtc::InStream* streamIn, - webrtc::OutStream* streamOut, - webrtc::CodecInst* compression)); - WEBRTC_STUB(ConvertCompressedToPCM, (const char* fileNameInUTF8, - const char* fileNameOutUTF8)); - WEBRTC_STUB(ConvertCompressedToPCM, (webrtc::InStream* streamIn, - webrtc::OutStream* streamOut)); - WEBRTC_STUB(GetFileDuration, (const char* fileNameUTF8, int& durationMs, - webrtc::FileFormats format)); - WEBRTC_STUB(GetPlaybackPosition, (int channel, int& positionMs)); - - // webrtc::VoEHardware - WEBRTC_STUB(GetCPULoad, (int&)); - WEBRTC_FUNC(GetNumOfRecordingDevices, (int& num)) { - return GetNumDevices(num); - } - WEBRTC_FUNC(GetNumOfPlayoutDevices, (int& num)) { - return GetNumDevices(num); - } - WEBRTC_FUNC(GetRecordingDeviceName, (int i, char* name, char* guid)) { - return GetDeviceName(i, name, guid); - } - WEBRTC_FUNC(GetPlayoutDeviceName, (int i, char* name, char* guid)) { - return GetDeviceName(i, name, guid); - } - WEBRTC_STUB(SetRecordingDevice, (int, webrtc::StereoChannel)); - WEBRTC_STUB(SetPlayoutDevice, (int)); - WEBRTC_STUB(SetAudioDeviceLayer, (webrtc::AudioLayers)); - WEBRTC_STUB(GetAudioDeviceLayer, (webrtc::AudioLayers&)); - WEBRTC_STUB(GetPlayoutDeviceStatus, (bool&)); - WEBRTC_STUB(GetRecordingDeviceStatus, (bool&)); - WEBRTC_STUB(ResetAudioDevice, ()); - WEBRTC_STUB(AudioDeviceControl, (unsigned int, unsigned int, unsigned int)); - WEBRTC_STUB(SetLoudspeakerStatus, (bool enable)); - WEBRTC_STUB(GetLoudspeakerStatus, (bool& enabled)); - WEBRTC_FUNC(SetRecordingSampleRate, (unsigned int samples_per_sec)) { - recording_sample_rate_ = samples_per_sec; - return 0; - } - WEBRTC_FUNC_CONST(RecordingSampleRate, (unsigned int* samples_per_sec)) { - *samples_per_sec = recording_sample_rate_; - return 0; - } - WEBRTC_FUNC(SetPlayoutSampleRate, (unsigned int samples_per_sec)) { - playout_sample_rate_ = samples_per_sec; - return 0; - } - WEBRTC_FUNC_CONST(PlayoutSampleRate, (unsigned int* samples_per_sec)) { - *samples_per_sec = playout_sample_rate_; - return 0; - } - WEBRTC_STUB(EnableBuiltInAEC, (bool enable)); - virtual bool BuiltInAECIsEnabled() const { return true; } - - // webrtc::VoENetEqStats - WEBRTC_STUB(GetNetworkStatistics, (int, webrtc::NetworkStatistics&)); - WEBRTC_FUNC_CONST(GetDecodingCallStatistics, (int channel, - webrtc::AudioDecodingCallStats*)) { - WEBRTC_CHECK_CHANNEL(channel); - return 0; - } - - // webrtc::VoENetwork - WEBRTC_FUNC(RegisterExternalTransport, (int channel, - webrtc::Transport& transport)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->external_transport = true; - return 0; - } - WEBRTC_FUNC(DeRegisterExternalTransport, (int channel)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->external_transport = false; - return 0; - } - WEBRTC_FUNC(ReceivedRTPPacket, (int channel, const void* data, - unsigned int length)) { - WEBRTC_CHECK_CHANNEL(channel); - if (!channels_[channel]->external_transport) return -1; - channels_[channel]->packets.push_back( - std::string(static_cast(data), length)); - return 0; - } - WEBRTC_FUNC(ReceivedRTPPacket, (int channel, const void* data, - unsigned int length, - const webrtc::PacketTime& packet_time)) { - WEBRTC_CHECK_CHANNEL(channel); - if (ReceivedRTPPacket(channel, data, length) == -1) { - return -1; - } - channels_[channel]->last_rtp_packet_time = packet_time; - return 0; - } - - WEBRTC_STUB(ReceivedRTCPPacket, (int channel, const void* data, - unsigned int length)); - - // webrtc::VoERTP_RTCP - WEBRTC_STUB(RegisterRTPObserver, (int channel, - webrtc::VoERTPObserver& observer)); - WEBRTC_STUB(DeRegisterRTPObserver, (int channel)); - WEBRTC_STUB(RegisterRTCPObserver, (int channel, - webrtc::VoERTCPObserver& observer)); - WEBRTC_STUB(DeRegisterRTCPObserver, (int channel)); - WEBRTC_FUNC(SetLocalSSRC, (int channel, unsigned int ssrc)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->send_ssrc = ssrc; - return 0; - } - WEBRTC_FUNC(GetLocalSSRC, (int channel, unsigned int& ssrc)) { - WEBRTC_CHECK_CHANNEL(channel); - ssrc = channels_[channel]->send_ssrc; - return 0; - } - WEBRTC_STUB(GetRemoteSSRC, (int channel, unsigned int& ssrc)); - WEBRTC_FUNC(SetSendAudioLevelIndicationStatus, (int channel, bool enable, - unsigned char id)) { - WEBRTC_CHECK_CHANNEL(channel); - WEBRTC_CHECK_HEADER_EXTENSION_ID(enable, id); - channels_[channel]->send_audio_level_ext_ = (enable) ? id : -1; - return 0; - } -#ifdef USE_WEBRTC_DEV_BRANCH - WEBRTC_FUNC(SetReceiveAudioLevelIndicationStatus, (int channel, bool enable, - unsigned char id)) { - WEBRTC_CHECK_CHANNEL(channel); - WEBRTC_CHECK_HEADER_EXTENSION_ID(enable, id); - channels_[channel]->receive_audio_level_ext_ = (enable) ? id : -1; - return 0; - } -#endif // USE_WEBRTC_DEV_BRANCH - WEBRTC_FUNC(SetSendAbsoluteSenderTimeStatus, (int channel, bool enable, - unsigned char id)) { - WEBRTC_CHECK_CHANNEL(channel); - WEBRTC_CHECK_HEADER_EXTENSION_ID(enable, id); - channels_[channel]->send_absolute_sender_time_ext_ = (enable) ? id : -1; - return 0; - } - WEBRTC_FUNC(SetReceiveAbsoluteSenderTimeStatus, (int channel, bool enable, - unsigned char id)) { - WEBRTC_CHECK_CHANNEL(channel); - WEBRTC_CHECK_HEADER_EXTENSION_ID(enable, id); - channels_[channel]->receive_absolute_sender_time_ext_ = (enable) ? id : -1; - return 0; - } - - WEBRTC_STUB(GetRemoteCSRCs, (int channel, unsigned int arrCSRC[15])); - WEBRTC_STUB(SetRTCPStatus, (int channel, bool enable)); - WEBRTC_STUB(GetRTCPStatus, (int channel, bool& enabled)); - WEBRTC_STUB(SetRTCP_CNAME, (int channel, const char cname[256])); - WEBRTC_STUB(GetRTCP_CNAME, (int channel, char cname[256])); - WEBRTC_STUB(GetRemoteRTCP_CNAME, (int channel, char* cname)); - WEBRTC_STUB(GetRemoteRTCPData, (int channel, unsigned int& NTPHigh, - unsigned int& NTPLow, - unsigned int& timestamp, - unsigned int& playoutTimestamp, - unsigned int* jitter, - unsigned short* fractionLost)); - WEBRTC_STUB(GetRemoteRTCPSenderInfo, (int channel, - webrtc::SenderInfo* sender_info)); - WEBRTC_FUNC(GetRemoteRTCPReportBlocks, - (int channel, std::vector* receive_blocks)) { - WEBRTC_CHECK_CHANNEL(channel); - webrtc::ReportBlock block; - block.source_SSRC = channels_[channel]->send_ssrc; - webrtc::CodecInst send_codec = channels_[channel]->send_codec; - if (send_codec.pltype >= 0) { - block.fraction_lost = (unsigned char)(kFractionLostStatValue * 256); - if (send_codec.plfreq / 1000 > 0) { - block.interarrival_jitter = kIntStatValue * (send_codec.plfreq / 1000); - } - block.cumulative_num_packets_lost = kIntStatValue; - block.extended_highest_sequence_number = kIntStatValue; - receive_blocks->push_back(block); - } - return 0; - } - WEBRTC_STUB(SendApplicationDefinedRTCPPacket, (int channel, - unsigned char subType, - unsigned int name, - const char* data, - unsigned short dataLength)); - WEBRTC_STUB(GetRTPStatistics, (int channel, unsigned int& averageJitterMs, - unsigned int& maxJitterMs, - unsigned int& discardedPackets)); - WEBRTC_FUNC(GetRTCPStatistics, (int channel, webrtc::CallStatistics& stats)) { - WEBRTC_CHECK_CHANNEL(channel); - stats.fractionLost = static_cast(kIntStatValue); - stats.cumulativeLost = kIntStatValue; - stats.extendedMax = kIntStatValue; - stats.jitterSamples = kIntStatValue; - stats.rttMs = kIntStatValue; - stats.bytesSent = kIntStatValue; - stats.packetsSent = kIntStatValue; - stats.bytesReceived = kIntStatValue; - stats.packetsReceived = kIntStatValue; - return 0; - } - WEBRTC_FUNC(SetFECStatus, (int channel, bool enable, int redPayloadtype)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->fec = enable; - channels_[channel]->fec_type = redPayloadtype; - return 0; - } - WEBRTC_FUNC(GetFECStatus, (int channel, bool& enable, int& redPayloadtype)) { - WEBRTC_CHECK_CHANNEL(channel); - enable = channels_[channel]->fec; - redPayloadtype = channels_[channel]->fec_type; - return 0; - } - WEBRTC_FUNC(SetNACKStatus, (int channel, bool enable, int maxNoPackets)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->nack = enable; - channels_[channel]->nack_max_packets = maxNoPackets; - return 0; - } - WEBRTC_STUB(StartRTPDump, (int channel, const char* fileNameUTF8, - webrtc::RTPDirections direction)); - WEBRTC_STUB(StopRTPDump, (int channel, webrtc::RTPDirections direction)); - WEBRTC_STUB(RTPDumpIsActive, (int channel, webrtc::RTPDirections direction)); - WEBRTC_STUB(InsertExtraRTPPacket, (int channel, unsigned char payloadType, - bool markerBit, const char* payloadData, - unsigned short payloadSize)); - WEBRTC_STUB(GetLastRemoteTimeStamp, (int channel, - uint32_t* lastRemoteTimeStamp)); - WEBRTC_FUNC(SetVideoEngineBWETarget, (int channel, - webrtc::ViENetwork* vie_network, - int video_channel)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->vie_network = vie_network; - channels_[channel]->video_channel = video_channel; - return 0; - } - - // webrtc::VoEVideoSync - WEBRTC_STUB(GetPlayoutBufferSize, (int& bufferMs)); - WEBRTC_STUB(GetPlayoutTimestamp, (int channel, unsigned int& timestamp)); - WEBRTC_STUB(GetRtpRtcp, (int, webrtc::RtpRtcp**, webrtc::RtpReceiver**)); - WEBRTC_STUB(SetInitTimestamp, (int channel, unsigned int timestamp)); - WEBRTC_STUB(SetInitSequenceNumber, (int channel, short sequenceNumber)); - WEBRTC_STUB(SetMinimumPlayoutDelay, (int channel, int delayMs)); - WEBRTC_STUB(SetInitialPlayoutDelay, (int channel, int delay_ms)); - WEBRTC_STUB(GetDelayEstimate, (int channel, int* jitter_buffer_delay_ms, - int* playout_buffer_delay_ms)); - WEBRTC_STUB_CONST(GetLeastRequiredDelayMs, (int channel)); - - // webrtc::VoEVolumeControl - WEBRTC_STUB(SetSpeakerVolume, (unsigned int)); - WEBRTC_STUB(GetSpeakerVolume, (unsigned int&)); - WEBRTC_STUB(SetSystemOutputMute, (bool)); - WEBRTC_STUB(GetSystemOutputMute, (bool&)); - WEBRTC_STUB(SetMicVolume, (unsigned int)); - WEBRTC_STUB(GetMicVolume, (unsigned int&)); - WEBRTC_STUB(SetInputMute, (int, bool)); - WEBRTC_STUB(GetInputMute, (int, bool&)); - WEBRTC_STUB(SetSystemInputMute, (bool)); - WEBRTC_STUB(GetSystemInputMute, (bool&)); - WEBRTC_STUB(GetSpeechInputLevel, (unsigned int&)); - WEBRTC_STUB(GetSpeechOutputLevel, (int, unsigned int&)); - WEBRTC_STUB(GetSpeechInputLevelFullRange, (unsigned int&)); - WEBRTC_STUB(GetSpeechOutputLevelFullRange, (int, unsigned int&)); - WEBRTC_FUNC(SetChannelOutputVolumeScaling, (int channel, float scale)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->volume_scale= scale; - return 0; - } - WEBRTC_FUNC(GetChannelOutputVolumeScaling, (int channel, float& scale)) { - WEBRTC_CHECK_CHANNEL(channel); - scale = channels_[channel]->volume_scale; - return 0; - } - WEBRTC_FUNC(SetOutputVolumePan, (int channel, float left, float right)) { - WEBRTC_CHECK_CHANNEL(channel); - channels_[channel]->volume_pan_left = left; - channels_[channel]->volume_pan_right = right; - return 0; - } - WEBRTC_FUNC(GetOutputVolumePan, (int channel, float& left, float& right)) { - WEBRTC_CHECK_CHANNEL(channel); - left = channels_[channel]->volume_pan_left; - right = channels_[channel]->volume_pan_right; - return 0; - } - - // webrtc::VoEAudioProcessing - WEBRTC_FUNC(SetNsStatus, (bool enable, webrtc::NsModes mode)) { - ns_enabled_ = enable; - ns_mode_ = mode; - return 0; - } - WEBRTC_FUNC(GetNsStatus, (bool& enabled, webrtc::NsModes& mode)) { - enabled = ns_enabled_; - mode = ns_mode_; - return 0; - } - - WEBRTC_FUNC(SetAgcStatus, (bool enable, webrtc::AgcModes mode)) { - agc_enabled_ = enable; - agc_mode_ = mode; - return 0; - } - WEBRTC_FUNC(GetAgcStatus, (bool& enabled, webrtc::AgcModes& mode)) { - enabled = agc_enabled_; - mode = agc_mode_; - return 0; - } - - WEBRTC_FUNC(SetAgcConfig, (webrtc::AgcConfig config)) { - agc_config_ = config; - return 0; - } - WEBRTC_FUNC(GetAgcConfig, (webrtc::AgcConfig& config)) { - config = agc_config_; - return 0; - } - WEBRTC_FUNC(SetEcStatus, (bool enable, webrtc::EcModes mode)) { - ec_enabled_ = enable; - ec_mode_ = mode; - return 0; - } - WEBRTC_FUNC(GetEcStatus, (bool& enabled, webrtc::EcModes& mode)) { - enabled = ec_enabled_; - mode = ec_mode_; - return 0; - } - WEBRTC_STUB(EnableDriftCompensation, (bool enable)) - WEBRTC_BOOL_STUB(DriftCompensationEnabled, ()) - WEBRTC_VOID_STUB(SetDelayOffsetMs, (int offset)) - WEBRTC_STUB(DelayOffsetMs, ()); - WEBRTC_FUNC(SetAecmMode, (webrtc::AecmModes mode, bool enableCNG)) { - aecm_mode_ = mode; - cng_enabled_ = enableCNG; - return 0; - } - WEBRTC_FUNC(GetAecmMode, (webrtc::AecmModes& mode, bool& enabledCNG)) { - mode = aecm_mode_; - enabledCNG = cng_enabled_; - return 0; - } - WEBRTC_STUB(SetRxNsStatus, (int channel, bool enable, webrtc::NsModes mode)); - WEBRTC_STUB(GetRxNsStatus, (int channel, bool& enabled, - webrtc::NsModes& mode)); - WEBRTC_FUNC(SetRxAgcStatus, (int channel, bool enable, - webrtc::AgcModes mode)) { - channels_[channel]->rx_agc_enabled = enable; - channels_[channel]->rx_agc_mode = mode; - return 0; - } - WEBRTC_FUNC(GetRxAgcStatus, (int channel, bool& enabled, - webrtc::AgcModes& mode)) { - enabled = channels_[channel]->rx_agc_enabled; - mode = channels_[channel]->rx_agc_mode; - return 0; - } - - WEBRTC_FUNC(SetRxAgcConfig, (int channel, webrtc::AgcConfig config)) { - channels_[channel]->rx_agc_config = config; - return 0; - } - WEBRTC_FUNC(GetRxAgcConfig, (int channel, webrtc::AgcConfig& config)) { - config = channels_[channel]->rx_agc_config; - return 0; - } - - WEBRTC_STUB(RegisterRxVadObserver, (int, webrtc::VoERxVadCallback&)); - WEBRTC_STUB(DeRegisterRxVadObserver, (int channel)); - WEBRTC_STUB(VoiceActivityIndicator, (int channel)); - WEBRTC_FUNC(SetEcMetricsStatus, (bool enable)) { - ec_metrics_enabled_ = enable; - return 0; - } - WEBRTC_FUNC(GetEcMetricsStatus, (bool& enabled)) { - enabled = ec_metrics_enabled_; - return 0; - } - WEBRTC_STUB(GetEchoMetrics, (int& ERL, int& ERLE, int& RERL, int& A_NLP)); - WEBRTC_STUB(GetEcDelayMetrics, (int& delay_median, int& delay_std)); - - WEBRTC_STUB(StartDebugRecording, (const char* fileNameUTF8)); - WEBRTC_STUB(StartDebugRecording, (FILE* handle)); - WEBRTC_STUB(StopDebugRecording, ()); - - WEBRTC_FUNC(SetTypingDetectionStatus, (bool enable)) { - typing_detection_enabled_ = enable; - return 0; - } - WEBRTC_FUNC(GetTypingDetectionStatus, (bool& enabled)) { - enabled = typing_detection_enabled_; - return 0; - } - - WEBRTC_STUB(TimeSinceLastTyping, (int& seconds)); - WEBRTC_STUB(SetTypingDetectionParameters, (int timeWindow, - int costPerTyping, - int reportingThreshold, - int penaltyDecay, - int typeEventDelay)); - int EnableHighPassFilter(bool enable) { - highpass_filter_enabled_ = enable; - return 0; - } - bool IsHighPassFilterEnabled() { - return highpass_filter_enabled_; - } - bool IsStereoChannelSwappingEnabled() { - return stereo_swapping_enabled_; - } - void EnableStereoChannelSwapping(bool enable) { - stereo_swapping_enabled_ = enable; - } - bool WasSendTelephoneEventCalled(int channel, int event_code, int length_ms) { - return (channels_[channel]->dtmf_info.dtmf_event_code == event_code && - channels_[channel]->dtmf_info.dtmf_out_of_band == true && - channels_[channel]->dtmf_info.dtmf_length_ms == length_ms); - } - bool WasPlayDtmfToneCalled(int event_code, int length_ms) { - return (dtmf_info_.dtmf_event_code == event_code && - dtmf_info_.dtmf_length_ms == length_ms); - } - // webrtc::VoEExternalMedia - WEBRTC_FUNC(RegisterExternalMediaProcessing, - (int channel, webrtc::ProcessingTypes type, - webrtc::VoEMediaProcess& processObject)) { - WEBRTC_CHECK_CHANNEL(channel); - if (channels_[channel]->media_processor_registered) { - return -1; - } - channels_[channel]->media_processor_registered = true; - media_processor_ = &processObject; - return 0; - } - WEBRTC_FUNC(DeRegisterExternalMediaProcessing, - (int channel, webrtc::ProcessingTypes type)) { - WEBRTC_CHECK_CHANNEL(channel); - if (!channels_[channel]->media_processor_registered) { - return -1; - } - channels_[channel]->media_processor_registered = false; - media_processor_ = NULL; - return 0; - } - WEBRTC_STUB(SetExternalRecordingStatus, (bool enable)); - WEBRTC_STUB(SetExternalPlayoutStatus, (bool enable)); - WEBRTC_STUB(ExternalRecordingInsertData, - (const int16_t speechData10ms[], int lengthSamples, - int samplingFreqHz, int current_delay_ms)); - WEBRTC_STUB(ExternalPlayoutGetData, - (int16_t speechData10ms[], int samplingFreqHz, - int current_delay_ms, int& lengthSamples)); - WEBRTC_STUB(GetAudioFrame, (int channel, int desired_sample_rate_hz, - webrtc::AudioFrame* frame)); - WEBRTC_STUB(SetExternalMixing, (int channel, bool enable)); - - private: - int GetNumDevices(int& num) { -#ifdef WIN32 - num = 1; -#else - // On non-Windows platforms VE adds a special entry for the default device, - // so if there is one physical device then there are two entries in the - // list. - num = 2; -#endif - return 0; - } - - int GetDeviceName(int i, char* name, char* guid) { - const char *s; -#ifdef WIN32 - if (0 == i) { - s = kFakeDeviceName; - } else { - return -1; - } -#else - // See comment above. - if (0 == i) { - s = kFakeDefaultDeviceName; - } else if (1 == i) { - s = kFakeDeviceName; - } else { - return -1; - } -#endif - strcpy(name, s); - guid[0] = '\0'; - return 0; - } - - bool inited_; - int last_channel_; - std::map channels_; - bool fail_create_channel_; - const cricket::AudioCodec* const* codecs_; - int num_codecs_; - int num_set_send_codecs_; // how many times we call SetSendCodec(). - bool ec_enabled_; - bool ec_metrics_enabled_; - bool cng_enabled_; - bool ns_enabled_; - bool agc_enabled_; - bool highpass_filter_enabled_; - bool stereo_swapping_enabled_; - bool typing_detection_enabled_; - webrtc::EcModes ec_mode_; - webrtc::AecmModes aecm_mode_; - webrtc::NsModes ns_mode_; - webrtc::AgcModes agc_mode_; - webrtc::AgcConfig agc_config_; - webrtc::VoiceEngineObserver* observer_; - int playout_fail_channel_; - int send_fail_channel_; - bool fail_start_recording_microphone_; - bool recording_microphone_; - int recording_sample_rate_; - int playout_sample_rate_; - DtmfInfo dtmf_info_; - webrtc::VoEMediaProcess* media_processor_; -}; - -#undef WEBRTC_CHECK_HEADER_EXTENSION_ID - -} // namespace cricket - -#endif // TALK_SESSION_PHONE_FAKEWEBRTCVOICEENGINE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtccommon.h b/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtccommon.h deleted file mode 100755 index e7e946f..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtccommon.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_WEBRTCCOMMON_H_ -#define TALK_MEDIA_WEBRTCCOMMON_H_ - -#include "webrtc/common_types.h" - -namespace cricket { - -// Tracing helpers, for easy logging when WebRTC calls fail. -// Example: "LOG_RTCERR1(StartSend, channel);" produces the trace -// "StartSend(1) failed, err=XXXX" -// The method GetLastEngineError must be defined in the calling scope. -#define LOG_RTCERR0(func) \ - LOG_RTCERR0_EX(func, GetLastEngineError()) -#define LOG_RTCERR1(func, a1) \ - LOG_RTCERR1_EX(func, a1, GetLastEngineError()) -#define LOG_RTCERR2(func, a1, a2) \ - LOG_RTCERR2_EX(func, a1, a2, GetLastEngineError()) -#define LOG_RTCERR3(func, a1, a2, a3) \ - LOG_RTCERR3_EX(func, a1, a2, a3, GetLastEngineError()) -#define LOG_RTCERR4(func, a1, a2, a3, a4) \ - LOG_RTCERR4_EX(func, a1, a2, a3, a4, GetLastEngineError()) -#define LOG_RTCERR5(func, a1, a2, a3, a4, a5) \ - LOG_RTCERR5_EX(func, a1, a2, a3, a4, a5, GetLastEngineError()) -#define LOG_RTCERR6(func, a1, a2, a3, a4, a5, a6) \ - LOG_RTCERR6_EX(func, a1, a2, a3, a4, a5, a6, GetLastEngineError()) -#define LOG_RTCERR0_EX(func, err) LOG(LS_WARNING) \ - << "" << #func << "() failed, err=" << err -#define LOG_RTCERR1_EX(func, a1, err) LOG(LS_WARNING) \ - << "" << #func << "(" << a1 << ") failed, err=" << err -#define LOG_RTCERR2_EX(func, a1, a2, err) LOG(LS_WARNING) \ - << "" << #func << "(" << a1 << ", " << a2 << ") failed, err=" \ - << err -#define LOG_RTCERR3_EX(func, a1, a2, a3, err) LOG(LS_WARNING) \ - << "" << #func << "(" << a1 << ", " << a2 << ", " << a3 \ - << ") failed, err=" << err -#define LOG_RTCERR4_EX(func, a1, a2, a3, a4, err) LOG(LS_WARNING) \ - << "" << #func << "(" << a1 << ", " << a2 << ", " << a3 \ - << ", " << a4 << ") failed, err=" << err -#define LOG_RTCERR5_EX(func, a1, a2, a3, a4, a5, err) LOG(LS_WARNING) \ - << "" << #func << "(" << a1 << ", " << a2 << ", " << a3 \ - << ", " << a4 << ", " << a5 << ") failed, err=" << err -#define LOG_RTCERR6_EX(func, a1, a2, a3, a4, a5, a6, err) LOG(LS_WARNING) \ - << "" << #func << "(" << a1 << ", " << a2 << ", " << a3 \ - << ", " << a4 << ", " << a5 << ", " << a6 << ") failed, err=" << err - -} // namespace cricket - -#endif // TALK_MEDIA_WEBRTCCOMMON_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcexport.h b/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcexport.h deleted file mode 100755 index 3b219b2..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcexport.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * libjingle - * Copyright 2004--2013, 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_WEBRTC_WEBRTCEXPORT_H_ -#define TALK_MEDIA_WEBRTC_WEBRTCEXPORT_H_ - -#if !defined(GOOGLE_CHROME_BUILD) && !defined(CHROMIUM_BUILD) -#define LIBPEERCONNECTION_LIB 1 -#endif - -#ifndef NON_EXPORTED_BASE -#ifdef WIN32 - -// MSVC_SUPPRESS_WARNING disables warning |n| for the remainder of the line and -// for the next line of the source file. -#define MSVC_SUPPRESS_WARNING(n) __pragma(warning(suppress:n)) - -// Allows exporting a class that inherits from a non-exported base class. -// This uses suppress instead of push/pop because the delimiter after the -// declaration (either "," or "{") has to be placed before the pop macro. -// -// Example usage: -// class EXPORT_API Foo : NON_EXPORTED_BASE(public Bar) { -// -// MSVC Compiler warning C4275: -// non dll-interface class 'Bar' used as base for dll-interface class 'Foo'. -// Note that this is intended to be used only when no access to the base class' -// static data is done through derived classes or inline methods. For more info, -// see http://msdn.microsoft.com/en-us/library/3tdb471s(VS.80).aspx -#define NON_EXPORTED_BASE(code) MSVC_SUPPRESS_WARNING(4275) \ - code - -#else // Not WIN32 -#define NON_EXPORTED_BASE(code) code -#endif // WIN32 -#endif // NON_EXPORTED_BASE - -#if defined (LIBPEERCONNECTION_LIB) - #define WRME_EXPORT -#else - #if defined(WIN32) - #if defined(LIBPEERCONNECTION_IMPLEMENTATION) - #define WRME_EXPORT __declspec(dllexport) - #else - #define WRME_EXPORT __declspec(dllimport) - #endif - #else // defined(WIN32) - #if defined(LIBPEERCONNECTION_IMPLEMENTATION) - #define WRME_EXPORT __attribute__((visibility("default"))) - #else - #define WRME_EXPORT - #endif - #endif -#endif // LIBPEERCONNECTION_LIB - -#endif // TALK_MEDIA_WEBRTC_WEBRTCEXPORT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcmediaengine.h b/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcmediaengine.h deleted file mode 100755 index ded1b54..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcmediaengine.h +++ /dev/null @@ -1,203 +0,0 @@ -/* - * 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_MEDIA_WEBRTCMEDIAENGINE_H_ -#define TALK_MEDIA_WEBRTCMEDIAENGINE_H_ - -#include "talk/media/base/mediaengine.h" -#include "talk/media/webrtc/webrtcexport.h" - -namespace webrtc { -class AudioDeviceModule; -class VideoCaptureModule; -} -namespace cricket { -class WebRtcVideoDecoderFactory; -class WebRtcVideoEncoderFactory; -} - - -#if !defined(LIBPEERCONNECTION_LIB) && \ - !defined(LIBPEERCONNECTION_IMPLEMENTATION) - -WRME_EXPORT -cricket::MediaEngineInterface* CreateWebRtcMediaEngine( - webrtc::AudioDeviceModule* adm, webrtc::AudioDeviceModule* adm_sc, - cricket::WebRtcVideoEncoderFactory* encoder_factory, - cricket::WebRtcVideoDecoderFactory* decoder_factory); - -WRME_EXPORT -void DestroyWebRtcMediaEngine(cricket::MediaEngineInterface* media_engine); - -namespace cricket { - -class WebRtcMediaEngine : public cricket::MediaEngineInterface { - public: - WebRtcMediaEngine( - webrtc::AudioDeviceModule* adm, - webrtc::AudioDeviceModule* adm_sc, - cricket::WebRtcVideoEncoderFactory* encoder_factory, - cricket::WebRtcVideoDecoderFactory* decoder_factory) - : delegate_(CreateWebRtcMediaEngine( - adm, adm_sc, encoder_factory, decoder_factory)) { - } - virtual ~WebRtcMediaEngine() { - DestroyWebRtcMediaEngine(delegate_); - } - virtual bool Init(talk_base::Thread* worker_thread) OVERRIDE { - return delegate_->Init(worker_thread); - } - virtual void Terminate() OVERRIDE { - delegate_->Terminate(); - } - virtual int GetCapabilities() OVERRIDE { - return delegate_->GetCapabilities(); - } - virtual VoiceMediaChannel* CreateChannel() OVERRIDE { - return delegate_->CreateChannel(); - } - virtual VideoMediaChannel* CreateVideoChannel( - VoiceMediaChannel* voice_media_channel) OVERRIDE { - return delegate_->CreateVideoChannel(voice_media_channel); - } - virtual SoundclipMedia* CreateSoundclip() OVERRIDE { - return delegate_->CreateSoundclip(); - } - virtual AudioOptions GetAudioOptions() const OVERRIDE { - return delegate_->GetAudioOptions(); - } - virtual bool SetAudioOptions(const AudioOptions& options) OVERRIDE { - return delegate_->SetAudioOptions(options); - } - virtual bool SetVideoOptions(const VideoOptions& options) OVERRIDE { - return delegate_->SetVideoOptions(options); - } - virtual bool SetAudioDelayOffset(int offset) OVERRIDE { - return delegate_->SetAudioDelayOffset(offset); - } - virtual bool SetDefaultVideoEncoderConfig( - const VideoEncoderConfig& config) OVERRIDE { - return delegate_->SetDefaultVideoEncoderConfig(config); - } - virtual VideoEncoderConfig GetDefaultVideoEncoderConfig() const OVERRIDE { - return delegate_->GetDefaultVideoEncoderConfig(); - } - virtual bool SetSoundDevices( - const Device* in_device, const Device* out_device) OVERRIDE { - return delegate_->SetSoundDevices(in_device, out_device); - } - virtual bool GetOutputVolume(int* level) OVERRIDE { - return delegate_->GetOutputVolume(level); - } - virtual bool SetOutputVolume(int level) OVERRIDE { - return delegate_->SetOutputVolume(level); - } - virtual int GetInputLevel() OVERRIDE { - return delegate_->GetInputLevel(); - } - virtual bool SetLocalMonitor(bool enable) OVERRIDE { - return delegate_->SetLocalMonitor(enable); - } - virtual bool SetLocalRenderer(VideoRenderer* renderer) OVERRIDE { - return delegate_->SetLocalRenderer(renderer); - } - virtual const std::vector& audio_codecs() OVERRIDE { - return delegate_->audio_codecs(); - } - virtual const std::vector& - audio_rtp_header_extensions() OVERRIDE { - return delegate_->audio_rtp_header_extensions(); - } - virtual const std::vector& video_codecs() OVERRIDE { - return delegate_->video_codecs(); - } - virtual const std::vector& - video_rtp_header_extensions() OVERRIDE { - return delegate_->video_rtp_header_extensions(); - } - virtual void SetVoiceLogging(int min_sev, const char* filter) OVERRIDE { - delegate_->SetVoiceLogging(min_sev, filter); - } - virtual void SetVideoLogging(int min_sev, const char* filter) OVERRIDE { - delegate_->SetVideoLogging(min_sev, filter); - } - virtual bool StartAecDump(talk_base::PlatformFile file) OVERRIDE { - return delegate_->StartAecDump(file); - } - virtual bool RegisterVoiceProcessor( - uint32 ssrc, VoiceProcessor* video_processor, - MediaProcessorDirection direction) OVERRIDE { - return delegate_->RegisterVoiceProcessor(ssrc, video_processor, direction); - } - virtual bool UnregisterVoiceProcessor( - uint32 ssrc, VoiceProcessor* video_processor, - MediaProcessorDirection direction) OVERRIDE { - return delegate_->UnregisterVoiceProcessor(ssrc, video_processor, - direction); - } - virtual VideoFormat GetStartCaptureFormat() const OVERRIDE { - return delegate_->GetStartCaptureFormat(); - } - virtual sigslot::repeater2& - SignalVideoCaptureStateChange() { - return delegate_->SignalVideoCaptureStateChange(); - } - - private: - cricket::MediaEngineInterface* delegate_; -}; - -} // namespace cricket -#else - -#include "talk/media/webrtc/webrtcvideoengine.h" -#include "talk/media/webrtc/webrtcvoiceengine.h" - -namespace cricket { -typedef CompositeMediaEngine - WebRtcCompositeMediaEngine; - -class WebRtcMediaEngine : public WebRtcCompositeMediaEngine { - public: - WebRtcMediaEngine(webrtc::AudioDeviceModule* adm, - webrtc::AudioDeviceModule* adm_sc, - WebRtcVideoEncoderFactory* encoder_factory, - WebRtcVideoDecoderFactory* decoder_factory) { - voice_.SetAudioDeviceModule(adm, adm_sc); - video_.SetVoiceEngine(&voice_); - video_.EnableTimedRender(); - video_.SetExternalEncoderFactory(encoder_factory); - video_.SetExternalDecoderFactory(decoder_factory); - } -}; - -} // namespace cricket - -#endif // !defined(LIBPEERCONNECTION_LIB) && - // !defined(LIBPEERCONNECTION_IMPLEMENTATION) - -#endif // TALK_MEDIA_WEBRTCMEDIAENGINE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcpassthroughrender.h b/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcpassthroughrender.h deleted file mode 100755 index cfef467..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcpassthroughrender.h +++ /dev/null @@ -1,211 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_WEBRTCPASSTHROUGHRENDER_H_ -#define TALK_MEDIA_WEBRTCPASSTHROUGHRENDER_H_ - -#include - -#include "talk/base/criticalsection.h" -#include "webrtc/modules/video_render/include/video_render.h" - -namespace cricket { -class PassthroughStream; - -class WebRtcPassthroughRender : public webrtc::VideoRender { - public: - WebRtcPassthroughRender(); - virtual ~WebRtcPassthroughRender(); - - virtual int32_t Version(int8_t* version, - uint32_t& remainingBufferInBytes, - uint32_t& position) const { - return 0; - } - - virtual int32_t ChangeUniqueId(const int32_t id) { - return 0; - } - - virtual int32_t TimeUntilNextProcess() { return 0; } - - virtual int32_t Process() { return 0; } - - virtual void* Window() { - talk_base::CritScope cs(&render_critical_); - return window_; - } - - virtual int32_t ChangeWindow(void* window) { - talk_base::CritScope cs(&render_critical_); - window_ = window; - return 0; - } - - virtual webrtc::VideoRenderCallback* AddIncomingRenderStream( - const uint32_t stream_id, - const uint32_t zOrder, - const float left, const float top, - const float right, const float bottom); - - virtual int32_t DeleteIncomingRenderStream(const uint32_t stream_id); - - virtual int32_t AddExternalRenderCallback( - const uint32_t stream_id, - webrtc::VideoRenderCallback* render_object); - - virtual int32_t GetIncomingRenderStreamProperties( - const uint32_t stream_id, - uint32_t& zOrder, - float& left, float& top, - float& right, float& bottom) const { - return -1; - } - - virtual uint32_t GetIncomingFrameRate( - const uint32_t stream_id) { - return 0; - } - - virtual uint32_t GetNumIncomingRenderStreams() const { - return static_cast(stream_render_map_.size()); - } - - virtual bool HasIncomingRenderStream(const uint32_t stream_id) const; - - virtual int32_t RegisterRawFrameCallback( - const uint32_t stream_id, - webrtc::VideoRenderCallback* callback_obj) { - return -1; - } - - virtual int32_t GetLastRenderedFrame( - const uint32_t stream_id, - webrtc::I420VideoFrame &frame) const { - return -1; - } - - virtual int32_t StartRender( - const uint32_t stream_id); - - virtual int32_t StopRender( - const uint32_t stream_id); - - virtual int32_t ResetRender() { return 0; } - - virtual webrtc::RawVideoType PreferredVideoType() const; - - virtual bool IsFullScreen() { return false; } - - virtual int32_t GetScreenResolution(uint32_t& screenWidth, - uint32_t& screenHeight) const { - return -1; - } - - virtual uint32_t RenderFrameRate( - const uint32_t stream_id) { - return 0; - } - - virtual int32_t SetStreamCropping( - const uint32_t stream_id, - const float left, const float top, - const float right, - const float bottom) { - return -1; - } - - virtual int32_t SetExpectedRenderDelay(uint32_t stream_id, int32_t delay_ms) { - return -1; - } - - virtual int32_t ConfigureRenderer( - const uint32_t stream_id, - const unsigned int zOrder, - const float left, const float top, - const float right, - const float bottom) { - return -1; - } - - virtual int32_t SetTransparentBackground(const bool enable) { - return -1; - } - - virtual int32_t FullScreenRender(void* window, const bool enable) { - return -1; - } - - virtual int32_t SetBitmap(const void* bitMap, - const uint8_t pictureId, const void* colorKey, - const float left, const float top, - const float right, const float bottom) { - return -1; - } - - virtual int32_t SetText(const uint8_t textId, - const uint8_t* text, - const int32_t textLength, - const uint32_t textColorRef, - const uint32_t backgroundColorRef, - const float left, const float top, - const float right, const float bottom) { - return -1; - } - - virtual int32_t SetStartImage( - const uint32_t stream_id, - const webrtc::I420VideoFrame& videoFrame) { - return -1; - } - - virtual int32_t SetTimeoutImage( - const uint32_t stream_id, - const webrtc::I420VideoFrame& videoFrame, - const uint32_t timeout) { - return -1; - } - - virtual int32_t MirrorRenderStream(const int renderId, - const bool enable, - const bool mirrorXAxis, - const bool mirrorYAxis) { - return -1; - } - - private: - typedef std::map StreamMap; - - PassthroughStream* FindStream(const uint32_t stream_id) const; - - void* window_; - StreamMap stream_render_map_; - talk_base::CriticalSection render_critical_; -}; -} // namespace cricket - -#endif // TALK_MEDIA_WEBRTCPASSTHROUGHRENDER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtctexturevideoframe.h b/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtctexturevideoframe.h deleted file mode 100755 index bab1f9f..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtctexturevideoframe.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * libjingle - * Copyright 2013 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_WEBRTC_WEBRTCTEXTUREVIDEOFRAME_H_ -#define TALK_MEDIA_WEBRTC_WEBRTCTEXTUREVIDEOFRAME_H_ - -#include "talk/base/refcount.h" -#include "talk/base/scoped_ref_ptr.h" -#include "talk/media/base/videoframe.h" -#include "webrtc/common_video/interface/native_handle.h" - -namespace cricket { - -// A video frame backed by the texture via a native handle. -class WebRtcTextureVideoFrame : public VideoFrame { - public: - WebRtcTextureVideoFrame(webrtc::NativeHandle* handle, int width, int height, - int64 elapsed_time, int64 time_stamp); - virtual ~WebRtcTextureVideoFrame(); - - // From base class VideoFrame. - virtual bool InitToBlack(int w, int h, size_t pixel_width, - size_t pixel_height, int64 elapsed_time, - int64 time_stamp); - virtual bool Reset(uint32 fourcc, int w, int h, int dw, int dh, uint8* sample, - size_t sample_size, size_t pixel_width, - size_t pixel_height, int64 elapsed_time, int64 time_stamp, - int rotation); - virtual size_t GetWidth() const { return width_; } - virtual size_t GetHeight() const { return height_; } - virtual const uint8* GetYPlane() const; - virtual const uint8* GetUPlane() const; - virtual const uint8* GetVPlane() const; - virtual uint8* GetYPlane(); - virtual uint8* GetUPlane(); - virtual uint8* GetVPlane(); - virtual int32 GetYPitch() const; - virtual int32 GetUPitch() const; - virtual int32 GetVPitch() const; - virtual size_t GetPixelWidth() const { return 1; } - virtual size_t GetPixelHeight() const { return 1; } - virtual int64 GetElapsedTime() const { return elapsed_time_; } - virtual int64 GetTimeStamp() const { return time_stamp_; } - virtual void SetElapsedTime(int64 elapsed_time) { - elapsed_time_ = elapsed_time; - } - virtual void SetTimeStamp(int64 time_stamp) { time_stamp_ = time_stamp; } - virtual int GetRotation() const { return 0; } - virtual VideoFrame* Copy() const; - virtual bool MakeExclusive(); - virtual size_t CopyToBuffer(uint8* buffer, size_t size) const; - virtual size_t ConvertToRgbBuffer(uint32 to_fourcc, uint8* buffer, - size_t size, int stride_rgb) const; - virtual void* GetNativeHandle() const { return handle_.get(); } - - virtual bool CopyToPlanes( - uint8* dst_y, uint8* dst_u, uint8* dst_v, - int32 dst_pitch_y, int32 dst_pitch_u, int32 dst_pitch_v) const; - virtual void CopyToFrame(VideoFrame* target) const; - virtual talk_base::StreamResult Write(talk_base::StreamInterface* stream, - int* error); - virtual void StretchToPlanes( - uint8* y, uint8* u, uint8* v, int32 pitchY, int32 pitchU, int32 pitchV, - size_t width, size_t height, bool interpolate, bool crop) const; - virtual size_t StretchToBuffer(size_t w, size_t h, uint8* buffer, size_t size, - bool interpolate, bool crop) const; - virtual void StretchToFrame(VideoFrame* target, bool interpolate, - bool crop) const; - virtual VideoFrame* Stretch(size_t w, size_t h, bool interpolate, - bool crop) const; - virtual bool SetToBlack(); - - protected: - virtual VideoFrame* CreateEmptyFrame(int w, int h, size_t pixel_width, - size_t pixel_height, int64 elapsed_time, - int64 time_stamp) const; - - private: - // The handle of the underlying video frame. - talk_base::scoped_refptr handle_; - int width_; - int height_; - int64 elapsed_time_; - int64 time_stamp_; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_WEBRTC_WEBRTCTEXTUREVIDEOFRAME_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvideocapturer.h b/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvideocapturer.h deleted file mode 100755 index 506b853..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvideocapturer.h +++ /dev/null @@ -1,107 +0,0 @@ -// libjingle -// Copyright 2004 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_WEBRTCVIDEOCAPTURER_H_ -#define TALK_MEDIA_WEBRTCVIDEOCAPTURER_H_ - -#ifdef HAVE_WEBRTC_VIDEO - -#include -#include - -#include "talk/base/criticalsection.h" -#include "talk/base/messagehandler.h" -#include "talk/media/base/videocapturer.h" -#include "talk/media/webrtc/webrtcvideoframe.h" -#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" -#include "webrtc/modules/video_capture/include/video_capture.h" - -namespace cricket { - -// Factory to allow injection of a VCM impl into WebRtcVideoCapturer. -// DeviceInfos do not have a Release() and therefore need an explicit Destroy(). -class WebRtcVcmFactoryInterface { - public: - virtual ~WebRtcVcmFactoryInterface() {} - virtual webrtc::VideoCaptureModule* Create( - int id, const char* device) = 0; - virtual webrtc::VideoCaptureModule::DeviceInfo* CreateDeviceInfo(int id) = 0; - virtual void DestroyDeviceInfo( - webrtc::VideoCaptureModule::DeviceInfo* info) = 0; -}; - -// WebRTC-based implementation of VideoCapturer. -class WebRtcVideoCapturer : public VideoCapturer, - public webrtc::VideoCaptureDataCallback { - public: - WebRtcVideoCapturer(); - explicit WebRtcVideoCapturer(WebRtcVcmFactoryInterface* factory); - virtual ~WebRtcVideoCapturer(); - - bool Init(const Device& device); - bool Init(webrtc::VideoCaptureModule* module); - - // Override virtual methods of the parent class VideoCapturer. - virtual bool GetBestCaptureFormat(const VideoFormat& desired, - VideoFormat* best_format); - virtual CaptureState Start(const VideoFormat& capture_format); - virtual void Stop(); - virtual bool IsRunning(); - virtual bool IsScreencast() const { return false; } - - protected: - // Override virtual methods of the parent class VideoCapturer. - virtual bool GetPreferredFourccs(std::vector* fourccs); - - private: - // Callback when a frame is captured by camera. - virtual void OnIncomingCapturedFrame(const int32_t id, - webrtc::I420VideoFrame& frame); - virtual void OnIncomingCapturedEncodedFrame(const int32_t id, - webrtc::VideoFrame& frame, - webrtc::VideoCodecType codec_type) { - } - virtual void OnCaptureDelayChanged(const int32_t id, - const int32_t delay); - - talk_base::scoped_ptr factory_; - webrtc::VideoCaptureModule* module_; - int captured_frames_; - std::vector capture_buffer_; - - // Critical section to avoid Stop during an OnIncomingCapturedFrame callback. - talk_base::CriticalSection critical_section_stopping_; -}; - -struct WebRtcCapturedFrame : public CapturedFrame { - public: - WebRtcCapturedFrame(const webrtc::I420VideoFrame& frame, - void* buffer, int length); -}; - -} // namespace cricket - -#endif // HAVE_WEBRTC_VIDEO -#endif // TALK_MEDIA_WEBRTCVIDEOCAPTURER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvideochannelfactory.h b/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvideochannelfactory.h deleted file mode 100755 index 7eb06bd..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvideochannelfactory.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_WEBRTC_WEBRTCVIDEOCHANNEL_H_ -#define TALK_MEDIA_WEBRTC_WEBRTCVIDEOCHANNEL_H_ - -namespace cricket { -class VoiceMediaChannel; -class WebRtcVideoEngine2; -class WebRtcVideoChannel2; - -class WebRtcVideoChannelFactory { - public: - virtual ~WebRtcVideoChannelFactory() {} - virtual WebRtcVideoChannel2* Create(WebRtcVideoEngine2* engine, - VoiceMediaChannel* voice_channel) = 0; -}; -} // namespace cricket - -#endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOCHANNEL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvideodecoderfactory.h b/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvideodecoderfactory.h deleted file mode 100755 index cb70790..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvideodecoderfactory.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * libjingle - * Copyright 2013, 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_WEBRTC_WEBRTCVIDEODECODERFACTORY_H_ -#define TALK_MEDIA_WEBRTC_WEBRTCVIDEODECODERFACTORY_H_ - -#include "talk/base/refcount.h" -#include "webrtc/common_types.h" - -namespace webrtc { -class VideoDecoder; -} - -namespace cricket { - -class WebRtcVideoDecoderFactory { - public: - // Caller takes the ownership of the returned object and it should be released - // by calling DestroyVideoDecoder(). - virtual webrtc::VideoDecoder* CreateVideoDecoder( - webrtc::VideoCodecType type) = 0; - virtual ~WebRtcVideoDecoderFactory() {} - - virtual void DestroyVideoDecoder(webrtc::VideoDecoder* decoder) = 0; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEODECODERFACTORY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvideoencoderfactory.h b/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvideoencoderfactory.h deleted file mode 100755 index e20a5d6..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvideoencoderfactory.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * libjingle - * Copyright 2013, 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_WEBRTC_WEBRTCVIDEOENCODERFACTORY_H_ -#define TALK_MEDIA_WEBRTC_WEBRTCVIDEOENCODERFACTORY_H_ - -#include "talk/base/refcount.h" -#include "talk/media/base/codec.h" -#include "webrtc/common_types.h" - -namespace webrtc { -class VideoEncoder; -} - -namespace cricket { - -class WebRtcVideoEncoderFactory { - public: - struct VideoCodec { - webrtc::VideoCodecType type; - std::string name; - int max_width; - int max_height; - int max_fps; - - VideoCodec(webrtc::VideoCodecType t, const std::string& nm, int w, int h, - int fr) - : type(t), name(nm), max_width(w), max_height(h), max_fps(fr) { - } - }; - - class Observer { - public: - // Invoked when the list of supported codecs becomes available. - // This will not be invoked if the list of codecs is already available when - // the factory is installed. Otherwise this will be invoked only once if the - // list of codecs is not yet available when the factory is installed. - virtual void OnCodecsAvailable() = 0; - - protected: - virtual ~Observer() {} - }; - - // Caller takes the ownership of the returned object and it should be released - // by calling DestroyVideoEncoder(). - virtual webrtc::VideoEncoder* CreateVideoEncoder( - webrtc::VideoCodecType type) = 0; - virtual ~WebRtcVideoEncoderFactory() {} - - // Adds/removes observer to receive OnCodecsChanged notifications. - // Factory must outlive Observer. Observer is responsible for removing itself - // from the Factory by the time its dtor is done. - virtual void AddObserver(Observer* observer) = 0; - virtual void RemoveObserver(Observer* observer) = 0; - - // Returns a list of supported codecs in order of preference. - // The list is empty if the list of codecs is not yet available. - virtual const std::vector& codecs() const = 0; - - virtual void DestroyVideoEncoder(webrtc::VideoEncoder* encoder) = 0; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENCODERFACTORY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvideoengine.h b/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvideoengine.h deleted file mode 100755 index 8e5f0cc..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvideoengine.h +++ /dev/null @@ -1,468 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_WEBRTCVIDEOENGINE_H_ -#define TALK_MEDIA_WEBRTCVIDEOENGINE_H_ - -#include -#include - -#include "talk/base/scoped_ptr.h" -#include "talk/media/base/codec.h" -#include "talk/media/base/videocommon.h" -#include "talk/media/webrtc/webrtccommon.h" -#include "talk/media/webrtc/webrtcexport.h" -#include "talk/media/webrtc/webrtcvideoencoderfactory.h" -#include "talk/session/media/channel.h" -#include "webrtc/video_engine/include/vie_base.h" - -#if !defined(LIBPEERCONNECTION_LIB) && \ - !defined(LIBPEERCONNECTION_IMPLEMENTATION) -#error "Bogus include." -#endif - - -namespace webrtc { -class VideoCaptureModule; -class VideoDecoder; -class VideoEncoder; -class VideoRender; -class ViEExternalCapture; -class ViERTP_RTCP; -} - -namespace talk_base { -class CpuMonitor; -} // namespace talk_base - -namespace cricket { - -class CoordinatedVideoAdapter; -class ViETraceWrapper; -class ViEWrapper; -class VideoCapturer; -class VideoFrame; -class VideoProcessor; -class VideoRenderer; -class VoiceMediaChannel; -class WebRtcDecoderObserver; -class WebRtcEncoderObserver; -class WebRtcLocalStreamInfo; -class WebRtcRenderAdapter; -class WebRtcVideoChannelRecvInfo; -class WebRtcVideoChannelSendInfo; -class WebRtcVideoDecoderFactory; -class WebRtcVideoEncoderFactory; -class WebRtcVideoMediaChannel; -class WebRtcVoiceEngine; - -struct CapturedFrame; -struct Device; - -class WebRtcVideoEngine : public sigslot::has_slots<>, - public webrtc::TraceCallback, - public WebRtcVideoEncoderFactory::Observer { - public: - // Creates the WebRtcVideoEngine with internal VideoCaptureModule. - WebRtcVideoEngine(); - // For testing purposes. Allows the WebRtcVoiceEngine, - // ViEWrapper and CpuMonitor to be mocks. - // TODO(juberti): Remove the 3-arg ctor once fake tracing is implemented. - WebRtcVideoEngine(WebRtcVoiceEngine* voice_engine, - ViEWrapper* vie_wrapper, - talk_base::CpuMonitor* cpu_monitor); - WebRtcVideoEngine(WebRtcVoiceEngine* voice_engine, - ViEWrapper* vie_wrapper, - ViETraceWrapper* tracing, - talk_base::CpuMonitor* cpu_monitor); - ~WebRtcVideoEngine(); - - // Basic video engine implementation. - bool Init(talk_base::Thread* worker_thread); - void Terminate(); - - int GetCapabilities(); - bool SetOptions(const VideoOptions &options); - bool SetDefaultEncoderConfig(const VideoEncoderConfig& config); - VideoEncoderConfig GetDefaultEncoderConfig() const; - - WebRtcVideoMediaChannel* CreateChannel(VoiceMediaChannel* voice_channel); - - const std::vector& codecs() const; - const std::vector& rtp_header_extensions() const; - void SetLogging(int min_sev, const char* filter); - - bool SetLocalRenderer(VideoRenderer* renderer); - sigslot::repeater2 SignalCaptureStateChange; - - // Set the VoiceEngine for A/V sync. This can only be called before Init. - bool SetVoiceEngine(WebRtcVoiceEngine* voice_engine); - // Set a WebRtcVideoDecoderFactory for external decoding. Video engine does - // not take the ownership of |decoder_factory|. The caller needs to make sure - // that |decoder_factory| outlives the video engine. - void SetExternalDecoderFactory(WebRtcVideoDecoderFactory* decoder_factory); - // Set a WebRtcVideoEncoderFactory for external encoding. Video engine does - // not take the ownership of |encoder_factory|. The caller needs to make sure - // that |encoder_factory| outlives the video engine. - void SetExternalEncoderFactory(WebRtcVideoEncoderFactory* encoder_factory); - // Enable the render module with timing control. - bool EnableTimedRender(); - - // Returns an external decoder for the given codec type. The return value - // can be NULL if decoder factory is not given or it does not support the - // codec type. The caller takes the ownership of the returned object. - webrtc::VideoDecoder* CreateExternalDecoder(webrtc::VideoCodecType type); - // Releases the decoder instance created by CreateExternalDecoder(). - void DestroyExternalDecoder(webrtc::VideoDecoder* decoder); - - // Returns an external encoder for the given codec type. The return value - // can be NULL if encoder factory is not given or it does not support the - // codec type. The caller takes the ownership of the returned object. - webrtc::VideoEncoder* CreateExternalEncoder(webrtc::VideoCodecType type); - // Releases the encoder instance created by CreateExternalEncoder(). - void DestroyExternalEncoder(webrtc::VideoEncoder* encoder); - - // Returns true if the codec type is supported by the external encoder. - bool IsExternalEncoderCodecType(webrtc::VideoCodecType type) const; - - // Functions called by WebRtcVideoMediaChannel. - talk_base::Thread* worker_thread() { return worker_thread_; } - ViEWrapper* vie() { return vie_wrapper_.get(); } - const VideoFormat& default_codec_format() const { - return default_codec_format_; - } - int GetLastEngineError(); - bool FindCodec(const VideoCodec& in); - bool CanSendCodec(const VideoCodec& in, const VideoCodec& current, - VideoCodec* out); - void RegisterChannel(WebRtcVideoMediaChannel* channel); - void UnregisterChannel(WebRtcVideoMediaChannel* channel); - bool ConvertFromCricketVideoCodec(const VideoCodec& in_codec, - webrtc::VideoCodec* out_codec); - // Check whether the supplied trace should be ignored. - bool ShouldIgnoreTrace(const std::string& trace); - int GetNumOfChannels(); - - VideoFormat GetStartCaptureFormat() const { return default_codec_format_; } - - talk_base::CpuMonitor* cpu_monitor() { return cpu_monitor_.get(); } - - protected: - // When a video processor registers with the engine. - // SignalMediaFrame will be invoked for every video frame. - // See videoprocessor.h for param reference. - sigslot::signal3 SignalMediaFrame; - - private: - typedef std::vector VideoChannels; - struct VideoCodecPref { - const char* name; - int payload_type; - // For RTX, this field is the payload-type that RTX applies to. - // For other codecs, it should be set to -1. - int associated_payload_type; - int pref; - }; - - static const VideoCodecPref kVideoCodecPrefs[]; - static const VideoFormatPod kVideoFormats[]; - static const VideoFormatPod kDefaultVideoFormat; - - void Construct(ViEWrapper* vie_wrapper, - ViETraceWrapper* tracing, - WebRtcVoiceEngine* voice_engine, - talk_base::CpuMonitor* cpu_monitor); - bool SetDefaultCodec(const VideoCodec& codec); - bool RebuildCodecList(const VideoCodec& max_codec); - void SetTraceFilter(int filter); - void SetTraceOptions(const std::string& options); - bool InitVideoEngine(); - bool VerifyApt(const VideoCodec& in, int expected_apt) const; - - // webrtc::TraceCallback implementation. - virtual void Print(webrtc::TraceLevel level, const char* trace, int length); - - // WebRtcVideoEncoderFactory::Observer implementation. - virtual void OnCodecsAvailable(); - - talk_base::Thread* worker_thread_; - talk_base::scoped_ptr vie_wrapper_; - bool vie_wrapper_base_initialized_; - talk_base::scoped_ptr tracing_; - WebRtcVoiceEngine* voice_engine_; - talk_base::scoped_ptr render_module_; - WebRtcVideoEncoderFactory* encoder_factory_; - WebRtcVideoDecoderFactory* decoder_factory_; - std::vector video_codecs_; - std::vector rtp_header_extensions_; - VideoFormat default_codec_format_; - - bool initialized_; - talk_base::CriticalSection channels_crit_; - VideoChannels channels_; - - bool capture_started_; - int local_renderer_w_; - int local_renderer_h_; - VideoRenderer* local_renderer_; - - talk_base::scoped_ptr cpu_monitor_; -}; - -class WebRtcVideoMediaChannel : public talk_base::MessageHandler, - public VideoMediaChannel, - public webrtc::Transport { - public: - WebRtcVideoMediaChannel(WebRtcVideoEngine* engine, - VoiceMediaChannel* voice_channel); - ~WebRtcVideoMediaChannel(); - bool Init(); - - WebRtcVideoEngine* engine() { return engine_; } - VoiceMediaChannel* voice_channel() { return voice_channel_; } - int video_channel() const { return vie_channel_; } - bool sending() const { return sending_; } - - // Public for testing purpose. - uint32 GetDefaultChannelSsrc(); - - // VideoMediaChannel implementation - virtual bool SetRecvCodecs(const std::vector &codecs); - virtual bool SetSendCodecs(const std::vector &codecs); - virtual bool GetSendCodec(VideoCodec* send_codec); - virtual bool SetSendStreamFormat(uint32 ssrc, const VideoFormat& format); - virtual bool SetRender(bool render); - virtual bool SetSend(bool send); - - virtual bool AddSendStream(const StreamParams& sp); - virtual bool RemoveSendStream(uint32 ssrc); - virtual bool AddRecvStream(const StreamParams& sp); - virtual bool RemoveRecvStream(uint32 ssrc); - virtual bool SetRenderer(uint32 ssrc, VideoRenderer* renderer); - virtual bool GetStats(const StatsOptions& options, VideoMediaInfo* info); - virtual bool SetCapturer(uint32 ssrc, VideoCapturer* capturer); - virtual bool SendIntraFrame(); - virtual bool RequestIntraFrame(); - - virtual void OnPacketReceived(talk_base::Buffer* packet, - const talk_base::PacketTime& packet_time); - virtual void OnRtcpReceived(talk_base::Buffer* packet, - const talk_base::PacketTime& packet_time); - virtual void OnReadyToSend(bool ready); - virtual bool MuteStream(uint32 ssrc, bool on); - virtual bool SetRecvRtpHeaderExtensions( - const std::vector& extensions); - virtual bool SetSendRtpHeaderExtensions( - const std::vector& extensions); - virtual int GetRtpSendTimeExtnId() const; - virtual bool SetStartSendBandwidth(int bps); - virtual bool SetMaxSendBandwidth(int bps); - virtual bool SetOptions(const VideoOptions &options); - virtual bool GetOptions(VideoOptions *options) const { - *options = options_; - return true; - } - virtual void SetInterface(NetworkInterface* iface); - virtual void UpdateAspectRatio(int ratio_w, int ratio_h); - - // Public functions for use by tests and other specialized code. - uint32 send_ssrc() const { return 0; } - bool GetRenderer(uint32 ssrc, VideoRenderer** renderer); - bool GetVideoAdapter(uint32 ssrc, CoordinatedVideoAdapter** video_adapter); - void SendFrame(VideoCapturer* capturer, const VideoFrame* frame); - bool SendFrame(WebRtcVideoChannelSendInfo* channel_info, - const VideoFrame* frame, bool is_screencast); - - // Thunk functions for use with HybridVideoEngine - void OnLocalFrame(VideoCapturer* capturer, const VideoFrame* frame) { - SendFrame(0u, frame, capturer->IsScreencast()); - } - void OnLocalFrameFormat(VideoCapturer* capturer, const VideoFormat* format) { - } - - virtual void OnMessage(talk_base::Message* msg); - - protected: - int GetLastEngineError() { return engine()->GetLastEngineError(); } - virtual int SendPacket(int channel, const void* data, int len); - virtual int SendRTCPPacket(int channel, const void* data, int len); - - private: - typedef std::map RecvChannelMap; - typedef std::map SendChannelMap; - typedef std::map SsrcMap; - typedef int (webrtc::ViERTP_RTCP::* ExtensionSetterFunction)(int, bool, int); - - enum MediaDirection { MD_RECV, MD_SEND, MD_SENDRECV }; - - // Creates and initializes a ViE channel. When successful |channel_id| will - // contain the new channel's ID. If |receiving| is true |ssrc| is the - // remote ssrc. If |sending| is true the ssrc is local ssrc. If both - // |receiving| and |sending| is true the ssrc must be 0 and the channel will - // be created as a default channel. The ssrc must be different for receive - // channels and it must be different for send channels. If the same SSRC is - // being used for creating channel more than once, this function will fail - // returning false. - bool CreateChannel(uint32 ssrc_key, MediaDirection direction, - int* channel_id); - bool CreateUnsignalledRecvChannel(uint32 ssrc_key, int* channel_id); - bool ConfigureChannel(int channel_id, MediaDirection direction, - uint32 ssrc_key); - bool ConfigureReceiving(int channel_id, uint32 remote_ssrc_key); - bool ConfigureSending(int channel_id, uint32 local_ssrc_key); - bool SetNackFec(int channel_id, int red_payload_type, int fec_payload_type, - bool nack_enabled); - bool SetSendCodec(const webrtc::VideoCodec& codec); - bool SetSendCodec(WebRtcVideoChannelSendInfo* send_channel, - const webrtc::VideoCodec& codec); - void LogSendCodecChange(const std::string& reason); - // Prepares the channel with channel id |info->channel_id()| to receive all - // codecs in |receive_codecs_| and start receive packets. - bool SetReceiveCodecs(WebRtcVideoChannelRecvInfo* info); - // Returns the channel number that receives the stream with SSRC |ssrc|. - int GetRecvChannelNum(uint32 ssrc); - // Given captured video frame size, checks if we need to reset vie send codec. - // |reset| is set to whether resetting has happened on vie or not. - // Returns false on error. - bool MaybeResetVieSendCodec(WebRtcVideoChannelSendInfo* send_channel, - int new_width, int new_height, bool is_screencast, - bool* reset); - // Checks the current bitrate estimate and modifies the bitrates - // accordingly, including converting kAutoBandwidth to the correct defaults. - void MaybeChangeBitrates(int channel_id, webrtc::VideoCodec* video_codec); - // Helper function for starting the sending of media on all channels or - // |channel_id|. Note that these two function do not change |sending_|. - bool StartSend(); - bool StartSend(WebRtcVideoChannelSendInfo* send_channel); - // Helper function for stop the sending of media on all channels or - // |channel_id|. Note that these two function do not change |sending_|. - bool StopSend(); - bool StopSend(WebRtcVideoChannelSendInfo* send_channel); - bool SendIntraFrame(int channel_id); - - bool HasReadySendChannels(); - - // Send channel key returns the key corresponding to the provided local SSRC - // in |key|. The return value is true upon success. - // If the local ssrc correspond to that of the default channel the key is 0. - // For all other channels the returned key will be the same as the local ssrc. - bool GetSendChannelKey(uint32 local_ssrc, uint32* key); - WebRtcVideoChannelSendInfo* GetSendChannel(uint32 local_ssrc); - // Creates a new unique key that can be used for inserting a new send channel - // into |send_channels_| - bool CreateSendChannelKey(uint32 local_ssrc, uint32* key); - // Get the number of the send channels |capturer| registered with. - int GetSendChannelNum(VideoCapturer* capturer); - - bool IsDefaultChannel(int channel_id) const { - return channel_id == vie_channel_; - } - - bool DeleteSendChannel(uint32 ssrc_key); - - bool InConferenceMode() const { - return options_.conference_mode.GetWithDefaultIfUnset(false); - } - bool RemoveCapturer(uint32 ssrc); - - - talk_base::MessageQueue* worker_thread() { return engine_->worker_thread(); } - void QueueBlackFrame(uint32 ssrc, int64 timestamp, int framerate); - void FlushBlackFrame(uint32 ssrc, int64 timestamp); - - void SetNetworkTransmissionState(bool is_transmitting); - - bool SetHeaderExtension(ExtensionSetterFunction setter, int channel_id, - const RtpHeaderExtension* extension); - bool SetHeaderExtension(ExtensionSetterFunction setter, int channel_id, - const std::vector& extensions, - const char header_extension_uri[]); - - // Signal when cpu adaptation has no further scope to adapt. - void OnCpuAdaptationUnable(); - - // Set the local (send-side) RTX SSRC corresponding to primary_ssrc. - bool SetLocalRtxSsrc(int channel_id, const StreamParams& send_params, - uint32 primary_ssrc, int stream_idx); - - // Connect |capturer| to WebRtcVideoMediaChannel if it is only registered - // to one send channel, i.e. the first send channel. - void MaybeConnectCapturer(VideoCapturer* capturer); - // Disconnect |capturer| from WebRtcVideoMediaChannel if it is only registered - // to one send channel, i.e. the last send channel. - void MaybeDisconnectCapturer(VideoCapturer* capturer); - - bool RemoveRecvStreamInternal(uint32 ssrc); - - // Global state. - WebRtcVideoEngine* engine_; - VoiceMediaChannel* voice_channel_; - int vie_channel_; - bool nack_enabled_; - // Receiver Estimated Max Bitrate - bool remb_enabled_; - VideoOptions options_; - - // Global recv side state. - // Note the default channel (vie_channel_), i.e. the send channel - // corresponding to all the receive channels (this must be done for REMB to - // work properly), resides in both recv_channels_ and send_channels_ with the - // ssrc key 0. - RecvChannelMap recv_channels_; // Contains all receive channels. - // A map from the SSRCs on which RTX packets are received to the media SSRCs - // the RTX packets are associated with. RTX packets will be delivered to the - // streams matching the primary SSRC. - SsrcMap rtx_to_primary_ssrc_; - std::vector receive_codecs_; - // A map from codec payload types to their associated payload types, if any. - // TODO(holmer): This is a temporary solution until webrtc::VideoCodec has - // an associated payload type member, when it does we can rely on - // receive_codecs_. - std::map associated_payload_types_; - bool render_started_; - uint32 first_receive_ssrc_; - std::vector receive_extensions_; - int num_unsignalled_recv_channels_; - - // Global send side state. - SendChannelMap send_channels_; - talk_base::scoped_ptr send_codec_; - int send_rtx_type_; - int send_red_type_; - int send_fec_type_; - bool sending_; - std::vector send_extensions_; - - // The aspect ratio that the channel desires. 0 means there is no desired - // aspect ratio - int ratio_w_; - int ratio_h_; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_WEBRTCVIDEOENGINE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvideoengine2.h b/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvideoengine2.h deleted file mode 100755 index 1b1f87b..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvideoengine2.h +++ /dev/null @@ -1,332 +0,0 @@ -/* - * 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_WEBRTC_WEBRTCVIDEOENGINE2_H_ -#define TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_H_ - -#include -#include -#include - -#include "talk/base/cpumonitor.h" -#include "talk/base/scoped_ptr.h" -#include "talk/media/base/mediaengine.h" -#include "talk/media/webrtc/webrtcvideochannelfactory.h" -#include "webrtc/common_video/interface/i420_video_frame.h" -#include "webrtc/system_wrappers/interface/thread_annotations.h" -#include "webrtc/transport.h" -#include "webrtc/video_renderer.h" -#include "webrtc/video_send_stream.h" - -namespace webrtc { -class Call; -class VideoCaptureModule; -class VideoDecoder; -class VideoEncoder; -class VideoRender; -class VideoSendStreamInput; -class VideoReceiveStream; -} - -namespace talk_base { -class CpuMonitor; -class Thread; -} // namespace talk_base - -namespace cricket { - -class VideoCapturer; -class VideoFrame; -class VideoProcessor; -class VideoRenderer; -class VoiceMediaChannel; -class WebRtcVideoChannel2; -class WebRtcDecoderObserver; -class WebRtcEncoderObserver; -class WebRtcLocalStreamInfo; -class WebRtcRenderAdapter; -class WebRtcVideoChannelRecvInfo; -class WebRtcVideoChannelSendInfo; -class WebRtcVideoDecoderFactory; -class WebRtcVoiceEngine; - -struct CapturedFrame; -struct Device; - -class WebRtcVideoEngine2; -class WebRtcVideoChannel2; - -class WebRtcVideoEncoderFactory2 { - public: - virtual bool CreateEncoderSettings( - webrtc::VideoSendStream::Config::EncoderSettings* encoder_settings, - const VideoOptions& options, - const cricket::VideoCodec& codec, - size_t num_streams) = 0; - virtual bool SupportsCodec(const cricket::VideoCodec& codec) = 0; -}; - -// WebRtcVideoEngine2 is used for the new native WebRTC Video API (webrtc:1667). -class WebRtcVideoEngine2 : public sigslot::has_slots<> { - public: - // Creates the WebRtcVideoEngine2 with internal VideoCaptureModule. - WebRtcVideoEngine2(); - // Custom WebRtcVideoChannelFactory for testing purposes. - explicit WebRtcVideoEngine2(WebRtcVideoChannelFactory* channel_factory); - ~WebRtcVideoEngine2(); - - // Basic video engine implementation. - bool Init(talk_base::Thread* worker_thread); - void Terminate(); - - int GetCapabilities(); - bool SetOptions(const VideoOptions& options); - bool SetDefaultEncoderConfig(const VideoEncoderConfig& config); - VideoEncoderConfig GetDefaultEncoderConfig() const; - - WebRtcVideoChannel2* CreateChannel(VoiceMediaChannel* voice_channel); - - const std::vector& codecs() const; - const std::vector& rtp_header_extensions() const; - void SetLogging(int min_sev, const char* filter); - - bool EnableTimedRender(); - // No-op, never used. - bool SetLocalRenderer(VideoRenderer* renderer); - // This is currently ignored. - sigslot::repeater2 SignalCaptureStateChange; - - // Set the VoiceEngine for A/V sync. This can only be called before Init. - bool SetVoiceEngine(WebRtcVoiceEngine* voice_engine); - - // Functions called by WebRtcVideoChannel2. - const VideoFormat& default_codec_format() const { - return default_codec_format_; - } - - bool FindCodec(const VideoCodec& in); - bool CanSendCodec(const VideoCodec& in, - const VideoCodec& current, - VideoCodec* out); - // Check whether the supplied trace should be ignored. - bool ShouldIgnoreTrace(const std::string& trace); - - VideoFormat GetStartCaptureFormat() const { return default_codec_format_; } - - talk_base::CpuMonitor* cpu_monitor() { return cpu_monitor_.get(); } - - virtual WebRtcVideoEncoderFactory2* GetDefaultVideoEncoderFactory() const; - - private: - void Construct(WebRtcVideoChannelFactory* channel_factory, - WebRtcVoiceEngine* voice_engine, - talk_base::CpuMonitor* cpu_monitor); - - talk_base::Thread* worker_thread_; - WebRtcVoiceEngine* voice_engine_; - std::vector video_codecs_; - std::vector rtp_header_extensions_; - VideoFormat default_codec_format_; - - bool initialized_; - - bool capture_started_; - - // Critical section to protect the media processor register/unregister - // while processing a frame - talk_base::CriticalSection signal_media_critical_; - - talk_base::scoped_ptr cpu_monitor_; - WebRtcVideoChannelFactory* channel_factory_; -}; - -// Adapter between webrtc::VideoRenderer and cricket::VideoRenderer. -// The webrtc::VideoRenderer is set once, whereas the cricket::VideoRenderer can -// be set after initialization. This adapter will also convert the incoming -// webrtc::I420VideoFrame to a frame type that cricket::VideoRenderer can -// render. -class WebRtcVideoRenderer : public webrtc::VideoRenderer { - public: - WebRtcVideoRenderer(); - - virtual void RenderFrame(const webrtc::I420VideoFrame& frame, - int time_to_render_ms) OVERRIDE; - - void SetRenderer(cricket::VideoRenderer* renderer); - cricket::VideoRenderer* GetRenderer(); - - private: - void SetSize(int width, int height); - int last_width_; - int last_height_; - talk_base::CriticalSection lock_; - cricket::VideoRenderer* renderer_ GUARDED_BY(lock_); -}; - -class WebRtcVideoChannel2 : public talk_base::MessageHandler, - public VideoMediaChannel, - public webrtc::newapi::Transport { - public: - WebRtcVideoChannel2(WebRtcVideoEngine2* engine, - VoiceMediaChannel* voice_channel, - WebRtcVideoEncoderFactory2* encoder_factory); - // For testing purposes insert a pre-constructed call to verify that - // WebRtcVideoChannel2 calls the correct corresponding methods. - WebRtcVideoChannel2(webrtc::Call* call, - WebRtcVideoEngine2* engine, - WebRtcVideoEncoderFactory2* encoder_factory); - ~WebRtcVideoChannel2(); - bool Init(); - - // VideoMediaChannel implementation - virtual bool SetRecvCodecs(const std::vector& codecs) OVERRIDE; - virtual bool SetSendCodecs(const std::vector& codecs) OVERRIDE; - virtual bool GetSendCodec(VideoCodec* send_codec) OVERRIDE; - virtual bool SetSendStreamFormat(uint32 ssrc, - const VideoFormat& format) OVERRIDE; - virtual bool SetRender(bool render) OVERRIDE; - virtual bool SetSend(bool send) OVERRIDE; - - virtual bool AddSendStream(const StreamParams& sp) OVERRIDE; - virtual bool RemoveSendStream(uint32 ssrc) OVERRIDE; - virtual bool AddRecvStream(const StreamParams& sp) OVERRIDE; - virtual bool RemoveRecvStream(uint32 ssrc) OVERRIDE; - virtual bool SetRenderer(uint32 ssrc, VideoRenderer* renderer) OVERRIDE; - virtual bool GetStats(const StatsOptions& options, - VideoMediaInfo* info) OVERRIDE; - virtual bool SetCapturer(uint32 ssrc, VideoCapturer* capturer) OVERRIDE; - virtual bool SendIntraFrame() OVERRIDE; - virtual bool RequestIntraFrame() OVERRIDE; - - virtual void OnPacketReceived(talk_base::Buffer* packet, - const talk_base::PacketTime& packet_time) - OVERRIDE; - virtual void OnRtcpReceived(talk_base::Buffer* packet, - const talk_base::PacketTime& packet_time) - OVERRIDE; - virtual void OnReadyToSend(bool ready) OVERRIDE; - virtual bool MuteStream(uint32 ssrc, bool mute) OVERRIDE; - virtual bool SetRecvRtpHeaderExtensions( - const std::vector& extensions) OVERRIDE; - virtual bool SetSendRtpHeaderExtensions( - const std::vector& extensions) OVERRIDE; - virtual bool SetStartSendBandwidth(int bps) OVERRIDE; - virtual bool SetMaxSendBandwidth(int bps) OVERRIDE; - virtual bool SetOptions(const VideoOptions& options) OVERRIDE; - virtual bool GetOptions(VideoOptions* options) const OVERRIDE { - *options = options_; - return true; - } - virtual void SetInterface(NetworkInterface* iface) OVERRIDE; - virtual void UpdateAspectRatio(int ratio_w, int ratio_h) OVERRIDE; - - virtual void OnMessage(talk_base::Message* msg) OVERRIDE; - - // Implemented for VideoMediaChannelTest. - bool sending() const { return sending_; } - uint32 GetDefaultChannelSsrc() { return default_send_ssrc_; } - bool GetRenderer(uint32 ssrc, VideoRenderer** renderer); - - private: - struct VideoCodecSettings { - VideoCodecSettings(); - - cricket::VideoCodec codec; - webrtc::FecConfig fec; - int rtx_payload_type; - }; - - class WebRtcVideoSendStream : public sigslot::has_slots<> { - public: - WebRtcVideoSendStream(webrtc::Call* call, - const webrtc::VideoSendStream::Config& config, - WebRtcVideoEncoderFactory2* encoder_factory); - ~WebRtcVideoSendStream(); - void SetCodec(const VideoOptions& options, const VideoCodecSettings& codec); - - void InputFrame(VideoCapturer* capturer, const VideoFrame* frame); - bool SetCapturer(VideoCapturer* capturer); - bool SetVideoFormat(const VideoFormat& format); - bool MuteStream(bool mute); - bool DisconnectCapturer(); - - void Start(); - void Stop(); - - private: - void RecreateWebRtcStream(); - void SetDimensions(int width, int height); - - webrtc::Call* const call_; - WebRtcVideoEncoderFactory2* const encoder_factory_; - - talk_base::CriticalSection lock_; - webrtc::VideoSendStream* stream_ GUARDED_BY(lock_); - webrtc::VideoSendStream::Config config_ GUARDED_BY(lock_); - VideoCapturer* capturer_ GUARDED_BY(lock_); - bool sending_ GUARDED_BY(lock_); - bool muted_ GUARDED_BY(lock_); - VideoFormat format_ GUARDED_BY(lock_); - - talk_base::CriticalSection frame_lock_; - webrtc::I420VideoFrame video_frame_ GUARDED_BY(frame_lock_); - }; - - void Construct(webrtc::Call* call, WebRtcVideoEngine2* engine); - - virtual bool SendRtp(const uint8_t* data, size_t len) OVERRIDE; - virtual bool SendRtcp(const uint8_t* data, size_t len) OVERRIDE; - - void StartAllSendStreams(); - void StopAllSendStreams(); - void SetCodecForAllSendStreams(const VideoCodecSettings& codec); - static std::vector MapCodecs( - const std::vector& codecs); - std::vector FilterSupportedCodecs( - const std::vector& mapped_codecs); - - uint32_t rtcp_receiver_report_ssrc_; - bool sending_; - talk_base::scoped_ptr call_; - std::map renderers_; - VideoRenderer* default_renderer_; - uint32_t default_send_ssrc_; - uint32_t default_recv_ssrc_; - - // Using primary-ssrc (first ssrc) as key. - std::map send_streams_; - std::map receive_streams_; - - Settable send_codec_; - WebRtcVideoEncoderFactory2* const encoder_factory_; - std::vector recv_codecs_; - VideoOptions options_; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvideoframe.h b/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvideoframe.h deleted file mode 100755 index 51fb0a4..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvideoframe.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - * 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_MEDIA_WEBRTCVIDEOFRAME_H_ -#define TALK_MEDIA_WEBRTCVIDEOFRAME_H_ - -#include "talk/base/buffer.h" -#include "talk/base/refcount.h" -#include "talk/base/scoped_ref_ptr.h" -#include "talk/media/base/videoframe.h" -#include "webrtc/common_types.h" -#include "webrtc/modules/interface/module_common_types.h" - -namespace cricket { - -struct CapturedFrame; - -class WebRtcVideoFrame : public VideoFrame { - public: - WebRtcVideoFrame(); - ~WebRtcVideoFrame(); - - // Creates a frame from a raw sample with FourCC "format" and size "w" x "h". - // "h" can be negative indicating a vertically flipped image. - // "dh" is destination height if cropping is desired and is always positive. - // Returns "true" if successful. - bool Init(uint32 format, int w, int h, int dw, int dh, uint8* sample, - size_t sample_size, size_t pixel_width, size_t pixel_height, - int64 elapsed_time, int64 time_stamp, int rotation); - - bool Init(const CapturedFrame* frame, int dw, int dh); - - // Aliases this WebRtcVideoFrame to a CapturedFrame. |frame| must outlive - // this WebRtcVideoFrame. - bool Alias(const CapturedFrame* frame, int dw, int dh); - - bool InitToBlack(int w, int h, size_t pixel_width, size_t pixel_height, - int64 elapsed_time, int64 time_stamp); - - // Aliases this WebRtcVideoFrame to a memory buffer. |buffer| must outlive - // this WebRtcVideoFrame. - void Alias(uint8* buffer, size_t buffer_size, int w, int h, - size_t pixel_width, size_t pixel_height, int64 elapsed_time, - int64 time_stamp, int rotation); - - webrtc::VideoFrame* frame(); - const webrtc::VideoFrame* frame() const; - - // From base class VideoFrame. - virtual bool Reset(uint32 format, int w, int h, int dw, int dh, uint8* sample, - size_t sample_size, size_t pixel_width, - size_t pixel_height, int64 elapsed_time, int64 time_stamp, - int rotation); - - virtual size_t GetWidth() const; - virtual size_t GetHeight() const; - virtual const uint8* GetYPlane() const; - virtual const uint8* GetUPlane() const; - virtual const uint8* GetVPlane() const; - virtual uint8* GetYPlane(); - virtual uint8* GetUPlane(); - virtual uint8* GetVPlane(); - virtual int32 GetYPitch() const { return frame()->Width(); } - virtual int32 GetUPitch() const { return (frame()->Width() + 1) / 2; } - virtual int32 GetVPitch() const { return (frame()->Width() + 1) / 2; } - virtual void* GetNativeHandle() const { return NULL; } - - virtual size_t GetPixelWidth() const { return pixel_width_; } - virtual size_t GetPixelHeight() const { return pixel_height_; } - virtual int64 GetElapsedTime() const { return elapsed_time_; } - virtual int64 GetTimeStamp() const { return time_stamp_; } - virtual void SetElapsedTime(int64 elapsed_time) { - elapsed_time_ = elapsed_time; - } - virtual void SetTimeStamp(int64 time_stamp) { time_stamp_ = time_stamp; } - - virtual int GetRotation() const { return rotation_; } - - virtual VideoFrame* Copy() const; - virtual bool MakeExclusive(); - virtual size_t CopyToBuffer(uint8* buffer, size_t size) const; - virtual size_t ConvertToRgbBuffer(uint32 to_fourcc, uint8* buffer, - size_t size, int stride_rgb) const; - - private: - class FrameBuffer; - typedef talk_base::RefCountedObject RefCountedBuffer; - - void Attach(RefCountedBuffer* video_buffer, size_t buffer_size, int w, int h, - size_t pixel_width, size_t pixel_height, int64 elapsed_time, - int64 time_stamp, int rotation); - - virtual VideoFrame* CreateEmptyFrame(int w, int h, size_t pixel_width, - size_t pixel_height, int64 elapsed_time, - int64 time_stamp) const; - void InitToEmptyBuffer(int w, int h, size_t pixel_width, size_t pixel_height, - int64 elapsed_time, int64 time_stamp); - - talk_base::scoped_refptr video_buffer_; - bool is_black_; - size_t pixel_width_; - size_t pixel_height_; - int64 elapsed_time_; - int64 time_stamp_; - int rotation_; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_WEBRTCVIDEOFRAME_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvie.h b/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvie.h deleted file mode 100755 index 1b2fe1a..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvie.h +++ /dev/null @@ -1,151 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_WEBRTCVIE_H_ -#define TALK_MEDIA_WEBRTCVIE_H_ - -#include "talk/base/common.h" -#include "talk/media/webrtc/webrtccommon.h" -#include "webrtc/common_types.h" -#include "webrtc/modules/interface/module_common_types.h" -#include "webrtc/modules/video_capture/include/video_capture.h" -#include "webrtc/modules/video_coding/codecs/interface/video_codec_interface.h" -#include "webrtc/modules/video_render/include/video_render.h" -#include "webrtc/video_engine/include/vie_base.h" -#include "webrtc/video_engine/include/vie_capture.h" -#include "webrtc/video_engine/include/vie_codec.h" -#include "webrtc/video_engine/include/vie_errors.h" -#include "webrtc/video_engine/include/vie_external_codec.h" -#include "webrtc/video_engine/include/vie_image_process.h" -#include "webrtc/video_engine/include/vie_network.h" -#include "webrtc/video_engine/include/vie_render.h" -#include "webrtc/video_engine/include/vie_rtp_rtcp.h" - -namespace cricket { - -// all tracing macros should go to a common file - -// automatically handles lifetime of VideoEngine -class scoped_vie_engine { - public: - explicit scoped_vie_engine(webrtc::VideoEngine* e) : ptr(e) {} - // VERIFY, to ensure that there are no leaks at shutdown - ~scoped_vie_engine() { - if (ptr) { - webrtc::VideoEngine::Delete(ptr); - } - } - webrtc::VideoEngine* get() const { return ptr; } - private: - webrtc::VideoEngine* ptr; -}; - -// scoped_ptr class to handle obtaining and releasing VideoEngine -// interface pointers -template class scoped_vie_ptr { - public: - explicit scoped_vie_ptr(const scoped_vie_engine& e) - : ptr(T::GetInterface(e.get())) {} - explicit scoped_vie_ptr(T* p) : ptr(p) {} - ~scoped_vie_ptr() { if (ptr) ptr->Release(); } - T* operator->() const { return ptr; } - T* get() const { return ptr; } - private: - T* ptr; -}; - -// Utility class for aggregating the various WebRTC interface. -// Fake implementations can also be injected for testing. -class ViEWrapper { - public: - ViEWrapper() - : engine_(webrtc::VideoEngine::Create()), - base_(engine_), codec_(engine_), capture_(engine_), - network_(engine_), render_(engine_), rtp_(engine_), - image_(engine_), ext_codec_(engine_) { - } - - ViEWrapper(webrtc::ViEBase* base, webrtc::ViECodec* codec, - webrtc::ViECapture* capture, webrtc::ViENetwork* network, - webrtc::ViERender* render, webrtc::ViERTP_RTCP* rtp, - webrtc::ViEImageProcess* image, - webrtc::ViEExternalCodec* ext_codec) - : engine_(NULL), - base_(base), - codec_(codec), - capture_(capture), - network_(network), - render_(render), - rtp_(rtp), - image_(image), - ext_codec_(ext_codec) { - } - - virtual ~ViEWrapper() {} - webrtc::VideoEngine* engine() { return engine_.get(); } - webrtc::ViEBase* base() { return base_.get(); } - webrtc::ViECodec* codec() { return codec_.get(); } - webrtc::ViECapture* capture() { return capture_.get(); } - webrtc::ViENetwork* network() { return network_.get(); } - webrtc::ViERender* render() { return render_.get(); } - webrtc::ViERTP_RTCP* rtp() { return rtp_.get(); } - webrtc::ViEImageProcess* image() { return image_.get(); } - webrtc::ViEExternalCodec* ext_codec() { return ext_codec_.get(); } - int error() { return base_->LastError(); } - - private: - scoped_vie_engine engine_; - scoped_vie_ptr base_; - scoped_vie_ptr codec_; - scoped_vie_ptr capture_; - scoped_vie_ptr network_; - scoped_vie_ptr render_; - scoped_vie_ptr rtp_; - scoped_vie_ptr image_; - scoped_vie_ptr ext_codec_; -}; - -// Adds indirection to static WebRtc functions, allowing them to be mocked. -class ViETraceWrapper { - public: - virtual ~ViETraceWrapper() {} - - virtual int SetTraceFilter(const unsigned int filter) { - return webrtc::VideoEngine::SetTraceFilter(filter); - } - virtual int SetTraceFile(const char* fileNameUTF8) { - return webrtc::VideoEngine::SetTraceFile(fileNameUTF8); - } - virtual int SetTraceCallback(webrtc::TraceCallback* callback) { - return webrtc::VideoEngine::SetTraceCallback(callback); - } -}; - -} // namespace cricket - -#endif // TALK_MEDIA_WEBRTCVIE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvoe.h b/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvoe.h deleted file mode 100755 index c0cb698..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvoe.h +++ /dev/null @@ -1,179 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_WEBRTCVOE_H_ -#define TALK_MEDIA_WEBRTCVOE_H_ - -#include "talk/base/common.h" -#include "talk/media/webrtc/webrtccommon.h" - -#include "webrtc/common_types.h" -#include "webrtc/modules/audio_device/include/audio_device.h" -#include "webrtc/voice_engine/include/voe_audio_processing.h" -#include "webrtc/voice_engine/include/voe_base.h" -#include "webrtc/voice_engine/include/voe_codec.h" -#include "webrtc/voice_engine/include/voe_dtmf.h" -#include "webrtc/voice_engine/include/voe_errors.h" -#include "webrtc/voice_engine/include/voe_external_media.h" -#include "webrtc/voice_engine/include/voe_file.h" -#include "webrtc/voice_engine/include/voe_hardware.h" -#include "webrtc/voice_engine/include/voe_neteq_stats.h" -#include "webrtc/voice_engine/include/voe_network.h" -#include "webrtc/voice_engine/include/voe_rtp_rtcp.h" -#include "webrtc/voice_engine/include/voe_video_sync.h" -#include "webrtc/voice_engine/include/voe_volume_control.h" - -namespace cricket { -// automatically handles lifetime of WebRtc VoiceEngine -class scoped_voe_engine { - public: - explicit scoped_voe_engine(webrtc::VoiceEngine* e) : ptr(e) {} - // VERIFY, to ensure that there are no leaks at shutdown - ~scoped_voe_engine() { if (ptr) VERIFY(webrtc::VoiceEngine::Delete(ptr)); } - // Releases the current pointer. - void reset() { - if (ptr) { - VERIFY(webrtc::VoiceEngine::Delete(ptr)); - ptr = NULL; - } - } - webrtc::VoiceEngine* get() const { return ptr; } - private: - webrtc::VoiceEngine* ptr; -}; - -// scoped_ptr class to handle obtaining and releasing WebRTC interface pointers -template -class scoped_voe_ptr { - public: - explicit scoped_voe_ptr(const scoped_voe_engine& e) - : ptr(T::GetInterface(e.get())) {} - explicit scoped_voe_ptr(T* p) : ptr(p) {} - ~scoped_voe_ptr() { if (ptr) ptr->Release(); } - T* operator->() const { return ptr; } - T* get() const { return ptr; } - - // Releases the current pointer. - void reset() { - if (ptr) { - ptr->Release(); - ptr = NULL; - } - } - - private: - T* ptr; -}; - -// Utility class for aggregating the various WebRTC interface. -// Fake implementations can also be injected for testing. -class VoEWrapper { - public: - VoEWrapper() - : engine_(webrtc::VoiceEngine::Create()), processing_(engine_), - base_(engine_), codec_(engine_), dtmf_(engine_), file_(engine_), - hw_(engine_), media_(engine_), neteq_(engine_), network_(engine_), - rtp_(engine_), sync_(engine_), volume_(engine_) { - } - VoEWrapper(webrtc::VoEAudioProcessing* processing, - webrtc::VoEBase* base, - webrtc::VoECodec* codec, - webrtc::VoEDtmf* dtmf, - webrtc::VoEFile* file, - webrtc::VoEHardware* hw, - webrtc::VoEExternalMedia* media, - webrtc::VoENetEqStats* neteq, - webrtc::VoENetwork* network, - webrtc::VoERTP_RTCP* rtp, - webrtc::VoEVideoSync* sync, - webrtc::VoEVolumeControl* volume) - : engine_(NULL), - processing_(processing), - base_(base), - codec_(codec), - dtmf_(dtmf), - file_(file), - hw_(hw), - media_(media), - neteq_(neteq), - network_(network), - rtp_(rtp), - sync_(sync), - volume_(volume) { - } - ~VoEWrapper() {} - webrtc::VoiceEngine* engine() const { return engine_.get(); } - webrtc::VoEAudioProcessing* processing() const { return processing_.get(); } - webrtc::VoEBase* base() const { return base_.get(); } - webrtc::VoECodec* codec() const { return codec_.get(); } - webrtc::VoEDtmf* dtmf() const { return dtmf_.get(); } - webrtc::VoEFile* file() const { return file_.get(); } - webrtc::VoEHardware* hw() const { return hw_.get(); } - webrtc::VoEExternalMedia* media() const { return media_.get(); } - webrtc::VoENetEqStats* neteq() const { return neteq_.get(); } - webrtc::VoENetwork* network() const { return network_.get(); } - webrtc::VoERTP_RTCP* rtp() const { return rtp_.get(); } - webrtc::VoEVideoSync* sync() const { return sync_.get(); } - webrtc::VoEVolumeControl* volume() const { return volume_.get(); } - int error() { return base_->LastError(); } - - private: - scoped_voe_engine engine_; - scoped_voe_ptr processing_; - scoped_voe_ptr base_; - scoped_voe_ptr codec_; - scoped_voe_ptr dtmf_; - scoped_voe_ptr file_; - scoped_voe_ptr hw_; - scoped_voe_ptr media_; - scoped_voe_ptr neteq_; - scoped_voe_ptr network_; - scoped_voe_ptr rtp_; - scoped_voe_ptr sync_; - scoped_voe_ptr volume_; -}; - -// Adds indirection to static WebRtc functions, allowing them to be mocked. -class VoETraceWrapper { - public: - virtual ~VoETraceWrapper() {} - - virtual int SetTraceFilter(const unsigned int filter) { - return webrtc::VoiceEngine::SetTraceFilter(filter); - } - virtual int SetTraceFile(const char* fileNameUTF8) { - return webrtc::VoiceEngine::SetTraceFile(fileNameUTF8); - } - virtual int SetTraceCallback(webrtc::TraceCallback* callback) { - return webrtc::VoiceEngine::SetTraceCallback(callback); - } -}; - -} // namespace cricket - -#endif // TALK_MEDIA_WEBRTCVOE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvoiceengine.h b/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvoiceengine.h deleted file mode 100755 index bf27085..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/media/webrtc/webrtcvoiceengine.h +++ /dev/null @@ -1,464 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_WEBRTCVOICEENGINE_H_ -#define TALK_MEDIA_WEBRTCVOICEENGINE_H_ - -#include -#include -#include -#include - -#include "talk/base/buffer.h" -#include "talk/base/byteorder.h" -#include "talk/base/logging.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/stream.h" -#include "talk/media/base/rtputils.h" -#include "talk/media/webrtc/webrtccommon.h" -#include "talk/media/webrtc/webrtcexport.h" -#include "talk/media/webrtc/webrtcvoe.h" -#include "talk/session/media/channel.h" -#include "webrtc/common.h" - -#if !defined(LIBPEERCONNECTION_LIB) && \ - !defined(LIBPEERCONNECTION_IMPLEMENTATION) -#error "Bogus include." -#endif - -namespace cricket { - -// WebRtcSoundclipStream is an adapter object that allows a memory stream to be -// passed into WebRtc, and support looping. -class WebRtcSoundclipStream : public webrtc::InStream { - public: - WebRtcSoundclipStream(const char* buf, size_t len) - : mem_(buf, len), loop_(true) { - } - void set_loop(bool loop) { loop_ = loop; } - virtual int Read(void* buf, int len); - virtual int Rewind(); - - private: - talk_base::MemoryStream mem_; - bool loop_; -}; - -// WebRtcMonitorStream is used to monitor a stream coming from WebRtc. -// For now we just dump the data. -class WebRtcMonitorStream : public webrtc::OutStream { - virtual bool Write(const void *buf, int len) { - return true; - } -}; - -class AudioDeviceModule; -class AudioRenderer; -class VoETraceWrapper; -class VoEWrapper; -class VoiceProcessor; -class WebRtcSoundclipMedia; -class WebRtcVoiceMediaChannel; - -// WebRtcVoiceEngine is a class to be used with CompositeMediaEngine. -// It uses the WebRtc VoiceEngine library for audio handling. -class WebRtcVoiceEngine - : public webrtc::VoiceEngineObserver, - public webrtc::TraceCallback, - public webrtc::VoEMediaProcess { - public: - WebRtcVoiceEngine(); - // Dependency injection for testing. - WebRtcVoiceEngine(VoEWrapper* voe_wrapper, - VoEWrapper* voe_wrapper_sc, - VoETraceWrapper* tracing); - ~WebRtcVoiceEngine(); - bool Init(talk_base::Thread* worker_thread); - void Terminate(); - - int GetCapabilities(); - VoiceMediaChannel* CreateChannel(); - - SoundclipMedia* CreateSoundclip(); - - AudioOptions GetOptions() const { return options_; } - bool SetOptions(const AudioOptions& options); - // Overrides, when set, take precedence over the options on a - // per-option basis. For example, if AGC is set in options and AEC - // is set in overrides, AGC and AEC will be both be set. Overrides - // can also turn off options. For example, if AGC is set to "on" in - // options and AGC is set to "off" in overrides, the result is that - // AGC will be off until different overrides are applied or until - // the overrides are cleared. Only one set of overrides is present - // at a time (they do not "stack"). And when the overrides are - // cleared, the media engine's state reverts back to the options set - // via SetOptions. This allows us to have both "persistent options" - // (the normal options) and "temporary options" (overrides). - bool SetOptionOverrides(const AudioOptions& options); - bool ClearOptionOverrides(); - bool SetDelayOffset(int offset); - bool SetDevices(const Device* in_device, const Device* out_device); - bool GetOutputVolume(int* level); - bool SetOutputVolume(int level); - int GetInputLevel(); - bool SetLocalMonitor(bool enable); - - const std::vector& codecs(); - bool FindCodec(const AudioCodec& codec); - bool FindWebRtcCodec(const AudioCodec& codec, webrtc::CodecInst* gcodec); - - const std::vector& rtp_header_extensions() const; - - void SetLogging(int min_sev, const char* filter); - - bool RegisterProcessor(uint32 ssrc, - VoiceProcessor* voice_processor, - MediaProcessorDirection direction); - bool UnregisterProcessor(uint32 ssrc, - VoiceProcessor* voice_processor, - MediaProcessorDirection direction); - - // Method from webrtc::VoEMediaProcess - virtual void Process(int channel, - webrtc::ProcessingTypes type, - int16_t audio10ms[], - int length, - int sampling_freq, - bool is_stereo); - - // For tracking WebRtc channels. Needed because we have to pause them - // all when switching devices. - // May only be called by WebRtcVoiceMediaChannel. - void RegisterChannel(WebRtcVoiceMediaChannel *channel); - void UnregisterChannel(WebRtcVoiceMediaChannel *channel); - - // May only be called by WebRtcSoundclipMedia. - void RegisterSoundclip(WebRtcSoundclipMedia *channel); - void UnregisterSoundclip(WebRtcSoundclipMedia *channel); - - // Called by WebRtcVoiceMediaChannel to set a gain offset from - // the default AGC target level. - bool AdjustAgcLevel(int delta); - - VoEWrapper* voe() { return voe_wrapper_.get(); } - VoEWrapper* voe_sc() { return voe_wrapper_sc_.get(); } - int GetLastEngineError(); - - // Set the external ADMs. This can only be called before Init. - bool SetAudioDeviceModule(webrtc::AudioDeviceModule* adm, - webrtc::AudioDeviceModule* adm_sc); - - // Starts AEC dump using existing file. - bool StartAecDump(talk_base::PlatformFile file); - - // Check whether the supplied trace should be ignored. - bool ShouldIgnoreTrace(const std::string& trace); - - // Create a VoiceEngine Channel. - int CreateMediaVoiceChannel(); - int CreateSoundclipVoiceChannel(); - - private: - typedef std::vector SoundclipList; - typedef std::vector ChannelList; - typedef sigslot:: - signal3 FrameSignal; - - void Construct(); - void ConstructCodecs(); - bool InitInternal(); - bool EnsureSoundclipEngineInit(); - void SetTraceFilter(int filter); - void SetTraceOptions(const std::string& options); - // Applies either options or overrides. Every option that is "set" - // will be applied. Every option not "set" will be ignored. This - // allows us to selectively turn on and off different options easily - // at any time. - bool ApplyOptions(const AudioOptions& options); - virtual void Print(webrtc::TraceLevel level, const char* trace, int length); - virtual void CallbackOnError(int channel, int errCode); - // Given the device type, name, and id, find device id. Return true and - // set the output parameter rtc_id if successful. - bool FindWebRtcAudioDeviceId( - bool is_input, const std::string& dev_name, int dev_id, int* rtc_id); - bool FindChannelAndSsrc(int channel_num, - WebRtcVoiceMediaChannel** channel, - uint32* ssrc) const; - bool FindChannelNumFromSsrc(uint32 ssrc, - MediaProcessorDirection direction, - int* channel_num); - bool ChangeLocalMonitor(bool enable); - bool PauseLocalMonitor(); - bool ResumeLocalMonitor(); - - bool UnregisterProcessorChannel(MediaProcessorDirection channel_direction, - uint32 ssrc, - VoiceProcessor* voice_processor, - MediaProcessorDirection processor_direction); - - void StartAecDump(const std::string& filename); - void StopAecDump(); - int CreateVoiceChannel(VoEWrapper* voe); - - // When a voice processor registers with the engine, it is connected - // to either the Rx or Tx signals, based on the direction parameter. - // SignalXXMediaFrame will be invoked for every audio packet. - FrameSignal SignalRxMediaFrame; - FrameSignal SignalTxMediaFrame; - - static const int kDefaultLogSeverity = talk_base::LS_WARNING; - - // The primary instance of WebRtc VoiceEngine. - talk_base::scoped_ptr voe_wrapper_; - // A secondary instance, for playing out soundclips (on the 'ring' device). - talk_base::scoped_ptr voe_wrapper_sc_; - bool voe_wrapper_sc_initialized_; - talk_base::scoped_ptr tracing_; - // The external audio device manager - webrtc::AudioDeviceModule* adm_; - webrtc::AudioDeviceModule* adm_sc_; - int log_filter_; - std::string log_options_; - bool is_dumping_aec_; - std::vector codecs_; - std::vector rtp_header_extensions_; - bool desired_local_monitor_enable_; - talk_base::scoped_ptr monitor_; - SoundclipList soundclips_; - ChannelList channels_; - // channels_ can be read from WebRtc callback thread. We need a lock on that - // callback as well as the RegisterChannel/UnregisterChannel. - talk_base::CriticalSection channels_cs_; - webrtc::AgcConfig default_agc_config_; - - webrtc::Config voe_config_; - - bool initialized_; - // See SetOptions and SetOptionOverrides for a description of the - // difference between options and overrides. - // options_ are the base options, which combined with the - // option_overrides_, create the current options being used. - // options_ is stored so that when option_overrides_ is cleared, we - // can restore the options_ without the option_overrides. - AudioOptions options_; - AudioOptions option_overrides_; - - // When the media processor registers with the engine, the ssrc is cached - // here so that a look up need not be made when the callback is invoked. - // This is necessary because the lookup results in mux_channels_cs lock being - // held and if a remote participant leaves the hangout at the same time - // we hit a deadlock. - uint32 tx_processor_ssrc_; - uint32 rx_processor_ssrc_; - - talk_base::CriticalSection signal_media_critical_; -}; - -// WebRtcMediaChannel is a class that implements the common WebRtc channel -// functionality. -template -class WebRtcMediaChannel : public T, public webrtc::Transport { - public: - WebRtcMediaChannel(E *engine, int channel) - : engine_(engine), voe_channel_(channel) {} - E *engine() { return engine_; } - int voe_channel() const { return voe_channel_; } - bool valid() const { return voe_channel_ != -1; } - - protected: - // implements Transport interface - virtual int SendPacket(int channel, const void *data, int len) { - talk_base::Buffer packet(data, len, kMaxRtpPacketLen); - if (!T::SendPacket(&packet)) { - return -1; - } - return len; - } - - virtual int SendRTCPPacket(int channel, const void *data, int len) { - talk_base::Buffer packet(data, len, kMaxRtpPacketLen); - return T::SendRtcp(&packet) ? len : -1; - } - - private: - E *engine_; - int voe_channel_; -}; - -// WebRtcVoiceMediaChannel is an implementation of VoiceMediaChannel that uses -// WebRtc Voice Engine. -class WebRtcVoiceMediaChannel - : public WebRtcMediaChannel { - public: - explicit WebRtcVoiceMediaChannel(WebRtcVoiceEngine *engine); - virtual ~WebRtcVoiceMediaChannel(); - virtual bool SetOptions(const AudioOptions& options); - virtual bool GetOptions(AudioOptions* options) const { - *options = options_; - return true; - } - virtual bool SetRecvCodecs(const std::vector &codecs); - virtual bool SetSendCodecs(const std::vector &codecs); - virtual bool SetRecvRtpHeaderExtensions( - const std::vector& extensions); - virtual bool SetSendRtpHeaderExtensions( - const std::vector& extensions); - virtual bool SetPlayout(bool playout); - bool PausePlayout(); - bool ResumePlayout(); - virtual bool SetSend(SendFlags send); - bool PauseSend(); - bool ResumeSend(); - virtual bool AddSendStream(const StreamParams& sp); - virtual bool RemoveSendStream(uint32 ssrc); - virtual bool AddRecvStream(const StreamParams& sp); - virtual bool RemoveRecvStream(uint32 ssrc); - virtual bool SetRemoteRenderer(uint32 ssrc, AudioRenderer* renderer); - virtual bool SetLocalRenderer(uint32 ssrc, AudioRenderer* renderer); - virtual bool GetActiveStreams(AudioInfo::StreamList* actives); - virtual int GetOutputLevel(); - virtual int GetTimeSinceLastTyping(); - virtual void SetTypingDetectionParameters(int time_window, - int cost_per_typing, int reporting_threshold, int penalty_decay, - int type_event_delay); - virtual bool SetOutputScaling(uint32 ssrc, double left, double right); - virtual bool GetOutputScaling(uint32 ssrc, double* left, double* right); - - virtual bool SetRingbackTone(const char *buf, int len); - virtual bool PlayRingbackTone(uint32 ssrc, bool play, bool loop); - virtual bool CanInsertDtmf(); - virtual bool InsertDtmf(uint32 ssrc, int event, int duration, int flags); - - virtual void OnPacketReceived(talk_base::Buffer* packet, - const talk_base::PacketTime& packet_time); - virtual void OnRtcpReceived(talk_base::Buffer* packet, - const talk_base::PacketTime& packet_time); - virtual void OnReadyToSend(bool ready) {} - virtual bool MuteStream(uint32 ssrc, bool on); - virtual bool SetStartSendBandwidth(int bps); - virtual bool SetMaxSendBandwidth(int bps); - virtual bool GetStats(VoiceMediaInfo* info); - // Gets last reported error from WebRtc voice engine. This should be only - // called in response a failure. - virtual void GetLastMediaError(uint32* ssrc, - VoiceMediaChannel::Error* error); - bool FindSsrc(int channel_num, uint32* ssrc); - void OnError(uint32 ssrc, int error); - - bool sending() const { return send_ != SEND_NOTHING; } - int GetReceiveChannelNum(uint32 ssrc); - int GetSendChannelNum(uint32 ssrc); - - protected: - int GetLastEngineError() { return engine()->GetLastEngineError(); } - int GetOutputLevel(int channel); - bool GetRedSendCodec(const AudioCodec& red_codec, - const std::vector& all_codecs, - webrtc::CodecInst* send_codec); - bool EnableRtcp(int channel); - bool ResetRecvCodecs(int channel); - bool SetPlayout(int channel, bool playout); - static uint32 ParseSsrc(const void* data, size_t len, bool rtcp); - static Error WebRtcErrorToChannelError(int err_code); - - private: - class WebRtcVoiceChannelRenderer; - // Map of ssrc to WebRtcVoiceChannelRenderer object. A new object of - // WebRtcVoiceChannelRenderer will be created for every new stream and - // will be destroyed when the stream goes away. - typedef std::map ChannelMap; - typedef int (webrtc::VoERTP_RTCP::* ExtensionSetterFunction)(int, bool, - unsigned char); - - void SetNack(int channel, bool nack_enabled); - void SetNack(const ChannelMap& channels, bool nack_enabled); - bool SetSendCodec(const webrtc::CodecInst& send_codec); - bool SetSendCodec(int channel, const webrtc::CodecInst& send_codec); - bool ChangePlayout(bool playout); - bool ChangeSend(SendFlags send); - bool ChangeSend(int channel, SendFlags send); - void ConfigureSendChannel(int channel); - bool ConfigureRecvChannel(int channel); - bool DeleteChannel(int channel); - bool InConferenceMode() const { - return options_.conference_mode.GetWithDefaultIfUnset(false); - } - bool IsDefaultChannel(int channel_id) const { - return channel_id == voe_channel(); - } - bool SetSendCodecs(int channel, const std::vector& codecs); - bool SetSendBandwidthInternal(int bps); - - bool SetHeaderExtension(ExtensionSetterFunction setter, int channel_id, - const RtpHeaderExtension* extension); - - bool SetChannelRecvRtpHeaderExtensions( - int channel_id, - const std::vector& extensions); - bool SetChannelSendRtpHeaderExtensions( - int channel_id, - const std::vector& extensions); - - talk_base::scoped_ptr ringback_tone_; - std::set ringback_channels_; // channels playing ringback - std::vector recv_codecs_; - std::vector send_codecs_; - talk_base::scoped_ptr send_codec_; - bool send_bw_setting_; - int send_bw_bps_; - AudioOptions options_; - bool dtmf_allowed_; - bool desired_playout_; - bool nack_enabled_; - bool playout_; - bool typing_noise_detected_; - SendFlags desired_send_; - SendFlags send_; - - // send_channels_ contains the channels which are being used for sending. - // When the default channel (voe_channel) is used for sending, it is - // contained in send_channels_, otherwise not. - ChannelMap send_channels_; - std::vector send_extensions_; - uint32 default_receive_ssrc_; - // Note the default channel (voe_channel()) can reside in both - // receive_channels_ and send_channels_ in non-conference mode and in that - // case it will only be there if a non-zero default_receive_ssrc_ is set. - ChannelMap receive_channels_; // for multiple sources - // receive_channels_ can be read from WebRtc callback thread. Access from - // the WebRtc thread must be synchronized with edits on the worker thread. - // Reads on the worker thread are ok. - // - std::vector receive_extensions_; - // Do not lock this on the VoE media processor thread; potential for deadlock - // exists. - mutable talk_base::CriticalSection receive_channels_cs_; -}; - -} // namespace cricket - -#endif // TALK_MEDIA_WEBRTCVOICEENGINE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/asyncstuntcpsocket.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/asyncstuntcpsocket.h deleted file mode 100755 index fca75e0..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/asyncstuntcpsocket.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * libjingle - * Copyright 2013, 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_BASE_ASYNCSTUNTCPSOCKET_H_ -#define TALK_BASE_ASYNCSTUNTCPSOCKET_H_ - -#include "talk/base/asynctcpsocket.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/socketfactory.h" - -namespace cricket { - -class AsyncStunTCPSocket : public talk_base::AsyncTCPSocketBase { - public: - // Binds and connects |socket| and creates AsyncTCPSocket for - // it. Takes ownership of |socket|. Returns NULL if bind() or - // connect() fail (|socket| is destroyed in that case). - static AsyncStunTCPSocket* Create( - talk_base::AsyncSocket* socket, - const talk_base::SocketAddress& bind_address, - const talk_base::SocketAddress& remote_address); - - AsyncStunTCPSocket(talk_base::AsyncSocket* socket, bool listen); - virtual ~AsyncStunTCPSocket() {} - - virtual int Send(const void* pv, size_t cb, - const talk_base::PacketOptions& options); - virtual void ProcessInput(char* data, size_t* len); - virtual void HandleIncomingConnection(talk_base::AsyncSocket* socket); - - private: - // This method returns the message hdr + length written in the header. - // This method also returns the number of padding bytes needed/added to the - // turn message. |pad_bytes| should be used only when |is_turn| is true. - size_t GetExpectedLength(const void* data, size_t len, - int* pad_bytes); - - DISALLOW_EVIL_CONSTRUCTORS(AsyncStunTCPSocket); -}; - -} // namespace cricket - -#endif // TALK_BASE_ASYNCSTUNTCPSOCKET_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/basicpacketsocketfactory.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/basicpacketsocketfactory.h deleted file mode 100755 index 031669b..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/basicpacketsocketfactory.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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_BASE_BASICPACKETSOCKETFACTORY_H_ -#define TALK_BASE_BASICPACKETSOCKETFACTORY_H_ - -#include "talk/p2p/base/packetsocketfactory.h" - -namespace talk_base { - -class AsyncSocket; -class SocketFactory; -class Thread; - -class BasicPacketSocketFactory : public PacketSocketFactory { - public: - BasicPacketSocketFactory(); - explicit BasicPacketSocketFactory(Thread* thread); - explicit BasicPacketSocketFactory(SocketFactory* socket_factory); - virtual ~BasicPacketSocketFactory(); - - virtual AsyncPacketSocket* CreateUdpSocket( - const SocketAddress& local_address, int min_port, int max_port); - virtual AsyncPacketSocket* CreateServerTcpSocket( - const SocketAddress& local_address, int min_port, int max_port, int opts); - virtual AsyncPacketSocket* CreateClientTcpSocket( - const SocketAddress& local_address, const SocketAddress& remote_address, - const ProxyInfo& proxy_info, const std::string& user_agent, int opts); - - virtual AsyncResolverInterface* CreateAsyncResolver(); - - private: - int BindSocket(AsyncSocket* socket, const SocketAddress& local_address, - int min_port, int max_port); - - SocketFactory* socket_factory(); - - Thread* thread_; - SocketFactory* socket_factory_; -}; - -} // namespace talk_base - -#endif // TALK_BASE_BASICPACKETSOCKETFACTORY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/candidate.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/candidate.h deleted file mode 100755 index 590d5cf..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/candidate.h +++ /dev/null @@ -1,222 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_BASE_CANDIDATE_H_ -#define TALK_P2P_BASE_CANDIDATE_H_ - -#include -#include - -#include -#include -#include - -#include "talk/base/basictypes.h" -#include "talk/base/socketaddress.h" -#include "talk/p2p/base/constants.h" - -namespace cricket { - -// Candidate for ICE based connection discovery. - -class Candidate { - public: - // TODO: Match the ordering and param list as per RFC 5245 - // candidate-attribute syntax. http://tools.ietf.org/html/rfc5245#section-15.1 - Candidate() : component_(0), priority_(0), generation_(0) {} - Candidate(const std::string& id, int component, const std::string& protocol, - const talk_base::SocketAddress& address, uint32 priority, - const std::string& username, const std::string& password, - const std::string& type, const std::string& network_name, - uint32 generation, const std::string& foundation) - : id_(id), component_(component), protocol_(protocol), address_(address), - priority_(priority), username_(username), password_(password), - type_(type), network_name_(network_name), generation_(generation), - foundation_(foundation) { - } - - const std::string & id() const { return id_; } - void set_id(const std::string & id) { id_ = id; } - - int component() const { return component_; } - void set_component(int component) { component_ = component; } - - const std::string & protocol() const { return protocol_; } - void set_protocol(const std::string & protocol) { protocol_ = protocol; } - - const talk_base::SocketAddress & address() const { return address_; } - void set_address(const talk_base::SocketAddress & address) { - address_ = address; - } - - uint32 priority() const { return priority_; } - void set_priority(const uint32 priority) { priority_ = priority; } - -// void set_type_preference(uint32 type_preference) { -// priority_ = GetPriority(type_preference); -// } - - // Maps old preference (which was 0.0-1.0) to match priority (which - // is 0-2^32-1) to to match RFC 5245, section 4.1.2.1. Also see - // https://docs.google.com/a/google.com/document/d/ - // 1iNQDiwDKMh0NQOrCqbj3DKKRT0Dn5_5UJYhmZO-t7Uc/edit - float preference() const { - // The preference value is clamped to two decimal precision. - return static_cast(((priority_ >> 24) * 100 / 127) / 100.0); - } - - void set_preference(float preference) { - // Limiting priority to UINT_MAX when value exceeds uint32 max. - // This can happen for e.g. when preference = 3. - uint64 prio_val = static_cast(preference * 127) << 24; - priority_ = static_cast( - talk_base::_min(prio_val, static_cast(UINT_MAX))); - } - - const std::string & username() const { return username_; } - void set_username(const std::string & username) { username_ = username; } - - const std::string & password() const { return password_; } - void set_password(const std::string & password) { password_ = password; } - - const std::string & type() const { return type_; } - void set_type(const std::string & type) { type_ = type; } - - const std::string & network_name() const { return network_name_; } - void set_network_name(const std::string & network_name) { - network_name_ = network_name; - } - - // Candidates in a new generation replace those in the old generation. - uint32 generation() const { return generation_; } - void set_generation(uint32 generation) { generation_ = generation; } - const std::string generation_str() const { - std::ostringstream ost; - ost << generation_; - return ost.str(); - } - void set_generation_str(const std::string& str) { - std::istringstream ist(str); - ist >> generation_; - } - - const std::string& foundation() const { - return foundation_; - } - - void set_foundation(const std::string& foundation) { - foundation_ = foundation; - } - - const talk_base::SocketAddress & related_address() const { - return related_address_; - } - void set_related_address( - const talk_base::SocketAddress & related_address) { - related_address_ = related_address; - } - - // Determines whether this candidate is equivalent to the given one. - bool IsEquivalent(const Candidate& c) const { - // We ignore the network name, since that is just debug information, and - // the priority, since that should be the same if the rest is (and it's - // a float so equality checking is always worrisome). - return (id_ == c.id_) && - (component_ == c.component_) && - (protocol_ == c.protocol_) && - (address_ == c.address_) && - (username_ == c.username_) && - (password_ == c.password_) && - (type_ == c.type_) && - (generation_ == c.generation_) && - (foundation_ == c.foundation_) && - (related_address_ == c.related_address_); - } - - std::string ToString() const { - return ToStringInternal(false); - } - - std::string ToSensitiveString() const { - return ToStringInternal(true); - } - - uint32 GetPriority(uint32 type_preference, - int network_adapter_preference) const { - // RFC 5245 - 4.1.2.1. - // priority = (2^24)*(type preference) + - // (2^8)*(local preference) + - // (2^0)*(256 - component ID) - - // |local_preference| length is 2 bytes, 0-65535 inclusive. - // In our implemenation we will partion local_preference into - // 0 1 - // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 - // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - // | NIC Pref | Addr Pref | - // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - // NIC Type - Type of the network adapter e.g. 3G/Wifi/Wired. - // Addr Pref - Address preference value as per RFC 3484. - // local preference is calculated as - NIC Type << 8 | Addr_Pref. - - int addr_pref = IPAddressPrecedence(address_.ipaddr()); - int local_preference = (network_adapter_preference << 8) | addr_pref; - - return (type_preference << 24) | - (local_preference << 8) | - (256 - component_); - } - - private: - std::string ToStringInternal(bool sensitive) const { - std::ostringstream ost; - std::string address = sensitive ? address_.ToSensitiveString() : - address_.ToString(); - ost << "Cand[" << foundation_ << ":" << component_ << ":" - << protocol_ << ":" << priority_ << ":" - << address << ":" << type_ << ":" << related_address_ << ":" - << username_ << ":" << password_ << "]"; - return ost.str(); - } - - std::string id_; - int component_; - std::string protocol_; - talk_base::SocketAddress address_; - uint32 priority_; - std::string username_; - std::string password_; - std::string type_; - std::string network_name_; - uint32 generation_; - std::string foundation_; - talk_base::SocketAddress related_address_; -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_CANDIDATE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/common.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/common.h deleted file mode 100755 index 0cdcfb6..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/common.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_BASE_COMMON_H_ -#define TALK_P2P_BASE_COMMON_H_ - -#include "talk/base/logging.h" - -// Common log description format for jingle messages -#define LOG_J(sev, obj) LOG(sev) << "Jingle:" << obj->ToString() << ": " -#define LOG_JV(sev, obj) LOG_V(sev) << "Jingle:" << obj->ToString() << ": " - -#endif // TALK_P2P_BASE_COMMON_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/constants.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/constants.h deleted file mode 100755 index 74889c3..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/constants.h +++ /dev/null @@ -1,276 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_BASE_CONSTANTS_H_ -#define TALK_P2P_BASE_CONSTANTS_H_ - -#include -#include "talk/xmllite/qname.h" - -// This file contains constants related to signaling that are used in various -// classes in this directory. - -namespace cricket { - -// NS_ == namespace -// QN_ == buzz::QName (namespace + name) -// LN_ == "local name" == QName::LocalPart() -// these are useful when you need to find a tag -// that has different namespaces (like or ) - -extern const char NS_EMPTY[]; -extern const char NS_JINGLE[]; -extern const char NS_JINGLE_DRAFT[]; -extern const char NS_GINGLE[]; - -enum SignalingProtocol { - PROTOCOL_JINGLE, - PROTOCOL_GINGLE, - PROTOCOL_HYBRID, -}; - -// actions (aka Gingle or Jingle ) -extern const buzz::StaticQName QN_ACTION; -extern const char LN_INITIATOR[]; -extern const buzz::StaticQName QN_INITIATOR; -extern const buzz::StaticQName QN_CREATOR; - -extern const buzz::StaticQName QN_JINGLE; -extern const buzz::StaticQName QN_JINGLE_CONTENT; -extern const buzz::StaticQName QN_JINGLE_CONTENT_NAME; -extern const buzz::StaticQName QN_JINGLE_CONTENT_MEDIA; -extern const buzz::StaticQName QN_JINGLE_REASON; -extern const buzz::StaticQName QN_JINGLE_DRAFT_GROUP; -extern const buzz::StaticQName QN_JINGLE_DRAFT_GROUP_TYPE; -extern const char JINGLE_CONTENT_MEDIA_AUDIO[]; -extern const char JINGLE_CONTENT_MEDIA_VIDEO[]; -extern const char JINGLE_CONTENT_MEDIA_DATA[]; -extern const char JINGLE_ACTION_SESSION_INITIATE[]; -extern const char JINGLE_ACTION_SESSION_INFO[]; -extern const char JINGLE_ACTION_SESSION_ACCEPT[]; -extern const char JINGLE_ACTION_SESSION_TERMINATE[]; -extern const char JINGLE_ACTION_TRANSPORT_INFO[]; -extern const char JINGLE_ACTION_TRANSPORT_ACCEPT[]; -extern const char JINGLE_ACTION_DESCRIPTION_INFO[]; - -extern const buzz::StaticQName QN_GINGLE_SESSION; -extern const char GINGLE_ACTION_INITIATE[]; -extern const char GINGLE_ACTION_INFO[]; -extern const char GINGLE_ACTION_ACCEPT[]; -extern const char GINGLE_ACTION_REJECT[]; -extern const char GINGLE_ACTION_TERMINATE[]; -extern const char GINGLE_ACTION_CANDIDATES[]; -extern const char GINGLE_ACTION_UPDATE[]; - -extern const char LN_ERROR[]; -extern const buzz::StaticQName QN_GINGLE_REDIRECT; -extern const char STR_REDIRECT_PREFIX[]; - -// Session Contents (aka Gingle -// or Jingle ) -extern const char LN_DESCRIPTION[]; -extern const char LN_PAYLOADTYPE[]; -extern const buzz::StaticQName QN_ID; -extern const buzz::StaticQName QN_SID; -extern const buzz::StaticQName QN_NAME; -extern const buzz::StaticQName QN_CLOCKRATE; -extern const buzz::StaticQName QN_BITRATE; -extern const buzz::StaticQName QN_CHANNELS; -extern const buzz::StaticQName QN_PARAMETER; -extern const char LN_NAME[]; -extern const char LN_VALUE[]; -extern const buzz::StaticQName QN_PAYLOADTYPE_PARAMETER_NAME; -extern const buzz::StaticQName QN_PAYLOADTYPE_PARAMETER_VALUE; -extern const char PAYLOADTYPE_PARAMETER_BITRATE[]; -extern const char PAYLOADTYPE_PARAMETER_HEIGHT[]; -extern const char PAYLOADTYPE_PARAMETER_WIDTH[]; -extern const char PAYLOADTYPE_PARAMETER_FRAMERATE[]; -extern const char LN_BANDWIDTH[]; - -// CN_ == "content name". When we initiate a session, we choose the -// name, and when we receive a Gingle session, we provide default -// names (since Gingle has no content names). But when we receive a -// Jingle call, the content name can be anything, so don't rely on -// these values being the same as the ones received. -extern const char CN_AUDIO[]; -extern const char CN_VIDEO[]; -extern const char CN_DATA[]; -extern const char CN_OTHER[]; -// other SDP related strings -// GN stands for group name -extern const char GROUP_TYPE_BUNDLE[]; - -extern const char NS_JINGLE_RTP[]; -extern const buzz::StaticQName QN_JINGLE_RTP_CONTENT; -extern const buzz::StaticQName QN_SSRC; -extern const buzz::StaticQName QN_JINGLE_RTP_PAYLOADTYPE; -extern const buzz::StaticQName QN_JINGLE_RTP_BANDWIDTH; -extern const buzz::StaticQName QN_JINGLE_RTCP_MUX; -extern const buzz::StaticQName QN_JINGLE_RTCP_FB; -extern const buzz::StaticQName QN_SUBTYPE; -extern const buzz::StaticQName QN_JINGLE_RTP_HDREXT; -extern const buzz::StaticQName QN_URI; - -extern const char NS_JINGLE_DRAFT_SCTP[]; -extern const buzz::StaticQName QN_JINGLE_DRAFT_SCTP_CONTENT; -extern const buzz::StaticQName QN_JINGLE_DRAFT_SCTP_STREAM; - -extern const char NS_GINGLE_AUDIO[]; -extern const buzz::StaticQName QN_GINGLE_AUDIO_CONTENT; -extern const buzz::StaticQName QN_GINGLE_AUDIO_PAYLOADTYPE; -extern const buzz::StaticQName QN_GINGLE_AUDIO_SRCID; -extern const char NS_GINGLE_VIDEO[]; -extern const buzz::StaticQName QN_GINGLE_VIDEO_CONTENT; -extern const buzz::StaticQName QN_GINGLE_VIDEO_PAYLOADTYPE; -extern const buzz::StaticQName QN_GINGLE_VIDEO_SRCID; -extern const buzz::StaticQName QN_GINGLE_VIDEO_BANDWIDTH; - -// Crypto support. -extern const buzz::StaticQName QN_ENCRYPTION; -extern const buzz::StaticQName QN_ENCRYPTION_REQUIRED; -extern const buzz::StaticQName QN_CRYPTO; -extern const buzz::StaticQName QN_GINGLE_AUDIO_CRYPTO_USAGE; -extern const buzz::StaticQName QN_GINGLE_VIDEO_CRYPTO_USAGE; -extern const buzz::StaticQName QN_CRYPTO_SUITE; -extern const buzz::StaticQName QN_CRYPTO_KEY_PARAMS; -extern const buzz::StaticQName QN_CRYPTO_TAG; -extern const buzz::StaticQName QN_CRYPTO_SESSION_PARAMS; - -// Transports and candidates. -extern const char LN_TRANSPORT[]; -extern const char LN_CANDIDATE[]; -extern const buzz::StaticQName QN_JINGLE_P2P_TRANSPORT; -extern const buzz::StaticQName QN_JINGLE_P2P_CANDIDATE; -extern const buzz::StaticQName QN_UFRAG; -extern const buzz::StaticQName QN_COMPONENT; -extern const buzz::StaticQName QN_PWD; -extern const buzz::StaticQName QN_IP; -extern const buzz::StaticQName QN_PORT; -extern const buzz::StaticQName QN_NETWORK; -extern const buzz::StaticQName QN_GENERATION; -extern const buzz::StaticQName QN_PRIORITY; -extern const buzz::StaticQName QN_PROTOCOL; -extern const char ICE_CANDIDATE_TYPE_PEER_STUN[]; -extern const char ICE_CANDIDATE_TYPE_SERVER_STUN[]; -extern const int ICE_UFRAG_LENGTH; -extern const int ICE_PWD_LENGTH; -extern const size_t ICE_UFRAG_MIN_LENGTH; -extern const size_t ICE_PWD_MIN_LENGTH; -extern const size_t ICE_UFRAG_MAX_LENGTH; -extern const size_t ICE_PWD_MAX_LENGTH; -extern const int ICE_CANDIDATE_COMPONENT_RTP; -extern const int ICE_CANDIDATE_COMPONENT_RTCP; -extern const int ICE_CANDIDATE_COMPONENT_DEFAULT; - -extern const buzz::StaticQName QN_FINGERPRINT; -extern const buzz::StaticQName QN_FINGERPRINT_ALGORITHM; -extern const buzz::StaticQName QN_FINGERPRINT_DIGEST; - -extern const char NS_JINGLE_ICE_UDP[]; - -extern const char ICE_OPTION_GICE[]; -extern const char NS_GINGLE_P2P[]; -extern const buzz::StaticQName QN_GINGLE_P2P_TRANSPORT; -extern const buzz::StaticQName QN_GINGLE_P2P_CANDIDATE; -extern const buzz::StaticQName QN_GINGLE_P2P_UNKNOWN_CHANNEL_NAME; -extern const buzz::StaticQName QN_GINGLE_CANDIDATE; -extern const buzz::StaticQName QN_ADDRESS; -extern const buzz::StaticQName QN_USERNAME; -extern const buzz::StaticQName QN_PASSWORD; -extern const buzz::StaticQName QN_PREFERENCE; -extern const char GINGLE_CANDIDATE_TYPE_STUN[]; -extern const char GICE_CHANNEL_NAME_RTP[]; -extern const char GICE_CHANNEL_NAME_RTCP[]; -extern const char GICE_CHANNEL_NAME_VIDEO_RTP[]; -extern const char GICE_CHANNEL_NAME_VIDEO_RTCP[]; -extern const char GICE_CHANNEL_NAME_DATA_RTP[]; -extern const char GICE_CHANNEL_NAME_DATA_RTCP[]; - -extern const char NS_GINGLE_RAW[]; -extern const buzz::StaticQName QN_GINGLE_RAW_TRANSPORT; -extern const buzz::StaticQName QN_GINGLE_RAW_CHANNEL; - -// terminate reasons and errors: see http://xmpp.org/extensions/xep-0166.html -extern const char JINGLE_ERROR_BAD_REQUEST[]; // like parse error -// got transport-info before session-initiate, for example -extern const char JINGLE_ERROR_OUT_OF_ORDER[]; -extern const char JINGLE_ERROR_UNKNOWN_SESSION[]; - -// Call terminate reasons from XEP-166 -extern const char STR_TERMINATE_DECLINE[]; // polite reject -extern const char STR_TERMINATE_SUCCESS[]; // polite hangup -extern const char STR_TERMINATE_ERROR[]; // something bad happened -extern const char STR_TERMINATE_INCOMPATIBLE_PARAMETERS[]; // no codecs? - -// Old terminate reasons used by cricket -extern const char STR_TERMINATE_CALL_ENDED[]; -extern const char STR_TERMINATE_RECIPIENT_UNAVAILABLE[]; -extern const char STR_TERMINATE_RECIPIENT_BUSY[]; -extern const char STR_TERMINATE_INSUFFICIENT_FUNDS[]; -extern const char STR_TERMINATE_NUMBER_MALFORMED[]; -extern const char STR_TERMINATE_NUMBER_DISALLOWED[]; -extern const char STR_TERMINATE_PROTOCOL_ERROR[]; -extern const char STR_TERMINATE_INTERNAL_SERVER_ERROR[]; -extern const char STR_TERMINATE_UNKNOWN_ERROR[]; - -// Draft view and notify messages. -extern const char STR_JINGLE_DRAFT_CONTENT_NAME_VIDEO[]; -extern const char STR_JINGLE_DRAFT_CONTENT_NAME_AUDIO[]; -extern const buzz::StaticQName QN_NICK; -extern const buzz::StaticQName QN_TYPE; -extern const buzz::StaticQName QN_JINGLE_DRAFT_VIEW; -extern const char STR_JINGLE_DRAFT_VIEW_TYPE_NONE[]; -extern const char STR_JINGLE_DRAFT_VIEW_TYPE_STATIC[]; -extern const buzz::StaticQName QN_JINGLE_DRAFT_PARAMS; -extern const buzz::StaticQName QN_WIDTH; -extern const buzz::StaticQName QN_HEIGHT; -extern const buzz::StaticQName QN_FRAMERATE; -extern const buzz::StaticQName QN_JINGLE_DRAFT_STREAM; -extern const buzz::StaticQName QN_JINGLE_DRAFT_STREAMS; -extern const buzz::StaticQName QN_DISPLAY; -extern const buzz::StaticQName QN_CNAME; -extern const buzz::StaticQName QN_JINGLE_DRAFT_SSRC; -extern const buzz::StaticQName QN_JINGLE_DRAFT_SSRC_GROUP; -extern const buzz::StaticQName QN_SEMANTICS; -extern const buzz::StaticQName QN_JINGLE_LEGACY_NOTIFY; -extern const buzz::StaticQName QN_JINGLE_LEGACY_SOURCE; - -// old stuff -#ifdef FEATURE_ENABLE_VOICEMAIL -extern const char NS_VOICEMAIL[]; -extern const buzz::StaticQName QN_VOICEMAIL_REGARDING; -#endif - -// RFC 4145, SDP setup attribute values. -extern const char CONNECTIONROLE_ACTIVE_STR[]; -extern const char CONNECTIONROLE_PASSIVE_STR[]; -extern const char CONNECTIONROLE_ACTPASS_STR[]; -extern const char CONNECTIONROLE_HOLDCONN_STR[]; - -} // namespace cricket - -#endif // TALK_P2P_BASE_CONSTANTS_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/dtlstransport.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/dtlstransport.h deleted file mode 100755 index 5070713..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/dtlstransport.h +++ /dev/null @@ -1,256 +0,0 @@ -/* - * 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_P2P_BASE_DTLSTRANSPORT_H_ -#define TALK_P2P_BASE_DTLSTRANSPORT_H_ - -#include "talk/p2p/base/dtlstransportchannel.h" -#include "talk/p2p/base/transport.h" - -namespace talk_base { -class SSLIdentity; -} - -namespace cricket { - -class PortAllocator; - -// Base should be a descendant of cricket::Transport -template -class DtlsTransport : public Base { - public: - DtlsTransport(talk_base::Thread* signaling_thread, - talk_base::Thread* worker_thread, - const std::string& content_name, - PortAllocator* allocator, - talk_base::SSLIdentity* identity) - : Base(signaling_thread, worker_thread, content_name, allocator), - identity_(identity) { - } - - ~DtlsTransport() { - Base::DestroyAllChannels(); - } - virtual void SetIdentity_w(talk_base::SSLIdentity* identity) { - identity_ = identity; - } - virtual bool GetIdentity_w(talk_base::SSLIdentity** identity) { - if (!identity_) - return false; - - *identity = identity_->GetReference(); - return true; - } - - virtual bool ApplyLocalTransportDescription_w(TransportChannelImpl* channel, - std::string* error_desc) { - talk_base::SSLFingerprint* local_fp = - Base::local_description()->identity_fingerprint.get(); - - if (local_fp) { - // Sanity check local fingerprint. - if (identity_) { - talk_base::scoped_ptr local_fp_tmp( - talk_base::SSLFingerprint::Create(local_fp->algorithm, - identity_)); - ASSERT(local_fp_tmp.get() != NULL); - if (!(*local_fp_tmp == *local_fp)) { - std::ostringstream desc; - desc << "Local fingerprint does not match identity. Expected: "; - desc << local_fp_tmp->ToString(); - desc << " Got: " << local_fp->ToString(); - return BadTransportDescription(desc.str(), error_desc); - } - } else { - return BadTransportDescription( - "Local fingerprint provided but no identity available.", - error_desc); - } - } else { - identity_ = NULL; - } - - if (!channel->SetLocalIdentity(identity_)) { - return BadTransportDescription("Failed to set local identity.", - error_desc); - } - - // Apply the description in the base class. - return Base::ApplyLocalTransportDescription_w(channel, error_desc); - } - - virtual bool NegotiateTransportDescription_w(ContentAction local_role, - std::string* error_desc) { - if (!Base::local_description() || !Base::remote_description()) { - const std::string msg = "Local and Remote description must be set before " - "transport descriptions are negotiated"; - return BadTransportDescription(msg, error_desc); - } - - talk_base::SSLFingerprint* local_fp = - Base::local_description()->identity_fingerprint.get(); - talk_base::SSLFingerprint* remote_fp = - Base::remote_description()->identity_fingerprint.get(); - - if (remote_fp && local_fp) { - remote_fingerprint_.reset(new talk_base::SSLFingerprint(*remote_fp)); - - // From RFC 4145, section-4.1, The following are the values that the - // 'setup' attribute can take in an offer/answer exchange: - // Offer Answer - // ________________ - // active passive / holdconn - // passive active / holdconn - // actpass active / passive / holdconn - // holdconn holdconn - // - // Set the role that is most conformant with RFC 5763, Section 5, bullet 1 - // The endpoint MUST use the setup attribute defined in [RFC4145]. - // The endpoint that is the offerer MUST use the setup attribute - // value of setup:actpass and be prepared to receive a client_hello - // before it receives the answer. The answerer MUST use either a - // setup attribute value of setup:active or setup:passive. Note that - // if the answerer uses setup:passive, then the DTLS handshake will - // not begin until the answerer is received, which adds additional - // latency. setup:active allows the answer and the DTLS handshake to - // occur in parallel. Thus, setup:active is RECOMMENDED. Whichever - // party is active MUST initiate a DTLS handshake by sending a - // ClientHello over each flow (host/port quartet). - // IOW - actpass and passive modes should be treated as server and - // active as client. - ConnectionRole local_connection_role = - Base::local_description()->connection_role; - ConnectionRole remote_connection_role = - Base::remote_description()->connection_role; - - bool is_remote_server = false; - if (local_role == CA_OFFER) { - if (local_connection_role != CONNECTIONROLE_ACTPASS) { - return BadTransportDescription( - "Offerer must use actpass value for setup attribute.", - error_desc); - } - - if (remote_connection_role == CONNECTIONROLE_ACTIVE || - remote_connection_role == CONNECTIONROLE_PASSIVE || - remote_connection_role == CONNECTIONROLE_NONE) { - is_remote_server = (remote_connection_role == CONNECTIONROLE_PASSIVE); - } else { - const std::string msg = - "Answerer must use either active or passive value " - "for setup attribute."; - return BadTransportDescription(msg, error_desc); - } - // If remote is NONE or ACTIVE it will act as client. - } else { - if (remote_connection_role != CONNECTIONROLE_ACTPASS && - remote_connection_role != CONNECTIONROLE_NONE) { - return BadTransportDescription( - "Offerer must use actpass value for setup attribute.", - error_desc); - } - - if (local_connection_role == CONNECTIONROLE_ACTIVE || - local_connection_role == CONNECTIONROLE_PASSIVE) { - is_remote_server = (local_connection_role == CONNECTIONROLE_ACTIVE); - } else { - const std::string msg = - "Answerer must use either active or passive value " - "for setup attribute."; - return BadTransportDescription(msg, error_desc); - } - - // If local is passive, local will act as server. - } - - secure_role_ = is_remote_server ? talk_base::SSL_CLIENT : - talk_base::SSL_SERVER; - - } else if (local_fp && (local_role == CA_ANSWER)) { - return BadTransportDescription( - "Local fingerprint supplied when caller didn't offer DTLS.", - error_desc); - } else { - // We are not doing DTLS - remote_fingerprint_.reset(new talk_base::SSLFingerprint( - "", NULL, 0)); - } - - // Now run the negotiation for the base class. - return Base::NegotiateTransportDescription_w(local_role, error_desc); - } - - virtual DtlsTransportChannelWrapper* CreateTransportChannel(int component) { - return new DtlsTransportChannelWrapper( - this, Base::CreateTransportChannel(component)); - } - - virtual void DestroyTransportChannel(TransportChannelImpl* channel) { - // Kind of ugly, but this lets us do the exact inverse of the create. - DtlsTransportChannelWrapper* dtls_channel = - static_cast(channel); - TransportChannelImpl* base_channel = dtls_channel->channel(); - delete dtls_channel; - Base::DestroyTransportChannel(base_channel); - } - - virtual bool GetSslRole_w(talk_base::SSLRole* ssl_role) const { - ASSERT(ssl_role != NULL); - *ssl_role = secure_role_; - return true; - } - - private: - virtual bool ApplyNegotiatedTransportDescription_w( - TransportChannelImpl* channel, - std::string* error_desc) { - // Set ssl role. Role must be set before fingerprint is applied, which - // initiates DTLS setup. - if (!channel->SetSslRole(secure_role_)) { - return BadTransportDescription("Failed to set ssl role for the channel.", - error_desc); - } - // Apply remote fingerprint. - if (!channel->SetRemoteFingerprint( - remote_fingerprint_->algorithm, - reinterpret_cast(remote_fingerprint_-> - digest.data()), - remote_fingerprint_->digest.length())) { - return BadTransportDescription("Failed to apply remote fingerprint.", - error_desc); - } - return Base::ApplyNegotiatedTransportDescription_w(channel, error_desc); - } - - talk_base::SSLIdentity* identity_; - talk_base::SSLRole secure_role_; - talk_base::scoped_ptr remote_fingerprint_; -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_DTLSTRANSPORT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/dtlstransportchannel.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/dtlstransportchannel.h deleted file mode 100755 index 54cb567..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/dtlstransportchannel.h +++ /dev/null @@ -1,264 +0,0 @@ -/* - * libjingle - * Copyright 2011, Google Inc. - * Copyright 2011, RTFM, 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_P2P_BASE_DTLSTRANSPORTCHANNEL_H_ -#define TALK_P2P_BASE_DTLSTRANSPORTCHANNEL_H_ - -#include -#include - -#include "talk/base/buffer.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/sslstreamadapter.h" -#include "talk/base/stream.h" -#include "talk/p2p/base/transportchannelimpl.h" - -namespace cricket { - -// A bridge between a packet-oriented/channel-type interface on -// the bottom and a StreamInterface on the top. -class StreamInterfaceChannel : public talk_base::StreamInterface, - public sigslot::has_slots<> { - public: - StreamInterfaceChannel(talk_base::Thread* owner, TransportChannel* channel) - : channel_(channel), - state_(talk_base::SS_OPEN), - fifo_(kFifoSize, owner) { - fifo_.SignalEvent.connect(this, &StreamInterfaceChannel::OnEvent); - } - - // Push in a packet; this gets pulled out from Read(). - bool OnPacketReceived(const char* data, size_t size); - - // Implementations of StreamInterface - virtual talk_base::StreamState GetState() const { return state_; } - virtual void Close() { state_ = talk_base::SS_CLOSED; } - virtual talk_base::StreamResult Read(void* buffer, size_t buffer_len, - size_t* read, int* error); - virtual talk_base::StreamResult Write(const void* data, size_t data_len, - size_t* written, int* error); - - private: - static const size_t kFifoSize = 8192; - - // Forward events - virtual void OnEvent(talk_base::StreamInterface* stream, int sig, int err); - - TransportChannel* channel_; // owned by DtlsTransportChannelWrapper - talk_base::StreamState state_; - talk_base::FifoBuffer fifo_; - - DISALLOW_COPY_AND_ASSIGN(StreamInterfaceChannel); -}; - - -// This class provides a DTLS SSLStreamAdapter inside a TransportChannel-style -// packet-based interface, wrapping an existing TransportChannel instance -// (e.g a P2PTransportChannel) -// Here's the way this works: -// -// DtlsTransportChannelWrapper { -// SSLStreamAdapter* dtls_ { -// StreamInterfaceChannel downward_ { -// TransportChannelImpl* channel_; -// } -// } -// } -// -// - Data which comes into DtlsTransportChannelWrapper from the underlying -// channel_ via OnReadPacket() is checked for whether it is DTLS -// or not, and if it is, is passed to DtlsTransportChannelWrapper:: -// HandleDtlsPacket, which pushes it into to downward_. -// dtls_ is listening for events on downward_, so it immediately calls -// downward_->Read(). -// -// - Data written to DtlsTransportChannelWrapper is passed either to -// downward_ or directly to channel_, depending on whether DTLS is -// negotiated and whether the flags include PF_SRTP_BYPASS -// -// - The SSLStreamAdapter writes to downward_->Write() -// which translates it into packet writes on channel_. -class DtlsTransportChannelWrapper : public TransportChannelImpl { - public: - enum State { - STATE_NONE, // No state or rejected. - STATE_OFFERED, // Our identity has been set. - STATE_ACCEPTED, // The other side sent a fingerprint. - STATE_STARTED, // We are negotiating. - STATE_OPEN, // Negotiation complete. - STATE_CLOSED // Connection closed. - }; - - // The parameters here are: - // transport -- the DtlsTransport that created us - // channel -- the TransportChannel we are wrapping - DtlsTransportChannelWrapper(Transport* transport, - TransportChannelImpl* channel); - virtual ~DtlsTransportChannelWrapper(); - - virtual void SetIceRole(IceRole role) { - channel_->SetIceRole(role); - } - virtual IceRole GetIceRole() const { - return channel_->GetIceRole(); - } - virtual size_t GetConnectionCount() const { - return channel_->GetConnectionCount(); - } - virtual bool SetLocalIdentity(talk_base::SSLIdentity *identity); - virtual bool GetLocalIdentity(talk_base::SSLIdentity** identity) const; - - virtual bool SetRemoteFingerprint(const std::string& digest_alg, - const uint8* digest, - size_t digest_len); - virtual bool IsDtlsActive() const { return dtls_state_ != STATE_NONE; } - - // Called to send a packet (via DTLS, if turned on). - virtual int SendPacket(const char* data, size_t size, - const talk_base::PacketOptions& options, - int flags); - - // TransportChannel calls that we forward to the wrapped transport. - virtual int SetOption(talk_base::Socket::Option opt, int value) { - return channel_->SetOption(opt, value); - } - virtual int GetError() { - return channel_->GetError(); - } - virtual bool GetStats(ConnectionInfos* infos) { - return channel_->GetStats(infos); - } - virtual const std::string SessionId() const { - return channel_->SessionId(); - } - - // Set up the ciphers to use for DTLS-SRTP. If this method is not called - // before DTLS starts, or |ciphers| is empty, SRTP keys won't be negotiated. - // This method should be called before SetupDtls. - virtual bool SetSrtpCiphers(const std::vector& ciphers); - - // Find out which DTLS-SRTP cipher was negotiated - virtual bool GetSrtpCipher(std::string* cipher); - - virtual bool GetSslRole(talk_base::SSLRole* role) const; - virtual bool SetSslRole(talk_base::SSLRole role); - - // Once DTLS has been established, this method retrieves the certificate in - // use by the remote peer, for use in external identity verification. - virtual bool GetRemoteCertificate(talk_base::SSLCertificate** cert) const; - - // Once DTLS has established (i.e., this channel is writable), this method - // extracts the keys negotiated during the DTLS handshake, for use in external - // encryption. DTLS-SRTP uses this to extract the needed SRTP keys. - // See the SSLStreamAdapter documentation for info on the specific parameters. - virtual bool ExportKeyingMaterial(const std::string& label, - const uint8* context, - size_t context_len, - bool use_context, - uint8* result, - size_t result_len) { - return (dtls_.get()) ? dtls_->ExportKeyingMaterial(label, context, - context_len, - use_context, - result, result_len) - : false; - } - - // TransportChannelImpl calls. - virtual Transport* GetTransport() { - return transport_; - } - virtual void SetIceTiebreaker(uint64 tiebreaker) { - channel_->SetIceTiebreaker(tiebreaker); - } - virtual bool GetIceProtocolType(IceProtocolType* type) const { - return channel_->GetIceProtocolType(type); - } - virtual void SetIceProtocolType(IceProtocolType type) { - channel_->SetIceProtocolType(type); - } - virtual void SetIceCredentials(const std::string& ice_ufrag, - const std::string& ice_pwd) { - channel_->SetIceCredentials(ice_ufrag, ice_pwd); - } - virtual void SetRemoteIceCredentials(const std::string& ice_ufrag, - const std::string& ice_pwd) { - channel_->SetRemoteIceCredentials(ice_ufrag, ice_pwd); - } - virtual void SetRemoteIceMode(IceMode mode) { - channel_->SetRemoteIceMode(mode); - } - - virtual void Connect(); - virtual void Reset(); - - virtual void OnSignalingReady() { - channel_->OnSignalingReady(); - } - virtual void OnCandidate(const Candidate& candidate) { - channel_->OnCandidate(candidate); - } - - // Needed by DtlsTransport. - TransportChannelImpl* channel() { return channel_; } - - private: - void OnReadableState(TransportChannel* channel); - void OnWritableState(TransportChannel* channel); - void OnReadPacket(TransportChannel* channel, const char* data, size_t size, - const talk_base::PacketTime& packet_time, int flags); - void OnReadyToSend(TransportChannel* channel); - void OnDtlsEvent(talk_base::StreamInterface* stream_, int sig, int err); - bool SetupDtls(); - bool MaybeStartDtls(); - bool HandleDtlsPacket(const char* data, size_t size); - void OnRequestSignaling(TransportChannelImpl* channel); - void OnCandidateReady(TransportChannelImpl* channel, const Candidate& c); - void OnCandidatesAllocationDone(TransportChannelImpl* channel); - void OnRoleConflict(TransportChannelImpl* channel); - void OnRouteChange(TransportChannel* channel, const Candidate& candidate); - void OnConnectionRemoved(TransportChannelImpl* channel); - - Transport* transport_; // The transport_ that created us. - talk_base::Thread* worker_thread_; // Everything should occur on this thread. - TransportChannelImpl* channel_; // Underlying channel, owned by transport_. - talk_base::scoped_ptr dtls_; // The DTLS stream - StreamInterfaceChannel* downward_; // Wrapper for channel_, owned by dtls_. - std::vector srtp_ciphers_; // SRTP ciphers to use with DTLS. - State dtls_state_; - talk_base::SSLIdentity* local_identity_; - talk_base::SSLRole ssl_role_; - talk_base::Buffer remote_fingerprint_value_; - std::string remote_fingerprint_algorithm_; - - DISALLOW_COPY_AND_ASSIGN(DtlsTransportChannelWrapper); -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_DTLSTRANSPORTCHANNEL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/fakesession.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/fakesession.h deleted file mode 100755 index 115cbdb..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/fakesession.h +++ /dev/null @@ -1,509 +0,0 @@ -/* - * libjingle - * Copyright 2009, 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_P2P_BASE_FAKESESSION_H_ -#define TALK_P2P_BASE_FAKESESSION_H_ - -#include -#include -#include - -#include "talk/base/buffer.h" -#include "talk/base/fakesslidentity.h" -#include "talk/base/sigslot.h" -#include "talk/base/sslfingerprint.h" -#include "talk/base/messagequeue.h" -#include "talk/p2p/base/session.h" -#include "talk/p2p/base/transport.h" -#include "talk/p2p/base/transportchannel.h" -#include "talk/p2p/base/transportchannelimpl.h" - -namespace cricket { - -class FakeTransport; - -struct PacketMessageData : public talk_base::MessageData { - PacketMessageData(const char* data, size_t len) : packet(data, len) { - } - talk_base::Buffer packet; -}; - -// Fake transport channel class, which can be passed to anything that needs a -// transport channel. Can be informed of another FakeTransportChannel via -// SetDestination. -class FakeTransportChannel : public TransportChannelImpl, - public talk_base::MessageHandler { - public: - explicit FakeTransportChannel(Transport* transport, - const std::string& content_name, - int component) - : TransportChannelImpl(content_name, component), - transport_(transport), - dest_(NULL), - state_(STATE_INIT), - async_(false), - identity_(NULL), - do_dtls_(false), - role_(ICEROLE_UNKNOWN), - tiebreaker_(0), - ice_proto_(ICEPROTO_HYBRID), - remote_ice_mode_(ICEMODE_FULL), - dtls_fingerprint_("", NULL, 0), - ssl_role_(talk_base::SSL_CLIENT), - connection_count_(0) { - } - ~FakeTransportChannel() { - Reset(); - } - - uint64 IceTiebreaker() const { return tiebreaker_; } - TransportProtocol protocol() const { return ice_proto_; } - IceMode remote_ice_mode() const { return remote_ice_mode_; } - const std::string& ice_ufrag() const { return ice_ufrag_; } - const std::string& ice_pwd() const { return ice_pwd_; } - const std::string& remote_ice_ufrag() const { return remote_ice_ufrag_; } - const std::string& remote_ice_pwd() const { return remote_ice_pwd_; } - const talk_base::SSLFingerprint& dtls_fingerprint() const { - return dtls_fingerprint_; - } - - void SetAsync(bool async) { - async_ = async; - } - - virtual Transport* GetTransport() { - return transport_; - } - - virtual void SetIceRole(IceRole role) { role_ = role; } - virtual IceRole GetIceRole() const { return role_; } - virtual size_t GetConnectionCount() const { return connection_count_; } - virtual void SetIceTiebreaker(uint64 tiebreaker) { tiebreaker_ = tiebreaker; } - virtual bool GetIceProtocolType(IceProtocolType* type) const { - *type = ice_proto_; - return true; - } - virtual void SetIceProtocolType(IceProtocolType type) { ice_proto_ = type; } - virtual void SetIceCredentials(const std::string& ice_ufrag, - const std::string& ice_pwd) { - ice_ufrag_ = ice_ufrag; - ice_pwd_ = ice_pwd; - } - virtual void SetRemoteIceCredentials(const std::string& ice_ufrag, - const std::string& ice_pwd) { - remote_ice_ufrag_ = ice_ufrag; - remote_ice_pwd_ = ice_pwd; - } - - virtual void SetRemoteIceMode(IceMode mode) { remote_ice_mode_ = mode; } - virtual bool SetRemoteFingerprint(const std::string& alg, const uint8* digest, - size_t digest_len) { - dtls_fingerprint_ = talk_base::SSLFingerprint(alg, digest, digest_len); - return true; - } - virtual bool SetSslRole(talk_base::SSLRole role) { - ssl_role_ = role; - return true; - } - virtual bool GetSslRole(talk_base::SSLRole* role) const { - *role = ssl_role_; - return true; - } - - virtual void Connect() { - if (state_ == STATE_INIT) { - state_ = STATE_CONNECTING; - } - } - virtual void Reset() { - if (state_ != STATE_INIT) { - state_ = STATE_INIT; - if (dest_) { - dest_->state_ = STATE_INIT; - dest_->dest_ = NULL; - dest_ = NULL; - } - } - } - - void SetWritable(bool writable) { - set_writable(writable); - } - - void SetDestination(FakeTransportChannel* dest) { - if (state_ == STATE_CONNECTING && dest) { - // This simulates the delivery of candidates. - dest_ = dest; - dest_->dest_ = this; - if (identity_ && dest_->identity_) { - do_dtls_ = true; - dest_->do_dtls_ = true; - NegotiateSrtpCiphers(); - } - state_ = STATE_CONNECTED; - dest_->state_ = STATE_CONNECTED; - set_writable(true); - dest_->set_writable(true); - } else if (state_ == STATE_CONNECTED && !dest) { - // Simulates loss of connectivity, by asymmetrically forgetting dest_. - dest_ = NULL; - state_ = STATE_CONNECTING; - set_writable(false); - } - } - - void SetConnectionCount(size_t connection_count) { - size_t old_connection_count = connection_count_; - connection_count_ = connection_count; - if (connection_count_ < old_connection_count) - SignalConnectionRemoved(this); - } - - virtual int SendPacket(const char* data, size_t len, - const talk_base::PacketOptions& options, int flags) { - if (state_ != STATE_CONNECTED) { - return -1; - } - - if (flags != PF_SRTP_BYPASS && flags != 0) { - return -1; - } - - PacketMessageData* packet = new PacketMessageData(data, len); - if (async_) { - talk_base::Thread::Current()->Post(this, 0, packet); - } else { - talk_base::Thread::Current()->Send(this, 0, packet); - } - return static_cast(len); - } - virtual int SetOption(talk_base::Socket::Option opt, int value) { - return true; - } - virtual int GetError() { - return 0; - } - - virtual void OnSignalingReady() { - } - virtual void OnCandidate(const Candidate& candidate) { - } - - virtual void OnMessage(talk_base::Message* msg) { - PacketMessageData* data = static_cast( - msg->pdata); - dest_->SignalReadPacket(dest_, data->packet.data(), - data->packet.length(), - talk_base::CreatePacketTime(0), 0); - delete data; - } - - bool SetLocalIdentity(talk_base::SSLIdentity* identity) { - identity_ = identity; - return true; - } - - - void SetRemoteCertificate(talk_base::FakeSSLCertificate* cert) { - remote_cert_ = cert; - } - - virtual bool IsDtlsActive() const { - return do_dtls_; - } - - virtual bool SetSrtpCiphers(const std::vector& ciphers) { - srtp_ciphers_ = ciphers; - return true; - } - - virtual bool GetSrtpCipher(std::string* cipher) { - if (!chosen_srtp_cipher_.empty()) { - *cipher = chosen_srtp_cipher_; - return true; - } - return false; - } - - virtual bool GetLocalIdentity(talk_base::SSLIdentity** identity) const { - if (!identity_) - return false; - - *identity = identity_->GetReference(); - return true; - } - - virtual bool GetRemoteCertificate(talk_base::SSLCertificate** cert) const { - if (!remote_cert_) - return false; - - *cert = remote_cert_->GetReference(); - return true; - } - - virtual bool ExportKeyingMaterial(const std::string& label, - const uint8* context, - size_t context_len, - bool use_context, - uint8* result, - size_t result_len) { - if (!chosen_srtp_cipher_.empty()) { - memset(result, 0xff, result_len); - return true; - } - - return false; - } - - virtual void NegotiateSrtpCiphers() { - for (std::vector::const_iterator it1 = srtp_ciphers_.begin(); - it1 != srtp_ciphers_.end(); ++it1) { - for (std::vector::const_iterator it2 = - dest_->srtp_ciphers_.begin(); - it2 != dest_->srtp_ciphers_.end(); ++it2) { - if (*it1 == *it2) { - chosen_srtp_cipher_ = *it1; - dest_->chosen_srtp_cipher_ = *it2; - return; - } - } - } - } - - virtual bool GetStats(ConnectionInfos* infos) OVERRIDE { - ConnectionInfo info; - infos->clear(); - infos->push_back(info); - return true; - } - - private: - enum State { STATE_INIT, STATE_CONNECTING, STATE_CONNECTED }; - Transport* transport_; - FakeTransportChannel* dest_; - State state_; - bool async_; - talk_base::SSLIdentity* identity_; - talk_base::FakeSSLCertificate* remote_cert_; - bool do_dtls_; - std::vector srtp_ciphers_; - std::string chosen_srtp_cipher_; - IceRole role_; - uint64 tiebreaker_; - IceProtocolType ice_proto_; - std::string ice_ufrag_; - std::string ice_pwd_; - std::string remote_ice_ufrag_; - std::string remote_ice_pwd_; - IceMode remote_ice_mode_; - talk_base::SSLFingerprint dtls_fingerprint_; - talk_base::SSLRole ssl_role_; - size_t connection_count_; -}; - -// Fake transport class, which can be passed to anything that needs a Transport. -// Can be informed of another FakeTransport via SetDestination (low-tech way -// of doing candidates) -class FakeTransport : public Transport { - public: - typedef std::map ChannelMap; - FakeTransport(talk_base::Thread* signaling_thread, - talk_base::Thread* worker_thread, - const std::string& content_name, - PortAllocator* alllocator = NULL) - : Transport(signaling_thread, worker_thread, - content_name, "test_type", NULL), - dest_(NULL), - async_(false), - identity_(NULL) { - } - ~FakeTransport() { - DestroyAllChannels(); - } - - const ChannelMap& channels() const { return channels_; } - - void SetAsync(bool async) { async_ = async; } - void SetDestination(FakeTransport* dest) { - dest_ = dest; - for (ChannelMap::iterator it = channels_.begin(); it != channels_.end(); - ++it) { - it->second->SetLocalIdentity(identity_); - SetChannelDestination(it->first, it->second); - } - } - - void SetWritable(bool writable) { - for (ChannelMap::iterator it = channels_.begin(); it != channels_.end(); - ++it) { - it->second->SetWritable(writable); - } - } - - void set_identity(talk_base::SSLIdentity* identity) { - identity_ = identity; - } - - using Transport::local_description; - using Transport::remote_description; - - protected: - virtual TransportChannelImpl* CreateTransportChannel(int component) { - if (channels_.find(component) != channels_.end()) { - return NULL; - } - FakeTransportChannel* channel = - new FakeTransportChannel(this, content_name(), component); - channel->SetAsync(async_); - SetChannelDestination(component, channel); - channels_[component] = channel; - return channel; - } - virtual void DestroyTransportChannel(TransportChannelImpl* channel) { - channels_.erase(channel->component()); - delete channel; - } - virtual void SetIdentity_w(talk_base::SSLIdentity* identity) { - identity_ = identity; - } - virtual bool GetIdentity_w(talk_base::SSLIdentity** identity) { - if (!identity_) - return false; - - *identity = identity_->GetReference(); - return true; - } - - private: - FakeTransportChannel* GetFakeChannel(int component) { - ChannelMap::iterator it = channels_.find(component); - return (it != channels_.end()) ? it->second : NULL; - } - void SetChannelDestination(int component, - FakeTransportChannel* channel) { - FakeTransportChannel* dest_channel = NULL; - if (dest_) { - dest_channel = dest_->GetFakeChannel(component); - if (dest_channel) { - dest_channel->SetLocalIdentity(dest_->identity_); - } - } - channel->SetDestination(dest_channel); - } - - // Note, this is distinct from the Channel map owned by Transport. - // This map just tracks the FakeTransportChannels created by this class. - ChannelMap channels_; - FakeTransport* dest_; - bool async_; - talk_base::SSLIdentity* identity_; -}; - -// Fake session class, which can be passed into a BaseChannel object for -// test purposes. Can be connected to other FakeSessions via Connect(). -class FakeSession : public BaseSession { - public: - explicit FakeSession() - : BaseSession(talk_base::Thread::Current(), - talk_base::Thread::Current(), - NULL, "", "", true), - fail_create_channel_(false) { - } - explicit FakeSession(bool initiator) - : BaseSession(talk_base::Thread::Current(), - talk_base::Thread::Current(), - NULL, "", "", initiator), - fail_create_channel_(false) { - } - FakeSession(talk_base::Thread* worker_thread, bool initiator) - : BaseSession(talk_base::Thread::Current(), - worker_thread, - NULL, "", "", initiator), - fail_create_channel_(false) { - } - - FakeTransport* GetTransport(const std::string& content_name) { - return static_cast( - BaseSession::GetTransport(content_name)); - } - - void Connect(FakeSession* dest) { - // Simulate the exchange of candidates. - CompleteNegotiation(); - dest->CompleteNegotiation(); - for (TransportMap::const_iterator it = transport_proxies().begin(); - it != transport_proxies().end(); ++it) { - static_cast(it->second->impl())->SetDestination( - dest->GetTransport(it->first)); - } - } - - virtual TransportChannel* CreateChannel( - const std::string& content_name, - const std::string& channel_name, - int component) { - if (fail_create_channel_) { - return NULL; - } - return BaseSession::CreateChannel(content_name, channel_name, component); - } - - void set_fail_channel_creation(bool fail_channel_creation) { - fail_create_channel_ = fail_channel_creation; - } - - // TODO: Hoist this into Session when we re-work the Session code. - void set_ssl_identity(talk_base::SSLIdentity* identity) { - for (TransportMap::const_iterator it = transport_proxies().begin(); - it != transport_proxies().end(); ++it) { - // We know that we have a FakeTransport* - - static_cast(it->second->impl())->set_identity - (identity); - } - } - - protected: - virtual Transport* CreateTransport(const std::string& content_name) { - return new FakeTransport(signaling_thread(), worker_thread(), content_name); - } - - void CompleteNegotiation() { - for (TransportMap::const_iterator it = transport_proxies().begin(); - it != transport_proxies().end(); ++it) { - it->second->CompleteNegotiation(); - it->second->ConnectChannels(); - } - } - - private: - bool fail_create_channel_; -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_FAKESESSION_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/p2ptransport.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/p2ptransport.h deleted file mode 100755 index 72240b5..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/p2ptransport.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_BASE_P2PTRANSPORT_H_ -#define TALK_P2P_BASE_P2PTRANSPORT_H_ - -#include -#include -#include "talk/p2p/base/transport.h" - -namespace cricket { - -class P2PTransport : public Transport { - public: - P2PTransport(talk_base::Thread* signaling_thread, - talk_base::Thread* worker_thread, - const std::string& content_name, - PortAllocator* allocator); - virtual ~P2PTransport(); - - protected: - // Creates and destroys P2PTransportChannel. - virtual TransportChannelImpl* CreateTransportChannel(int component); - virtual void DestroyTransportChannel(TransportChannelImpl* channel); - - friend class P2PTransportChannel; - - DISALLOW_EVIL_CONSTRUCTORS(P2PTransport); -}; - -class P2PTransportParser : public TransportParser { - public: - P2PTransportParser() {} - // Translator may be null, in which case ParseCandidates should - // return false if there are candidates to parse. We can't not call - // ParseCandidates because there's no way to know ahead of time if - // there are candidates or not. - - // Jingle-specific functions; can be used with either ICE, GICE, or HYBRID. - virtual bool ParseTransportDescription(const buzz::XmlElement* elem, - const CandidateTranslator* translator, - TransportDescription* desc, - ParseError* error); - virtual bool WriteTransportDescription(const TransportDescription& desc, - const CandidateTranslator* translator, - buzz::XmlElement** elem, - WriteError* error); - - // Legacy Gingle functions; only can be used with GICE. - virtual bool ParseGingleCandidate(const buzz::XmlElement* elem, - const CandidateTranslator* translator, - Candidate* candidate, - ParseError* error); - virtual bool WriteGingleCandidate(const Candidate& candidate, - const CandidateTranslator* translator, - buzz::XmlElement** elem, - WriteError* error); - - private: - bool ParseCandidate(TransportProtocol proto, - const buzz::XmlElement* elem, - const CandidateTranslator* translator, - Candidate* candidate, - ParseError* error); - bool WriteCandidate(TransportProtocol proto, - const Candidate& candidate, - const CandidateTranslator* translator, - buzz::XmlElement* elem, - WriteError* error); - bool VerifyUsernameFormat(TransportProtocol proto, - const std::string& username, - ParseError* error); - - DISALLOW_EVIL_CONSTRUCTORS(P2PTransportParser); -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_P2PTRANSPORT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/p2ptransportchannel.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/p2ptransportchannel.h deleted file mode 100755 index 607dd5f..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/p2ptransportchannel.h +++ /dev/null @@ -1,259 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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. - */ - -// P2PTransportChannel wraps up the state management of the connection between -// two P2P clients. Clients have candidate ports for connecting, and -// connections which are combinations of candidates from each end (Alice and -// Bob each have candidates, one candidate from Alice and one candidate from -// Bob are used to make a connection, repeat to make many connections). -// -// When all of the available connections become invalid (non-writable), we -// kick off a process of determining more candidates and more connections. -// -#ifndef TALK_P2P_BASE_P2PTRANSPORTCHANNEL_H_ -#define TALK_P2P_BASE_P2PTRANSPORTCHANNEL_H_ - -#include -#include -#include -#include "talk/base/asyncpacketsocket.h" -#include "talk/base/sigslot.h" -#include "talk/p2p/base/candidate.h" -#include "talk/p2p/base/portinterface.h" -#include "talk/p2p/base/portallocator.h" -#include "talk/p2p/base/transport.h" -#include "talk/p2p/base/transportchannelimpl.h" -#include "talk/p2p/base/p2ptransport.h" - -namespace cricket { - -// Adds the port on which the candidate originated. -class RemoteCandidate : public Candidate { - public: - RemoteCandidate(const Candidate& c, PortInterface* origin_port) - : Candidate(c), origin_port_(origin_port) {} - - PortInterface* origin_port() { return origin_port_; } - - private: - PortInterface* origin_port_; -}; - -// P2PTransportChannel manages the candidates and connection process to keep -// two P2P clients connected to each other. -class P2PTransportChannel : public TransportChannelImpl, - public talk_base::MessageHandler { - public: - P2PTransportChannel(const std::string& content_name, - int component, - P2PTransport* transport, - PortAllocator *allocator); - virtual ~P2PTransportChannel(); - - // From TransportChannelImpl: - virtual Transport* GetTransport() { return transport_; } - virtual void SetIceRole(IceRole role); - virtual IceRole GetIceRole() const { return ice_role_; } - virtual void SetIceTiebreaker(uint64 tiebreaker); - virtual size_t GetConnectionCount() const { return connections_.size(); } - virtual bool GetIceProtocolType(IceProtocolType* type) const; - virtual void SetIceProtocolType(IceProtocolType type); - virtual void SetIceCredentials(const std::string& ice_ufrag, - const std::string& ice_pwd); - virtual void SetRemoteIceCredentials(const std::string& ice_ufrag, - const std::string& ice_pwd); - virtual void SetRemoteIceMode(IceMode mode); - virtual void Connect(); - virtual void Reset(); - virtual void OnSignalingReady(); - virtual void OnCandidate(const Candidate& candidate); - - // From TransportChannel: - virtual int SendPacket(const char *data, size_t len, - const talk_base::PacketOptions& options, int flags); - virtual int SetOption(talk_base::Socket::Option opt, int value); - virtual int GetError() { return error_; } - virtual bool GetStats(std::vector* stats); - - const Connection* best_connection() const { return best_connection_; } - void set_incoming_only(bool value) { incoming_only_ = value; } - - // Note: This is only for testing purpose. - // |ports_| should not be changed from outside. - const std::vector& ports() { return ports_; } - - IceMode remote_ice_mode() const { return remote_ice_mode_; } - - // DTLS methods. - virtual bool IsDtlsActive() const { return false; } - - // Default implementation. - virtual bool GetSslRole(talk_base::SSLRole* role) const { - return false; - } - - virtual bool SetSslRole(talk_base::SSLRole role) { - return false; - } - - // Set up the ciphers to use for DTLS-SRTP. - virtual bool SetSrtpCiphers(const std::vector& ciphers) { - return false; - } - - // Find out which DTLS-SRTP cipher was negotiated - virtual bool GetSrtpCipher(std::string* cipher) { - return false; - } - - // Returns false because the channel is not encrypted by default. - virtual bool GetLocalIdentity(talk_base::SSLIdentity** identity) const { - return false; - } - - virtual bool GetRemoteCertificate(talk_base::SSLCertificate** cert) const { - return false; - } - - // Allows key material to be extracted for external encryption. - virtual bool ExportKeyingMaterial( - const std::string& label, - const uint8* context, - size_t context_len, - bool use_context, - uint8* result, - size_t result_len) { - return false; - } - - virtual bool SetLocalIdentity(talk_base::SSLIdentity* identity) { - return false; - } - - // Set DTLS Remote fingerprint. Must be after local identity set. - virtual bool SetRemoteFingerprint( - const std::string& digest_alg, - const uint8* digest, - size_t digest_len) { - return false; - } - - // Helper method used only in unittest. - talk_base::DiffServCodePoint DefaultDscpValue() const; - - private: - talk_base::Thread* thread() { return worker_thread_; } - PortAllocatorSession* allocator_session() { - return allocator_sessions_.back(); - } - - void Allocate(); - void UpdateConnectionStates(); - void RequestSort(); - void SortConnections(); - void SwitchBestConnectionTo(Connection* conn); - void UpdateChannelState(); - void HandleWritable(); - void HandleNotWritable(); - void HandleAllTimedOut(); - - Connection* GetBestConnectionOnNetwork(talk_base::Network* network); - bool CreateConnections(const Candidate &remote_candidate, - PortInterface* origin_port, bool readable); - bool CreateConnection(PortInterface* port, const Candidate& remote_candidate, - PortInterface* origin_port, bool readable); - bool FindConnection(cricket::Connection* connection) const; - - uint32 GetRemoteCandidateGeneration(const Candidate& candidate); - bool IsDuplicateRemoteCandidate(const Candidate& candidate); - void RememberRemoteCandidate(const Candidate& remote_candidate, - PortInterface* origin_port); - bool IsPingable(Connection* conn); - Connection* FindNextPingableConnection(); - void PingConnection(Connection* conn); - void AddAllocatorSession(PortAllocatorSession* session); - void AddConnection(Connection* connection); - - void OnPortReady(PortAllocatorSession *session, PortInterface* port); - void OnCandidatesReady(PortAllocatorSession *session, - const std::vector& candidates); - void OnCandidatesAllocationDone(PortAllocatorSession* session); - void OnUnknownAddress(PortInterface* port, - const talk_base::SocketAddress& addr, - ProtocolType proto, - IceMessage* stun_msg, - const std::string& remote_username, - bool port_muxed); - void OnPortDestroyed(PortInterface* port); - void OnRoleConflict(PortInterface* port); - - void OnConnectionStateChange(Connection* connection); - void OnReadPacket(Connection *connection, const char *data, size_t len, - const talk_base::PacketTime& packet_time); - void OnReadyToSend(Connection* connection); - void OnConnectionDestroyed(Connection *connection); - - void OnUseCandidate(Connection* conn); - - virtual void OnMessage(talk_base::Message *pmsg); - void OnSort(); - void OnPing(); - - P2PTransport* transport_; - PortAllocator *allocator_; - talk_base::Thread *worker_thread_; - bool incoming_only_; - bool waiting_for_signaling_; - int error_; - std::vector allocator_sessions_; - std::vector ports_; - std::vector connections_; - Connection* best_connection_; - // Connection selected by the controlling agent. This should be used only - // at controlled side when protocol type is RFC5245. - Connection* pending_best_connection_; - std::vector remote_candidates_; - bool sort_dirty_; // indicates whether another sort is needed right now - bool was_writable_; - typedef std::map OptionMap; - OptionMap options_; - std::string ice_ufrag_; - std::string ice_pwd_; - std::string remote_ice_ufrag_; - std::string remote_ice_pwd_; - IceProtocolType protocol_type_; - IceMode remote_ice_mode_; - IceRole ice_role_; - uint64 tiebreaker_; - uint32 remote_candidate_generation_; - - DISALLOW_EVIL_CONSTRUCTORS(P2PTransportChannel); -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_P2PTRANSPORTCHANNEL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/packetsocketfactory.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/packetsocketfactory.h deleted file mode 100755 index ba8574e..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/packetsocketfactory.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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_BASE_PACKETSOCKETFACTORY_H_ -#define TALK_BASE_PACKETSOCKETFACTORY_H_ - -#include "talk/base/proxyinfo.h" - -namespace talk_base { - -class AsyncPacketSocket; -class AsyncResolverInterface; - -class PacketSocketFactory { - public: - enum Options { - OPT_SSLTCP = 0x01, // Pseudo-TLS. - OPT_TLS = 0x02, - OPT_STUN = 0x04, - }; - - PacketSocketFactory() { } - virtual ~PacketSocketFactory() { } - - virtual AsyncPacketSocket* CreateUdpSocket( - const SocketAddress& address, int min_port, int max_port) = 0; - virtual AsyncPacketSocket* CreateServerTcpSocket( - const SocketAddress& local_address, int min_port, int max_port, - int opts) = 0; - - // TODO: |proxy_info| and |user_agent| should be set - // per-factory and not when socket is created. - virtual AsyncPacketSocket* CreateClientTcpSocket( - const SocketAddress& local_address, const SocketAddress& remote_address, - const ProxyInfo& proxy_info, const std::string& user_agent, int opts) = 0; - - virtual AsyncResolverInterface* CreateAsyncResolver() = 0; - - private: - DISALLOW_EVIL_CONSTRUCTORS(PacketSocketFactory); -}; - -} // namespace talk_base - -#endif // TALK_BASE_PACKETSOCKETFACTORY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/parsing.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/parsing.h deleted file mode 100755 index e15525f..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/parsing.h +++ /dev/null @@ -1,157 +0,0 @@ -/* - * libjingle - * Copyright 2010, 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_P2P_BASE_PARSING_H_ -#define TALK_P2P_BASE_PARSING_H_ - -#include -#include -#include "talk/base/basictypes.h" -#include "talk/base/stringencode.h" -#include "talk/xmllite/xmlelement.h" // Needed to delete ParseError.extra. - -namespace cricket { - -typedef std::vector XmlElements; - -// We decided "bool Parse(in, out*, error*)" is generally the best -// parse signature. "out Parse(in)" doesn't allow for errors. -// "error* Parse(in, out*)" doesn't allow flexible memory management. - -// The error type for parsing. -struct ParseError { - public: - // explains the error - std::string text; - // provide details about what wasn't parsable - const buzz::XmlElement* extra; - - ParseError() : extra(NULL) {} - - ~ParseError() { - delete extra; - } - - void SetText(const std::string& text) { - this->text = text; - } -}; - -// The error type for writing. -struct WriteError { - std::string text; - - void SetText(const std::string& text) { - this->text = text; - } -}; - -// Convenience method for returning a message when parsing fails. -bool BadParse(const std::string& text, ParseError* err); - -// Convenience method for returning a message when writing fails. -bool BadWrite(const std::string& text, WriteError* error); - -// helper XML functions -std::string GetXmlAttr(const buzz::XmlElement* elem, - const buzz::QName& name, - const std::string& def); -std::string GetXmlAttr(const buzz::XmlElement* elem, - const buzz::QName& name, - const char* def); -// Return true if the value is "true" or "1". -bool GetXmlAttr(const buzz::XmlElement* elem, - const buzz::QName& name, bool def); -int GetXmlAttr(const buzz::XmlElement* elem, - const buzz::QName& name, int def); - -template -bool GetXmlAttr(const buzz::XmlElement* elem, - const buzz::QName& name, - T* val_out) { - if (!elem->HasAttr(name)) { - return false; - } - std::string unparsed = elem->Attr(name); - return talk_base::FromString(unparsed, val_out); -} - -template -bool GetXmlAttr(const buzz::XmlElement* elem, - const buzz::QName& name, - const T& def, - T* val_out) { - if (!elem->HasAttr(name)) { - *val_out = def; - return true; - } - return GetXmlAttr(elem, name, val_out); -} - -template -bool AddXmlAttr(buzz::XmlElement* elem, - const buzz::QName& name, const T& val) { - std::string buf; - if (!talk_base::ToString(val, &buf)) { - return false; - } - elem->AddAttr(name, buf); - return true; -} - -template -bool SetXmlBody(buzz::XmlElement* elem, const T& val) { - std::string buf; - if (!talk_base::ToString(val, &buf)) { - return false; - } - elem->SetBodyText(buf); - return true; -} - -const buzz::XmlElement* GetXmlChild(const buzz::XmlElement* parent, - const std::string& name); - -bool RequireXmlChild(const buzz::XmlElement* parent, - const std::string& name, - const buzz::XmlElement** child, - ParseError* error); -bool RequireXmlAttr(const buzz::XmlElement* elem, - const buzz::QName& name, - std::string* value, - ParseError* error); -void AddXmlAttrIfNonEmpty(buzz::XmlElement* elem, - const buzz::QName name, - const std::string& value); -void AddXmlChildren(buzz::XmlElement* parent, - const std::vector& children); -void CopyXmlChildren(const buzz::XmlElement* source, buzz::XmlElement* dest); -std::vector CopyOfXmlChildren(const buzz::XmlElement* elem); - -} // namespace cricket - -#endif // TALK_P2P_BASE_PARSING_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/port.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/port.h deleted file mode 100755 index d5f368b..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/port.h +++ /dev/null @@ -1,596 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_BASE_PORT_H_ -#define TALK_P2P_BASE_PORT_H_ - -#include -#include -#include - -#include "talk/base/asyncpacketsocket.h" -#include "talk/base/network.h" -#include "talk/base/proxyinfo.h" -#include "talk/base/ratetracker.h" -#include "talk/base/sigslot.h" -#include "talk/base/socketaddress.h" -#include "talk/base/thread.h" -#include "talk/p2p/base/candidate.h" -#include "talk/p2p/base/packetsocketfactory.h" -#include "talk/p2p/base/portinterface.h" -#include "talk/p2p/base/stun.h" -#include "talk/p2p/base/stunrequest.h" -#include "talk/p2p/base/transport.h" - -namespace cricket { - -class Connection; -class ConnectionRequest; - -extern const char LOCAL_PORT_TYPE[]; -extern const char STUN_PORT_TYPE[]; -extern const char PRFLX_PORT_TYPE[]; -extern const char RELAY_PORT_TYPE[]; - -extern const char UDP_PROTOCOL_NAME[]; -extern const char TCP_PROTOCOL_NAME[]; -extern const char SSLTCP_PROTOCOL_NAME[]; - -// The length of time we wait before timing out readability on a connection. -const uint32 CONNECTION_READ_TIMEOUT = 30 * 1000; // 30 seconds - -// The length of time we wait before timing out writability on a connection. -const uint32 CONNECTION_WRITE_TIMEOUT = 15 * 1000; // 15 seconds - -// The length of time we wait before we become unwritable. -const uint32 CONNECTION_WRITE_CONNECT_TIMEOUT = 5 * 1000; // 5 seconds - -// The number of pings that must fail to respond before we become unwritable. -const uint32 CONNECTION_WRITE_CONNECT_FAILURES = 5; - -// This is the length of time that we wait for a ping response to come back. -const int CONNECTION_RESPONSE_TIMEOUT = 5 * 1000; // 5 seconds - -enum RelayType { - RELAY_GTURN, // Legacy google relay service. - RELAY_TURN // Standard (TURN) relay service. -}; - -enum IcePriorityValue { - // The reason we are choosing Relay preference 2 is because, we can run - // Relay from client to server on UDP/TCP/TLS. To distinguish the transport - // protocol, we prefer UDP over TCP over TLS. - // For UDP ICE_TYPE_PREFERENCE_RELAY will be 2. - // For TCP ICE_TYPE_PREFERENCE_RELAY will be 1. - // For TLS ICE_TYPE_PREFERENCE_RELAY will be 0. - // Check turnport.cc for setting these values. - ICE_TYPE_PREFERENCE_RELAY = 2, - ICE_TYPE_PREFERENCE_HOST_TCP = 90, - ICE_TYPE_PREFERENCE_SRFLX = 100, - ICE_TYPE_PREFERENCE_PRFLX = 110, - ICE_TYPE_PREFERENCE_HOST = 126 -}; - -const char* ProtoToString(ProtocolType proto); -bool StringToProto(const char* value, ProtocolType* proto); - -struct ProtocolAddress { - talk_base::SocketAddress address; - ProtocolType proto; - bool secure; - - ProtocolAddress(const talk_base::SocketAddress& a, ProtocolType p) - : address(a), proto(p), secure(false) { } - ProtocolAddress(const talk_base::SocketAddress& a, ProtocolType p, bool sec) - : address(a), proto(p), secure(sec) { } -}; - -// Represents a local communication mechanism that can be used to create -// connections to similar mechanisms of the other client. Subclasses of this -// one add support for specific mechanisms like local UDP ports. -class Port : public PortInterface, public talk_base::MessageHandler, - public sigslot::has_slots<> { - public: - Port(talk_base::Thread* thread, talk_base::PacketSocketFactory* factory, - talk_base::Network* network, const talk_base::IPAddress& ip, - const std::string& username_fragment, const std::string& password); - Port(talk_base::Thread* thread, const std::string& type, - talk_base::PacketSocketFactory* factory, - talk_base::Network* network, const talk_base::IPAddress& ip, - int min_port, int max_port, const std::string& username_fragment, - const std::string& password); - virtual ~Port(); - - virtual const std::string& Type() const { return type_; } - virtual talk_base::Network* Network() const { return network_; } - - // This method will set the flag which enables standard ICE/STUN procedures - // in STUN connectivity checks. Currently this method does - // 1. Add / Verify MI attribute in STUN binding requests. - // 2. Username attribute in STUN binding request will be RFRAF:LFRAG, - // as opposed to RFRAGLFRAG. - virtual void SetIceProtocolType(IceProtocolType protocol) { - ice_protocol_ = protocol; - } - virtual IceProtocolType IceProtocol() const { return ice_protocol_; } - - // Methods to set/get ICE role and tiebreaker values. - IceRole GetIceRole() const { return ice_role_; } - void SetIceRole(IceRole role) { ice_role_ = role; } - - void SetIceTiebreaker(uint64 tiebreaker) { tiebreaker_ = tiebreaker; } - uint64 IceTiebreaker() const { return tiebreaker_; } - - virtual bool SharedSocket() const { return shared_socket_; } - - // The thread on which this port performs its I/O. - talk_base::Thread* thread() { return thread_; } - - // The factory used to create the sockets of this port. - talk_base::PacketSocketFactory* socket_factory() const { return factory_; } - void set_socket_factory(talk_base::PacketSocketFactory* factory) { - factory_ = factory; - } - - // For debugging purposes. - const std::string& content_name() const { return content_name_; } - void set_content_name(const std::string& content_name) { - content_name_ = content_name; - } - - int component() const { return component_; } - void set_component(int component) { component_ = component; } - - bool send_retransmit_count_attribute() const { - return send_retransmit_count_attribute_; - } - void set_send_retransmit_count_attribute(bool enable) { - send_retransmit_count_attribute_ = enable; - } - - // Identifies the generation that this port was created in. - uint32 generation() { return generation_; } - void set_generation(uint32 generation) { generation_ = generation; } - - // ICE requires a single username/password per content/media line. So the - // |ice_username_fragment_| of the ports that belongs to the same content will - // be the same. However this causes a small complication with our relay - // server, which expects different username for RTP and RTCP. - // - // To resolve this problem, we implemented the username_fragment(), - // which returns a different username (calculated from - // |ice_username_fragment_|) for RTCP in the case of ICEPROTO_GOOGLE. And the - // username_fragment() simply returns |ice_username_fragment_| when running - // in ICEPROTO_RFC5245. - // - // As a result the ICEPROTO_GOOGLE will use different usernames for RTP and - // RTCP. And the ICEPROTO_RFC5245 will use same username for both RTP and - // RTCP. - const std::string username_fragment() const; - const std::string& password() const { return password_; } - - // Fired when candidates are discovered by the port. When all candidates - // are discovered that belong to port SignalAddressReady is fired. - sigslot::signal2 SignalCandidateReady; - - // Provides all of the above information in one handy object. - virtual const std::vector& Candidates() const { - return candidates_; - } - - // SignalPortComplete is sent when port completes the task of candidates - // allocation. - sigslot::signal1 SignalPortComplete; - // This signal sent when port fails to allocate candidates and this port - // can't be used in establishing the connections. When port is in shared mode - // and port fails to allocate one of the candidates, port shouldn't send - // this signal as other candidates might be usefull in establishing the - // connection. - sigslot::signal1 SignalPortError; - - // Returns a map containing all of the connections of this port, keyed by the - // remote address. - typedef std::map AddressMap; - const AddressMap& connections() { return connections_; } - - // Returns the connection to the given address or NULL if none exists. - virtual Connection* GetConnection( - const talk_base::SocketAddress& remote_addr); - - // Called each time a connection is created. - sigslot::signal2 SignalConnectionCreated; - - // In a shared socket mode each port which shares the socket will decide - // to accept the packet based on the |remote_addr|. Currently only UDP - // port implemented this method. - // TODO(mallinath) - Make it pure virtual. - virtual bool HandleIncomingPacket( - talk_base::AsyncPacketSocket* socket, const char* data, size_t size, - const talk_base::SocketAddress& remote_addr, - const talk_base::PacketTime& packet_time) { - ASSERT(false); - return false; - } - - // Sends a response message (normal or error) to the given request. One of - // these methods should be called as a response to SignalUnknownAddress. - // NOTE: You MUST call CreateConnection BEFORE SendBindingResponse. - virtual void SendBindingResponse(StunMessage* request, - const talk_base::SocketAddress& addr); - virtual void SendBindingErrorResponse( - StunMessage* request, const talk_base::SocketAddress& addr, - int error_code, const std::string& reason); - - void set_proxy(const std::string& user_agent, - const talk_base::ProxyInfo& proxy) { - user_agent_ = user_agent; - proxy_ = proxy; - } - const std::string& user_agent() { return user_agent_; } - const talk_base::ProxyInfo& proxy() { return proxy_; } - - virtual void EnablePortPackets(); - - // Called if the port has no connections and is no longer useful. - void Destroy(); - - virtual void OnMessage(talk_base::Message *pmsg); - - // Debugging description of this port - virtual std::string ToString() const; - talk_base::IPAddress& ip() { return ip_; } - int min_port() { return min_port_; } - int max_port() { return max_port_; } - - // Timeout shortening function to speed up unit tests. - void set_timeout_delay(int delay) { timeout_delay_ = delay; } - - // This method will return local and remote username fragements from the - // stun username attribute if present. - bool ParseStunUsername(const StunMessage* stun_msg, - std::string* local_username, - std::string* remote_username, - IceProtocolType* remote_protocol_type) const; - void CreateStunUsername(const std::string& remote_username, - std::string* stun_username_attr_str) const; - - bool MaybeIceRoleConflict(const talk_base::SocketAddress& addr, - IceMessage* stun_msg, - const std::string& remote_ufrag); - - // Called when the socket is currently able to send. - void OnReadyToSend(); - - // Called when the Connection discovers a local peer reflexive candidate. - // Returns the index of the new local candidate. - size_t AddPrflxCandidate(const Candidate& local); - - // Returns if RFC 5245 ICE protocol is used. - bool IsStandardIce() const; - - // Returns if Google ICE protocol is used. - bool IsGoogleIce() const; - - // Returns if Hybrid ICE protocol is used. - bool IsHybridIce() const; - - protected: - enum { - MSG_CHECKTIMEOUT = 0, - MSG_FIRST_AVAILABLE - }; - - void set_type(const std::string& type) { type_ = type; } - // Fills in the local address of the port. - void AddAddress(const talk_base::SocketAddress& address, - const talk_base::SocketAddress& base_address, - const talk_base::SocketAddress& related_address, - const std::string& protocol, const std::string& type, - uint32 type_preference, bool final); - - // Adds the given connection to the list. (Deleting removes them.) - void AddConnection(Connection* conn); - - // Called when a packet is received from an unknown address that is not - // currently a connection. If this is an authenticated STUN binding request, - // then we will signal the client. - void OnReadPacket(const char* data, size_t size, - const talk_base::SocketAddress& addr, - ProtocolType proto); - - // If the given data comprises a complete and correct STUN message then the - // return value is true, otherwise false. If the message username corresponds - // with this port's username fragment, msg will contain the parsed STUN - // message. Otherwise, the function may send a STUN response internally. - // remote_username contains the remote fragment of the STUN username. - bool GetStunMessage(const char* data, size_t size, - const talk_base::SocketAddress& addr, - IceMessage** out_msg, std::string* out_username); - - // Checks if the address in addr is compatible with the port's ip. - bool IsCompatibleAddress(const talk_base::SocketAddress& addr); - - // Returns default DSCP value. - talk_base::DiffServCodePoint DefaultDscpValue() const { - // No change from what MediaChannel set. - return talk_base::DSCP_NO_CHANGE; - } - - private: - void Construct(); - // Called when one of our connections deletes itself. - void OnConnectionDestroyed(Connection* conn); - - // Checks if this port is useless, and hence, should be destroyed. - void CheckTimeout(); - - talk_base::Thread* thread_; - talk_base::PacketSocketFactory* factory_; - std::string type_; - bool send_retransmit_count_attribute_; - talk_base::Network* network_; - talk_base::IPAddress ip_; - int min_port_; - int max_port_; - std::string content_name_; - int component_; - uint32 generation_; - // In order to establish a connection to this Port (so that real data can be - // sent through), the other side must send us a STUN binding request that is - // authenticated with this username_fragment and password. - // PortAllocatorSession will provide these username_fragment and password. - // - // Note: we should always use username_fragment() instead of using - // |ice_username_fragment_| directly. For the details see the comment on - // username_fragment(). - std::string ice_username_fragment_; - std::string password_; - std::vector candidates_; - AddressMap connections_; - int timeout_delay_; - bool enable_port_packets_; - IceProtocolType ice_protocol_; - IceRole ice_role_; - uint64 tiebreaker_; - bool shared_socket_; - // Information to use when going through a proxy. - std::string user_agent_; - talk_base::ProxyInfo proxy_; - - friend class Connection; -}; - -// Represents a communication link between a port on the local client and a -// port on the remote client. -class Connection : public talk_base::MessageHandler, - public sigslot::has_slots<> { - public: - // States are from RFC 5245. http://tools.ietf.org/html/rfc5245#section-5.7.4 - enum State { - STATE_WAITING = 0, // Check has not been performed, Waiting pair on CL. - STATE_INPROGRESS, // Check has been sent, transaction is in progress. - STATE_SUCCEEDED, // Check already done, produced a successful result. - STATE_FAILED // Check for this connection failed. - }; - - virtual ~Connection(); - - // The local port where this connection sends and receives packets. - Port* port() { return port_; } - const Port* port() const { return port_; } - - // Returns the description of the local port - virtual const Candidate& local_candidate() const; - - // Returns the description of the remote port to which we communicate. - const Candidate& remote_candidate() const { return remote_candidate_; } - - // Returns the pair priority. - uint64 priority() const; - - enum ReadState { - STATE_READ_INIT = 0, // we have yet to receive a ping - STATE_READABLE = 1, // we have received pings recently - STATE_READ_TIMEOUT = 2, // we haven't received pings in a while - }; - - ReadState read_state() const { return read_state_; } - bool readable() const { return read_state_ == STATE_READABLE; } - - enum WriteState { - STATE_WRITABLE = 0, // we have received ping responses recently - STATE_WRITE_UNRELIABLE = 1, // we have had a few ping failures - STATE_WRITE_INIT = 2, // we have yet to receive a ping response - STATE_WRITE_TIMEOUT = 3, // we have had a large number of ping failures - }; - - WriteState write_state() const { return write_state_; } - bool writable() const { return write_state_ == STATE_WRITABLE; } - - // Determines whether the connection has finished connecting. This can only - // be false for TCP connections. - bool connected() const { return connected_; } - - // Estimate of the round-trip time over this connection. - uint32 rtt() const { return rtt_; } - - size_t sent_total_bytes(); - size_t sent_bytes_second(); - size_t recv_total_bytes(); - size_t recv_bytes_second(); - sigslot::signal1 SignalStateChange; - - // Sent when the connection has decided that it is no longer of value. It - // will delete itself immediately after this call. - sigslot::signal1 SignalDestroyed; - - // The connection can send and receive packets asynchronously. This matches - // the interface of AsyncPacketSocket, which may use UDP or TCP under the - // covers. - virtual int Send(const void* data, size_t size, - const talk_base::PacketOptions& options) = 0; - - // Error if Send() returns < 0 - virtual int GetError() = 0; - - sigslot::signal4 SignalReadPacket; - - sigslot::signal1 SignalReadyToSend; - - // Called when a packet is received on this connection. - void OnReadPacket(const char* data, size_t size, - const talk_base::PacketTime& packet_time); - - // Called when the socket is currently able to send. - void OnReadyToSend(); - - // Called when a connection is determined to be no longer useful to us. We - // still keep it around in case the other side wants to use it. But we can - // safely stop pinging on it and we can allow it to time out if the other - // side stops using it as well. - bool pruned() const { return pruned_; } - void Prune(); - - bool use_candidate_attr() const { return use_candidate_attr_; } - void set_use_candidate_attr(bool enable); - - void set_remote_ice_mode(IceMode mode) { - remote_ice_mode_ = mode; - } - - // Makes the connection go away. - void Destroy(); - - // Checks that the state of this connection is up-to-date. The argument is - // the current time, which is compared against various timeouts. - void UpdateState(uint32 now); - - // Called when this connection should try checking writability again. - uint32 last_ping_sent() const { return last_ping_sent_; } - void Ping(uint32 now); - - // Called whenever a valid ping is received on this connection. This is - // public because the connection intercepts the first ping for us. - uint32 last_ping_received() const { return last_ping_received_; } - void ReceivedPing(); - - // Debugging description of this connection - std::string ToString() const; - std::string ToSensitiveString() const; - - bool reported() const { return reported_; } - void set_reported(bool reported) { reported_ = reported;} - - // This flag will be set if this connection is the chosen one for media - // transmission. This connection will send STUN ping with USE-CANDIDATE - // attribute. - sigslot::signal1 SignalUseCandidate; - // Invoked when Connection receives STUN error response with 487 code. - void HandleRoleConflictFromPeer(); - - State state() const { return state_; } - - IceMode remote_ice_mode() const { return remote_ice_mode_; } - - protected: - // Constructs a new connection to the given remote port. - Connection(Port* port, size_t index, const Candidate& candidate); - - // Called back when StunRequestManager has a stun packet to send - void OnSendStunPacket(const void* data, size_t size, StunRequest* req); - - // Callbacks from ConnectionRequest - void OnConnectionRequestResponse(ConnectionRequest* req, - StunMessage* response); - void OnConnectionRequestErrorResponse(ConnectionRequest* req, - StunMessage* response); - void OnConnectionRequestTimeout(ConnectionRequest* req); - - // Changes the state and signals if necessary. - void set_read_state(ReadState value); - void set_write_state(WriteState value); - void set_state(State state); - void set_connected(bool value); - - // Checks if this connection is useless, and hence, should be destroyed. - void CheckTimeout(); - - void OnMessage(talk_base::Message *pmsg); - - Port* port_; - size_t local_candidate_index_; - Candidate remote_candidate_; - ReadState read_state_; - WriteState write_state_; - bool connected_; - bool pruned_; - // By default |use_candidate_attr_| flag will be true, - // as we will be using agrressive nomination. - // But when peer is ice-lite, this flag "must" be initialized to false and - // turn on when connection becomes "best connection". - bool use_candidate_attr_; - IceMode remote_ice_mode_; - StunRequestManager requests_; - uint32 rtt_; - uint32 last_ping_sent_; // last time we sent a ping to the other side - uint32 last_ping_received_; // last time we received a ping from the other - // side - uint32 last_data_received_; - uint32 last_ping_response_received_; - std::vector pings_since_last_response_; - - talk_base::RateTracker recv_rate_tracker_; - talk_base::RateTracker send_rate_tracker_; - - private: - void MaybeAddPrflxCandidate(ConnectionRequest* request, - StunMessage* response); - - bool reported_; - State state_; - - friend class Port; - friend class ConnectionRequest; -}; - -// ProxyConnection defers all the interesting work to the port -class ProxyConnection : public Connection { - public: - ProxyConnection(Port* port, size_t index, const Candidate& candidate); - - virtual int Send(const void* data, size_t size, - const talk_base::PacketOptions& options); - virtual int GetError() { return error_; } - - private: - int error_; -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_PORT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/portallocator.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/portallocator.h deleted file mode 100755 index afce017..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/portallocator.h +++ /dev/null @@ -1,190 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_BASE_PORTALLOCATOR_H_ -#define TALK_P2P_BASE_PORTALLOCATOR_H_ - -#include -#include - -#include "talk/base/helpers.h" -#include "talk/base/proxyinfo.h" -#include "talk/base/sigslot.h" -#include "talk/p2p/base/portinterface.h" - -namespace cricket { - -// PortAllocator is responsible for allocating Port types for a given -// P2PSocket. It also handles port freeing. -// -// Clients can override this class to control port allocation, including -// what kinds of ports are allocated. - -const uint32 PORTALLOCATOR_DISABLE_UDP = 0x01; -const uint32 PORTALLOCATOR_DISABLE_STUN = 0x02; -const uint32 PORTALLOCATOR_DISABLE_RELAY = 0x04; -const uint32 PORTALLOCATOR_DISABLE_TCP = 0x08; -const uint32 PORTALLOCATOR_ENABLE_SHAKER = 0x10; -const uint32 PORTALLOCATOR_ENABLE_BUNDLE = 0x20; -const uint32 PORTALLOCATOR_ENABLE_IPV6 = 0x40; -const uint32 PORTALLOCATOR_ENABLE_SHARED_UFRAG = 0x80; -const uint32 PORTALLOCATOR_ENABLE_SHARED_SOCKET = 0x100; -const uint32 PORTALLOCATOR_ENABLE_STUN_RETRANSMIT_ATTRIBUTE = 0x200; - -const uint32 kDefaultPortAllocatorFlags = 0; - -const uint32 kDefaultStepDelay = 1000; // 1 sec step delay. -// As per RFC 5245 Appendix B.1, STUN transactions need to be paced at certain -// internal. Less than 20ms is not acceptable. We choose 50ms as our default. -const uint32 kMinimumStepDelay = 50; - -class PortAllocatorSessionMuxer; - -class PortAllocatorSession : public sigslot::has_slots<> { - public: - // Content name passed in mostly for logging and debugging. - // TODO(mallinath) - Change username and password to ice_ufrag and ice_pwd. - PortAllocatorSession(const std::string& content_name, - int component, - const std::string& username, - const std::string& password, - uint32 flags); - - // Subclasses should clean up any ports created. - virtual ~PortAllocatorSession() {} - - uint32 flags() const { return flags_; } - void set_flags(uint32 flags) { flags_ = flags; } - std::string content_name() const { return content_name_; } - int component() const { return component_; } - - // Starts gathering STUN and Relay configurations. - virtual void StartGettingPorts() = 0; - virtual void StopGettingPorts() = 0; - virtual bool IsGettingPorts() = 0; - - sigslot::signal2 SignalPortReady; - sigslot::signal2&> SignalCandidatesReady; - sigslot::signal1 SignalCandidatesAllocationDone; - - virtual uint32 generation() { return generation_; } - virtual void set_generation(uint32 generation) { generation_ = generation; } - sigslot::signal1 SignalDestroyed; - - protected: - const std::string& username() const { return username_; } - const std::string& password() const { return password_; } - - std::string content_name_; - int component_; - - private: - uint32 flags_; - uint32 generation_; - std::string username_; - std::string password_; -}; - -class PortAllocator : public sigslot::has_slots<> { - public: - PortAllocator() : - flags_(kDefaultPortAllocatorFlags), - min_port_(0), - max_port_(0), - step_delay_(kDefaultStepDelay), - allow_tcp_listen_(true) { - // This will allow us to have old behavior on non webrtc clients. - } - virtual ~PortAllocator(); - - PortAllocatorSession* CreateSession( - const std::string& sid, - const std::string& content_name, - int component, - const std::string& ice_ufrag, - const std::string& ice_pwd); - - PortAllocatorSessionMuxer* GetSessionMuxer(const std::string& key) const; - void OnSessionMuxerDestroyed(PortAllocatorSessionMuxer* session); - - uint32 flags() const { return flags_; } - void set_flags(uint32 flags) { flags_ = flags; } - - const std::string& user_agent() const { return agent_; } - const talk_base::ProxyInfo& proxy() const { return proxy_; } - void set_proxy(const std::string& agent, const talk_base::ProxyInfo& proxy) { - agent_ = agent; - proxy_ = proxy; - } - - // Gets/Sets the port range to use when choosing client ports. - int min_port() const { return min_port_; } - int max_port() const { return max_port_; } - bool SetPortRange(int min_port, int max_port) { - if (min_port > max_port) { - return false; - } - - min_port_ = min_port; - max_port_ = max_port; - return true; - } - - uint32 step_delay() const { return step_delay_; } - void set_step_delay(uint32 delay) { - ASSERT(delay >= kMinimumStepDelay); - step_delay_ = delay; - } - - bool allow_tcp_listen() const { return allow_tcp_listen_; } - void set_allow_tcp_listen(bool allow_tcp_listen) { - allow_tcp_listen_ = allow_tcp_listen; - } - - protected: - virtual PortAllocatorSession* CreateSessionInternal( - const std::string& content_name, - int component, - const std::string& ice_ufrag, - const std::string& ice_pwd) = 0; - - typedef std::map SessionMuxerMap; - - uint32 flags_; - std::string agent_; - talk_base::ProxyInfo proxy_; - int min_port_; - int max_port_; - uint32 step_delay_; - SessionMuxerMap muxers_; - bool allow_tcp_listen_; -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_PORTALLOCATOR_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/portallocatorsessionproxy.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/portallocatorsessionproxy.h deleted file mode 100755 index 4f57821..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/portallocatorsessionproxy.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * libjingle - * Copyright 2004--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_P2P_BASE_PORTALLOCATORSESSIONPROXY_H_ -#define TALK_P2P_BASE_PORTALLOCATORSESSIONPROXY_H_ - -#include - -#include "talk/p2p/base/candidate.h" -#include "talk/p2p/base/portallocator.h" - -namespace cricket { -class PortAllocator; -class PortAllocatorSessionProxy; -class PortProxy; - -// This class maintains the list of cricket::Port* objects. Ports will be -// deleted upon receiving SignalDestroyed signal. This class is used when -// PORTALLOCATOR_ENABLE_BUNDLE flag is set. - -class PortAllocatorSessionMuxer : public talk_base::MessageHandler, - public sigslot::has_slots<> { - public: - explicit PortAllocatorSessionMuxer(PortAllocatorSession* session); - virtual ~PortAllocatorSessionMuxer(); - - void RegisterSessionProxy(PortAllocatorSessionProxy* session_proxy); - - void OnPortReady(PortAllocatorSession* session, PortInterface* port); - void OnPortDestroyed(PortInterface* port); - void OnCandidatesAllocationDone(PortAllocatorSession* session); - - const std::vector& ports() { return ports_; } - - sigslot::signal1 SignalDestroyed; - - private: - virtual void OnMessage(talk_base::Message *pmsg); - void OnSessionProxyDestroyed(PortAllocatorSession* proxy); - void SendAllocationDone_w(PortAllocatorSessionProxy* proxy); - void SendAllocatedPorts_w(PortAllocatorSessionProxy* proxy); - - // Port will be deleted when SignalDestroyed received, otherwise delete - // happens when PortAllocatorSession dtor is called. - talk_base::Thread* worker_thread_; - std::vector ports_; - talk_base::scoped_ptr session_; - std::vector session_proxies_; - bool candidate_done_signal_received_; -}; - -class PortAllocatorSessionProxy : public PortAllocatorSession { - public: - PortAllocatorSessionProxy(const std::string& content_name, - int component, - uint32 flags) - // Use empty string as the ufrag and pwd because the proxy always uses - // the ufrag and pwd from the underlying implementation. - : PortAllocatorSession(content_name, component, "", "", flags), - impl_(NULL) { - } - - virtual ~PortAllocatorSessionProxy(); - - PortAllocatorSession* impl() { return impl_; } - void set_impl(PortAllocatorSession* session); - - // Forwards call to the actual PortAllocatorSession. - virtual void StartGettingPorts(); - virtual void StopGettingPorts(); - virtual bool IsGettingPorts(); - - virtual void set_generation(uint32 generation) { - ASSERT(impl_ != NULL); - impl_->set_generation(generation); - } - - virtual uint32 generation() { - ASSERT(impl_ != NULL); - return impl_->generation(); - } - - private: - void OnPortReady(PortAllocatorSession* session, PortInterface* port); - void OnCandidatesReady(PortAllocatorSession* session, - const std::vector& candidates); - void OnPortDestroyed(PortInterface* port); - void OnCandidatesAllocationDone(PortAllocatorSession* session); - - // This is the actual PortAllocatorSession, owned by PortAllocator. - PortAllocatorSession* impl_; - std::map proxy_ports_; - - friend class PortAllocatorSessionMuxer; -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_PORTALLOCATORSESSIONPROXY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/portinterface.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/portinterface.h deleted file mode 100755 index cc793b6..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/portinterface.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - * 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_P2P_BASE_PORTINTERFACE_H_ -#define TALK_P2P_BASE_PORTINTERFACE_H_ - -#include - -#include "talk/base/socketaddress.h" -#include "talk/p2p/base/transport.h" - -namespace talk_base { -class Network; -struct PacketOptions; -} - -namespace cricket { -class Connection; -class IceMessage; -class StunMessage; - -enum ProtocolType { - PROTO_UDP, - PROTO_TCP, - PROTO_SSLTCP, - PROTO_LAST = PROTO_SSLTCP -}; - -// Defines the interface for a port, which represents a local communication -// mechanism that can be used to create connections to similar mechanisms of -// the other client. Various types of ports will implement this interface. -class PortInterface { - public: - virtual ~PortInterface() {} - - virtual const std::string& Type() const = 0; - virtual talk_base::Network* Network() const = 0; - - virtual void SetIceProtocolType(IceProtocolType protocol) = 0; - virtual IceProtocolType IceProtocol() const = 0; - - // Methods to set/get ICE role and tiebreaker values. - virtual void SetIceRole(IceRole role) = 0; - virtual IceRole GetIceRole() const = 0; - - virtual void SetIceTiebreaker(uint64 tiebreaker) = 0; - virtual uint64 IceTiebreaker() const = 0; - - virtual bool SharedSocket() const = 0; - - // PrepareAddress will attempt to get an address for this port that other - // clients can send to. It may take some time before the address is ready. - // Once it is ready, we will send SignalAddressReady. If errors are - // preventing the port from getting an address, it may send - // SignalAddressError. - virtual void PrepareAddress() = 0; - - // Returns the connection to the given address or NULL if none exists. - virtual Connection* GetConnection( - const talk_base::SocketAddress& remote_addr) = 0; - - // Creates a new connection to the given address. - enum CandidateOrigin { ORIGIN_THIS_PORT, ORIGIN_OTHER_PORT, ORIGIN_MESSAGE }; - virtual Connection* CreateConnection( - const Candidate& remote_candidate, CandidateOrigin origin) = 0; - - // Functions on the underlying socket(s). - virtual int SetOption(talk_base::Socket::Option opt, int value) = 0; - virtual int GetOption(talk_base::Socket::Option opt, int* value) = 0; - virtual int GetError() = 0; - - virtual const std::vector& Candidates() const = 0; - - // Sends the given packet to the given address, provided that the address is - // that of a connection or an address that has sent to us already. - virtual int SendTo(const void* data, size_t size, - const talk_base::SocketAddress& addr, - const talk_base::PacketOptions& options, bool payload) = 0; - - // Indicates that we received a successful STUN binding request from an - // address that doesn't correspond to any current connection. To turn this - // into a real connection, call CreateConnection. - sigslot::signal6 SignalUnknownAddress; - - // Sends a response message (normal or error) to the given request. One of - // these methods should be called as a response to SignalUnknownAddress. - // NOTE: You MUST call CreateConnection BEFORE SendBindingResponse. - virtual void SendBindingResponse(StunMessage* request, - const talk_base::SocketAddress& addr) = 0; - virtual void SendBindingErrorResponse( - StunMessage* request, const talk_base::SocketAddress& addr, - int error_code, const std::string& reason) = 0; - - // Signaled when this port decides to delete itself because it no longer has - // any usefulness. - sigslot::signal1 SignalDestroyed; - - // Signaled when Port discovers ice role conflict with the peer. - sigslot::signal1 SignalRoleConflict; - - // Normally, packets arrive through a connection (or they result signaling of - // unknown address). Calling this method turns off delivery of packets - // through their respective connection and instead delivers every packet - // through this port. - virtual void EnablePortPackets() = 0; - sigslot::signal4 SignalReadPacket; - - virtual std::string ToString() const = 0; - - protected: - PortInterface() {} -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_PORTINTERFACE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/portproxy.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/portproxy.h deleted file mode 100755 index 0db3ab7..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/portproxy.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * libjingle - * Copyright 2004--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_P2P_BASE_PORTPROXY_H_ -#define TALK_P2P_BASE_PORTPROXY_H_ - -#include "talk/base/sigslot.h" -#include "talk/p2p/base/portinterface.h" - -namespace talk_base { -class Network; -} - -namespace cricket { - -class PortProxy : public PortInterface, public sigslot::has_slots<> { - public: - PortProxy() {} - virtual ~PortProxy() {} - - PortInterface* impl() { return impl_; } - void set_impl(PortInterface* port); - - virtual const std::string& Type() const; - virtual talk_base::Network* Network() const; - - virtual void SetIceProtocolType(IceProtocolType protocol); - virtual IceProtocolType IceProtocol() const; - - // Methods to set/get ICE role and tiebreaker values. - virtual void SetIceRole(IceRole role); - virtual IceRole GetIceRole() const; - - virtual void SetIceTiebreaker(uint64 tiebreaker); - virtual uint64 IceTiebreaker() const; - - virtual bool SharedSocket() const; - - // Forwards call to the actual Port. - virtual void PrepareAddress(); - virtual Connection* CreateConnection(const Candidate& remote_candidate, - CandidateOrigin origin); - virtual Connection* GetConnection( - const talk_base::SocketAddress& remote_addr); - - virtual int SendTo(const void* data, size_t size, - const talk_base::SocketAddress& addr, - const talk_base::PacketOptions& options, - bool payload); - virtual int SetOption(talk_base::Socket::Option opt, int value); - virtual int GetOption(talk_base::Socket::Option opt, int* value); - virtual int GetError(); - - virtual const std::vector& Candidates() const; - - virtual void SendBindingResponse(StunMessage* request, - const talk_base::SocketAddress& addr); - virtual void SendBindingErrorResponse( - StunMessage* request, const talk_base::SocketAddress& addr, - int error_code, const std::string& reason); - - virtual void EnablePortPackets(); - virtual std::string ToString() const; - - private: - void OnUnknownAddress(PortInterface *port, - const talk_base::SocketAddress &addr, - ProtocolType proto, - IceMessage *stun_msg, - const std::string &remote_username, - bool port_muxed); - void OnRoleConflict(PortInterface* port); - void OnPortDestroyed(PortInterface* port); - - PortInterface* impl_; -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_PORTPROXY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/pseudotcp.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/pseudotcp.h deleted file mode 100755 index 8778b52..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/pseudotcp.h +++ /dev/null @@ -1,258 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_BASE_PSEUDOTCP_H_ -#define TALK_P2P_BASE_PSEUDOTCP_H_ - -#include - -#include "talk/base/basictypes.h" -#include "talk/base/stream.h" - -namespace cricket { - -////////////////////////////////////////////////////////////////////// -// IPseudoTcpNotify -////////////////////////////////////////////////////////////////////// - -class PseudoTcp; - -class IPseudoTcpNotify { - public: - // Notification of tcp events - virtual void OnTcpOpen(PseudoTcp* tcp) = 0; - virtual void OnTcpReadable(PseudoTcp* tcp) = 0; - virtual void OnTcpWriteable(PseudoTcp* tcp) = 0; - virtual void OnTcpClosed(PseudoTcp* tcp, uint32 error) = 0; - - // Write the packet onto the network - enum WriteResult { WR_SUCCESS, WR_TOO_LARGE, WR_FAIL }; - virtual WriteResult TcpWritePacket(PseudoTcp* tcp, - const char* buffer, size_t len) = 0; - - protected: - virtual ~IPseudoTcpNotify() {} -}; - -////////////////////////////////////////////////////////////////////// -// PseudoTcp -////////////////////////////////////////////////////////////////////// - -class PseudoTcp { - public: - static uint32 Now(); - - PseudoTcp(IPseudoTcpNotify* notify, uint32 conv); - virtual ~PseudoTcp(); - - int Connect(); - int Recv(char* buffer, size_t len); - int Send(const char* buffer, size_t len); - void Close(bool force); - int GetError(); - - enum TcpState { - TCP_LISTEN, TCP_SYN_SENT, TCP_SYN_RECEIVED, TCP_ESTABLISHED, TCP_CLOSED - }; - TcpState State() const { return m_state; } - - // Call this when the PMTU changes. - void NotifyMTU(uint16 mtu); - - // Call this based on timeout value returned from GetNextClock. - // It's ok to call this too frequently. - void NotifyClock(uint32 now); - - // Call this whenever a packet arrives. - // Returns true if the packet was processed successfully. - bool NotifyPacket(const char * buffer, size_t len); - - // Call this to determine the next time NotifyClock should be called. - // Returns false if the socket is ready to be destroyed. - bool GetNextClock(uint32 now, long& timeout); - - // Call these to get/set option values to tailor this PseudoTcp - // instance's behaviour for the kind of data it will carry. - // If an unrecognized option is set or got, an assertion will fire. - // - // Setting options for OPT_RCVBUF or OPT_SNDBUF after Connect() is called - // will result in an assertion. - enum Option { - OPT_NODELAY, // Whether to enable Nagle's algorithm (0 == off) - OPT_ACKDELAY, // The Delayed ACK timeout (0 == off). - OPT_RCVBUF, // Set the receive buffer size, in bytes. - OPT_SNDBUF, // Set the send buffer size, in bytes. - }; - void GetOption(Option opt, int* value); - void SetOption(Option opt, int value); - - // Returns current congestion window in bytes. - uint32 GetCongestionWindow() const; - - // Returns amount of data in bytes that has been sent, but haven't - // been acknowledged. - uint32 GetBytesInFlight() const; - - // Returns number of bytes that were written in buffer and haven't - // been sent. - uint32 GetBytesBufferedNotSent() const; - - // Returns current round-trip time estimate in milliseconds. - uint32 GetRoundTripTimeEstimateMs() const; - - protected: - enum SendFlags { sfNone, sfDelayedAck, sfImmediateAck }; - - struct Segment { - uint32 conv, seq, ack; - uint8 flags; - uint16 wnd; - const char * data; - uint32 len; - uint32 tsval, tsecr; - }; - - struct SSegment { - SSegment(uint32 s, uint32 l, bool c) - : seq(s), len(l), /*tstamp(0),*/ xmit(0), bCtrl(c) { - } - uint32 seq, len; - //uint32 tstamp; - uint8 xmit; - bool bCtrl; - }; - typedef std::list SList; - - struct RSegment { - uint32 seq, len; - }; - - uint32 queue(const char* data, uint32 len, bool bCtrl); - - // Creates a packet and submits it to the network. This method can either - // send payload or just an ACK packet. - // - // |seq| is the sequence number of this packet. - // |flags| is the flags for sending this packet. - // |offset| is the offset to read from |m_sbuf|. - // |len| is the number of bytes to read from |m_sbuf| as payload. If this - // value is 0 then this is an ACK packet, otherwise this packet has payload. - IPseudoTcpNotify::WriteResult packet(uint32 seq, uint8 flags, - uint32 offset, uint32 len); - bool parse(const uint8* buffer, uint32 size); - - void attemptSend(SendFlags sflags = sfNone); - - void closedown(uint32 err = 0); - - bool clock_check(uint32 now, long& nTimeout); - - bool process(Segment& seg); - bool transmit(const SList::iterator& seg, uint32 now); - - void adjustMTU(); - - protected: - // This method is used in test only to query receive buffer state. - bool isReceiveBufferFull() const; - - // This method is only used in tests, to disable window scaling - // support for testing backward compatibility. - void disableWindowScale(); - - private: - // Queue the connect message with TCP options. - void queueConnectMessage(); - - // Parse TCP options in the header. - void parseOptions(const char* data, uint32 len); - - // Apply a TCP option that has been read from the header. - void applyOption(char kind, const char* data, uint32 len); - - // Apply window scale option. - void applyWindowScaleOption(uint8 scale_factor); - - // Resize the send buffer with |new_size| in bytes. - void resizeSendBuffer(uint32 new_size); - - // Resize the receive buffer with |new_size| in bytes. This call adjusts - // window scale factor |m_swnd_scale| accordingly. - void resizeReceiveBuffer(uint32 new_size); - - IPseudoTcpNotify* m_notify; - enum Shutdown { SD_NONE, SD_GRACEFUL, SD_FORCEFUL } m_shutdown; - int m_error; - - // TCB data - TcpState m_state; - uint32 m_conv; - bool m_bReadEnable, m_bWriteEnable, m_bOutgoing; - uint32 m_lasttraffic; - - // Incoming data - typedef std::list RList; - RList m_rlist; - uint32 m_rbuf_len, m_rcv_nxt, m_rcv_wnd, m_lastrecv; - uint8 m_rwnd_scale; // Window scale factor. - talk_base::FifoBuffer m_rbuf; - - // Outgoing data - SList m_slist; - uint32 m_sbuf_len, m_snd_nxt, m_snd_wnd, m_lastsend, m_snd_una; - uint8 m_swnd_scale; // Window scale factor. - talk_base::FifoBuffer m_sbuf; - - // Maximum segment size, estimated protocol level, largest segment sent - uint32 m_mss, m_msslevel, m_largest, m_mtu_advise; - // Retransmit timer - uint32 m_rto_base; - - // Timestamp tracking - uint32 m_ts_recent, m_ts_lastack; - - // Round-trip calculation - uint32 m_rx_rttvar, m_rx_srtt, m_rx_rto; - - // Congestion avoidance, Fast retransmit/recovery, Delayed ACKs - uint32 m_ssthresh, m_cwnd; - uint8 m_dup_acks; - uint32 m_recover; - uint32 m_t_ack; - - // Configuration options - bool m_use_nagling; - uint32 m_ack_delay; - - // This is used by unit tests to test backward compatibility of - // PseudoTcp implementations that don't support window scaling. - bool m_support_wnd_scale; -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_PSEUDOTCP_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/rawtransport.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/rawtransport.h deleted file mode 100755 index 30ba010..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/rawtransport.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_BASE_RAWTRANSPORT_H_ -#define TALK_P2P_BASE_RAWTRANSPORT_H_ - -#include -#include "talk/p2p/base/transport.h" - -#if defined(FEATURE_ENABLE_PSTN) -namespace cricket { - -// Implements a transport that only sends raw packets, no STUN. As a result, -// it cannot do pings to determine connectivity, so it only uses a single port -// that it thinks will work. -class RawTransport : public Transport, public TransportParser { - public: - RawTransport(talk_base::Thread* signaling_thread, - talk_base::Thread* worker_thread, - const std::string& content_name, - PortAllocator* allocator); - virtual ~RawTransport(); - - virtual bool ParseCandidates(SignalingProtocol protocol, - const buzz::XmlElement* elem, - const CandidateTranslator* translator, - Candidates* candidates, - ParseError* error); - virtual bool WriteCandidates(SignalingProtocol protocol, - const Candidates& candidates, - const CandidateTranslator* translator, - XmlElements* candidate_elems, - WriteError* error); - - protected: - // Creates and destroys raw channels. - virtual TransportChannelImpl* CreateTransportChannel(int component); - virtual void DestroyTransportChannel(TransportChannelImpl* channel); - - private: - // Parses the given element, which should describe the address to use for a - // given channel. This will return false and signal an error if the address - // or channel name is bad. - bool ParseRawAddress(const buzz::XmlElement* elem, - talk_base::SocketAddress* addr, - ParseError* error); - - friend class RawTransportChannel; // For ParseAddress. - - DISALLOW_EVIL_CONSTRUCTORS(RawTransport); -}; - -} // namespace cricket - -#endif // defined(FEATURE_ENABLE_PSTN) - -#endif // TALK_P2P_BASE_RAWTRANSPORT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/rawtransportchannel.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/rawtransportchannel.h deleted file mode 100755 index db5265e..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/rawtransportchannel.h +++ /dev/null @@ -1,206 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_BASE_RAWTRANSPORTCHANNEL_H_ -#define TALK_P2P_BASE_RAWTRANSPORTCHANNEL_H_ - -#include -#include -#include "talk/base/messagequeue.h" -#include "talk/p2p/base/transportchannelimpl.h" -#include "talk/p2p/base/rawtransport.h" -#include "talk/p2p/base/candidate.h" - -#if defined(FEATURE_ENABLE_PSTN) - -namespace talk_base { -class Thread; -} - -namespace cricket { - -class Connection; -class PortAllocator; -class PortAllocatorSession; -class PortInterface; -class RelayPort; -class StunPort; - -// Implements a channel that just sends bare packets once we have received the -// address of the other side. We pick a single address to send them based on -// a simple investigation of NAT type. -class RawTransportChannel : public TransportChannelImpl, - public talk_base::MessageHandler { - public: - RawTransportChannel(const std::string& content_name, - int component, - RawTransport* transport, - talk_base::Thread *worker_thread, - PortAllocator *allocator); - virtual ~RawTransportChannel(); - - // Implementation of normal channel packet sending. - virtual int SendPacket(const char *data, size_t len, - const talk_base::PacketOptions& options, int flags); - virtual int SetOption(talk_base::Socket::Option opt, int value); - virtual int GetError(); - - // Implements TransportChannelImpl. - virtual Transport* GetTransport() { return raw_transport_; } - virtual void SetIceCredentials(const std::string& ice_ufrag, - const std::string& ice_pwd) {} - virtual void SetRemoteIceCredentials(const std::string& ice_ufrag, - const std::string& ice_pwd) {} - - // Creates an allocator session to start figuring out which type of - // port we should send to the other client. This will send - // SignalAvailableCandidate once we have decided. - virtual void Connect(); - - // Resets state back to unconnected. - virtual void Reset(); - - // We don't actually worry about signaling since we can't send new candidates. - virtual void OnSignalingReady() {} - - // Handles a message setting the remote address. We are writable once we - // have this since we now know where to send. - virtual void OnCandidate(const Candidate& candidate); - - void OnRemoteAddress(const talk_base::SocketAddress& remote_address); - - // Below ICE specific virtual methods not implemented. - virtual IceRole GetIceRole() const { return ICEROLE_UNKNOWN; } - virtual void SetIceRole(IceRole role) {} - virtual void SetIceTiebreaker(uint64 tiebreaker) {} - - virtual bool GetIceProtocolType(IceProtocolType* type) const { return false; } - virtual void SetIceProtocolType(IceProtocolType type) {} - - virtual void SetIceUfrag(const std::string& ice_ufrag) {} - virtual void SetIcePwd(const std::string& ice_pwd) {} - virtual void SetRemoteIceMode(IceMode mode) {} - virtual size_t GetConnectionCount() const { return 1; } - - virtual bool GetStats(ConnectionInfos* infos) { - return false; - } - - // DTLS methods. - virtual bool IsDtlsActive() const { return false; } - - // Default implementation. - virtual bool GetSslRole(talk_base::SSLRole* role) const { - return false; - } - - virtual bool SetSslRole(talk_base::SSLRole role) { - return false; - } - - // Set up the ciphers to use for DTLS-SRTP. - virtual bool SetSrtpCiphers(const std::vector& ciphers) { - return false; - } - - // Find out which DTLS-SRTP cipher was negotiated - virtual bool GetSrtpCipher(std::string* cipher) { - return false; - } - - // Returns false because the channel is not DTLS. - virtual bool GetLocalIdentity(talk_base::SSLIdentity** identity) const { - return false; - } - - virtual bool GetRemoteCertificate(talk_base::SSLCertificate** cert) const { - return false; - } - - // Allows key material to be extracted for external encryption. - virtual bool ExportKeyingMaterial( - const std::string& label, - const uint8* context, - size_t context_len, - bool use_context, - uint8* result, - size_t result_len) { - return false; - } - - virtual bool SetLocalIdentity(talk_base::SSLIdentity* identity) { - return false; - } - - // Set DTLS Remote fingerprint. Must be after local identity set. - virtual bool SetRemoteFingerprint( - const std::string& digest_alg, - const uint8* digest, - size_t digest_len) { - return false; - } - - private: - RawTransport* raw_transport_; - talk_base::Thread *worker_thread_; - PortAllocator* allocator_; - PortAllocatorSession* allocator_session_; - StunPort* stun_port_; - RelayPort* relay_port_; - PortInterface* port_; - bool use_relay_; - talk_base::SocketAddress remote_address_; - - // Called when the allocator creates another port. - void OnPortReady(PortAllocatorSession* session, PortInterface* port); - - // Called when one of the ports we are using has determined its address. - void OnCandidatesReady(PortAllocatorSession *session, - const std::vector& candidates); - - // Called once we have chosen the port to use for communication with the - // other client. This will send its address and prepare the port for use. - void SetPort(PortInterface* port); - - // Called once we have a port and a remote address. This will set mark the - // channel as writable and signal the route to the client. - void SetWritable(); - - // Called when we receive a packet from the other client. - void OnReadPacket(PortInterface* port, const char* data, size_t size, - const talk_base::SocketAddress& addr); - - // Handles a message to destroy unused ports. - virtual void OnMessage(talk_base::Message *msg); - - DISALLOW_EVIL_CONSTRUCTORS(RawTransportChannel); -}; - -} // namespace cricket - -#endif // defined(FEATURE_ENABLE_PSTN) -#endif // TALK_P2P_BASE_RAWTRANSPORTCHANNEL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/relayport.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/relayport.h deleted file mode 100755 index b56bf26..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/relayport.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_BASE_RELAYPORT_H_ -#define TALK_P2P_BASE_RELAYPORT_H_ - -#include -#include -#include -#include - -#include "talk/p2p/base/port.h" -#include "talk/p2p/base/stunrequest.h" - -namespace cricket { - -class RelayEntry; -class RelayConnection; - -// Communicates using an allocated port on the relay server. For each -// remote candidate that we try to send data to a RelayEntry instance -// is created. The RelayEntry will try to reach the remote destination -// by connecting to all available server addresses in a pre defined -// order with a small delay in between. When a connection is -// successful all other connection attemts are aborted. -class RelayPort : public Port { - public: - typedef std::pair OptionValue; - - // RelayPort doesn't yet do anything fancy in the ctor. - static RelayPort* Create( - talk_base::Thread* thread, talk_base::PacketSocketFactory* factory, - talk_base::Network* network, const talk_base::IPAddress& ip, - int min_port, int max_port, const std::string& username, - const std::string& password) { - return new RelayPort(thread, factory, network, ip, min_port, max_port, - username, password); - } - virtual ~RelayPort(); - - void AddServerAddress(const ProtocolAddress& addr); - void AddExternalAddress(const ProtocolAddress& addr); - - const std::vector& options() const { return options_; } - bool HasMagicCookie(const char* data, size_t size); - - virtual void PrepareAddress(); - virtual Connection* CreateConnection(const Candidate& address, - CandidateOrigin origin); - virtual int SetOption(talk_base::Socket::Option opt, int value); - virtual int GetOption(talk_base::Socket::Option opt, int* value); - virtual int GetError(); - - const ProtocolAddress * ServerAddress(size_t index) const; - bool IsReady() { return ready_; } - - // Used for testing. - sigslot::signal1 SignalConnectFailure; - sigslot::signal1 SignalSoftTimeout; - - protected: - RelayPort(talk_base::Thread* thread, talk_base::PacketSocketFactory* factory, - talk_base::Network*, const talk_base::IPAddress& ip, - int min_port, int max_port, const std::string& username, - const std::string& password); - bool Init(); - - void SetReady(); - - virtual int SendTo(const void* data, size_t size, - const talk_base::SocketAddress& addr, - const talk_base::PacketOptions& options, - bool payload); - - // Dispatches the given packet to the port or connection as appropriate. - void OnReadPacket(const char* data, size_t size, - const talk_base::SocketAddress& remote_addr, - ProtocolType proto, - const talk_base::PacketTime& packet_time); - - private: - friend class RelayEntry; - - std::deque server_addr_; - std::vector external_addr_; - bool ready_; - std::vector entries_; - std::vector options_; - int error_; -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_RELAYPORT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/relayserver.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/relayserver.h deleted file mode 100755 index ad33adc..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/relayserver.h +++ /dev/null @@ -1,252 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_BASE_RELAYSERVER_H_ -#define TALK_P2P_BASE_RELAYSERVER_H_ - -#include -#include -#include - -#include "talk/base/asyncudpsocket.h" -#include "talk/base/socketaddresspair.h" -#include "talk/base/thread.h" -#include "talk/base/timeutils.h" -#include "talk/p2p/base/port.h" -#include "talk/p2p/base/stun.h" - -namespace cricket { - -class RelayServerBinding; -class RelayServerConnection; - -// Relays traffic between connections to the server that are "bound" together. -// All connections created with the same username/password are bound together. -class RelayServer : public talk_base::MessageHandler, - public sigslot::has_slots<> { - public: - // Creates a server, which will use this thread to post messages to itself. - explicit RelayServer(talk_base::Thread* thread); - ~RelayServer(); - - talk_base::Thread* thread() { return thread_; } - - // Indicates whether we will print updates of the number of bindings. - bool log_bindings() const { return log_bindings_; } - void set_log_bindings(bool log_bindings) { log_bindings_ = log_bindings; } - - // Updates the set of sockets that the server uses to talk to "internal" - // clients. These are clients that do the "port allocations". - void AddInternalSocket(talk_base::AsyncPacketSocket* socket); - void RemoveInternalSocket(talk_base::AsyncPacketSocket* socket); - - // Updates the set of sockets that the server uses to talk to "external" - // clients. These are the clients that do not do allocations. They do not - // know that these addresses represent a relay server. - void AddExternalSocket(talk_base::AsyncPacketSocket* socket); - void RemoveExternalSocket(talk_base::AsyncPacketSocket* socket); - - // Starts listening for connections on this sockets. When someone - // tries to connect, the connection will be accepted and a new - // internal socket will be added. - void AddInternalServerSocket(talk_base::AsyncSocket* socket, - cricket::ProtocolType proto); - - // Removes this server socket from the list. - void RemoveInternalServerSocket(talk_base::AsyncSocket* socket); - - // Methods for testing and debuging. - int GetConnectionCount() const; - talk_base::SocketAddressPair GetConnection(int connection) const; - bool HasConnection(const talk_base::SocketAddress& address) const; - - private: - typedef std::vector SocketList; - typedef std::map ServerSocketMap; - typedef std::map BindingMap; - typedef std::map ConnectionMap; - - talk_base::Thread* thread_; - bool log_bindings_; - SocketList internal_sockets_; - SocketList external_sockets_; - SocketList removed_sockets_; - ServerSocketMap server_sockets_; - BindingMap bindings_; - ConnectionMap connections_; - - // Called when a packet is received by the server on one of its sockets. - void OnInternalPacket(talk_base::AsyncPacketSocket* socket, - const char* bytes, size_t size, - const talk_base::SocketAddress& remote_addr, - const talk_base::PacketTime& packet_time); - void OnExternalPacket(talk_base::AsyncPacketSocket* socket, - const char* bytes, size_t size, - const talk_base::SocketAddress& remote_addr, - const talk_base::PacketTime& packet_time); - - void OnReadEvent(talk_base::AsyncSocket* socket); - - // Processes the relevant STUN request types from the client. - bool HandleStun(const char* bytes, size_t size, - const talk_base::SocketAddress& remote_addr, - talk_base::AsyncPacketSocket* socket, - std::string* username, StunMessage* msg); - void HandleStunAllocate(const char* bytes, size_t size, - const talk_base::SocketAddressPair& ap, - talk_base::AsyncPacketSocket* socket); - void HandleStun(RelayServerConnection* int_conn, const char* bytes, - size_t size); - void HandleStunAllocate(RelayServerConnection* int_conn, - const StunMessage& msg); - void HandleStunSend(RelayServerConnection* int_conn, const StunMessage& msg); - - // Adds/Removes the a connection or binding. - void AddConnection(RelayServerConnection* conn); - void RemoveConnection(RelayServerConnection* conn); - void RemoveBinding(RelayServerBinding* binding); - - // Handle messages in our worker thread. - void OnMessage(talk_base::Message *pmsg); - - // Called when the timer for checking lifetime times out. - void OnTimeout(RelayServerBinding* binding); - - // Accept connections on this server socket. - void AcceptConnection(talk_base::AsyncSocket* server_socket); - - friend class RelayServerConnection; - friend class RelayServerBinding; -}; - -// Maintains information about a connection to the server. Each connection is -// part of one and only one binding. -class RelayServerConnection { - public: - RelayServerConnection(RelayServerBinding* binding, - const talk_base::SocketAddressPair& addrs, - talk_base::AsyncPacketSocket* socket); - ~RelayServerConnection(); - - RelayServerBinding* binding() { return binding_; } - talk_base::AsyncPacketSocket* socket() { return socket_; } - - // Returns a pair where the source is the remote address and the destination - // is the local address. - const talk_base::SocketAddressPair& addr_pair() { return addr_pair_; } - - // Sends a packet to the connected client. If an address is provided, then - // we make sure the internal client receives it, wrapping if necessary. - void Send(const char* data, size_t size); - void Send(const char* data, size_t size, - const talk_base::SocketAddress& ext_addr); - - // Sends a STUN message to the connected client with no wrapping. - void SendStun(const StunMessage& msg); - void SendStunError(const StunMessage& request, int code, const char* desc); - - // A locked connection is one for which we know the intended destination of - // any raw packet received. - bool locked() const { return locked_; } - void Lock(); - void Unlock(); - - // Records the address that raw packets should be forwarded to (for internal - // packets only; for external, we already know where they go). - const talk_base::SocketAddress& default_destination() const { - return default_dest_; - } - void set_default_destination(const talk_base::SocketAddress& addr) { - default_dest_ = addr; - } - - private: - RelayServerBinding* binding_; - talk_base::SocketAddressPair addr_pair_; - talk_base::AsyncPacketSocket* socket_; - bool locked_; - talk_base::SocketAddress default_dest_; -}; - -// Records a set of internal and external connections that we relay between, -// or in other words, that are "bound" together. -class RelayServerBinding : public talk_base::MessageHandler { - public: - RelayServerBinding( - RelayServer* server, const std::string& username, - const std::string& password, uint32 lifetime); - virtual ~RelayServerBinding(); - - RelayServer* server() { return server_; } - uint32 lifetime() { return lifetime_; } - const std::string& username() { return username_; } - const std::string& password() { return password_; } - const std::string& magic_cookie() { return magic_cookie_; } - - // Adds/Removes a connection into the binding. - void AddInternalConnection(RelayServerConnection* conn); - void AddExternalConnection(RelayServerConnection* conn); - - // We keep track of the use of each binding. If we detect that it was not - // used for longer than the lifetime, then we send a signal. - void NoteUsed(); - sigslot::signal1 SignalTimeout; - - // Determines whether the given packet has the magic cookie present (in the - // right place). - bool HasMagicCookie(const char* bytes, size_t size) const; - - // Determines the connection to use to send packets to or from the given - // external address. - RelayServerConnection* GetInternalConnection( - const talk_base::SocketAddress& ext_addr); - RelayServerConnection* GetExternalConnection( - const talk_base::SocketAddress& ext_addr); - - // MessageHandler: - void OnMessage(talk_base::Message *pmsg); - - private: - RelayServer* server_; - - std::string username_; - std::string password_; - std::string magic_cookie_; - - std::vector internal_connections_; - std::vector external_connections_; - - uint32 lifetime_; - uint32 last_used_; - // TODO: bandwidth -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_RELAYSERVER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/session.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/session.h deleted file mode 100755 index 06ff403..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/session.h +++ /dev/null @@ -1,768 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_BASE_SESSION_H_ -#define TALK_P2P_BASE_SESSION_H_ - -#include -#include -#include -#include - -#include "talk/base/refcount.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/scoped_ref_ptr.h" -#include "talk/base/socketaddress.h" -#include "talk/p2p/base/parsing.h" -#include "talk/p2p/base/port.h" -#include "talk/p2p/base/sessionclient.h" -#include "talk/p2p/base/sessionmanager.h" -#include "talk/p2p/base/sessionmessages.h" -#include "talk/p2p/base/transport.h" -#include "talk/xmllite/xmlelement.h" -#include "talk/xmpp/constants.h" - -namespace cricket { - -class BaseSession; -class P2PTransportChannel; -class Transport; -class TransportChannel; -class TransportChannelProxy; -class TransportChannelImpl; - -typedef talk_base::RefCountedObject > -TransportWrapper; - -// Used for errors that will send back a specific error message to the -// remote peer. We add "type" to the errors because it's needed for -// SignalErrorMessage. -struct MessageError : ParseError { - buzz::QName type; - - // if unset, assume type is a parse error - MessageError() : ParseError(), type(buzz::QN_STANZA_BAD_REQUEST) {} - - void SetType(const buzz::QName type) { - this->type = type; - } -}; - -// Used for errors that may be returned by public session methods that -// can fail. -// TODO: Use this error in Session::Initiate and -// Session::Accept. -struct SessionError : WriteError { -}; - -// Bundles a Transport and ChannelMap together. ChannelMap is used to -// create transport channels before receiving or sending a session -// initiate, and for speculatively connecting channels. Previously, a -// session had one ChannelMap and transport. Now, with multiple -// transports per session, we need multiple ChannelMaps as well. - -typedef std::map ChannelMap; - -class TransportProxy : public sigslot::has_slots<>, - public CandidateTranslator { - public: - TransportProxy( - talk_base::Thread* worker_thread, - const std::string& sid, - const std::string& content_name, - TransportWrapper* transport) - : worker_thread_(worker_thread), - sid_(sid), - content_name_(content_name), - transport_(transport), - connecting_(false), - negotiated_(false), - sent_candidates_(false), - candidates_allocated_(false), - local_description_set_(false), - remote_description_set_(false) { - transport_->get()->SignalCandidatesReady.connect( - this, &TransportProxy::OnTransportCandidatesReady); - } - ~TransportProxy(); - - std::string content_name() const { return content_name_; } - // TODO(juberti): It's not good form to expose the object you're wrapping, - // since callers can mutate it. Can we make this return a const Transport*? - Transport* impl() const { return transport_->get(); } - - std::string type() const; - bool negotiated() const { return negotiated_; } - const Candidates& sent_candidates() const { return sent_candidates_; } - const Candidates& unsent_candidates() const { return unsent_candidates_; } - bool candidates_allocated() const { return candidates_allocated_; } - void set_candidates_allocated(bool allocated) { - candidates_allocated_ = allocated; - } - - TransportChannel* GetChannel(int component); - TransportChannel* CreateChannel(const std::string& channel_name, - int component); - bool HasChannel(int component); - void DestroyChannel(int component); - - void AddSentCandidates(const Candidates& candidates); - void AddUnsentCandidates(const Candidates& candidates); - void ClearSentCandidates() { sent_candidates_.clear(); } - void ClearUnsentCandidates() { unsent_candidates_.clear(); } - - // Start the connection process for any channels, creating impls if needed. - void ConnectChannels(); - // Hook up impls to the proxy channels. Doesn't change connect state. - void CompleteNegotiation(); - - // Mux this proxy onto the specified proxy's transport. - bool SetupMux(TransportProxy* proxy); - - // Simple functions that thunk down to the same functions on Transport. - void SetIceRole(IceRole role); - void SetIdentity(talk_base::SSLIdentity* identity); - bool SetLocalTransportDescription(const TransportDescription& description, - ContentAction action, - std::string* error_desc); - bool SetRemoteTransportDescription(const TransportDescription& description, - ContentAction action, - std::string* error_desc); - void OnSignalingReady(); - bool OnRemoteCandidates(const Candidates& candidates, std::string* error); - - // CandidateTranslator methods. - virtual bool GetChannelNameFromComponent( - int component, std::string* channel_name) const; - virtual bool GetComponentFromChannelName( - const std::string& channel_name, int* component) const; - - // Called when a transport signals that it has new candidates. - void OnTransportCandidatesReady(cricket::Transport* transport, - const Candidates& candidates) { - SignalCandidatesReady(this, candidates); - } - - bool local_description_set() const { - return local_description_set_; - } - bool remote_description_set() const { - return remote_description_set_; - } - - // Handles sending of ready candidates and receiving of remote candidates. - sigslot::signal2&> SignalCandidatesReady; - - private: - TransportChannelProxy* GetChannelProxy(int component) const; - TransportChannelProxy* GetChannelProxyByName(const std::string& name) const; - - TransportChannelImpl* GetOrCreateChannelProxyImpl(int component); - TransportChannelImpl* GetOrCreateChannelProxyImpl_w(int component); - - // Manipulators of transportchannelimpl in channel proxy. - void SetupChannelProxy(int component, - TransportChannelProxy* proxy); - void SetupChannelProxy_w(int component, - TransportChannelProxy* proxy); - void ReplaceChannelProxyImpl(TransportChannelProxy* proxy, - TransportChannelImpl* impl); - void ReplaceChannelProxyImpl_w(TransportChannelProxy* proxy, - TransportChannelImpl* impl); - - talk_base::Thread* worker_thread_; - std::string sid_; - std::string content_name_; - talk_base::scoped_refptr transport_; - bool connecting_; - bool negotiated_; - ChannelMap channels_; - Candidates sent_candidates_; - Candidates unsent_candidates_; - bool candidates_allocated_; - bool local_description_set_; - bool remote_description_set_; -}; - -typedef std::map TransportMap; - -// Statistics for all the transports of this session. -typedef std::map TransportStatsMap; -typedef std::map ProxyTransportMap; - -struct SessionStats { - ProxyTransportMap proxy_to_transport; - TransportStatsMap transport_stats; -}; - -// A BaseSession manages general session state. This includes negotiation -// of both the application-level and network-level protocols: the former -// defines what will be sent and the latter defines how it will be sent. Each -// network-level protocol is represented by a Transport object. Each Transport -// participates in the network-level negotiation. The individual streams of -// packets are represented by TransportChannels. The application-level protocol -// is represented by SessionDecription objects. -class BaseSession : public sigslot::has_slots<>, - public talk_base::MessageHandler { - public: - enum { - MSG_TIMEOUT = 0, - MSG_ERROR, - MSG_STATE, - }; - - enum State { - STATE_INIT = 0, - STATE_SENTINITIATE, // sent initiate, waiting for Accept or Reject - STATE_RECEIVEDINITIATE, // received an initiate. Call Accept or Reject - STATE_SENTPRACCEPT, // sent provisional Accept - STATE_SENTACCEPT, // sent accept. begin connecting transport - STATE_RECEIVEDPRACCEPT, // received provisional Accept, waiting for Accept - STATE_RECEIVEDACCEPT, // received accept. begin connecting transport - STATE_SENTMODIFY, // sent modify, waiting for Accept or Reject - STATE_RECEIVEDMODIFY, // received modify, call Accept or Reject - STATE_SENTREJECT, // sent reject after receiving initiate - STATE_RECEIVEDREJECT, // received reject after sending initiate - STATE_SENTREDIRECT, // sent direct after receiving initiate - STATE_SENTTERMINATE, // sent terminate (any time / either side) - STATE_RECEIVEDTERMINATE, // received terminate (any time / either side) - STATE_INPROGRESS, // session accepted and in progress - STATE_DEINIT, // session is being destroyed - }; - - enum Error { - ERROR_NONE = 0, // no error - ERROR_TIME = 1, // no response to signaling - ERROR_RESPONSE = 2, // error during signaling - ERROR_NETWORK = 3, // network error, could not allocate network resources - ERROR_CONTENT = 4, // channel errors in SetLocalContent/SetRemoteContent - ERROR_TRANSPORT = 5, // transport error of some kind - }; - - // Convert State to a readable string. - static std::string StateToString(State state); - - BaseSession(talk_base::Thread* signaling_thread, - talk_base::Thread* worker_thread, - PortAllocator* port_allocator, - const std::string& sid, - const std::string& content_type, - bool initiator); - virtual ~BaseSession(); - - talk_base::Thread* signaling_thread() { return signaling_thread_; } - talk_base::Thread* worker_thread() { return worker_thread_; } - PortAllocator* port_allocator() { return port_allocator_; } - - // The ID of this session. - const std::string& id() const { return sid_; } - - // TODO(juberti): This data is largely redundant, as it can now be obtained - // from local/remote_description(). Remove these functions and members. - // Returns the XML namespace identifying the type of this session. - const std::string& content_type() const { return content_type_; } - // Returns the XML namespace identifying the transport used for this session. - const std::string& transport_type() const { return transport_type_; } - - // Indicates whether we initiated this session. - bool initiator() const { return initiator_; } - - // Returns the application-level description given by our client. - // If we are the recipient, this will be NULL until we send an accept. - const SessionDescription* local_description() const { - return local_description_; - } - // Returns the application-level description given by the other client. - // If we are the initiator, this will be NULL until we receive an accept. - const SessionDescription* remote_description() const { - return remote_description_; - } - SessionDescription* remote_description() { - return remote_description_; - } - - // Takes ownership of SessionDescription* - bool set_local_description(const SessionDescription* sdesc) { - if (sdesc != local_description_) { - delete local_description_; - local_description_ = sdesc; - } - return true; - } - - // Takes ownership of SessionDescription* - bool set_remote_description(SessionDescription* sdesc) { - if (sdesc != remote_description_) { - delete remote_description_; - remote_description_ = sdesc; - } - return true; - } - - const SessionDescription* initiator_description() const { - if (initiator_) { - return local_description_; - } else { - return remote_description_; - } - } - - // Returns the current state of the session. See the enum above for details. - // Each time the state changes, we will fire this signal. - State state() const { return state_; } - sigslot::signal2 SignalState; - - // Returns the last error in the session. See the enum above for details. - // Each time the an error occurs, we will fire this signal. - Error error() const { return error_; } - const std::string& error_desc() const { return error_desc_; } - sigslot::signal2 SignalError; - - // Updates the state, signaling if necessary. - virtual void SetState(State state); - - // Updates the error state, signaling if necessary. - // TODO(ronghuawu): remove the SetError method that doesn't take |error_desc|. - virtual void SetError(Error error, const std::string& error_desc); - - // Fired when the remote description is updated, with the updated - // contents. - sigslot::signal2 - SignalRemoteDescriptionUpdate; - - // Fired when SetState is called (regardless if there's a state change), which - // indicates the session description might have be updated. - sigslot::signal2 SignalNewLocalDescription; - - // Fired when SetState is called (regardless if there's a state change), which - // indicates the session description might have be updated. - sigslot::signal2 SignalNewRemoteDescription; - - // Returns the transport that has been negotiated or NULL if - // negotiation is still in progress. - virtual Transport* GetTransport(const std::string& content_name); - - // Creates a new channel with the given names. This method may be called - // immediately after creating the session. However, the actual - // implementation may not be fixed until transport negotiation completes. - // This will usually be called from the worker thread, but that - // shouldn't be an issue since the main thread will be blocked in - // Send when doing so. - virtual TransportChannel* CreateChannel(const std::string& content_name, - const std::string& channel_name, - int component); - - // Returns the channel with the given names. - virtual TransportChannel* GetChannel(const std::string& content_name, - int component); - - // Destroys the channel with the given names. - // This will usually be called from the worker thread, but that - // shouldn't be an issue since the main thread will be blocked in - // Send when doing so. - virtual void DestroyChannel(const std::string& content_name, - int component); - - // Returns stats for all channels of all transports. - // This avoids exposing the internal structures used to track them. - virtual bool GetStats(SessionStats* stats); - - talk_base::SSLIdentity* identity() { return identity_; } - - protected: - // Specifies the identity to use in this session. - bool SetIdentity(talk_base::SSLIdentity* identity); - - bool PushdownTransportDescription(ContentSource source, - ContentAction action, - std::string* error_desc); - void set_initiator(bool initiator) { initiator_ = initiator; } - - const TransportMap& transport_proxies() const { return transports_; } - // Get a TransportProxy by content_name or transport. NULL if not found. - TransportProxy* GetTransportProxy(const std::string& content_name); - TransportProxy* GetTransportProxy(const Transport* transport); - TransportProxy* GetFirstTransportProxy(); - void DestroyTransportProxy(const std::string& content_name); - // TransportProxy is owned by session. Return proxy just for convenience. - TransportProxy* GetOrCreateTransportProxy(const std::string& content_name); - // Creates the actual transport object. Overridable for testing. - virtual Transport* CreateTransport(const std::string& content_name); - - void OnSignalingReady(); - void SpeculativelyConnectAllTransportChannels(); - // Helper method to provide remote candidates to the transport. - bool OnRemoteCandidates(const std::string& content_name, - const Candidates& candidates, - std::string* error); - - // This method will mux transport channels by content_name. - // First content is used for muxing. - bool MaybeEnableMuxingSupport(); - - // Called when a transport requests signaling. - virtual void OnTransportRequestSignaling(Transport* transport) { - } - - // Called when the first channel of a transport begins connecting. We use - // this to start a timer, to make sure that the connection completes in a - // reasonable amount of time. - virtual void OnTransportConnecting(Transport* transport) { - } - - // Called when a transport changes its writable state. We track this to make - // sure that the transport becomes writable within a reasonable amount of - // time. If this does not occur, we signal an error. - virtual void OnTransportWritable(Transport* transport) { - } - virtual void OnTransportReadable(Transport* transport) { - } - - // Called when a transport has found its steady-state connections. - virtual void OnTransportCompleted(Transport* transport) { - } - - // Called when a transport has failed permanently. - virtual void OnTransportFailed(Transport* transport) { - } - - // Called when a transport signals that it has new candidates. - virtual void OnTransportProxyCandidatesReady(TransportProxy* proxy, - const Candidates& candidates) { - } - - // Called when a transport signals that it found an error in an incoming - // message. - virtual void OnTransportSendError(Transport* transport, - const buzz::XmlElement* stanza, - const buzz::QName& name, - const std::string& type, - const std::string& text, - const buzz::XmlElement* extra_info) { - } - - virtual void OnTransportRouteChange( - Transport* transport, - int component, - const cricket::Candidate& remote_candidate) { - } - - virtual void OnTransportCandidatesAllocationDone(Transport* transport); - - // Called when all transport channels allocated required candidates. - // This method should be used as an indication of candidates gathering process - // is completed and application can now send local candidates list to remote. - virtual void OnCandidatesAllocationDone() { - } - - // Handles the ice role change callback from Transport. This must be - // propagated to all the transports. - virtual void OnRoleConflict(); - - // Handles messages posted to us. - virtual void OnMessage(talk_base::Message *pmsg); - - protected: - State state_; - Error error_; - std::string error_desc_; - - private: - // Helper methods to push local and remote transport descriptions. - bool PushdownLocalTransportDescription( - const SessionDescription* sdesc, ContentAction action, - std::string* error_desc); - bool PushdownRemoteTransportDescription( - const SessionDescription* sdesc, ContentAction action, - std::string* error_desc); - - bool IsCandidateAllocationDone() const; - void MaybeCandidateAllocationDone(); - - // This method will delete the Transport and TransportChannelImpls and - // replace those with the selected Transport objects. Selection is done - // based on the content_name and in this case first MediaContent information - // is used for mux. - bool SetSelectedProxy(const std::string& content_name, - const ContentGroup* muxed_group); - // Log session state. - void LogState(State old_state, State new_state); - - // Returns true and the TransportInfo of the given |content_name| - // from |description|. Returns false if it's not available. - bool GetTransportDescription(const SessionDescription* description, - const std::string& content_name, - TransportDescription* info); - - // Fires the new description signal according to the current state. - void SignalNewDescription(); - - // Gets the ContentAction and ContentSource according to the session state. - bool GetContentAction(ContentAction* action, ContentSource* source); - - talk_base::Thread* signaling_thread_; - talk_base::Thread* worker_thread_; - PortAllocator* port_allocator_; - std::string sid_; - std::string content_type_; - std::string transport_type_; - bool initiator_; - talk_base::SSLIdentity* identity_; - const SessionDescription* local_description_; - SessionDescription* remote_description_; - uint64 ice_tiebreaker_; - // This flag will be set to true after the first role switch. This flag - // will enable us to stop any role switch during the call. - bool role_switch_; - TransportMap transports_; -}; - -// A specific Session created by the SessionManager, using XMPP for protocol. -class Session : public BaseSession { - public: - // Returns the manager that created and owns this session. - SessionManager* session_manager() const { return session_manager_; } - - // Returns the client that is handling the application data of this session. - SessionClient* client() const { return client_; } - - // Returns the JID of this client. - const std::string& local_name() const { return local_name_; } - - // Returns the JID of the other peer in this session. - const std::string& remote_name() const { return remote_name_; } - - // Set the JID of the other peer in this session. - // Typically the remote_name_ is set when the session is initiated. - // However, sometimes (e.g when a proxy is used) the peer name is - // known after the BaseSession has been initiated and it must be updated - // explicitly. - void set_remote_name(const std::string& name) { remote_name_ = name; } - - // Set the JID of the initiator of this session. Allows for the overriding - // of the initiator to be a third-party, eg. the MUC JID when creating p2p - // sessions. - void set_initiator_name(const std::string& name) { initiator_name_ = name; } - - // Indicates the JID of the entity who initiated this session. - // In special cases, may be different than both local_name and remote_name. - const std::string& initiator_name() const { return initiator_name_; } - - SignalingProtocol current_protocol() const { return current_protocol_; } - - void set_current_protocol(SignalingProtocol protocol) { - current_protocol_ = protocol; - } - - // Updates the error state, signaling if necessary. - virtual void SetError(Error error, const std::string& error_desc); - - // When the session needs to send signaling messages, it beings by requesting - // signaling. The client should handle this by calling OnSignalingReady once - // it is ready to send the messages. - // (These are called only by SessionManager.) - sigslot::signal1 SignalRequestSignaling; - void OnSignalingReady() { BaseSession::OnSignalingReady(); } - - // Takes ownership of session description. - // TODO: Add an error argument to pass back to the caller. - bool Initiate(const std::string& to, - const SessionDescription* sdesc); - - // When we receive an initiate, we create a session in the - // RECEIVEDINITIATE state and respond by accepting or rejecting. - // Takes ownership of session description. - // TODO: Add an error argument to pass back to the caller. - bool Accept(const SessionDescription* sdesc); - bool Reject(const std::string& reason); - bool Terminate() { - return TerminateWithReason(STR_TERMINATE_SUCCESS); - } - bool TerminateWithReason(const std::string& reason); - // Fired whenever we receive a terminate message along with a reason - sigslot::signal2 SignalReceivedTerminateReason; - - // The two clients in the session may also send one another - // arbitrary XML messages, which are called "info" messages. Sending - // takes ownership of the given elements. The signal does not; the - // parent element will be deleted after the signal. - bool SendInfoMessage(const XmlElements& elems, - const std::string& remote_name); - bool SendDescriptionInfoMessage(const ContentInfos& contents); - sigslot::signal2 SignalInfoMessage; - - private: - // Creates or destroys a session. (These are called only SessionManager.) - Session(SessionManager *session_manager, - const std::string& local_name, const std::string& initiator_name, - const std::string& sid, const std::string& content_type, - SessionClient* client); - ~Session(); - // For each transport info, create a transport proxy. Can fail for - // incompatible transport types. - bool CreateTransportProxies(const TransportInfos& tinfos, - SessionError* error); - bool OnRemoteCandidates(const TransportInfos& tinfos, - ParseError* error); - // Returns a TransportInfo without candidates for each content name. - // Uses the transport_type_ of the session. - TransportInfos GetEmptyTransportInfos(const ContentInfos& contents) const; - - // Maps passed to serialization functions. - TransportParserMap GetTransportParsers(); - ContentParserMap GetContentParsers(); - CandidateTranslatorMap GetCandidateTranslators(); - - virtual void OnTransportRequestSignaling(Transport* transport); - virtual void OnTransportConnecting(Transport* transport); - virtual void OnTransportWritable(Transport* transport); - virtual void OnTransportProxyCandidatesReady(TransportProxy* proxy, - const Candidates& candidates); - virtual void OnTransportSendError(Transport* transport, - const buzz::XmlElement* stanza, - const buzz::QName& name, - const std::string& type, - const std::string& text, - const buzz::XmlElement* extra_info); - virtual void OnMessage(talk_base::Message *pmsg); - - // Send various kinds of session messages. - bool SendInitiateMessage(const SessionDescription* sdesc, - SessionError* error); - bool SendAcceptMessage(const SessionDescription* sdesc, SessionError* error); - bool SendRejectMessage(const std::string& reason, SessionError* error); - bool SendTerminateMessage(const std::string& reason, SessionError* error); - bool SendTransportInfoMessage(const TransportInfo& tinfo, - SessionError* error); - bool SendTransportInfoMessage(const TransportProxy* transproxy, - const Candidates& candidates, - SessionError* error); - - bool ResendAllTransportInfoMessages(SessionError* error); - bool SendAllUnsentTransportInfoMessages(SessionError* error); - - // All versions of SendMessage send a message of the given type to - // the other client. Can pass either a set of elements or an - // "action", which must have a WriteSessionAction method to go along - // with it. Sending with an action supports sending a "hybrid" - // message. Sending with elements must be sent as Jingle or Gingle. - - // When passing elems, must be either Jingle or Gingle protocol. - // Takes ownership of action_elems. - bool SendMessage(ActionType type, const XmlElements& action_elems, - SessionError* error); - // Sends a messge, but overrides the remote name. - bool SendMessage(ActionType type, const XmlElements& action_elems, - const std::string& remote_name, - SessionError* error); - // When passing an action, may be Hybrid protocol. - template - bool SendMessage(ActionType type, const Action& action, - SessionError* error); - - // Helper methods to write the session message stanza. - template - bool WriteActionMessage(ActionType type, const Action& action, - buzz::XmlElement* stanza, WriteError* error); - template - bool WriteActionMessage(SignalingProtocol protocol, - ActionType type, const Action& action, - buzz::XmlElement* stanza, WriteError* error); - - // Sending messages in hybrid form requires being able to write them - // on a per-protocol basis with a common method signature, which all - // of these have. - bool WriteSessionAction(SignalingProtocol protocol, - const SessionInitiate& init, - XmlElements* elems, WriteError* error); - bool WriteSessionAction(SignalingProtocol protocol, - const TransportInfo& tinfo, - XmlElements* elems, WriteError* error); - bool WriteSessionAction(SignalingProtocol protocol, - const SessionTerminate& term, - XmlElements* elems, WriteError* error); - - // Sends a message back to the other client indicating that we have received - // and accepted their message. - void SendAcknowledgementMessage(const buzz::XmlElement* stanza); - - // Once signaling is ready, the session will use this signal to request the - // sending of each message. When messages are received by the other client, - // they should be handed to OnIncomingMessage. - // (These are called only by SessionManager.) - sigslot::signal2 SignalOutgoingMessage; - void OnIncomingMessage(const SessionMessage& msg); - - void OnIncomingResponse(const buzz::XmlElement* orig_stanza, - const buzz::XmlElement* response_stanza, - const SessionMessage& msg); - void OnInitiateAcked(); - void OnFailedSend(const buzz::XmlElement* orig_stanza, - const buzz::XmlElement* error_stanza); - - // Invoked when an error is found in an incoming message. This is translated - // into the appropriate XMPP response by SessionManager. - sigslot::signal6 SignalErrorMessage; - - // Handlers for the various types of messages. These functions may take - // pointers to the whole stanza or to just the session element. - bool OnInitiateMessage(const SessionMessage& msg, MessageError* error); - bool OnAcceptMessage(const SessionMessage& msg, MessageError* error); - bool OnRejectMessage(const SessionMessage& msg, MessageError* error); - bool OnInfoMessage(const SessionMessage& msg); - bool OnTerminateMessage(const SessionMessage& msg, MessageError* error); - bool OnTransportInfoMessage(const SessionMessage& msg, MessageError* error); - bool OnTransportAcceptMessage(const SessionMessage& msg, MessageError* error); - bool OnDescriptionInfoMessage(const SessionMessage& msg, MessageError* error); - bool OnRedirectError(const SessionRedirect& redirect, SessionError* error); - - // Verifies that we are in the appropriate state to receive this message. - bool CheckState(State state, MessageError* error); - - SessionManager* session_manager_; - bool initiate_acked_; - std::string local_name_; - std::string initiator_name_; - std::string remote_name_; - SessionClient* client_; - TransportParser* transport_parser_; - // Keeps track of what protocol we are speaking. - SignalingProtocol current_protocol_; - - friend class SessionManager; // For access to constructor, destructor, - // and signaling related methods. -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_SESSION_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/sessionclient.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/sessionclient.h deleted file mode 100755 index 61ea48f..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/sessionclient.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_BASE_SESSIONCLIENT_H_ -#define TALK_P2P_BASE_SESSIONCLIENT_H_ - -#include "talk/p2p/base/constants.h" - -namespace buzz { -class XmlElement; -} - -namespace cricket { - -struct ParseError; -class Session; -class ContentDescription; - -class ContentParser { - public: - virtual bool ParseContent(SignalingProtocol protocol, - const buzz::XmlElement* elem, - ContentDescription** content, - ParseError* error) = 0; - // If not IsWriteable, then a given content should be "skipped" when - // writing in the given protocol, as if it didn't exist. We assume - // most things are writeable. We do this to avoid strange cases - // like data contents in Gingle, which aren't writable. - virtual bool IsWritable(SignalingProtocol protocol, - const ContentDescription* content) { - return true; - } - virtual bool WriteContent(SignalingProtocol protocol, - const ContentDescription* content, - buzz::XmlElement** elem, - WriteError* error) = 0; - virtual ~ContentParser() {} -}; - -// A SessionClient exists in 1-1 relation with each session. The implementor -// of this interface is the one that understands *what* the two sides are -// trying to send to one another. The lower-level layers only know how to send -// data; they do not know what is being sent. -class SessionClient : public ContentParser { - public: - // Notifies the client of the creation / destruction of sessions of this type. - // - // IMPORTANT: The SessionClient, in its handling of OnSessionCreate, must - // create whatever channels are indicate in the description. This is because - // the remote client may already be attempting to connect those channels. If - // we do not create our channel right away, then connection may fail or be - // delayed. - virtual void OnSessionCreate(Session* session, bool received_initiate) = 0; - virtual void OnSessionDestroy(Session* session) = 0; - - virtual bool ParseContent(SignalingProtocol protocol, - const buzz::XmlElement* elem, - ContentDescription** content, - ParseError* error) = 0; - virtual bool WriteContent(SignalingProtocol protocol, - const ContentDescription* content, - buzz::XmlElement** elem, - WriteError* error) = 0; - protected: - // The SessionClient interface explicitly does not include destructor - virtual ~SessionClient() { } -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_SESSIONCLIENT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/sessiondescription.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/sessiondescription.h deleted file mode 100755 index d272d06..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/sessiondescription.h +++ /dev/null @@ -1,202 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_BASE_SESSIONDESCRIPTION_H_ -#define TALK_P2P_BASE_SESSIONDESCRIPTION_H_ - -#include -#include - -#include "talk/base/constructormagic.h" -#include "talk/p2p/base/transportinfo.h" - -namespace cricket { - -// Describes a session content. Individual content types inherit from -// this class. Analagous to a or -// . -class ContentDescription { - public: - virtual ~ContentDescription() {} - virtual ContentDescription* Copy() const = 0; -}; - -// Analagous to a or . -// name = name of -// type = xmlns of -struct ContentInfo { - ContentInfo() : description(NULL) {} - ContentInfo(const std::string& name, - const std::string& type, - ContentDescription* description) : - name(name), type(type), rejected(false), description(description) {} - ContentInfo(const std::string& name, - const std::string& type, - bool rejected, - ContentDescription* description) : - name(name), type(type), rejected(rejected), description(description) {} - std::string name; - std::string type; - bool rejected; - ContentDescription* description; -}; - -typedef std::vector ContentNames; - -// This class provides a mechanism to aggregate different media contents into a -// group. This group can also be shared with the peers in a pre-defined format. -// GroupInfo should be populated only with the |content_name| of the -// MediaDescription. -class ContentGroup { - public: - explicit ContentGroup(const std::string& semantics) : - semantics_(semantics) {} - - const std::string& semantics() const { return semantics_; } - const ContentNames& content_names() const { return content_names_; } - - const std::string* FirstContentName() const; - bool HasContentName(const std::string& content_name) const; - void AddContentName(const std::string& content_name); - bool RemoveContentName(const std::string& content_name); - - private: - std::string semantics_; - ContentNames content_names_; -}; - -typedef std::vector ContentInfos; -typedef std::vector ContentGroups; - -const ContentInfo* FindContentInfoByName( - const ContentInfos& contents, const std::string& name); -const ContentInfo* FindContentInfoByType( - const ContentInfos& contents, const std::string& type); - -// Describes a collection of contents, each with its own name and -// type. Analogous to a or stanza. Assumes that -// contents are unique be name, but doesn't enforce that. -class SessionDescription { - public: - SessionDescription() {} - explicit SessionDescription(const ContentInfos& contents) : - contents_(contents) {} - SessionDescription(const ContentInfos& contents, - const ContentGroups& groups) : - contents_(contents), - content_groups_(groups) {} - SessionDescription(const ContentInfos& contents, - const TransportInfos& transports, - const ContentGroups& groups) : - contents_(contents), - transport_infos_(transports), - content_groups_(groups) {} - ~SessionDescription() { - for (ContentInfos::iterator content = contents_.begin(); - content != contents_.end(); ++content) { - delete content->description; - } - } - - SessionDescription* Copy() const; - - // Content accessors. - const ContentInfos& contents() const { return contents_; } - ContentInfos& contents() { return contents_; } - const ContentInfo* GetContentByName(const std::string& name) const; - ContentInfo* GetContentByName(const std::string& name); - const ContentDescription* GetContentDescriptionByName( - const std::string& name) const; - ContentDescription* GetContentDescriptionByName(const std::string& name); - const ContentInfo* FirstContentByType(const std::string& type) const; - const ContentInfo* FirstContent() const; - - // Content mutators. - // Adds a content to this description. Takes ownership of ContentDescription*. - void AddContent(const std::string& name, - const std::string& type, - ContentDescription* description); - void AddContent(const std::string& name, - const std::string& type, - bool rejected, - ContentDescription* description); - bool RemoveContentByName(const std::string& name); - - // Transport accessors. - const TransportInfos& transport_infos() const { return transport_infos_; } - TransportInfos& transport_infos() { return transport_infos_; } - const TransportInfo* GetTransportInfoByName( - const std::string& name) const; - TransportInfo* GetTransportInfoByName(const std::string& name); - const TransportDescription* GetTransportDescriptionByName( - const std::string& name) const { - const TransportInfo* tinfo = GetTransportInfoByName(name); - return tinfo ? &tinfo->description : NULL; - } - - // Transport mutators. - void set_transport_infos(const TransportInfos& transport_infos) { - transport_infos_ = transport_infos; - } - // Adds a TransportInfo to this description. - // Returns false if a TransportInfo with the same name already exists. - bool AddTransportInfo(const TransportInfo& transport_info); - bool RemoveTransportInfoByName(const std::string& name); - - // Group accessors. - const ContentGroups& groups() const { return content_groups_; } - const ContentGroup* GetGroupByName(const std::string& name) const; - bool HasGroup(const std::string& name) const; - - // Group mutators. - void AddGroup(const ContentGroup& group) { content_groups_.push_back(group); } - // Remove the first group with the same semantics specified by |name|. - void RemoveGroupByName(const std::string& name); - - private: - ContentInfos contents_; - TransportInfos transport_infos_; - ContentGroups content_groups_; -}; - -// Indicates whether a ContentDescription was an offer or an answer, as -// described in http://www.ietf.org/rfc/rfc3264.txt. CA_UPDATE -// indicates a jingle update message which contains a subset of a full -// session description -enum ContentAction { - CA_OFFER, CA_PRANSWER, CA_ANSWER, CA_UPDATE -}; - -// Indicates whether a ContentDescription was sent by the local client -// or received from the remote client. -enum ContentSource { - CS_LOCAL, CS_REMOTE -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_SESSIONDESCRIPTION_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/sessionid.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/sessionid.h deleted file mode 100755 index c630ad0..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/sessionid.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_BASE_SESSIONID_H_ -#define TALK_P2P_BASE_SESSIONID_H_ - -// TODO: Remove this file. - -namespace cricket { - -} // namespace cricket - -#endif // TALK_P2P_BASE_SESSIONID_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/sessionmanager.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/sessionmanager.h deleted file mode 100755 index 268c588..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/sessionmanager.h +++ /dev/null @@ -1,211 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_BASE_SESSIONMANAGER_H_ -#define TALK_P2P_BASE_SESSIONMANAGER_H_ - -#include -#include -#include -#include - -#include "talk/base/sigslot.h" -#include "talk/base/thread.h" -#include "talk/p2p/base/portallocator.h" -#include "talk/p2p/base/transportdescriptionfactory.h" - -namespace buzz { -class QName; -class XmlElement; -} - -namespace cricket { - -class Session; -class BaseSession; -class SessionClient; - -// SessionManager manages session instances. -class SessionManager : public sigslot::has_slots<> { - public: - SessionManager(PortAllocator *allocator, - talk_base::Thread *worker_thread = NULL); - virtual ~SessionManager(); - - PortAllocator *port_allocator() const { return allocator_; } - talk_base::Thread *worker_thread() const { return worker_thread_; } - talk_base::Thread *signaling_thread() const { return signaling_thread_; } - - int session_timeout() const { return timeout_; } - void set_session_timeout(int timeout) { timeout_ = timeout; } - - // Set what transport protocol we want to default to. - void set_transport_protocol(TransportProtocol proto) { - transport_desc_factory_.set_protocol(proto); - } - - // Control use of DTLS. An identity must be supplied if DTLS is enabled. - void set_secure(SecurePolicy policy) { - transport_desc_factory_.set_secure(policy); - } - void set_identity(talk_base::SSLIdentity* identity) { - transport_desc_factory_.set_identity(identity); - } - const TransportDescriptionFactory* transport_desc_factory() const { - return &transport_desc_factory_; - } - - // Registers support for the given client. If we receive an initiate - // describing a session of the given type, we will automatically create a - // Session object and notify this client. The client may then accept or - // reject the session. - void AddClient(const std::string& content_type, SessionClient* client); - void RemoveClient(const std::string& content_type); - SessionClient* GetClient(const std::string& content_type); - - // Creates a new session. The given name is the JID of the client on whose - // behalf we initiate the session. - Session *CreateSession(const std::string& local_name, - const std::string& content_type); - - Session *CreateSession(const std::string& id, - const std::string& local_name, - const std::string& content_type); - - // Destroys the given session. - void DestroySession(Session *session); - - // Returns the session with the given ID or NULL if none exists. - Session *GetSession(const std::string& sid); - - // Terminates all of the sessions created by this manager. - void TerminateAll(); - - // These are signaled whenever the set of existing sessions changes. - sigslot::signal2 SignalSessionCreate; - sigslot::signal1 SignalSessionDestroy; - - // Determines whether the given stanza is intended for some session. - bool IsSessionMessage(const buzz::XmlElement* stanza); - - // Given a sid, initiator, and remote_name, this finds the matching Session - Session* FindSession(const std::string& sid, - const std::string& remote_name); - - // Called when we receive a stanza for which IsSessionMessage is true. - void OnIncomingMessage(const buzz::XmlElement* stanza); - - // Called when we get a response to a message that we sent. - void OnIncomingResponse(const buzz::XmlElement* orig_stanza, - const buzz::XmlElement* response_stanza); - - // Called if an attempted to send times out or an error is returned. In the - // timeout case error_stanza will be NULL - void OnFailedSend(const buzz::XmlElement* orig_stanza, - const buzz::XmlElement* error_stanza); - - // Signalled each time a session generates a signaling message to send. - // Also signalled on errors, but with a NULL session. - sigslot::signal2 SignalOutgoingMessage; - - // Signaled before sessions try to send certain signaling messages. The - // client should call OnSignalingReady once it is safe to send them. These - // steps are taken so that we don't send signaling messages trying to - // re-establish the connectivity of a session when the client cannot send - // the messages (and would probably just drop them on the floor). - // - // Note: you can connect this directly to OnSignalingReady(), if a signalling - // check is not supported. - sigslot::signal0<> SignalRequestSignaling; - void OnSignalingReady(); - - // Signaled when this SessionManager is deleted. - sigslot::signal0<> SignalDestroyed; - - private: - typedef std::map SessionMap; - typedef std::map ClientMap; - - // Helper function for CreateSession. This is also invoked when we receive - // a message attempting to initiate a session with this client. - Session *CreateSession(const std::string& local_name, - const std::string& initiator, - const std::string& sid, - const std::string& content_type, - bool received_initiate); - - // Attempts to find a registered session type whose description appears as - // a child of the session element. Such a child should be present indicating - // the application they hope to initiate. - std::string FindClient(const buzz::XmlElement* session); - - // Sends a message back to the other client indicating that we found an error - // in the stanza they sent. name identifies the error, type is one of the - // standard XMPP types (cancel, continue, modify, auth, wait), and text is a - // description for debugging purposes. - void SendErrorMessage(const buzz::XmlElement* stanza, - const buzz::QName& name, - const std::string& type, - const std::string& text, - const buzz::XmlElement* extra_info); - - // Creates and returns an error message from the given components. The - // caller is responsible for deleting this. - buzz::XmlElement* CreateErrorMessage( - const buzz::XmlElement* stanza, - const buzz::QName& name, - const std::string& type, - const std::string& text, - const buzz::XmlElement* extra_info); - - // Called each time a session requests signaling. - void OnRequestSignaling(Session* session); - - // Called each time a session has an outgoing message. - void OnOutgoingMessage(Session* session, const buzz::XmlElement* stanza); - - // Called each time a session has an error to send. - void OnErrorMessage(BaseSession* session, - const buzz::XmlElement* stanza, - const buzz::QName& name, - const std::string& type, - const std::string& text, - const buzz::XmlElement* extra_info); - - PortAllocator *allocator_; - talk_base::Thread *signaling_thread_; - talk_base::Thread *worker_thread_; - int timeout_; - TransportDescriptionFactory transport_desc_factory_; - SessionMap session_map_; - ClientMap client_map_; -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_SESSIONMANAGER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/sessionmessages.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/sessionmessages.h deleted file mode 100755 index c7dac82..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/sessionmessages.h +++ /dev/null @@ -1,243 +0,0 @@ -/* - * libjingle - * Copyright 2010, 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_P2P_BASE_SESSIONMESSAGES_H_ -#define TALK_P2P_BASE_SESSIONMESSAGES_H_ - -#include -#include -#include - -#include "talk/base/basictypes.h" -#include "talk/p2p/base/constants.h" -#include "talk/p2p/base/parsing.h" -#include "talk/p2p/base/sessiondescription.h" // Needed to delete contents. -#include "talk/p2p/base/transportinfo.h" -#include "talk/xmllite/xmlelement.h" - -namespace cricket { - -struct ParseError; -struct WriteError; -class Candidate; -class ContentParser; -class TransportParser; - -typedef std::vector Candidates; -typedef std::map ContentParserMap; -typedef std::map TransportParserMap; - -enum ActionType { - ACTION_UNKNOWN, - - ACTION_SESSION_INITIATE, - ACTION_SESSION_INFO, - ACTION_SESSION_ACCEPT, - ACTION_SESSION_REJECT, - ACTION_SESSION_TERMINATE, - - ACTION_TRANSPORT_INFO, - ACTION_TRANSPORT_ACCEPT, - - ACTION_DESCRIPTION_INFO, -}; - -// Abstraction of a element within an stanza, per XMPP -// standard XEP-166. Can be serialized into multiple protocols, -// including the standard (Jingle) and the draft standard (Gingle). -// In general, used to communicate actions related to a p2p session, -// such accept, initiate, terminate, etc. - -struct SessionMessage { - SessionMessage() : action_elem(NULL), stanza(NULL) {} - - SessionMessage(SignalingProtocol protocol, ActionType type, - const std::string& sid, const std::string& initiator) : - protocol(protocol), type(type), sid(sid), initiator(initiator), - action_elem(NULL), stanza(NULL) {} - - std::string id; - std::string from; - std::string to; - SignalingProtocol protocol; - ActionType type; - std::string sid; // session id - std::string initiator; - - // Used for further parsing when necessary. - // Represents or . - const buzz::XmlElement* action_elem; - // Mostly used for debugging. - const buzz::XmlElement* stanza; -}; - -// TODO: Break up this class so we don't have to typedef it into -// different classes. -struct ContentMessage { - ContentMessage() : owns_contents(false) {} - - ~ContentMessage() { - if (owns_contents) { - for (ContentInfos::iterator content = contents.begin(); - content != contents.end(); content++) { - delete content->description; - } - } - } - - // Caller takes ownership of contents. - ContentInfos ClearContents() { - ContentInfos out; - contents.swap(out); - owns_contents = false; - return out; - } - - bool owns_contents; - ContentInfos contents; - TransportInfos transports; - ContentGroups groups; -}; - -typedef ContentMessage SessionInitiate; -typedef ContentMessage SessionAccept; -// Note that a DescriptionInfo does not have TransportInfos. -typedef ContentMessage DescriptionInfo; - -struct SessionTerminate { - SessionTerminate() {} - - explicit SessionTerminate(const std::string& reason) : - reason(reason) {} - - std::string reason; - std::string debug_reason; -}; - -struct SessionRedirect { - std::string target; -}; - -// Used during parsing and writing to map component to channel name -// and back. This is primarily for converting old G-ICE candidate -// signalling to new ICE candidate classes. -class CandidateTranslator { - public: - virtual bool GetChannelNameFromComponent( - int component, std::string* channel_name) const = 0; - virtual bool GetComponentFromChannelName( - const std::string& channel_name, int* component) const = 0; -}; - -// Content name => translator -typedef std::map CandidateTranslatorMap; - -bool IsSessionMessage(const buzz::XmlElement* stanza); -bool ParseSessionMessage(const buzz::XmlElement* stanza, - SessionMessage* msg, - ParseError* error); -// Will return an error if there is more than one content type. -bool ParseContentType(SignalingProtocol protocol, - const buzz::XmlElement* action_elem, - std::string* content_type, - ParseError* error); -void WriteSessionMessage(const SessionMessage& msg, - const XmlElements& action_elems, - buzz::XmlElement* stanza); -bool ParseSessionInitiate(SignalingProtocol protocol, - const buzz::XmlElement* action_elem, - const ContentParserMap& content_parsers, - const TransportParserMap& transport_parsers, - const CandidateTranslatorMap& translators, - SessionInitiate* init, - ParseError* error); -bool WriteSessionInitiate(SignalingProtocol protocol, - const ContentInfos& contents, - const TransportInfos& tinfos, - const ContentParserMap& content_parsers, - const TransportParserMap& transport_parsers, - const CandidateTranslatorMap& translators, - const ContentGroups& groups, - XmlElements* elems, - WriteError* error); -bool ParseSessionAccept(SignalingProtocol protocol, - const buzz::XmlElement* action_elem, - const ContentParserMap& content_parsers, - const TransportParserMap& transport_parsers, - const CandidateTranslatorMap& translators, - SessionAccept* accept, - ParseError* error); -bool WriteSessionAccept(SignalingProtocol protocol, - const ContentInfos& contents, - const TransportInfos& tinfos, - const ContentParserMap& content_parsers, - const TransportParserMap& transport_parsers, - const CandidateTranslatorMap& translators, - const ContentGroups& groups, - XmlElements* elems, - WriteError* error); -bool ParseSessionTerminate(SignalingProtocol protocol, - const buzz::XmlElement* action_elem, - SessionTerminate* term, - ParseError* error); -void WriteSessionTerminate(SignalingProtocol protocol, - const SessionTerminate& term, - XmlElements* elems); -bool ParseDescriptionInfo(SignalingProtocol protocol, - const buzz::XmlElement* action_elem, - const ContentParserMap& content_parsers, - const TransportParserMap& transport_parsers, - const CandidateTranslatorMap& translators, - DescriptionInfo* description_info, - ParseError* error); -bool WriteDescriptionInfo(SignalingProtocol protocol, - const ContentInfos& contents, - const ContentParserMap& content_parsers, - XmlElements* elems, - WriteError* error); -// Since a TransportInfo is not a transport-info message, and a -// transport-info message is just a collection of TransportInfos, we -// say Parse/Write TransportInfos for transport-info messages. -bool ParseTransportInfos(SignalingProtocol protocol, - const buzz::XmlElement* action_elem, - const ContentInfos& contents, - const TransportParserMap& trans_parsers, - const CandidateTranslatorMap& translators, - TransportInfos* tinfos, - ParseError* error); -bool WriteTransportInfos(SignalingProtocol protocol, - const TransportInfos& tinfos, - const TransportParserMap& trans_parsers, - const CandidateTranslatorMap& translators, - XmlElements* elems, - WriteError* error); -// Handles both Gingle and Jingle syntax. -bool FindSessionRedirect(const buzz::XmlElement* stanza, - SessionRedirect* redirect); -} // namespace cricket - -#endif // TALK_P2P_BASE_SESSIONMESSAGES_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/stun.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/stun.h deleted file mode 100755 index 887dbf8..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/stun.h +++ /dev/null @@ -1,648 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_BASE_STUN_H_ -#define TALK_P2P_BASE_STUN_H_ - -// This file contains classes for dealing with the STUN protocol, as specified -// in RFC 5389, and its descendants. - -#include -#include - -#include "talk/base/basictypes.h" -#include "talk/base/bytebuffer.h" -#include "talk/base/socketaddress.h" - -namespace cricket { - -// These are the types of STUN messages defined in RFC 5389. -enum StunMessageType { - STUN_BINDING_REQUEST = 0x0001, - STUN_BINDING_INDICATION = 0x0011, - STUN_BINDING_RESPONSE = 0x0101, - STUN_BINDING_ERROR_RESPONSE = 0x0111, -}; - -// These are all known STUN attributes, defined in RFC 5389 and elsewhere. -// Next to each is the name of the class (T is StunTAttribute) that implements -// that type. -// RETRANSMIT_COUNT is the number of outstanding pings without a response at -// the time the packet is generated. -enum StunAttributeType { - STUN_ATTR_MAPPED_ADDRESS = 0x0001, // Address - STUN_ATTR_USERNAME = 0x0006, // ByteString - STUN_ATTR_MESSAGE_INTEGRITY = 0x0008, // ByteString, 20 bytes - STUN_ATTR_ERROR_CODE = 0x0009, // ErrorCode - STUN_ATTR_UNKNOWN_ATTRIBUTES = 0x000a, // UInt16List - STUN_ATTR_REALM = 0x0014, // ByteString - STUN_ATTR_NONCE = 0x0015, // ByteString - STUN_ATTR_XOR_MAPPED_ADDRESS = 0x0020, // XorAddress - STUN_ATTR_SOFTWARE = 0x8022, // ByteString - STUN_ATTR_ALTERNATE_SERVER = 0x8023, // ByteString - STUN_ATTR_FINGERPRINT = 0x8028, // UInt32 - STUN_ATTR_RETRANSMIT_COUNT = 0xFF00 // UInt32 -}; - -// These are the types of the values associated with the attributes above. -// This allows us to perform some basic validation when reading or adding -// attributes. Note that these values are for our own use, and not defined in -// RFC 5389. -enum StunAttributeValueType { - STUN_VALUE_UNKNOWN = 0, - STUN_VALUE_ADDRESS = 1, - STUN_VALUE_XOR_ADDRESS = 2, - STUN_VALUE_UINT32 = 3, - STUN_VALUE_UINT64 = 4, - STUN_VALUE_BYTE_STRING = 5, - STUN_VALUE_ERROR_CODE = 6, - STUN_VALUE_UINT16_LIST = 7 -}; - -// These are the types of STUN addresses defined in RFC 5389. -enum StunAddressFamily { - // NB: UNDEF is not part of the STUN spec. - STUN_ADDRESS_UNDEF = 0, - STUN_ADDRESS_IPV4 = 1, - STUN_ADDRESS_IPV6 = 2 -}; - -// These are the types of STUN error codes defined in RFC 5389. -enum StunErrorCode { - STUN_ERROR_TRY_ALTERNATE = 300, - STUN_ERROR_BAD_REQUEST = 400, - STUN_ERROR_UNAUTHORIZED = 401, - STUN_ERROR_UNKNOWN_ATTRIBUTE = 420, - STUN_ERROR_STALE_CREDENTIALS = 430, // GICE only - STUN_ERROR_STALE_NONCE = 438, - STUN_ERROR_SERVER_ERROR = 500, - STUN_ERROR_GLOBAL_FAILURE = 600 -}; - -// Strings for the error codes above. -extern const char STUN_ERROR_REASON_BAD_REQUEST[]; -extern const char STUN_ERROR_REASON_UNAUTHORIZED[]; -extern const char STUN_ERROR_REASON_UNKNOWN_ATTRIBUTE[]; -extern const char STUN_ERROR_REASON_STALE_CREDENTIALS[]; -extern const char STUN_ERROR_REASON_STALE_NONCE[]; -extern const char STUN_ERROR_REASON_SERVER_ERROR[]; - -// The mask used to determine whether a STUN message is a request/response etc. -const uint32 kStunTypeMask = 0x0110; - -// STUN Attribute header length. -const size_t kStunAttributeHeaderSize = 4; - -// Following values correspond to RFC5389. -const size_t kStunHeaderSize = 20; -const size_t kStunTransactionIdOffset = 8; -const size_t kStunTransactionIdLength = 12; -const uint32 kStunMagicCookie = 0x2112A442; -const size_t kStunMagicCookieLength = sizeof(kStunMagicCookie); - -// Following value corresponds to an earlier version of STUN from -// RFC3489. -const size_t kStunLegacyTransactionIdLength = 16; - -// STUN Message Integrity HMAC length. -const size_t kStunMessageIntegritySize = 20; - -class StunAttribute; -class StunAddressAttribute; -class StunXorAddressAttribute; -class StunUInt32Attribute; -class StunUInt64Attribute; -class StunByteStringAttribute; -class StunErrorCodeAttribute; -class StunUInt16ListAttribute; - -// Records a complete STUN/TURN message. Each message consists of a type and -// any number of attributes. Each attribute is parsed into an instance of an -// appropriate class (see above). The Get* methods will return instances of -// that attribute class. -class StunMessage { - public: - StunMessage(); - virtual ~StunMessage(); - - int type() const { return type_; } - size_t length() const { return length_; } - const std::string& transaction_id() const { return transaction_id_; } - - // Returns true if the message confirms to RFC3489 rather than - // RFC5389. The main difference between two version of the STUN - // protocol is the presence of the magic cookie and different length - // of transaction ID. For outgoing packets version of the protocol - // is determined by the lengths of the transaction ID. - bool IsLegacy() const; - - void SetType(int type) { type_ = static_cast(type); } - bool SetTransactionID(const std::string& str); - - // Gets the desired attribute value, or NULL if no such attribute type exists. - const StunAddressAttribute* GetAddress(int type) const; - const StunUInt32Attribute* GetUInt32(int type) const; - const StunUInt64Attribute* GetUInt64(int type) const; - const StunByteStringAttribute* GetByteString(int type) const; - - // Gets these specific attribute values. - const StunErrorCodeAttribute* GetErrorCode() const; - const StunUInt16ListAttribute* GetUnknownAttributes() const; - - // Takes ownership of the specified attribute, verifies it is of the correct - // type, and adds it to the message. The return value indicates whether this - // was successful. - bool AddAttribute(StunAttribute* attr); - - // Validates that a raw STUN message has a correct MESSAGE-INTEGRITY value. - // This can't currently be done on a StunMessage, since it is affected by - // padding data (which we discard when reading a StunMessage). - static bool ValidateMessageIntegrity(const char* data, size_t size, - const std::string& password); - // Adds a MESSAGE-INTEGRITY attribute that is valid for the current message. - bool AddMessageIntegrity(const std::string& password); - bool AddMessageIntegrity(const char* key, size_t keylen); - - // Verifies that a given buffer is STUN by checking for a correct FINGERPRINT. - static bool ValidateFingerprint(const char* data, size_t size); - - // Adds a FINGERPRINT attribute that is valid for the current message. - bool AddFingerprint(); - - // Parses the STUN packet in the given buffer and records it here. The - // return value indicates whether this was successful. - bool Read(talk_base::ByteBuffer* buf); - - // Writes this object into a STUN packet. The return value indicates whether - // this was successful. - bool Write(talk_base::ByteBuffer* buf) const; - - // Creates an empty message. Overridable by derived classes. - virtual StunMessage* CreateNew() const { return new StunMessage(); } - - protected: - // Verifies that the given attribute is allowed for this message. - virtual StunAttributeValueType GetAttributeValueType(int type) const; - - private: - StunAttribute* CreateAttribute(int type, size_t length) /* const*/; - const StunAttribute* GetAttribute(int type) const; - static bool IsValidTransactionId(const std::string& transaction_id); - - uint16 type_; - uint16 length_; - std::string transaction_id_; - std::vector* attrs_; -}; - -// Base class for all STUN/TURN attributes. -class StunAttribute { - public: - virtual ~StunAttribute() { - } - - int type() const { return type_; } - size_t length() const { return length_; } - - // Return the type of this attribute. - virtual StunAttributeValueType value_type() const = 0; - - // Only XorAddressAttribute needs this so far. - virtual void SetOwner(StunMessage* owner) {} - - // Reads the body (not the type or length) for this type of attribute from - // the given buffer. Return value is true if successful. - virtual bool Read(talk_base::ByteBuffer* buf) = 0; - - // Writes the body (not the type or length) to the given buffer. Return - // value is true if successful. - virtual bool Write(talk_base::ByteBuffer* buf) const = 0; - - // Creates an attribute object with the given type and smallest length. - static StunAttribute* Create(StunAttributeValueType value_type, uint16 type, - uint16 length, StunMessage* owner); - // TODO: Allow these create functions to take parameters, to reduce - // the amount of work callers need to do to initialize attributes. - static StunAddressAttribute* CreateAddress(uint16 type); - static StunXorAddressAttribute* CreateXorAddress(uint16 type); - static StunUInt32Attribute* CreateUInt32(uint16 type); - static StunUInt64Attribute* CreateUInt64(uint16 type); - static StunByteStringAttribute* CreateByteString(uint16 type); - static StunErrorCodeAttribute* CreateErrorCode(); - static StunUInt16ListAttribute* CreateUnknownAttributes(); - - protected: - StunAttribute(uint16 type, uint16 length); - void SetLength(uint16 length) { length_ = length; } - void WritePadding(talk_base::ByteBuffer* buf) const; - void ConsumePadding(talk_base::ByteBuffer* buf) const; - - private: - uint16 type_; - uint16 length_; -}; - -// Implements STUN attributes that record an Internet address. -class StunAddressAttribute : public StunAttribute { - public: - static const uint16 SIZE_UNDEF = 0; - static const uint16 SIZE_IP4 = 8; - static const uint16 SIZE_IP6 = 20; - StunAddressAttribute(uint16 type, const talk_base::SocketAddress& addr); - StunAddressAttribute(uint16 type, uint16 length); - - virtual StunAttributeValueType value_type() const { - return STUN_VALUE_ADDRESS; - } - - StunAddressFamily family() const { - switch (address_.ipaddr().family()) { - case AF_INET: - return STUN_ADDRESS_IPV4; - case AF_INET6: - return STUN_ADDRESS_IPV6; - } - return STUN_ADDRESS_UNDEF; - } - - const talk_base::SocketAddress& GetAddress() const { return address_; } - const talk_base::IPAddress& ipaddr() const { return address_.ipaddr(); } - uint16 port() const { return address_.port(); } - - void SetAddress(const talk_base::SocketAddress& addr) { - address_ = addr; - EnsureAddressLength(); - } - void SetIP(const talk_base::IPAddress& ip) { - address_.SetIP(ip); - EnsureAddressLength(); - } - void SetPort(uint16 port) { address_.SetPort(port); } - - virtual bool Read(talk_base::ByteBuffer* buf); - virtual bool Write(talk_base::ByteBuffer* buf) const; - - private: - void EnsureAddressLength() { - switch (family()) { - case STUN_ADDRESS_IPV4: { - SetLength(SIZE_IP4); - break; - } - case STUN_ADDRESS_IPV6: { - SetLength(SIZE_IP6); - break; - } - default: { - SetLength(SIZE_UNDEF); - break; - } - } - } - talk_base::SocketAddress address_; -}; - -// Implements STUN attributes that record an Internet address. When encoded -// in a STUN message, the address contained in this attribute is XORed with the -// transaction ID of the message. -class StunXorAddressAttribute : public StunAddressAttribute { - public: - StunXorAddressAttribute(uint16 type, const talk_base::SocketAddress& addr); - StunXorAddressAttribute(uint16 type, uint16 length, - StunMessage* owner); - - virtual StunAttributeValueType value_type() const { - return STUN_VALUE_XOR_ADDRESS; - } - virtual void SetOwner(StunMessage* owner) { - owner_ = owner; - } - virtual bool Read(talk_base::ByteBuffer* buf); - virtual bool Write(talk_base::ByteBuffer* buf) const; - - private: - talk_base::IPAddress GetXoredIP() const; - StunMessage* owner_; -}; - -// Implements STUN attributes that record a 32-bit integer. -class StunUInt32Attribute : public StunAttribute { - public: - static const uint16 SIZE = 4; - StunUInt32Attribute(uint16 type, uint32 value); - explicit StunUInt32Attribute(uint16 type); - - virtual StunAttributeValueType value_type() const { - return STUN_VALUE_UINT32; - } - - uint32 value() const { return bits_; } - void SetValue(uint32 bits) { bits_ = bits; } - - bool GetBit(size_t index) const; - void SetBit(size_t index, bool value); - - virtual bool Read(talk_base::ByteBuffer* buf); - virtual bool Write(talk_base::ByteBuffer* buf) const; - - private: - uint32 bits_; -}; - -class StunUInt64Attribute : public StunAttribute { - public: - static const uint16 SIZE = 8; - StunUInt64Attribute(uint16 type, uint64 value); - explicit StunUInt64Attribute(uint16 type); - - virtual StunAttributeValueType value_type() const { - return STUN_VALUE_UINT64; - } - - uint64 value() const { return bits_; } - void SetValue(uint64 bits) { bits_ = bits; } - - virtual bool Read(talk_base::ByteBuffer* buf); - virtual bool Write(talk_base::ByteBuffer* buf) const; - - private: - uint64 bits_; -}; - -// Implements STUN attributes that record an arbitrary byte string. -class StunByteStringAttribute : public StunAttribute { - public: - explicit StunByteStringAttribute(uint16 type); - StunByteStringAttribute(uint16 type, const std::string& str); - StunByteStringAttribute(uint16 type, const void* bytes, size_t length); - StunByteStringAttribute(uint16 type, uint16 length); - ~StunByteStringAttribute(); - - virtual StunAttributeValueType value_type() const { - return STUN_VALUE_BYTE_STRING; - } - - const char* bytes() const { return bytes_; } - std::string GetString() const { return std::string(bytes_, length()); } - - void CopyBytes(const char* bytes); // uses strlen - void CopyBytes(const void* bytes, size_t length); - - uint8 GetByte(size_t index) const; - void SetByte(size_t index, uint8 value); - - virtual bool Read(talk_base::ByteBuffer* buf); - virtual bool Write(talk_base::ByteBuffer* buf) const; - - private: - void SetBytes(char* bytes, size_t length); - - char* bytes_; -}; - -// Implements STUN attributes that record an error code. -class StunErrorCodeAttribute : public StunAttribute { - public: - static const uint16 MIN_SIZE = 4; - StunErrorCodeAttribute(uint16 type, int code, const std::string& reason); - StunErrorCodeAttribute(uint16 type, uint16 length); - ~StunErrorCodeAttribute(); - - virtual StunAttributeValueType value_type() const { - return STUN_VALUE_ERROR_CODE; - } - - // The combined error and class, e.g. 0x400. - int code() const; - void SetCode(int code); - - // The individual error components. - int eclass() const { return class_; } - int number() const { return number_; } - const std::string& reason() const { return reason_; } - void SetClass(uint8 eclass) { class_ = eclass; } - void SetNumber(uint8 number) { number_ = number; } - void SetReason(const std::string& reason); - - bool Read(talk_base::ByteBuffer* buf); - bool Write(talk_base::ByteBuffer* buf) const; - - private: - uint8 class_; - uint8 number_; - std::string reason_; -}; - -// Implements STUN attributes that record a list of attribute names. -class StunUInt16ListAttribute : public StunAttribute { - public: - StunUInt16ListAttribute(uint16 type, uint16 length); - ~StunUInt16ListAttribute(); - - virtual StunAttributeValueType value_type() const { - return STUN_VALUE_UINT16_LIST; - } - - size_t Size() const; - uint16 GetType(int index) const; - void SetType(int index, uint16 value); - void AddType(uint16 value); - - bool Read(talk_base::ByteBuffer* buf); - bool Write(talk_base::ByteBuffer* buf) const; - - private: - std::vector* attr_types_; -}; - -// Returns the (successful) response type for the given request type. -// Returns -1 if |request_type| is not a valid request type. -int GetStunSuccessResponseType(int request_type); - -// Returns the error response type for the given request type. -// Returns -1 if |request_type| is not a valid request type. -int GetStunErrorResponseType(int request_type); - -// Returns whether a given message is a request type. -bool IsStunRequestType(int msg_type); - -// Returns whether a given message is an indication type. -bool IsStunIndicationType(int msg_type); - -// Returns whether a given response is a success type. -bool IsStunSuccessResponseType(int msg_type); - -// Returns whether a given response is an error type. -bool IsStunErrorResponseType(int msg_type); - -// Computes the STUN long-term credential hash. -bool ComputeStunCredentialHash(const std::string& username, - const std::string& realm, const std::string& password, std::string* hash); - -// TODO: Move the TURN/ICE stuff below out to separate files. -extern const char TURN_MAGIC_COOKIE_VALUE[4]; - -// "GTURN" STUN methods. -// TODO: Rename these methods to GTURN_ to make it clear they aren't -// part of standard STUN/TURN. -enum RelayMessageType { - // For now, using the same defs from TurnMessageType below. - // STUN_ALLOCATE_REQUEST = 0x0003, - // STUN_ALLOCATE_RESPONSE = 0x0103, - // STUN_ALLOCATE_ERROR_RESPONSE = 0x0113, - STUN_SEND_REQUEST = 0x0004, - STUN_SEND_RESPONSE = 0x0104, - STUN_SEND_ERROR_RESPONSE = 0x0114, - STUN_DATA_INDICATION = 0x0115, -}; - -// "GTURN"-specific STUN attributes. -// TODO: Rename these attributes to GTURN_ to avoid conflicts. -enum RelayAttributeType { - STUN_ATTR_LIFETIME = 0x000d, // UInt32 - STUN_ATTR_MAGIC_COOKIE = 0x000f, // ByteString, 4 bytes - STUN_ATTR_BANDWIDTH = 0x0010, // UInt32 - STUN_ATTR_DESTINATION_ADDRESS = 0x0011, // Address - STUN_ATTR_SOURCE_ADDRESS2 = 0x0012, // Address - STUN_ATTR_DATA = 0x0013, // ByteString - STUN_ATTR_OPTIONS = 0x8001, // UInt32 -}; - -// A "GTURN" STUN message. -class RelayMessage : public StunMessage { - protected: - virtual StunAttributeValueType GetAttributeValueType(int type) const { - switch (type) { - case STUN_ATTR_LIFETIME: return STUN_VALUE_UINT32; - case STUN_ATTR_MAGIC_COOKIE: return STUN_VALUE_BYTE_STRING; - case STUN_ATTR_BANDWIDTH: return STUN_VALUE_UINT32; - case STUN_ATTR_DESTINATION_ADDRESS: return STUN_VALUE_ADDRESS; - case STUN_ATTR_SOURCE_ADDRESS2: return STUN_VALUE_ADDRESS; - case STUN_ATTR_DATA: return STUN_VALUE_BYTE_STRING; - case STUN_ATTR_OPTIONS: return STUN_VALUE_UINT32; - default: return StunMessage::GetAttributeValueType(type); - } - } - virtual StunMessage* CreateNew() const { return new RelayMessage(); } -}; - -// Defined in TURN RFC 5766. -enum TurnMessageType { - STUN_ALLOCATE_REQUEST = 0x0003, - STUN_ALLOCATE_RESPONSE = 0x0103, - STUN_ALLOCATE_ERROR_RESPONSE = 0x0113, - TURN_REFRESH_REQUEST = 0x0004, - TURN_REFRESH_RESPONSE = 0x0104, - TURN_REFRESH_ERROR_RESPONSE = 0x0114, - TURN_SEND_INDICATION = 0x0016, - TURN_DATA_INDICATION = 0x0017, - TURN_CREATE_PERMISSION_REQUEST = 0x0008, - TURN_CREATE_PERMISSION_RESPONSE = 0x0108, - TURN_CREATE_PERMISSION_ERROR_RESPONSE = 0x0118, - TURN_CHANNEL_BIND_REQUEST = 0x0009, - TURN_CHANNEL_BIND_RESPONSE = 0x0109, - TURN_CHANNEL_BIND_ERROR_RESPONSE = 0x0119, -}; - -enum TurnAttributeType { - STUN_ATTR_CHANNEL_NUMBER = 0x000C, // UInt32 - STUN_ATTR_TURN_LIFETIME = 0x000d, // UInt32 - STUN_ATTR_XOR_PEER_ADDRESS = 0x0012, // XorAddress - // TODO(mallinath) - Uncomment after RelayAttributes are renamed. - // STUN_ATTR_DATA = 0x0013, // ByteString - STUN_ATTR_XOR_RELAYED_ADDRESS = 0x0016, // XorAddress - STUN_ATTR_EVEN_PORT = 0x0018, // ByteString, 1 byte. - STUN_ATTR_REQUESTED_TRANSPORT = 0x0019, // UInt32 - STUN_ATTR_DONT_FRAGMENT = 0x001A, // No content, Length = 0 - STUN_ATTR_RESERVATION_TOKEN = 0x0022, // ByteString, 8 bytes. - // TODO(mallinath) - Rename STUN_ATTR_TURN_LIFETIME to STUN_ATTR_LIFETIME and - // STUN_ATTR_TURN_DATA to STUN_ATTR_DATA. Also rename RelayMessage attributes - // by appending G to attribute name. -}; - -// RFC 5766-defined errors. -enum TurnErrorType { - STUN_ERROR_FORBIDDEN = 403, - STUN_ERROR_ALLOCATION_MISMATCH = 437, - STUN_ERROR_WRONG_CREDENTIALS = 441, - STUN_ERROR_UNSUPPORTED_PROTOCOL = 442 -}; -extern const char STUN_ERROR_REASON_FORBIDDEN[]; -extern const char STUN_ERROR_REASON_ALLOCATION_MISMATCH[]; -extern const char STUN_ERROR_REASON_WRONG_CREDENTIALS[]; -extern const char STUN_ERROR_REASON_UNSUPPORTED_PROTOCOL[]; -class TurnMessage : public StunMessage { - protected: - virtual StunAttributeValueType GetAttributeValueType(int type) const { - switch (type) { - case STUN_ATTR_CHANNEL_NUMBER: return STUN_VALUE_UINT32; - case STUN_ATTR_TURN_LIFETIME: return STUN_VALUE_UINT32; - case STUN_ATTR_XOR_PEER_ADDRESS: return STUN_VALUE_XOR_ADDRESS; - case STUN_ATTR_DATA: return STUN_VALUE_BYTE_STRING; - case STUN_ATTR_XOR_RELAYED_ADDRESS: return STUN_VALUE_XOR_ADDRESS; - case STUN_ATTR_EVEN_PORT: return STUN_VALUE_BYTE_STRING; - case STUN_ATTR_REQUESTED_TRANSPORT: return STUN_VALUE_UINT32; - case STUN_ATTR_DONT_FRAGMENT: return STUN_VALUE_BYTE_STRING; - case STUN_ATTR_RESERVATION_TOKEN: return STUN_VALUE_BYTE_STRING; - default: return StunMessage::GetAttributeValueType(type); - } - } - virtual StunMessage* CreateNew() const { return new TurnMessage(); } -}; - -// RFC 5245 ICE STUN attributes. -enum IceAttributeType { - STUN_ATTR_PRIORITY = 0x0024, // UInt32 - STUN_ATTR_USE_CANDIDATE = 0x0025, // No content, Length = 0 - STUN_ATTR_ICE_CONTROLLED = 0x8029, // UInt64 - STUN_ATTR_ICE_CONTROLLING = 0x802A // UInt64 -}; - -// RFC 5245-defined errors. -enum IceErrorCode { - STUN_ERROR_ROLE_CONFLICT = 487, -}; -extern const char STUN_ERROR_REASON_ROLE_CONFLICT[]; - -// A RFC 5245 ICE STUN message. -class IceMessage : public StunMessage { - protected: - virtual StunAttributeValueType GetAttributeValueType(int type) const { - switch (type) { - case STUN_ATTR_PRIORITY: return STUN_VALUE_UINT32; - case STUN_ATTR_USE_CANDIDATE: return STUN_VALUE_BYTE_STRING; - case STUN_ATTR_ICE_CONTROLLED: return STUN_VALUE_UINT64; - case STUN_ATTR_ICE_CONTROLLING: return STUN_VALUE_UINT64; - default: return StunMessage::GetAttributeValueType(type); - } - } - virtual StunMessage* CreateNew() const { return new IceMessage(); } -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_STUN_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/stunport.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/stunport.h deleted file mode 100755 index bd074a4..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/stunport.h +++ /dev/null @@ -1,214 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_BASE_STUNPORT_H_ -#define TALK_P2P_BASE_STUNPORT_H_ - -#include - -#include "talk/base/asyncpacketsocket.h" -#include "talk/p2p/base/port.h" -#include "talk/p2p/base/stunrequest.h" - -// TODO(mallinath) - Rename stunport.cc|h to udpport.cc|h. -namespace talk_base { -class AsyncResolver; -class SignalThread; -} - -namespace cricket { - -// Communicates using the address on the outside of a NAT. -class UDPPort : public Port { - public: - static UDPPort* Create(talk_base::Thread* thread, - talk_base::PacketSocketFactory* factory, - talk_base::Network* network, - talk_base::AsyncPacketSocket* socket, - const std::string& username, - const std::string& password) { - UDPPort* port = new UDPPort(thread, factory, network, socket, - username, password); - if (!port->Init()) { - delete port; - port = NULL; - } - return port; - } - - static UDPPort* Create(talk_base::Thread* thread, - talk_base::PacketSocketFactory* factory, - talk_base::Network* network, - const talk_base::IPAddress& ip, - int min_port, int max_port, - const std::string& username, - const std::string& password) { - UDPPort* port = new UDPPort(thread, factory, network, - ip, min_port, max_port, - username, password); - if (!port->Init()) { - delete port; - port = NULL; - } - return port; - } - virtual ~UDPPort(); - - talk_base::SocketAddress GetLocalAddress() const { - return socket_->GetLocalAddress(); - } - - const talk_base::SocketAddress& server_addr() const { return server_addr_; } - void set_server_addr(const talk_base::SocketAddress& addr) { - server_addr_ = addr; - } - - virtual void PrepareAddress(); - - virtual Connection* CreateConnection(const Candidate& address, - CandidateOrigin origin); - virtual int SetOption(talk_base::Socket::Option opt, int value); - virtual int GetOption(talk_base::Socket::Option opt, int* value); - virtual int GetError(); - - virtual bool HandleIncomingPacket( - talk_base::AsyncPacketSocket* socket, const char* data, size_t size, - const talk_base::SocketAddress& remote_addr, - const talk_base::PacketTime& packet_time) { - // All packets given to UDP port will be consumed. - OnReadPacket(socket, data, size, remote_addr, packet_time); - return true; - } - - void set_stun_keepalive_delay(int delay) { - stun_keepalive_delay_ = delay; - } - int stun_keepalive_delay() const { - return stun_keepalive_delay_; - } - - protected: - UDPPort(talk_base::Thread* thread, talk_base::PacketSocketFactory* factory, - talk_base::Network* network, const talk_base::IPAddress& ip, - int min_port, int max_port, - const std::string& username, const std::string& password); - - UDPPort(talk_base::Thread* thread, talk_base::PacketSocketFactory* factory, - talk_base::Network* network, talk_base::AsyncPacketSocket* socket, - const std::string& username, const std::string& password); - - bool Init(); - - virtual int SendTo(const void* data, size_t size, - const talk_base::SocketAddress& addr, - const talk_base::PacketOptions& options, - bool payload); - - void OnLocalAddressReady(talk_base::AsyncPacketSocket* socket, - const talk_base::SocketAddress& address); - void OnReadPacket(talk_base::AsyncPacketSocket* socket, - const char* data, size_t size, - const talk_base::SocketAddress& remote_addr, - const talk_base::PacketTime& packet_time); - - void OnReadyToSend(talk_base::AsyncPacketSocket* socket); - - // This method will send STUN binding request if STUN server address is set. - void MaybePrepareStunCandidate(); - - void SendStunBindingRequest(); - - private: - // DNS resolution of the STUN server. - void ResolveStunAddress(); - void OnResolveResult(talk_base::AsyncResolverInterface* resolver); - - // Below methods handles binding request responses. - void OnStunBindingRequestSucceeded(const talk_base::SocketAddress& stun_addr); - void OnStunBindingOrResolveRequestFailed(); - - // Sends STUN requests to the server. - void OnSendPacket(const void* data, size_t size, StunRequest* req); - - // TODO(mallinaht) - Move this up to cricket::Port when SignalAddressReady is - // changed to SignalPortReady. - void SetResult(bool success); - - talk_base::SocketAddress server_addr_; - StunRequestManager requests_; - talk_base::AsyncPacketSocket* socket_; - int error_; - talk_base::AsyncResolverInterface* resolver_; - bool ready_; - int stun_keepalive_delay_; - - friend class StunBindingRequest; -}; - -class StunPort : public UDPPort { - public: - static StunPort* Create(talk_base::Thread* thread, - talk_base::PacketSocketFactory* factory, - talk_base::Network* network, - const talk_base::IPAddress& ip, - int min_port, int max_port, - const std::string& username, - const std::string& password, - const talk_base::SocketAddress& server_addr) { - StunPort* port = new StunPort(thread, factory, network, - ip, min_port, max_port, - username, password, server_addr); - if (!port->Init()) { - delete port; - port = NULL; - } - return port; - } - - virtual ~StunPort() {} - - virtual void PrepareAddress() { - SendStunBindingRequest(); - } - - protected: - StunPort(talk_base::Thread* thread, talk_base::PacketSocketFactory* factory, - talk_base::Network* network, const talk_base::IPAddress& ip, - int min_port, int max_port, - const std::string& username, const std::string& password, - const talk_base::SocketAddress& server_address) - : UDPPort(thread, factory, network, ip, min_port, max_port, username, - password) { - // UDPPort will set these to local udp, updating these to STUN. - set_type(STUN_PORT_TYPE); - set_server_addr(server_address); - } -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_STUNPORT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/stunrequest.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/stunrequest.h deleted file mode 100755 index 76f9d1d..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/stunrequest.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_BASE_STUNREQUEST_H_ -#define TALK_P2P_BASE_STUNREQUEST_H_ - -#include "talk/base/sigslot.h" -#include "talk/base/thread.h" -#include "talk/p2p/base/stun.h" -#include -#include - -namespace cricket { - -class StunRequest; - -// Manages a set of STUN requests, sending and resending until we receive a -// response or determine that the request has timed out. -class StunRequestManager { -public: - StunRequestManager(talk_base::Thread* thread); - ~StunRequestManager(); - - // Starts sending the given request (perhaps after a delay). - void Send(StunRequest* request); - void SendDelayed(StunRequest* request, int delay); - - // Removes a stun request that was added previously. This will happen - // automatically when a request succeeds, fails, or times out. - void Remove(StunRequest* request); - - // Removes all stun requests that were added previously. - void Clear(); - - // Determines whether the given message is a response to one of the - // outstanding requests, and if so, processes it appropriately. - bool CheckResponse(StunMessage* msg); - bool CheckResponse(const char* data, size_t size); - - bool empty() { return requests_.empty(); } - - // Raised when there are bytes to be sent. - sigslot::signal3 SignalSendPacket; - -private: - typedef std::map RequestMap; - - talk_base::Thread* thread_; - RequestMap requests_; - - friend class StunRequest; -}; - -// Represents an individual request to be sent. The STUN message can either be -// constructed beforehand or built on demand. -class StunRequest : public talk_base::MessageHandler { -public: - StunRequest(); - StunRequest(StunMessage* request); - virtual ~StunRequest(); - - // Causes our wrapped StunMessage to be Prepared - void Construct(); - - // The manager handling this request (if it has been scheduled for sending). - StunRequestManager* manager() { return manager_; } - - // Returns the transaction ID of this request. - const std::string& id() { return msg_->transaction_id(); } - - // Returns the STUN type of the request message. - int type(); - - // Returns a const pointer to |msg_|. - const StunMessage* msg() const; - - // Time elapsed since last send (in ms) - uint32 Elapsed() const; - -protected: - int count_; - bool timeout_; - - // Fills in a request object to be sent. Note that request's transaction ID - // will already be set and cannot be changed. - virtual void Prepare(StunMessage* request) {} - - // Called when the message receives a response or times out. - virtual void OnResponse(StunMessage* response) {} - virtual void OnErrorResponse(StunMessage* response) {} - virtual void OnTimeout() {} - virtual int GetNextDelay(); - -private: - void set_manager(StunRequestManager* manager); - - // Handles messages for sending and timeout. - void OnMessage(talk_base::Message* pmsg); - - StunRequestManager* manager_; - StunMessage* msg_; - uint32 tstamp_; - - friend class StunRequestManager; -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_STUNREQUEST_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/stunserver.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/stunserver.h deleted file mode 100755 index c2b72ca..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/stunserver.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_BASE_STUNSERVER_H_ -#define TALK_P2P_BASE_STUNSERVER_H_ - -#include "talk/base/asyncudpsocket.h" -#include "talk/base/scoped_ptr.h" -#include "talk/p2p/base/stun.h" - -namespace cricket { - -const int STUN_SERVER_PORT = 3478; - -class StunServer : public sigslot::has_slots<> { - public: - // Creates a STUN server, which will listen on the given socket. - explicit StunServer(talk_base::AsyncUDPSocket* socket); - // Removes the STUN server from the socket and deletes the socket. - ~StunServer(); - - protected: - // Slot for AsyncSocket.PacketRead: - void OnPacket( - talk_base::AsyncPacketSocket* socket, const char* buf, size_t size, - const talk_base::SocketAddress& remote_addr, - const talk_base::PacketTime& packet_time); - - // Handlers for the different types of STUN/TURN requests: - void OnBindingRequest(StunMessage* msg, - const talk_base::SocketAddress& addr); - void OnAllocateRequest(StunMessage* msg, - const talk_base::SocketAddress& addr); - void OnSharedSecretRequest(StunMessage* msg, - const talk_base::SocketAddress& addr); - void OnSendRequest(StunMessage* msg, - const talk_base::SocketAddress& addr); - - // Sends an error response to the given message back to the user. - void SendErrorResponse( - const StunMessage& msg, const talk_base::SocketAddress& addr, - int error_code, const char* error_desc); - - // Sends the given message to the appropriate destination. - void SendResponse(const StunMessage& msg, - const talk_base::SocketAddress& addr); - - private: - talk_base::scoped_ptr socket_; -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_STUNSERVER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/tcpport.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/tcpport.h deleted file mode 100755 index f0d7694..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/tcpport.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_BASE_TCPPORT_H_ -#define TALK_P2P_BASE_TCPPORT_H_ - -#include -#include -#include "talk/base/asyncpacketsocket.h" -#include "talk/p2p/base/port.h" - -namespace cricket { - -class TCPConnection; - -// Communicates using a local TCP port. -// -// This class is designed to allow subclasses to take advantage of the -// connection management provided by this class. A subclass should take of all -// packet sending and preparation, but when a packet is received, it should -// call this TCPPort::OnReadPacket (3 arg) to dispatch to a connection. -class TCPPort : public Port { - public: - static TCPPort* Create(talk_base::Thread* thread, - talk_base::PacketSocketFactory* factory, - talk_base::Network* network, - const talk_base::IPAddress& ip, - int min_port, int max_port, - const std::string& username, - const std::string& password, - bool allow_listen) { - TCPPort* port = new TCPPort(thread, factory, network, - ip, min_port, max_port, - username, password, allow_listen); - if (!port->Init()) { - delete port; - port = NULL; - } - return port; - } - virtual ~TCPPort(); - - virtual Connection* CreateConnection(const Candidate& address, - CandidateOrigin origin); - - virtual void PrepareAddress(); - - virtual int GetOption(talk_base::Socket::Option opt, int* value); - virtual int SetOption(talk_base::Socket::Option opt, int value); - virtual int GetError(); - - protected: - TCPPort(talk_base::Thread* thread, talk_base::PacketSocketFactory* factory, - talk_base::Network* network, const talk_base::IPAddress& ip, - int min_port, int max_port, const std::string& username, - const std::string& password, bool allow_listen); - bool Init(); - - // Handles sending using the local TCP socket. - virtual int SendTo(const void* data, size_t size, - const talk_base::SocketAddress& addr, - const talk_base::PacketOptions& options, - bool payload); - - // Accepts incoming TCP connection. - void OnNewConnection(talk_base::AsyncPacketSocket* socket, - talk_base::AsyncPacketSocket* new_socket); - - private: - struct Incoming { - talk_base::SocketAddress addr; - talk_base::AsyncPacketSocket* socket; - }; - - talk_base::AsyncPacketSocket* GetIncoming( - const talk_base::SocketAddress& addr, bool remove = false); - - // Receives packet signal from the local TCP Socket. - void OnReadPacket(talk_base::AsyncPacketSocket* socket, - const char* data, size_t size, - const talk_base::SocketAddress& remote_addr, - const talk_base::PacketTime& packet_time); - - void OnReadyToSend(talk_base::AsyncPacketSocket* socket); - - void OnAddressReady(talk_base::AsyncPacketSocket* socket, - const talk_base::SocketAddress& address); - - // TODO: Is this still needed? - bool incoming_only_; - bool allow_listen_; - talk_base::AsyncPacketSocket* socket_; - int error_; - std::list incoming_; - - friend class TCPConnection; -}; - -class TCPConnection : public Connection { - public: - // Connection is outgoing unless socket is specified - TCPConnection(TCPPort* port, const Candidate& candidate, - talk_base::AsyncPacketSocket* socket = 0); - virtual ~TCPConnection(); - - virtual int Send(const void* data, size_t size, - const talk_base::PacketOptions& options); - virtual int GetError(); - - talk_base::AsyncPacketSocket* socket() { return socket_; } - - private: - void OnConnect(talk_base::AsyncPacketSocket* socket); - void OnClose(talk_base::AsyncPacketSocket* socket, int error); - void OnReadPacket(talk_base::AsyncPacketSocket* socket, - const char* data, size_t size, - const talk_base::SocketAddress& remote_addr, - const talk_base::PacketTime& packet_time); - void OnReadyToSend(talk_base::AsyncPacketSocket* socket); - - talk_base::AsyncPacketSocket* socket_; - int error_; - - friend class TCPPort; -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_TCPPORT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/testrelayserver.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/testrelayserver.h deleted file mode 100755 index ca70481..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/testrelayserver.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - * libjingle - * Copyright 2008 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_P2P_BASE_TESTRELAYSERVER_H_ -#define TALK_P2P_BASE_TESTRELAYSERVER_H_ - -#include "talk/base/asynctcpsocket.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/socketadapters.h" -#include "talk/base/sigslot.h" -#include "talk/base/thread.h" -#include "talk/p2p/base/relayserver.h" - -namespace cricket { - -// A test relay server. Useful for unit tests. -class TestRelayServer : public sigslot::has_slots<> { - public: - TestRelayServer(talk_base::Thread* thread, - const talk_base::SocketAddress& udp_int_addr, - const talk_base::SocketAddress& udp_ext_addr, - const talk_base::SocketAddress& tcp_int_addr, - const talk_base::SocketAddress& tcp_ext_addr, - const talk_base::SocketAddress& ssl_int_addr, - const talk_base::SocketAddress& ssl_ext_addr) - : server_(thread) { - server_.AddInternalSocket(talk_base::AsyncUDPSocket::Create( - thread->socketserver(), udp_int_addr)); - server_.AddExternalSocket(talk_base::AsyncUDPSocket::Create( - thread->socketserver(), udp_ext_addr)); - - tcp_int_socket_.reset(CreateListenSocket(thread, tcp_int_addr)); - tcp_ext_socket_.reset(CreateListenSocket(thread, tcp_ext_addr)); - ssl_int_socket_.reset(CreateListenSocket(thread, ssl_int_addr)); - ssl_ext_socket_.reset(CreateListenSocket(thread, ssl_ext_addr)); - } - int GetConnectionCount() const { - return server_.GetConnectionCount(); - } - talk_base::SocketAddressPair GetConnection(int connection) const { - return server_.GetConnection(connection); - } - bool HasConnection(const talk_base::SocketAddress& address) const { - return server_.HasConnection(address); - } - - private: - talk_base::AsyncSocket* CreateListenSocket(talk_base::Thread* thread, - const talk_base::SocketAddress& addr) { - talk_base::AsyncSocket* socket = - thread->socketserver()->CreateAsyncSocket(addr.family(), SOCK_STREAM); - socket->Bind(addr); - socket->Listen(5); - socket->SignalReadEvent.connect(this, &TestRelayServer::OnAccept); - return socket; - } - void OnAccept(talk_base::AsyncSocket* socket) { - bool external = (socket == tcp_ext_socket_.get() || - socket == ssl_ext_socket_.get()); - bool ssl = (socket == ssl_int_socket_.get() || - socket == ssl_ext_socket_.get()); - talk_base::AsyncSocket* raw_socket = socket->Accept(NULL); - if (raw_socket) { - talk_base::AsyncTCPSocket* packet_socket = new talk_base::AsyncTCPSocket( - (!ssl) ? raw_socket : - new talk_base::AsyncSSLServerSocket(raw_socket), false); - if (!external) { - packet_socket->SignalClose.connect(this, - &TestRelayServer::OnInternalClose); - server_.AddInternalSocket(packet_socket); - } else { - packet_socket->SignalClose.connect(this, - &TestRelayServer::OnExternalClose); - server_.AddExternalSocket(packet_socket); - } - } - } - void OnInternalClose(talk_base::AsyncPacketSocket* socket, int error) { - server_.RemoveInternalSocket(socket); - } - void OnExternalClose(talk_base::AsyncPacketSocket* socket, int error) { - server_.RemoveExternalSocket(socket); - } - private: - cricket::RelayServer server_; - talk_base::scoped_ptr tcp_int_socket_; - talk_base::scoped_ptr tcp_ext_socket_; - talk_base::scoped_ptr ssl_int_socket_; - talk_base::scoped_ptr ssl_ext_socket_; -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_TESTRELAYSERVER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/teststunserver.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/teststunserver.h deleted file mode 100755 index 80bf9eb..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/teststunserver.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * libjingle - * Copyright 2008 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_P2P_BASE_TESTSTUNSERVER_H_ -#define TALK_P2P_BASE_TESTSTUNSERVER_H_ - -#include "talk/base/socketaddress.h" -#include "talk/base/thread.h" -#include "talk/p2p/base/stunserver.h" - -namespace cricket { - -// A test STUN server. Useful for unit tests. -class TestStunServer { - public: - TestStunServer(talk_base::Thread* thread, - const talk_base::SocketAddress& addr) - : socket_(thread->socketserver()->CreateAsyncSocket(addr.family(), - SOCK_DGRAM)), - udp_socket_(talk_base::AsyncUDPSocket::Create(socket_, addr)), - server_(udp_socket_) { - } - private: - talk_base::AsyncSocket* socket_; - talk_base::AsyncUDPSocket* udp_socket_; - cricket::StunServer server_; -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_TESTSTUNSERVER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/testturnserver.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/testturnserver.h deleted file mode 100755 index 5625090..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/testturnserver.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * 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_P2P_BASE_TESTTURNSERVER_H_ -#define TALK_P2P_BASE_TESTTURNSERVER_H_ - -#include - -#include "talk/base/asyncudpsocket.h" -#include "talk/base/thread.h" -#include "talk/p2p/base/basicpacketsocketfactory.h" -#include "talk/p2p/base/stun.h" -#include "talk/p2p/base/turnserver.h" - -namespace cricket { - -static const char kTestRealm[] = "example.org"; -static const char kTestSoftware[] = "TestTurnServer"; - -class TestTurnServer : public TurnAuthInterface { - public: - TestTurnServer(talk_base::Thread* thread, - const talk_base::SocketAddress& udp_int_addr, - const talk_base::SocketAddress& udp_ext_addr) - : server_(thread) { - AddInternalSocket(udp_int_addr, cricket::PROTO_UDP); - server_.SetExternalSocketFactory(new talk_base::BasicPacketSocketFactory(), - udp_ext_addr); - server_.set_realm(kTestRealm); - server_.set_software(kTestSoftware); - server_.set_auth_hook(this); - } - - void set_enable_otu_nonce(bool enable) { - server_.set_enable_otu_nonce(enable); - } - - TurnServer* server() { return &server_; } - - void AddInternalSocket(const talk_base::SocketAddress& int_addr, - ProtocolType proto) { - talk_base::Thread* thread = talk_base::Thread::Current(); - if (proto == cricket::PROTO_UDP) { - server_.AddInternalSocket(talk_base::AsyncUDPSocket::Create( - thread->socketserver(), int_addr), proto); - } else if (proto == cricket::PROTO_TCP) { - // For TCP we need to create a server socket which can listen for incoming - // new connections. - talk_base::AsyncSocket* socket = - thread->socketserver()->CreateAsyncSocket(SOCK_STREAM); - socket->Bind(int_addr); - socket->Listen(5); - server_.AddInternalServerSocket(socket, proto); - } - } - - private: - // For this test server, succeed if the password is the same as the username. - // Obviously, do not use this in a production environment. - virtual bool GetKey(const std::string& username, const std::string& realm, - std::string* key) { - return ComputeStunCredentialHash(username, realm, username, key); - } - - TurnServer server_; -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_TESTTURNSERVER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/transport.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/transport.h deleted file mode 100755 index 6d85438..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/transport.h +++ /dev/null @@ -1,525 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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. - */ - -// A Transport manages a set of named channels of the same type. -// -// Subclasses choose the appropriate class to instantiate for each channel; -// however, this base class keeps track of the channels by name, watches their -// state changes (in order to update the manager's state), and forwards -// requests to begin connecting or to reset to each of the channels. -// -// On Threading: Transport performs work on both the signaling and worker -// threads. For subclasses, the rule is that all signaling related calls will -// be made on the signaling thread and all channel related calls (including -// signaling for a channel) will be made on the worker thread. When -// information needs to be sent between the two threads, this class should do -// the work (e.g., OnRemoteCandidate). -// -// Note: Subclasses must call DestroyChannels() in their own constructors. -// It is not possible to do so here because the subclass constructor will -// already have run. - -#ifndef TALK_P2P_BASE_TRANSPORT_H_ -#define TALK_P2P_BASE_TRANSPORT_H_ - -#include -#include -#include -#include "talk/base/criticalsection.h" -#include "talk/base/messagequeue.h" -#include "talk/base/sigslot.h" -#include "talk/base/sslstreamadapter.h" -#include "talk/p2p/base/candidate.h" -#include "talk/p2p/base/constants.h" -#include "talk/p2p/base/sessiondescription.h" -#include "talk/p2p/base/transportinfo.h" - -namespace talk_base { -class Thread; -} - -namespace buzz { -class QName; -class XmlElement; -} - -namespace cricket { - -struct ParseError; -struct WriteError; -class CandidateTranslator; -class PortAllocator; -class SessionManager; -class Session; -class TransportChannel; -class TransportChannelImpl; - -typedef std::vector XmlElements; -typedef std::vector Candidates; - -// Used to parse and serialize (write) transport candidates. For -// convenience of old code, Transports will implement TransportParser. -// Parse/Write seems better than Serialize/Deserialize or -// Create/Translate. -class TransportParser { - public: - // The incoming Translator value may be null, in which case - // ParseCandidates should return false if there are candidates to - // parse (indicating a failure to parse). If the Translator is null - // and there are no candidates to parse, then return true, - // indicating a successful parse of 0 candidates. - - // Parse or write a transport description, including ICE credentials and - // any DTLS fingerprint. Since only Jingle has transport descriptions, these - // functions are only used when serializing to Jingle. - virtual bool ParseTransportDescription(const buzz::XmlElement* elem, - const CandidateTranslator* translator, - TransportDescription* tdesc, - ParseError* error) = 0; - virtual bool WriteTransportDescription(const TransportDescription& tdesc, - const CandidateTranslator* translator, - buzz::XmlElement** tdesc_elem, - WriteError* error) = 0; - - - // Parse a single candidate. This must be used when parsing Gingle - // candidates, since there is no enclosing transport description. - virtual bool ParseGingleCandidate(const buzz::XmlElement* elem, - const CandidateTranslator* translator, - Candidate* candidates, - ParseError* error) = 0; - virtual bool WriteGingleCandidate(const Candidate& candidate, - const CandidateTranslator* translator, - buzz::XmlElement** candidate_elem, - WriteError* error) = 0; - - // Helper function to parse an element describing an address. This - // retrieves the IP and port from the given element and verifies - // that they look like plausible values. - bool ParseAddress(const buzz::XmlElement* elem, - const buzz::QName& address_name, - const buzz::QName& port_name, - talk_base::SocketAddress* address, - ParseError* error); - - virtual ~TransportParser() {} -}; - -// For "writable" and "readable", we need to differentiate between -// none, all, and some. -enum TransportState { - TRANSPORT_STATE_NONE = 0, - TRANSPORT_STATE_SOME, - TRANSPORT_STATE_ALL -}; - -// Stats that we can return about the connections for a transport channel. -// TODO(hta): Rename to ConnectionStats -struct ConnectionInfo { - ConnectionInfo() - : best_connection(false), - writable(false), - readable(false), - timeout(false), - new_connection(false), - rtt(0), - sent_total_bytes(0), - sent_bytes_second(0), - recv_total_bytes(0), - recv_bytes_second(0), - key(NULL) {} - - bool best_connection; // Is this the best connection we have? - bool writable; // Has this connection received a STUN response? - bool readable; // Has this connection received a STUN request? - bool timeout; // Has this connection timed out? - bool new_connection; // Is this a newly created connection? - size_t rtt; // The STUN RTT for this connection. - size_t sent_total_bytes; // Total bytes sent on this connection. - size_t sent_bytes_second; // Bps over the last measurement interval. - size_t recv_total_bytes; // Total bytes received on this connection. - size_t recv_bytes_second; // Bps over the last measurement interval. - Candidate local_candidate; // The local candidate for this connection. - Candidate remote_candidate; // The remote candidate for this connection. - void* key; // A static value that identifies this conn. -}; - -// Information about all the connections of a channel. -typedef std::vector ConnectionInfos; - -// Information about a specific channel -struct TransportChannelStats { - int component; - ConnectionInfos connection_infos; -}; - -// Information about all the channels of a transport. -// TODO(hta): Consider if a simple vector is as good as a map. -typedef std::vector TransportChannelStatsList; - -// Information about the stats of a transport. -struct TransportStats { - std::string content_name; - TransportChannelStatsList channel_stats; -}; - -bool BadTransportDescription(const std::string& desc, std::string* err_desc); - -class Transport : public talk_base::MessageHandler, - public sigslot::has_slots<> { - public: - Transport(talk_base::Thread* signaling_thread, - talk_base::Thread* worker_thread, - const std::string& content_name, - const std::string& type, - PortAllocator* allocator); - virtual ~Transport(); - - // Returns the signaling thread. The app talks to Transport on this thread. - talk_base::Thread* signaling_thread() { return signaling_thread_; } - // Returns the worker thread. The actual networking is done on this thread. - talk_base::Thread* worker_thread() { return worker_thread_; } - - // Returns the content_name of this transport. - const std::string& content_name() const { return content_name_; } - // Returns the type of this transport. - const std::string& type() const { return type_; } - - // Returns the port allocator object for this transport. - PortAllocator* port_allocator() { return allocator_; } - - // Returns the readable and states of this manager. These bits are the ORs - // of the corresponding bits on the managed channels. Each time one of these - // states changes, a signal is raised. - // TODO: Replace uses of readable() and writable() with - // any_channels_readable() and any_channels_writable(). - bool readable() const { return any_channels_readable(); } - bool writable() const { return any_channels_writable(); } - bool was_writable() const { return was_writable_; } - bool any_channels_readable() const { - return (readable_ == TRANSPORT_STATE_SOME || - readable_ == TRANSPORT_STATE_ALL); - } - bool any_channels_writable() const { - return (writable_ == TRANSPORT_STATE_SOME || - writable_ == TRANSPORT_STATE_ALL); - } - bool all_channels_readable() const { - return (readable_ == TRANSPORT_STATE_ALL); - } - bool all_channels_writable() const { - return (writable_ == TRANSPORT_STATE_ALL); - } - sigslot::signal1 SignalReadableState; - sigslot::signal1 SignalWritableState; - sigslot::signal1 SignalCompleted; - sigslot::signal1 SignalFailed; - - // Returns whether the client has requested the channels to connect. - bool connect_requested() const { return connect_requested_; } - - void SetIceRole(IceRole role); - IceRole ice_role() const { return ice_role_; } - - void SetIceTiebreaker(uint64 IceTiebreaker) { tiebreaker_ = IceTiebreaker; } - uint64 IceTiebreaker() { return tiebreaker_; } - - // Must be called before applying local session description. - void SetIdentity(talk_base::SSLIdentity* identity); - - // Get a copy of the local identity provided by SetIdentity. - bool GetIdentity(talk_base::SSLIdentity** identity); - - // Get a copy of the remote certificate in use by the specified channel. - bool GetRemoteCertificate(talk_base::SSLCertificate** cert); - - TransportProtocol protocol() const { return protocol_; } - - // Create, destroy, and lookup the channels of this type by their components. - TransportChannelImpl* CreateChannel(int component); - // Note: GetChannel may lead to race conditions, since the mutex is not held - // after the pointer is returned. - TransportChannelImpl* GetChannel(int component); - // Note: HasChannel does not lead to race conditions, unlike GetChannel. - bool HasChannel(int component) { - return (NULL != GetChannel(component)); - } - bool HasChannels(); - void DestroyChannel(int component); - - // Set the local TransportDescription to be used by TransportChannels. - // This should be called before ConnectChannels(). - bool SetLocalTransportDescription(const TransportDescription& description, - ContentAction action, - std::string* error_desc); - - // Set the remote TransportDescription to be used by TransportChannels. - bool SetRemoteTransportDescription(const TransportDescription& description, - ContentAction action, - std::string* error_desc); - - // Tells all current and future channels to start connecting. When the first - // channel begins connecting, the following signal is raised. - void ConnectChannels(); - sigslot::signal1 SignalConnecting; - - // Resets all of the channels back to their initial state. They are no - // longer connecting. - void ResetChannels(); - - // Destroys every channel created so far. - void DestroyAllChannels(); - - bool GetStats(TransportStats* stats); - - // Before any stanza is sent, the manager will request signaling. Once - // signaling is available, the client should call OnSignalingReady. Once - // this occurs, the transport (or its channels) can send any waiting stanzas. - // OnSignalingReady invokes OnTransportSignalingReady and then forwards this - // signal to each channel. - sigslot::signal1 SignalRequestSignaling; - void OnSignalingReady(); - - // Handles sending of ready candidates and receiving of remote candidates. - sigslot::signal2&> SignalCandidatesReady; - - sigslot::signal1 SignalCandidatesAllocationDone; - void OnRemoteCandidates(const std::vector& candidates); - - // If candidate is not acceptable, returns false and sets error. - // Call this before calling OnRemoteCandidates. - virtual bool VerifyCandidate(const Candidate& candidate, - std::string* error); - - // Signals when the best connection for a channel changes. - sigslot::signal3 SignalRouteChange; - - // A transport message has generated an transport-specific error. The - // stanza that caused the error is available in session_msg. If false is - // returned, the error is considered unrecoverable, and the session is - // terminated. - // TODO(juberti): Remove these obsolete functions once Session no longer - // references them. - virtual void OnTransportError(const buzz::XmlElement* error) {} - sigslot::signal6 - SignalTransportError; - - // Forwards the signal from TransportChannel to BaseSession. - sigslot::signal0<> SignalRoleConflict; - - virtual bool GetSslRole(talk_base::SSLRole* ssl_role) const; - - protected: - // These are called by Create/DestroyChannel above in order to create or - // destroy the appropriate type of channel. - virtual TransportChannelImpl* CreateTransportChannel(int component) = 0; - virtual void DestroyTransportChannel(TransportChannelImpl* channel) = 0; - - // Informs the subclass that we received the signaling ready message. - virtual void OnTransportSignalingReady() {} - - // The current local transport description, for use by derived classes - // when performing transport description negotiation. - const TransportDescription* local_description() const { - return local_description_.get(); - } - - // The current remote transport description, for use by derived classes - // when performing transport description negotiation. - const TransportDescription* remote_description() const { - return remote_description_.get(); - } - - virtual void SetIdentity_w(talk_base::SSLIdentity* identity) {} - - virtual bool GetIdentity_w(talk_base::SSLIdentity** identity) { - return false; - } - - // Pushes down the transport parameters from the local description, such - // as the ICE ufrag and pwd. - // Derived classes can override, but must call the base as well. - virtual bool ApplyLocalTransportDescription_w(TransportChannelImpl* channel, - std::string* error_desc); - - // Pushes down remote ice credentials from the remote description to the - // transport channel. - virtual bool ApplyRemoteTransportDescription_w(TransportChannelImpl* ch, - std::string* error_desc); - - // Negotiates the transport parameters based on the current local and remote - // transport description, such at the version of ICE to use, and whether DTLS - // should be activated. - // Derived classes can negotiate their specific parameters here, but must call - // the base as well. - virtual bool NegotiateTransportDescription_w(ContentAction local_role, - std::string* error_desc); - - // Pushes down the transport parameters obtained via negotiation. - // Derived classes can set their specific parameters here, but must call the - // base as well. - virtual bool ApplyNegotiatedTransportDescription_w( - TransportChannelImpl* channel, std::string* error_desc); - - virtual bool GetSslRole_w(talk_base::SSLRole* ssl_role) const { - return false; - } - - private: - struct ChannelMapEntry { - ChannelMapEntry() : impl_(NULL), candidates_allocated_(false), ref_(0) {} - explicit ChannelMapEntry(TransportChannelImpl *impl) - : impl_(impl), - candidates_allocated_(false), - ref_(0) { - } - - void AddRef() { ++ref_; } - void DecRef() { - ASSERT(ref_ > 0); - --ref_; - } - int ref() const { return ref_; } - - TransportChannelImpl* get() const { return impl_; } - TransportChannelImpl* operator->() const { return impl_; } - void set_candidates_allocated(bool status) { - candidates_allocated_ = status; - } - bool candidates_allocated() const { return candidates_allocated_; } - - private: - TransportChannelImpl *impl_; - bool candidates_allocated_; - int ref_; - }; - - // Candidate component => ChannelMapEntry - typedef std::map ChannelMap; - - // Called when the state of a channel changes. - void OnChannelReadableState(TransportChannel* channel); - void OnChannelWritableState(TransportChannel* channel); - - // Called when a channel requests signaling. - void OnChannelRequestSignaling(TransportChannelImpl* channel); - - // Called when a candidate is ready from remote peer. - void OnRemoteCandidate(const Candidate& candidate); - // Called when a candidate is ready from channel. - void OnChannelCandidateReady(TransportChannelImpl* channel, - const Candidate& candidate); - void OnChannelRouteChange(TransportChannel* channel, - const Candidate& remote_candidate); - void OnChannelCandidatesAllocationDone(TransportChannelImpl* channel); - // Called when there is ICE role change. - void OnRoleConflict(TransportChannelImpl* channel); - // Called when the channel removes a connection. - void OnChannelConnectionRemoved(TransportChannelImpl* channel); - - // Dispatches messages to the appropriate handler (below). - void OnMessage(talk_base::Message* msg); - - // These are versions of the above methods that are called only on a - // particular thread (s = signaling, w = worker). The above methods post or - // send a message to invoke this version. - TransportChannelImpl* CreateChannel_w(int component); - void DestroyChannel_w(int component); - void ConnectChannels_w(); - void ResetChannels_w(); - void DestroyAllChannels_w(); - void OnRemoteCandidate_w(const Candidate& candidate); - void OnChannelReadableState_s(); - void OnChannelWritableState_s(); - void OnChannelRequestSignaling_s(int component); - void OnConnecting_s(); - void OnChannelRouteChange_s(const TransportChannel* channel, - const Candidate& remote_candidate); - void OnChannelCandidatesAllocationDone_s(); - - // Helper function that invokes the given function on every channel. - typedef void (TransportChannelImpl::* TransportChannelFunc)(); - void CallChannels_w(TransportChannelFunc func); - - // Computes the OR of the channel's read or write state (argument picks). - TransportState GetTransportState_s(bool read); - - void OnChannelCandidateReady_s(); - - void SetIceRole_w(IceRole role); - void SetRemoteIceMode_w(IceMode mode); - bool SetLocalTransportDescription_w(const TransportDescription& desc, - ContentAction action, - std::string* error_desc); - bool SetRemoteTransportDescription_w(const TransportDescription& desc, - ContentAction action, - std::string* error_desc); - bool GetStats_w(TransportStats* infos); - bool GetRemoteCertificate_w(talk_base::SSLCertificate** cert); - - // Sends SignalCompleted if we are now in that state. - void MaybeCompleted_w(); - - talk_base::Thread* signaling_thread_; - talk_base::Thread* worker_thread_; - std::string content_name_; - std::string type_; - PortAllocator* allocator_; - bool destroyed_; - TransportState readable_; - TransportState writable_; - bool was_writable_; - bool connect_requested_; - IceRole ice_role_; - uint64 tiebreaker_; - TransportProtocol protocol_; - IceMode remote_ice_mode_; - talk_base::scoped_ptr local_description_; - talk_base::scoped_ptr remote_description_; - - ChannelMap channels_; - // Buffers the ready_candidates so that SignalCanidatesReady can - // provide them in multiples. - std::vector ready_candidates_; - // Protects changes to channels and messages - talk_base::CriticalSection crit_; - - DISALLOW_EVIL_CONSTRUCTORS(Transport); -}; - -// Extract a TransportProtocol from a TransportDescription. -TransportProtocol TransportProtocolFromDescription( - const TransportDescription* desc); - -} // namespace cricket - -#endif // TALK_P2P_BASE_TRANSPORT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/transportchannel.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/transportchannel.h deleted file mode 100755 index b3ee89f..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/transportchannel.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_BASE_TRANSPORTCHANNEL_H_ -#define TALK_P2P_BASE_TRANSPORTCHANNEL_H_ - -#include -#include - -#include "talk/base/asyncpacketsocket.h" -#include "talk/base/basictypes.h" -#include "talk/base/dscp.h" -#include "talk/base/sigslot.h" -#include "talk/base/socket.h" -#include "talk/base/sslidentity.h" -#include "talk/base/sslstreamadapter.h" -#include "talk/p2p/base/candidate.h" -#include "talk/p2p/base/transport.h" -#include "talk/p2p/base/transportdescription.h" - -namespace cricket { - -class Candidate; - -// Flags for SendPacket/SignalReadPacket. -enum PacketFlags { - PF_NORMAL = 0x00, // A normal packet. - PF_SRTP_BYPASS = 0x01, // An encrypted SRTP packet; bypass any additional - // crypto provided by the transport (e.g. DTLS) -}; - -// A TransportChannel represents one logical stream of packets that are sent -// between the two sides of a session. -class TransportChannel : public sigslot::has_slots<> { - public: - explicit TransportChannel(const std::string& content_name, int component) - : content_name_(content_name), - component_(component), - readable_(false), writable_(false) {} - virtual ~TransportChannel() {} - - // TODO(mallinath) - Remove this API, as it's no longer useful. - // Returns the session id of this channel. - virtual const std::string SessionId() const { return std::string(); } - - const std::string& content_name() const { return content_name_; } - int component() const { return component_; } - - // Returns the readable and states of this channel. Each time one of these - // states changes, a signal is raised. These states are aggregated by the - // TransportManager. - bool readable() const { return readable_; } - bool writable() const { return writable_; } - sigslot::signal1 SignalReadableState; - sigslot::signal1 SignalWritableState; - // Emitted when the TransportChannel's ability to send has changed. - sigslot::signal1 SignalReadyToSend; - - // Attempts to send the given packet. The return value is < 0 on failure. - // TODO: Remove the default argument once channel code is updated. - virtual int SendPacket(const char* data, size_t len, - const talk_base::PacketOptions& options, - int flags = 0) = 0; - - // Sets a socket option on this channel. Note that not all options are - // supported by all transport types. - virtual int SetOption(talk_base::Socket::Option opt, int value) = 0; - - // Returns the most recent error that occurred on this channel. - virtual int GetError() = 0; - - // Returns the current stats for this connection. - virtual bool GetStats(ConnectionInfos* infos) = 0; - - // Is DTLS active? - virtual bool IsDtlsActive() const = 0; - - // Default implementation. - virtual bool GetSslRole(talk_base::SSLRole* role) const = 0; - - // Sets up the ciphers to use for DTLS-SRTP. - virtual bool SetSrtpCiphers(const std::vector& ciphers) = 0; - - // Finds out which DTLS-SRTP cipher was negotiated - virtual bool GetSrtpCipher(std::string* cipher) = 0; - - // Gets a copy of the local SSL identity, owned by the caller. - virtual bool GetLocalIdentity(talk_base::SSLIdentity** identity) const = 0; - - // Gets a copy of the remote side's SSL certificate, owned by the caller. - virtual bool GetRemoteCertificate(talk_base::SSLCertificate** cert) const = 0; - - // Allows key material to be extracted for external encryption. - virtual bool ExportKeyingMaterial(const std::string& label, - const uint8* context, - size_t context_len, - bool use_context, - uint8* result, - size_t result_len) = 0; - - // Signalled each time a packet is received on this channel. - sigslot::signal5 SignalReadPacket; - - // This signal occurs when there is a change in the way that packets are - // being routed, i.e. to a different remote location. The candidate - // indicates where and how we are currently sending media. - sigslot::signal2 SignalRouteChange; - - // Invoked when the channel is being destroyed. - sigslot::signal1 SignalDestroyed; - - // Debugging description of this transport channel. - std::string ToString() const; - - protected: - // Sets the readable state, signaling if necessary. - void set_readable(bool readable); - - // Sets the writable state, signaling if necessary. - void set_writable(bool writable); - - - private: - // Used mostly for debugging. - std::string content_name_; - int component_; - bool readable_; - bool writable_; - - DISALLOW_EVIL_CONSTRUCTORS(TransportChannel); -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_TRANSPORTCHANNEL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/transportchannelimpl.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/transportchannelimpl.h deleted file mode 100755 index 9802f21..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/transportchannelimpl.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_BASE_TRANSPORTCHANNELIMPL_H_ -#define TALK_P2P_BASE_TRANSPORTCHANNELIMPL_H_ - -#include -#include "talk/p2p/base/transport.h" -#include "talk/p2p/base/transportchannel.h" - -namespace buzz { class XmlElement; } - -namespace cricket { - -class Candidate; - -// Base class for real implementations of TransportChannel. This includes some -// methods called only by Transport, which do not need to be exposed to the -// client. -class TransportChannelImpl : public TransportChannel { - public: - explicit TransportChannelImpl(const std::string& content_name, int component) - : TransportChannel(content_name, component) {} - - // Returns the transport that created this channel. - virtual Transport* GetTransport() = 0; - - // For ICE channels. - virtual IceRole GetIceRole() const = 0; - virtual void SetIceRole(IceRole role) = 0; - virtual void SetIceTiebreaker(uint64 tiebreaker) = 0; - virtual size_t GetConnectionCount() const = 0; - // To toggle G-ICE/ICE. - virtual bool GetIceProtocolType(IceProtocolType* type) const = 0; - virtual void SetIceProtocolType(IceProtocolType type) = 0; - // SetIceCredentials only need to be implemented by the ICE - // transport channels. Non-ICE transport channels can just ignore. - // The ufrag and pwd should be set before the Connect() is called. - virtual void SetIceCredentials(const std::string& ice_ufrag, - const std::string& ice_pwd) = 0; - // SetRemoteIceCredentials only need to be implemented by the ICE - // transport channels. Non-ICE transport channels can just ignore. - virtual void SetRemoteIceCredentials(const std::string& ice_ufrag, - const std::string& ice_pwd) = 0; - - // SetRemoteIceMode must be implemented only by the ICE transport channels. - virtual void SetRemoteIceMode(IceMode mode) = 0; - - // Begins the process of attempting to make a connection to the other client. - virtual void Connect() = 0; - - // Resets this channel back to the initial state (i.e., not connecting). - virtual void Reset() = 0; - - // Allows an individual channel to request signaling and be notified when it - // is ready. This is useful if the individual named channels have need to - // send their own transport-info stanzas. - sigslot::signal1 SignalRequestSignaling; - virtual void OnSignalingReady() = 0; - - // Handles sending and receiving of candidates. The Transport - // receives the candidates and may forward them to the relevant - // channel. - // - // Note: Since candidates are delivered asynchronously to the - // channel, they cannot return an error if the message is invalid. - // It is assumed that the Transport will have checked validity - // before forwarding. - sigslot::signal2 SignalCandidateReady; - virtual void OnCandidate(const Candidate& candidate) = 0; - - // DTLS methods - // Set DTLS local identity. The identity object is not copied, but the caller - // retains ownership and must delete it after this TransportChannelImpl is - // destroyed. - // TODO(bemasc): Fix the ownership semantics of this method. - virtual bool SetLocalIdentity(talk_base::SSLIdentity* identity) = 0; - - // Set DTLS Remote fingerprint. Must be after local identity set. - virtual bool SetRemoteFingerprint(const std::string& digest_alg, - const uint8* digest, - size_t digest_len) = 0; - - virtual bool SetSslRole(talk_base::SSLRole role) = 0; - - // TransportChannel is forwarding this signal from PortAllocatorSession. - sigslot::signal1 SignalCandidatesAllocationDone; - - // Invoked when there is conflict in the ICE role between local and remote - // agents. - sigslot::signal1 SignalRoleConflict; - - // Emitted whenever the number of connections available to the transport - // channel decreases. - sigslot::signal1 SignalConnectionRemoved; - - private: - DISALLOW_EVIL_CONSTRUCTORS(TransportChannelImpl); -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_TRANSPORTCHANNELIMPL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/transportchannelproxy.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/transportchannelproxy.h deleted file mode 100755 index 46c6c00..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/transportchannelproxy.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_BASE_TRANSPORTCHANNELPROXY_H_ -#define TALK_P2P_BASE_TRANSPORTCHANNELPROXY_H_ - -#include -#include -#include - -#include "talk/base/messagehandler.h" -#include "talk/p2p/base/transportchannel.h" - -namespace talk_base { -class Thread; -} - -namespace cricket { - -class TransportChannelImpl; - -// Proxies calls between the client and the transport channel implementation. -// This is needed because clients are allowed to create channels before the -// network negotiation is complete. Hence, we create a proxy up front, and -// when negotiation completes, connect the proxy to the implementaiton. -class TransportChannelProxy : public TransportChannel, - public talk_base::MessageHandler { - public: - TransportChannelProxy(const std::string& content_name, - const std::string& name, - int component); - virtual ~TransportChannelProxy(); - - const std::string& name() const { return name_; } - TransportChannelImpl* impl() { return impl_; } - - // Sets the implementation to which we will proxy. - void SetImplementation(TransportChannelImpl* impl); - - // Implementation of the TransportChannel interface. These simply forward to - // the implementation. - virtual int SendPacket(const char* data, size_t len, - const talk_base::PacketOptions& options, - int flags); - virtual int SetOption(talk_base::Socket::Option opt, int value); - virtual int GetError(); - virtual IceRole GetIceRole() const; - virtual bool GetStats(ConnectionInfos* infos); - virtual bool IsDtlsActive() const; - virtual bool GetSslRole(talk_base::SSLRole* role) const; - virtual bool SetSslRole(talk_base::SSLRole role); - virtual bool SetSrtpCiphers(const std::vector& ciphers); - virtual bool GetSrtpCipher(std::string* cipher); - virtual bool GetLocalIdentity(talk_base::SSLIdentity** identity) const; - virtual bool GetRemoteCertificate(talk_base::SSLCertificate** cert) const; - virtual bool ExportKeyingMaterial(const std::string& label, - const uint8* context, - size_t context_len, - bool use_context, - uint8* result, - size_t result_len); - - private: - // Catch signals from the implementation channel. These just forward to the - // client (after updating our state to match). - void OnReadableState(TransportChannel* channel); - void OnWritableState(TransportChannel* channel); - void OnReadPacket(TransportChannel* channel, const char* data, size_t size, - const talk_base::PacketTime& packet_time, int flags); - void OnReadyToSend(TransportChannel* channel); - void OnRouteChange(TransportChannel* channel, const Candidate& candidate); - - void OnMessage(talk_base::Message* message); - - typedef std::pair OptionPair; - typedef std::vector OptionList; - std::string name_; - talk_base::Thread* worker_thread_; - TransportChannelImpl* impl_; - OptionList pending_options_; - std::vector pending_srtp_ciphers_; - - DISALLOW_EVIL_CONSTRUCTORS(TransportChannelProxy); -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_TRANSPORTCHANNELPROXY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/transportdescription.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/transportdescription.h deleted file mode 100755 index 7a8ad1f..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/transportdescription.h +++ /dev/null @@ -1,186 +0,0 @@ -/* - * libjingle - * Copyright 2012, The Libjingle Authors. - * - * 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_P2P_BASE_TRANSPORTDESCRIPTION_H_ -#define TALK_P2P_BASE_TRANSPORTDESCRIPTION_H_ - -#include -#include -#include - -#include "talk/base/scoped_ptr.h" -#include "talk/base/sslfingerprint.h" -#include "talk/p2p/base/candidate.h" -#include "talk/p2p/base/constants.h" - -namespace cricket { - -// SEC_ENABLED and SEC_REQUIRED should only be used if the session -// was negotiated over TLS, to protect the inline crypto material -// exchange. -// SEC_DISABLED: No crypto in outgoing offer, ignore any supplied crypto. -// SEC_ENABLED: Crypto in outgoing offer and answer (if supplied in offer). -// SEC_REQUIRED: Crypto in outgoing offer and answer. Fail any offer with absent -// or unsupported crypto. -enum SecurePolicy { - SEC_DISABLED, - SEC_ENABLED, - SEC_REQUIRED -}; - -// The transport protocol we've elected to use. -enum TransportProtocol { - ICEPROTO_GOOGLE, // Google version of ICE protocol. - ICEPROTO_HYBRID, // ICE, but can fall back to the Google version. - ICEPROTO_RFC5245 // Standard RFC 5245 version of ICE. -}; -// The old name for TransportProtocol. -// TODO(juberti): remove this. -typedef TransportProtocol IceProtocolType; - -// Whether our side of the call is driving the negotiation, or the other side. -enum IceRole { - ICEROLE_CONTROLLING = 0, - ICEROLE_CONTROLLED, - ICEROLE_UNKNOWN -}; - -// ICE RFC 5245 implementation type. -enum IceMode { - ICEMODE_FULL, // As defined in http://tools.ietf.org/html/rfc5245#section-4.1 - ICEMODE_LITE // As defined in http://tools.ietf.org/html/rfc5245#section-4.2 -}; - -// RFC 4145 - http://tools.ietf.org/html/rfc4145#section-4 -// 'active': The endpoint will initiate an outgoing connection. -// 'passive': The endpoint will accept an incoming connection. -// 'actpass': The endpoint is willing to accept an incoming -// connection or to initiate an outgoing connection. -enum ConnectionRole { - CONNECTIONROLE_NONE = 0, - CONNECTIONROLE_ACTIVE, - CONNECTIONROLE_PASSIVE, - CONNECTIONROLE_ACTPASS, - CONNECTIONROLE_HOLDCONN, -}; - -extern const char CONNECTIONROLE_ACTIVE_STR[]; -extern const char CONNECTIONROLE_PASSIVE_STR[]; -extern const char CONNECTIONROLE_ACTPASS_STR[]; -extern const char CONNECTIONROLE_HOLDCONN_STR[]; - -bool StringToConnectionRole(const std::string& role_str, ConnectionRole* role); -bool ConnectionRoleToString(const ConnectionRole& role, std::string* role_str); - -typedef std::vector Candidates; - -struct TransportDescription { - TransportDescription() : ice_mode(ICEMODE_FULL) {} - - TransportDescription(const std::string& transport_type, - const std::vector& transport_options, - const std::string& ice_ufrag, - const std::string& ice_pwd, - IceMode ice_mode, - ConnectionRole role, - const talk_base::SSLFingerprint* identity_fingerprint, - const Candidates& candidates) - : transport_type(transport_type), - transport_options(transport_options), - ice_ufrag(ice_ufrag), - ice_pwd(ice_pwd), - ice_mode(ice_mode), - connection_role(role), - identity_fingerprint(CopyFingerprint(identity_fingerprint)), - candidates(candidates) {} - TransportDescription(const std::string& transport_type, - const std::string& ice_ufrag, - const std::string& ice_pwd) - : transport_type(transport_type), - ice_ufrag(ice_ufrag), - ice_pwd(ice_pwd), - ice_mode(ICEMODE_FULL), - connection_role(CONNECTIONROLE_NONE) {} - TransportDescription(const TransportDescription& from) - : transport_type(from.transport_type), - transport_options(from.transport_options), - ice_ufrag(from.ice_ufrag), - ice_pwd(from.ice_pwd), - ice_mode(from.ice_mode), - connection_role(from.connection_role), - identity_fingerprint(CopyFingerprint(from.identity_fingerprint.get())), - candidates(from.candidates) {} - - TransportDescription& operator=(const TransportDescription& from) { - // Self-assignment - if (this == &from) - return *this; - - transport_type = from.transport_type; - transport_options = from.transport_options; - ice_ufrag = from.ice_ufrag; - ice_pwd = from.ice_pwd; - ice_mode = from.ice_mode; - connection_role = from.connection_role; - - identity_fingerprint.reset(CopyFingerprint( - from.identity_fingerprint.get())); - candidates = from.candidates; - return *this; - } - - bool HasOption(const std::string& option) const { - return (std::find(transport_options.begin(), transport_options.end(), - option) != transport_options.end()); - } - void AddOption(const std::string& option) { - transport_options.push_back(option); - } - bool secure() const { return identity_fingerprint != NULL; } - - static talk_base::SSLFingerprint* CopyFingerprint( - const talk_base::SSLFingerprint* from) { - if (!from) - return NULL; - - return new talk_base::SSLFingerprint(*from); - } - - std::string transport_type; // xmlns of - std::vector transport_options; - std::string ice_ufrag; - std::string ice_pwd; - IceMode ice_mode; - ConnectionRole connection_role; - - talk_base::scoped_ptr identity_fingerprint; - Candidates candidates; -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_TRANSPORTDESCRIPTION_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/transportdescriptionfactory.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/transportdescriptionfactory.h deleted file mode 100755 index 98ab93a..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/transportdescriptionfactory.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * libjingle - * Copyright 2012 Google Inc. All rights reserved. - * - * 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_P2P_BASE_TRANSPORTDESCRIPTIONFACTORY_H_ -#define TALK_P2P_BASE_TRANSPORTDESCRIPTIONFACTORY_H_ - -#include "talk/p2p/base/transportdescription.h" - -namespace talk_base { -class SSLIdentity; -} - -namespace cricket { - -struct TransportOptions { - TransportOptions() : ice_restart(false), prefer_passive_role(false) {} - bool ice_restart; - bool prefer_passive_role; -}; - -// Creates transport descriptions according to the supplied configuration. -// When creating answers, performs the appropriate negotiation -// of the various fields to determine the proper result. -class TransportDescriptionFactory { - public: - // Default ctor; use methods below to set configuration. - TransportDescriptionFactory(); - SecurePolicy secure() const { return secure_; } - // The identity to use when setting up DTLS. - talk_base::SSLIdentity* identity() const { return identity_; } - - // Specifies the transport protocol to be use. - void set_protocol(TransportProtocol protocol) { protocol_ = protocol; } - // Specifies the transport security policy to use. - void set_secure(SecurePolicy s) { secure_ = s; } - // Specifies the identity to use (only used when secure is not SEC_DISABLED). - void set_identity(talk_base::SSLIdentity* identity) { identity_ = identity; } - - // Creates a transport description suitable for use in an offer. - TransportDescription* CreateOffer(const TransportOptions& options, - const TransportDescription* current_description) const; - // Create a transport description that is a response to an offer. - TransportDescription* CreateAnswer( - const TransportDescription* offer, - const TransportOptions& options, - const TransportDescription* current_description) const; - - private: - bool SetSecurityInfo(TransportDescription* description, - ConnectionRole role) const; - - TransportProtocol protocol_; - SecurePolicy secure_; - talk_base::SSLIdentity* identity_; -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_TRANSPORTDESCRIPTIONFACTORY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/transportinfo.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/transportinfo.h deleted file mode 100755 index f72552d..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/transportinfo.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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_P2P_BASE_TRANSPORTINFO_H_ -#define TALK_P2P_BASE_TRANSPORTINFO_H_ - -#include -#include - -#include "talk/base/helpers.h" -#include "talk/p2p/base/candidate.h" -#include "talk/p2p/base/constants.h" -#include "talk/p2p/base/transportdescription.h" - -namespace cricket { - -// A TransportInfo is NOT a transport-info message. It is comparable -// to a "ContentInfo". A transport-infos message is basically just a -// collection of TransportInfos. -struct TransportInfo { - TransportInfo() {} - - TransportInfo(const std::string& content_name, - const TransportDescription& description) - : content_name(content_name), - description(description) {} - - std::string content_name; - TransportDescription description; -}; - -typedef std::vector TransportInfos; - -} // namespace cricket - -#endif // TALK_P2P_BASE_TRANSPORTINFO_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/turnport.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/turnport.h deleted file mode 100755 index 5ff0e32..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/turnport.h +++ /dev/null @@ -1,225 +0,0 @@ -/* - * 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_P2P_BASE_TURNPORT_H_ -#define TALK_P2P_BASE_TURNPORT_H_ - -#include -#include -#include - -#include "talk/base/asyncpacketsocket.h" -#include "talk/p2p/base/port.h" -#include "talk/p2p/client/basicportallocator.h" - -namespace talk_base { -class AsyncResolver; -class SignalThread; -} - -namespace cricket { - -extern const char TURN_PORT_TYPE[]; -class TurnAllocateRequest; -class TurnEntry; - -class TurnPort : public Port { - public: - static TurnPort* Create(talk_base::Thread* thread, - talk_base::PacketSocketFactory* factory, - talk_base::Network* network, - talk_base::AsyncPacketSocket* socket, - const std::string& username, // ice username. - const std::string& password, // ice password. - const ProtocolAddress& server_address, - const RelayCredentials& credentials) { - return new TurnPort(thread, factory, network, socket, - username, password, server_address, credentials); - } - - static TurnPort* Create(talk_base::Thread* thread, - talk_base::PacketSocketFactory* factory, - talk_base::Network* network, - const talk_base::IPAddress& ip, - int min_port, int max_port, - const std::string& username, // ice username. - const std::string& password, // ice password. - const ProtocolAddress& server_address, - const RelayCredentials& credentials) { - return new TurnPort(thread, factory, network, ip, min_port, max_port, - username, password, server_address, credentials); - } - - virtual ~TurnPort(); - - const ProtocolAddress& server_address() const { return server_address_; } - - bool connected() const { return connected_; } - const RelayCredentials& credentials() const { return credentials_; } - - virtual void PrepareAddress(); - virtual Connection* CreateConnection( - const Candidate& c, PortInterface::CandidateOrigin origin); - virtual int SendTo(const void* data, size_t size, - const talk_base::SocketAddress& addr, - const talk_base::PacketOptions& options, - bool payload); - virtual int SetOption(talk_base::Socket::Option opt, int value); - virtual int GetOption(talk_base::Socket::Option opt, int* value); - virtual int GetError(); - - virtual bool HandleIncomingPacket( - talk_base::AsyncPacketSocket* socket, const char* data, size_t size, - const talk_base::SocketAddress& remote_addr, - const talk_base::PacketTime& packet_time) { - OnReadPacket(socket, data, size, remote_addr, packet_time); - return true; - } - virtual void OnReadPacket(talk_base::AsyncPacketSocket* socket, - const char* data, size_t size, - const talk_base::SocketAddress& remote_addr, - const talk_base::PacketTime& packet_time); - - virtual void OnReadyToSend(talk_base::AsyncPacketSocket* socket); - - void OnSocketConnect(talk_base::AsyncPacketSocket* socket); - void OnSocketClose(talk_base::AsyncPacketSocket* socket, int error); - - - const std::string& hash() const { return hash_; } - const std::string& nonce() const { return nonce_; } - - // Signal with resolved server address. - // Parameters are port, server address and resolved server address. - // This signal will be sent only if server address is resolved successfully. - sigslot::signal3 SignalResolvedServerAddress; - - // This signal is only for testing purpose. - sigslot::signal3 - SignalCreatePermissionResult; - - protected: - TurnPort(talk_base::Thread* thread, - talk_base::PacketSocketFactory* factory, - talk_base::Network* network, - talk_base::AsyncPacketSocket* socket, - const std::string& username, - const std::string& password, - const ProtocolAddress& server_address, - const RelayCredentials& credentials); - - TurnPort(talk_base::Thread* thread, - talk_base::PacketSocketFactory* factory, - talk_base::Network* network, - const talk_base::IPAddress& ip, - int min_port, int max_port, - const std::string& username, - const std::string& password, - const ProtocolAddress& server_address, - const RelayCredentials& credentials); - - private: - enum { MSG_ERROR = MSG_FIRST_AVAILABLE }; - - typedef std::list EntryList; - typedef std::map SocketOptionsMap; - - virtual void OnMessage(talk_base::Message* pmsg); - - void set_nonce(const std::string& nonce) { nonce_ = nonce; } - void set_realm(const std::string& realm) { - if (realm != realm_) { - realm_ = realm; - UpdateHash(); - } - } - - void ResolveTurnAddress(const talk_base::SocketAddress& address); - void OnResolveResult(talk_base::AsyncResolverInterface* resolver); - - void AddRequestAuthInfo(StunMessage* msg); - void OnSendStunPacket(const void* data, size_t size, StunRequest* request); - // Stun address from allocate success response. - // Currently used only for testing. - void OnStunAddress(const talk_base::SocketAddress& address); - void OnAllocateSuccess(const talk_base::SocketAddress& address, - const talk_base::SocketAddress& stun_address); - void OnAllocateError(); - void OnAllocateRequestTimeout(); - - void HandleDataIndication(const char* data, size_t size, - const talk_base::PacketTime& packet_time); - void HandleChannelData(int channel_id, const char* data, size_t size, - const talk_base::PacketTime& packet_time); - void DispatchPacket(const char* data, size_t size, - const talk_base::SocketAddress& remote_addr, - ProtocolType proto, const talk_base::PacketTime& packet_time); - - bool ScheduleRefresh(int lifetime); - void SendRequest(StunRequest* request, int delay); - int Send(const void* data, size_t size, - const talk_base::PacketOptions& options); - void UpdateHash(); - bool UpdateNonce(StunMessage* response); - - bool HasPermission(const talk_base::IPAddress& ipaddr) const; - TurnEntry* FindEntry(const talk_base::SocketAddress& address) const; - TurnEntry* FindEntry(int channel_id) const; - TurnEntry* CreateEntry(const talk_base::SocketAddress& address); - void DestroyEntry(const talk_base::SocketAddress& address); - void OnConnectionDestroyed(Connection* conn); - - ProtocolAddress server_address_; - RelayCredentials credentials_; - - talk_base::AsyncPacketSocket* socket_; - SocketOptionsMap socket_options_; - talk_base::AsyncResolverInterface* resolver_; - int error_; - - StunRequestManager request_manager_; - std::string realm_; // From 401/438 response message. - std::string nonce_; // From 401/438 response message. - std::string hash_; // Digest of username:realm:password - - int next_channel_number_; - EntryList entries_; - - bool connected_; - - friend class TurnEntry; - friend class TurnAllocateRequest; - friend class TurnRefreshRequest; - friend class TurnCreatePermissionRequest; - friend class TurnChannelBindRequest; -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_TURNPORT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/turnserver.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/turnserver.h deleted file mode 100755 index 74c460f..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/turnserver.h +++ /dev/null @@ -1,187 +0,0 @@ -/* - * 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_P2P_BASE_TURNSERVER_H_ -#define TALK_P2P_BASE_TURNSERVER_H_ - -#include -#include -#include -#include - -#include "talk/base/asyncpacketsocket.h" -#include "talk/base/messagequeue.h" -#include "talk/base/sigslot.h" -#include "talk/base/socketaddress.h" -#include "talk/p2p/base/portinterface.h" - -namespace talk_base { -class ByteBuffer; -class PacketSocketFactory; -class Thread; -} - -namespace cricket { - -class StunMessage; -class TurnMessage; - -// The default server port for TURN, as specified in RFC5766. -const int TURN_SERVER_PORT = 3478; - -// An interface through which the MD5 credential hash can be retrieved. -class TurnAuthInterface { - public: - // Gets HA1 for the specified user and realm. - // HA1 = MD5(A1) = MD5(username:realm:password). - // Return true if the given username and realm are valid, or false if not. - virtual bool GetKey(const std::string& username, const std::string& realm, - std::string* key) = 0; -}; - -// The core TURN server class. Give it a socket to listen on via -// AddInternalServerSocket, and a factory to create external sockets via -// SetExternalSocketFactory, and it's ready to go. -// Not yet wired up: TCP support. -class TurnServer : public sigslot::has_slots<> { - public: - explicit TurnServer(talk_base::Thread* thread); - ~TurnServer(); - - // Gets/sets the realm value to use for the server. - const std::string& realm() const { return realm_; } - void set_realm(const std::string& realm) { realm_ = realm; } - - // Gets/sets the value for the SOFTWARE attribute for TURN messages. - const std::string& software() const { return software_; } - void set_software(const std::string& software) { software_ = software; } - - // Sets the authentication callback; does not take ownership. - void set_auth_hook(TurnAuthInterface* auth_hook) { auth_hook_ = auth_hook; } - - void set_enable_otu_nonce(bool enable) { enable_otu_nonce_ = enable; } - - // Starts listening for packets from internal clients. - void AddInternalSocket(talk_base::AsyncPacketSocket* socket, - ProtocolType proto); - // Starts listening for the connections on this socket. When someone tries - // to connect, the connection will be accepted and a new internal socket - // will be added. - void AddInternalServerSocket(talk_base::AsyncSocket* socket, - ProtocolType proto); - // Specifies the factory to use for creating external sockets. - void SetExternalSocketFactory(talk_base::PacketSocketFactory* factory, - const talk_base::SocketAddress& address); - - private: - // Encapsulates the client's connection to the server. - class Connection { - public: - Connection() : proto_(PROTO_UDP), socket_(NULL) {} - Connection(const talk_base::SocketAddress& src, - ProtocolType proto, - talk_base::AsyncPacketSocket* socket); - const talk_base::SocketAddress& src() const { return src_; } - talk_base::AsyncPacketSocket* socket() { return socket_; } - bool operator==(const Connection& t) const; - bool operator<(const Connection& t) const; - std::string ToString() const; - - private: - talk_base::SocketAddress src_; - talk_base::SocketAddress dst_; - cricket::ProtocolType proto_; - talk_base::AsyncPacketSocket* socket_; - }; - class Allocation; - class Permission; - class Channel; - typedef std::map AllocationMap; - - void OnInternalPacket(talk_base::AsyncPacketSocket* socket, const char* data, - size_t size, const talk_base::SocketAddress& address, - const talk_base::PacketTime& packet_time); - - void OnNewInternalConnection(talk_base::AsyncSocket* socket); - - // Accept connections on this server socket. - void AcceptConnection(talk_base::AsyncSocket* server_socket); - void OnInternalSocketClose(talk_base::AsyncPacketSocket* socket, int err); - - void HandleStunMessage(Connection* conn, const char* data, size_t size); - void HandleBindingRequest(Connection* conn, const StunMessage* msg); - void HandleAllocateRequest(Connection* conn, const TurnMessage* msg, - const std::string& key); - - bool GetKey(const StunMessage* msg, std::string* key); - bool CheckAuthorization(Connection* conn, const StunMessage* msg, - const char* data, size_t size, - const std::string& key); - std::string GenerateNonce() const; - bool ValidateNonce(const std::string& nonce) const; - - Allocation* FindAllocation(Connection* conn); - Allocation* CreateAllocation(Connection* conn, int proto, - const std::string& key); - - void SendErrorResponse(Connection* conn, const StunMessage* req, - int code, const std::string& reason); - - void SendErrorResponseWithRealmAndNonce(Connection* conn, - const StunMessage* req, - int code, - const std::string& reason); - void SendStun(Connection* conn, StunMessage* msg); - void Send(Connection* conn, const talk_base::ByteBuffer& buf); - - void OnAllocationDestroyed(Allocation* allocation); - void DestroyInternalSocket(talk_base::AsyncPacketSocket* socket); - - typedef std::map InternalSocketMap; - typedef std::map ServerSocketMap; - - talk_base::Thread* thread_; - std::string nonce_key_; - std::string realm_; - std::string software_; - TurnAuthInterface* auth_hook_; - // otu - one-time-use. Server will respond with 438 if it's - // sees the same nonce in next transaction. - bool enable_otu_nonce_; - InternalSocketMap server_sockets_; - ServerSocketMap server_listen_sockets_; - talk_base::scoped_ptr - external_socket_factory_; - talk_base::SocketAddress external_addr_; - AllocationMap allocations_; -}; - -} // namespace cricket - -#endif // TALK_P2P_BASE_TURNSERVER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/udpport.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/base/udpport.h deleted file mode 100755 index a291a78..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/base/udpport.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_BASE_UDPPORT_H_ -#define TALK_P2P_BASE_UDPPORT_H_ - -// StunPort will be handling UDPPort functionality. -#include "talk/p2p/base/stunport.h" - -#endif // TALK_P2P_BASE_UDPPORT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/client/autoportallocator.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/client/autoportallocator.h deleted file mode 100755 index 4345d1d..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/client/autoportallocator.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * libjingle - * Copyright 2010, 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_EXAMPLES_LOGIN_AUTOPORTALLOCATOR_H_ -#define TALK_EXAMPLES_LOGIN_AUTOPORTALLOCATOR_H_ - -#include -#include - -#include "talk/base/sigslot.h" -#include "talk/p2p/client/httpportallocator.h" -#include "talk/xmpp/jingleinfotask.h" -#include "talk/xmpp/xmppclient.h" - -// This class sets the relay and stun servers using XmppClient. -// It enables the client to traverse Proxy and NAT. -class AutoPortAllocator : public cricket::HttpPortAllocator { - public: - AutoPortAllocator(talk_base::NetworkManager* network_manager, - const std::string& user_agent) - : cricket::HttpPortAllocator(network_manager, user_agent) { - } - - // Creates and initiates a task to get relay token from XmppClient and set - // it appropriately. - void SetXmppClient(buzz::XmppClient* client) { - // The JingleInfoTask is freed by the task-runner. - buzz::JingleInfoTask* jit = new buzz::JingleInfoTask(client); - jit->SignalJingleInfo.connect(this, &AutoPortAllocator::OnJingleInfo); - jit->Start(); - jit->RefreshJingleInfoNow(); - } - - private: - void OnJingleInfo( - const std::string& token, - const std::vector& relay_hosts, - const std::vector& stun_hosts) { - SetRelayToken(token); - SetStunHosts(stun_hosts); - SetRelayHosts(relay_hosts); - } -}; - -#endif // TALK_EXAMPLES_LOGIN_AUTOPORTALLOCATOR_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/client/basicportallocator.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/client/basicportallocator.h deleted file mode 100755 index 1116936..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/client/basicportallocator.h +++ /dev/null @@ -1,246 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_CLIENT_BASICPORTALLOCATOR_H_ -#define TALK_P2P_CLIENT_BASICPORTALLOCATOR_H_ - -#include -#include - -#include "talk/base/messagequeue.h" -#include "talk/base/network.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/thread.h" -#include "talk/p2p/base/port.h" -#include "talk/p2p/base/portallocator.h" - -namespace cricket { - -struct RelayCredentials { - RelayCredentials() {} - RelayCredentials(const std::string& username, - const std::string& password) - : username(username), - password(password) { - } - - std::string username; - std::string password; -}; - -typedef std::vector PortList; -struct RelayServerConfig { - RelayServerConfig(RelayType type) : type(type) {} - - RelayType type; - PortList ports; - RelayCredentials credentials; -}; - -class BasicPortAllocator : public PortAllocator { - public: - BasicPortAllocator(talk_base::NetworkManager* network_manager, - talk_base::PacketSocketFactory* socket_factory); - explicit BasicPortAllocator(talk_base::NetworkManager* network_manager); - BasicPortAllocator(talk_base::NetworkManager* network_manager, - talk_base::PacketSocketFactory* socket_factory, - const talk_base::SocketAddress& stun_server); - BasicPortAllocator(talk_base::NetworkManager* network_manager, - const talk_base::SocketAddress& stun_server, - const talk_base::SocketAddress& relay_server_udp, - const talk_base::SocketAddress& relay_server_tcp, - const talk_base::SocketAddress& relay_server_ssl); - virtual ~BasicPortAllocator(); - - talk_base::NetworkManager* network_manager() { return network_manager_; } - - // If socket_factory() is set to NULL each PortAllocatorSession - // creates its own socket factory. - talk_base::PacketSocketFactory* socket_factory() { return socket_factory_; } - - const talk_base::SocketAddress& stun_address() const { - return stun_address_; - } - - const std::vector& relays() const { - return relays_; - } - virtual void AddRelay(const RelayServerConfig& relay) { - relays_.push_back(relay); - } - - virtual PortAllocatorSession* CreateSessionInternal( - const std::string& content_name, - int component, - const std::string& ice_ufrag, - const std::string& ice_pwd); - - private: - void Construct(); - - talk_base::NetworkManager* network_manager_; - talk_base::PacketSocketFactory* socket_factory_; - const talk_base::SocketAddress stun_address_; - std::vector relays_; - bool allow_tcp_listen_; -}; - -struct PortConfiguration; -class AllocationSequence; - -class BasicPortAllocatorSession : public PortAllocatorSession, - public talk_base::MessageHandler { - public: - BasicPortAllocatorSession(BasicPortAllocator* allocator, - const std::string& content_name, - int component, - const std::string& ice_ufrag, - const std::string& ice_pwd); - ~BasicPortAllocatorSession(); - - virtual BasicPortAllocator* allocator() { return allocator_; } - talk_base::Thread* network_thread() { return network_thread_; } - talk_base::PacketSocketFactory* socket_factory() { return socket_factory_; } - - virtual void StartGettingPorts(); - virtual void StopGettingPorts(); - virtual bool IsGettingPorts() { return running_; } - - protected: - // Starts the process of getting the port configurations. - virtual void GetPortConfigurations(); - - // Adds a port configuration that is now ready. Once we have one for each - // network (or a timeout occurs), we will start allocating ports. - virtual void ConfigReady(PortConfiguration* config); - - // MessageHandler. Can be overriden if message IDs do not conflict. - virtual void OnMessage(talk_base::Message *message); - - private: - class PortData { - public: - PortData() : port_(NULL), sequence_(NULL), state_(STATE_INIT) {} - PortData(Port* port, AllocationSequence* seq) - : port_(port), sequence_(seq), state_(STATE_INIT) { - } - - Port* port() { return port_; } - AllocationSequence* sequence() { return sequence_; } - bool ready() const { return state_ == STATE_READY; } - bool complete() const { - // Returns true if candidate allocation has completed one way or another. - return ((state_ == STATE_COMPLETE) || (state_ == STATE_ERROR)); - } - - void set_ready() { ASSERT(state_ == STATE_INIT); state_ = STATE_READY; } - void set_complete() { - ASSERT(state_ == STATE_READY); - state_ = STATE_COMPLETE; - } - void set_error() { - ASSERT(state_ == STATE_INIT || state_ == STATE_READY); - state_ = STATE_ERROR; - } - - private: - enum State { - STATE_INIT, // No candidates allocated yet. - STATE_READY, // At least one candidate is ready for process. - STATE_COMPLETE, // All candidates allocated and ready for process. - STATE_ERROR // Error in gathering candidates. - }; - Port* port_; - AllocationSequence* sequence_; - State state_; - }; - - void OnConfigReady(PortConfiguration* config); - void OnConfigStop(); - void AllocatePorts(); - void OnAllocate(); - void DoAllocate(); - void OnNetworksChanged(); - void OnAllocationSequenceObjectsCreated(); - void DisableEquivalentPhases(talk_base::Network* network, - PortConfiguration* config, uint32* flags); - void AddAllocatedPort(Port* port, AllocationSequence* seq, - bool prepare_address); - void OnCandidateReady(Port* port, const Candidate& c); - void OnPortComplete(Port* port); - void OnPortError(Port* port); - void OnProtocolEnabled(AllocationSequence* seq, ProtocolType proto); - void OnPortDestroyed(PortInterface* port); - void OnShake(); - void MaybeSignalCandidatesAllocationDone(); - void OnPortAllocationComplete(AllocationSequence* seq); - PortData* FindPort(Port* port); - - BasicPortAllocator* allocator_; - talk_base::Thread* network_thread_; - talk_base::scoped_ptr owned_socket_factory_; - talk_base::PacketSocketFactory* socket_factory_; - bool allocation_started_; - bool network_manager_started_; - bool running_; // set when StartGetAllPorts is called - bool allocation_sequences_created_; - std::vector configs_; - std::vector sequences_; - std::vector ports_; - - friend class AllocationSequence; -}; - -// Records configuration information useful in creating ports. -struct PortConfiguration : public talk_base::MessageData { - talk_base::SocketAddress stun_address; - std::string username; - std::string password; - - typedef std::vector RelayList; - RelayList relays; - - PortConfiguration(const talk_base::SocketAddress& stun_address, - const std::string& username, - const std::string& password); - - // Adds another relay server, with the given ports and modifier, to the list. - void AddRelay(const RelayServerConfig& config); - - // Determines whether the given relay server supports the given protocol. - bool SupportsProtocol(const RelayServerConfig& relay, - ProtocolType type) const; - bool SupportsProtocol(RelayType turn_type, ProtocolType type) const; - // Helper method returns the first server address for the matching - // RelayType and Protocol type. - talk_base::SocketAddress GetFirstRelayServerAddress( - RelayType turn_type, ProtocolType type) const; -}; - -} // namespace cricket - -#endif // TALK_P2P_CLIENT_BASICPORTALLOCATOR_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/client/connectivitychecker.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/client/connectivitychecker.h deleted file mode 100755 index c4e8d0d..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/client/connectivitychecker.h +++ /dev/null @@ -1,274 +0,0 @@ -// Copyright 2011 Google Inc. All Rights Reserved. - - -#ifndef TALK_P2P_CLIENT_CONNECTIVITYCHECKER_H_ -#define TALK_P2P_CLIENT_CONNECTIVITYCHECKER_H_ - -#include -#include - -#include "talk/base/network.h" -#include "talk/base/basictypes.h" -#include "talk/base/messagehandler.h" -#include "talk/base/proxyinfo.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/sigslot.h" -#include "talk/base/socketaddress.h" -#include "talk/p2p/base/basicpacketsocketfactory.h" -#include "talk/p2p/client/httpportallocator.h" - -namespace talk_base { -class AsyncHttpRequest; -class AutoDetectProxy; -class BasicPacketSocketFactory; -class NetworkManager; -class PacketSocketFactory; -class SignalThread; -class TestHttpPortAllocatorSession; -class Thread; -} - -namespace cricket { -class HttpPortAllocator; -class Port; -class PortAllocatorSession; -struct PortConfiguration; -class RelayPort; -class StunPort; - -// Contains details about a discovered firewall that are of interest -// when debugging call failures. -struct FirewallInfo { - std::string brand; - std::string model; - - // TODO: List of current port mappings. -}; - -// Contains details about a specific connect attempt. -struct ConnectInfo { - ConnectInfo() - : rtt(-1), error(0) {} - // Time when the connection was initiated. Needed for calculating - // the round trip time. - uint32 start_time_ms; - // Round trip time in milliseconds or -1 for failed connection. - int32 rtt; - // Error code representing low level errors like socket errors. - int error; -}; - -// Identifier for a network interface and proxy address pair. -struct NicId { - NicId(const talk_base::IPAddress& ip, - const talk_base::SocketAddress& proxy_address) - : ip(ip), - proxy_address(proxy_address) { - } - talk_base::IPAddress ip; - talk_base::SocketAddress proxy_address; -}; - -// Comparator implementation identifying unique network interface and -// proxy address pairs. -class NicIdComparator { - public: - int compare(const NicId &first, const NicId &second) const { - if (first.ip == second.ip) { - // Compare proxy address. - if (first.proxy_address == second.proxy_address) { - return 0; - } else { - return first.proxy_address < second.proxy_address? -1 : 1; - } - } - return first.ip < second.ip ? -1 : 1; - } - - bool operator()(const NicId &first, const NicId &second) const { - return (compare(first, second) < 0); - } -}; - -// Contains information of a network interface and proxy address pair. -struct NicInfo { - NicInfo() {} - talk_base::IPAddress ip; - talk_base::ProxyInfo proxy_info; - talk_base::SocketAddress external_address; - talk_base::SocketAddress stun_server_address; - talk_base::SocketAddress media_server_address; - ConnectInfo stun; - ConnectInfo http; - ConnectInfo https; - ConnectInfo udp; - ConnectInfo tcp; - ConnectInfo ssltcp; - FirewallInfo firewall; -}; - -// Holds the result of the connectivity check. -class NicMap : public std::map { -}; - -class TestHttpPortAllocatorSession : public HttpPortAllocatorSession { - public: - TestHttpPortAllocatorSession( - HttpPortAllocator* allocator, - const std::string& content_name, - int component, - const std::string& ice_ufrag, - const std::string& ice_pwd, - const std::vector& stun_hosts, - const std::vector& relay_hosts, - const std::string& relay_token, - const std::string& user_agent) - : HttpPortAllocatorSession( - allocator, content_name, component, ice_ufrag, ice_pwd, stun_hosts, - relay_hosts, relay_token, user_agent) { - } - void set_proxy(const talk_base::ProxyInfo& proxy) { - proxy_ = proxy; - } - - void ConfigReady(PortConfiguration* config); - - void OnRequestDone(talk_base::SignalThread* data); - - sigslot::signal4 SignalConfigReady; - sigslot::signal1 SignalRequestDone; - - private: - talk_base::ProxyInfo proxy_; -}; - -// Runs a request/response check on all network interface and proxy -// address combinations. The check is considered done either when all -// checks has been successful or when the check times out. -class ConnectivityChecker - : public talk_base::MessageHandler, public sigslot::has_slots<> { - public: - ConnectivityChecker(talk_base::Thread* worker, - const std::string& jid, - const std::string& session_id, - const std::string& user_agent, - const std::string& relay_token, - const std::string& connection); - virtual ~ConnectivityChecker(); - - // Virtual for gMock. - virtual bool Initialize(); - virtual void Start(); - - // MessageHandler implementation. - virtual void OnMessage(talk_base::Message *msg); - - // Instruct checker to stop and wait until that's done. - // Virtual for gMock. - virtual void Stop() { - worker_->Stop(); - } - - const NicMap& GetResults() const { - return nics_; - } - - void set_timeout_ms(uint32 timeout) { - timeout_ms_ = timeout; - } - - void set_stun_address(const talk_base::SocketAddress& stun_address) { - stun_address_ = stun_address; - } - - const std::string& connection() const { - return connection_; - } - - const std::string& jid() const { - return jid_; - } - - const std::string& session_id() const { - return session_id_; - } - - // Context: Main Thread. Signalled when the connectivity check is complete. - sigslot::signal1 SignalCheckDone; - - protected: - // Can be overridden for test. - virtual talk_base::NetworkManager* CreateNetworkManager() { - return new talk_base::BasicNetworkManager(); - } - virtual talk_base::BasicPacketSocketFactory* CreateSocketFactory( - talk_base::Thread* thread) { - return new talk_base::BasicPacketSocketFactory(thread); - } - virtual HttpPortAllocator* CreatePortAllocator( - talk_base::NetworkManager* network_manager, - const std::string& user_agent, - const std::string& relay_token); - virtual StunPort* CreateStunPort( - const std::string& username, const std::string& password, - const PortConfiguration* config, talk_base::Network* network); - virtual RelayPort* CreateRelayPort( - const std::string& username, const std::string& password, - const PortConfiguration* config, talk_base::Network* network); - virtual void InitiateProxyDetection(); - virtual void SetProxyInfo(const talk_base::ProxyInfo& info); - virtual talk_base::ProxyInfo GetProxyInfo() const; - - talk_base::Thread* worker() { - return worker_; - } - - private: - bool AddNic(const talk_base::IPAddress& ip, - const talk_base::SocketAddress& proxy_address); - void AllocatePorts(); - void AllocateRelayPorts(); - void CheckNetworks(); - void CreateRelayPorts( - const std::string& username, const std::string& password, - const PortConfiguration* config, const talk_base::ProxyInfo& proxy_info); - - // Must be called by the worker thread. - void CleanUp(); - - void OnRequestDone(talk_base::AsyncHttpRequest* request); - void OnRelayPortComplete(Port* port); - void OnStunPortComplete(Port* port); - void OnRelayPortError(Port* port); - void OnStunPortError(Port* port); - void OnNetworksChanged(); - void OnProxyDetect(talk_base::SignalThread* thread); - void OnConfigReady( - const std::string& username, const std::string& password, - const PortConfiguration* config, const talk_base::ProxyInfo& proxy); - void OnConfigWithProxyReady(const PortConfiguration*); - void RegisterHttpStart(int port); - talk_base::Thread* worker_; - std::string jid_; - std::string session_id_; - std::string user_agent_; - std::string relay_token_; - std::string connection_; - talk_base::AutoDetectProxy* proxy_detect_; - talk_base::scoped_ptr network_manager_; - talk_base::scoped_ptr socket_factory_; - talk_base::scoped_ptr port_allocator_; - NicMap nics_; - std::vector ports_; - std::vector sessions_; - uint32 timeout_ms_; - talk_base::SocketAddress stun_address_; - talk_base::Thread* main_; - bool started_; -}; - -} // namespace cricket - -#endif // TALK_P2P_CLIENT_CONNECTIVITYCHECKER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/client/fakeportallocator.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/client/fakeportallocator.h deleted file mode 100755 index 7a28edb..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/client/fakeportallocator.h +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2010 Google Inc. All Rights Reserved, -// -// Author: Justin Uberti (juberti@google.com) - -#ifndef TALK_P2P_CLIENT_FAKEPORTALLOCATOR_H_ -#define TALK_P2P_CLIENT_FAKEPORTALLOCATOR_H_ - -#include -#include "talk/base/scoped_ptr.h" -#include "talk/p2p/base/basicpacketsocketfactory.h" -#include "talk/p2p/base/portallocator.h" -#include "talk/p2p/base/udpport.h" - -namespace talk_base { -class SocketFactory; -class Thread; -} - -namespace cricket { - -class FakePortAllocatorSession : public PortAllocatorSession { - public: - FakePortAllocatorSession(talk_base::Thread* worker_thread, - talk_base::PacketSocketFactory* factory, - const std::string& content_name, - int component, - const std::string& ice_ufrag, - const std::string& ice_pwd) - : PortAllocatorSession(content_name, component, ice_ufrag, ice_pwd, - cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG), - worker_thread_(worker_thread), - factory_(factory), - network_("network", "unittest", - talk_base::IPAddress(INADDR_LOOPBACK), 8), - port_(), running_(false), - port_config_count_(0) { - network_.AddIP(talk_base::IPAddress(INADDR_LOOPBACK)); - } - - virtual void StartGettingPorts() { - if (!port_) { - port_.reset(cricket::UDPPort::Create(worker_thread_, factory_, - &network_, network_.ip(), 0, 0, - username(), - password())); - AddPort(port_.get()); - } - ++port_config_count_; - running_ = true; - } - - virtual void StopGettingPorts() { running_ = false; } - virtual bool IsGettingPorts() { return running_; } - int port_config_count() { return port_config_count_; } - - void AddPort(cricket::Port* port) { - port->set_component(component_); - port->set_generation(0); - port->SignalPortComplete.connect( - this, &FakePortAllocatorSession::OnPortComplete); - port->PrepareAddress(); - SignalPortReady(this, port); - } - void OnPortComplete(cricket::Port* port) { - SignalCandidatesReady(this, port->Candidates()); - SignalCandidatesAllocationDone(this); - } - - private: - talk_base::Thread* worker_thread_; - talk_base::PacketSocketFactory* factory_; - talk_base::Network network_; - talk_base::scoped_ptr port_; - bool running_; - int port_config_count_; -}; - -class FakePortAllocator : public cricket::PortAllocator { - public: - FakePortAllocator(talk_base::Thread* worker_thread, - talk_base::PacketSocketFactory* factory) - : worker_thread_(worker_thread), factory_(factory) { - if (factory_ == NULL) { - owned_factory_.reset(new talk_base::BasicPacketSocketFactory( - worker_thread_)); - factory_ = owned_factory_.get(); - } - } - - virtual cricket::PortAllocatorSession* CreateSessionInternal( - const std::string& content_name, - int component, - const std::string& ice_ufrag, - const std::string& ice_pwd) { - return new FakePortAllocatorSession( - worker_thread_, factory_, content_name, component, ice_ufrag, ice_pwd); - } - - private: - talk_base::Thread* worker_thread_; - talk_base::PacketSocketFactory* factory_; - talk_base::scoped_ptr owned_factory_; -}; - -} // namespace cricket - -#endif // TALK_P2P_CLIENT_FAKEPORTALLOCATOR_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/client/httpportallocator.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/client/httpportallocator.h deleted file mode 100755 index e1b428f..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/client/httpportallocator.h +++ /dev/null @@ -1,190 +0,0 @@ -/* - * libjingle - * Copyright 2004--2008, 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_P2P_CLIENT_HTTPPORTALLOCATOR_H_ -#define TALK_P2P_CLIENT_HTTPPORTALLOCATOR_H_ - -#include -#include -#include - -#include "talk/p2p/client/basicportallocator.h" - -class HttpPortAllocatorTest_TestSessionRequestUrl_Test; - -namespace talk_base { -class AsyncHttpRequest; -class SignalThread; -} - -namespace cricket { - -class HttpPortAllocatorBase : public BasicPortAllocator { - public: - // The number of HTTP requests we should attempt before giving up. - static const int kNumRetries; - - // Records the URL that we will GET in order to create a session. - static const char kCreateSessionURL[]; - - HttpPortAllocatorBase(talk_base::NetworkManager* network_manager, - const std::string& user_agent); - HttpPortAllocatorBase(talk_base::NetworkManager* network_manager, - talk_base::PacketSocketFactory* socket_factory, - const std::string& user_agent); - virtual ~HttpPortAllocatorBase(); - - // CreateSession is defined in BasicPortAllocator but is - // redefined here as pure virtual. - virtual PortAllocatorSession* CreateSessionInternal( - const std::string& content_name, - int component, - const std::string& ice_ufrag, - const std::string& ice_pwd) = 0; - - void SetStunHosts(const std::vector& hosts) { - if (!hosts.empty()) { - stun_hosts_ = hosts; - } - } - void SetRelayHosts(const std::vector& hosts) { - if (!hosts.empty()) { - relay_hosts_ = hosts; - } - } - void SetRelayToken(const std::string& relay) { relay_token_ = relay; } - - const std::vector& stun_hosts() const { - return stun_hosts_; - } - - const std::vector& relay_hosts() const { - return relay_hosts_; - } - - const std::string& relay_token() const { - return relay_token_; - } - - const std::string& user_agent() const { - return agent_; - } - - private: - std::vector stun_hosts_; - std::vector relay_hosts_; - std::string relay_token_; - std::string agent_; -}; - -class RequestData; - -class HttpPortAllocatorSessionBase : public BasicPortAllocatorSession { - public: - HttpPortAllocatorSessionBase( - HttpPortAllocatorBase* allocator, - const std::string& content_name, - int component, - const std::string& ice_ufrag, - const std::string& ice_pwd, - const std::vector& stun_hosts, - const std::vector& relay_hosts, - const std::string& relay, - const std::string& agent); - virtual ~HttpPortAllocatorSessionBase(); - - const std::string& relay_token() const { - return relay_token_; - } - - const std::string& user_agent() const { - return agent_; - } - - virtual void SendSessionRequest(const std::string& host, int port) = 0; - virtual void ReceiveSessionResponse(const std::string& response); - - // Made public for testing. Should be protected. - std::string GetSessionRequestUrl(); - - protected: - virtual void GetPortConfigurations(); - void TryCreateRelaySession(); - virtual HttpPortAllocatorBase* allocator() { - return static_cast( - BasicPortAllocatorSession::allocator()); - } - - private: - std::vector relay_hosts_; - std::vector stun_hosts_; - std::string relay_token_; - std::string agent_; - int attempts_; -}; - -class HttpPortAllocator : public HttpPortAllocatorBase { - public: - HttpPortAllocator(talk_base::NetworkManager* network_manager, - const std::string& user_agent); - HttpPortAllocator(talk_base::NetworkManager* network_manager, - talk_base::PacketSocketFactory* socket_factory, - const std::string& user_agent); - virtual ~HttpPortAllocator(); - virtual PortAllocatorSession* CreateSessionInternal( - const std::string& content_name, - int component, - const std::string& ice_ufrag, const std::string& ice_pwd); -}; - -class HttpPortAllocatorSession : public HttpPortAllocatorSessionBase { - public: - HttpPortAllocatorSession( - HttpPortAllocator* allocator, - const std::string& content_name, - int component, - const std::string& ice_ufrag, - const std::string& ice_pwd, - const std::vector& stun_hosts, - const std::vector& relay_hosts, - const std::string& relay, - const std::string& agent); - virtual ~HttpPortAllocatorSession(); - - virtual void SendSessionRequest(const std::string& host, int port); - - protected: - // Protected for diagnostics. - virtual void OnRequestDone(talk_base::SignalThread* request); - - private: - std::list requests_; -}; - -} // namespace cricket - -#endif // TALK_P2P_CLIENT_HTTPPORTALLOCATOR_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/client/sessionmanagertask.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/client/sessionmanagertask.h deleted file mode 100755 index 548c695..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/client/sessionmanagertask.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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 _SESSIONMANAGERTASK_H_ -#define _SESSIONMANAGERTASK_H_ - -#include "talk/p2p/base/sessionmanager.h" -#include "talk/p2p/client/sessionsendtask.h" -#include "talk/xmpp/xmppengine.h" -#include "talk/xmpp/xmpptask.h" - -namespace cricket { - -// This class handles sending and receiving XMPP messages on behalf of the -// SessionManager. The sending part is handed over to SessionSendTask. - -class SessionManagerTask : public buzz::XmppTask { - public: - SessionManagerTask(buzz::XmppTaskParentInterface* parent, - SessionManager* session_manager) - : buzz::XmppTask(parent, buzz::XmppEngine::HL_SINGLE), - session_manager_(session_manager) { - } - - ~SessionManagerTask() { - } - - // Turns on simple support for sending messages, using SessionSendTask. - void EnableOutgoingMessages() { - session_manager_->SignalOutgoingMessage.connect( - this, &SessionManagerTask::OnOutgoingMessage); - session_manager_->SignalRequestSignaling.connect( - session_manager_, &SessionManager::OnSignalingReady); - } - - virtual int ProcessStart() { - const buzz::XmlElement *stanza = NextStanza(); - if (stanza == NULL) - return STATE_BLOCKED; - session_manager_->OnIncomingMessage(stanza); - return STATE_START; - } - - protected: - virtual bool HandleStanza(const buzz::XmlElement *stanza) { - if (!session_manager_->IsSessionMessage(stanza)) - return false; - // Responses are handled by the SessionSendTask that sent the request. - //if (stanza->Attr(buzz::QN_TYPE) != buzz::STR_SET) - // return false; - QueueStanza(stanza); - return true; - } - - private: - void OnOutgoingMessage(SessionManager* manager, - const buzz::XmlElement* stanza) { - cricket::SessionSendTask* sender = - new cricket::SessionSendTask(parent_, session_manager_); - sender->Send(stanza); - sender->Start(); - } - - SessionManager* session_manager_; -}; - -} // namespace cricket - -#endif // _SESSIONMANAGERTASK_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/client/sessionsendtask.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/client/sessionsendtask.h deleted file mode 100755 index acd1cc0..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/client/sessionsendtask.h +++ /dev/null @@ -1,145 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_CLIENT_SESSIONSENDTASK_H_ -#define TALK_P2P_CLIENT_SESSIONSENDTASK_H_ - -#include "talk/base/common.h" -#include "talk/xmpp/constants.h" -#include "talk/xmpp/xmppclient.h" -#include "talk/xmpp/xmppengine.h" -#include "talk/xmpp/xmpptask.h" -#include "talk/p2p/base/sessionmanager.h" - -namespace cricket { - -// The job of this task is to send an IQ stanza out (after stamping it with -// an ID attribute) and then wait for a response. If not response happens -// within 5 seconds, it will signal failure on a SessionManager. If an error -// happens it will also signal failure. If, however, the send succeeds this -// task will quietly go away. - -class SessionSendTask : public buzz::XmppTask { - public: - SessionSendTask(buzz::XmppTaskParentInterface* parent, - SessionManager* session_manager) - : buzz::XmppTask(parent, buzz::XmppEngine::HL_SINGLE), - session_manager_(session_manager) { - set_timeout_seconds(15); - session_manager_->SignalDestroyed.connect( - this, &SessionSendTask::OnSessionManagerDestroyed); - } - - virtual ~SessionSendTask() { - SignalDone(this); - } - - void Send(const buzz::XmlElement* stanza) { - ASSERT(stanza_.get() == NULL); - - // This should be an IQ of type set, result, or error. In the first case, - // we supply an ID. In the others, it should be present. - ASSERT(stanza->Name() == buzz::QN_IQ); - ASSERT(stanza->HasAttr(buzz::QN_TYPE)); - if (stanza->Attr(buzz::QN_TYPE) == "set") { - ASSERT(!stanza->HasAttr(buzz::QN_ID)); - } else { - ASSERT((stanza->Attr(buzz::QN_TYPE) == "result") || - (stanza->Attr(buzz::QN_TYPE) == "error")); - ASSERT(stanza->HasAttr(buzz::QN_ID)); - } - - stanza_.reset(new buzz::XmlElement(*stanza)); - if (stanza_->HasAttr(buzz::QN_ID)) { - set_task_id(stanza_->Attr(buzz::QN_ID)); - } else { - stanza_->SetAttr(buzz::QN_ID, task_id()); - } - } - - void OnSessionManagerDestroyed() { - // If the session manager doesn't exist anymore, we should still try to - // send the message, but avoid calling back into the SessionManager. - session_manager_ = NULL; - } - - sigslot::signal1 SignalDone; - - protected: - virtual int OnTimeout() { - if (session_manager_ != NULL) { - session_manager_->OnFailedSend(stanza_.get(), NULL); - } - - return XmppTask::OnTimeout(); - } - - virtual int ProcessStart() { - SendStanza(stanza_.get()); - if (stanza_->Attr(buzz::QN_TYPE) == buzz::STR_SET) { - return STATE_RESPONSE; - } else { - return STATE_DONE; - } - } - - virtual int ProcessResponse() { - const buzz::XmlElement* next = NextStanza(); - if (next == NULL) - return STATE_BLOCKED; - - if (session_manager_ != NULL) { - if (next->Attr(buzz::QN_TYPE) == buzz::STR_RESULT) { - session_manager_->OnIncomingResponse(stanza_.get(), next); - } else { - session_manager_->OnFailedSend(stanza_.get(), next); - } - } - - return STATE_DONE; - } - - virtual bool HandleStanza(const buzz::XmlElement *stanza) { - if (!MatchResponseIq(stanza, - buzz::Jid(stanza_->Attr(buzz::QN_TO)), task_id())) - return false; - if (stanza->Attr(buzz::QN_TYPE) == buzz::STR_RESULT || - stanza->Attr(buzz::QN_TYPE) == buzz::STR_ERROR) { - QueueStanza(stanza); - return true; - } - return false; - } - - private: - SessionManager *session_manager_; - talk_base::scoped_ptr stanza_; -}; - -} - -#endif // TALK_P2P_CLIENT_SESSIONSENDTASK_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/p2p/client/socketmonitor.h b/thirdparties/common/include/webrtc-sdk/talk/p2p/client/socketmonitor.h deleted file mode 100755 index b366b9d..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/p2p/client/socketmonitor.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_P2P_CLIENT_SOCKETMONITOR_H_ -#define TALK_P2P_CLIENT_SOCKETMONITOR_H_ - -#include - -#include "talk/base/criticalsection.h" -#include "talk/base/sigslot.h" -#include "talk/base/thread.h" -#include "talk/p2p/base/transportchannel.h" - -namespace cricket { - -class SocketMonitor : public talk_base::MessageHandler, - public sigslot::has_slots<> { - public: - SocketMonitor(TransportChannel* channel, - talk_base::Thread* worker_thread, - talk_base::Thread* monitor_thread); - ~SocketMonitor(); - - void Start(int cms); - void Stop(); - - talk_base::Thread* monitor_thread() { return monitoring_thread_; } - - sigslot::signal2&> SignalUpdate; - - protected: - void OnMessage(talk_base::Message* message); - void PollSocket(bool poll); - - std::vector connection_infos_; - TransportChannel* channel_; - talk_base::Thread* channel_thread_; - talk_base::Thread* monitoring_thread_; - talk_base::CriticalSection crit_; - uint32 rate_; - bool monitoring_; -}; - -} // namespace cricket - -#endif // TALK_P2P_CLIENT_SOCKETMONITOR_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/session/media/audiomonitor.h b/thirdparties/common/include/webrtc-sdk/talk/session/media/audiomonitor.h deleted file mode 100755 index 5ab6b96..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/session/media/audiomonitor.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_SESSION_MEDIA_AUDIOMONITOR_H_ -#define TALK_SESSION_MEDIA_AUDIOMONITOR_H_ - -#include "talk/base/sigslot.h" -#include "talk/base/thread.h" -#include "talk/p2p/base/port.h" -#include - -namespace cricket { - -class VoiceChannel; - -struct AudioInfo { - int input_level; - int output_level; - typedef std::vector > StreamList; - StreamList active_streams; // ssrcs contributing to output_level -}; - -class AudioMonitor : public talk_base::MessageHandler, - public sigslot::has_slots<> { - public: - AudioMonitor(VoiceChannel* voice_channel, talk_base::Thread *monitor_thread); - ~AudioMonitor(); - - void Start(int cms); - void Stop(); - - VoiceChannel* voice_channel(); - talk_base::Thread *monitor_thread(); - - sigslot::signal2 SignalUpdate; - - protected: - void OnMessage(talk_base::Message *message); - void PollVoiceChannel(); - - AudioInfo audio_info_; - VoiceChannel* voice_channel_; - talk_base::Thread* monitoring_thread_; - talk_base::CriticalSection crit_; - uint32 rate_; - bool monitoring_; -}; - -} - -#endif // TALK_SESSION_MEDIA_AUDIOMONITOR_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/session/media/bundlefilter.h b/thirdparties/common/include/webrtc-sdk/talk/session/media/bundlefilter.h deleted file mode 100755 index 6e3d8c4..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/session/media/bundlefilter.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_SESSION_MEDIA_BUNDLEFILTER_H_ -#define TALK_SESSION_MEDIA_BUNDLEFILTER_H_ - -#include -#include - -#include "talk/base/basictypes.h" -#include "talk/media/base/streamparams.h" - -namespace cricket { - -// In case of single RTP session and single transport channel, all session -// ( or media) channels share a common transport channel. Hence they all get -// SignalReadPacket when packet received on transport channel. This requires -// cricket::BaseChannel to know all the valid sources, else media channel -// will decode invalid packets. -// -// This class determines whether a packet is destined for cricket::BaseChannel. -// For rtp packets, this is decided based on the payload type. For rtcp packets, -// this is decided based on the sender ssrc values. -class BundleFilter { - public: - BundleFilter(); - ~BundleFilter(); - - // Determines packet belongs to valid cricket::BaseChannel. - bool DemuxPacket(const char* data, size_t len, bool rtcp); - - // Adds the supported payload type. - void AddPayloadType(int payload_type); - - // Adding a valid source to the filter. - bool AddStream(const StreamParams& stream); - - // Removes source from the filter. - bool RemoveStream(uint32 ssrc); - - // Utility methods added for unitest. - // True if |streams_| is not empty. - bool HasStreams() const; - bool FindStream(uint32 ssrc) const; - bool FindPayloadType(int pl_type) const; - void ClearAllPayloadTypes(); - - - private: - std::set payload_types_; - std::vector streams_; -}; - -} // namespace cricket - -#endif // TALK_SESSION_MEDIA_BUNDLEFILTER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/session/media/call.h b/thirdparties/common/include/webrtc-sdk/talk/session/media/call.h deleted file mode 100755 index ea9f0d2..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/session/media/call.h +++ /dev/null @@ -1,309 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_SESSION_MEDIA_CALL_H_ -#define TALK_SESSION_MEDIA_CALL_H_ - -#include -#include -#include -#include - -#include "talk/base/messagequeue.h" -#include "talk/media/base/mediachannel.h" -#include "talk/media/base/screencastid.h" -#include "talk/media/base/streamparams.h" -#include "talk/media/base/videocommon.h" -#include "talk/p2p/base/session.h" -#include "talk/p2p/client/socketmonitor.h" -#include "talk/session/media/audiomonitor.h" -#include "talk/session/media/currentspeakermonitor.h" -#include "talk/session/media/mediamessages.h" -#include "talk/session/media/mediasession.h" -#include "talk/xmpp/jid.h" - -namespace cricket { - -struct AudioInfo; -class MediaSessionClient; -class BaseChannel; -class VoiceChannel; -class VideoChannel; -class DataChannel; - -// Can't typedef this easily since it's forward declared as struct elsewhere. -struct CallOptions : public MediaSessionOptions { -}; - -// CurrentSpeakerMonitor used to have a dependency on Call. To remove this -// dependency, we create AudioSourceContext. CurrentSpeakerMonitor depends on -// AudioSourceContext. -// AudioSourceProxy acts as a proxy so that when SignalAudioMonitor -// in Call is triggered, SignalAudioMonitor in AudioSourceContext is triggered. -// Likewise, when OnMediaStreamsUpdate in Call is triggered, -// OnMediaStreamsUpdate in AudioSourceContext is triggered. -class AudioSourceProxy: public AudioSourceContext, public sigslot::has_slots<> { - public: - explicit AudioSourceProxy(Call* call); - - private: - void OnAudioMonitor(Call* call, const AudioInfo& info); - void OnMediaStreamsUpdate(Call* call, cricket::Session*, - const cricket::MediaStreams&, const cricket::MediaStreams&); - - AudioSourceContext* audio_source_context_; - Call* call_; -}; - -class Call : public talk_base::MessageHandler, public sigslot::has_slots<> { - public: - explicit Call(MediaSessionClient* session_client); - ~Call(); - - // |initiator| can be empty. - Session* InitiateSession(const buzz::Jid& to, const buzz::Jid& initiator, - const CallOptions& options); - Session* InitiateSession(const std::string& id, const buzz::Jid& to, - const CallOptions& options); - void AcceptSession(Session* session, const CallOptions& options); - void RejectSession(Session* session); - void TerminateSession(Session* session); - void Terminate(); - bool SendViewRequest(Session* session, - const ViewRequest& view_request); - void SetLocalRenderer(VideoRenderer* renderer); - void SetVideoRenderer(Session* session, uint32 ssrc, - VideoRenderer* renderer); - void StartConnectionMonitor(Session* session, int cms); - void StopConnectionMonitor(Session* session); - void StartAudioMonitor(Session* session, int cms); - void StopAudioMonitor(Session* session); - bool IsAudioMonitorRunning(Session* session); - void StartSpeakerMonitor(Session* session); - void StopSpeakerMonitor(Session* session); - void Mute(bool mute); - void MuteVideo(bool mute); - bool SendData(Session* session, - const SendDataParams& params, - const talk_base::Buffer& payload, - SendDataResult* result); - void PressDTMF(int event); - bool StartScreencast(Session* session, - const std::string& stream_name, uint32 ssrc, - const ScreencastId& screencastid, int fps); - bool StopScreencast(Session* session, - const std::string& stream_name, uint32 ssrc); - - std::vector sessions(); - uint32 id(); - bool has_video() const { return has_video_; } - bool has_data() const { return has_data_; } - bool muted() const { return muted_; } - bool video() const { return has_video_; } - bool secure() const; - bool video_muted() const { return video_muted_; } - const std::vector* GetDataRecvStreams(Session* session) const { - MediaStreams* recv_streams = GetMediaStreams(session); - return recv_streams ? &recv_streams->data() : NULL; - } - const std::vector* GetVideoRecvStreams(Session* session) const { - MediaStreams* recv_streams = GetMediaStreams(session); - return recv_streams ? &recv_streams->video() : NULL; - } - const std::vector* GetAudioRecvStreams(Session* session) const { - MediaStreams* recv_streams = GetMediaStreams(session); - return recv_streams ? &recv_streams->audio() : NULL; - } - VoiceChannel* GetVoiceChannel(Session* session) const; - VideoChannel* GetVideoChannel(Session* session) const; - DataChannel* GetDataChannel(Session* session) const; - // Public just for unit tests - VideoContentDescription* CreateVideoStreamUpdate(const StreamParams& stream); - // Takes ownership of video. - void SendVideoStreamUpdate(Session* session, VideoContentDescription* video); - - // Setting this to false will cause the call to have a longer timeout and - // for the SignalSetupToCallVoicemail to never fire. - void set_send_to_voicemail(bool send_to_voicemail) { - send_to_voicemail_ = send_to_voicemail; - } - bool send_to_voicemail() { return send_to_voicemail_; } - const VoiceMediaInfo& last_voice_media_info() const { - return last_voice_media_info_; - } - - // Sets a flag on the chatapp that will redirect the call to voicemail once - // the call has been terminated - sigslot::signal0<> SignalSetupToCallVoicemail; - sigslot::signal2 SignalAddSession; - sigslot::signal2 SignalRemoveSession; - sigslot::signal3 - SignalSessionState; - sigslot::signal3 - SignalSessionError; - sigslot::signal3 - SignalReceivedTerminateReason; - sigslot::signal2 &> - SignalConnectionMonitor; - sigslot::signal2 SignalMediaMonitor; - sigslot::signal2 SignalAudioMonitor; - // Empty nick on StreamParams means "unknown". - // No ssrcs in StreamParams means "no current speaker". - sigslot::signal3 SignalSpeakerMonitor; - sigslot::signal2 &> - SignalVideoConnectionMonitor; - sigslot::signal2 SignalVideoMediaMonitor; - // Gives added streams and removed streams, in that order. - sigslot::signal4 SignalMediaStreamsUpdate; - sigslot::signal3 SignalDataReceived; - - AudioSourceProxy* GetAudioSourceProxy(); - - private: - void OnMessage(talk_base::Message* message); - void OnSessionState(BaseSession* base_session, BaseSession::State state); - void OnSessionError(BaseSession* base_session, Session::Error error); - void OnSessionInfoMessage( - Session* session, const buzz::XmlElement* action_elem); - void OnViewRequest( - Session* session, const ViewRequest& view_request); - void OnRemoteDescriptionUpdate( - BaseSession* base_session, const ContentInfos& updated_contents); - void OnReceivedTerminateReason(Session* session, const std::string &reason); - void IncomingSession(Session* session, const SessionDescription* offer); - // Returns true on success. - bool AddSession(Session* session, const SessionDescription* offer); - void RemoveSession(Session* session); - void EnableChannels(bool enable); - void EnableSessionChannels(Session* session, bool enable); - void Join(Call* call, bool enable); - void OnConnectionMonitor(VoiceChannel* channel, - const std::vector &infos); - void OnMediaMonitor(VoiceChannel* channel, const VoiceMediaInfo& info); - void OnAudioMonitor(VoiceChannel* channel, const AudioInfo& info); - void OnSpeakerMonitor(CurrentSpeakerMonitor* monitor, uint32 ssrc); - void OnConnectionMonitor(VideoChannel* channel, - const std::vector &infos); - void OnMediaMonitor(VideoChannel* channel, const VideoMediaInfo& info); - void OnDataReceived(DataChannel* channel, - const ReceiveDataParams& params, - const talk_base::Buffer& payload); - MediaStreams* GetMediaStreams(Session* session) const; - void UpdateRemoteMediaStreams(Session* session, - const ContentInfos& updated_contents, - bool update_channels); - bool UpdateVoiceChannelRemoteContent(Session* session, - const AudioContentDescription* audio); - bool UpdateVideoChannelRemoteContent(Session* session, - const VideoContentDescription* video); - bool UpdateDataChannelRemoteContent(Session* session, - const DataContentDescription* data); - void UpdateRecvStreams(const std::vector& update_streams, - BaseChannel* channel, - std::vector* recv_streams, - std::vector* added_streams, - std::vector* removed_streams); - void AddRecvStreams(const std::vector& added_streams, - BaseChannel* channel, - std::vector* recv_streams); - void AddRecvStream(const StreamParams& stream, - BaseChannel* channel, - std::vector* recv_streams); - void RemoveRecvStreams(const std::vector& removed_streams, - BaseChannel* channel, - std::vector* recv_streams); - void RemoveRecvStream(const StreamParams& stream, - BaseChannel* channel, - std::vector* recv_streams); - void ContinuePlayDTMF(); - bool StopScreencastWithoutSendingUpdate(Session* session, uint32 ssrc); - bool StopAllScreencastsWithoutSendingUpdate(Session* session); - bool SessionDescriptionContainsCrypto(const SessionDescription* sdesc) const; - Session* InternalInitiateSession(const std::string& id, - const buzz::Jid& to, - const std::string& initiator_name, - const CallOptions& options); - - uint32 id_; - MediaSessionClient* session_client_; - - struct StartedCapture { - StartedCapture(cricket::VideoCapturer* capturer, - const cricket::VideoFormat& format) : - capturer(capturer), - format(format) { - } - cricket::VideoCapturer* capturer; - cricket::VideoFormat format; - }; - typedef std::map StartedScreencastMap; - - struct MediaSession { - Session* session; - VoiceChannel* voice_channel; - VideoChannel* video_channel; - DataChannel* data_channel; - MediaStreams* recv_streams; - StartedScreencastMap started_screencasts; - }; - - // Create a map of media sessions, keyed off session->id(). - typedef std::map MediaSessionMap; - MediaSessionMap media_session_map_; - - std::map speaker_monitor_map_; - VideoRenderer* local_renderer_; - bool has_video_; - bool has_data_; - bool muted_; - bool video_muted_; - bool send_to_voicemail_; - - // DTMF tones have to be queued up so that we don't flood the call. We - // keep a deque (doubely ended queue) of them around. While one is playing we - // set the playing_dtmf_ bit and schedule a message in XX msec to clear that - // bit or start the next tone playing. - std::deque queued_dtmf_; - bool playing_dtmf_; - - VoiceMediaInfo last_voice_media_info_; - - talk_base::scoped_ptr audio_source_proxy_; - - friend class MediaSessionClient; -}; - -} // namespace cricket - -#endif // TALK_SESSION_MEDIA_CALL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/session/media/channel.h b/thirdparties/common/include/webrtc-sdk/talk/session/media/channel.h deleted file mode 100755 index 35b3326..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/session/media/channel.h +++ /dev/null @@ -1,724 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_SESSION_MEDIA_CHANNEL_H_ -#define TALK_SESSION_MEDIA_CHANNEL_H_ - -#include -#include - -#include "talk/base/asyncudpsocket.h" -#include "talk/base/criticalsection.h" -#include "talk/base/network.h" -#include "talk/base/sigslot.h" -#include "talk/base/window.h" -#include "talk/media/base/mediachannel.h" -#include "talk/media/base/mediaengine.h" -#include "talk/media/base/screencastid.h" -#include "talk/media/base/streamparams.h" -#include "talk/media/base/videocapturer.h" -#include "talk/p2p/base/session.h" -#include "talk/p2p/client/socketmonitor.h" -#include "talk/session/media/audiomonitor.h" -#include "talk/session/media/bundlefilter.h" -#include "talk/session/media/mediamonitor.h" -#include "talk/session/media/mediasession.h" -#include "talk/session/media/rtcpmuxfilter.h" -#include "talk/session/media/srtpfilter.h" - -namespace cricket { - -struct CryptoParams; -class MediaContentDescription; -struct TypingMonitorOptions; -class TypingMonitor; -struct ViewRequest; - -enum SinkType { - SINK_PRE_CRYPTO, // Sink packets before encryption or after decryption. - SINK_POST_CRYPTO // Sink packets after encryption or before decryption. -}; - -// BaseChannel contains logic common to voice and video, including -// enable/mute, marshaling calls to a worker thread, and -// connection and media monitors. -// -// WARNING! SUBCLASSES MUST CALL Deinit() IN THEIR DESTRUCTORS! -// This is required to avoid a data race between the destructor modifying the -// vtable, and the media channel's thread using BaseChannel as the -// NetworkInterface. - -class BaseChannel - : public talk_base::MessageHandler, public sigslot::has_slots<>, - public MediaChannel::NetworkInterface { - public: - BaseChannel(talk_base::Thread* thread, MediaEngineInterface* media_engine, - MediaChannel* channel, BaseSession* session, - const std::string& content_name, bool rtcp); - virtual ~BaseChannel(); - bool Init(TransportChannel* transport_channel, - TransportChannel* rtcp_transport_channel); - // Deinit may be called multiple times and is simply ignored if it's alreay - // done. - void Deinit(); - - talk_base::Thread* worker_thread() const { return worker_thread_; } - BaseSession* session() const { return session_; } - const std::string& content_name() { return content_name_; } - TransportChannel* transport_channel() const { - return transport_channel_; - } - TransportChannel* rtcp_transport_channel() const { - return rtcp_transport_channel_; - } - bool enabled() const { return enabled_; } - - // This function returns true if we are using SRTP. - bool secure() const { return srtp_filter_.IsActive(); } - // The following function returns true if we are using - // DTLS-based keying. If you turned off SRTP later, however - // you could have secure() == false and dtls_secure() == true. - bool secure_dtls() const { return dtls_keyed_; } - // This function returns true if we require secure channel for call setup. - bool secure_required() const { return secure_required_; } - - bool writable() const { return writable_; } - bool IsStreamMuted(uint32 ssrc); - - // Channel control - bool SetLocalContent(const MediaContentDescription* content, - ContentAction action, - std::string* error_desc); - bool SetRemoteContent(const MediaContentDescription* content, - ContentAction action, - std::string* error_desc); - - bool Enable(bool enable); - // Mute sending media on the stream with SSRC |ssrc| - // If there is only one sending stream SSRC 0 can be used. - bool MuteStream(uint32 ssrc, bool mute); - - // Multiplexing - bool AddRecvStream(const StreamParams& sp); - bool RemoveRecvStream(uint32 ssrc); - bool AddSendStream(const StreamParams& sp); - bool RemoveSendStream(uint32 ssrc); - - // Monitoring - void StartConnectionMonitor(int cms); - void StopConnectionMonitor(); - - void set_srtp_signal_silent_time(uint32 silent_time) { - srtp_filter_.set_signal_silent_time(silent_time); - } - - void set_content_name(const std::string& content_name) { - ASSERT(signaling_thread()->IsCurrent()); - ASSERT(!writable_); - if (session_->state() != BaseSession::STATE_INIT) { - LOG(LS_ERROR) << "Content name for a channel can be changed only " - << "when BaseSession is in STATE_INIT state."; - return; - } - content_name_ = content_name; - } - - template - void RegisterSendSink(T* sink, - void (T::*OnPacket)(const void*, size_t, bool), - SinkType type) { - talk_base::CritScope cs(&signal_send_packet_cs_); - if (SINK_POST_CRYPTO == type) { - SignalSendPacketPostCrypto.disconnect(sink); - SignalSendPacketPostCrypto.connect(sink, OnPacket); - } else { - SignalSendPacketPreCrypto.disconnect(sink); - SignalSendPacketPreCrypto.connect(sink, OnPacket); - } - } - - void UnregisterSendSink(sigslot::has_slots<>* sink, - SinkType type) { - talk_base::CritScope cs(&signal_send_packet_cs_); - if (SINK_POST_CRYPTO == type) { - SignalSendPacketPostCrypto.disconnect(sink); - } else { - SignalSendPacketPreCrypto.disconnect(sink); - } - } - - bool HasSendSinks(SinkType type) { - talk_base::CritScope cs(&signal_send_packet_cs_); - if (SINK_POST_CRYPTO == type) { - return !SignalSendPacketPostCrypto.is_empty(); - } else { - return !SignalSendPacketPreCrypto.is_empty(); - } - } - - template - void RegisterRecvSink(T* sink, - void (T::*OnPacket)(const void*, size_t, bool), - SinkType type) { - talk_base::CritScope cs(&signal_recv_packet_cs_); - if (SINK_POST_CRYPTO == type) { - SignalRecvPacketPostCrypto.disconnect(sink); - SignalRecvPacketPostCrypto.connect(sink, OnPacket); - } else { - SignalRecvPacketPreCrypto.disconnect(sink); - SignalRecvPacketPreCrypto.connect(sink, OnPacket); - } - } - - void UnregisterRecvSink(sigslot::has_slots<>* sink, - SinkType type) { - talk_base::CritScope cs(&signal_recv_packet_cs_); - if (SINK_POST_CRYPTO == type) { - SignalRecvPacketPostCrypto.disconnect(sink); - } else { - SignalRecvPacketPreCrypto.disconnect(sink); - } - } - - bool HasRecvSinks(SinkType type) { - talk_base::CritScope cs(&signal_recv_packet_cs_); - if (SINK_POST_CRYPTO == type) { - return !SignalRecvPacketPostCrypto.is_empty(); - } else { - return !SignalRecvPacketPreCrypto.is_empty(); - } - } - - BundleFilter* bundle_filter() { return &bundle_filter_; } - - const std::vector& local_streams() const { - return local_streams_; - } - const std::vector& remote_streams() const { - return remote_streams_; - } - - // Used for latency measurements. - sigslot::signal1 SignalFirstPacketReceived; - - // Used to alert UI when the muted status changes, perhaps autonomously. - sigslot::repeater2 SignalAutoMuted; - - // Made public for easier testing. - void SetReadyToSend(TransportChannel* channel, bool ready); - - protected: - MediaEngineInterface* media_engine() const { return media_engine_; } - virtual MediaChannel* media_channel() const { return media_channel_; } - void set_rtcp_transport_channel(TransportChannel* transport); - bool was_ever_writable() const { return was_ever_writable_; } - void set_local_content_direction(MediaContentDirection direction) { - local_content_direction_ = direction; - } - void set_remote_content_direction(MediaContentDirection direction) { - remote_content_direction_ = direction; - } - bool IsReadyToReceive() const; - bool IsReadyToSend() const; - talk_base::Thread* signaling_thread() { return session_->signaling_thread(); } - SrtpFilter* srtp_filter() { return &srtp_filter_; } - bool rtcp() const { return rtcp_; } - - void FlushRtcpMessages(); - - // NetworkInterface implementation, called by MediaEngine - virtual bool SendPacket(talk_base::Buffer* packet, - talk_base::DiffServCodePoint dscp); - virtual bool SendRtcp(talk_base::Buffer* packet, - talk_base::DiffServCodePoint dscp); - virtual int SetOption(SocketType type, talk_base::Socket::Option o, int val); - - // From TransportChannel - void OnWritableState(TransportChannel* channel); - virtual void OnChannelRead(TransportChannel* channel, - const char* data, - size_t len, - const talk_base::PacketTime& packet_time, - int flags); - void OnReadyToSend(TransportChannel* channel); - - bool PacketIsRtcp(const TransportChannel* channel, const char* data, - size_t len); - bool SendPacket(bool rtcp, talk_base::Buffer* packet, - talk_base::DiffServCodePoint dscp); - virtual bool WantsPacket(bool rtcp, talk_base::Buffer* packet); - void HandlePacket(bool rtcp, talk_base::Buffer* packet, - const talk_base::PacketTime& packet_time); - - // Apply the new local/remote session description. - void OnNewLocalDescription(BaseSession* session, ContentAction action); - void OnNewRemoteDescription(BaseSession* session, ContentAction action); - - void EnableMedia_w(); - void DisableMedia_w(); - virtual bool MuteStream_w(uint32 ssrc, bool mute); - bool IsStreamMuted_w(uint32 ssrc); - void ChannelWritable_w(); - void ChannelNotWritable_w(); - bool AddRecvStream_w(const StreamParams& sp); - bool RemoveRecvStream_w(uint32 ssrc); - bool AddSendStream_w(const StreamParams& sp); - bool RemoveSendStream_w(uint32 ssrc); - virtual bool ShouldSetupDtlsSrtp() const; - // Do the DTLS key expansion and impose it on the SRTP/SRTCP filters. - // |rtcp_channel| indicates whether to set up the RTP or RTCP filter. - bool SetupDtlsSrtp(bool rtcp_channel); - // Set the DTLS-SRTP cipher policy on this channel as appropriate. - bool SetDtlsSrtpCiphers(TransportChannel *tc, bool rtcp); - - virtual void ChangeState() = 0; - - // Gets the content info appropriate to the channel (audio or video). - virtual const ContentInfo* GetFirstContent( - const SessionDescription* sdesc) = 0; - bool UpdateLocalStreams_w(const std::vector& streams, - ContentAction action, - std::string* error_desc); - bool UpdateRemoteStreams_w(const std::vector& streams, - ContentAction action, - std::string* error_desc); - bool SetBaseLocalContent_w(const MediaContentDescription* content, - ContentAction action, - std::string* error_desc); - virtual bool SetLocalContent_w(const MediaContentDescription* content, - ContentAction action, - std::string* error_desc) = 0; - bool SetBaseRemoteContent_w(const MediaContentDescription* content, - ContentAction action, - std::string* error_desc); - virtual bool SetRemoteContent_w(const MediaContentDescription* content, - ContentAction action, - std::string* error_desc) = 0; - - // Helper method to get RTP Absoulute SendTime extension header id if - // present in remote supported extensions list. - void MaybeCacheRtpAbsSendTimeHeaderExtension( - const std::vector& extensions); - - bool CheckSrtpConfig(const std::vector& cryptos, - bool* dtls, - std::string* error_desc); - bool SetSrtp_w(const std::vector& params, - ContentAction action, - ContentSource src, - std::string* error_desc); - bool SetRtcpMux_w(bool enable, - ContentAction action, - ContentSource src, - std::string* error_desc); - - // From MessageHandler - virtual void OnMessage(talk_base::Message* pmsg); - - // Handled in derived classes - // Get the SRTP ciphers to use for RTP media - virtual void GetSrtpCiphers(std::vector* ciphers) const = 0; - virtual void OnConnectionMonitorUpdate(SocketMonitor* monitor, - const std::vector& infos) = 0; - - // Helper function for invoking bool-returning methods on the worker thread. - template - bool InvokeOnWorker(const FunctorT& functor) { - return worker_thread_->Invoke(functor); - } - - private: - sigslot::signal3 SignalSendPacketPreCrypto; - sigslot::signal3 SignalSendPacketPostCrypto; - sigslot::signal3 SignalRecvPacketPreCrypto; - sigslot::signal3 SignalRecvPacketPostCrypto; - talk_base::CriticalSection signal_send_packet_cs_; - talk_base::CriticalSection signal_recv_packet_cs_; - - talk_base::Thread* worker_thread_; - MediaEngineInterface* media_engine_; - BaseSession* session_; - MediaChannel* media_channel_; - std::vector local_streams_; - std::vector remote_streams_; - - std::string content_name_; - bool rtcp_; - TransportChannel* transport_channel_; - TransportChannel* rtcp_transport_channel_; - SrtpFilter srtp_filter_; - RtcpMuxFilter rtcp_mux_filter_; - BundleFilter bundle_filter_; - talk_base::scoped_ptr socket_monitor_; - bool enabled_; - bool writable_; - bool rtp_ready_to_send_; - bool rtcp_ready_to_send_; - bool was_ever_writable_; - MediaContentDirection local_content_direction_; - MediaContentDirection remote_content_direction_; - std::set muted_streams_; - bool has_received_packet_; - bool dtls_keyed_; - bool secure_required_; - int rtp_abs_sendtime_extn_id_; -}; - -// VoiceChannel is a specialization that adds support for early media, DTMF, -// and input/output level monitoring. -class VoiceChannel : public BaseChannel { - public: - VoiceChannel(talk_base::Thread* thread, MediaEngineInterface* media_engine, - VoiceMediaChannel* channel, BaseSession* session, - const std::string& content_name, bool rtcp); - ~VoiceChannel(); - bool Init(); - bool SetRemoteRenderer(uint32 ssrc, AudioRenderer* renderer); - bool SetLocalRenderer(uint32 ssrc, AudioRenderer* renderer); - - // downcasts a MediaChannel - virtual VoiceMediaChannel* media_channel() const { - return static_cast(BaseChannel::media_channel()); - } - - bool SetRingbackTone(const void* buf, int len); - void SetEarlyMedia(bool enable); - // This signal is emitted when we have gone a period of time without - // receiving early media. When received, a UI should start playing its - // own ringing sound - sigslot::signal1 SignalEarlyMediaTimeout; - - bool PlayRingbackTone(uint32 ssrc, bool play, bool loop); - // TODO(ronghuawu): Replace PressDTMF with InsertDtmf. - bool PressDTMF(int digit, bool playout); - // Returns if the telephone-event has been negotiated. - bool CanInsertDtmf(); - // Send and/or play a DTMF |event| according to the |flags|. - // The DTMF out-of-band signal will be used on sending. - // The |ssrc| should be either 0 or a valid send stream ssrc. - // The valid value for the |event| are 0 which corresponding to DTMF - // event 0-9, *, #, A-D. - bool InsertDtmf(uint32 ssrc, int event_code, int duration, int flags); - bool SetOutputScaling(uint32 ssrc, double left, double right); - // Get statistics about the current media session. - bool GetStats(VoiceMediaInfo* stats); - - // Monitoring functions - sigslot::signal2&> - SignalConnectionMonitor; - - void StartMediaMonitor(int cms); - void StopMediaMonitor(); - sigslot::signal2 SignalMediaMonitor; - - void StartAudioMonitor(int cms); - void StopAudioMonitor(); - bool IsAudioMonitorRunning() const; - sigslot::signal2 SignalAudioMonitor; - - void StartTypingMonitor(const TypingMonitorOptions& settings); - void StopTypingMonitor(); - bool IsTypingMonitorRunning() const; - - // Overrides BaseChannel::MuteStream_w. - virtual bool MuteStream_w(uint32 ssrc, bool mute); - - int GetInputLevel_w(); - int GetOutputLevel_w(); - void GetActiveStreams_w(AudioInfo::StreamList* actives); - - // Signal errors from VoiceMediaChannel. Arguments are: - // ssrc(uint32), and error(VoiceMediaChannel::Error). - sigslot::signal3 - SignalMediaError; - - // Configuration and setting. - bool SetChannelOptions(const AudioOptions& options); - - private: - // overrides from BaseChannel - virtual void OnChannelRead(TransportChannel* channel, - const char* data, size_t len, - const talk_base::PacketTime& packet_time, - int flags); - virtual void ChangeState(); - virtual const ContentInfo* GetFirstContent(const SessionDescription* sdesc); - virtual bool SetLocalContent_w(const MediaContentDescription* content, - ContentAction action, - std::string* error_desc); - virtual bool SetRemoteContent_w(const MediaContentDescription* content, - ContentAction action, - std::string* error_desc); - bool SetRingbackTone_w(const void* buf, int len); - bool PlayRingbackTone_w(uint32 ssrc, bool play, bool loop); - void HandleEarlyMediaTimeout(); - bool InsertDtmf_w(uint32 ssrc, int event, int duration, int flags); - bool SetOutputScaling_w(uint32 ssrc, double left, double right); - bool GetStats_w(VoiceMediaInfo* stats); - - virtual void OnMessage(talk_base::Message* pmsg); - virtual void GetSrtpCiphers(std::vector* ciphers) const; - virtual void OnConnectionMonitorUpdate( - SocketMonitor* monitor, const std::vector& infos); - virtual void OnMediaMonitorUpdate( - VoiceMediaChannel* media_channel, const VoiceMediaInfo& info); - void OnAudioMonitorUpdate(AudioMonitor* monitor, const AudioInfo& info); - void OnVoiceChannelError(uint32 ssrc, VoiceMediaChannel::Error error); - void SendLastMediaError(); - void OnSrtpError(uint32 ssrc, SrtpFilter::Mode mode, SrtpFilter::Error error); - - static const int kEarlyMediaTimeout = 1000; - bool received_media_; - talk_base::scoped_ptr media_monitor_; - talk_base::scoped_ptr audio_monitor_; - talk_base::scoped_ptr typing_monitor_; -}; - -// VideoChannel is a specialization for video. -class VideoChannel : public BaseChannel { - public: - // Make screen capturer virtual so that it can be overriden in testing. - // E.g. used to test that window events are triggered correctly. - class ScreenCapturerFactory { - public: - virtual VideoCapturer* CreateScreenCapturer(const ScreencastId& window) = 0; - virtual ~ScreenCapturerFactory() {} - }; - - VideoChannel(talk_base::Thread* thread, MediaEngineInterface* media_engine, - VideoMediaChannel* channel, BaseSession* session, - const std::string& content_name, bool rtcp, - VoiceChannel* voice_channel); - ~VideoChannel(); - bool Init(); - - bool SetRenderer(uint32 ssrc, VideoRenderer* renderer); - bool ApplyViewRequest(const ViewRequest& request); - - // TODO(pthatcher): Refactor to use a "capture id" instead of an - // ssrc here as the "key". - VideoCapturer* AddScreencast(uint32 ssrc, const ScreencastId& id); - bool SetCapturer(uint32 ssrc, VideoCapturer* capturer); - bool RemoveScreencast(uint32 ssrc); - // True if we've added a screencast. Doesn't matter if the capturer - // has been started or not. - bool IsScreencasting(); - int GetScreencastFps(uint32 ssrc); - int GetScreencastMaxPixels(uint32 ssrc); - // Get statistics about the current media session. - bool GetStats(const StatsOptions& options, VideoMediaInfo* stats); - - sigslot::signal2&> - SignalConnectionMonitor; - - void StartMediaMonitor(int cms); - void StopMediaMonitor(); - sigslot::signal2 SignalMediaMonitor; - sigslot::signal2 SignalScreencastWindowEvent; - - bool SendIntraFrame(); - bool RequestIntraFrame(); - sigslot::signal3 - SignalMediaError; - - void SetScreenCaptureFactory( - ScreenCapturerFactory* screencapture_factory); - - // Configuration and setting. - bool SetChannelOptions(const VideoOptions& options); - - protected: - // downcasts a MediaChannel - virtual VideoMediaChannel* media_channel() const { - return static_cast(BaseChannel::media_channel()); - } - - private: - typedef std::map ScreencastMap; - struct ScreencastDetailsData; - - // overrides from BaseChannel - virtual void ChangeState(); - virtual const ContentInfo* GetFirstContent(const SessionDescription* sdesc); - virtual bool SetLocalContent_w(const MediaContentDescription* content, - ContentAction action, - std::string* error_desc); - virtual bool SetRemoteContent_w(const MediaContentDescription* content, - ContentAction action, - std::string* error_desc); - bool ApplyViewRequest_w(const ViewRequest& request); - - VideoCapturer* AddScreencast_w(uint32 ssrc, const ScreencastId& id); - bool RemoveScreencast_w(uint32 ssrc); - void OnScreencastWindowEvent_s(uint32 ssrc, talk_base::WindowEvent we); - bool IsScreencasting_w() const; - void GetScreencastDetails_w(ScreencastDetailsData* d) const; - void SetScreenCaptureFactory_w( - ScreenCapturerFactory* screencapture_factory); - bool GetStats_w(VideoMediaInfo* stats); - - virtual void OnMessage(talk_base::Message* pmsg); - virtual void GetSrtpCiphers(std::vector* ciphers) const; - virtual void OnConnectionMonitorUpdate( - SocketMonitor* monitor, const std::vector& infos); - virtual void OnMediaMonitorUpdate( - VideoMediaChannel* media_channel, const VideoMediaInfo& info); - virtual void OnScreencastWindowEvent(uint32 ssrc, - talk_base::WindowEvent event); - virtual void OnStateChange(VideoCapturer* capturer, CaptureState ev); - bool GetLocalSsrc(const VideoCapturer* capturer, uint32* ssrc); - - void OnVideoChannelError(uint32 ssrc, VideoMediaChannel::Error error); - void OnSrtpError(uint32 ssrc, SrtpFilter::Mode mode, SrtpFilter::Error error); - - VoiceChannel* voice_channel_; - VideoRenderer* renderer_; - talk_base::scoped_ptr screencapture_factory_; - ScreencastMap screencast_capturers_; - talk_base::scoped_ptr media_monitor_; - - talk_base::WindowEvent previous_we_; -}; - -// DataChannel is a specialization for data. -class DataChannel : public BaseChannel { - public: - DataChannel(talk_base::Thread* thread, - DataMediaChannel* media_channel, - BaseSession* session, - const std::string& content_name, - bool rtcp); - ~DataChannel(); - bool Init(); - - virtual bool SendData(const SendDataParams& params, - const talk_base::Buffer& payload, - SendDataResult* result); - - void StartMediaMonitor(int cms); - void StopMediaMonitor(); - - // Should be called on the signaling thread only. - bool ready_to_send_data() const { - return ready_to_send_data_; - } - - sigslot::signal2 SignalMediaMonitor; - sigslot::signal2&> - SignalConnectionMonitor; - sigslot::signal3 - SignalMediaError; - sigslot::signal3 - SignalDataReceived; - // Signal for notifying when the channel becomes ready to send data. - // That occurs when the channel is enabled, the transport is writable, - // both local and remote descriptions are set, and the channel is unblocked. - sigslot::signal1 SignalReadyToSendData; - - protected: - // downcasts a MediaChannel. - virtual DataMediaChannel* media_channel() const { - return static_cast(BaseChannel::media_channel()); - } - - private: - struct SendDataMessageData : public talk_base::MessageData { - SendDataMessageData(const SendDataParams& params, - const talk_base::Buffer* payload, - SendDataResult* result) - : params(params), - payload(payload), - result(result), - succeeded(false) { - } - - const SendDataParams& params; - const talk_base::Buffer* payload; - SendDataResult* result; - bool succeeded; - }; - - struct DataReceivedMessageData : public talk_base::MessageData { - // We copy the data because the data will become invalid after we - // handle DataMediaChannel::SignalDataReceived but before we fire - // SignalDataReceived. - DataReceivedMessageData( - const ReceiveDataParams& params, const char* data, size_t len) - : params(params), - payload(data, len) { - } - const ReceiveDataParams params; - const talk_base::Buffer payload; - }; - - typedef talk_base::TypedMessageData DataChannelReadyToSendMessageData; - - // overrides from BaseChannel - virtual const ContentInfo* GetFirstContent(const SessionDescription* sdesc); - // If data_channel_type_ is DCT_NONE, set it. Otherwise, check that - // it's the same as what was set previously. Returns false if it's - // set to one type one type and changed to another type later. - bool SetDataChannelType(DataChannelType new_data_channel_type, - std::string* error_desc); - // Same as SetDataChannelType, but extracts the type from the - // DataContentDescription. - bool SetDataChannelTypeFromContent(const DataContentDescription* content, - std::string* error_desc); - virtual bool SetLocalContent_w(const MediaContentDescription* content, - ContentAction action, - std::string* error_desc); - virtual bool SetRemoteContent_w(const MediaContentDescription* content, - ContentAction action, - std::string* error_desc); - virtual void ChangeState(); - virtual bool WantsPacket(bool rtcp, talk_base::Buffer* packet); - - virtual void OnMessage(talk_base::Message* pmsg); - virtual void GetSrtpCiphers(std::vector* ciphers) const; - virtual void OnConnectionMonitorUpdate( - SocketMonitor* monitor, const std::vector& infos); - virtual void OnMediaMonitorUpdate( - DataMediaChannel* media_channel, const DataMediaInfo& info); - virtual bool ShouldSetupDtlsSrtp() const; - void OnDataReceived( - const ReceiveDataParams& params, const char* data, size_t len); - void OnDataChannelError(uint32 ssrc, DataMediaChannel::Error error); - void OnDataChannelReadyToSend(bool writable); - void OnSrtpError(uint32 ssrc, SrtpFilter::Mode mode, SrtpFilter::Error error); - - talk_base::scoped_ptr media_monitor_; - // TODO(pthatcher): Make a separate SctpDataChannel and - // RtpDataChannel instead of using this. - DataChannelType data_channel_type_; - bool ready_to_send_data_; -}; - -} // namespace cricket - -#endif // TALK_SESSION_MEDIA_CHANNEL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/session/media/channelmanager.h b/thirdparties/common/include/webrtc-sdk/talk/session/media/channelmanager.h deleted file mode 100755 index 8ee1e57..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/session/media/channelmanager.h +++ /dev/null @@ -1,316 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_SESSION_MEDIA_CHANNELMANAGER_H_ -#define TALK_SESSION_MEDIA_CHANNELMANAGER_H_ - -#include -#include - -#include "talk/base/criticalsection.h" -#include "talk/base/fileutils.h" -#include "talk/base/sigslotrepeater.h" -#include "talk/base/thread.h" -#include "talk/media/base/capturemanager.h" -#include "talk/media/base/mediaengine.h" -#include "talk/p2p/base/session.h" -#include "talk/session/media/voicechannel.h" - -namespace cricket { - -class Soundclip; -class VideoProcessor; -class VoiceChannel; -class VoiceProcessor; - -// ChannelManager allows the MediaEngine to run on a separate thread, and takes -// care of marshalling calls between threads. It also creates and keeps track of -// voice and video channels; by doing so, it can temporarily pause all the -// channels when a new audio or video device is chosen. The voice and video -// channels are stored in separate vectors, to easily allow operations on just -// voice or just video channels. -// ChannelManager also allows the application to discover what devices it has -// using device manager. -class ChannelManager : public talk_base::MessageHandler, - public sigslot::has_slots<> { - public: -#if !defined(DISABLE_MEDIA_ENGINE_FACTORY) - // Creates the channel manager, and specifies the worker thread to use. - explicit ChannelManager(talk_base::Thread* worker); -#endif - - // For testing purposes. Allows the media engine and data media - // engine and dev manager to be mocks. The ChannelManager takes - // ownership of these objects. - ChannelManager(MediaEngineInterface* me, - DataEngineInterface* dme, - DeviceManagerInterface* dm, - CaptureManager* cm, - talk_base::Thread* worker); - // Same as above, but gives an easier default DataEngine. - ChannelManager(MediaEngineInterface* me, - DeviceManagerInterface* dm, - talk_base::Thread* worker); - ~ChannelManager(); - - // Accessors for the worker thread, allowing it to be set after construction, - // but before Init. set_worker_thread will return false if called after Init. - talk_base::Thread* worker_thread() const { return worker_thread_; } - bool set_worker_thread(talk_base::Thread* thread) { - if (initialized_) return false; - worker_thread_ = thread; - return true; - } - - // Gets capabilities. Can be called prior to starting the media engine. - int GetCapabilities(); - - // Retrieves the list of supported audio & video codec types. - // Can be called before starting the media engine. - void GetSupportedAudioCodecs(std::vector* codecs) const; - void GetSupportedAudioRtpHeaderExtensions(RtpHeaderExtensions* ext) const; - void GetSupportedVideoCodecs(std::vector* codecs) const; - void GetSupportedVideoRtpHeaderExtensions(RtpHeaderExtensions* ext) const; - void GetSupportedDataCodecs(std::vector* codecs) const; - - // Indicates whether the media engine is started. - bool initialized() const { return initialized_; } - // Starts up the media engine. - bool Init(); - // Shuts down the media engine. - void Terminate(); - - // The operations below all occur on the worker thread. - - // Creates a voice channel, to be associated with the specified session. - VoiceChannel* CreateVoiceChannel( - BaseSession* session, const std::string& content_name, bool rtcp); - // Destroys a voice channel created with the Create API. - void DestroyVoiceChannel(VoiceChannel* voice_channel); - // Creates a video channel, synced with the specified voice channel, and - // associated with the specified session. - VideoChannel* CreateVideoChannel( - BaseSession* session, const std::string& content_name, bool rtcp, - VoiceChannel* voice_channel); - // Destroys a video channel created with the Create API. - void DestroyVideoChannel(VideoChannel* video_channel); - DataChannel* CreateDataChannel( - BaseSession* session, const std::string& content_name, - bool rtcp, DataChannelType data_channel_type); - // Destroys a data channel created with the Create API. - void DestroyDataChannel(DataChannel* data_channel); - - // Creates a soundclip. - Soundclip* CreateSoundclip(); - // Destroys a soundclip created with the Create API. - void DestroySoundclip(Soundclip* soundclip); - - // Indicates whether any channels exist. - bool has_channels() const { - return (!voice_channels_.empty() || !video_channels_.empty() || - !soundclips_.empty()); - } - - // Configures the audio and video devices. A null pointer can be passed to - // GetAudioOptions() for any parameter of no interest. - bool GetAudioOptions(std::string* wave_in_device, - std::string* wave_out_device, - AudioOptions* options); - bool SetAudioOptions(const std::string& wave_in_device, - const std::string& wave_out_device, - const AudioOptions& options); - bool GetOutputVolume(int* level); - bool SetOutputVolume(int level); - bool IsSameCapturer(const std::string& capturer_name, - VideoCapturer* capturer); - // TODO(noahric): Nearly everything called "device" in this API is actually a - // device name, so this should really be GetCaptureDeviceName, and the - // next method should be GetCaptureDevice. - bool GetCaptureDevice(std::string* cam_device); - // Gets the current capture Device. - bool GetVideoCaptureDevice(Device* device); - // Create capturer based on what has been set in SetCaptureDevice(). - VideoCapturer* CreateVideoCapturer(); - bool SetCaptureDevice(const std::string& cam_device); - bool SetDefaultVideoEncoderConfig(const VideoEncoderConfig& config); - // RTX will be enabled/disabled in engines that support it. The supporting - // engines will start offering an RTX codec. Must be called before Init(). - bool SetVideoRtxEnabled(bool enable); - - // Starts/stops the local microphone and enables polling of the input level. - bool SetLocalMonitor(bool enable); - bool monitoring() const { return monitoring_; } - // Sets the local renderer where to renderer the local camera. - bool SetLocalRenderer(VideoRenderer* renderer); - bool capturing() const { return capturing_; } - - // Configures the logging output of the mediaengine(s). - void SetVoiceLogging(int level, const char* filter); - void SetVideoLogging(int level, const char* filter); - - // The channel manager handles the Tx side for Video processing, - // as well as Tx and Rx side for Voice processing. - // (The Rx Video processing will go throug the simplerenderingmanager, - // to be implemented). - bool RegisterVideoProcessor(VideoCapturer* capturer, - VideoProcessor* processor); - bool UnregisterVideoProcessor(VideoCapturer* capturer, - VideoProcessor* processor); - bool RegisterVoiceProcessor(uint32 ssrc, - VoiceProcessor* processor, - MediaProcessorDirection direction); - bool UnregisterVoiceProcessor(uint32 ssrc, - VoiceProcessor* processor, - MediaProcessorDirection direction); - // The following are done in the new "CaptureManager" style that - // all local video capturers, processors, and managers should move to. - // TODO(pthatcher): Make methods nicer by having start return a handle that - // can be used for stop and restart, rather than needing to pass around - // formats a a pseudo-handle. - bool StartVideoCapture(VideoCapturer* video_capturer, - const VideoFormat& video_format); - // When muting, produce black frames then pause the camera. - // When unmuting, start the camera. Camera starts unmuted. - bool MuteToBlackThenPause(VideoCapturer* video_capturer, bool muted); - bool StopVideoCapture(VideoCapturer* video_capturer, - const VideoFormat& video_format); - bool RestartVideoCapture(VideoCapturer* video_capturer, - const VideoFormat& previous_format, - const VideoFormat& desired_format, - CaptureManager::RestartOptions options); - - bool AddVideoRenderer(VideoCapturer* capturer, VideoRenderer* renderer); - bool RemoveVideoRenderer(VideoCapturer* capturer, VideoRenderer* renderer); - bool IsScreencastRunning() const; - - // The operations below occur on the main thread. - - bool GetAudioInputDevices(std::vector* names); - bool GetAudioOutputDevices(std::vector* names); - bool GetVideoCaptureDevices(std::vector* names); - void SetVideoCaptureDeviceMaxFormat(const std::string& usb_id, - const VideoFormat& max_format); - - // Starts AEC dump using existing file. - bool StartAecDump(talk_base::PlatformFile file); - - sigslot::repeater0<> SignalDevicesChange; - sigslot::signal2 SignalVideoCaptureStateChange; - - // Returns the current selected device. Note: Subtly different from - // GetCaptureDevice(). See member video_device_ for more details. - // This API is mainly a hook used by unittests. - const std::string& video_device_name() const { return video_device_name_; } - - // TODO(hellner): Remove this function once the engine capturer has been - // removed. - VideoFormat GetStartCaptureFormat(); - - protected: - // Adds non-transient parameters which can only be changed through the - // options store. - bool SetAudioOptions(const std::string& wave_in_device, - const std::string& wave_out_device, - const AudioOptions& options, - int delay_offset); - int audio_delay_offset() const { return audio_delay_offset_; } - - private: - typedef std::vector VoiceChannels; - typedef std::vector VideoChannels; - typedef std::vector DataChannels; - typedef std::vector Soundclips; - - void Construct(MediaEngineInterface* me, - DataEngineInterface* dme, - DeviceManagerInterface* dm, - CaptureManager* cm, - talk_base::Thread* worker_thread); - void Terminate_w(); - VoiceChannel* CreateVoiceChannel_w( - BaseSession* session, const std::string& content_name, bool rtcp); - void DestroyVoiceChannel_w(VoiceChannel* voice_channel); - VideoChannel* CreateVideoChannel_w( - BaseSession* session, const std::string& content_name, bool rtcp, - VoiceChannel* voice_channel); - void DestroyVideoChannel_w(VideoChannel* video_channel); - DataChannel* CreateDataChannel_w( - BaseSession* session, const std::string& content_name, - bool rtcp, DataChannelType data_channel_type); - void DestroyDataChannel_w(DataChannel* data_channel); - Soundclip* CreateSoundclip_w(); - void DestroySoundclip_w(Soundclip* soundclip); - bool SetAudioOptions_w(const AudioOptions& options, int delay_offset, - const Device* in_dev, const Device* out_dev); - bool SetCaptureDevice_w(const Device* cam_device); - void OnVideoCaptureStateChange(VideoCapturer* capturer, - CaptureState result); - bool RegisterVideoProcessor_w(VideoCapturer* capturer, - VideoProcessor* processor); - bool UnregisterVideoProcessor_w(VideoCapturer* capturer, - VideoProcessor* processor); - bool IsScreencastRunning_w() const; - virtual void OnMessage(talk_base::Message *message); - - talk_base::scoped_ptr media_engine_; - talk_base::scoped_ptr data_media_engine_; - talk_base::scoped_ptr device_manager_; - talk_base::scoped_ptr capture_manager_; - bool initialized_; - talk_base::Thread* main_thread_; - talk_base::Thread* worker_thread_; - - VoiceChannels voice_channels_; - VideoChannels video_channels_; - DataChannels data_channels_; - Soundclips soundclips_; - - std::string audio_in_device_; - std::string audio_out_device_; - AudioOptions audio_options_; - int audio_delay_offset_; - int audio_output_volume_; - std::string camera_device_; - VideoEncoderConfig default_video_encoder_config_; - VideoRenderer* local_renderer_; - bool enable_rtx_; - - bool capturing_; - bool monitoring_; - - // String containing currently set device. Note that this string is subtly - // different from camera_device_. E.g. camera_device_ will list unplugged - // but selected devices while this sting will be empty or contain current - // selected device. - // TODO(hellner): refactor the code such that there is no need to keep two - // strings for video devices that have subtle differences in behavior. - std::string video_device_name_; -}; - -} // namespace cricket - -#endif // TALK_SESSION_MEDIA_CHANNELMANAGER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/session/media/currentspeakermonitor.h b/thirdparties/common/include/webrtc-sdk/talk/session/media/currentspeakermonitor.h deleted file mode 100755 index 1367581..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/session/media/currentspeakermonitor.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - * 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. - */ - -// CurrentSpeakerMonitor monitors the audio levels for a session and determines -// which participant is currently speaking. - -#ifndef TALK_SESSION_MEDIA_CURRENTSPEAKERMONITOR_H_ -#define TALK_SESSION_MEDIA_CURRENTSPEAKERMONITOR_H_ - -#include - -#include "talk/base/basictypes.h" -#include "talk/base/sigslot.h" - -namespace cricket { - -class BaseSession; -class Call; -class Session; -struct AudioInfo; -struct MediaStreams; - -class AudioSourceContext { - public: - sigslot::signal2 - SignalAudioMonitor; - sigslot::signal2 - SignalMediaStreamsReset; - sigslot::signal4 - SignalMediaStreamsUpdate; -}; - -// CurrentSpeakerMonitor can be used to monitor the audio-levels from -// many audio-sources and report on changes in the loudest audio-source. -// Its a generic type and relies on an AudioSourceContext which is aware of -// the audio-sources. AudioSourceContext needs to provide two signals namely -// SignalAudioInfoMonitor - provides audio info of the all current speakers. -// SignalMediaSourcesUpdated - provides updates when a speaker leaves or joins. -// Note that the AudioSourceContext's audio monitor must be started -// before this is started. -// It's recommended that the audio monitor be started with a 100 ms period. -class CurrentSpeakerMonitor : public sigslot::has_slots<> { - public: - CurrentSpeakerMonitor(AudioSourceContext* call, BaseSession* session); - ~CurrentSpeakerMonitor(); - - BaseSession* session() const { return session_; } - - void Start(); - void Stop(); - - // Used by tests. Note that the actual minimum time between switches - // enforced by the monitor will be the given value plus or minus the - // resolution of the system clock. - void set_min_time_between_switches(uint32 min_time_between_switches); - - // This is fired when the current speaker changes, and provides his audio - // SSRC. This only fires after the audio monitor on the underlying Call has - // been started. - sigslot::signal2 SignalUpdate; - - private: - void OnAudioMonitor(AudioSourceContext* call, const AudioInfo& info); - void OnMediaStreamsUpdate(AudioSourceContext* call, - BaseSession* session, - const MediaStreams& added, - const MediaStreams& removed); - void OnMediaStreamsReset(AudioSourceContext* audio_source_context, - BaseSession* session); - - // These are states that a participant will pass through so that we gradually - // recognize that they have started and stopped speaking. This avoids - // "twitchiness". - enum SpeakingState { - SS_NOT_SPEAKING, - SS_MIGHT_BE_SPEAKING, - SS_SPEAKING, - SS_WAS_SPEAKING_RECENTLY1, - SS_WAS_SPEAKING_RECENTLY2 - }; - - bool started_; - AudioSourceContext* audio_source_context_; - BaseSession* session_; - std::map ssrc_to_speaking_state_map_; - uint32 current_speaker_ssrc_; - // To prevent overswitching, switching is disabled for some time after a - // switch is made. This gives us the earliest time a switch is permitted. - uint32 earliest_permitted_switch_time_; - uint32 min_time_between_switches_; -}; - -} - -#endif // TALK_SESSION_MEDIA_CURRENTSPEAKERMONITOR_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/session/media/externalhmac.h b/thirdparties/common/include/webrtc-sdk/talk/session/media/externalhmac.h deleted file mode 100755 index 71fab40..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/session/media/externalhmac.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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_SESSION_MEDIA_EXTERNAL_HMAC_H_ -#define TALK_SESSION_MEDIA_EXTERNAL_HMAC_H_ - -// External libsrtp HMAC auth module which implements methods defined in -// auth_type_t. -// The default auth module will be replaced only when the ENABLE_EXTERNAL_AUTH -// flag is enabled. This allows us to access to authentication keys, -// as the default auth implementation doesn't provide access and avoids -// hashing each packet twice. - -// How will libsrtp select this module? -// Libsrtp defines authentication function types identified by an unsigned -// integer, e.g. HMAC_SHA1 is 3. Using authentication ids, the application -// can plug any desired authentication modules into libsrtp. -// libsrtp also provides a mechanism to select different auth functions for -// individual streams. This can be done by setting the right value in -// the auth_type of srtp_policy_t. The application must first register auth -// functions and the corresponding authentication id using -// crypto_kernel_replace_auth_type function. -#if defined(HAVE_SRTP) && defined(ENABLE_EXTERNAL_AUTH) - -#include "talk/base/basictypes.h" -#ifdef SRTP_RELATIVE_PATH -#include "auth.h" // NOLINT -#else -#include "third_party/libsrtp/crypto/include/auth.h" -#endif // SRTP_RELATIVE_PATH - -#define EXTERNAL_HMAC_SHA1 HMAC_SHA1 + 1 -#define HMAC_KEY_LENGTH 20 - -// The HMAC context structure used to store authentication keys. -// The pointer to the key will be allocated in the external_hmac_init function. -// This pointer is owned by srtp_t in a template context. -typedef struct { - uint8 key[HMAC_KEY_LENGTH]; - int key_length; -} external_hmac_ctx_t; - -err_status_t external_hmac_alloc(auth_t** a, int key_len, int out_len); - -err_status_t external_hmac_dealloc(auth_t* a); - -err_status_t external_hmac_init(external_hmac_ctx_t* state, - const uint8_t* key, - int key_len); - -err_status_t external_hmac_start(external_hmac_ctx_t* state); - -err_status_t external_hmac_update(external_hmac_ctx_t* state, - const uint8_t* message, - int msg_octets); - -err_status_t external_hmac_compute(external_hmac_ctx_t* state, - const void* message, - int msg_octets, - int tag_len, - uint8_t* result); - -err_status_t external_crypto_init(); - -#endif // defined(HAVE_SRTP) && defined(ENABLE_EXTERNAL_AUTH) -#endif // TALK_SESSION_MEDIA_EXTERNAL_HMAC_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/session/media/mediamessages.h b/thirdparties/common/include/webrtc-sdk/talk/session/media/mediamessages.h deleted file mode 100755 index 63b682d..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/session/media/mediamessages.h +++ /dev/null @@ -1,169 +0,0 @@ -/* - * libjingle - * Copyright 2010 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. - */ - -/* - * A collection of functions and types for serializing and - * deserializing Jingle session messages related to media. - * Specificially, the and messages. They are not yet - * standardized, but their current documentation can be found at: - * goto/jinglemuc - */ - -#ifndef TALK_SESSION_MEDIA_MEDIAMESSAGES_H_ -#define TALK_SESSION_MEDIA_MEDIAMESSAGES_H_ - -#include -#include - -#include "talk/base/basictypes.h" -#include "talk/media/base/mediachannel.h" // For RtpHeaderExtension -#include "talk/media/base/streamparams.h" -#include "talk/p2p/base/parsing.h" -#include "talk/p2p/base/sessiondescription.h" - -namespace cricket { - -// A collection of audio and video and data streams. Most of the -// methods are merely for convenience. Many of these methods are keyed -// by ssrc, which is the source identifier in the RTP spec -// (http://tools.ietf.org/html/rfc3550). -struct MediaStreams { - public: - MediaStreams() {} - void CopyFrom(const MediaStreams& sources); - - bool empty() const { - return audio_.empty() && video_.empty() && data_.empty(); - } - - std::vector* mutable_audio() { return &audio_; } - std::vector* mutable_video() { return &video_; } - std::vector* mutable_data() { return &data_; } - const std::vector& audio() const { return audio_; } - const std::vector& video() const { return video_; } - const std::vector& data() const { return data_; } - - // Gets a stream, returning true if found. - bool GetAudioStream( - const StreamSelector& selector, StreamParams* stream); - bool GetVideoStream( - const StreamSelector& selector, StreamParams* stream); - bool GetDataStream( - const StreamSelector& selector, StreamParams* stream); - // Adds a stream. - void AddAudioStream(const StreamParams& stream); - void AddVideoStream(const StreamParams& stream); - void AddDataStream(const StreamParams& stream); - // Removes a stream, returning true if found and removed. - bool RemoveAudioStream(const StreamSelector& selector); - bool RemoveVideoStream(const StreamSelector& selector); - bool RemoveDataStream(const StreamSelector& selector); - - private: - std::vector audio_; - std::vector video_; - std::vector data_; - - DISALLOW_COPY_AND_ASSIGN(MediaStreams); -}; - -// In a message, there are a number of views specified. This -// represents one such view. We currently only support "static" -// views. -struct StaticVideoView { - StaticVideoView(const StreamSelector& selector, - int width, int height, int framerate) - : selector(selector), - width(width), - height(height), - framerate(framerate), - preference(0) { - } - - StreamSelector selector; - int width; - int height; - int framerate; - int preference; -}; - -typedef std::vector StaticVideoViews; - -// Represents a whole view request message, which contains many views. -struct ViewRequest { - StaticVideoViews static_video_views; -}; - -// If the parent element (usually ) is a jingle view. -bool IsJingleViewRequest(const buzz::XmlElement* action_elem); - -// Parses a view request from the parent element (usually -// ). If it fails, it returns false and fills an error -// message. -bool ParseJingleViewRequest(const buzz::XmlElement* action_elem, - ViewRequest* view_request, - ParseError* error); - -// Serializes a view request to XML. If it fails, returns false and -// fills in an error message. -bool WriteJingleViewRequest(const std::string& content_name, - const ViewRequest& view, - XmlElements* elems, - WriteError* error); - -// TODO(pthatcher): Get rid of legacy source notify and replace with -// description-info as soon as reflector is capable of sending it. -bool IsSourcesNotify(const buzz::XmlElement* action_elem); - -// If the given elem has . -bool HasJingleStreams(const buzz::XmlElement* desc_elem); - -// Parses streams from a jingle . If it fails, returns -// false and fills an error message. -bool ParseJingleStreams(const buzz::XmlElement* desc_elem, - std::vector* streams, - ParseError* error); - -// Write a element to the parent_elem. -void WriteJingleStreams(const std::vector& streams, - buzz::XmlElement* parent_elem); - -// Parses rtp header extensions from a jingle . If it -// fails, returns false and fills an error message. -bool ParseJingleRtpHeaderExtensions( - const buzz::XmlElement* desc_elem, - std::vector* hdrexts, - ParseError* error); - -// Writes elements to the parent_elem. -void WriteJingleRtpHeaderExtensions( - const std::vector& hdrexts, - buzz::XmlElement* parent_elem); - -} // namespace cricket - -#endif // TALK_SESSION_MEDIA_MEDIAMESSAGES_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/session/media/mediamonitor.h b/thirdparties/common/include/webrtc-sdk/talk/session/media/mediamonitor.h deleted file mode 100755 index 1675d76..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/session/media/mediamonitor.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * libjingle - * Copyright 2005 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. - */ - -// Class to collect statistics from a media channel - -#ifndef TALK_SESSION_MEDIA_MEDIAMONITOR_H_ -#define TALK_SESSION_MEDIA_MEDIAMONITOR_H_ - -#include "talk/base/criticalsection.h" -#include "talk/base/sigslot.h" -#include "talk/base/thread.h" -#include "talk/media/base/mediachannel.h" - -namespace cricket { - -// The base MediaMonitor class, independent of voice and video. -class MediaMonitor : public talk_base::MessageHandler, - public sigslot::has_slots<> { - public: - MediaMonitor(talk_base::Thread* worker_thread, - talk_base::Thread* monitor_thread); - ~MediaMonitor(); - - void Start(uint32 milliseconds); - void Stop(); - - protected: - void OnMessage(talk_base::Message *message); - void PollMediaChannel(); - virtual void GetStats() = 0; - virtual void Update() = 0; - - talk_base::CriticalSection crit_; - talk_base::Thread* worker_thread_; - talk_base::Thread* monitor_thread_; - bool monitoring_; - uint32 rate_; -}; - -// Templatized MediaMonitor that can deal with different kinds of media. -template -class MediaMonitorT : public MediaMonitor { - public: - MediaMonitorT(MC* media_channel, talk_base::Thread* worker_thread, - talk_base::Thread* monitor_thread) - : MediaMonitor(worker_thread, monitor_thread), - media_channel_(media_channel) {} - sigslot::signal2 SignalUpdate; - - protected: - // These routines assume the crit_ lock is held by the calling thread. - virtual void GetStats() { - media_info_.Clear(); - media_channel_->GetStats(&media_info_); - } - virtual void Update() { - MI stats(media_info_); - crit_.Leave(); - SignalUpdate(media_channel_, stats); - crit_.Enter(); - } - - private: - MC* media_channel_; - MI media_info_; -}; - -typedef MediaMonitorT VoiceMediaMonitor; -typedef MediaMonitorT VideoMediaMonitor; -typedef MediaMonitorT DataMediaMonitor; - -} // namespace cricket - -#endif // TALK_SESSION_MEDIA_MEDIAMONITOR_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/session/media/mediarecorder.h b/thirdparties/common/include/webrtc-sdk/talk/session/media/mediarecorder.h deleted file mode 100755 index 5f08ec4..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/session/media/mediarecorder.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - * libjingle - * Copyright 2010 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_SESSION_MEDIA_MEDIARECORDER_H_ -#define TALK_SESSION_MEDIA_MEDIARECORDER_H_ - -#include -#include - -#include "talk/base/criticalsection.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/sigslot.h" -#include "talk/session/media/channel.h" -#include "talk/session/media/mediasink.h" - -namespace talk_base { -class Pathname; -class FileStream; -} - -namespace cricket { - -class BaseChannel; -class VideoChannel; -class VoiceChannel; -class RtpDumpWriter; - -// RtpDumpSink implements MediaSinkInterface by dumping the RTP/RTCP packets to -// a file. -class RtpDumpSink : public MediaSinkInterface, public sigslot::has_slots<> { - public: - // Takes ownership of stream. - explicit RtpDumpSink(talk_base::StreamInterface* stream); - virtual ~RtpDumpSink(); - - virtual void SetMaxSize(size_t size); - virtual bool Enable(bool enable); - virtual bool IsEnabled() const { return recording_; } - virtual void OnPacket(const void* data, size_t size, bool rtcp); - virtual void set_packet_filter(int filter); - int packet_filter() const { return packet_filter_; } - void Flush(); - - private: - size_t max_size_; - bool recording_; - int packet_filter_; - talk_base::scoped_ptr stream_; - talk_base::scoped_ptr writer_; - talk_base::CriticalSection critical_section_; - - DISALLOW_COPY_AND_ASSIGN(RtpDumpSink); -}; - -class MediaRecorder { - public: - MediaRecorder(); - virtual ~MediaRecorder(); - - bool AddChannel(VoiceChannel* channel, - talk_base::StreamInterface* send_stream, - talk_base::StreamInterface* recv_stream, - int filter); - bool AddChannel(VideoChannel* channel, - talk_base::StreamInterface* send_stream, - talk_base::StreamInterface* recv_stream, - int filter); - void RemoveChannel(BaseChannel* channel, SinkType type); - bool EnableChannel(BaseChannel* channel, bool enable_send, bool enable_recv, - SinkType type); - void FlushSinks(); - - private: - struct SinkPair { - bool video_channel; - int filter; - talk_base::scoped_ptr send_sink; - talk_base::scoped_ptr recv_sink; - }; - - bool InternalAddChannel(BaseChannel* channel, - bool video_channel, - talk_base::StreamInterface* send_stream, - talk_base::StreamInterface* recv_stream, - int filter); - - std::map sinks_; - talk_base::CriticalSection critical_section_; - - DISALLOW_COPY_AND_ASSIGN(MediaRecorder); -}; - -} // namespace cricket - -#endif // TALK_SESSION_MEDIA_MEDIARECORDER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/session/media/mediasession.h b/thirdparties/common/include/webrtc-sdk/talk/session/media/mediasession.h deleted file mode 100755 index 4b30fea..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/session/media/mediasession.h +++ /dev/null @@ -1,522 +0,0 @@ -/* - * libjingle - * Copyright 2004 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. - */ - -// Types and classes used in media session descriptions. - -#ifndef TALK_SESSION_MEDIA_MEDIASESSION_H_ -#define TALK_SESSION_MEDIA_MEDIASESSION_H_ - -#include -#include -#include - -#include "talk/base/scoped_ptr.h" -#include "talk/media/base/codec.h" -#include "talk/media/base/constants.h" -#include "talk/media/base/cryptoparams.h" -#include "talk/media/base/mediachannel.h" -#include "talk/media/base/mediaengine.h" // For DataChannelType -#include "talk/media/base/streamparams.h" -#include "talk/p2p/base/sessiondescription.h" -#include "talk/p2p/base/transport.h" -#include "talk/p2p/base/transportdescriptionfactory.h" - -namespace cricket { - -class ChannelManager; -typedef std::vector AudioCodecs; -typedef std::vector VideoCodecs; -typedef std::vector DataCodecs; -typedef std::vector CryptoParamsVec; -typedef std::vector RtpHeaderExtensions; - -enum MediaType { - MEDIA_TYPE_AUDIO, - MEDIA_TYPE_VIDEO, - MEDIA_TYPE_DATA -}; - -std::string MediaTypeToString(MediaType type); - -enum MediaContentDirection { - MD_INACTIVE, - MD_SENDONLY, - MD_RECVONLY, - MD_SENDRECV -}; - -enum CryptoType { - CT_NONE, - CT_SDES, - CT_DTLS -}; - -// RTC4585 RTP/AVPF -extern const char kMediaProtocolAvpf[]; -// RFC5124 RTP/SAVPF -extern const char kMediaProtocolSavpf[]; - -extern const char kMediaProtocolRtpPrefix[]; - -extern const char kMediaProtocolSctp[]; -extern const char kMediaProtocolDtlsSctp[]; - -// Options to control how session descriptions are generated. -const int kAutoBandwidth = -1; -const int kBufferedModeDisabled = 0; - -struct MediaSessionOptions { - MediaSessionOptions() : - has_audio(true), // Audio enabled by default. - has_video(false), - data_channel_type(DCT_NONE), - is_muc(false), - vad_enabled(true), // When disabled, removes all CN codecs from SDP. - rtcp_mux_enabled(true), - bundle_enabled(false), - video_bandwidth(kAutoBandwidth), - data_bandwidth(kDataMaxBandwidth) { - } - - bool has_data() const { return data_channel_type != DCT_NONE; } - - // Add a stream with MediaType type and id. - // All streams with the same sync_label will get the same CNAME. - // All ids must be unique. - void AddStream(MediaType type, - const std::string& id, - const std::string& sync_label); - void AddVideoStream(const std::string& id, - const std::string& sync_label, - int num_sim_layers); - void RemoveStream(MediaType type, const std::string& id); - - - // Helper function. - void AddStreamInternal(MediaType type, - const std::string& id, - const std::string& sync_label, - int num_sim_layers); - - bool has_audio; - bool has_video; - DataChannelType data_channel_type; - bool is_muc; - bool vad_enabled; - bool rtcp_mux_enabled; - bool bundle_enabled; - // bps. -1 == auto. - int video_bandwidth; - int data_bandwidth; - TransportOptions transport_options; - - struct Stream { - Stream(MediaType type, - const std::string& id, - const std::string& sync_label, - int num_sim_layers) - : type(type), id(id), sync_label(sync_label), - num_sim_layers(num_sim_layers) { - } - MediaType type; - std::string id; - std::string sync_label; - int num_sim_layers; - }; - - typedef std::vector Streams; - Streams streams; -}; - -// "content" (as used in XEP-0166) descriptions for voice and video. -class MediaContentDescription : public ContentDescription { - public: - MediaContentDescription() - : rtcp_mux_(false), - bandwidth_(kAutoBandwidth), - crypto_required_(CT_NONE), - rtp_header_extensions_set_(false), - multistream_(false), - conference_mode_(false), - partial_(false), - buffered_mode_latency_(kBufferedModeDisabled), - direction_(MD_SENDRECV) { - } - - virtual MediaType type() const = 0; - virtual bool has_codecs() const = 0; - - // |protocol| is the expected media transport protocol, such as RTP/AVPF, - // RTP/SAVPF or SCTP/DTLS. - std::string protocol() const { return protocol_; } - void set_protocol(const std::string& protocol) { protocol_ = protocol; } - - MediaContentDirection direction() const { return direction_; } - void set_direction(MediaContentDirection direction) { - direction_ = direction; - } - - bool rtcp_mux() const { return rtcp_mux_; } - void set_rtcp_mux(bool mux) { rtcp_mux_ = mux; } - - int bandwidth() const { return bandwidth_; } - void set_bandwidth(int bandwidth) { bandwidth_ = bandwidth; } - - const std::vector& cryptos() const { return cryptos_; } - void AddCrypto(const CryptoParams& params) { - cryptos_.push_back(params); - } - void set_cryptos(const std::vector& cryptos) { - cryptos_ = cryptos; - } - - CryptoType crypto_required() const { return crypto_required_; } - void set_crypto_required(CryptoType type) { - crypto_required_ = type; - } - - const RtpHeaderExtensions& rtp_header_extensions() const { - return rtp_header_extensions_; - } - void set_rtp_header_extensions(const RtpHeaderExtensions& extensions) { - rtp_header_extensions_ = extensions; - rtp_header_extensions_set_ = true; - } - void AddRtpHeaderExtension(const RtpHeaderExtension& ext) { - rtp_header_extensions_.push_back(ext); - rtp_header_extensions_set_ = true; - } - void ClearRtpHeaderExtensions() { - rtp_header_extensions_.clear(); - rtp_header_extensions_set_ = true; - } - // We can't always tell if an empty list of header extensions is - // because the other side doesn't support them, or just isn't hooked up to - // signal them. For now we assume an empty list means no signaling, but - // provide the ClearRtpHeaderExtensions method to allow "no support" to be - // clearly indicated (i.e. when derived from other information). - bool rtp_header_extensions_set() const { - return rtp_header_extensions_set_; - } - // True iff the client supports multiple streams. - void set_multistream(bool multistream) { multistream_ = multistream; } - bool multistream() const { return multistream_; } - const StreamParamsVec& streams() const { - return streams_; - } - // TODO(pthatcher): Remove this by giving mediamessage.cc access - // to MediaContentDescription - StreamParamsVec& mutable_streams() { - return streams_; - } - void AddStream(const StreamParams& stream) { - streams_.push_back(stream); - } - // Legacy streams have an ssrc, but nothing else. - void AddLegacyStream(uint32 ssrc) { - streams_.push_back(StreamParams::CreateLegacy(ssrc)); - } - void AddLegacyStream(uint32 ssrc, uint32 fid_ssrc) { - StreamParams sp = StreamParams::CreateLegacy(ssrc); - sp.AddFidSsrc(ssrc, fid_ssrc); - streams_.push_back(sp); - } - // Sets the CNAME of all StreamParams if it have not been set. - // This can be used to set the CNAME of legacy streams. - void SetCnameIfEmpty(const std::string& cname) { - for (cricket::StreamParamsVec::iterator it = streams_.begin(); - it != streams_.end(); ++it) { - if (it->cname.empty()) - it->cname = cname; - } - } - uint32 first_ssrc() const { - if (streams_.empty()) { - return 0; - } - return streams_[0].first_ssrc(); - } - bool has_ssrcs() const { - if (streams_.empty()) { - return false; - } - return streams_[0].has_ssrcs(); - } - - void set_conference_mode(bool enable) { conference_mode_ = enable; } - bool conference_mode() const { return conference_mode_; } - - void set_partial(bool partial) { partial_ = partial; } - bool partial() const { return partial_; } - - void set_buffered_mode_latency(int latency) { - buffered_mode_latency_ = latency; - } - int buffered_mode_latency() const { return buffered_mode_latency_; } - - protected: - bool rtcp_mux_; - int bandwidth_; - std::string protocol_; - std::vector cryptos_; - CryptoType crypto_required_; - std::vector rtp_header_extensions_; - bool rtp_header_extensions_set_; - bool multistream_; - StreamParamsVec streams_; - bool conference_mode_; - bool partial_; - int buffered_mode_latency_; - MediaContentDirection direction_; -}; - -template -class MediaContentDescriptionImpl : public MediaContentDescription { - public: - struct PreferenceSort { - bool operator()(C a, C b) { return a.preference > b.preference; } - }; - - const std::vector& codecs() const { return codecs_; } - void set_codecs(const std::vector& codecs) { codecs_ = codecs; } - virtual bool has_codecs() const { return !codecs_.empty(); } - bool HasCodec(int id) { - bool found = false; - for (typename std::vector::iterator iter = codecs_.begin(); - iter != codecs_.end(); ++iter) { - if (iter->id == id) { - found = true; - break; - } - } - return found; - } - void AddCodec(const C& codec) { - codecs_.push_back(codec); - } - void AddOrReplaceCodec(const C& codec) { - for (typename std::vector::iterator iter = codecs_.begin(); - iter != codecs_.end(); ++iter) { - if (iter->id == codec.id) { - *iter = codec; - return; - } - } - AddCodec(codec); - } - void AddCodecs(const std::vector& codecs) { - typename std::vector::const_iterator codec; - for (codec = codecs.begin(); codec != codecs.end(); ++codec) { - AddCodec(*codec); - } - } - void SortCodecs() { - std::sort(codecs_.begin(), codecs_.end(), PreferenceSort()); - } - - private: - std::vector codecs_; -}; - -class AudioContentDescription : public MediaContentDescriptionImpl { - public: - AudioContentDescription() : - agc_minus_10db_(false) {} - - virtual ContentDescription* Copy() const { - return new AudioContentDescription(*this); - } - virtual MediaType type() const { return MEDIA_TYPE_AUDIO; } - - const std::string &lang() const { return lang_; } - void set_lang(const std::string &lang) { lang_ = lang; } - - bool agc_minus_10db() const { return agc_minus_10db_; } - void set_agc_minus_10db(bool enable) { - agc_minus_10db_ = enable; - } - - private: - bool agc_minus_10db_; - - private: - std::string lang_; -}; - -class VideoContentDescription : public MediaContentDescriptionImpl { - public: - virtual ContentDescription* Copy() const { - return new VideoContentDescription(*this); - } - virtual MediaType type() const { return MEDIA_TYPE_VIDEO; } -}; - -class DataContentDescription : public MediaContentDescriptionImpl { - public: - virtual ContentDescription* Copy() const { - return new DataContentDescription(*this); - } - virtual MediaType type() const { return MEDIA_TYPE_DATA; } -}; - -// Creates media session descriptions according to the supplied codecs and -// other fields, as well as the supplied per-call options. -// When creating answers, performs the appropriate negotiation -// of the various fields to determine the proper result. -class MediaSessionDescriptionFactory { - public: - // Default ctor; use methods below to set configuration. - // The TransportDescriptionFactory is not owned by MediaSessionDescFactory, - // so it must be kept alive by the user of this class. - explicit MediaSessionDescriptionFactory( - const TransportDescriptionFactory* factory); - // This helper automatically sets up the factory to get its configuration - // from the specified ChannelManager. - MediaSessionDescriptionFactory(ChannelManager* cmanager, - const TransportDescriptionFactory* factory); - - const AudioCodecs& audio_codecs() const { return audio_codecs_; } - void set_audio_codecs(const AudioCodecs& codecs) { audio_codecs_ = codecs; } - void set_audio_rtp_header_extensions(const RtpHeaderExtensions& extensions) { - audio_rtp_extensions_ = extensions; - } - const RtpHeaderExtensions& audio_rtp_header_extensions() const { - return audio_rtp_extensions_; - } - const VideoCodecs& video_codecs() const { return video_codecs_; } - void set_video_codecs(const VideoCodecs& codecs) { video_codecs_ = codecs; } - void set_video_rtp_header_extensions(const RtpHeaderExtensions& extensions) { - video_rtp_extensions_ = extensions; - } - const RtpHeaderExtensions& video_rtp_header_extensions() const { - return video_rtp_extensions_; - } - const DataCodecs& data_codecs() const { return data_codecs_; } - void set_data_codecs(const DataCodecs& codecs) { data_codecs_ = codecs; } - SecurePolicy secure() const { return secure_; } - void set_secure(SecurePolicy s) { secure_ = s; } - // Decides if a StreamParams shall be added to the audio and video media - // content in SessionDescription when CreateOffer and CreateAnswer is called - // even if |options| don't include a Stream. This is needed to support legacy - // applications. |add_legacy_| is true per default. - void set_add_legacy_streams(bool add_legacy) { add_legacy_ = add_legacy; } - - SessionDescription* CreateOffer( - const MediaSessionOptions& options, - const SessionDescription* current_description) const; - SessionDescription* CreateAnswer( - const SessionDescription* offer, - const MediaSessionOptions& options, - const SessionDescription* current_description) const; - - private: - void GetCodecsToOffer(const SessionDescription* current_description, - AudioCodecs* audio_codecs, - VideoCodecs* video_codecs, - DataCodecs* data_codecs) const; - void GetRtpHdrExtsToOffer(const SessionDescription* current_description, - RtpHeaderExtensions* audio_extensions, - RtpHeaderExtensions* video_extensions) const; - bool AddTransportOffer( - const std::string& content_name, - const TransportOptions& transport_options, - const SessionDescription* current_desc, - SessionDescription* offer) const; - - TransportDescription* CreateTransportAnswer( - const std::string& content_name, - const SessionDescription* offer_desc, - const TransportOptions& transport_options, - const SessionDescription* current_desc) const; - - bool AddTransportAnswer( - const std::string& content_name, - const TransportDescription& transport_desc, - SessionDescription* answer_desc) const; - - AudioCodecs audio_codecs_; - RtpHeaderExtensions audio_rtp_extensions_; - VideoCodecs video_codecs_; - RtpHeaderExtensions video_rtp_extensions_; - DataCodecs data_codecs_; - SecurePolicy secure_; - bool add_legacy_; - std::string lang_; - const TransportDescriptionFactory* transport_desc_factory_; -}; - -// Convenience functions. -bool IsMediaContent(const ContentInfo* content); -bool IsAudioContent(const ContentInfo* content); -bool IsVideoContent(const ContentInfo* content); -bool IsDataContent(const ContentInfo* content); -const ContentInfo* GetFirstAudioContent(const ContentInfos& contents); -const ContentInfo* GetFirstVideoContent(const ContentInfos& contents); -const ContentInfo* GetFirstDataContent(const ContentInfos& contents); -const ContentInfo* GetFirstAudioContent(const SessionDescription* sdesc); -const ContentInfo* GetFirstVideoContent(const SessionDescription* sdesc); -const ContentInfo* GetFirstDataContent(const SessionDescription* sdesc); -const AudioContentDescription* GetFirstAudioContentDescription( - const SessionDescription* sdesc); -const VideoContentDescription* GetFirstVideoContentDescription( - const SessionDescription* sdesc); -const DataContentDescription* GetFirstDataContentDescription( - const SessionDescription* sdesc); -bool GetStreamBySsrc( - const SessionDescription* sdesc, MediaType media_type, - uint32 ssrc, StreamParams* stream_out); -bool GetStreamByIds( - const SessionDescription* sdesc, MediaType media_type, - const std::string& groupid, const std::string& id, - StreamParams* stream_out); - -// Functions for translating media candidate names. - -// For converting between media ICE component and G-ICE channel -// names. For example: -// "rtp" <=> 1 -// "rtcp" <=> 2 -// "video_rtp" <=> 1 -// "video_rtcp" <=> 2 -// Will not convert in the general case of arbitrary channel names, -// but is useful for cases where we have candidates for media -// channels. -// returns false if there is no mapping. -bool GetMediaChannelNameFromComponent( - int component, cricket::MediaType media_type, std::string* channel_name); -bool GetMediaComponentFromChannelName( - const std::string& channel_name, int* component); -bool GetMediaTypeFromChannelName( - const std::string& channel_name, cricket::MediaType* media_type); - -void GetSupportedAudioCryptoSuites(std::vector* crypto_suites); -void GetSupportedVideoCryptoSuites(std::vector* crypto_suites); -void GetSupportedDataCryptoSuites(std::vector* crypto_suites); -void GetSupportedDefaultCryptoSuites(std::vector* crypto_suites); -} // namespace cricket - -#endif // TALK_SESSION_MEDIA_MEDIASESSION_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/session/media/mediasessionclient.h b/thirdparties/common/include/webrtc-sdk/talk/session/media/mediasessionclient.h deleted file mode 100755 index 9727a67..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/session/media/mediasessionclient.h +++ /dev/null @@ -1,175 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_SESSION_MEDIA_MEDIASESSIONCLIENT_H_ -#define TALK_SESSION_MEDIA_MEDIASESSIONCLIENT_H_ - -#include -#include -#include -#include -#include "talk/base/messagequeue.h" -#include "talk/base/sigslot.h" -#include "talk/base/sigslotrepeater.h" -#include "talk/base/thread.h" -#include "talk/media/base/cryptoparams.h" -#include "talk/p2p/base/session.h" -#include "talk/p2p/base/sessionclient.h" -#include "talk/p2p/base/sessiondescription.h" -#include "talk/p2p/base/sessionmanager.h" -#include "talk/session/media/call.h" -#include "talk/session/media/channelmanager.h" -#include "talk/session/media/mediasession.h" - -namespace cricket { - -class Call; - -class MediaSessionClient : public SessionClient, public sigslot::has_slots<> { - public: -#if !defined(DISABLE_MEDIA_ENGINE_FACTORY) - MediaSessionClient(const buzz::Jid& jid, SessionManager *manager); -#endif - // Alternative constructor, allowing injection of media_engine - // and device_manager. - MediaSessionClient(const buzz::Jid& jid, SessionManager *manager, - MediaEngineInterface* media_engine, - DataEngineInterface* data_media_engine, - DeviceManagerInterface* device_manager); - ~MediaSessionClient(); - - const buzz::Jid &jid() const { return jid_; } - SessionManager* session_manager() const { return session_manager_; } - ChannelManager* channel_manager() const { return channel_manager_; } - - // Return mapping of call ids to Calls. - const std::map& calls() const { return calls_; } - - // The settings below combine with the settings on SessionManager to choose - - // whether SDES-SRTP, DTLS-SRTP, or no security should be used. The possible - // combinations are shown in the following table. Note that where either DTLS - // or SDES is possible, DTLS is preferred. Thus to require either SDES or - // DTLS, but not mandate DTLS, set SDES to require and DTLS to enable. - // - // | SDES:Disable | SDES:Enable | SDES:Require | - // ----------------------------------------------------------------| - // DTLS:Disable | No SRTP | SDES Optional | SDES Mandatory | - // DTLS:Enable | DTLS Optional | DTLS/SDES Opt | DTLS/SDES Mand | - // DTLS:Require | DTLS Mandatory | DTLS Mandatory | DTLS Mandatory | - - // Control use of SDES-SRTP. - SecurePolicy secure() const { return desc_factory_.secure(); } - void set_secure(SecurePolicy s) { desc_factory_.set_secure(s); } - - // Control use of multiple sessions in a call. - void set_multisession_enabled(bool multisession_enabled) { - multisession_enabled_ = multisession_enabled; - } - - int GetCapabilities() { return channel_manager_->GetCapabilities(); } - - Call *CreateCall(); - void DestroyCall(Call *call); - - Call *GetFocus(); - void SetFocus(Call *call); - - void JoinCalls(Call *call_to_join, Call *call); - - bool GetAudioInputDevices(std::vector* names) { - return channel_manager_->GetAudioInputDevices(names); - } - bool GetAudioOutputDevices(std::vector* names) { - return channel_manager_->GetAudioOutputDevices(names); - } - bool GetVideoCaptureDevices(std::vector* names) { - return channel_manager_->GetVideoCaptureDevices(names); - } - - bool SetAudioOptions(const std::string& in_name, const std::string& out_name, - const AudioOptions& options) { - return channel_manager_->SetAudioOptions(in_name, out_name, options); - } - bool SetOutputVolume(int level) { - return channel_manager_->SetOutputVolume(level); - } - bool SetCaptureDevice(const std::string& cam_device) { - return channel_manager_->SetCaptureDevice(cam_device); - } - - SessionDescription* CreateOffer(const CallOptions& options) { - return desc_factory_.CreateOffer(options, NULL); - } - SessionDescription* CreateAnswer(const SessionDescription* offer, - const CallOptions& options) { - return desc_factory_.CreateAnswer(offer, options, NULL); - } - - sigslot::signal2 SignalFocus; - sigslot::signal1 SignalCallCreate; - sigslot::signal1 SignalCallDestroy; - sigslot::repeater0<> SignalDevicesChange; - - virtual bool ParseContent(SignalingProtocol protocol, - const buzz::XmlElement* elem, - ContentDescription** content, - ParseError* error); - virtual bool IsWritable(SignalingProtocol protocol, - const ContentDescription* content); - virtual bool WriteContent(SignalingProtocol protocol, - const ContentDescription* content, - buzz::XmlElement** elem, - WriteError* error); - - private: - void Construct(); - void OnSessionCreate(Session *session, bool received_initiate); - void OnSessionState(BaseSession *session, BaseSession::State state); - void OnSessionDestroy(Session *session); - Session *CreateSession(Call *call); - Session *CreateSession(const std::string& id, Call* call); - Call *FindCallByRemoteName(const std::string &remote_name); - - buzz::Jid jid_; - SessionManager* session_manager_; - Call *focus_call_; - ChannelManager *channel_manager_; - MediaSessionDescriptionFactory desc_factory_; - bool multisession_enabled_; - std::map calls_; - - // Maintain a mapping of session id to call. - typedef std::map SessionMap; - SessionMap session_map_; - - friend class Call; -}; - -} // namespace cricket - -#endif // TALK_SESSION_MEDIA_MEDIASESSIONCLIENT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/session/media/mediasink.h b/thirdparties/common/include/webrtc-sdk/talk/session/media/mediasink.h deleted file mode 100755 index 82b1661..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/session/media/mediasink.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_SESSION_MEDIA_MEDIASINK_H_ -#define TALK_SESSION_MEDIA_MEDIASINK_H_ - -namespace cricket { - -// MediaSinkInterface is a sink to handle RTP and RTCP packets that are sent or -// received by a channel. -class MediaSinkInterface { - public: - virtual ~MediaSinkInterface() {} - - virtual void SetMaxSize(size_t size) = 0; - virtual bool Enable(bool enable) = 0; - virtual bool IsEnabled() const = 0; - virtual void OnPacket(const void* data, size_t size, bool rtcp) = 0; - virtual void set_packet_filter(int filter) = 0; -}; - -} // namespace cricket - -#endif // TALK_SESSION_MEDIA_MEDIASINK_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/session/media/rtcpmuxfilter.h b/thirdparties/common/include/webrtc-sdk/talk/session/media/rtcpmuxfilter.h deleted file mode 100755 index 9fd4d8b..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/session/media/rtcpmuxfilter.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_SESSION_MEDIA_RTCPMUXFILTER_H_ -#define TALK_SESSION_MEDIA_RTCPMUXFILTER_H_ - -#include "talk/base/basictypes.h" -#include "talk/p2p/base/sessiondescription.h" - -namespace cricket { - -// RTCP Muxer, as defined in RFC 5761 (http://tools.ietf.org/html/rfc5761) -class RtcpMuxFilter { - public: - RtcpMuxFilter(); - - // Whether the filter is active, i.e. has RTCP mux been properly negotiated. - bool IsActive() const; - - // Specifies whether the offer indicates the use of RTCP mux. - bool SetOffer(bool offer_enable, ContentSource src); - - // Specifies whether the provisional answer indicates the use of RTCP mux. - bool SetProvisionalAnswer(bool answer_enable, ContentSource src); - - // Specifies whether the answer indicates the use of RTCP mux. - bool SetAnswer(bool answer_enable, ContentSource src); - - // Determines whether the specified packet is RTCP. - bool DemuxRtcp(const char* data, int len); - - private: - bool ExpectOffer(bool offer_enable, ContentSource source); - bool ExpectAnswer(ContentSource source); - enum State { - // RTCP mux filter unused. - ST_INIT, - // Offer with RTCP mux enabled received. - // RTCP mux filter is not active. - ST_RECEIVEDOFFER, - // Offer with RTCP mux enabled sent. - // RTCP mux filter can demux incoming packets but is not active. - ST_SENTOFFER, - // RTCP mux filter is active but the sent answer is only provisional. - // When the final answer is set, the state transitions to ST_ACTIVE or - // ST_INIT. - ST_SENTPRANSWER, - // RTCP mux filter is active but the received answer is only provisional. - // When the final answer is set, the state transitions to ST_ACTIVE or - // ST_INIT. - ST_RECEIVEDPRANSWER, - // Offer and answer set, RTCP mux enabled. It is not possible to de-activate - // the filter. - ST_ACTIVE - }; - State state_; - bool offer_enable_; -}; - -} // namespace cricket - -#endif // TALK_SESSION_MEDIA_RTCPMUXFILTER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/session/media/soundclip.h b/thirdparties/common/include/webrtc-sdk/talk/session/media/soundclip.h deleted file mode 100755 index 1b3bbed..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/session/media/soundclip.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_SESSION_MEDIA_SOUNDCLIP_H_ -#define TALK_SESSION_MEDIA_SOUNDCLIP_H_ - -#include "talk/base/scoped_ptr.h" -#include "talk/media/base/mediaengine.h" - -namespace talk_base { - -class Thread; - -} - -namespace cricket { - -// Soundclip wraps SoundclipMedia to support marshalling calls to the proper -// thread. -class Soundclip : private talk_base::MessageHandler { - public: - Soundclip(talk_base::Thread* thread, SoundclipMedia* soundclip_media); - - // Plays a sound out to the speakers with the given audio stream. The stream - // must be 16-bit little-endian 16 kHz PCM. If a stream is already playing - // on this Soundclip, it is stopped. If clip is NULL, nothing is played. - // Returns whether it was successful. - bool PlaySound(const void* clip, - int len, - SoundclipMedia::SoundclipFlags flags); - - private: - bool PlaySound_w(const void* clip, - int len, - SoundclipMedia::SoundclipFlags flags); - - // From MessageHandler - virtual void OnMessage(talk_base::Message* message); - - talk_base::Thread* worker_thread_; - talk_base::scoped_ptr soundclip_media_; -}; - -} // namespace cricket - -#endif // TALK_SESSION_MEDIA_SOUNDCLIP_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/session/media/srtpfilter.h b/thirdparties/common/include/webrtc-sdk/talk/session/media/srtpfilter.h deleted file mode 100755 index 7318444..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/session/media/srtpfilter.h +++ /dev/null @@ -1,327 +0,0 @@ -/* - * libjingle - * Copyright 2009 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_SESSION_MEDIA_SRTPFILTER_H_ -#define TALK_SESSION_MEDIA_SRTPFILTER_H_ - -#include -#include -#include -#include - -#include "talk/base/basictypes.h" -#include "talk/base/scoped_ptr.h" -#include "talk/base/sigslotrepeater.h" -#include "talk/media/base/cryptoparams.h" -#include "talk/p2p/base/sessiondescription.h" - -// Forward declaration to avoid pulling in libsrtp headers here -struct srtp_event_data_t; -struct srtp_ctx_t; -typedef srtp_ctx_t* srtp_t; -struct srtp_policy_t; - -namespace cricket { - -// Cipher suite to use for SRTP. Typically a 80-bit HMAC will be used, except -// in applications (voice) where the additional bandwidth may be significant. -// A 80-bit HMAC is always used for SRTCP. -// 128-bit AES with 80-bit SHA-1 HMAC. -extern const char CS_AES_CM_128_HMAC_SHA1_80[]; -// 128-bit AES with 32-bit SHA-1 HMAC. -extern const char CS_AES_CM_128_HMAC_SHA1_32[]; -// Key is 128 bits and salt is 112 bits == 30 bytes. B64 bloat => 40 bytes. -extern const int SRTP_MASTER_KEY_BASE64_LEN; - -// Needed for DTLS-SRTP -extern const int SRTP_MASTER_KEY_KEY_LEN; -extern const int SRTP_MASTER_KEY_SALT_LEN; - -class SrtpSession; -class SrtpStat; - -void EnableSrtpDebugging(); -void ShutdownSrtp(); - -// Class to transform SRTP to/from RTP. -// Initialize by calling SetSend with the local security params, then call -// SetRecv once the remote security params are received. At that point -// Protect/UnprotectRt(c)p can be called to encrypt/decrypt data. -// TODO: Figure out concurrency policy for SrtpFilter. -class SrtpFilter { - public: - enum Mode { - PROTECT, - UNPROTECT - }; - enum Error { - ERROR_NONE, - ERROR_FAIL, - ERROR_AUTH, - ERROR_REPLAY, - }; - - SrtpFilter(); - ~SrtpFilter(); - - // Whether the filter is active (i.e. crypto has been properly negotiated). - bool IsActive() const; - - // Indicates which crypto algorithms and keys were contained in the offer. - // offer_params should contain a list of available parameters to use, or none, - // if crypto is not desired. This must be called before SetAnswer. - bool SetOffer(const std::vector& offer_params, - ContentSource source); - // Same as SetAnwer. But multiple calls are allowed to SetProvisionalAnswer - // after a call to SetOffer. - bool SetProvisionalAnswer(const std::vector& answer_params, - ContentSource source); - // Indicates which crypto algorithms and keys were contained in the answer. - // answer_params should contain the negotiated parameters, which may be none, - // if crypto was not desired or could not be negotiated (and not required). - // This must be called after SetOffer. If crypto negotiation completes - // successfully, this will advance the filter to the active state. - bool SetAnswer(const std::vector& answer_params, - ContentSource source); - - // Just set up both sets of keys directly. - // Used with DTLS-SRTP. - bool SetRtpParams(const std::string& send_cs, - const uint8* send_key, int send_key_len, - const std::string& recv_cs, - const uint8* recv_key, int recv_key_len); - bool SetRtcpParams(const std::string& send_cs, - const uint8* send_key, int send_key_len, - const std::string& recv_cs, - const uint8* recv_key, int recv_key_len); - - // Encrypts/signs an individual RTP/RTCP packet, in-place. - // If an HMAC is used, this will increase the packet size. - bool ProtectRtp(void* data, int in_len, int max_len, int* out_len); - // Overloaded version, outputs packet index. - bool ProtectRtp(void* data, int in_len, int max_len, int* out_len, - int64* index); - bool ProtectRtcp(void* data, int in_len, int max_len, int* out_len); - // Decrypts/verifies an invidiual RTP/RTCP packet. - // If an HMAC is used, this will decrease the packet size. - bool UnprotectRtp(void* data, int in_len, int* out_len); - bool UnprotectRtcp(void* data, int in_len, int* out_len); - - // Returns rtp auth params from srtp context. - bool GetRtpAuthParams(uint8** key, int* key_len, int* tag_len); - - // Update the silent threshold (in ms) for signaling errors. - void set_signal_silent_time(uint32 signal_silent_time_in_ms); - - sigslot::repeater3 SignalSrtpError; - - protected: - bool ExpectOffer(ContentSource source); - bool StoreParams(const std::vector& params, - ContentSource source); - bool ExpectAnswer(ContentSource source); - bool DoSetAnswer(const std::vector& answer_params, - ContentSource source, - bool final); - void CreateSrtpSessions(); - bool NegotiateParams(const std::vector& answer_params, - CryptoParams* selected_params); - bool ApplyParams(const CryptoParams& send_params, - const CryptoParams& recv_params); - bool ResetParams(); - static bool ParseKeyParams(const std::string& params, uint8* key, int len); - - private: - enum State { - ST_INIT, // SRTP filter unused. - ST_SENTOFFER, // Offer with SRTP parameters sent. - ST_RECEIVEDOFFER, // Offer with SRTP parameters received. - ST_SENTPRANSWER_NO_CRYPTO, // Sent provisional answer without crypto. - // Received provisional answer without crypto. - ST_RECEIVEDPRANSWER_NO_CRYPTO, - ST_ACTIVE, // Offer and answer set. - // SRTP filter is active but new parameters are offered. - // When the answer is set, the state transitions to ST_ACTIVE or ST_INIT. - ST_SENTUPDATEDOFFER, - // SRTP filter is active but new parameters are received. - // When the answer is set, the state transitions back to ST_ACTIVE. - ST_RECEIVEDUPDATEDOFFER, - // SRTP filter is active but the sent answer is only provisional. - // When the final answer is set, the state transitions to ST_ACTIVE or - // ST_INIT. - ST_SENTPRANSWER, - // SRTP filter is active but the received answer is only provisional. - // When the final answer is set, the state transitions to ST_ACTIVE or - // ST_INIT. - ST_RECEIVEDPRANSWER - }; - State state_; - uint32 signal_silent_time_in_ms_; - std::vector offer_params_; - talk_base::scoped_ptr send_session_; - talk_base::scoped_ptr recv_session_; - talk_base::scoped_ptr send_rtcp_session_; - talk_base::scoped_ptr recv_rtcp_session_; - CryptoParams applied_send_params_; - CryptoParams applied_recv_params_; -}; - -// Class that wraps a libSRTP session. -class SrtpSession { - public: - SrtpSession(); - ~SrtpSession(); - - // Configures the session for sending data using the specified - // cipher-suite and key. Receiving must be done by a separate session. - bool SetSend(const std::string& cs, const uint8* key, int len); - // Configures the session for receiving data using the specified - // cipher-suite and key. Sending must be done by a separate session. - bool SetRecv(const std::string& cs, const uint8* key, int len); - - // Encrypts/signs an individual RTP/RTCP packet, in-place. - // If an HMAC is used, this will increase the packet size. - bool ProtectRtp(void* data, int in_len, int max_len, int* out_len); - // Overloaded version, outputs packet index. - bool ProtectRtp(void* data, int in_len, int max_len, int* out_len, - int64* index); - bool ProtectRtcp(void* data, int in_len, int max_len, int* out_len); - // Decrypts/verifies an invidiual RTP/RTCP packet. - // If an HMAC is used, this will decrease the packet size. - bool UnprotectRtp(void* data, int in_len, int* out_len); - bool UnprotectRtcp(void* data, int in_len, int* out_len); - - // Helper method to get authentication params. - bool GetRtpAuthParams(uint8** key, int* key_len, int* tag_len); - - // Update the silent threshold (in ms) for signaling errors. - void set_signal_silent_time(uint32 signal_silent_time_in_ms); - - // Calls srtp_shutdown if it's initialized. - static void Terminate(); - - sigslot::repeater3 - SignalSrtpError; - - private: - bool SetKey(int type, const std::string& cs, const uint8* key, int len); - // Returns send stream current packet index from srtp db. - bool GetSendStreamPacketIndex(void* data, int in_len, int64* index); - - static bool Init(); - void HandleEvent(const srtp_event_data_t* ev); - static void HandleEventThunk(srtp_event_data_t* ev); - - static std::list* sessions(); - - srtp_t session_; - int rtp_auth_tag_len_; - int rtcp_auth_tag_len_; - talk_base::scoped_ptr srtp_stat_; - static bool inited_; - int last_send_seq_num_; - DISALLOW_COPY_AND_ASSIGN(SrtpSession); -}; - -// Class that collects failures of SRTP. -class SrtpStat { - public: - SrtpStat(); - - // Report RTP protection results to the handler. - void AddProtectRtpResult(uint32 ssrc, int result); - // Report RTP unprotection results to the handler. - void AddUnprotectRtpResult(uint32 ssrc, int result); - // Report RTCP protection results to the handler. - void AddProtectRtcpResult(int result); - // Report RTCP unprotection results to the handler. - void AddUnprotectRtcpResult(int result); - - // Get silent time (in ms) for SRTP statistics handler. - uint32 signal_silent_time() const { return signal_silent_time_; } - // Set silent time (in ms) for SRTP statistics handler. - void set_signal_silent_time(uint32 signal_silent_time) { - signal_silent_time_ = signal_silent_time; - } - - // Sigslot for reporting errors. - sigslot::signal3 - SignalSrtpError; - - private: - // For each different ssrc and error, we collect statistics separately. - struct FailureKey { - FailureKey() - : ssrc(0), - mode(SrtpFilter::PROTECT), - error(SrtpFilter::ERROR_NONE) { - } - FailureKey(uint32 in_ssrc, SrtpFilter::Mode in_mode, - SrtpFilter::Error in_error) - : ssrc(in_ssrc), - mode(in_mode), - error(in_error) { - } - bool operator <(const FailureKey& key) const { - return - (ssrc < key.ssrc) || - (ssrc == key.ssrc && mode < key.mode) || - (ssrc == key.ssrc && mode == key.mode && error < key.error); - } - uint32 ssrc; - SrtpFilter::Mode mode; - SrtpFilter::Error error; - }; - // For tracing conditions for signaling, currently we only use - // last_signal_time. Wrap this as a struct so that later on, if we need any - // other improvements, it will be easier. - struct FailureStat { - FailureStat() - : last_signal_time(0) { - } - explicit FailureStat(uint32 in_last_signal_time) - : last_signal_time(in_last_signal_time) { - } - void Reset() { - last_signal_time = 0; - } - uint32 last_signal_time; - }; - - // Inspect SRTP result and signal error if needed. - void HandleSrtpResult(const FailureKey& key); - - std::map failures_; - // Threshold in ms to silent the signaling errors. - uint32 signal_silent_time_; - - DISALLOW_COPY_AND_ASSIGN(SrtpStat); -}; - -} // namespace cricket - -#endif // TALK_SESSION_MEDIA_SRTPFILTER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/session/media/typingmonitor.h b/thirdparties/common/include/webrtc-sdk/talk/session/media/typingmonitor.h deleted file mode 100755 index c970094..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/session/media/typingmonitor.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * libjingle - * Copyright 2004 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_SESSION_MEDIA_TYPINGMONITOR_H_ -#define TALK_SESSION_MEDIA_TYPINGMONITOR_H_ - -#include "talk/base/messagehandler.h" -#include "talk/media/base/mediachannel.h" - -namespace talk_base { -class Thread; -} - -namespace cricket { - -class VoiceChannel; -class BaseChannel; - -struct TypingMonitorOptions { - int cost_per_typing; - int mute_period; - int penalty_decay; - int reporting_threshold; - int time_window; - int type_event_delay; - size_t min_participants; -}; - -/** - * An object that observes a channel and listens for typing detection warnings, - * which can be configured to mute audio capture of that channel for some period - * of time. The purpose is to automatically mute someone if they are disturbing - * a conference with loud keystroke audio signals. - */ -class TypingMonitor - : public talk_base::MessageHandler, public sigslot::has_slots<> { - public: - TypingMonitor(VoiceChannel* channel, talk_base::Thread* worker_thread, - const TypingMonitorOptions& params); - ~TypingMonitor(); - - sigslot::signal2 SignalMuted; - - void OnChannelMuted(); - - private: - void OnVoiceChannelError(uint32 ssrc, VoiceMediaChannel::Error error); - void OnMessage(talk_base::Message* msg); - - VoiceChannel* channel_; - talk_base::Thread* worker_thread_; - int mute_period_; - int muted_at_; - bool has_pending_unmute_; -}; - -} // namespace cricket - -#endif // TALK_SESSION_MEDIA_TYPINGMONITOR_H_ - diff --git a/thirdparties/common/include/webrtc-sdk/talk/session/media/voicechannel.h b/thirdparties/common/include/webrtc-sdk/talk/session/media/voicechannel.h deleted file mode 100755 index 114ce9d..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/session/media/voicechannel.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * libjingle - * Copyright 2004 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 _VOICECHANNEL_H_ -#define _VOICECHANNEL_H_ - -#include "talk/session/media/channel.h" - -#endif // _VOICECHANNEL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/session/tunnel/pseudotcpchannel.h b/thirdparties/common/include/webrtc-sdk/talk/session/tunnel/pseudotcpchannel.h deleted file mode 100755 index a2e1261..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/session/tunnel/pseudotcpchannel.h +++ /dev/null @@ -1,140 +0,0 @@ -/* - * libjingle - * Copyright 2004--2006, 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_SESSION_TUNNEL_PSEUDOTCPCHANNEL_H_ -#define TALK_SESSION_TUNNEL_PSEUDOTCPCHANNEL_H_ - -#include "talk/base/criticalsection.h" -#include "talk/base/messagequeue.h" -#include "talk/base/stream.h" -#include "talk/p2p/base/pseudotcp.h" -#include "talk/p2p/base/session.h" - -namespace talk_base { -class Thread; -} - -namespace cricket { - -class Candidate; -class TransportChannel; - -/////////////////////////////////////////////////////////////////////////////// -// PseudoTcpChannel -// Note: The PseudoTcpChannel must persist until both of: -// 1) The StreamInterface provided via GetStream has been closed. -// This is tracked via non-null stream_. -// 2) The PseudoTcp session has completed. -// This is tracked via non-null worker_thread_. When PseudoTcp is done, -// the TransportChannel is signalled to tear-down. Once the channel is -// torn down, the worker thread is purged. -// These indicators are checked by CheckDestroy, invoked whenever one of them -// changes. -/////////////////////////////////////////////////////////////////////////////// -// PseudoTcpChannel::GetStream -// Note: The stream pointer returned by GetStream is owned by the caller. -// They can close & immediately delete the stream while PseudoTcpChannel still -// has cleanup work to do. They can also close the stream but not delete it -// until long after PseudoTcpChannel has finished. We must cope with both. -/////////////////////////////////////////////////////////////////////////////// - -class PseudoTcpChannel - : public IPseudoTcpNotify, - public talk_base::MessageHandler, - public sigslot::has_slots<> { - public: - // Signal thread methods - PseudoTcpChannel(talk_base::Thread* stream_thread, - Session* session); - - bool Connect(const std::string& content_name, - const std::string& channel_name, - int component); - talk_base::StreamInterface* GetStream(); - - sigslot::signal1 SignalChannelClosed; - - // Call this when the Session used to create this channel is being torn - // down, to ensure that things get cleaned up properly. - void OnSessionTerminate(Session* session); - - // See the PseudoTcp class for available options. - void GetOption(PseudoTcp::Option opt, int* value); - void SetOption(PseudoTcp::Option opt, int value); - - private: - class InternalStream; - friend class InternalStream; - - virtual ~PseudoTcpChannel(); - - // Stream thread methods - talk_base::StreamState GetState() const; - talk_base::StreamResult Read(void* buffer, size_t buffer_len, - size_t* read, int* error); - talk_base::StreamResult Write(const void* data, size_t data_len, - size_t* written, int* error); - void Close(); - - // Multi-thread methods - void OnMessage(talk_base::Message* pmsg); - void AdjustClock(bool clear = true); - void CheckDestroy(); - - // Signal thread methods - void OnChannelDestroyed(TransportChannel* channel); - - // Worker thread methods - void OnChannelWritableState(TransportChannel* channel); - void OnChannelRead(TransportChannel* channel, const char* data, size_t size, - const talk_base::PacketTime& packet_time, int flags); - void OnChannelConnectionChanged(TransportChannel* channel, - const Candidate& candidate); - - virtual void OnTcpOpen(PseudoTcp* ptcp); - virtual void OnTcpReadable(PseudoTcp* ptcp); - virtual void OnTcpWriteable(PseudoTcp* ptcp); - virtual void OnTcpClosed(PseudoTcp* ptcp, uint32 nError); - virtual IPseudoTcpNotify::WriteResult TcpWritePacket(PseudoTcp* tcp, - const char* buffer, - size_t len); - - talk_base::Thread* signal_thread_, * worker_thread_, * stream_thread_; - Session* session_; - TransportChannel* channel_; - std::string content_name_; - std::string channel_name_; - PseudoTcp* tcp_; - InternalStream* stream_; - bool stream_readable_, pending_read_event_; - bool ready_to_connect_; - mutable talk_base::CriticalSection cs_; -}; - -} // namespace cricket - -#endif // TALK_SESSION_TUNNEL_PSEUDOTCPCHANNEL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/session/tunnel/securetunnelsessionclient.h b/thirdparties/common/include/webrtc-sdk/talk/session/tunnel/securetunnelsessionclient.h deleted file mode 100755 index ce3bb21..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/session/tunnel/securetunnelsessionclient.h +++ /dev/null @@ -1,165 +0,0 @@ -/* - * libjingle - * Copyright 2004--2008, 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. - */ - -// SecureTunnelSessionClient and SecureTunnelSession. -// SecureTunnelSessionClient extends TunnelSessionClient to exchange -// certificates as part of the session description. -// SecureTunnelSession is a TunnelSession that wraps the underlying -// tunnel stream into an SSLStreamAdapter. - -#ifndef TALK_SESSION_TUNNEL_SECURETUNNELSESSIONCLIENT_H_ -#define TALK_SESSION_TUNNEL_SECURETUNNELSESSIONCLIENT_H_ - -#include - -#include "talk/base/sslidentity.h" -#include "talk/base/sslstreamadapter.h" -#include "talk/session/tunnel/tunnelsessionclient.h" - -namespace cricket { - -class SecureTunnelSession; // below - -// SecureTunnelSessionClient - -// This TunnelSessionClient establishes secure tunnels protected by -// SSL/TLS. The PseudoTcpChannel stream is wrapped with an -// SSLStreamAdapter. An SSLIdentity must be set or generated. -// -// The TunnelContentDescription is extended to include the client and -// server certificates. The initiator acts as the client. The session -// initiate stanza carries a description that contains the client's -// certificate, and the session accept response's description has the -// server certificate added to it. - -class SecureTunnelSessionClient : public TunnelSessionClient { - public: - // The jid is used as the name for sessions for outgoing tunnels. - // manager is the SessionManager to which we register this client - // and its sessions. - SecureTunnelSessionClient(const buzz::Jid& jid, SessionManager* manager); - - // Configures this client to use a preexisting SSLIdentity. - // The client takes ownership of the identity object. - // Use either SetIdentity or GenerateIdentity, and only once. - void SetIdentity(talk_base::SSLIdentity* identity); - - // Generates an identity from nothing. - // Returns true if generation was successful. - // Use either SetIdentity or GenerateIdentity, and only once. - bool GenerateIdentity(); - - // Returns our identity for SSL purposes, as either set by - // SetIdentity() or generated by GenerateIdentity(). Call this - // method only after our identity has been successfully established - // by one of those methods. - talk_base::SSLIdentity& GetIdentity() const; - - // Inherited methods - virtual void OnIncomingTunnel(const buzz::Jid& jid, Session *session); - virtual bool ParseContent(SignalingProtocol protocol, - const buzz::XmlElement* elem, - ContentDescription** content, - ParseError* error); - virtual bool WriteContent(SignalingProtocol protocol, - const ContentDescription* content, - buzz::XmlElement** elem, - WriteError* error); - virtual SessionDescription* CreateOffer( - const buzz::Jid &jid, const std::string &description); - virtual SessionDescription* CreateAnswer( - const SessionDescription* offer); - - protected: - virtual TunnelSession* MakeTunnelSession( - Session* session, talk_base::Thread* stream_thread, - TunnelSessionRole role); - - private: - // Our identity (key and certificate) for SSL purposes. The - // certificate part will be communicated within the session - // description. The identity will be passed to the SSLStreamAdapter - // and used for SSL authentication. - talk_base::scoped_ptr identity_; - - DISALLOW_EVIL_CONSTRUCTORS(SecureTunnelSessionClient); -}; - -// SecureTunnelSession: -// A TunnelSession represents one session for one client. It -// provides the actual tunnel stream and handles state changes. -// A SecureTunnelSession is a TunnelSession that wraps the underlying -// tunnel stream into an SSLStreamAdapter. - -class SecureTunnelSession : public TunnelSession { - public: - // This TunnelSession will tie together the given client and session. - // stream_thread is passed to the PseudoTCPChannel: it's the thread - // designated to interact with the tunnel stream. - // role is either INITIATOR or RESPONDER, depending on who is - // initiating the session. - SecureTunnelSession(SecureTunnelSessionClient* client, Session* session, - talk_base::Thread* stream_thread, - TunnelSessionRole role); - - // Returns the stream that implements the actual P2P tunnel. - // This may be called only once. Caller is responsible for freeing - // the returned object. - virtual talk_base::StreamInterface* GetStream(); - - protected: - // Inherited method: callback on accepting a session. - virtual void OnAccept(); - - // Helper method for GetStream() that Instantiates the - // SSLStreamAdapter to wrap the PseudoTcpChannel's stream, and - // configures it with our identity and role. - talk_base::StreamInterface* MakeSecureStream( - talk_base::StreamInterface* stream); - - // Our role in requesting the tunnel: INITIATOR or - // RESPONDER. Translates to our role in SSL negotiation: - // respectively client or server. Also indicates which slot of the - // SecureTunnelContentDescription our cert goes into: client-cert or - // server-cert respectively. - TunnelSessionRole role_; - - // This is the stream representing the usable tunnel endpoint. It's - // a StreamReference wrapping the SSLStreamAdapter instance, which - // further wraps a PseudoTcpChannel::InternalStream. The - // StreamReference is because in the case of CreateTunnel(), the - // stream endpoint is returned early, but we need to keep a handle - // on it so we can setup the peer certificate when we receive it - // later. - talk_base::scoped_ptr ssl_stream_reference_; - - DISALLOW_EVIL_CONSTRUCTORS(SecureTunnelSession); -}; - -} // namespace cricket - -#endif // TALK_SESSION_TUNNEL_SECURETUNNELSESSIONCLIENT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/session/tunnel/tunnelsessionclient.h b/thirdparties/common/include/webrtc-sdk/talk/session/tunnel/tunnelsessionclient.h deleted file mode 100755 index 8fec2cc..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/session/tunnel/tunnelsessionclient.h +++ /dev/null @@ -1,182 +0,0 @@ -/* - * libjingle - * Copyright 2004--2008, 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 __TUNNELSESSIONCLIENT_H__ -#define __TUNNELSESSIONCLIENT_H__ - -#include - -#include "talk/base/criticalsection.h" -#include "talk/base/stream.h" -#include "talk/p2p/base/constants.h" -#include "talk/p2p/base/pseudotcp.h" -#include "talk/p2p/base/session.h" -#include "talk/p2p/base/sessiondescription.h" -#include "talk/p2p/base/sessionmanager.h" -#include "talk/p2p/base/sessionclient.h" -#include "talk/xmllite/qname.h" -#include "talk/xmpp/constants.h" - -namespace cricket { - -class TunnelSession; -class TunnelStream; - -enum TunnelSessionRole { INITIATOR, RESPONDER }; - -/////////////////////////////////////////////////////////////////////////////// -// TunnelSessionClient -/////////////////////////////////////////////////////////////////////////////// - -// Base class is still abstract -class TunnelSessionClientBase - : public SessionClient, public talk_base::MessageHandler { -public: - TunnelSessionClientBase(const buzz::Jid& jid, SessionManager* manager, - const std::string &ns); - virtual ~TunnelSessionClientBase(); - - const buzz::Jid& jid() const { return jid_; } - SessionManager* session_manager() const { return session_manager_; } - - void OnSessionCreate(Session* session, bool received); - void OnSessionDestroy(Session* session); - - // This can be called on any thread. The stream interface is - // thread-safe, but notifications must be registered on the creating - // thread. - talk_base::StreamInterface* CreateTunnel(const buzz::Jid& to, - const std::string& description); - - talk_base::StreamInterface* AcceptTunnel(Session* session); - void DeclineTunnel(Session* session); - - // Invoked on an incoming tunnel - virtual void OnIncomingTunnel(const buzz::Jid &jid, Session *session) = 0; - - // Invoked on an outgoing session request - virtual SessionDescription* CreateOffer( - const buzz::Jid &jid, const std::string &description) = 0; - // Invoked on a session request accept to create - // the local-side session description - virtual SessionDescription* CreateAnswer( - const SessionDescription* offer) = 0; - -protected: - - void OnMessage(talk_base::Message* pmsg); - - // helper method to instantiate TunnelSession. By overriding this, - // subclasses of TunnelSessionClient are able to instantiate - // subclasses of TunnelSession instead. - virtual TunnelSession* MakeTunnelSession(Session* session, - talk_base::Thread* stream_thread, - TunnelSessionRole role); - - buzz::Jid jid_; - SessionManager* session_manager_; - std::vector sessions_; - std::string namespace_; - bool shutdown_; -}; - -class TunnelSessionClient - : public TunnelSessionClientBase, public sigslot::has_slots<> { -public: - TunnelSessionClient(const buzz::Jid& jid, SessionManager* manager); - TunnelSessionClient(const buzz::Jid& jid, SessionManager* manager, - const std::string &ns); - virtual ~TunnelSessionClient(); - - virtual bool ParseContent(SignalingProtocol protocol, - const buzz::XmlElement* elem, - ContentDescription** content, - ParseError* error); - virtual bool WriteContent(SignalingProtocol protocol, - const ContentDescription* content, - buzz::XmlElement** elem, - WriteError* error); - - // Signal arguments are this, initiator, description, session - sigslot::signal4 - SignalIncomingTunnel; - - virtual void OnIncomingTunnel(const buzz::Jid &jid, - Session *session); - virtual SessionDescription* CreateOffer( - const buzz::Jid &jid, const std::string &description); - virtual SessionDescription* CreateAnswer( - const SessionDescription* offer); -}; - -/////////////////////////////////////////////////////////////////////////////// -// TunnelSession -// Note: The lifetime of TunnelSession is complicated. It needs to survive -// until the following three conditions are true: -// 1) TunnelStream has called Close (tracked via non-null stream_) -// 2) PseudoTcp has completed (tracked via non-null tcp_) -// 3) Session has been destroyed (tracked via non-null session_) -// This is accomplished by calling CheckDestroy after these indicators change. -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -// TunnelStream -// Note: Because TunnelStream provides a stream interface, its lifetime is -// controlled by the owner of the stream pointer. As a result, we must support -// both the TunnelSession disappearing before TunnelStream, and vice versa. -/////////////////////////////////////////////////////////////////////////////// - -class PseudoTcpChannel; - -class TunnelSession : public sigslot::has_slots<> { - public: - // Signalling thread methods - TunnelSession(TunnelSessionClientBase* client, Session* session, - talk_base::Thread* stream_thread); - - virtual talk_base::StreamInterface* GetStream(); - bool HasSession(Session* session); - Session* ReleaseSession(bool channel_exists); - - protected: - virtual ~TunnelSession(); - - virtual void OnSessionState(BaseSession* session, BaseSession::State state); - virtual void OnInitiate(); - virtual void OnAccept(); - virtual void OnTerminate(); - virtual void OnChannelClosed(PseudoTcpChannel* channel); - - TunnelSessionClientBase* client_; - Session* session_; - PseudoTcpChannel* channel_; -}; - -/////////////////////////////////////////////////////////////////////////////// - -} // namespace cricket - -#endif // __TUNNELSESSIONCLIENT_H__ diff --git a/thirdparties/common/include/webrtc-sdk/talk/sound/alsasoundsystem.h b/thirdparties/common/include/webrtc-sdk/talk/sound/alsasoundsystem.h deleted file mode 100755 index da9f535..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/sound/alsasoundsystem.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_SOUND_ALSASOUNDSYSTEM_H_ -#define TALK_SOUND_ALSASOUNDSYSTEM_H_ - -#include "talk/base/constructormagic.h" -#include "talk/sound/alsasymboltable.h" -#include "talk/sound/soundsysteminterface.h" - -namespace cricket { - -class AlsaStream; -class AlsaInputStream; -class AlsaOutputStream; - -// Sound system implementation for ALSA, the predominant sound device API on -// Linux (but typically not used directly by applications anymore). -class AlsaSoundSystem : public SoundSystemInterface { - friend class AlsaStream; - friend class AlsaInputStream; - friend class AlsaOutputStream; - public: - static SoundSystemInterface *Create() { - return new AlsaSoundSystem(); - } - - AlsaSoundSystem(); - - virtual ~AlsaSoundSystem(); - - virtual bool Init(); - virtual void Terminate(); - - virtual bool EnumeratePlaybackDevices(SoundDeviceLocatorList *devices); - virtual bool EnumerateCaptureDevices(SoundDeviceLocatorList *devices); - - virtual bool GetDefaultPlaybackDevice(SoundDeviceLocator **device); - virtual bool GetDefaultCaptureDevice(SoundDeviceLocator **device); - - virtual SoundOutputStreamInterface *OpenPlaybackDevice( - const SoundDeviceLocator *device, - const OpenParams ¶ms); - virtual SoundInputStreamInterface *OpenCaptureDevice( - const SoundDeviceLocator *device, - const OpenParams ¶ms); - - virtual const char *GetName() const; - - private: - bool IsInitialized() { return initialized_; } - - bool EnumerateDevices(SoundDeviceLocatorList *devices, - bool capture_not_playback); - - bool GetDefaultDevice(SoundDeviceLocator **device); - - static size_t FrameSize(const OpenParams ¶ms); - - template - StreamInterface *OpenDevice( - const SoundDeviceLocator *device, - const OpenParams ¶ms, - snd_pcm_stream_t type, - StreamInterface *(AlsaSoundSystem::*start_fn)( - snd_pcm_t *handle, - size_t frame_size, - int wait_timeout_ms, - int flags, - int freq)); - - SoundOutputStreamInterface *StartOutputStream( - snd_pcm_t *handle, - size_t frame_size, - int wait_timeout_ms, - int flags, - int freq); - - SoundInputStreamInterface *StartInputStream( - snd_pcm_t *handle, - size_t frame_size, - int wait_timeout_ms, - int flags, - int freq); - - const char *GetError(int err); - - bool initialized_; - AlsaSymbolTable symbol_table_; - - DISALLOW_COPY_AND_ASSIGN(AlsaSoundSystem); -}; - -} // namespace cricket - -#endif // TALK_SOUND_ALSASOUNDSYSTEM_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/sound/alsasymboltable.h b/thirdparties/common/include/webrtc-sdk/talk/sound/alsasymboltable.h deleted file mode 100755 index fc6a21f..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/sound/alsasymboltable.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_SOUND_ALSASYMBOLTABLE_H_ -#define TALK_SOUND_ALSASYMBOLTABLE_H_ - -#include - -#include "talk/base/latebindingsymboltable.h" - -namespace cricket { - -#define ALSA_SYMBOLS_CLASS_NAME AlsaSymbolTable -// The ALSA symbols we need, as an X-Macro list. -// This list must contain precisely every libasound function that is used in -// alsasoundsystem.cc. -#define ALSA_SYMBOLS_LIST \ - X(snd_device_name_free_hint) \ - X(snd_device_name_get_hint) \ - X(snd_device_name_hint) \ - X(snd_pcm_avail_update) \ - X(snd_pcm_close) \ - X(snd_pcm_delay) \ - X(snd_pcm_drop) \ - X(snd_pcm_open) \ - X(snd_pcm_prepare) \ - X(snd_pcm_readi) \ - X(snd_pcm_recover) \ - X(snd_pcm_set_params) \ - X(snd_pcm_start) \ - X(snd_pcm_stream) \ - X(snd_pcm_wait) \ - X(snd_pcm_writei) \ - X(snd_strerror) - -#define LATE_BINDING_SYMBOL_TABLE_CLASS_NAME ALSA_SYMBOLS_CLASS_NAME -#define LATE_BINDING_SYMBOL_TABLE_SYMBOLS_LIST ALSA_SYMBOLS_LIST -#include "talk/base/latebindingsymboltable.h.def" - -} // namespace cricket - -#endif // TALK_SOUND_ALSASYMBOLTABLE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/sound/automaticallychosensoundsystem.h b/thirdparties/common/include/webrtc-sdk/talk/sound/automaticallychosensoundsystem.h deleted file mode 100755 index 7371e19..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/sound/automaticallychosensoundsystem.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_SOUND_AUTOMATICALLYCHOSENSOUNDSYSTEM_H_ -#define TALK_SOUND_AUTOMATICALLYCHOSENSOUNDSYSTEM_H_ - -#include "talk/base/common.h" -#include "talk/base/logging.h" -#include "talk/base/scoped_ptr.h" -#include "talk/sound/soundsysteminterface.h" -#include "talk/sound/soundsystemproxy.h" - -namespace cricket { - -// A function type that creates an instance of a sound system implementation. -typedef SoundSystemInterface *(*SoundSystemCreator)(); - -// An AutomaticallyChosenSoundSystem is a sound system proxy that defers to -// an instance of the first sound system implementation in a list that -// successfully initializes. -template -class AutomaticallyChosenSoundSystem : public SoundSystemProxy { - public: - // Chooses and initializes the underlying sound system. - virtual bool Init(); - // Terminates the underlying sound system implementation, but caches it for - // future re-use. - virtual void Terminate(); - - virtual const char *GetName() const; - - private: - talk_base::scoped_ptr sound_systems_[kNumSoundSystems]; -}; - -template -bool AutomaticallyChosenSoundSystem::Init() { - if (wrapped_) { - return true; - } - for (int i = 0; i < kNumSoundSystems; ++i) { - if (!sound_systems_[i].get()) { - sound_systems_[i].reset((*kSoundSystemCreators[i])()); - } - if (sound_systems_[i]->Init()) { - // This is the first sound system in the list to successfully - // initialize, so we're done. - wrapped_ = sound_systems_[i].get(); - break; - } - // Else it failed to initialize, so try the remaining ones. - } - if (!wrapped_) { - LOG(LS_ERROR) << "Failed to find a usable sound system"; - return false; - } - LOG(LS_INFO) << "Selected " << wrapped_->GetName() << " sound system"; - return true; -} - -template -void AutomaticallyChosenSoundSystem::Terminate() { - if (!wrapped_) { - return; - } - wrapped_->Terminate(); - wrapped_ = NULL; - // We do not free the scoped_ptrs because we may be re-init'ed soon. -} - -template -const char *AutomaticallyChosenSoundSystem::GetName() const { - return wrapped_ ? wrapped_->GetName() : "automatic"; -} - -} // namespace cricket - -#endif // TALK_SOUND_AUTOMATICALLYCHOSENSOUNDSYSTEM_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/sound/linuxsoundsystem.h b/thirdparties/common/include/webrtc-sdk/talk/sound/linuxsoundsystem.h deleted file mode 100755 index 160a671..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/sound/linuxsoundsystem.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_SOUND_LINUXSOUNDSYSTEM_H_ -#define TALK_SOUND_LINUXSOUNDSYSTEM_H_ - -#include "talk/sound/automaticallychosensoundsystem.h" - -namespace cricket { - -extern const SoundSystemCreator kLinuxSoundSystemCreators[ -#ifdef HAVE_LIBPULSE - 2 -#else - 1 -#endif - ]; - -// The vast majority of Linux systems use ALSA for the device-level sound API, -// but an increasing number are using PulseAudio for the application API and -// only using ALSA internally in PulseAudio itself. But like everything on -// Linux this is user-configurable, so we need to support both and choose the -// right one at run-time. -// PulseAudioSoundSystem is designed to only successfully initialize if -// PulseAudio is installed and running, and if it is running then direct device -// access using ALSA typically won't work, so if PulseAudioSoundSystem -// initializes then we choose that. Otherwise we choose ALSA. -typedef AutomaticallyChosenSoundSystem< - kLinuxSoundSystemCreators, - ARRAY_SIZE(kLinuxSoundSystemCreators)> LinuxSoundSystem; - -} // namespace cricket - -#endif // TALK_SOUND_LINUXSOUNDSYSTEM_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/sound/nullsoundsystem.h b/thirdparties/common/include/webrtc-sdk/talk/sound/nullsoundsystem.h deleted file mode 100755 index 705012c..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/sound/nullsoundsystem.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_SOUND_NULLSOUNDSYSTEM_H_ -#define TALK_SOUND_NULLSOUNDSYSTEM_H_ - -#include "talk/sound/soundsysteminterface.h" - -namespace cricket { - -class SoundDeviceLocator; -class SoundInputStreamInterface; -class SoundOutputStreamInterface; - -// A simple reference sound system that drops output samples and generates -// no input samples. -class NullSoundSystem : public SoundSystemInterface { - public: - static SoundSystemInterface *Create() { - return new NullSoundSystem(); - } - - virtual ~NullSoundSystem(); - - virtual bool Init(); - virtual void Terminate(); - - virtual bool EnumeratePlaybackDevices(SoundDeviceLocatorList *devices); - virtual bool EnumerateCaptureDevices(SoundDeviceLocatorList *devices); - - virtual SoundOutputStreamInterface *OpenPlaybackDevice( - const SoundDeviceLocator *device, - const OpenParams ¶ms); - virtual SoundInputStreamInterface *OpenCaptureDevice( - const SoundDeviceLocator *device, - const OpenParams ¶ms); - - virtual bool GetDefaultPlaybackDevice(SoundDeviceLocator **device); - virtual bool GetDefaultCaptureDevice(SoundDeviceLocator **device); - - virtual const char *GetName() const; -}; - -} // namespace cricket - -#endif // TALK_SOUND_NULLSOUNDSYSTEM_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/sound/nullsoundsystemfactory.h b/thirdparties/common/include/webrtc-sdk/talk/sound/nullsoundsystemfactory.h deleted file mode 100755 index 2a6dd37..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/sound/nullsoundsystemfactory.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_SOUND_NULLSOUNDSYSTEMFACTORY_H_ -#define TALK_SOUND_NULLSOUNDSYSTEMFACTORY_H_ - -#include "talk/sound/soundsystemfactory.h" - -namespace cricket { - -// A SoundSystemFactory that always returns a NullSoundSystem. Intended for -// testing. -class NullSoundSystemFactory : public SoundSystemFactory { - public: - NullSoundSystemFactory(); - virtual ~NullSoundSystemFactory(); - - protected: - // Inherited from SoundSystemFactory. - virtual bool SetupInstance(); - virtual void CleanupInstance(); -}; - -} // namespace cricket - -#endif // TALK_SOUND_NULLSOUNDSYSTEMFACTORY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/sound/platformsoundsystem.h b/thirdparties/common/include/webrtc-sdk/talk/sound/platformsoundsystem.h deleted file mode 100755 index 80628f1..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/sound/platformsoundsystem.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_SOUND_PLATFORMSOUNDSYSTEM_H_ -#define TALK_SOUND_PLATFORMSOUNDSYSTEM_H_ - -namespace cricket { - -class SoundSystemInterface; - -// Creates the sound system implementation for this platform. -SoundSystemInterface *CreatePlatformSoundSystem(); - -} // namespace cricket - -#endif // TALK_SOUND_PLATFORMSOUNDSYSTEM_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/sound/platformsoundsystemfactory.h b/thirdparties/common/include/webrtc-sdk/talk/sound/platformsoundsystemfactory.h deleted file mode 100755 index 9ac117d..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/sound/platformsoundsystemfactory.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_SOUND_PLATFORMSOUNDSYSTEMFACTORY_H_ -#define TALK_SOUND_PLATFORMSOUNDSYSTEMFACTORY_H_ - -#include "talk/sound/soundsystemfactory.h" - -namespace cricket { - -// A SoundSystemFactory that returns the platform's native sound system -// implementation. -class PlatformSoundSystemFactory : public SoundSystemFactory { - public: - PlatformSoundSystemFactory(); - virtual ~PlatformSoundSystemFactory(); - - protected: - // Inherited from SoundSystemFactory. - virtual bool SetupInstance(); - virtual void CleanupInstance(); -}; - -} // namespace cricket - -#endif // TALK_SOUND_PLATFORMSOUNDSYSTEMFACTORY_H_ - - diff --git a/thirdparties/common/include/webrtc-sdk/talk/sound/pulseaudiosoundsystem.h b/thirdparties/common/include/webrtc-sdk/talk/sound/pulseaudiosoundsystem.h deleted file mode 100755 index 775a05d..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/sound/pulseaudiosoundsystem.h +++ /dev/null @@ -1,194 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_SOUND_PULSEAUDIOSOUNDSYSTEM_H_ -#define TALK_SOUND_PULSEAUDIOSOUNDSYSTEM_H_ - -#ifdef HAVE_LIBPULSE - -#include "talk/base/constructormagic.h" -#include "talk/sound/pulseaudiosymboltable.h" -#include "talk/sound/soundsysteminterface.h" - -namespace cricket { - -class PulseAudioInputStream; -class PulseAudioOutputStream; -class PulseAudioStream; - -// Sound system implementation for PulseAudio, a cross-platform sound server -// (but commonly used only on Linux, which is the only platform we support -// it on). -// Init(), Terminate(), and the destructor should never be invoked concurrently, -// but all other methods are thread-safe. -class PulseAudioSoundSystem : public SoundSystemInterface { - friend class PulseAudioInputStream; - friend class PulseAudioOutputStream; - friend class PulseAudioStream; - public: - static SoundSystemInterface *Create() { - return new PulseAudioSoundSystem(); - } - - PulseAudioSoundSystem(); - - virtual ~PulseAudioSoundSystem(); - - virtual bool Init(); - virtual void Terminate(); - - virtual bool EnumeratePlaybackDevices(SoundDeviceLocatorList *devices); - virtual bool EnumerateCaptureDevices(SoundDeviceLocatorList *devices); - - virtual bool GetDefaultPlaybackDevice(SoundDeviceLocator **device); - virtual bool GetDefaultCaptureDevice(SoundDeviceLocator **device); - - virtual SoundOutputStreamInterface *OpenPlaybackDevice( - const SoundDeviceLocator *device, - const OpenParams ¶ms); - virtual SoundInputStreamInterface *OpenCaptureDevice( - const SoundDeviceLocator *device, - const OpenParams ¶ms); - - virtual const char *GetName() const; - - private: - bool IsInitialized(); - - static void ConnectToPulseCallbackThunk(pa_context *context, void *userdata); - - void OnConnectToPulseCallback(pa_context *context, bool *connect_done); - - bool ConnectToPulse(pa_context *context); - - pa_context *CreateNewConnection(); - - template - bool EnumerateDevices(SoundDeviceLocatorList *devices, - pa_operation *(*enumerate_fn)( - pa_context *c, - void (*callback_fn)( - pa_context *c, - const InfoStruct *i, - int eol, - void *userdata), - void *userdata), - void (*callback_fn)( - pa_context *c, - const InfoStruct *i, - int eol, - void *userdata)); - - static void EnumeratePlaybackDevicesCallbackThunk(pa_context *unused, - const pa_sink_info *info, - int eol, - void *userdata); - - static void EnumerateCaptureDevicesCallbackThunk(pa_context *unused, - const pa_source_info *info, - int eol, - void *userdata); - - void OnEnumeratePlaybackDevicesCallback( - SoundDeviceLocatorList *devices, - const pa_sink_info *info, - int eol); - - void OnEnumerateCaptureDevicesCallback( - SoundDeviceLocatorList *devices, - const pa_source_info *info, - int eol); - - template - static void GetDefaultDeviceCallbackThunk( - pa_context *unused, - const pa_server_info *info, - void *userdata); - - template - void OnGetDefaultDeviceCallback( - const pa_server_info *info, - SoundDeviceLocator **device); - - template - bool GetDefaultDevice(SoundDeviceLocator **device); - - static void StreamStateChangedCallbackThunk(pa_stream *stream, - void *userdata); - - void OnStreamStateChangedCallback(pa_stream *stream); - - template - StreamInterface *OpenDevice( - const SoundDeviceLocator *device, - const OpenParams ¶ms, - const char *stream_name, - StreamInterface *(PulseAudioSoundSystem::*connect_fn)( - pa_stream *stream, - const char *dev, - int flags, - pa_stream_flags_t pa_flags, - int latency, - const pa_sample_spec &spec)); - - SoundOutputStreamInterface *ConnectOutputStream( - pa_stream *stream, - const char *dev, - int flags, - pa_stream_flags_t pa_flags, - int latency, - const pa_sample_spec &spec); - - SoundInputStreamInterface *ConnectInputStream( - pa_stream *stream, - const char *dev, - int flags, - pa_stream_flags_t pa_flags, - int latency, - const pa_sample_spec &spec); - - bool FinishOperation(pa_operation *op); - - void Lock(); - void Unlock(); - void Wait(); - void Signal(); - - const char *LastError(); - - pa_threaded_mainloop *mainloop_; - pa_context *context_; - PulseAudioSymbolTable symbol_table_; - - DISALLOW_COPY_AND_ASSIGN(PulseAudioSoundSystem); -}; - -} // namespace cricket - -#endif // HAVE_LIBPULSE - -#endif // TALK_SOUND_PULSEAUDIOSOUNDSYSTEM_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/sound/pulseaudiosymboltable.h b/thirdparties/common/include/webrtc-sdk/talk/sound/pulseaudiosymboltable.h deleted file mode 100755 index 7ceca85..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/sound/pulseaudiosymboltable.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_SOUND_PULSEAUDIOSYMBOLTABLE_H_ -#define TALK_SOUND_PULSEAUDIOSYMBOLTABLE_H_ - -#include -#include -#include -#include -#include -#include - -#include "talk/base/latebindingsymboltable.h" - -namespace cricket { - -#define PULSE_AUDIO_SYMBOLS_CLASS_NAME PulseAudioSymbolTable -// The PulseAudio symbols we need, as an X-Macro list. -// This list must contain precisely every libpulse function that is used in -// pulseaudiosoundsystem.cc. -#define PULSE_AUDIO_SYMBOLS_LIST \ - X(pa_bytes_per_second) \ - X(pa_context_connect) \ - X(pa_context_disconnect) \ - X(pa_context_errno) \ - X(pa_context_get_protocol_version) \ - X(pa_context_get_server_info) \ - X(pa_context_get_sink_info_list) \ - X(pa_context_get_sink_input_info) \ - X(pa_context_get_source_info_by_index) \ - X(pa_context_get_source_info_list) \ - X(pa_context_get_state) \ - X(pa_context_new) \ - X(pa_context_set_sink_input_volume) \ - X(pa_context_set_source_volume_by_index) \ - X(pa_context_set_state_callback) \ - X(pa_context_unref) \ - X(pa_cvolume_set) \ - X(pa_operation_get_state) \ - X(pa_operation_unref) \ - X(pa_stream_connect_playback) \ - X(pa_stream_connect_record) \ - X(pa_stream_disconnect) \ - X(pa_stream_drop) \ - X(pa_stream_get_device_index) \ - X(pa_stream_get_index) \ - X(pa_stream_get_latency) \ - X(pa_stream_get_sample_spec) \ - X(pa_stream_get_state) \ - X(pa_stream_new) \ - X(pa_stream_peek) \ - X(pa_stream_readable_size) \ - X(pa_stream_set_buffer_attr) \ - X(pa_stream_set_overflow_callback) \ - X(pa_stream_set_read_callback) \ - X(pa_stream_set_state_callback) \ - X(pa_stream_set_underflow_callback) \ - X(pa_stream_set_write_callback) \ - X(pa_stream_unref) \ - X(pa_stream_writable_size) \ - X(pa_stream_write) \ - X(pa_strerror) \ - X(pa_threaded_mainloop_free) \ - X(pa_threaded_mainloop_get_api) \ - X(pa_threaded_mainloop_lock) \ - X(pa_threaded_mainloop_new) \ - X(pa_threaded_mainloop_signal) \ - X(pa_threaded_mainloop_start) \ - X(pa_threaded_mainloop_stop) \ - X(pa_threaded_mainloop_unlock) \ - X(pa_threaded_mainloop_wait) - -#define LATE_BINDING_SYMBOL_TABLE_CLASS_NAME PULSE_AUDIO_SYMBOLS_CLASS_NAME -#define LATE_BINDING_SYMBOL_TABLE_SYMBOLS_LIST PULSE_AUDIO_SYMBOLS_LIST -#include "talk/base/latebindingsymboltable.h.def" - -} // namespace cricket - -#endif // TALK_SOUND_PULSEAUDIOSYMBOLTABLE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/sound/sounddevicelocator.h b/thirdparties/common/include/webrtc-sdk/talk/sound/sounddevicelocator.h deleted file mode 100755 index 6cc8e84..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/sound/sounddevicelocator.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_SOUND_SOUNDDEVICELOCATOR_H_ -#define TALK_SOUND_SOUNDDEVICELOCATOR_H_ - -#include - -#include "talk/base/constructormagic.h" - -namespace cricket { - -// A simple container for holding the name of a device and any additional id -// information needed to locate and open it. Implementations of -// SoundSystemInterface must subclass this to add any id information that they -// need. -class SoundDeviceLocator { - public: - virtual ~SoundDeviceLocator() {} - - // Human-readable name for the device. - const std::string &name() const { return name_; } - - // Name sound system uses to locate this device. - const std::string &device_name() const { return device_name_; } - - // Makes a duplicate of this locator. - virtual SoundDeviceLocator *Copy() const = 0; - - protected: - SoundDeviceLocator(const std::string &name, - const std::string &device_name) - : name_(name), device_name_(device_name) {} - - explicit SoundDeviceLocator(const SoundDeviceLocator &that) - : name_(that.name_), device_name_(that.device_name_) {} - - std::string name_; - std::string device_name_; - - private: - DISALLOW_ASSIGN(SoundDeviceLocator); -}; - -} // namespace cricket - -#endif // TALK_SOUND_SOUNDDEVICELOCATOR_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/sound/soundinputstreaminterface.h b/thirdparties/common/include/webrtc-sdk/talk/sound/soundinputstreaminterface.h deleted file mode 100755 index b9c84db..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/sound/soundinputstreaminterface.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_SOUND_SOUNDINPUTSTREAMINTERFACE_H_ -#define TALK_SOUND_SOUNDINPUTSTREAMINTERFACE_H_ - -#include "talk/base/constructormagic.h" -#include "talk/base/sigslot.h" - -namespace cricket { - -// Interface for consuming an input stream from a recording device. -// Semantics and thread-safety of StartReading()/StopReading() are the same as -// for talk_base::Worker. -class SoundInputStreamInterface { - public: - virtual ~SoundInputStreamInterface() {} - - // Starts the reading of samples on the current thread. - virtual bool StartReading() = 0; - // Stops the reading of samples. - virtual bool StopReading() = 0; - - // Retrieves the current input volume for this stream. Nominal range is - // defined by SoundSystemInterface::k(Max|Min)Volume, but values exceeding the - // max may be possible in some implementations. This call retrieves the actual - // volume currently in use by the OS, not a cached value from a previous - // (Get|Set)Volume() call. - virtual bool GetVolume(int *volume) = 0; - - // Changes the input volume for this stream. Nominal range is defined by - // SoundSystemInterface::k(Max|Min)Volume. The effect of exceeding kMaxVolume - // is implementation-defined. - virtual bool SetVolume(int volume) = 0; - - // Closes this stream object. If currently reading then this may only be - // called from the reading thread. - virtual bool Close() = 0; - - // Get the latency of the stream. - virtual int LatencyUsecs() = 0; - - // Notifies the consumer of new data read from the device. - // The first parameter is a pointer to the data read, and is only valid for - // the duration of the call. - // The second parameter is the amount of data read in bytes (i.e., the valid - // length of the memory pointed to). - // The 3rd parameter is the stream that is issuing the callback. - sigslot::signal3 SignalSamplesRead; - - protected: - SoundInputStreamInterface() {} - - private: - DISALLOW_COPY_AND_ASSIGN(SoundInputStreamInterface); -}; - -} // namespace cricket - -#endif // TALK_SOUND_SOUNDOUTPUTSTREAMINTERFACE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/sound/soundoutputstreaminterface.h b/thirdparties/common/include/webrtc-sdk/talk/sound/soundoutputstreaminterface.h deleted file mode 100755 index 25d836a..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/sound/soundoutputstreaminterface.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_SOUND_SOUNDOUTPUTSTREAMINTERFACE_H_ -#define TALK_SOUND_SOUNDOUTPUTSTREAMINTERFACE_H_ - -#include "talk/base/constructormagic.h" -#include "talk/base/sigslot.h" - -namespace cricket { - -// Interface for outputting a stream to a playback device. -// Semantics and thread-safety of EnableBufferMonitoring()/ -// DisableBufferMonitoring() are the same as for talk_base::Worker. -class SoundOutputStreamInterface { - public: - virtual ~SoundOutputStreamInterface() {} - - // Enables monitoring the available buffer space on the current thread. - virtual bool EnableBufferMonitoring() = 0; - // Disables the monitoring. - virtual bool DisableBufferMonitoring() = 0; - - // Write the given samples to the devices. If currently monitoring then this - // may only be called from the monitoring thread. - virtual bool WriteSamples(const void *sample_data, - size_t size) = 0; - - // Retrieves the current output volume for this stream. Nominal range is - // defined by SoundSystemInterface::k(Max|Min)Volume, but values exceeding the - // max may be possible in some implementations. This call retrieves the actual - // volume currently in use by the OS, not a cached value from a previous - // (Get|Set)Volume() call. - virtual bool GetVolume(int *volume) = 0; - - // Changes the output volume for this stream. Nominal range is defined by - // SoundSystemInterface::k(Max|Min)Volume. The effect of exceeding kMaxVolume - // is implementation-defined. - virtual bool SetVolume(int volume) = 0; - - // Closes this stream object. If currently monitoring then this may only be - // called from the monitoring thread. - virtual bool Close() = 0; - - // Get the latency of the stream. - virtual int LatencyUsecs() = 0; - - // Notifies the producer of the available buffer space for writes. - // It fires continuously as long as the space is greater than zero. - // The first parameter is the amount of buffer space available for data to - // be written (i.e., the maximum amount of data that can be written right now - // with WriteSamples() without blocking). - // The 2nd parameter is the stream that is issuing the callback. - sigslot::signal2 SignalBufferSpace; - - protected: - SoundOutputStreamInterface() {} - - private: - DISALLOW_COPY_AND_ASSIGN(SoundOutputStreamInterface); -}; - -} // namespace cricket - -#endif // TALK_SOUND_SOUNDOUTPUTSTREAMINTERFACE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/sound/soundsystemfactory.h b/thirdparties/common/include/webrtc-sdk/talk/sound/soundsystemfactory.h deleted file mode 100755 index 0893a24..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/sound/soundsystemfactory.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_SOUND_SOUNDSYSTEMFACTORY_H_ -#define TALK_SOUND_SOUNDSYSTEMFACTORY_H_ - -#include "talk/base/referencecountedsingletonfactory.h" - -namespace cricket { - -class SoundSystemInterface; - -typedef talk_base::ReferenceCountedSingletonFactory - SoundSystemFactory; - -typedef talk_base::rcsf_ptr SoundSystemHandle; - -} // namespace cricket - -#endif // TALK_SOUND_SOUNDSYSTEMFACTORY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/sound/soundsysteminterface.h b/thirdparties/common/include/webrtc-sdk/talk/sound/soundsysteminterface.h deleted file mode 100755 index 245b211..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/sound/soundsysteminterface.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_SOUND_SOUNDSYSTEMINTERFACE_H_ -#define TALK_SOUND_SOUNDSYSTEMINTERFACE_H_ - -#include - -#include "talk/base/constructormagic.h" - -namespace cricket { - -class SoundDeviceLocator; -class SoundInputStreamInterface; -class SoundOutputStreamInterface; - -// Interface for a platform's sound system. -// Implementations must guarantee thread-safety for at least the following use -// cases: -// 1) Concurrent enumeration and opening of devices from different threads. -// 2) Concurrent use of different Sound(Input|Output)StreamInterface -// instances from different threads (but concurrent use of the _same_ one from -// different threads need not be supported). -class SoundSystemInterface { - public: - typedef std::vector SoundDeviceLocatorList; - - enum SampleFormat { - // Only one supported sample format at this time. - // The values here may be used in lookup tables, so they shouldn't change. - FORMAT_S16LE = 0, - }; - - enum Flags { - // Enable reporting the current stream latency in - // Sound(Input|Output)StreamInterface. See those classes for more details. - FLAG_REPORT_LATENCY = (1 << 0), - }; - - struct OpenParams { - // Format for the sound stream. - SampleFormat format; - // Sampling frequency in hertz. - unsigned int freq; - // Number of channels in the PCM stream. - unsigned int channels; - // Misc flags. Should be taken from the Flags enum above. - int flags; - // Desired latency, measured as number of bytes of sample data - int latency; - }; - - // Special values for the "latency" field of OpenParams. - // Use this one to say you don't care what the latency is. The sound system - // will optimize for other things instead. - static const int kNoLatencyRequirements = -1; - // Use this one to say that you want the sound system to pick an appropriate - // small latency value. The sound system may pick the minimum allowed one, or - // a slightly higher one in the event that the true minimum requires an - // undesirable trade-off. - static const int kLowLatency = 0; - - // Max value for the volume parameters for Sound(Input|Output)StreamInterface. - static const int kMaxVolume = 255; - // Min value for the volume parameters for Sound(Input|Output)StreamInterface. - static const int kMinVolume = 0; - - // Helper for clearing a locator list and deleting the entries. - static void ClearSoundDeviceLocatorList(SoundDeviceLocatorList *devices); - - virtual ~SoundSystemInterface() {} - - virtual bool Init() = 0; - virtual void Terminate() = 0; - - // Enumerates the available devices. (Any pre-existing locators in the lists - // are deleted.) - virtual bool EnumeratePlaybackDevices(SoundDeviceLocatorList *devices) = 0; - virtual bool EnumerateCaptureDevices(SoundDeviceLocatorList *devices) = 0; - - // Gets a special locator for the default device. - virtual bool GetDefaultPlaybackDevice(SoundDeviceLocator **device) = 0; - virtual bool GetDefaultCaptureDevice(SoundDeviceLocator **device) = 0; - - // Opens the given device, or returns NULL on error. - virtual SoundOutputStreamInterface *OpenPlaybackDevice( - const SoundDeviceLocator *device, - const OpenParams ¶ms) = 0; - virtual SoundInputStreamInterface *OpenCaptureDevice( - const SoundDeviceLocator *device, - const OpenParams ¶ms) = 0; - - // A human-readable name for this sound system. - virtual const char *GetName() const = 0; - - protected: - SoundSystemInterface() {} - - private: - DISALLOW_COPY_AND_ASSIGN(SoundSystemInterface); -}; - -} // namespace cricket - -#endif // TALK_SOUND_SOUNDSYSTEMINTERFACE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/sound/soundsystemproxy.h b/thirdparties/common/include/webrtc-sdk/talk/sound/soundsystemproxy.h deleted file mode 100755 index b164d6d..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/sound/soundsystemproxy.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * libjingle - * Copyright 2004--2010, 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_SOUND_SOUNDSYSTEMPROXY_H_ -#define TALK_SOUND_SOUNDSYSTEMPROXY_H_ - -#include "talk/base/basictypes.h" // for NULL -#include "talk/sound/soundsysteminterface.h" - -namespace cricket { - -// A SoundSystemProxy is a sound system that defers to another one. -// Init(), Terminate(), and GetName() are left as pure virtual, so a sub-class -// must define them. -class SoundSystemProxy : public SoundSystemInterface { - public: - SoundSystemProxy() : wrapped_(NULL) {} - - // Each of these methods simply defers to wrapped_ if non-NULL, else fails. - - virtual bool EnumeratePlaybackDevices(SoundDeviceLocatorList *devices); - virtual bool EnumerateCaptureDevices(SoundDeviceLocatorList *devices); - - virtual bool GetDefaultPlaybackDevice(SoundDeviceLocator **device); - virtual bool GetDefaultCaptureDevice(SoundDeviceLocator **device); - - virtual SoundOutputStreamInterface *OpenPlaybackDevice( - const SoundDeviceLocator *device, - const OpenParams ¶ms); - virtual SoundInputStreamInterface *OpenCaptureDevice( - const SoundDeviceLocator *device, - const OpenParams ¶ms); - - protected: - SoundSystemInterface *wrapped_; -}; - -} // namespace cricket - -#endif // TALK_SOUND_SOUNDSYSTEMPROXY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/xmllite/qname.h b/thirdparties/common/include/webrtc-sdk/talk/xmllite/qname.h deleted file mode 100755 index 92e54d0..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/xmllite/qname.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_XMLLITE_QNAME_H_ -#define TALK_XMLLITE_QNAME_H_ - -#include - -namespace buzz { - -class QName; - -// StaticQName is used to represend constant quailified names. They -// can be initialized statically and don't need intializers code, e.g. -// const StaticQName QN_FOO = { "foo_namespace", "foo" }; -// -// Beside this use case, QName should be used everywhere -// else. StaticQName instances are implicitly converted to QName -// objects. -struct StaticQName { - const char* const ns; - const char* const local; - - bool operator==(const QName& other) const; - bool operator!=(const QName& other) const; -}; - -class QName { - public: - QName(); - QName(const QName& qname); - QName(const StaticQName& const_value); - QName(const std::string& ns, const std::string& local); - explicit QName(const std::string& merged_or_local); - ~QName(); - - const std::string& Namespace() const { return namespace_; } - const std::string& LocalPart() const { return local_part_; } - std::string Merged() const; - bool IsEmpty() const; - - int Compare(const StaticQName& other) const; - int Compare(const QName& other) const; - - bool operator==(const StaticQName& other) const { - return Compare(other) == 0; - } - bool operator==(const QName& other) const { - return Compare(other) == 0; - } - bool operator!=(const StaticQName& other) const { - return Compare(other) != 0; - } - bool operator!=(const QName& other) const { - return Compare(other) != 0; - } - bool operator<(const QName& other) const { - return Compare(other) < 0; - } - - private: - std::string namespace_; - std::string local_part_; -}; - -inline bool StaticQName::operator==(const QName& other) const { - return other.Compare(*this) == 0; -} - -inline bool StaticQName::operator!=(const QName& other) const { - return other.Compare(*this) != 0; -} - -} // namespace buzz - -#endif // TALK_XMLLITE_QNAME_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/xmllite/xmlbuilder.h b/thirdparties/common/include/webrtc-sdk/talk/xmllite/xmlbuilder.h deleted file mode 100755 index 984eee2..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/xmllite/xmlbuilder.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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 _xmlbuilder_h_ -#define _xmlbuilder_h_ - -#include -#include -#include "talk/base/scoped_ptr.h" -#include "talk/xmllite/xmlparser.h" - -#ifdef EXPAT_RELATIVE_PATH -#include "expat.h" -#else -#include "third_party/expat/v2_0_1/Source/lib/expat.h" -#endif // EXPAT_RELATIVE_PATH - -namespace buzz { - -class XmlElement; -class XmlParseContext; - - -class XmlBuilder : public XmlParseHandler { -public: - XmlBuilder(); - - static XmlElement * BuildElement(XmlParseContext * pctx, - const char * name, const char ** atts); - virtual void StartElement(XmlParseContext * pctx, - const char * name, const char ** atts); - virtual void EndElement(XmlParseContext * pctx, const char * name); - virtual void CharacterData(XmlParseContext * pctx, - const char * text, int len); - virtual void Error(XmlParseContext * pctx, XML_Error); - virtual ~XmlBuilder(); - - void Reset(); - - // Take ownership of the built element; second call returns NULL - XmlElement * CreateElement(); - - // Peek at the built element without taking ownership - XmlElement * BuiltElement(); - -private: - XmlElement * pelCurrent_; - talk_base::scoped_ptr pelRoot_; - talk_base::scoped_ptr > pvParents_; -}; - -} - -#endif diff --git a/thirdparties/common/include/webrtc-sdk/talk/xmllite/xmlconstants.h b/thirdparties/common/include/webrtc-sdk/talk/xmllite/xmlconstants.h deleted file mode 100755 index 3e5da98..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/xmllite/xmlconstants.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_XMLLITE_XMLCONSTANTS_H_ -#define TALK_XMLLITE_XMLCONSTANTS_H_ - -#include "talk/xmllite/qname.h" - -namespace buzz { - -extern const char STR_EMPTY[]; -extern const char NS_XML[]; -extern const char NS_XMLNS[]; -extern const char STR_XMLNS[]; -extern const char STR_XML[]; -extern const char STR_VERSION[]; -extern const char STR_ENCODING[]; - -extern const StaticQName QN_XMLNS; - -} // namespace buzz - -#endif // TALK_XMLLITE_XMLCONSTANTS_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/xmllite/xmlelement.h b/thirdparties/common/include/webrtc-sdk/talk/xmllite/xmlelement.h deleted file mode 100755 index ffdc333..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/xmllite/xmlelement.h +++ /dev/null @@ -1,251 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_XMLLITE_XMLELEMENT_H_ -#define TALK_XMLLITE_XMLELEMENT_H_ - -#include -#include - -#include "talk/base/scoped_ptr.h" -#include "talk/xmllite/qname.h" - -namespace buzz { - -class XmlChild; -class XmlText; -class XmlElement; -class XmlAttr; - -class XmlChild { - public: - XmlChild* NextChild() { return next_child_; } - const XmlChild* NextChild() const { return next_child_; } - - bool IsText() const { return IsTextImpl(); } - - XmlElement* AsElement() { return AsElementImpl(); } - const XmlElement* AsElement() const { return AsElementImpl(); } - - XmlText* AsText() { return AsTextImpl(); } - const XmlText* AsText() const { return AsTextImpl(); } - - - protected: - XmlChild() : - next_child_(NULL) { - } - - virtual bool IsTextImpl() const = 0; - virtual XmlElement* AsElementImpl() const = 0; - virtual XmlText* AsTextImpl() const = 0; - - - virtual ~XmlChild(); - - private: - friend class XmlElement; - - XmlChild(const XmlChild& noimpl); - - XmlChild* next_child_; -}; - -class XmlText : public XmlChild { - public: - explicit XmlText(const std::string& text) : - XmlChild(), - text_(text) { - } - explicit XmlText(const XmlText& t) : - XmlChild(), - text_(t.text_) { - } - explicit XmlText(const char* cstr, size_t len) : - XmlChild(), - text_(cstr, len) { - } - virtual ~XmlText(); - - const std::string& Text() const { return text_; } - void SetText(const std::string& text); - void AddParsedText(const char* buf, int len); - void AddText(const std::string& text); - - protected: - virtual bool IsTextImpl() const; - virtual XmlElement* AsElementImpl() const; - virtual XmlText* AsTextImpl() const; - - private: - std::string text_; -}; - -class XmlAttr { - public: - XmlAttr* NextAttr() const { return next_attr_; } - const QName& Name() const { return name_; } - const std::string& Value() const { return value_; } - - private: - friend class XmlElement; - - explicit XmlAttr(const QName& name, const std::string& value) : - next_attr_(NULL), - name_(name), - value_(value) { - } - explicit XmlAttr(const XmlAttr& att) : - next_attr_(NULL), - name_(att.name_), - value_(att.value_) { - } - - XmlAttr* next_attr_; - QName name_; - std::string value_; -}; - -class XmlElement : public XmlChild { - public: - explicit XmlElement(const QName& name); - explicit XmlElement(const QName& name, bool useDefaultNs); - explicit XmlElement(const XmlElement& elt); - - virtual ~XmlElement(); - - const QName& Name() const { return name_; } - void SetName(const QName& name) { name_ = name; } - - const std::string BodyText() const; - void SetBodyText(const std::string& text); - - const QName FirstElementName() const; - - XmlAttr* FirstAttr(); - const XmlAttr* FirstAttr() const - { return const_cast(this)->FirstAttr(); } - - // Attr will return an empty string if the attribute isn't there: - // use HasAttr to test presence of an attribute. - const std::string Attr(const StaticQName& name) const; - const std::string Attr(const QName& name) const; - bool HasAttr(const StaticQName& name) const; - bool HasAttr(const QName& name) const; - void SetAttr(const QName& name, const std::string& value); - void ClearAttr(const QName& name); - - XmlChild* FirstChild(); - const XmlChild* FirstChild() const { - return const_cast(this)->FirstChild(); - } - - XmlElement* FirstElement(); - const XmlElement* FirstElement() const { - return const_cast(this)->FirstElement(); - } - - XmlElement* NextElement(); - const XmlElement* NextElement() const { - return const_cast(this)->NextElement(); - } - - XmlElement* FirstWithNamespace(const std::string& ns); - const XmlElement* FirstWithNamespace(const std::string& ns) const { - return const_cast(this)->FirstWithNamespace(ns); - } - - XmlElement* NextWithNamespace(const std::string& ns); - const XmlElement* NextWithNamespace(const std::string& ns) const { - return const_cast(this)->NextWithNamespace(ns); - } - - XmlElement* FirstNamed(const StaticQName& name); - const XmlElement* FirstNamed(const StaticQName& name) const { - return const_cast(this)->FirstNamed(name); - } - - XmlElement* FirstNamed(const QName& name); - const XmlElement* FirstNamed(const QName& name) const { - return const_cast(this)->FirstNamed(name); - } - - XmlElement* NextNamed(const StaticQName& name); - const XmlElement* NextNamed(const StaticQName& name) const { - return const_cast(this)->NextNamed(name); - } - - XmlElement* NextNamed(const QName& name); - const XmlElement* NextNamed(const QName& name) const { - return const_cast(this)->NextNamed(name); - } - - // Finds the first element named 'name'. If that element can't be found then - // adds one and returns it. - XmlElement* FindOrAddNamedChild(const QName& name); - - const std::string TextNamed(const QName& name) const; - - void InsertChildAfter(XmlChild* predecessor, XmlChild* new_child); - void RemoveChildAfter(XmlChild* predecessor); - - void AddParsedText(const char* buf, int len); - // Note: CDATA is not supported by XMPP, therefore using this function will - // generate non-XMPP compatible XML. - void AddCDATAText(const char* buf, int len); - void AddText(const std::string& text); - void AddText(const std::string& text, int depth); - void AddElement(XmlElement* child); - void AddElement(XmlElement* child, int depth); - void AddAttr(const QName& name, const std::string& value); - void AddAttr(const QName& name, const std::string& value, int depth); - void ClearNamedChildren(const QName& name); - void ClearAttributes(); - void ClearChildren(); - - static XmlElement* ForStr(const std::string& str); - std::string Str() const; - - bool IsCDATA() const { return cdata_; } - - protected: - virtual bool IsTextImpl() const; - virtual XmlElement* AsElementImpl() const; - virtual XmlText* AsTextImpl() const; - - private: - QName name_; - XmlAttr* first_attr_; - XmlAttr* last_attr_; - XmlChild* first_child_; - XmlChild* last_child_; - bool cdata_; -}; - -} // namespace buzz - -#endif // TALK_XMLLITE_XMLELEMENT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/xmllite/xmlnsstack.h b/thirdparties/common/include/webrtc-sdk/talk/xmllite/xmlnsstack.h deleted file mode 100755 index f6b4b81..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/xmllite/xmlnsstack.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_XMLLITE_XMLNSSTACK_H_ -#define TALK_XMLLITE_XMLNSSTACK_H_ - -#include -#include -#include "talk/base/scoped_ptr.h" -#include "talk/xmllite/qname.h" - -namespace buzz { - -class XmlnsStack { -public: - XmlnsStack(); - ~XmlnsStack(); - - void AddXmlns(const std::string& prefix, const std::string& ns); - void RemoveXmlns(); - void PushFrame(); - void PopFrame(); - void Reset(); - - std::pair NsForPrefix(const std::string& prefix); - bool PrefixMatchesNs(const std::string & prefix, const std::string & ns); - std::pair PrefixForNs(const std::string& ns, bool isAttr); - std::pair AddNewPrefix(const std::string& ns, bool isAttr); - std::string FormatQName(const QName & name, bool isAttr); - -private: - - talk_base::scoped_ptr > pxmlnsStack_; - talk_base::scoped_ptr > pxmlnsDepthStack_; -}; -} - -#endif // TALK_XMLLITE_XMLNSSTACK_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/xmllite/xmlparser.h b/thirdparties/common/include/webrtc-sdk/talk/xmllite/xmlparser.h deleted file mode 100755 index 4a79858..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/xmllite/xmlparser.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_XMLLITE_XMLPARSER_H_ -#define TALK_XMLLITE_XMLPARSER_H_ - -#include - -#include "talk/xmllite/xmlnsstack.h" -#ifdef EXPAT_RELATIVE_PATH -#include "expat.h" -#else -#include "third_party/expat/v2_0_1/Source/lib/expat.h" -#endif // EXPAT_RELATIVE_PATH - -struct XML_ParserStruct; -typedef struct XML_ParserStruct* XML_Parser; - -namespace buzz { - -class XmlParseHandler; -class XmlParseContext; -class XmlParser; - -class XmlParseContext { -public: - virtual ~XmlParseContext() {} - virtual QName ResolveQName(const char * qname, bool isAttr) = 0; - virtual void RaiseError(XML_Error err) = 0; - virtual void GetPosition(unsigned long * line, unsigned long * column, - unsigned long * byte_index) = 0; -}; - -class XmlParseHandler { -public: - virtual ~XmlParseHandler() {} - virtual void StartElement(XmlParseContext * pctx, - const char * name, const char ** atts) = 0; - virtual void EndElement(XmlParseContext * pctx, - const char * name) = 0; - virtual void CharacterData(XmlParseContext * pctx, - const char * text, int len) = 0; - virtual void Error(XmlParseContext * pctx, - XML_Error errorCode) = 0; -}; - -class XmlParser { -public: - static void ParseXml(XmlParseHandler * pxph, std::string text); - - explicit XmlParser(XmlParseHandler * pxph); - bool Parse(const char * data, size_t len, bool isFinal); - void Reset(); - virtual ~XmlParser(); - - // expat callbacks - void ExpatStartElement(const char * name, const char ** atts); - void ExpatEndElement(const char * name); - void ExpatCharacterData(const char * text, int len); - void ExpatXmlDecl(const char * ver, const char * enc, int standalone); - -private: - - class ParseContext : public XmlParseContext { - public: - ParseContext(); - virtual ~ParseContext(); - virtual QName ResolveQName(const char * qname, bool isAttr); - virtual void RaiseError(XML_Error err) { if (!raised_) raised_ = err; } - virtual void GetPosition(unsigned long * line, unsigned long * column, - unsigned long * byte_index); - XML_Error RaisedError() { return raised_; } - void Reset(); - - void StartElement(); - void EndElement(); - void StartNamespace(const char * prefix, const char * ns); - void SetPosition(int line, int column, long byte_index); - - private: - XmlnsStack xmlnsstack_; - XML_Error raised_; - XML_Size line_number_; - XML_Size column_number_; - XML_Index byte_index_; - }; - - ParseContext context_; - XML_Parser expat_; - XmlParseHandler * pxph_; - bool sentError_; -}; - -} // namespace buzz - -#endif // TALK_XMLLITE_XMLPARSER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/talk/xmllite/xmlprinter.h b/thirdparties/common/include/webrtc-sdk/talk/xmllite/xmlprinter.h deleted file mode 100755 index 90cc255..0000000 --- a/thirdparties/common/include/webrtc-sdk/talk/xmllite/xmlprinter.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * libjingle - * Copyright 2004--2005, 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_XMLLITE_XMLPRINTER_H_ -#define TALK_XMLLITE_XMLPRINTER_H_ - -#include -#include - -namespace buzz { - -class XmlElement; -class XmlnsStack; - -class XmlPrinter { - public: - static void PrintXml(std::ostream* pout, const XmlElement* pelt); - - static void PrintXml(std::ostream* pout, const XmlElement* pelt, - XmlnsStack* ns_stack); -}; - -} // namespace buzz - -#endif // TALK_XMLLITE_XMLPRINTER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/assertions.h b/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/assertions.h deleted file mode 100755 index 3d35ac9..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/assertions.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED -# define CPPTL_JSON_ASSERTIONS_H_INCLUDED - -#include - -#if !defined(JSON_IS_AMALGAMATION) -# include -#endif // if !defined(JSON_IS_AMALGAMATION) - -#if JSON_USE_EXCEPTION -#define JSON_ASSERT( condition ) assert( condition ); // @todo <= change this into an exception throw -#define JSON_FAIL_MESSAGE( message ) throw std::runtime_error( message ); -#else // JSON_USE_EXCEPTION -#define JSON_ASSERT( condition ) assert( condition ); - -// The call to assert() will show the failure message in debug builds. In -// release bugs we write to invalid memory in order to crash hard, so that a -// debugger or crash reporter gets the chance to take over. We still call exit() -// afterward in order to tell the compiler that this macro doesn't return. -#define JSON_FAIL_MESSAGE( message ) { assert(false && message); strcpy(reinterpret_cast(666), message); exit(123); } - -#endif - -#define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) { JSON_FAIL_MESSAGE( message ) } - -#endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED diff --git a/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/autolink.h b/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/autolink.h deleted file mode 100755 index c15bf57..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/autolink.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef JSON_AUTOLINK_H_INCLUDED -# define JSON_AUTOLINK_H_INCLUDED - -# include "config.h" - -# ifdef JSON_IN_CPPTL -# include -# endif - -# if !defined(JSON_NO_AUTOLINK) && !defined(JSON_DLL_BUILD) && !defined(JSON_IN_CPPTL) -# define CPPTL_AUTOLINK_NAME "json" -# undef CPPTL_AUTOLINK_DLL -# ifdef JSON_DLL -# define CPPTL_AUTOLINK_DLL -# endif -# include "autolink.h" -# endif - -#endif // JSON_AUTOLINK_H_INCLUDED diff --git a/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/config.h b/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/config.h deleted file mode 100755 index 77e33af..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/config.h +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef JSON_CONFIG_H_INCLUDED -# define JSON_CONFIG_H_INCLUDED - -/// If defined, indicates that json library is embedded in CppTL library. -//# define JSON_IN_CPPTL 1 - -/// If defined, indicates that json may leverage CppTL library -//# define JSON_USE_CPPTL 1 -/// If defined, indicates that cpptl vector based map should be used instead of std::map -/// as Value container. -//# define JSON_USE_CPPTL_SMALLMAP 1 -/// If defined, indicates that Json specific container should be used -/// (hash table & simple deque container with customizable allocator). -/// THIS FEATURE IS STILL EXPERIMENTAL! There is know bugs: See #3177332 -//# define JSON_VALUE_USE_INTERNAL_MAP 1 -/// Force usage of standard new/malloc based allocator instead of memory pool based allocator. -/// The memory pools allocator used optimization (initializing Value and ValueInternalLink -/// as if it was a POD) that may cause some validation tool to report errors. -/// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined. -//# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1 - -// If non-zero, the library uses exceptions to report bad input instead of C -// assertion macros. The default is to use exceptions. -# ifndef JSON_USE_EXCEPTION -# define JSON_USE_EXCEPTION 1 -# endif - -/// If defined, indicates that the source file is amalgated -/// to prevent private header inclusion. -/// Remarks: it is automatically defined in the generated amalgated header. -// #define JSON_IS_AMALGAMATION - - -# ifdef JSON_IN_CPPTL -# include -# ifndef JSON_USE_CPPTL -# define JSON_USE_CPPTL 1 -# endif -# endif - -# ifdef JSON_IN_CPPTL -# define JSON_API CPPTL_API -# elif defined(JSON_DLL_BUILD) -# define JSON_API __declspec(dllexport) -# elif defined(JSON_DLL) -# define JSON_API __declspec(dllimport) -# else -# define JSON_API -# endif - -// If JSON_NO_INT64 is defined, then Json only support C++ "int" type for integer -// Storages, and 64 bits integer support is disabled. -// #define JSON_NO_INT64 1 - -#if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC 6 -// Microsoft Visual Studio 6 only support conversion from __int64 to double -// (no conversion from unsigned __int64). -#define JSON_USE_INT64_DOUBLE_CONVERSION 1 -#endif // if defined(_MSC_VER) && _MSC_VER < 1200 // MSVC 6 - -#if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008 -/// Indicates that the following function is deprecated. -# define JSONCPP_DEPRECATED(message) __declspec(deprecated(message)) -#endif - -#if !defined(JSONCPP_DEPRECATED) -# define JSONCPP_DEPRECATED(message) -#endif // if !defined(JSONCPP_DEPRECATED) - -namespace Json { - typedef int Int; - typedef unsigned int UInt; -# if defined(JSON_NO_INT64) - typedef int LargestInt; - typedef unsigned int LargestUInt; -# undef JSON_HAS_INT64 -# else // if defined(JSON_NO_INT64) - // For Microsoft Visual use specific types as long long is not supported -# if defined(_MSC_VER) // Microsoft Visual Studio - typedef __int64 Int64; - typedef unsigned __int64 UInt64; -# else // if defined(_MSC_VER) // Other platforms, use long long - typedef long long int Int64; - typedef unsigned long long int UInt64; -# endif // if defined(_MSC_VER) - typedef Int64 LargestInt; - typedef UInt64 LargestUInt; -# define JSON_HAS_INT64 -# endif // if defined(JSON_NO_INT64) -} // end namespace Json - - -#endif // JSON_CONFIG_H_INCLUDED diff --git a/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/features.h b/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/features.h deleted file mode 100755 index 54fbf5b..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/features.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef CPPTL_JSON_FEATURES_H_INCLUDED -# define CPPTL_JSON_FEATURES_H_INCLUDED - -#if !defined(JSON_IS_AMALGAMATION) -# include "forwards.h" -#endif // if !defined(JSON_IS_AMALGAMATION) - -namespace Json { - - /** \brief Configuration passed to reader and writer. - * This configuration object can be used to force the Reader or Writer - * to behave in a standard conforming way. - */ - class JSON_API Features - { - public: - /** \brief A configuration that allows all features and assumes all strings are UTF-8. - * - C & C++ comments are allowed - * - Root object can be any JSON value - * - Assumes Value strings are encoded in UTF-8 - */ - static Features all(); - - /** \brief A configuration that is strictly compatible with the JSON specification. - * - Comments are forbidden. - * - Root object must be either an array or an object value. - * - Assumes Value strings are encoded in UTF-8 - */ - static Features strictMode(); - - /** \brief Initialize the configuration like JsonConfig::allFeatures; - */ - Features(); - - /// \c true if comments are allowed. Default: \c true. - bool allowComments_; - - /// \c true if root must be either an array or an object value. Default: \c false. - bool strictRoot_; - }; - -} // namespace Json - -#endif // CPPTL_JSON_FEATURES_H_INCLUDED diff --git a/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/forwards.h b/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/forwards.h deleted file mode 100755 index c1f8d75..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/forwards.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef JSON_FORWARDS_H_INCLUDED -# define JSON_FORWARDS_H_INCLUDED - -#if !defined(JSON_IS_AMALGAMATION) -# include "config.h" -#endif // if !defined(JSON_IS_AMALGAMATION) - -namespace Json { - - // writer.h - class FastWriter; - class StyledWriter; - - // reader.h - class Reader; - - // features.h - class Features; - - // value.h - typedef unsigned int ArrayIndex; - class StaticString; - class Path; - class PathArgument; - class Value; - class ValueIteratorBase; - class ValueIterator; - class ValueConstIterator; -#ifdef JSON_VALUE_USE_INTERNAL_MAP - class ValueMapAllocator; - class ValueInternalLink; - class ValueInternalArray; - class ValueInternalMap; -#endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP - -} // namespace Json - - -#endif // JSON_FORWARDS_H_INCLUDED diff --git a/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/json.h b/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/json.h deleted file mode 100755 index fa91ff0..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/json.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef JSON_JSON_H_INCLUDED -# define JSON_JSON_H_INCLUDED - -# include "autolink.h" -# include "value.h" -# include "reader.h" -# include "writer.h" -# include "features.h" - -#endif // JSON_JSON_H_INCLUDED diff --git a/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/reader.h b/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/reader.h deleted file mode 100755 index 4721ac2..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/reader.h +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef CPPTL_JSON_READER_H_INCLUDED -# define CPPTL_JSON_READER_H_INCLUDED - -#if !defined(JSON_IS_AMALGAMATION) -# include "features.h" -# include "value.h" -#endif // if !defined(JSON_IS_AMALGAMATION) -# include -# include -# include - -namespace Json { - - /** \brief Unserialize a JSON document into a Value. - * - */ - class JSON_API Reader - { - public: - typedef char Char; - typedef const Char *Location; - - /** \brief Constructs a Reader allowing all features - * for parsing. - */ - Reader(); - - /** \brief Constructs a Reader allowing the specified feature set - * for parsing. - */ - Reader( const Features &features ); - - /** \brief Read a Value from a JSON document. - * \param document UTF-8 encoded string containing the document to read. - * \param root [out] Contains the root value of the document if it was - * successfully parsed. - * \param collectComments \c true to collect comment and allow writing them back during - * serialization, \c false to discard comments. - * This parameter is ignored if Features::allowComments_ - * is \c false. - * \return \c true if the document was successfully parsed, \c false if an error occurred. - */ - bool parse( const std::string &document, - Value &root, - bool collectComments = true ); - - /** \brief Read a Value from a JSON document. - * \param beginDoc Pointer on the beginning of the UTF-8 encoded string of the document to read. - * \param endDoc Pointer on the end of the UTF-8 encoded string of the document to read. - \ Must be >= beginDoc. - * \param root [out] Contains the root value of the document if it was - * successfully parsed. - * \param collectComments \c true to collect comment and allow writing them back during - * serialization, \c false to discard comments. - * This parameter is ignored if Features::allowComments_ - * is \c false. - * \return \c true if the document was successfully parsed, \c false if an error occurred. - */ - bool parse( const char *beginDoc, const char *endDoc, - Value &root, - bool collectComments = true ); - - /// \brief Parse from input stream. - /// \see Json::operator>>(std::istream&, Json::Value&). - bool parse( std::istream &is, - Value &root, - bool collectComments = true ); - - /** \brief Returns a user friendly string that list errors in the parsed document. - * \return Formatted error message with the list of errors with their location in - * the parsed document. An empty string is returned if no error occurred - * during parsing. - * \deprecated Use getFormattedErrorMessages() instead (typo fix). - */ - JSONCPP_DEPRECATED("Use getFormattedErrorMessages instead") - std::string getFormatedErrorMessages() const; - - /** \brief Returns a user friendly string that list errors in the parsed document. - * \return Formatted error message with the list of errors with their location in - * the parsed document. An empty string is returned if no error occurred - * during parsing. - */ - std::string getFormattedErrorMessages() const; - - private: - enum TokenType - { - tokenEndOfStream = 0, - tokenObjectBegin, - tokenObjectEnd, - tokenArrayBegin, - tokenArrayEnd, - tokenString, - tokenNumber, - tokenTrue, - tokenFalse, - tokenNull, - tokenArraySeparator, - tokenMemberSeparator, - tokenComment, - tokenError - }; - - class Token - { - public: - TokenType type_; - Location start_; - Location end_; - }; - - class ErrorInfo - { - public: - Token token_; - std::string message_; - Location extra_; - }; - - typedef std::deque Errors; - - bool expectToken( TokenType type, Token &token, const char *message ); - bool readToken( Token &token ); - void skipSpaces(); - bool match( Location pattern, - int patternLength ); - bool readComment(); - bool readCStyleComment(); - bool readCppStyleComment(); - bool readString(); - void readNumber(); - bool readValue(); - bool readObject( Token &token ); - bool readArray( Token &token ); - bool decodeNumber( Token &token ); - bool decodeString( Token &token ); - bool decodeString( Token &token, std::string &decoded ); - bool decodeDouble( Token &token ); - bool decodeUnicodeCodePoint( Token &token, - Location ¤t, - Location end, - unsigned int &unicode ); - bool decodeUnicodeEscapeSequence( Token &token, - Location ¤t, - Location end, - unsigned int &unicode ); - bool addError( const std::string &message, - Token &token, - Location extra = 0 ); - bool recoverFromError( TokenType skipUntilToken ); - bool addErrorAndRecover( const std::string &message, - Token &token, - TokenType skipUntilToken ); - void skipUntilSpace(); - Value ¤tValue(); - Char getNextChar(); - void getLocationLineAndColumn( Location location, - int &line, - int &column ) const; - std::string getLocationLineAndColumn( Location location ) const; - void addComment( Location begin, - Location end, - CommentPlacement placement ); - void skipCommentTokens( Token &token ); - - typedef std::stack Nodes; - Nodes nodes_; - Errors errors_; - std::string document_; - Location begin_; - Location end_; - Location current_; - Location lastValueEnd_; - Value *lastValue_; - std::string commentsBefore_; - Features features_; - bool collectComments_; - }; - - /** \brief Read from 'sin' into 'root'. - - Always keep comments from the input JSON. - - This can be used to read a file into a particular sub-object. - For example: - \code - Json::Value root; - cin >> root["dir"]["file"]; - cout << root; - \endcode - Result: - \verbatim - { - "dir": { - "file": { - // The input stream JSON would be nested here. - } - } - } - \endverbatim - \throw std::exception on parse error. - \see Json::operator<<() - */ - std::istream& operator>>( std::istream&, Value& ); - -} // namespace Json - -#endif // CPPTL_JSON_READER_H_INCLUDED diff --git a/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/value.h b/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/value.h deleted file mode 100755 index 6405ee3..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/value.h +++ /dev/null @@ -1,1109 +0,0 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef CPPTL_JSON_H_INCLUDED -# define CPPTL_JSON_H_INCLUDED - -#if !defined(JSON_IS_AMALGAMATION) -# include "forwards.h" -#endif // if !defined(JSON_IS_AMALGAMATION) -# include -# include - -# ifndef JSON_USE_CPPTL_SMALLMAP -# include -# else -# include -# endif -# ifdef JSON_USE_CPPTL -# include -# endif - -/** \brief JSON (JavaScript Object Notation). - */ -namespace Json { - - /** \brief Type of the value held by a Value object. - */ - enum ValueType - { - nullValue = 0, ///< 'null' value - intValue, ///< signed integer value - uintValue, ///< unsigned integer value - realValue, ///< double value - stringValue, ///< UTF-8 string value - booleanValue, ///< bool value - arrayValue, ///< array value (ordered list) - objectValue ///< object value (collection of name/value pairs). - }; - - enum CommentPlacement - { - commentBefore = 0, ///< a comment placed on the line before a value - commentAfterOnSameLine, ///< a comment just after a value on the same line - commentAfter, ///< a comment on the line after a value (only make sense for root value) - numberOfCommentPlacement - }; - -//# ifdef JSON_USE_CPPTL -// typedef CppTL::AnyEnumerator EnumMemberNames; -// typedef CppTL::AnyEnumerator EnumValues; -//# endif - - /** \brief Lightweight wrapper to tag static string. - * - * Value constructor and objectValue member assignement takes advantage of the - * StaticString and avoid the cost of string duplication when storing the - * string or the member name. - * - * Example of usage: - * \code - * Json::Value aValue( StaticString("some text") ); - * Json::Value object; - * static const StaticString code("code"); - * object[code] = 1234; - * \endcode - */ - class JSON_API StaticString - { - public: - explicit StaticString( const char *czstring ) - : str_( czstring ) - { - } - - operator const char *() const - { - return str_; - } - - const char *c_str() const - { - return str_; - } - - private: - const char *str_; - }; - - /** \brief Represents a JSON value. - * - * This class is a discriminated union wrapper that can represents a: - * - signed integer [range: Value::minInt - Value::maxInt] - * - unsigned integer (range: 0 - Value::maxUInt) - * - double - * - UTF-8 string - * - boolean - * - 'null' - * - an ordered list of Value - * - collection of name/value pairs (javascript object) - * - * The type of the held value is represented by a #ValueType and - * can be obtained using type(). - * - * values of an #objectValue or #arrayValue can be accessed using operator[]() methods. - * Non const methods will automatically create the a #nullValue element - * if it does not exist. - * The sequence of an #arrayValue will be automatically resize and initialized - * with #nullValue. resize() can be used to enlarge or truncate an #arrayValue. - * - * The get() methods can be used to obtanis default value in the case the required element - * does not exist. - * - * It is possible to iterate over the list of a #objectValue values using - * the getMemberNames() method. - */ - class JSON_API Value - { - friend class ValueIteratorBase; -# ifdef JSON_VALUE_USE_INTERNAL_MAP - friend class ValueInternalLink; - friend class ValueInternalMap; -# endif - public: - typedef std::vector Members; - typedef ValueIterator iterator; - typedef ValueConstIterator const_iterator; - typedef Json::UInt UInt; - typedef Json::Int Int; -# if defined(JSON_HAS_INT64) - typedef Json::UInt64 UInt64; - typedef Json::Int64 Int64; -#endif // defined(JSON_HAS_INT64) - typedef Json::LargestInt LargestInt; - typedef Json::LargestUInt LargestUInt; - typedef Json::ArrayIndex ArrayIndex; - - static const Value null; - /// Minimum signed integer value that can be stored in a Json::Value. - static const LargestInt minLargestInt; - /// Maximum signed integer value that can be stored in a Json::Value. - static const LargestInt maxLargestInt; - /// Maximum unsigned integer value that can be stored in a Json::Value. - static const LargestUInt maxLargestUInt; - - /// Minimum signed int value that can be stored in a Json::Value. - static const Int minInt; - /// Maximum signed int value that can be stored in a Json::Value. - static const Int maxInt; - /// Maximum unsigned int value that can be stored in a Json::Value. - static const UInt maxUInt; - -# if defined(JSON_HAS_INT64) - /// Minimum signed 64 bits int value that can be stored in a Json::Value. - static const Int64 minInt64; - /// Maximum signed 64 bits int value that can be stored in a Json::Value. - static const Int64 maxInt64; - /// Maximum unsigned 64 bits int value that can be stored in a Json::Value. - static const UInt64 maxUInt64; -#endif // defined(JSON_HAS_INT64) - - private: -#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION -# ifndef JSON_VALUE_USE_INTERNAL_MAP - class CZString - { - public: - enum DuplicationPolicy - { - noDuplication = 0, - duplicate, - duplicateOnCopy - }; - CZString( ArrayIndex index ); - CZString( const char *cstr, DuplicationPolicy allocate ); - CZString( const CZString &other ); - ~CZString(); - CZString &operator =( const CZString &other ); - bool operator<( const CZString &other ) const; - bool operator==( const CZString &other ) const; - ArrayIndex index() const; - const char *c_str() const; - bool isStaticString() const; - private: - void swap( CZString &other ); - const char *cstr_; - ArrayIndex index_; - }; - - public: -# ifndef JSON_USE_CPPTL_SMALLMAP - typedef std::map ObjectValues; -# else - typedef CppTL::SmallMap ObjectValues; -# endif // ifndef JSON_USE_CPPTL_SMALLMAP -# endif // ifndef JSON_VALUE_USE_INTERNAL_MAP -#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION - - public: - /** \brief Create a default Value of the given type. - - This is a very useful constructor. - To create an empty array, pass arrayValue. - To create an empty object, pass objectValue. - Another Value can then be set to this one by assignment. - This is useful since clear() and resize() will not alter types. - - Examples: - \code - Json::Value null_value; // null - Json::Value arr_value(Json::arrayValue); // [] - Json::Value obj_value(Json::objectValue); // {} - \endcode - */ - Value( ValueType type = nullValue ); - Value( Int value ); - Value( UInt value ); -#if defined(JSON_HAS_INT64) - Value( Int64 value ); - Value( UInt64 value ); -#endif // if defined(JSON_HAS_INT64) - Value( double value ); - Value( const char *value ); - Value( const char *beginValue, const char *endValue ); - /** \brief Constructs a value from a static string. - - * Like other value string constructor but do not duplicate the string for - * internal storage. The given string must remain alive after the call to this - * constructor. - * Example of usage: - * \code - * Json::Value aValue( StaticString("some text") ); - * \endcode - */ - Value( const StaticString &value ); - Value( const std::string &value ); -# ifdef JSON_USE_CPPTL - Value( const CppTL::ConstString &value ); -# endif - Value( bool value ); - Value( const Value &other ); - ~Value(); - - Value &operator=( const Value &other ); - /// Swap values. - /// \note Currently, comments are intentionally not swapped, for - /// both logic and efficiency. - void swap( Value &other ); - - ValueType type() const; - - bool operator <( const Value &other ) const; - bool operator <=( const Value &other ) const; - bool operator >=( const Value &other ) const; - bool operator >( const Value &other ) const; - - bool operator ==( const Value &other ) const; - bool operator !=( const Value &other ) const; - - int compare( const Value &other ) const; - - const char *asCString() const; - std::string asString() const; -# ifdef JSON_USE_CPPTL - CppTL::ConstString asConstString() const; -# endif - Int asInt() const; - UInt asUInt() const; -#if defined(JSON_HAS_INT64) - Int64 asInt64() const; - UInt64 asUInt64() const; -#endif // if defined(JSON_HAS_INT64) - LargestInt asLargestInt() const; - LargestUInt asLargestUInt() const; - float asFloat() const; - double asDouble() const; - bool asBool() const; - - bool isNull() const; - bool isBool() const; - bool isInt() const; - bool isInt64() const; - bool isUInt() const; - bool isUInt64() const; - bool isIntegral() const; - bool isDouble() const; - bool isNumeric() const; - bool isString() const; - bool isArray() const; - bool isObject() const; - - bool isConvertibleTo( ValueType other ) const; - - /// Number of values in array or object - ArrayIndex size() const; - - /// \brief Return true if empty array, empty object, or null; - /// otherwise, false. - bool empty() const; - - /// Return isNull() - bool operator!() const; - - /// Remove all object members and array elements. - /// \pre type() is arrayValue, objectValue, or nullValue - /// \post type() is unchanged - void clear(); - - /// Resize the array to size elements. - /// New elements are initialized to null. - /// May only be called on nullValue or arrayValue. - /// \pre type() is arrayValue or nullValue - /// \post type() is arrayValue - void resize( ArrayIndex size ); - - /// Access an array element (zero based index ). - /// If the array contains less than index element, then null value are inserted - /// in the array so that its size is index+1. - /// (You may need to say 'value[0u]' to get your compiler to distinguish - /// this from the operator[] which takes a string.) - Value &operator[]( ArrayIndex index ); - - /// Access an array element (zero based index ). - /// If the array contains less than index element, then null value are inserted - /// in the array so that its size is index+1. - /// (You may need to say 'value[0u]' to get your compiler to distinguish - /// this from the operator[] which takes a string.) - Value &operator[]( int index ); - - /// Access an array element (zero based index ) - /// (You may need to say 'value[0u]' to get your compiler to distinguish - /// this from the operator[] which takes a string.) - const Value &operator[]( ArrayIndex index ) const; - - /// Access an array element (zero based index ) - /// (You may need to say 'value[0u]' to get your compiler to distinguish - /// this from the operator[] which takes a string.) - const Value &operator[]( int index ) const; - - /// If the array contains at least index+1 elements, returns the element value, - /// otherwise returns defaultValue. - Value get( ArrayIndex index, - const Value &defaultValue ) const; - /// Return true if index < size(). - bool isValidIndex( ArrayIndex index ) const; - /// \brief Append value to array at the end. - /// - /// Equivalent to jsonvalue[jsonvalue.size()] = value; - Value &append( const Value &value ); - - /// Access an object value by name, create a null member if it does not exist. - Value &operator[]( const char *key ); - /// Access an object value by name, returns null if there is no member with that name. - const Value &operator[]( const char *key ) const; - /// Access an object value by name, create a null member if it does not exist. - Value &operator[]( const std::string &key ); - /// Access an object value by name, returns null if there is no member with that name. - const Value &operator[]( const std::string &key ) const; - /** \brief Access an object value by name, create a null member if it does not exist. - - * If the object as no entry for that name, then the member name used to store - * the new entry is not duplicated. - * Example of use: - * \code - * Json::Value object; - * static const StaticString code("code"); - * object[code] = 1234; - * \endcode - */ - Value &operator[]( const StaticString &key ); -# ifdef JSON_USE_CPPTL - /// Access an object value by name, create a null member if it does not exist. - Value &operator[]( const CppTL::ConstString &key ); - /// Access an object value by name, returns null if there is no member with that name. - const Value &operator[]( const CppTL::ConstString &key ) const; -# endif - /// Return the member named key if it exist, defaultValue otherwise. - Value get( const char *key, - const Value &defaultValue ) const; - /// Return the member named key if it exist, defaultValue otherwise. - Value get( const std::string &key, - const Value &defaultValue ) const; -# ifdef JSON_USE_CPPTL - /// Return the member named key if it exist, defaultValue otherwise. - Value get( const CppTL::ConstString &key, - const Value &defaultValue ) const; -# endif - /// \brief Remove and return the named member. - /// - /// Do nothing if it did not exist. - /// \return the removed Value, or null. - /// \pre type() is objectValue or nullValue - /// \post type() is unchanged - Value removeMember( const char* key ); - /// Same as removeMember(const char*) - Value removeMember( const std::string &key ); - - /// Return true if the object has a member named key. - bool isMember( const char *key ) const; - /// Return true if the object has a member named key. - bool isMember( const std::string &key ) const; -# ifdef JSON_USE_CPPTL - /// Return true if the object has a member named key. - bool isMember( const CppTL::ConstString &key ) const; -# endif - - /// \brief Return a list of the member names. - /// - /// If null, return an empty list. - /// \pre type() is objectValue or nullValue - /// \post if type() was nullValue, it remains nullValue - Members getMemberNames() const; - -//# ifdef JSON_USE_CPPTL -// EnumMemberNames enumMemberNames() const; -// EnumValues enumValues() const; -//# endif - - /// Comments must be //... or /* ... */ - void setComment( const char *comment, - CommentPlacement placement ); - /// Comments must be //... or /* ... */ - void setComment( const std::string &comment, - CommentPlacement placement ); - bool hasComment( CommentPlacement placement ) const; - /// Include delimiters and embedded newlines. - std::string getComment( CommentPlacement placement ) const; - - std::string toStyledString() const; - - const_iterator begin() const; - const_iterator end() const; - - iterator begin(); - iterator end(); - - private: - Value &resolveReference( const char *key, - bool isStatic ); - -# ifdef JSON_VALUE_USE_INTERNAL_MAP - inline bool isItemAvailable() const - { - return itemIsUsed_ == 0; - } - - inline void setItemUsed( bool isUsed = true ) - { - itemIsUsed_ = isUsed ? 1 : 0; - } - - inline bool isMemberNameStatic() const - { - return memberNameIsStatic_ == 0; - } - - inline void setMemberNameIsStatic( bool isStatic ) - { - memberNameIsStatic_ = isStatic ? 1 : 0; - } -# endif // # ifdef JSON_VALUE_USE_INTERNAL_MAP - - private: - struct CommentInfo - { - CommentInfo(); - ~CommentInfo(); - - void setComment( const char *text ); - - char *comment_; - }; - - //struct MemberNamesTransform - //{ - // typedef const char *result_type; - // const char *operator()( const CZString &name ) const - // { - // return name.c_str(); - // } - //}; - - union ValueHolder - { - LargestInt int_; - LargestUInt uint_; - double real_; - bool bool_; - char *string_; -# ifdef JSON_VALUE_USE_INTERNAL_MAP - ValueInternalArray *array_; - ValueInternalMap *map_; -#else - ObjectValues *map_; -# endif - } value_; - ValueType type_ : 8; - int allocated_ : 1; // Notes: if declared as bool, bitfield is useless. -# ifdef JSON_VALUE_USE_INTERNAL_MAP - unsigned int itemIsUsed_ : 1; // used by the ValueInternalMap container. - int memberNameIsStatic_ : 1; // used by the ValueInternalMap container. -# endif - CommentInfo *comments_; - }; - - - /** \brief Experimental and untested: represents an element of the "path" to access a node. - */ - class PathArgument - { - public: - friend class Path; - - PathArgument(); - PathArgument( ArrayIndex index ); - PathArgument( const char *key ); - PathArgument( const std::string &key ); - - private: - enum Kind - { - kindNone = 0, - kindIndex, - kindKey - }; - std::string key_; - ArrayIndex index_; - Kind kind_; - }; - - /** \brief Experimental and untested: represents a "path" to access a node. - * - * Syntax: - * - "." => root node - * - ".[n]" => elements at index 'n' of root node (an array value) - * - ".name" => member named 'name' of root node (an object value) - * - ".name1.name2.name3" - * - ".[0][1][2].name1[3]" - * - ".%" => member name is provided as parameter - * - ".[%]" => index is provied as parameter - */ - class Path - { - public: - Path( const std::string &path, - const PathArgument &a1 = PathArgument(), - const PathArgument &a2 = PathArgument(), - const PathArgument &a3 = PathArgument(), - const PathArgument &a4 = PathArgument(), - const PathArgument &a5 = PathArgument() ); - - const Value &resolve( const Value &root ) const; - Value resolve( const Value &root, - const Value &defaultValue ) const; - /// Creates the "path" to access the specified node and returns a reference on the node. - Value &make( Value &root ) const; - - private: - typedef std::vector InArgs; - typedef std::vector Args; - - void makePath( const std::string &path, - const InArgs &in ); - void addPathInArg( const std::string &path, - const InArgs &in, - InArgs::const_iterator &itInArg, - PathArgument::Kind kind ); - void invalidPath( const std::string &path, - int location ); - - Args args_; - }; - - - -#ifdef JSON_VALUE_USE_INTERNAL_MAP - /** \brief Allocator to customize Value internal map. - * Below is an example of a simple implementation (default implementation actually - * use memory pool for speed). - * \code - class DefaultValueMapAllocator : public ValueMapAllocator - { - public: // overridden from ValueMapAllocator - virtual ValueInternalMap *newMap() - { - return new ValueInternalMap(); - } - - virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) - { - return new ValueInternalMap( other ); - } - - virtual void destructMap( ValueInternalMap *map ) - { - delete map; - } - - virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) - { - return new ValueInternalLink[size]; - } - - virtual void releaseMapBuckets( ValueInternalLink *links ) - { - delete [] links; - } - - virtual ValueInternalLink *allocateMapLink() - { - return new ValueInternalLink(); - } - - virtual void releaseMapLink( ValueInternalLink *link ) - { - delete link; - } - }; - * \endcode - */ - class JSON_API ValueMapAllocator - { - public: - virtual ~ValueMapAllocator(); - virtual ValueInternalMap *newMap() = 0; - virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) = 0; - virtual void destructMap( ValueInternalMap *map ) = 0; - virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) = 0; - virtual void releaseMapBuckets( ValueInternalLink *links ) = 0; - virtual ValueInternalLink *allocateMapLink() = 0; - virtual void releaseMapLink( ValueInternalLink *link ) = 0; - }; - - /** \brief ValueInternalMap hash-map bucket chain link (for internal use only). - * \internal previous_ & next_ allows for bidirectional traversal. - */ - class JSON_API ValueInternalLink - { - public: - enum { itemPerLink = 6 }; // sizeof(ValueInternalLink) = 128 on 32 bits architecture. - enum InternalFlags { - flagAvailable = 0, - flagUsed = 1 - }; - - ValueInternalLink(); - - ~ValueInternalLink(); - - Value items_[itemPerLink]; - char *keys_[itemPerLink]; - ValueInternalLink *previous_; - ValueInternalLink *next_; - }; - - - /** \brief A linked page based hash-table implementation used internally by Value. - * \internal ValueInternalMap is a tradional bucket based hash-table, with a linked - * list in each bucket to handle collision. There is an addional twist in that - * each node of the collision linked list is a page containing a fixed amount of - * value. This provides a better compromise between memory usage and speed. - * - * Each bucket is made up of a chained list of ValueInternalLink. The last - * link of a given bucket can be found in the 'previous_' field of the following bucket. - * The last link of the last bucket is stored in tailLink_ as it has no following bucket. - * Only the last link of a bucket may contains 'available' item. The last link always - * contains at least one element unless is it the bucket one very first link. - */ - class JSON_API ValueInternalMap - { - friend class ValueIteratorBase; - friend class Value; - public: - typedef unsigned int HashKey; - typedef unsigned int BucketIndex; - -# ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION - struct IteratorState - { - IteratorState() - : map_(0) - , link_(0) - , itemIndex_(0) - , bucketIndex_(0) - { - } - ValueInternalMap *map_; - ValueInternalLink *link_; - BucketIndex itemIndex_; - BucketIndex bucketIndex_; - }; -# endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION - - ValueInternalMap(); - ValueInternalMap( const ValueInternalMap &other ); - ValueInternalMap &operator =( const ValueInternalMap &other ); - ~ValueInternalMap(); - - void swap( ValueInternalMap &other ); - - BucketIndex size() const; - - void clear(); - - bool reserveDelta( BucketIndex growth ); - - bool reserve( BucketIndex newItemCount ); - - const Value *find( const char *key ) const; - - Value *find( const char *key ); - - Value &resolveReference( const char *key, - bool isStatic ); - - void remove( const char *key ); - - void doActualRemove( ValueInternalLink *link, - BucketIndex index, - BucketIndex bucketIndex ); - - ValueInternalLink *&getLastLinkInBucket( BucketIndex bucketIndex ); - - Value &setNewItem( const char *key, - bool isStatic, - ValueInternalLink *link, - BucketIndex index ); - - Value &unsafeAdd( const char *key, - bool isStatic, - HashKey hashedKey ); - - HashKey hash( const char *key ) const; - - int compare( const ValueInternalMap &other ) const; - - private: - void makeBeginIterator( IteratorState &it ) const; - void makeEndIterator( IteratorState &it ) const; - static bool equals( const IteratorState &x, const IteratorState &other ); - static void increment( IteratorState &iterator ); - static void incrementBucket( IteratorState &iterator ); - static void decrement( IteratorState &iterator ); - static const char *key( const IteratorState &iterator ); - static const char *key( const IteratorState &iterator, bool &isStatic ); - static Value &value( const IteratorState &iterator ); - static int distance( const IteratorState &x, const IteratorState &y ); - - private: - ValueInternalLink *buckets_; - ValueInternalLink *tailLink_; - BucketIndex bucketsSize_; - BucketIndex itemCount_; - }; - - /** \brief A simplified deque implementation used internally by Value. - * \internal - * It is based on a list of fixed "page", each page contains a fixed number of items. - * Instead of using a linked-list, a array of pointer is used for fast item look-up. - * Look-up for an element is as follow: - * - compute page index: pageIndex = itemIndex / itemsPerPage - * - look-up item in page: pages_[pageIndex][itemIndex % itemsPerPage] - * - * Insertion is amortized constant time (only the array containing the index of pointers - * need to be reallocated when items are appended). - */ - class JSON_API ValueInternalArray - { - friend class Value; - friend class ValueIteratorBase; - public: - enum { itemsPerPage = 8 }; // should be a power of 2 for fast divide and modulo. - typedef Value::ArrayIndex ArrayIndex; - typedef unsigned int PageIndex; - -# ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION - struct IteratorState // Must be a POD - { - IteratorState() - : array_(0) - , currentPageIndex_(0) - , currentItemIndex_(0) - { - } - ValueInternalArray *array_; - Value **currentPageIndex_; - unsigned int currentItemIndex_; - }; -# endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION - - ValueInternalArray(); - ValueInternalArray( const ValueInternalArray &other ); - ValueInternalArray &operator =( const ValueInternalArray &other ); - ~ValueInternalArray(); - void swap( ValueInternalArray &other ); - - void clear(); - void resize( ArrayIndex newSize ); - - Value &resolveReference( ArrayIndex index ); - - Value *find( ArrayIndex index ) const; - - ArrayIndex size() const; - - int compare( const ValueInternalArray &other ) const; - - private: - static bool equals( const IteratorState &x, const IteratorState &other ); - static void increment( IteratorState &iterator ); - static void decrement( IteratorState &iterator ); - static Value &dereference( const IteratorState &iterator ); - static Value &unsafeDereference( const IteratorState &iterator ); - static int distance( const IteratorState &x, const IteratorState &y ); - static ArrayIndex indexOf( const IteratorState &iterator ); - void makeBeginIterator( IteratorState &it ) const; - void makeEndIterator( IteratorState &it ) const; - void makeIterator( IteratorState &it, ArrayIndex index ) const; - - void makeIndexValid( ArrayIndex index ); - - Value **pages_; - ArrayIndex size_; - PageIndex pageCount_; - }; - - /** \brief Experimental: do not use. Allocator to customize Value internal array. - * Below is an example of a simple implementation (actual implementation use - * memory pool). - \code -class DefaultValueArrayAllocator : public ValueArrayAllocator -{ -public: // overridden from ValueArrayAllocator - virtual ~DefaultValueArrayAllocator() - { - } - - virtual ValueInternalArray *newArray() - { - return new ValueInternalArray(); - } - - virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) - { - return new ValueInternalArray( other ); - } - - virtual void destruct( ValueInternalArray *array ) - { - delete array; - } - - virtual void reallocateArrayPageIndex( Value **&indexes, - ValueInternalArray::PageIndex &indexCount, - ValueInternalArray::PageIndex minNewIndexCount ) - { - ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1; - if ( minNewIndexCount > newIndexCount ) - newIndexCount = minNewIndexCount; - void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount ); - if ( !newIndexes ) - throw std::bad_alloc(); - indexCount = newIndexCount; - indexes = static_cast( newIndexes ); - } - virtual void releaseArrayPageIndex( Value **indexes, - ValueInternalArray::PageIndex indexCount ) - { - if ( indexes ) - free( indexes ); - } - - virtual Value *allocateArrayPage() - { - return static_cast( malloc( sizeof(Value) * ValueInternalArray::itemsPerPage ) ); - } - - virtual void releaseArrayPage( Value *value ) - { - if ( value ) - free( value ); - } -}; - \endcode - */ - class JSON_API ValueArrayAllocator - { - public: - virtual ~ValueArrayAllocator(); - virtual ValueInternalArray *newArray() = 0; - virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) = 0; - virtual void destructArray( ValueInternalArray *array ) = 0; - /** \brief Reallocate array page index. - * Reallocates an array of pointer on each page. - * \param indexes [input] pointer on the current index. May be \c NULL. - * [output] pointer on the new index of at least - * \a minNewIndexCount pages. - * \param indexCount [input] current number of pages in the index. - * [output] number of page the reallocated index can handle. - * \b MUST be >= \a minNewIndexCount. - * \param minNewIndexCount Minimum number of page the new index must be able to - * handle. - */ - virtual void reallocateArrayPageIndex( Value **&indexes, - ValueInternalArray::PageIndex &indexCount, - ValueInternalArray::PageIndex minNewIndexCount ) = 0; - virtual void releaseArrayPageIndex( Value **indexes, - ValueInternalArray::PageIndex indexCount ) = 0; - virtual Value *allocateArrayPage() = 0; - virtual void releaseArrayPage( Value *value ) = 0; - }; -#endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP - - - /** \brief base class for Value iterators. - * - */ - class ValueIteratorBase - { - public: - typedef unsigned int size_t; - typedef int difference_type; - typedef ValueIteratorBase SelfType; - - ValueIteratorBase(); -#ifndef JSON_VALUE_USE_INTERNAL_MAP - explicit ValueIteratorBase( const Value::ObjectValues::iterator ¤t ); -#else - ValueIteratorBase( const ValueInternalArray::IteratorState &state ); - ValueIteratorBase( const ValueInternalMap::IteratorState &state ); -#endif - - bool operator ==( const SelfType &other ) const - { - return isEqual( other ); - } - - bool operator !=( const SelfType &other ) const - { - return !isEqual( other ); - } - - difference_type operator -( const SelfType &other ) const - { - return computeDistance( other ); - } - - /// Return either the index or the member name of the referenced value as a Value. - Value key() const; - - /// Return the index of the referenced Value. -1 if it is not an arrayValue. - UInt index() const; - - /// Return the member name of the referenced Value. "" if it is not an objectValue. - const char *memberName() const; - - protected: - Value &deref() const; - - void increment(); - - void decrement(); - - difference_type computeDistance( const SelfType &other ) const; - - bool isEqual( const SelfType &other ) const; - - void copy( const SelfType &other ); - - private: -#ifndef JSON_VALUE_USE_INTERNAL_MAP - Value::ObjectValues::iterator current_; - // Indicates that iterator is for a null value. - bool isNull_; -#else - union - { - ValueInternalArray::IteratorState array_; - ValueInternalMap::IteratorState map_; - } iterator_; - bool isArray_; -#endif - }; - - /** \brief const iterator for object and array value. - * - */ - class ValueConstIterator : public ValueIteratorBase - { - friend class Value; - public: - typedef unsigned int size_t; - typedef int difference_type; - typedef const Value &reference; - typedef const Value *pointer; - typedef ValueConstIterator SelfType; - - ValueConstIterator(); - private: - /*! \internal Use by Value to create an iterator. - */ -#ifndef JSON_VALUE_USE_INTERNAL_MAP - explicit ValueConstIterator( const Value::ObjectValues::iterator ¤t ); -#else - ValueConstIterator( const ValueInternalArray::IteratorState &state ); - ValueConstIterator( const ValueInternalMap::IteratorState &state ); -#endif - public: - SelfType &operator =( const ValueIteratorBase &other ); - - SelfType operator++( int ) - { - SelfType temp( *this ); - ++*this; - return temp; - } - - SelfType operator--( int ) - { - SelfType temp( *this ); - --*this; - return temp; - } - - SelfType &operator--() - { - decrement(); - return *this; - } - - SelfType &operator++() - { - increment(); - return *this; - } - - reference operator *() const - { - return deref(); - } - }; - - - /** \brief Iterator for object and array value. - */ - class ValueIterator : public ValueIteratorBase - { - friend class Value; - public: - typedef unsigned int size_t; - typedef int difference_type; - typedef Value &reference; - typedef Value *pointer; - typedef ValueIterator SelfType; - - ValueIterator(); - ValueIterator( const ValueConstIterator &other ); - ValueIterator( const ValueIterator &other ); - private: - /*! \internal Use by Value to create an iterator. - */ -#ifndef JSON_VALUE_USE_INTERNAL_MAP - explicit ValueIterator( const Value::ObjectValues::iterator ¤t ); -#else - ValueIterator( const ValueInternalArray::IteratorState &state ); - ValueIterator( const ValueInternalMap::IteratorState &state ); -#endif - public: - - SelfType &operator =( const SelfType &other ); - - SelfType operator++( int ) - { - SelfType temp( *this ); - ++*this; - return temp; - } - - SelfType operator--( int ) - { - SelfType temp( *this ); - --*this; - return temp; - } - - SelfType &operator--() - { - decrement(); - return *this; - } - - SelfType &operator++() - { - increment(); - return *this; - } - - reference operator *() const - { - return deref(); - } - }; - - -} // namespace Json - - -#endif // CPPTL_JSON_H_INCLUDED diff --git a/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/writer.h b/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/writer.h deleted file mode 100755 index e222d93..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/jsoncpp/writer.h +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright 2007-2010 Baptiste Lepilleur -// Distributed under MIT license, or public domain if desired and -// recognized in your jurisdiction. -// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE - -#ifndef JSON_WRITER_H_INCLUDED -# define JSON_WRITER_H_INCLUDED - -#if !defined(JSON_IS_AMALGAMATION) -# include "value.h" -#endif // if !defined(JSON_IS_AMALGAMATION) -# include -# include - -namespace Json { - - class Value; - - /** \brief Abstract class for writers. - */ - class JSON_API Writer - { - public: - virtual ~Writer(); - - virtual std::string write( const Value &root ) = 0; - }; - - /** \brief Outputs a Value in JSON format without formatting (not human friendly). - * - * The JSON document is written in a single line. It is not intended for 'human' consumption, - * but may be usefull to support feature such as RPC where bandwith is limited. - * \sa Reader, Value - */ - class JSON_API FastWriter : public Writer - { - public: - FastWriter(); - virtual ~FastWriter(){} - - void enableYAMLCompatibility(); - - public: // overridden from Writer - virtual std::string write( const Value &root ); - - private: - void writeValue( const Value &value ); - - std::string document_; - bool yamlCompatiblityEnabled_; - }; - - /** \brief Writes a Value in JSON format in a human friendly way. - * - * The rules for line break and indent are as follow: - * - Object value: - * - if empty then print {} without indent and line break - * - if not empty the print '{', line break & indent, print one value per line - * and then unindent and line break and print '}'. - * - Array value: - * - if empty then print [] without indent and line break - * - if the array contains no object value, empty array or some other value types, - * and all the values fit on one lines, then print the array on a single line. - * - otherwise, it the values do not fit on one line, or the array contains - * object or non empty array, then print one value per line. - * - * If the Value have comments then they are outputed according to their #CommentPlacement. - * - * \sa Reader, Value, Value::setComment() - */ - class JSON_API StyledWriter: public Writer - { - public: - StyledWriter(); - virtual ~StyledWriter(){} - - public: // overridden from Writer - /** \brief Serialize a Value in JSON format. - * \param root Value to serialize. - * \return String containing the JSON document that represents the root value. - */ - virtual std::string write( const Value &root ); - - private: - void writeValue( const Value &value ); - void writeArrayValue( const Value &value ); - bool isMultineArray( const Value &value ); - void pushValue( const std::string &value ); - void writeIndent(); - void writeWithIndent( const std::string &value ); - void indent(); - void unindent(); - void writeCommentBeforeValue( const Value &root ); - void writeCommentAfterValueOnSameLine( const Value &root ); - bool hasCommentForValue( const Value &value ); - static std::string normalizeEOL( const std::string &text ); - - typedef std::vector ChildValues; - - ChildValues childValues_; - std::string document_; - std::string indentString_; - int rightMargin_; - int indentSize_; - bool addChildValues_; - }; - - /** \brief Writes a Value in JSON format in a human friendly way, - to a stream rather than to a string. - * - * The rules for line break and indent are as follow: - * - Object value: - * - if empty then print {} without indent and line break - * - if not empty the print '{', line break & indent, print one value per line - * and then unindent and line break and print '}'. - * - Array value: - * - if empty then print [] without indent and line break - * - if the array contains no object value, empty array or some other value types, - * and all the values fit on one lines, then print the array on a single line. - * - otherwise, it the values do not fit on one line, or the array contains - * object or non empty array, then print one value per line. - * - * If the Value have comments then they are outputed according to their #CommentPlacement. - * - * \param indentation Each level will be indented by this amount extra. - * \sa Reader, Value, Value::setComment() - */ - class JSON_API StyledStreamWriter - { - public: - StyledStreamWriter( std::string indentation="\t" ); - ~StyledStreamWriter(){} - - public: - /** \brief Serialize a Value in JSON format. - * \param out Stream to write to. (Can be ostringstream, e.g.) - * \param root Value to serialize. - * \note There is no point in deriving from Writer, since write() should not return a value. - */ - void write( std::ostream &out, const Value &root ); - - private: - void writeValue( const Value &value ); - void writeArrayValue( const Value &value ); - bool isMultineArray( const Value &value ); - void pushValue( const std::string &value ); - void writeIndent(); - void writeWithIndent( const std::string &value ); - void indent(); - void unindent(); - void writeCommentBeforeValue( const Value &root ); - void writeCommentAfterValueOnSameLine( const Value &root ); - bool hasCommentForValue( const Value &value ); - static std::string normalizeEOL( const std::string &text ); - - typedef std::vector ChildValues; - - ChildValues childValues_; - std::ostream* document_; - std::string indentString_; - int rightMargin_; - std::string indentation_; - bool addChildValues_; - }; - -# if defined(JSON_HAS_INT64) - std::string JSON_API valueToString( Int value ); - std::string JSON_API valueToString( UInt value ); -# endif // if defined(JSON_HAS_INT64) - std::string JSON_API valueToString( LargestInt value ); - std::string JSON_API valueToString( LargestUInt value ); - std::string JSON_API valueToString( double value ); - std::string JSON_API valueToString( bool value ); - std::string JSON_API valueToQuotedString( const char *value ); - - /// \brief Output using the StyledStreamWriter. - /// \see Json::operator>>() - std::ostream& operator<<( std::ostream&, const Value &root ); - -} // namespace Json - - - -#endif // JSON_WRITER_H_INCLUDED diff --git a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv.h b/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv.h deleted file mode 100755 index 3bebe64..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2011 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_H_ // NOLINT -#define INCLUDE_LIBYUV_H_ - -#include "libyuv/basic_types.h" -#include "libyuv/compare.h" -#include "libyuv/convert.h" -#include "libyuv/convert_argb.h" -#include "libyuv/convert_from.h" -#include "libyuv/convert_from_argb.h" -#include "libyuv/cpu_id.h" -#include "libyuv/format_conversion.h" -#include "libyuv/mjpeg_decoder.h" -#include "libyuv/planar_functions.h" -#include "libyuv/rotate.h" -#include "libyuv/rotate_argb.h" -#include "libyuv/row.h" -#include "libyuv/scale.h" -#include "libyuv/scale_argb.h" -#include "libyuv/scale_row.h" -#include "libyuv/version.h" -#include "libyuv/video_common.h" - -#endif // INCLUDE_LIBYUV_H_ NOLINT diff --git a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/basic_types.h b/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/basic_types.h deleted file mode 100755 index beb750b..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/basic_types.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright 2011 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_BASIC_TYPES_H_ // NOLINT -#define INCLUDE_LIBYUV_BASIC_TYPES_H_ - -#include // for NULL, size_t - -#if defined(__ANDROID__) || (defined(_MSC_VER) && (_MSC_VER < 1600)) -#include // for uintptr_t on x86 -#else -#include // for uintptr_t -#endif - -#ifndef GG_LONGLONG -#ifndef INT_TYPES_DEFINED -#define INT_TYPES_DEFINED -#ifdef COMPILER_MSVC -typedef unsigned __int64 uint64; -typedef __int64 int64; -#ifndef INT64_C -#define INT64_C(x) x ## I64 -#endif -#ifndef UINT64_C -#define UINT64_C(x) x ## UI64 -#endif -#define INT64_F "I64" -#else // COMPILER_MSVC -#if defined(__LP64__) && !defined(__OpenBSD__) && !defined(__APPLE__) -typedef unsigned long uint64; // NOLINT -typedef long int64; // NOLINT -#ifndef INT64_C -#define INT64_C(x) x ## L -#endif -#ifndef UINT64_C -#define UINT64_C(x) x ## UL -#endif -#define INT64_F "l" -#else // defined(__LP64__) && !defined(__OpenBSD__) && !defined(__APPLE__) -typedef unsigned long long uint64; // NOLINT -typedef long long int64; // NOLINT -#ifndef INT64_C -#define INT64_C(x) x ## LL -#endif -#ifndef UINT64_C -#define UINT64_C(x) x ## ULL -#endif -#define INT64_F "ll" -#endif // __LP64__ -#endif // COMPILER_MSVC -typedef unsigned int uint32; -typedef int int32; -typedef unsigned short uint16; // NOLINT -typedef short int16; // NOLINT -typedef unsigned char uint8; -typedef signed char int8; -#endif // INT_TYPES_DEFINED -#endif // GG_LONGLONG - -// Detect compiler is for x86 or x64. -#if defined(__x86_64__) || defined(_M_X64) || \ - defined(__i386__) || defined(_M_IX86) -#define CPU_X86 1 -#endif -// Detect compiler is for ARM. -#if defined(__arm__) || defined(_M_ARM) -#define CPU_ARM 1 -#endif - -#ifndef ALIGNP -#ifdef __cplusplus -#define ALIGNP(p, t) \ - (reinterpret_cast(((reinterpret_cast(p) + \ - ((t) - 1)) & ~((t) - 1)))) -#else -#define ALIGNP(p, t) \ - ((uint8*)((((uintptr_t)(p) + ((t) - 1)) & ~((t) - 1)))) /* NOLINT */ -#endif -#endif - -#if !defined(LIBYUV_API) -#if defined(_WIN32) || defined(__CYGWIN__) -#if defined(LIBYUV_BUILDING_SHARED_LIBRARY) -#define LIBYUV_API __declspec(dllexport) -#elif defined(LIBYUV_USING_SHARED_LIBRARY) -#define LIBYUV_API __declspec(dllimport) -#else -#define LIBYUV_API -#endif // LIBYUV_BUILDING_SHARED_LIBRARY -#elif defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__APPLE__) && \ - (defined(LIBYUV_BUILDING_SHARED_LIBRARY) || \ - defined(LIBYUV_USING_SHARED_LIBRARY)) -#define LIBYUV_API __attribute__ ((visibility ("default"))) -#else -#define LIBYUV_API -#endif // __GNUC__ -#endif // LIBYUV_API - -#define LIBYUV_BOOL int -#define LIBYUV_FALSE 0 -#define LIBYUV_TRUE 1 - -// Visual C x86 or GCC little endian. -#if defined(__x86_64__) || defined(_M_X64) || \ - defined(__i386__) || defined(_M_IX86) || \ - defined(__arm__) || defined(_M_ARM) || \ - (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) -#define LIBYUV_LITTLE_ENDIAN -#endif - -#endif // INCLUDE_LIBYUV_BASIC_TYPES_H_ NOLINT diff --git a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/compare.h b/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/compare.h deleted file mode 100755 index 5dfac7c..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/compare.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2011 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_COMPARE_H_ // NOLINT -#define INCLUDE_LIBYUV_COMPARE_H_ - -#include "libyuv/basic_types.h" - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -// Compute a hash for specified memory. Seed of 5381 recommended. -LIBYUV_API -uint32 HashDjb2(const uint8* src, uint64 count, uint32 seed); - -// Sum Square Error - used to compute Mean Square Error or PSNR. -LIBYUV_API -uint64 ComputeSumSquareError(const uint8* src_a, - const uint8* src_b, int count); - -LIBYUV_API -uint64 ComputeSumSquareErrorPlane(const uint8* src_a, int stride_a, - const uint8* src_b, int stride_b, - int width, int height); - -static const int kMaxPsnr = 128; - -LIBYUV_API -double SumSquareErrorToPsnr(uint64 sse, uint64 count); - -LIBYUV_API -double CalcFramePsnr(const uint8* src_a, int stride_a, - const uint8* src_b, int stride_b, - int width, int height); - -LIBYUV_API -double I420Psnr(const uint8* src_y_a, int stride_y_a, - const uint8* src_u_a, int stride_u_a, - const uint8* src_v_a, int stride_v_a, - const uint8* src_y_b, int stride_y_b, - const uint8* src_u_b, int stride_u_b, - const uint8* src_v_b, int stride_v_b, - int width, int height); - -LIBYUV_API -double CalcFrameSsim(const uint8* src_a, int stride_a, - const uint8* src_b, int stride_b, - int width, int height); - -LIBYUV_API -double I420Ssim(const uint8* src_y_a, int stride_y_a, - const uint8* src_u_a, int stride_u_a, - const uint8* src_v_a, int stride_v_a, - const uint8* src_y_b, int stride_y_b, - const uint8* src_u_b, int stride_u_b, - const uint8* src_v_b, int stride_v_b, - int width, int height); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_COMPARE_H_ NOLINT diff --git a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/convert.h b/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/convert.h deleted file mode 100755 index 1bd45c8..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/convert.h +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Copyright 2011 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_CONVERT_H_ // NOLINT -#define INCLUDE_LIBYUV_CONVERT_H_ - -#include "libyuv/basic_types.h" -// TODO(fbarchard): Remove the following headers includes. -#include "libyuv/convert_from.h" -#include "libyuv/planar_functions.h" -#include "libyuv/rotate.h" - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -// Convert I444 to I420. -LIBYUV_API -int I444ToI420(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert I422 to I420. -LIBYUV_API -int I422ToI420(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert I411 to I420. -LIBYUV_API -int I411ToI420(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Copy I420 to I420. -#define I420ToI420 I420Copy -LIBYUV_API -int I420Copy(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert I400 (grey) to I420. -LIBYUV_API -int I400ToI420(const uint8* src_y, int src_stride_y, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert NV12 to I420. -LIBYUV_API -int NV12ToI420(const uint8* src_y, int src_stride_y, - const uint8* src_uv, int src_stride_uv, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert NV21 to I420. -LIBYUV_API -int NV21ToI420(const uint8* src_y, int src_stride_y, - const uint8* src_vu, int src_stride_vu, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert YUY2 to I420. -LIBYUV_API -int YUY2ToI420(const uint8* src_yuy2, int src_stride_yuy2, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert UYVY to I420. -LIBYUV_API -int UYVYToI420(const uint8* src_uyvy, int src_stride_uyvy, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert M420 to I420. -LIBYUV_API -int M420ToI420(const uint8* src_m420, int src_stride_m420, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert Q420 to I420. -LIBYUV_API -int Q420ToI420(const uint8* src_y, int src_stride_y, - const uint8* src_yuy2, int src_stride_yuy2, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// ARGB little endian (bgra in memory) to I420. -LIBYUV_API -int ARGBToI420(const uint8* src_frame, int src_stride_frame, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// BGRA little endian (argb in memory) to I420. -LIBYUV_API -int BGRAToI420(const uint8* src_frame, int src_stride_frame, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// ABGR little endian (rgba in memory) to I420. -LIBYUV_API -int ABGRToI420(const uint8* src_frame, int src_stride_frame, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// RGBA little endian (abgr in memory) to I420. -LIBYUV_API -int RGBAToI420(const uint8* src_frame, int src_stride_frame, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// RGB little endian (bgr in memory) to I420. -LIBYUV_API -int RGB24ToI420(const uint8* src_frame, int src_stride_frame, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// RGB big endian (rgb in memory) to I420. -LIBYUV_API -int RAWToI420(const uint8* src_frame, int src_stride_frame, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// RGB16 (RGBP fourcc) little endian to I420. -LIBYUV_API -int RGB565ToI420(const uint8* src_frame, int src_stride_frame, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// RGB15 (RGBO fourcc) little endian to I420. -LIBYUV_API -int ARGB1555ToI420(const uint8* src_frame, int src_stride_frame, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// RGB12 (R444 fourcc) little endian to I420. -LIBYUV_API -int ARGB4444ToI420(const uint8* src_frame, int src_stride_frame, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -#ifdef HAVE_JPEG -// src_width/height provided by capture. -// dst_width/height for clipping determine final size. -LIBYUV_API -int MJPGToI420(const uint8* sample, size_t sample_size, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int src_width, int src_height, - int dst_width, int dst_height); - -// Query size of MJPG in pixels. -LIBYUV_API -int MJPGSize(const uint8* sample, size_t sample_size, - int* width, int* height); -#endif - -// Note Bayer formats (BGGR) To I420 are in format_conversion.h - -// Convert camera sample to I420 with cropping, rotation and vertical flip. -// "src_size" is needed to parse MJPG. -// "dst_stride_y" number of bytes in a row of the dst_y plane. -// Normally this would be the same as dst_width, with recommended alignment -// to 16 bytes for better efficiency. -// If rotation of 90 or 270 is used, stride is affected. The caller should -// allocate the I420 buffer according to rotation. -// "dst_stride_u" number of bytes in a row of the dst_u plane. -// Normally this would be the same as (dst_width + 1) / 2, with -// recommended alignment to 16 bytes for better efficiency. -// If rotation of 90 or 270 is used, stride is affected. -// "crop_x" and "crop_y" are starting position for cropping. -// To center, crop_x = (src_width - dst_width) / 2 -// crop_y = (src_height - dst_height) / 2 -// "src_width" / "src_height" is size of src_frame in pixels. -// "src_height" can be negative indicating a vertically flipped image source. -// "crop_width" / "crop_height" is the size to crop the src to. -// Must be less than or equal to src_width/src_height -// Cropping parameters are pre-rotation. -// "rotation" can be 0, 90, 180 or 270. -// "format" is a fourcc. ie 'I420', 'YUY2' -// Returns 0 for successful; -1 for invalid parameter. Non-zero for failure. -LIBYUV_API -int ConvertToI420(const uint8* src_frame, size_t src_size, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int crop_x, int crop_y, - int src_width, int src_height, - int crop_width, int crop_height, - enum RotationMode rotation, - uint32 format); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_CONVERT_H_ NOLINT diff --git a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/convert_argb.h b/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/convert_argb.h deleted file mode 100755 index a18014c..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/convert_argb.h +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Copyright 2012 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_CONVERT_ARGB_H_ // NOLINT -#define INCLUDE_LIBYUV_CONVERT_ARGB_H_ - -#include "libyuv/basic_types.h" -// TODO(fbarchard): Remove the following headers includes -#include "libyuv/convert_from.h" -#include "libyuv/planar_functions.h" -#include "libyuv/rotate.h" - -// TODO(fbarchard): This set of functions should exactly match convert.h -// Add missing Q420. -// TODO(fbarchard): Add tests. Create random content of right size and convert -// with C vs Opt and or to I420 and compare. -// TODO(fbarchard): Some of these functions lack parameter setting. - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -// Alias. -#define ARGBToARGB ARGBCopy - -// Copy ARGB to ARGB. -LIBYUV_API -int ARGBCopy(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert I420 to ARGB. -LIBYUV_API -int I420ToARGB(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert I422 to ARGB. -LIBYUV_API -int I422ToARGB(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert I444 to ARGB. -LIBYUV_API -int I444ToARGB(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert I411 to ARGB. -LIBYUV_API -int I411ToARGB(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert I400 (grey) to ARGB. -LIBYUV_API -int I400ToARGB(const uint8* src_y, int src_stride_y, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Alias. -#define YToARGB I400ToARGB_Reference - -// Convert I400 to ARGB. Reverse of ARGBToI400. -LIBYUV_API -int I400ToARGB_Reference(const uint8* src_y, int src_stride_y, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert NV12 to ARGB. -LIBYUV_API -int NV12ToARGB(const uint8* src_y, int src_stride_y, - const uint8* src_uv, int src_stride_uv, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert NV21 to ARGB. -LIBYUV_API -int NV21ToARGB(const uint8* src_y, int src_stride_y, - const uint8* src_vu, int src_stride_vu, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert M420 to ARGB. -LIBYUV_API -int M420ToARGB(const uint8* src_m420, int src_stride_m420, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// TODO(fbarchard): Convert Q420 to ARGB. -// LIBYUV_API -// int Q420ToARGB(const uint8* src_y, int src_stride_y, -// const uint8* src_yuy2, int src_stride_yuy2, -// uint8* dst_argb, int dst_stride_argb, -// int width, int height); - -// Convert YUY2 to ARGB. -LIBYUV_API -int YUY2ToARGB(const uint8* src_yuy2, int src_stride_yuy2, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert UYVY to ARGB. -LIBYUV_API -int UYVYToARGB(const uint8* src_uyvy, int src_stride_uyvy, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// BGRA little endian (argb in memory) to ARGB. -LIBYUV_API -int BGRAToARGB(const uint8* src_frame, int src_stride_frame, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// ABGR little endian (rgba in memory) to ARGB. -LIBYUV_API -int ABGRToARGB(const uint8* src_frame, int src_stride_frame, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// RGBA little endian (abgr in memory) to ARGB. -LIBYUV_API -int RGBAToARGB(const uint8* src_frame, int src_stride_frame, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Deprecated function name. -#define BG24ToARGB RGB24ToARGB - -// RGB little endian (bgr in memory) to ARGB. -LIBYUV_API -int RGB24ToARGB(const uint8* src_frame, int src_stride_frame, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// RGB big endian (rgb in memory) to ARGB. -LIBYUV_API -int RAWToARGB(const uint8* src_frame, int src_stride_frame, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// RGB16 (RGBP fourcc) little endian to ARGB. -LIBYUV_API -int RGB565ToARGB(const uint8* src_frame, int src_stride_frame, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// RGB15 (RGBO fourcc) little endian to ARGB. -LIBYUV_API -int ARGB1555ToARGB(const uint8* src_frame, int src_stride_frame, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// RGB12 (R444 fourcc) little endian to ARGB. -LIBYUV_API -int ARGB4444ToARGB(const uint8* src_frame, int src_stride_frame, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -#ifdef HAVE_JPEG -// src_width/height provided by capture -// dst_width/height for clipping determine final size. -LIBYUV_API -int MJPGToARGB(const uint8* sample, size_t sample_size, - uint8* dst_argb, int dst_stride_argb, - int src_width, int src_height, - int dst_width, int dst_height); -#endif - -// Note Bayer formats (BGGR) to ARGB are in format_conversion.h. - -// Convert camera sample to ARGB with cropping, rotation and vertical flip. -// "src_size" is needed to parse MJPG. -// "dst_stride_argb" number of bytes in a row of the dst_argb plane. -// Normally this would be the same as dst_width, with recommended alignment -// to 16 bytes for better efficiency. -// If rotation of 90 or 270 is used, stride is affected. The caller should -// allocate the I420 buffer according to rotation. -// "dst_stride_u" number of bytes in a row of the dst_u plane. -// Normally this would be the same as (dst_width + 1) / 2, with -// recommended alignment to 16 bytes for better efficiency. -// If rotation of 90 or 270 is used, stride is affected. -// "crop_x" and "crop_y" are starting position for cropping. -// To center, crop_x = (src_width - dst_width) / 2 -// crop_y = (src_height - dst_height) / 2 -// "src_width" / "src_height" is size of src_frame in pixels. -// "src_height" can be negative indicating a vertically flipped image source. -// "crop_width" / "crop_height" is the size to crop the src to. -// Must be less than or equal to src_width/src_height -// Cropping parameters are pre-rotation. -// "rotation" can be 0, 90, 180 or 270. -// "format" is a fourcc. ie 'I420', 'YUY2' -// Returns 0 for successful; -1 for invalid parameter. Non-zero for failure. -LIBYUV_API -int ConvertToARGB(const uint8* src_frame, size_t src_size, - uint8* dst_argb, int dst_stride_argb, - int crop_x, int crop_y, - int src_width, int src_height, - int crop_width, int crop_height, - enum RotationMode rotation, - uint32 format); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_CONVERT_ARGB_H_ NOLINT diff --git a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/convert_from.h b/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/convert_from.h deleted file mode 100755 index b1cf57f..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/convert_from.h +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright 2011 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_CONVERT_FROM_H_ // NOLINT -#define INCLUDE_LIBYUV_CONVERT_FROM_H_ - -#include "libyuv/basic_types.h" -#include "libyuv/rotate.h" - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -// See Also convert.h for conversions from formats to I420. - -// I420Copy in convert to I420ToI420. - -LIBYUV_API -int I420ToI422(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -LIBYUV_API -int I420ToI444(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -LIBYUV_API -int I420ToI411(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Copy to I400. Source can be I420, I422, I444, I400, NV12 or NV21. -LIBYUV_API -int I400Copy(const uint8* src_y, int src_stride_y, - uint8* dst_y, int dst_stride_y, - int width, int height); - -// TODO(fbarchard): I420ToM420 -// TODO(fbarchard): I420ToQ420 - -LIBYUV_API -int I420ToNV12(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_uv, int dst_stride_uv, - int width, int height); - -LIBYUV_API -int I420ToNV21(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_vu, int dst_stride_vu, - int width, int height); - -LIBYUV_API -int I420ToYUY2(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_frame, int dst_stride_frame, - int width, int height); - -LIBYUV_API -int I420ToUYVY(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_frame, int dst_stride_frame, - int width, int height); - -LIBYUV_API -int I420ToARGB(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -LIBYUV_API -int I420ToBGRA(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -LIBYUV_API -int I420ToABGR(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -LIBYUV_API -int I420ToRGBA(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_rgba, int dst_stride_rgba, - int width, int height); - -LIBYUV_API -int I420ToRGB24(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_frame, int dst_stride_frame, - int width, int height); - -LIBYUV_API -int I420ToRAW(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_frame, int dst_stride_frame, - int width, int height); - -LIBYUV_API -int I420ToRGB565(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_frame, int dst_stride_frame, - int width, int height); - -LIBYUV_API -int I420ToARGB1555(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_frame, int dst_stride_frame, - int width, int height); - -LIBYUV_API -int I420ToARGB4444(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_frame, int dst_stride_frame, - int width, int height); - -// Note Bayer formats (BGGR) To I420 are in format_conversion.h. - -// Convert I420 to specified format. -// "dst_sample_stride" is bytes in a row for the destination. Pass 0 if the -// buffer has contiguous rows. Can be negative. A multiple of 16 is optimal. -LIBYUV_API -int ConvertFromI420(const uint8* y, int y_stride, - const uint8* u, int u_stride, - const uint8* v, int v_stride, - uint8* dst_sample, int dst_sample_stride, - int width, int height, - uint32 format); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_CONVERT_FROM_H_ NOLINT diff --git a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/convert_from_argb.h b/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/convert_from_argb.h deleted file mode 100755 index f0343a7..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/convert_from_argb.h +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright 2012 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_ // NOLINT -#define INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_ - -#include "libyuv/basic_types.h" - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -// Copy ARGB to ARGB. -#define ARGBToARGB ARGBCopy -LIBYUV_API -int ARGBCopy(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert ARGB To BGRA. (alias) -#define ARGBToBGRA BGRAToARGB -LIBYUV_API -int BGRAToARGB(const uint8* src_frame, int src_stride_frame, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert ARGB To ABGR. (alias) -#define ARGBToABGR ABGRToARGB -LIBYUV_API -int ABGRToARGB(const uint8* src_frame, int src_stride_frame, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert ARGB To RGBA. -LIBYUV_API -int ARGBToRGBA(const uint8* src_frame, int src_stride_frame, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert ARGB To RGB24. -LIBYUV_API -int ARGBToRGB24(const uint8* src_argb, int src_stride_argb, - uint8* dst_rgb24, int dst_stride_rgb24, - int width, int height); - -// Convert ARGB To RAW. -LIBYUV_API -int ARGBToRAW(const uint8* src_argb, int src_stride_argb, - uint8* dst_rgb, int dst_stride_rgb, - int width, int height); - -// Convert ARGB To RGB565. -LIBYUV_API -int ARGBToRGB565(const uint8* src_argb, int src_stride_argb, - uint8* dst_rgb565, int dst_stride_rgb565, - int width, int height); - -// Convert ARGB To ARGB1555. -LIBYUV_API -int ARGBToARGB1555(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb1555, int dst_stride_argb1555, - int width, int height); - -// Convert ARGB To ARGB4444. -LIBYUV_API -int ARGBToARGB4444(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb4444, int dst_stride_argb4444, - int width, int height); - -// Convert ARGB To I444. -LIBYUV_API -int ARGBToI444(const uint8* src_argb, int src_stride_argb, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert ARGB To I422. -LIBYUV_API -int ARGBToI422(const uint8* src_argb, int src_stride_argb, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert ARGB To I420. (also in convert.h) -LIBYUV_API -int ARGBToI420(const uint8* src_argb, int src_stride_argb, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert ARGB to J420. (JPeg full range I420). -LIBYUV_API -int ARGBToJ420(const uint8* src_argb, int src_stride_argb, - uint8* dst_yj, int dst_stride_yj, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert ARGB To I411. -LIBYUV_API -int ARGBToI411(const uint8* src_argb, int src_stride_argb, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert ARGB to J400. (JPeg full range). -LIBYUV_API -int ARGBToJ400(const uint8* src_argb, int src_stride_argb, - uint8* dst_yj, int dst_stride_yj, - int width, int height); - -// Convert ARGB to I400. -LIBYUV_API -int ARGBToI400(const uint8* src_argb, int src_stride_argb, - uint8* dst_y, int dst_stride_y, - int width, int height); - -// Convert ARGB To NV12. -LIBYUV_API -int ARGBToNV12(const uint8* src_argb, int src_stride_argb, - uint8* dst_y, int dst_stride_y, - uint8* dst_uv, int dst_stride_uv, - int width, int height); - -// Convert ARGB To NV21. -LIBYUV_API -int ARGBToNV21(const uint8* src_argb, int src_stride_argb, - uint8* dst_y, int dst_stride_y, - uint8* dst_vu, int dst_stride_vu, - int width, int height); - -// Convert ARGB To NV21. -LIBYUV_API -int ARGBToNV21(const uint8* src_argb, int src_stride_argb, - uint8* dst_y, int dst_stride_y, - uint8* dst_vu, int dst_stride_vu, - int width, int height); - -// Convert ARGB To YUY2. -LIBYUV_API -int ARGBToYUY2(const uint8* src_argb, int src_stride_argb, - uint8* dst_yuy2, int dst_stride_yuy2, - int width, int height); - -// Convert ARGB To UYVY. -LIBYUV_API -int ARGBToUYVY(const uint8* src_argb, int src_stride_argb, - uint8* dst_uyvy, int dst_stride_uyvy, - int width, int height); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_CONVERT_FROM_ARGB_H_ NOLINT diff --git a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/cpu_id.h b/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/cpu_id.h deleted file mode 100755 index dc858a8..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/cpu_id.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2011 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_CPU_ID_H_ // NOLINT -#define INCLUDE_LIBYUV_CPU_ID_H_ - -#include "libyuv/basic_types.h" - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -// TODO(fbarchard): Consider overlapping bits for different architectures. -// Internal flag to indicate cpuid requires initialization. -#define kCpuInit 0x1 - -// These flags are only valid on ARM processors. -static const int kCpuHasARM = 0x2; -static const int kCpuHasNEON = 0x4; -// 0x8 reserved for future ARM flag. - -// These flags are only valid on x86 processors. -static const int kCpuHasX86 = 0x10; -static const int kCpuHasSSE2 = 0x20; -static const int kCpuHasSSSE3 = 0x40; -static const int kCpuHasSSE41 = 0x80; -static const int kCpuHasSSE42 = 0x100; -static const int kCpuHasAVX = 0x200; -static const int kCpuHasAVX2 = 0x400; -static const int kCpuHasERMS = 0x800; -static const int kCpuHasFMA3 = 0x1000; -// 0x2000, 0x4000, 0x8000 reserved for future X86 flags. - -// These flags are only valid on MIPS processors. -static const int kCpuHasMIPS = 0x10000; -static const int kCpuHasMIPS_DSP = 0x20000; -static const int kCpuHasMIPS_DSPR2 = 0x40000; - -// Internal function used to auto-init. -LIBYUV_API -int InitCpuFlags(void); - -// Internal function for parsing /proc/cpuinfo. -LIBYUV_API -int ArmCpuCaps(const char* cpuinfo_name); - -// Detect CPU has SSE2 etc. -// Test_flag parameter should be one of kCpuHas constants above. -// returns non-zero if instruction set is detected -static __inline int TestCpuFlag(int test_flag) { - LIBYUV_API extern int cpu_info_; - return (cpu_info_ == kCpuInit ? InitCpuFlags() : cpu_info_) & test_flag; -} - -// For testing, allow CPU flags to be disabled. -// ie MaskCpuFlags(~kCpuHasSSSE3) to disable SSSE3. -// MaskCpuFlags(-1) to enable all cpu specific optimizations. -// MaskCpuFlags(0) to disable all cpu specific optimizations. -LIBYUV_API -void MaskCpuFlags(int enable_flags); - -// Low level cpuid for X86. Returns zeros on other CPUs. -// eax is the info type that you want. -// ecx is typically the cpu number, and should normally be zero. -LIBYUV_API -void CpuId(uint32 eax, uint32 ecx, uint32* cpu_info); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_CPU_ID_H_ NOLINT diff --git a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/format_conversion.h b/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/format_conversion.h deleted file mode 100755 index b18bf05..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/format_conversion.h +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright 2011 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_FORMATCONVERSION_H_ // NOLINT -#define INCLUDE_LIBYUV_FORMATCONVERSION_H_ - -#include "libyuv/basic_types.h" - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -// Convert Bayer RGB formats to I420. -LIBYUV_API -int BayerBGGRToI420(const uint8* src_bayer, int src_stride_bayer, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -LIBYUV_API -int BayerGBRGToI420(const uint8* src_bayer, int src_stride_bayer, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -LIBYUV_API -int BayerGRBGToI420(const uint8* src_bayer, int src_stride_bayer, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -LIBYUV_API -int BayerRGGBToI420(const uint8* src_bayer, int src_stride_bayer, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Temporary API mapper. -#define BayerRGBToI420(b, bs, f, y, ys, u, us, v, vs, w, h) \ - BayerToI420(b, bs, y, ys, u, us, v, vs, w, h, f) - -LIBYUV_API -int BayerToI420(const uint8* src_bayer, int src_stride_bayer, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height, - uint32 src_fourcc_bayer); - -// Convert I420 to Bayer RGB formats. -LIBYUV_API -int I420ToBayerBGGR(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_frame, int dst_stride_frame, - int width, int height); - -LIBYUV_API -int I420ToBayerGBRG(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_frame, int dst_stride_frame, - int width, int height); - -LIBYUV_API -int I420ToBayerGRBG(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_frame, int dst_stride_frame, - int width, int height); - -LIBYUV_API -int I420ToBayerRGGB(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_frame, int dst_stride_frame, - int width, int height); - -// Temporary API mapper. -#define I420ToBayerRGB(y, ys, u, us, v, vs, b, bs, f, w, h) \ - I420ToBayer(y, ys, u, us, v, vs, b, bs, w, h, f) - -LIBYUV_API -int I420ToBayer(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_frame, int dst_stride_frame, - int width, int height, - uint32 dst_fourcc_bayer); - -// Convert Bayer RGB formats to ARGB. -LIBYUV_API -int BayerBGGRToARGB(const uint8* src_bayer, int src_stride_bayer, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -LIBYUV_API -int BayerGBRGToARGB(const uint8* src_bayer, int src_stride_bayer, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -LIBYUV_API -int BayerGRBGToARGB(const uint8* src_bayer, int src_stride_bayer, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -LIBYUV_API -int BayerRGGBToARGB(const uint8* src_bayer, int src_stride_bayer, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Temporary API mapper. -#define BayerRGBToARGB(b, bs, f, a, as, w, h) BayerToARGB(b, bs, a, as, w, h, f) - -LIBYUV_API -int BayerToARGB(const uint8* src_bayer, int src_stride_bayer, - uint8* dst_argb, int dst_stride_argb, - int width, int height, - uint32 src_fourcc_bayer); - -// Converts ARGB to Bayer RGB formats. -LIBYUV_API -int ARGBToBayerBGGR(const uint8* src_argb, int src_stride_argb, - uint8* dst_bayer, int dst_stride_bayer, - int width, int height); - -LIBYUV_API -int ARGBToBayerGBRG(const uint8* src_argb, int src_stride_argb, - uint8* dst_bayer, int dst_stride_bayer, - int width, int height); - -LIBYUV_API -int ARGBToBayerGRBG(const uint8* src_argb, int src_stride_argb, - uint8* dst_bayer, int dst_stride_bayer, - int width, int height); - -LIBYUV_API -int ARGBToBayerRGGB(const uint8* src_argb, int src_stride_argb, - uint8* dst_bayer, int dst_stride_bayer, - int width, int height); - -// Temporary API mapper. -#define ARGBToBayerRGB(a, as, b, bs, f, w, h) ARGBToBayer(b, bs, a, as, w, h, f) - -LIBYUV_API -int ARGBToBayer(const uint8* src_argb, int src_stride_argb, - uint8* dst_bayer, int dst_stride_bayer, - int width, int height, - uint32 dst_fourcc_bayer); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_FORMATCONVERSION_H_ NOLINT diff --git a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/mjpeg_decoder.h b/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/mjpeg_decoder.h deleted file mode 100755 index faffaea..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/mjpeg_decoder.h +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright 2012 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_MJPEG_DECODER_H_ // NOLINT -#define INCLUDE_LIBYUV_MJPEG_DECODER_H_ - -#include "libyuv/basic_types.h" - -#ifdef __cplusplus -// NOTE: For a simplified public API use convert.h MJPGToI420(). - -struct jpeg_common_struct; -struct jpeg_decompress_struct; -struct jpeg_source_mgr; - -namespace libyuv { - -#ifdef __cplusplus -extern "C" { -#endif - -LIBYUV_BOOL ValidateJpeg(const uint8* sample, size_t sample_size); - -#ifdef __cplusplus -} // extern "C" -#endif - -static const uint32 kUnknownDataSize = 0xFFFFFFFF; - -enum JpegSubsamplingType { - kJpegYuv420, - kJpegYuv422, - kJpegYuv411, - kJpegYuv444, - kJpegYuv400, - kJpegUnknown -}; - -struct SetJmpErrorMgr; - -// MJPEG ("Motion JPEG") is a pseudo-standard video codec where the frames are -// simply independent JPEG images with a fixed huffman table (which is omitted). -// It is rarely used in video transmission, but is common as a camera capture -// format, especially in Logitech devices. This class implements a decoder for -// MJPEG frames. -// -// See http://tools.ietf.org/html/rfc2435 -class LIBYUV_API MJpegDecoder { - public: - typedef void (*CallbackFunction)(void* opaque, - const uint8* const* data, - const int* strides, - int rows); - - static const int kColorSpaceUnknown; - static const int kColorSpaceGrayscale; - static const int kColorSpaceRgb; - static const int kColorSpaceYCbCr; - static const int kColorSpaceCMYK; - static const int kColorSpaceYCCK; - - MJpegDecoder(); - ~MJpegDecoder(); - - // Loads a new frame, reads its headers, and determines the uncompressed - // image format. - // Returns LIBYUV_TRUE if image looks valid and format is supported. - // If return value is LIBYUV_TRUE, then the values for all the following - // getters are populated. - // src_len is the size of the compressed mjpeg frame in bytes. - LIBYUV_BOOL LoadFrame(const uint8* src, size_t src_len); - - // Returns width of the last loaded frame in pixels. - int GetWidth(); - - // Returns height of the last loaded frame in pixels. - int GetHeight(); - - // Returns format of the last loaded frame. The return value is one of the - // kColorSpace* constants. - int GetColorSpace(); - - // Number of color components in the color space. - int GetNumComponents(); - - // Sample factors of the n-th component. - int GetHorizSampFactor(int component); - - int GetVertSampFactor(int component); - - int GetHorizSubSampFactor(int component); - - int GetVertSubSampFactor(int component); - - // Public for testability. - int GetImageScanlinesPerImcuRow(); - - // Public for testability. - int GetComponentScanlinesPerImcuRow(int component); - - // Width of a component in bytes. - int GetComponentWidth(int component); - - // Height of a component. - int GetComponentHeight(int component); - - // Width of a component in bytes with padding for DCTSIZE. Public for testing. - int GetComponentStride(int component); - - // Size of a component in bytes. - int GetComponentSize(int component); - - // Call this after LoadFrame() if you decide you don't want to decode it - // after all. - LIBYUV_BOOL UnloadFrame(); - - // Decodes the entire image into a one-buffer-per-color-component format. - // dst_width must match exactly. dst_height must be <= to image height; if - // less, the image is cropped. "planes" must have size equal to at least - // GetNumComponents() and they must point to non-overlapping buffers of size - // at least GetComponentSize(i). The pointers in planes are incremented - // to point to after the end of the written data. - // TODO(fbarchard): Add dst_x, dst_y to allow specific rect to be decoded. - LIBYUV_BOOL DecodeToBuffers(uint8** planes, int dst_width, int dst_height); - - // Decodes the entire image and passes the data via repeated calls to a - // callback function. Each call will get the data for a whole number of - // image scanlines. - // TODO(fbarchard): Add dst_x, dst_y to allow specific rect to be decoded. - LIBYUV_BOOL DecodeToCallback(CallbackFunction fn, void* opaque, - int dst_width, int dst_height); - - // The helper function which recognizes the jpeg sub-sampling type. - static JpegSubsamplingType JpegSubsamplingTypeHelper( - int* subsample_x, int* subsample_y, int number_of_components); - - private: - struct Buffer { - const uint8* data; - int len; - }; - - struct BufferVector { - Buffer* buffers; - int len; - int pos; - }; - - // Methods that are passed to jpeglib. - static int fill_input_buffer(jpeg_decompress_struct* cinfo); - static void init_source(jpeg_decompress_struct* cinfo); - static void skip_input_data(jpeg_decompress_struct* cinfo, - long num_bytes); // NOLINT - static void term_source(jpeg_decompress_struct* cinfo); - - static void ErrorHandler(jpeg_common_struct* cinfo); - - void AllocOutputBuffers(int num_outbufs); - void DestroyOutputBuffers(); - - LIBYUV_BOOL StartDecode(); - LIBYUV_BOOL FinishDecode(); - - void SetScanlinePointers(uint8** data); - LIBYUV_BOOL DecodeImcuRow(); - - int GetComponentScanlinePadding(int component); - - // A buffer holding the input data for a frame. - Buffer buf_; - BufferVector buf_vec_; - - jpeg_decompress_struct* decompress_struct_; - jpeg_source_mgr* source_mgr_; - SetJmpErrorMgr* error_mgr_; - - // LIBYUV_TRUE iff at least one component has scanline padding. (i.e., - // GetComponentScanlinePadding() != 0.) - LIBYUV_BOOL has_scanline_padding_; - - // Temporaries used to point to scanline outputs. - int num_outbufs_; // Outermost size of all arrays below. - uint8*** scanlines_; - int* scanlines_sizes_; - // Temporary buffer used for decoding when we can't decode directly to the - // output buffers. Large enough for just one iMCU row. - uint8** databuf_; - int* databuf_strides_; -}; - -} // namespace libyuv - -#endif // __cplusplus -#endif // INCLUDE_LIBYUV_MJPEG_DECODER_H_ NOLINT diff --git a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/planar_functions.h b/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/planar_functions.h deleted file mode 100755 index ac516c5..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/planar_functions.h +++ /dev/null @@ -1,434 +0,0 @@ -/* - * Copyright 2011 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_PLANAR_FUNCTIONS_H_ // NOLINT -#define INCLUDE_LIBYUV_PLANAR_FUNCTIONS_H_ - -#include "libyuv/basic_types.h" - -// TODO(fbarchard): Remove the following headers includes. -#include "libyuv/convert.h" -#include "libyuv/convert_argb.h" - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -// Copy a plane of data. -LIBYUV_API -void CopyPlane(const uint8* src_y, int src_stride_y, - uint8* dst_y, int dst_stride_y, - int width, int height); - -// Set a plane of data to a 32 bit value. -LIBYUV_API -void SetPlane(uint8* dst_y, int dst_stride_y, - int width, int height, - uint32 value); - -// Copy I400. Supports inverting. -LIBYUV_API -int I400ToI400(const uint8* src_y, int src_stride_y, - uint8* dst_y, int dst_stride_y, - int width, int height); - - -// Copy I422 to I422. -#define I422ToI422 I422Copy -LIBYUV_API -int I422Copy(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Copy I444 to I444. -#define I444ToI444 I444Copy -LIBYUV_API -int I444Copy(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert YUY2 to I422. -LIBYUV_API -int YUY2ToI422(const uint8* src_yuy2, int src_stride_yuy2, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert UYVY to I422. -LIBYUV_API -int UYVYToI422(const uint8* src_uyvy, int src_stride_uyvy, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Convert I420 to I400. (calls CopyPlane ignoring u/v). -LIBYUV_API -int I420ToI400(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - int width, int height); - -// Alias -#define I420ToI420Mirror I420Mirror - -// I420 mirror. -LIBYUV_API -int I420Mirror(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int width, int height); - -// Alias -#define I400ToI400Mirror I400Mirror - -// I400 mirror. A single plane is mirrored horizontally. -// Pass negative height to achieve 180 degree rotation. -LIBYUV_API -int I400Mirror(const uint8* src_y, int src_stride_y, - uint8* dst_y, int dst_stride_y, - int width, int height); - -// Alias -#define ARGBToARGBMirror ARGBMirror - -// ARGB mirror. -LIBYUV_API -int ARGBMirror(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert NV12 to RGB565. -LIBYUV_API -int NV12ToRGB565(const uint8* src_y, int src_stride_y, - const uint8* src_uv, int src_stride_uv, - uint8* dst_rgb565, int dst_stride_rgb565, - int width, int height); - -// Convert NV21 to RGB565. -LIBYUV_API -int NV21ToRGB565(const uint8* src_y, int src_stride_y, - const uint8* src_uv, int src_stride_uv, - uint8* dst_rgb565, int dst_stride_rgb565, - int width, int height); - -// I422ToARGB is in convert_argb.h -// Convert I422 to BGRA. -LIBYUV_API -int I422ToBGRA(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_bgra, int dst_stride_bgra, - int width, int height); - -// Convert I422 to ABGR. -LIBYUV_API -int I422ToABGR(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_abgr, int dst_stride_abgr, - int width, int height); - -// Convert I422 to RGBA. -LIBYUV_API -int I422ToRGBA(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_rgba, int dst_stride_rgba, - int width, int height); - -// Draw a rectangle into I420. -LIBYUV_API -int I420Rect(uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int x, int y, int width, int height, - int value_y, int value_u, int value_v); - -// Draw a rectangle into ARGB. -LIBYUV_API -int ARGBRect(uint8* dst_argb, int dst_stride_argb, - int x, int y, int width, int height, uint32 value); - -// Convert ARGB to gray scale ARGB. -LIBYUV_API -int ARGBGrayTo(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Make a rectangle of ARGB gray scale. -LIBYUV_API -int ARGBGray(uint8* dst_argb, int dst_stride_argb, - int x, int y, int width, int height); - -// Make a rectangle of ARGB Sepia tone. -LIBYUV_API -int ARGBSepia(uint8* dst_argb, int dst_stride_argb, - int x, int y, int width, int height); - -// Apply a matrix rotation to each ARGB pixel. -// matrix_argb is 4 signed ARGB values. -128 to 127 representing -2 to 2. -// The first 4 coefficients apply to B, G, R, A and produce B of the output. -// The next 4 coefficients apply to B, G, R, A and produce G of the output. -// The next 4 coefficients apply to B, G, R, A and produce R of the output. -// The last 4 coefficients apply to B, G, R, A and produce A of the output. -LIBYUV_API -int ARGBColorMatrix(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - const int8* matrix_argb, - int width, int height); - -// Deprecated. Use ARGBColorMatrix instead. -// Apply a matrix rotation to each ARGB pixel. -// matrix_argb is 3 signed ARGB values. -128 to 127 representing -1 to 1. -// The first 4 coefficients apply to B, G, R, A and produce B of the output. -// The next 4 coefficients apply to B, G, R, A and produce G of the output. -// The last 4 coefficients apply to B, G, R, A and produce R of the output. -LIBYUV_API -int RGBColorMatrix(uint8* dst_argb, int dst_stride_argb, - const int8* matrix_rgb, - int x, int y, int width, int height); - -// Apply a color table each ARGB pixel. -// Table contains 256 ARGB values. -LIBYUV_API -int ARGBColorTable(uint8* dst_argb, int dst_stride_argb, - const uint8* table_argb, - int x, int y, int width, int height); - -// Apply a color table each ARGB pixel but preserve destination alpha. -// Table contains 256 ARGB values. -LIBYUV_API -int RGBColorTable(uint8* dst_argb, int dst_stride_argb, - const uint8* table_argb, - int x, int y, int width, int height); - -// Apply a luma/color table each ARGB pixel but preserve destination alpha. -// Table contains 32768 values indexed by [Y][C] where 7 it 7 bit luma from -// RGB (YJ style) and C is an 8 bit color component (R, G or B). -LIBYUV_API -int ARGBLumaColorTable(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - const uint8* luma_rgb_table, - int width, int height); - -// Apply a 3 term polynomial to ARGB values. -// poly points to a 4x4 matrix. The first row is constants. The 2nd row is -// coefficients for b, g, r and a. The 3rd row is coefficients for b squared, -// g squared, r squared and a squared. The 4rd row is coefficients for b to -// the 3, g to the 3, r to the 3 and a to the 3. The values are summed and -// result clamped to 0 to 255. -// A polynomial approximation can be dirived using software such as 'R'. - -LIBYUV_API -int ARGBPolynomial(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - const float* poly, - int width, int height); - -// Quantize a rectangle of ARGB. Alpha unaffected. -// scale is a 16 bit fractional fixed point scaler between 0 and 65535. -// interval_size should be a value between 1 and 255. -// interval_offset should be a value between 0 and 255. -LIBYUV_API -int ARGBQuantize(uint8* dst_argb, int dst_stride_argb, - int scale, int interval_size, int interval_offset, - int x, int y, int width, int height); - -// Copy ARGB to ARGB. -LIBYUV_API -int ARGBCopy(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Copy ARGB to ARGB. -LIBYUV_API -int ARGBCopyAlpha(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Copy ARGB to ARGB. -LIBYUV_API -int ARGBCopyYToAlpha(const uint8* src_y, int src_stride_y, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -typedef void (*ARGBBlendRow)(const uint8* src_argb0, const uint8* src_argb1, - uint8* dst_argb, int width); - -// Get function to Alpha Blend ARGB pixels and store to destination. -LIBYUV_API -ARGBBlendRow GetARGBBlend(); - -// Alpha Blend ARGB images and store to destination. -// Alpha of destination is set to 255. -LIBYUV_API -int ARGBBlend(const uint8* src_argb0, int src_stride_argb0, - const uint8* src_argb1, int src_stride_argb1, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Multiply ARGB image by ARGB image. Shifted down by 8. Saturates to 255. -LIBYUV_API -int ARGBMultiply(const uint8* src_argb0, int src_stride_argb0, - const uint8* src_argb1, int src_stride_argb1, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Add ARGB image with ARGB image. Saturates to 255. -LIBYUV_API -int ARGBAdd(const uint8* src_argb0, int src_stride_argb0, - const uint8* src_argb1, int src_stride_argb1, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Subtract ARGB image (argb1) from ARGB image (argb0). Saturates to 0. -LIBYUV_API -int ARGBSubtract(const uint8* src_argb0, int src_stride_argb0, - const uint8* src_argb1, int src_stride_argb1, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert I422 to YUY2. -LIBYUV_API -int I422ToYUY2(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_frame, int dst_stride_frame, - int width, int height); - -// Convert I422 to UYVY. -LIBYUV_API -int I422ToUYVY(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_frame, int dst_stride_frame, - int width, int height); - -// Convert unattentuated ARGB to preattenuated ARGB. -LIBYUV_API -int ARGBAttenuate(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert preattentuated ARGB to unattenuated ARGB. -LIBYUV_API -int ARGBUnattenuate(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Convert MJPG to ARGB. -LIBYUV_API -int MJPGToARGB(const uint8* sample, size_t sample_size, - uint8* argb, int argb_stride, - int w, int h, int dw, int dh); - -// Internal function - do not call directly. -// Computes table of cumulative sum for image where the value is the sum -// of all values above and to the left of the entry. Used by ARGBBlur. -LIBYUV_API -int ARGBComputeCumulativeSum(const uint8* src_argb, int src_stride_argb, - int32* dst_cumsum, int dst_stride32_cumsum, - int width, int height); - -// Blur ARGB image. -// dst_cumsum table of width * (height + 1) * 16 bytes aligned to -// 16 byte boundary. -// dst_stride32_cumsum is number of ints in a row (width * 4). -// radius is number of pixels around the center. e.g. 1 = 3x3. 2=5x5. -// Blur is optimized for radius of 5 (11x11) or less. -LIBYUV_API -int ARGBBlur(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int32* dst_cumsum, int dst_stride32_cumsum, - int width, int height, int radius); - -// Multiply ARGB image by ARGB value. -LIBYUV_API -int ARGBShade(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int width, int height, uint32 value); - -// Interpolate between two ARGB images using specified amount of interpolation -// (0 to 255) and store to destination. -// 'interpolation' is specified as 8 bit fraction where 0 means 100% src_argb0 -// and 255 means 1% src_argb0 and 99% src_argb1. -// Internally uses ARGBScale bilinear filtering. -// Caveat: This function will write up to 16 bytes beyond the end of dst_argb. -LIBYUV_API -int ARGBInterpolate(const uint8* src_argb0, int src_stride_argb0, - const uint8* src_argb1, int src_stride_argb1, - uint8* dst_argb, int dst_stride_argb, - int width, int height, int interpolation); - -#if defined(__pnacl__) || defined(__CLR_VER) || defined(COVERAGE_ENABLED) || \ - defined(TARGET_IPHONE_SIMULATOR) -#define LIBYUV_DISABLE_X86 -#endif - -// Row functions for copying a pixels from a source with a slope to a row -// of destination. Useful for scaling, rotation, mirror, texture mapping. -LIBYUV_API -void ARGBAffineRow_C(const uint8* src_argb, int src_argb_stride, - uint8* dst_argb, const float* uv_dudv, int width); -// The following are available on all x86 platforms: -#if !defined(LIBYUV_DISABLE_X86) && \ - (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__)) -LIBYUV_API -void ARGBAffineRow_SSE2(const uint8* src_argb, int src_argb_stride, - uint8* dst_argb, const float* uv_dudv, int width); -#define HAS_ARGBAFFINEROW_SSE2 -#endif // LIBYUV_DISABLE_X86 - -// Shuffle ARGB channel order. e.g. BGRA to ARGB. -// shuffler is 16 bytes and must be aligned. -LIBYUV_API -int ARGBShuffle(const uint8* src_bgra, int src_stride_bgra, - uint8* dst_argb, int dst_stride_argb, - const uint8* shuffler, int width, int height); - -// Sobel ARGB effect with planar output. -LIBYUV_API -int ARGBSobelToPlane(const uint8* src_argb, int src_stride_argb, - uint8* dst_y, int dst_stride_y, - int width, int height); - -// Sobel ARGB effect. -LIBYUV_API -int ARGBSobel(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -// Sobel ARGB effect w/ Sobel X, Sobel, Sobel Y in ARGB. -LIBYUV_API -int ARGBSobelXY(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int width, int height); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_PLANAR_FUNCTIONS_H_ NOLINT diff --git a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/rotate.h b/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/rotate.h deleted file mode 100755 index 8af60b8..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/rotate.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright 2011 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_ROTATE_H_ // NOLINT -#define INCLUDE_LIBYUV_ROTATE_H_ - -#include "libyuv/basic_types.h" - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -// Supported rotation. -typedef enum RotationMode { - kRotate0 = 0, // No rotation. - kRotate90 = 90, // Rotate 90 degrees clockwise. - kRotate180 = 180, // Rotate 180 degrees. - kRotate270 = 270, // Rotate 270 degrees clockwise. - - // Deprecated. - kRotateNone = 0, - kRotateClockwise = 90, - kRotateCounterClockwise = 270, -} RotationModeEnum; - -// Rotate I420 frame. -LIBYUV_API -int I420Rotate(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int src_width, int src_height, enum RotationMode mode); - -// Rotate NV12 input and store in I420. -LIBYUV_API -int NV12ToI420Rotate(const uint8* src_y, int src_stride_y, - const uint8* src_uv, int src_stride_uv, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int src_width, int src_height, enum RotationMode mode); - -// Rotate a plane by 0, 90, 180, or 270. -LIBYUV_API -int RotatePlane(const uint8* src, int src_stride, - uint8* dst, int dst_stride, - int src_width, int src_height, enum RotationMode mode); - -// Rotate planes by 90, 180, 270. Deprecated. -LIBYUV_API -void RotatePlane90(const uint8* src, int src_stride, - uint8* dst, int dst_stride, - int width, int height); - -LIBYUV_API -void RotatePlane180(const uint8* src, int src_stride, - uint8* dst, int dst_stride, - int width, int height); - -LIBYUV_API -void RotatePlane270(const uint8* src, int src_stride, - uint8* dst, int dst_stride, - int width, int height); - -LIBYUV_API -void RotateUV90(const uint8* src, int src_stride, - uint8* dst_a, int dst_stride_a, - uint8* dst_b, int dst_stride_b, - int width, int height); - -// Rotations for when U and V are interleaved. -// These functions take one input pointer and -// split the data into two buffers while -// rotating them. Deprecated. -LIBYUV_API -void RotateUV180(const uint8* src, int src_stride, - uint8* dst_a, int dst_stride_a, - uint8* dst_b, int dst_stride_b, - int width, int height); - -LIBYUV_API -void RotateUV270(const uint8* src, int src_stride, - uint8* dst_a, int dst_stride_a, - uint8* dst_b, int dst_stride_b, - int width, int height); - -// The 90 and 270 functions are based on transposes. -// Doing a transpose with reversing the read/write -// order will result in a rotation by +- 90 degrees. -// Deprecated. -LIBYUV_API -void TransposePlane(const uint8* src, int src_stride, - uint8* dst, int dst_stride, - int width, int height); - -LIBYUV_API -void TransposeUV(const uint8* src, int src_stride, - uint8* dst_a, int dst_stride_a, - uint8* dst_b, int dst_stride_b, - int width, int height); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_ROTATE_H_ NOLINT diff --git a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/rotate_argb.h b/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/rotate_argb.h deleted file mode 100755 index 660ff55..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/rotate_argb.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2012 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_ROTATE_ARGB_H_ // NOLINT -#define INCLUDE_LIBYUV_ROTATE_ARGB_H_ - -#include "libyuv/basic_types.h" -#include "libyuv/rotate.h" // For RotationMode. - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -// Rotate ARGB frame -LIBYUV_API -int ARGBRotate(const uint8* src_argb, int src_stride_argb, - uint8* dst_argb, int dst_stride_argb, - int src_width, int src_height, enum RotationMode mode); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_ROTATE_ARGB_H_ NOLINT diff --git a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/row.h b/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/row.h deleted file mode 100755 index 757020d..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/row.h +++ /dev/null @@ -1,1694 +0,0 @@ -/* - * Copyright 2011 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_ROW_H_ // NOLINT -#define INCLUDE_LIBYUV_ROW_H_ - -#include // For malloc. - -#include "libyuv/basic_types.h" - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -#define IS_ALIGNED(p, a) (!((uintptr_t)(p) & ((a) - 1))) - -#ifdef __cplusplus -#define align_buffer_64(var, size) \ - uint8* var##_mem = reinterpret_cast(malloc((size) + 63)); \ - uint8* var = reinterpret_cast \ - ((reinterpret_cast(var##_mem) + 63) & ~63) -#else -#define align_buffer_64(var, size) \ - uint8* var##_mem = (uint8*)(malloc((size) + 63)); /* NOLINT */ \ - uint8* var = (uint8*)(((intptr_t)(var##_mem) + 63) & ~63) /* NOLINT */ -#endif - -#define free_aligned_buffer_64(var) \ - free(var##_mem); \ - var = 0 - -#if defined(__pnacl__) || defined(__CLR_VER) || defined(COVERAGE_ENABLED) || \ - defined(TARGET_IPHONE_SIMULATOR) -#define LIBYUV_DISABLE_X86 -#endif -// True if compiling for SSSE3 as a requirement. -#if defined(__SSSE3__) || (defined(_M_IX86_FP) && (_M_IX86_FP >= 3)) -#define LIBYUV_SSSE3_ONLY -#endif - -// Enable for NaCL pepper 33 for bundle and AVX2 support. -// #define NEW_BINUTILS - -// The following are available on all x86 platforms: -#if !defined(LIBYUV_DISABLE_X86) && \ - (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__)) -// Effects: -#define HAS_ARGBADDROW_SSE2 -#define HAS_ARGBAFFINEROW_SSE2 -#define HAS_ARGBATTENUATEROW_SSSE3 -#define HAS_ARGBBLENDROW_SSSE3 -#define HAS_ARGBCOLORMATRIXROW_SSSE3 -#define HAS_ARGBCOLORTABLEROW_X86 -#define HAS_ARGBCOPYALPHAROW_SSE2 -#define HAS_ARGBCOPYYTOALPHAROW_SSE2 -#define HAS_ARGBGRAYROW_SSSE3 -#define HAS_ARGBLUMACOLORTABLEROW_SSSE3 -#define HAS_ARGBMIRRORROW_SSSE3 -#define HAS_ARGBMULTIPLYROW_SSE2 -#define HAS_ARGBPOLYNOMIALROW_SSE2 -#define HAS_ARGBQUANTIZEROW_SSE2 -#define HAS_ARGBSEPIAROW_SSSE3 -#define HAS_ARGBSHADEROW_SSE2 -#define HAS_ARGBSUBTRACTROW_SSE2 -#define HAS_ARGBTOUVROW_SSSE3 -#define HAS_ARGBUNATTENUATEROW_SSE2 -#define HAS_COMPUTECUMULATIVESUMROW_SSE2 -#define HAS_CUMULATIVESUMTOAVERAGEROW_SSE2 -#define HAS_INTERPOLATEROW_SSE2 -#define HAS_INTERPOLATEROW_SSSE3 -#define HAS_RGBCOLORTABLEROW_X86 -#define HAS_SOBELROW_SSE2 -#define HAS_SOBELTOPLANEROW_SSE2 -#define HAS_SOBELXROW_SSE2 -#define HAS_SOBELXYROW_SSE2 -#define HAS_SOBELYROW_SSE2 - -// Conversions: -#define HAS_ABGRTOUVROW_SSSE3 -#define HAS_ABGRTOYROW_SSSE3 -#define HAS_ARGB1555TOARGBROW_SSE2 -#define HAS_ARGB4444TOARGBROW_SSE2 -#define HAS_ARGBSHUFFLEROW_SSE2 -#define HAS_ARGBSHUFFLEROW_SSSE3 -#define HAS_ARGBTOARGB1555ROW_SSE2 -#define HAS_ARGBTOARGB4444ROW_SSE2 -#define HAS_ARGBTOBAYERGGROW_SSE2 -#define HAS_ARGBTOBAYERROW_SSSE3 -#define HAS_ARGBTORAWROW_SSSE3 -#define HAS_ARGBTORGB24ROW_SSSE3 -#define HAS_ARGBTORGB565ROW_SSE2 -#define HAS_ARGBTOUV422ROW_SSSE3 -#define HAS_ARGBTOUV444ROW_SSSE3 -#define HAS_ARGBTOUVJROW_SSSE3 -#define HAS_ARGBTOYJROW_SSSE3 -#define HAS_ARGBTOYROW_SSSE3 -#define HAS_BGRATOUVROW_SSSE3 -#define HAS_BGRATOYROW_SSSE3 -#define HAS_COPYROW_ERMS -#define HAS_COPYROW_SSE2 -#define HAS_COPYROW_X86 -#define HAS_HALFROW_SSE2 -#define HAS_I400TOARGBROW_SSE2 -#define HAS_I411TOARGBROW_SSSE3 -#define HAS_I422TOARGB1555ROW_SSSE3 -#define HAS_I422TOABGRROW_SSSE3 -#define HAS_I422TOARGB1555ROW_SSSE3 -#define HAS_I422TOARGB4444ROW_SSSE3 -#define HAS_I422TOARGBROW_SSSE3 -#define HAS_I422TOBGRAROW_SSSE3 -#define HAS_I422TORAWROW_SSSE3 -#define HAS_I422TORGB24ROW_SSSE3 -#define HAS_I422TORGB565ROW_SSSE3 -#define HAS_I422TORGBAROW_SSSE3 -#define HAS_I422TOUYVYROW_SSE2 -#define HAS_I422TOYUY2ROW_SSE2 -#define HAS_I444TOARGBROW_SSSE3 -#define HAS_MERGEUVROW_SSE2 -#define HAS_MIRRORROW_SSE2 -#define HAS_MIRRORROW_SSSE3 -#define HAS_MIRRORROW_UV_SSSE3 -#define HAS_MIRRORUVROW_SSSE3 -#define HAS_NV12TOARGBROW_SSSE3 -#define HAS_NV12TORGB565ROW_SSSE3 -#define HAS_NV21TOARGBROW_SSSE3 -#define HAS_NV21TORGB565ROW_SSSE3 -#define HAS_RAWTOARGBROW_SSSE3 -#define HAS_RAWTOYROW_SSSE3 -#define HAS_RGB24TOARGBROW_SSSE3 -#define HAS_RGB24TOYROW_SSSE3 -#define HAS_RGB565TOARGBROW_SSE2 -#define HAS_RGBATOUVROW_SSSE3 -#define HAS_RGBATOYROW_SSSE3 -#define HAS_SETROW_X86 -#define HAS_SPLITUVROW_SSE2 -#define HAS_UYVYTOARGBROW_SSSE3 -#define HAS_UYVYTOUV422ROW_SSE2 -#define HAS_UYVYTOUVROW_SSE2 -#define HAS_UYVYTOYROW_SSE2 -#define HAS_YTOARGBROW_SSE2 -#define HAS_YUY2TOARGBROW_SSSE3 -#define HAS_YUY2TOUV422ROW_SSE2 -#define HAS_YUY2TOUVROW_SSE2 -#define HAS_YUY2TOYROW_SSE2 -#endif - -// GCC >= 4.7.0 required for AVX2. -#if defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__)) -#if (__GNUC__ > 4) || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 7)) -#define GCC_HAS_AVX2 1 -#endif // GNUC >= 4.7 -#endif // __GNUC__ - -// clang >= 3.4.0 required for AVX2. -#if defined(__clang__) && (defined(__x86_64__) || defined(__i386__)) -#if (__clang_major__ > 3) || (__clang_major__ == 3 && (__clang_minor__ >= 4)) -#define CLANG_HAS_AVX2 1 -#endif // clang >= 3.4 -#endif // __clang__ - -// Visual C 2012 required for AVX2. -#if defined(_M_IX86) && defined(_MSC_VER) && _MSC_VER >= 1700 -#define VISUALC_HAS_AVX2 1 -#endif // VisualStudio >= 2012 - -// The following are available on all x86 platforms, but -// require VS2012, clang 3.4 or gcc 4.7. -// The code supports NaCL but requires a new compiler and validator. -#if !defined(LIBYUV_DISABLE_X86) && (defined(VISUALC_HAS_AVX2) || \ - defined(CLANG_HAS_AVX2) || defined(GCC_HAS_AVX2)) -// Effects: -#define HAS_ARGBPOLYNOMIALROW_AVX2 -#define HAS_ARGBSHUFFLEROW_AVX2 -#define HAS_ARGBCOPYALPHAROW_AVX2 -#define HAS_ARGBCOPYYTOALPHAROW_AVX2 -#endif - -// The following are require VS2012. -// TODO(fbarchard): Port to gcc. -#if !defined(LIBYUV_DISABLE_X86) && defined(VISUALC_HAS_AVX2) -#define HAS_ARGBTOUVROW_AVX2 -#define HAS_ARGBTOYJROW_AVX2 -#define HAS_ARGBTOYROW_AVX2 -#define HAS_HALFROW_AVX2 -#define HAS_I422TOARGBROW_AVX2 -#define HAS_INTERPOLATEROW_AVX2 -#define HAS_MERGEUVROW_AVX2 -#define HAS_MIRRORROW_AVX2 -#define HAS_SPLITUVROW_AVX2 -#define HAS_UYVYTOUV422ROW_AVX2 -#define HAS_UYVYTOUVROW_AVX2 -#define HAS_UYVYTOYROW_AVX2 -#define HAS_YUY2TOUV422ROW_AVX2 -#define HAS_YUY2TOUVROW_AVX2 -#define HAS_YUY2TOYROW_AVX2 - -// Effects: -#define HAS_ARGBADDROW_AVX2 -#define HAS_ARGBATTENUATEROW_AVX2 -#define HAS_ARGBMIRRORROW_AVX2 -#define HAS_ARGBMULTIPLYROW_AVX2 -#define HAS_ARGBSUBTRACTROW_AVX2 -#define HAS_ARGBUNATTENUATEROW_AVX2 -#endif // defined(VISUALC_HAS_AVX2) - -// The following are Yasm x86 only: -// TODO(fbarchard): Port AVX2 to inline. -#if !defined(LIBYUV_DISABLE_X86) && defined(HAVE_YASM) - (defined(_M_IX86) || defined(_M_X64) || \ - defined(__x86_64__) || defined(__i386__)) -#define HAS_MERGEUVROW_AVX2 -#define HAS_MERGEUVROW_MMX -#define HAS_SPLITUVROW_AVX2 -#define HAS_SPLITUVROW_MMX -#define HAS_UYVYTOYROW_AVX2 -#define HAS_UYVYTOYROW_MMX -#define HAS_YUY2TOYROW_AVX2 -#define HAS_YUY2TOYROW_MMX -#endif - -// The following are disabled when SSSE3 is available: -#if !defined(LIBYUV_DISABLE_X86) && \ - (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__)) && \ - !defined(LIBYUV_SSSE3_ONLY) -#define HAS_ARGBBLENDROW_SSE2 -#define HAS_ARGBATTENUATEROW_SSE2 -#define HAS_MIRRORROW_SSE2 -#endif - -// The following are available on Neon platforms: -#if !defined(LIBYUV_DISABLE_NEON) && \ - (defined(__ARM_NEON__) || defined(LIBYUV_NEON)) -#define HAS_ABGRTOUVROW_NEON -#define HAS_ABGRTOYROW_NEON -#define HAS_ARGB1555TOARGBROW_NEON -#define HAS_ARGB1555TOUVROW_NEON -#define HAS_ARGB1555TOYROW_NEON -#define HAS_ARGB4444TOARGBROW_NEON -#define HAS_ARGB4444TOUVROW_NEON -#define HAS_ARGB4444TOYROW_NEON -#define HAS_ARGBTOARGB1555ROW_NEON -#define HAS_ARGBTOARGB4444ROW_NEON -#define HAS_ARGBTOBAYERROW_NEON -#define HAS_ARGBTOBAYERGGROW_NEON -#define HAS_ARGBTORAWROW_NEON -#define HAS_ARGBTORGB24ROW_NEON -#define HAS_ARGBTORGB565ROW_NEON -#define HAS_ARGBTOUV411ROW_NEON -#define HAS_ARGBTOUV422ROW_NEON -#define HAS_ARGBTOUV444ROW_NEON -#define HAS_ARGBTOUVROW_NEON -#define HAS_ARGBTOUVJROW_NEON -#define HAS_ARGBTOYROW_NEON -#define HAS_ARGBTOYJROW_NEON -#define HAS_BGRATOUVROW_NEON -#define HAS_BGRATOYROW_NEON -#define HAS_COPYROW_NEON -#define HAS_HALFROW_NEON -#define HAS_I400TOARGBROW_NEON -#define HAS_I411TOARGBROW_NEON -#define HAS_I422TOABGRROW_NEON -#define HAS_I422TOARGB1555ROW_NEON -#define HAS_I422TOARGB4444ROW_NEON -#define HAS_I422TOARGBROW_NEON -#define HAS_I422TOBGRAROW_NEON -#define HAS_I422TORAWROW_NEON -#define HAS_I422TORGB24ROW_NEON -#define HAS_I422TORGB565ROW_NEON -#define HAS_I422TORGBAROW_NEON -#define HAS_I422TOUYVYROW_NEON -#define HAS_I422TOYUY2ROW_NEON -#define HAS_I444TOARGBROW_NEON -#define HAS_MERGEUVROW_NEON -#define HAS_MIRRORROW_NEON -#define HAS_MIRRORUVROW_NEON -#define HAS_NV12TOARGBROW_NEON -#define HAS_NV12TORGB565ROW_NEON -#define HAS_NV21TOARGBROW_NEON -#define HAS_NV21TORGB565ROW_NEON -#define HAS_RAWTOARGBROW_NEON -#define HAS_RAWTOUVROW_NEON -#define HAS_RAWTOYROW_NEON -#define HAS_RGB24TOARGBROW_NEON -#define HAS_RGB24TOUVROW_NEON -#define HAS_RGB24TOYROW_NEON -#define HAS_RGB565TOARGBROW_NEON -#define HAS_RGB565TOUVROW_NEON -#define HAS_RGB565TOYROW_NEON -#define HAS_RGBATOUVROW_NEON -#define HAS_RGBATOYROW_NEON -#define HAS_SETROW_NEON -#define HAS_SPLITUVROW_NEON -#define HAS_UYVYTOARGBROW_NEON -#define HAS_UYVYTOUV422ROW_NEON -#define HAS_UYVYTOUVROW_NEON -#define HAS_UYVYTOYROW_NEON -#define HAS_YTOARGBROW_NEON -#define HAS_YUY2TOARGBROW_NEON -#define HAS_YUY2TOUV422ROW_NEON -#define HAS_YUY2TOUVROW_NEON -#define HAS_YUY2TOYROW_NEON - -// Effects: -#define HAS_ARGBADDROW_NEON -#define HAS_ARGBATTENUATEROW_NEON -#define HAS_ARGBBLENDROW_NEON -#define HAS_ARGBCOLORMATRIXROW_NEON -#define HAS_ARGBGRAYROW_NEON -#define HAS_ARGBMIRRORROW_NEON -#define HAS_ARGBMULTIPLYROW_NEON -#define HAS_ARGBQUANTIZEROW_NEON -#define HAS_ARGBSEPIAROW_NEON -#define HAS_ARGBSHADEROW_NEON -#define HAS_ARGBSUBTRACTROW_NEON -#define HAS_SOBELROW_NEON -#define HAS_SOBELTOPLANEROW_NEON -#define HAS_SOBELXYROW_NEON -#define HAS_SOBELXROW_NEON -#define HAS_SOBELYROW_NEON -#define HAS_INTERPOLATEROW_NEON -#endif - -// The following are available on Mips platforms: -#if !defined(LIBYUV_DISABLE_MIPS) && defined(__mips__) -#define HAS_COPYROW_MIPS -#if defined(__mips_dsp) && (__mips_dsp_rev >= 2) -#define HAS_I422TOABGRROW_MIPS_DSPR2 -#define HAS_I422TOARGBROW_MIPS_DSPR2 -#define HAS_I422TOBGRAROW_MIPS_DSPR2 -#define HAS_INTERPOLATEROWS_MIPS_DSPR2 -#define HAS_MIRRORROW_MIPS_DSPR2 -#define HAS_MIRRORUVROW_MIPS_DSPR2 -#define HAS_SPLITUVROW_MIPS_DSPR2 -#endif -#endif - -#if defined(_MSC_VER) && !defined(__CLR_VER) -#define SIMD_ALIGNED(var) __declspec(align(16)) var -typedef __declspec(align(16)) int16 vec16[8]; -typedef __declspec(align(16)) int32 vec32[4]; -typedef __declspec(align(16)) int8 vec8[16]; -typedef __declspec(align(16)) uint16 uvec16[8]; -typedef __declspec(align(16)) uint32 uvec32[4]; -typedef __declspec(align(16)) uint8 uvec8[16]; -typedef __declspec(align(32)) int16 lvec16[16]; -typedef __declspec(align(32)) int32 lvec32[8]; -typedef __declspec(align(32)) int8 lvec8[32]; -typedef __declspec(align(32)) uint16 ulvec16[16]; -typedef __declspec(align(32)) uint32 ulvec32[8]; -typedef __declspec(align(32)) uint8 ulvec8[32]; - -#elif defined(__GNUC__) -// Caveat GCC 4.2 to 4.7 have a known issue using vectors with const. -#define SIMD_ALIGNED(var) var __attribute__((aligned(16))) -typedef int16 __attribute__((vector_size(16))) vec16; -typedef int32 __attribute__((vector_size(16))) vec32; -typedef int8 __attribute__((vector_size(16))) vec8; -typedef uint16 __attribute__((vector_size(16))) uvec16; -typedef uint32 __attribute__((vector_size(16))) uvec32; -typedef uint8 __attribute__((vector_size(16))) uvec8; -#else -#define SIMD_ALIGNED(var) var -typedef int16 vec16[8]; -typedef int32 vec32[4]; -typedef int8 vec8[16]; -typedef uint16 uvec16[8]; -typedef uint32 uvec32[4]; -typedef uint8 uvec8[16]; -#endif - -#if defined(__APPLE__) || defined(__x86_64__) || defined(__llvm__) -#define OMITFP -#else -#define OMITFP __attribute__((optimize("omit-frame-pointer"))) -#endif - -// NaCL macros for GCC x86 and x64. - -// TODO(nfullagar): When pepper_33 toolchain is distributed, default to -// NEW_BINUTILS and remove all BUNDLEALIGN occurances. -#if defined(__native_client__) -#define LABELALIGN ".p2align 5\n" -#else -#define LABELALIGN ".p2align 2\n" -#endif -#if defined(__native_client__) && defined(__x86_64__) -#if defined(NEW_BINUTILS) -#define BUNDLELOCK ".bundle_lock\n" -#define BUNDLEUNLOCK ".bundle_unlock\n" -#define BUNDLEALIGN "\n" -#else -#define BUNDLELOCK "\n" -#define BUNDLEUNLOCK "\n" -#define BUNDLEALIGN ".p2align 5\n" -#endif -#define MEMACCESS(base) "%%nacl:(%%r15,%q" #base ")" -#define MEMACCESS2(offset, base) "%%nacl:" #offset "(%%r15,%q" #base ")" -#define MEMLEA(offset, base) #offset "(%q" #base ")" -#define MEMLEA3(offset, index, scale) \ - #offset "(,%q" #index "," #scale ")" -#define MEMLEA4(offset, base, index, scale) \ - #offset "(%q" #base ",%q" #index "," #scale ")" -#define MEMMOVESTRING(s, d) "%%nacl:(%q" #s "),%%nacl:(%q" #d "), %%r15" -#define MEMSTORESTRING(reg, d) "%%" #reg ",%%nacl:(%q" #d "), %%r15" -#define MEMOPREG(opcode, offset, base, index, scale, reg) \ - BUNDLELOCK \ - "lea " #offset "(%q" #base ",%q" #index "," #scale "),%%r14d\n" \ - #opcode " (%%r15,%%r14),%%" #reg "\n" \ - BUNDLEUNLOCK -#define MEMOPMEM(opcode, reg, offset, base, index, scale) \ - BUNDLELOCK \ - "lea " #offset "(%q" #base ",%q" #index "," #scale "),%%r14d\n" \ - #opcode " %%" #reg ",(%%r15,%%r14)\n" \ - BUNDLEUNLOCK -#define MEMOPARG(opcode, offset, base, index, scale, arg) \ - BUNDLELOCK \ - "lea " #offset "(%q" #base ",%q" #index "," #scale "),%%r14d\n" \ - #opcode " (%%r15,%%r14),%" #arg "\n" \ - BUNDLEUNLOCK -#else -#define BUNDLEALIGN "\n" -#define MEMACCESS(base) "(%" #base ")" -#define MEMACCESS2(offset, base) #offset "(%" #base ")" -#define MEMLEA(offset, base) #offset "(%" #base ")" -#define MEMLEA3(offset, index, scale) \ - #offset "(,%" #index "," #scale ")" -#define MEMLEA4(offset, base, index, scale) \ - #offset "(%" #base ",%" #index "," #scale ")" -#define MEMMOVESTRING(s, d) -#define MEMSTORESTRING(reg, d) -#define MEMOPREG(opcode, offset, base, index, scale, reg) \ - #opcode " " #offset "(%" #base ",%" #index "," #scale "),%%" #reg "\n" -#define MEMOPMEM(opcode, reg, offset, base, index, scale) \ - #opcode " %%" #reg ","#offset "(%" #base ",%" #index "," #scale ")\n" -#define MEMOPARG(opcode, offset, base, index, scale, arg) \ - #opcode " " #offset "(%" #base ",%" #index "," #scale "),%" #arg "\n" -#endif - -void I444ToARGBRow_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToARGBRow_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I411ToARGBRow_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToBGRARow_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_bgra, - int width); -void I422ToABGRRow_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_abgr, - int width); -void I422ToRGBARow_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgba, - int width); -void I422ToRGB24Row_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgb24, - int width); -void I422ToRAWRow_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_raw, - int width); -void I422ToRGB565Row_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgb565, - int width); -void I422ToARGB1555Row_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb1555, - int width); -void I422ToARGB4444Row_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb4444, - int width); -void NV12ToARGBRow_NEON(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void NV21ToARGBRow_NEON(const uint8* src_y, - const uint8* src_vu, - uint8* dst_argb, - int width); -void NV12ToRGB565Row_NEON(const uint8* src_y, - const uint8* src_uv, - uint8* dst_rgb565, - int width); -void NV21ToRGB565Row_NEON(const uint8* src_y, - const uint8* src_vu, - uint8* dst_rgb565, - int width); -void YUY2ToARGBRow_NEON(const uint8* src_yuy2, - uint8* dst_argb, - int width); -void UYVYToARGBRow_NEON(const uint8* src_uyvy, - uint8* dst_argb, - int width); - -void ARGBToYRow_AVX2(const uint8* src_argb, uint8* dst_y, int pix); -void ARGBToYRow_Any_AVX2(const uint8* src_argb, uint8* dst_y, int pix); -void ARGBToYRow_SSSE3(const uint8* src_argb, uint8* dst_y, int pix); -void ARGBToYJRow_AVX2(const uint8* src_argb, uint8* dst_y, int pix); -void ARGBToYJRow_Any_AVX2(const uint8* src_argb, uint8* dst_y, int pix); -void ARGBToYJRow_SSSE3(const uint8* src_argb, uint8* dst_y, int pix); -void BGRAToYRow_SSSE3(const uint8* src_bgra, uint8* dst_y, int pix); -void ABGRToYRow_SSSE3(const uint8* src_abgr, uint8* dst_y, int pix); -void RGBAToYRow_SSSE3(const uint8* src_rgba, uint8* dst_y, int pix); -void RGB24ToYRow_SSSE3(const uint8* src_rgb24, uint8* dst_y, int pix); -void RAWToYRow_SSSE3(const uint8* src_raw, uint8* dst_y, int pix); -void ARGBToYRow_Unaligned_SSSE3(const uint8* src_argb, uint8* dst_y, int pix); -void ARGBToYJRow_Unaligned_SSSE3(const uint8* src_argb, uint8* dst_y, int pix); -void BGRAToYRow_Unaligned_SSSE3(const uint8* src_bgra, uint8* dst_y, int pix); -void ABGRToYRow_Unaligned_SSSE3(const uint8* src_abgr, uint8* dst_y, int pix); -void RGBAToYRow_Unaligned_SSSE3(const uint8* src_rgba, uint8* dst_y, int pix); -void RGB24ToYRow_Unaligned_SSSE3(const uint8* src_rgb24, uint8* dst_y, int pix); -void RAWToYRow_Unaligned_SSSE3(const uint8* src_raw, uint8* dst_y, int pix); -void ARGBToYRow_NEON(const uint8* src_argb, uint8* dst_y, int pix); -void ARGBToYJRow_NEON(const uint8* src_argb, uint8* dst_y, int pix); -void ARGBToUV444Row_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v, - int pix); -void ARGBToUV422Row_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v, - int pix); -void ARGBToUV411Row_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v, - int pix); -void ARGBToUVRow_NEON(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int pix); -void ARGBToUVJRow_NEON(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int pix); -void BGRAToUVRow_NEON(const uint8* src_bgra, int src_stride_bgra, - uint8* dst_u, uint8* dst_v, int pix); -void ABGRToUVRow_NEON(const uint8* src_abgr, int src_stride_abgr, - uint8* dst_u, uint8* dst_v, int pix); -void RGBAToUVRow_NEON(const uint8* src_rgba, int src_stride_rgba, - uint8* dst_u, uint8* dst_v, int pix); -void RGB24ToUVRow_NEON(const uint8* src_rgb24, int src_stride_rgb24, - uint8* dst_u, uint8* dst_v, int pix); -void RAWToUVRow_NEON(const uint8* src_raw, int src_stride_raw, - uint8* dst_u, uint8* dst_v, int pix); -void RGB565ToUVRow_NEON(const uint8* src_rgb565, int src_stride_rgb565, - uint8* dst_u, uint8* dst_v, int pix); -void ARGB1555ToUVRow_NEON(const uint8* src_argb1555, int src_stride_argb1555, - uint8* dst_u, uint8* dst_v, int pix); -void ARGB4444ToUVRow_NEON(const uint8* src_argb4444, int src_stride_argb4444, - uint8* dst_u, uint8* dst_v, int pix); -void BGRAToYRow_NEON(const uint8* src_bgra, uint8* dst_y, int pix); -void ABGRToYRow_NEON(const uint8* src_abgr, uint8* dst_y, int pix); -void RGBAToYRow_NEON(const uint8* src_rgba, uint8* dst_y, int pix); -void RGB24ToYRow_NEON(const uint8* src_rgb24, uint8* dst_y, int pix); -void RAWToYRow_NEON(const uint8* src_raw, uint8* dst_y, int pix); -void RGB565ToYRow_NEON(const uint8* src_rgb565, uint8* dst_y, int pix); -void ARGB1555ToYRow_NEON(const uint8* src_argb1555, uint8* dst_y, int pix); -void ARGB4444ToYRow_NEON(const uint8* src_argb4444, uint8* dst_y, int pix); -void ARGBToYRow_C(const uint8* src_argb, uint8* dst_y, int pix); -void ARGBToYJRow_C(const uint8* src_argb, uint8* dst_y, int pix); -void BGRAToYRow_C(const uint8* src_bgra, uint8* dst_y, int pix); -void ABGRToYRow_C(const uint8* src_abgr, uint8* dst_y, int pix); -void RGBAToYRow_C(const uint8* src_rgba, uint8* dst_y, int pix); -void RGB24ToYRow_C(const uint8* src_rgb24, uint8* dst_y, int pix); -void RAWToYRow_C(const uint8* src_raw, uint8* dst_y, int pix); -void RGB565ToYRow_C(const uint8* src_rgb565, uint8* dst_y, int pix); -void ARGB1555ToYRow_C(const uint8* src_argb1555, uint8* dst_y, int pix); -void ARGB4444ToYRow_C(const uint8* src_argb4444, uint8* dst_y, int pix); -void ARGBToYRow_Any_SSSE3(const uint8* src_argb, uint8* dst_y, int pix); -void ARGBToYJRow_Any_SSSE3(const uint8* src_argb, uint8* dst_y, int pix); -void BGRAToYRow_Any_SSSE3(const uint8* src_bgra, uint8* dst_y, int pix); -void ABGRToYRow_Any_SSSE3(const uint8* src_abgr, uint8* dst_y, int pix); -void RGBAToYRow_Any_SSSE3(const uint8* src_rgba, uint8* dst_y, int pix); -void RGB24ToYRow_Any_SSSE3(const uint8* src_rgb24, uint8* dst_y, int pix); -void RAWToYRow_Any_SSSE3(const uint8* src_raw, uint8* dst_y, int pix); -void ARGBToYRow_Any_NEON(const uint8* src_argb, uint8* dst_y, int pix); -void ARGBToYJRow_Any_NEON(const uint8* src_argb, uint8* dst_y, int pix); -void BGRAToYRow_Any_NEON(const uint8* src_bgra, uint8* dst_y, int pix); -void ABGRToYRow_Any_NEON(const uint8* src_abgr, uint8* dst_y, int pix); -void RGBAToYRow_Any_NEON(const uint8* src_rgba, uint8* dst_y, int pix); -void RGB24ToYRow_Any_NEON(const uint8* src_rgb24, uint8* dst_y, int pix); -void RAWToYRow_Any_NEON(const uint8* src_raw, uint8* dst_y, int pix); -void RGB565ToYRow_Any_NEON(const uint8* src_rgb565, uint8* dst_y, int pix); -void ARGB1555ToYRow_Any_NEON(const uint8* src_argb1555, uint8* dst_y, int pix); -void ARGB4444ToYRow_Any_NEON(const uint8* src_argb4444, uint8* dst_y, int pix); - -void ARGBToUVRow_AVX2(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUVRow_Any_AVX2(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUVRow_SSSE3(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUVJRow_SSSE3(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int width); -void BGRAToUVRow_SSSE3(const uint8* src_bgra, int src_stride_bgra, - uint8* dst_u, uint8* dst_v, int width); -void ABGRToUVRow_SSSE3(const uint8* src_abgr, int src_stride_abgr, - uint8* dst_u, uint8* dst_v, int width); -void RGBAToUVRow_SSSE3(const uint8* src_rgba, int src_stride_rgba, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUVRow_Unaligned_SSSE3(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUVJRow_Unaligned_SSSE3(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int width); -void BGRAToUVRow_Unaligned_SSSE3(const uint8* src_bgra, int src_stride_bgra, - uint8* dst_u, uint8* dst_v, int width); -void ABGRToUVRow_Unaligned_SSSE3(const uint8* src_abgr, int src_stride_abgr, - uint8* dst_u, uint8* dst_v, int width); -void RGBAToUVRow_Unaligned_SSSE3(const uint8* src_rgba, int src_stride_rgba, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUVRow_Any_SSSE3(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUVJRow_Any_SSSE3(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int width); -void BGRAToUVRow_Any_SSSE3(const uint8* src_bgra, int src_stride_bgra, - uint8* dst_u, uint8* dst_v, int width); -void ABGRToUVRow_Any_SSSE3(const uint8* src_abgr, int src_stride_abgr, - uint8* dst_u, uint8* dst_v, int width); -void RGBAToUVRow_Any_SSSE3(const uint8* src_rgba, int src_stride_rgba, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUV444Row_Any_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v, - int pix); -void ARGBToUV422Row_Any_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v, - int pix); -void ARGBToUV411Row_Any_NEON(const uint8* src_argb, uint8* dst_u, uint8* dst_v, - int pix); -void ARGBToUVRow_Any_NEON(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int pix); -void ARGBToUVJRow_Any_NEON(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int pix); -void BGRAToUVRow_Any_NEON(const uint8* src_bgra, int src_stride_bgra, - uint8* dst_u, uint8* dst_v, int pix); -void ABGRToUVRow_Any_NEON(const uint8* src_abgr, int src_stride_abgr, - uint8* dst_u, uint8* dst_v, int pix); -void RGBAToUVRow_Any_NEON(const uint8* src_rgba, int src_stride_rgba, - uint8* dst_u, uint8* dst_v, int pix); -void RGB24ToUVRow_Any_NEON(const uint8* src_rgb24, int src_stride_rgb24, - uint8* dst_u, uint8* dst_v, int pix); -void RAWToUVRow_Any_NEON(const uint8* src_raw, int src_stride_raw, - uint8* dst_u, uint8* dst_v, int pix); -void RGB565ToUVRow_Any_NEON(const uint8* src_rgb565, int src_stride_rgb565, - uint8* dst_u, uint8* dst_v, int pix); -void ARGB1555ToUVRow_Any_NEON(const uint8* src_argb1555, - int src_stride_argb1555, - uint8* dst_u, uint8* dst_v, int pix); -void ARGB4444ToUVRow_Any_NEON(const uint8* src_argb4444, - int src_stride_argb4444, - uint8* dst_u, uint8* dst_v, int pix); -void ARGBToUVRow_C(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUVJRow_C(const uint8* src_argb, int src_stride_argb, - uint8* dst_u, uint8* dst_v, int width); -void BGRAToUVRow_C(const uint8* src_bgra, int src_stride_bgra, - uint8* dst_u, uint8* dst_v, int width); -void ABGRToUVRow_C(const uint8* src_abgr, int src_stride_abgr, - uint8* dst_u, uint8* dst_v, int width); -void RGBAToUVRow_C(const uint8* src_rgba, int src_stride_rgba, - uint8* dst_u, uint8* dst_v, int width); -void RGB24ToUVRow_C(const uint8* src_rgb24, int src_stride_rgb24, - uint8* dst_u, uint8* dst_v, int width); -void RAWToUVRow_C(const uint8* src_raw, int src_stride_raw, - uint8* dst_u, uint8* dst_v, int width); -void RGB565ToUVRow_C(const uint8* src_rgb565, int src_stride_rgb565, - uint8* dst_u, uint8* dst_v, int width); -void ARGB1555ToUVRow_C(const uint8* src_argb1555, int src_stride_argb1555, - uint8* dst_u, uint8* dst_v, int width); -void ARGB4444ToUVRow_C(const uint8* src_argb4444, int src_stride_argb4444, - uint8* dst_u, uint8* dst_v, int width); - -void ARGBToUV444Row_SSSE3(const uint8* src_argb, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUV444Row_Unaligned_SSSE3(const uint8* src_argb, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUV444Row_Any_SSSE3(const uint8* src_argb, - uint8* dst_u, uint8* dst_v, int width); - -void ARGBToUV422Row_SSSE3(const uint8* src_argb, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUV422Row_Unaligned_SSSE3(const uint8* src_argb, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUV422Row_Any_SSSE3(const uint8* src_argb, - uint8* dst_u, uint8* dst_v, int width); - -void ARGBToUV444Row_C(const uint8* src_argb, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUV422Row_C(const uint8* src_argb, - uint8* dst_u, uint8* dst_v, int width); -void ARGBToUV411Row_C(const uint8* src_argb, - uint8* dst_u, uint8* dst_v, int width); - -void MirrorRow_AVX2(const uint8* src, uint8* dst, int width); -void MirrorRow_SSSE3(const uint8* src, uint8* dst, int width); -void MirrorRow_SSE2(const uint8* src, uint8* dst, int width); -void MirrorRow_NEON(const uint8* src, uint8* dst, int width); -void MirrorRow_MIPS_DSPR2(const uint8* src, uint8* dst, int width); -void MirrorRow_C(const uint8* src, uint8* dst, int width); - -void MirrorUVRow_SSSE3(const uint8* src_uv, uint8* dst_u, uint8* dst_v, - int width); -void MirrorUVRow_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v, - int width); -void MirrorUVRow_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, - int width); -void MirrorUVRow_C(const uint8* src_uv, uint8* dst_u, uint8* dst_v, - int width); - -void ARGBMirrorRow_AVX2(const uint8* src, uint8* dst, int width); -void ARGBMirrorRow_SSSE3(const uint8* src, uint8* dst, int width); -void ARGBMirrorRow_NEON(const uint8* src, uint8* dst, int width); -void ARGBMirrorRow_C(const uint8* src, uint8* dst, int width); - -void SplitUVRow_C(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix); -void SplitUVRow_SSE2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix); -void SplitUVRow_AVX2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix); -void SplitUVRow_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int pix); -void SplitUVRow_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, - int pix); -void SplitUVRow_Unaligned_SSE2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, - int pix); -void SplitUVRow_Unaligned_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, - uint8* dst_v, int pix); -void SplitUVRow_Any_SSE2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, - int pix); -void SplitUVRow_Any_AVX2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, - int pix); -void SplitUVRow_Any_NEON(const uint8* src_uv, uint8* dst_u, uint8* dst_v, - int pix); -void SplitUVRow_Any_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, - int pix); - -void MergeUVRow_C(const uint8* src_u, const uint8* src_v, uint8* dst_uv, - int width); -void MergeUVRow_SSE2(const uint8* src_u, const uint8* src_v, uint8* dst_uv, - int width); -void MergeUVRow_AVX2(const uint8* src_u, const uint8* src_v, uint8* dst_uv, - int width); -void MergeUVRow_NEON(const uint8* src_u, const uint8* src_v, uint8* dst_uv, - int width); -void MergeUVRow_Unaligned_SSE2(const uint8* src_u, const uint8* src_v, - uint8* dst_uv, int width); -void MergeUVRow_Any_SSE2(const uint8* src_u, const uint8* src_v, uint8* dst_uv, - int width); -void MergeUVRow_Any_AVX2(const uint8* src_u, const uint8* src_v, uint8* dst_uv, - int width); -void MergeUVRow_Any_NEON(const uint8* src_u, const uint8* src_v, uint8* dst_uv, - int width); - -void CopyRow_SSE2(const uint8* src, uint8* dst, int count); -void CopyRow_ERMS(const uint8* src, uint8* dst, int count); -void CopyRow_X86(const uint8* src, uint8* dst, int count); -void CopyRow_NEON(const uint8* src, uint8* dst, int count); -void CopyRow_MIPS(const uint8* src, uint8* dst, int count); -void CopyRow_C(const uint8* src, uint8* dst, int count); - -void ARGBCopyAlphaRow_C(const uint8* src_argb, uint8* dst_argb, int width); -void ARGBCopyAlphaRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width); -void ARGBCopyAlphaRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width); - -void ARGBCopyYToAlphaRow_C(const uint8* src_y, uint8* dst_argb, int width); -void ARGBCopyYToAlphaRow_SSE2(const uint8* src_y, uint8* dst_argb, int width); -void ARGBCopyYToAlphaRow_AVX2(const uint8* src_y, uint8* dst_argb, int width); - -void SetRow_X86(uint8* dst, uint32 v32, int count); -void ARGBSetRows_X86(uint8* dst, uint32 v32, int width, - int dst_stride, int height); -void SetRow_NEON(uint8* dst, uint32 v32, int count); -void ARGBSetRows_NEON(uint8* dst, uint32 v32, int width, - int dst_stride, int height); -void SetRow_C(uint8* dst, uint32 v32, int count); -void ARGBSetRows_C(uint8* dst, uint32 v32, int width, int dst_stride, - int height); - -// ARGBShufflers for BGRAToARGB etc. -void ARGBShuffleRow_C(const uint8* src_argb, uint8* dst_argb, - const uint8* shuffler, int pix); -void ARGBShuffleRow_SSE2(const uint8* src_argb, uint8* dst_argb, - const uint8* shuffler, int pix); -void ARGBShuffleRow_SSSE3(const uint8* src_argb, uint8* dst_argb, - const uint8* shuffler, int pix); -void ARGBShuffleRow_AVX2(const uint8* src_argb, uint8* dst_argb, - const uint8* shuffler, int pix); -void ARGBShuffleRow_NEON(const uint8* src_argb, uint8* dst_argb, - const uint8* shuffler, int pix); -void ARGBShuffleRow_Unaligned_SSSE3(const uint8* src_argb, uint8* dst_argb, - const uint8* shuffler, int pix); -void ARGBShuffleRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb, - const uint8* shuffler, int pix); -void ARGBShuffleRow_Any_SSSE3(const uint8* src_argb, uint8* dst_argb, - const uint8* shuffler, int pix); -void ARGBShuffleRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb, - const uint8* shuffler, int pix); -void ARGBShuffleRow_Any_NEON(const uint8* src_argb, uint8* dst_argb, - const uint8* shuffler, int pix); - -void RGB24ToARGBRow_SSSE3(const uint8* src_rgb24, uint8* dst_argb, int pix); -void RAWToARGBRow_SSSE3(const uint8* src_raw, uint8* dst_argb, int pix); -void RGB565ToARGBRow_SSE2(const uint8* src_rgb565, uint8* dst_argb, int pix); -void ARGB1555ToARGBRow_SSE2(const uint8* src_argb1555, uint8* dst_argb, - int pix); -void ARGB4444ToARGBRow_SSE2(const uint8* src_argb4444, uint8* dst_argb, - int pix); - -void RGB24ToARGBRow_NEON(const uint8* src_rgb24, uint8* dst_argb, int pix); -void RAWToARGBRow_NEON(const uint8* src_raw, uint8* dst_argb, int pix); -void RGB565ToARGBRow_NEON(const uint8* src_rgb565, uint8* dst_argb, int pix); -void ARGB1555ToARGBRow_NEON(const uint8* src_argb1555, uint8* dst_argb, - int pix); -void ARGB4444ToARGBRow_NEON(const uint8* src_argb4444, uint8* dst_argb, - int pix); -void RGB24ToARGBRow_C(const uint8* src_rgb24, uint8* dst_argb, int pix); -void RAWToARGBRow_C(const uint8* src_raw, uint8* dst_argb, int pix); -void RGB565ToARGBRow_C(const uint8* src_rgb, uint8* dst_argb, int pix); -void ARGB1555ToARGBRow_C(const uint8* src_argb, uint8* dst_argb, int pix); -void ARGB4444ToARGBRow_C(const uint8* src_argb, uint8* dst_argb, int pix); -void RGB24ToARGBRow_Any_SSSE3(const uint8* src_rgb24, uint8* dst_argb, int pix); -void RAWToARGBRow_Any_SSSE3(const uint8* src_raw, uint8* dst_argb, int pix); -void RGB565ToARGBRow_Any_SSE2(const uint8* src_rgb565, uint8* dst_argb, - int pix); -void ARGB1555ToARGBRow_Any_SSE2(const uint8* src_argb1555, uint8* dst_argb, - int pix); -void ARGB4444ToARGBRow_Any_SSE2(const uint8* src_argb4444, uint8* dst_argb, - int pix); -void RGB24ToARGBRow_Any_NEON(const uint8* src_rgb24, uint8* dst_argb, int pix); -void RAWToARGBRow_Any_NEON(const uint8* src_raw, uint8* dst_argb, int pix); -void RGB565ToARGBRow_Any_NEON(const uint8* src_rgb565, uint8* dst_argb, - int pix); -void ARGB1555ToARGBRow_Any_NEON(const uint8* src_argb1555, uint8* dst_argb, - int pix); -void ARGB4444ToARGBRow_Any_NEON(const uint8* src_argb4444, uint8* dst_argb, - int pix); - -void ARGBToRGB24Row_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToRAWRow_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToRGB565Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToARGB1555Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToARGB4444Row_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix); - -void ARGBToRGB24Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToRAWRow_NEON(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToRGB565Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToARGB1555Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToARGB4444Row_NEON(const uint8* src_argb, uint8* dst_rgb, int pix); - -void ARGBToRGBARow_C(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToRGB24Row_C(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToRAWRow_C(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToRGB565Row_C(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToARGB1555Row_C(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToARGB4444Row_C(const uint8* src_argb, uint8* dst_rgb, int pix); - -void I400ToARGBRow_SSE2(const uint8* src_y, uint8* dst_argb, int pix); -void I400ToARGBRow_Unaligned_SSE2(const uint8* src_y, uint8* dst_argb, int pix); -void I400ToARGBRow_NEON(const uint8* src_y, uint8* dst_argb, int pix); -void I400ToARGBRow_C(const uint8* src_y, uint8* dst_argb, int pix); -void I400ToARGBRow_Any_SSE2(const uint8* src_y, uint8* dst_argb, int pix); -void I400ToARGBRow_Any_NEON(const uint8* src_y, uint8* dst_argb, int pix); - -void I444ToARGBRow_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToARGBRow_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I411ToARGBRow_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void NV12ToARGBRow_C(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void NV21ToRGB565Row_C(const uint8* src_y, - const uint8* src_vu, - uint8* dst_argb, - int width); -void NV12ToRGB565Row_C(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void NV21ToARGBRow_C(const uint8* src_y, - const uint8* src_vu, - uint8* dst_argb, - int width); -void YUY2ToARGBRow_C(const uint8* src_yuy2, - uint8* dst_argb, - int width); -void UYVYToARGBRow_C(const uint8* src_uyvy, - uint8* dst_argb, - int width); -void I422ToBGRARow_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_bgra, - int width); -void I422ToABGRRow_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_abgr, - int width); -void I422ToRGBARow_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgba, - int width); -void I422ToRGB24Row_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgb24, - int width); -void I422ToRAWRow_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_raw, - int width); -void I422ToARGB4444Row_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb4444, - int width); -void I422ToARGB1555Row_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb4444, - int width); -void I422ToRGB565Row_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgb565, - int width); -void YToARGBRow_C(const uint8* src_y, - uint8* dst_argb, - int width); -void I422ToARGBRow_AVX2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I444ToARGBRow_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToARGBRow_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I411ToARGBRow_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void NV12ToARGBRow_SSSE3(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void NV21ToARGBRow_SSSE3(const uint8* src_y, - const uint8* src_vu, - uint8* dst_argb, - int width); -void NV12ToRGB565Row_SSSE3(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void NV21ToRGB565Row_SSSE3(const uint8* src_y, - const uint8* src_vu, - uint8* dst_argb, - int width); -void YUY2ToARGBRow_SSSE3(const uint8* src_yuy2, - uint8* dst_argb, - int width); -void UYVYToARGBRow_SSSE3(const uint8* src_uyvy, - uint8* dst_argb, - int width); -void I422ToBGRARow_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_bgra, - int width); -void I422ToABGRRow_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_abgr, - int width); -void I422ToRGBARow_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgba, - int width); -void I422ToARGB4444Row_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToARGB1555Row_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToRGB565Row_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -// RGB24/RAW are unaligned. -void I422ToRGB24Row_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgb24, - int width); -void I422ToRAWRow_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_raw, - int width); - -void I444ToARGBRow_Unaligned_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToARGBRow_Unaligned_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I411ToARGBRow_Unaligned_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void NV12ToARGBRow_Unaligned_SSSE3(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void NV21ToARGBRow_Unaligned_SSSE3(const uint8* src_y, - const uint8* src_vu, - uint8* dst_argb, - int width); -void YUY2ToARGBRow_Unaligned_SSSE3(const uint8* src_yuy2, - uint8* dst_argb, - int width); -void UYVYToARGBRow_Unaligned_SSSE3(const uint8* src_uyvy, - uint8* dst_argb, - int width); -void I422ToBGRARow_Unaligned_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_bgra, - int width); -void I422ToABGRRow_Unaligned_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_abgr, - int width); -void I422ToRGBARow_Unaligned_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgba, - int width); -void I422ToARGBRow_Any_AVX2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I444ToARGBRow_Any_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToARGBRow_Any_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I411ToARGBRow_Any_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void NV12ToARGBRow_Any_SSSE3(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void NV21ToARGBRow_Any_SSSE3(const uint8* src_y, - const uint8* src_vu, - uint8* dst_argb, - int width); -void NV12ToRGB565Row_Any_SSSE3(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void NV21ToRGB565Row_Any_SSSE3(const uint8* src_y, - const uint8* src_vu, - uint8* dst_argb, - int width); -void YUY2ToARGBRow_Any_SSSE3(const uint8* src_yuy2, - uint8* dst_argb, - int width); -void UYVYToARGBRow_Any_SSSE3(const uint8* src_uyvy, - uint8* dst_argb, - int width); -void I422ToBGRARow_Any_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_bgra, - int width); -void I422ToABGRRow_Any_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_abgr, - int width); -void I422ToRGBARow_Any_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgba, - int width); -void I422ToARGB4444Row_Any_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgba, - int width); -void I422ToARGB1555Row_Any_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgba, - int width); -void I422ToRGB565Row_Any_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_rgba, - int width); -// RGB24/RAW are unaligned. -void I422ToRGB24Row_Any_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToRAWRow_Any_SSSE3(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void YToARGBRow_SSE2(const uint8* src_y, - uint8* dst_argb, - int width); -void YToARGBRow_NEON(const uint8* src_y, - uint8* dst_argb, - int width); -void YToARGBRow_Any_SSE2(const uint8* src_y, - uint8* dst_argb, - int width); -void YToARGBRow_Any_NEON(const uint8* src_y, - uint8* dst_argb, - int width); - -// ARGB preattenuated alpha blend. -void ARGBBlendRow_SSSE3(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBBlendRow_SSE2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBBlendRow_NEON(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBBlendRow_C(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); - -// ARGB multiply images. Same API as Blend, but these require -// pointer and width alignment for SSE2. -void ARGBMultiplyRow_C(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBMultiplyRow_SSE2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBMultiplyRow_Any_SSE2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBMultiplyRow_AVX2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBMultiplyRow_Any_AVX2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBMultiplyRow_NEON(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBMultiplyRow_Any_NEON(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); - -// ARGB add images. -void ARGBAddRow_C(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBAddRow_SSE2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBAddRow_Any_SSE2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBAddRow_AVX2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBAddRow_Any_AVX2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBAddRow_NEON(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBAddRow_Any_NEON(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); - -// ARGB subtract images. Same API as Blend, but these require -// pointer and width alignment for SSE2. -void ARGBSubtractRow_C(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBSubtractRow_SSE2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBSubtractRow_Any_SSE2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBSubtractRow_AVX2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBSubtractRow_Any_AVX2(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBSubtractRow_NEON(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); -void ARGBSubtractRow_Any_NEON(const uint8* src_argb, const uint8* src_argb1, - uint8* dst_argb, int width); - -void ARGBToRGB24Row_Any_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToRAWRow_Any_SSSE3(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToRGB565Row_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToARGB1555Row_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToARGB4444Row_Any_SSE2(const uint8* src_argb, uint8* dst_rgb, int pix); - -void ARGBToRGB24Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToRAWRow_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToRGB565Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToARGB1555Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix); -void ARGBToARGB4444Row_Any_NEON(const uint8* src_argb, uint8* dst_rgb, int pix); - -void I444ToARGBRow_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToARGBRow_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I411ToARGBRow_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToBGRARow_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToABGRRow_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToRGBARow_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToRGB24Row_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToRAWRow_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToARGB4444Row_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToARGB1555Row_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToRGB565Row_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void NV12ToARGBRow_Any_NEON(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void NV21ToARGBRow_Any_NEON(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void NV12ToRGB565Row_Any_NEON(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void NV21ToRGB565Row_Any_NEON(const uint8* src_y, - const uint8* src_uv, - uint8* dst_argb, - int width); -void YUY2ToARGBRow_Any_NEON(const uint8* src_yuy2, - uint8* dst_argb, - int width); -void UYVYToARGBRow_Any_NEON(const uint8* src_uyvy, - uint8* dst_argb, - int width); -void I422ToARGBRow_MIPS_DSPR2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToBGRARow_MIPS_DSPR2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToABGRRow_MIPS_DSPR2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToARGBRow_MIPS_DSPR2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToBGRARow_MIPS_DSPR2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); -void I422ToABGRRow_MIPS_DSPR2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_argb, - int width); - -void YUY2ToYRow_AVX2(const uint8* src_yuy2, uint8* dst_y, int pix); -void YUY2ToUVRow_AVX2(const uint8* src_yuy2, int stride_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToUV422Row_AVX2(const uint8* src_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToYRow_SSE2(const uint8* src_yuy2, uint8* dst_y, int pix); -void YUY2ToUVRow_SSE2(const uint8* src_yuy2, int stride_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToUV422Row_SSE2(const uint8* src_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToYRow_Unaligned_SSE2(const uint8* src_yuy2, - uint8* dst_y, int pix); -void YUY2ToUVRow_Unaligned_SSE2(const uint8* src_yuy2, int stride_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToUV422Row_Unaligned_SSE2(const uint8* src_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToYRow_NEON(const uint8* src_yuy2, uint8* dst_y, int pix); -void YUY2ToUVRow_NEON(const uint8* src_yuy2, int stride_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToUV422Row_NEON(const uint8* src_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToYRow_C(const uint8* src_yuy2, uint8* dst_y, int pix); -void YUY2ToUVRow_C(const uint8* src_yuy2, int stride_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToUV422Row_C(const uint8* src_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToYRow_Any_AVX2(const uint8* src_yuy2, uint8* dst_y, int pix); -void YUY2ToUVRow_Any_AVX2(const uint8* src_yuy2, int stride_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToUV422Row_Any_AVX2(const uint8* src_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToYRow_Any_SSE2(const uint8* src_yuy2, uint8* dst_y, int pix); -void YUY2ToUVRow_Any_SSE2(const uint8* src_yuy2, int stride_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToUV422Row_Any_SSE2(const uint8* src_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToYRow_Any_NEON(const uint8* src_yuy2, uint8* dst_y, int pix); -void YUY2ToUVRow_Any_NEON(const uint8* src_yuy2, int stride_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void YUY2ToUV422Row_Any_NEON(const uint8* src_yuy2, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToYRow_AVX2(const uint8* src_uyvy, uint8* dst_y, int pix); -void UYVYToUVRow_AVX2(const uint8* src_uyvy, int stride_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToUV422Row_AVX2(const uint8* src_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToYRow_SSE2(const uint8* src_uyvy, uint8* dst_y, int pix); -void UYVYToUVRow_SSE2(const uint8* src_uyvy, int stride_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToUV422Row_SSE2(const uint8* src_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToYRow_Unaligned_SSE2(const uint8* src_uyvy, - uint8* dst_y, int pix); -void UYVYToUVRow_Unaligned_SSE2(const uint8* src_uyvy, int stride_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToUV422Row_Unaligned_SSE2(const uint8* src_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToYRow_AVX2(const uint8* src_uyvy, uint8* dst_y, int pix); -void UYVYToUVRow_AVX2(const uint8* src_uyvy, int stride_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToUV422Row_AVX2(const uint8* src_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToYRow_NEON(const uint8* src_uyvy, uint8* dst_y, int pix); -void UYVYToUVRow_NEON(const uint8* src_uyvy, int stride_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToUV422Row_NEON(const uint8* src_uyvy, - uint8* dst_u, uint8* dst_v, int pix); - -void UYVYToYRow_C(const uint8* src_uyvy, uint8* dst_y, int pix); -void UYVYToUVRow_C(const uint8* src_uyvy, int stride_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToUV422Row_C(const uint8* src_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToYRow_Any_AVX2(const uint8* src_uyvy, uint8* dst_y, int pix); -void UYVYToUVRow_Any_AVX2(const uint8* src_uyvy, int stride_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToUV422Row_Any_AVX2(const uint8* src_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToYRow_Any_SSE2(const uint8* src_uyvy, uint8* dst_y, int pix); -void UYVYToUVRow_Any_SSE2(const uint8* src_uyvy, int stride_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToUV422Row_Any_SSE2(const uint8* src_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToYRow_Any_NEON(const uint8* src_uyvy, uint8* dst_y, int pix); -void UYVYToUVRow_Any_NEON(const uint8* src_uyvy, int stride_uyvy, - uint8* dst_u, uint8* dst_v, int pix); -void UYVYToUV422Row_Any_NEON(const uint8* src_uyvy, - uint8* dst_u, uint8* dst_v, int pix); - -void HalfRow_C(const uint8* src_uv, int src_uv_stride, - uint8* dst_uv, int pix); -void HalfRow_SSE2(const uint8* src_uv, int src_uv_stride, - uint8* dst_uv, int pix); -void HalfRow_AVX2(const uint8* src_uv, int src_uv_stride, - uint8* dst_uv, int pix); -void HalfRow_NEON(const uint8* src_uv, int src_uv_stride, - uint8* dst_uv, int pix); - -void ARGBToBayerRow_C(const uint8* src_argb, uint8* dst_bayer, - uint32 selector, int pix); -void ARGBToBayerRow_SSSE3(const uint8* src_argb, uint8* dst_bayer, - uint32 selector, int pix); -void ARGBToBayerRow_NEON(const uint8* src_argb, uint8* dst_bayer, - uint32 selector, int pix); -void ARGBToBayerRow_Any_SSSE3(const uint8* src_argb, uint8* dst_bayer, - uint32 selector, int pix); -void ARGBToBayerRow_Any_NEON(const uint8* src_argb, uint8* dst_bayer, - uint32 selector, int pix); -void ARGBToBayerGGRow_C(const uint8* src_argb, uint8* dst_bayer, - uint32 /* selector */, int pix); -void ARGBToBayerGGRow_SSE2(const uint8* src_argb, uint8* dst_bayer, - uint32 /* selector */, int pix); -void ARGBToBayerGGRow_NEON(const uint8* src_argb, uint8* dst_bayer, - uint32 /* selector */, int pix); -void ARGBToBayerGGRow_Any_SSE2(const uint8* src_argb, uint8* dst_bayer, - uint32 /* selector */, int pix); -void ARGBToBayerGGRow_Any_NEON(const uint8* src_argb, uint8* dst_bayer, - uint32 /* selector */, int pix); - -void I422ToYUY2Row_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_yuy2, int width); -void I422ToUYVYRow_C(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_uyvy, int width); -void I422ToYUY2Row_SSE2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_yuy2, int width); -void I422ToUYVYRow_SSE2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_uyvy, int width); -void I422ToYUY2Row_Any_SSE2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_yuy2, int width); -void I422ToUYVYRow_Any_SSE2(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_uyvy, int width); -void I422ToYUY2Row_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_yuy2, int width); -void I422ToUYVYRow_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_uyvy, int width); -void I422ToYUY2Row_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_yuy2, int width); -void I422ToUYVYRow_Any_NEON(const uint8* src_y, - const uint8* src_u, - const uint8* src_v, - uint8* dst_uyvy, int width); - -// Effects related row functions. -void ARGBAttenuateRow_C(const uint8* src_argb, uint8* dst_argb, int width); -void ARGBAttenuateRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width); -void ARGBAttenuateRow_SSSE3(const uint8* src_argb, uint8* dst_argb, int width); -void ARGBAttenuateRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width); -void ARGBAttenuateRow_NEON(const uint8* src_argb, uint8* dst_argb, int width); -void ARGBAttenuateRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb, - int width); -void ARGBAttenuateRow_Any_SSSE3(const uint8* src_argb, uint8* dst_argb, - int width); -void ARGBAttenuateRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb, - int width); -void ARGBAttenuateRow_Any_NEON(const uint8* src_argb, uint8* dst_argb, - int width); - -// Inverse table for unattenuate, shared by C and SSE2. -extern const uint32 fixed_invtbl8[256]; -void ARGBUnattenuateRow_C(const uint8* src_argb, uint8* dst_argb, int width); -void ARGBUnattenuateRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width); -void ARGBUnattenuateRow_AVX2(const uint8* src_argb, uint8* dst_argb, int width); -void ARGBUnattenuateRow_Any_SSE2(const uint8* src_argb, uint8* dst_argb, - int width); -void ARGBUnattenuateRow_Any_AVX2(const uint8* src_argb, uint8* dst_argb, - int width); - -void ARGBGrayRow_C(const uint8* src_argb, uint8* dst_argb, int width); -void ARGBGrayRow_SSSE3(const uint8* src_argb, uint8* dst_argb, int width); -void ARGBGrayRow_NEON(const uint8* src_argb, uint8* dst_argb, int width); - -void ARGBSepiaRow_C(uint8* dst_argb, int width); -void ARGBSepiaRow_SSSE3(uint8* dst_argb, int width); -void ARGBSepiaRow_NEON(uint8* dst_argb, int width); - -void ARGBColorMatrixRow_C(const uint8* src_argb, uint8* dst_argb, - const int8* matrix_argb, int width); -void ARGBColorMatrixRow_SSSE3(const uint8* src_argb, uint8* dst_argb, - const int8* matrix_argb, int width); -void ARGBColorMatrixRow_NEON(const uint8* src_argb, uint8* dst_argb, - const int8* matrix_argb, int width); - -void ARGBColorTableRow_C(uint8* dst_argb, const uint8* table_argb, int width); -void ARGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb, int width); - -void RGBColorTableRow_C(uint8* dst_argb, const uint8* table_argb, int width); -void RGBColorTableRow_X86(uint8* dst_argb, const uint8* table_argb, int width); - -void ARGBQuantizeRow_C(uint8* dst_argb, int scale, int interval_size, - int interval_offset, int width); -void ARGBQuantizeRow_SSE2(uint8* dst_argb, int scale, int interval_size, - int interval_offset, int width); -void ARGBQuantizeRow_NEON(uint8* dst_argb, int scale, int interval_size, - int interval_offset, int width); - -void ARGBShadeRow_C(const uint8* src_argb, uint8* dst_argb, int width, - uint32 value); -void ARGBShadeRow_SSE2(const uint8* src_argb, uint8* dst_argb, int width, - uint32 value); -void ARGBShadeRow_NEON(const uint8* src_argb, uint8* dst_argb, int width, - uint32 value); - -// Used for blur. -void CumulativeSumToAverageRow_SSE2(const int32* topleft, const int32* botleft, - int width, int area, uint8* dst, int count); -void ComputeCumulativeSumRow_SSE2(const uint8* row, int32* cumsum, - const int32* previous_cumsum, int width); - -void CumulativeSumToAverageRow_C(const int32* topleft, const int32* botleft, - int width, int area, uint8* dst, int count); -void ComputeCumulativeSumRow_C(const uint8* row, int32* cumsum, - const int32* previous_cumsum, int width); - -LIBYUV_API -void ARGBAffineRow_C(const uint8* src_argb, int src_argb_stride, - uint8* dst_argb, const float* uv_dudv, int width); -LIBYUV_API -void ARGBAffineRow_SSE2(const uint8* src_argb, int src_argb_stride, - uint8* dst_argb, const float* uv_dudv, int width); - -// Used for I420Scale, ARGBScale, and ARGBInterpolate. -void InterpolateRow_C(uint8* dst_ptr, const uint8* src_ptr, - ptrdiff_t src_stride_ptr, - int width, int source_y_fraction); -void InterpolateRow_SSE2(uint8* dst_ptr, const uint8* src_ptr, - ptrdiff_t src_stride_ptr, int width, - int source_y_fraction); -void InterpolateRow_SSSE3(uint8* dst_ptr, const uint8* src_ptr, - ptrdiff_t src_stride_ptr, int width, - int source_y_fraction); -void InterpolateRow_AVX2(uint8* dst_ptr, const uint8* src_ptr, - ptrdiff_t src_stride_ptr, int width, - int source_y_fraction); -void InterpolateRow_NEON(uint8* dst_ptr, const uint8* src_ptr, - ptrdiff_t src_stride_ptr, int width, - int source_y_fraction); -void InterpolateRows_MIPS_DSPR2(uint8* dst_ptr, const uint8* src_ptr, - ptrdiff_t src_stride_ptr, int width, - int source_y_fraction); -void InterpolateRow_Unaligned_SSE2(uint8* dst_ptr, const uint8* src_ptr, - ptrdiff_t src_stride_ptr, int width, - int source_y_fraction); -void InterpolateRow_Unaligned_SSSE3(uint8* dst_ptr, const uint8* src_ptr, - ptrdiff_t src_stride_ptr, int width, - int source_y_fraction); -void InterpolateRow_Any_NEON(uint8* dst_ptr, const uint8* src_ptr, - ptrdiff_t src_stride_ptr, int width, - int source_y_fraction); -void InterpolateRow_Any_SSE2(uint8* dst_ptr, const uint8* src_ptr, - ptrdiff_t src_stride_ptr, int width, - int source_y_fraction); -void InterpolateRow_Any_SSSE3(uint8* dst_ptr, const uint8* src_ptr, - ptrdiff_t src_stride_ptr, int width, - int source_y_fraction); -void InterpolateRow_Any_AVX2(uint8* dst_ptr, const uint8* src_ptr, - ptrdiff_t src_stride_ptr, int width, - int source_y_fraction); -void InterpolateRows_Any_MIPS_DSPR2(uint8* dst_ptr, const uint8* src_ptr, - ptrdiff_t src_stride_ptr, int width, - int source_y_fraction); - -// Sobel images. -void SobelXRow_C(const uint8* src_y0, const uint8* src_y1, const uint8* src_y2, - uint8* dst_sobelx, int width); -void SobelXRow_SSE2(const uint8* src_y0, const uint8* src_y1, - const uint8* src_y2, uint8* dst_sobelx, int width); -void SobelXRow_NEON(const uint8* src_y0, const uint8* src_y1, - const uint8* src_y2, uint8* dst_sobelx, int width); -void SobelYRow_C(const uint8* src_y0, const uint8* src_y1, - uint8* dst_sobely, int width); -void SobelYRow_SSE2(const uint8* src_y0, const uint8* src_y1, - uint8* dst_sobely, int width); -void SobelYRow_NEON(const uint8* src_y0, const uint8* src_y1, - uint8* dst_sobely, int width); -void SobelRow_C(const uint8* src_sobelx, const uint8* src_sobely, - uint8* dst_argb, int width); -void SobelRow_SSE2(const uint8* src_sobelx, const uint8* src_sobely, - uint8* dst_argb, int width); -void SobelRow_NEON(const uint8* src_sobelx, const uint8* src_sobely, - uint8* dst_argb, int width); -void SobelToPlaneRow_C(const uint8* src_sobelx, const uint8* src_sobely, - uint8* dst_y, int width); -void SobelToPlaneRow_SSE2(const uint8* src_sobelx, const uint8* src_sobely, - uint8* dst_y, int width); -void SobelToPlaneRow_NEON(const uint8* src_sobelx, const uint8* src_sobely, - uint8* dst_y, int width); -void SobelXYRow_C(const uint8* src_sobelx, const uint8* src_sobely, - uint8* dst_argb, int width); -void SobelXYRow_SSE2(const uint8* src_sobelx, const uint8* src_sobely, - uint8* dst_argb, int width); -void SobelXYRow_NEON(const uint8* src_sobelx, const uint8* src_sobely, - uint8* dst_argb, int width); - -void ARGBPolynomialRow_C(const uint8* src_argb, - uint8* dst_argb, const float* poly, - int width); -void ARGBPolynomialRow_SSE2(const uint8* src_argb, - uint8* dst_argb, const float* poly, - int width); -void ARGBPolynomialRow_AVX2(const uint8* src_argb, - uint8* dst_argb, const float* poly, - int width); - -void ARGBLumaColorTableRow_C(const uint8* src_argb, uint8* dst_argb, int width, - const uint8* luma, uint32 lumacoeff); -void ARGBLumaColorTableRow_SSSE3(const uint8* src_argb, uint8* dst_argb, - int width, - const uint8* luma, uint32 lumacoeff); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_ROW_H_ NOLINT diff --git a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/scale.h b/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/scale.h deleted file mode 100755 index 592b8ed..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/scale.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2011 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_SCALE_H_ // NOLINT -#define INCLUDE_LIBYUV_SCALE_H_ - -#include "libyuv/basic_types.h" - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -// Supported filtering. -typedef enum FilterMode { - kFilterNone = 0, // Point sample; Fastest. - kFilterLinear = 1, // Filter horizontally only. - kFilterBilinear = 2, // Faster than box, but lower quality scaling down. - kFilterBox = 3 // Highest quality. -} FilterModeEnum; - -// Scale a YUV plane. -LIBYUV_API -void ScalePlane(const uint8* src, int src_stride, - int src_width, int src_height, - uint8* dst, int dst_stride, - int dst_width, int dst_height, - enum FilterMode filtering); - -// Scales a YUV 4:2:0 image from the src width and height to the -// dst width and height. -// If filtering is kFilterNone, a simple nearest-neighbor algorithm is -// used. This produces basic (blocky) quality at the fastest speed. -// If filtering is kFilterBilinear, interpolation is used to produce a better -// quality image, at the expense of speed. -// If filtering is kFilterBox, averaging is used to produce ever better -// quality image, at further expense of speed. -// Returns 0 if successful. - -LIBYUV_API -int I420Scale(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - int src_width, int src_height, - uint8* dst_y, int dst_stride_y, - uint8* dst_u, int dst_stride_u, - uint8* dst_v, int dst_stride_v, - int dst_width, int dst_height, - enum FilterMode filtering); - -#ifdef __cplusplus -// Legacy API. Deprecated. -LIBYUV_API -int Scale(const uint8* src_y, const uint8* src_u, const uint8* src_v, - int src_stride_y, int src_stride_u, int src_stride_v, - int src_width, int src_height, - uint8* dst_y, uint8* dst_u, uint8* dst_v, - int dst_stride_y, int dst_stride_u, int dst_stride_v, - int dst_width, int dst_height, - LIBYUV_BOOL interpolate); - -// Legacy API. Deprecated. -LIBYUV_API -int ScaleOffset(const uint8* src_i420, int src_width, int src_height, - uint8* dst_i420, int dst_width, int dst_height, int dst_yoffset, - LIBYUV_BOOL interpolate); - -// For testing, allow disabling of specialized scalers. -LIBYUV_API -void SetUseReferenceImpl(LIBYUV_BOOL use); -#endif // __cplusplus - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_SCALE_H_ NOLINT diff --git a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/scale_argb.h b/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/scale_argb.h deleted file mode 100755 index 0c9b362..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/scale_argb.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2012 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_SCALE_ARGB_H_ // NOLINT -#define INCLUDE_LIBYUV_SCALE_ARGB_H_ - -#include "libyuv/basic_types.h" -#include "libyuv/scale.h" // For FilterMode - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -LIBYUV_API -int ARGBScale(const uint8* src_argb, int src_stride_argb, - int src_width, int src_height, - uint8* dst_argb, int dst_stride_argb, - int dst_width, int dst_height, - enum FilterMode filtering); - -// Clipped scale takes destination rectangle coordinates for clip values. -LIBYUV_API -int ARGBScaleClip(const uint8* src_argb, int src_stride_argb, - int src_width, int src_height, - uint8* dst_argb, int dst_stride_argb, - int dst_width, int dst_height, - int clip_x, int clip_y, int clip_width, int clip_height, - enum FilterMode filtering); - -// TODO(fbarchard): Implement this. -// Scale with YUV conversion to ARGB and clipping. -LIBYUV_API -int YUVToARGBScaleClip(const uint8* src_y, int src_stride_y, - const uint8* src_u, int src_stride_u, - const uint8* src_v, int src_stride_v, - uint32 src_fourcc, - int src_width, int src_height, - uint8* dst_argb, int dst_stride_argb, - uint32 dst_fourcc, - int dst_width, int dst_height, - int clip_x, int clip_y, int clip_width, int clip_height, - enum FilterMode filtering); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_SCALE_ARGB_H_ NOLINT diff --git a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/scale_row.h b/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/scale_row.h deleted file mode 100755 index 13eccc4..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/scale_row.h +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Copyright 2013 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_SCALE_ROW_H_ // NOLINT -#define INCLUDE_LIBYUV_SCALE_ROW_H_ - -#include "libyuv/basic_types.h" - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -#if defined(__pnacl__) || defined(__CLR_VER) || defined(COVERAGE_ENABLED) || \ - defined(TARGET_IPHONE_SIMULATOR) -#define LIBYUV_DISABLE_X86 -#endif - -// The following are available on all x86 platforms: -#if !defined(LIBYUV_DISABLE_X86) && \ - (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__)) -#define HAS_SCALEROWDOWN2_SSE2 -#define HAS_SCALEROWDOWN4_SSE2 -#define HAS_SCALEROWDOWN34_SSSE3 -#define HAS_SCALEROWDOWN38_SSSE3 -#define HAS_SCALEADDROWS_SSE2 -#define HAS_SCALEFILTERCOLS_SSSE3 -#define HAS_SCALECOLSUP2_SSE2 -#define HAS_SCALEARGBROWDOWN2_SSE2 -#define HAS_SCALEARGBROWDOWNEVEN_SSE2 -#define HAS_SCALEARGBCOLS_SSE2 -#define HAS_SCALEARGBFILTERCOLS_SSSE3 -#define HAS_SCALEARGBCOLSUP2_SSE2 -#define HAS_FIXEDDIV_X86 -#define HAS_FIXEDDIV1_X86 -#endif - -// The following are available on Neon platforms: -#if !defined(LIBYUV_DISABLE_NEON) && !defined(__native_client__) && \ - (defined(__ARM_NEON__) || defined(LIBYUV_NEON)) -#define HAS_SCALEROWDOWN2_NEON -#define HAS_SCALEROWDOWN4_NEON -#define HAS_SCALEROWDOWN34_NEON -#define HAS_SCALEROWDOWN38_NEON -#define HAS_SCALEARGBROWDOWNEVEN_NEON -#define HAS_SCALEARGBROWDOWN2_NEON -#endif - -// The following are available on Mips platforms: -#if !defined(LIBYUV_DISABLE_MIPS) && !defined(__native_client__) && \ - defined(__mips__) && defined(__mips_dsp) && (__mips_dsp_rev >= 2) -#define HAS_SCALEROWDOWN2_MIPS_DSPR2 -#define HAS_SCALEROWDOWN4_MIPS_DSPR2 -#define HAS_SCALEROWDOWN34_MIPS_DSPR2 -#define HAS_SCALEROWDOWN38_MIPS_DSPR2 -#endif - -// Scale ARGB vertically with bilinear interpolation. -void ScalePlaneVertical(int src_height, - int dst_width, int dst_height, - int src_stride, int dst_stride, - const uint8* src_argb, uint8* dst_argb, - int x, int y, int dy, - int bpp, enum FilterMode filtering); - -// Simplify the filtering based on scale factors. -enum FilterMode ScaleFilterReduce(int src_width, int src_height, - int dst_width, int dst_height, - enum FilterMode filtering); - -// Divide num by div and return as 16.16 fixed point result. -int FixedDiv_C(int num, int div); -int FixedDiv_X86(int num, int div); -// Divide num - 1 by div - 1 and return as 16.16 fixed point result. -int FixedDiv1_C(int num, int div); -int FixedDiv1_X86(int num, int div); -#ifdef HAS_FIXEDDIV_X86 -#define FixedDiv FixedDiv_X86 -#define FixedDiv1 FixedDiv1_X86 -#else -#define FixedDiv FixedDiv_C -#define FixedDiv1 FixedDiv1_C -#endif - -// Compute slope values for stepping. -void ScaleSlope(int src_width, int src_height, - int dst_width, int dst_height, - enum FilterMode filtering, - int* x, int* y, int* dx, int* dy); - -void ScaleRowDown2_C(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown2Linear_C(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown2Box_C(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown4_C(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown4Box_C(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown34_C(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown34_0_Box_C(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* d, int dst_width); -void ScaleRowDown34_1_Box_C(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* d, int dst_width); -void ScaleCols_C(uint8* dst_ptr, const uint8* src_ptr, - int dst_width, int x, int dx); -void ScaleColsUp2_C(uint8* dst_ptr, const uint8* src_ptr, - int dst_width, int, int); -void ScaleFilterCols_C(uint8* dst_ptr, const uint8* src_ptr, - int dst_width, int x, int dx); -void ScaleFilterCols64_C(uint8* dst_ptr, const uint8* src_ptr, - int dst_width, int x, int dx); -void ScaleRowDown38_C(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown38_3_Box_C(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown38_2_Box_C(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleAddRows_C(const uint8* src_ptr, ptrdiff_t src_stride, - uint16* dst_ptr, int src_width, int src_height); -void ScaleARGBRowDown2_C(const uint8* src_argb, - ptrdiff_t src_stride, - uint8* dst_argb, int dst_width); -void ScaleARGBRowDown2Linear_C(const uint8* src_argb, - ptrdiff_t src_stride, - uint8* dst_argb, int dst_width); -void ScaleARGBRowDown2Box_C(const uint8* src_argb, ptrdiff_t src_stride, - uint8* dst_argb, int dst_width); -void ScaleARGBRowDownEven_C(const uint8* src_argb, ptrdiff_t src_stride, - int src_stepx, - uint8* dst_argb, int dst_width); -void ScaleARGBRowDownEvenBox_C(const uint8* src_argb, - ptrdiff_t src_stride, - int src_stepx, - uint8* dst_argb, int dst_width); -void ScaleARGBCols_C(uint8* dst_argb, const uint8* src_argb, - int dst_width, int x, int dx); -void ScaleARGBCols64_C(uint8* dst_argb, const uint8* src_argb, - int dst_width, int x, int dx); -void ScaleARGBColsUp2_C(uint8* dst_argb, const uint8* src_argb, - int dst_width, int, int); -void ScaleARGBFilterCols_C(uint8* dst_argb, const uint8* src_argb, - int dst_width, int x, int dx); -void ScaleARGBFilterCols64_C(uint8* dst_argb, const uint8* src_argb, - int dst_width, int x, int dx); - -void ScaleRowDown2_SSE2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown2Linear_SSE2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown2Box_SSE2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown2_Unaligned_SSE2(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown2Linear_Unaligned_SSE2(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown2Box_Unaligned_SSE2(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown4_SSE2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown4Box_SSE2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown34_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown34_1_Box_SSSE3(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown34_0_Box_SSSE3(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown38_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown38_3_Box_SSSE3(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown38_2_Box_SSSE3(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleAddRows_SSE2(const uint8* src_ptr, ptrdiff_t src_stride, - uint16* dst_ptr, int src_width, - int src_height); -void ScaleFilterCols_SSSE3(uint8* dst_ptr, const uint8* src_ptr, - int dst_width, int x, int dx); -void ScaleColsUp2_SSE2(uint8* dst_ptr, const uint8* src_ptr, - int dst_width, int x, int dx); -void ScaleARGBRowDown2_SSE2(const uint8* src_argb, - ptrdiff_t src_stride, - uint8* dst_argb, int dst_width); -void ScaleARGBRowDown2Linear_SSE2(const uint8* src_argb, - ptrdiff_t src_stride, - uint8* dst_argb, int dst_width); -void ScaleARGBRowDown2Box_SSE2(const uint8* src_argb, - ptrdiff_t src_stride, - uint8* dst_argb, int dst_width); -void ScaleARGBRowDownEven_SSE2(const uint8* src_argb, ptrdiff_t src_stride, - int src_stepx, - uint8* dst_argb, int dst_width); -void ScaleARGBRowDownEvenBox_SSE2(const uint8* src_argb, - ptrdiff_t src_stride, - int src_stepx, - uint8* dst_argb, int dst_width); -void ScaleARGBCols_SSE2(uint8* dst_argb, const uint8* src_argb, - int dst_width, int x, int dx); -void ScaleARGBFilterCols_SSSE3(uint8* dst_argb, const uint8* src_argb, - int dst_width, int x, int dx); -void ScaleARGBColsUp2_SSE2(uint8* dst_argb, const uint8* src_argb, - int dst_width, int x, int dx); -// Row functions. -void ScaleARGBRowDownEven_NEON(const uint8* src_argb, int src_stride, - int src_stepx, - uint8* dst_argb, int dst_width); -void ScaleARGBRowDownEvenBox_NEON(const uint8* src_argb, int src_stride, - int src_stepx, - uint8* dst_argb, int dst_width); -void ScaleARGBRowDown2_NEON(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleARGBRowDown2Box_NEON(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); - -// ScaleRowDown2Box also used by planar functions -// NEON downscalers with interpolation. - -// Note - not static due to reuse in convert for 444 to 420. -void ScaleRowDown2_NEON(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); - -void ScaleRowDown2Box_NEON(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); - -void ScaleRowDown4_NEON(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown4Box_NEON(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); - -// Down scale from 4 to 3 pixels. Use the neon multilane read/write -// to load up the every 4th pixel into a 4 different registers. -// Point samples 32 pixels to 24 pixels. -void ScaleRowDown34_NEON(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown34_0_Box_NEON(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown34_1_Box_NEON(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); - -// 32 -> 12 -void ScaleRowDown38_NEON(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -// 32x3 -> 12x1 -void ScaleRowDown38_3_Box_NEON(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -// 32x2 -> 12x1 -void ScaleRowDown38_2_Box_NEON(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); - -void ScaleRowDown2_MIPS_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown2Box_MIPS_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown4_MIPS_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown4Box_MIPS_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown34_MIPS_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown34_0_Box_MIPS_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* d, int dst_width); -void ScaleRowDown34_1_Box_MIPS_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* d, int dst_width); -void ScaleRowDown38_MIPS_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst, int dst_width); -void ScaleRowDown38_2_Box_MIPS_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); -void ScaleRowDown38_3_Box_MIPS_DSPR2(const uint8* src_ptr, - ptrdiff_t src_stride, - uint8* dst_ptr, int dst_width); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_SCALE_ROW_H_ NOLINT diff --git a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/version.h b/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/version.h deleted file mode 100755 index a61c45f..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/version.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright 2012 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT -#define INCLUDE_LIBYUV_VERSION_H_ - -#define LIBYUV_VERSION 1000 - -#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/video_common.h b/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/video_common.h deleted file mode 100755 index 039efb9..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/libyuv/include/libyuv/video_common.h +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright 2011 The LibYuv Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Common definitions for video, including fourcc and VideoFormat. - -#ifndef INCLUDE_LIBYUV_VIDEO_COMMON_H_ // NOLINT -#define INCLUDE_LIBYUV_VIDEO_COMMON_H_ - -#include "libyuv/basic_types.h" - -#ifdef __cplusplus -namespace libyuv { -extern "C" { -#endif - -////////////////////////////////////////////////////////////////////////////// -// Definition of FourCC codes -////////////////////////////////////////////////////////////////////////////// - -// Convert four characters to a FourCC code. -// Needs to be a macro otherwise the OS X compiler complains when the kFormat* -// constants are used in a switch. -#ifdef __cplusplus -#define FOURCC(a, b, c, d) ( \ - (static_cast(a)) | (static_cast(b) << 8) | \ - (static_cast(c) << 16) | (static_cast(d) << 24)) -#else -#define FOURCC(a, b, c, d) ( \ - ((uint32)(a)) | ((uint32)(b) << 8) | /* NOLINT */ \ - ((uint32)(c) << 16) | ((uint32)(d) << 24)) /* NOLINT */ -#endif - -// Some pages discussing FourCC codes: -// http://www.fourcc.org/yuv.php -// http://v4l2spec.bytesex.org/spec/book1.htm -// http://developer.apple.com/quicktime/icefloe/dispatch020.html -// http://msdn.microsoft.com/library/windows/desktop/dd206750.aspx#nv12 -// http://people.xiph.org/~xiphmont/containers/nut/nut4cc.txt - -// FourCC codes grouped according to implementation efficiency. -// Primary formats should convert in 1 efficient step. -// Secondary formats are converted in 2 steps. -// Auxilliary formats call primary converters. -enum FourCC { - // 9 Primary YUV formats: 5 planar, 2 biplanar, 2 packed. - FOURCC_I420 = FOURCC('I', '4', '2', '0'), - FOURCC_I422 = FOURCC('I', '4', '2', '2'), - FOURCC_I444 = FOURCC('I', '4', '4', '4'), - FOURCC_I411 = FOURCC('I', '4', '1', '1'), - FOURCC_I400 = FOURCC('I', '4', '0', '0'), - FOURCC_NV21 = FOURCC('N', 'V', '2', '1'), - FOURCC_NV12 = FOURCC('N', 'V', '1', '2'), - FOURCC_YUY2 = FOURCC('Y', 'U', 'Y', '2'), - FOURCC_UYVY = FOURCC('U', 'Y', 'V', 'Y'), - - // 2 Secondary YUV formats: row biplanar. - FOURCC_M420 = FOURCC('M', '4', '2', '0'), - FOURCC_Q420 = FOURCC('Q', '4', '2', '0'), - - // 9 Primary RGB formats: 4 32 bpp, 2 24 bpp, 3 16 bpp. - FOURCC_ARGB = FOURCC('A', 'R', 'G', 'B'), - FOURCC_BGRA = FOURCC('B', 'G', 'R', 'A'), - FOURCC_ABGR = FOURCC('A', 'B', 'G', 'R'), - FOURCC_24BG = FOURCC('2', '4', 'B', 'G'), - FOURCC_RAW = FOURCC('r', 'a', 'w', ' '), - FOURCC_RGBA = FOURCC('R', 'G', 'B', 'A'), - FOURCC_RGBP = FOURCC('R', 'G', 'B', 'P'), // rgb565 LE. - FOURCC_RGBO = FOURCC('R', 'G', 'B', 'O'), // argb1555 LE. - FOURCC_R444 = FOURCC('R', '4', '4', '4'), // argb4444 LE. - - // 4 Secondary RGB formats: 4 Bayer Patterns. - FOURCC_RGGB = FOURCC('R', 'G', 'G', 'B'), - FOURCC_BGGR = FOURCC('B', 'G', 'G', 'R'), - FOURCC_GRBG = FOURCC('G', 'R', 'B', 'G'), - FOURCC_GBRG = FOURCC('G', 'B', 'R', 'G'), - - // 1 Primary Compressed YUV format. - FOURCC_MJPG = FOURCC('M', 'J', 'P', 'G'), - - // 5 Auxiliary YUV variations: 3 with U and V planes are swapped, 1 Alias. - FOURCC_YV12 = FOURCC('Y', 'V', '1', '2'), - FOURCC_YV16 = FOURCC('Y', 'V', '1', '6'), - FOURCC_YV24 = FOURCC('Y', 'V', '2', '4'), - FOURCC_YU12 = FOURCC('Y', 'U', '1', '2'), // Linux version of I420. - FOURCC_J420 = FOURCC('J', '4', '2', '0'), - FOURCC_J400 = FOURCC('J', '4', '0', '0'), - - // 14 Auxiliary aliases. CanonicalFourCC() maps these to canonical fourcc. - FOURCC_IYUV = FOURCC('I', 'Y', 'U', 'V'), // Alias for I420. - FOURCC_YU16 = FOURCC('Y', 'U', '1', '6'), // Alias for I422. - FOURCC_YU24 = FOURCC('Y', 'U', '2', '4'), // Alias for I444. - FOURCC_YUYV = FOURCC('Y', 'U', 'Y', 'V'), // Alias for YUY2. - FOURCC_YUVS = FOURCC('y', 'u', 'v', 's'), // Alias for YUY2 on Mac. - FOURCC_HDYC = FOURCC('H', 'D', 'Y', 'C'), // Alias for UYVY. - FOURCC_2VUY = FOURCC('2', 'v', 'u', 'y'), // Alias for UYVY on Mac. - FOURCC_JPEG = FOURCC('J', 'P', 'E', 'G'), // Alias for MJPG. - FOURCC_DMB1 = FOURCC('d', 'm', 'b', '1'), // Alias for MJPG on Mac. - FOURCC_BA81 = FOURCC('B', 'A', '8', '1'), // Alias for BGGR. - FOURCC_RGB3 = FOURCC('R', 'G', 'B', '3'), // Alias for RAW. - FOURCC_BGR3 = FOURCC('B', 'G', 'R', '3'), // Alias for 24BG. - FOURCC_CM32 = FOURCC(0, 0, 0, 32), // Alias for BGRA kCMPixelFormat_32ARGB - FOURCC_CM24 = FOURCC(0, 0, 0, 24), // Alias for RAW kCMPixelFormat_24RGB - FOURCC_L555 = FOURCC('L', '5', '5', '5'), // Alias for RGBO. - FOURCC_L565 = FOURCC('L', '5', '6', '5'), // Alias for RGBP. - FOURCC_5551 = FOURCC('5', '5', '5', '1'), // Alias for RGBO. - - // 1 Auxiliary compressed YUV format set aside for capturer. - FOURCC_H264 = FOURCC('H', '2', '6', '4'), - - // Match any fourcc. - FOURCC_ANY = 0xFFFFFFFF, -}; - -enum FourCCBpp { - // Canonical fourcc codes used in our code. - FOURCC_BPP_I420 = 12, - FOURCC_BPP_I422 = 16, - FOURCC_BPP_I444 = 24, - FOURCC_BPP_I411 = 12, - FOURCC_BPP_I400 = 8, - FOURCC_BPP_NV21 = 12, - FOURCC_BPP_NV12 = 12, - FOURCC_BPP_YUY2 = 16, - FOURCC_BPP_UYVY = 16, - FOURCC_BPP_M420 = 12, - FOURCC_BPP_Q420 = 12, - FOURCC_BPP_ARGB = 32, - FOURCC_BPP_BGRA = 32, - FOURCC_BPP_ABGR = 32, - FOURCC_BPP_RGBA = 32, - FOURCC_BPP_24BG = 24, - FOURCC_BPP_RAW = 24, - FOURCC_BPP_RGBP = 16, - FOURCC_BPP_RGBO = 16, - FOURCC_BPP_R444 = 16, - FOURCC_BPP_RGGB = 8, - FOURCC_BPP_BGGR = 8, - FOURCC_BPP_GRBG = 8, - FOURCC_BPP_GBRG = 8, - FOURCC_BPP_YV12 = 12, - FOURCC_BPP_YV16 = 16, - FOURCC_BPP_YV24 = 24, - FOURCC_BPP_YU12 = 12, - FOURCC_BPP_J420 = 12, - FOURCC_BPP_J400 = 8, - FOURCC_BPP_MJPG = 0, // 0 means unknown. - FOURCC_BPP_H264 = 0, - FOURCC_BPP_IYUV = 12, - FOURCC_BPP_YU16 = 16, - FOURCC_BPP_YU24 = 24, - FOURCC_BPP_YUYV = 16, - FOURCC_BPP_YUVS = 16, - FOURCC_BPP_HDYC = 16, - FOURCC_BPP_2VUY = 16, - FOURCC_BPP_JPEG = 1, - FOURCC_BPP_DMB1 = 1, - FOURCC_BPP_BA81 = 8, - FOURCC_BPP_RGB3 = 24, - FOURCC_BPP_BGR3 = 24, - FOURCC_BPP_CM32 = 32, - FOURCC_BPP_CM24 = 24, - - // Match any fourcc. - FOURCC_BPP_ANY = 0, // 0 means unknown. -}; - -// Converts fourcc aliases into canonical ones. -LIBYUV_API uint32 CanonicalFourCC(uint32 fourcc); - -#ifdef __cplusplus -} // extern "C" -} // namespace libyuv -#endif - -#endif // INCLUDE_LIBYUV_VIDEO_COMMON_H_ NOLINT diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/lib/ds/plarena.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/lib/ds/plarena.h deleted file mode 100755 index 8dcfb3e..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/lib/ds/plarena.h +++ /dev/null @@ -1,253 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef plarena_h___ -#define plarena_h___ -/* - * Lifetime-based fast allocation, inspired by much prior art, including - * "Fast Allocation and Deallocation of Memory Based on Object Lifetimes" - * David R. Hanson, Software -- Practice and Experience, Vol. 20(1). - * - * Also supports LIFO allocation (PL_ARENA_MARK/PL_ARENA_RELEASE). - */ -#include "prtypes.h" -#include "plarenas.h" - -PR_BEGIN_EXTERN_C - -typedef struct PLArena PLArena; - -struct PLArena { - PLArena *next; /* next arena for this lifetime */ - PRUword base; /* aligned base address, follows this header */ - PRUword limit; /* one beyond last byte in arena */ - PRUword avail; /* points to next available byte */ -}; - -#ifdef PL_ARENAMETER -typedef struct PLArenaStats PLArenaStats; - -struct PLArenaStats { - PLArenaStats *next; /* next in arenaStats list */ - char *name; /* name for debugging */ - PRUint32 narenas; /* number of arenas in pool */ - PRUint32 nallocs; /* number of PL_ARENA_ALLOCATE() calls */ - PRUint32 nreclaims; /* number of reclaims from freeArenas */ - PRUint32 nmallocs; /* number of malloc() calls */ - PRUint32 ndeallocs; /* number of lifetime deallocations */ - PRUint32 ngrows; /* number of PL_ARENA_GROW() calls */ - PRUint32 ninplace; /* number of in-place growths */ - PRUint32 nreleases; /* number of PL_ARENA_RELEASE() calls */ - PRUint32 nfastrels; /* number of "fast path" releases */ - PRUint32 nbytes; /* total bytes allocated */ - PRUint32 maxalloc; /* maximum allocation size in bytes */ - PRFloat64 variance; /* size variance accumulator */ -}; -#endif - -struct PLArenaPool { - PLArena first; /* first arena in pool list */ - PLArena *current; /* arena from which to allocate space */ - PRUint32 arenasize; /* net exact size of a new arena */ - PRUword mask; /* alignment mask (power-of-2 - 1) */ -#ifdef PL_ARENAMETER - PLArenaStats stats; -#endif -}; - -/* - * WARNING: The PL_MAKE_MEM_ macros are for internal use by NSPR. Do NOT use - * them in your code. - * - * NOTE: Valgrind support to be added. - * - * The PL_MAKE_MEM_ macros are modeled after the MOZ_MAKE_MEM_ macros in - * Mozilla's mfbt/MemoryChecking.h. Only AddressSanitizer is supported now. - * - * Provides a common interface to the ASan (AddressSanitizer) and Valgrind - * functions used to mark memory in certain ways. In detail, the following - * three macros are provided: - * - * PL_MAKE_MEM_NOACCESS - Mark memory as unsafe to access (e.g. freed) - * PL_MAKE_MEM_UNDEFINED - Mark memory as accessible, with content undefined - * PL_MAKE_MEM_DEFINED - Mark memory as accessible, with content defined - * - * With Valgrind in use, these directly map to the three respective Valgrind - * macros. With ASan in use, the NOACCESS macro maps to poisoning the memory, - * while the UNDEFINED/DEFINED macros unpoison memory. - * - * With no memory checker available, all macros expand to the empty statement. - */ - -/* WARNING: PL_SANITIZE_ADDRESS is for internal use by this header. Do NOT - * define or test this macro in your code. - */ -#if defined(__has_feature) -#if __has_feature(address_sanitizer) -#define PL_SANITIZE_ADDRESS 1 -#endif -#elif defined(__SANITIZE_ADDRESS__) -#define PL_SANITIZE_ADDRESS 1 -#endif - -#if defined(PL_SANITIZE_ADDRESS) - -/* These definitions are usually provided through the - * sanitizer/asan_interface.h header installed by ASan. - * See https://code.google.com/p/address-sanitizer/wiki/ManualPoisoning - */ - -void __asan_poison_memory_region(void const volatile *addr, size_t size); -void __asan_unpoison_memory_region(void const volatile *addr, size_t size); - -#define PL_MAKE_MEM_NOACCESS(addr, size) \ - __asan_poison_memory_region((addr), (size)) - -#define PL_MAKE_MEM_UNDEFINED(addr, size) \ - __asan_unpoison_memory_region((addr), (size)) - -#define PL_MAKE_MEM_DEFINED(addr, size) \ - __asan_unpoison_memory_region((addr), (size)) - -#else - -#define PL_MAKE_MEM_NOACCESS(addr, size) -#define PL_MAKE_MEM_UNDEFINED(addr, size) -#define PL_MAKE_MEM_DEFINED(addr, size) - -#endif - -/* - * If the including .c file uses only one power-of-2 alignment, it may define - * PL_ARENA_CONST_ALIGN_MASK to the alignment mask and save a few instructions - * per ALLOCATE and GROW. - */ -#ifdef PL_ARENA_CONST_ALIGN_MASK -#define PL_ARENA_ALIGN(pool, n) (((PRUword)(n) + PL_ARENA_CONST_ALIGN_MASK) \ - & ~PL_ARENA_CONST_ALIGN_MASK) - -#define PL_INIT_ARENA_POOL(pool, name, size) \ - PL_InitArenaPool(pool, name, size, PL_ARENA_CONST_ALIGN_MASK + 1) -#else -#define PL_ARENA_ALIGN(pool, n) (((PRUword)(n) + (pool)->mask) & ~(pool)->mask) -#endif - -#define PL_ARENA_ALLOCATE(p, pool, nb) \ - PR_BEGIN_MACRO \ - PLArena *_a = (pool)->current; \ - PRUint32 _nb = PL_ARENA_ALIGN(pool, nb); \ - PRUword _p = _a->avail; \ - PRUword _q = _p + _nb; \ - if (_q > _a->limit) { \ - _p = (PRUword)PL_ArenaAllocate(pool, _nb); \ - } else { \ - _a->avail = _q; \ - } \ - p = (void *)_p; \ - PL_MAKE_MEM_UNDEFINED(p, nb); \ - PL_ArenaCountAllocation(pool, nb); \ - PR_END_MACRO - -#define PL_ARENA_GROW(p, pool, size, incr) \ - PR_BEGIN_MACRO \ - PLArena *_a = (pool)->current; \ - PRUint32 _incr = PL_ARENA_ALIGN(pool, incr); \ - PRUword _p = _a->avail; \ - PRUword _q = _p + _incr; \ - if (_p == (PRUword)(p) + PL_ARENA_ALIGN(pool, size) && \ - _q <= _a->limit) { \ - PL_MAKE_MEM_UNDEFINED((unsigned char *)(p) + size, incr); \ - _a->avail = _q; \ - PL_ArenaCountInplaceGrowth(pool, size, incr); \ - } else { \ - p = PL_ArenaGrow(pool, p, size, incr); \ - } \ - PL_ArenaCountGrowth(pool, size, incr); \ - PR_END_MACRO - -#define PL_ARENA_MARK(pool) ((void *) (pool)->current->avail) -#define PR_UPTRDIFF(p,q) ((PRUword)(p) - (PRUword)(q)) - -#define PL_CLEAR_UNUSED_PATTERN(a, pattern) \ - PR_BEGIN_MACRO \ - PR_ASSERT((a)->avail <= (a)->limit); \ - PL_MAKE_MEM_UNDEFINED((void*)(a)->avail, (a)->limit - (a)->avail); \ - memset((void*)(a)->avail, (pattern), (a)->limit - (a)->avail); \ - PR_END_MACRO -#ifdef DEBUG -#define PL_FREE_PATTERN 0xDA -#define PL_CLEAR_UNUSED(a) PL_CLEAR_UNUSED_PATTERN((a), PL_FREE_PATTERN) -#define PL_CLEAR_ARENA(a) \ - PR_BEGIN_MACRO \ - PL_MAKE_MEM_UNDEFINED((void*)(a), (a)->limit - (PRUword)(a)); \ - memset((void*)(a), PL_FREE_PATTERN, (a)->limit - (PRUword)(a)); \ - PR_END_MACRO -#else -#define PL_CLEAR_UNUSED(a) -#define PL_CLEAR_ARENA(a) -#endif - -#define PL_ARENA_RELEASE(pool, mark) \ - PR_BEGIN_MACRO \ - char *_m = (char *)(mark); \ - PLArena *_a = (pool)->current; \ - if (PR_UPTRDIFF(_m, _a->base) <= PR_UPTRDIFF(_a->avail, _a->base)) { \ - _a->avail = (PRUword)PL_ARENA_ALIGN(pool, _m); \ - PL_CLEAR_UNUSED(_a); \ - PL_MAKE_MEM_NOACCESS((void*)_a->avail, _a->limit - _a->avail); \ - PL_ArenaCountRetract(pool, _m); \ - } else { \ - PL_ArenaRelease(pool, _m); \ - } \ - PL_ArenaCountRelease(pool, _m); \ - PR_END_MACRO - -#ifdef PL_ARENAMETER -#define PL_COUNT_ARENA(pool,op) ((pool)->stats.narenas op) -#else -#define PL_COUNT_ARENA(pool,op) -#endif - -#define PL_ARENA_DESTROY(pool, a, pnext) \ - PR_BEGIN_MACRO \ - PL_COUNT_ARENA(pool,--); \ - if ((pool)->current == (a)) (pool)->current = &(pool)->first; \ - *(pnext) = (a)->next; \ - PL_CLEAR_ARENA(a); \ - free(a); \ - (a) = 0; \ - PR_END_MACRO - -#ifdef PL_ARENAMETER - -#include - -PR_EXTERN(void) PL_ArenaCountAllocation(PLArenaPool *pool, PRUint32 nb); - -PR_EXTERN(void) PL_ArenaCountInplaceGrowth( - PLArenaPool *pool, PRUint32 size, PRUint32 incr); - -PR_EXTERN(void) PL_ArenaCountGrowth( - PLArenaPool *pool, PRUint32 size, PRUint32 incr); - -PR_EXTERN(void) PL_ArenaCountRelease(PLArenaPool *pool, char *mark); - -PR_EXTERN(void) PL_ArenaCountRetract(PLArenaPool *pool, char *mark); - -PR_EXTERN(void) PL_DumpArenaStats(FILE *fp); - -#else /* !PL_ARENAMETER */ - -#define PL_ArenaCountAllocation(ap, nb) /* nothing */ -#define PL_ArenaCountInplaceGrowth(ap, size, incr) /* nothing */ -#define PL_ArenaCountGrowth(ap, size, incr) /* nothing */ -#define PL_ArenaCountRelease(ap, mark) /* nothing */ -#define PL_ArenaCountRetract(ap, mark) /* nothing */ - -#endif /* !PL_ARENAMETER */ - -PR_END_EXTERN_C - -#endif /* plarena_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/lib/ds/plarenas.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/lib/ds/plarenas.h deleted file mode 100755 index 98bd7f8..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/lib/ds/plarenas.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef PLARENAS_H -#define PLARENAS_H - -PR_BEGIN_EXTERN_C - -typedef struct PLArenaPool PLArenaPool; - -/* -** Initialize an arena pool with the given name for debugging and metering, -** with a minimum gross size per arena of size bytes. The net size per arena -** is smaller than the gross size by a header of four pointers plus any -** necessary padding for alignment. -** -** Note: choose a gross size that's a power of two to avoid the heap allocator -** rounding the size up. -**/ -PR_EXTERN(void) PL_InitArenaPool( - PLArenaPool *pool, const char *name, PRUint32 size, PRUint32 align); - -/* -** Finish using arenas, freeing all memory associated with them. -**/ -PR_EXTERN(void) PL_ArenaFinish(void); - -/* -** Free the arenas in pool. The user may continue to allocate from pool -** after calling this function. There is no need to call PL_InitArenaPool() -** again unless PL_FinishArenaPool(pool) has been called. -**/ -PR_EXTERN(void) PL_FreeArenaPool(PLArenaPool *pool); - -/* -** Free the arenas in pool and finish using it altogether. -**/ -PR_EXTERN(void) PL_FinishArenaPool(PLArenaPool *pool); - -/* -** Compact all of the arenas in a pool so that no space is wasted. -** NOT IMPLEMENTED. Do not use. -**/ -PR_EXTERN(void) PL_CompactArenaPool(PLArenaPool *pool); - -/* -** Friend functions used by the PL_ARENA_*() macros. -** -** WARNING: do not call these functions directly. Always use the -** PL_ARENA_*() macros. -**/ -PR_EXTERN(void *) PL_ArenaAllocate(PLArenaPool *pool, PRUint32 nb); - -PR_EXTERN(void *) PL_ArenaGrow( - PLArenaPool *pool, void *p, PRUint32 size, PRUint32 incr); - -PR_EXTERN(void) PL_ArenaRelease(PLArenaPool *pool, char *mark); - -/* -** memset contents of all arenas in pool to pattern -*/ -PR_EXTERN(void) PL_ClearArenaPool(PLArenaPool *pool, PRInt32 pattern); - -/* -** A function like malloc_size() or malloc_usable_size() that measures the -** size of a heap block. -*/ -typedef size_t (*PLMallocSizeFn)(const void *ptr); - -/* -** Measure all memory used by a PLArenaPool, excluding the PLArenaPool -** structure. -*/ -PR_EXTERN(size_t) PL_SizeOfArenaPoolExcludingPool( - const PLArenaPool *pool, PLMallocSizeFn mallocSizeOf); - -PR_END_EXTERN_C - -#endif /* PLARENAS_H */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/lib/ds/plhash.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/lib/ds/plhash.h deleted file mode 100755 index 2c221ae..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/lib/ds/plhash.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef plhash_h___ -#define plhash_h___ -/* - * API to portable hash table code. - */ -#include -#include "prtypes.h" - -PR_BEGIN_EXTERN_C - -typedef struct PLHashEntry PLHashEntry; -typedef struct PLHashTable PLHashTable; -typedef PRUint32 PLHashNumber; -#define PL_HASH_BITS 32 /* Number of bits in PLHashNumber */ -typedef PLHashNumber (PR_CALLBACK *PLHashFunction)(const void *key); -typedef PRIntn (PR_CALLBACK *PLHashComparator)(const void *v1, const void *v2); - -typedef PRIntn (PR_CALLBACK *PLHashEnumerator)(PLHashEntry *he, PRIntn i, void *arg); - -/* Flag bits in PLHashEnumerator's return value */ -#define HT_ENUMERATE_NEXT 0 /* continue enumerating entries */ -#define HT_ENUMERATE_STOP 1 /* stop enumerating entries */ -#define HT_ENUMERATE_REMOVE 2 /* remove and free the current entry */ -#define HT_ENUMERATE_UNHASH 4 /* just unhash the current entry */ - -typedef struct PLHashAllocOps { - void * (PR_CALLBACK *allocTable)(void *pool, PRSize size); - void (PR_CALLBACK *freeTable)(void *pool, void *item); - PLHashEntry * (PR_CALLBACK *allocEntry)(void *pool, const void *key); - void (PR_CALLBACK *freeEntry)(void *pool, PLHashEntry *he, PRUintn flag); -} PLHashAllocOps; - -#define HT_FREE_VALUE 0 /* just free the entry's value */ -#define HT_FREE_ENTRY 1 /* free value and entire entry */ - -struct PLHashEntry { - PLHashEntry *next; /* hash chain linkage */ - PLHashNumber keyHash; /* key hash function result */ - const void *key; /* ptr to opaque key */ - void *value; /* ptr to opaque value */ -}; - -struct PLHashTable { - PLHashEntry **buckets; /* vector of hash buckets */ - PRUint32 nentries; /* number of entries in table */ - PRUint32 shift; /* multiplicative hash shift */ - PLHashFunction keyHash; /* key hash function */ - PLHashComparator keyCompare; /* key comparison function */ - PLHashComparator valueCompare; /* value comparison function */ - const PLHashAllocOps *allocOps; /* allocation operations */ - void *allocPriv; /* allocation private data */ -#ifdef HASHMETER - PRUint32 nlookups; /* total number of lookups */ - PRUint32 nsteps; /* number of hash chains traversed */ - PRUint32 ngrows; /* number of table expansions */ - PRUint32 nshrinks; /* number of table contractions */ -#endif -}; - -/* - * Create a new hash table. - * If allocOps is null, use default allocator ops built on top of malloc(). - */ -PR_EXTERN(PLHashTable *) -PL_NewHashTable(PRUint32 numBuckets, PLHashFunction keyHash, - PLHashComparator keyCompare, PLHashComparator valueCompare, - const PLHashAllocOps *allocOps, void *allocPriv); - -PR_EXTERN(void) -PL_HashTableDestroy(PLHashTable *ht); - -/* Higher level access methods */ -PR_EXTERN(PLHashEntry *) -PL_HashTableAdd(PLHashTable *ht, const void *key, void *value); - -PR_EXTERN(PRBool) -PL_HashTableRemove(PLHashTable *ht, const void *key); - -PR_EXTERN(void *) -PL_HashTableLookup(PLHashTable *ht, const void *key); - -PR_EXTERN(void *) -PL_HashTableLookupConst(PLHashTable *ht, const void *key); - -PR_EXTERN(PRIntn) -PL_HashTableEnumerateEntries(PLHashTable *ht, PLHashEnumerator f, void *arg); - -/* General-purpose C string hash function. */ -PR_EXTERN(PLHashNumber) -PL_HashString(const void *key); - -/* Compare strings using strcmp(), return true if equal. */ -PR_EXTERN(PRIntn) -PL_CompareStrings(const void *v1, const void *v2); - -/* Stub function just returns v1 == v2 */ -PR_EXTERN(PRIntn) -PL_CompareValues(const void *v1, const void *v2); - -/* Low level access methods */ -PR_EXTERN(PLHashEntry **) -PL_HashTableRawLookup(PLHashTable *ht, PLHashNumber keyHash, const void *key); - -PR_EXTERN(PLHashEntry **) -PL_HashTableRawLookupConst(PLHashTable *ht, PLHashNumber keyHash, - const void *key); - -PR_EXTERN(PLHashEntry *) -PL_HashTableRawAdd(PLHashTable *ht, PLHashEntry **hep, PLHashNumber keyHash, - const void *key, void *value); - -PR_EXTERN(void) -PL_HashTableRawRemove(PLHashTable *ht, PLHashEntry **hep, PLHashEntry *he); - -/* This can be trivially implemented using PL_HashTableEnumerateEntries. */ -PR_EXTERN(PRIntn) -PL_HashTableDump(PLHashTable *ht, PLHashEnumerator dump, FILE *fp); - -PR_END_EXTERN_C - -#endif /* plhash_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/lib/libc/include/plbase64.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/lib/libc/include/plbase64.h deleted file mode 100755 index 7d17ea7..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/lib/libc/include/plbase64.h +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef _plbase64_h -#define _plbase64_h - -#include "prtypes.h" - -PR_BEGIN_EXTERN_C - -/* - * PL_Base64Encode - * - * This routine encodes the data pointed to by the "src" parameter using the - * base64 algorithm, and returns a pointer to the result. If the "srclen" - * parameter is not zero, it specifies the length of the source data. If it - * is zero, the source data is assumed to be null-terminated, and PL_strlen - * is used to determine the source length. If the "dest" parameter is not - * null, it is assumed to point to a buffer of sufficient size (which may be - * calculated: ((srclen + 2)/3)*4) into which the encoded data is placed - * (without any termination). If the "dest" parameter is null, a buffer is - * allocated from the heap to hold the encoded data, and the result *will* - * be terminated with an extra null character. It is the caller's - * responsibility to free the result when it is allocated. A null is returned - * if the allocation fails. - * - * NOTE: when calculating ((srclen + 2)/3)*4), first ensure that - * srclen <= (PR_UINT32_MAX/4) * 3 - * to avoid PRUint32 overflow. - */ - -PR_EXTERN(char *) -PL_Base64Encode -( - const char *src, - PRUint32 srclen, - char *dest -); - -/* - * PL_Base64Decode - * - * This routine decodes the data pointed to by the "src" parameter using - * the base64 algorithm, and returns a pointer to the result. The source - * may either include or exclude any trailing '=' characters. If the - * "srclen" parameter is not zero, it specifies the length of the source - * data. If it is zero, PL_strlen will be used to determine the source - * length. If the "dest" parameter is not null, it is assumed to point to - * a buffer of sufficient size (which may be calculated: (srclen * 3)/4 - * when srclen includes the '=' characters) into which the decoded data - * is placed (without any termination). If the "dest" parameter is null, - * a buffer is allocated from the heap to hold the decoded data, and the - * result *will* be terminated with an extra null character. It is the - * caller's responsibility to free the result when it is allocated. A null - * is retuned if the allocation fails, or if the source is not well-coded. - * - * NOTE: when calculating (srclen * 3)/4, first ensure that - * srclen <= PR_UINT32_MAX/3 - * to avoid PRUint32 overflow. Alternatively, calculate - * (srclen/4) * 3 + ((srclen%4) * 3)/4 - * which is equivalent but doesn't overflow for any value of srclen. - */ - -PR_EXTERN(char *) -PL_Base64Decode -( - const char *src, - PRUint32 srclen, - char *dest -); - -PR_END_EXTERN_C - -#endif /* _plbase64_h */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/lib/libc/include/plerror.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/lib/libc/include/plerror.h deleted file mode 100755 index cd85dd3..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/lib/libc/include/plerror.h +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* -** File: plerror.h -** Description: Simple routine to print translate the calling thread's -** error numbers and print them. -*/ - -#if defined(PLERROR_H) -#else -#define PLERROR_H - -#include "prio.h" -#include "prtypes.h" - -PR_BEGIN_EXTERN_C -/* -** Print the messages to "syserr" prepending 'msg' if not NULL. -*/ -PR_EXTERN(void) PL_PrintError(const char *msg); - -/* -** Print the messages to specified output file prepending 'msg' if not NULL. -*/ -PR_EXTERN(void) PL_FPrintError(PRFileDesc *output, const char *msg); - -PR_END_EXTERN_C - -#endif /* defined(PLERROR_H) */ - -/* plerror.h */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/lib/libc/include/plgetopt.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/lib/libc/include/plgetopt.h deleted file mode 100755 index 19cafa6..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/lib/libc/include/plgetopt.h +++ /dev/null @@ -1,125 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* -** File: plgetopt.h -** Description: utilities to parse argc/argv -*/ - -#if defined(PLGETOPT_H_) -#else -#define PLGETOPT_H_ - -#include "prtypes.h" - -PR_BEGIN_EXTERN_C - -typedef struct PLOptionInternal PLOptionInternal; - -typedef enum -{ - PL_OPT_OK, /* all's well with the option */ - PL_OPT_EOL, /* end of options list */ - PL_OPT_BAD /* invalid option (and value) */ -} PLOptStatus; - -typedef struct PLLongOpt -{ - const char * longOptName; /* long option name string */ - PRIntn longOption; /* value put in PLOptState for this option. */ - PRBool valueRequired; /* If option name not followed by '=', */ - /* value is the next argument from argv. */ -} PLLongOpt; - -typedef struct PLOptState -{ - char option; /* the name of the option */ - const char *value; /* the value of that option | NULL */ - - PLOptionInternal *internal; /* private processing state */ - - PRIntn longOption; /* value from PLLongOpt put here */ - PRIntn longOptIndex; /* index into caller's array of PLLongOpts */ -} PLOptState; - -/* - * PL_CreateOptState - * - * The argument "options" points to a string of single-character option - * names. Option names that may have an option argument value must be - * followed immediately by a ':' character. - */ -PR_EXTERN(PLOptState*) PL_CreateOptState( - PRIntn argc, char **argv, const char *options); - -/* - * PL_CreateLongOptState - * - * Alternative to PL_CreateOptState. - * Allows caller to specify BOTH a string of single-character option names, - * AND an array of structures describing "long" (keyword) option names. - * The array is terminated by a structure in which longOptName is NULL. - * Long option values (arguments) may always be given as "--name=value". - * If PLLongOpt.valueRequired is not PR_FALSE, and the option name was not - * followed by '=' then the next argument from argv is taken as the value. - */ -PR_EXTERN(PLOptState*) PL_CreateLongOptState( - PRIntn argc, char **argv, const char *options, - const PLLongOpt *longOpts); -/* - * PL_DestroyOptState - * - * Call this to destroy the PLOptState returned from PL_CreateOptState or - * PL_CreateLongOptState. - */ -PR_EXTERN(void) PL_DestroyOptState(PLOptState *opt); - -/* - * PL_GetNextOpt - * - * When this function returns PL_OPT_OK, - * - opt->option will hold the single-character option name that was parsed, - * or zero. - * When opt->option is zero, the token parsed was either a "long" (keyword) - * option or a positional parameter. - * For a positional parameter, - * - opt->longOptIndex will contain -1, and - * - opt->value will point to the positional parameter string. - * For a long option name, - * - opt->longOptIndex will contain the non-negative index of the - * PLLongOpt structure in the caller's array of PLLongOpt structures - * corresponding to the long option name, and - * For a single-character or long option, - * - opt->longOption will contain the value of the single-character option - * name, or the value of the longOption from the PLLongOpt structure - * for that long option. See notes below. - * - opt->value will point to the argument option string, or will - * be NULL if option does not require argument. If option requires - * argument but it is not provided, PL_OPT_BAD is returned. - * When opt->option is non-zero, - * - opt->longOptIndex will be -1 - * When this function returns PL_OPT_EOL, or PL_OPT_BAD, the contents of - * opt are undefined. - * - * Notes: It is possible to ignore opt->option, and always look at - * opt->longOption instead. opt->longOption will contain the same value - * as opt->option for single-character option names, and will contain the - * value of longOption from the PLLongOpt structure for long option names. - * This means that it is possible to equivalence long option names to - * single character names by giving the longOption in the PLLongOpt struct - * the same value as the single-character option name. - * For long options that are NOT intended to be equivalent to any single- - * character option, the longOption value should be chosen to not match - * any possible single character name. It might be advisable to choose - * longOption values greater than 0xff for such long options. - */ -PR_EXTERN(PLOptStatus) PL_GetNextOpt(PLOptState *opt); - -PR_END_EXTERN_C - -#endif /* defined(PLGETOPT_H_) */ - -/* plgetopt.h */ - diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/lib/libc/include/plstr.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/lib/libc/include/plstr.h deleted file mode 100755 index 57814c7..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/lib/libc/include/plstr.h +++ /dev/null @@ -1,437 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef _plstr_h -#define _plstr_h - -/* - * plstr.h - * - * This header file exports the API to the NSPR portable library or string- - * handling functions. - * - * This API was not designed as an "optimal" or "ideal" string library; it - * was based on the good ol' unix string.3 functions, and was written to - * - * 1) replace the libc functions, for cross-platform consistency, - * 2) complete the API on platforms lacking common functions (e.g., - * strcase*), and - * 3) to implement some obvious "closure" functions that I've seen - * people hacking around in our code. - * - * Point number three largely means that most functions have an "strn" - * limited-length version, and all comparison routines have a non-case- - * sensitive version available. - */ - -#include "prtypes.h" - -PR_BEGIN_EXTERN_C -/* - * PL_strlen - * - * Returns the length of the provided string, not including the trailing '\0'. - */ - -PR_EXTERN(PRUint32) -PL_strlen(const char *str); - -/* - * PL_strnlen - * - * Returns the length of the provided string, not including the trailing '\0', - * up to the indicated maximum. The string will not be examined beyond the - * maximum; if no terminating '\0' is found, the maximum will be returned. - */ - -PR_EXTERN(PRUint32) -PL_strnlen(const char *str, PRUint32 max); - -/* - * PL_strcpy - * - * Copies the source string, up to and including the trailing '\0', into the - * destination buffer. It does not (can not) verify that the destination - * buffer is large enough. It returns the "dest" argument. - */ - -PR_EXTERN(char *) -PL_strcpy(char *dest, const char *src); - -/* - * PL_strncpy - * - * Copies the source string into the destination buffer, up to and including - * the trailing '\0' or up to and including the max'th character, whichever - * comes first. It does not (can not) verify that the destination buffer is - * large enough. If the source string is longer than the maximum length, - * the result will *not* be null-terminated (JLRU). - */ - -PR_EXTERN(char *) -PL_strncpy(char *dest, const char *src, PRUint32 max); - -/* - * PL_strncpyz - * - * Copies the source string into the destination buffer, up to and including - * the trailing '\0' or up but not including the max'th character, whichever - * comes first. It does not (can not) verify that the destination buffer is - * large enough. The destination string is always terminated with a '\0', - * unlike the traditional libc implementation. It returns the "dest" argument. - * - * NOTE: If you call this with a source "abcdefg" and a max of 5, the - * destination will end up with "abcd\0" (i.e., its strlen length will be 4)! - * - * This means you can do this: - * - * char buffer[ SOME_SIZE ]; - * PL_strncpyz(buffer, src, sizeof(buffer)); - * - * and the result will be properly terminated. - */ - -PR_EXTERN(char *) -PL_strncpyz(char *dest, const char *src, PRUint32 max); - -/* - * PL_strdup - * - * Returns a pointer to a malloc'd extent of memory containing a duplicate - * of the argument string. The size of the allocated extent is one greater - * than the length of the argument string, because of the terminator. A - * null argument, like a zero-length argument, will result in a pointer to - * a one-byte extent containing the null value. This routine returns null - * upon malloc failure. - */ - -PR_EXTERN(char *) -PL_strdup(const char *s); - -/* - * PL_strfree - * - * Free memory allocated by PL_strdup - */ - -PR_EXTERN(void) -PL_strfree(char *s); - -/* - * PL_strndup - * - * Returns a pointer to a malloc'd extent of memory containing a duplicate - * of the argument string, up to the maximum specified. If the argument - * string has a length greater than the value of the specified maximum, the - * return value will be a pointer to an extent of memory of length one - * greater than the maximum specified. A null string, a zero-length string, - * or a zero maximum will all result in a pointer to a one-byte extent - * containing the null value. This routine returns null upon malloc failure. - */ - -PR_EXTERN(char *) -PL_strndup(const char *s, PRUint32 max); - -/* - * PL_strcat - * - * Appends a copy of the string pointed to by the second argument to the - * end of the string pointed to by the first. The destination buffer is - * not (can not be) checked for sufficient size. A null destination - * argument returns null; otherwise, the first argument is returned. - */ - -PR_EXTERN(char *) -PL_strcat(char *dst, const char *src); - -/* - * PL_strncat - * - * Appends a copy of the string pointed to by the second argument, up to - * the maximum size specified, to the end of the string pointed to by the - * first. The destination buffer is not (can not be) checked for sufficient - * size. A null destination argument returns null; otherwise, the first - * argument is returned. If the maximum size limits the copy, then the - * result will *not* be null-terminated (JLRU). A null destination - * returns null; otherwise, the destination argument is returned. - */ - -PR_EXTERN(char *) -PL_strncat(char *dst, const char *src, PRUint32 max); - -/* - * PL_strcatn - * - * Appends a copy of the string pointed to by the third argument, to the - * end of the string pointed to by the first. The second argument specifies - * the maximum size of the destination buffer, including the null termination. - * If the existing string in dst is longer than the max, no action is taken. - * The resulting string will be null-terminated. A null destination returns - * null; otherwise, the destination argument is returned. - */ - -PR_EXTERN(char *) -PL_strcatn(char *dst, PRUint32 max, const char *src); - -/* - * PL_strcmp - * - * Returns an integer, the sign of which -- positive, zero, or negative -- - * reflects the lexical sorting order of the two strings indicated. The - * result is positive if the first string comes after the second. The - * NSPR implementation is not i18n. - */ - -PR_EXTERN(PRIntn) -PL_strcmp(const char *a, const char *b); - -/* - * PL_strncmp - * - * Returns an integer, the sign of which -- positive, zero, or negative -- - * reflects the lexical sorting order of the two strings indicated, up to - * the maximum specified. The result is positive if the first string comes - * after the second. The NSPR implementation is not i18n. If the maximum - * is zero, only the existance or non-existance (pointer is null) of the - * strings is compared. - */ - -PR_EXTERN(PRIntn) -PL_strncmp(const char *a, const char *b, PRUint32 max); - -/* - * PL_strcasecmp - * - * Returns an integer, the sign of which -- positive, zero or negative -- - * reflects the case-insensitive lexical sorting order of the two strings - * indicated. The result is positive if the first string comes after the - * second. The NSPR implementation is not i18n. - */ - -PR_EXTERN(PRIntn) -PL_strcasecmp(const char *a, const char *b); - -/* - * PL_strncasecmp - * - * Returns an integer, the sign of which -- positive, zero or negative -- - * reflects the case-insensitive lexical sorting order of the first n characters - * of the two strings indicated. The result is positive if the first string comes - * after the second. The NSPR implementation is not i18n. - */ - -PR_EXTERN(PRIntn) -PL_strncasecmp(const char *a, const char *b, PRUint32 max); - -/* - * PL_strchr - * - * Returns a pointer to the first instance of the specified character in the - * provided string. It returns null if the character is not found, or if the - * provided string is null. The character may be the null character. - */ - -PR_EXTERN(char *) -PL_strchr(const char *s, char c); - -/* - * PL_strrchr - * - * Returns a pointer to the last instance of the specified character in the - * provided string. It returns null if the character is not found, or if the - * provided string is null. The character may be the null character. - */ - -PR_EXTERN(char *) -PL_strrchr(const char *s, char c); - -/* - * PL_strnchr - * - * Returns a pointer to the first instance of the specified character within the - * first n characters of the provided string. It returns null if the character - * is not found, or if the provided string is null. The character may be the - * null character. - */ - -PR_EXTERN(char *) -PL_strnchr(const char *s, char c, PRUint32 n); - -/* - * PL_strnrchr - * - * Returns a pointer to the last instance of the specified character within the - * first n characters of the provided string. It returns null if the character is - * not found, or if the provided string is null. The character may be the null - * character. - */ - -PR_EXTERN(char *) -PL_strnrchr(const char *s, char c, PRUint32 n); - -/* - * NOTE: Looking for strcasechr, strcaserchr, strncasechr, or strncaserchr? - * Use strpbrk, strprbrk, strnpbrk or strnprbrk. - */ - -/* - * PL_strpbrk - * - * Returns a pointer to the first instance in the first string of any character - * (not including the terminating null character) of the second string. It returns - * null if either string is null. - */ - -PR_EXTERN(char *) -PL_strpbrk(const char *s, const char *list); - -/* - * PL_strprbrk - * - * Returns a pointer to the last instance in the first string of any character - * (not including the terminating null character) of the second string. It returns - * null if either string is null. - */ - -PR_EXTERN(char *) -PL_strprbrk(const char *s, const char *list); - -/* - * PL_strnpbrk - * - * Returns a pointer to the first instance (within the first n characters) of any - * character (not including the terminating null character) of the second string. - * It returns null if either string is null. - */ - -PR_EXTERN(char *) -PL_strnpbrk(const char *s, const char *list, PRUint32 n); - -/* - * PL_strnprbrk - * - * Returns a pointer to the last instance (within the first n characters) of any - * character (not including the terminating null character) of the second string. - * It returns null if either string is null. - */ - -PR_EXTERN(char *) -PL_strnprbrk(const char *s, const char *list, PRUint32 n); - -/* - * PL_strstr - * - * Returns a pointer to the first instance of the little string within the - * big one. It returns null if either string is null. - */ - -PR_EXTERN(char *) -PL_strstr(const char *big, const char *little); - -/* - * PL_strrstr - * - * Returns a pointer to the last instance of the little string within the big one. - * It returns null if either string is null. - */ - -PR_EXTERN(char *) -PL_strrstr(const char *big, const char *little); - -/* - * PL_strnstr - * - * Returns a pointer to the first instance of the little string within the first - * n characters of the big one. It returns null if either string is null. It - * returns null if the length of the little string is greater than n. - */ - -PR_EXTERN(char *) -PL_strnstr(const char *big, const char *little, PRUint32 n); - -/* - * PL_strnrstr - * - * Returns a pointer to the last instance of the little string within the first - * n characters of the big one. It returns null if either string is null. It - * returns null if the length of the little string is greater than n. - */ - -PR_EXTERN(char *) -PL_strnrstr(const char *big, const char *little, PRUint32 max); - -/* - * PL_strcasestr - * - * Returns a pointer to the first instance of the little string within the big one, - * ignoring case. It returns null if either string is null. - */ - -PR_EXTERN(char *) -PL_strcasestr(const char *big, const char *little); - -/* - * PL_strcaserstr - * - * Returns a pointer to the last instance of the little string within the big one, - * ignoring case. It returns null if either string is null. - */ - -PR_EXTERN(char *) -PL_strcaserstr(const char *big, const char *little); - -/* - * PL_strncasestr - * - * Returns a pointer to the first instance of the little string within the first - * n characters of the big one, ignoring case. It returns null if either string is - * null. It returns null if the length of the little string is greater than n. - */ - -PR_EXTERN(char *) -PL_strncasestr(const char *big, const char *little, PRUint32 max); - -/* - * PL_strncaserstr - * - * Returns a pointer to the last instance of the little string within the first - * n characters of the big one, ignoring case. It returns null if either string is - * null. It returns null if the length of the little string is greater than n. - */ - -PR_EXTERN(char *) -PL_strncaserstr(const char *big, const char *little, PRUint32 max); - -/* - * PL_strtok_r - * - * Splits the string s1 into tokens, separated by one or more characters - * from the separator string s2. The argument lasts points to a - * user-supplied char * pointer in which PL_strtok_r stores information - * for it to continue scanning the same string. - * - * In the first call to PL_strtok_r, s1 points to a string and the value - * of *lasts is ignored. PL_strtok_r returns a pointer to the first - * token, writes '\0' into the character following the first token, and - * updates *lasts. - * - * In subsequent calls, s1 is null and lasts must stay unchanged from the - * previous call. The separator string s2 may be different from call to - * call. PL_strtok_r returns a pointer to the next token in s1. When no - * token remains in s1, PL_strtok_r returns null. - */ - -PR_EXTERN(char *) -PL_strtok_r(char *s1, const char *s2, char **lasts); - -/* - * Things not (yet?) included: strspn/strcspn, strsep. - * memchr, memcmp, memcpy, memccpy, index, rindex, bcmp, bcopy, bzero. - * Any and all i18n/l10n stuff. - */ - -PR_END_EXTERN_C - -#endif /* _plstr_h */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/.DS_Store b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/.DS_Store deleted file mode 100644 index 2de0c1e..0000000 Binary files a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/.DS_Store and /dev/null differ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/md/_darwin.cfg b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/md/_darwin.cfg deleted file mode 100755 index 5e11893..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/md/_darwin.cfg +++ /dev/null @@ -1,165 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef nspr_cpucfg___ -#define nspr_cpucfg___ - -#ifndef XP_UNIX -#define XP_UNIX -#endif - -#define PR_AF_INET6 30 /* same as AF_INET6 */ - -#ifdef __LITTLE_ENDIAN__ -#undef IS_BIG_ENDIAN -#define IS_LITTLE_ENDIAN 1 -#else -#undef IS_LITTLE_ENDIAN -#define IS_BIG_ENDIAN 1 -#endif - -#ifdef __LP64__ -#define IS_64 -#endif - -#ifndef HAVE_LONG_LONG -#define HAVE_LONG_LONG -#endif -#undef HAVE_ALIGNED_DOUBLES -#define HAVE_ALIGNED_LONGLONGS 1 - -#ifdef IS_64 - -#define PR_BYTES_PER_BYTE 1 -#define PR_BYTES_PER_SHORT 2 -#define PR_BYTES_PER_INT 4 -#define PR_BYTES_PER_INT64 8 -#define PR_BYTES_PER_LONG 8 -#define PR_BYTES_PER_FLOAT 4 -#define PR_BYTES_PER_DOUBLE 8 -#define PR_BYTES_PER_WORD 8 -#define PR_BYTES_PER_DWORD 8 - -#define PR_BITS_PER_BYTE 8 -#define PR_BITS_PER_SHORT 16 -#define PR_BITS_PER_INT 32 -#define PR_BITS_PER_INT64 64 -#define PR_BITS_PER_LONG 64 -#define PR_BITS_PER_FLOAT 32 -#define PR_BITS_PER_DOUBLE 64 -#define PR_BITS_PER_WORD 64 -#define PR_BITS_PER_DWORD 64 - -#define PR_BITS_PER_BYTE_LOG2 3 -#define PR_BITS_PER_SHORT_LOG2 4 -#define PR_BITS_PER_INT_LOG2 5 -#define PR_BITS_PER_INT64_LOG2 6 -#define PR_BITS_PER_LONG_LOG2 6 -#define PR_BITS_PER_FLOAT_LOG2 5 -#define PR_BITS_PER_DOUBLE_LOG2 6 -#define PR_BITS_PER_WORD_LOG2 6 -#define PR_BITS_PER_DWORD_LOG2 6 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 4 -#define PR_ALIGN_OF_LONG 8 -#define PR_ALIGN_OF_INT64 8 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_DOUBLE 8 -#define PR_ALIGN_OF_POINTER 8 -#define PR_ALIGN_OF_WORD 8 -#define PR_ALIGN_OF_DWORD 8 - -#else /* IS_64 */ - -#define PR_BYTES_PER_BYTE 1 -#define PR_BYTES_PER_SHORT 2 -#define PR_BYTES_PER_INT 4 -#define PR_BYTES_PER_INT64 8 -#define PR_BYTES_PER_LONG 4 -#define PR_BYTES_PER_FLOAT 4 -#define PR_BYTES_PER_DOUBLE 8 -#define PR_BYTES_PER_WORD 4 -#define PR_BYTES_PER_DWORD 8 -#define PR_BYTES_PER_WORD_LOG2 2 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#define PR_BITS_PER_BYTE 8 -#define PR_BITS_PER_SHORT 16 -#define PR_BITS_PER_INT 32 -#define PR_BITS_PER_INT64 64 -#define PR_BITS_PER_LONG 32 -#define PR_BITS_PER_FLOAT 32 -#define PR_BITS_PER_DOUBLE 64 -#define PR_BITS_PER_WORD 32 -#define PR_BITS_PER_DWORD 64 - -#define PR_BITS_PER_BYTE_LOG2 3 -#define PR_BITS_PER_SHORT_LOG2 4 -#define PR_BITS_PER_INT_LOG2 5 -#define PR_BITS_PER_INT64_LOG2 6 -#define PR_BITS_PER_LONG_LOG2 5 -#define PR_BITS_PER_FLOAT_LOG2 5 -#define PR_BITS_PER_DOUBLE_LOG2 6 -#define PR_BITS_PER_WORD_LOG2 5 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 4 -#define PR_ALIGN_OF_LONG 4 -#define PR_ALIGN_OF_INT64 4 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_DOUBLE 4 -#define PR_ALIGN_OF_POINTER 4 -#define PR_ALIGN_OF_WORD 4 - -#endif /* IS_64 */ - -#ifndef NO_NSPR_10_SUPPORT - -#define BYTES_PER_BYTE PR_BYTES_PER_BYTE -#define BYTES_PER_SHORT PR_BYTES_PER_SHORT -#define BYTES_PER_INT PR_BYTES_PER_INT -#define BYTES_PER_INT64 PR_BYTES_PER_INT64 -#define BYTES_PER_LONG PR_BYTES_PER_LONG -#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT -#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE -#define BYTES_PER_WORD PR_BYTES_PER_WORD -#define BYTES_PER_DWORD PR_BYTES_PER_DWORD - -#define BITS_PER_BYTE PR_BITS_PER_BYTE -#define BITS_PER_SHORT PR_BITS_PER_SHORT -#define BITS_PER_INT PR_BITS_PER_INT -#define BITS_PER_INT64 PR_BITS_PER_INT64 -#define BITS_PER_LONG PR_BITS_PER_LONG -#define BITS_PER_FLOAT PR_BITS_PER_FLOAT -#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE -#define BITS_PER_WORD PR_BITS_PER_WORD - -#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2 -#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2 -#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2 -#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2 -#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2 -#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2 -#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2 -#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2 - -#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT -#define ALIGN_OF_INT PR_ALIGN_OF_INT -#define ALIGN_OF_LONG PR_ALIGN_OF_LONG -#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64 -#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT -#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE -#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER -#define ALIGN_OF_WORD PR_ALIGN_OF_WORD - -#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2 -#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2 -#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2 - -#endif /* NO_NSPR_10_SUPPORT */ - -#endif /* nspr_cpucfg___ */ - diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/md/_linux.cfg b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/md/_linux.cfg deleted file mode 100755 index 78fd839..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/md/_linux.cfg +++ /dev/null @@ -1,978 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * This file is used by not only Linux but also other glibc systems - * such as GNU/Hurd and GNU/k*BSD. - */ - -#ifndef nspr_cpucfg___ -#define nspr_cpucfg___ - -#ifndef XP_UNIX -#define XP_UNIX -#endif - -#if !defined(LINUX) && defined(__linux__) -#define LINUX -#endif - -#ifdef __FreeBSD_kernel__ -#define PR_AF_INET6 28 /* same as AF_INET6 */ -#elif defined(__GNU__) -#define PR_AF_INET6 26 /* same as AF_INET6 */ -#else -#define PR_AF_INET6 10 /* same as AF_INET6 */ -#endif - -#ifdef __powerpc64__ - -#undef IS_LITTLE_ENDIAN -#define IS_BIG_ENDIAN 1 -#define IS_64 - -#define PR_BYTES_PER_BYTE 1 -#define PR_BYTES_PER_SHORT 2 -#define PR_BYTES_PER_INT 4 -#define PR_BYTES_PER_INT64 8 -#define PR_BYTES_PER_LONG 8 -#define PR_BYTES_PER_FLOAT 4 -#define PR_BYTES_PER_DOUBLE 8 -#define PR_BYTES_PER_WORD 8 -#define PR_BYTES_PER_DWORD 8 - -#define PR_BITS_PER_BYTE 8 -#define PR_BITS_PER_SHORT 16 -#define PR_BITS_PER_INT 32 -#define PR_BITS_PER_INT64 64 -#define PR_BITS_PER_LONG 64 -#define PR_BITS_PER_FLOAT 32 -#define PR_BITS_PER_DOUBLE 64 -#define PR_BITS_PER_WORD 64 - -#define PR_BITS_PER_BYTE_LOG2 3 -#define PR_BITS_PER_SHORT_LOG2 4 -#define PR_BITS_PER_INT_LOG2 5 -#define PR_BITS_PER_INT64_LOG2 6 -#define PR_BITS_PER_LONG_LOG2 6 -#define PR_BITS_PER_FLOAT_LOG2 5 -#define PR_BITS_PER_DOUBLE_LOG2 6 -#define PR_BITS_PER_WORD_LOG2 6 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 4 -#define PR_ALIGN_OF_LONG 8 -#define PR_ALIGN_OF_INT64 8 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_DOUBLE 8 -#define PR_ALIGN_OF_POINTER 8 -#define PR_ALIGN_OF_WORD 8 - -#define PR_BYTES_PER_WORD_LOG2 3 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#elif defined(__powerpc__) - -#undef IS_LITTLE_ENDIAN -#define IS_BIG_ENDIAN 1 - -#define PR_BYTES_PER_BYTE 1 -#define PR_BYTES_PER_SHORT 2 -#define PR_BYTES_PER_INT 4 -#define PR_BYTES_PER_INT64 8 -#define PR_BYTES_PER_LONG 4 -#define PR_BYTES_PER_FLOAT 4 -#define PR_BYTES_PER_DOUBLE 8 -#define PR_BYTES_PER_WORD 4 -#define PR_BYTES_PER_DWORD 8 - -#define PR_BITS_PER_BYTE 8 -#define PR_BITS_PER_SHORT 16 -#define PR_BITS_PER_INT 32 -#define PR_BITS_PER_INT64 64 -#define PR_BITS_PER_LONG 32 -#define PR_BITS_PER_FLOAT 32 -#define PR_BITS_PER_DOUBLE 64 -#define PR_BITS_PER_WORD 32 - -#define PR_BITS_PER_BYTE_LOG2 3 -#define PR_BITS_PER_SHORT_LOG2 4 -#define PR_BITS_PER_INT_LOG2 5 -#define PR_BITS_PER_INT64_LOG2 6 -#define PR_BITS_PER_LONG_LOG2 5 -#define PR_BITS_PER_FLOAT_LOG2 5 -#define PR_BITS_PER_DOUBLE_LOG2 6 -#define PR_BITS_PER_WORD_LOG2 5 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 4 -#define PR_ALIGN_OF_LONG 4 -#define PR_ALIGN_OF_INT64 8 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_DOUBLE 8 -#define PR_ALIGN_OF_POINTER 4 -#define PR_ALIGN_OF_WORD 4 - -#define PR_BYTES_PER_WORD_LOG2 2 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#elif defined(__alpha) - -#define IS_LITTLE_ENDIAN 1 -#undef IS_BIG_ENDIAN -#define IS_64 - -#define PR_BYTES_PER_BYTE 1 -#define PR_BYTES_PER_SHORT 2 -#define PR_BYTES_PER_INT 4 -#define PR_BYTES_PER_INT64 8 -#define PR_BYTES_PER_LONG 8 -#define PR_BYTES_PER_FLOAT 4 -#define PR_BYTES_PER_DOUBLE 8 -#define PR_BYTES_PER_WORD 8 -#define PR_BYTES_PER_DWORD 8 - -#define PR_BITS_PER_BYTE 8 -#define PR_BITS_PER_SHORT 16 -#define PR_BITS_PER_INT 32 -#define PR_BITS_PER_INT64 64 -#define PR_BITS_PER_LONG 64 -#define PR_BITS_PER_FLOAT 32 -#define PR_BITS_PER_DOUBLE 64 -#define PR_BITS_PER_WORD 64 - -#define PR_BITS_PER_BYTE_LOG2 3 -#define PR_BITS_PER_SHORT_LOG2 4 -#define PR_BITS_PER_INT_LOG2 5 -#define PR_BITS_PER_INT64_LOG2 6 -#define PR_BITS_PER_LONG_LOG2 6 -#define PR_BITS_PER_FLOAT_LOG2 5 -#define PR_BITS_PER_DOUBLE_LOG2 6 -#define PR_BITS_PER_WORD_LOG2 6 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 4 -#define PR_ALIGN_OF_LONG 8 -#define PR_ALIGN_OF_INT64 8 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_DOUBLE 8 -#define PR_ALIGN_OF_POINTER 8 -#define PR_ALIGN_OF_WORD 8 - -#define PR_BYTES_PER_WORD_LOG2 3 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#elif defined(__ia64__) - -#define IS_LITTLE_ENDIAN 1 -#undef IS_BIG_ENDIAN -#define IS_64 - -#define PR_BYTES_PER_BYTE 1 -#define PR_BYTES_PER_SHORT 2 -#define PR_BYTES_PER_INT 4 -#define PR_BYTES_PER_INT64 8 -#define PR_BYTES_PER_LONG 8 -#define PR_BYTES_PER_FLOAT 4 -#define PR_BYTES_PER_DOUBLE 8 -#define PR_BYTES_PER_WORD 8 -#define PR_BYTES_PER_DWORD 8 - -#define PR_BITS_PER_BYTE 8 -#define PR_BITS_PER_SHORT 16 -#define PR_BITS_PER_INT 32 -#define PR_BITS_PER_INT64 64 -#define PR_BITS_PER_LONG 64 -#define PR_BITS_PER_FLOAT 32 -#define PR_BITS_PER_DOUBLE 64 -#define PR_BITS_PER_WORD 64 - -#define PR_BITS_PER_BYTE_LOG2 3 -#define PR_BITS_PER_SHORT_LOG2 4 -#define PR_BITS_PER_INT_LOG2 5 -#define PR_BITS_PER_INT64_LOG2 6 -#define PR_BITS_PER_LONG_LOG2 6 -#define PR_BITS_PER_FLOAT_LOG2 5 -#define PR_BITS_PER_DOUBLE_LOG2 6 -#define PR_BITS_PER_WORD_LOG2 6 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 4 -#define PR_ALIGN_OF_LONG 8 -#define PR_ALIGN_OF_INT64 8 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_DOUBLE 8 -#define PR_ALIGN_OF_POINTER 8 -#define PR_ALIGN_OF_WORD 8 - -#define PR_BYTES_PER_WORD_LOG2 3 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#elif defined(__x86_64__) - -#ifdef __ILP32__ - -#define IS_LITTLE_ENDIAN 1 -#undef IS_BIG_ENDIAN - -#define PR_BYTES_PER_BYTE 1 -#define PR_BYTES_PER_SHORT 2 -#define PR_BYTES_PER_INT 4 -#define PR_BYTES_PER_INT64 8 -#define PR_BYTES_PER_LONG 4 -#define PR_BYTES_PER_FLOAT 4 -#define PR_BYTES_PER_DOUBLE 8 -#define PR_BYTES_PER_WORD 4 -#define PR_BYTES_PER_DWORD 8 - -#define PR_BITS_PER_BYTE 8 -#define PR_BITS_PER_SHORT 16 -#define PR_BITS_PER_INT 32 -#define PR_BITS_PER_INT64 64 -#define PR_BITS_PER_LONG 32 -#define PR_BITS_PER_FLOAT 32 -#define PR_BITS_PER_DOUBLE 64 -#define PR_BITS_PER_WORD 32 - -#define PR_BITS_PER_BYTE_LOG2 3 -#define PR_BITS_PER_SHORT_LOG2 4 -#define PR_BITS_PER_INT_LOG2 5 -#define PR_BITS_PER_INT64_LOG2 6 -#define PR_BITS_PER_LONG_LOG2 5 -#define PR_BITS_PER_FLOAT_LOG2 5 -#define PR_BITS_PER_DOUBLE_LOG2 6 -#define PR_BITS_PER_WORD_LOG2 5 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 4 -#define PR_ALIGN_OF_LONG 4 -#define PR_ALIGN_OF_INT64 8 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_DOUBLE 8 -#define PR_ALIGN_OF_POINTER 4 -#define PR_ALIGN_OF_WORD 4 - -#define PR_BYTES_PER_WORD_LOG2 2 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#else - -#define IS_LITTLE_ENDIAN 1 -#undef IS_BIG_ENDIAN -#define IS_64 - -#define PR_BYTES_PER_BYTE 1 -#define PR_BYTES_PER_SHORT 2 -#define PR_BYTES_PER_INT 4 -#define PR_BYTES_PER_INT64 8 -#define PR_BYTES_PER_LONG 8 -#define PR_BYTES_PER_FLOAT 4 -#define PR_BYTES_PER_DOUBLE 8 -#define PR_BYTES_PER_WORD 8 -#define PR_BYTES_PER_DWORD 8 - -#define PR_BITS_PER_BYTE 8 -#define PR_BITS_PER_SHORT 16 -#define PR_BITS_PER_INT 32 -#define PR_BITS_PER_INT64 64 -#define PR_BITS_PER_LONG 64 -#define PR_BITS_PER_FLOAT 32 -#define PR_BITS_PER_DOUBLE 64 -#define PR_BITS_PER_WORD 64 - -#define PR_BITS_PER_BYTE_LOG2 3 -#define PR_BITS_PER_SHORT_LOG2 4 -#define PR_BITS_PER_INT_LOG2 5 -#define PR_BITS_PER_INT64_LOG2 6 -#define PR_BITS_PER_LONG_LOG2 6 -#define PR_BITS_PER_FLOAT_LOG2 5 -#define PR_BITS_PER_DOUBLE_LOG2 6 -#define PR_BITS_PER_WORD_LOG2 6 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 4 -#define PR_ALIGN_OF_LONG 8 -#define PR_ALIGN_OF_INT64 8 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_DOUBLE 8 -#define PR_ALIGN_OF_POINTER 8 -#define PR_ALIGN_OF_WORD 8 - -#define PR_BYTES_PER_WORD_LOG2 3 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#endif - -#elif defined(__mc68000__) - -#undef IS_LITTLE_ENDIAN -#define IS_BIG_ENDIAN 1 - -#define PR_BYTES_PER_BYTE 1 -#define PR_BYTES_PER_SHORT 2 -#define PR_BYTES_PER_INT 4 -#define PR_BYTES_PER_INT64 8 -#define PR_BYTES_PER_LONG 4 -#define PR_BYTES_PER_FLOAT 4 -#define PR_BYTES_PER_DOUBLE 8 -#define PR_BYTES_PER_WORD 4 -#define PR_BYTES_PER_DWORD 8 - -#define PR_BITS_PER_BYTE 8 -#define PR_BITS_PER_SHORT 16 -#define PR_BITS_PER_INT 32 -#define PR_BITS_PER_INT64 64 -#define PR_BITS_PER_LONG 32 -#define PR_BITS_PER_FLOAT 32 -#define PR_BITS_PER_DOUBLE 64 -#define PR_BITS_PER_WORD 32 - -#define PR_BITS_PER_BYTE_LOG2 3 -#define PR_BITS_PER_SHORT_LOG2 4 -#define PR_BITS_PER_INT_LOG2 5 -#define PR_BITS_PER_INT64_LOG2 6 -#define PR_BITS_PER_LONG_LOG2 5 -#define PR_BITS_PER_FLOAT_LOG2 5 -#define PR_BITS_PER_DOUBLE_LOG2 6 -#define PR_BITS_PER_WORD_LOG2 5 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 2 -#define PR_ALIGN_OF_LONG 2 -#define PR_ALIGN_OF_INT64 2 -#define PR_ALIGN_OF_FLOAT 2 -#define PR_ALIGN_OF_DOUBLE 2 -#define PR_ALIGN_OF_POINTER 2 -#define PR_ALIGN_OF_WORD 2 - -#define PR_BYTES_PER_WORD_LOG2 2 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#elif defined(__sparc__) && defined (__arch64__) - -#undef IS_LITTLE_ENDIAN -#define IS_BIG_ENDIAN 1 -#define IS_64 - -#define PR_BYTES_PER_BYTE 1 -#define PR_BYTES_PER_SHORT 2 -#define PR_BYTES_PER_INT 4 -#define PR_BYTES_PER_INT64 8 -#define PR_BYTES_PER_LONG 8 -#define PR_BYTES_PER_FLOAT 4 -#define PR_BYTES_PER_DOUBLE 8 -#define PR_BYTES_PER_WORD 8 -#define PR_BYTES_PER_DWORD 8 - -#define PR_BITS_PER_BYTE 8 -#define PR_BITS_PER_SHORT 16 -#define PR_BITS_PER_INT 32 -#define PR_BITS_PER_INT64 64 -#define PR_BITS_PER_LONG 64 -#define PR_BITS_PER_FLOAT 32 -#define PR_BITS_PER_DOUBLE 64 -#define PR_BITS_PER_WORD 64 - -#define PR_BITS_PER_BYTE_LOG2 3 -#define PR_BITS_PER_SHORT_LOG2 4 -#define PR_BITS_PER_INT_LOG2 5 -#define PR_BITS_PER_INT64_LOG2 6 -#define PR_BITS_PER_LONG_LOG2 6 -#define PR_BITS_PER_FLOAT_LOG2 5 -#define PR_BITS_PER_DOUBLE_LOG2 6 -#define PR_BITS_PER_WORD_LOG2 6 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 4 -#define PR_ALIGN_OF_INT64 8 -#define PR_ALIGN_OF_LONG 8 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_DOUBLE 8 -#define PR_ALIGN_OF_POINTER 8 -#define PR_ALIGN_OF_WORD 8 - -#define PR_BYTES_PER_WORD_LOG2 3 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#elif defined(__sparc__) - -#undef IS_LITTLE_ENDIAN -#define IS_BIG_ENDIAN 1 - -#define PR_BYTES_PER_BYTE 1 -#define PR_BYTES_PER_SHORT 2 -#define PR_BYTES_PER_INT 4 -#define PR_BYTES_PER_INT64 8 -#define PR_BYTES_PER_LONG 4 -#define PR_BYTES_PER_FLOAT 4 -#define PR_BYTES_PER_DOUBLE 8 -#define PR_BYTES_PER_WORD 4 -#define PR_BYTES_PER_DWORD 8 - -#define PR_BITS_PER_BYTE 8 -#define PR_BITS_PER_SHORT 16 -#define PR_BITS_PER_INT 32 -#define PR_BITS_PER_INT64 64 -#define PR_BITS_PER_LONG 32 -#define PR_BITS_PER_FLOAT 32 -#define PR_BITS_PER_DOUBLE 64 -#define PR_BITS_PER_WORD 32 - -#define PR_BITS_PER_BYTE_LOG2 3 -#define PR_BITS_PER_SHORT_LOG2 4 -#define PR_BITS_PER_INT_LOG2 5 -#define PR_BITS_PER_INT64_LOG2 6 -#define PR_BITS_PER_LONG_LOG2 5 -#define PR_BITS_PER_FLOAT_LOG2 5 -#define PR_BITS_PER_DOUBLE_LOG2 6 -#define PR_BITS_PER_WORD_LOG2 5 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 4 -#define PR_ALIGN_OF_LONG 4 -#define PR_ALIGN_OF_INT64 8 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_DOUBLE 8 -#define PR_ALIGN_OF_POINTER 4 -#define PR_ALIGN_OF_WORD 4 - -#define PR_BYTES_PER_WORD_LOG2 2 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#elif defined(__i386__) - -#define IS_LITTLE_ENDIAN 1 -#undef IS_BIG_ENDIAN - -#define PR_BYTES_PER_BYTE 1 -#define PR_BYTES_PER_SHORT 2 -#define PR_BYTES_PER_INT 4 -#define PR_BYTES_PER_INT64 8 -#define PR_BYTES_PER_LONG 4 -#define PR_BYTES_PER_FLOAT 4 -#define PR_BYTES_PER_DOUBLE 8 -#define PR_BYTES_PER_WORD 4 -#define PR_BYTES_PER_DWORD 8 - -#define PR_BITS_PER_BYTE 8 -#define PR_BITS_PER_SHORT 16 -#define PR_BITS_PER_INT 32 -#define PR_BITS_PER_INT64 64 -#define PR_BITS_PER_LONG 32 -#define PR_BITS_PER_FLOAT 32 -#define PR_BITS_PER_DOUBLE 64 -#define PR_BITS_PER_WORD 32 - -#define PR_BITS_PER_BYTE_LOG2 3 -#define PR_BITS_PER_SHORT_LOG2 4 -#define PR_BITS_PER_INT_LOG2 5 -#define PR_BITS_PER_INT64_LOG2 6 -#define PR_BITS_PER_LONG_LOG2 5 -#define PR_BITS_PER_FLOAT_LOG2 5 -#define PR_BITS_PER_DOUBLE_LOG2 6 -#define PR_BITS_PER_WORD_LOG2 5 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 4 -#define PR_ALIGN_OF_LONG 4 -#define PR_ALIGN_OF_INT64 4 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_DOUBLE 4 -#define PR_ALIGN_OF_POINTER 4 -#define PR_ALIGN_OF_WORD 4 - -#define PR_BYTES_PER_WORD_LOG2 2 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#elif defined(__mips__) - -#ifdef __MIPSEB__ -#define IS_BIG_ENDIAN 1 -#undef IS_LITTLE_ENDIAN -#elif defined(__MIPSEL__) -#define IS_LITTLE_ENDIAN 1 -#undef IS_BIG_ENDIAN -#else -#error "Unknown MIPS endianness." -#endif - -#define PR_BYTES_PER_BYTE 1 -#define PR_BYTES_PER_SHORT 2 -#define PR_BYTES_PER_INT 4 -#define PR_BYTES_PER_INT64 8 -#define PR_BYTES_PER_LONG 4 -#define PR_BYTES_PER_FLOAT 4 -#define PR_BYTES_PER_DOUBLE 8 -#define PR_BYTES_PER_WORD 4 -#define PR_BYTES_PER_DWORD 8 - -#define PR_BITS_PER_BYTE 8 -#define PR_BITS_PER_SHORT 16 -#define PR_BITS_PER_INT 32 -#define PR_BITS_PER_INT64 64 -#define PR_BITS_PER_LONG 32 -#define PR_BITS_PER_FLOAT 32 -#define PR_BITS_PER_DOUBLE 64 -#define PR_BITS_PER_WORD 32 - -#define PR_BITS_PER_BYTE_LOG2 3 -#define PR_BITS_PER_SHORT_LOG2 4 -#define PR_BITS_PER_INT_LOG2 5 -#define PR_BITS_PER_INT64_LOG2 6 -#define PR_BITS_PER_LONG_LOG2 5 -#define PR_BITS_PER_FLOAT_LOG2 5 -#define PR_BITS_PER_DOUBLE_LOG2 6 -#define PR_BITS_PER_WORD_LOG2 5 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 4 -#define PR_ALIGN_OF_LONG 4 -#define PR_ALIGN_OF_INT64 8 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_DOUBLE 8 -#define PR_ALIGN_OF_POINTER 4 -#define PR_ALIGN_OF_WORD 4 - -#define PR_BYTES_PER_WORD_LOG2 2 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#elif defined(__arm__) - -#ifdef __ARMEB__ -#undef IS_LITTLE_ENDIAN -#define IS_BIG_ENDIAN 1 -#elif defined(__ARMEL__) -#define IS_LITTLE_ENDIAN 1 -#undef IS_BIG_ENDIAN -#else -#error "Unknown ARM endianness." -#endif - -#define PR_BYTES_PER_BYTE 1 -#define PR_BYTES_PER_SHORT 2 -#define PR_BYTES_PER_INT 4 -#define PR_BYTES_PER_INT64 8 -#define PR_BYTES_PER_LONG 4 -#define PR_BYTES_PER_FLOAT 4 -#define PR_BYTES_PER_DOUBLE 8 -#define PR_BYTES_PER_WORD 4 -#define PR_BYTES_PER_DWORD 8 - -#define PR_BITS_PER_BYTE 8 -#define PR_BITS_PER_SHORT 16 -#define PR_BITS_PER_INT 32 -#define PR_BITS_PER_INT64 64 -#define PR_BITS_PER_LONG 32 -#define PR_BITS_PER_FLOAT 32 -#define PR_BITS_PER_DOUBLE 64 -#define PR_BITS_PER_WORD 32 - -#define PR_BITS_PER_BYTE_LOG2 3 -#define PR_BITS_PER_SHORT_LOG2 4 -#define PR_BITS_PER_INT_LOG2 5 -#define PR_BITS_PER_INT64_LOG2 6 -#define PR_BITS_PER_LONG_LOG2 5 -#define PR_BITS_PER_FLOAT_LOG2 5 -#define PR_BITS_PER_DOUBLE_LOG2 6 -#define PR_BITS_PER_WORD_LOG2 5 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 4 -#define PR_ALIGN_OF_LONG 4 -#define PR_ALIGN_OF_INT64 4 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_DOUBLE 4 -#define PR_ALIGN_OF_POINTER 4 -#define PR_ALIGN_OF_WORD 4 - -#define PR_BYTES_PER_WORD_LOG2 2 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#elif defined(__aarch64__) - -#ifdef __AARCH64EB__ -#undef IS_LITTLE_ENDIAN -#define IS_BIG_ENDIAN 1 -#elif defined(__AARCH64EL__) -#define IS_LITTLE_ENDIAN 1 -#undef IS_BIG_ENDIAN -#else -#error "Unknown Aarch64 endianness." -#endif -#define IS_64 - -#define PR_BYTES_PER_BYTE 1 -#define PR_BYTES_PER_SHORT 2 -#define PR_BYTES_PER_INT 4 -#define PR_BYTES_PER_INT64 8 -#define PR_BYTES_PER_LONG 8 -#define PR_BYTES_PER_FLOAT 4 -#define PR_BYTES_PER_DOUBLE 8 -#define PR_BYTES_PER_WORD 8 -#define PR_BYTES_PER_DWORD 8 - -#define PR_BITS_PER_BYTE 8 -#define PR_BITS_PER_SHORT 16 -#define PR_BITS_PER_INT 32 -#define PR_BITS_PER_INT64 64 -#define PR_BITS_PER_LONG 64 -#define PR_BITS_PER_FLOAT 32 -#define PR_BITS_PER_DOUBLE 64 -#define PR_BITS_PER_WORD 64 - -#define PR_BITS_PER_BYTE_LOG2 3 -#define PR_BITS_PER_SHORT_LOG2 4 -#define PR_BITS_PER_INT_LOG2 5 -#define PR_BITS_PER_INT64_LOG2 6 -#define PR_BITS_PER_LONG_LOG2 6 -#define PR_BITS_PER_FLOAT_LOG2 5 -#define PR_BITS_PER_DOUBLE_LOG2 6 -#define PR_BITS_PER_WORD_LOG2 6 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 4 -#define PR_ALIGN_OF_LONG 8 -#define PR_ALIGN_OF_INT64 8 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_DOUBLE 8 -#define PR_ALIGN_OF_POINTER 8 -#define PR_ALIGN_OF_WORD 8 - -#define PR_BYTES_PER_WORD_LOG2 3 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#elif defined(__hppa__) - -#undef IS_LITTLE_ENDIAN -#define IS_BIG_ENDIAN 1 - -#define PR_BYTES_PER_BYTE 1 -#define PR_BYTES_PER_SHORT 2 -#define PR_BYTES_PER_INT 4 -#define PR_BYTES_PER_INT64 8 -#define PR_BYTES_PER_LONG 4 -#define PR_BYTES_PER_FLOAT 4 -#define PR_BYTES_PER_DOUBLE 8 -#define PR_BYTES_PER_WORD 4 -#define PR_BYTES_PER_DWORD 8 - -#define PR_BITS_PER_BYTE 8 -#define PR_BITS_PER_SHORT 16 -#define PR_BITS_PER_INT 32 -#define PR_BITS_PER_INT64 64 -#define PR_BITS_PER_LONG 32 -#define PR_BITS_PER_FLOAT 32 -#define PR_BITS_PER_DOUBLE 64 -#define PR_BITS_PER_WORD 32 - -#define PR_BITS_PER_BYTE_LOG2 3 -#define PR_BITS_PER_SHORT_LOG2 4 -#define PR_BITS_PER_INT_LOG2 5 -#define PR_BITS_PER_INT64_LOG2 6 -#define PR_BITS_PER_LONG_LOG2 5 -#define PR_BITS_PER_FLOAT_LOG2 5 -#define PR_BITS_PER_DOUBLE_LOG2 6 -#define PR_BITS_PER_WORD_LOG2 5 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 4 -#define PR_ALIGN_OF_LONG 4 -#define PR_ALIGN_OF_INT64 8 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_DOUBLE 8 -#define PR_ALIGN_OF_POINTER 4 -#define PR_ALIGN_OF_WORD 4 - -#define PR_BYTES_PER_WORD_LOG2 2 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#elif defined(__s390x__) - -#define IS_BIG_ENDIAN 1 -#undef IS_LITTLE_ENDIAN -#define IS_64 - -#define PR_BYTES_PER_BYTE 1 -#define PR_BYTES_PER_SHORT 2 -#define PR_BYTES_PER_INT 4 -#define PR_BYTES_PER_INT64 8 -#define PR_BYTES_PER_LONG 8 -#define PR_BYTES_PER_FLOAT 4 -#define PR_BYTES_PER_DOUBLE 8 -#define PR_BYTES_PER_WORD 8 -#define PR_BYTES_PER_DWORD 8 - -#define PR_BITS_PER_BYTE 8 -#define PR_BITS_PER_SHORT 16 -#define PR_BITS_PER_INT 32 -#define PR_BITS_PER_INT64 64 -#define PR_BITS_PER_LONG 64 -#define PR_BITS_PER_FLOAT 32 -#define PR_BITS_PER_DOUBLE 64 -#define PR_BITS_PER_WORD 64 - -#define PR_BITS_PER_BYTE_LOG2 3 -#define PR_BITS_PER_SHORT_LOG2 4 -#define PR_BITS_PER_INT_LOG2 5 -#define PR_BITS_PER_INT64_LOG2 6 -#define PR_BITS_PER_LONG_LOG2 6 -#define PR_BITS_PER_FLOAT_LOG2 5 -#define PR_BITS_PER_DOUBLE_LOG2 6 -#define PR_BITS_PER_WORD_LOG2 6 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 4 -#define PR_ALIGN_OF_LONG 8 -#define PR_ALIGN_OF_INT64 8 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_DOUBLE 8 -#define PR_ALIGN_OF_POINTER 8 -#define PR_ALIGN_OF_WORD 8 - -#define PR_BYTES_PER_WORD_LOG2 3 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#elif defined(__s390__) - -#define IS_BIG_ENDIAN 1 -#undef IS_LITTLE_ENDIAN - -#define PR_BYTES_PER_BYTE 1 -#define PR_BYTES_PER_SHORT 2 -#define PR_BYTES_PER_INT 4 -#define PR_BYTES_PER_INT64 8 -#define PR_BYTES_PER_LONG 4 -#define PR_BYTES_PER_FLOAT 4 -#define PR_BYTES_PER_DOUBLE 8 -#define PR_BYTES_PER_WORD 4 -#define PR_BYTES_PER_DWORD 8 - -#define PR_BITS_PER_BYTE 8 -#define PR_BITS_PER_SHORT 16 -#define PR_BITS_PER_INT 32 -#define PR_BITS_PER_INT64 64 -#define PR_BITS_PER_LONG 32 -#define PR_BITS_PER_FLOAT 32 -#define PR_BITS_PER_DOUBLE 64 -#define PR_BITS_PER_WORD 32 - -#define PR_BITS_PER_BYTE_LOG2 3 -#define PR_BITS_PER_SHORT_LOG2 4 -#define PR_BITS_PER_INT_LOG2 5 -#define PR_BITS_PER_INT64_LOG2 6 -#define PR_BITS_PER_LONG_LOG2 5 -#define PR_BITS_PER_FLOAT_LOG2 5 -#define PR_BITS_PER_DOUBLE_LOG2 6 -#define PR_BITS_PER_WORD_LOG2 5 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 4 -#define PR_ALIGN_OF_LONG 4 -#define PR_ALIGN_OF_INT64 4 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_DOUBLE 4 -#define PR_ALIGN_OF_POINTER 4 -#define PR_ALIGN_OF_WORD 4 - -#define PR_BYTES_PER_WORD_LOG2 2 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#elif defined(__sh__) - -#define IS_LITTLE_ENDIAN 1 -#undef IS_BIG_ENDIAN - -#define PR_BYTES_PER_BYTE 1 -#define PR_BYTES_PER_SHORT 2 -#define PR_BYTES_PER_INT 4 -#define PR_BYTES_PER_INT64 8 -#define PR_BYTES_PER_LONG 4 -#define PR_BYTES_PER_FLOAT 4 -#define PR_BYTES_PER_DOUBLE 8 -#define PR_BYTES_PER_WORD 4 -#define PR_BYTES_PER_DWORD 8 - -#define PR_BITS_PER_BYTE 8 -#define PR_BITS_PER_SHORT 16 -#define PR_BITS_PER_INT 32 -#define PR_BITS_PER_INT64 64 -#define PR_BITS_PER_LONG 32 -#define PR_BITS_PER_FLOAT 32 -#define PR_BITS_PER_DOUBLE 64 -#define PR_BITS_PER_WORD 32 - -#define PR_BITS_PER_BYTE_LOG2 3 -#define PR_BITS_PER_SHORT_LOG2 4 -#define PR_BITS_PER_INT_LOG2 5 -#define PR_BITS_PER_INT64_LOG2 6 -#define PR_BITS_PER_LONG_LOG2 5 -#define PR_BITS_PER_FLOAT_LOG2 5 -#define PR_BITS_PER_DOUBLE_LOG2 6 -#define PR_BITS_PER_WORD_LOG2 5 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 4 -#define PR_ALIGN_OF_LONG 4 -#define PR_ALIGN_OF_INT64 4 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_DOUBLE 4 -#define PR_ALIGN_OF_POINTER 4 -#define PR_ALIGN_OF_WORD 4 - -#define PR_BYTES_PER_WORD_LOG2 2 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#elif defined(__avr32__) - -#undef IS_LITTLE_ENDIAN -#define IS_BIG_ENDIAN 1 - -#define PR_BYTES_PER_BYTE 1 -#define PR_BYTES_PER_SHORT 2 -#define PR_BYTES_PER_INT 4 -#define PR_BYTES_PER_INT64 8 -#define PR_BYTES_PER_LONG 4 -#define PR_BYTES_PER_FLOAT 4 -#define PR_BYTES_PER_DOUBLE 8 -#define PR_BYTES_PER_WORD 4 -#define PR_BYTES_PER_DWORD 8 - -#define PR_BITS_PER_BYTE 8 -#define PR_BITS_PER_SHORT 16 -#define PR_BITS_PER_INT 32 -#define PR_BITS_PER_INT64 64 -#define PR_BITS_PER_LONG 32 -#define PR_BITS_PER_FLOAT 32 -#define PR_BITS_PER_DOUBLE 64 -#define PR_BITS_PER_WORD 32 - -#define PR_BITS_PER_BYTE_LOG2 3 -#define PR_BITS_PER_SHORT_LOG2 4 -#define PR_BITS_PER_INT_LOG2 5 -#define PR_BITS_PER_INT64_LOG2 6 -#define PR_BITS_PER_LONG_LOG2 5 -#define PR_BITS_PER_FLOAT_LOG2 5 -#define PR_BITS_PER_DOUBLE_LOG2 6 -#define PR_BITS_PER_WORD_LOG2 5 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 4 -#define PR_ALIGN_OF_LONG 4 -#define PR_ALIGN_OF_INT64 4 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_DOUBLE 4 -#define PR_ALIGN_OF_POINTER 4 -#define PR_ALIGN_OF_WORD 4 - -#define PR_BYTES_PER_WORD_LOG2 2 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#elif defined(__m32r__) - -#undef IS_LITTLE_ENDIAN -#define IS_BIG_ENDIAN 1 - -#define PR_BYTES_PER_BYTE 1 -#define PR_BYTES_PER_SHORT 2 -#define PR_BYTES_PER_INT 4 -#define PR_BYTES_PER_INT64 8 -#define PR_BYTES_PER_LONG 4 -#define PR_BYTES_PER_FLOAT 4 -#define PR_BYTES_PER_DOUBLE 8 -#define PR_BYTES_PER_WORD 4 -#define PR_BYTES_PER_DWORD 8 - -#define PR_BITS_PER_BYTE 8 -#define PR_BITS_PER_SHORT 16 -#define PR_BITS_PER_INT 32 -#define PR_BITS_PER_INT64 64 -#define PR_BITS_PER_LONG 32 -#define PR_BITS_PER_FLOAT 32 -#define PR_BITS_PER_DOUBLE 64 -#define PR_BITS_PER_WORD 32 - -#define PR_BITS_PER_BYTE_LOG2 3 -#define PR_BITS_PER_SHORT_LOG2 4 -#define PR_BITS_PER_INT_LOG2 5 -#define PR_BITS_PER_INT64_LOG2 6 -#define PR_BITS_PER_LONG_LOG2 5 -#define PR_BITS_PER_FLOAT_LOG2 5 -#define PR_BITS_PER_DOUBLE_LOG2 6 -#define PR_BITS_PER_WORD_LOG2 5 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 4 -#define PR_ALIGN_OF_LONG 4 -#define PR_ALIGN_OF_INT64 4 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_DOUBLE 4 -#define PR_ALIGN_OF_POINTER 4 -#define PR_ALIGN_OF_WORD 4 - -#define PR_BYTES_PER_WORD_LOG2 2 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#else - -#error "Unknown CPU architecture" - -#endif - -#ifndef HAVE_LONG_LONG -#define HAVE_LONG_LONG -#endif -#if PR_ALIGN_OF_DOUBLE == 8 -#define HAVE_ALIGNED_DOUBLES -#endif -#if PR_ALIGN_OF_INT64 == 8 -#define HAVE_ALIGNED_LONGLONGS -#endif - -#ifndef NO_NSPR_10_SUPPORT - -#define BYTES_PER_BYTE PR_BYTES_PER_BYTE -#define BYTES_PER_SHORT PR_BYTES_PER_SHORT -#define BYTES_PER_INT PR_BYTES_PER_INT -#define BYTES_PER_INT64 PR_BYTES_PER_INT64 -#define BYTES_PER_LONG PR_BYTES_PER_LONG -#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT -#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE -#define BYTES_PER_WORD PR_BYTES_PER_WORD -#define BYTES_PER_DWORD PR_BYTES_PER_DWORD - -#define BITS_PER_BYTE PR_BITS_PER_BYTE -#define BITS_PER_SHORT PR_BITS_PER_SHORT -#define BITS_PER_INT PR_BITS_PER_INT -#define BITS_PER_INT64 PR_BITS_PER_INT64 -#define BITS_PER_LONG PR_BITS_PER_LONG -#define BITS_PER_FLOAT PR_BITS_PER_FLOAT -#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE -#define BITS_PER_WORD PR_BITS_PER_WORD - -#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2 -#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2 -#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2 -#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2 -#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2 -#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2 -#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2 -#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2 - -#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT -#define ALIGN_OF_INT PR_ALIGN_OF_INT -#define ALIGN_OF_LONG PR_ALIGN_OF_LONG -#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64 -#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT -#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE -#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER -#define ALIGN_OF_WORD PR_ALIGN_OF_WORD - -#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2 -#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2 -#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2 - -#endif /* NO_NSPR_10_SUPPORT */ - -#endif /* nspr_cpucfg___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/md/_win95.cfg b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/md/_win95.cfg deleted file mode 100755 index 1e693cc..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/md/_win95.cfg +++ /dev/null @@ -1,272 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef nspr_cpucfg___ -#define nspr_cpucfg___ - -#ifndef XP_PC -#define XP_PC -#endif - -#ifndef WIN32 -#define WIN32 -#endif - -#ifndef WIN95 -#define WIN95 -#endif - -#define PR_AF_INET6 23 /* same as AF_INET6 */ - -#if defined(_M_IX86) || defined(_X86_) - -#define IS_LITTLE_ENDIAN 1 -#undef IS_BIG_ENDIAN - -#define PR_BYTES_PER_BYTE 1 -#define PR_BYTES_PER_SHORT 2 -#define PR_BYTES_PER_INT 4 -#define PR_BYTES_PER_INT64 8 -#define PR_BYTES_PER_LONG 4 -#define PR_BYTES_PER_FLOAT 4 -#define PR_BYTES_PER_WORD 4 -#define PR_BYTES_PER_DWORD 8 -#define PR_BYTES_PER_DOUBLE 8 - -#define PR_BITS_PER_BYTE 8 -#define PR_BITS_PER_SHORT 16 -#define PR_BITS_PER_INT 32 -#define PR_BITS_PER_INT64 64 -#define PR_BITS_PER_LONG 32 -#define PR_BITS_PER_FLOAT 32 -#define PR_BITS_PER_WORD 32 -#define PR_BITS_PER_DWORD 64 -#define PR_BITS_PER_DOUBLE 64 - -#define PR_BITS_PER_BYTE_LOG2 3 -#define PR_BITS_PER_SHORT_LOG2 4 -#define PR_BITS_PER_INT_LOG2 5 -#define PR_BITS_PER_INT64_LOG2 6 -#define PR_BITS_PER_LONG_LOG2 5 -#define PR_BITS_PER_FLOAT_LOG2 5 -#define PR_BITS_PER_WORD_LOG2 5 -#define PR_BITS_PER_DWORD_LOG2 6 -#define PR_BITS_PER_DOUBLE_LOG2 6 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 4 -#define PR_ALIGN_OF_LONG 4 -#define PR_ALIGN_OF_INT64 8 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_WORD 4 -#define PR_ALIGN_OF_DWORD 8 -#define PR_ALIGN_OF_DOUBLE 4 -#define PR_ALIGN_OF_POINTER 4 - -#define PR_BYTES_PER_WORD_LOG2 2 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#elif defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_) - -#define IS_LITTLE_ENDIAN 1 -#undef IS_BIG_ENDIAN -#define IS_64 - -#define PR_BYTES_PER_BYTE 1 -#define PR_BYTES_PER_SHORT 2 -#define PR_BYTES_PER_INT 4 -#define PR_BYTES_PER_INT64 8 -#define PR_BYTES_PER_LONG 4 -#define PR_BYTES_PER_FLOAT 4 -#define PR_BYTES_PER_WORD 8 -#define PR_BYTES_PER_DWORD 8 -#define PR_BYTES_PER_DOUBLE 8 - -#define PR_BITS_PER_BYTE 8 -#define PR_BITS_PER_SHORT 16 -#define PR_BITS_PER_INT 32 -#define PR_BITS_PER_INT64 64 -#define PR_BITS_PER_LONG 32 -#define PR_BITS_PER_FLOAT 32 -#define PR_BITS_PER_WORD 64 -#define PR_BITS_PER_DWORD 64 -#define PR_BITS_PER_DOUBLE 64 - -#define PR_BITS_PER_BYTE_LOG2 3 -#define PR_BITS_PER_SHORT_LOG2 4 -#define PR_BITS_PER_INT_LOG2 5 -#define PR_BITS_PER_INT64_LOG2 6 -#define PR_BITS_PER_LONG_LOG2 5 -#define PR_BITS_PER_FLOAT_LOG2 5 -#define PR_BITS_PER_WORD_LOG2 6 -#define PR_BITS_PER_DWORD_LOG2 6 -#define PR_BITS_PER_DOUBLE_LOG2 6 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 4 -#define PR_ALIGN_OF_LONG 4 -#define PR_ALIGN_OF_INT64 8 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_WORD 8 -#define PR_ALIGN_OF_DWORD 8 -#define PR_ALIGN_OF_DOUBLE 8 -#define PR_ALIGN_OF_POINTER 8 - -#define PR_BYTES_PER_WORD_LOG2 3 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#elif defined(_M_IA64) || defined(_IA64_) - -#define IS_LITTLE_ENDIAN 1 -#undef IS_BIG_ENDIAN -#define IS_64 - -#define PR_BYTES_PER_BYTE 1 -#define PR_BYTES_PER_SHORT 2 -#define PR_BYTES_PER_INT 4 -#define PR_BYTES_PER_INT64 8 -#define PR_BYTES_PER_LONG 4 -#define PR_BYTES_PER_FLOAT 4 -#define PR_BYTES_PER_WORD 8 -#define PR_BYTES_PER_DWORD 8 -#define PR_BYTES_PER_DOUBLE 8 - -#define PR_BITS_PER_BYTE 8 -#define PR_BITS_PER_SHORT 16 -#define PR_BITS_PER_INT 32 -#define PR_BITS_PER_INT64 64 -#define PR_BITS_PER_LONG 32 -#define PR_BITS_PER_FLOAT 32 -#define PR_BITS_PER_WORD 64 -#define PR_BITS_PER_DWORD 64 -#define PR_BITS_PER_DOUBLE 64 - -#define PR_BITS_PER_BYTE_LOG2 3 -#define PR_BITS_PER_SHORT_LOG2 4 -#define PR_BITS_PER_INT_LOG2 5 -#define PR_BITS_PER_INT64_LOG2 6 -#define PR_BITS_PER_LONG_LOG2 5 -#define PR_BITS_PER_FLOAT_LOG2 5 -#define PR_BITS_PER_WORD_LOG2 6 -#define PR_BITS_PER_DWORD_LOG2 6 -#define PR_BITS_PER_DOUBLE_LOG2 6 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 4 -#define PR_ALIGN_OF_LONG 4 -#define PR_ALIGN_OF_INT64 8 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_WORD 8 -#define PR_ALIGN_OF_DWORD 8 -#define PR_ALIGN_OF_DOUBLE 8 -#define PR_ALIGN_OF_POINTER 8 - -#define PR_BYTES_PER_WORD_LOG2 3 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#elif defined(_M_ARM) || defined(_ARM_) - -#define IS_LITTLE_ENDIAN 1 -#undef IS_BIG_ENDIAN - -#define PR_BYTES_PER_BYTE 1 -#define PR_BYTES_PER_SHORT 2 -#define PR_BYTES_PER_INT 4 -#define PR_BYTES_PER_INT64 8 -#define PR_BYTES_PER_LONG 4 -#define PR_BYTES_PER_FLOAT 4 -#define PR_BYTES_PER_WORD 4 -#define PR_BYTES_PER_DWORD 8 -#define PR_BYTES_PER_DOUBLE 8 - -#define PR_BITS_PER_BYTE 8 -#define PR_BITS_PER_SHORT 16 -#define PR_BITS_PER_INT 32 -#define PR_BITS_PER_INT64 64 -#define PR_BITS_PER_LONG 32 -#define PR_BITS_PER_FLOAT 32 -#define PR_BITS_PER_WORD 32 -#define PR_BITS_PER_DWORD 64 -#define PR_BITS_PER_DOUBLE 64 - -#define PR_BITS_PER_BYTE_LOG2 3 -#define PR_BITS_PER_SHORT_LOG2 4 -#define PR_BITS_PER_INT_LOG2 5 -#define PR_BITS_PER_INT64_LOG2 6 -#define PR_BITS_PER_LONG_LOG2 5 -#define PR_BITS_PER_FLOAT_LOG2 5 -#define PR_BITS_PER_WORD_LOG2 5 -#define PR_BITS_PER_DWORD_LOG2 6 -#define PR_BITS_PER_DOUBLE_LOG2 6 - -#define PR_ALIGN_OF_SHORT 2 -#define PR_ALIGN_OF_INT 4 -#define PR_ALIGN_OF_LONG 4 -#define PR_ALIGN_OF_INT64 8 -#define PR_ALIGN_OF_FLOAT 4 -#define PR_ALIGN_OF_WORD 4 -#define PR_ALIGN_OF_DWORD 8 -#define PR_ALIGN_OF_DOUBLE 8 -#define PR_ALIGN_OF_POINTER 4 - -#define PR_BYTES_PER_WORD_LOG2 2 -#define PR_BYTES_PER_DWORD_LOG2 3 - -#else /* defined(_M_IX86) || defined(_X86_) */ - -#error unknown processor architecture - -#endif /* defined(_M_IX86) || defined(_X86_) */ - -#ifndef HAVE_LONG_LONG -#define HAVE_LONG_LONG -#endif - -#ifndef NO_NSPR_10_SUPPORT - -#define BYTES_PER_BYTE PR_BYTES_PER_BYTE -#define BYTES_PER_SHORT PR_BYTES_PER_SHORT -#define BYTES_PER_INT PR_BYTES_PER_INT -#define BYTES_PER_INT64 PR_BYTES_PER_INT64 -#define BYTES_PER_LONG PR_BYTES_PER_LONG -#define BYTES_PER_FLOAT PR_BYTES_PER_FLOAT -#define BYTES_PER_DOUBLE PR_BYTES_PER_DOUBLE -#define BYTES_PER_WORD PR_BYTES_PER_WORD -#define BYTES_PER_DWORD PR_BYTES_PER_DWORD - -#define BITS_PER_BYTE PR_BITS_PER_BYTE -#define BITS_PER_SHORT PR_BITS_PER_SHORT -#define BITS_PER_INT PR_BITS_PER_INT -#define BITS_PER_INT64 PR_BITS_PER_INT64 -#define BITS_PER_LONG PR_BITS_PER_LONG -#define BITS_PER_FLOAT PR_BITS_PER_FLOAT -#define BITS_PER_DOUBLE PR_BITS_PER_DOUBLE -#define BITS_PER_WORD PR_BITS_PER_WORD - -#define BITS_PER_BYTE_LOG2 PR_BITS_PER_BYTE_LOG2 -#define BITS_PER_SHORT_LOG2 PR_BITS_PER_SHORT_LOG2 -#define BITS_PER_INT_LOG2 PR_BITS_PER_INT_LOG2 -#define BITS_PER_INT64_LOG2 PR_BITS_PER_INT64_LOG2 -#define BITS_PER_LONG_LOG2 PR_BITS_PER_LONG_LOG2 -#define BITS_PER_FLOAT_LOG2 PR_BITS_PER_FLOAT_LOG2 -#define BITS_PER_DOUBLE_LOG2 PR_BITS_PER_DOUBLE_LOG2 -#define BITS_PER_WORD_LOG2 PR_BITS_PER_WORD_LOG2 - -#define ALIGN_OF_SHORT PR_ALIGN_OF_SHORT -#define ALIGN_OF_INT PR_ALIGN_OF_INT -#define ALIGN_OF_LONG PR_ALIGN_OF_LONG -#define ALIGN_OF_INT64 PR_ALIGN_OF_INT64 -#define ALIGN_OF_FLOAT PR_ALIGN_OF_FLOAT -#define ALIGN_OF_DOUBLE PR_ALIGN_OF_DOUBLE -#define ALIGN_OF_POINTER PR_ALIGN_OF_POINTER -#define ALIGN_OF_WORD PR_ALIGN_OF_WORD - -#define BYTES_PER_WORD_LOG2 PR_BYTES_PER_WORD_LOG2 -#define BYTES_PER_DWORD_LOG2 PR_BYTES_PER_DWORD_LOG2 -#define WORDS_PER_DWORD_LOG2 PR_WORDS_PER_DWORD_LOG2 - -#endif /* NO_NSPR_10_SUPPORT */ - -#endif /* nspr_cpucfg___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/nspr.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/nspr.h deleted file mode 100755 index 0cbc71c..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/nspr.h +++ /dev/null @@ -1,43 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef nspr_h___ -#define nspr_h___ - -#include "pratom.h" -#include "prbit.h" -#include "prclist.h" -#include "prcmon.h" -#include "prcvar.h" -#include "prdtoa.h" -#include "prenv.h" -#include "prerror.h" -#include "prinet.h" -#include "prinit.h" -#include "prinrval.h" -#include "prio.h" -#include "pripcsem.h" -#include "prlink.h" -#include "prlock.h" -#include "prlog.h" -#include "prlong.h" -#include "prmem.h" -#include "prmon.h" -#include "prmwait.h" -#include "prnetdb.h" -#include "prprf.h" -#include "prproces.h" -#include "prrng.h" -#include "prrwlock.h" -#include "prshm.h" -#include "prshma.h" -#include "prsystem.h" -#include "prthread.h" -#include "prtime.h" -#include "prtpool.h" -#include "prtrace.h" -#include "prtypes.h" - -#endif /* nspr_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/pratom.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/pratom.h deleted file mode 100755 index 5846bd3..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/pratom.h +++ /dev/null @@ -1,199 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* GLOBAL FUNCTIONS: -** DESCRIPTION: -** PR Atomic operations -*/ - -#ifndef pratom_h___ -#define pratom_h___ - -#include "prtypes.h" -#include "prlock.h" - -PR_BEGIN_EXTERN_C - -/* -** FUNCTION: PR_AtomicIncrement -** DESCRIPTION: -** Atomically increment a 32 bit value. -** INPUTS: -** val: a pointer to the value to increment -** RETURN: -** the returned value is the result of the increment -*/ -NSPR_API(PRInt32) PR_AtomicIncrement(PRInt32 *val); - -/* -** FUNCTION: PR_AtomicDecrement -** DESCRIPTION: -** Atomically decrement a 32 bit value. -** INPUTS: -** val: a pointer to the value to decrement -** RETURN: -** the returned value is the result of the decrement -*/ -NSPR_API(PRInt32) PR_AtomicDecrement(PRInt32 *val); - -/* -** FUNCTION: PR_AtomicSet -** DESCRIPTION: -** Atomically set a 32 bit value. -** INPUTS: -** val: A pointer to a 32 bit value to be set -** newval: The newvalue to assign to val -** RETURN: -** Returns the prior value -*/ -NSPR_API(PRInt32) PR_AtomicSet(PRInt32 *val, PRInt32 newval); - -/* -** FUNCTION: PR_AtomicAdd -** DESCRIPTION: -** Atomically add a 32 bit value. -** INPUTS: -** ptr: a pointer to the value to increment -** val: value to be added -** RETURN: -** the returned value is the result of the addition -*/ -NSPR_API(PRInt32) PR_AtomicAdd(PRInt32 *ptr, PRInt32 val); - -/* -** MACRO: PR_ATOMIC_INCREMENT -** MACRO: PR_ATOMIC_DECREMENT -** MACRO: PR_ATOMIC_SET -** MACRO: PR_ATOMIC_ADD -** DESCRIPTION: -** Macro versions of the atomic operations. They may be implemented -** as compiler intrinsics. -** -** IMPORTANT NOTE TO NSPR MAINTAINERS: -** Implement these macros with compiler intrinsics only on platforms -** where the PR_AtomicXXX functions are truly atomic (i.e., where the -** configuration macro _PR_HAVE_ATOMIC_OPS is defined). Otherwise, -** the macros and functions won't be compatible and can't be used -** interchangeably. -*/ -#if defined(_WIN32) && !defined(_WIN32_WCE) && \ - (!defined(_MSC_VER) || (_MSC_VER >= 1310)) - -long __cdecl _InterlockedIncrement(long volatile *Addend); -long __cdecl _InterlockedDecrement(long volatile *Addend); -long __cdecl _InterlockedExchange(long volatile *Target, long Value); -long __cdecl _InterlockedExchangeAdd(long volatile *Addend, long Value); - -#ifdef _MSC_VER -#pragma intrinsic(_InterlockedIncrement) -#pragma intrinsic(_InterlockedDecrement) -#pragma intrinsic(_InterlockedExchange) -#pragma intrinsic(_InterlockedExchangeAdd) -#endif - -#define PR_ATOMIC_INCREMENT(val) _InterlockedIncrement((long volatile *)(val)) -#define PR_ATOMIC_DECREMENT(val) _InterlockedDecrement((long volatile *)(val)) -#define PR_ATOMIC_SET(val, newval) \ - _InterlockedExchange((long volatile *)(val), (long)(newval)) -#define PR_ATOMIC_ADD(ptr, val) \ - (_InterlockedExchangeAdd((long volatile *)(ptr), (long)(val)) + (val)) - -#elif ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && \ - ((defined(__APPLE__) && \ - (defined(__ppc__) || defined(__i386__) || defined(__x86_64__))) || \ - (defined(__linux__) && \ - ((defined(__i386__) && \ - defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)) || \ - defined(__ia64__) || defined(__x86_64__) || \ - (defined(__powerpc__) && !defined(__powerpc64__)) || \ - (defined(__arm__) && \ - defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)) || \ - defined(__aarch64__) || defined(__alpha)))) - -/* - * Because the GCC manual warns that some processors may support - * reduced functionality of __sync_lock_test_and_set, we test for the - * processors that we believe support a full atomic exchange operation. - */ - -#define PR_ATOMIC_INCREMENT(val) __sync_add_and_fetch(val, 1) -#define PR_ATOMIC_DECREMENT(val) __sync_sub_and_fetch(val, 1) -#define PR_ATOMIC_SET(val, newval) __sync_lock_test_and_set(val, newval) -#define PR_ATOMIC_ADD(ptr, val) __sync_add_and_fetch(ptr, val) - -#else - -#define PR_ATOMIC_INCREMENT(val) PR_AtomicIncrement(val) -#define PR_ATOMIC_DECREMENT(val) PR_AtomicDecrement(val) -#define PR_ATOMIC_SET(val, newval) PR_AtomicSet(val, newval) -#define PR_ATOMIC_ADD(ptr, val) PR_AtomicAdd(ptr, val) - -#endif - -/* -** LIFO linked-list (stack) -*/ -typedef struct PRStackElemStr PRStackElem; - -struct PRStackElemStr { - PRStackElem *prstk_elem_next; /* next pointer MUST be at offset 0; - assembly language code relies on this */ -}; - -typedef struct PRStackStr PRStack; - -/* -** FUNCTION: PR_CreateStack -** DESCRIPTION: -** Create a stack, a LIFO linked list -** INPUTS: -** stack_name: a pointer to string containing the name of the stack -** RETURN: -** A pointer to the created stack, if successful, else NULL. -*/ -NSPR_API(PRStack *) PR_CreateStack(const char *stack_name); - -/* -** FUNCTION: PR_StackPush -** DESCRIPTION: -** Push an element on the top of the stack -** INPUTS: -** stack: pointer to the stack -** stack_elem: pointer to the stack element -** RETURN: -** None -*/ -NSPR_API(void) PR_StackPush(PRStack *stack, PRStackElem *stack_elem); - -/* -** FUNCTION: PR_StackPop -** DESCRIPTION: -** Remove the element on the top of the stack -** INPUTS: -** stack: pointer to the stack -** RETURN: -** A pointer to the stack element removed from the top of the stack, -** if non-empty, -** else NULL -*/ -NSPR_API(PRStackElem *) PR_StackPop(PRStack *stack); - -/* -** FUNCTION: PR_DestroyStack -** DESCRIPTION: -** Destroy the stack -** INPUTS: -** stack: pointer to the stack -** RETURN: -** PR_SUCCESS - if successfully deleted -** PR_FAILURE - if the stack is not empty -** PR_GetError will return -** PR_INVALID_STATE_ERROR - stack is not empty -*/ -NSPR_API(PRStatus) PR_DestroyStack(PRStack *stack); - -PR_END_EXTERN_C - -#endif /* pratom_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prbit.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prbit.h deleted file mode 100755 index de83750..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prbit.h +++ /dev/null @@ -1,151 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef prbit_h___ -#define prbit_h___ - -#include "prtypes.h" -PR_BEGIN_EXTERN_C - -/* -** Replace compare/jump/add/shift sequence with compiler built-in/intrinsic -** functions. -*/ -#if defined(_WIN32) && (_MSC_VER >= 1300) && \ - (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_ARM)) - unsigned char _BitScanForward(unsigned long * Index, unsigned long Mask); - unsigned char _BitScanReverse(unsigned long * Index, unsigned long Mask); -# pragma intrinsic(_BitScanForward,_BitScanReverse) - __forceinline static int __prBitScanForward32(unsigned int val) - { - unsigned long idx; - _BitScanForward(&idx, (unsigned long)val); - return( (int)idx ); - } - __forceinline static int __prBitScanReverse32(unsigned int val) - { - unsigned long idx; - _BitScanReverse(&idx, (unsigned long)val); - return( (int)(31-idx) ); - } -# define pr_bitscan_ctz32(val) __prBitScanForward32(val) -# define pr_bitscan_clz32(val) __prBitScanReverse32(val) -# define PR_HAVE_BUILTIN_BITSCAN32 -#elif ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) && \ - (defined(__i386__) || defined(__x86_64__) || defined(__arm__)) -# define pr_bitscan_ctz32(val) __builtin_ctz(val) -# define pr_bitscan_clz32(val) __builtin_clz(val) -# define PR_HAVE_BUILTIN_BITSCAN32 -#endif /* MSVC || GCC */ - -/* -** A prbitmap_t is a long integer that can be used for bitmaps -*/ -typedef unsigned long prbitmap_t; - -#define PR_TEST_BIT(_map,_bit) \ - ((_map)[(_bit)>>PR_BITS_PER_LONG_LOG2] & (1L << ((_bit) & (PR_BITS_PER_LONG-1)))) -#define PR_SET_BIT(_map,_bit) \ - ((_map)[(_bit)>>PR_BITS_PER_LONG_LOG2] |= (1L << ((_bit) & (PR_BITS_PER_LONG-1)))) -#define PR_CLEAR_BIT(_map,_bit) \ - ((_map)[(_bit)>>PR_BITS_PER_LONG_LOG2] &= ~(1L << ((_bit) & (PR_BITS_PER_LONG-1)))) - -/* -** Compute the log of the least power of 2 greater than or equal to n -*/ -NSPR_API(PRIntn) PR_CeilingLog2(PRUint32 i); - -/* -** Compute the log of the greatest power of 2 less than or equal to n -*/ -NSPR_API(PRIntn) PR_FloorLog2(PRUint32 i); - -/* -** Macro version of PR_CeilingLog2: Compute the log of the least power of -** 2 greater than or equal to _n. The result is returned in _log2. -*/ -#ifdef PR_HAVE_BUILTIN_BITSCAN32 -#define PR_CEILING_LOG2(_log2,_n) \ - PR_BEGIN_MACRO \ - PRUint32 j_ = (PRUint32)(_n); \ - (_log2) = (j_ <= 1 ? 0 : 32 - pr_bitscan_clz32(j_ - 1)); \ - PR_END_MACRO -#else -#define PR_CEILING_LOG2(_log2,_n) \ - PR_BEGIN_MACRO \ - PRUint32 j_ = (PRUint32)(_n); \ - (_log2) = 0; \ - if ((j_) & ((j_)-1)) \ - (_log2) += 1; \ - if ((j_) >> 16) \ - (_log2) += 16, (j_) >>= 16; \ - if ((j_) >> 8) \ - (_log2) += 8, (j_) >>= 8; \ - if ((j_) >> 4) \ - (_log2) += 4, (j_) >>= 4; \ - if ((j_) >> 2) \ - (_log2) += 2, (j_) >>= 2; \ - if ((j_) >> 1) \ - (_log2) += 1; \ - PR_END_MACRO -#endif /* PR_HAVE_BUILTIN_BITSCAN32 */ - -/* -** Macro version of PR_FloorLog2: Compute the log of the greatest power of -** 2 less than or equal to _n. The result is returned in _log2. -** -** This is equivalent to finding the highest set bit in the word. -*/ -#ifdef PR_HAVE_BUILTIN_BITSCAN32 -#define PR_FLOOR_LOG2(_log2,_n) \ - PR_BEGIN_MACRO \ - PRUint32 j_ = (PRUint32)(_n); \ - (_log2) = 31 - pr_bitscan_clz32((j_) | 1); \ - PR_END_MACRO -#else -#define PR_FLOOR_LOG2(_log2,_n) \ - PR_BEGIN_MACRO \ - PRUint32 j_ = (PRUint32)(_n); \ - (_log2) = 0; \ - if ((j_) >> 16) \ - (_log2) += 16, (j_) >>= 16; \ - if ((j_) >> 8) \ - (_log2) += 8, (j_) >>= 8; \ - if ((j_) >> 4) \ - (_log2) += 4, (j_) >>= 4; \ - if ((j_) >> 2) \ - (_log2) += 2, (j_) >>= 2; \ - if ((j_) >> 1) \ - (_log2) += 1; \ - PR_END_MACRO -#endif /* PR_HAVE_BUILTIN_BITSCAN32 */ - -/* -** Macros for rotate left and right. The argument 'a' must be an unsigned -** 32-bit integer type such as PRUint32. -** -** There is no rotate operation in the C Language, so the construct -** (a << 4) | (a >> 28) is frequently used instead. Most compilers convert -** this to a rotate instruction, but MSVC doesn't without a little help. -** To get MSVC to generate a rotate instruction, we have to use the _rotl -** or _rotr intrinsic and use a pragma to make it inline. -** -** Note: MSVC in VS2005 will do an inline rotate instruction on the above -** construct. -*/ - -#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || \ - defined(_M_X64) || defined(_M_ARM)) -#include -#pragma intrinsic(_rotl, _rotr) -#define PR_ROTATE_LEFT32(a, bits) _rotl(a, bits) -#define PR_ROTATE_RIGHT32(a, bits) _rotr(a, bits) -#else -#define PR_ROTATE_LEFT32(a, bits) (((a) << (bits)) | ((a) >> (32 - (bits)))) -#define PR_ROTATE_RIGHT32(a, bits) (((a) >> (bits)) | ((a) << (32 - (bits)))) -#endif - -PR_END_EXTERN_C -#endif /* prbit_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prclist.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prclist.h deleted file mode 100755 index 2324722..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prclist.h +++ /dev/null @@ -1,108 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef prclist_h___ -#define prclist_h___ - -#include "prtypes.h" - -typedef struct PRCListStr PRCList; - -/* -** Circular linked list -*/ -struct PRCListStr { - PRCList *next; - PRCList *prev; -}; - -/* -** Insert element "_e" into the list, before "_l". -*/ -#define PR_INSERT_BEFORE(_e,_l) \ - PR_BEGIN_MACRO \ - (_e)->next = (_l); \ - (_e)->prev = (_l)->prev; \ - (_l)->prev->next = (_e); \ - (_l)->prev = (_e); \ - PR_END_MACRO - -/* -** Insert element "_e" into the list, after "_l". -*/ -#define PR_INSERT_AFTER(_e,_l) \ - PR_BEGIN_MACRO \ - (_e)->next = (_l)->next; \ - (_e)->prev = (_l); \ - (_l)->next->prev = (_e); \ - (_l)->next = (_e); \ - PR_END_MACRO - -/* -** Return the element following element "_e" -*/ -#define PR_NEXT_LINK(_e) \ - ((_e)->next) -/* -** Return the element preceding element "_e" -*/ -#define PR_PREV_LINK(_e) \ - ((_e)->prev) - -/* -** Append an element "_e" to the end of the list "_l" -*/ -#define PR_APPEND_LINK(_e,_l) PR_INSERT_BEFORE(_e,_l) - -/* -** Insert an element "_e" at the head of the list "_l" -*/ -#define PR_INSERT_LINK(_e,_l) PR_INSERT_AFTER(_e,_l) - -/* Return the head/tail of the list */ -#define PR_LIST_HEAD(_l) (_l)->next -#define PR_LIST_TAIL(_l) (_l)->prev - -/* -** Remove the element "_e" from it's circular list. -*/ -#define PR_REMOVE_LINK(_e) \ - PR_BEGIN_MACRO \ - (_e)->prev->next = (_e)->next; \ - (_e)->next->prev = (_e)->prev; \ - PR_END_MACRO - -/* -** Remove the element "_e" from it's circular list. Also initializes the -** linkage. -*/ -#define PR_REMOVE_AND_INIT_LINK(_e) \ - PR_BEGIN_MACRO \ - (_e)->prev->next = (_e)->next; \ - (_e)->next->prev = (_e)->prev; \ - (_e)->next = (_e); \ - (_e)->prev = (_e); \ - PR_END_MACRO - -/* -** Return non-zero if the given circular list "_l" is empty, zero if the -** circular list is not empty -*/ -#define PR_CLIST_IS_EMPTY(_l) \ - ((_l)->next == (_l)) - -/* -** Initialize a circular list -*/ -#define PR_INIT_CLIST(_l) \ - PR_BEGIN_MACRO \ - (_l)->next = (_l); \ - (_l)->prev = (_l); \ - PR_END_MACRO - -#define PR_INIT_STATIC_CLIST(_l) \ - {(_l), (_l)} - -#endif /* prclist_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prcmon.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prcmon.h deleted file mode 100755 index 6917113..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prcmon.h +++ /dev/null @@ -1,66 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef prcmon_h___ -#define prcmon_h___ - -/* -** Interface to cached monitors. Cached monitors use an address to find a -** given PR monitor. In this way a monitor can be associated with another -** object without preallocating a monitor for all objects. -** -** A hash table is used to quickly map addresses to individual monitors -** and the system automatically grows the hash table as needed. -** -** Cache monitors are about 5 times slower to use than uncached monitors. -*/ -#include "prmon.h" -#include "prinrval.h" - -PR_BEGIN_EXTERN_C - -/** -** Like PR_EnterMonitor except use the "address" to find a monitor in the -** monitor cache. If successful, returns the PRMonitor now associated -** with "address". Note that you must PR_CExitMonitor the address to -** release the monitor cache entry (otherwise the monitor cache will fill -** up). This call will return NULL if the monitor cache needs to be -** expanded and the system is out of memory. -*/ -NSPR_API(PRMonitor*) PR_CEnterMonitor(void *address); - -/* -** Like PR_ExitMonitor except use the "address" to find a monitor in the -** monitor cache. -*/ -NSPR_API(PRStatus) PR_CExitMonitor(void *address); - -/* -** Like PR_Wait except use the "address" to find a monitor in the -** monitor cache. -*/ -NSPR_API(PRStatus) PR_CWait(void *address, PRIntervalTime timeout); - -/* -** Like PR_Notify except use the "address" to find a monitor in the -** monitor cache. -*/ -NSPR_API(PRStatus) PR_CNotify(void *address); - -/* -** Like PR_NotifyAll except use the "address" to find a monitor in the -** monitor cache. -*/ -NSPR_API(PRStatus) PR_CNotifyAll(void *address); - -/* -** Set a callback to be invoked each time a monitor is recycled from the cache -** freelist, with the monitor's cache-key passed in address. -*/ -NSPR_API(void) PR_CSetOnMonitorRecycle(void (PR_CALLBACK *callback)(void *address)); - -PR_END_EXTERN_C - -#endif /* prcmon_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prcountr.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prcountr.h deleted file mode 100755 index 53b6176..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prcountr.h +++ /dev/null @@ -1,525 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef prcountr_h___ -#define prcountr_h___ - -/*---------------------------------------------------------------------------- -** prcountr.h -- NSPR Instrumentation counters -** -** The NSPR Counter Feature provides a means to "count -** something." Counters can be dynamically defined, incremented, -** decremented, set, and deleted under application program -** control. -** -** The Counter Feature is intended to be used as instrumentation, -** not as operational data. If you need a counter for operational -** data, use native integral types. -** -** Counters are 32bit unsigned intergers. On overflow, a counter -** will wrap. No exception is recognized or reported. -** -** A counter can be dynamically created using a two level naming -** convention. A "handle" is returned when the counter is -** created. The counter can subsequently be addressed by its -** handle. An API is provided to get an existing counter's handle -** given the names with which it was originally created. -** Similarly, a counter's name can be retrieved given its handle. -** -** The counter naming convention is a two-level hierarchy. The -** QName is the higher level of the hierarchy; RName is the -** lower level. RNames can be thought of as existing within a -** QName. The same RName can exist within multiple QNames. QNames -** are unique. The NSPR Counter is not a near-zero overhead -** feature. Application designers should be aware of -** serialization issues when using the Counter API. Creating a -** counter locks a large asset, potentially causing a stall. This -** suggest that applications should create counters at component -** initialization, for example, and not create and destroy them -** willy-nilly. ... You have been warned. -** -** Incrementing and Adding to counters uses atomic operations. -** The performance of these operations will vary from platform -** to platform. On platforms where atomic operations are not -** supported the overhead may be substantial. -** -** When traversing the counter database with FindNext functions, -** the instantaneous values of any given counter is that at the -** moment of extraction. The state of the entire counter database -** may not be viewed as atomic. -** -** The counter interface may be disabled (No-Op'd) at compile -** time. When DEBUG is defined at compile time, the Counter -** Feature is compiled into NSPR and applications invoking it. -** When DEBUG is not defined, the counter macros compile to -** nothing. To force the Counter Feature to be compiled into an -** optimized build, define FORCE_NSPR_COUNTERS at compile time -** for both NSPR and the application intending to use it. -** -** Application designers should use the macro form of the Counter -** Feature methods to minimize performance impact in optimized -** builds. The macros normally compile to nothing on optimized -** builds. -** -** Application designers should be aware of the effects of -** debug and optimized build differences when using result of the -** Counter Feature macros in expressions. -** -** The Counter Feature is thread-safe and SMP safe. -** -** /lth. 09-Jun-1998. -*/ - -#include "prtypes.h" - -PR_BEGIN_EXTERN_C - -/* -** Opaque counter handle type. -** ... don't even think of looking in here. -** -*/ -typedef void * PRCounterHandle; - -#define PRCOUNTER_NAME_MAX 31 -#define PRCOUNTER_DESC_MAX 255 - - - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_DEFINE_COUNTER() -- Define a PRCounterHandle -** -** DESCRIPTION: PR_DEFINE_COUNTER() is used to define a counter -** handle. -** -*/ -#define PR_DEFINE_COUNTER(name) PRCounterHandle name - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_INIT_COUNTER_HANDLE() -- Set the value of a PRCounterHandle -** -** DESCRIPTION: -** PR_INIT_COUNTER_HANDLE() sets the value of a PRCounterHandle -** to value. -** -*/ -#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS) -#define PR_INIT_COUNTER_HANDLE(handle,value)\ - (handle) = (PRCounterHandle)(value) -#else -#define PR_INIT_COUNTER_HANDLE(handle,value) -#endif - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_CreateCounter() -- Create a counter -** -** DESCRIPTION: PR_CreateCounter() creates a counter object and -** initializes it to zero. -** -** The macro form takes as its first argument the name of the -** PRCounterHandle to receive the handle returned from -** PR_CreateCounter(). -** -** INPUTS: -** qName: The QName for the counter object. The maximum length -** of qName is defined by PRCOUNTER_NAME_MAX -** -** rName: The RName for the counter object. The maximum length -** of qName is defined by PRCOUNTER_NAME_MAX -** -** descrioption: The description of the counter object. The -** maximum length of description is defined by -** PRCOUNTER_DESC_MAX. -** -** OUTPUTS: -** -** RETURNS: -** PRCounterHandle. -** -** RESTRICTIONS: -** -*/ -#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS) -#define PR_CREATE_COUNTER(handle,qName,rName,description)\ - (handle) = PR_CreateCounter((qName),(rName),(description)) -#else -#define PR_CREATE_COUNTER(handle,qName,rName,description) -#endif - -NSPR_API(PRCounterHandle) - PR_CreateCounter( - const char *qName, - const char *rName, - const char *description -); - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_DestroyCounter() -- Destroy a counter object. -** -** DESCRIPTION: PR_DestroyCounter() removes a counter and -** unregisters its handle from the counter database. -** -** INPUTS: -** handle: the PRCounterHandle of the counter to be destroyed. -** -** OUTPUTS: -** The counter is destroyed. -** -** RETURNS: void -** -** RESTRICTIONS: -** -*/ -#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS) -#define PR_DESTROY_COUNTER(handle) PR_DestroyCounter((handle)) -#else -#define PR_DESTROY_COUNTER(handle) -#endif - -NSPR_API(void) - PR_DestroyCounter( - PRCounterHandle handle -); - - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_GetCounterHandleFromName() -- Retreive a -** counter's handle give its name. -** -** DESCRIPTION: PR_GetCounterHandleFromName() retreives a -** counter's handle from the counter database, given the name -** the counter was originally created with. -** -** INPUTS: -** qName: Counter's original QName. -** rName: Counter's original RName. -** -** OUTPUTS: -** -** RETURNS: -** PRCounterHandle or PRCounterError. -** -** RESTRICTIONS: -** -*/ -#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS) -#define PR_GET_COUNTER_HANDLE_FROM_NAME(handle,qName,rName)\ - (handle) = PR_GetCounterHandleFromName((qName),(rName)) -#else -#define PR_GET_COUNTER_HANDLE_FROM_NAME(handle,qName,rName) -#endif - -NSPR_API(PRCounterHandle) - PR_GetCounterHandleFromName( - const char *qName, - const char *rName -); - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_GetCounterNameFromHandle() -- Retreive a -** counter's name, given its handle. -** -** DESCRIPTION: PR_GetCounterNameFromHandle() retreives a -** counter's name given its handle. -** -** INPUTS: -** qName: Where to store a pointer to qName. -** rName: Where to store a pointer to rName. -** description: Where to store a pointer to description. -** -** OUTPUTS: Pointers to the Counter Feature's copies of the names -** used when the counters were created. -** -** RETURNS: void -** -** RESTRICTIONS: -** -*/ -#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS) -#define PR_GET_COUNTER_NAME_FROM_HANDLE(handle,qName,rName,description)\ - PR_GetCounterNameFromHandle((handle),(qName),(rName),(description)) -#else -#define PR_GET_COUNTER_NAME_FROM_HANDLE(handle,qName,rName,description ) -#endif - -NSPR_API(void) - PR_GetCounterNameFromHandle( - PRCounterHandle handle, - const char **qName, - const char **rName, - const char **description -); - - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_IncrementCounter() -- Add one to the referenced -** counter. -** -** DESCRIPTION: Add one to the referenced counter. -** -** INPUTS: -** handle: The PRCounterHandle of the counter to be incremented -** -** OUTPUTS: The counter is incrementd. -** -** RETURNS: void -** -** RESTRICTIONS: -** -*/ -#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS) -#define PR_INCREMENT_COUNTER(handle) PR_IncrementCounter(handle) -#else -#define PR_INCREMENT_COUNTER(handle) -#endif - -NSPR_API(void) - PR_IncrementCounter( - PRCounterHandle handle -); - - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_DecrementCounter() -- Subtract one from the -** referenced counter -** -** DESCRIPTION: Subtract one from the referenced counter. -** -** INPUTS: -** handle: The PRCounterHandle of the coutner to be -** decremented. -** -** OUTPUTS: the counter is decremented. -** -** RETURNS: void -** -** RESTRICTIONS: -** -*/ -#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS) -#define PR_DECREMENT_COUNTER(handle) PR_DecrementCounter(handle) -#else -#define PR_DECREMENT_COUNTER(handle) -#endif - -NSPR_API(void) - PR_DecrementCounter( - PRCounterHandle handle -); - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_AddToCounter() -- Add a value to a counter. -** -** DESCRIPTION: Add value to the counter referenced by handle. -** -** INPUTS: -** handle: the PRCounterHandle of the counter to be added to. -** -** value: the value to be added to the counter. -** -** OUTPUTS: new value for counter. -** -** RETURNS: void -** -** RESTRICTIONS: -** -*/ -#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS) -#define PR_ADD_TO_COUNTER(handle,value)\ - PR_AddToCounter((handle),(value)) -#else -#define PR_ADD_TO_COUNTER(handle,value) -#endif - -NSPR_API(void) - PR_AddToCounter( - PRCounterHandle handle, - PRUint32 value -); - - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_SubtractFromCounter() -- A value is subtracted -** from a counter. -** -** DESCRIPTION: -** Subtract a value from a counter. -** -** INPUTS: -** handle: the PRCounterHandle of the counter to be subtracted -** from. -** -** value: the value to be subtracted from the counter. -** -** OUTPUTS: new value for counter -** -** RETURNS: void -** -** RESTRICTIONS: -** -*/ -#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS) -#define PR_SUBTRACT_FROM_COUNTER(handle,value)\ - PR_SubtractFromCounter((handle),(value)) -#else -#define PR_SUBTRACT_FROM_COUNTER(handle,value) -#endif - -NSPR_API(void) - PR_SubtractFromCounter( - PRCounterHandle handle, - PRUint32 value -); - - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_GetCounter() -- Retreive the value of a counter -** -** DESCRIPTION: -** Retreive the value of a counter. -** -** INPUTS: -** handle: the PR_CounterHandle of the counter to be retreived -** -** OUTPUTS: -** -** RETURNS: The value of the referenced counter -** -** RESTRICTIONS: -** -*/ -#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS) -#define PR_GET_COUNTER(counter,handle)\ - (counter) = PR_GetCounter((handle)) -#else -#define PR_GET_COUNTER(counter,handle) 0 -#endif - -NSPR_API(PRUint32) - PR_GetCounter( - PRCounterHandle handle -); - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_SetCounter() -- Replace the content of counter -** with value. -** -** DESCRIPTION: The contents of the referenced counter are -** replaced by value. -** -** INPUTS: -** handle: the PRCounterHandle of the counter whose contents -** are to be replaced. -** -** value: the new value of the counter. -** -** OUTPUTS: -** -** RETURNS: void -** -** RESTRICTIONS: -** -*/ -#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS) -#define PR_SET_COUNTER(handle,value) PR_SetCounter((handle),(value)) -#else -#define PR_SET_COUNTER(handle,value) -#endif - -NSPR_API(void) - PR_SetCounter( - PRCounterHandle handle, - PRUint32 value -); - - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_FindNextCounterQname() -- Retreive the next QName counter -** handle iterator -** -** DESCRIPTION: -** PR_FindNextCounterQname() retreives the first or next Qname -** the counter data base, depending on the value of handle. When -** handle is NULL, the function attempts to retreive the first -** QName handle in the database. When handle is a handle previosly -** retreived QName handle, then the function attempts to retreive -** the next QName handle. -** -** INPUTS: -** handle: PRCounterHandle or NULL. -** -** OUTPUTS: returned -** -** RETURNS: PRCounterHandle or NULL when no more QName counter -** handles are present. -** -** RESTRICTIONS: -** A concurrent PR_CreateCounter() or PR_DestroyCounter() may -** cause unpredictable results. -** -** A PRCounterHandle returned from this function may only be used -** in another PR_FindNextCounterQname() function call; other -** operations may cause unpredictable results. -** -*/ -#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS) -#define PR_FIND_NEXT_COUNTER_QNAME(next,handle)\ - (next) = PR_FindNextCounterQname((handle)) -#else -#define PR_FIND_NEXT_COUNTER_QNAME(next,handle) NULL -#endif - -NSPR_API(PRCounterHandle) - PR_FindNextCounterQname( - PRCounterHandle handle -); - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_FindNextCounterRname() -- Retreive the next RName counter -** handle iterator -** -** DESCRIPTION: -** PR_FindNextCounterRname() retreives the first or next RNname -** handle from the counter data base, depending on the -** value of handle. When handle is NULL, the function attempts to -** retreive the first RName handle in the database. When handle is -** a handle previosly retreived RName handle, then the function -** attempts to retreive the next RName handle. -** -** INPUTS: -** handle: PRCounterHandle or NULL. -** qhandle: PRCounterHandle of a previously aquired via -** PR_FIND_NEXT_QNAME_HANDLE() -** -** OUTPUTS: returned -** -** RETURNS: PRCounterHandle or NULL when no more RName counter -** handles are present. -** -** RESTRICTIONS: -** A concurrent PR_CreateCounter() or PR_DestroyCounter() may -** cause unpredictable results. -** -** A PRCounterHandle returned from this function may only be used -** in another PR_FindNextCounterRname() function call; other -** operations may cause unpredictable results. -** -*/ -#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS) -#define PR_FIND_NEXT_COUNTER_RNAME(next,rhandle,qhandle)\ - (next) = PR_FindNextCounterRname((rhandle),(qhandle)) -#else -#define PR_FIND_NEXT_COUNTER_RNAME(next,rhandle,qhandle) -#endif - -NSPR_API(PRCounterHandle) - PR_FindNextCounterRname( - PRCounterHandle rhandle, - PRCounterHandle qhandle -); - -PR_END_EXTERN_C - -#endif /* prcountr_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prcpucfg.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prcpucfg.h deleted file mode 100755 index c1c37cc..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prcpucfg.h +++ /dev/null @@ -1,14 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#if defined(_WIN32) -#include "md/_win95.cfg" -#elif defined(__APPLE__) -#include "md/_darwin.cfg" -#elif defined(__linux__) -#include "md/_linux.cfg" -#else -#error Add a case for your platform -#endif diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prcvar.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prcvar.h deleted file mode 100755 index 3e30ce1..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prcvar.h +++ /dev/null @@ -1,94 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef prcvar_h___ -#define prcvar_h___ - -#include "prlock.h" -#include "prinrval.h" - -PR_BEGIN_EXTERN_C - -typedef struct PRCondVar PRCondVar; - -/* -** Create a new condition variable. -** -** "lock" is the lock used to protect the condition variable. -** -** Condition variables are synchronization objects that threads can use -** to wait for some condition to occur. -** -** This may fail if memory is tight or if some operating system resource -** is low. In such cases, a NULL will be returned. -*/ -NSPR_API(PRCondVar*) PR_NewCondVar(PRLock *lock); - -/* -** Destroy a condition variable. There must be no thread -** waiting on the condvar. The caller is responsible for guaranteeing -** that the condvar is no longer in use. -** -*/ -NSPR_API(void) PR_DestroyCondVar(PRCondVar *cvar); - -/* -** The thread that waits on a condition is blocked in a "waiting on -** condition" state until another thread notifies the condition or a -** caller specified amount of time expires. The lock associated with -** the condition variable will be released, which must have be held -** prior to the call to wait. -** -** Logically a notified thread is moved from the "waiting on condition" -** state and made "ready." When scheduled, it will attempt to reacquire -** the lock that it held when wait was called. -** -** The timeout has two well known values, PR_INTERVAL_NO_TIMEOUT and -** PR_INTERVAL_NO_WAIT. The former value requires that a condition be -** notified (or the thread interrupted) before it will resume from the -** wait. If the timeout has a value of PR_INTERVAL_NO_WAIT, the effect -** is to release the lock, possibly causing a rescheduling within the -** runtime, then immediately attempting to reacquire the lock and resume. -** -** Any other value for timeout will cause the thread to be rescheduled -** either due to explicit notification or an expired interval. The latter -** must be determined by treating time as one part of the monitored data -** being protected by the lock and tested explicitly for an expired -** interval. -** -** Returns PR_FAILURE if the caller has not locked the lock associated -** with the condition variable or the thread was interrupted (PR_Interrupt()). -** The particular reason can be extracted with PR_GetError(). -*/ -NSPR_API(PRStatus) PR_WaitCondVar(PRCondVar *cvar, PRIntervalTime timeout); - -/* -** Notify ONE thread that is currently waiting on 'cvar'. Which thread is -** dependent on the implementation of the runtime. Common sense would dictate -** that all threads waiting on a single condition have identical semantics, -** therefore which one gets notified is not significant. -** -** The calling thead must hold the lock that protects the condition, as -** well as the invariants that are tightly bound to the condition, when -** notify is called. -** -** Returns PR_FAILURE if the caller has not locked the lock associated -** with the condition variable. -*/ -NSPR_API(PRStatus) PR_NotifyCondVar(PRCondVar *cvar); - -/* -** Notify all of the threads waiting on the condition variable. The order -** that the threads are notified is indeterminant. The lock that protects -** the condition must be held. -** -** Returns PR_FAILURE if the caller has not locked the lock associated -** with the condition variable. -*/ -NSPR_API(PRStatus) PR_NotifyAllCondVar(PRCondVar *cvar); - -PR_END_EXTERN_C - -#endif /* prcvar_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prdtoa.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prdtoa.h deleted file mode 100755 index 191b6c7..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prdtoa.h +++ /dev/null @@ -1,51 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef prdtoa_h___ -#define prdtoa_h___ - -#include "prtypes.h" - -PR_BEGIN_EXTERN_C - -/* -** PR_strtod() returns as a double-precision floating-point number -** the value represented by the character string pointed to by -** s00. The string is scanned up to the first unrecognized -** character. -**a -** If the value of se is not (char **)NULL, a pointer to -** the character terminating the scan is returned in the location pointed -** to by se. If no number can be formed, se is set to s00, and -** zero is returned. -*/ -NSPR_API(PRFloat64) -PR_strtod(const char *s00, char **se); - -/* -** PR_cnvtf() -** conversion routines for floating point -** prcsn - number of digits of precision to generate floating -** point value. -*/ -NSPR_API(void) PR_cnvtf(char *buf, PRIntn bufsz, PRIntn prcsn, PRFloat64 fval); - -/* -** PR_dtoa() converts double to a string. -** -** ARGUMENTS: -** If rve is not null, *rve is set to point to the end of the return value. -** If d is +-Infinity or NaN, then *decpt is set to 9999. -** -** mode: -** 0 ==> shortest string that yields d when read in -** and rounded to nearest. -*/ -NSPR_API(PRStatus) PR_dtoa(PRFloat64 d, PRIntn mode, PRIntn ndigits, - PRIntn *decpt, PRIntn *sign, char **rve, char *buf, PRSize bufsize); - -PR_END_EXTERN_C - -#endif /* prdtoa_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prenv.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prenv.h deleted file mode 100755 index 524fc75..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prenv.h +++ /dev/null @@ -1,118 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef prenv_h___ -#define prenv_h___ - -#include "prtypes.h" - -/*******************************************************************************/ -/*******************************************************************************/ -/****************** THESE FUNCTIONS MAY NOT BE THREAD SAFE *********************/ -/*******************************************************************************/ -/*******************************************************************************/ - -PR_BEGIN_EXTERN_C - -/* -** PR_GetEnv() -- Retrieve value of environment variable -** -** Description: -** PR_GetEnv() is modeled on Unix getenv(). -** -** -** Inputs: -** var -- The name of the environment variable -** -** Returns: -** The value of the environment variable 'var' or NULL if -** the variable is undefined. -** -** Restrictions: -** You'd think that a POSIX getenv(), putenv() would be -** consistently implemented everywhere. Surprise! It is not. On -** some platforms, a putenv() where the argument is of -** the form "name" causes the named environment variable to -** be un-set; that is: a subsequent getenv() returns NULL. On -** other platforms, the putenv() fails, on others, it is a -** no-op. Similarly, a putenv() where the argument is of the -** form "name=" causes the named environment variable to be -** un-set; a subsequent call to getenv() returns NULL. On -** other platforms, a subsequent call to getenv() returns a -** pointer to a null-string (a byte of zero). -** -** PR_GetEnv(), PR_SetEnv() provide a consistent behavior -** across all supported platforms. There are, however, some -** restrictions and some practices you must use to achieve -** consistent results everywhere. -** -** When manipulating the environment there is no way to un-set -** an environment variable across all platforms. We suggest -** you interpret the return of a pointer to null-string to -** mean the same as a return of NULL from PR_GetEnv(). -** -** A call to PR_SetEnv() where the parameter is of the form -** "name" will return PR_FAILURE; the environment remains -** unchanged. A call to PR_SetEnv() where the parameter is -** of the form "name=" may un-set the envrionment variable on -** some platforms; on others it may set the value of the -** environment variable to the null-string. -** -** For example, to test for NULL return or return of the -** null-string from PR_GetEnv(), use the following code -** fragment: -** -** char *val = PR_GetEnv("foo"); -** if ((NULL == val) || ('\0' == *val)) { -** ... interpret this as un-set ... -** } -** -** The caller must ensure that the string passed -** to PR_SetEnv() is persistent. That is: The string should -** not be on the stack, where it can be overwritten -** on return from the function calling PR_SetEnv(). -** Similarly, the string passed to PR_SetEnv() must not be -** overwritten by other actions of the process. ... Some -** platforms use the string by reference rather than copying -** it into the environment space. ... You have been warned! -** -** Use of platform-native functions that manipulate the -** environment (getenv(), putenv(), -** SetEnvironmentVariable(), etc.) must not be used with -** NSPR's similar functions. The platform-native functions -** may not be thread safe and/or may operate on different -** conceptual environment space than that operated upon by -** NSPR's functions or other environment manipulating -** functions on the same platform. (!) -** -*/ -NSPR_API(char*) PR_GetEnv(const char *var); - -/* -** PR_SetEnv() -- set, unset or change an environment variable -** -** Description: -** PR_SetEnv() is modeled on the Unix putenv() function. -** -** Inputs: -** string -- pointer to a caller supplied -** constant, persistent string of the form name=value. Where -** name is the name of the environment variable to be set or -** changed; value is the value assigned to the variable. -** -** Returns: -** PRStatus. -** -** Restrictions: -** See the Restrictions documented in the description of -** PR_GetEnv() in this header file. -** -** -*/ -NSPR_API(PRStatus) PR_SetEnv(const char *string); - -PR_END_EXTERN_C - -#endif /* prenv_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prerr.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prerr.h deleted file mode 100755 index 8512329..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prerr.h +++ /dev/null @@ -1,249 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef prerr_h___ -#define prerr_h___ - -/* - * - * prerr.h - * This file is automatically generated; please do not edit it. - */ - -/* Memory allocation attempt failed */ -#define PR_OUT_OF_MEMORY_ERROR (-6000L) - -/* Invalid file descriptor */ -#define PR_BAD_DESCRIPTOR_ERROR (-5999L) - -/* The operation would have blocked */ -#define PR_WOULD_BLOCK_ERROR (-5998L) - -/* Invalid memory address argument */ -#define PR_ACCESS_FAULT_ERROR (-5997L) - -/* Invalid function for file type */ -#define PR_INVALID_METHOD_ERROR (-5996L) - -/* Invalid memory address argument */ -#define PR_ILLEGAL_ACCESS_ERROR (-5995L) - -/* Some unknown error has occurred */ -#define PR_UNKNOWN_ERROR (-5994L) - -/* Operation interrupted by another thread */ -#define PR_PENDING_INTERRUPT_ERROR (-5993L) - -/* function not implemented */ -#define PR_NOT_IMPLEMENTED_ERROR (-5992L) - -/* I/O function error */ -#define PR_IO_ERROR (-5991L) - -/* I/O operation timed out */ -#define PR_IO_TIMEOUT_ERROR (-5990L) - -/* I/O operation on busy file descriptor */ -#define PR_IO_PENDING_ERROR (-5989L) - -/* The directory could not be opened */ -#define PR_DIRECTORY_OPEN_ERROR (-5988L) - -/* Invalid function argument */ -#define PR_INVALID_ARGUMENT_ERROR (-5987L) - -/* Network address not available (in use?) */ -#define PR_ADDRESS_NOT_AVAILABLE_ERROR (-5986L) - -/* Network address type not supported */ -#define PR_ADDRESS_NOT_SUPPORTED_ERROR (-5985L) - -/* Already connected */ -#define PR_IS_CONNECTED_ERROR (-5984L) - -/* Network address is invalid */ -#define PR_BAD_ADDRESS_ERROR (-5983L) - -/* Local Network address is in use */ -#define PR_ADDRESS_IN_USE_ERROR (-5982L) - -/* Connection refused by peer */ -#define PR_CONNECT_REFUSED_ERROR (-5981L) - -/* Network address is presently unreachable */ -#define PR_NETWORK_UNREACHABLE_ERROR (-5980L) - -/* Connection attempt timed out */ -#define PR_CONNECT_TIMEOUT_ERROR (-5979L) - -/* Network file descriptor is not connected */ -#define PR_NOT_CONNECTED_ERROR (-5978L) - -/* Failure to load dynamic library */ -#define PR_LOAD_LIBRARY_ERROR (-5977L) - -/* Failure to unload dynamic library */ -#define PR_UNLOAD_LIBRARY_ERROR (-5976L) - -/* Symbol not found in any of the loaded dynamic libraries */ -#define PR_FIND_SYMBOL_ERROR (-5975L) - -/* Insufficient system resources */ -#define PR_INSUFFICIENT_RESOURCES_ERROR (-5974L) - -/* A directory lookup on a network address has failed */ -#define PR_DIRECTORY_LOOKUP_ERROR (-5973L) - -/* Attempt to access a TPD key that is out of range */ -#define PR_TPD_RANGE_ERROR (-5972L) - -/* Process open FD table is full */ -#define PR_PROC_DESC_TABLE_FULL_ERROR (-5971L) - -/* System open FD table is full */ -#define PR_SYS_DESC_TABLE_FULL_ERROR (-5970L) - -/* Network operation attempted on non-network file descriptor */ -#define PR_NOT_SOCKET_ERROR (-5969L) - -/* TCP-specific function attempted on a non-TCP file descriptor */ -#define PR_NOT_TCP_SOCKET_ERROR (-5968L) - -/* TCP file descriptor is already bound */ -#define PR_SOCKET_ADDRESS_IS_BOUND_ERROR (-5967L) - -/* Access Denied */ -#define PR_NO_ACCESS_RIGHTS_ERROR (-5966L) - -/* The requested operation is not supported by the platform */ -#define PR_OPERATION_NOT_SUPPORTED_ERROR (-5965L) - -/* The host operating system does not support the protocol requested */ -#define PR_PROTOCOL_NOT_SUPPORTED_ERROR (-5964L) - -/* Access to the remote file has been severed */ -#define PR_REMOTE_FILE_ERROR (-5963L) - -/* The value requested is too large to be stored in the data buffer provided */ -#define PR_BUFFER_OVERFLOW_ERROR (-5962L) - -/* TCP connection reset by peer */ -#define PR_CONNECT_RESET_ERROR (-5961L) - -/* Unused */ -#define PR_RANGE_ERROR (-5960L) - -/* The operation would have deadlocked */ -#define PR_DEADLOCK_ERROR (-5959L) - -/* The file is already locked */ -#define PR_FILE_IS_LOCKED_ERROR (-5958L) - -/* Write would result in file larger than the system allows */ -#define PR_FILE_TOO_BIG_ERROR (-5957L) - -/* The device for storing the file is full */ -#define PR_NO_DEVICE_SPACE_ERROR (-5956L) - -/* Unused */ -#define PR_PIPE_ERROR (-5955L) - -/* Unused */ -#define PR_NO_SEEK_DEVICE_ERROR (-5954L) - -/* Cannot perform a normal file operation on a directory */ -#define PR_IS_DIRECTORY_ERROR (-5953L) - -/* Symbolic link loop */ -#define PR_LOOP_ERROR (-5952L) - -/* File name is too long */ -#define PR_NAME_TOO_LONG_ERROR (-5951L) - -/* File not found */ -#define PR_FILE_NOT_FOUND_ERROR (-5950L) - -/* Cannot perform directory operation on a normal file */ -#define PR_NOT_DIRECTORY_ERROR (-5949L) - -/* Cannot write to a read-only file system */ -#define PR_READ_ONLY_FILESYSTEM_ERROR (-5948L) - -/* Cannot delete a directory that is not empty */ -#define PR_DIRECTORY_NOT_EMPTY_ERROR (-5947L) - -/* Cannot delete or rename a file object while the file system is busy */ -#define PR_FILESYSTEM_MOUNTED_ERROR (-5946L) - -/* Cannot rename a file to a file system on another device */ -#define PR_NOT_SAME_DEVICE_ERROR (-5945L) - -/* The directory object in the file system is corrupted */ -#define PR_DIRECTORY_CORRUPTED_ERROR (-5944L) - -/* Cannot create or rename a filename that already exists */ -#define PR_FILE_EXISTS_ERROR (-5943L) - -/* Directory is full. No additional filenames may be added */ -#define PR_MAX_DIRECTORY_ENTRIES_ERROR (-5942L) - -/* The required device was in an invalid state */ -#define PR_INVALID_DEVICE_STATE_ERROR (-5941L) - -/* The device is locked */ -#define PR_DEVICE_IS_LOCKED_ERROR (-5940L) - -/* No more entries in the directory */ -#define PR_NO_MORE_FILES_ERROR (-5939L) - -/* Encountered end of file */ -#define PR_END_OF_FILE_ERROR (-5938L) - -/* Seek error */ -#define PR_FILE_SEEK_ERROR (-5937L) - -/* The file is busy */ -#define PR_FILE_IS_BUSY_ERROR (-5936L) - -/* The I/O operation was aborted */ -#define PR_OPERATION_ABORTED_ERROR (-5935L) - -/* Operation is still in progress (probably a non-blocking connect) */ -#define PR_IN_PROGRESS_ERROR (-5934L) - -/* Operation has already been initiated (probably a non-blocking connect) */ -#define PR_ALREADY_INITIATED_ERROR (-5933L) - -/* The wait group is empty */ -#define PR_GROUP_EMPTY_ERROR (-5932L) - -/* Object state improper for request */ -#define PR_INVALID_STATE_ERROR (-5931L) - -/* Network is down */ -#define PR_NETWORK_DOWN_ERROR (-5930L) - -/* Socket shutdown */ -#define PR_SOCKET_SHUTDOWN_ERROR (-5929L) - -/* Connection aborted */ -#define PR_CONNECT_ABORTED_ERROR (-5928L) - -/* Host is unreachable */ -#define PR_HOST_UNREACHABLE_ERROR (-5927L) - -/* The library is not loaded */ -#define PR_LIBRARY_NOT_LOADED_ERROR (-5926L) - -/* The one-time function was previously called and failed. Its error code is no longer available */ -#define PR_CALL_ONCE_ERROR (-5925L) - -/* Placeholder for the end of the list */ -#define PR_MAX_ERROR (-5924L) - -extern void nspr_InitializePRErrorTable(void); -#define ERROR_TABLE_BASE_nspr (-6000L) - -#endif /* prerr_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prerror.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prerror.h deleted file mode 100755 index 3d6baf6..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prerror.h +++ /dev/null @@ -1,294 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef prerror_h___ -#define prerror_h___ - -#include "prtypes.h" - -PR_BEGIN_EXTERN_C - -typedef PRInt32 PRErrorCode; - -#define PR_NSPR_ERROR_BASE -6000 - -#include "prerr.h" - -/* -** Set error will preserve an error condition within a thread context. -** The values stored are the NSPR (platform independent) translation of -** the error. Also, if available, the platform specific oserror is stored. -** If there is no appropriate OS error number, a zero my be supplied. -*/ -NSPR_API(void) PR_SetError(PRErrorCode errorCode, PRInt32 oserr); - -/* -** The text value specified may be NULL. If it is not NULL and the text length -** is zero, the string is assumed to be a null terminated C string. Otherwise -** the text is assumed to be the length specified and possibly include NULL -** characters (e.g., a multi-national string). -** -** The text will be copied into to thread structure and remain there -** until the next call to PR_SetError. -*/ -NSPR_API(void) PR_SetErrorText( - PRIntn textLength, const char *text); - -/* -** Return the current threads last set error code. -*/ -NSPR_API(PRErrorCode) PR_GetError(void); - -/* -** Return the current threads last set os error code. This is used for -** machine specific code that desires the underlying os error. -*/ -NSPR_API(PRInt32) PR_GetOSError(void); - -/* -** Get the length of the error text. If a zero is returned, then there -** is no text. Otherwise, the value returned is sufficient to contain -** the error text currently available. -*/ -NSPR_API(PRInt32) PR_GetErrorTextLength(void); - -/* -** Copy the current threads current error text. Then actual number of bytes -** copied is returned as the result. If the result is zero, the 'text' area -** is unaffected. -*/ -NSPR_API(PRInt32) PR_GetErrorText(char *text); - - -/* -Copyright (C) 1987, 1988 Student Information Processing Board of the -Massachusetts Institute of Technology. - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, provided -that the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation, and that the names of M.I.T. and the M.I.T. S.I.P.B. not be -used in advertising or publicity pertaining to distribution of the software -without specific, written prior permission. M.I.T. and the M.I.T. S.I.P.B. -make no representations about the suitability of this software for any -purpose. It is provided "as is" without express or implied warranty. -*/ - - -/* - * NOTE: - * The interfaces for error-code-translation described in the rest of - * this file are preliminary in the 3.1 release of nspr and are subject - * to change in future releases. - */ - -/* -** Description: Localizable error code to string function. -** -** -** NSPR provides a mechanism for converting an error code to a -** descriptive string, in a caller-specified language. -** -** Error codes themselves are 32 bit (signed) integers. Typically, -** the high order 24 bits are an identifier of which error table the -** error code is from, and the low order 8 bits are a sequential error -** number within the table. NSPR supports error tables whose first -** error code is not a multiple of 256, such error code assignments -** should be avoided when possible. -** -** Error table 0 is defined to match the UNIX system call error table -** (sys_errlist); this allows errno values to be used directly in the -** library. Other error table numbers are typically formed by -** compacting together the first four characters of the error table -** name. The mapping between characters in the name and numeric -** values in the error code are defined in a system-independent -** fashion, so that two systems that can pass integral values between -** them can reliably pass error codes without loss of meaning; this -** should work even if the character sets used are not the -** same. (However, if this is to be done, error table 0 should be -** avoided, since the local system call error tables may differ.) -** -** Libraries defining error codes need only provide a table mapping -** error code numbers to names and default English descriptions, -** calling a routine to install the table, making it ``known'' to NSPR -** library. Once installed, a table may not be removed. Any error -** code the library generates can be converted to the corresponding -** error message. There is also a default format for error codes -** accidentally returned before making the table known, which is of -** the form "unknown code foo 32", where "foo" would be the name of -** the table. -** -** Normally, the error code conversion routine only supports the -** languages "i-default" and "en", returning the error-table-provided -** English description for both languages. The application may -** provide a localization plugin, allowing support for additional -** languages. -** -**/ - -/**********************************************************************/ -/************************* TYPES AND CONSTANTS ************************/ -/**********************************************************************/ - -/* - * PRLanguageCode -- - * - * NSPR represents a language code as a non-negative integer. - * Languages 0 is always "i-default" the language you get without - * explicit negotiation. Language 1 is always "en", English - * which has been explicitly negotiated. Additional language - * codes are defined by an application-provided localization plugin. - */ -typedef PRUint32 PRLanguageCode; -#define PR_LANGUAGE_I_DEFAULT 0 /* i-default, the default language */ -#define PR_LANGUAGE_EN 1 /* English, explicitly negotiated */ - -/* - * struct PRErrorMessage -- - * - * An error message in an error table. - */ -struct PRErrorMessage { - const char * name; /* Macro name for error */ - const char * en_text; /* Default English text */ -}; - -/* - * struct PRErrorTable -- - * - * An error table, provided by a library. - */ -struct PRErrorTable { - const struct PRErrorMessage * msgs; /* Array of error information */ - const char *name; /* Name of error table source */ - PRErrorCode base; /* Error code for first error in table */ - int n_msgs; /* Number of codes in table */ -}; - -/* - * struct PRErrorCallbackPrivate -- - * - * A private structure for the localization plugin - */ -struct PRErrorCallbackPrivate; - -/* - * struct PRErrorCallbackTablePrivate -- - * - * A data structure under which the localization plugin may store information, - * associated with an error table, that is private to itself. - */ -struct PRErrorCallbackTablePrivate; - -/* - * PRErrorCallbackLookupFn -- - * - * A function of PRErrorCallbackLookupFn type is a localization - * plugin callback which converts an error code into a description - * in the requested language. The callback is provided the - * appropriate error table, private data for the plugin and the table. - * The callback returns the appropriate UTF-8 encoded description, or NULL - * if no description can be found. - */ -typedef const char * -PRErrorCallbackLookupFn(PRErrorCode code, PRLanguageCode language, - const struct PRErrorTable *table, - struct PRErrorCallbackPrivate *cb_private, - struct PRErrorCallbackTablePrivate *table_private); - -/* - * PRErrorCallbackNewTableFn -- - * - * A function PRErrorCallbackNewTableFn type is a localization plugin - * callback which is called once with each error table registered - * with NSPR. The callback is provided with the error table and - * the plugin's private structure. The callback returns any table private - * data it wishes to associate with the error table. Does not need to be thread - * safe. - */ -typedef struct PRErrorCallbackTablePrivate * -PRErrorCallbackNewTableFn(const struct PRErrorTable *table, - struct PRErrorCallbackPrivate *cb_private); - -/**********************************************************************/ -/****************************** FUNCTIONS *****************************/ -/**********************************************************************/ - -/*********************************************************************** -** FUNCTION: PR_ErrorToString -** DESCRIPTION: -** Returns the UTF-8 message for an error code in -** the requested language. May return the message -** in the default language if a translation in the requested -** language is not available. The returned string is -** valid for the duration of the process. Never returns NULL. -** -***********************************************************************/ -NSPR_API(const char *) PR_ErrorToString(PRErrorCode code, - PRLanguageCode language); - - -/*********************************************************************** -** FUNCTION: PR_ErrorToName -** DESCRIPTION: -** Returns the macro name for an error code, or NULL -** if the error code is not known. The returned string is -** valid for the duration of the process. -** -** Does not work for error table 0, the system error codes. -** -***********************************************************************/ -NSPR_API(const char *) PR_ErrorToName(PRErrorCode code); - - -/*********************************************************************** -** FUNCTION: PR_ErrorLanguages -** DESCRIPTION: -** Returns the RFC 1766 language tags for the language -** codes PR_ErrorToString() supports. The returned array is valid -** for the duration of the process. Never returns NULL. The first -** item in the returned array is the language tag for PRLanguageCode 0, -** the second is for PRLanguageCode 1, and so on. The array is terminated -** with a null pointer. -** -***********************************************************************/ -NSPR_API(const char * const *) PR_ErrorLanguages(void); - - -/*********************************************************************** -** FUNCTION: PR_ErrorInstallTable -** DESCRIPTION: -** Registers an error table with NSPR. Must be done exactly once per -** table. Memory pointed to by `table' must remain valid for the life -** of the process. -** -** NOT THREAD SAFE! -** -***********************************************************************/ -NSPR_API(PRErrorCode) PR_ErrorInstallTable(const struct PRErrorTable *table); - - -/*********************************************************************** -** FUNCTION: PR_ErrorInstallCallback -** DESCRIPTION: -** Registers an error localization plugin with NSPR. May be called -** at most one time. `languages' contains the language codes supported -** by this plugin. Languages 0 and 1 must be "i-default" and "en" -** respectively. `lookup' and `newtable' contain pointers to -** the plugin callback functions. `cb_private' contains any information -** private to the plugin functions. -** -** NOT THREAD SAFE! -** -***********************************************************************/ -NSPR_API(void) PR_ErrorInstallCallback(const char * const * languages, - PRErrorCallbackLookupFn *lookup, - PRErrorCallbackNewTableFn *newtable, - struct PRErrorCallbackPrivate *cb_private); - -PR_END_EXTERN_C - -#endif /* prerror_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prinet.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prinet.h deleted file mode 100755 index 15d229f..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prinet.h +++ /dev/null @@ -1,99 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * File: prinet.h - * Description: - * Header file used to find the system header files for socket support[1]. - * This file serves the following purposes: - * - A cross-platform, "get-everything" socket header file. On - * Unix, socket support is scattered in several header files, - * while Windows has a "get-everything" socket header file[2]. - * - NSPR needs the following macro definitions and function - * prototype declarations from these header files: - * AF_INET - * INADDR_ANY, INADDR_LOOPBACK, INADDR_BROADCAST - * ntohl(), ntohs(), htonl(), ntons(). - * NSPR does not define its own versions of these macros and - * functions. It simply uses the native versions, which have - * the same names on all supported platforms. - * This file is intended to be included by NSPR public header - * files, such as prio.h. One should not include this file directly. - * - * Notes: - * 1. This file should have been an internal header. Please do not - * depend on it to pull in the system header files you need. - * 2. WARNING: This file is no longer cross-platform as it is a no-op - * for WIN32! See the comment in the WIN32 section for details. - */ - -#ifndef prinet_h__ -#define prinet_h__ - -#if defined(XP_UNIX) || defined(XP_OS2) || defined(XP_BEOS) -#include -#include /* AF_INET */ -#include /* INADDR_ANY, ..., ntohl(), ... */ -#ifdef XP_OS2 -#include -#endif -#ifdef XP_UNIX -#ifdef AIX -/* - * On AIX 4.3, the header refers to struct - * ether_addr and struct sockaddr_dl that are not declared. - * The following struct declarations eliminate the compiler - * warnings. - */ -struct ether_addr; -struct sockaddr_dl; -#endif /* AIX */ -#include -#endif /* XP_UNIX */ -#include - -#if defined(FREEBSD) || defined(BSDI) || defined(QNX) -#include /* the only place that defines INADDR_LOOPBACK */ -#endif - -/* - * OS/2 hack. For some reason INADDR_LOOPBACK is not defined in the - * socket headers. - */ -#if defined(OS2) && !defined(INADDR_LOOPBACK) -#define INADDR_LOOPBACK 0x7f000001 -#endif - -/* - * Prototypes of ntohl() etc. are declared in - * on these platforms. - */ -#if defined(BSDI) || defined(OSF1) -#include -#endif - -/* On Android, ntohl() etc. are declared in . */ -#ifdef __ANDROID__ -#include -#endif - -#elif defined(WIN32) - -/* - * Do not include any system header files. - * - * Originally we were including . It slowed down the - * compilation of files that included NSPR headers, so we removed - * the inclusion at customer's request, which created - * an unfortunate inconsistency with other platforms. - */ - -#else - -#error Unknown platform - -#endif - -#endif /* prinet_h__ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prinit.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prinit.h deleted file mode 100755 index f9787fd..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prinit.h +++ /dev/null @@ -1,215 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef prinit_h___ -#define prinit_h___ - -#include "prthread.h" -#include "prtypes.h" -#include "prwin16.h" -#include - -PR_BEGIN_EXTERN_C - -/************************************************************************/ -/**************************IDENTITY AND VERSIONING***********************/ -/************************************************************************/ - -/* -** NSPR's name, this should persist until at least the turn of the -** century. -*/ -#define PR_NAME "NSPR" - -/* -** NSPR's version is used to determine the likelihood that the version you -** used to build your component is anywhere close to being compatible with -** what is in the underlying library. -** -** The format of the version string is -** ".[.] []" -*/ -#define PR_VERSION "4.10.4" -#define PR_VMAJOR 4 -#define PR_VMINOR 10 -#define PR_VPATCH 4 -#define PR_BETA PR_FALSE - -/* -** PRVersionCheck -** -** The basic signature of the function that is called to provide version -** checking. The result will be a boolean that indicates the likelihood -** that the underling library will perform as the caller expects. -** -** The only argument is a string, which should be the verson identifier -** of the library in question. That string will be compared against an -** equivalent string that represents the actual build version of the -** exporting library. -** -** The result will be the logical union of the directly called library -** and all dependent libraries. -*/ - -typedef PRBool (*PRVersionCheck)(const char*); - -/* -** PR_VersionCheck -** -** NSPR's existance proof of the version check function. -** -** Note that NSPR has no cooperating dependencies. -*/ - -NSPR_API(PRBool) PR_VersionCheck(const char *importedVersion); - -/* - * Returns a const string of the NSPR library version. - */ -NSPR_API(const char*) PR_GetVersion(void); - - -/************************************************************************/ -/*******************************INITIALIZATION***************************/ -/************************************************************************/ - -/* -** Initialize the runtime. Attach a thread object to the currently -** executing native thread of type "type". -** -** The specificaiton of 'maxPTDs' is ignored. -*/ -NSPR_API(void) PR_Init( - PRThreadType type, PRThreadPriority priority, PRUintn maxPTDs); - -/* -** And alternate form of initialization, one that may become the default if -** not the only mechanism, provides a method to get the NSPR runtime init- -** ialized and place NSPR between the caller and the runtime library. This -** allows main() to be treated as any other thread root function, signalling -** its compeletion by returning and allowing the runtime to coordinate the -** completion of the other threads of the runtime. -** -** The priority of the main (or primordial) thread will be PR_PRIORITY_NORMAL. -** The thread may adjust its own priority by using PR_SetPriority(), though -** at this time the support for priorities is somewhat weak. -** -** The specificaiton of 'maxPTDs' is ignored. -** -** The value returned by PR_Initialize is the value returned from the root -** function, 'prmain'. -*/ - -typedef PRIntn (PR_CALLBACK *PRPrimordialFn)(PRIntn argc, char **argv); - -NSPR_API(PRIntn) PR_Initialize( - PRPrimordialFn prmain, PRIntn argc, char **argv, PRUintn maxPTDs); - -/* -** Return PR_TRUE if PR_Init has already been called. -*/ -NSPR_API(PRBool) PR_Initialized(void); - -/* - * Perform a graceful shutdown of NSPR. PR_Cleanup() may be called by - * the primordial thread near the end of the main() function. - * - * PR_Cleanup() attempts to synchronize the natural termination of - * process. It does that by blocking the caller, if and only if it is - * the primordial thread, until the number of user threads has dropped - * to zero. When the primordial thread returns from main(), the process - * will immediately and silently exit. That is, it will (if necessary) - * forcibly terminate any existing threads and exit without significant - * blocking and there will be no error messages or core files. - * - * PR_Cleanup() returns PR_SUCCESS if NSPR is successfully shutdown, - * or PR_FAILURE if the calling thread of this function is not the - * primordial thread. - */ -NSPR_API(PRStatus) PR_Cleanup(void); - -/* -** Disable Interrupts -** Disables timer signals used for pre-emptive scheduling. -*/ -NSPR_API(void) PR_DisableClockInterrupts(void); - -/* -** Enables Interrupts -** Enables timer signals used for pre-emptive scheduling. -*/ -NSPR_API(void) PR_EnableClockInterrupts(void); - -/* -** Block Interrupts -** Blocks the timer signal used for pre-emptive scheduling -*/ -NSPR_API(void) PR_BlockClockInterrupts(void); - -/* -** Unblock Interrupts -** Unblocks the timer signal used for pre-emptive scheduling -*/ -NSPR_API(void) PR_UnblockClockInterrupts(void); - -/* -** Create extra virtual processor threads. Generally used with MP systems. -*/ -NSPR_API(void) PR_SetConcurrency(PRUintn numCPUs); - -/* -** Control the method and size of the file descriptor (PRFileDesc*) -** cache used by the runtime. Setting 'high' to zero is for performance, -** any other value probably for debugging (see memo on FD caching). -*/ -NSPR_API(PRStatus) PR_SetFDCacheSize(PRIntn low, PRIntn high); - -/* - * Cause an immediate, nongraceful, forced termination of the process. - * It takes a PRIntn argument, which is the exit status code of the - * process. - */ -NSPR_API(void) PR_ProcessExit(PRIntn status); - -/* -** Abort the process in a non-graceful manner. This will cause a core file, -** call to the debugger or other moral equivalent as well as causing the -** entire process to stop. -*/ -NSPR_API(void) PR_Abort(void); - -/* - **************************************************************** - * - * Module initialization: - * - **************************************************************** - */ - -typedef struct PRCallOnceType { - PRIntn initialized; - PRInt32 inProgress; - PRStatus status; -} PRCallOnceType; - -typedef PRStatus (PR_CALLBACK *PRCallOnceFN)(void); - -typedef PRStatus (PR_CALLBACK *PRCallOnceWithArgFN)(void *arg); - -NSPR_API(PRStatus) PR_CallOnce( - PRCallOnceType *once, - PRCallOnceFN func -); - -NSPR_API(PRStatus) PR_CallOnceWithArg( - PRCallOnceType *once, - PRCallOnceWithArgFN func, - void *arg -); - - -PR_END_EXTERN_C - -#endif /* prinit_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prinrval.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prinrval.h deleted file mode 100755 index 14cd39b..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prinrval.h +++ /dev/null @@ -1,146 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* -** File: prinrval.h -** Description: API to interval timing functions of NSPR. -** -** -** NSPR provides interval times that are independent of network time -** of day values. Interval times are (in theory) accurate regardless -** of host processing requirements and also very cheap to acquire. It -** is expected that getting an interval time while in a synchronized -** function (holding one's lock). -**/ - -#if !defined(prinrval_h) -#define prinrval_h - -#include "prtypes.h" - -PR_BEGIN_EXTERN_C - -/**********************************************************************/ -/************************* TYPES AND CONSTANTS ************************/ -/**********************************************************************/ - -typedef PRUint32 PRIntervalTime; - -/*********************************************************************** -** DEFINES: PR_INTERVAL_MIN -** PR_INTERVAL_MAX -** DESCRIPTION: -** These two constants define the range (in ticks / second) of the -** platform dependent type, PRIntervalTime. These constants bound both -** the period and the resolution of a PRIntervalTime. -***********************************************************************/ -#define PR_INTERVAL_MIN 1000UL -#define PR_INTERVAL_MAX 100000UL - -/*********************************************************************** -** DEFINES: PR_INTERVAL_NO_WAIT -** PR_INTERVAL_NO_TIMEOUT -** DESCRIPTION: -** Two reserved constants are defined in the PRIntervalTime namespace. -** They are used to indicate that the process should wait no time (return -** immediately) or wait forever (never time out), respectively. -** Note: PR_INTERVAL_NO_TIMEOUT passed as input to PR_Connect is -** interpreted as use the OS's connect timeout. -** -***********************************************************************/ -#define PR_INTERVAL_NO_WAIT 0UL -#define PR_INTERVAL_NO_TIMEOUT 0xffffffffUL - -/**********************************************************************/ -/****************************** FUNCTIONS *****************************/ -/**********************************************************************/ - -/*********************************************************************** -** FUNCTION: PR_IntervalNow -** DESCRIPTION: -** Return the value of NSPR's free running interval timer. That timer -** can be used to establish epochs and determine intervals (be computing -** the difference between two times). -** INPUTS: void -** OUTPUTS: void -** RETURN: PRIntervalTime -** -** SIDE EFFECTS: -** None -** RESTRICTIONS: -** The units of PRIntervalTime are platform dependent. They are chosen -** such that they are appropriate for the host OS, yet provide sufficient -** resolution and period to be useful to clients. -** MEMORY: N/A -** ALGORITHM: Platform dependent -***********************************************************************/ -NSPR_API(PRIntervalTime) PR_IntervalNow(void); - -/*********************************************************************** -** FUNCTION: PR_TicksPerSecond -** DESCRIPTION: -** Return the number of ticks per second for PR_IntervalNow's clock. -** The value will be in the range [PR_INTERVAL_MIN..PR_INTERVAL_MAX]. -** INPUTS: void -** OUTPUTS: void -** RETURN: PRUint32 -** -** SIDE EFFECTS: -** None -** RESTRICTIONS: -** None -** MEMORY: N/A -** ALGORITHM: N/A -***********************************************************************/ -NSPR_API(PRUint32) PR_TicksPerSecond(void); - -/*********************************************************************** -** FUNCTION: PR_SecondsToInterval -** PR_MillisecondsToInterval -** PR_MicrosecondsToInterval -** DESCRIPTION: -** Convert standard clock units to platform dependent intervals. -** INPUTS: PRUint32 -** OUTPUTS: void -** RETURN: PRIntervalTime -** -** SIDE EFFECTS: -** None -** RESTRICTIONS: -** Conversion may cause overflow, which is not reported. -** MEMORY: N/A -** ALGORITHM: N/A -***********************************************************************/ -NSPR_API(PRIntervalTime) PR_SecondsToInterval(PRUint32 seconds); -NSPR_API(PRIntervalTime) PR_MillisecondsToInterval(PRUint32 milli); -NSPR_API(PRIntervalTime) PR_MicrosecondsToInterval(PRUint32 micro); - -/*********************************************************************** -** FUNCTION: PR_IntervalToSeconds -** PR_IntervalToMilliseconds -** PR_IntervalToMicroseconds -** DESCRIPTION: -** Convert platform dependent intervals to standard clock units. -** INPUTS: PRIntervalTime -** OUTPUTS: void -** RETURN: PRUint32 -** -** SIDE EFFECTS: -** None -** RESTRICTIONS: -** Conversion may cause overflow, which is not reported. -** MEMORY: N/A -** ALGORITHM: N/A -***********************************************************************/ -NSPR_API(PRUint32) PR_IntervalToSeconds(PRIntervalTime ticks); -NSPR_API(PRUint32) PR_IntervalToMilliseconds(PRIntervalTime ticks); -NSPR_API(PRUint32) PR_IntervalToMicroseconds(PRIntervalTime ticks); - -PR_END_EXTERN_C - - -#endif /* !defined(prinrval_h) */ - -/* prinrval.h */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prio.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prio.h deleted file mode 100755 index 72397c8..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prio.h +++ /dev/null @@ -1,2018 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * File: prio.h - * - * Description: PR i/o related stuff, such as file system access, file - * i/o, socket i/o, etc. - */ - -#ifndef prio_h___ -#define prio_h___ - -#include "prlong.h" -#include "prtime.h" -#include "prinrval.h" -#include "prinet.h" - -PR_BEGIN_EXTERN_C - -/* Typedefs */ -typedef struct PRDir PRDir; -typedef struct PRDirEntry PRDirEntry; -#ifdef MOZ_UNICODE -typedef struct PRDirUTF16 PRDirUTF16; -typedef struct PRDirEntryUTF16 PRDirEntryUTF16; -#endif /* MOZ_UNICODE */ -typedef struct PRFileDesc PRFileDesc; -typedef struct PRFileInfo PRFileInfo; -typedef struct PRFileInfo64 PRFileInfo64; -typedef union PRNetAddr PRNetAddr; -typedef struct PRIOMethods PRIOMethods; -typedef struct PRPollDesc PRPollDesc; -typedef struct PRFilePrivate PRFilePrivate; -typedef struct PRSendFileData PRSendFileData; - -/* -*************************************************************************** -** The file descriptor. -** This is the primary structure to represent any active open socket, -** whether it be a normal file or a network connection. Such objects -** are stackable (or layerable). Each layer may have its own set of -** method pointers and context private to that layer. All each layer -** knows about its neighbors is how to get to their method table. -*************************************************************************** -*/ - -typedef PRIntn PRDescIdentity; /* see: Layering file descriptors */ - -struct PRFileDesc { - const PRIOMethods *methods; /* the I/O methods table */ - PRFilePrivate *secret; /* layer dependent data */ - PRFileDesc *lower, *higher; /* pointers to adjacent layers */ - void (PR_CALLBACK *dtor)(PRFileDesc *fd); - /* A destructor function for layer */ - PRDescIdentity identity; /* Identity of this particular layer */ -}; - -/* -*************************************************************************** -** PRTransmitFileFlags -** -** Flags for PR_TransmitFile. Pass PR_TRANSMITFILE_CLOSE_SOCKET to -** PR_TransmitFile if the connection should be closed after the file -** is transmitted. -*************************************************************************** -*/ -typedef enum PRTransmitFileFlags { - PR_TRANSMITFILE_KEEP_OPEN = 0, /* socket is left open after file - * is transmitted. */ - PR_TRANSMITFILE_CLOSE_SOCKET = 1 /* socket is closed after file - * is transmitted. */ -} PRTransmitFileFlags; - -/* -************************************************************************** -** Macros for PRNetAddr -** -** Address families: PR_AF_INET, PR_AF_INET6, PR_AF_LOCAL -** IP addresses: PR_INADDR_ANY, PR_INADDR_LOOPBACK, PR_INADDR_BROADCAST -************************************************************************** -*/ - -#ifdef WIN32 - -#define PR_AF_INET 2 -#define PR_AF_LOCAL 1 -#define PR_INADDR_ANY (unsigned long)0x00000000 -#define PR_INADDR_LOOPBACK 0x7f000001 -#define PR_INADDR_BROADCAST (unsigned long)0xffffffff - -#else /* WIN32 */ - -#define PR_AF_INET AF_INET -#define PR_AF_LOCAL AF_UNIX -#define PR_INADDR_ANY INADDR_ANY -#define PR_INADDR_LOOPBACK INADDR_LOOPBACK -#define PR_INADDR_BROADCAST INADDR_BROADCAST - -#endif /* WIN32 */ - -/* -** Define PR_AF_INET6 in prcpucfg.h with the same -** value as AF_INET6 on platforms with IPv6 support. -** Otherwise define it here. -*/ -#ifndef PR_AF_INET6 -#define PR_AF_INET6 100 -#endif - -#define PR_AF_INET_SDP 101 -#define PR_AF_INET6_SDP 102 - -#ifndef PR_AF_UNSPEC -#define PR_AF_UNSPEC 0 -#endif - -/* -************************************************************************** -** A network address -** -** Only Internet Protocol (IPv4 and IPv6) addresses are supported. -** The address family must always represent IPv4 (AF_INET, probably == 2) -** or IPv6 (AF_INET6). -************************************************************************** -*************************************************************************/ - -struct PRIPv6Addr { - union { - PRUint8 _S6_u8[16]; - PRUint16 _S6_u16[8]; - PRUint32 _S6_u32[4]; - PRUint64 _S6_u64[2]; - } _S6_un; -}; -#define pr_s6_addr _S6_un._S6_u8 -#define pr_s6_addr16 _S6_un._S6_u16 -#define pr_s6_addr32 _S6_un._S6_u32 -#define pr_s6_addr64 _S6_un._S6_u64 - -typedef struct PRIPv6Addr PRIPv6Addr; - -union PRNetAddr { - struct { - PRUint16 family; /* address family (0x00ff maskable) */ -#ifdef XP_BEOS - char data[10]; /* Be has a smaller structure */ -#else - char data[14]; /* raw address data */ -#endif - } raw; - struct { - PRUint16 family; /* address family (AF_INET) */ - PRUint16 port; /* port number */ - PRUint32 ip; /* The actual 32 bits of address */ -#ifdef XP_BEOS - char pad[4]; /* Be has a smaller structure */ -#else - char pad[8]; -#endif - } inet; - struct { - PRUint16 family; /* address family (AF_INET6) */ - PRUint16 port; /* port number */ - PRUint32 flowinfo; /* routing information */ - PRIPv6Addr ip; /* the actual 128 bits of address */ - PRUint32 scope_id; /* set of interfaces for a scope */ - } ipv6; -#if defined(XP_UNIX) || defined(XP_OS2) - struct { /* Unix domain socket address */ - PRUint16 family; /* address family (AF_UNIX) */ -#ifdef XP_OS2 - char path[108]; /* null-terminated pathname */ - /* bind fails if size is not 108. */ -#else - char path[104]; /* null-terminated pathname */ -#endif - } local; -#endif -}; - -/* -*************************************************************************** -** PRSockOption -** -** The file descriptors can have predefined options set after they file -** descriptor is created to change their behavior. Only the options in -** the following enumeration are supported. -*************************************************************************** -*/ -typedef enum PRSockOption -{ - PR_SockOpt_Nonblocking, /* nonblocking io */ - PR_SockOpt_Linger, /* linger on close if data present */ - PR_SockOpt_Reuseaddr, /* allow local address reuse */ - PR_SockOpt_Keepalive, /* keep connections alive */ - PR_SockOpt_RecvBufferSize, /* send buffer size */ - PR_SockOpt_SendBufferSize, /* receive buffer size */ - - PR_SockOpt_IpTimeToLive, /* time to live */ - PR_SockOpt_IpTypeOfService, /* type of service and precedence */ - - PR_SockOpt_AddMember, /* add an IP group membership */ - PR_SockOpt_DropMember, /* drop an IP group membership */ - PR_SockOpt_McastInterface, /* multicast interface address */ - PR_SockOpt_McastTimeToLive, /* multicast timetolive */ - PR_SockOpt_McastLoopback, /* multicast loopback */ - - PR_SockOpt_NoDelay, /* don't delay send to coalesce packets */ - PR_SockOpt_MaxSegment, /* maximum segment size */ - PR_SockOpt_Broadcast, /* enable broadcast */ - PR_SockOpt_Last -} PRSockOption; - -typedef struct PRLinger { - PRBool polarity; /* Polarity of the option's setting */ - PRIntervalTime linger; /* Time to linger before closing */ -} PRLinger; - -typedef struct PRMcastRequest { - PRNetAddr mcaddr; /* IP multicast address of group */ - PRNetAddr ifaddr; /* local IP address of interface */ -} PRMcastRequest; - -typedef struct PRSocketOptionData -{ - PRSockOption option; - union - { - PRUintn ip_ttl; /* IP time to live */ - PRUintn mcast_ttl; /* IP multicast time to live */ - PRUintn tos; /* IP type of service and precedence */ - PRBool non_blocking; /* Non-blocking (network) I/O */ - PRBool reuse_addr; /* Allow local address reuse */ - PRBool keep_alive; /* Keep connections alive */ - PRBool mcast_loopback; /* IP multicast loopback */ - PRBool no_delay; /* Don't delay send to coalesce packets */ - PRBool broadcast; /* Enable broadcast */ - PRSize max_segment; /* Maximum segment size */ - PRSize recv_buffer_size; /* Receive buffer size */ - PRSize send_buffer_size; /* Send buffer size */ - PRLinger linger; /* Time to linger on close if data present */ - PRMcastRequest add_member; /* add an IP group membership */ - PRMcastRequest drop_member; /* Drop an IP group membership */ - PRNetAddr mcast_if; /* multicast interface address */ - } value; -} PRSocketOptionData; - -/* -*************************************************************************** -** PRIOVec -** -** The I/O vector is used by the write vector method to describe the areas -** that are affected by the ouput operation. -*************************************************************************** -*/ -typedef struct PRIOVec { - char *iov_base; - int iov_len; -} PRIOVec; - -/* -*************************************************************************** -** Discover what type of socket is being described by the file descriptor. -*************************************************************************** -*/ -typedef enum PRDescType -{ - PR_DESC_FILE = 1, - PR_DESC_SOCKET_TCP = 2, - PR_DESC_SOCKET_UDP = 3, - PR_DESC_LAYERED = 4, - PR_DESC_PIPE = 5 -} PRDescType; - -typedef enum PRSeekWhence { - PR_SEEK_SET = 0, - PR_SEEK_CUR = 1, - PR_SEEK_END = 2 -} PRSeekWhence; - -NSPR_API(PRDescType) PR_GetDescType(PRFileDesc *file); - -/* -*************************************************************************** -** PRIOMethods -** -** The I/O methods table provides procedural access to the functions of -** the file descriptor. It is the responsibility of a layer implementor -** to provide suitable functions at every entry point. If a layer provides -** no functionality, it should call the next lower(higher) function of the -** same name (e.g., return fd->lower->method->close(fd->lower)); -** -** Not all functions are implemented for all types of files. In cases where -** that is true, the function will return a error indication with an error -** code of PR_INVALID_METHOD_ERROR. -*************************************************************************** -*/ - -typedef PRStatus (PR_CALLBACK *PRCloseFN)(PRFileDesc *fd); -typedef PRInt32 (PR_CALLBACK *PRReadFN)(PRFileDesc *fd, void *buf, PRInt32 amount); -typedef PRInt32 (PR_CALLBACK *PRWriteFN)(PRFileDesc *fd, const void *buf, PRInt32 amount); -typedef PRInt32 (PR_CALLBACK *PRAvailableFN)(PRFileDesc *fd); -typedef PRInt64 (PR_CALLBACK *PRAvailable64FN)(PRFileDesc *fd); -typedef PRStatus (PR_CALLBACK *PRFsyncFN)(PRFileDesc *fd); -typedef PROffset32 (PR_CALLBACK *PRSeekFN)(PRFileDesc *fd, PROffset32 offset, PRSeekWhence how); -typedef PROffset64 (PR_CALLBACK *PRSeek64FN)(PRFileDesc *fd, PROffset64 offset, PRSeekWhence how); -typedef PRStatus (PR_CALLBACK *PRFileInfoFN)(PRFileDesc *fd, PRFileInfo *info); -typedef PRStatus (PR_CALLBACK *PRFileInfo64FN)(PRFileDesc *fd, PRFileInfo64 *info); -typedef PRInt32 (PR_CALLBACK *PRWritevFN)( - PRFileDesc *fd, const PRIOVec *iov, PRInt32 iov_size, - PRIntervalTime timeout); -typedef PRStatus (PR_CALLBACK *PRConnectFN)( - PRFileDesc *fd, const PRNetAddr *addr, PRIntervalTime timeout); -typedef PRFileDesc* (PR_CALLBACK *PRAcceptFN) ( - PRFileDesc *fd, PRNetAddr *addr, PRIntervalTime timeout); -typedef PRStatus (PR_CALLBACK *PRBindFN)(PRFileDesc *fd, const PRNetAddr *addr); -typedef PRStatus (PR_CALLBACK *PRListenFN)(PRFileDesc *fd, PRIntn backlog); -typedef PRStatus (PR_CALLBACK *PRShutdownFN)(PRFileDesc *fd, PRIntn how); -typedef PRInt32 (PR_CALLBACK *PRRecvFN)( - PRFileDesc *fd, void *buf, PRInt32 amount, - PRIntn flags, PRIntervalTime timeout); -typedef PRInt32 (PR_CALLBACK *PRSendFN) ( - PRFileDesc *fd, const void *buf, PRInt32 amount, - PRIntn flags, PRIntervalTime timeout); -typedef PRInt32 (PR_CALLBACK *PRRecvfromFN)( - PRFileDesc *fd, void *buf, PRInt32 amount, - PRIntn flags, PRNetAddr *addr, PRIntervalTime timeout); -typedef PRInt32 (PR_CALLBACK *PRSendtoFN)( - PRFileDesc *fd, const void *buf, PRInt32 amount, - PRIntn flags, const PRNetAddr *addr, PRIntervalTime timeout); -typedef PRInt16 (PR_CALLBACK *PRPollFN)( - PRFileDesc *fd, PRInt16 in_flags, PRInt16 *out_flags); -typedef PRInt32 (PR_CALLBACK *PRAcceptreadFN)( - PRFileDesc *sd, PRFileDesc **nd, PRNetAddr **raddr, - void *buf, PRInt32 amount, PRIntervalTime t); -typedef PRInt32 (PR_CALLBACK *PRTransmitfileFN)( - PRFileDesc *sd, PRFileDesc *fd, const void *headers, - PRInt32 hlen, PRTransmitFileFlags flags, PRIntervalTime t); -typedef PRStatus (PR_CALLBACK *PRGetsocknameFN)(PRFileDesc *fd, PRNetAddr *addr); -typedef PRStatus (PR_CALLBACK *PRGetpeernameFN)(PRFileDesc *fd, PRNetAddr *addr); -typedef PRStatus (PR_CALLBACK *PRGetsocketoptionFN)( - PRFileDesc *fd, PRSocketOptionData *data); -typedef PRStatus (PR_CALLBACK *PRSetsocketoptionFN)( - PRFileDesc *fd, const PRSocketOptionData *data); -typedef PRInt32 (PR_CALLBACK *PRSendfileFN)( - PRFileDesc *networkSocket, PRSendFileData *sendData, - PRTransmitFileFlags flags, PRIntervalTime timeout); -typedef PRStatus (PR_CALLBACK *PRConnectcontinueFN)( - PRFileDesc *fd, PRInt16 out_flags); -typedef PRIntn (PR_CALLBACK *PRReservedFN)(PRFileDesc *fd); - -struct PRIOMethods { - PRDescType file_type; /* Type of file represented (tos) */ - PRCloseFN close; /* close file and destroy descriptor */ - PRReadFN read; /* read up to specified bytes into buffer */ - PRWriteFN write; /* write specified bytes from buffer */ - PRAvailableFN available; /* determine number of bytes available */ - PRAvailable64FN available64; /* ditto, 64 bit */ - PRFsyncFN fsync; /* flush all buffers to permanent store */ - PRSeekFN seek; /* position the file to the desired place */ - PRSeek64FN seek64; /* ditto, 64 bit */ - PRFileInfoFN fileInfo; /* Get information about an open file */ - PRFileInfo64FN fileInfo64; /* ditto, 64 bit */ - PRWritevFN writev; /* Write segments as described by iovector */ - PRConnectFN connect; /* Connect to the specified (net) address */ - PRAcceptFN accept; /* Accept a connection for a (net) peer */ - PRBindFN bind; /* Associate a (net) address with the fd */ - PRListenFN listen; /* Prepare to listen for (net) connections */ - PRShutdownFN shutdown; /* Shutdown a (net) connection */ - PRRecvFN recv; /* Solicit up the the specified bytes */ - PRSendFN send; /* Send all the bytes specified */ - PRRecvfromFN recvfrom; /* Solicit (net) bytes and report source */ - PRSendtoFN sendto; /* Send bytes to (net) address specified */ - PRPollFN poll; /* Test the fd to see if it is ready */ - PRAcceptreadFN acceptread; /* Accept and read on a new (net) fd */ - PRTransmitfileFN transmitfile; /* Transmit at entire file */ - PRGetsocknameFN getsockname; /* Get (net) address associated with fd */ - PRGetpeernameFN getpeername; /* Get peer's (net) address */ - PRReservedFN reserved_fn_6; /* reserved for future use */ - PRReservedFN reserved_fn_5; /* reserved for future use */ - PRGetsocketoptionFN getsocketoption; - /* Get current setting of specified option */ - PRSetsocketoptionFN setsocketoption; - /* Set value of specified option */ - PRSendfileFN sendfile; /* Send a (partial) file with header/trailer*/ - PRConnectcontinueFN connectcontinue; - /* Continue a nonblocking connect */ - PRReservedFN reserved_fn_3; /* reserved for future use */ - PRReservedFN reserved_fn_2; /* reserved for future use */ - PRReservedFN reserved_fn_1; /* reserved for future use */ - PRReservedFN reserved_fn_0; /* reserved for future use */ -}; - -/* - ************************************************************************** - * FUNCTION: PR_GetSpecialFD - * DESCRIPTION: Get the file descriptor that represents the standard input, - * output, or error stream. - * INPUTS: - * PRSpecialFD id - * A value indicating the type of stream desired: - * PR_StandardInput: standard input - * PR_StandardOuput: standard output - * PR_StandardError: standard error - * OUTPUTS: none - * RETURNS: PRFileDesc * - * If the argument is valid, PR_GetSpecialFD returns a file descriptor - * that represents the corresponding standard I/O stream. Otherwise, - * PR_GetSpecialFD returns NULL and sets error PR_INVALID_ARGUMENT_ERROR. - ************************************************************************** - */ - -typedef enum PRSpecialFD -{ - PR_StandardInput, /* standard input */ - PR_StandardOutput, /* standard output */ - PR_StandardError /* standard error */ -} PRSpecialFD; - -NSPR_API(PRFileDesc*) PR_GetSpecialFD(PRSpecialFD id); - -#define PR_STDIN PR_GetSpecialFD(PR_StandardInput) -#define PR_STDOUT PR_GetSpecialFD(PR_StandardOutput) -#define PR_STDERR PR_GetSpecialFD(PR_StandardError) - -/* - ************************************************************************** - * Layering file descriptors - * - * File descriptors may be layered. Each layer has it's own identity. - * Identities are allocated by the runtime and are to be associated - * (by the layer implementor) with all layers that are of that type. - * It is then possible to scan the chain of layers and find a layer - * that one recongizes and therefore predict that it will implement - * a desired protocol. - * - * There are three well-known identities: - * PR_INVALID_IO_LAYER => an invalid layer identity, for error return - * PR_TOP_IO_LAYER => the identity of the top of the stack - * PR_NSPR_IO_LAYER => the identity used by NSPR proper - * PR_TOP_IO_LAYER may be used as a shorthand for identifying the topmost - * layer of an existing stack. Ie., the following two constructs are - * equivalent. - * - * rv = PR_PushIOLayer(stack, PR_TOP_IO_LAYER, my_layer); - * rv = PR_PushIOLayer(stack, PR_GetLayersIdentity(stack), my_layer) - * - * A string may be associated with the creation of the identity. It - * will be copied by the runtime. If queried the runtime will return - * a reference to that copied string (not yet another copy). There - * is no facility for deleting an identity. - ************************************************************************** - */ - -#define PR_IO_LAYER_HEAD (PRDescIdentity)-3 -#define PR_INVALID_IO_LAYER (PRDescIdentity)-1 -#define PR_TOP_IO_LAYER (PRDescIdentity)-2 -#define PR_NSPR_IO_LAYER (PRDescIdentity)0 - -NSPR_API(PRDescIdentity) PR_GetUniqueIdentity(const char *layer_name); -NSPR_API(const char*) PR_GetNameForIdentity(PRDescIdentity ident); -NSPR_API(PRDescIdentity) PR_GetLayersIdentity(PRFileDesc* fd); -NSPR_API(PRFileDesc*) PR_GetIdentitiesLayer(PRFileDesc* fd_stack, PRDescIdentity id); - -/* - ************************************************************************** - * PR_GetDefaultIOMethods: Accessing the default methods table. - * You may get a pointer to the default methods table by calling this function. - * You may then select any elements from that table with which to build your - * layer's methods table. You may NOT modify the table directly. - ************************************************************************** - */ -NSPR_API(const PRIOMethods *) PR_GetDefaultIOMethods(void); - -/* - ************************************************************************** - * Creating a layer - * - * A new layer may be allocated by calling PR_CreateIOLayerStub(). The - * file descriptor returned will contain the pointer to the methods table - * provided. The runtime will not modify the table nor test its correctness. - ************************************************************************** - */ -NSPR_API(PRFileDesc*) PR_CreateIOLayerStub( - PRDescIdentity ident, const PRIOMethods *methods); - -/* - ************************************************************************** - * Creating a layer - * - * A new stack may be created by calling PR_CreateIOLayer(). The - * file descriptor returned will point to the top of the stack, which has - * the layer 'fd' as the topmost layer. - * - * NOTE: This function creates a new style stack, which has a fixed, dummy - * header. The old style stack, created by a call to PR_PushIOLayer, - * results in modifying contents of the top layer of the stack, when - * pushing and popping layers of the stack. - ************************************************************************** - */ -NSPR_API(PRFileDesc*) PR_CreateIOLayer(PRFileDesc* fd); - -/* - ************************************************************************** - * Pushing a layer - * - * A file descriptor (perhaps allocated using PR_CreateIOLayerStub()) may - * be pushed into an existing stack of file descriptors at any point the - * caller deems appropriate. The new layer will be inserted into the stack - * just above the layer with the indicated identity. - * - * Note: Even if the identity parameter indicates the top-most layer of - * the stack, the value of the file descriptor describing the original - * stack will not change. - ************************************************************************** - */ -NSPR_API(PRStatus) PR_PushIOLayer( - PRFileDesc *fd_stack, PRDescIdentity id, PRFileDesc *layer); - -/* - ************************************************************************** - * Popping a layer - * - * A layer may be popped from a stack by indicating the identity of the - * layer to be removed. If found, a pointer to the removed object will - * be returned to the caller. The object then becomes the responsibility - * of the caller. - * - * Note: Even if the identity indicates the top layer of the stack, the - * reference returned will not be the file descriptor for the stack and - * that file descriptor will remain valid. - ************************************************************************** - */ -NSPR_API(PRFileDesc*) PR_PopIOLayer(PRFileDesc *fd_stack, PRDescIdentity id); - -/* - ************************************************************************** - * FUNCTION: PR_Open - * DESCRIPTION: Open a file for reading, writing, or both. - * INPUTS: - * const char *name - * The path name of the file to be opened - * PRIntn flags - * The file status flags. - * It is a bitwise OR of the following bit flags (only one of - * the first three flags below may be used): - * PR_RDONLY Open for reading only. - * PR_WRONLY Open for writing only. - * PR_RDWR Open for reading and writing. - * PR_CREATE_FILE If the file does not exist, the file is created - * If the file exists, this flag has no effect. - * PR_SYNC If set, each write will wait for both the file data - * and file status to be physically updated. - * PR_APPEND The file pointer is set to the end of - * the file prior to each write. - * PR_TRUNCATE If the file exists, its length is truncated to 0. - * PR_EXCL With PR_CREATE_FILE, if the file does not exist, - * the file is created. If the file already - * exists, no action and NULL is returned - * - * PRIntn mode - * The access permission bits of the file mode, if the file is - * created when PR_CREATE_FILE is on. - * OUTPUTS: None - * RETURNS: PRFileDesc * - * If the file is successfully opened, - * returns a pointer to the PRFileDesc - * created for the newly opened file. - * Returns a NULL pointer if the open - * failed. - * SIDE EFFECTS: - * RESTRICTIONS: - * MEMORY: - * The return value, if not NULL, points to a dynamically allocated - * PRFileDesc object. - * ALGORITHM: - ************************************************************************** - */ - -/* Open flags */ -#define PR_RDONLY 0x01 -#define PR_WRONLY 0x02 -#define PR_RDWR 0x04 -#define PR_CREATE_FILE 0x08 -#define PR_APPEND 0x10 -#define PR_TRUNCATE 0x20 -#define PR_SYNC 0x40 -#define PR_EXCL 0x80 - -/* -** File modes .... -** -** CAVEAT: 'mode' is currently only applicable on UNIX platforms. -** The 'mode' argument may be ignored by PR_Open on other platforms. -** -** 00400 Read by owner. -** 00200 Write by owner. -** 00100 Execute (search if a directory) by owner. -** 00040 Read by group. -** 00020 Write by group. -** 00010 Execute by group. -** 00004 Read by others. -** 00002 Write by others -** 00001 Execute by others. -** -*/ - -NSPR_API(PRFileDesc*) PR_Open(const char *name, PRIntn flags, PRIntn mode); - -/* - ************************************************************************** - * FUNCTION: PR_OpenFile - * DESCRIPTION: - * Open a file for reading, writing, or both. - * PR_OpenFile has the same prototype as PR_Open but implements - * the specified file mode where possible. - ************************************************************************** - */ - -/* File mode bits */ -#define PR_IRWXU 00700 /* read, write, execute/search by owner */ -#define PR_IRUSR 00400 /* read permission, owner */ -#define PR_IWUSR 00200 /* write permission, owner */ -#define PR_IXUSR 00100 /* execute/search permission, owner */ -#define PR_IRWXG 00070 /* read, write, execute/search by group */ -#define PR_IRGRP 00040 /* read permission, group */ -#define PR_IWGRP 00020 /* write permission, group */ -#define PR_IXGRP 00010 /* execute/search permission, group */ -#define PR_IRWXO 00007 /* read, write, execute/search by others */ -#define PR_IROTH 00004 /* read permission, others */ -#define PR_IWOTH 00002 /* write permission, others */ -#define PR_IXOTH 00001 /* execute/search permission, others */ - -NSPR_API(PRFileDesc*) PR_OpenFile( - const char *name, PRIntn flags, PRIntn mode); - -#ifdef MOZ_UNICODE -/* - * EXPERIMENTAL: This function may be removed in a future release. - */ -NSPR_API(PRFileDesc*) PR_OpenFileUTF16( - const PRUnichar *name, PRIntn flags, PRIntn mode); -#endif /* MOZ_UNICODE */ - -/* - ************************************************************************** - * FUNCTION: PR_Close - * DESCRIPTION: - * Close a file or socket. - * INPUTS: - * PRFileDesc *fd - * a pointer to a PRFileDesc. - * OUTPUTS: - * None. - * RETURN: - * PRStatus - * SIDE EFFECTS: - * RESTRICTIONS: - * None. - * MEMORY: - * The dynamic memory pointed to by the argument fd is freed. - ************************************************************************** - */ - -NSPR_API(PRStatus) PR_Close(PRFileDesc *fd); - -/* - ************************************************************************** - * FUNCTION: PR_Read - * DESCRIPTION: - * Read bytes from a file or socket. - * The operation will block until either an end of stream indication is - * encountered, some positive number of bytes are transferred, or there - * is an error. No more than 'amount' bytes will be transferred. - * INPUTS: - * PRFileDesc *fd - * pointer to the PRFileDesc object for the file or socket - * void *buf - * pointer to a buffer to hold the data read in. - * PRInt32 amount - * the size of 'buf' (in bytes) - * OUTPUTS: - * RETURN: - * PRInt32 - * a positive number indicates the number of bytes actually read in. - * 0 means end of file is reached or the network connection is closed. - * -1 indicates a failure. The reason for the failure is obtained - * by calling PR_GetError(). - * SIDE EFFECTS: - * data is written into the buffer pointed to by 'buf'. - * RESTRICTIONS: - * None. - * MEMORY: - * N/A - * ALGORITHM: - * N/A - ************************************************************************** - */ - -NSPR_API(PRInt32) PR_Read(PRFileDesc *fd, void *buf, PRInt32 amount); - -/* - *************************************************************************** - * FUNCTION: PR_Write - * DESCRIPTION: - * Write a specified number of bytes to a file or socket. The thread - * invoking this function blocks until all the data is written. - * INPUTS: - * PRFileDesc *fd - * pointer to a PRFileDesc object that refers to a file or socket - * const void *buf - * pointer to the buffer holding the data - * PRInt32 amount - * amount of data in bytes to be written from the buffer - * OUTPUTS: - * None. - * RETURN: PRInt32 - * A positive number indicates the number of bytes successfully written. - * A -1 is an indication that the operation failed. The reason - * for the failure is obtained by calling PR_GetError(). - *************************************************************************** - */ - -NSPR_API(PRInt32) PR_Write(PRFileDesc *fd,const void *buf,PRInt32 amount); - -/* - *************************************************************************** - * FUNCTION: PR_Writev - * DESCRIPTION: - * Write data to a socket. The data is organized in a PRIOVec array. The - * operation will block until all the data is written or the operation - * fails. - * INPUTS: - * PRFileDesc *fd - * Pointer that points to a PRFileDesc object for a socket. - * const PRIOVec *iov - * An array of PRIOVec. PRIOVec is a struct with the following - * two fields: - * char *iov_base; - * int iov_len; - * PRInt32 iov_size - * Number of elements in the iov array. The value of this - * argument must not be greater than PR_MAX_IOVECTOR_SIZE. - * If it is, the method will fail (PR_BUFFER_OVERFLOW_ERROR). - * PRIntervalTime timeout - * Time limit for completion of the entire write operation. - * OUTPUTS: - * None - * RETURN: - * A positive number indicates the number of bytes successfully written. - * A -1 is an indication that the operation failed. The reason - * for the failure is obtained by calling PR_GetError(). - *************************************************************************** - */ - -#define PR_MAX_IOVECTOR_SIZE 16 /* 'iov_size' must be <= */ - -NSPR_API(PRInt32) PR_Writev( - PRFileDesc *fd, const PRIOVec *iov, PRInt32 iov_size, - PRIntervalTime timeout); - -/* - *************************************************************************** - * FUNCTION: PR_Delete - * DESCRIPTION: - * Delete a file from the filesystem. The operation may fail if the - * file is open. - * INPUTS: - * const char *name - * Path name of the file to be deleted. - * OUTPUTS: - * None. - * RETURN: PRStatus - * The function returns PR_SUCCESS if the file is successfully - * deleted, otherwise it returns PR_FAILURE. - *************************************************************************** - */ - -NSPR_API(PRStatus) PR_Delete(const char *name); - -/**************************************************************************/ - -typedef enum PRFileType -{ - PR_FILE_FILE = 1, - PR_FILE_DIRECTORY = 2, - PR_FILE_OTHER = 3 -} PRFileType; - -struct PRFileInfo { - PRFileType type; /* Type of file */ - PROffset32 size; /* Size, in bytes, of file's contents */ - PRTime creationTime; /* Creation time per definition of PRTime */ - PRTime modifyTime; /* Last modification time per definition of PRTime */ -}; - -struct PRFileInfo64 { - PRFileType type; /* Type of file */ - PROffset64 size; /* Size, in bytes, of file's contents */ - PRTime creationTime; /* Creation time per definition of PRTime */ - PRTime modifyTime; /* Last modification time per definition of PRTime */ -}; - -/**************************************************************************** - * FUNCTION: PR_GetFileInfo, PR_GetFileInfo64 - * DESCRIPTION: - * Get the information about the file with the given path name. This is - * applicable only to NSFileDesc describing 'file' types (see - * INPUTS: - * const char *fn - * path name of the file - * OUTPUTS: - * PRFileInfo *info - * Information about the given file is written into the file - * information object pointer to by 'info'. - * RETURN: PRStatus - * PR_GetFileInfo returns PR_SUCCESS if file information is successfully - * obtained, otherwise it returns PR_FAILURE. - *************************************************************************** - */ - -NSPR_API(PRStatus) PR_GetFileInfo(const char *fn, PRFileInfo *info); -NSPR_API(PRStatus) PR_GetFileInfo64(const char *fn, PRFileInfo64 *info); - -#ifdef MOZ_UNICODE -/* - * EXPERIMENTAL: This function may be removed in a future release. - */ -NSPR_API(PRStatus) PR_GetFileInfo64UTF16(const PRUnichar *fn, PRFileInfo64 *info); -#endif /* MOZ_UNICODE */ - -/* - ************************************************************************** - * FUNCTION: PR_GetOpenFileInfo, PR_GetOpenFileInfo64 - * DESCRIPTION: - * Get information about an open file referred to by the - * given PRFileDesc object. - * INPUTS: - * const PRFileDesc *fd - * A reference to a valid, open file. - * OUTPUTS: - * Same as PR_GetFileInfo, PR_GetFileInfo64 - * RETURN: PRStatus - * PR_GetFileInfo returns PR_SUCCESS if file information is successfully - * obtained, otherwise it returns PR_FAILURE. - *************************************************************************** - */ - -NSPR_API(PRStatus) PR_GetOpenFileInfo(PRFileDesc *fd, PRFileInfo *info); -NSPR_API(PRStatus) PR_GetOpenFileInfo64(PRFileDesc *fd, PRFileInfo64 *info); - -/* - ************************************************************************** - * FUNCTION: PR_Rename - * DESCRIPTION: - * Rename a file from the old name 'from' to the new name 'to'. - * INPUTS: - * const char *from - * The old name of the file to be renamed. - * const char *to - * The new name of the file. - * OUTPUTS: - * None. - * RETURN: PRStatus - ************************************************************************** - */ - -NSPR_API(PRStatus) PR_Rename(const char *from, const char *to); - -/* - ************************************************************************* - * FUNCTION: PR_Access - * DESCRIPTION: - * Determine accessibility of a file. - * INPUTS: - * const char *name - * path name of the file - * PRAccessHow how - * specifies which access permission to check for. - * It can be one of the following values: - * PR_ACCESS_READ_OK Test for read permission - * PR_ACCESS_WRITE_OK Test for write permission - * PR_ACCESS_EXISTS Check existence of file - * OUTPUTS: - * None. - * RETURN: PRStatus - * PR_SUCCESS is returned if the requested access is permitted. - * Otherwise, PR_FAILURE is returned. Additional information - * regarding the reason for the failure may be retrieved from - * PR_GetError(). - ************************************************************************* - */ - -typedef enum PRAccessHow { - PR_ACCESS_EXISTS = 1, - PR_ACCESS_WRITE_OK = 2, - PR_ACCESS_READ_OK = 3 -} PRAccessHow; - -NSPR_API(PRStatus) PR_Access(const char *name, PRAccessHow how); - -/* - ************************************************************************* - * FUNCTION: PR_Seek, PR_Seek64 - * DESCRIPTION: - * Moves read-write file offset - * INPUTS: - * PRFileDesc *fd - * Pointer to a PRFileDesc object. - * PROffset32, PROffset64 offset - * Specifies a value, in bytes, that is used in conjunction - * with the 'whence' parameter to set the file pointer. A - * negative value causes seeking in the reverse direction. - * PRSeekWhence whence - * Specifies how to interpret the 'offset' parameter in setting - * the file pointer associated with the 'fd' parameter. - * Values for the 'whence' parameter are: - * PR_SEEK_SET Sets the file pointer to the value of the - * 'offset' parameter - * PR_SEEK_CUR Sets the file pointer to its current location - * plus the value of the offset parameter. - * PR_SEEK_END Sets the file pointer to the size of the - * file plus the value of the offset parameter. - * OUTPUTS: - * None. - * RETURN: PROffset32, PROffset64 - * Upon successful completion, the resulting pointer location, - * measured in bytes from the beginning of the file, is returned. - * If the PR_Seek() function fails, the file offset remains - * unchanged, and the returned value is -1. The error code can - * then be retrieved via PR_GetError(). - ************************************************************************* - */ - -NSPR_API(PROffset32) PR_Seek(PRFileDesc *fd, PROffset32 offset, PRSeekWhence whence); -NSPR_API(PROffset64) PR_Seek64(PRFileDesc *fd, PROffset64 offset, PRSeekWhence whence); - -/* - ************************************************************************ - * FUNCTION: PR_Available - * DESCRIPTION: - * Determine the amount of data in bytes available for reading - * in the given file or socket. - * INPUTS: - * PRFileDesc *fd - * Pointer to a PRFileDesc object that refers to a file or - * socket. - * OUTPUTS: - * None - * RETURN: PRInt32, PRInt64 - * Upon successful completion, PR_Available returns the number of - * bytes beyond the current read pointer that is available for - * reading. Otherwise, it returns a -1 and the reason for the - * failure can be retrieved via PR_GetError(). - ************************************************************************ - */ - -NSPR_API(PRInt32) PR_Available(PRFileDesc *fd); -NSPR_API(PRInt64) PR_Available64(PRFileDesc *fd); - -/* - ************************************************************************ - * FUNCTION: PR_Sync - * DESCRIPTION: - * Sync any buffered data for a fd to its backing device (disk). - * INPUTS: - * PRFileDesc *fd - * Pointer to a PRFileDesc object that refers to a file or - * socket - * OUTPUTS: - * None - * RETURN: PRStatus - * PR_SUCCESS is returned if the requested access is permitted. - * Otherwise, PR_FAILURE is returned. - ************************************************************************ - */ - -NSPR_API(PRStatus) PR_Sync(PRFileDesc *fd); - -/************************************************************************/ - -struct PRDirEntry { - const char *name; /* name of entry, relative to directory name */ -}; - -#ifdef MOZ_UNICODE -struct PRDirEntryUTF16 { - const PRUnichar *name; /* name of entry in UTF16, relative to - * directory name */ -}; -#endif /* MOZ_UNICODE */ - -#if !defined(NO_NSPR_10_SUPPORT) -#define PR_DirName(dirEntry) (dirEntry->name) -#endif - -/* - ************************************************************************* - * FUNCTION: PR_OpenDir - * DESCRIPTION: - * Open the directory by the given name - * INPUTS: - * const char *name - * path name of the directory to be opened - * OUTPUTS: - * None - * RETURN: PRDir * - * If the directory is sucessfully opened, a PRDir object is - * dynamically allocated and a pointer to it is returned. - * If the directory cannot be opened, a NULL pointer is returned. - * MEMORY: - * Upon successful completion, the return value points to - * dynamically allocated memory. - ************************************************************************* - */ - -NSPR_API(PRDir*) PR_OpenDir(const char *name); - -#ifdef MOZ_UNICODE -/* - * EXPERIMENTAL: This function may be removed in a future release. - */ -NSPR_API(PRDirUTF16*) PR_OpenDirUTF16(const PRUnichar *name); -#endif /* MOZ_UNICODE */ - -/* - ************************************************************************* - * FUNCTION: PR_ReadDir - * DESCRIPTION: - * INPUTS: - * PRDir *dir - * pointer to a PRDir object that designates an open directory - * PRDirFlags flags - * PR_SKIP_NONE Do not skip any files - * PR_SKIP_DOT Skip the directory entry "." that - * represents the current directory - * PR_SKIP_DOT_DOT Skip the directory entry ".." that - * represents the parent directory. - * PR_SKIP_BOTH Skip both '.' and '..' - * PR_SKIP_HIDDEN Skip hidden files - * OUTPUTS: - * RETURN: PRDirEntry* - * Returns a pointer to the next entry in the directory. Returns - * a NULL pointer upon reaching the end of the directory or when an - * error occurs. The actual reason can be retrieved via PR_GetError(). - ************************************************************************* - */ - -typedef enum PRDirFlags { - PR_SKIP_NONE = 0x0, - PR_SKIP_DOT = 0x1, - PR_SKIP_DOT_DOT = 0x2, - PR_SKIP_BOTH = 0x3, - PR_SKIP_HIDDEN = 0x4 -} PRDirFlags; - -NSPR_API(PRDirEntry*) PR_ReadDir(PRDir *dir, PRDirFlags flags); - -#ifdef MOZ_UNICODE -/* - * EXPERIMENTAL: This function may be removed in a future release. - */ -NSPR_API(PRDirEntryUTF16*) PR_ReadDirUTF16(PRDirUTF16 *dir, PRDirFlags flags); -#endif /* MOZ_UNICODE */ - -/* - ************************************************************************* - * FUNCTION: PR_CloseDir - * DESCRIPTION: - * Close the specified directory. - * INPUTS: - * PRDir *dir - * The directory to be closed. - * OUTPUTS: - * None - * RETURN: PRStatus - * If successful, will return a status of PR_SUCCESS. Otherwise - * a value of PR_FAILURE. The reason for the failure may be re- - * trieved using PR_GetError(). - ************************************************************************* - */ - -NSPR_API(PRStatus) PR_CloseDir(PRDir *dir); - -#ifdef MOZ_UNICODE -/* - * EXPERIMENTAL: This function may be removed in a future release. - */ -NSPR_API(PRStatus) PR_CloseDirUTF16(PRDirUTF16 *dir); -#endif /* MOZ_UNICODE */ - -/* - ************************************************************************* - * FUNCTION: PR_MkDir - * DESCRIPTION: - * Create a new directory with the given name and access mode. - * INPUTS: - * const char *name - * The name of the directory to be created. All the path components - * up to but not including the leaf component must already exist. - * PRIntn mode - * See 'mode' definiton in PR_Open(). - * OUTPUTS: - * None - * RETURN: PRStatus - * If successful, will return a status of PR_SUCCESS. Otherwise - * a value of PR_FAILURE. The reason for the failure may be re- - * trieved using PR_GetError(). - ************************************************************************* - */ - -NSPR_API(PRStatus) PR_MkDir(const char *name, PRIntn mode); - -/* - ************************************************************************* - * FUNCTION: PR_MakeDir - * DESCRIPTION: - * Create a new directory with the given name and access mode. - * PR_MakeDir has the same prototype as PR_MkDir but implements - * the specified access mode where possible. - ************************************************************************* - */ - -NSPR_API(PRStatus) PR_MakeDir(const char *name, PRIntn mode); - -/* - ************************************************************************* - * FUNCTION: PR_RmDir - * DESCRIPTION: - * Remove a directory by the given name. - * INPUTS: - * const char *name - * The name of the directory to be removed. All the path components - * must already exist. Only the leaf component will be removed. - * OUTPUTS: - * None - * RETURN: PRStatus - * If successful, will return a status of PR_SUCCESS. Otherwise - * a value of PR_FAILURE. The reason for the failure may be re- - * trieved using PR_GetError(). - ************************************************************************** - */ - -NSPR_API(PRStatus) PR_RmDir(const char *name); - -/* - ************************************************************************* - * FUNCTION: PR_NewUDPSocket - * DESCRIPTION: - * Create a new UDP socket. - * INPUTS: - * None - * OUTPUTS: - * None - * RETURN: PRFileDesc* - * Upon successful completion, PR_NewUDPSocket returns a pointer - * to the PRFileDesc created for the newly opened UDP socket. - * Returns a NULL pointer if the creation of a new UDP socket failed. - * - ************************************************************************** - */ - -NSPR_API(PRFileDesc*) PR_NewUDPSocket(void); - -/* - ************************************************************************* - * FUNCTION: PR_NewTCPSocket - * DESCRIPTION: - * Create a new TCP socket. - * INPUTS: - * None - * OUTPUTS: - * None - * RETURN: PRFileDesc* - * Upon successful completion, PR_NewTCPSocket returns a pointer - * to the PRFileDesc created for the newly opened TCP socket. - * Returns a NULL pointer if the creation of a new TCP socket failed. - * - ************************************************************************** - */ - -NSPR_API(PRFileDesc*) PR_NewTCPSocket(void); - -/* - ************************************************************************* - * FUNCTION: PR_OpenUDPSocket - * DESCRIPTION: - * Create a new UDP socket of the specified address family. - * INPUTS: - * PRIntn af - * Address family - * OUTPUTS: - * None - * RETURN: PRFileDesc* - * Upon successful completion, PR_OpenUDPSocket returns a pointer - * to the PRFileDesc created for the newly opened UDP socket. - * Returns a NULL pointer if the creation of a new UDP socket failed. - * - ************************************************************************** - */ - -NSPR_API(PRFileDesc*) PR_OpenUDPSocket(PRIntn af); - -/* - ************************************************************************* - * FUNCTION: PR_OpenTCPSocket - * DESCRIPTION: - * Create a new TCP socket of the specified address family. - * INPUTS: - * PRIntn af - * Address family - * OUTPUTS: - * None - * RETURN: PRFileDesc* - * Upon successful completion, PR_NewTCPSocket returns a pointer - * to the PRFileDesc created for the newly opened TCP socket. - * Returns a NULL pointer if the creation of a new TCP socket failed. - * - ************************************************************************** - */ - -NSPR_API(PRFileDesc*) PR_OpenTCPSocket(PRIntn af); - -/* - ************************************************************************* - * FUNCTION: PR_Connect - * DESCRIPTION: - * Initiate a connection on a socket. - * INPUTS: - * PRFileDesc *fd - * Points to a PRFileDesc object representing a socket - * PRNetAddr *addr - * Specifies the address of the socket in its own communication - * space. - * PRIntervalTime timeout - * The function uses the lesser of the provided timeout and - * the OS's connect timeout. In particular, if you specify - * PR_INTERVAL_NO_TIMEOUT as the timeout, the OS's connection - * time limit will be used. - * - * OUTPUTS: - * None - * RETURN: PRStatus - * Upon successful completion of connection initiation, PR_Connect - * returns PR_SUCCESS. Otherwise, it returns PR_FAILURE. Further - * failure information can be obtained by calling PR_GetError(). - ************************************************************************** - */ - -NSPR_API(PRStatus) PR_Connect( - PRFileDesc *fd, const PRNetAddr *addr, PRIntervalTime timeout); - -/* - ************************************************************************* - * FUNCTION: PR_ConnectContinue - * DESCRIPTION: - * Continue a nonblocking connect. After a nonblocking connect - * is initiated with PR_Connect() (which fails with - * PR_IN_PROGRESS_ERROR), one should call PR_Poll() on the socket, - * with the in_flags PR_POLL_WRITE | PR_POLL_EXCEPT. When - * PR_Poll() returns, one calls PR_ConnectContinue() on the - * socket to determine whether the nonblocking connect has - * completed or is still in progress. Repeat the PR_Poll(), - * PR_ConnectContinue() sequence until the nonblocking connect - * has completed. - * INPUTS: - * PRFileDesc *fd - * the file descriptor representing a socket - * PRInt16 out_flags - * the out_flags field of the poll descriptor returned by - * PR_Poll() - * RETURN: PRStatus - * If the nonblocking connect has successfully completed, - * PR_ConnectContinue returns PR_SUCCESS. If PR_ConnectContinue() - * returns PR_FAILURE, call PR_GetError(): - * - PR_IN_PROGRESS_ERROR: the nonblocking connect is still in - * progress and has not completed yet. The caller should poll - * on the file descriptor for the in_flags - * PR_POLL_WRITE|PR_POLL_EXCEPT and retry PR_ConnectContinue - * later when PR_Poll() returns. - * - Other errors: the nonblocking connect has failed with this - * error code. - */ - -NSPR_API(PRStatus) PR_ConnectContinue(PRFileDesc *fd, PRInt16 out_flags); - -/* - ************************************************************************* - * THIS FUNCTION IS DEPRECATED. USE PR_ConnectContinue INSTEAD. - * - * FUNCTION: PR_GetConnectStatus - * DESCRIPTION: - * Get the completion status of a nonblocking connect. After - * a nonblocking connect is initiated with PR_Connect() (which - * fails with PR_IN_PROGRESS_ERROR), one should call PR_Poll() - * on the socket, with the in_flags PR_POLL_WRITE | PR_POLL_EXCEPT. - * When PR_Poll() returns, one calls PR_GetConnectStatus on the - * PRPollDesc structure to determine whether the nonblocking - * connect has succeeded or failed. - * INPUTS: - * const PRPollDesc *pd - * Pointer to a PRPollDesc whose fd member is the socket, - * and in_flags must contain PR_POLL_WRITE and PR_POLL_EXCEPT. - * PR_Poll() should have been called and set the out_flags. - * RETURN: PRStatus - * If the nonblocking connect has successfully completed, - * PR_GetConnectStatus returns PR_SUCCESS. If PR_GetConnectStatus() - * returns PR_FAILURE, call PR_GetError(): - * - PR_IN_PROGRESS_ERROR: the nonblocking connect is still in - * progress and has not completed yet. - * - Other errors: the nonblocking connect has failed with this - * error code. - */ - -NSPR_API(PRStatus) PR_GetConnectStatus(const PRPollDesc *pd); - -/* - ************************************************************************* - * FUNCTION: PR_Accept - * DESCRIPTION: - * Accept a connection on a socket. - * INPUTS: - * PRFileDesc *fd - * Points to a PRFileDesc object representing the rendezvous socket - * on which the caller is willing to accept new connections. - * PRIntervalTime timeout - * Time limit for completion of the accept operation. - * OUTPUTS: - * PRNetAddr *addr - * Returns the address of the connecting entity in its own - * communication space. It may be NULL. - * RETURN: PRFileDesc* - * Upon successful acceptance of a connection, PR_Accept - * returns a valid file descriptor. Otherwise, it returns NULL. - * Further failure information can be obtained by calling PR_GetError(). - ************************************************************************** - */ - -NSPR_API(PRFileDesc*) PR_Accept( - PRFileDesc *fd, PRNetAddr *addr, PRIntervalTime timeout); - -/* - ************************************************************************* - * FUNCTION: PR_Bind - * DESCRIPTION: - * Bind an address to a socket. - * INPUTS: - * PRFileDesc *fd - * Points to a PRFileDesc object representing a socket. - * PRNetAddr *addr - * Specifies the address to which the socket will be bound. - * OUTPUTS: - * None - * RETURN: PRStatus - * Upon successful binding of an address to a socket, PR_Bind - * returns PR_SUCCESS. Otherwise, it returns PR_FAILURE. Further - * failure information can be obtained by calling PR_GetError(). - ************************************************************************** - */ - -NSPR_API(PRStatus) PR_Bind(PRFileDesc *fd, const PRNetAddr *addr); - -/* - ************************************************************************* - * FUNCTION: PR_Listen - * DESCRIPTION: - * Listen for connections on a socket. - * INPUTS: - * PRFileDesc *fd - * Points to a PRFileDesc object representing a socket that will be - * used to listen for new connections. - * PRIntn backlog - * Specifies the maximum length of the queue of pending connections. - * OUTPUTS: - * None - * RETURN: PRStatus - * Upon successful completion of listen request, PR_Listen - * returns PR_SUCCESS. Otherwise, it returns PR_FAILURE. Further - * failure information can be obtained by calling PR_GetError(). - ************************************************************************** - */ - -NSPR_API(PRStatus) PR_Listen(PRFileDesc *fd, PRIntn backlog); - -/* - ************************************************************************* - * FUNCTION: PR_Shutdown - * DESCRIPTION: - * Shut down part of a full-duplex connection on a socket. - * INPUTS: - * PRFileDesc *fd - * Points to a PRFileDesc object representing a connected socket. - * PRIntn how - * Specifies the kind of disallowed operations on the socket. - * PR_SHUTDOWN_RCV - Further receives will be disallowed - * PR_SHUTDOWN_SEND - Further sends will be disallowed - * PR_SHUTDOWN_BOTH - Further sends and receives will be disallowed - * OUTPUTS: - * None - * RETURN: PRStatus - * Upon successful completion of shutdown request, PR_Shutdown - * returns PR_SUCCESS. Otherwise, it returns PR_FAILURE. Further - * failure information can be obtained by calling PR_GetError(). - ************************************************************************** - */ - -typedef enum PRShutdownHow -{ - PR_SHUTDOWN_RCV = 0, /* disallow further receives */ - PR_SHUTDOWN_SEND = 1, /* disallow further sends */ - PR_SHUTDOWN_BOTH = 2 /* disallow further receives and sends */ -} PRShutdownHow; - -NSPR_API(PRStatus) PR_Shutdown(PRFileDesc *fd, PRShutdownHow how); - -/* - ************************************************************************* - * FUNCTION: PR_Recv - * DESCRIPTION: - * Receive a specified number of bytes from a connected socket. - * The operation will block until some positive number of bytes are - * transferred, a time out has occurred, or there is an error. - * No more than 'amount' bytes will be transferred. - * INPUTS: - * PRFileDesc *fd - * points to a PRFileDesc object representing a socket. - * void *buf - * pointer to a buffer to hold the data received. - * PRInt32 amount - * the size of 'buf' (in bytes) - * PRIntn flags - * must be zero or PR_MSG_PEEK. - * PRIntervalTime timeout - * Time limit for completion of the receive operation. - * OUTPUTS: - * None - * RETURN: PRInt32 - * a positive number indicates the number of bytes actually received. - * 0 means the network connection is closed. - * -1 indicates a failure. The reason for the failure is obtained - * by calling PR_GetError(). - ************************************************************************** - */ - -#define PR_MSG_PEEK 0x2 - -NSPR_API(PRInt32) PR_Recv(PRFileDesc *fd, void *buf, PRInt32 amount, - PRIntn flags, PRIntervalTime timeout); - -/* - ************************************************************************* - * FUNCTION: PR_Send - * DESCRIPTION: - * Send a specified number of bytes from a connected socket. - * The operation will block until all bytes are - * processed, a time out has occurred, or there is an error. - * INPUTS: - * PRFileDesc *fd - * points to a PRFileDesc object representing a socket. - * void *buf - * pointer to a buffer from where the data is sent. - * PRInt32 amount - * the size of 'buf' (in bytes) - * PRIntn flags - * (OBSOLETE - must always be zero) - * PRIntervalTime timeout - * Time limit for completion of the send operation. - * OUTPUTS: - * None - * RETURN: PRInt32 - * A positive number indicates the number of bytes successfully processed. - * This number must always equal 'amount'. A -1 is an indication that the - * operation failed. The reason for the failure is obtained by calling - * PR_GetError(). - ************************************************************************** - */ - -NSPR_API(PRInt32) PR_Send(PRFileDesc *fd, const void *buf, PRInt32 amount, - PRIntn flags, PRIntervalTime timeout); - -/* - ************************************************************************* - * FUNCTION: PR_RecvFrom - * DESCRIPTION: - * Receive up to a specified number of bytes from socket which may - * or may not be connected. - * The operation will block until one or more bytes are - * transferred, a time out has occurred, or there is an error. - * No more than 'amount' bytes will be transferred. - * INPUTS: - * PRFileDesc *fd - * points to a PRFileDesc object representing a socket. - * void *buf - * pointer to a buffer to hold the data received. - * PRInt32 amount - * the size of 'buf' (in bytes) - * PRIntn flags - * (OBSOLETE - must always be zero) - * PRNetAddr *addr - * Specifies the address of the sending peer. It may be NULL. - * PRIntervalTime timeout - * Time limit for completion of the receive operation. - * OUTPUTS: - * None - * RETURN: PRInt32 - * a positive number indicates the number of bytes actually received. - * 0 means the network connection is closed. - * -1 indicates a failure. The reason for the failure is obtained - * by calling PR_GetError(). - ************************************************************************** - */ - -NSPR_API(PRInt32) PR_RecvFrom( - PRFileDesc *fd, void *buf, PRInt32 amount, PRIntn flags, - PRNetAddr *addr, PRIntervalTime timeout); - -/* - ************************************************************************* - * FUNCTION: PR_SendTo - * DESCRIPTION: - * Send a specified number of bytes from an unconnected socket. - * The operation will block until all bytes are - * sent, a time out has occurred, or there is an error. - * INPUTS: - * PRFileDesc *fd - * points to a PRFileDesc object representing an unconnected socket. - * void *buf - * pointer to a buffer from where the data is sent. - * PRInt32 amount - * the size of 'buf' (in bytes) - * PRIntn flags - * (OBSOLETE - must always be zero) - * PRNetAddr *addr - * Specifies the address of the peer. -.* PRIntervalTime timeout - * Time limit for completion of the send operation. - * OUTPUTS: - * None - * RETURN: PRInt32 - * A positive number indicates the number of bytes successfully sent. - * -1 indicates a failure. The reason for the failure is obtained - * by calling PR_GetError(). - ************************************************************************** - */ - -NSPR_API(PRInt32) PR_SendTo( - PRFileDesc *fd, const void *buf, PRInt32 amount, PRIntn flags, - const PRNetAddr *addr, PRIntervalTime timeout); - -/* -************************************************************************* -** FUNCTION: PR_TransmitFile -** DESCRIPTION: -** Transmitfile sends a complete file (sourceFile) across a socket -** (networkSocket). If headers is non-NULL, the headers will be sent across -** the socket prior to sending the file. -** -** Optionally, the PR_TRANSMITFILE_CLOSE_SOCKET flag may be passed to -** transmitfile. This flag specifies that transmitfile should close the -** socket after sending the data. -** -** INPUTS: -** PRFileDesc *networkSocket -** The socket to send data over -** PRFileDesc *sourceFile -** The file to send -** const void *headers -** A pointer to headers to be sent before sending data -** PRInt32 hlen -** length of header buffers in bytes. -** PRTransmitFileFlags flags -** If the flags indicate that the connection should be closed, -** it will be done immediately after transferring the file, unless -** the operation is unsuccessful. -.* PRIntervalTime timeout - * Time limit for completion of the transmit operation. -** -** RETURNS: -** Returns the number of bytes written or -1 if the operation failed. -** If an error occurs while sending the file, the PR_TRANSMITFILE_CLOSE_ -** SOCKET flag is ignored. The reason for the failure is obtained -** by calling PR_GetError(). -************************************************************************** -*/ - -NSPR_API(PRInt32) PR_TransmitFile( - PRFileDesc *networkSocket, PRFileDesc *sourceFile, - const void *headers, PRInt32 hlen, PRTransmitFileFlags flags, - PRIntervalTime timeout); - -/* -************************************************************************* -** FUNCTION: PR_SendFile -** DESCRIPTION: -** PR_SendFile sends data from a file (sendData->fd) across a socket -** (networkSocket). If specified, a header and/or trailer buffer are sent -** before and after the file, respectively. The file offset, number of bytes -** of file data to send, the header and trailer buffers are specified in the -** sendData argument. -** -** Optionally, if the PR_TRANSMITFILE_CLOSE_SOCKET flag is passed, the -** socket is closed after successfully sending the data. -** -** INPUTS: -** PRFileDesc *networkSocket -** The socket to send data over -** PRSendFileData *sendData -** Contains the FD, file offset and length, header and trailer -** buffer specifications. -** PRTransmitFileFlags flags -** If the flags indicate that the connection should be closed, -** it will be done immediately after transferring the file, unless -** the operation is unsuccessful. -.* PRIntervalTime timeout - * Time limit for completion of the send operation. -** -** RETURNS: -** Returns the number of bytes written or -1 if the operation failed. -** If an error occurs while sending the file, the PR_TRANSMITFILE_CLOSE_ -** SOCKET flag is ignored. The reason for the failure is obtained -** by calling PR_GetError(). -************************************************************************** -*/ - -struct PRSendFileData { - PRFileDesc *fd; /* file to send */ - PRUint32 file_offset; /* file offset */ - PRSize file_nbytes; /* number of bytes of file data to send */ - /* if 0, send data from file_offset to */ - /* end-of-file. */ - const void *header; /* header buffer */ - PRInt32 hlen; /* header len */ - const void *trailer; /* trailer buffer */ - PRInt32 tlen; /* trailer len */ -}; - - -NSPR_API(PRInt32) PR_SendFile( - PRFileDesc *networkSocket, PRSendFileData *sendData, - PRTransmitFileFlags flags, PRIntervalTime timeout); - -/* -************************************************************************* -** FUNCTION: PR_AcceptRead -** DESCRIPTION: -** AcceptRead accepts a new connection, returns the newly created -** socket's descriptor and also returns the connecting peer's address. -** AcceptRead, as its name suggests, also receives the first block of data -** sent by the peer. -** -** INPUTS: -** PRFileDesc *listenSock -** A socket descriptor that has been called with the PR_Listen() -** function, also known as the rendezvous socket. -** void *buf -** A pointer to a buffer to receive data sent by the client. This -** buffer must be large enough to receive bytes of data -** and two PRNetAddr structures, plus an extra 32 bytes. See: -** PR_ACCEPT_READ_BUF_OVERHEAD. -** PRInt32 amount -** The number of bytes of client data to receive. Does not include -** the size of the PRNetAddr structures. If 0, no data will be read -** from the client. -** PRIntervalTime timeout -** The timeout interval only applies to the read portion of the -** operation. PR_AcceptRead will block indefinitely until the -** connection is accepted; the read will timeout after the timeout -** interval elapses. -** OUTPUTS: -** PRFileDesc **acceptedSock -** The file descriptor for the newly connected socket. This parameter -** will only be valid if the function return does not indicate failure. -** PRNetAddr **peerAddr, -** The address of the remote socket. This parameter will only be -** valid if the function return does not indicate failure. The -** returned address is not guaranteed to be properly aligned. -** -** RETURNS: -** The number of bytes read from the client or -1 on failure. The reason -** for the failure is obtained by calling PR_GetError(). -************************************************************************** -**/ -/* define buffer overhead constant. Add this value to the user's -** data length when allocating a buffer to accept data. -** Example: -** #define USER_DATA_SIZE 10 -** char buf[USER_DATA_SIZE + PR_ACCEPT_READ_BUF_OVERHEAD]; -** bytesRead = PR_AcceptRead( s, fd, &a, &p, USER_DATA_SIZE, ...); -*/ -#define PR_ACCEPT_READ_BUF_OVERHEAD (32+(2*sizeof(PRNetAddr))) - -NSPR_API(PRInt32) PR_AcceptRead( - PRFileDesc *listenSock, PRFileDesc **acceptedSock, - PRNetAddr **peerAddr, void *buf, PRInt32 amount, PRIntervalTime timeout); - -/* -************************************************************************* -** FUNCTION: PR_NewTCPSocketPair -** DESCRIPTION: -** Create a new TCP socket pair. The returned descriptors can be used -** interchangeably; they are interconnected full-duplex descriptors: data -** written to one can be read from the other and vice-versa. -** -** INPUTS: -** None -** OUTPUTS: -** PRFileDesc *fds[2] -** The file descriptor pair for the newly created TCP sockets. -** RETURN: PRStatus -** Upon successful completion of TCP socket pair, PR_NewTCPSocketPair -** returns PR_SUCCESS. Otherwise, it returns PR_FAILURE. Further -** failure information can be obtained by calling PR_GetError(). -** XXX can we implement this on windoze and mac? -************************************************************************** -**/ -NSPR_API(PRStatus) PR_NewTCPSocketPair(PRFileDesc *fds[2]); - -/* -************************************************************************* -** FUNCTION: PR_GetSockName -** DESCRIPTION: -** Get socket name. Return the network address for this socket. -** -** INPUTS: -** PRFileDesc *fd -** Points to a PRFileDesc object representing the socket. -** OUTPUTS: -** PRNetAddr *addr -** Returns the address of the socket in its own communication space. -** RETURN: PRStatus -** Upon successful completion, PR_GetSockName returns PR_SUCCESS. -** Otherwise, it returns PR_FAILURE. Further failure information can -** be obtained by calling PR_GetError(). -************************************************************************** -**/ -NSPR_API(PRStatus) PR_GetSockName(PRFileDesc *fd, PRNetAddr *addr); - -/* -************************************************************************* -** FUNCTION: PR_GetPeerName -** DESCRIPTION: -** Get name of the connected peer. Return the network address for the -** connected peer socket. -** -** INPUTS: -** PRFileDesc *fd -** Points to a PRFileDesc object representing the connected peer. -** OUTPUTS: -** PRNetAddr *addr -** Returns the address of the connected peer in its own communication -** space. -** RETURN: PRStatus -** Upon successful completion, PR_GetPeerName returns PR_SUCCESS. -** Otherwise, it returns PR_FAILURE. Further failure information can -** be obtained by calling PR_GetError(). -************************************************************************** -**/ -NSPR_API(PRStatus) PR_GetPeerName(PRFileDesc *fd, PRNetAddr *addr); - -NSPR_API(PRStatus) PR_GetSocketOption( - PRFileDesc *fd, PRSocketOptionData *data); - -NSPR_API(PRStatus) PR_SetSocketOption( - PRFileDesc *fd, const PRSocketOptionData *data); - -/* - ********************************************************************* - * - * File descriptor inheritance - * - ********************************************************************* - */ - -/* - ************************************************************************ - * FUNCTION: PR_SetFDInheritable - * DESCRIPTION: - * Set the inheritance attribute of a file descriptor. - * - * INPUTS: - * PRFileDesc *fd - * Points to a PRFileDesc object. - * PRBool inheritable - * If PR_TRUE, the file descriptor fd is set to be inheritable - * by a child process. If PR_FALSE, the file descriptor is set - * to be not inheritable by a child process. - * RETURN: PRStatus - * Upon successful completion, PR_SetFDInheritable returns PR_SUCCESS. - * Otherwise, it returns PR_FAILURE. Further failure information can - * be obtained by calling PR_GetError(). - ************************************************************************* - */ -NSPR_API(PRStatus) PR_SetFDInheritable( - PRFileDesc *fd, - PRBool inheritable); - -/* - ************************************************************************ - * FUNCTION: PR_GetInheritedFD - * DESCRIPTION: - * Get an inherited file descriptor with the specified name. - * - * INPUTS: - * const char *name - * The name of the inherited file descriptor. - * RETURN: PRFileDesc * - * Upon successful completion, PR_GetInheritedFD returns the - * inherited file descriptor with the specified name. Otherwise, - * it returns NULL. Further failure information can be obtained - * by calling PR_GetError(). - ************************************************************************* - */ -NSPR_API(PRFileDesc *) PR_GetInheritedFD(const char *name); - -/* - ********************************************************************* - * - * Memory-mapped files - * - ********************************************************************* - */ - -typedef struct PRFileMap PRFileMap; - -/* - * protection options for read and write accesses of a file mapping - */ -typedef enum PRFileMapProtect { - PR_PROT_READONLY, /* read only */ - PR_PROT_READWRITE, /* readable, and write is shared */ - PR_PROT_WRITECOPY /* readable, and write is private (copy-on-write) */ -} PRFileMapProtect; - -NSPR_API(PRFileMap *) PR_CreateFileMap( - PRFileDesc *fd, - PRInt64 size, - PRFileMapProtect prot); - -/* - * return the alignment (in bytes) of the offset argument to PR_MemMap - */ -NSPR_API(PRInt32) PR_GetMemMapAlignment(void); - -NSPR_API(void *) PR_MemMap( - PRFileMap *fmap, - PROffset64 offset, /* must be aligned and sized according to the - * return value of PR_GetMemMapAlignment() */ - PRUint32 len); - -NSPR_API(PRStatus) PR_MemUnmap(void *addr, PRUint32 len); - -NSPR_API(PRStatus) PR_CloseFileMap(PRFileMap *fmap); - -/* - * Synchronously flush the given memory-mapped address range of the given open - * file to disk. The function does not return until all modified data have - * been written to disk. - * - * On some platforms, the function will call PR_Sync(fd) internally if it is - * necessary for flushing modified data to disk synchronously. - */ -NSPR_API(PRStatus) PR_SyncMemMap( - PRFileDesc *fd, - void *addr, - PRUint32 len); - -/* - ****************************************************************** - * - * Interprocess communication - * - ****************************************************************** - */ - -/* - * Creates an anonymous pipe and returns file descriptors for the - * read and write ends of the pipe. - */ - -NSPR_API(PRStatus) PR_CreatePipe( - PRFileDesc **readPipe, - PRFileDesc **writePipe -); - -/************************************************************************/ -/************** The following definitions are for poll ******************/ -/************************************************************************/ - -struct PRPollDesc { - PRFileDesc* fd; - PRInt16 in_flags; - PRInt16 out_flags; -}; - -/* -** Bit values for PRPollDesc.in_flags or PRPollDesc.out_flags. Binary-or -** these together to produce the desired poll request. -*/ - -#if defined(_PR_POLL_BACKCOMPAT) - -#include -#define PR_POLL_READ POLLIN -#define PR_POLL_WRITE POLLOUT -#define PR_POLL_EXCEPT POLLPRI -#define PR_POLL_ERR POLLERR /* only in out_flags */ -#define PR_POLL_NVAL POLLNVAL /* only in out_flags when fd is bad */ -#define PR_POLL_HUP POLLHUP /* only in out_flags */ - -#else /* _PR_POLL_BACKCOMPAT */ - -#define PR_POLL_READ 0x1 -#define PR_POLL_WRITE 0x2 -#define PR_POLL_EXCEPT 0x4 -#define PR_POLL_ERR 0x8 /* only in out_flags */ -#define PR_POLL_NVAL 0x10 /* only in out_flags when fd is bad */ -#define PR_POLL_HUP 0x20 /* only in out_flags */ - -#endif /* _PR_POLL_BACKCOMPAT */ - -/* -************************************************************************* -** FUNCTION: PR_Poll -** DESCRIPTION: -** -** The call returns as soon as I/O is ready on one or more of the underlying -** socket objects. A count of the number of ready descriptors is -** returned unless a timeout occurs in which case zero is returned. -** -** PRPollDesc.fd should be set to a pointer to a PRFileDesc object -** representing a socket. This field can be set to NULL to indicate to -** PR_Poll that this PRFileDesc object should be ignored. -** PRPollDesc.in_flags should be set to the desired request -** (read/write/except or some combination). Upon successful return from -** this call PRPollDesc.out_flags will be set to indicate what kind of -** i/o can be performed on the respective descriptor. PR_Poll() uses the -** out_flags fields as scratch variables during the call. If PR_Poll() -** returns 0 or -1, the out_flags fields do not contain meaningful values -** and must not be used. -** -** INPUTS: -** PRPollDesc *pds A pointer to an array of PRPollDesc -** -** PRIntn npds The number of elements in the array -** If this argument is zero PR_Poll is -** equivalent to a PR_Sleep(timeout). -** -** PRIntervalTime timeout Amount of time the call will block waiting -** for I/O to become ready. If this time expires -** w/o any I/O becoming ready, the result will -** be zero. -** -** OUTPUTS: None -** RETURN: -** PRInt32 Number of PRPollDesc's with events or zero -** if the function timed out or -1 on failure. -** The reason for the failure is obtained by -** calling PR_GetError(). -************************************************************************** -*/ -NSPR_API(PRInt32) PR_Poll( - PRPollDesc *pds, PRIntn npds, PRIntervalTime timeout); - -/* -************************************************************************** -** -** Pollable events -** -** A pollable event is a special kind of file descriptor. -** The only I/O operation you can perform on a pollable event -** is to poll it with the PR_POLL_READ flag. You can't -** read from or write to a pollable event. -** -** The purpose of a pollable event is to combine event waiting -** with I/O waiting in a single PR_Poll call. Pollable events -** are implemented using a pipe or a pair of TCP sockets -** connected via the loopback address, therefore setting and -** waiting for pollable events are expensive operating system -** calls. Do not use pollable events for general thread -** synchronization. Use condition variables instead. -** -** A pollable event has two states: set and unset. Events -** are not queued, so there is no notion of an event count. -** A pollable event is either set or unset. -** -** A new pollable event is created by a PR_NewPollableEvent -** call and is initially in the unset state. -** -** PR_WaitForPollableEvent blocks the calling thread until -** the pollable event is set, and then it atomically unsets -** the pollable event before it returns. -** -** To set a pollable event, call PR_SetPollableEvent. -** -** One can call PR_Poll with the PR_POLL_READ flag on a pollable -** event. When the pollable event is set, PR_Poll returns with -** the PR_POLL_READ flag set in the out_flags. -** -** To close a pollable event, call PR_DestroyPollableEvent -** (not PR_Close). -** -************************************************************************** -*/ - -NSPR_API(PRFileDesc *) PR_NewPollableEvent(void); - -NSPR_API(PRStatus) PR_DestroyPollableEvent(PRFileDesc *event); - -NSPR_API(PRStatus) PR_SetPollableEvent(PRFileDesc *event); - -NSPR_API(PRStatus) PR_WaitForPollableEvent(PRFileDesc *event); - -PR_END_EXTERN_C - -#endif /* prio_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/pripcsem.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/pripcsem.h deleted file mode 100755 index f5a524d..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/pripcsem.h +++ /dev/null @@ -1,101 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * File: pripcsem.h - * - * Description: named semaphores for interprocess - * synchronization - * - * Unrelated processes obtain access to a shared semaphore - * by specifying its name. - * - * Our goal is to support named semaphores on at least - * Unix and Win32 platforms. The implementation will use - * one of the three native semaphore APIs: POSIX, System V, - * and Win32. - * - * Because POSIX named semaphores have kernel persistence, - * we are forced to have a delete function in this API. - */ - -#ifndef pripcsem_h___ -#define pripcsem_h___ - -#include "prtypes.h" -#include "prio.h" - -PR_BEGIN_EXTERN_C - -/* - * PRSem is an opaque structure that represents a named - * semaphore. - */ -typedef struct PRSem PRSem; - -/* - * PR_OpenSemaphore -- - * - * Create or open a named semaphore with the specified name. - * A handle to the semaphore is returned. - * - * If the named semaphore doesn't exist and the PR_SEM_CREATE - * flag is specified, the named semaphore is created. The - * created semaphore needs to be removed from the system with - * a PR_DeleteSemaphore call. - * - * If PR_SEM_CREATE is specified, the third argument is the - * access permission bits of the new semaphore (same - * interpretation as the mode argument to PR_Open) and the - * fourth argument is the initial value of the new semaphore. - * If PR_SEM_CREATE is not specified, the third and fourth - * arguments are ignored. - */ - -#define PR_SEM_CREATE 0x1 /* create if not exist */ -#define PR_SEM_EXCL 0x2 /* fail if already exists */ - -NSPR_API(PRSem *) PR_OpenSemaphore( - const char *name, PRIntn flags, PRIntn mode, PRUintn value); - -/* - * PR_WaitSemaphore -- - * - * If the value of the semaphore is > 0, decrement the value and return. - * If the value is 0, sleep until the value becomes > 0, then decrement - * the value and return. - * - * The "test and decrement" operation is performed atomically. - */ - -NSPR_API(PRStatus) PR_WaitSemaphore(PRSem *sem); - -/* - * PR_PostSemaphore -- - * - * Increment the value of the named semaphore by 1. - */ - -NSPR_API(PRStatus) PR_PostSemaphore(PRSem *sem); - -/* - * PR_CloseSemaphore -- - * - * Close a named semaphore handle. - */ - -NSPR_API(PRStatus) PR_CloseSemaphore(PRSem *sem); - -/* - * PR_DeleteSemaphore -- - * - * Remove a named semaphore from the system. - */ - -NSPR_API(PRStatus) PR_DeleteSemaphore(const char *name); - -PR_END_EXTERN_C - -#endif /* pripcsem_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prlink.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prlink.h deleted file mode 100755 index ea45ef8..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prlink.h +++ /dev/null @@ -1,230 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef prlink_h___ -#define prlink_h___ - -/* -** API to static and dynamic linking. -*/ -#include "prtypes.h" - -PR_BEGIN_EXTERN_C - -typedef struct PRLibrary PRLibrary; - -typedef struct PRStaticLinkTable { - const char *name; - void (*fp)(void); -} PRStaticLinkTable; - -/* -** Change the default library path to the given string. The string is -** copied. This call will fail if it runs out of memory. -** -** The string provided as 'path' is copied. The caller can do whatever is -** convenient with the argument when the function is complete. -*/ -NSPR_API(PRStatus) PR_SetLibraryPath(const char *path); - -/* -** Return a character string which contains the path used to search for -** dynamically loadable libraries. -** -** The returned value is basically a copy of a PR_SetLibraryPath(). -** The storage is allocated by the runtime and becomes the responsibilty -** of the caller. -*/ -NSPR_API(char*) PR_GetLibraryPath(void); - -/* -** Given a directory name "dir" and a library name "lib" construct a full -** path name that will refer to the actual dynamically loaded -** library. This does not test for existance of said file, it just -** constructs the full filename. The name constructed is system dependent -** and prepared for PR_LoadLibrary. The result must be free'd when the -** caller is done with it. -** -** The storage for the result is allocated by the runtime and becomes the -** responsibility of the caller. -*/ -NSPR_API(char*) PR_GetLibraryName(const char *dir, const char *lib); - -/* -** -** Free the memory allocated, for the caller, by PR_GetLibraryName -*/ -NSPR_API(void) PR_FreeLibraryName(char *mem); - -/* -** Given a library "name" try to load the library. The argument "name" -** is a machine-dependent name for the library, such as the full pathname -** returned by PR_GetLibraryName. If the library is already loaded, -** this function will avoid loading the library twice. -** -** If the library is loaded successfully, then a pointer to the PRLibrary -** structure representing the library is returned. Otherwise, NULL is -** returned. -** -** This increments the reference count of the library. -*/ -NSPR_API(PRLibrary*) PR_LoadLibrary(const char *name); - -/* -** Each operating system has its preferred way of specifying -** a file in the file system. Most operating systems use -** a pathname. Mac OS Classic, on the other hand, uses the FSSpec -** structure to specify a file. PRLibSpec allows NSPR clients -** to use the type of file specification that is most efficient -** for a particular platform. -** -** On some operating systems such as Mac OS Classic, a shared library -** may contain code fragments that can be individually loaded. -** PRLibSpec also allows NSPR clients to identify a code fragment -** in a library, if code fragments are supported by the OS. -** A code fragment can be specified by name or by an integer index. -** -** Right now PRLibSpec supports four types of library specification: -** a pathname in the native character encoding, a Mac code fragment -** by name, a Mac code fragment by index, and a UTF-16 pathname. -*/ - -typedef enum PRLibSpecType { - PR_LibSpec_Pathname, - PR_LibSpec_MacNamedFragment, /* obsolete (for Mac OS Classic) */ - PR_LibSpec_MacIndexedFragment, /* obsolete (for Mac OS Classic) */ - PR_LibSpec_PathnameU /* supported only on Win32 */ -} PRLibSpecType; - -struct FSSpec; /* Mac OS Classic FSSpec */ - -typedef struct PRLibSpec { - PRLibSpecType type; - union { - /* if type is PR_LibSpec_Pathname */ - const char *pathname; - - /* if type is PR_LibSpec_MacNamedFragment */ - struct { - const struct FSSpec *fsspec; - const char *name; - } mac_named_fragment; /* obsolete (for Mac OS Classic) */ - - /* if type is PR_LibSpec_MacIndexedFragment */ - struct { - const struct FSSpec *fsspec; - PRUint32 index; - } mac_indexed_fragment; /* obsolete (for Mac OS Classic) */ - - /* if type is PR_LibSpec_PathnameU */ - const PRUnichar *pathname_u; /* supported only on Win32 */ - } value; -} PRLibSpec; - -/* -** The following bit flags may be or'd together and passed -** as the 'flags' argument to PR_LoadLibraryWithFlags. -** Flags not supported by the underlying OS are ignored. -*/ - -#define PR_LD_LAZY 0x1 /* equivalent to RTLD_LAZY on Unix */ -#define PR_LD_NOW 0x2 /* equivalent to RTLD_NOW on Unix */ -#define PR_LD_GLOBAL 0x4 /* equivalent to RTLD_GLOBAL on Unix */ -#define PR_LD_LOCAL 0x8 /* equivalent to RTLD_LOCAL on Unix */ -/* The following is equivalent to LOAD_WITH_ALTERED_SEARCH_PATH on Windows */ -#define PR_LD_ALT_SEARCH_PATH 0x10 -/* 0x8000 reserved for NSPR internal use */ - -/* -** Load the specified library, in the manner specified by 'flags'. -*/ - -NSPR_API(PRLibrary *) -PR_LoadLibraryWithFlags( - PRLibSpec libSpec, /* the shared library */ - PRIntn flags /* flags that affect the loading */ -); - -/* -** Unload a previously loaded library. If the library was a static -** library then the static link table will no longer be referenced. The -** associated PRLibrary object is freed. -** -** PR_FAILURE is returned if the library cannot be unloaded. -** -** This function decrements the reference count of the library. -*/ -NSPR_API(PRStatus) PR_UnloadLibrary(PRLibrary *lib); - -/* -** Given the name of a procedure, return the address of the function that -** implements the procedure, or NULL if no such function can be -** found. This does not find symbols in the main program (the ".exe"); -** use PR_LoadStaticLibrary to register symbols in the main program. -** -** This function does not modify the reference count of the library. -*/ -NSPR_API(void*) PR_FindSymbol(PRLibrary *lib, const char *name); - -/* -** Similar to PR_FindSymbol, except that the return value is a pointer to -** a function, and not a pointer to void. Casting between a data pointer -** and a function pointer is not portable according to the C standard. -** Any function pointer can be cast to any other function pointer. -** -** This function does not modify the reference count of the library. -*/ -typedef void (*PRFuncPtr)(void); -NSPR_API(PRFuncPtr) PR_FindFunctionSymbol(PRLibrary *lib, const char *name); - -/* -** Finds a symbol in one of the currently loaded libraries. Given the -** name of a procedure, return the address of the function that -** implements the procedure, and return the library that contains that -** symbol, or NULL if no such function can be found. This does not find -** symbols in the main program (the ".exe"); use PR_AddStaticLibrary to -** register symbols in the main program. -** -** This increments the reference count of the library. -*/ -NSPR_API(void*) PR_FindSymbolAndLibrary(const char *name, - PRLibrary* *lib); - -/* -** Similar to PR_FindSymbolAndLibrary, except that the return value is -** a pointer to a function, and not a pointer to void. Casting between a -** data pointer and a function pointer is not portable according to the C -** standard. Any function pointer can be cast to any other function pointer. -** -** This increments the reference count of the library. -*/ -NSPR_API(PRFuncPtr) PR_FindFunctionSymbolAndLibrary(const char *name, - PRLibrary* *lib); - -/* -** Register a static link table with the runtime under the name -** "name". The symbols present in the static link table will be made -** available to PR_FindSymbol. If "name" is null then the symbols will be -** made available to the library which represents the executable. The -** tables are not copied. -** -** Returns the library object if successful, null otherwise. -** -** This increments the reference count of the library. -*/ -NSPR_API(PRLibrary*) PR_LoadStaticLibrary( - const char *name, const PRStaticLinkTable *table); - -/* -** Return the pathname of the file that the library "name" was loaded -** from. "addr" is the address of a function defined in the library. -** -** The caller is responsible for freeing the result with PR_Free. -*/ -NSPR_API(char *) PR_GetLibraryFilePathname(const char *name, PRFuncPtr addr); - -PR_END_EXTERN_C - -#endif /* prlink_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prlock.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prlock.h deleted file mode 100755 index bc76a0e..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prlock.h +++ /dev/null @@ -1,109 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* -** File: prlock.h -** Description: API to basic locking functions of NSPR. -** -** -** NSPR provides basic locking mechanisms for thread synchronization. Locks -** are lightweight resource contention controls that prevent multiple threads -** from accessing something (code/data) simultaneously. -**/ - -#ifndef prlock_h___ -#define prlock_h___ - -#include "prtypes.h" - -PR_BEGIN_EXTERN_C - -/**********************************************************************/ -/************************* TYPES AND CONSTANTS ************************/ -/**********************************************************************/ - -/* - * PRLock -- - * - * NSPR represents the lock as an opaque entity to the client of the - * API. All routines operate on a pointer to this opaque entity. - */ - -typedef struct PRLock PRLock; - -/**********************************************************************/ -/****************************** FUNCTIONS *****************************/ -/**********************************************************************/ - -/*********************************************************************** -** FUNCTION: PR_NewLock -** DESCRIPTION: -** Returns a pointer to a newly created opaque lock object. -** INPUTS: void -** OUTPUTS: void -** RETURN: PRLock* -** If the lock can not be created because of resource constraints, NULL -** is returned. -** -***********************************************************************/ -NSPR_API(PRLock*) PR_NewLock(void); - -/*********************************************************************** -** FUNCTION: PR_DestroyLock -** DESCRIPTION: -** Destroys a given opaque lock object. -** INPUTS: PRLock *lock -** Lock to be freed. -** OUTPUTS: void -** RETURN: None -***********************************************************************/ -NSPR_API(void) PR_DestroyLock(PRLock *lock); - -/*********************************************************************** -** FUNCTION: PR_Lock -** DESCRIPTION: -** Lock a lock. -** INPUTS: PRLock *lock -** Lock to locked. -** OUTPUTS: void -** RETURN: None -***********************************************************************/ -NSPR_API(void) PR_Lock(PRLock *lock); - -/*********************************************************************** -** FUNCTION: PR_Unlock -** DESCRIPTION: -** Unlock a lock. Unlocking an unlocked lock has undefined results. -** INPUTS: PRLock *lock -** Lock to unlocked. -** OUTPUTS: void -** RETURN: PR_STATUS -** Returns PR_FAILURE if the caller does not own the lock. -***********************************************************************/ -NSPR_API(PRStatus) PR_Unlock(PRLock *lock); - -/*********************************************************************** -** MACRO: PR_ASSERT_CURRENT_THREAD_OWNS_LOCK -** DESCRIPTION: -** If the current thread owns |lock|, this assertion is guaranteed to -** succeed. Otherwise, the behavior of this function is undefined. -** INPUTS: PRLock *lock -** Lock to assert ownership of. -** OUTPUTS: void -** RETURN: None -***********************************************************************/ -#if defined(DEBUG) || defined(FORCE_PR_ASSERT) -#define PR_ASSERT_CURRENT_THREAD_OWNS_LOCK(/* PrLock* */ lock) \ - PR_AssertCurrentThreadOwnsLock(lock) -#else -#define PR_ASSERT_CURRENT_THREAD_OWNS_LOCK(/* PrLock* */ lock) -#endif - -/* Don't call this function directly. */ -NSPR_API(void) PR_AssertCurrentThreadOwnsLock(PRLock *lock); - -PR_END_EXTERN_C - -#endif /* prlock_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prlog.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prlog.h deleted file mode 100755 index 6f825f2..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prlog.h +++ /dev/null @@ -1,221 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef prlog_h___ -#define prlog_h___ - -#include "prtypes.h" - -PR_BEGIN_EXTERN_C - -/* -** prlog.h -- Declare interfaces to NSPR's Logging service -** -** NSPR provides a logging service that is used by NSPR itself and is -** available to client programs. -** -** To use the service from a client program, you should create a -** PRLogModuleInfo structure by calling PR_NewLogModule(). After -** creating the LogModule, you can write to the log using the PR_LOG() -** macro. -** -** Initialization of the log service is handled by NSPR initialization. -** -** At execution time, you must enable the log service. To enable the -** log service, set the environment variable: NSPR_LOG_MODULES -** variable. -** -** NSPR_LOG_MODULES variable has the form: -** -** :[, :]* -** -** Where: -** is the name passed to PR_NewLogModule(). -** is a numeric constant, e.g. 5. This value is the maximum -** value of a log event, enumerated by PRLogModuleLevel, that you want -** written to the log. -** -** For example: to record all events of greater value than or equal to -** PR_LOG_ERROR for a LogModule names "gizmo", say: -** -** set NSPR_LOG_MODULES=gizmo:2 -** -** Note that you must specify the numeric value of PR_LOG_ERROR. -** -** Special LogModule names are provided for controlling NSPR's log -** service at execution time. These controls should be set in the -** NSPR_LOG_MODULES environment variable at execution time to affect -** NSPR's log service for your application. -** -** The special LogModule "all" enables all LogModules. To enable all -** LogModule calls to PR_LOG(), say: -** -** set NSPR_LOG_MODULES=all:5 -** -** The special LogModule name "sync" tells the NSPR log service to do -** unbuffered logging. -** -** The special LogModule name "bufsize:" tells NSPR to set the -** log buffer to . -** -** The environment variable NSPR_LOG_FILE specifies the log file to use -** unless the default of "stderr" is acceptable. For MS Windows -** systems, NSPR_LOG_FILE can be set to a special value: "WinDebug" -** (case sensitive). This value causes PR_LOG() output to be written -** using the Windows API OutputDebugString(). OutputDebugString() -** writes to the debugger window; some people find this helpful. -** -** -** To put log messages in your programs, use the PR_LOG macro: -** -** PR_LOG(, , (, *)); -** -** Where is the address of a PRLogModuleInfo structure, and -** is one of the levels defined by the enumeration: -** PRLogModuleLevel. is a printf() style of argument list. That -** is: (fmtstring, ...). -** -** Example: -** -** main() { -** PRIntn one = 1; -** PRLogModuleInfo * myLm = PR_NewLogModule("gizmo"); -** PR_LOG( myLm, PR_LOG_ALWAYS, ("Log this! %d\n", one)); -** return; -** } -** -** Note the use of printf() style arguments as the third agrument(s) to -** PR_LOG(). -** -** After compiling and linking you application, set the environment: -** -** set NSPR_LOG_MODULES=gizmo:5 -** set NSPR_LOG_FILE=logfile.txt -** -** When you execute your application, the string "Log this! 1" will be -** written to the file "logfile.txt". -** -** Note to NSPR engineers: a number of PRLogModuleInfo structures are -** defined and initialized in prinit.c. See this module for ideas on -** what to log where. -** -*/ - -typedef enum PRLogModuleLevel { - PR_LOG_NONE = 0, /* nothing */ - PR_LOG_ALWAYS = 1, /* always printed */ - PR_LOG_ERROR = 2, /* error messages */ - PR_LOG_WARNING = 3, /* warning messages */ - PR_LOG_DEBUG = 4, /* debug messages */ - - PR_LOG_NOTICE = PR_LOG_DEBUG, /* notice messages */ - PR_LOG_WARN = PR_LOG_WARNING, /* warning messages */ - PR_LOG_MIN = PR_LOG_DEBUG, /* minimal debugging messages */ - PR_LOG_MAX = PR_LOG_DEBUG /* maximal debugging messages */ -} PRLogModuleLevel; - -/* -** One of these structures is created for each module that uses logging. -** "name" is the name of the module -** "level" is the debugging level selected for that module -*/ -typedef struct PRLogModuleInfo { - const char *name; - PRLogModuleLevel level; - struct PRLogModuleInfo *next; -} PRLogModuleInfo; - -/* -** Create a new log module. -*/ -NSPR_API(PRLogModuleInfo*) PR_NewLogModule(const char *name); - -/* -** Set the file to use for logging. Returns PR_FALSE if the file cannot -** be created -*/ -NSPR_API(PRBool) PR_SetLogFile(const char *name); - -/* -** Set the size of the logging buffer. If "buffer_size" is zero then the -** logging becomes "synchronous" (or unbuffered). -*/ -NSPR_API(void) PR_SetLogBuffering(PRIntn buffer_size); - -/* -** Print a string to the log. "fmt" is a PR_snprintf format type. All -** messages printed to the log are preceeded by the name of the thread -** and a time stamp. Also, the routine provides a missing newline if one -** is not provided. -*/ -NSPR_API(void) PR_LogPrint(const char *fmt, ...); - -/* -** Flush the log to its file. -*/ -NSPR_API(void) PR_LogFlush(void); - -NSPR_API(void) PR_Assert(const char *s, const char *file, PRIntn ln); - -#if defined(DEBUG) || defined(FORCE_PR_LOG) -#define PR_LOGGING 1 - -#define PR_LOG_TEST(_module,_level) \ - ((_module)->level >= (_level)) - -/* -** Log something. -** "module" is the address of a PRLogModuleInfo structure -** "level" is the desired logging level -** "args" is a variable length list of arguments to print, in the following -** format: ("printf style format string", ...) -*/ -#define PR_LOG(_module,_level,_args) \ - PR_BEGIN_MACRO \ - if (PR_LOG_TEST(_module,_level)) { \ - PR_LogPrint _args; \ - } \ - PR_END_MACRO - -#else /* defined(DEBUG) || defined(FORCE_PR_LOG) */ - -#undef PR_LOGGING -#define PR_LOG_TEST(module,level) 0 -#define PR_LOG(module,level,args) - -#endif /* defined(DEBUG) || defined(FORCE_PR_LOG) */ - -#ifndef NO_NSPR_10_SUPPORT - -#ifdef PR_LOGGING -#define PR_LOG_BEGIN PR_LOG -#define PR_LOG_END PR_LOG -#define PR_LOG_DEFINE PR_NewLogModule -#else -#define PR_LOG_BEGIN(module,level,args) -#define PR_LOG_END(module,level,args) -#define PR_LOG_DEFINE(_name) NULL -#endif /* PR_LOGGING */ - -#endif /* NO_NSPR_10_SUPPORT */ - -#if defined(DEBUG) || defined(FORCE_PR_ASSERT) - -#define PR_ASSERT(_expr) \ - ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__)) - -#define PR_NOT_REACHED(_reasonStr) \ - PR_Assert(_reasonStr,__FILE__,__LINE__) - -#else - -#define PR_ASSERT(expr) ((void) 0) -#define PR_NOT_REACHED(reasonStr) - -#endif /* defined(DEBUG) || defined(FORCE_PR_ASSERT) */ - -PR_END_EXTERN_C - -#endif /* prlog_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prlong.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prlong.h deleted file mode 100755 index df1f30b..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prlong.h +++ /dev/null @@ -1,403 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* -** File: prlong.h -** Description: Portable access to 64 bit numerics -** -** Long-long (64-bit signed integer type) support. Some C compilers -** don't support 64 bit integers yet, so we use these macros to -** support both machines that do and don't. -**/ -#ifndef prlong_h___ -#define prlong_h___ - -#include "prtypes.h" - -PR_BEGIN_EXTERN_C - -/*********************************************************************** -** DEFINES: LL_MaxInt -** LL_MinInt -** LL_Zero -** LL_MaxUint -** DESCRIPTION: -** Various interesting constants and static variable -** initializer -***********************************************************************/ -NSPR_API(PRInt64) LL_MaxInt(void); -NSPR_API(PRInt64) LL_MinInt(void); -NSPR_API(PRInt64) LL_Zero(void); -NSPR_API(PRUint64) LL_MaxUint(void); - -#if defined(HAVE_LONG_LONG) - -/* Keep this in sync with prtypes.h. */ -#if PR_BYTES_PER_LONG == 8 && !defined(PR_ALTERNATE_INT64_TYPEDEF) -#define LL_MAXINT 9223372036854775807L -#define LL_MININT (-LL_MAXINT - 1L) -#define LL_ZERO 0L -#define LL_MAXUINT 18446744073709551615UL -#define LL_INIT(hi, lo) ((hi ## L << 32) + lo ## L) -#elif defined(WIN32) && !defined(__GNUC__) -#define LL_MAXINT 9223372036854775807i64 -#define LL_MININT (-LL_MAXINT - 1i64) -#define LL_ZERO 0i64 -#define LL_MAXUINT 18446744073709551615ui64 -#define LL_INIT(hi, lo) ((hi ## i64 << 32) + lo ## i64) -#else -#define LL_MAXINT 9223372036854775807LL -#define LL_MININT (-LL_MAXINT - 1LL) -#define LL_ZERO 0LL -#define LL_MAXUINT 18446744073709551615ULL -#define LL_INIT(hi, lo) ((hi ## LL << 32) + lo ## LL) -#endif - -/*********************************************************************** -** MACROS: LL_* -** DESCRIPTION: -** The following macros define portable access to the 64 bit -** math facilities. -** -***********************************************************************/ - -/*********************************************************************** -** MACROS: LL_ -** -** LL_IS_ZERO Test for zero -** LL_EQ Test for equality -** LL_NE Test for inequality -** LL_GE_ZERO Test for zero or positive -** LL_CMP Compare two values -***********************************************************************/ -#define LL_IS_ZERO(a) ((a) == 0) -#define LL_EQ(a, b) ((a) == (b)) -#define LL_NE(a, b) ((a) != (b)) -#define LL_GE_ZERO(a) ((a) >= 0) -#define LL_CMP(a, op, b) ((PRInt64)(a) op (PRInt64)(b)) -#define LL_UCMP(a, op, b) ((PRUint64)(a) op (PRUint64)(b)) - -/*********************************************************************** -** MACROS: LL_ -** -** LL_AND Logical and -** LL_OR Logical or -** LL_XOR Logical exclusion -** LL_OR2 A disgusting deviation -** LL_NOT Negation (one's complement) -***********************************************************************/ -#define LL_AND(r, a, b) ((r) = (a) & (b)) -#define LL_OR(r, a, b) ((r) = (a) | (b)) -#define LL_XOR(r, a, b) ((r) = (a) ^ (b)) -#define LL_OR2(r, a) ((r) = (r) | (a)) -#define LL_NOT(r, a) ((r) = ~(a)) - -/*********************************************************************** -** MACROS: LL_ -** -** LL_NEG Negation (two's complement) -** LL_ADD Summation (two's complement) -** LL_SUB Difference (two's complement) -***********************************************************************/ -#define LL_NEG(r, a) ((r) = -(a)) -#define LL_ADD(r, a, b) ((r) = (a) + (b)) -#define LL_SUB(r, a, b) ((r) = (a) - (b)) - -/*********************************************************************** -** MACROS: LL_ -** -** LL_MUL Product (two's complement) -** LL_DIV Quotient (two's complement) -** LL_MOD Modulus (two's complement) -***********************************************************************/ -#define LL_MUL(r, a, b) ((r) = (a) * (b)) -#define LL_DIV(r, a, b) ((r) = (a) / (b)) -#define LL_MOD(r, a, b) ((r) = (a) % (b)) - -/*********************************************************************** -** MACROS: LL_ -** -** LL_SHL Shift left [0..64] bits -** LL_SHR Shift right [0..64] bits with sign extension -** LL_USHR Unsigned shift right [0..64] bits -** LL_ISHL Signed shift left [0..64] bits -***********************************************************************/ -#define LL_SHL(r, a, b) ((r) = (PRInt64)(a) << (b)) -#define LL_SHR(r, a, b) ((r) = (PRInt64)(a) >> (b)) -#define LL_USHR(r, a, b) ((r) = (PRUint64)(a) >> (b)) -#define LL_ISHL(r, a, b) ((r) = (PRInt64)(a) << (b)) - -/*********************************************************************** -** MACROS: LL_ -** -** LL_L2I Convert to signed 32 bit -** LL_L2UI Convert to unsigned 32 bit -** LL_L2F Convert to floating point -** LL_L2D Convert to floating point -** LL_I2L Convert signed to 64 bit -** LL_UI2L Convert unsigned to 64 bit -** LL_F2L Convert float to 64 bit -** LL_D2L Convert float to 64 bit -***********************************************************************/ -#define LL_L2I(i, l) ((i) = (PRInt32)(l)) -#define LL_L2UI(ui, l) ((ui) = (PRUint32)(l)) -#define LL_L2F(f, l) ((f) = (PRFloat64)(l)) -#define LL_L2D(d, l) ((d) = (PRFloat64)(l)) - -#define LL_I2L(l, i) ((l) = (PRInt64)(i)) -#define LL_UI2L(l, ui) ((l) = (PRInt64)(ui)) -#define LL_F2L(l, f) ((l) = (PRInt64)(f)) -#define LL_D2L(l, d) ((l) = (PRInt64)(d)) - -/*********************************************************************** -** MACROS: LL_UDIVMOD -** DESCRIPTION: -** Produce both a quotient and a remainder given an unsigned -** INPUTS: PRUint64 a: The dividend of the operation -** PRUint64 b: The quotient of the operation -** OUTPUTS: PRUint64 *qp: pointer to quotient -** PRUint64 *rp: pointer to remainder -***********************************************************************/ -#define LL_UDIVMOD(qp, rp, a, b) \ - (*(qp) = ((PRUint64)(a) / (b)), \ - *(rp) = ((PRUint64)(a) % (b))) - -#else /* !HAVE_LONG_LONG */ - -#define LL_MAXINT LL_MaxInt() -#define LL_MININT LL_MinInt() -#define LL_ZERO LL_Zero() -#define LL_MAXUINT LL_MaxUint() - -#ifdef IS_LITTLE_ENDIAN -#define LL_INIT(hi, lo) {PR_UINT32(lo), PR_UINT32(hi)} -#else -#define LL_INIT(hi, lo) {PR_UINT32(hi), PR_UINT32(lo)} -#endif - -#define LL_IS_ZERO(a) (((a).hi == 0) && ((a).lo == 0)) -#define LL_EQ(a, b) (((a).hi == (b).hi) && ((a).lo == (b).lo)) -#define LL_NE(a, b) (((a).hi != (b).hi) || ((a).lo != (b).lo)) -#define LL_GE_ZERO(a) (((a).hi >> 31) == 0) - -#define LL_CMP(a, op, b) (((a).hi == (b).hi) ? ((a).lo op (b).lo) : \ - ((PRInt32)(a).hi op (PRInt32)(b).hi)) -#define LL_UCMP(a, op, b) (((a).hi == (b).hi) ? ((a).lo op (b).lo) : \ - ((a).hi op (b).hi)) - -#define LL_AND(r, a, b) ((r).lo = (a).lo & (b).lo, \ - (r).hi = (a).hi & (b).hi) -#define LL_OR(r, a, b) ((r).lo = (a).lo | (b).lo, \ - (r).hi = (a).hi | (b).hi) -#define LL_XOR(r, a, b) ((r).lo = (a).lo ^ (b).lo, \ - (r).hi = (a).hi ^ (b).hi) -#define LL_OR2(r, a) ((r).lo = (r).lo | (a).lo, \ - (r).hi = (r).hi | (a).hi) -#define LL_NOT(r, a) ((r).lo = ~(a).lo, \ - (r).hi = ~(a).hi) - -#define LL_NEG(r, a) ((r).lo = -(PRInt32)(a).lo, \ - (r).hi = -(PRInt32)(a).hi - ((r).lo != 0)) -#define LL_ADD(r, a, b) { \ - PRInt64 _a, _b; \ - _a = a; _b = b; \ - (r).lo = _a.lo + _b.lo; \ - (r).hi = _a.hi + _b.hi + ((r).lo < _b.lo); \ -} - -#define LL_SUB(r, a, b) { \ - PRInt64 _a, _b; \ - _a = a; _b = b; \ - (r).lo = _a.lo - _b.lo; \ - (r).hi = _a.hi - _b.hi - (_a.lo < _b.lo); \ -} - -#define LL_MUL(r, a, b) { \ - PRInt64 _a, _b; \ - _a = a; _b = b; \ - LL_MUL32(r, _a.lo, _b.lo); \ - (r).hi += _a.hi * _b.lo + _a.lo * _b.hi; \ -} - -#define _lo16(a) ((a) & PR_BITMASK(16)) -#define _hi16(a) ((a) >> 16) - -#define LL_MUL32(r, a, b) { \ - PRUint32 _a1, _a0, _b1, _b0, _y0, _y1, _y2, _y3; \ - _a1 = _hi16(a), _a0 = _lo16(a); \ - _b1 = _hi16(b), _b0 = _lo16(b); \ - _y0 = _a0 * _b0; \ - _y1 = _a0 * _b1; \ - _y2 = _a1 * _b0; \ - _y3 = _a1 * _b1; \ - _y1 += _hi16(_y0); /* can't carry */ \ - _y1 += _y2; /* might carry */ \ - if (_y1 < _y2) \ - _y3 += (PRUint32)(PR_BIT(16)); /* propagate */ \ - (r).lo = (_lo16(_y1) << 16) + _lo16(_y0); \ - (r).hi = _y3 + _hi16(_y1); \ -} - -#define LL_UDIVMOD(qp, rp, a, b) ll_udivmod(qp, rp, a, b) - -NSPR_API(void) ll_udivmod(PRUint64 *qp, PRUint64 *rp, PRUint64 a, PRUint64 b); - -#define LL_DIV(r, a, b) { \ - PRInt64 _a, _b; \ - PRUint32 _negative = (PRInt32)(a).hi < 0; \ - if (_negative) { \ - LL_NEG(_a, a); \ - } else { \ - _a = a; \ - } \ - if ((PRInt32)(b).hi < 0) { \ - _negative ^= 1; \ - LL_NEG(_b, b); \ - } else { \ - _b = b; \ - } \ - LL_UDIVMOD(&(r), 0, _a, _b); \ - if (_negative) \ - LL_NEG(r, r); \ -} - -#define LL_MOD(r, a, b) { \ - PRInt64 _a, _b; \ - PRUint32 _negative = (PRInt32)(a).hi < 0; \ - if (_negative) { \ - LL_NEG(_a, a); \ - } else { \ - _a = a; \ - } \ - if ((PRInt32)(b).hi < 0) { \ - LL_NEG(_b, b); \ - } else { \ - _b = b; \ - } \ - LL_UDIVMOD(0, &(r), _a, _b); \ - if (_negative) \ - LL_NEG(r, r); \ -} - -#define LL_SHL(r, a, b) { \ - if (b) { \ - PRInt64 _a; \ - _a = a; \ - if ((b) < 32) { \ - (r).lo = _a.lo << ((b) & 31); \ - (r).hi = (_a.hi << ((b) & 31)) | (_a.lo >> (32 - (b))); \ - } else { \ - (r).lo = 0; \ - (r).hi = _a.lo << ((b) & 31); \ - } \ - } else { \ - (r) = (a); \ - } \ -} - -/* a is an PRInt32, b is PRInt32, r is PRInt64 */ -#define LL_ISHL(r, a, b) { \ - if (b) { \ - PRInt64 _a; \ - _a.lo = (a); \ - _a.hi = 0; \ - if ((b) < 32) { \ - (r).lo = (a) << ((b) & 31); \ - (r).hi = ((a) >> (32 - (b))); \ - } else { \ - (r).lo = 0; \ - (r).hi = (a) << ((b) & 31); \ - } \ - } else { \ - (r).lo = (a); \ - (r).hi = 0; \ - } \ -} - -#define LL_SHR(r, a, b) { \ - if (b) { \ - PRInt64 _a; \ - _a = a; \ - if ((b) < 32) { \ - (r).lo = (_a.hi << (32 - (b))) | (_a.lo >> ((b) & 31)); \ - (r).hi = (PRInt32)_a.hi >> ((b) & 31); \ - } else { \ - (r).lo = (PRInt32)_a.hi >> ((b) & 31); \ - (r).hi = (PRInt32)_a.hi >> 31; \ - } \ - } else { \ - (r) = (a); \ - } \ -} - -#define LL_USHR(r, a, b) { \ - if (b) { \ - PRInt64 _a; \ - _a = a; \ - if ((b) < 32) { \ - (r).lo = (_a.hi << (32 - (b))) | (_a.lo >> ((b) & 31)); \ - (r).hi = _a.hi >> ((b) & 31); \ - } else { \ - (r).lo = _a.hi >> ((b) & 31); \ - (r).hi = 0; \ - } \ - } else { \ - (r) = (a); \ - } \ -} - -#define LL_L2I(i, l) ((i) = (l).lo) -#define LL_L2UI(ui, l) ((ui) = (l).lo) -#define LL_L2F(f, l) { double _d; LL_L2D(_d, l); (f) = (PRFloat64)_d; } - -#define LL_L2D(d, l) { \ - int _negative; \ - PRInt64 _absval; \ - \ - _negative = (l).hi >> 31; \ - if (_negative) { \ - LL_NEG(_absval, l); \ - } else { \ - _absval = l; \ - } \ - (d) = (double)_absval.hi * 4.294967296e9 + _absval.lo; \ - if (_negative) \ - (d) = -(d); \ -} - -#define LL_I2L(l, i) { PRInt32 _i = ((PRInt32)(i)) >> 31; (l).lo = (i); (l).hi = _i; } -#define LL_UI2L(l, ui) ((l).lo = (ui), (l).hi = 0) -#define LL_F2L(l, f) { double _d = (double)f; LL_D2L(l, _d); } - -#define LL_D2L(l, d) { \ - int _negative; \ - double _absval, _d_hi; \ - PRInt64 _lo_d; \ - \ - _negative = ((d) < 0); \ - _absval = _negative ? -(d) : (d); \ - \ - (l).hi = _absval / 4.294967296e9; \ - (l).lo = 0; \ - LL_L2D(_d_hi, l); \ - _absval -= _d_hi; \ - _lo_d.hi = 0; \ - if (_absval < 0) { \ - _lo_d.lo = -_absval; \ - LL_SUB(l, l, _lo_d); \ - } else { \ - _lo_d.lo = _absval; \ - LL_ADD(l, l, _lo_d); \ - } \ - \ - if (_negative) \ - LL_NEG(l, l); \ -} - -#endif /* !HAVE_LONG_LONG */ - -PR_END_EXTERN_C - -#endif /* prlong_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prmem.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prmem.h deleted file mode 100755 index c7cb5fb..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prmem.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* -** File: prmem.h -** Description: API to NSPR memory management functions -** -*/ -#ifndef prmem_h___ -#define prmem_h___ - -#include "prtypes.h" -#include - -PR_BEGIN_EXTERN_C - -/* -** Thread safe memory allocation. -** -** NOTE: pr wraps up malloc, free, calloc, realloc so they are already -** thread safe (and are not declared here - look in stdlib.h). -*/ - -/* -** PR_Malloc, PR_Calloc, PR_Realloc, and PR_Free have the same signatures -** as their libc equivalent malloc, calloc, realloc, and free, and have -** the same semantics. (Note that the argument type size_t is replaced -** by PRUint32.) Memory allocated by PR_Malloc, PR_Calloc, or PR_Realloc -** must be freed by PR_Free. -*/ - -NSPR_API(void *) PR_Malloc(PRUint32 size); - -NSPR_API(void *) PR_Calloc(PRUint32 nelem, PRUint32 elsize); - -NSPR_API(void *) PR_Realloc(void *ptr, PRUint32 size); - -NSPR_API(void) PR_Free(void *ptr); - -/* -** The following are some convenience macros defined in terms of -** PR_Malloc, PR_Calloc, PR_Realloc, and PR_Free. -*/ - -/*********************************************************************** -** FUNCTION: PR_MALLOC() -** DESCRIPTION: -** PR_NEW() allocates an untyped item of size _size from the heap. -** INPUTS: _size: size in bytes of item to be allocated -** OUTPUTS: untyped pointer to the node allocated -** RETURN: pointer to node or error returned from malloc(). -***********************************************************************/ -#define PR_MALLOC(_bytes) (PR_Malloc((_bytes))) - -/*********************************************************************** -** FUNCTION: PR_NEW() -** DESCRIPTION: -** PR_NEW() allocates an item of type _struct from the heap. -** INPUTS: _struct: a data type -** OUTPUTS: pointer to _struct -** RETURN: pointer to _struct or error returns from malloc(). -***********************************************************************/ -#define PR_NEW(_struct) ((_struct *) PR_MALLOC(sizeof(_struct))) - -/*********************************************************************** -** FUNCTION: PR_REALLOC() -** DESCRIPTION: -** PR_REALLOC() re-allocates _ptr bytes from the heap as a _size -** untyped item. -** INPUTS: _ptr: pointer to node to reallocate -** _size: size of node to allocate -** OUTPUTS: pointer to node allocated -** RETURN: pointer to node allocated -***********************************************************************/ -#define PR_REALLOC(_ptr, _size) (PR_Realloc((_ptr), (_size))) - -/*********************************************************************** -** FUNCTION: PR_CALLOC() -** DESCRIPTION: -** PR_CALLOC() allocates a _size bytes untyped item from the heap -** and sets the allocated memory to all 0x00. -** INPUTS: _size: size of node to allocate -** OUTPUTS: pointer to node allocated -** RETURN: pointer to node allocated -***********************************************************************/ -#define PR_CALLOC(_size) (PR_Calloc(1, (_size))) - -/*********************************************************************** -** FUNCTION: PR_NEWZAP() -** DESCRIPTION: -** PR_NEWZAP() allocates an item of type _struct from the heap -** and sets the allocated memory to all 0x00. -** INPUTS: _struct: a data type -** OUTPUTS: pointer to _struct -** RETURN: pointer to _struct -***********************************************************************/ -#define PR_NEWZAP(_struct) ((_struct*)PR_Calloc(1, sizeof(_struct))) - -/*********************************************************************** -** FUNCTION: PR_DELETE() -** DESCRIPTION: -** PR_DELETE() unallocates an object previosly allocated via PR_NEW() -** or PR_NEWZAP() to the heap. -** INPUTS: pointer to previously allocated object -** OUTPUTS: the referenced object is returned to the heap -** RETURN: void -***********************************************************************/ -#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; } - -/*********************************************************************** -** FUNCTION: PR_FREEIF() -** DESCRIPTION: -** PR_FREEIF() conditionally unallocates an object previously allocated -** vial PR_NEW() or PR_NEWZAP(). If the pointer to the object is -** equal to zero (0), the object is not released. -** INPUTS: pointer to previously allocated object -** OUTPUTS: the referenced object is conditionally returned to the heap -** RETURN: void -***********************************************************************/ -#define PR_FREEIF(_ptr) if (_ptr) PR_DELETE(_ptr) - -PR_END_EXTERN_C - -#endif /* prmem_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prmon.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prmon.h deleted file mode 100755 index 374e298..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prmon.h +++ /dev/null @@ -1,96 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef prmon_h___ -#define prmon_h___ - -#include "prtypes.h" -#include "prinrval.h" - -PR_BEGIN_EXTERN_C - -typedef struct PRMonitor PRMonitor; - -/* -** Create a new monitor. Monitors are re-entrant locks with a single built-in -** condition variable. -** -** This may fail if memory is tight or if some operating system resource -** is low. -*/ -NSPR_API(PRMonitor*) PR_NewMonitor(void); - -/* -** Destroy a monitor. The caller is responsible for guaranteeing that the -** monitor is no longer in use. There must be no thread waiting on the monitor's -** condition variable and that the lock is not held. -** -*/ -NSPR_API(void) PR_DestroyMonitor(PRMonitor *mon); - -/* -** Enter the lock associated with the monitor. If the calling thread currently -** is in the monitor, the call to enter will silently succeed. In either case, -** it will increment the entry count by one. -*/ -NSPR_API(void) PR_EnterMonitor(PRMonitor *mon); - -/* -** Decrement the entry count associated with the monitor. If the decremented -** entry count is zero, the monitor is exited. Returns PR_FAILURE if the -** calling thread has not entered the monitor. -*/ -NSPR_API(PRStatus) PR_ExitMonitor(PRMonitor *mon); - -/* -** Wait for a notify on the monitor's condition variable. Sleep for "ticks" -** amount of time (if "ticks" is PR_INTERVAL_NO_TIMEOUT then the sleep is -** indefinite). -** -** While the thread is waiting it exits the monitor (as if it called -** PR_ExitMonitor as many times as it had called PR_EnterMonitor). When -** the wait has finished the thread regains control of the monitors lock -** with the same entry count as before the wait began. -** -** The thread waiting on the monitor will be resumed when the monitor is -** notified (assuming the thread is the next in line to receive the -** notify) or when the "ticks" timeout elapses. -** -** Returns PR_FAILURE if the caller has not entered the monitor. -*/ -NSPR_API(PRStatus) PR_Wait(PRMonitor *mon, PRIntervalTime ticks); - -/* -** Notify a thread waiting on the monitor's condition variable. If a thread -** is waiting on the condition variable (using PR_Wait) then it is awakened -** and attempts to reenter the monitor. -*/ -NSPR_API(PRStatus) PR_Notify(PRMonitor *mon); - -/* -** Notify all of the threads waiting on the monitor's condition variable. -** All of threads waiting on the condition are scheduled to reenter the -** monitor. -*/ -NSPR_API(PRStatus) PR_NotifyAll(PRMonitor *mon); - -/* -** PR_ASSERT_CURRENT_THREAD_IN_MONITOR -** If the current thread is in |mon|, this assertion is guaranteed to -** succeed. Otherwise, the behavior of this function is undefined. -*/ -#if defined(DEBUG) || defined(FORCE_PR_ASSERT) -#define PR_ASSERT_CURRENT_THREAD_IN_MONITOR(/* PRMonitor* */ mon) \ - PR_AssertCurrentThreadInMonitor(mon) -#else -#define PR_ASSERT_CURRENT_THREAD_IN_MONITOR(/* PRMonitor* */ mon) -#endif - -/* Don't call this function directly. */ -NSPR_API(void) PR_AssertCurrentThreadInMonitor(PRMonitor *mon); - -PR_END_EXTERN_C - -#endif /* prmon_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prmwait.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prmwait.h deleted file mode 100755 index a902d90..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prmwait.h +++ /dev/null @@ -1,380 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#if defined(_PRMWAIT_H) -#else -#define _PRMWAIT_H - -#include "prio.h" -#include "prtypes.h" -#include "prclist.h" - -PR_BEGIN_EXTERN_C - -/********************************************************************************/ -/********************************************************************************/ -/********************************************************************************/ -/****************************** WARNING ****************************/ -/********************************************************************************/ -/**************************** This is work in progress. *************************/ -/************************** Do not make any assumptions *************************/ -/************************** about the stability of this *************************/ -/************************** API or the underlying imple- ************************/ -/************************** mentation. ************************/ -/********************************************************************************/ -/********************************************************************************/ - -/* -** STRUCTURE: PRWaitGroup -** DESCRIPTION: -** The client may define several wait groups in order to semantically -** tie a collection of file descriptors for a single purpose. This allows -** easier dispatching of threads that returned with active file descriptors -** from the wait function. -*/ -typedef struct PRWaitGroup PRWaitGroup; - -/* -** ENUMERATION: PRMWStatus -** DESCRIPTION: -** This enumeration is used to indicate the completion status of -** a receive wait object. Generally stated, a positive value indicates -** that the operation is not yet complete. A zero value indicates -** success (similar to PR_SUCCESS) and any negative value is an -** indication of failure. The reason for the failure can be retrieved -** by calling PR_GetError(). -** -** PR_MW_PENDING The operation is still pending. None of the other -** fields of the object are currently valid. -** PR_MW_SUCCESS The operation is complete and it was successful. -** PR_MW_FAILURE The operation failed. The reason for the failure -** can be retrieved by calling PR_GetError(). -** PR_MW_TIMEOUT The amount of time allowed for by the object's -** 'timeout' field has expired w/o the operation -** otherwise coming to closure. -** PR_MW_INTERRUPT The operation was cancelled, either by the client -** calling PR_CancelWaitFileDesc() or destroying the -** entire wait group (PR_DestroyWaitGroup()). -*/ -typedef enum PRMWStatus -{ - PR_MW_PENDING = 1, - PR_MW_SUCCESS = 0, - PR_MW_FAILURE = -1, - PR_MW_TIMEOUT = -2, - PR_MW_INTERRUPT = -3 -} PRMWStatus; - -/* -** STRUCTURE: PRMemoryDescriptor -** DESCRIPTION: -** THis is a descriptor for an interval of memory. It contains a -** pointer to the first byte of that memory and the length (in -** bytes) of the interval. -*/ -typedef struct PRMemoryDescriptor -{ - void *start; /* pointer to first byte of memory */ - PRSize length; /* length (in bytes) of memory interval */ -} PRMemoryDescriptor; - -/* -** STRUCTURE: PRMWaitClientData -** DESCRIPTION: -** An opague stucture for which a client MAY give provide a concrete -** definition and associate with a receive descriptor. The NSPR runtime -** does not manage this field. It is completely up to the client. -*/ -typedef struct PRMWaitClientData PRMWaitClientData; - -/* -** STRUCTURE: PRRecvWait -** DESCRIPTION: -** A receive wait object contains the file descriptor that is subject -** to the wait and the amount of time (beginning epoch established -** when the object is presented to the runtime) the the channel should -** block before abandoning the process. -** -** The success of the wait operation will be noted in the object's -** 'outcome' field. The fields are not valid when the NSPR runtime -** is in possession of the object. -** -** The memory descriptor describes an interval of writable memory -** in the caller's address space where data from an initial read -** can be placed. The description may indicate a null interval. -*/ -typedef struct PRRecvWait -{ - PRCList internal; /* internal runtime linkages */ - - PRFileDesc *fd; /* file descriptor associated w/ object */ - PRMWStatus outcome; /* outcome of the current/last operation */ - PRIntervalTime timeout; /* time allowed for entire operation */ - - PRInt32 bytesRecv; /* number of bytes transferred into buffer */ - PRMemoryDescriptor buffer; /* where to store first segment of input data */ - PRMWaitClientData *client; /* pointer to arbitrary client defined data */ -} PRRecvWait; - -/* -** STRUCTURE: PRMWaitEnumerator -** DESCRIPTION: -** An enumeration object is used to store the state of an existing -** enumeration over a wait group. The opaque object must be allocated -** by the client and the reference presented on each call to the -** pseudo-stateless enumerator. The enumeration objects are sharable -** only in serial fashion. -*/ -typedef struct PRMWaitEnumerator PRMWaitEnumerator; - - -/* -** FUNCTION: PR_AddWaitFileDesc -** DESCRIPTION: -** This function will effectively add a file descriptor to the -** list of those waiting for network receive. The new descriptor -** will be semantically tied to the wait group specified. -** -** The ownership for the storage pointed to by 'desc' is temporarily -** passed over the the NSPR runtime. It will be handed back by the -** function PR_WaitRecvReady(). -** -** INPUTS -** group A reference to a PRWaitGroup or NULL. Wait groups are -** created by calling PR_CreateWaitGroup() and are used -** to semantically group various file descriptors by the -** client's application. -** desc A reference to a valid PRRecvWait. The object of the -** reference must be preserved and not be modified -** until its ownership is returned to the client. -** RETURN -** PRStatus An indication of success. If equal to PR_FAILUE details -** of the failure are avaiable via PR_GetError(). -** -** ERRORS -** PR_INVALID_ARGUMENT_ERROR -** Invalid 'group' identifier or duplicate 'desc' object. -** PR_OUT_OF_MEMORY_ERROR -** Insuffient memory for internal data structures. -** PR_INVALID_STATE_ERROR -** The group is being destroyed. -*/ -NSPR_API(PRStatus) PR_AddWaitFileDesc(PRWaitGroup *group, PRRecvWait *desc); - -/* -** FUNCTION: PR_WaitRecvReady -** DESCRIPTION: -** PR_WaitRecvReady will block the calling thread until one of the -** file descriptors that have been added via PR_AddWaitFileDesc is -** available for input I/O. -** INPUT -** group A pointer to a valid PRWaitGroup or NULL (the null -** group. The function will block the caller until a -** channel from the wait group becomes ready for receive -** or there is some sort of error. -** RETURN -** PRReciveWait -** When the caller is resumed it is either returned a -** valid pointer to a previously added receive wait or -** a NULL. If the latter, the function has terminated -** for a reason that can be determined by calling -** PR_GetError(). -** If a valid pointer is returned, the reference is to the -** file descriptor contained in the receive wait object. -** The outcome of the wait operation may still fail, and -** if it has, that fact will be noted in the object's -** outcome field. Details can be retrieved from PR_GetError(). -** -** ERRORS -** PR_INVALID_ARGUMENT_ERROR -** The 'group' is not known by the runtime. -** PR_PENDING_INTERRUPT_ERROR - The thread was interrupted. -** PR_INVALID_STATE_ERROR -** The group is being destroyed. -*/ -NSPR_API(PRRecvWait*) PR_WaitRecvReady(PRWaitGroup *group); - -/* -** FUNCTION: PR_CancelWaitFileDesc -** DESCRIPTION: -** PR_CancelWaitFileDesc is provided as a means for cancelling operations -** on objects previously submitted by use of PR_AddWaitFileDesc(). If -** the runtime knows of the object, it will be marked as having failed -** because it was interrupted (similar to PR_Interrupt()). The first -** available thread waiting on the group will be made to return the -** PRRecvWait object with the outcome noted. -** -** INPUTS -** group The wait group under which the wait receive object was -** added. -** desc A pointer to the wait receive object that is to be -** cancelled. -** RETURN -** PRStatus If the wait receive object was located and associated -** with the specified wait group, the status returned will -** be PR_SUCCESS. There is still a race condition that would -** permit the offected object to complete normally, but it -** is assured that it will complete in the near future. -** If the receive object or wait group are invalid, the -** function will return with a status of PR_FAILURE. -** -** ERRORS -** PR_INVALID_ARGUMENT_ERROR -** The 'group' argument is not recognized as a valid group. -** PR_COLLECTION_EMPTY_ERROR -** There are no more receive wait objects in the group's -** collection. -** PR_INVALID_STATE_ERROR -** The group is being destroyed. -*/ -NSPR_API(PRStatus) PR_CancelWaitFileDesc(PRWaitGroup *group, PRRecvWait *desc); - -/* -** FUNCTION: PR_CancelWaitGroup -** DESCRIPTION: -** PR_CancelWaitGroup is provided as a means for cancelling operations -** on objects previously submitted by use of PR_AddWaitFileDesc(). Each -** successive call will return a pointer to a PRRecvWait object that -** was previously registered via PR_AddWaitFileDesc(). If no wait -** objects are associated with the wait group, a NULL will be returned. -** This function should be called in a loop until a NULL is returned -** to reclaim all the wait objects prior to calling PR_DestroyWaitGroup(). -** -** INPUTS -** group The wait group under which the wait receive object was -** added. -** RETURN -** PRRecvWait* If the wait group is valid and at least one receive wait -** object is present in the group, that object will be -** marked as PR_MW_INTERRUPT'd and removed from the group's -** queues. Otherwise a NULL will be returned and the reason -** for the NULL may be retrieved by calling PR_GetError(). -** -** ERRORS -** PR_INVALID_ARGUMENT_ERROR -** PR_GROUP_EMPTY_ERROR -*/ -NSPR_API(PRRecvWait*) PR_CancelWaitGroup(PRWaitGroup *group); - -/* -** FUNCTION: PR_CreateWaitGroup -** DESCRIPTION: -** A wait group is an opaque object that a client may create in order -** to semantically group various wait requests. Each wait group is -** unique, including the default wait group (NULL). A wait request -** that was added under a wait group will only be serviced by a caller -** that specified the same wait group. -** -** INPUT -** size The size of the hash table to be used to contain the -** receive wait objects. This is just the initial size. -** It will grow as it needs to, but to avoid that hassle -** one can suggest a suitable size initially. It should -** be ~30% larger than the maximum number of receive wait -** objects expected. -** RETURN -** PRWaitGroup If successful, the function will return a pointer to an -** object that was allocated by and owned by the runtime. -** The reference remains valid until it is explicitly destroyed -** by calling PR_DestroyWaitGroup(). -** -** ERRORS -** PR_OUT_OF_MEMORY_ERROR -*/ -NSPR_API(PRWaitGroup*) PR_CreateWaitGroup(PRInt32 size); - -/* -** FUNCTION: PR_DestroyWaitGroup -** DESCRIPTION: -** Undo the effects of PR_CreateWaitGroup(). Any receive wait operations -** on the group will be treated as if the each had been the target of a -** PR_CancelWaitFileDesc(). -** -** INPUT -** group Reference to a wait group previously allocated using -** PR_CreateWaitGroup(). -** RETURN -** PRStatus Will be PR_SUCCESS if the wait group was valid and there -** are no receive wait objects in that group. Otherwise -** will indicate PR_FAILURE. -** -** ERRORS -** PR_INVALID_ARGUMENT_ERROR -** The 'group' argument does not reference a known object. -** PR_INVALID_STATE_ERROR -** The group still contains receive wait objects. -*/ -NSPR_API(PRStatus) PR_DestroyWaitGroup(PRWaitGroup *group); - -/* -** FUNCTION: PR_CreateMWaitEnumerator -** DESCRIPTION: -** The PR_CreateMWaitEnumerator() function returns a reference to an -** opaque PRMWaitEnumerator object. The enumerator object is required -** as an argument for each successive call in the stateless enumeration -** of the indicated wait group. -** -** group The wait group that the enumeration is intended to -** process. It may be be the default wait group (NULL). -** RETURN -** PRMWaitEnumerator* group -** A reference to an object that will be used to store -** intermediate state of enumerations. -** ERRORS -** Errors are indicated by the function returning a NULL. -** PR_INVALID_ARGUMENT_ERROR -** The 'group' argument does not reference a known object. -** PR_OUT_OF_MEMORY_ERROR -*/ -NSPR_API(PRMWaitEnumerator*) PR_CreateMWaitEnumerator(PRWaitGroup *group); - -/* -** FUNCTION: PR_DestroyMWaitEnumerator -** DESCRIPTION: -** Destroys the object created by PR_CreateMWaitEnumerator(). The reference -** used as an argument becomes invalid. -** -** INPUT -** PRMWaitEnumerator* enumerator -** The PRMWaitEnumerator object to destroy. -** RETURN -** PRStatus -** PR_SUCCESS if successful, PR_FAILURE otherwise. -** ERRORS -** PR_INVALID_ARGUMENT_ERROR -** The enumerator is invalid. -*/ -NSPR_API(PRStatus) PR_DestroyMWaitEnumerator(PRMWaitEnumerator* enumerator); - -/* -** FUNCTION: PR_EnumerateWaitGroup -** DESCRIPTION: -** PR_EnumerateWaitGroup is a thread safe enumerator over a wait group. -** Each call to the enumerator must present a valid PRMWaitEnumerator -** rererence and a pointer to the "previous" element returned from the -** enumeration process or a NULL. -** -** An enumeration is started by passing a NULL as the "previous" value. -** Subsequent calls to the enumerator must pass in the result of the -** previous call. The enumeration end is signaled by the runtime returning -** a NULL as the result. -** -** Modifications to the content of the wait group are allowed during -** an enumeration. The effect is that the enumeration may have to be -** "reset" and that may result in duplicates being returned from the -** enumeration. -** -** An enumeration may be abandoned at any time. The runtime is not -** keeping any state, so there are no issues in that regard. -*/ -NSPR_API(PRRecvWait*) PR_EnumerateWaitGroup( - PRMWaitEnumerator *enumerator, const PRRecvWait *previous); - -PR_END_EXTERN_C - -#endif /* defined(_PRMWAIT_H) */ - -/* prmwait.h */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prnetdb.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prnetdb.h deleted file mode 100755 index 49b77b1..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prnetdb.h +++ /dev/null @@ -1,467 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef prnetdb_h___ -#define prnetdb_h___ - -#include "prtypes.h" -#include "prio.h" - -PR_BEGIN_EXTERN_C - - -/* - ********************************************************************* - * Translate an Internet address to/from a character string - ********************************************************************* - */ -NSPR_API(PRStatus) PR_StringToNetAddr( - const char *string, PRNetAddr *addr); - -NSPR_API(PRStatus) PR_NetAddrToString( - const PRNetAddr *addr, char *string, PRUint32 size); - -/* -** Structures returned by network data base library. All addresses are -** supplied in host order, and returned in network order (suitable for -** use in system calls). -*/ -/* -** Beware that WINSOCK.H defines h_addrtype and h_length as short. -** Client code does direct struct copies of hostent to PRHostEnt and -** hence the ifdef. -*/ -typedef struct PRHostEnt { - char *h_name; /* official name of host */ - char **h_aliases; /* alias list */ -#ifdef WIN32 - PRInt16 h_addrtype; /* host address type */ - PRInt16 h_length; /* length of address */ -#else - PRInt32 h_addrtype; /* host address type */ - PRInt32 h_length; /* length of address */ -#endif - char **h_addr_list; /* list of addresses from name server */ -} PRHostEnt; - -/* A safe size to use that will mostly work... */ -#if (defined(AIX) && defined(_THREAD_SAFE)) || defined(OSF1) -#define PR_NETDB_BUF_SIZE sizeof(struct protoent_data) -#else -#define PR_NETDB_BUF_SIZE 1024 -#endif - -/*********************************************************************** -** FUNCTION: -** DESCRIPTION: PR_GetHostByName() -** Lookup a host by name. -** -** INPUTS: -** char *hostname Character string defining the host name of interest -** char *buf A scratch buffer for the runtime to return result. -** This buffer is allocated by the caller. -** PRIntn bufsize Number of bytes in 'buf'. A recommnded value to -** use is PR_NETDB_BUF_SIZE. -** OUTPUTS: -** PRHostEnt *hostentry -** This structure is filled in by the runtime if -** the function returns PR_SUCCESS. This structure -** is allocated by the caller. -** RETURN: -** PRStatus PR_SUCCESS if the lookup succeeds. If it fails -** the result will be PR_FAILURE and the reason -** for the failure can be retrieved by PR_GetError(). -***********************************************************************/ -NSPR_API(PRStatus) PR_GetHostByName( - const char *hostname, char *buf, PRIntn bufsize, PRHostEnt *hostentry); - -/*********************************************************************** -** FUNCTION: -** DESCRIPTION: PR_GetIPNodeByName() -** Lookup a host by name. Equivalent to getipnodebyname(AI_DEFAULT) -** of RFC 2553. -** -** INPUTS: -** char *hostname Character string defining the host name of interest -** PRUint16 af Address family (either PR_AF_INET or PR_AF_INET6) -** PRIntn flags Specifies the types of addresses that are searched -** for and the types of addresses that are returned. -** The only supported flag is PR_AI_DEFAULT. -** char *buf A scratch buffer for the runtime to return result. -** This buffer is allocated by the caller. -** PRIntn bufsize Number of bytes in 'buf'. A recommnded value to -** use is PR_NETDB_BUF_SIZE. -** OUTPUTS: -** PRHostEnt *hostentry -** This structure is filled in by the runtime if -** the function returns PR_SUCCESS. This structure -** is allocated by the caller. -** RETURN: -** PRStatus PR_SUCCESS if the lookup succeeds. If it fails -** the result will be PR_FAILURE and the reason -** for the failure can be retrieved by PR_GetError(). -***********************************************************************/ - - -#define PR_AI_ALL 0x08 -#define PR_AI_V4MAPPED 0x10 -#define PR_AI_ADDRCONFIG 0x20 -#define PR_AI_NOCANONNAME 0x8000 -#define PR_AI_DEFAULT (PR_AI_V4MAPPED | PR_AI_ADDRCONFIG) - -NSPR_API(PRStatus) PR_GetIPNodeByName( - const char *hostname, - PRUint16 af, - PRIntn flags, - char *buf, - PRIntn bufsize, - PRHostEnt *hostentry); - -/*********************************************************************** -** FUNCTION: -** DESCRIPTION: PR_GetHostByAddr() -** Lookup a host entry by its network address. -** -** INPUTS: -** char *hostaddr IP address of host in question -** char *buf A scratch buffer for the runtime to return result. -** This buffer is allocated by the caller. -** PRIntn bufsize Number of bytes in 'buf'. A recommnded value to -** use is PR_NETDB_BUF_SIZE. -** OUTPUTS: -** PRHostEnt *hostentry -** This structure is filled in by the runtime if -** the function returns PR_SUCCESS. This structure -** is allocated by the caller. -** RETURN: -** PRStatus PR_SUCCESS if the lookup succeeds. If it fails -** the result will be PR_FAILURE and the reason -** for the failure can be retrieved by PR_GetError(). -***********************************************************************/ -NSPR_API(PRStatus) PR_GetHostByAddr( - const PRNetAddr *hostaddr, char *buf, PRIntn bufsize, PRHostEnt *hostentry); - -/*********************************************************************** -** FUNCTION: PR_EnumerateHostEnt() -** DESCRIPTION: -** A stateless enumerator over a PRHostEnt structure acquired from -** PR_GetHostByName() PR_GetHostByAddr() to evaluate the possible -** network addresses. -** -** INPUTS: -** PRIntn enumIndex Index of the enumeration. The enumeration starts -** and ends with a value of zero. -** -** PRHostEnt *hostEnt A pointer to a host entry struct that was -** previously returned by PR_GetHostByName() or -** PR_GetHostByAddr(). -** -** PRUint16 port The port number to be assigned as part of the -** PRNetAddr. -** -** OUTPUTS: -** PRNetAddr *address A pointer to an address structure that will be -** filled in by the call to the enumeration if the -** result of the call is greater than zero. -** -** RETURN: -** PRIntn The value that should be used for the next call -** of the enumerator ('enumIndex'). The enumeration -** is ended if this value is returned zero. -** If a value of -1 is returned, the enumeration -** has failed. The reason for the failure can be -** retrieved by calling PR_GetError(). -***********************************************************************/ -NSPR_API(PRIntn) PR_EnumerateHostEnt( - PRIntn enumIndex, const PRHostEnt *hostEnt, PRUint16 port, PRNetAddr *address); - -/*********************************************************************** -** FUNCTION: PR_InitializeNetAddr(), -** DESCRIPTION: -** Initialize the fields of a PRNetAddr, assigning well known values as -** appropriate. -** -** INPUTS -** PRNetAddrValue val The value to be assigned to the IP Address portion -** of the network address. This can only specify the -** special well known values that are equivalent to -** INADDR_ANY and INADDR_LOOPBACK. -** -** PRUint16 port The port number to be assigned in the structure. -** -** OUTPUTS: -** PRNetAddr *addr The address to be manipulated. -** -** RETURN: -** PRStatus To indicate success or failure. If the latter, the -** reason for the failure can be retrieved by calling -** PR_GetError(); -***********************************************************************/ -typedef enum PRNetAddrValue -{ - PR_IpAddrNull, /* do NOT overwrite the IP address */ - PR_IpAddrAny, /* assign logical INADDR_ANY to IP address */ - PR_IpAddrLoopback, /* assign logical INADDR_LOOPBACK */ - PR_IpAddrV4Mapped /* IPv4 mapped address */ -} PRNetAddrValue; - -NSPR_API(PRStatus) PR_InitializeNetAddr( - PRNetAddrValue val, PRUint16 port, PRNetAddr *addr); - -/*********************************************************************** -** FUNCTION: PR_SetNetAddr(), -** DESCRIPTION: -** Set the fields of a PRNetAddr, assigning well known values as -** appropriate. This function is similar to PR_InitializeNetAddr -** but differs in that the address family is specified. -** -** INPUTS -** PRNetAddrValue val The value to be assigned to the IP Address portion -** of the network address. This can only specify the -** special well known values that are equivalent to -** INADDR_ANY and INADDR_LOOPBACK. -** -** PRUint16 af The address family (either PR_AF_INET or PR_AF_INET6) -** -** PRUint16 port The port number to be assigned in the structure. -** -** OUTPUTS: -** PRNetAddr *addr The address to be manipulated. -** -** RETURN: -** PRStatus To indicate success or failure. If the latter, the -** reason for the failure can be retrieved by calling -** PR_GetError(); -***********************************************************************/ -NSPR_API(PRStatus) PR_SetNetAddr( - PRNetAddrValue val, PRUint16 af, PRUint16 port, PRNetAddr *addr); - -/*********************************************************************** -** FUNCTION: -** DESCRIPTION: PR_IsNetAddrType() -** Determine if the network address is of the specified type. -** -** INPUTS: -** const PRNetAddr *addr A network address. -** PRNetAddrValue The type of network address -** -** RETURN: -** PRBool PR_TRUE if the network address is of the -** specified type, else PR_FALSE. -***********************************************************************/ -NSPR_API(PRBool) PR_IsNetAddrType(const PRNetAddr *addr, PRNetAddrValue val); - -/*********************************************************************** -** FUNCTION: -** DESCRIPTION: PR_ConvertIPv4AddrToIPv6() -** Convert an IPv4 addr to an (IPv4-mapped) IPv6 addr -** -** INPUTS: -** PRUint32 v4addr IPv4 address -** -** OUTPUTS: -** PRIPv6Addr *v6addr The converted IPv6 address -** -** RETURN: -** void -** -***********************************************************************/ -NSPR_API(void) PR_ConvertIPv4AddrToIPv6(PRUint32 v4addr, PRIPv6Addr *v6addr); - -/*********************************************************************** -** MACRO: -** DESCRIPTION: PR_NetAddrFamily() -** Get the 'family' field of a PRNetAddr union. -** -** INPUTS: -** const PRNetAddr *addr A network address. -** -** RETURN: -** PRUint16 The 'family' field of 'addr'. -***********************************************************************/ -#define PR_NetAddrFamily(addr) ((addr)->raw.family) - -/*********************************************************************** -** MACRO: -** DESCRIPTION: PR_NetAddrInetPort() -** Get the 'port' field of a PRNetAddr union. -** -** INPUTS: -** const PRNetAddr *addr A network address. -** -** RETURN: -** PRUint16 The 'port' field of 'addr'. -***********************************************************************/ -#define PR_NetAddrInetPort(addr) \ - ((addr)->raw.family == PR_AF_INET6 ? (addr)->ipv6.port : (addr)->inet.port) - -/*********************************************************************** -** FUNCTION: -** DESCRIPTION: PR_GetProtoByName() -** Lookup a protocol entry based on protocol's name -** -** INPUTS: -** char *protocolname Character string of the protocol's name. -** char *buf A scratch buffer for the runtime to return result. -** This buffer is allocated by the caller. -** PRIntn bufsize Number of bytes in 'buf'. A recommnded value to -** use is PR_NETDB_BUF_SIZE. -** OUTPUTS: -** PRHostEnt *PRProtoEnt -** This structure is filled in by the runtime if -** the function returns PR_SUCCESS. This structure -** is allocated by the caller. -** RETURN: -** PRStatus PR_SUCCESS if the lookup succeeds. If it fails -** the result will be PR_FAILURE and the reason -** for the failure can be retrieved by PR_GetError(). -***********************************************************************/ - -typedef struct PRProtoEnt { - char *p_name; /* official protocol name */ - char **p_aliases; /* alias list */ -#ifdef WIN32 - PRInt16 p_num; /* protocol # */ -#else - PRInt32 p_num; /* protocol # */ -#endif -} PRProtoEnt; - -NSPR_API(PRStatus) PR_GetProtoByName( - const char* protocolname, char* buffer, PRInt32 bufsize, PRProtoEnt* result); - -/*********************************************************************** -** FUNCTION: -** DESCRIPTION: PR_GetProtoByNumber() -** Lookup a protocol entry based on protocol's number -** -** INPUTS: -** PRInt32 protocolnumber -** Number assigned to the protocol. -** char *buf A scratch buffer for the runtime to return result. -** This buffer is allocated by the caller. -** PRIntn bufsize Number of bytes in 'buf'. A recommnded value to -** use is PR_NETDB_BUF_SIZE. -** OUTPUTS: -** PRHostEnt *PRProtoEnt -** This structure is filled in by the runtime if -** the function returns PR_SUCCESS. This structure -** is allocated by the caller. -** RETURN: -** PRStatus PR_SUCCESS if the lookup succeeds. If it fails -** the result will be PR_FAILURE and the reason -** for the failure can be retrieved by PR_GetError(). -***********************************************************************/ -NSPR_API(PRStatus) PR_GetProtoByNumber( - PRInt32 protocolnumber, char* buffer, PRInt32 bufsize, PRProtoEnt* result); - -/*********************************************************************** -** FUNCTION: -** DESCRIPTION: PR_GetAddrInfoByName() -** Look up a host by name. Equivalent to getaddrinfo(host, NULL, ...) of -** RFC 3493. -** -** INPUTS: -** char *hostname Character string defining the host name of interest -** PRUint16 af May be PR_AF_UNSPEC or PR_AF_INET. -** PRIntn flags May be either PR_AI_ADDRCONFIG or -** PR_AI_ADDRCONFIG | PR_AI_NOCANONNAME. Include -** PR_AI_NOCANONNAME to suppress the determination of -** the canonical name corresponding to hostname. -** RETURN: -** PRAddrInfo* Handle to a data structure containing the results -** of the host lookup. Use PR_EnumerateAddrInfo to -** inspect the PRNetAddr values stored in this object. -** When no longer needed, this handle must be destroyed -** with a call to PR_FreeAddrInfo. If a lookup error -** occurs, then NULL will be returned. -***********************************************************************/ -typedef struct PRAddrInfo PRAddrInfo; - -NSPR_API(PRAddrInfo*) PR_GetAddrInfoByName( - const char *hostname, PRUint16 af, PRIntn flags); - -/*********************************************************************** -** FUNCTION: -** DESCRIPTION: PR_FreeAddrInfo() -** Destroy the PRAddrInfo handle allocated by PR_GetAddrInfoByName(). -** -** INPUTS: -** PRAddrInfo *addrInfo -** The handle resulting from a successful call to -** PR_GetAddrInfoByName(). -** RETURN: -** void -***********************************************************************/ -NSPR_API(void) PR_FreeAddrInfo(PRAddrInfo *addrInfo); - -/*********************************************************************** -** FUNCTION: -** DESCRIPTION: PR_EnumerateAddrInfo() -** A stateless enumerator over a PRAddrInfo handle acquired from -** PR_GetAddrInfoByName() to inspect the possible network addresses. -** -** INPUTS: -** void *enumPtr Index pointer of the enumeration. The enumeration -** starts and ends with a value of NULL. -** const PRAddrInfo *addrInfo -** The PRAddrInfo handle returned by a successful -** call to PR_GetAddrInfoByName(). -** PRUint16 port The port number to be assigned as part of the -** PRNetAddr. -** OUTPUTS: -** PRNetAddr *result A pointer to an address structure that will be -** filled in by the call to the enumeration if the -** result of the call is not NULL. -** RETURN: -** void* The value that should be used for the next call -** of the enumerator ('enumPtr'). The enumeration -** is ended if this value is NULL. -***********************************************************************/ -NSPR_API(void *) PR_EnumerateAddrInfo( - void *enumPtr, const PRAddrInfo *addrInfo, PRUint16 port, PRNetAddr *result); - -/*********************************************************************** -** FUNCTION: -** DESCRIPTION: PR_GetCanonNameFromAddrInfo() -** Extracts the canonical name of the hostname passed to -** PR_GetAddrInfoByName(). -** -** INPUTS: -** const PRAddrInfo *addrInfo -** The PRAddrInfo handle returned by a successful -** call to PR_GetAddrInfoByName(). -** RETURN: -** const char * A const pointer to the canonical hostname stored -** in the given PRAddrInfo handle. This pointer is -** invalidated once the PRAddrInfo handle is destroyed -** by a call to PR_FreeAddrInfo(). -***********************************************************************/ -NSPR_API(const char *) PR_GetCanonNameFromAddrInfo( - const PRAddrInfo *addrInfo); - -/*********************************************************************** -** FUNCTIONS: PR_ntohs, PR_ntohl, PR_ntohll, PR_htons, PR_htonl, PR_htonll -** -** DESCRIPTION: API entries for the common byte ordering routines. -** -** PR_ntohs 16 bit conversion from network to host -** PR_ntohl 32 bit conversion from network to host -** PR_ntohll 64 bit conversion from network to host -** PR_htons 16 bit conversion from host to network -** PR_htonl 32 bit conversion from host to network -** PR_ntonll 64 bit conversion from host to network -** -***********************************************************************/ -NSPR_API(PRUint16) PR_ntohs(PRUint16); -NSPR_API(PRUint32) PR_ntohl(PRUint32); -NSPR_API(PRUint64) PR_ntohll(PRUint64); -NSPR_API(PRUint16) PR_htons(PRUint16); -NSPR_API(PRUint32) PR_htonl(PRUint32); -NSPR_API(PRUint64) PR_htonll(PRUint64); - -PR_END_EXTERN_C - -#endif /* prnetdb_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prolock.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prolock.h deleted file mode 100755 index 4fe61f8..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prolock.h +++ /dev/null @@ -1,178 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef prolock_h___ -#define prolock_h___ - -#include "prtypes.h" - -PR_BEGIN_EXTERN_C - -/* -** A locking mechanism, built on the existing PRLock definiion, -** is provided that will permit applications to define a Lock -** Hierarchy (or Lock Ordering) schema. An application designed -** using the Ordered Lock functions will terminate with a -** diagnostic message when a lock inversion condition is -** detected. -** -** The lock ordering detection is complile-time enabled only. in -** optimized builds of NSPR, the Ordered Lock functions map -** directly to PRLock functions, providing no lock order -** detection. -** -** The Ordered Lock Facility is compiled in when DEBUG is defined at -** compile time. Ordered Lock can be forced on in optimized builds by -** defining FORCE_NSPR_ORDERED_LOCK at compile time. Both the -** application using Ordered Lock and NSPR must be compiled with the -** facility enabled to achieve the desired results. -** -** Application designers should use the macro interfaces to the Ordered -** Lock facility to ensure that it is compiled out in optimized builds. -** -** Application designers are responsible for defining their own -** lock hierarchy. -** -** Ordered Lock is thread-safe and SMP safe. -** -** See Also: prlock.h -** -** /lth. 10-Jun-1998. -** -*/ - -/* -** Opaque type for ordered lock. -** ... Don't even think of looking in here. -** -*/ - -#if defined(DEBUG) || defined(FORCE_NSPR_ORDERED_LOCKS) -typedef void * PROrderedLock; -#else -/* -** Map PROrderedLock and methods onto PRLock when ordered locking -** is not compiled in. -** -*/ -#include "prlock.h" - -typedef PRLock PROrderedLock; -#endif - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_CreateOrderedLock() -- Create an Ordered Lock -** -** DESCRIPTION: PR_CreateOrderedLock() creates an ordered lock. -** -** INPUTS: -** order: user defined order of this lock. -** name: name of the lock. For debugging purposes. -** -** OUTPUTS: returned -** -** RETURNS: PR_OrderedLock pointer -** -** RESTRICTIONS: -** -*/ -#if defined(DEBUG) || defined(FORCE_NSPR_ORDERED_LOCKS) -#define PR_CREATE_ORDERED_LOCK(order,name)\ - PR_CreateOrderedLock((order),(name)) -#else -#define PR_CREATE_ORDERED_LOCK(order) PR_NewLock() -#endif - -NSPR_API(PROrderedLock *) - PR_CreateOrderedLock( - PRInt32 order, - const char *name -); - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_DestroyOrderedLock() -- Destroy an Ordered Lock -** -** DESCRIPTION: PR_DestroyOrderedLock() destroys the ordered lock -** referenced by lock. -** -** INPUTS: lock: pointer to a PROrderedLock -** -** OUTPUTS: the lock is destroyed -** -** RETURNS: void -** -** RESTRICTIONS: -** -*/ -#if defined(DEBUG) || defined(FORCE_NSPR_ORDERED_LOCKS) -#define PR_DESTROY_ORDERED_LOCK(lock) PR_DestroyOrderedLock((lock)) -#else -#define PR_DESTROY_ORDERED_LOCK(lock) PR_DestroyLock((lock)) -#endif - -NSPR_API(void) - PR_DestroyOrderedLock( - PROrderedLock *lock -); - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_LockOrderedLock() -- Lock an ordered lock -** -** DESCRIPTION: PR_LockOrderedLock() locks the ordered lock -** referenced by lock. If the order of lock is less than or equal -** to the order of the highest lock held by the locking thread, -** the function asserts. -** -** INPUTS: lock: a pointer to a PROrderedLock -** -** OUTPUTS: The lock is held or the function asserts. -** -** RETURNS: void -** -** RESTRICTIONS: -** -*/ -#if defined(DEBUG) || defined(FORCE_NSPR_ORDERED_LOCKS) -#define PR_LOCK_ORDERED_LOCK(lock) PR_LockOrderedLock((lock)) -#else -#define PR_LOCK_ORDERED_LOCK(lock) PR_Lock((lock)) -#endif - -NSPR_API(void) - PR_LockOrderedLock( - PROrderedLock *lock -); - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_UnlockOrderedLock() -- unlock and Ordered Lock -** -** DESCRIPTION: PR_UnlockOrderedLock() unlocks the lock referenced -** by lock. -** -** INPUTS: lock: a pointer to a PROrderedLock -** -** OUTPUTS: the lock is unlocked -** -** RETURNS: -** PR_SUCCESS -** PR_FAILURE -** -** RESTRICTIONS: -** -*/ -#if defined(DEBUG) || defined(FORCE_NSPR_ORDERED_LOCKS) -#define PR_UNLOCK_ORDERED_LOCK(lock) PR_UnlockOrderedLock((lock)) -#else -#define PR_UNLOCK_ORDERED_LOCK(lock) PR_Unlock((lock)) -#endif - -NSPR_API(PRStatus) - PR_UnlockOrderedLock( - PROrderedLock *lock -); - -PR_END_EXTERN_C - -#endif /* prolock_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prpdce.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prpdce.h deleted file mode 100755 index b681795..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prpdce.h +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * File: prpdce.h - * Description: This file is the API defined to allow for DCE (aka POSIX) - * thread emulation in an NSPR environment. It is not the - * intent that this be a fully supported API. - */ - -#if !defined(PRPDCE_H) -#define PRPDCE_H - -#include "prlock.h" -#include "prcvar.h" -#include "prtypes.h" -#include "prinrval.h" - -PR_BEGIN_EXTERN_C - -#define _PR_NAKED_CV_LOCK (PRLock*)0xdce1dce1 - -/* -** Test and acquire a lock. -** -** If the lock is acquired by the calling thread, the -** return value will be PR_SUCCESS. If the lock is -** already held, by another thread or this thread, the -** result will be PR_FAILURE. -*/ -NSPR_API(PRStatus) PRP_TryLock(PRLock *lock); - -/* -** Create a naked condition variable -** -** A "naked" condition variable is one that is not created bound -** to a lock. The CV created with this function is the only type -** that may be used in the subsequent "naked" condition variable -** operations (see PRP_NakedWait, PRP_NakedNotify, PRP_NakedBroadcast); -*/ -NSPR_API(PRCondVar*) PRP_NewNakedCondVar(void); - -/* -** Destroy a naked condition variable -** -** Destroy the condition variable created by PR_NewNakedCondVar. -*/ -NSPR_API(void) PRP_DestroyNakedCondVar(PRCondVar *cvar); - -/* -** Wait on a condition -** -** Wait on the condition variable 'cvar'. It is asserted that -** the lock protecting the condition 'lock' is held by the -** calling thread. If more time expires than that declared in -** 'timeout' the condition will be notified. Waits can be -** interrupted by another thread. -** -** NB: The CV ('cvar') must be one created using PR_NewNakedCondVar. -*/ -NSPR_API(PRStatus) PRP_NakedWait( - PRCondVar *cvar, PRLock *lock, PRIntervalTime timeout); - -/* -** Notify a thread waiting on a condition -** -** Notify the condition specified 'cvar'. -** -** NB: The CV ('cvar') must be one created using PR_NewNakedCondVar. -*/ -NSPR_API(PRStatus) PRP_NakedNotify(PRCondVar *cvar); - -/* -** Notify all threads waiting on a condition -** -** Notify the condition specified 'cvar'. -** -** NB: The CV ('cvar') must be one created using PR_NewNakedCondVar. -*/ -NSPR_API(PRStatus) PRP_NakedBroadcast(PRCondVar *cvar); - -PR_END_EXTERN_C - -#endif /* PRPDCE_H */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prprf.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prprf.h deleted file mode 100755 index 440be88..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prprf.h +++ /dev/null @@ -1,122 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef prprf_h___ -#define prprf_h___ - -/* -** API for PR printf like routines. Supports the following formats -** %d - decimal -** %u - unsigned decimal -** %x - unsigned hex -** %X - unsigned uppercase hex -** %o - unsigned octal -** %hd, %hu, %hx, %hX, %ho - 16-bit versions of above -** %ld, %lu, %lx, %lX, %lo - 32-bit versions of above -** %lld, %llu, %llx, %llX, %llo - 64 bit versions of above -** %s - string -** %c - character -** %p - pointer (deals with machine dependent pointer size) -** %f - float -** %g - float -*/ -#include "prtypes.h" -#include "prio.h" -#include -#include - -PR_BEGIN_EXTERN_C - -/* -** sprintf into a fixed size buffer. Guarantees that a NUL is at the end -** of the buffer. Returns the length of the written output, NOT including -** the NUL, or (PRUint32)-1 if an error occurs. -*/ -NSPR_API(PRUint32) PR_snprintf(char *out, PRUint32 outlen, const char *fmt, ...); - -/* -** sprintf into a PR_MALLOC'd buffer. Return a pointer to the malloc'd -** buffer on success, NULL on failure. Call "PR_smprintf_free" to release -** the memory returned. -*/ -NSPR_API(char*) PR_smprintf(const char *fmt, ...); - -/* -** Free the memory allocated, for the caller, by PR_smprintf -*/ -NSPR_API(void) PR_smprintf_free(char *mem); - -/* -** "append" sprintf into a PR_MALLOC'd buffer. "last" is the last value of -** the PR_MALLOC'd buffer. sprintf will append data to the end of last, -** growing it as necessary using realloc. If last is NULL, PR_sprintf_append -** will allocate the initial string. The return value is the new value of -** last for subsequent calls, or NULL if there is a malloc failure. -*/ -NSPR_API(char*) PR_sprintf_append(char *last, const char *fmt, ...); - -/* -** sprintf into a function. The function "f" is called with a string to -** place into the output. "arg" is an opaque pointer used by the stuff -** function to hold any state needed to do the storage of the output -** data. The return value is a count of the number of characters fed to -** the stuff function, or (PRUint32)-1 if an error occurs. -*/ -typedef PRIntn (*PRStuffFunc)(void *arg, const char *s, PRUint32 slen); - -NSPR_API(PRUint32) PR_sxprintf(PRStuffFunc f, void *arg, const char *fmt, ...); - -/* -** fprintf to a PRFileDesc -*/ -NSPR_API(PRUint32) PR_fprintf(struct PRFileDesc* fd, const char *fmt, ...); - -/* -** va_list forms of the above. -*/ -NSPR_API(PRUint32) PR_vsnprintf(char *out, PRUint32 outlen, const char *fmt, va_list ap); -NSPR_API(char*) PR_vsmprintf(const char *fmt, va_list ap); -NSPR_API(char*) PR_vsprintf_append(char *last, const char *fmt, va_list ap); -NSPR_API(PRUint32) PR_vsxprintf(PRStuffFunc f, void *arg, const char *fmt, va_list ap); -NSPR_API(PRUint32) PR_vfprintf(struct PRFileDesc* fd, const char *fmt, va_list ap); - -/* -*************************************************************************** -** FUNCTION: PR_sscanf -** DESCRIPTION: -** PR_sscanf() scans the input character string, performs data -** conversions, and stores the converted values in the data objects -** pointed to by its arguments according to the format control -** string. -** -** PR_sscanf() behaves the same way as the sscanf() function in the -** Standard C Library (stdio.h), with the following exceptions: -** - PR_sscanf() handles the NSPR integer and floating point types, -** such as PRInt16, PRInt32, PRInt64, and PRFloat64, whereas -** sscanf() handles the standard C types like short, int, long, -** and double. -** - PR_sscanf() has no multibyte character support, while sscanf() -** does. -** INPUTS: -** const char *buf -** a character string holding the input to scan -** const char *fmt -** the format control string for the conversions -** ... -** variable number of arguments, each of them is a pointer to -** a data object in which the converted value will be stored -** OUTPUTS: none -** RETURNS: PRInt32 -** The number of values converted and stored. -** RESTRICTIONS: -** Multibyte characters in 'buf' or 'fmt' are not allowed. -*************************************************************************** -*/ - -NSPR_API(PRInt32) PR_sscanf(const char *buf, const char *fmt, ...); - -PR_END_EXTERN_C - -#endif /* prprf_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prproces.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prproces.h deleted file mode 100755 index 9782542..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prproces.h +++ /dev/null @@ -1,86 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef prproces_h___ -#define prproces_h___ - -#include "prtypes.h" -#include "prio.h" - -PR_BEGIN_EXTERN_C - -/************************************************************************/ -/*****************************PROCESS OPERATIONS*************************/ -/************************************************************************/ - -typedef struct PRProcess PRProcess; -typedef struct PRProcessAttr PRProcessAttr; - -NSPR_API(PRProcessAttr *) PR_NewProcessAttr(void); - -NSPR_API(void) PR_ResetProcessAttr(PRProcessAttr *attr); - -NSPR_API(void) PR_DestroyProcessAttr(PRProcessAttr *attr); - -NSPR_API(void) PR_ProcessAttrSetStdioRedirect( - PRProcessAttr *attr, - PRSpecialFD stdioFd, - PRFileDesc *redirectFd -); - -/* - * OBSOLETE -- use PR_ProcessAttrSetStdioRedirect instead. - */ -NSPR_API(void) PR_SetStdioRedirect( - PRProcessAttr *attr, - PRSpecialFD stdioFd, - PRFileDesc *redirectFd -); - -NSPR_API(PRStatus) PR_ProcessAttrSetCurrentDirectory( - PRProcessAttr *attr, - const char *dir -); - -NSPR_API(PRStatus) PR_ProcessAttrSetInheritableFD( - PRProcessAttr *attr, - PRFileDesc *fd, - const char *name -); - -/* -** Create a new process -** -** Create a new process executing the file specified as 'path' and with -** the supplied arguments and environment. -** -** This function may fail because of illegal access (permissions), -** invalid arguments or insufficient resources. -** -** A process may be created such that the creator can later synchronize its -** termination using PR_WaitProcess(). -*/ - -NSPR_API(PRProcess*) PR_CreateProcess( - const char *path, - char *const *argv, - char *const *envp, - const PRProcessAttr *attr); - -NSPR_API(PRStatus) PR_CreateProcessDetached( - const char *path, - char *const *argv, - char *const *envp, - const PRProcessAttr *attr); - -NSPR_API(PRStatus) PR_DetachProcess(PRProcess *process); - -NSPR_API(PRStatus) PR_WaitProcess(PRProcess *process, PRInt32 *exitCode); - -NSPR_API(PRStatus) PR_KillProcess(PRProcess *process); - -PR_END_EXTERN_C - -#endif /* prproces_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prrng.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prrng.h deleted file mode 100755 index 3b5a443..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prrng.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - - -/* -** prrng.h -- NSPR Random Number Generator -** -** -** lth. 29-Oct-1999. -*/ - -#ifndef prrng_h___ -#define prrng_h___ - -#include "prtypes.h" - -PR_BEGIN_EXTERN_C - -/* -** PR_GetRandomNoise() -- Get random noise from the host platform -** -** Description: -** PR_GetRandomNoise() provides, depending on platform, a random value. -** The length of the random value is dependent on platform and the -** platform's ability to provide a random value at that moment. -** -** The intent of PR_GetRandomNoise() is to provide a "seed" value for a -** another random number generator that may be suitable for -** cryptographic operations. This implies that the random value -** provided may not be, by itself, cryptographically secure. The value -** generated by PR_GetRandomNoise() is at best, extremely difficult to -** predict and is as non-deterministic as the underlying platfrom can -** provide. -** -** Inputs: -** buf -- pointer to a caller supplied buffer to contain the -** generated random number. buf must be at least as large as -** is specified in the 'size' argument. -** -** size -- the requested size of the generated random number -** -** Outputs: -** a random number provided in 'buf'. -** -** Returns: -** PRSize value equal to the size of the random number actually -** generated, or zero. The generated size may be less than the size -** requested. A return value of zero means that PR_GetRandomNoise() is -** not implemented on this platform, or there is no available noise -** available to be returned at the time of the call. -** -** Restrictions: -** Calls to PR_GetRandomNoise() may use a lot of CPU on some platforms. -** Some platforms may block for up to a few seconds while they -** accumulate some noise. Busy machines generate lots of noise, but -** care is advised when using PR_GetRandomNoise() frequently in your -** application. -** -** History: -** Parts of the model dependent implementation for PR_GetRandomNoise() -** were taken in whole or part from code previously in Netscape's NSS -** component. -** -*/ -NSPR_API(PRSize) PR_GetRandomNoise( - void *buf, - PRSize size -); - -PR_END_EXTERN_C - -#endif /* prrng_h___ */ -/* end prrng.h */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prrwlock.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prrwlock.h deleted file mode 100755 index 65d052d..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prrwlock.h +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* -** File: prrwlock.h -** Description: API to basic reader-writer lock functions of NSPR. -** -**/ - -#ifndef prrwlock_h___ -#define prrwlock_h___ - -#include "prtypes.h" - -PR_BEGIN_EXTERN_C - -/* - * PRRWLock -- - * - * The reader writer lock, PRRWLock, is an opaque object to the clients - * of NSPR. All routines operate on a pointer to this opaque entity. - */ - - -typedef struct PRRWLock PRRWLock; - -#define PR_RWLOCK_RANK_NONE 0 - - -/*********************************************************************** -** FUNCTION: PR_NewRWLock -** DESCRIPTION: -** Returns a pointer to a newly created reader-writer lock object. -** INPUTS: Lock rank -** Lock name -** OUTPUTS: void -** RETURN: PRRWLock* -** If the lock cannot be created because of resource constraints, NULL -** is returned. -** -***********************************************************************/ -NSPR_API(PRRWLock*) PR_NewRWLock(PRUint32 lock_rank, const char *lock_name); - -/*********************************************************************** -** FUNCTION: PR_DestroyRWLock -** DESCRIPTION: -** Destroys a given RW lock object. -** INPUTS: PRRWLock *lock - Lock to be freed. -** OUTPUTS: void -** RETURN: None -***********************************************************************/ -NSPR_API(void) PR_DestroyRWLock(PRRWLock *lock); - -/*********************************************************************** -** FUNCTION: PR_RWLock_Rlock -** DESCRIPTION: -** Apply a read lock (non-exclusive) on a RWLock -** INPUTS: PRRWLock *lock - Lock to be read-locked. -** OUTPUTS: void -** RETURN: None -***********************************************************************/ -NSPR_API(void) PR_RWLock_Rlock(PRRWLock *lock); - -/*********************************************************************** -** FUNCTION: PR_RWLock_Wlock -** DESCRIPTION: -** Apply a write lock (exclusive) on a RWLock -** INPUTS: PRRWLock *lock - Lock to write-locked. -** OUTPUTS: void -** RETURN: None -***********************************************************************/ -NSPR_API(void) PR_RWLock_Wlock(PRRWLock *lock); - -/*********************************************************************** -** FUNCTION: PR_RWLock_Unlock -** DESCRIPTION: -** Release a RW lock. Unlocking an unlocked lock has undefined results. -** INPUTS: PRRWLock *lock - Lock to unlocked. -** OUTPUTS: void -** RETURN: void -***********************************************************************/ -NSPR_API(void) PR_RWLock_Unlock(PRRWLock *lock); - -PR_END_EXTERN_C - -#endif /* prrwlock_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prshm.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prshm.h deleted file mode 100755 index f821a58..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prshm.h +++ /dev/null @@ -1,257 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* -** prshm.h -- NSPR Shared Memory -** -** NSPR Named Shared Memory API provides a cross-platform named -** shared-memory interface. NSPR Named Shared Memory is modeled on -** similar constructs in Unix and Windows operating systems. Shared -** memory allows multiple processes to access one or more common shared -** memory regions, using it as an inter-process communication channel. -** -** Notes on Platform Independence: -** NSPR Named Shared Memory is built on the native services offered -** by most platforms. The NSPR Named Shared Memory API tries to -** provide a least common denominator interface so that it works -** across all supported platforms. To ensure that it works everywhere, -** some platform considerations must be accomodated and the protocol -** for using NSPR Shared Memory API must be observed. -** -** Protocol: -** Multiple shared memories can be created using NSPR's Shared Memory -** feature. For each named shared memory, as defined by the name -** given in the PR_OpenSharedMemory() call, a protocol for using the -** shared memory API is required to ensure desired behavior. Failing -** to follow the protocol may yield unpredictable results. -** -** PR_OpenSharedMemory() will create the shared memory segment, if it -** does not already exist, or open a connection that the existing -** shared memory segment if it already exists. -** -** PR_AttachSharedMemory() should be called following -** PR_OpenSharedMemory() to map the memory segment to an address in -** the application's address space. -** -** PR_AttachSharedMemory() may be called to re-map a shared memory -** segment after detaching the same PRSharedMemory object. Be -** sure to detach it when done. -** -** PR_DetachSharedMemory() should be called to un-map the shared -** memory segment from the application's address space. -** -** PR_CloseSharedMemory() should be called when no further use of the -** PRSharedMemory object is required within a process. Following a -** call to PR_CloseSharedMemory() the PRSharedMemory object is -** invalid and cannot be reused. -** -** PR_DeleteSharedMemory() should be called before process -** termination. After calling PR_DeleteSharedMemory() any further use -** of the shared memory associated with the name may cause -** unpredictable results. -** -** Files: -** The name passed to PR_OpenSharedMemory() should be a valid filename -** for a unix platform. PR_OpenSharedMemory() creates file using the -** name passed in. Some platforms may mangle the name before creating -** the file and the shared memory. -** -** The unix implementation may use SysV IPC shared memory, Posix -** shared memory, or memory mapped files; the filename may used to -** define the namespace. On Windows, the name is significant, but -** there is no file associated with name. -** -** No assumptions about the persistence of data in the named file -** should be made. Depending on platform, the shared memory may be -** mapped onto system paging space and be discarded at process -** termination. -** -** All names provided to PR_OpenSharedMemory() should be valid -** filename syntax or name syntax for shared memory for the target -** platform. Referenced directories should have permissions -** appropriate for writing. -** -** Limits: -** Different platforms have limits on both the number and size of -** shared memory resources. The default system limits on some -** platforms may be smaller than your requirements. These limits may -** be adjusted on some platforms either via boot-time options or by -** setting the size of the system paging space to accomodate more -** and/or larger shared memory segment(s). -** -** Security: -** On unix platforms, depending on implementation, contents of the -** backing store for the shared memory can be exposed via the file -** system. Set permissions and or access controls at create and attach -** time to ensure you get the desired security. -** -** On windows platforms, no special security measures are provided. -** -** Example: -** The test case pr/tests/nameshm1.c provides an example of use as -** well as testing the operation of NSPR's Named Shared Memory. -** -** lth. 18-Aug-1999. -*/ - -#ifndef prshm_h___ -#define prshm_h___ - -#include "prtypes.h" -#include "prio.h" - -PR_BEGIN_EXTERN_C - -/* -** Declare opaque type PRSharedMemory. -*/ -typedef struct PRSharedMemory PRSharedMemory; - -/* -** FUNCTION: PR_OpenSharedMemory() -** -** DESCRIPTION: -** PR_OpenSharedMemory() creates a new shared-memory segment or -** associates a previously created memory segment with name. -** -** When parameter create is (PR_SHM_EXCL | PR_SHM_CREATE) and the -** shared memory already exists, the function returns NULL with the -** error set to PR_FILE_EXISTS_ERROR. -** -** When parameter create is PR_SHM_CREATE and the shared memory -** already exists, a handle to that memory segment is returned. If -** the segment does not exist, it is created and a pointer to the -** related PRSharedMemory structure is returned. -** -** When parameter create is 0, and the shared memory exists, a -** pointer to a PRSharedMemory is returned. If the shared memory does -** not exist, NULL is returned with the error set to -** PR_FILE_NOT_FOUND_ERROR. -** -** INPUTS: -** name -- the name the shared-memory segment is known as. -** size -- the size of the shared memory segment. -** flags -- Options for creating the shared memory -** mode -- Same as is passed to PR_Open() -** -** OUTPUTS: -** The shared memory is allocated. -** -** RETURNS: Pointer to opaque structure PRSharedMemory or NULL. -** NULL is returned on error. The reason for the error can be -** retrieved via PR_GetError() and PR_GetOSError(); -** -*/ -NSPR_API( PRSharedMemory * ) - PR_OpenSharedMemory( - const char *name, - PRSize size, - PRIntn flags, - PRIntn mode -); -/* Define values for PR_OpenShareMemory(...,create) */ -#define PR_SHM_CREATE 0x1 /* create if not exist */ -#define PR_SHM_EXCL 0x2 /* fail if already exists */ - -/* -** FUNCTION: PR_AttachSharedMemory() -** -** DESCRIPTION: -** PR_AttachSharedMemory() maps the shared-memory described by -** shm to the current process. -** -** INPUTS: -** shm -- The handle returned from PR_OpenSharedMemory(). -** flags -- options for mapping the shared memory. -** PR_SHM_READONLY causes the memory to be attached -** read-only. -** -** OUTPUTS: -** On success, the shared memory segment represented by shm is mapped -** into the process' address space. -** -** RETURNS: Address where shared memory is mapped, or NULL. -** NULL is returned on error. The reason for the error can be -** retrieved via PR_GetError() and PR_GetOSError(); -** -** -*/ -NSPR_API( void * ) - PR_AttachSharedMemory( - PRSharedMemory *shm, - PRIntn flags -); -/* Define values for PR_AttachSharedMemory(...,flags) */ -#define PR_SHM_READONLY 0x01 - -/* -** FUNCTION: PR_DetachSharedMemory() -** -** DESCRIPTION: -** PR_DetachSharedMemory() detaches the shared-memory described -** by shm. -** -** INPUTS: -** shm -- The handle returned from PR_OpenSharedMemory(). -** addr -- The address at which the memory was attached. -** -** OUTPUTS: -** The shared memory mapped to an address via a previous call to -** PR_AttachSharedMemory() is unmapped. -** -** RETURNS: PRStatus -** -*/ -NSPR_API( PRStatus ) - PR_DetachSharedMemory( - PRSharedMemory *shm, - void *addr -); - -/* -** FUNCTION: PR_CloseSharedMemory() -** -** DESCRIPTION: -** PR_CloseSharedMemory() closes the shared-memory described by -** shm. -** -** INPUTS: -** shm -- The handle returned from PR_OpenSharedMemory(). -** -** OUTPUTS: -** the shared memory represented by shm is closed -** -** RETURNS: PRStatus -** -*/ -NSPR_API( PRStatus ) - PR_CloseSharedMemory( - PRSharedMemory *shm -); - -/* -** FUNCTION: PR_DeleteSharedMemory() -** -** DESCRIPTION: -** The shared memory resource represented by name is released. -** -** INPUTS: -** name -- the name the shared-memory segment -** -** OUTPUTS: -** depending on platform, resources may be returned to the underlying -** operating system. -** -** RETURNS: PRStatus -** -*/ -NSPR_API( PRStatus ) - PR_DeleteSharedMemory( - const char *name -); - -PR_END_EXTERN_C - -#endif /* prshm_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prshma.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prshma.h deleted file mode 100755 index 2abc4ae..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prshma.h +++ /dev/null @@ -1,239 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* -** prshma.h -- NSPR Anonymous Shared Memory -** -** NSPR provides an anonymous shared memory based on NSPR's PRFileMap -** type. The anonymous file-mapped shared memory provides an inheritable -** shared memory, as in: the child process inherits the shared memory. -** Compare the file-mapped anonymous shared memory to to a named shared -** memory described in prshm.h. The intent is to provide a shared -** memory that is accessable only by parent and child processes. ... -** It's a security thing. -** -** Depending on the underlying platform, the file-mapped shared memory -** may be backed by a file. ... surprise! ... On some platforms, no -** real file backs the shared memory. On platforms where the shared -** memory is backed by a file, the file's name in the filesystem is -** visible to other processes for only the duration of the creation of -** the file, hopefully a very short time. This restricts processess -** that do not inherit the shared memory from opening the file and -** reading or writing its contents. Further, when all processes -** using an anonymous shared memory terminate, the backing file is -** deleted. ... If you are not paranoid, you're not paying attention. -** -** The file-mapped shared memory requires a protocol for the parent -** process and child process to share the memory. NSPR provides two -** protocols. Use one or the other; don't mix and match. -** -** In the first protocol, the job of passing the inheritable shared -** memory is done via helper-functions with PR_CreateProcess(). In the -** second protocol, the parent process is responsible for creating the -** child process; the parent and child are mutually responsible for -** passing a FileMap string. NSPR provides helper functions for -** extracting data from the PRFileMap object. ... See the examples -** below. -** -** Both sides should adhere strictly to the protocol for proper -** operation. The pseudo-code below shows the use of a file-mapped -** shared memory by a parent and child processes. In the examples, the -** server creates the file-mapped shared memory, the client attaches to -** it. -** -** First protocol. -** Server: -** -** fm = PR_OpenAnonFileMap(dirName, size, FilemapProt); -** addr = PR_MemMap(fm); -** attr = PR_NewProcessAttr(); -** PR_ProcessAttrSetInheritableFileMap( attr, fm, shmname ); -** PR_CreateProcess(Client); -** PR_DestroyProcessAttr(attr); -** ... yadda ... -** PR_MemUnmap( addr ); -** PR_CloseFileMap(fm); -** -** -** Client: -** ... started by server via PR_CreateProcess() -** fm = PR_GetInheritedFileMap( shmname ); -** addr = PR_MemMap(fm); -** ... yadda ... -** PR_MemUnmap(addr); -** PR_CloseFileMap(fm); -** -** -** Second Protocol: -** Server: -** -** fm = PR_OpenAnonFileMap(dirName, size, FilemapProt); -** fmstring = PR_ExportFileMapAsString( fm ); -** addr = PR_MemMap(fm); -** ... application specific technique to pass fmstring to child -** ... yadda ... Server uses his own magic to create child -** PR_MemUnmap( addr ); -** PR_CloseFileMap(fm); -** -** -** Client: -** ... started by server via his own magic -** ... application specific technique to find fmstring from parent -** fm = PR_ImportFileMapFromString( fmstring ) -** addr = PR_MemMap(fm); -** ... yadda ... -** PR_MemUnmap(addr); -** PR_CloseFileMap(fm); -** -** -** lth. 2-Jul-1999. -** -** Note: The second protocol was requested by NelsonB (7/1999); this is -** to accomodate servers which already create their own child processes -** using platform native methods. -** -*/ - -#ifndef prshma_h___ -#define prshma_h___ - -#include "prtypes.h" -#include "prio.h" -#include "prproces.h" - -PR_BEGIN_EXTERN_C - -/* -** PR_OpenAnonFileMap() -- Creates an anonymous file-mapped shared memory -** -** Description: -** PR_OpenAnonFileMap() creates an anonymous shared memory. If the -** shared memory already exists, a handle is returned to that shared -** memory object. -** -** On Unix platforms, PR_OpenAnonFileMap() uses 'dirName' as a -** directory name, without the trailing '/', to contain the anonymous -** file. A filename is generated for the name. -** -** On Windows platforms, dirName is ignored. -** -** Inputs: -** dirName -- A directory name to contain the anonymous file. -** size -- The size of the shared memory -** prot -- How the shared memory is mapped. See prio.h -** -** Outputs: -** PRFileMap * -** -** Returns: -** Pointer to PRFileMap or NULL on error. -** -*/ -NSPR_API( PRFileMap *) -PR_OpenAnonFileMap( - const char *dirName, - PRSize size, - PRFileMapProtect prot -); - -/* -** PR_ProcessAttrSetInheritableFileMap() -- Prepare FileMap for export -** to my children processes via PR_CreateProcess() -** -** Description: -** PR_ProcessAttrSetInheritableFileMap() connects the PRFileMap to -** PRProcessAttr with shmname. A subsequent call to PR_CreateProcess() -** makes the PRFileMap importable by the child process. -** -** Inputs: -** attr -- PRProcessAttr, used to pass data to PR_CreateProcess() -** fm -- PRFileMap structure to be passed to the child process -** shmname -- The name for the PRFileMap; used by child. -** -** Outputs: -** PRFileMap * -** -** Returns: -** PRStatus -** -*/ -NSPR_API(PRStatus) -PR_ProcessAttrSetInheritableFileMap( - PRProcessAttr *attr, - PRFileMap *fm, - const char *shmname -); - -/* -** PR_GetInheritedFileMap() -- Import a PRFileMap previously exported -** by my parent process via PR_CreateProcess() -** -** Description: -** PR_GetInheritedFileMap() retrieves a PRFileMap object exported from -** its parent process via PR_CreateProcess(). -** -** Inputs: -** shmname -- The name provided to PR_ProcessAttrSetInheritableFileMap() -** -** Outputs: -** PRFileMap * -** -** Returns: -** PRFileMap pointer or NULL. -** -*/ -NSPR_API( PRFileMap *) -PR_GetInheritedFileMap( - const char *shmname -); - -/* -** PR_ExportFileMapAsString() -- Creates a string identifying a PRFileMap -** -** Description: -** Creates an identifier, as a string, from a PRFileMap object -** previously created with PR_OpenAnonFileMap(). -** -** Inputs: -** fm -- PRFileMap pointer to be represented as a string. -** bufsize -- sizeof(buf) -** buf -- a buffer of length PR_FILEMAP_STRING_BUFSIZE -** -** Outputs: -** buf contains the stringized PRFileMap identifier -** -** Returns: -** PRStatus -** -*/ -NSPR_API( PRStatus ) -PR_ExportFileMapAsString( - PRFileMap *fm, - PRSize bufsize, - char *buf -); -#define PR_FILEMAP_STRING_BUFSIZE 128 - -/* -** PR_ImportFileMapFromString() -- Creates a PRFileMap from the identifying string -** -** Description: -** PR_ImportFileMapFromString() creates a PRFileMap object from a -** string previously created by PR_ExportFileMapAsString(). -** -** Inputs: -** fmstring -- string created by PR_ExportFileMapAsString() -** -** Returns: -** PRFileMap pointer or NULL. -** -*/ -NSPR_API( PRFileMap * ) -PR_ImportFileMapFromString( - const char *fmstring -); - -PR_END_EXTERN_C -#endif /* prshma_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prsystem.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prsystem.h deleted file mode 100755 index b3e14e7..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prsystem.h +++ /dev/null @@ -1,108 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef prsystem_h___ -#define prsystem_h___ - -/* -** API to NSPR functions returning system info. -*/ -#include "prtypes.h" - -PR_BEGIN_EXTERN_C - -/* -** Get the host' directory separator. -** Pathnames are then assumed to be of the form: -** []*() -*/ - -NSPR_API(char) PR_GetDirectorySeparator(void); - -/* -** OBSOLETE -- the function name is misspelled. -** Use PR_GetDirectorySeparator instead. -*/ - -NSPR_API(char) PR_GetDirectorySepartor(void); - -/* -** Get the host' path separator. -** Paths are assumed to be of the form: -** []* -*/ - -NSPR_API(char) PR_GetPathSeparator(void); - -/* Types of information available via PR_GetSystemInfo(...) */ -typedef enum { - PR_SI_HOSTNAME, /* the hostname with the domain name (if any) - * removed */ - PR_SI_SYSNAME, - PR_SI_RELEASE, - PR_SI_ARCHITECTURE, - PR_SI_HOSTNAME_UNTRUNCATED /* the hostname exactly as configured - * on the system */ -} PRSysInfo; - - -/* -** If successful returns a null termintated string in 'buf' for -** the information indicated in 'cmd'. If unseccussful the reason for -** the failure can be retrieved from PR_GetError(). -** -** The buffer is allocated by the caller and should be at least -** SYS_INFO_BUFFER_LENGTH bytes in length. -*/ - -#define SYS_INFO_BUFFER_LENGTH 256 - -NSPR_API(PRStatus) PR_GetSystemInfo(PRSysInfo cmd, char *buf, PRUint32 buflen); - -/* -** Return the number of bytes in a page -*/ -NSPR_API(PRInt32) PR_GetPageSize(void); - -/* -** Return log2 of the size of a page -*/ -NSPR_API(PRInt32) PR_GetPageShift(void); - -/* -** PR_GetNumberOfProcessors() -- returns the number of CPUs -** -** Description: -** PR_GetNumberOfProcessors() extracts the number of processors -** (CPUs available in an SMP system) and returns the number. -** -** Parameters: -** none -** -** Returns: -** The number of available processors or -1 on error -** -*/ -NSPR_API(PRInt32) PR_GetNumberOfProcessors( void ); - -/* -** PR_GetPhysicalMemorySize() -- returns the amount of system RAM -** -** Description: -** PR_GetPhysicalMemorySize() determines the amount of physical RAM -** in the system and returns the size in bytes. -** -** Parameters: -** none -** -** Returns: -** The amount of system RAM, or 0 on failure. -** -*/ -NSPR_API(PRUint64) PR_GetPhysicalMemorySize(void); - -PR_END_EXTERN_C - -#endif /* prsystem_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prthread.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prthread.h deleted file mode 100755 index f8b28a6..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prthread.h +++ /dev/null @@ -1,272 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef prthread_h___ -#define prthread_h___ - -/* -** API for NSPR threads. On some architectures (Mac OS Classic -** notably) pre-emptibility is not guaranteed. Hard priority scheduling -** is not guaranteed, so programming using priority based synchronization -** is a no-no. -** -** NSPR threads are scheduled based loosely on their client set priority. -** In general, a thread of a higher priority has a statistically better -** chance of running relative to threads of lower priority. However, -** NSPR uses multiple strategies to provide execution vehicles for thread -** abstraction of various host platforms. As it turns out, there is little -** NSPR can do to affect the scheduling attributes of "GLOBAL" threads. -** However, a semblance of GLOBAL threads is used to implement "LOCAL" -** threads. An arbitrary number of such LOCAL threads can be assigned to -** a single GLOBAL thread. -** -** For scheduling, NSPR will attempt to run the highest priority LOCAL -** thread associated with a given GLOBAL thread. It is further assumed -** that the host OS will apply some form of "fair" scheduling on the -** GLOBAL threads. -** -** Threads have a "system flag" which when set indicates the thread -** doesn't count for determining when the process should exit (the -** process exits when the last user thread exits). -** -** Threads also have a "scope flag" which controls whether the threads -** are scheduled in the local scope or scheduled by the OS globally. This -** indicates whether a thread is permanently bound to a native OS thread. -** An unbound thread competes for scheduling resources in the same process. -** -** Another flag is "state flag" which control whether the thread is joinable. -** It allows other threads to wait for the created thread to reach completion. -** -** Threads can have "per-thread-data" attached to them. Each thread has a -** per-thread error number and error string which are updated when NSPR -** operations fail. -*/ -#include "prtypes.h" -#include "prinrval.h" - -PR_BEGIN_EXTERN_C - -typedef struct PRThread PRThread; -typedef struct PRThreadStack PRThreadStack; - -typedef enum PRThreadType { - PR_USER_THREAD, - PR_SYSTEM_THREAD -} PRThreadType; - -typedef enum PRThreadScope { - PR_LOCAL_THREAD, - PR_GLOBAL_THREAD, - PR_GLOBAL_BOUND_THREAD -} PRThreadScope; - -typedef enum PRThreadState { - PR_JOINABLE_THREAD, - PR_UNJOINABLE_THREAD -} PRThreadState; - -typedef enum PRThreadPriority -{ - PR_PRIORITY_FIRST = 0, /* just a placeholder */ - PR_PRIORITY_LOW = 0, /* the lowest possible priority */ - PR_PRIORITY_NORMAL = 1, /* most common expected priority */ - PR_PRIORITY_HIGH = 2, /* slightly more aggressive scheduling */ - PR_PRIORITY_URGENT = 3, /* it does little good to have more than one */ - PR_PRIORITY_LAST = 3 /* this is just a placeholder */ -} PRThreadPriority; - -/* -** Create a new thread: -** "type" is the type of thread to create -** "start(arg)" will be invoked as the threads "main" -** "priority" will be created thread's priority -** "scope" will specify whether the thread is local or global -** "state" will specify whether the thread is joinable or not -** "stackSize" the size of the stack, in bytes. The value can be zero -** and then a machine specific stack size will be chosen. -** -** This can return NULL if some kind of error occurs, such as if memory is -** tight. -** -** If you want the thread to start up waiting for the creator to do -** something, enter a lock before creating the thread and then have the -** threads start routine enter and exit the same lock. When you are ready -** for the thread to run, exit the lock. -** -** If you want to detect the completion of the created thread, the thread -** should be created joinable. Then, use PR_JoinThread to synchrnoize the -** termination of another thread. -** -** When the start function returns the thread exits. If it is the last -** PR_USER_THREAD to exit then the process exits. -*/ -NSPR_API(PRThread*) PR_CreateThread(PRThreadType type, - void (PR_CALLBACK *start)(void *arg), - void *arg, - PRThreadPriority priority, - PRThreadScope scope, - PRThreadState state, - PRUint32 stackSize); - -/* -** Wait for thread termination: -** "thread" is the target thread -** -** This can return PR_FAILURE if no joinable thread could be found -** corresponding to the specified target thread. -** -** The calling thread is blocked until the target thread completes. -** Several threads cannot wait for the same thread to complete; one thread -** will operate successfully and others will terminate with an error PR_FAILURE. -** The calling thread will not be blocked if the target thread has already -** terminated. -*/ -NSPR_API(PRStatus) PR_JoinThread(PRThread *thread); - -/* -** Return the current thread object for the currently running code. -** Never returns NULL. -*/ -NSPR_API(PRThread*) PR_GetCurrentThread(void); -#ifndef NO_NSPR_10_SUPPORT -#define PR_CurrentThread() PR_GetCurrentThread() /* for nspr1.0 compat. */ -#endif /* NO_NSPR_10_SUPPORT */ - -/* -** Get the priority of "thread". -*/ -NSPR_API(PRThreadPriority) PR_GetThreadPriority(const PRThread *thread); - -/* -** Change the priority of the "thread" to "priority". -** -** PR_SetThreadPriority works in a best-effort manner. On some platforms a -** special privilege, such as root access, is required to change thread -** priorities, especially to raise thread priorities. If the caller doesn't -** have enough privileges to change thread priorites, the function has no -** effect except causing a future PR_GetThreadPriority call to return -** |priority|. -*/ -NSPR_API(void) PR_SetThreadPriority(PRThread *thread, PRThreadPriority priority); - -/* -** Set the name of the current thread, which will be visible in a debugger -** and accessible via a call to PR_GetThreadName(). -*/ -NSPR_API(PRStatus) PR_SetCurrentThreadName(const char *name); - -/* -** Return the name of "thread", if set. Otherwise return NULL. -*/ -NSPR_API(const char *) PR_GetThreadName(const PRThread *thread); - -/* -** This routine returns a new index for per-thread-private data table. -** The index is visible to all threads within a process. This index can -** be used with the PR_SetThreadPrivate() and PR_GetThreadPrivate() routines -** to save and retrieve data associated with the index for a thread. -** -** Each index is associationed with a destructor function ('dtor'). The function -** may be specified as NULL when the index is created. If it is not NULL, the -** function will be called when: -** - the thread exits and the private data for the associated index -** is not NULL, -** - new thread private data is set and the current private data is -** not NULL. -** -** The index independently maintains specific values for each binding thread. -** A thread can only get access to its own thread-specific-data. -** -** Upon a new index return the value associated with the index for all threads -** is NULL, and upon thread creation the value associated with all indices for -** that thread is NULL. -** -** Returns PR_FAILURE if the total number of indices will exceed the maximun -** allowed. -*/ -typedef void (PR_CALLBACK *PRThreadPrivateDTOR)(void *priv); - -NSPR_API(PRStatus) PR_NewThreadPrivateIndex( - PRUintn *newIndex, PRThreadPrivateDTOR destructor); - -/* -** Define some per-thread-private data. -** "tpdIndex" is an index into the per-thread private data table -** "priv" is the per-thread-private data -** -** If the per-thread private data table has a previously registered -** destructor function and a non-NULL per-thread-private data value, -** the destructor function is invoked. -** -** This can return PR_FAILURE if the index is invalid. -*/ -NSPR_API(PRStatus) PR_SetThreadPrivate(PRUintn tpdIndex, void *priv); - -/* -** Recover the per-thread-private data for the current thread. "tpdIndex" is -** the index into the per-thread private data table. -** -** The returned value may be NULL which is indistinguishable from an error -** condition. -** -** A thread can only get access to its own thread-specific-data. -*/ -NSPR_API(void*) PR_GetThreadPrivate(PRUintn tpdIndex); - -/* -** This routine sets the interrupt request for a target thread. The interrupt -** request remains in the thread's state until it is delivered exactly once -** or explicitly canceled. -** -** A thread that has been interrupted will fail all NSPR blocking operations -** that return a PRStatus (I/O, waiting on a condition, etc). -** -** PR_Interrupt may itself fail if the target thread is invalid. -*/ -NSPR_API(PRStatus) PR_Interrupt(PRThread *thread); - -/* -** Clear the interrupt request for the calling thread. If no such request -** is pending, this operation is a noop. -*/ -NSPR_API(void) PR_ClearInterrupt(void); - -/* -** Block the interrupt for the calling thread. -*/ -NSPR_API(void) PR_BlockInterrupt(void); - -/* -** Unblock the interrupt for the calling thread. -*/ -NSPR_API(void) PR_UnblockInterrupt(void); - -/* -** Make the current thread sleep until "ticks" time amount of time -** has expired. If "ticks" is PR_INTERVAL_NO_WAIT then the call is -** equivalent to calling PR_Yield. Calling PR_Sleep with an argument -** equivalent to PR_INTERVAL_NO_TIMEOUT is an error and will result -** in a PR_FAILURE error return. -*/ -NSPR_API(PRStatus) PR_Sleep(PRIntervalTime ticks); - -/* -** Get the scoping of this thread. -*/ -NSPR_API(PRThreadScope) PR_GetThreadScope(const PRThread *thread); - -/* -** Get the type of this thread. -*/ -NSPR_API(PRThreadType) PR_GetThreadType(const PRThread *thread); - -/* -** Get the join state of this thread. -*/ -NSPR_API(PRThreadState) PR_GetThreadState(const PRThread *thread); - -PR_END_EXTERN_C - -#endif /* prthread_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prtime.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prtime.h deleted file mode 100755 index 732990e..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prtime.h +++ /dev/null @@ -1,262 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - *---------------------------------------------------------------------- - * - * prtime.h -- - * - * NSPR date and time functions - * - *----------------------------------------------------------------------- - */ - -#ifndef prtime_h___ -#define prtime_h___ - -#include "prlong.h" - -PR_BEGIN_EXTERN_C - -/**********************************************************************/ -/************************* TYPES AND CONSTANTS ************************/ -/**********************************************************************/ - -#define PR_MSEC_PER_SEC 1000L -#define PR_USEC_PER_SEC 1000000L -#define PR_NSEC_PER_SEC 1000000000L -#define PR_USEC_PER_MSEC 1000L -#define PR_NSEC_PER_MSEC 1000000L - -/* - * PRTime -- - * - * NSPR represents basic time as 64-bit signed integers relative - * to midnight (00:00:00), January 1, 1970 Greenwich Mean Time (GMT). - * (GMT is also known as Coordinated Universal Time, UTC.) - * The units of time are in microseconds. Negative times are allowed - * to represent times prior to the January 1970 epoch. Such values are - * intended to be exported to other systems or converted to human - * readable form. - * - * Notes on porting: PRTime corresponds to time_t in ANSI C. NSPR 1.0 - * simply uses PRInt64. - */ - -typedef PRInt64 PRTime; - -/* - * Time zone and daylight saving time corrections applied to GMT to - * obtain the local time of some geographic location - */ - -typedef struct PRTimeParameters { - PRInt32 tp_gmt_offset; /* the offset from GMT in seconds */ - PRInt32 tp_dst_offset; /* contribution of DST in seconds */ -} PRTimeParameters; - -/* - * PRExplodedTime -- - * - * Time broken down into human-readable components such as year, month, - * day, hour, minute, second, and microsecond. Time zone and daylight - * saving time corrections may be applied. If they are applied, the - * offsets from the GMT must be saved in the 'tm_params' field so that - * all the information is available to reconstruct GMT. - * - * Notes on porting: PRExplodedTime corrresponds to struct tm in - * ANSI C, with the following differences: - * - an additional field tm_usec; - * - replacing tm_isdst by tm_params; - * - the month field is spelled tm_month, not tm_mon; - * - we use absolute year, AD, not the year since 1900. - * The corresponding type in NSPR 1.0 is called PRTime. Below is - * a table of date/time type correspondence in the three APIs: - * API time since epoch time in components - * ANSI C time_t struct tm - * NSPR 1.0 PRInt64 PRTime - * NSPR 2.0 PRTime PRExplodedTime - */ - -typedef struct PRExplodedTime { - PRInt32 tm_usec; /* microseconds past tm_sec (0-99999) */ - PRInt32 tm_sec; /* seconds past tm_min (0-61, accomodating - up to two leap seconds) */ - PRInt32 tm_min; /* minutes past tm_hour (0-59) */ - PRInt32 tm_hour; /* hours past tm_day (0-23) */ - PRInt32 tm_mday; /* days past tm_mon (1-31, note that it - starts from 1) */ - PRInt32 tm_month; /* months past tm_year (0-11, Jan = 0) */ - PRInt16 tm_year; /* absolute year, AD (note that we do not - count from 1900) */ - - PRInt8 tm_wday; /* calculated day of the week - (0-6, Sun = 0) */ - PRInt16 tm_yday; /* calculated day of the year - (0-365, Jan 1 = 0) */ - - PRTimeParameters tm_params; /* time parameters used by conversion */ -} PRExplodedTime; - -/* - * PRTimeParamFn -- - * - * A function of PRTimeParamFn type returns the time zone and - * daylight saving time corrections for some geographic location, - * given the current time in GMT. The input argument gmt should - * point to a PRExplodedTime that is in GMT, i.e., whose - * tm_params contains all 0's. - * - * For any time zone other than GMT, the computation is intended to - * consist of two steps: - * - Figure out the time zone correction, tp_gmt_offset. This number - * usually depends on the geographic location only. But it may - * also depend on the current time. For example, all of China - * is one time zone right now. But this situation may change - * in the future. - * - Figure out the daylight saving time correction, tp_dst_offset. - * This number depends on both the geographic location and the - * current time. Most of the DST rules are expressed in local - * current time. If so, one should apply the time zone correction - * to GMT before applying the DST rules. - */ - -typedef PRTimeParameters (PR_CALLBACK *PRTimeParamFn)(const PRExplodedTime *gmt); - -/**********************************************************************/ -/****************************** FUNCTIONS *****************************/ -/**********************************************************************/ - -/* - * The PR_Now routine returns the current time relative to the - * epoch, midnight, January 1, 1970 UTC. The units of the returned - * value are microseconds since the epoch. - * - * The values returned are not guaranteed to advance in a linear fashion - * due to the application of time correction protocols which synchronize - * computer clocks to some external time source. Consequently it should - * not be depended on for interval timing. - * - * The implementation is machine dependent. - * Cf. time_t time(time_t *tp) in ANSI C. - */ -NSPR_API(PRTime) -PR_Now(void); - -/* - * Expand time binding it to time parameters provided by PRTimeParamFn. - * The calculation is envisoned to proceed in the following steps: - * - From given PRTime, calculate PRExplodedTime in GMT - * - Apply the given PRTimeParamFn to the GMT that we just calculated - * to obtain PRTimeParameters. - * - Add the PRTimeParameters offsets to GMT to get the local time - * as PRExplodedTime. - */ - -NSPR_API(void) PR_ExplodeTime( - PRTime usecs, PRTimeParamFn params, PRExplodedTime *exploded); - -/* Reverse operation of PR_ExplodeTime */ -NSPR_API(PRTime) -PR_ImplodeTime(const PRExplodedTime *exploded); - -/* - * Adjust exploded time to normalize field overflows after manipulation. - * Note that the following fields of PRExplodedTime should not be - * manipulated: - * - tm_month and tm_year: because the number of days in a month and - * number of days in a year are not constant, it is ambiguous to - * manipulate the month and year fields, although one may be tempted - * to. For example, what does "a month from January 31st" mean? - * - tm_wday and tm_yday: these fields are calculated by NSPR. Users - * should treat them as "read-only". - */ - -NSPR_API(void) PR_NormalizeTime( - PRExplodedTime *exploded, PRTimeParamFn params); - -/**********************************************************************/ -/*********************** TIME PARAMETER FUNCTIONS *********************/ -/**********************************************************************/ - -/* Time parameters that suit current host machine */ -NSPR_API(PRTimeParameters) PR_LocalTimeParameters(const PRExplodedTime *gmt); - -/* Time parameters that represent Greenwich Mean Time */ -NSPR_API(PRTimeParameters) PR_GMTParameters(const PRExplodedTime *gmt); - -/* - * Time parameters that represent the US Pacific Time Zone, with the - * current daylight saving time rules (for testing only) - */ -NSPR_API(PRTimeParameters) PR_USPacificTimeParameters(const PRExplodedTime *gmt); - -/* - * This parses a time/date string into a PRExplodedTime - * struct. It populates all fields but it can't split - * the offset from UTC into tp_gmt_offset and tp_dst_offset in - * most cases (exceptions: PST/PDT, MST/MDT, CST/CDT, EST/EDT, GMT/BST). - * In those cases tp_gmt_offset will be the sum of these two and - * tp_dst_offset will be 0. - * It returns PR_SUCCESS on success, and PR_FAILURE - * if the time/date string can't be parsed. - * - * Many formats are handled, including: - * - * 14 Apr 89 03:20:12 - * 14 Apr 89 03:20 GMT - * Fri, 17 Mar 89 4:01:33 - * Fri, 17 Mar 89 4:01 GMT - * Mon Jan 16 16:12 PDT 1989 - * Mon Jan 16 16:12 +0130 1989 - * 6 May 1992 16:41-JST (Wednesday) - * 22-AUG-1993 10:59:12.82 - * 22-AUG-1993 10:59pm - * 22-AUG-1993 12:59am - * 22-AUG-1993 12:59 PM - * Friday, August 04, 1995 3:54 PM - * 06/21/95 04:24:34 PM - * 20/06/95 21:07 - * 95-06-08 19:32:48 EDT - * - * If the input string doesn't contain a description of the timezone, - * we consult the `default_to_gmt' to decide whether the string should - * be interpreted relative to the local time zone (PR_FALSE) or GMT (PR_TRUE). - * The correct value for this argument depends on what standard specified - * the time string which you are parsing. - */ - -NSPR_API(PRStatus) PR_ParseTimeStringToExplodedTime ( - const char *string, - PRBool default_to_gmt, - PRExplodedTime *result); - -/* - * This uses PR_ParseTimeStringToExplodedTime to parse - * a time/date string and PR_ImplodeTime to transform it into - * a PRTime (microseconds after "1-Jan-1970 00:00:00 GMT"). - * It returns PR_SUCCESS on success, and PR_FAILURE - * if the time/date string can't be parsed. - */ - -NSPR_API(PRStatus) PR_ParseTimeString ( - const char *string, - PRBool default_to_gmt, - PRTime *result); - -/* Format a time value into a buffer. Same semantics as strftime() */ -NSPR_API(PRUint32) PR_FormatTime(char *buf, int buflen, const char *fmt, - const PRExplodedTime *tm); - -/* Format a time value into a buffer. Time is always in US English format, regardless - * of locale setting. - */ -NSPR_API(PRUint32) -PR_FormatTimeUSEnglish( char* buf, PRUint32 bufSize, - const char* format, const PRExplodedTime* tm ); - -PR_END_EXTERN_C - -#endif /* prtime_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prtpool.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prtpool.h deleted file mode 100755 index 6a434dd..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prtpool.h +++ /dev/null @@ -1,83 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef prtpool_h___ -#define prtpool_h___ - -#include "prtypes.h" -#include "prthread.h" -#include "prio.h" -#include "prerror.h" - -/* - * NOTE: - * THIS API IS A PRELIMINARY VERSION IN NSPR 4.0 AND IS SUBJECT TO - * CHANGE - */ - -PR_BEGIN_EXTERN_C - -typedef struct PRJobIoDesc { - PRFileDesc *socket; - PRErrorCode error; - PRIntervalTime timeout; -} PRJobIoDesc; - -typedef struct PRThreadPool PRThreadPool; -typedef struct PRJob PRJob; -typedef void (PR_CALLBACK *PRJobFn) (void *arg); - -/* Create thread pool */ -NSPR_API(PRThreadPool *) -PR_CreateThreadPool(PRInt32 initial_threads, PRInt32 max_threads, - PRUint32 stacksize); - -/* queue a job */ -NSPR_API(PRJob *) -PR_QueueJob(PRThreadPool *tpool, PRJobFn fn, void *arg, PRBool joinable); - -/* queue a job, when a socket is readable */ -NSPR_API(PRJob *) -PR_QueueJob_Read(PRThreadPool *tpool, PRJobIoDesc *iod, - PRJobFn fn, void * arg, PRBool joinable); - -/* queue a job, when a socket is writeable */ -NSPR_API(PRJob *) -PR_QueueJob_Write(PRThreadPool *tpool, PRJobIoDesc *iod, - PRJobFn fn, void * arg, PRBool joinable); - -/* queue a job, when a socket has a pending connection */ -NSPR_API(PRJob *) -PR_QueueJob_Accept(PRThreadPool *tpool, PRJobIoDesc *iod, - PRJobFn fn, void * arg, PRBool joinable); - -/* queue a job, when the socket connection to addr succeeds or fails */ -NSPR_API(PRJob *) -PR_QueueJob_Connect(PRThreadPool *tpool, PRJobIoDesc *iod, - const PRNetAddr *addr, PRJobFn fn, void * arg, PRBool joinable); - -/* queue a job, when a timer exipres */ -NSPR_API(PRJob *) -PR_QueueJob_Timer(PRThreadPool *tpool, PRIntervalTime timeout, - PRJobFn fn, void * arg, PRBool joinable); -/* cancel a job */ -NSPR_API(PRStatus) -PR_CancelJob(PRJob *job); - -/* join a job */ -NSPR_API(PRStatus) -PR_JoinJob(PRJob *job); - -/* shutdown pool */ -NSPR_API(PRStatus) -PR_ShutdownThreadPool(PRThreadPool *tpool); - -/* join pool, wait for exit of all threads */ -NSPR_API(PRStatus) -PR_JoinThreadPool(PRThreadPool *tpool); - -PR_END_EXTERN_C - -#endif /* prtpool_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prtrace.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prtrace.h deleted file mode 100755 index 12a5fbf..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prtrace.h +++ /dev/null @@ -1,646 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef prtrace_h___ -#define prtrace_h___ -/* -** prtrace.h -- NSPR's Trace Facility. -** -** The Trace Facility provides a means to trace application -** program events within a process. When implementing an -** application program an engineer may insert a "Trace" function -** call, passing arguments to be traced. The "Trace" function -** combines the user trace data with identifying data and -** writes this data in time ordered sequence into a circular -** in-memory buffer; when the buffer fills, it wraps. -** -** Functions are provided to set and/or re-configure the size of -** the trace buffer, control what events are recorded in the -** buffer, enable and disable tracing based on specific user -** supplied data and other control functions. Methods are provided -** to record the trace entries in the in-memory trace buffer to -** a file. -** -** Tracing may cause a performance degredation to the application -** depending on the number and placement of calls to the tracing -** facility. When tracing is compiled in and all tracing is -** disabled via the runtime controls, the overhead should be -** minimal. ... Famous last words, eh? -** -** When DEBUG is defined at compile time, the Trace Facility is -** compiled as part of NSPR and any application using NSPR's -** header files will have tracing compiled in. When DEBUG is not -** defined, the Trace Facility is not compiled into NSPR nor -** exported in its header files. If the Trace Facility is -** desired in a non-debug build, then FORCE_NSPR_TRACE may be -** defined at compile time for both the optimized build of NSPR -** and the application. NSPR and any application using NSPR's -** Trace Facility must be compiled with the same level of trace -** conditioning or unresolved references may be realized at link -** time. -** -** For any of the Trace Facility methods that requires a trace -** handle as an input argument, the caller must ensure that the -** trace handle argument is valid. An invalid trace handle -** argument may cause unpredictable results. -** -** Trace Facility methods are thread-safe and SMP safe. -** -** Users of the Trace Facility should use the defined macros to -** invoke trace methods, not the function calls directly. e.g. -** PR_TRACE( h1,0,1,2, ...); not PR_Trace(h1,0,1,2, ...); -** -** Application designers should be aware of the effects of -** debug and optimized build differences when using result of the -** Trace Facility macros in expressions. -** -** See Also: prcountr.h -** -** /lth. 08-Jun-1998. -*/ - -#include "prtypes.h" -#include "prthread.h" -#include "prtime.h" - -PR_BEGIN_EXTERN_C - -/* -** Opaque type for the trace handle -** ... Don't even think about looking in here. -** -*/ -typedef void * PRTraceHandle; - -/* -** PRTraceEntry -- A trace entry in the in-memory trace buffer -** looks like this. -** -*/ -typedef struct PRTraceEntry -{ - PRThread *thread; /* The thread creating the trace entry */ - PRTraceHandle handle; /* PRTraceHandle creating the trace entry */ - PRTime time; /* Value of PR_Now() at time of trace entry */ - PRUint32 userData[8]; /* user supplied trace data */ -} PRTraceEntry; - -/* -** PRTraceOption -- command operands to -** PR_[Set|Get]TraceOption(). See descriptive meanings there. -** -*/ -typedef enum PRTraceOption -{ - PRTraceBufSize, - PRTraceEnable, - PRTraceDisable, - PRTraceSuspend, - PRTraceResume, - PRTraceSuspendRecording, - PRTraceResumeRecording, - PRTraceLockHandles, - PRTraceUnLockHandles, - PRTraceStopRecording -} PRTraceOption; - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_DEFINE_TRACE() -- Define a PRTraceHandle -** -** DESCRIPTION: PR_DEFINE_TRACE() is used to define a trace -** handle. -** -*/ -#define PR_DEFINE_TRACE(name) PRTraceHandle name - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_INIT_TRACE_HANDLE() -- Set the value of a PRTraceHandle -** -** DESCRIPTION: -** PR_INIT_TRACE_HANDLE() sets the value of a PRTraceHandle -** to value. e.g. PR_INIT_TRACE_HANDLE( myHandle, NULL ); -** -*/ -#if defined (DEBUG) || defined (FORCE_NSPR_TRACE) -#define PR_INIT_TRACE_HANDLE(handle,value)\ - (handle) = (PRCounterHandle)(value) -#else -#define PR_INIT_TRACE_HANDLE(handle,value) -#endif - - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_CreateTrace() -- Create a trace handle -** -** DESCRIPTION: -** PR_CreateTrace() creates a new trace handle. Tracing is -** enabled for this handle when it is created. The trace handle -** is intended for use in other Trace Facility calls. -** -** PR_CreateTrace() registers the QName, RName and description -** data so that this data can be retrieved later. -** -** INPUTS: -** qName: pointer to string. QName for this trace handle. -** -** rName: pointer to string. RName for this trace handle. -** -** description: pointer to string. Descriptive data about this -** trace handle. -** -** OUTPUTS: -** Creates the trace handle. -** Registers the QName and RName with the trace facility. -** -** RETURNS: -** PRTraceHandle -** -** RESTRICTIONS: -** qName is limited to 31 characters. -** rName is limited to 31 characters. -** description is limited to 255 characters. -** -*/ -#define PRTRACE_NAME_MAX 31 -#define PRTRACE_DESC_MAX 255 - -#if defined (DEBUG) || defined (FORCE_NSPR_TRACE) -#define PR_CREATE_TRACE(handle,qName,rName,description)\ - (handle) = PR_CreateTrace((qName),(rName),(description)) -#else -#define PR_CREATE_TRACE(handle,qName,rName,description) -#endif - -NSPR_API(PRTraceHandle) - PR_CreateTrace( - const char *qName, /* QName for this trace handle */ - const char *rName, /* RName for this trace handle */ - const char *description /* description for this trace handle */ -); - - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_DestroyTrace() -- Destroy a trace handle -** -** DESCRIPTION: -** PR_DestroyTrace() removes the referenced trace handle and -** associated QName, RName and description data from the Trace -** Facility. -** -** INPUTS: handle. A PRTraceHandle -** -** OUTPUTS: -** The trace handle is unregistered. -** The QName, RName and description are removed. -** -** RETURNS: void -** -** RESTRICTIONS: -** -*/ -#if defined (DEBUG) || defined (FORCE_NSPR_TRACE) -#define PR_DESTROY_TRACE(handle)\ - PR_DestroyTrace((handle)) -#else -#define PR_DESTROY_TRACE(handle) -#endif - -NSPR_API(void) - PR_DestroyTrace( - PRTraceHandle handle /* Handle to be destroyed */ -); - - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_Trace() -- Make a trace entry in the in-memory trace -** -** DESCRIPTION: -** PR_Trace() makes an entry in the in-memory trace buffer for -** the referenced trace handle. The next logically available -** PRTraceEntry is used; when the next trace entry would overflow -** the trace table, the table wraps. -** -** PR_Trace() for a specific trace handle may be disabled by -** calling PR_SetTraceOption() specifying PRTraceDisable for the -** trace handle to be disabled. -** -** INPUTS: -** handle: PRTraceHandle. The trace handle for this trace. -** -** userData[0..7]: unsigned 32bit integers. user supplied data -** that is copied into the PRTraceEntry -** -** OUTPUTS: -** A PRTraceEntry is (conditionally) formatted in the in-memory -** trace buffer. -** -** RETURNS: void. -** -** RESTRICTIONS: -** -*/ -#if defined (DEBUG) || defined (FORCE_NSPR_TRACE) -#define PR_TRACE(handle,ud0,ud1,ud2,ud3,ud4,ud5,ud6,ud7)\ - PR_Trace((handle),(ud0),(ud1),(ud2),(ud3),(ud4),(ud5),(ud6),(ud7)) -#else -#define PR_TRACE(handle,ud0,ud1,ud2,ud3,ud4,ud5,ud6,ud7) -#endif - -NSPR_API(void) - PR_Trace( - PRTraceHandle handle, /* use this trace handle */ - PRUint32 userData0, /* User supplied data word 0 */ - PRUint32 userData1, /* User supplied data word 1 */ - PRUint32 userData2, /* User supplied data word 2 */ - PRUint32 userData3, /* User supplied data word 3 */ - PRUint32 userData4, /* User supplied data word 4 */ - PRUint32 userData5, /* User supplied data word 5 */ - PRUint32 userData6, /* User supplied data word 6 */ - PRUint32 userData7 /* User supplied data word 7 */ -); - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_SetTraceOption() -- Control the Trace Facility -** -** DESCRIPTION: -** PR_SetTraceOption() controls the Trace Facility. Depending on -** command and value, attributes of the Trace Facility may be -** changed. -** -** INPUTS: -** command: An enumerated value in the set of PRTraceOption. -** value: pointer to the data to be set. Type of the data is -** dependent on command; for each value of command, the type -** and meaning of dereferenced value is shown. -** -** PRTraceBufSize: unsigned long: the size of the trace buffer, -** in bytes. -** -** PRTraceEnable: PRTraceHandle. The trace handle to be -** enabled. -** -** PRTraceDisable: PRTraceHandle. The trace handle to be -** disabled. -** -** PRTraceSuspend: void. value must be NULL. All tracing is -** suspended. -** -** PRTraceResume: void. value must be NULL. Tracing for all -** previously enabled, prior to a PRTraceSuspend, is resumed. -** -** PRTraceStopRecording: void. value must be NULL. If recording -** (see: ** PR_RecordTraceEntries()) is being done, -** PRTraceStopRecording causes PR_RecordTraceEntries() to return -** to its caller. If recording is not being done, this function -** has no effect. -** -** PRTraceSuspendRecording: void. Must be NULL. If recording is -** being done, PRTraceSuspendRecording causes further writes to -** the trace file to be suspended. Data in the in-memory -** trace buffer that would ordinarily be written to the -** trace file will not be written. Trace entries will continue -** to be entered in the in-memory buffer. If the Trace Facility -** recording is already in a suspended state, the call has no -** effect. -** -** PRTraceResumeRecording: void. value must be NULL. If -** recording for the Trace Facility has been previously been -** suspended, this causes recording to resume. Recording resumes -** with the next in-memory buffer segment that would be written -** if trace recording had not been suspended. If recording is -** not currently suspended, the call has no effect. -** -** PRTraceLockHandles: void. value must be NULL. Locks the -** trace handle lock. While the trace handle lock is held, -** calls to PR_CreateTrace() will block until the lock is -** released. -** -** PRTraceUnlockHandles: void. value must be NULL. Unlocks the -** trace handle lock. -** -** OUTPUTS: -** The operation of the Trace Facility may be changed. -** -** RETURNS: void -** -** RESTRICTIONS: -** -*/ -#if defined (DEBUG) || defined (FORCE_NSPR_TRACE) -#define PR_SET_TRACE_OPTION(command,value)\ - PR_SetTraceOption((command),(value)) -#else -#define PR_SET_TRACE_OPTION(command,value) -#endif - -NSPR_API(void) - PR_SetTraceOption( - PRTraceOption command, /* One of the enumerated values */ - void *value /* command value or NULL */ -); - - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_GetTraceOption() -- Retrieve settings from the Trace Facility -** -** DESCRIPTION: -** PR_GetTraceOption() retrieves the current setting of the -** Trace Facility control depending on command. -** -** -** PRTraceBufSize: unsigned long: the size of the trace buffer, -** in bytes. -** -** -** INPUTS: -** command: one of the enumerated values in PRTraceOptions -** valid for PR_GetTraceOption(). -** -** OUTPUTS: -** dependent on command. -** -** RETURNS: void -** -** RESTRICTIONS: -** -*/ -#if defined (DEBUG) || defined (FORCE_NSPR_TRACE) -#define PR_GET_TRACE_OPTION(command,value)\ - PR_GetTraceOption((command),(value)) -#else -#define PR_GET_TRACE_OPTION(command,value) -#endif - -NSPR_API(void) - PR_GetTraceOption( - PRTraceOption command, /* One of the enumerated values */ - void *value /* command value or NULL */ -); - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_GetTraceHandleFromName() -- Retrieve an existing -** handle by name. -** -** DESCRIPTION: -** PR_GetTraceHandleFromName() retreives an existing tracehandle -** using the name specified by qName and rName. -** -** INPUTS: -** qName: pointer to string. QName for this trace handle. -** -** rName: pointer to string. RName for this trace handle. -** -** -** OUTPUTS: returned. -** -** RETURNS: -** PRTraceHandle associated with qName and rName or NULL when -** there is no match. -** -** RESTRICTIONS: -** -*/ -#if defined (DEBUG) || defined (FORCE_NSPR_TRACE) -#define PR_GET_TRACE_HANDLE_FROM_NAME(handle,qName,rName)\ - (handle) = PR_GetTraceHandleFromName((qName),(rName)) -#else -#define PR_GET_TRACE_HANDLE_FROM_NAME(handle,qName,rName) -#endif - -NSPR_API(PRTraceHandle) - PR_GetTraceHandleFromName( - const char *qName, /* QName search argument */ - const char *rName /* RName search argument */ -); - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_GetTraceNameFromHandle() -- Retreive trace name -** by bandle. -** -** DESCRIPTION: -** PR_GetTraceNameFromHandle() retreives the existing qName, -** rName, and description for the referenced trace handle. -** -** INPUTS: handle: PRTraceHandle. -** -** OUTPUTS: pointers to the Trace Facility's copy of qName, -** rName and description. ... Don't mess with these values. -** They're mine. -** -** RETURNS: void -** -** RESTRICTIONS: -** -*/ -#if defined (DEBUG) || defined (FORCE_NSPR_TRACE) -#define PR_GET_TRACE_NAME_FROM_HANDLE(handle,qName,rName,description)\ - PR_GetTraceNameFromHandle((handle),(qName),(rName),(description)) -#else -#define PR_GET_TRACE_NAME_FROM_HANDLE(handle,qName,rName,description) -#endif - -NSPR_API(void) - PR_GetTraceNameFromHandle( - PRTraceHandle handle, /* handle as search argument */ - const char **qName, /* pointer to associated QName */ - const char **rName, /* pointer to associated RName */ - const char **description /* pointer to associated description */ -); - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_FindNextTraceQname() -- Retrieive a QName handle -** iterator. -** -** DESCRIPTION: -** PR_FindNextTraceQname() retreives the first or next trace -** QName handle, depending on the value of handle, from the trace -** database. The PRTraceHandle returned can be used as an -** iterator to traverse the QName handles in the Trace database. -** -** INPUTS: -** handle: When NULL, PR_FindNextQname() returns the first QName -** handle. When a handle is a valid PRTraceHandle previously -** retreived using PR_FindNextQname() the next QName handle is -** retreived. -** -** OUTPUTS: returned. -** -** RETURNS: -** PRTraceHandle or NULL when there are no trace handles. -** -** RESTRICTIONS: -** Iterating thru the trace handles via FindFirst/FindNext -** should be done under protection of the trace handle lock. -** See: PR_SetTraceOption( PRLockTraceHandles ). -** -*/ -#if defined (DEBUG) || defined (FORCE_NSPR_TRACE) -#define PR_FIND_NEXT_TRACE_QNAME(next,handle)\ - (next) = PR_FindNextTraceQname((handle)) -#else -#define PR_FIND_NEXT_TRACE_QNAME(next,handle) -#endif - -NSPR_API(PRTraceHandle) - PR_FindNextTraceQname( - PRTraceHandle handle -); - - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_FindNextTraceRname() -- Retrieive an RName handle -** iterator. -** -** DESCRIPTION: -** PR_FindNextTraceRname() retreives the first or next trace -** RName handle, depending on the value of handle, from the trace -** database. The PRTraceHandle returned can be used as an -** iterator to traverse the RName handles in the Trace database. -** -** INPUTS: -** rhandle: When NULL, PR_FindNextRname() returns the first -** RName handle. When a handle is a valid PRTraceHandle -** previously retreived using PR_FindNextRname() the next RName -** handle is retreived. -** qhandle: A valid PRTraceHandle retruned from a previous call -** to PR_FIND_NEXT_TRACE_QNAME(). -** -** OUTPUTS: returned. -** -** RETURNS: -** PRTraceHandle or NULL when there are no trace handles. -** -** RESTRICTIONS: -** Iterating thru the trace handles via FindNext should be done -** under protection of the trace handle lock. See: ( -** PR_SetTraceOption( PRLockTraceHandles ). -** -*/ -#if defined (DEBUG) || defined (FORCE_NSPR_TRACE) -#define PR_FIND_NEXT_TRACE_RNAME(next,rhandle,qhandle)\ - (next) = PR_FindNextTraceRname((rhandle),(qhandle)) -#else -#define PR_FIND_NEXT_TRACE_RNAME(next,rhandle,qhandle) -#endif - -NSPR_API(PRTraceHandle) - PR_FindNextTraceRname( - PRTraceHandle rhandle, - PRTraceHandle qhandle -); - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_RecordTraceEntries() -- Write trace entries to external media -** -** DESCRIPTION: -** PR_RecordTraceEntries() causes entries in the in-memory trace -** buffer to be written to external media. -** -** When PR_RecordTraceEntries() is called from an application -** thread, the function appears to block until another thread -** calls PR_SetTraceOption() with the PRTraceStopRecording -** option. This suggests that PR_RecordTraceEntries() should be -** called from a user supplied thread whose only job is to -** record trace entries. -** -** The environment variable NSPR_TRACE_LOG controls the operation -** of this function. When NSPR_TRACE_LOG is not defined in the -** environment, no recording of trace entries occurs. When -** NSPR_TRACE_LOG is defined, the value of its definition must be -** the filename of the file to receive the trace entry buffer. -** -** PR_RecordTraceEntries() attempts to record the in-memory -** buffer to a file, subject to the setting of the environment -** variable NSPR_TRACE_LOG. It is possible because of system -** load, the thread priority of the recording thread, number of -** active trace records being written over time, and other -** variables that some trace records can be lost. ... In other -** words: don't bet the farm on getting everything. -** -** INPUTS: none -** -** OUTPUTS: none -** -** RETURNS: PR_STATUS -** PR_SUCCESS no errors were found. -** PR_FAILURE errors were found. -** -** RESTRICTIONS: -** Only one thread can call PR_RecordTraceEntries() within a -** process. -** -** On error, PR_RecordTraceEntries() may return prematurely. -** -*/ -#if defined (DEBUG) || defined (FORCE_NSPR_TRACE) -#define PR_RECORD_TRACE_ENTRIES()\ - PR_RecordTraceEntries() -#else -#define PR_RECORD_TRACE_ENTRIES() -#endif - -NSPR_API(void) - PR_RecordTraceEntries( - void -); - -/* ----------------------------------------------------------------------- -** FUNCTION: PR_GetTraceEntries() -- Retreive trace entries from -** the Trace Facility -** -** DESCRIPTION: -** PR_GetTraceEntries() retreives trace entries from the Trace -** Facility. Up to count trace entries are copied from the Trace -** Facility into buffer. Only those trace entries that have not -** been copied via a previous call to PR_GetTraceEntries() are -** copied. The actual number copied is placed in the PRInt32 -** variable pointed to by found. -** -** If more than count trace entries have entered the Trace -** Facility since the last call to PR_GetTraceEntries() -** a lost data condition is returned. In this case, the most -** recent count trace entries are copied into buffer and found is -** set to count. -** -** INPUTS: -** count. The number of trace entries to be copied into buffer. -** -** -** OUTPUTS: -** buffer. An array of PRTraceEntries. The buffer is supplied -** by the caller. -** -** found: 32bit signed integer. The number of PRTraceEntries -** actually copied. found is always less than or equal to count. -** -** RETURNS: -** zero when there is no lost data. -** non-zero when some PRTraceEntries have been lost. -** -** RESTRICTIONS: -** This is a real performance pig. The copy out operation is bad -** enough, but depending on then frequency of calls to the -** function, serious performance impact to the operating -** application may be realized. ... YMMV. -** -*/ -#if defined (DEBUG) || defined (FORCE_NSPR_TRACE) -#define PR_GET_TRACE_ENTRIES(buffer,count,found)\ - PR_GetTraceEntries((buffer),(count),(found)) -#else -#define PR_GET_TRACE_ENTRIES(buffer,count,found) -#endif - -NSPR_API(PRIntn) - PR_GetTraceEntries( - PRTraceEntry *buffer, /* where to write output */ - PRInt32 count, /* number to get */ - PRInt32 *found /* number you got */ -); - -PR_END_EXTERN_C - -#endif /* prtrace_h___ */ - diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prtypes.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prtypes.h deleted file mode 100755 index 1e2641b..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prtypes.h +++ /dev/null @@ -1,581 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* -** File: prtypes.h -** Description: Definitions of NSPR's basic types -** -** Prototypes and macros used to make up for deficiencies that we have found -** in ANSI environments. -** -** Since we do not wrap and all the other standard headers, authors -** of portable code will not know in general that they need these definitions. -** Instead of requiring these authors to find the dependent uses in their code -** and take the following steps only in those C files, we take steps once here -** for all C files. -**/ - -#ifndef prtypes_h___ -#define prtypes_h___ - -#ifdef MDCPUCFG -#include MDCPUCFG -#else -#include "prcpucfg.h" -#endif - -#include - -/*********************************************************************** -** MACROS: PR_EXTERN -** PR_IMPLEMENT -** DESCRIPTION: -** These are only for externally visible routines and globals. For -** internal routines, just use "extern" for type checking and that -** will not export internal cross-file or forward-declared symbols. -** Define a macro for declaring procedures return types. We use this to -** deal with windoze specific type hackery for DLL definitions. Use -** PR_EXTERN when the prototype for the method is declared. Use -** PR_IMPLEMENT for the implementation of the method. -** -** Example: -** in dowhim.h -** PR_EXTERN( void ) DoWhatIMean( void ); -** in dowhim.c -** PR_IMPLEMENT( void ) DoWhatIMean( void ) { return; } -** -** -***********************************************************************/ -#if defined(NSPR_STATIC) - -#define PR_EXPORT(__type) extern __type -#define PR_EXPORT_DATA(__type) extern __type -#define PR_IMPORT(__type) extern __type -#define PR_IMPORT_DATA(__type) extern __type - -#define PR_EXTERN(__type) extern __type -#define PR_IMPLEMENT(__type) __type -#define PR_EXTERN_DATA(__type) extern __type -#define PR_IMPLEMENT_DATA(__type) __type - -#define PR_CALLBACK -#define PR_CALLBACK_DECL -#define PR_STATIC_CALLBACK(__x) static __x - -#elif defined(WIN32) - -#define PR_EXPORT(__type) extern __declspec(dllexport) __type -#define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type -#define PR_IMPORT(__type) __declspec(dllimport) __type -#define PR_IMPORT_DATA(__type) __declspec(dllimport) __type - -#define PR_EXTERN(__type) extern __declspec(dllexport) __type -#define PR_IMPLEMENT(__type) __declspec(dllexport) __type -#define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type -#define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type - -#define PR_CALLBACK -#define PR_CALLBACK_DECL -#define PR_STATIC_CALLBACK(__x) static __x - -#elif defined(XP_BEOS) - -#define PR_EXPORT(__type) extern __declspec(dllexport) __type -#define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type -#define PR_IMPORT(__type) extern __declspec(dllexport) __type -#define PR_IMPORT_DATA(__type) extern __declspec(dllexport) __type - -#define PR_EXTERN(__type) extern __declspec(dllexport) __type -#define PR_IMPLEMENT(__type) __declspec(dllexport) __type -#define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type -#define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type - -#define PR_CALLBACK -#define PR_CALLBACK_DECL -#define PR_STATIC_CALLBACK(__x) static __x - -#elif defined(XP_OS2) && defined(__declspec) - -#define PR_EXPORT(__type) extern __declspec(dllexport) __type -#define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type -#define PR_IMPORT(__type) extern __declspec(dllimport) __type -#define PR_IMPORT_DATA(__type) extern __declspec(dllimport) __type - -#define PR_EXTERN(__type) extern __declspec(dllexport) __type -#define PR_IMPLEMENT(__type) __declspec(dllexport) __type -#define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type -#define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type - -#define PR_CALLBACK -#define PR_CALLBACK_DECL -#define PR_STATIC_CALLBACK(__x) static __x - -#elif defined(SYMBIAN) - -#define PR_EXPORT(__type) extern __declspec(dllexport) __type -#define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type -#ifdef __WINS__ -#define PR_IMPORT(__type) extern __declspec(dllexport) __type -#define PR_IMPORT_DATA(__type) extern __declspec(dllexport) __type -#else -#define PR_IMPORT(__type) extern __declspec(dllimport) __type -#define PR_IMPORT_DATA(__type) extern __declspec(dllimport) __type -#endif - -#define PR_EXTERN(__type) extern __type -#define PR_IMPLEMENT(__type) __type -#define PR_EXTERN_DATA(__type) extern __type -#define PR_IMPLEMENT_DATA(__type) __type - -#define PR_CALLBACK -#define PR_CALLBACK_DECL -#define PR_STATIC_CALLBACK(__x) static __x - -#else /* Unix */ - -/* GCC 3.3 and later support the visibility attribute. */ -#if (__GNUC__ >= 4) || \ - (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) -#define PR_VISIBILITY_DEFAULT __attribute__((visibility("default"))) -#else -#define PR_VISIBILITY_DEFAULT -#endif - -#define PR_EXPORT(__type) extern PR_VISIBILITY_DEFAULT __type -#define PR_EXPORT_DATA(__type) extern PR_VISIBILITY_DEFAULT __type -#define PR_IMPORT(__type) extern PR_VISIBILITY_DEFAULT __type -#define PR_IMPORT_DATA(__type) extern PR_VISIBILITY_DEFAULT __type - -#define PR_EXTERN(__type) extern PR_VISIBILITY_DEFAULT __type -#define PR_IMPLEMENT(__type) PR_VISIBILITY_DEFAULT __type -#define PR_EXTERN_DATA(__type) extern PR_VISIBILITY_DEFAULT __type -#define PR_IMPLEMENT_DATA(__type) PR_VISIBILITY_DEFAULT __type -#define PR_CALLBACK -#define PR_CALLBACK_DECL -#define PR_STATIC_CALLBACK(__x) static __x - -#endif - -#if defined(_NSPR_BUILD_) -#define NSPR_API(__type) PR_EXPORT(__type) -#define NSPR_DATA_API(__type) PR_EXPORT_DATA(__type) -#else -#define NSPR_API(__type) PR_IMPORT(__type) -#define NSPR_DATA_API(__type) PR_IMPORT_DATA(__type) -#endif - -/*********************************************************************** -** MACROS: PR_BEGIN_MACRO -** PR_END_MACRO -** DESCRIPTION: -** Macro body brackets so that macros with compound statement definitions -** behave syntactically more like functions when called. -***********************************************************************/ -#define PR_BEGIN_MACRO do { -#define PR_END_MACRO } while (0) - -/*********************************************************************** -** MACROS: PR_BEGIN_EXTERN_C -** PR_END_EXTERN_C -** DESCRIPTION: -** Macro shorthands for conditional C++ extern block delimiters. -***********************************************************************/ -#ifdef __cplusplus -#define PR_BEGIN_EXTERN_C extern "C" { -#define PR_END_EXTERN_C } -#else -#define PR_BEGIN_EXTERN_C -#define PR_END_EXTERN_C -#endif - -/*********************************************************************** -** MACROS: PR_BIT -** PR_BITMASK -** DESCRIPTION: -** Bit masking macros. XXX n must be <= 31 to be portable -***********************************************************************/ -#define PR_BIT(n) ((PRUint32)1 << (n)) -#define PR_BITMASK(n) (PR_BIT(n) - 1) - -/*********************************************************************** -** MACROS: PR_ROUNDUP -** PR_MIN -** PR_MAX -** PR_ABS -** DESCRIPTION: -** Commonly used macros for operations on compatible types. -***********************************************************************/ -#define PR_ROUNDUP(x,y) ((((x)+((y)-1))/(y))*(y)) -#define PR_MIN(x,y) ((x)<(y)?(x):(y)) -#define PR_MAX(x,y) ((x)>(y)?(x):(y)) -#define PR_ABS(x) ((x)<0?-(x):(x)) - -/*********************************************************************** -** MACROS: PR_ARRAY_SIZE -** DESCRIPTION: -** The number of elements in an array. -***********************************************************************/ -#define PR_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0])) - -PR_BEGIN_EXTERN_C - -/* -** Starting in NSPR 4.9.5, NSPR's exact-width integer types should match -** the exact-width integer types defined in . This allows sloppy -** code to use PRInt{N} and int{N}_t interchangeably. -** -** The 8-bit and 16-bit integer types can only be defined using char and -** short. All platforms define the 32-bit integer types using int. So only -** the 64-bit integer types could be defined differently. -** -** NSPR's original strategy was to use the "shortest" 64-bit integer type: -** if long is 64-bit, then prefer it over long long. This strategy is also -** used by Linux/glibc, FreeBSD, and NetBSD. -** -** Other platforms use a different strategy: simply define the 64-bit -** integer types using long long. We define the PR_ALTERNATE_INT64_TYPEDEF -** macro on these platforms. Note that PR_ALTERNATE_INT64_TYPEDEF is for -** internal use by NSPR headers only. Do not define or test this macro in -** your code. -** -** NOTE: NSPR can't use because C99 requires C++ code to define -** __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS to make all the macros -** defined in available. This strange requirement is gone in -** C11. When most platforms ignore this C99 requirement, NSPR will be able -** to use . A patch to do that is in NSPR bug 634793. -*/ - -#if defined(__APPLE__) || defined(__ANDROID__) || defined(__OpenBSD__) -#define PR_ALTERNATE_INT64_TYPEDEF -#endif - -/************************************************************************ -** TYPES: PRUint8 -** PRInt8 -** DESCRIPTION: -** The int8 types are known to be 8 bits each. There is no type that -** is equivalent to a plain "char". -************************************************************************/ -#if PR_BYTES_PER_BYTE == 1 -typedef unsigned char PRUint8; -/* -** Some cfront-based C++ compilers do not like 'signed char' and -** issue the warning message: -** warning: "signed" not implemented (ignored) -** For these compilers, we have to define PRInt8 as plain 'char'. -** Make sure that plain 'char' is indeed signed under these compilers. -*/ -#if (defined(HPUX) && defined(__cplusplus) \ - && !defined(__GNUC__) && __cplusplus < 199707L) \ - || (defined(SCO) && defined(__cplusplus) \ - && !defined(__GNUC__) && __cplusplus == 1L) -typedef char PRInt8; -#else -typedef signed char PRInt8; -#endif -#else -#error No suitable type for PRInt8/PRUint8 -#endif - -/************************************************************************ - * MACROS: PR_INT8_MAX - * PR_INT8_MIN - * PR_UINT8_MAX - * DESCRIPTION: - * The maximum and minimum values of a PRInt8 or PRUint8. -************************************************************************/ - -#define PR_INT8_MAX 127 -#define PR_INT8_MIN (-128) -#define PR_UINT8_MAX 255U - -/************************************************************************ -** TYPES: PRUint16 -** PRInt16 -** DESCRIPTION: -** The int16 types are known to be 16 bits each. -************************************************************************/ -#if PR_BYTES_PER_SHORT == 2 -typedef unsigned short PRUint16; -typedef short PRInt16; -#else -#error No suitable type for PRInt16/PRUint16 -#endif - -/************************************************************************ - * MACROS: PR_INT16_MAX - * PR_INT16_MIN - * PR_UINT16_MAX - * DESCRIPTION: - * The maximum and minimum values of a PRInt16 or PRUint16. -************************************************************************/ - -#define PR_INT16_MAX 32767 -#define PR_INT16_MIN (-32768) -#define PR_UINT16_MAX 65535U - -/************************************************************************ -** TYPES: PRUint32 -** PRInt32 -** DESCRIPTION: -** The int32 types are known to be 32 bits each. -************************************************************************/ -#if PR_BYTES_PER_INT == 4 -typedef unsigned int PRUint32; -typedef int PRInt32; -#define PR_INT32(x) x -#define PR_UINT32(x) x ## U -#elif PR_BYTES_PER_LONG == 4 -typedef unsigned long PRUint32; -typedef long PRInt32; -#define PR_INT32(x) x ## L -#define PR_UINT32(x) x ## UL -#else -#error No suitable type for PRInt32/PRUint32 -#endif - -/************************************************************************ - * MACROS: PR_INT32_MAX - * PR_INT32_MIN - * PR_UINT32_MAX - * DESCRIPTION: - * The maximum and minimum values of a PRInt32 or PRUint32. -************************************************************************/ - -#define PR_INT32_MAX PR_INT32(2147483647) -#define PR_INT32_MIN (-PR_INT32_MAX - 1) -#define PR_UINT32_MAX PR_UINT32(4294967295) - -/************************************************************************ -** TYPES: PRUint64 -** PRInt64 -** DESCRIPTION: -** The int64 types are known to be 64 bits each. Care must be used when -** declaring variables of type PRUint64 or PRInt64. Different hardware -** architectures and even different compilers have varying support for -** 64 bit values. The only guaranteed portability requires the use of -** the LL_ macros (see prlong.h). -** -** MACROS: PR_INT64 -** PR_UINT64 -** DESCRIPTION: -** The PR_INT64 and PR_UINT64 macros provide a portable way for -** specifying 64-bit integer constants. They can only be used if -** PRInt64 and PRUint64 are defined as compiler-supported 64-bit -** integer types (i.e., if HAVE_LONG_LONG is defined, which is true -** for all the supported compilers topday). If PRInt64 and PRUint64 -** are defined as structs, the LL_INIT macro defined in prlong.h has -** to be used. -** -** MACROS: PR_INT64_MAX -** PR_INT64_MIN -** PR_UINT64_MAX -** DESCRIPTION: -** The maximum and minimum values of a PRInt64 or PRUint64. -************************************************************************/ -#ifdef HAVE_LONG_LONG -/* Keep this in sync with prlong.h. */ -#if PR_BYTES_PER_LONG == 8 && !defined(PR_ALTERNATE_INT64_TYPEDEF) -typedef long PRInt64; -typedef unsigned long PRUint64; -#define PR_INT64(x) x ## L -#define PR_UINT64(x) x ## UL -#elif defined(WIN32) && !defined(__GNUC__) -typedef __int64 PRInt64; -typedef unsigned __int64 PRUint64; -#define PR_INT64(x) x ## i64 -#define PR_UINT64(x) x ## ui64 -#else -typedef long long PRInt64; -typedef unsigned long long PRUint64; -#define PR_INT64(x) x ## LL -#define PR_UINT64(x) x ## ULL -#endif /* PR_BYTES_PER_LONG == 8 */ - -#define PR_INT64_MAX PR_INT64(0x7fffffffffffffff) -#define PR_INT64_MIN (-PR_INT64_MAX - 1) -#define PR_UINT64_MAX PR_UINT64(-1) -#else /* !HAVE_LONG_LONG */ -typedef struct { -#ifdef IS_LITTLE_ENDIAN - PRUint32 lo, hi; -#else - PRUint32 hi, lo; -#endif -} PRInt64; -typedef PRInt64 PRUint64; - -#define PR_INT64_MAX (PRInt64){0x7fffffff, 0xffffffff} -#define PR_INT64_MIN (PRInt64){0xffffffff, 0xffffffff} -#define PR_UINT64_MAX (PRUint64){0xffffffff, 0xffffffff} - -#endif /* !HAVE_LONG_LONG */ - -/************************************************************************ -** TYPES: PRUintn -** PRIntn -** DESCRIPTION: -** The PRIntn types are most appropriate for automatic variables. They are -** guaranteed to be at least 16 bits, though various architectures may -** define them to be wider (e.g., 32 or even 64 bits). These types are -** never valid for fields of a structure. -************************************************************************/ -#if PR_BYTES_PER_INT >= 2 -typedef int PRIntn; -typedef unsigned int PRUintn; -#else -#error 'sizeof(int)' not sufficient for platform use -#endif - -/************************************************************************ -** TYPES: PRFloat64 -** DESCRIPTION: -** NSPR's floating point type is always 64 bits. -************************************************************************/ -typedef double PRFloat64; - -/************************************************************************ -** TYPES: PRSize -** DESCRIPTION: -** A type for representing the size of objects. -************************************************************************/ -typedef size_t PRSize; - - -/************************************************************************ -** TYPES: PROffset32, PROffset64 -** DESCRIPTION: -** A type for representing byte offsets from some location. -************************************************************************/ -typedef PRInt32 PROffset32; -typedef PRInt64 PROffset64; - -/************************************************************************ -** TYPES: PRPtrDiff -** DESCRIPTION: -** A type for pointer difference. Variables of this type are suitable -** for storing a pointer or pointer subtraction. -************************************************************************/ -typedef ptrdiff_t PRPtrdiff; - -/************************************************************************ -** TYPES: PRUptrdiff -** DESCRIPTION: -** A type for pointer difference. Variables of this type are suitable -** for storing a pointer or pointer sutraction. -************************************************************************/ -#ifdef _WIN64 -typedef PRUint64 PRUptrdiff; -#else -typedef unsigned long PRUptrdiff; -#endif - -/************************************************************************ -** TYPES: PRBool -** DESCRIPTION: -** Use PRBool for variables and parameter types. Use PR_FALSE and PR_TRUE -** for clarity of target type in assignments and actual arguments. Use -** 'if (bool)', 'while (!bool)', '(bool) ? x : y' etc., to test booleans -** just as you would C int-valued conditions. -************************************************************************/ -typedef PRIntn PRBool; -#define PR_TRUE 1 -#define PR_FALSE 0 - -/************************************************************************ -** TYPES: PRPackedBool -** DESCRIPTION: -** Use PRPackedBool within structs where bitfields are not desirable -** but minimum and consistant overhead matters. -************************************************************************/ -typedef PRUint8 PRPackedBool; - -/* -** Status code used by some routines that have a single point of failure or -** special status return. -*/ -typedef enum { PR_FAILURE = -1, PR_SUCCESS = 0 } PRStatus; - -#ifndef __PRUNICHAR__ -#define __PRUNICHAR__ -#ifdef WIN32 -typedef wchar_t PRUnichar; -#else -typedef PRUint16 PRUnichar; -#endif -#endif - -/* -** WARNING: The undocumented data types PRWord and PRUword are -** only used in the garbage collection and arena code. Do not -** use PRWord and PRUword in new code. -** -** A PRWord is an integer that is the same size as a void*. -** It implements the notion of a "word" in the Java Virtual -** Machine. (See Sec. 3.4 "Words", The Java Virtual Machine -** Specification, Addison-Wesley, September 1996. -** http://java.sun.com/docs/books/vmspec/index.html.) -*/ -#ifdef _WIN64 -typedef PRInt64 PRWord; -typedef PRUint64 PRUword; -#else -typedef long PRWord; -typedef unsigned long PRUword; -#endif - -#if defined(NO_NSPR_10_SUPPORT) -#else -/********* ???????????????? FIX ME ??????????????????????????? *****/ -/********************** Some old definitions until pr=>ds transition is done ***/ -/********************** Also, we are still using NSPR 1.0. GC ******************/ -/* -** Fundamental NSPR macros, used nearly everywhere. -*/ - -#define PR_PUBLIC_API PR_IMPLEMENT - -/* -** Macro body brackets so that macros with compound statement definitions -** behave syntactically more like functions when called. -*/ -#define NSPR_BEGIN_MACRO do { -#define NSPR_END_MACRO } while (0) - -/* -** Macro shorthands for conditional C++ extern block delimiters. -*/ -#ifdef NSPR_BEGIN_EXTERN_C -#undef NSPR_BEGIN_EXTERN_C -#endif -#ifdef NSPR_END_EXTERN_C -#undef NSPR_END_EXTERN_C -#endif - -#ifdef __cplusplus -#define NSPR_BEGIN_EXTERN_C extern "C" { -#define NSPR_END_EXTERN_C } -#else -#define NSPR_BEGIN_EXTERN_C -#define NSPR_END_EXTERN_C -#endif - -#include "obsolete/protypes.h" - -/********* ????????????? End Fix me ?????????????????????????????? *****/ -#endif /* NO_NSPR_10_SUPPORT */ - -/* -** Compile-time assert. "condition" must be a constant expression. -** The macro can be used only in places where an "extern" declaration is -** allowed. -*/ -#define PR_STATIC_ASSERT(condition) \ - extern void pr_static_assert(int arg[(condition) ? 1 : -1]) - -PR_END_EXTERN_C - -#endif /* prtypes_h___ */ - diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prvrsion.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prvrsion.h deleted file mode 100755 index a8415b2..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prvrsion.h +++ /dev/null @@ -1,105 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - - -/* author: jstewart */ - -#if defined(_PRVERSION_H) -#else -#define _PRVERSION_H - -#include "prtypes.h" - -PR_BEGIN_EXTERN_C - -/* All components participating in the PR version protocol must expose - * a structure and a function. The structure is defined below and named - * according to the naming conventions outlined further below. The function - * is called libVersionPoint and returns a pointer to this structure. - */ - -/* on NT, always pack the structure the same. */ -#ifdef _WIN32 -#pragma pack(push, 8) -#endif - -typedef struct { - /* - * The first field defines which version of this structure is in use. - * At this time, only version 2 is specified. If this value is not - * 2, you must read no further into the structure. - */ - PRInt32 version; - - /* for Version 2, this is the body format. */ - PRInt64 buildTime; /* 64 bits - usecs since midnight, 1/1/1970 */ - char * buildTimeString;/* a human readable version of the time */ - - PRUint8 vMajor; /* Major version of this component */ - PRUint8 vMinor; /* Minor version of this component */ - PRUint8 vPatch; /* Patch level of this component */ - - PRBool beta; /* true if this is a beta component */ - PRBool debug; /* true if this is a debug component */ - PRBool special; /* true if this component is a special build */ - - char * filename; /* The original filename */ - char * description; /* description of this component */ - char * security; /* level of security in this component */ - char * copyright; /* The copyright for this file */ - char * comment; /* free form field for misc usage */ - char * specialString; /* the special variant for this build */ -} PRVersionDescription; - -/* on NT, restore the previous packing */ -#ifdef _WIN32 -#pragma pack(pop) -#endif - -/* - * All components must define an entrypoint named libVersionPoint which - * is of type versionEntryPointType. - * - * For example, for a library named libfoo, we would have: - * - * PRVersionDescription prVersionDescription_libfoo = - * { - * ... - * }; - * - * PR_IMPLEMENT(const PRVersionDescription*) libVersionPoint(void) - * { - * return &prVersionDescription_libfoo; - * } - */ -typedef const PRVersionDescription *(*versionEntryPointType)(void); - -/* - * Where you declare your libVersionPoint, do it like this: - * PR_IMPLEMENT(const PRVersionDescription *) libVersionPoint(void) { - * fill it in... - * } - */ - -/* - * NAMING CONVENTION FOR struct - * - * all components should also expose a static PRVersionDescription - * The name of the struct should be calculated as follows: - * Take the value of filename. (If filename is not specified, calculate - * a short, unique string.) Convert all non-alphanumeric characters - * to '_'. To this, prepend "PRVersionDescription_". Thus for libfoo.so, - * the symbol name is "PRVersionDescription_libfoo_so". - * so the file should have - * PRVersionDescription PRVersionDescription_libfoo_so { fill it in }; - * on NT, this file should be declspec export. - */ - -PR_END_EXTERN_C - -#endif /* defined(_PRVERSION_H) */ - -/* prvrsion.h */ - diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prwin16.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prwin16.h deleted file mode 100755 index 9f8d7a9..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nspr/pr/include/prwin16.h +++ /dev/null @@ -1,164 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef prwin16_h___ -#define prwin16_h___ - -/* -** Condition use of this header on platform. -*/ -#if (defined(XP_PC) && !defined(_WIN32) && !defined(XP_OS2) && defined(MOZILLA_CLIENT)) || defined(WIN16) -#include - -PR_BEGIN_EXTERN_C -/* -** Win16 stdio special case. -** To get stdio to work for Win16, all calls to printf() and related -** things must be called from the environment of the .EXE; calls to -** printf() from the .DLL send output to the bit-bucket. -** -** To make sure that PR_fprintf(), and related functions, work correctly, -** the actual stream I/O to stdout, stderr, stdin must be done in the -** .EXE. To do this, a hack is placed in _MD_Write() such that the -** fd for stdio handles results in a call to the .EXE. -** -** file w16stdio.c contains the functions that get called from NSPR -** to do the actual I/O. w16stdio.o must be statically linked with -** any application needing stdio for Win16. -** -** The address of these functions must be made available to the .DLL -** so he can call back to the .EXE. To do this, function -** PR_MD_RegisterW16StdioCallbacks() is called from the .EXE. -** The arguments are the functions defined in w16stdio.c -** At runtime, MD_Write() calls the registered functions, if any -** were registered. -** -** prinit.h contains a macro PR_STDIO_INIT() that calls the registration -** function for Win16; For other platforms, the macro is a No-Op. -** -** Note that stdio is not operational at all on Win16 GUI applications. -** This special case exists to provide stdio capability from the NSPR -** .DLL for command line applications only. NSPR's test cases are -** almost exclusively command line applications. -** -** See also: w16io.c, w16stdio.c -*/ -typedef PRInt32 (PR_CALLBACK *PRStdinRead)( void *buf, PRInt32 amount); -typedef PRInt32 (PR_CALLBACK *PRStdoutWrite)( void *buf, PRInt32 amount); -typedef PRInt32 (PR_CALLBACK *PRStderrWrite)( void *buf, PRInt32 amount); - -NSPR_API(PRStatus) -PR_MD_RegisterW16StdioCallbacks( - PRStdinRead inReadf, /* i: function pointer for stdin read */ - PRStdoutWrite outWritef, /* i: function pointer for stdout write */ - PRStderrWrite errWritef /* i: function pointer for stderr write */ - ); - -NSPR_API(PRInt32) -_PL_W16StdioWrite( void *buf, PRInt32 amount ); - -NSPR_API(PRInt32) -_PL_W16StdioRead( void *buf, PRInt32 amount ); - -#define PR_STDIO_INIT() PR_MD_RegisterW16StdioCallbacks( \ - _PL_W16StdioRead, _PL_W16StdioWrite, _PL_W16StdioWrite ); \ - PR_INIT_CALLBACKS(); - -/* -** Win16 hackery. -** -*/ -struct PRMethodCallbackStr { - int (PR_CALLBACK *auxOutput)(const char *outputString); - size_t (PR_CALLBACK *strftime)(char *s, size_t len, const char *fmt, const struct tm *p); - void * (PR_CALLBACK *malloc)( size_t size ); - void * (PR_CALLBACK *calloc)(size_t n, size_t size ); - void * (PR_CALLBACK *realloc)( void* old_blk, size_t size ); - void (PR_CALLBACK *free)( void *ptr ); - void * (PR_CALLBACK *getenv)( const char *name); - int (PR_CALLBACK *putenv)( const char *assoc); -/* void * (PR_CALLBACK *perror)( const char *prefix ); */ -}; - -NSPR_API(void) PR_MDRegisterCallbacks(struct PRMethodCallbackStr *); - -int PR_CALLBACK _PL_W16CallBackPuts( const char *outputString ); -size_t PR_CALLBACK _PL_W16CallBackStrftime( - char *s, - size_t len, - const char *fmt, - const struct tm *p ); -void * PR_CALLBACK _PL_W16CallBackMalloc( size_t size ); -void * PR_CALLBACK _PL_W16CallBackCalloc( size_t n, size_t size ); -void * PR_CALLBACK _PL_W16CallBackRealloc( - void *old_blk, - size_t size ); -void PR_CALLBACK _PL_W16CallBackFree( void *ptr ); -void * PR_CALLBACK _PL_W16CallBackGetenv( const char *name ); -int PR_CALLBACK _PL_W16CallBackPutenv( const char *assoc ); - -/* -** Hackery! -** -** These functions are provided as static link points. -** This is to satisfy the quick port of Gromit to NSPR 2.0 -** ... Don't do this! ... alas, It may never go away. -** -*/ -NSPR_API(int) PR_MD_printf(const char *, ...); -NSPR_API(void) PR_MD_exit(int); -NSPR_API(size_t) PR_MD_strftime(char *, size_t, const char *, const struct tm *); -NSPR_API(int) PR_MD_sscanf(const char *, const char *, ...); -NSPR_API(void*) PR_MD_malloc( size_t size ); -NSPR_API(void*) PR_MD_calloc( size_t n, size_t size ); -NSPR_API(void*) PR_MD_realloc( void* old_blk, size_t size ); -NSPR_API(void) PR_MD_free( void *ptr ); -NSPR_API(char*) PR_MD_getenv( const char *name ); -NSPR_API(int) PR_MD_putenv( const char *assoc ); -NSPR_API(int) PR_MD_fprintf(FILE *fPtr, const char *fmt, ...); - -#define PR_INIT_CALLBACKS() \ - { \ - static struct PRMethodCallbackStr cbf = { \ - _PL_W16CallBackPuts, \ - _PL_W16CallBackStrftime, \ - _PL_W16CallBackMalloc, \ - _PL_W16CallBackCalloc, \ - _PL_W16CallBackRealloc, \ - _PL_W16CallBackFree, \ - _PL_W16CallBackGetenv, \ - _PL_W16CallBackPutenv, \ - }; \ - PR_MDRegisterCallbacks( &cbf ); \ - } - - -/* -** Get the exception context for Win16 MFC applications threads -*/ -NSPR_API(void *) PR_W16GetExceptionContext(void); -/* -** Set the exception context for Win16 MFC applications threads -*/ -NSPR_API(void) PR_W16SetExceptionContext(void *context); - -PR_END_EXTERN_C -#else -/* -** For platforms other than Win16, define -** PR_STDIO_INIT() as a No-Op. -*/ -#define PR_STDIO_INIT() -#endif /* WIN16 || MOZILLA_CLIENT */ - -#endif /* prwin16_h___ */ - - - - - - - - diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/certdb/cert.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/certdb/cert.h deleted file mode 100755 index 1d4fe9c..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/certdb/cert.h +++ /dev/null @@ -1,1676 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * cert.h - public data structures and prototypes for the certificate library - */ - -#ifndef _CERT_H_ -#define _CERT_H_ - -#include "utilrename.h" -#include "plarena.h" -#include "plhash.h" -#include "prlong.h" -#include "prlog.h" - -#include "seccomon.h" -#include "secdert.h" -#include "secoidt.h" -#include "keyt.h" -#include "certt.h" - -SEC_BEGIN_PROTOS - -/**************************************************************************** - * - * RFC1485 ascii to/from X.? RelativeDistinguishedName (aka CERTName) - * - ****************************************************************************/ - -/* -** Convert an ascii RFC1485 encoded name into its CERTName equivalent. -*/ -extern CERTName *CERT_AsciiToName(const char *string); - -/* -** Convert an CERTName into its RFC1485 encoded equivalent. -** Returns a string that must be freed with PORT_Free(). -** This version produces a string for maximum human readability, -** not for strict RFC compliance. -*/ -extern char *CERT_NameToAscii(CERTName *name); - -/* -** Convert an CERTName into its RFC1485 encoded equivalent. -** Returns a string that must be freed with PORT_Free(). -** Caller chooses encoding rules. -*/ -extern char *CERT_NameToAsciiInvertible(CERTName *name, - CertStrictnessLevel strict); - -extern CERTAVA *CERT_CopyAVA(PLArenaPool *arena, CERTAVA *src); - -/* convert an OID to dotted-decimal representation */ -/* Returns a string that must be freed with PR_smprintf_free(). */ -extern char * CERT_GetOidString(const SECItem *oid); - -/* -** Examine an AVA and return the tag that refers to it. The AVA tags are -** defined as SEC_OID_AVA*. -*/ -extern SECOidTag CERT_GetAVATag(CERTAVA *ava); - -/* -** Compare two AVA's, returning the difference between them. -*/ -extern SECComparison CERT_CompareAVA(const CERTAVA *a, const CERTAVA *b); - -/* -** Create an RDN (relative-distinguished-name). The argument list is a -** NULL terminated list of AVA's. -*/ -extern CERTRDN *CERT_CreateRDN(PLArenaPool *arena, CERTAVA *avas, ...); - -/* -** Make a copy of "src" storing it in "dest". -*/ -extern SECStatus CERT_CopyRDN(PLArenaPool *arena, CERTRDN *dest, CERTRDN *src); - -/* -** Destory an RDN object. -** "rdn" the RDN to destroy -** "freeit" if PR_TRUE then free the object as well as its sub-objects -*/ -extern void CERT_DestroyRDN(CERTRDN *rdn, PRBool freeit); - -/* -** Add an AVA to an RDN. -** "rdn" the RDN to add to -** "ava" the AVA to add -*/ -extern SECStatus CERT_AddAVA(PLArenaPool *arena, CERTRDN *rdn, CERTAVA *ava); - -/* -** Compare two RDN's, returning the difference between them. -*/ -extern SECComparison CERT_CompareRDN(const CERTRDN *a, const CERTRDN *b); - -/* -** Create an X.500 style name using a NULL terminated list of RDN's. -*/ -extern CERTName *CERT_CreateName(CERTRDN *rdn, ...); - -/* -** Make a copy of "src" storing it in "dest". Memory is allocated in -** "dest" for each of the appropriate sub objects. Memory is not freed in -** "dest" before allocation is done (use CERT_DestroyName(dest, PR_FALSE) to -** do that). -*/ -extern SECStatus CERT_CopyName(PLArenaPool *arena, CERTName *dest, - const CERTName *src); - -/* -** Destroy a Name object. -** "name" the CERTName to destroy -** "freeit" if PR_TRUE then free the object as well as its sub-objects -*/ -extern void CERT_DestroyName(CERTName *name); - -/* -** Add an RDN to a name. -** "name" the name to add the RDN to -** "rdn" the RDN to add to name -*/ -extern SECStatus CERT_AddRDN(CERTName *name, CERTRDN *rdn); - -/* -** Compare two names, returning the difference between them. -*/ -extern SECComparison CERT_CompareName(const CERTName *a, const CERTName *b); - -/* -** Convert a CERTName into something readable -*/ -extern char *CERT_FormatName (CERTName *name); - -/* -** Convert a der-encoded integer to a hex printable string form. -** Perhaps this should be a SEC function but it's only used for certs. -*/ -extern char *CERT_Hexify (SECItem *i, int do_colon); - -/* -** Converts DER string (with explicit length) into zString, if destination -** buffer is big enough to receive it. Does quoting and/or escaping as -** specified in RFC 1485. Input string must be single or multi-byte DER -** character set, (ASCII, UTF8, or ISO 8851-x) not a wide character set. -** Returns SECSuccess or SECFailure with error code set. If output buffer -** is too small, sets error code SEC_ERROR_OUTPUT_LEN. -*/ -extern SECStatus -CERT_RFC1485_EscapeAndQuote(char *dst, int dstlen, char *src, int srclen); - -/****************************************************************************** - * - * Certificate handling operations - * - *****************************************************************************/ - -/* -** Create a new validity object given two unix time values. -** "notBefore" the time before which the validity is not valid -** "notAfter" the time after which the validity is not valid -*/ -extern CERTValidity *CERT_CreateValidity(PRTime notBefore, PRTime notAfter); - -/* -** Destroy a validity object. -** "v" the validity to destroy -** "freeit" if PR_TRUE then free the object as well as its sub-objects -*/ -extern void CERT_DestroyValidity(CERTValidity *v); - -/* -** Copy the "src" object to "dest". Memory is allocated in "dest" for -** each of the appropriate sub-objects. Memory in "dest" is not freed -** before memory is allocated (use CERT_DestroyValidity(v, PR_FALSE) to do -** that). -*/ -extern SECStatus CERT_CopyValidity - (PLArenaPool *arena, CERTValidity *dest, CERTValidity *src); - -/* -** The cert lib considers a cert or CRL valid if the "notBefore" time is -** in the not-too-distant future, e.g. within the next 24 hours. This -** prevents freshly issued certificates from being considered invalid -** because the local system's time zone is incorrectly set. -** The amount of "pending slop time" is adjustable by the application. -** Units of SlopTime are seconds. Default is 86400 (24 hours). -** Negative SlopTime values are not allowed. -*/ -PRInt32 CERT_GetSlopTime(void); - -SECStatus CERT_SetSlopTime(PRInt32 slop); - -/* -** Create a new certificate object. The result must be wrapped with an -** CERTSignedData to create a signed certificate. -** "serialNumber" the serial number -** "issuer" the name of the certificate issuer -** "validity" the validity period of the certificate -** "req" the certificate request that prompted the certificate issuance -*/ -extern CERTCertificate * -CERT_CreateCertificate (unsigned long serialNumber, CERTName *issuer, - CERTValidity *validity, CERTCertificateRequest *req); - -/* -** Destroy a certificate object -** "cert" the certificate to destroy -** NOTE: certificate's are reference counted. This call decrements the -** reference count, and if the result is zero, then the object is destroyed -** and optionally freed. -*/ -extern void CERT_DestroyCertificate(CERTCertificate *cert); - -/* -** Make a shallow copy of a certificate "c". Just increments the -** reference count on "c". -*/ -extern CERTCertificate *CERT_DupCertificate(CERTCertificate *c); - -/* -** Create a new certificate request. This result must be wrapped with an -** CERTSignedData to create a signed certificate request. -** "name" the subject name (who the certificate request is from) -** "spki" describes/defines the public key the certificate is for -** "attributes" if non-zero, some optional attribute data -*/ -extern CERTCertificateRequest * -CERT_CreateCertificateRequest (CERTName *name, CERTSubjectPublicKeyInfo *spki, - SECItem **attributes); - -/* -** Destroy a certificate-request object -** "r" the certificate-request to destroy -** "freeit" if PR_TRUE then free the object as well as its sub-objects -*/ -extern void CERT_DestroyCertificateRequest(CERTCertificateRequest *r); - -/* -** Start adding extensions to a certificate request. -*/ -void * -CERT_StartCertificateRequestAttributes(CERTCertificateRequest *req); - -/* -** Reformat the certificate extension list into a CertificateRequest -** attribute list. -*/ -SECStatus -CERT_FinishCertificateRequestAttributes(CERTCertificateRequest *req); - -/* -** Extract the Extension Requests from a DER CertRequest attribute list. -*/ -SECStatus -CERT_GetCertificateRequestExtensions(CERTCertificateRequest *req, - CERTCertExtension ***exts); - -/* -** Extract a public key object from a certificate -*/ -extern SECKEYPublicKey *CERT_ExtractPublicKey(CERTCertificate *cert); - -/* -** Retrieve the Key Type associated with the cert we're dealing with -*/ - -extern KeyType CERT_GetCertKeyType (const CERTSubjectPublicKeyInfo *spki); - -/* -** Initialize the certificate database. This is called to create -** the initial list of certificates in the database. -*/ -extern SECStatus CERT_InitCertDB(CERTCertDBHandle *handle); - -extern int CERT_GetDBContentVersion(CERTCertDBHandle *handle); - -/* -** Default certificate database routines -*/ -extern void CERT_SetDefaultCertDB(CERTCertDBHandle *handle); - -extern CERTCertDBHandle *CERT_GetDefaultCertDB(void); - -extern CERTCertList *CERT_GetCertChainFromCert(CERTCertificate *cert, - PRTime time, - SECCertUsage usage); -extern CERTCertificate * -CERT_NewTempCertificate (CERTCertDBHandle *handle, SECItem *derCert, - char *nickname, PRBool isperm, PRBool copyDER); - - -/****************************************************************************** - * - * X.500 Name handling operations - * - *****************************************************************************/ - -/* -** Create an AVA (attribute-value-assertion) -** "arena" the memory arena to alloc from -** "kind" is one of SEC_OID_AVA_* -** "valueType" is one of DER_PRINTABLE_STRING, DER_IA5_STRING, or -** DER_T61_STRING -** "value" is the null terminated string containing the value -*/ -extern CERTAVA *CERT_CreateAVA - (PLArenaPool *arena, SECOidTag kind, int valueType, char *value); - -/* -** Extract the Distinguished Name from a DER encoded certificate -** "derCert" is the DER encoded certificate -** "derName" is the SECItem that the name is returned in -*/ -extern SECStatus CERT_NameFromDERCert(SECItem *derCert, SECItem *derName); - -/* -** Extract the Issuers Distinguished Name from a DER encoded certificate -** "derCert" is the DER encoded certificate -** "derName" is the SECItem that the name is returned in -*/ -extern SECStatus CERT_IssuerNameFromDERCert(SECItem *derCert, - SECItem *derName); - -extern SECItem * -CERT_EncodeGeneralName(CERTGeneralName *genName, SECItem *dest, - PLArenaPool *arena); - -extern CERTGeneralName * -CERT_DecodeGeneralName(PLArenaPool *reqArena, SECItem *encodedName, - CERTGeneralName *genName); - - - -/* -** Generate a database search key for a certificate, based on the -** issuer and serial number. -** "arena" the memory arena to alloc from -** "derCert" the DER encoded certificate -** "key" the returned key -*/ -extern SECStatus CERT_KeyFromDERCert(PLArenaPool *reqArena, SECItem *derCert, - SECItem *key); - -extern SECStatus CERT_KeyFromIssuerAndSN(PLArenaPool *arena, SECItem *issuer, - SECItem *sn, SECItem *key); - -extern SECStatus CERT_SerialNumberFromDERCert(SECItem *derCert, - SECItem *derName); - - -/* -** Generate a database search key for a crl, based on the -** issuer. -** "arena" the memory arena to alloc from -** "derCrl" the DER encoded crl -** "key" the returned key -*/ -extern SECStatus CERT_KeyFromDERCrl(PLArenaPool *arena, SECItem *derCrl, SECItem *key); - -/* -** Open the certificate database. Use callback to get name of database. -*/ -extern SECStatus CERT_OpenCertDB(CERTCertDBHandle *handle, PRBool readOnly, - CERTDBNameFunc namecb, void *cbarg); - -/* Open the certificate database. Use given filename for database. */ -extern SECStatus CERT_OpenCertDBFilename(CERTCertDBHandle *handle, - char *certdbname, PRBool readOnly); - -/* -** Open and initialize a cert database that is entirely in memory. This -** can be used when the permanent database can not be opened or created. -*/ -extern SECStatus CERT_OpenVolatileCertDB(CERTCertDBHandle *handle); - -/* -** Extract the list of host names, host name patters, IP address strings -** this cert is valid for. -** This function does NOT return nicknames. -** Type CERTCertNicknames is being used because it's a convenient -** data structure to carry a list of strings and its count. -*/ -extern CERTCertNicknames * - CERT_GetValidDNSPatternsFromCert(CERTCertificate *cert); - -/* -** Check the hostname to make sure that it matches the shexp that -** is given in the common name of the certificate. -*/ -extern SECStatus CERT_VerifyCertName(const CERTCertificate *cert, - const char *hostname); - -/* -** Add a domain name to the list of names that the user has explicitly -** allowed (despite cert name mismatches) for use with a server cert. -*/ -extern SECStatus CERT_AddOKDomainName(CERTCertificate *cert, const char *hostname); - -/* -** Decode a DER encoded certificate into an CERTCertificate structure -** "derSignedCert" is the DER encoded signed certificate -** "copyDER" is true if the DER should be copied, false if the -** existing copy should be referenced -** "nickname" is the nickname to use in the database. If it is NULL -** then a temporary nickname is generated. -*/ -extern CERTCertificate * -CERT_DecodeDERCertificate (SECItem *derSignedCert, PRBool copyDER, char *nickname); -/* -** Decode a DER encoded CRL into a CERTSignedCrl structure -** "derSignedCrl" is the DER encoded signed CRL. -** "type" must be SEC_CRL_TYPE. -*/ -#define SEC_CRL_TYPE 1 -#define SEC_KRL_TYPE 0 /* deprecated */ - -extern CERTSignedCrl * -CERT_DecodeDERCrl (PLArenaPool *arena, SECItem *derSignedCrl,int type); - -/* - * same as CERT_DecodeDERCrl, plus allow options to be passed in - */ - -extern CERTSignedCrl * -CERT_DecodeDERCrlWithFlags(PLArenaPool *narena, SECItem *derSignedCrl, - int type, PRInt32 options); - -/* CRL options to pass */ - -#define CRL_DECODE_DEFAULT_OPTIONS 0x00000000 - -/* when CRL_DECODE_DONT_COPY_DER is set, the DER is not copied . The - application must then keep derSignedCrl until it destroys the - CRL . Ideally, it should allocate derSignedCrl in an arena - and pass that arena in as the first argument to - CERT_DecodeDERCrlWithFlags */ - -#define CRL_DECODE_DONT_COPY_DER 0x00000001 -#define CRL_DECODE_SKIP_ENTRIES 0x00000002 -#define CRL_DECODE_KEEP_BAD_CRL 0x00000004 -#define CRL_DECODE_ADOPT_HEAP_DER 0x00000008 - -/* complete the decoding of a partially decoded CRL, ie. decode the - entries. Note that entries is an optional field in a CRL, so the - "entries" pointer in CERTCrlStr may still be NULL even after - function returns SECSuccess */ - -extern SECStatus CERT_CompleteCRLDecodeEntries(CERTSignedCrl* crl); - -/* Validate CRL then import it to the dbase. If there is already a CRL with the - * same CA in the dbase, it will be replaced if derCRL is more up to date. - * If the process successes, a CRL will be returned. Otherwise, a NULL will - * be returned. The caller should call PORT_GetError() for the exactly error - * code. - */ -extern CERTSignedCrl * -CERT_ImportCRL (CERTCertDBHandle *handle, SECItem *derCRL, char *url, - int type, void * wincx); - -extern void CERT_DestroyCrl (CERTSignedCrl *crl); - -/* this is a hint to flush the CRL cache. crlKey is the DER subject of - the issuer (CA). */ -void CERT_CRLCacheRefreshIssuer(CERTCertDBHandle* dbhandle, SECItem* crlKey); - -/* add the specified DER CRL object to the CRL cache. Doing so will allow - certificate verification functions (such as CERT_VerifyCertificate) - to automatically find and make use of this CRL object. - Once a CRL is added to the CRL cache, the application must hold on to - the object's memory, because the cache will reference it directly. The - application can only free the object after it calls CERT_UncacheCRL to - remove it from the CRL cache. -*/ -SECStatus CERT_CacheCRL(CERTCertDBHandle* dbhandle, SECItem* newcrl); - -/* remove a previously added CRL object from the CRL cache. It is OK - for the application to free the memory after a successful removal -*/ -SECStatus CERT_UncacheCRL(CERTCertDBHandle* dbhandle, SECItem* oldcrl); - -/* -** Find a certificate in the database -** "key" is the database key to look for -*/ -extern CERTCertificate *CERT_FindCertByKey(CERTCertDBHandle *handle, SECItem *key); - -/* -** Find a certificate in the database by name -** "name" is the distinguished name to look up -*/ -extern CERTCertificate * -CERT_FindCertByName (CERTCertDBHandle *handle, SECItem *name); - -/* -** Find a certificate in the database by name -** "name" is the distinguished name to look up (in ascii) -*/ -extern CERTCertificate * -CERT_FindCertByNameString (CERTCertDBHandle *handle, char *name); - -/* -** Find a certificate in the database by name and keyid -** "name" is the distinguished name to look up -** "keyID" is the value of the subjectKeyID to match -*/ -extern CERTCertificate * -CERT_FindCertByKeyID (CERTCertDBHandle *handle, SECItem *name, SECItem *keyID); - -/* -** Generate a certificate key from the issuer and serialnumber, then look it -** up in the database. Return the cert if found. -** "issuerAndSN" is the issuer and serial number to look for -*/ -extern CERTCertificate * -CERT_FindCertByIssuerAndSN (CERTCertDBHandle *handle, CERTIssuerAndSN *issuerAndSN); - -/* -** Find a certificate in the database by a subject key ID -** "subjKeyID" is the subject Key ID to look for -*/ -extern CERTCertificate * -CERT_FindCertBySubjectKeyID (CERTCertDBHandle *handle, SECItem *subjKeyID); - -/* -** Encode Certificate SKID (Subject Key ID) extension. -** -*/ -extern SECStatus -CERT_EncodeSubjectKeyID(PLArenaPool *arena, const SECItem* srcString, - SECItem *encodedValue); - -/* -** Find a certificate in the database by a nickname -** "nickname" is the ascii string nickname to look for -*/ -extern CERTCertificate * -CERT_FindCertByNickname (CERTCertDBHandle *handle, const char *nickname); - -/* -** Find a certificate in the database by a DER encoded certificate -** "derCert" is the DER encoded certificate -*/ -extern CERTCertificate * -CERT_FindCertByDERCert(CERTCertDBHandle *handle, SECItem *derCert); - -/* -** Find a certificate in the database by a email address -** "emailAddr" is the email address to look up -*/ -CERTCertificate * -CERT_FindCertByEmailAddr(CERTCertDBHandle *handle, char *emailAddr); - -/* -** Find a certificate in the database by a email address or nickname -** "name" is the email address or nickname to look up -*/ -CERTCertificate * -CERT_FindCertByNicknameOrEmailAddr(CERTCertDBHandle *handle, const char *name); - -/* -** Find a certificate in the database by a email address or nickname -** and require it to have the given usage. -** "name" is the email address or nickname to look up -*/ -CERTCertificate * -CERT_FindCertByNicknameOrEmailAddrForUsage(CERTCertDBHandle *handle, - const char *name, - SECCertUsage lookingForUsage); - -/* -** Find a certificate in the database by a digest of a subject public key -** "spkDigest" is the digest to look up -*/ -extern CERTCertificate * -CERT_FindCertBySPKDigest(CERTCertDBHandle *handle, SECItem *spkDigest); - -/* - * Find the issuer of a cert - */ -CERTCertificate * -CERT_FindCertIssuer(CERTCertificate *cert, PRTime validTime, SECCertUsage usage); - -/* -** Check the validity times of a certificate vs. time 't', allowing -** some slop for broken clocks and stuff. -** "cert" is the certificate to be checked -** "t" is the time to check against -** "allowOverride" if true then check to see if the invalidity has -** been overridden by the user. -*/ -extern SECCertTimeValidity CERT_CheckCertValidTimes(const CERTCertificate *cert, - PRTime t, - PRBool allowOverride); - -/* -** WARNING - this function is deprecated, and will either go away or have -** a new API in the near future. -** -** Check the validity times of a certificate vs. the current time, allowing -** some slop for broken clocks and stuff. -** "cert" is the certificate to be checked -*/ -extern SECStatus CERT_CertTimesValid(CERTCertificate *cert); - -/* -** Extract the validity times from a certificate -** "c" is the certificate -** "notBefore" is the start of the validity period -** "notAfter" is the end of the validity period -*/ -extern SECStatus -CERT_GetCertTimes (const CERTCertificate *c, PRTime *notBefore, - PRTime *notAfter); - -/* -** Extract the issuer and serial number from a certificate -*/ -extern CERTIssuerAndSN *CERT_GetCertIssuerAndSN(PLArenaPool *, - CERTCertificate *); - -/* -** verify the signature of a signed data object with a given certificate -** "sd" the signed data object to be verified -** "cert" the certificate to use to check the signature -*/ -extern SECStatus CERT_VerifySignedData(CERTSignedData *sd, - CERTCertificate *cert, - PRTime t, - void *wincx); -/* -** verify the signature of a signed data object with the given DER publickey -*/ -extern SECStatus -CERT_VerifySignedDataWithPublicKeyInfo(CERTSignedData *sd, - CERTSubjectPublicKeyInfo *pubKeyInfo, - void *wincx); - -/* -** verify the signature of a signed data object with a SECKEYPublicKey. -*/ -extern SECStatus -CERT_VerifySignedDataWithPublicKey(const CERTSignedData *sd, - SECKEYPublicKey *pubKey, void *wincx); - -/* -** NEW FUNCTIONS with new bit-field-FIELD SECCertificateUsage - please use -** verify a certificate by checking validity times against a certain time, -** that we trust the issuer, and that the signature on the certificate is -** valid. -** "cert" the certificate to verify -** "checkSig" only check signatures if true -*/ -extern SECStatus -CERT_VerifyCertificate(CERTCertDBHandle *handle, CERTCertificate *cert, - PRBool checkSig, SECCertificateUsage requiredUsages, - PRTime t, void *wincx, CERTVerifyLog *log, - SECCertificateUsage* returnedUsages); - -/* same as above, but uses current time */ -extern SECStatus -CERT_VerifyCertificateNow(CERTCertDBHandle *handle, CERTCertificate *cert, - PRBool checkSig, SECCertificateUsage requiredUsages, - void *wincx, SECCertificateUsage* returnedUsages); - -/* -** Verify that a CA cert can certify some (unspecified) leaf cert for a given -** purpose. This is used by UI code to help identify where a chain may be -** broken and why. This takes identical parameters to CERT_VerifyCert -*/ -extern SECStatus -CERT_VerifyCACertForUsage(CERTCertDBHandle *handle, CERTCertificate *cert, - PRBool checkSig, SECCertUsage certUsage, PRTime t, - void *wincx, CERTVerifyLog *log); - -/* -** OLD OBSOLETE FUNCTIONS with enum SECCertUsage - DO NOT USE FOR NEW CODE -** verify a certificate by checking validity times against a certain time, -** that we trust the issuer, and that the signature on the certificate is -** valid. -** "cert" the certificate to verify -** "checkSig" only check signatures if true -*/ -extern SECStatus -CERT_VerifyCert(CERTCertDBHandle *handle, CERTCertificate *cert, - PRBool checkSig, SECCertUsage certUsage, PRTime t, - void *wincx, CERTVerifyLog *log); - -/* same as above, but uses current time */ -extern SECStatus -CERT_VerifyCertNow(CERTCertDBHandle *handle, CERTCertificate *cert, - PRBool checkSig, SECCertUsage certUsage, void *wincx); - -SECStatus -CERT_VerifyCertChain(CERTCertDBHandle *handle, CERTCertificate *cert, - PRBool checkSig, SECCertUsage certUsage, PRTime t, - void *wincx, CERTVerifyLog *log); - -/* -** Read a base64 ascii encoded DER certificate and convert it to our -** internal format. -** "certstr" is a null-terminated string containing the certificate -*/ -extern CERTCertificate *CERT_ConvertAndDecodeCertificate(char *certstr); - -/* -** Read a certificate in some foreign format, and convert it to our -** internal format. -** "certbuf" is the buffer containing the certificate -** "certlen" is the length of the buffer -** NOTE - currently supports netscape base64 ascii encoded raw certs -** and netscape binary DER typed files. -*/ -extern CERTCertificate *CERT_DecodeCertFromPackage(char *certbuf, int certlen); - -extern SECStatus -CERT_ImportCAChain (SECItem *certs, int numcerts, SECCertUsage certUsage); - -extern SECStatus -CERT_ImportCAChainTrusted(SECItem *certs, int numcerts, SECCertUsage certUsage); - -/* -** Read a certificate chain in some foreign format, and pass it to a -** callback function. -** "certbuf" is the buffer containing the certificate -** "certlen" is the length of the buffer -** "f" is the callback function -** "arg" is the callback argument -*/ -typedef SECStatus (PR_CALLBACK *CERTImportCertificateFunc) - (void *arg, SECItem **certs, int numcerts); - -extern SECStatus -CERT_DecodeCertPackage(char *certbuf, int certlen, CERTImportCertificateFunc f, - void *arg); - -/* -** Returns the value of an AVA. This was a formerly static -** function that has been exposed due to the need to decode -** and convert unicode strings to UTF8. -** -** XXX This function resides in certhtml.c, should it be -** moved elsewhere? -*/ -extern SECItem *CERT_DecodeAVAValue(const SECItem *derAVAValue); - - - -/* -** extract various element strings from a distinguished name. -** "name" the distinguished name -*/ - -extern char *CERT_GetCertificateEmailAddress(CERTCertificate *cert); - -extern char *CERT_GetCertEmailAddress(const CERTName *name); - -extern const char * CERT_GetFirstEmailAddress(CERTCertificate * cert); - -extern const char * CERT_GetNextEmailAddress(CERTCertificate * cert, - const char * prev); - -/* The return value must be freed with PORT_Free. */ -extern char *CERT_GetCommonName(const CERTName *name); - -extern char *CERT_GetCountryName(const CERTName *name); - -extern char *CERT_GetLocalityName(const CERTName *name); - -extern char *CERT_GetStateName(const CERTName *name); - -extern char *CERT_GetOrgName(const CERTName *name); - -extern char *CERT_GetOrgUnitName(const CERTName *name); - -extern char *CERT_GetDomainComponentName(const CERTName *name); - -extern char *CERT_GetCertUid(const CERTName *name); - -/* manipulate the trust parameters of a certificate */ - -extern SECStatus CERT_GetCertTrust(const CERTCertificate *cert, - CERTCertTrust *trust); - -extern SECStatus -CERT_ChangeCertTrust (CERTCertDBHandle *handle, CERTCertificate *cert, - CERTCertTrust *trust); - -extern SECStatus -CERT_ChangeCertTrustByUsage(CERTCertDBHandle *certdb, CERTCertificate *cert, - SECCertUsage usage); - -/************************************************************************* - * - * manipulate the extensions of a certificate - * - ************************************************************************/ - -/* -** Set up a cert for adding X509v3 extensions. Returns an opaque handle -** used by the next two routines. -** "cert" is the certificate we are adding extensions to -*/ -extern void *CERT_StartCertExtensions(CERTCertificate *cert); - -/* -** Add an extension to a certificate. -** "exthandle" is the handle returned by the previous function -** "idtag" is the integer tag for the OID that should ID this extension -** "value" is the value of the extension -** "critical" is the critical extension flag -** "copyData" is a flag indicating whether the value data should be -** copied. -*/ -extern SECStatus CERT_AddExtension (void *exthandle, int idtag, - SECItem *value, PRBool critical, PRBool copyData); - -extern SECStatus CERT_AddExtensionByOID (void *exthandle, SECItem *oid, - SECItem *value, PRBool critical, PRBool copyData); - -extern SECStatus CERT_EncodeAndAddExtension - (void *exthandle, int idtag, void *value, PRBool critical, - const SEC_ASN1Template *atemplate); - -extern SECStatus CERT_EncodeAndAddBitStrExtension - (void *exthandle, int idtag, SECItem *value, PRBool critical); - - -extern SECStatus -CERT_EncodeAltNameExtension(PLArenaPool *arena, CERTGeneralName *value, SECItem *encodedValue); - - -/* -** Finish adding cert extensions. Does final processing on extension -** data, putting it in the right format, and freeing any temporary -** storage. -** "exthandle" is the handle used to add extensions to a certificate -*/ -extern SECStatus CERT_FinishExtensions(void *exthandle); - -/* -** Merge an external list of extensions into a cert's extension list, adding one -** only when its OID matches none of the cert's existing extensions. Call this -** immediately before calling CERT_FinishExtensions(). -*/ -SECStatus -CERT_MergeExtensions(void *exthandle, CERTCertExtension **exts); - -/* If the extension is found, return its criticality and value. -** This allocate storage for the returning extension value. -*/ -extern SECStatus CERT_GetExtenCriticality - (CERTCertExtension **extensions, int tag, PRBool *isCritical); - -extern void -CERT_DestroyOidSequence(CERTOidSequence *oidSeq); - -/**************************************************************************** - * - * DER encode and decode extension values - * - ****************************************************************************/ - -/* Encode the value of the basicConstraint extension. -** arena - where to allocate memory for the encoded value. -** value - extension value to encode -** encodedValue - output encoded value -*/ -extern SECStatus CERT_EncodeBasicConstraintValue - (PLArenaPool *arena, CERTBasicConstraints *value, SECItem *encodedValue); - -/* -** Encode the value of the authorityKeyIdentifier extension. -*/ -extern SECStatus CERT_EncodeAuthKeyID - (PLArenaPool *arena, CERTAuthKeyID *value, SECItem *encodedValue); - -/* -** Encode the value of the crlDistributionPoints extension. -*/ -extern SECStatus CERT_EncodeCRLDistributionPoints - (PLArenaPool *arena, CERTCrlDistributionPoints *value,SECItem *derValue); - -/* -** Decodes a DER encoded basicConstaint extension value into a readable format -** value - decoded value -** encodedValue - value to decoded -*/ -extern SECStatus CERT_DecodeBasicConstraintValue - (CERTBasicConstraints *value, const SECItem *encodedValue); - -/* Decodes a DER encoded authorityKeyIdentifier extension value into a -** readable format. -** arena - where to allocate memory for the decoded value -** encodedValue - value to be decoded -** Returns a CERTAuthKeyID structure which contains the decoded value -*/ -extern CERTAuthKeyID *CERT_DecodeAuthKeyID - (PLArenaPool *arena, const SECItem *encodedValue); - -/* Decodes a DER encoded crlDistributionPoints extension value into a -** readable format. -** arena - where to allocate memory for the decoded value -** der - value to be decoded -** Returns a CERTCrlDistributionPoints structure which contains the -** decoded value -*/ -extern CERTCrlDistributionPoints * CERT_DecodeCRLDistributionPoints - (PLArenaPool *arena, SECItem *der); - -/* Extract certain name type from a generalName */ -extern void *CERT_GetGeneralNameByType - (CERTGeneralName *genNames, CERTGeneralNameType type, PRBool derFormat); - - -extern CERTOidSequence * -CERT_DecodeOidSequence(const SECItem *seqItem); - - - - -/**************************************************************************** - * - * Find extension values of a certificate - * - ***************************************************************************/ - -extern SECStatus CERT_FindCertExtension - (const CERTCertificate *cert, int tag, SECItem *value); - -extern SECStatus CERT_FindNSCertTypeExtension - (CERTCertificate *cert, SECItem *value); - -extern char * CERT_FindNSStringExtension (CERTCertificate *cert, int oidtag); - -extern SECStatus CERT_FindIssuerCertExtension - (CERTCertificate *cert, int tag, SECItem *value); - -extern SECStatus CERT_FindCertExtensionByOID - (CERTCertificate *cert, SECItem *oid, SECItem *value); - -extern char *CERT_FindCertURLExtension (CERTCertificate *cert, int tag, - int catag); - -/* Returns the decoded value of the authKeyID extension. -** Note that this uses passed in the arena to allocate storage for the result -*/ -extern CERTAuthKeyID * CERT_FindAuthKeyIDExten (PLArenaPool *arena,CERTCertificate *cert); - -/* Returns the decoded value of the basicConstraint extension. - */ -extern SECStatus CERT_FindBasicConstraintExten - (CERTCertificate *cert, CERTBasicConstraints *value); - -/* Returns the decoded value of the crlDistributionPoints extension. -** Note that the arena in cert is used to allocate storage for the result -*/ -extern CERTCrlDistributionPoints * CERT_FindCRLDistributionPoints - (CERTCertificate *cert); - -/* Returns value of the keyUsage extension. This uses PR_Alloc to allocate -** buffer for the decoded value. The caller should free up the storage -** allocated in value->data. -*/ -extern SECStatus CERT_FindKeyUsageExtension (CERTCertificate *cert, - SECItem *value); - -/* Return the decoded value of the subjectKeyID extension. The caller should -** free up the storage allocated in retItem->data. -*/ -extern SECStatus CERT_FindSubjectKeyIDExtension (CERTCertificate *cert, - SECItem *retItem); - -/* -** If cert is a v3 certificate, and a critical keyUsage extension is included, -** then check the usage against the extension value. If a non-critical -** keyUsage extension is included, this will return SECSuccess without -** checking, since the extension is an advisory field, not a restriction. -** If cert is not a v3 certificate, this will return SECSuccess. -** cert - certificate -** usage - one of the x.509 v3 the Key Usage Extension flags -*/ -extern SECStatus CERT_CheckCertUsage (CERTCertificate *cert, - unsigned char usage); - -/**************************************************************************** - * - * CRL v2 Extensions supported routines - * - ****************************************************************************/ - -extern SECStatus CERT_FindCRLExtensionByOID - (CERTCrl *crl, SECItem *oid, SECItem *value); - -extern SECStatus CERT_FindCRLExtension - (CERTCrl *crl, int tag, SECItem *value); - -extern SECStatus - CERT_FindInvalidDateExten (CERTCrl *crl, PRTime *value); - -/* -** Set up a crl for adding X509v3 extensions. Returns an opaque handle -** used by routines that take an exthandle (void*) argument . -** "crl" is the CRL we are adding extensions to -*/ -extern void *CERT_StartCRLExtensions(CERTCrl *crl); - -/* -** Set up a crl entry for adding X509v3 extensions. Returns an opaque handle -** used by routines that take an exthandle (void*) argument . -** "crl" is the crl we are adding certs entries to -** "entry" is the crl entry we are adding extensions to -*/ -extern void *CERT_StartCRLEntryExtensions(CERTCrl *crl, CERTCrlEntry *entry); - -extern CERTCertNicknames *CERT_GetCertNicknames (CERTCertDBHandle *handle, - int what, void *wincx); - -/* -** Finds the crlNumber extension and decodes its value into 'value' -*/ -extern SECStatus CERT_FindCRLNumberExten (PLArenaPool *arena, CERTCrl *crl, - SECItem *value); - -extern SECStatus CERT_FindCRLEntryReasonExten (CERTCrlEntry *crlEntry, - CERTCRLEntryReasonCode *value); - -extern void CERT_FreeNicknames(CERTCertNicknames *nicknames); - -extern PRBool CERT_CompareCerts(const CERTCertificate *c1, - const CERTCertificate *c2); - -extern PRBool CERT_CompareCertsForRedirection(CERTCertificate *c1, - CERTCertificate *c2); - -/* -** Generate an array of the Distinguished Names that the given cert database -** "trusts" -*/ -extern CERTDistNames *CERT_GetSSLCACerts(CERTCertDBHandle *handle); - -extern void CERT_FreeDistNames(CERTDistNames *names); - -/* Duplicate distinguished name array */ -extern CERTDistNames *CERT_DupDistNames(CERTDistNames *orig); - -/* -** Generate an array of Distinguished names from an array of nicknames -*/ -extern CERTDistNames *CERT_DistNamesFromNicknames - (CERTCertDBHandle *handle, char **nicknames, int nnames); - -/* -** Generate an array of Distinguished names from a list of certs. -*/ -extern CERTDistNames *CERT_DistNamesFromCertList(CERTCertList *list); - -/* -** Generate a certificate chain from a certificate. -*/ -extern CERTCertificateList * -CERT_CertChainFromCert(CERTCertificate *cert, SECCertUsage usage, - PRBool includeRoot); - -extern CERTCertificateList * -CERT_CertListFromCert(CERTCertificate *cert); - -extern CERTCertificateList * -CERT_DupCertList(const CERTCertificateList * oldList); - -extern void CERT_DestroyCertificateList(CERTCertificateList *list); - -/* -** is cert a user cert? i.e. does it have CERTDB_USER trust, -** i.e. a private key? -*/ -PRBool CERT_IsUserCert(CERTCertificate* cert); - -/* is cert a newer than cert b? */ -PRBool CERT_IsNewer(CERTCertificate *certa, CERTCertificate *certb); - -/* currently a stub for address book */ -PRBool -CERT_IsCertRevoked(CERTCertificate *cert); - -void -CERT_DestroyCertArray(CERTCertificate **certs, unsigned int ncerts); - -/* convert an email address to lower case */ -char *CERT_FixupEmailAddr(const char *emailAddr); - -/* decode string representation of trust flags into trust struct */ -SECStatus -CERT_DecodeTrustString(CERTCertTrust *trust, const char *trusts); - -/* encode trust struct into string representation of trust flags */ -char * -CERT_EncodeTrustString(CERTCertTrust *trust); - -/* find the next or prev cert in a subject list */ -CERTCertificate * -CERT_PrevSubjectCert(CERTCertificate *cert); -CERTCertificate * -CERT_NextSubjectCert(CERTCertificate *cert); - -/* - * import a collection of certs into the temporary or permanent cert - * database - */ -SECStatus -CERT_ImportCerts(CERTCertDBHandle *certdb, SECCertUsage usage, - unsigned int ncerts, SECItem **derCerts, - CERTCertificate ***retCerts, PRBool keepCerts, - PRBool caOnly, char *nickname); - -char * -CERT_MakeCANickname(CERTCertificate *cert); - -PRBool -CERT_IsCACert(CERTCertificate *cert, unsigned int *rettype); - -PRBool -CERT_IsCADERCert(SECItem *derCert, unsigned int *rettype); - -PRBool -CERT_IsRootDERCert(SECItem *derCert); - -SECStatus -CERT_SaveSMimeProfile(CERTCertificate *cert, SECItem *emailProfile, - SECItem *profileTime); - -/* - * find the smime symmetric capabilities profile for a given cert - */ -SECItem * -CERT_FindSMimeProfile(CERTCertificate *cert); - -SECStatus -CERT_AddNewCerts(CERTCertDBHandle *handle); - -CERTCertificatePolicies * -CERT_DecodeCertificatePoliciesExtension(const SECItem *extnValue); - -void -CERT_DestroyCertificatePoliciesExtension(CERTCertificatePolicies *policies); - -CERTCertificatePolicyMappings * -CERT_DecodePolicyMappingsExtension(SECItem *encodedCertPolicyMaps); - -SECStatus -CERT_DestroyPolicyMappingsExtension(CERTCertificatePolicyMappings *mappings); - -SECStatus -CERT_DecodePolicyConstraintsExtension( - CERTCertificatePolicyConstraints *decodedValue, - const SECItem *encodedValue); - -SECStatus CERT_DecodeInhibitAnyExtension - (CERTCertificateInhibitAny *decodedValue, SECItem *extnValue); - -CERTUserNotice * -CERT_DecodeUserNotice(SECItem *noticeItem); - -extern CERTGeneralName * -CERT_DecodeAltNameExtension(PLArenaPool *reqArena, SECItem *EncodedAltName); - -extern CERTNameConstraints * -CERT_DecodeNameConstraintsExtension(PLArenaPool *arena, - const SECItem *encodedConstraints); - -/* returns addr of a NULL termainated array of pointers to CERTAuthInfoAccess */ -extern CERTAuthInfoAccess ** -CERT_DecodeAuthInfoAccessExtension(PLArenaPool *reqArena, - SECItem *encodedExtension); - -extern CERTPrivKeyUsagePeriod * -CERT_DecodePrivKeyUsagePeriodExtension(PLArenaPool *arena, SECItem *extnValue); - -extern CERTGeneralName * -CERT_GetNextGeneralName(CERTGeneralName *current); - -extern CERTGeneralName * -CERT_GetPrevGeneralName(CERTGeneralName *current); - -CERTNameConstraint * -CERT_GetNextNameConstraint(CERTNameConstraint *current); - -CERTNameConstraint * -CERT_GetPrevNameConstraint(CERTNameConstraint *current); - -void -CERT_DestroyUserNotice(CERTUserNotice *userNotice); - -typedef char * (* CERTPolicyStringCallback)(char *org, - unsigned long noticeNumber, - void *arg); -void -CERT_SetCAPolicyStringCallback(CERTPolicyStringCallback cb, void *cbarg); - -char * -CERT_GetCertCommentString(CERTCertificate *cert); - -PRBool -CERT_GovtApprovedBitSet(CERTCertificate *cert); - -SECStatus -CERT_AddPermNickname(CERTCertificate *cert, char *nickname); - -CERTCertList * -CERT_MatchUserCert(CERTCertDBHandle *handle, - SECCertUsage usage, - int nCANames, char **caNames, - void *proto_win); - -CERTCertList * -CERT_NewCertList(void); - -/* free the cert list and all the certs in the list */ -void -CERT_DestroyCertList(CERTCertList *certs); - -/* remove the node and free the cert */ -void -CERT_RemoveCertListNode(CERTCertListNode *node); - -/* equivalent to CERT_AddCertToListTailWithData(certs, cert, NULL) */ -SECStatus -CERT_AddCertToListTail(CERTCertList *certs, CERTCertificate *cert); - -/* equivalent to CERT_AddCertToListHeadWithData(certs, cert, NULL) */ -SECStatus -CERT_AddCertToListHead(CERTCertList *certs, CERTCertificate *cert); - -/* - * The new cert list node takes ownership of "cert". "cert" is freed - * when the list node is removed. - */ -SECStatus -CERT_AddCertToListTailWithData(CERTCertList *certs, CERTCertificate *cert, - void *appData); - -/* - * The new cert list node takes ownership of "cert". "cert" is freed - * when the list node is removed. - */ -SECStatus -CERT_AddCertToListHeadWithData(CERTCertList *certs, CERTCertificate *cert, - void *appData); - -typedef PRBool (* CERTSortCallback)(CERTCertificate *certa, - CERTCertificate *certb, - void *arg); -SECStatus -CERT_AddCertToListSorted(CERTCertList *certs, CERTCertificate *cert, - CERTSortCallback f, void *arg); - -/* callback for CERT_AddCertToListSorted that sorts based on validity - * period and a given time. - */ -PRBool -CERT_SortCBValidity(CERTCertificate *certa, - CERTCertificate *certb, - void *arg); - -SECStatus -CERT_CheckForEvilCert(CERTCertificate *cert); - -CERTGeneralName * -CERT_GetCertificateNames(CERTCertificate *cert, PLArenaPool *arena); - -CERTGeneralName * -CERT_GetConstrainedCertificateNames(const CERTCertificate *cert, - PLArenaPool *arena, - PRBool includeSubjectCommonName); - -/* - * Creates or adds to a list of all certs with a give subject name, sorted by - * validity time, newest first. Invalid certs are considered older than - * valid certs. If validOnly is set, do not include invalid certs on list. - */ -CERTCertList * -CERT_CreateSubjectCertList(CERTCertList *certList, CERTCertDBHandle *handle, - const SECItem *name, PRTime sorttime, - PRBool validOnly); - -/* - * remove certs from a list that don't have keyUsage and certType - * that match the given usage. - */ -SECStatus -CERT_FilterCertListByUsage(CERTCertList *certList, SECCertUsage usage, - PRBool ca); - -/* - * check the key usage of a cert against a set of required values - */ -SECStatus -CERT_CheckKeyUsage(CERTCertificate *cert, unsigned int requiredUsage); - -/* - * return required key usage and cert type based on cert usage - */ -SECStatus -CERT_KeyUsageAndTypeForCertUsage(SECCertUsage usage, - PRBool ca, - unsigned int *retKeyUsage, - unsigned int *retCertType); -/* - * return required trust flags for various cert usages for CAs - */ -SECStatus -CERT_TrustFlagsForCACertUsage(SECCertUsage usage, - unsigned int *retFlags, - SECTrustType *retTrustType); - -/* - * Find all user certificates that match the given criteria. - * - * "handle" - database to search - * "usage" - certificate usage to match - * "oneCertPerName" - if set then only return the "best" cert per - * name - * "validOnly" - only return certs that are curently valid - * "proto_win" - window handle passed to pkcs11 - */ -CERTCertList * -CERT_FindUserCertsByUsage(CERTCertDBHandle *handle, - SECCertUsage usage, - PRBool oneCertPerName, - PRBool validOnly, - void *proto_win); - -/* - * Find a user certificate that matchs the given criteria. - * - * "handle" - database to search - * "nickname" - nickname to match - * "usage" - certificate usage to match - * "validOnly" - only return certs that are curently valid - * "proto_win" - window handle passed to pkcs11 - */ -CERTCertificate * -CERT_FindUserCertByUsage(CERTCertDBHandle *handle, - const char *nickname, - SECCertUsage usage, - PRBool validOnly, - void *proto_win); - -/* - * Filter a list of certificates, removing those certs that do not have - * one of the named CA certs somewhere in their cert chain. - * - * "certList" - the list of certificates to filter - * "nCANames" - number of CA names - * "caNames" - array of CA names in string(rfc 1485) form - * "usage" - what use the certs are for, this is used when - * selecting CA certs - */ -SECStatus -CERT_FilterCertListByCANames(CERTCertList *certList, int nCANames, - char **caNames, SECCertUsage usage); - -/* - * Filter a list of certificates, removing those certs that aren't user certs - */ -SECStatus -CERT_FilterCertListForUserCerts(CERTCertList *certList); - -/* - * Collect the nicknames from all certs in a CertList. If the cert is not - * valid, append a string to that nickname. - * - * "certList" - the list of certificates - * "expiredString" - the string to append to the nickname of any expired cert - * "notYetGoodString" - the string to append to the nickname of any cert - * that is not yet valid - */ -CERTCertNicknames * -CERT_NicknameStringsFromCertList(CERTCertList *certList, char *expiredString, - char *notYetGoodString); - -/* - * Extract the nickname from a nickmake string that may have either - * expiredString or notYetGoodString appended. - * - * Args: - * "namestring" - the string containing the nickname, and possibly - * one of the validity label strings - * "expiredString" - the expired validity label string - * "notYetGoodString" - the not yet good validity label string - * - * Returns the raw nickname - */ -char * -CERT_ExtractNicknameString(char *namestring, char *expiredString, - char *notYetGoodString); - -/* - * Given a certificate, return a string containing the nickname, and possibly - * one of the validity strings, based on the current validity state of the - * certificate. - * - * "arena" - arena to allocate returned string from. If NULL, then heap - * is used. - * "cert" - the cert to get nickname from - * "expiredString" - the string to append to the nickname if the cert is - * expired. - * "notYetGoodString" - the string to append to the nickname if the cert is - * not yet good. - */ -char * -CERT_GetCertNicknameWithValidity(PLArenaPool *arena, CERTCertificate *cert, - char *expiredString, char *notYetGoodString); - -/* - * Return the string representation of a DER encoded distinguished name - * "dername" - The DER encoded name to convert - */ -char * -CERT_DerNameToAscii(SECItem *dername); - -/* - * Supported usage values and types: - * certUsageSSLClient - * certUsageSSLServer - * certUsageSSLServerWithStepUp - * certUsageEmailSigner - * certUsageEmailRecipient - * certUsageObjectSigner - */ - -CERTCertificate * -CERT_FindMatchingCert(CERTCertDBHandle *handle, SECItem *derName, - CERTCertOwner owner, SECCertUsage usage, - PRBool preferTrusted, PRTime validTime, PRBool validOnly); - -/* - * Acquire the global lock on the cert database. - * This lock is currently used for the following operations: - * adding or deleting a cert to either the temp or perm databases - * converting a temp to perm or perm to temp - * changing(maybe just adding?) the trust of a cert - * adjusting the reference count of a cert - */ -void -CERT_LockDB(CERTCertDBHandle *handle); - -/* - * Free the global cert database lock. - */ -void -CERT_UnlockDB(CERTCertDBHandle *handle); - -/* - * Get the certificate status checking configuratino data for - * the certificate database - */ -CERTStatusConfig * -CERT_GetStatusConfig(CERTCertDBHandle *handle); - -/* - * Set the certificate status checking information for the - * database. The input structure becomes part of the certificate - * database and will be freed by calling the 'Destroy' function in - * the configuration object. - */ -void -CERT_SetStatusConfig(CERTCertDBHandle *handle, CERTStatusConfig *config); - - - -/* - * Acquire the cert reference count lock - * There is currently one global lock for all certs, but I'm putting a cert - * arg here so that it will be easy to make it per-cert in the future if - * that turns out to be necessary. - */ -void -CERT_LockCertRefCount(CERTCertificate *cert); - -/* - * Free the cert reference count lock - */ -void -CERT_UnlockCertRefCount(CERTCertificate *cert); - -/* - * Acquire the cert trust lock - * There is currently one global lock for all certs, but I'm putting a cert - * arg here so that it will be easy to make it per-cert in the future if - * that turns out to be necessary. - */ -void -CERT_LockCertTrust(const CERTCertificate *cert); - -/* - * Free the cert trust lock - */ -void -CERT_UnlockCertTrust(const CERTCertificate *cert); - -/* - * Digest the cert's subject public key using the specified algorithm. - * NOTE: this digests the value of the BIT STRING subjectPublicKey (excluding - * the tag, length, and number of unused bits) rather than the whole - * subjectPublicKeyInfo field. - * - * The necessary storage for the digest data is allocated. If "fill" is - * non-null, the data is put there, otherwise a SECItem is allocated. - * Allocation from "arena" if it is non-null, heap otherwise. Any problem - * results in a NULL being returned (and an appropriate error set). - */ -extern SECItem * -CERT_GetSubjectPublicKeyDigest(PLArenaPool *arena, const CERTCertificate *cert, - SECOidTag digestAlg, SECItem *fill); - -/* - * Digest the cert's subject name using the specified algorithm. - */ -extern SECItem * -CERT_GetSubjectNameDigest(PLArenaPool *arena, const CERTCertificate *cert, - SECOidTag digestAlg, SECItem *fill); - -SECStatus CERT_CheckCRL(CERTCertificate* cert, CERTCertificate* issuer, - const SECItem* dp, PRTime t, void* wincx); - - -/* - * Add a CERTNameConstraint to the CERTNameConstraint list - */ -extern CERTNameConstraint * -CERT_AddNameConstraint(CERTNameConstraint *list, - CERTNameConstraint *constraint); - -/* - * Allocate space and copy CERTNameConstraint from src to dest. - * Arena is used to allocate result(if dest eq NULL) and its members - * SECItem data. - */ -extern CERTNameConstraint * -CERT_CopyNameConstraint(PLArenaPool *arena, - CERTNameConstraint *dest, - CERTNameConstraint *src); - -/* - * Verify name against all the constraints relevant to that type of - * the name. - */ -extern SECStatus -CERT_CheckNameSpace(PLArenaPool *arena, - const CERTNameConstraints *constraints, - const CERTGeneralName *currentName); - -/* - * Extract and allocate the name constraints extension from the CA cert. - */ -extern SECStatus -CERT_FindNameConstraintsExten(PLArenaPool *arena, - CERTCertificate *cert, - CERTNameConstraints **constraints); - -/* - * Initialize a new GERTGeneralName fields (link) - */ -extern CERTGeneralName * -CERT_NewGeneralName(PLArenaPool *arena, CERTGeneralNameType type); - -/* - * PKIX extension encoding routines - */ -extern SECStatus -CERT_EncodePolicyConstraintsExtension(PLArenaPool *arena, - CERTCertificatePolicyConstraints *constr, - SECItem *dest); -extern SECStatus -CERT_EncodeInhibitAnyExtension(PLArenaPool *arena, - CERTCertificateInhibitAny *inhibitAny, - SECItem *dest); -extern SECStatus -CERT_EncodePolicyMappingExtension(PLArenaPool *arena, - CERTCertificatePolicyMappings *maps, - SECItem *dest); - -extern SECStatus CERT_EncodeInfoAccessExtension(PLArenaPool *arena, - CERTAuthInfoAccess **info, - SECItem *dest); -extern SECStatus -CERT_EncodeUserNotice(PLArenaPool *arena, - CERTUserNotice *notice, - SECItem *dest); - -extern SECStatus -CERT_EncodeDisplayText(PLArenaPool *arena, - SECItem *text, - SECItem *dest); - -extern SECStatus -CERT_EncodeCertPoliciesExtension(PLArenaPool *arena, - CERTPolicyInfo **info, - SECItem *dest); -extern SECStatus -CERT_EncodeNoticeReference(PLArenaPool *arena, - CERTNoticeReference *reference, - SECItem *dest); - -/* - * Returns a pointer to a static structure. - */ -extern const CERTRevocationFlags* -CERT_GetPKIXVerifyNistRevocationPolicy(void); - -/* - * Returns a pointer to a static structure. - */ -extern const CERTRevocationFlags* -CERT_GetClassicOCSPEnabledSoftFailurePolicy(void); - -/* - * Returns a pointer to a static structure. - */ -extern const CERTRevocationFlags* -CERT_GetClassicOCSPEnabledHardFailurePolicy(void); - -/* - * Returns a pointer to a static structure. - */ -extern const CERTRevocationFlags* -CERT_GetClassicOCSPDisabledPolicy(void); - -/* - * Verify a Cert with libpkix - * paramsIn control the verification options. If a value isn't specified - * in paramsIn, it reverts to the application default. - * paramsOut specifies the parameters the caller would like to get back. - * the caller may pass NULL, in which case no parameters are returned. - */ -extern SECStatus CERT_PKIXVerifyCert( - CERTCertificate *cert, - SECCertificateUsage usages, - CERTValInParam *paramsIn, - CERTValOutParam *paramsOut, - void *wincx); - -/* Makes old cert validation APIs(CERT_VerifyCert, CERT_VerifyCertificate) - * to use libpkix validation engine. The function should be called ones at - * application initialization time. - * Function is not thread safe.*/ -extern SECStatus CERT_SetUsePKIXForValidation(PRBool enable); - -/* The function return PR_TRUE if cert validation should use - * libpkix cert validation engine. */ -extern PRBool CERT_GetUsePKIXForValidation(void); - -/* - * Allocate a parameter container of type CERTRevocationFlags, - * and allocate the inner arrays of the given sizes. - * To cleanup call CERT_DestroyCERTRevocationFlags. - */ -extern CERTRevocationFlags * -CERT_AllocCERTRevocationFlags( - PRUint32 number_leaf_methods, PRUint32 number_leaf_pref_methods, - PRUint32 number_chain_methods, PRUint32 number_chain_pref_methods); - -/* - * Destroy the arrays inside flags, - * and destroy the object pointed to by flags, too. - */ -extern void -CERT_DestroyCERTRevocationFlags(CERTRevocationFlags *flags); - -SEC_END_PROTOS - -#endif /* _CERT_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/certdb/certdb.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/certdb/certdb.h deleted file mode 100755 index 41e0b91..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/certdb/certdb.h +++ /dev/null @@ -1,83 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef _CERTDB_H_ -#define _CERTDB_H_ - - -/* common flags for all types of certificates */ -#define CERTDB_TERMINAL_RECORD (1<<0) -#define CERTDB_TRUSTED (1<<1) -#define CERTDB_SEND_WARN (1<<2) -#define CERTDB_VALID_CA (1<<3) -#define CERTDB_TRUSTED_CA (1<<4) /* trusted for issuing server certs */ -#define CERTDB_NS_TRUSTED_CA (1<<5) -#define CERTDB_USER (1<<6) -#define CERTDB_TRUSTED_CLIENT_CA (1<<7) /* trusted for issuing client certs */ -#define CERTDB_INVISIBLE_CA (1<<8) /* don't show in UI */ -#define CERTDB_GOVT_APPROVED_CA (1<<9) /* can do strong crypto in export ver */ - -/* old usage, to keep old programs compiling */ -/* On Windows, Mac, and Linux (and other gcc platforms), we can give compile - * time deprecation warnings when applications use the old CERTDB_VALID_PEER - * define */ -#if __GNUC__ > 3 -#if (__GNUC__ == 4) && (__GNUC_MINOR__ < 5) -typedef unsigned int __CERTDB_VALID_PEER __attribute__((deprecated)); -#else -typedef unsigned int __CERTDB_VALID_PEER __attribute__((deprecated - ("CERTDB_VALID_PEER is now CERTDB_TERMINAL_RECORD"))); -#endif -#define CERTDB_VALID_PEER ((__CERTDB_VALID_PEER) CERTDB_TERMINAL_RECORD) -#else -#ifdef _WIN32 -#pragma deprecated(CERTDB_VALID_PEER) -#endif -#define CERTDB_VALID_PEER CERTDB_TERMINAL_RECORD -#endif - -SEC_BEGIN_PROTOS - -CERTSignedCrl * -SEC_FindCrlByKey(CERTCertDBHandle *handle, SECItem *crlKey, int type); - -CERTSignedCrl * -SEC_FindCrlByName(CERTCertDBHandle *handle, SECItem *crlKey, int type); - -CERTSignedCrl * -SEC_FindCrlByDERCert(CERTCertDBHandle *handle, SECItem *derCrl, int type); - -PRBool -SEC_CertNicknameConflict(const char *nickname, const SECItem *derSubject, - CERTCertDBHandle *handle); -CERTSignedCrl * -SEC_NewCrl(CERTCertDBHandle *handle, char *url, SECItem *derCrl, int type); - -SECStatus -SEC_DeletePermCRL(CERTSignedCrl *crl); - - -SECStatus -SEC_LookupCrls(CERTCertDBHandle *handle, CERTCrlHeadNode **nodes, int type); - -SECStatus -SEC_DestroyCrl(CERTSignedCrl *crl); - -CERTSignedCrl* SEC_DupCrl(CERTSignedCrl* acrl); - -SECStatus -CERT_AddTempCertToPerm(CERTCertificate *cert, char *nickname, - CERTCertTrust *trust); - -SECStatus SEC_DeletePermCertificate(CERTCertificate *cert); - -PRBool -SEC_CrlIsNewer(CERTCrl *inNew, CERTCrl *old); - -SECCertTimeValidity -SEC_CheckCrlTimes(CERTCrl *crl, PRTime t); - -SEC_END_PROTOS - -#endif /* _CERTDB_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/certdb/certi.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/certdb/certi.h deleted file mode 100755 index f47af1c..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/certdb/certi.h +++ /dev/null @@ -1,403 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/* - * certi.h - private data structures for the certificate library - */ -#ifndef _CERTI_H_ -#define _CERTI_H_ - -#include "certt.h" -#include "nssrwlkt.h" - -/* -#define GLOBAL_RWLOCK 1 -*/ - -#define DPC_RWLOCK 1 - -/* all definitions in this file are subject to change */ - -typedef struct OpaqueCRLFieldsStr OpaqueCRLFields; -typedef struct CRLEntryCacheStr CRLEntryCache; -typedef struct CRLDPCacheStr CRLDPCache; -typedef struct CRLIssuerCacheStr CRLIssuerCache; -typedef struct CRLCacheStr CRLCache; -typedef struct CachedCrlStr CachedCrl; -typedef struct NamedCRLCacheStr NamedCRLCache; -typedef struct NamedCRLCacheEntryStr NamedCRLCacheEntry; - -struct OpaqueCRLFieldsStr { - PRBool partial; - PRBool decodingError; - PRBool badEntries; - PRBool badDER; - PRBool badExtensions; - PRBool heapDER; -}; - -typedef struct PreAllocatorStr PreAllocator; - -struct PreAllocatorStr -{ - PRSize len; - void* data; - PRSize used; - PLArenaPool* arena; - PRSize extra; -}; - -/* CRL entry cache. - This is the same as an entry plus the next/prev pointers for the hash table -*/ - -struct CRLEntryCacheStr { - CERTCrlEntry entry; - CRLEntryCache *prev, *next; -}; - -#define CRL_CACHE_INVALID_CRLS 0x0001 /* this state will be set - if we have CRL objects with an invalid DER or signature. Can be - cleared if the invalid objects are deleted from the token */ -#define CRL_CACHE_LAST_FETCH_FAILED 0x0002 /* this state will be set - if the last CRL fetch encountered an error. Can be cleared if a - new fetch succeeds */ - -#define CRL_CACHE_OUT_OF_MEMORY 0x0004 /* this state will be set - if we don't have enough memory to build the hash table of entries */ - -typedef enum { - CRL_OriginToken = 0, /* CRL came from PKCS#11 token */ - CRL_OriginExplicit = 1 /* CRL was explicitly added to the cache, from RAM */ -} CRLOrigin; - -typedef enum { - dpcacheNoEntry = 0, /* no entry found for this SN */ - dpcacheFoundEntry = 1, /* entry found for this SN */ - dpcacheCallerError = 2, /* invalid args */ - dpcacheInvalidCacheError = 3, /* CRL in cache may be bad DER */ - /* or unverified */ - dpcacheEmpty = 4, /* no CRL in cache */ - dpcacheLookupError = 5 /* internal error */ -} dpcacheStatus; - - -struct CachedCrlStr { - CERTSignedCrl* crl; - CRLOrigin origin; - /* hash table of entries. We use a PLHashTable and pre-allocate the - required amount of memory in one shot, so that our allocator can - simply pass offsets into it when hashing. - - This won't work anymore when we support delta CRLs and iCRLs, because - the size of the hash table will vary over time. At that point, the best - solution will be to allocate large CRLEntry structures by modifying - the DER decoding template. The extra space would be for next/prev - pointers. This would allow entries from different CRLs to be mixed in - the same hash table. - */ - PLHashTable* entries; - PreAllocator* prebuffer; /* big pre-allocated buffer mentioned above */ - PRBool sigChecked; /* this CRL signature has already been checked */ - PRBool sigValid; /* signature verification status . - Only meaningful if checked is PR_TRUE . */ - PRBool unbuildable; /* Avoid using assosiated CRL is it fails - * a decoding step */ -}; - -/* CRL distribution point cache object - This is a cache of CRL entries for a given distribution point of an issuer - It is built from a collection of one full and 0 or more delta CRLs. -*/ - -struct CRLDPCacheStr { -#ifdef DPC_RWLOCK - NSSRWLock* lock; -#else - PRLock* lock; -#endif - CERTCertificate* issuer; /* issuer cert - XXX there may be multiple issuer certs, - with different validity dates. Also - need to deal with SKID/AKID . See - bugzilla 217387, 233118 */ - SECItem* subject; /* DER of issuer subject */ - SECItem* distributionPoint; /* DER of distribution point. This may be - NULL when distribution points aren't - in use (ie. the CA has a single CRL). - Currently not used. */ - - /* array of full CRLs matching this distribution point */ - PRUint32 ncrls; /* total number of CRLs in crls */ - CachedCrl** crls; /* array of all matching CRLs */ - /* XCRL With iCRLs and multiple DPs, the CRL can be shared accross several - issuers. In the future, we'll need to globally recycle the CRL in a - separate list in order to avoid extra lookups, decodes, and copies */ - - /* pointers to good decoded CRLs used to build the cache */ - CachedCrl* selected; /* full CRL selected for use in the cache */ -#if 0 - /* for future use */ - PRInt32 numdeltas; /* number of delta CRLs used for the cache */ - CachedCrl** deltas; /* delta CRLs used for the cache */ -#endif - /* cache invalidity bitflag */ - PRUint16 invalid; /* this state will be set if either - CRL_CACHE_INVALID_CRLS or CRL_CACHE_LAST_FETCH_FAILED is set. - In those cases, all certs are considered to have unknown status. - The invalid state can only be cleared during an update if all - error states are cleared */ - PRBool refresh; /* manual refresh from tokens has been forced */ - PRBool mustchoose; /* trigger reselection algorithm, for case when - RAM CRL objects are dropped from the cache */ - PRTime lastfetch; /* time a CRL token fetch was last performed */ - PRTime lastcheck; /* time CRL token objects were last checked for - existence */ -}; - -/* CRL issuer cache object - This object tracks all the distribution point caches for a given issuer. - XCRL once we support multiple issuing distribution points, this object - will be a hash table. For now, it just holds the single CRL distribution - point cache structure. -*/ - -struct CRLIssuerCacheStr { - SECItem* subject; /* DER of issuer subject */ - CRLDPCache* dpp; -#if 0 - /* XCRL for future use. - We don't need to lock at the moment because we only have one DP, - which gets created at the same time as this object */ - NSSRWLock* lock; - CRLDPCache** dps; - PLHashTable* distributionpoints; - CERTCertificate* issuer; -#endif -}; - -/* CRL revocation cache object - This object tracks all the issuer caches -*/ - -struct CRLCacheStr { -#ifdef GLOBAL_RWLOCK - NSSRWLock* lock; -#else - PRLock* lock; -#endif - /* hash table of issuer to CRLIssuerCacheStr, - indexed by issuer DER subject */ - PLHashTable* issuers; -}; - -SECStatus InitCRLCache(void); -SECStatus ShutdownCRLCache(void); - -/* Returns a pointer to an environment-like string, a series of -** null-terminated strings, terminated by a zero-length string. -** This function is intended to be internal to NSS. -*/ -extern char * cert_GetCertificateEmailAddresses(CERTCertificate *cert); - -/* - * These functions are used to map subjectKeyID extension values to certs - * and to keep track of the checks for user certificates in each slot - */ -SECStatus -cert_CreateSubjectKeyIDHashTable(void); - -SECStatus -cert_AddSubjectKeyIDMapping(SECItem *subjKeyID, CERTCertificate *cert); - -SECStatus -cert_UpdateSubjectKeyIDSlotCheck(SECItem *slotid, int series); - -int -cert_SubjectKeyIDSlotCheckSeries(SECItem *slotid); - -/* - * Call this function to remove an entry from the mapping table. - */ -SECStatus -cert_RemoveSubjectKeyIDMapping(SECItem *subjKeyID); - -SECStatus -cert_DestroySubjectKeyIDHashTable(void); - -SECItem* -cert_FindDERCertBySubjectKeyID(SECItem *subjKeyID); - -/* return maximum length of AVA value based on its type OID tag. */ -extern int cert_AVAOidTagToMaxLen(SECOidTag tag); - -/* Make an AVA, allocated from pool, from OID and DER encoded value */ -extern CERTAVA * CERT_CreateAVAFromRaw(PLArenaPool *pool, - const SECItem * OID, const SECItem * value); - -/* Make an AVA from binary input specified by SECItem */ -extern CERTAVA * CERT_CreateAVAFromSECItem(PLArenaPool *arena, SECOidTag kind, - int valueType, SECItem *value); - -/* - * get a DPCache object for the given issuer subject and dp - * Automatically creates the cache object if it doesn't exist yet. - */ -SECStatus AcquireDPCache(CERTCertificate* issuer, const SECItem* subject, - const SECItem* dp, PRTime t, void* wincx, - CRLDPCache** dpcache, PRBool* writeLocked); - -/* check if a particular SN is in the CRL cache and return its entry */ -dpcacheStatus DPCache_Lookup(CRLDPCache* cache, const SECItem* sn, - CERTCrlEntry** returned); - -/* release a DPCache object that was previously acquired */ -void ReleaseDPCache(CRLDPCache* dpcache, PRBool writeLocked); - -/* - * map Stan errors into NSS errors - * This function examines the stan error stack and automatically sets - * PORT_SetError(); to the appropriate SEC_ERROR value. - */ -void CERT_MapStanError(); - -/* Like CERT_VerifyCert, except with an additional argument, flags. The - * flags are defined immediately below. - */ -SECStatus -cert_VerifyCertWithFlags(CERTCertDBHandle *handle, CERTCertificate *cert, - PRBool checkSig, SECCertUsage certUsage, PRTime t, - PRUint32 flags, void *wincx, CERTVerifyLog *log); - -/* Use the default settings. - * cert_VerifyCertWithFlags(..., CERT_VERIFYCERT_USE_DEFAULTS, ...) is - * equivalent to CERT_VerifyCert(...); - */ -#define CERT_VERIFYCERT_USE_DEFAULTS 0 - -/* Skip all the OCSP checks during certificate verification, regardless of - * the global OCSP settings. By default, certificate |cert| will have its - * revocation status checked via OCSP according to the global OCSP settings. - * - * OCSP checking is always skipped when certUsage is certUsageStatusResponder. - */ -#define CERT_VERIFYCERT_SKIP_OCSP 1 - -/* Interface function for libpkix cert validation engine: - * cert_verify wrapper. */ -SECStatus -cert_VerifyCertChainPkix(CERTCertificate *cert, - PRBool checkSig, - SECCertUsage requiredUsage, - PRTime time, - void *wincx, - CERTVerifyLog *log, - PRBool *sigError, - PRBool *revoked); - -SECStatus cert_InitLocks(void); - -SECStatus cert_DestroyLocks(void); - -/* - * fill in nsCertType field of the cert based on the cert extension - */ -extern SECStatus cert_GetCertType(CERTCertificate *cert); - -/* - * compute and return the value of nsCertType for cert, but do not - * update the CERTCertificate. - */ -extern PRUint32 cert_ComputeCertType(CERTCertificate *cert); - -void cert_AddToVerifyLog(CERTVerifyLog *log,CERTCertificate *cert, - long errorCode, unsigned int depth, - void *arg); - -/* Insert a DER CRL into the CRL cache, and take ownership of it. - * - * cert_CacheCRLByGeneralName takes ownership of the memory in crl argument - * completely. crl must be freeable by SECITEM_FreeItem. It will be freed - * immediately if it is rejected from the CRL cache, or later during cache - * updates when a new crl is available, or at shutdown time. - * - * canonicalizedName represents the source of the CRL, a GeneralName. - * The format of the encoding is not restricted, but all callers of - * cert_CacheCRLByGeneralName and cert_FindCRLByGeneralName must use - * the same encoding. To facilitate X.500 name matching, a canonicalized - * encoding of the GeneralName should be used, if available. - */ - -SECStatus cert_CacheCRLByGeneralName(CERTCertDBHandle* dbhandle, SECItem* crl, - const SECItem* canonicalizedName); - -struct NamedCRLCacheStr { - PRLock* lock; - PLHashTable* entries; -}; - -/* NamedCRLCacheEntryStr is filled in by cert_CacheCRLByGeneralName, - * and read by cert_FindCRLByGeneralName */ -struct NamedCRLCacheEntryStr { - SECItem* canonicalizedName; - SECItem* crl; /* DER, kept only if CRL - * is successfully cached */ - PRBool inCRLCache; - PRTime successfulInsertionTime; /* insertion time */ - PRTime lastAttemptTime; /* time of last call to - cert_CacheCRLByGeneralName with this name */ - PRBool badDER; /* ASN.1 error */ - PRBool dupe; /* matching DER CRL already in CRL cache */ - PRBool unsupported; /* IDP, delta, any other reason */ -}; - -typedef enum { - certRevocationStatusRevoked = 0, - certRevocationStatusValid = 1, - certRevocationStatusUnknown = 2 -} CERTRevocationStatus; - -/* Returns detailed status of the cert(revStatus variable). Tells if - * issuer cache has OriginFetchedWithTimeout crl in it. */ -SECStatus -cert_CheckCertRevocationStatus(CERTCertificate* cert, CERTCertificate* issuer, - const SECItem* dp, PRTime t, void *wincx, - CERTRevocationStatus *revStatus, - CERTCRLEntryReasonCode *revReason); - - -SECStatus cert_AcquireNamedCRLCache(NamedCRLCache** returned); - -/* cert_FindCRLByGeneralName must be called only while the named cache is - * acquired, and the entry is only valid until cache is released. - */ -SECStatus cert_FindCRLByGeneralName(NamedCRLCache* ncc, - const SECItem* canonicalizedName, - NamedCRLCacheEntry** retEntry); - -SECStatus cert_ReleaseNamedCRLCache(NamedCRLCache* ncc); - -/* This is private for now. Maybe shoule be public. */ -CERTGeneralName * -cert_GetSubjectAltNameList(const CERTCertificate *cert, PLArenaPool *arena); - -/* Count DNS names and IP addresses in a list of GeneralNames */ -PRUint32 -cert_CountDNSPatterns(CERTGeneralName *firstName); - -/* - * returns the trust status of the leaf certificate based on usage. - * If the leaf is explicitly untrusted, this function will fail and - * failedFlags will be set to the trust bit value that lead to the failure. - * If the leaf is trusted, isTrusted is set to true and the function returns - * SECSuccess. This function does not check if the cert is fit for a - * particular usage. - */ -SECStatus -cert_CheckLeafTrust(CERTCertificate *cert, - SECCertUsage usage, - unsigned int *failedFlags, - PRBool *isTrusted); - -#endif /* _CERTI_H_ */ - diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/certdb/certt.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/certdb/certt.h deleted file mode 100755 index 9ab00fd..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/certdb/certt.h +++ /dev/null @@ -1,1349 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/* - * certt.h - public data structures for the certificate library - */ -#ifndef _CERTT_H_ -#define _CERTT_H_ - -#include "prclist.h" -#include "pkcs11t.h" -#include "seccomon.h" -#include "secmodt.h" -#include "secoidt.h" -#include "plarena.h" -#include "prcvar.h" -#include "nssilock.h" -#include "prio.h" -#include "prmon.h" - -/* Stan data types */ -struct NSSCertificateStr; -struct NSSTrustDomainStr; - -/* Non-opaque objects */ -typedef struct CERTAVAStr CERTAVA; -typedef struct CERTAttributeStr CERTAttribute; -typedef struct CERTAuthInfoAccessStr CERTAuthInfoAccess; -typedef struct CERTAuthKeyIDStr CERTAuthKeyID; -typedef struct CERTBasicConstraintsStr CERTBasicConstraints; -typedef struct NSSTrustDomainStr CERTCertDBHandle; -typedef struct CERTCertExtensionStr CERTCertExtension; -typedef struct CERTCertKeyStr CERTCertKey; -typedef struct CERTCertListStr CERTCertList; -typedef struct CERTCertListNodeStr CERTCertListNode; -typedef struct CERTCertNicknamesStr CERTCertNicknames; -typedef struct CERTCertTrustStr CERTCertTrust; -typedef struct CERTCertificateStr CERTCertificate; -typedef struct CERTCertificateListStr CERTCertificateList; -typedef struct CERTCertificateRequestStr CERTCertificateRequest; -typedef struct CERTCrlStr CERTCrl; -typedef struct CERTCrlDistributionPointsStr CERTCrlDistributionPoints; -typedef struct CERTCrlEntryStr CERTCrlEntry; -typedef struct CERTCrlHeadNodeStr CERTCrlHeadNode; -typedef struct CERTCrlKeyStr CERTCrlKey; -typedef struct CERTCrlNodeStr CERTCrlNode; -typedef struct CERTDERCertsStr CERTDERCerts; -typedef struct CERTDistNamesStr CERTDistNames; -typedef struct CERTGeneralNameStr CERTGeneralName; -typedef struct CERTGeneralNameListStr CERTGeneralNameList; -typedef struct CERTIssuerAndSNStr CERTIssuerAndSN; -typedef struct CERTNameStr CERTName; -typedef struct CERTNameConstraintStr CERTNameConstraint; -typedef struct CERTNameConstraintsStr CERTNameConstraints; -typedef struct CERTOKDomainNameStr CERTOKDomainName; -typedef struct CERTPrivKeyUsagePeriodStr CERTPrivKeyUsagePeriod; -typedef struct CERTPublicKeyAndChallengeStr CERTPublicKeyAndChallenge; -typedef struct CERTRDNStr CERTRDN; -typedef struct CERTSignedCrlStr CERTSignedCrl; -typedef struct CERTSignedDataStr CERTSignedData; -typedef struct CERTStatusConfigStr CERTStatusConfig; -typedef struct CERTSubjectListStr CERTSubjectList; -typedef struct CERTSubjectNodeStr CERTSubjectNode; -typedef struct CERTSubjectPublicKeyInfoStr CERTSubjectPublicKeyInfo; -typedef struct CERTValidityStr CERTValidity; -typedef struct CERTVerifyLogStr CERTVerifyLog; -typedef struct CERTVerifyLogNodeStr CERTVerifyLogNode; -typedef struct CRLDistributionPointStr CRLDistributionPoint; - -/* CRL extensions type */ -typedef unsigned long CERTCrlNumber; - -/* -** An X.500 AVA object -*/ -struct CERTAVAStr { - SECItem type; - SECItem value; -}; - -/* -** An X.500 RDN object -*/ -struct CERTRDNStr { - CERTAVA **avas; -}; - -/* -** An X.500 name object -*/ -struct CERTNameStr { - PLArenaPool *arena; - CERTRDN **rdns; -}; - -/* -** An X.509 validity object -*/ -struct CERTValidityStr { - PLArenaPool *arena; - SECItem notBefore; - SECItem notAfter; -}; - -/* - * A serial number and issuer name, which is used as a database key - */ -struct CERTCertKeyStr { - SECItem serialNumber; - SECItem derIssuer; -}; - -/* -** A signed data object. Used to implement the "signed" macro used -** in the X.500 specs. -*/ -struct CERTSignedDataStr { - SECItem data; - SECAlgorithmID signatureAlgorithm; - SECItem signature; -}; - -/* -** An X.509 subject-public-key-info object -*/ -struct CERTSubjectPublicKeyInfoStr { - PLArenaPool *arena; - SECAlgorithmID algorithm; - SECItem subjectPublicKey; -}; - -struct CERTPublicKeyAndChallengeStr { - SECItem spki; - SECItem challenge; -}; - -struct CERTCertTrustStr { - unsigned int sslFlags; - unsigned int emailFlags; - unsigned int objectSigningFlags; -}; - -/* - * defined the types of trust that exist - */ -typedef enum SECTrustTypeEnum { - trustSSL = 0, - trustEmail = 1, - trustObjectSigning = 2, - trustTypeNone = 3 -} SECTrustType; - -#define SEC_GET_TRUST_FLAGS(trust,type) \ - (((type)==trustSSL)?((trust)->sslFlags): \ - (((type)==trustEmail)?((trust)->emailFlags): \ - (((type)==trustObjectSigning)?((trust)->objectSigningFlags):0))) - -/* -** An X.509.3 certificate extension -*/ -struct CERTCertExtensionStr { - SECItem id; - SECItem critical; - SECItem value; -}; - -struct CERTSubjectNodeStr { - struct CERTSubjectNodeStr *next; - struct CERTSubjectNodeStr *prev; - SECItem certKey; - SECItem keyID; -}; - -struct CERTSubjectListStr { - PLArenaPool *arena; - int ncerts; - char *emailAddr; - CERTSubjectNode *head; - CERTSubjectNode *tail; /* do we need tail? */ - void *entry; -}; - -/* -** An X.509 certificate object (the unsigned form) -*/ -struct CERTCertificateStr { - /* the arena is used to allocate any data structures that have the same - * lifetime as the cert. This is all stuff that hangs off of the cert - * structure, and is all freed at the same time. I is used when the - * cert is decoded, destroyed, and at some times when it changes - * state - */ - PLArenaPool *arena; - - /* The following fields are static after the cert has been decoded */ - char *subjectName; - char *issuerName; - CERTSignedData signatureWrap; /* XXX */ - SECItem derCert; /* original DER for the cert */ - SECItem derIssuer; /* DER for issuer name */ - SECItem derSubject; /* DER for subject name */ - SECItem derPublicKey; /* DER for the public key */ - SECItem certKey; /* database key for this cert */ - SECItem version; - SECItem serialNumber; - SECAlgorithmID signature; - CERTName issuer; - CERTValidity validity; - CERTName subject; - CERTSubjectPublicKeyInfo subjectPublicKeyInfo; - SECItem issuerID; - SECItem subjectID; - CERTCertExtension **extensions; - char *emailAddr; - CERTCertDBHandle *dbhandle; - SECItem subjectKeyID; /* x509v3 subject key identifier */ - PRBool keyIDGenerated; /* was the keyid generated? */ - unsigned int keyUsage; /* what uses are allowed for this cert */ - unsigned int rawKeyUsage; /* value of the key usage extension */ - PRBool keyUsagePresent; /* was the key usage extension present */ - PRUint32 nsCertType; /* value of the ns cert type extension */ - /* must be 32-bit for PR_ATOMIC_SET */ - - /* these values can be set by the application to bypass certain checks - * or to keep the cert in memory for an entire session. - * XXX - need an api to set these - */ - PRBool keepSession; /* keep this cert for entire session*/ - PRBool timeOK; /* is the bad validity time ok? */ - CERTOKDomainName *domainOK; /* these domain names are ok */ - - /* - * these values can change when the cert changes state. These state - * changes include transitions from temp to perm or vice-versa, and - * changes of trust flags - */ - PRBool isperm; - PRBool istemp; - char *nickname; - char *dbnickname; - struct NSSCertificateStr *nssCertificate; /* This is Stan stuff. */ - CERTCertTrust *trust; - - /* the reference count is modified whenever someone looks up, dups - * or destroys a certificate - */ - int referenceCount; - - /* The subject list is a list of all certs with the same subject name. - * It can be modified any time a cert is added or deleted from either - * the in-memory(temporary) or on-disk(permanent) database. - */ - CERTSubjectList *subjectList; - - /* these belong in the static section, but are here to maintain - * the structure's integrity - */ - CERTAuthKeyID * authKeyID; /* x509v3 authority key identifier */ - PRBool isRoot; /* cert is the end of a chain */ - - /* these fields are used by client GUI code to keep track of ssl sockets - * that are blocked waiting on GUI feedback related to this cert. - * XXX - these should be moved into some sort of application specific - * data structure. They are only used by the browser right now. - */ - union { - void* apointer; /* was struct SECSocketNode* authsocketlist */ - struct { - unsigned int hasUnsupportedCriticalExt :1; - /* add any new option bits needed here */ - } bits; - } options; - int series; /* was int authsocketcount; record the series of the pkcs11ID */ - - /* This is PKCS #11 stuff. */ - PK11SlotInfo *slot; /*if this cert came of a token, which is it*/ - CK_OBJECT_HANDLE pkcs11ID; /*and which object on that token is it */ - PRBool ownSlot; /*true if the cert owns the slot reference */ -}; -#define SEC_CERTIFICATE_VERSION_1 0 /* default created */ -#define SEC_CERTIFICATE_VERSION_2 1 /* v2 */ -#define SEC_CERTIFICATE_VERSION_3 2 /* v3 extensions */ - -#define SEC_CRL_VERSION_1 0 /* default */ -#define SEC_CRL_VERSION_2 1 /* v2 extensions */ - -/* - * used to identify class of cert in mime stream code - */ -#define SEC_CERT_CLASS_CA 1 -#define SEC_CERT_CLASS_SERVER 2 -#define SEC_CERT_CLASS_USER 3 -#define SEC_CERT_CLASS_EMAIL 4 - -struct CERTDERCertsStr { - PLArenaPool *arena; - int numcerts; - SECItem *rawCerts; -}; - -/* -** A PKCS ? Attribute -** XXX this is duplicated through out the code, it *should* be moved -** to a central location. Where would be appropriate? -*/ -struct CERTAttributeStr { - SECItem attrType; - SECItem **attrValue; -}; - -/* -** A PKCS#10 certificate-request object (the unsigned form) -*/ -struct CERTCertificateRequestStr { - PLArenaPool *arena; - SECItem version; - CERTName subject; - CERTSubjectPublicKeyInfo subjectPublicKeyInfo; - CERTAttribute **attributes; -}; -#define SEC_CERTIFICATE_REQUEST_VERSION 0 /* what we *create* */ - - -/* -** A certificate list object. -*/ -struct CERTCertificateListStr { - SECItem *certs; - int len; /* number of certs */ - PLArenaPool *arena; -}; - -struct CERTCertListNodeStr { - PRCList links; - CERTCertificate *cert; - void *appData; -}; - -struct CERTCertListStr { - PRCList list; - PLArenaPool *arena; -}; - -#define CERT_LIST_HEAD(l) ((CERTCertListNode *)PR_LIST_HEAD(&l->list)) -#define CERT_LIST_TAIL(l) ((CERTCertListNode *)PR_LIST_TAIL(&l->list)) -#define CERT_LIST_NEXT(n) ((CERTCertListNode *)n->links.next) -#define CERT_LIST_END(n,l) (((void *)n) == ((void *)&l->list)) -#define CERT_LIST_EMPTY(l) CERT_LIST_END(CERT_LIST_HEAD(l), l) - -struct CERTCrlEntryStr { - SECItem serialNumber; - SECItem revocationDate; - CERTCertExtension **extensions; -}; - -struct CERTCrlStr { - PLArenaPool *arena; - SECItem version; - SECAlgorithmID signatureAlg; - SECItem derName; - CERTName name; - SECItem lastUpdate; - SECItem nextUpdate; /* optional for x.509 CRL */ - CERTCrlEntry **entries; - CERTCertExtension **extensions; - /* can't add anything there for binary backwards compatibility reasons */ -}; - -struct CERTCrlKeyStr { - SECItem derName; - SECItem dummy; /* The decoder can not skip a primitive, - this serves as a place holder for the - decoder to finish its task only - */ -}; - -struct CERTSignedCrlStr { - PLArenaPool *arena; - CERTCrl crl; - void *reserved1; - PRBool reserved2; - PRBool isperm; - PRBool istemp; - int referenceCount; - CERTCertDBHandle *dbhandle; - CERTSignedData signatureWrap; /* XXX */ - char *url; - SECItem *derCrl; - PK11SlotInfo *slot; - CK_OBJECT_HANDLE pkcs11ID; - void* opaque; /* do not touch */ -}; - - -struct CERTCrlHeadNodeStr { - PLArenaPool *arena; - CERTCertDBHandle *dbhandle; - CERTCrlNode *first; - CERTCrlNode *last; -}; - - -struct CERTCrlNodeStr { - CERTCrlNode *next; - int type; - CERTSignedCrl *crl; -}; - - -/* - * Array of X.500 Distinguished Names - */ -struct CERTDistNamesStr { - PLArenaPool *arena; - int nnames; - SECItem *names; - void *head; /* private */ -}; - - -#define NS_CERT_TYPE_SSL_CLIENT (0x80) /* bit 0 */ -#define NS_CERT_TYPE_SSL_SERVER (0x40) /* bit 1 */ -#define NS_CERT_TYPE_EMAIL (0x20) /* bit 2 */ -#define NS_CERT_TYPE_OBJECT_SIGNING (0x10) /* bit 3 */ -#define NS_CERT_TYPE_RESERVED (0x08) /* bit 4 */ -#define NS_CERT_TYPE_SSL_CA (0x04) /* bit 5 */ -#define NS_CERT_TYPE_EMAIL_CA (0x02) /* bit 6 */ -#define NS_CERT_TYPE_OBJECT_SIGNING_CA (0x01) /* bit 7 */ - -#define EXT_KEY_USAGE_TIME_STAMP (0x8000) -#define EXT_KEY_USAGE_STATUS_RESPONDER (0x4000) - -#define NS_CERT_TYPE_APP ( NS_CERT_TYPE_SSL_CLIENT | \ - NS_CERT_TYPE_SSL_SERVER | \ - NS_CERT_TYPE_EMAIL | \ - NS_CERT_TYPE_OBJECT_SIGNING ) - -#define NS_CERT_TYPE_CA ( NS_CERT_TYPE_SSL_CA | \ - NS_CERT_TYPE_EMAIL_CA | \ - NS_CERT_TYPE_OBJECT_SIGNING_CA | \ - EXT_KEY_USAGE_STATUS_RESPONDER ) -typedef enum SECCertUsageEnum { - certUsageSSLClient = 0, - certUsageSSLServer = 1, - certUsageSSLServerWithStepUp = 2, - certUsageSSLCA = 3, - certUsageEmailSigner = 4, - certUsageEmailRecipient = 5, - certUsageObjectSigner = 6, - certUsageUserCertImport = 7, - certUsageVerifyCA = 8, - certUsageProtectedObjectSigner = 9, - certUsageStatusResponder = 10, - certUsageAnyCA = 11 -} SECCertUsage; - -typedef PRInt64 SECCertificateUsage; - -#define certificateUsageCheckAllUsages (0x0000) -#define certificateUsageSSLClient (0x0001) -#define certificateUsageSSLServer (0x0002) -#define certificateUsageSSLServerWithStepUp (0x0004) -#define certificateUsageSSLCA (0x0008) -#define certificateUsageEmailSigner (0x0010) -#define certificateUsageEmailRecipient (0x0020) -#define certificateUsageObjectSigner (0x0040) -#define certificateUsageUserCertImport (0x0080) -#define certificateUsageVerifyCA (0x0100) -#define certificateUsageProtectedObjectSigner (0x0200) -#define certificateUsageStatusResponder (0x0400) -#define certificateUsageAnyCA (0x0800) - -#define certificateUsageHighest certificateUsageAnyCA - -/* - * Does the cert belong to the user, a peer, or a CA. - */ -typedef enum CERTCertOwnerEnum { - certOwnerUser = 0, - certOwnerPeer = 1, - certOwnerCA = 2 -} CERTCertOwner; - -/* - * This enum represents the state of validity times of a certificate - */ -typedef enum SECCertTimeValidityEnum { - secCertTimeValid = 0, - secCertTimeExpired = 1, - secCertTimeNotValidYet = 2, - secCertTimeUndetermined = 3 /* validity could not be decoded from the - cert, most likely because it was NULL */ -} SECCertTimeValidity; - -/* - * This is used as return status in functions that compare the validity - * periods of two certificates A and B, currently only - * CERT_CompareValidityTimes. - */ - -typedef enum CERTCompareValidityStatusEnum -{ - certValidityUndetermined = 0, /* the function is unable to select one cert - over another */ - certValidityChooseB = 1, /* cert B should be preferred */ - certValidityEqual = 2, /* both certs have the same validity period */ - certValidityChooseA = 3 /* cert A should be preferred */ -} CERTCompareValidityStatus; - -/* - * Interface for getting certificate nickname strings out of the database - */ - -/* these are values for the what argument below */ -#define SEC_CERT_NICKNAMES_ALL 1 -#define SEC_CERT_NICKNAMES_USER 2 -#define SEC_CERT_NICKNAMES_SERVER 3 -#define SEC_CERT_NICKNAMES_CA 4 - -struct CERTCertNicknamesStr { - PLArenaPool *arena; - void *head; - int numnicknames; - char **nicknames; - int what; - int totallen; -}; - -struct CERTIssuerAndSNStr { - SECItem derIssuer; - CERTName issuer; - SECItem serialNumber; -}; - - -/* X.509 v3 Key Usage Extension flags */ -#define KU_DIGITAL_SIGNATURE (0x80) /* bit 0 */ -#define KU_NON_REPUDIATION (0x40) /* bit 1 */ -#define KU_KEY_ENCIPHERMENT (0x20) /* bit 2 */ -#define KU_DATA_ENCIPHERMENT (0x10) /* bit 3 */ -#define KU_KEY_AGREEMENT (0x08) /* bit 4 */ -#define KU_KEY_CERT_SIGN (0x04) /* bit 5 */ -#define KU_CRL_SIGN (0x02) /* bit 6 */ -#define KU_ENCIPHER_ONLY (0x01) /* bit 7 */ -#define KU_ALL (KU_DIGITAL_SIGNATURE | \ - KU_NON_REPUDIATION | \ - KU_KEY_ENCIPHERMENT | \ - KU_DATA_ENCIPHERMENT | \ - KU_KEY_AGREEMENT | \ - KU_KEY_CERT_SIGN | \ - KU_CRL_SIGN | \ - KU_ENCIPHER_ONLY) - -/* This value will not occur in certs. It is used internally for the case - * when either digital signature or non-repudiation is the correct value. - */ -#define KU_DIGITAL_SIGNATURE_OR_NON_REPUDIATION (0x2000) - -/* This value will not occur in certs. It is used internally for the case - * when the key type is not know ahead of time and either key agreement or - * key encipherment are the correct value based on key type - */ -#define KU_KEY_AGREEMENT_OR_ENCIPHERMENT (0x4000) - -/* internal bits that do not match bits in the x509v3 spec, but are used - * for similar purposes - */ -#define KU_NS_GOVT_APPROVED (0x8000) /*don't make part of KU_ALL!*/ -/* - * x.509 v3 Basic Constraints Extension - * If isCA is false, the pathLenConstraint is ignored. - * Otherwise, the following pathLenConstraint values will apply: - * < 0 - there is no limit to the certificate path - * 0 - CA can issues end-entity certificates only - * > 0 - the number of certificates in the certificate path is - * limited to this number - */ -#define CERT_UNLIMITED_PATH_CONSTRAINT -2 - -struct CERTBasicConstraintsStr { - PRBool isCA; /* on if is CA */ - int pathLenConstraint; /* maximum number of certificates that can be - in the cert path. Only applies to a CA - certificate; otherwise, it's ignored. - */ -}; - -/* Maximum length of a certificate chain */ -#define CERT_MAX_CERT_CHAIN 20 - -#define CERT_MAX_SERIAL_NUMBER_BYTES 20 /* from RFC 3280 */ -#define CERT_MAX_DN_BYTES 4096 /* arbitrary */ - -/* x.509 v3 Reason Flags, used in CRLDistributionPoint Extension */ -#define RF_UNUSED (0x80) /* bit 0 */ -#define RF_KEY_COMPROMISE (0x40) /* bit 1 */ -#define RF_CA_COMPROMISE (0x20) /* bit 2 */ -#define RF_AFFILIATION_CHANGED (0x10) /* bit 3 */ -#define RF_SUPERSEDED (0x08) /* bit 4 */ -#define RF_CESSATION_OF_OPERATION (0x04) /* bit 5 */ -#define RF_CERTIFICATE_HOLD (0x02) /* bit 6 */ - -/* enum for CRL Entry Reason Code */ -typedef enum CERTCRLEntryReasonCodeEnum { - crlEntryReasonUnspecified = 0, - crlEntryReasonKeyCompromise = 1, - crlEntryReasonCaCompromise = 2, - crlEntryReasonAffiliationChanged = 3, - crlEntryReasonSuperseded = 4, - crlEntryReasonCessationOfOperation = 5, - crlEntryReasoncertificatedHold = 6, - crlEntryReasonRemoveFromCRL = 8, - crlEntryReasonPrivilegeWithdrawn = 9, - crlEntryReasonAaCompromise = 10 -} CERTCRLEntryReasonCode; - -/* If we needed to extract the general name field, use this */ -/* General Name types */ -typedef enum CERTGeneralNameTypeEnum { - certOtherName = 1, - certRFC822Name = 2, - certDNSName = 3, - certX400Address = 4, - certDirectoryName = 5, - certEDIPartyName = 6, - certURI = 7, - certIPAddress = 8, - certRegisterID = 9 -} CERTGeneralNameType; - - -typedef struct OtherNameStr { - SECItem name; - SECItem oid; -}OtherName; - - - -struct CERTGeneralNameStr { - CERTGeneralNameType type; /* name type */ - union { - CERTName directoryName; /* distinguish name */ - OtherName OthName; /* Other Name */ - SECItem other; /* the rest of the name forms */ - }name; - SECItem derDirectoryName; /* this is saved to simplify directory name - comparison */ - PRCList l; -}; - -struct CERTGeneralNameListStr { - PLArenaPool *arena; - CERTGeneralName *name; - int refCount; - int len; - PZLock *lock; -}; - -struct CERTNameConstraintStr { - CERTGeneralName name; - SECItem DERName; - SECItem min; - SECItem max; - PRCList l; -}; - - -struct CERTNameConstraintsStr { - CERTNameConstraint *permited; - CERTNameConstraint *excluded; - SECItem **DERPermited; - SECItem **DERExcluded; -}; - - -/* Private Key Usage Period extension struct. */ -struct CERTPrivKeyUsagePeriodStr { - SECItem notBefore; - SECItem notAfter; - PLArenaPool *arena; -}; - -/* X.509 v3 Authority Key Identifier extension. For the authority certificate - issuer field, we only support URI now. - */ -struct CERTAuthKeyIDStr { - SECItem keyID; /* unique key identifier */ - CERTGeneralName *authCertIssuer; /* CA's issuer name. End with a NULL */ - SECItem authCertSerialNumber; /* CA's certificate serial number */ - SECItem **DERAuthCertIssuer; /* This holds the DER encoded format of - the authCertIssuer field. It is used - by the encoding engine. It should be - used as a read only field by the caller. - */ -}; - -/* x.509 v3 CRL Distributeion Point */ - -/* - * defined the types of CRL Distribution points - */ -typedef enum DistributionPointTypesEnum { - generalName = 1, /* only support this for now */ - relativeDistinguishedName = 2 -} DistributionPointTypes; - -struct CRLDistributionPointStr { - DistributionPointTypes distPointType; - union { - CERTGeneralName *fullName; - CERTRDN relativeName; - } distPoint; - SECItem reasons; - CERTGeneralName *crlIssuer; - - /* Reserved for internal use only*/ - SECItem derDistPoint; - SECItem derRelativeName; - SECItem **derCrlIssuer; - SECItem **derFullName; - SECItem bitsmap; -}; - -struct CERTCrlDistributionPointsStr { - CRLDistributionPoint **distPoints; -}; - -/* - * This structure is used to keep a log of errors when verifying - * a cert chain. This allows multiple errors to be reported all at - * once. - */ -struct CERTVerifyLogNodeStr { - CERTCertificate *cert; /* what cert had the error */ - long error; /* what error was it? */ - unsigned int depth; /* how far up the chain are we */ - void *arg; /* error specific argument */ - struct CERTVerifyLogNodeStr *next; /* next in the list */ - struct CERTVerifyLogNodeStr *prev; /* next in the list */ -}; - - -struct CERTVerifyLogStr { - PLArenaPool *arena; - unsigned int count; - struct CERTVerifyLogNodeStr *head; - struct CERTVerifyLogNodeStr *tail; -}; - - -struct CERTOKDomainNameStr { - CERTOKDomainName *next; - char name[1]; /* actual length may be longer. */ -}; - - -typedef SECStatus (PR_CALLBACK *CERTStatusChecker) (CERTCertDBHandle *handle, - CERTCertificate *cert, - PRTime time, - void *pwArg); - -typedef SECStatus (PR_CALLBACK *CERTStatusDestroy) (CERTStatusConfig *handle); - -struct CERTStatusConfigStr { - CERTStatusChecker statusChecker; /* NULL means no checking enabled */ - CERTStatusDestroy statusDestroy; /* enabled or no, will clean up */ - void *statusContext; /* cx specific to checking protocol */ -}; - -struct CERTAuthInfoAccessStr { - SECItem method; - SECItem derLocation; - CERTGeneralName *location; /* decoded location */ -}; - - -/* This is the typedef for the callback passed to CERT_OpenCertDB() */ -/* callback to return database name based on version number */ -typedef char * (*CERTDBNameFunc)(void *arg, int dbVersion); - -/* - * types of cert packages that we can decode - */ -typedef enum CERTPackageTypeEnum { - certPackageNone = 0, - certPackageCert = 1, - certPackagePKCS7 = 2, - certPackageNSCertSeq = 3, - certPackageNSCertWrap = 4 -} CERTPackageType; - -/* - * these types are for the PKIX Certificate Policies extension - */ -typedef struct { - SECOidTag oid; - SECItem qualifierID; - SECItem qualifierValue; -} CERTPolicyQualifier; - -typedef struct { - SECOidTag oid; - SECItem policyID; - CERTPolicyQualifier **policyQualifiers; -} CERTPolicyInfo; - -typedef struct { - PLArenaPool *arena; - CERTPolicyInfo **policyInfos; -} CERTCertificatePolicies; - -typedef struct { - SECItem organization; - SECItem **noticeNumbers; -} CERTNoticeReference; - -typedef struct { - PLArenaPool *arena; - CERTNoticeReference noticeReference; - SECItem derNoticeReference; - SECItem displayText; -} CERTUserNotice; - -typedef struct { - PLArenaPool *arena; - SECItem **oids; -} CERTOidSequence; - -/* - * these types are for the PKIX Policy Mappings extension - */ -typedef struct { - SECItem issuerDomainPolicy; - SECItem subjectDomainPolicy; -} CERTPolicyMap; - -typedef struct { - PLArenaPool *arena; - CERTPolicyMap **policyMaps; -} CERTCertificatePolicyMappings; - -/* - * these types are for the PKIX inhibitAnyPolicy extension - */ -typedef struct { - SECItem inhibitAnySkipCerts; -} CERTCertificateInhibitAny; - -/* - * these types are for the PKIX Policy Constraints extension - */ -typedef struct { - SECItem explicitPolicySkipCerts; - SECItem inhibitMappingSkipCerts; -} CERTCertificatePolicyConstraints; - -/* - * These types are for the validate chain callback param. - * - * CERTChainVerifyCallback is an application-supplied callback that can be used - * to augment libpkix's certificate chain validation with additional - * application-specific checks. It may be called multiple times if there are - * multiple potentially-valid paths for the certificate being validated. This - * callback is called before revocation checking is done on the certificates in - * the given chain. - * - * - isValidChainArg contains the application-provided opaque argument - * - currentChain is the currently validated chain. It is ordered with the leaf - * certificate at the head and the trust anchor at the tail. - * - * The callback should set *chainOK = PR_TRUE and return SECSuccess if the - * certificate chain is acceptable. It should set *chainOK = PR_FALSE and - * return SECSuccess if the chain is unacceptable, to indicate that the given - * chain is bad and path building should continue. It should return SECFailure - * to indicate an fatal error that will cause path validation to fail - * immediately. - */ -typedef SECStatus (*CERTChainVerifyCallbackFunc) - (void *isChainValidArg, - const CERTCertList *currentChain, - PRBool *chainOK); - -/* - * Note: If extending this structure, it will be necessary to change the - * associated CERTValParamInType - */ -typedef struct { - CERTChainVerifyCallbackFunc isChainValid; - void *isChainValidArg; -} CERTChainVerifyCallback; - -/* - * these types are for the CERT_PKIX* Verification functions - * These are all optional parameters. - */ - -typedef enum { - cert_pi_end = 0, /* SPECIAL: signifies end of array of - * CERTValParam* */ - cert_pi_nbioContext = 1, /* specify a non-blocking IO context used to - * resume a session. If this argument is - * specified, no other arguments should be. - * Specified in value.pointer.p. If the - * operation completes the context will be - * freed. */ - cert_pi_nbioAbort = 2, /* specify a non-blocking IO context for an - * existing operation which the caller wants - * to abort. If this argument is - * specified, no other arguments should be. - * Specified in value.pointer.p. If the - * operation succeeds the context will be - * freed. */ - cert_pi_certList = 3, /* specify the chain to validate against. If - * this value is given, then the path - * construction step in the validation is - * skipped. Specified in value.pointer.chain */ - cert_pi_policyOID = 4, /* validate certificate for policy OID. - * Specified in value.array.oids. Cert must - * be good for at least one OID in order - * to validate. Default is that the user is not - * concerned about certificate policy. */ - cert_pi_policyFlags = 5, /* flags for each policy specified in policyOID. - * Specified in value.scalar.ul. Policy flags - * apply to all specified oids. - * Use CERT_POLICY_FLAG_* macros below. If not - * specified policy flags default to 0 */ - cert_pi_keyusage = 6, /* specify what the keyusages the certificate - * will be evaluated against, specified in - * value.scalar.ui. The cert must validate for - * at least one of the specified key usages. - * Values match the KU_ bit flags defined - * in this file. Default is derived from - * the 'usages' function argument */ - cert_pi_extendedKeyusage= 7, /* specify what the required extended key - * usage of the certificate. Specified as - * an array of oidTags in value.array.oids. - * The cert must validate for at least one - * of the specified extended key usages. - * If not specified, no extended key usages - * will be checked. */ - cert_pi_date = 8, /* validate certificate is valid as of date - * specified in value.scalar.time. A special - * value '0' indicates 'now'. default is '0' */ - cert_pi_revocationFlags = 9, /* Specify what revocation checking to do. - * See CERT_REV_FLAG_* macros below - * Set in value.pointer.revocation */ - cert_pi_certStores = 10,/* Bitmask of Cert Store flags (see below) - * Set in value.scalar.ui */ - cert_pi_trustAnchors = 11,/* Specify the list of trusted roots to - * validate against. - * The default set of trusted roots, these are - * root CA certs from libnssckbi.so or CA - * certs trusted by user, are used in any of - * the following cases: - * * when the parameter is not set. - * * when the list of trust anchors is empty. - * Note that this handling can be further altered by altering the - * cert_pi_useOnlyTrustAnchors flag - * Specified in value.pointer.chain */ - cert_pi_useAIACertFetch = 12, /* Enables cert fetching using AIA extension. - * In NSS 3.12.1 or later. Default is off. - * Value is in value.scalar.b */ - cert_pi_chainVerifyCallback = 13, - /* The callback container for doing extra - * validation on the currently calculated chain. - * Value is in value.pointer.chainVerifyCallback */ - cert_pi_useOnlyTrustAnchors = 14,/* If true, disables trusting any - * certificates other than the ones passed in via cert_pi_trustAnchors. - * If false, then the certificates specified via cert_pi_trustAnchors - * will be combined with the pre-existing trusted roots, but only for - * the certificate validation being performed. - * If no value has been supplied via cert_pi_trustAnchors, this has no - * effect. - * The default value is true, meaning if this is not supplied, only - * trust anchors supplied via cert_pi_trustAnchors are trusted. - * Specified in value.scalar.b */ - cert_pi_max /* SPECIAL: signifies maximum allowed value, - * can increase in future releases */ -} CERTValParamInType; - -/* - * for all out parameters: - * out parameters are only returned if the caller asks for them in - * the CERTValOutParam array. Caller is responsible for the CERTValOutParam - * array itself. The pkix verify function will allocate and other arrays - * pointers, or objects. The Caller is responsible for freeing those results. - * If SECWouldBlock is returned, only cert_pi_nbioContext is returned. - */ -typedef enum { - cert_po_end = 0, /* SPECIAL: signifies end of array of - * CERTValParam* */ - cert_po_nbioContext = 1, /* Return a nonblocking context. If no - * non-blocking context is specified, then - * blocking IO will be used. - * Returned in value.pointer.p. The context is - * freed after an abort or a complete operation. - * This value is only returned on SECWouldBlock. - */ - cert_po_trustAnchor = 2, /* Return the trust anchor for the chain that - * was validated. Returned in - * value.pointer.cert, this value is only - * returned on SECSuccess. */ - cert_po_certList = 3, /* Return the entire chain that was validated. - * Returned in value.pointer.certList. If no - * chain could be constructed, this value - * would be NULL. */ - cert_po_policyOID = 4, /* Return the policies that were found to be - * valid. Returned in value.array.oids as an - * array. This is only returned on - * SECSuccess. */ - cert_po_errorLog = 5, /* Return a log of problems with the chain. - * Returned in value.pointer.log */ - cert_po_usages = 6, /* Return what usages the certificate is valid - for. Returned in value.scalar.usages */ - cert_po_keyUsage = 7, /* Return what key usages the certificate - * is valid for. - * Returned in value.scalar.usage */ - cert_po_extendedKeyusage= 8, /* Return what extended key usages the - * certificate is valid for. - * Returned in value.array.oids */ - cert_po_max /* SPECIAL: signifies maximum allowed value, - * can increase in future releases */ - -} CERTValParamOutType; - -typedef enum { - cert_revocation_method_crl = 0, - cert_revocation_method_ocsp, - cert_revocation_method_count -} CERTRevocationMethodIndex; - - -/* - * The following flags are supposed to be used to control bits in - * each integer contained in the array pointed to be: - * CERTRevocationTests.cert_rev_flags_per_method - * All Flags are prefixed by CERT_REV_M_, where _M_ indicates - * this is a method dependent flag. - */ - -/* - * Whether or not to use a method for revocation testing. - * If set to "do not test", then all other flags are ignored. - */ -#define CERT_REV_M_DO_NOT_TEST_USING_THIS_METHOD 0UL -#define CERT_REV_M_TEST_USING_THIS_METHOD 1UL - -/* - * Whether or not NSS is allowed to attempt to fetch fresh information - * from the network. - * (Although fetching will never happen if fresh information for the - * method is already locally available.) - */ -#define CERT_REV_M_ALLOW_NETWORK_FETCHING 0UL -#define CERT_REV_M_FORBID_NETWORK_FETCHING 2UL - -/* - * Example for an implicit default source: - * The globally configured default OCSP responder. - * IGNORE means: - * ignore the implicit default source, whether it's configured or not. - * ALLOW means: - * if an implicit default source is configured, - * then it overrides any available or missing source in the cert. - * if no implicit default source is configured, - * then we continue to use what's available (or not available) - * in the certs. - */ -#define CERT_REV_M_ALLOW_IMPLICIT_DEFAULT_SOURCE 0UL -#define CERT_REV_M_IGNORE_IMPLICIT_DEFAULT_SOURCE 4UL - -/* - * Defines the behavior if no fresh information is available, - * fetching from the network is allowed, but the source of revocation - * information is unknown (even after considering implicit sources, - * if allowed by other flags). - * SKIPT_TEST means: - * We ignore that no fresh information is available and - * skip this test. - * REQUIRE_INFO means: - * We still require that fresh information is available. - * Other flags define what happens on missing fresh info. - */ -#define CERT_REV_M_SKIP_TEST_ON_MISSING_SOURCE 0UL -#define CERT_REV_M_REQUIRE_INFO_ON_MISSING_SOURCE 8UL - -/* - * Defines the behavior if we are unable to obtain fresh information. - * INGORE means: - * Return "cert status unknown" - * FAIL means: - * Return "cert revoked". - */ -#define CERT_REV_M_IGNORE_MISSING_FRESH_INFO 0UL -#define CERT_REV_M_FAIL_ON_MISSING_FRESH_INFO 16UL - -/* - * What should happen if we were able to find fresh information using - * this method, and the data indicated the cert is good? - * STOP_TESTING means: - * Our success is sufficient, do not continue testing - * other methods. - * CONTINUE_TESTING means: - * We will continue and test the next allowed - * specified method. - */ -#define CERT_REV_M_STOP_TESTING_ON_FRESH_INFO 0UL -#define CERT_REV_M_CONTINUE_TESTING_ON_FRESH_INFO 32UL - -/* When this flag is used, libpkix will never attempt to use the GET HTTP - * method for OCSP requests; it will always use POST. - */ -#define CERT_REV_M_FORCE_POST_METHOD_FOR_OCSP 64UL - -/* - * The following flags are supposed to be used to control bits in - * CERTRevocationTests.cert_rev_method_independent_flags - * All Flags are prefixed by CERT_REV_M_, where _M_ indicates - * this is a method independent flag. - */ - -/* - * This defines the order to checking. - * EACH_METHOD_SEPARATELY means: - * Do all tests related to a particular allowed method - * (both local information and network fetching) in a single step. - * Only after testing for a particular method is done, - * then switching to the next method will happen. - * ALL_LOCAL_INFORMATION_FIRST means: - * Start by testing the information for all allowed methods - * which are already locally available. Only after that is done - * consider to fetch from the network (as allowed by other flags). - */ -#define CERT_REV_MI_TEST_EACH_METHOD_SEPARATELY 0UL -#define CERT_REV_MI_TEST_ALL_LOCAL_INFORMATION_FIRST 1UL - -/* - * Use this flag to specify that it's necessary that fresh information - * is available for at least one of the allowed methods, but it's - * irrelevant which of the mechanisms succeeded. - * NO_OVERALL_INFO_REQUIREMENT means: - * We strictly follow the requirements for each individual method. - * REQUIRE_SOME_FRESH_INFO_AVAILABLE means: - * After the individual tests have been executed, we must have - * been able to find fresh information using at least one method. - * If we were unable to find fresh info, it's a failure. - * This setting overrides the CERT_REV_M_FAIL_ON_MISSING_FRESH_INFO - * flag on all methods. - */ -#define CERT_REV_MI_NO_OVERALL_INFO_REQUIREMENT 0UL -#define CERT_REV_MI_REQUIRE_SOME_FRESH_INFO_AVAILABLE 2UL - - -typedef struct { - /* - * The size of the array that cert_rev_flags_per_method points to, - * meaning, the number of methods that are known and defined - * by the caller. - */ - PRUint32 number_of_defined_methods; - - /* - * A pointer to an array of integers. - * Each integer defines revocation checking for a single method, - * by having individual CERT_REV_M_* bits set or not set. - * The meaning of index numbers into this array are defined by - * enum CERTRevocationMethodIndex - * The size of the array must be specified by the caller in the separate - * variable number_of_defined_methods. - * The size of the array may be smaller than - * cert_revocation_method_count, it can happen if a caller - * is not yet aware of the latest revocation methods - * (or does not want to use them). - */ - PRUint64 *cert_rev_flags_per_method; - - /* - * How many preferred methods are specified? - * This is equivalent to the size of the array that - * preferred_revocation_methods points to. - * It's allowed to set this value to zero, - * then NSS will decide which methods to prefer. - */ - PRUint32 number_of_preferred_methods; - - /* Array that may specify an optional order of preferred methods. - * Each array entry shall contain a method identifier as defined - * by CERTRevocationMethodIndex. - * The entry at index [0] specifies the method with highest preferrence. - * These methods will be tested first for locally available information. - * Methods allowed for downloading will be attempted in the same order. - */ - CERTRevocationMethodIndex *preferred_methods; - - /* - * An integer which defines certain aspects of revocation checking - * (independent of individual methods) by having individual - * CERT_REV_MI_* bits set or not set. - */ - PRUint64 cert_rev_method_independent_flags; -} CERTRevocationTests; - -typedef struct { - CERTRevocationTests leafTests; - CERTRevocationTests chainTests; -} CERTRevocationFlags; - -typedef struct CERTValParamInValueStr { - union { - PRBool b; - PRInt32 i; - PRUint32 ui; - PRInt64 l; - PRUint64 ul; - PRTime time; - } scalar; - union { - const void* p; - const char* s; - const CERTCertificate* cert; - const CERTCertList *chain; - const CERTRevocationFlags *revocation; - const CERTChainVerifyCallback *chainVerifyCallback; - } pointer; - union { - const PRInt32 *pi; - const PRUint32 *pui; - const PRInt64 *pl; - const PRUint64 *pul; - const SECOidTag *oids; - } array; - int arraySize; -} CERTValParamInValue; - - -typedef struct CERTValParamOutValueStr { - union { - PRBool b; - PRInt32 i; - PRUint32 ui; - PRInt64 l; - PRUint64 ul; - SECCertificateUsage usages; - } scalar; - union { - void* p; - char* s; - CERTVerifyLog *log; - CERTCertificate* cert; - CERTCertList *chain; - } pointer; - union { - void *p; - SECOidTag *oids; - } array; - int arraySize; -} CERTValParamOutValue; - -typedef struct { - CERTValParamInType type; - CERTValParamInValue value; -} CERTValInParam; - -typedef struct { - CERTValParamOutType type; - CERTValParamOutValue value; -} CERTValOutParam; - -/* - * Levels of standards conformance strictness for CERT_NameToAsciiInvertible - */ -typedef enum CertStrictnessLevels { - CERT_N2A_READABLE = 0, /* maximum human readability */ - CERT_N2A_STRICT = 10, /* strict RFC compliance */ - CERT_N2A_INVERTIBLE = 20 /* maximum invertibility, - all DirectoryStrings encoded in hex */ -} CertStrictnessLevel; - -/* - * policy flag defines - */ -#define CERT_POLICY_FLAG_NO_MAPPING 1 -#define CERT_POLICY_FLAG_EXPLICIT 2 -#define CERT_POLICY_FLAG_NO_ANY 4 - -/* - * CertStore flags - */ -#define CERT_ENABLE_LDAP_FETCH 1 -#define CERT_ENABLE_HTTP_FETCH 2 - -/* This functin pointer type may be used for any function that takes - * a CERTCertificate * and returns an allocated string, which must be - * freed by a call to PORT_Free. - */ -typedef char * (*CERT_StringFromCertFcn)(CERTCertificate *cert); - -/* XXX Lisa thinks the template declarations belong in cert.h, not here? */ - -#include "secasn1t.h" /* way down here because I expect template stuff to - * move out of here anyway */ - -SEC_BEGIN_PROTOS - -extern const SEC_ASN1Template CERT_CertificateRequestTemplate[]; -extern const SEC_ASN1Template CERT_CertificateTemplate[]; -extern const SEC_ASN1Template SEC_SignedCertificateTemplate[]; -extern const SEC_ASN1Template CERT_CertExtensionTemplate[]; -extern const SEC_ASN1Template CERT_SequenceOfCertExtensionTemplate[]; -extern const SEC_ASN1Template SECKEY_PublicKeyTemplate[]; -extern const SEC_ASN1Template CERT_SubjectPublicKeyInfoTemplate[]; -extern const SEC_ASN1Template CERT_TimeChoiceTemplate[]; -extern const SEC_ASN1Template CERT_ValidityTemplate[]; -extern const SEC_ASN1Template CERT_PublicKeyAndChallengeTemplate[]; -extern const SEC_ASN1Template SEC_CertSequenceTemplate[]; - -extern const SEC_ASN1Template CERT_IssuerAndSNTemplate[]; -extern const SEC_ASN1Template CERT_NameTemplate[]; -extern const SEC_ASN1Template CERT_SetOfSignedCrlTemplate[]; -extern const SEC_ASN1Template CERT_RDNTemplate[]; -extern const SEC_ASN1Template CERT_SignedDataTemplate[]; -extern const SEC_ASN1Template CERT_CrlTemplate[]; -extern const SEC_ASN1Template CERT_SignedCrlTemplate[]; - -/* -** XXX should the attribute stuff be centralized for all of ns/security? -*/ -extern const SEC_ASN1Template CERT_AttributeTemplate[]; -extern const SEC_ASN1Template CERT_SetOfAttributeTemplate[]; - -/* These functions simply return the address of the above-declared templates. -** This is necessary for Windows DLLs. Sigh. -*/ -SEC_ASN1_CHOOSER_DECLARE(CERT_CertificateRequestTemplate) -SEC_ASN1_CHOOSER_DECLARE(CERT_CertificateTemplate) -SEC_ASN1_CHOOSER_DECLARE(CERT_CrlTemplate) -SEC_ASN1_CHOOSER_DECLARE(CERT_IssuerAndSNTemplate) -SEC_ASN1_CHOOSER_DECLARE(CERT_NameTemplate) -SEC_ASN1_CHOOSER_DECLARE(CERT_SequenceOfCertExtensionTemplate) -SEC_ASN1_CHOOSER_DECLARE(CERT_SetOfSignedCrlTemplate) -SEC_ASN1_CHOOSER_DECLARE(CERT_SignedDataTemplate) -SEC_ASN1_CHOOSER_DECLARE(CERT_SubjectPublicKeyInfoTemplate) -SEC_ASN1_CHOOSER_DECLARE(SEC_SignedCertificateTemplate) -SEC_ASN1_CHOOSER_DECLARE(CERT_SignedCrlTemplate) -SEC_ASN1_CHOOSER_DECLARE(CERT_TimeChoiceTemplate) - -SEC_END_PROTOS - -#endif /* _CERTT_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/certdb/certxutl.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/certdb/certxutl.h deleted file mode 100755 index 05ad572..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/certdb/certxutl.h +++ /dev/null @@ -1,50 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * x.509 v3 certificate extension helper routines - * - */ - - -#ifndef _CERTXUTL_H_ -#define _CERTXUTL_H_ - -#include "nspr.h" - -#ifdef OLD -typedef enum { - CertificateExtensions, - CrlExtensions, - OCSPRequestExtensions, - OCSPSingleRequestExtensions, - OCSPResponseSingleExtensions -} ExtensionsType; -#endif - -extern PRBool -cert_HasCriticalExtension (CERTCertExtension **extensions); - -extern SECStatus -CERT_FindBitStringExtension (CERTCertExtension **extensions, - int tag, SECItem *retItem); -extern void * -cert_StartExtensions (void *owner, PLArenaPool *arena, - void (*setExts)(void *object, CERTCertExtension **exts)); - -extern SECStatus -cert_FindExtension (CERTCertExtension **extensions, int tag, SECItem *value); - -extern SECStatus -cert_FindExtensionByOID (CERTCertExtension **extensions, - SECItem *oid, SECItem *value); - -extern SECStatus -cert_GetExtenCriticality (CERTCertExtension **extensions, - int tag, PRBool *isCritical); - -extern PRBool -cert_HasUnknownCriticalExten (CERTCertExtension **extensions); - -#endif diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/certdb/genname.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/certdb/genname.h deleted file mode 100755 index 091c82c..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/certdb/genname.h +++ /dev/null @@ -1,106 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef _GENAME_H_ -#define _GENAME_H_ - -#include "plarena.h" -#include "seccomon.h" -#include "secoidt.h" -#include "secasn1.h" -#include "secder.h" -#include "certt.h" - -/************************************************************************/ -SEC_BEGIN_PROTOS - -extern const SEC_ASN1Template CERT_GeneralNamesTemplate[]; - -extern SECItem ** -cert_EncodeGeneralNames(PLArenaPool *arena, CERTGeneralName *names); - -extern CERTGeneralName * -cert_DecodeGeneralNames(PLArenaPool *arena, SECItem **encodedGenName); - -extern SECStatus -cert_DestroyGeneralNames(CERTGeneralName *name); - -extern SECStatus -cert_EncodeNameConstraints(CERTNameConstraints *constraints, PLArenaPool *arena, - SECItem *dest); - -extern CERTNameConstraints * -cert_DecodeNameConstraints(PLArenaPool *arena, const SECItem *encodedConstraints); - -extern CERTGeneralName * -cert_CombineNamesLists(CERTGeneralName *list1, CERTGeneralName *list2); - -extern CERTNameConstraint * -cert_CombineConstraintsLists(CERTNameConstraint *list1, CERTNameConstraint *list2); - -/*********************************************************************/ -/* A thread safe implementation of General Names */ -/*********************************************************************/ - -/* Destroy a Single CERTGeneralName */ -void -CERT_DestroyGeneralName(CERTGeneralName *name); - -SECStatus -CERT_CompareGeneralName(CERTGeneralName *a, CERTGeneralName *b); - -SECStatus -CERT_CopyGeneralName(PLArenaPool *arena, - CERTGeneralName *dest, - CERTGeneralName *src); - -/* General Name Lists are a thread safe, reference counting layer to - * general names */ - -/* Destroys a CERTGeneralNameList */ -void -CERT_DestroyGeneralNameList(CERTGeneralNameList *list); - -/* Creates a CERTGeneralNameList */ -CERTGeneralNameList * -CERT_CreateGeneralNameList(CERTGeneralName *name); - -/* Compares two CERTGeneralNameList */ -SECStatus -CERT_CompareGeneralNameLists(CERTGeneralNameList *a, CERTGeneralNameList *b); - -/* returns a copy of the first name of the type requested */ -void * -CERT_GetGeneralNameFromListByType(CERTGeneralNameList *list, - CERTGeneralNameType type, - PLArenaPool *arena); - -/* Adds a name to the tail of the list */ -void -CERT_AddGeneralNameToList(CERTGeneralNameList *list, - CERTGeneralNameType type, - void *data, SECItem *oid); - -/* returns a duplicate of the CERTGeneralNameList */ -CERTGeneralNameList * -CERT_DupGeneralNameList(CERTGeneralNameList *list); - -/* returns the number of CERTGeneralName objects in the doubly linked -** list of which *names is a member. -*/ -extern int -CERT_GetNamesLength(CERTGeneralName *names); - -/************************************************************************/ - -SECStatus -CERT_CompareNameSpace(CERTCertificate *cert, - CERTGeneralName *namesList, - CERTCertificate **certsList, - PLArenaPool *reqArena, - CERTCertificate **pBadCert); - -SEC_END_PROTOS - -#endif diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/certdb/xconst.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/certdb/xconst.h deleted file mode 100755 index 72767c3..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/certdb/xconst.h +++ /dev/null @@ -1,36 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef _XCONST_H_ -#define _XCONST_H_ - -#include "certt.h" - -typedef struct CERTAltNameEncodedContextStr { - SECItem **encodedGenName; -} CERTAltNameEncodedContext; - - - -SEC_BEGIN_PROTOS - -extern SECStatus -CERT_EncodePrivateKeyUsagePeriod(PLArenaPool *arena, - CERTPrivKeyUsagePeriod *pkup, - SECItem *encodedValue); - -extern SECStatus -CERT_EncodeNameConstraintsExtension(PLArenaPool *arena, - CERTNameConstraints *value, - SECItem *encodedValue); - -extern SECStatus -CERT_EncodeIA5TypeExtension(PLArenaPool *arena, char *value, - SECItem *encodedValue); - -SECStatus -cert_EncodeAuthInfoAccessExtension(PLArenaPool *arena, - CERTAuthInfoAccess **info, - SECItem *dest); -SEC_END_PROTOS -#endif diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/cryptohi/cryptohi.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/cryptohi/cryptohi.h deleted file mode 100755 index 09297ea..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/cryptohi/cryptohi.h +++ /dev/null @@ -1,368 +0,0 @@ -/* - * crypto.h - public data structures and prototypes for the crypto library - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef _CRYPTOHI_H_ -#define _CRYPTOHI_H_ - -#include "blapit.h" - -#include "seccomon.h" -#include "secoidt.h" -#include "secdert.h" -#include "cryptoht.h" -#include "keyt.h" -#include "certt.h" - - -SEC_BEGIN_PROTOS - - -/****************************************/ -/* -** DER encode/decode (EC)DSA signatures -*/ - -/* ANSI X9.57 defines DSA signatures as DER encoded data. Our DSA1 code (and - * most of the rest of the world) just generates 40 bytes of raw data. These - * functions convert between formats. - */ -extern SECStatus DSAU_EncodeDerSig(SECItem *dest, SECItem *src); -extern SECItem *DSAU_DecodeDerSig(const SECItem *item); - -/* - * Unlike DSA1, raw DSA2 and ECDSA signatures do not have a fixed length. - * Rather they contain two integers r and s whose length depends - * on the size of q or the EC key used for signing. - * - * We can reuse the DSAU_EncodeDerSig interface to DER encode - * raw ECDSA signature keeping in mind that the length of r - * is the same as that of s and exactly half of src->len. - * - * For decoding, we need to pass the length of the desired - * raw signature (twice the key size) explicitly. - */ -extern SECStatus DSAU_EncodeDerSigWithLen(SECItem *dest, SECItem *src, - unsigned int len); -extern SECItem *DSAU_DecodeDerSigToLen(const SECItem *item, unsigned int len); - -/****************************************/ -/* -** Signature creation operations -*/ - -/* -** Create a new signature context used for signing a data stream. -** "alg" the signature algorithm to use (e.g. SEC_OID_RSA_WITH_MD5) -** "privKey" the private key to use -*/ -extern SGNContext *SGN_NewContext(SECOidTag alg, SECKEYPrivateKey *privKey); - -/* -** Destroy a signature-context object -** "cx" the object -** "freeit" if PR_TRUE then free the object as well as its sub-objects -*/ -extern void SGN_DestroyContext(SGNContext *cx, PRBool freeit); - -/* -** Reset the signing context "cx" to its initial state, preparing it for -** another stream of data. -*/ -extern SECStatus SGN_Begin(SGNContext *cx); - -/* -** Update the signing context with more data to sign. -** "cx" the context -** "input" the input data to sign -** "inputLen" the length of the input data -*/ -extern SECStatus SGN_Update(SGNContext *cx, const unsigned char *input, - unsigned int inputLen); - -/* -** Finish the signature process. Use either k0 or k1 to sign the data -** stream that was input using SGN_Update. The resulting signature is -** formatted using PKCS#1 and then encrypted using RSA private or public -** encryption. -** "cx" the context -** "result" the final signature data (memory is allocated) -*/ -extern SECStatus SGN_End(SGNContext *cx, SECItem *result); - -/* -** Sign a single block of data using private key encryption and given -** signature/hash algorithm. -** "result" the final signature data (memory is allocated) -** "buf" the input data to sign -** "len" the amount of data to sign -** "pk" the private key to encrypt with -** "algid" the signature/hash algorithm to sign with -** (must be compatible with the key type). -*/ -extern SECStatus SEC_SignData(SECItem *result, - const unsigned char *buf, int len, - SECKEYPrivateKey *pk, SECOidTag algid); - -/* -** Sign a pre-digested block of data using private key encryption, encoding -** The given signature/hash algorithm. -** "result" the final signature data (memory is allocated) -** "digest" the digest to sign -** "privKey" the private key to encrypt with -** "algtag" The algorithm tag to encode (need for RSA only) -*/ -extern SECStatus SGN_Digest(SECKEYPrivateKey *privKey, - SECOidTag algtag, SECItem *result, SECItem *digest); - -/* -** DER sign a single block of data using private key encryption and the -** MD5 hashing algorithm. This routine first computes a digital signature -** using SEC_SignData, then wraps it with an CERTSignedData and then der -** encodes the result. -** "arena" is the memory arena to use to allocate data from -** "result" the final der encoded data (memory is allocated) -** "buf" the input data to sign -** "len" the amount of data to sign -** "pk" the private key to encrypt with -*/ -extern SECStatus SEC_DerSignData(PLArenaPool *arena, SECItem *result, - const unsigned char *buf, int len, - SECKEYPrivateKey *pk, SECOidTag algid); - -/* -** Destroy a signed-data object. -** "sd" the object -** "freeit" if PR_TRUE then free the object as well as its sub-objects -*/ -extern void SEC_DestroySignedData(CERTSignedData *sd, PRBool freeit); - -/* -** Get the signature algorithm tag number for the given key type and hash -** algorithm tag. Returns SEC_OID_UNKNOWN if key type and hash algorithm -** do not match or are not supported. -*/ -extern SECOidTag SEC_GetSignatureAlgorithmOidTag(KeyType keyType, - SECOidTag hashAlgTag); - -/****************************************/ -/* -** Signature verification operations -*/ - -/* -** Create a signature verification context. This version is deprecated, -** This function is deprecated. Use VFY_CreateContextDirect or -** VFY_CreateContextWithAlgorithmID instead. -** "key" the public key to verify with -** "sig" the encrypted signature data if sig is NULL then -** VFY_EndWithSignature must be called with the correct signature at -** the end of the processing. -** "sigAlg" specifies the signing algorithm to use (including the -** hash algorthim). This must match the key type. -** "wincx" void pointer to the window context -*/ -extern VFYContext *VFY_CreateContext(SECKEYPublicKey *key, SECItem *sig, - SECOidTag sigAlg, void *wincx); -/* -** Create a signature verification context. -** "key" the public key to verify with -** "sig" the encrypted signature data if sig is NULL then -** VFY_EndWithSignature must be called with the correct signature at -** the end of the processing. -** "pubkAlg" specifies the cryptographic signing algorithm to use (the -** raw algorithm without any hash specified. This must match the key -** type. -** "hashAlg" specifies the hashing algorithm used. If the key is an -** RSA key, and sig is not NULL, then hashAlg can be SEC_OID_UNKNOWN. -** the hash is selected from data in the sig. -** "hash" optional pointer to return the actual hash algorithm used. -** in practice this should always match the passed in hashAlg (the -** exception is the case where hashAlg is SEC_OID_UNKNOWN above). -** If this value is NULL no, hash oid is returned. -** "wincx" void pointer to the window context -*/ -extern VFYContext *VFY_CreateContextDirect(const SECKEYPublicKey *key, - const SECItem *sig, - SECOidTag pubkAlg, - SECOidTag hashAlg, - SECOidTag *hash, void *wincx); -/* -** Create a signature verification context from a algorithm ID. -** "key" the public key to verify with -** "sig" the encrypted signature data if sig is NULL then -** VFY_EndWithSignature must be called with the correct signature at -** the end of the processing. -** "algid" specifies the signing algorithm and parameters to use. -** This must match the key type. -** "hash" optional pointer to return the oid of the actual hash used in -** the signature. If this value is NULL no, hash oid is returned. -** "wincx" void pointer to the window context -*/ -extern VFYContext *VFY_CreateContextWithAlgorithmID(const SECKEYPublicKey *key, - const SECItem *sig, - const SECAlgorithmID *algid, - SECOidTag *hash, - void *wincx); - -/* -** Destroy a verification-context object. -** "cx" the context to destroy -** "freeit" if PR_TRUE then free the object as well as its sub-objects -*/ -extern void VFY_DestroyContext(VFYContext *cx, PRBool freeit); - -extern SECStatus VFY_Begin(VFYContext *cx); - -/* -** Update a verification context with more input data. The input data -** is fed to a secure hash function (depending on what was in the -** encrypted signature data). -** "cx" the context -** "input" the input data -** "inputLen" the amount of input data -*/ -extern SECStatus VFY_Update(VFYContext *cx, const unsigned char *input, - unsigned int inputLen); - -/* -** Finish the verification process. The return value is a status which -** indicates success or failure. On success, the SECSuccess value is -** returned. Otherwise, SECFailure is returned and the error code found -** using PORT_GetError() indicates what failure occurred. -** "cx" the context -*/ -extern SECStatus VFY_End(VFYContext *cx); - -/* -** Finish the verification process. The return value is a status which -** indicates success or failure. On success, the SECSuccess value is -** returned. Otherwise, SECFailure is returned and the error code found -** using PORT_GetError() indicates what failure occurred. If signature is -** supplied the verification uses this signature to verify, otherwise the -** signature passed in VFY_CreateContext() is used. -** VFY_EndWithSignature(cx,NULL); is identical to VFY_End(cx);. -** "cx" the context -** "sig" the encrypted signature data -*/ -extern SECStatus VFY_EndWithSignature(VFYContext *cx, SECItem *sig); - - -/* -** Verify the signature on a block of data for which we already have -** the digest. The signature data is an RSA private key encrypted -** block of data formatted according to PKCS#1. -** This function is deprecated. Use VFY_VerifyDigestDirect or -** VFY_VerifyDigestWithAlgorithmID instead. -** "dig" the digest -** "key" the public key to check the signature with -** "sig" the encrypted signature data -** "sigAlg" specifies the signing algorithm to use. This must match -** the key type. -** "wincx" void pointer to the window context -**/ -extern SECStatus VFY_VerifyDigest(SECItem *dig, SECKEYPublicKey *key, - SECItem *sig, SECOidTag sigAlg, void *wincx); -/* -** Verify the signature on a block of data for which we already have -** the digest. The signature data is an RSA private key encrypted -** block of data formatted according to PKCS#1. -** "dig" the digest -** "key" the public key to check the signature with -** "sig" the encrypted signature data -** "pubkAlg" specifies the cryptographic signing algorithm to use (the -** raw algorithm without any hash specified. This must match the key -** type. -** "hashAlg" specifies the hashing algorithm used. -** "wincx" void pointer to the window context -**/ -extern SECStatus VFY_VerifyDigestDirect(const SECItem *dig, - const SECKEYPublicKey *key, - const SECItem *sig, SECOidTag pubkAlg, - SECOidTag hashAlg, void *wincx); -/* -** Verify the signature on a block of data for which we already have -** the digest. The signature data is an RSA private key encrypted -** block of data formatted according to PKCS#1. -** "key" the public key to verify with -** "sig" the encrypted signature data if sig is NULL then -** VFY_EndWithSignature must be called with the correct signature at -** the end of the processing. -** "algid" specifies the signing algorithm and parameters to use. -** This must match the key type. -** "hash" oid of the actual hash used to create digest. If this value is -** not set to SEC_OID_UNKNOWN, it must match the hash of the signature. -** "wincx" void pointer to the window context -*/ -extern SECStatus VFY_VerifyDigestWithAlgorithmID(const SECItem *dig, - const SECKEYPublicKey *key, const SECItem *sig, - const SECAlgorithmID *algid, SECOidTag hash, - void *wincx); - -/* -** Verify the signature on a block of data. The signature data is an RSA -** private key encrypted block of data formatted according to PKCS#1. -** This function is deprecated. Use VFY_VerifyDataDirect or -** VFY_VerifyDataWithAlgorithmID instead. -** "buf" the input data -** "len" the length of the input data -** "key" the public key to check the signature with -** "sig" the encrypted signature data -** "sigAlg" specifies the signing algorithm to use. This must match -** the key type. -** "wincx" void pointer to the window context -*/ -extern SECStatus VFY_VerifyData(const unsigned char *buf, int len, - const SECKEYPublicKey *key, const SECItem *sig, - SECOidTag sigAlg, void *wincx); -/* -** Verify the signature on a block of data. The signature data is an RSA -** private key encrypted block of data formatted according to PKCS#1. -** "buf" the input data -** "len" the length of the input data -** "key" the public key to check the signature with -** "sig" the encrypted signature data -** "pubkAlg" specifies the cryptographic signing algorithm to use (the -** raw algorithm without any hash specified. This must match the key -** type. -** "hashAlg" specifies the hashing algorithm used. If the key is an -** RSA key, and sig is not NULL, then hashAlg can be SEC_OID_UNKNOWN. -** the hash is selected from data in the sig. -** "hash" optional pointer to return the actual hash algorithm used. -** in practice this should always match the passed in hashAlg (the -** exception is the case where hashAlg is SEC_OID_UNKNOWN above). -** If this value is NULL no, hash oid is returned. -** "wincx" void pointer to the window context -*/ -extern SECStatus VFY_VerifyDataDirect(const unsigned char *buf, int len, - const SECKEYPublicKey *key, - const SECItem *sig, - SECOidTag pubkAlg, SECOidTag hashAlg, - SECOidTag *hash, void *wincx); - -/* -** Verify the signature on a block of data. The signature data is an RSA -** private key encrypted block of data formatted according to PKCS#1. -** "buf" the input data -** "len" the length of the input data -** "key" the public key to check the signature with -** "sig" the encrypted signature data -** "algid" specifies the signing algorithm and parameters to use. -** This must match the key type. -** "hash" optional pointer to return the oid of the actual hash used in -** the signature. If this value is NULL no, hash oid is returned. -** "wincx" void pointer to the window context -*/ -extern SECStatus VFY_VerifyDataWithAlgorithmID(const unsigned char *buf, - int len, const SECKEYPublicKey *key, - const SECItem *sig, - const SECAlgorithmID *algid, SECOidTag *hash, - void *wincx); - - -SEC_END_PROTOS - -#endif /* _CRYPTOHI_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/cryptohi/cryptoht.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/cryptohi/cryptoht.h deleted file mode 100755 index aca4899..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/cryptohi/cryptoht.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * cryptoht.h - public data structures for the crypto library - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef _CRYPTOHT_H_ -#define _CRYPTOHT_H_ - -typedef struct SGNContextStr SGNContext; -typedef struct VFYContextStr VFYContext; - - -#endif /* _CRYPTOHT_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/cryptohi/key.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/cryptohi/key.h deleted file mode 100755 index 3e89b74..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/cryptohi/key.h +++ /dev/null @@ -1,12 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* This header is deprecated. Please include keyhi.h instead. */ - -#ifndef _KEY_H_ -#define _KEY_H_ - -#include "keyhi.h" - -#endif /* _KEY_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/cryptohi/keyhi.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/cryptohi/keyhi.h deleted file mode 100755 index 3793b57..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/cryptohi/keyhi.h +++ /dev/null @@ -1,270 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef _KEYHI_H_ -#define _KEYHI_H_ - -#include "plarena.h" - -#include "seccomon.h" -#include "secoidt.h" -#include "secdert.h" -#include "keythi.h" -#include "certt.h" -/*#include "secpkcs5.h" */ - -SEC_BEGIN_PROTOS - - -/* -** Destroy a subject-public-key-info object. -*/ -extern void SECKEY_DestroySubjectPublicKeyInfo(CERTSubjectPublicKeyInfo *spki); - -/* -** Copy subject-public-key-info "src" to "dst". "dst" is filled in -** appropriately (memory is allocated for each of the sub objects). -*/ -extern SECStatus SECKEY_CopySubjectPublicKeyInfo(PLArenaPool *arena, - CERTSubjectPublicKeyInfo *dst, - CERTSubjectPublicKeyInfo *src); - -/* -** Update the PQG parameters for a cert's public key. -** Only done for DSA certs -*/ -extern SECStatus -SECKEY_UpdateCertPQG(CERTCertificate * subjectCert); - - -/* -** Return the strength of the public key in bytes -*/ -extern unsigned SECKEY_PublicKeyStrength(const SECKEYPublicKey *pubk); - -/* -** Return the strength of the public key in bits -*/ -extern unsigned SECKEY_PublicKeyStrengthInBits(const SECKEYPublicKey *pubk); - -/* -** Return the length of the signature in bytes -*/ -extern unsigned SECKEY_SignatureLen(const SECKEYPublicKey *pubk); - -/* -** Make a copy of the private key "privKey" -*/ -extern SECKEYPrivateKey *SECKEY_CopyPrivateKey(const SECKEYPrivateKey *privKey); - -/* -** Make a copy of the public key "pubKey" -*/ -extern SECKEYPublicKey *SECKEY_CopyPublicKey(const SECKEYPublicKey *pubKey); - -/* -** Convert a private key "privateKey" into a public key -*/ -extern SECKEYPublicKey *SECKEY_ConvertToPublicKey(SECKEYPrivateKey *privateKey); - -/* - * create a new RSA key pair. The private Key is returned... - */ -SECKEYPrivateKey *SECKEY_CreateRSAPrivateKey(int keySizeInBits, - SECKEYPublicKey **pubk, void *cx); - -/* - * create a new DH key pair. The private Key is returned... - */ -SECKEYPrivateKey *SECKEY_CreateDHPrivateKey(SECKEYDHParams *param, - SECKEYPublicKey **pubk, void *cx); - -/* - * create a new EC key pair. The private Key is returned... - */ -SECKEYPrivateKey *SECKEY_CreateECPrivateKey(SECKEYECParams *param, - SECKEYPublicKey **pubk, void *cx); - -/* -** Create a subject-public-key-info based on a public key. -*/ -extern CERTSubjectPublicKeyInfo * -SECKEY_CreateSubjectPublicKeyInfo(SECKEYPublicKey *k); - -/* -** Decode a DER encoded public key into an SECKEYPublicKey structure. -*/ -extern SECKEYPublicKey *SECKEY_DecodeDERPublicKey(const SECItem *pubkder); - -/* -** Convert a base64 ascii encoded DER public key to our internal format. -*/ -extern SECKEYPublicKey *SECKEY_ConvertAndDecodePublicKey(const char *pubkstr); - -/* -** Convert a base64 ascii encoded DER public key and challenge to spki, -** and verify the signature and challenge data are correct -*/ -extern CERTSubjectPublicKeyInfo * -SECKEY_ConvertAndDecodePublicKeyAndChallenge(char *pkacstr, char *challenge, - void *cx); - -/* -** Encode a CERTSubjectPublicKeyInfo structure. into a -** DER encoded subject public key info. -*/ -SECItem * -SECKEY_EncodeDERSubjectPublicKeyInfo(SECKEYPublicKey *pubk); - -/* -** Decode a DER encoded subject public key info into a -** CERTSubjectPublicKeyInfo structure. -*/ -extern CERTSubjectPublicKeyInfo * -SECKEY_DecodeDERSubjectPublicKeyInfo(const SECItem *spkider); - -/* -** Convert a base64 ascii encoded DER subject public key info to our -** internal format. -*/ -extern CERTSubjectPublicKeyInfo * -SECKEY_ConvertAndDecodeSubjectPublicKeyInfo(const char *spkistr); - -/* - * extract the public key from a subject Public Key info structure. - * (used by JSS). - */ -extern SECKEYPublicKey * -SECKEY_ExtractPublicKey(const CERTSubjectPublicKeyInfo *); - -/* -** Destroy a private key object. -** "key" the object -*/ -extern void SECKEY_DestroyPrivateKey(SECKEYPrivateKey *key); - - -/* -** Destroy a public key object. -** "key" the object -*/ -extern void SECKEY_DestroyPublicKey(SECKEYPublicKey *key); - -/* Destroy and zero out a private key info structure. for now this - * function zero's out memory allocated in an arena for the key - * since PORT_FreeArena does not currently do this. - * - * NOTE -- If a private key info is allocated in an arena, one should - * not call this function with freeit = PR_FALSE. The function should - * destroy the arena. - */ -extern void -SECKEY_DestroyPrivateKeyInfo(SECKEYPrivateKeyInfo *pvk, PRBool freeit); - -/* Destroy and zero out an encrypted private key info. - * - * NOTE -- If a encrypted private key info is allocated in an arena, one should - * not call this function with freeit = PR_FALSE. The function should - * destroy the arena. - */ -extern void -SECKEY_DestroyEncryptedPrivateKeyInfo(SECKEYEncryptedPrivateKeyInfo *epki, - PRBool freeit); - -/* Copy private key info structure. - * poolp is the arena into which the contents of from is to be copied. - * NULL is a valid entry. - * to is the destination private key info - * from is the source private key info - * if either from or to is NULL or an error occurs, SECFailure is - * returned. otherwise, SECSuccess is returned. - */ -extern SECStatus -SECKEY_CopyPrivateKeyInfo(PLArenaPool *poolp, - SECKEYPrivateKeyInfo *to, - const SECKEYPrivateKeyInfo *from); - -extern SECStatus -SECKEY_CacheStaticFlags(SECKEYPrivateKey* key); - -/* Copy encrypted private key info structure. - * poolp is the arena into which the contents of from is to be copied. - * NULL is a valid entry. - * to is the destination encrypted private key info - * from is the source encrypted private key info - * if either from or to is NULL or an error occurs, SECFailure is - * returned. otherwise, SECSuccess is returned. - */ -extern SECStatus -SECKEY_CopyEncryptedPrivateKeyInfo(PLArenaPool *poolp, - SECKEYEncryptedPrivateKeyInfo *to, - const SECKEYEncryptedPrivateKeyInfo *from); -/* - * Accessor functions for key type of public and private keys. - */ -KeyType SECKEY_GetPrivateKeyType(const SECKEYPrivateKey *privKey); -KeyType SECKEY_GetPublicKeyType(const SECKEYPublicKey *pubKey); - -/* - * Creates a PublicKey from its DER encoding. - * Currently only supports RSA and DSA keys. - */ -SECKEYPublicKey* -SECKEY_ImportDERPublicKey(const SECItem *derKey, CK_KEY_TYPE type); - -SECKEYPrivateKeyList* -SECKEY_NewPrivateKeyList(void); - -void -SECKEY_DestroyPrivateKeyList(SECKEYPrivateKeyList *keys); - -void -SECKEY_RemovePrivateKeyListNode(SECKEYPrivateKeyListNode *node); - -SECStatus -SECKEY_AddPrivateKeyToListTail( SECKEYPrivateKeyList *list, - SECKEYPrivateKey *key); - -#define PRIVKEY_LIST_HEAD(l) ((SECKEYPrivateKeyListNode*)PR_LIST_HEAD(&l->list)) -#define PRIVKEY_LIST_NEXT(n) ((SECKEYPrivateKeyListNode *)n->links.next) -#define PRIVKEY_LIST_END(n,l) (((void *)n) == ((void *)&l->list)) - -SECKEYPublicKeyList* -SECKEY_NewPublicKeyList(void); - -void -SECKEY_DestroyPublicKeyList(SECKEYPublicKeyList *keys); - -void -SECKEY_RemovePublicKeyListNode(SECKEYPublicKeyListNode *node); - -SECStatus -SECKEY_AddPublicKeyToListTail( SECKEYPublicKeyList *list, - SECKEYPublicKey *key); - -#define PUBKEY_LIST_HEAD(l) ((SECKEYPublicKeyListNode*)PR_LIST_HEAD(&l->list)) -#define PUBKEY_LIST_NEXT(n) ((SECKEYPublicKeyListNode *)n->links.next) -#define PUBKEY_LIST_END(n,l) (((void *)n) == ((void *)&l->list)) - -/* - * Length in bits of the EC's field size. This is also the length of - * the x and y coordinates of EC points, such as EC public keys and - * base points. - * - * Return 0 on failure (unknown EC domain parameters). - */ -extern int SECKEY_ECParamsToKeySize(const SECItem *params); - -/* - * Length in bits of the EC base point order, usually denoted n. This - * is also the length of EC private keys and ECDSA signature components - * r and s. - * - * Return 0 on failure (unknown EC domain parameters). - */ -extern int SECKEY_ECParamsToBasePointOrderLen(const SECItem *params); - -SEC_END_PROTOS - -#endif /* _KEYHI_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/cryptohi/keyi.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/cryptohi/keyi.h deleted file mode 100755 index 7d0304e..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/cryptohi/keyi.h +++ /dev/null @@ -1,23 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef _KEYI_H_ -#define _KEYI_H_ - - -SEC_BEGIN_PROTOS -/* NSS private functions */ -/* map an oid to a keytype... actually this function and it's converse - * are good candidates for public functions.. */ -KeyType seckey_GetKeyType(SECOidTag pubKeyOid); - -/* extract the 'encryption' (could be signing) and hash oids from and - * algorithm, key and parameters (parameters is the parameters field - * of a algorithm ID structure (SECAlgorithmID)*/ -SECStatus sec_DecodeSigAlg(const SECKEYPublicKey *key, SECOidTag sigAlg, - const SECItem *param, SECOidTag *encalg, SECOidTag *hashalg); - -SEC_END_PROTOS - -#endif /* _KEYHI_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/cryptohi/keyt.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/cryptohi/keyt.h deleted file mode 100755 index 99da312..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/cryptohi/keyt.h +++ /dev/null @@ -1,10 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef _KEYT_H_ -#define _KEYT_H_ - -#include "keythi.h" - -#endif /* _KEYT_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/cryptohi/keythi.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/cryptohi/keythi.h deleted file mode 100755 index 9b9a278..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/cryptohi/keythi.h +++ /dev/null @@ -1,258 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef _KEYTHI_H_ -#define _KEYTHI_H_ 1 - -#include "plarena.h" -#include "pkcs11t.h" -#include "secmodt.h" -#include "prclist.h" - -/* -** RFC 4055 Section 1.2 specifies three different RSA key types. -** -** rsaKey maps to keys with SEC_OID_PKCS1_RSA_ENCRYPTION and can be used for -** both encryption and signatures with old (PKCS #1 v1.5) and new (PKCS #1 -** v2.1) padding schemes. -** -** rsaPssKey maps to keys with SEC_OID_PKCS1_RSA_PSS_SIGNATURE and may only -** be used for signatures with PSS padding (PKCS #1 v2.1). -** -** rsaOaepKey maps to keys with SEC_OID_PKCS1_RSA_OAEP_ENCRYPTION and may only -** be used for encryption with OAEP padding (PKCS #1 v2.1). -*/ - -typedef enum { - nullKey = 0, - rsaKey = 1, - dsaKey = 2, - fortezzaKey = 3, /* deprecated */ - dhKey = 4, - keaKey = 5, /* deprecated */ - ecKey = 6, - rsaPssKey = 7, - rsaOaepKey = 8 -} KeyType; - -/* -** Template Definitions -**/ - -SEC_BEGIN_PROTOS -extern const SEC_ASN1Template SECKEY_RSAPublicKeyTemplate[]; -extern const SEC_ASN1Template SECKEY_RSAPSSParamsTemplate[]; -extern const SEC_ASN1Template SECKEY_DSAPublicKeyTemplate[]; -extern const SEC_ASN1Template SECKEY_DHPublicKeyTemplate[]; -extern const SEC_ASN1Template SECKEY_DHParamKeyTemplate[]; -extern const SEC_ASN1Template SECKEY_PQGParamsTemplate[]; -extern const SEC_ASN1Template SECKEY_DSAPrivateKeyExportTemplate[]; - -/* Windows DLL accessor functions */ -SEC_ASN1_CHOOSER_DECLARE(SECKEY_DSAPublicKeyTemplate) -SEC_ASN1_CHOOSER_DECLARE(SECKEY_RSAPublicKeyTemplate) -SEC_ASN1_CHOOSER_DECLARE(SECKEY_RSAPSSParamsTemplate) -SEC_END_PROTOS - - -/* -** RSA Public Key structures -** member names from PKCS#1, section 7.1 -*/ - -struct SECKEYRSAPublicKeyStr { - PLArenaPool * arena; - SECItem modulus; - SECItem publicExponent; -}; -typedef struct SECKEYRSAPublicKeyStr SECKEYRSAPublicKey; - -/* -** RSA-PSS parameters -*/ -struct SECKEYRSAPSSParamsStr { - SECAlgorithmID *hashAlg; - SECAlgorithmID *maskAlg; - SECItem saltLength; - SECItem trailerField; -}; -typedef struct SECKEYRSAPSSParamsStr SECKEYRSAPSSParams; - -/* -** DSA Public Key and related structures -*/ - -struct SECKEYPQGParamsStr { - PLArenaPool *arena; - SECItem prime; /* p */ - SECItem subPrime; /* q */ - SECItem base; /* g */ - /* XXX chrisk: this needs to be expanded to hold j and validationParms (RFC2459 7.3.2) */ -}; -typedef struct SECKEYPQGParamsStr SECKEYPQGParams; - -struct SECKEYDSAPublicKeyStr { - SECKEYPQGParams params; - SECItem publicValue; -}; -typedef struct SECKEYDSAPublicKeyStr SECKEYDSAPublicKey; - - -/* -** Diffie-Hellman Public Key structure -** Structure member names suggested by PKCS#3. -*/ -struct SECKEYDHParamsStr { - PLArenaPool * arena; - SECItem prime; /* p */ - SECItem base; /* g */ -}; -typedef struct SECKEYDHParamsStr SECKEYDHParams; - -struct SECKEYDHPublicKeyStr { - PLArenaPool * arena; - SECItem prime; - SECItem base; - SECItem publicValue; -}; -typedef struct SECKEYDHPublicKeyStr SECKEYDHPublicKey; - -/* -** Elliptic curve Public Key structure -** The PKCS#11 layer needs DER encoding of ANSI X9.62 -** parameters value -*/ -typedef SECItem SECKEYECParams; - -struct SECKEYECPublicKeyStr { - SECKEYECParams DEREncodedParams; - int size; /* size in bits */ - SECItem publicValue; /* encoded point */ - /* XXX Even though the PKCS#11 interface takes encoded parameters, - * we may still wish to decode them above PKCS#11 for things like - * printing key information. For named curves, which is what - * we initially support, we ought to have the curve name at the - * very least. - */ -}; -typedef struct SECKEYECPublicKeyStr SECKEYECPublicKey; - -/* -** FORTEZZA Public Key structures -*/ -struct SECKEYFortezzaPublicKeyStr { - int KEAversion; - int DSSversion; - unsigned char KMID[8]; - SECItem clearance; - SECItem KEApriviledge; - SECItem DSSpriviledge; - SECItem KEAKey; - SECItem DSSKey; - SECKEYPQGParams params; - SECKEYPQGParams keaParams; -}; -typedef struct SECKEYFortezzaPublicKeyStr SECKEYFortezzaPublicKey; -#define KEAprivilege KEApriviledge /* corrected spelling */ -#define DSSprivilege DSSpriviledge /* corrected spelling */ - -struct SECKEYDiffPQGParamsStr { - SECKEYPQGParams DiffKEAParams; - SECKEYPQGParams DiffDSAParams; -}; -typedef struct SECKEYDiffPQGParamsStr SECKEYDiffPQGParams; - -struct SECKEYPQGDualParamsStr { - SECKEYPQGParams CommParams; - SECKEYDiffPQGParams DiffParams; -}; -typedef struct SECKEYPQGDualParamsStr SECKEYPQGDualParams; - -struct SECKEYKEAParamsStr { - PLArenaPool *arena; - SECItem hash; -}; -typedef struct SECKEYKEAParamsStr SECKEYKEAParams; - -struct SECKEYKEAPublicKeyStr { - SECKEYKEAParams params; - SECItem publicValue; -}; -typedef struct SECKEYKEAPublicKeyStr SECKEYKEAPublicKey; - -/* -** A Generic public key object. -*/ -struct SECKEYPublicKeyStr { - PLArenaPool *arena; - KeyType keyType; - PK11SlotInfo *pkcs11Slot; - CK_OBJECT_HANDLE pkcs11ID; - union { - SECKEYRSAPublicKey rsa; - SECKEYDSAPublicKey dsa; - SECKEYDHPublicKey dh; - SECKEYKEAPublicKey kea; - SECKEYFortezzaPublicKey fortezza; - SECKEYECPublicKey ec; - } u; -}; -typedef struct SECKEYPublicKeyStr SECKEYPublicKey; - -/* bit flag definitions for staticflags */ -#define SECKEY_Attributes_Cached 0x1 /* bit 0 states - whether attributes are cached */ -#define SECKEY_CKA_PRIVATE (1U << 1) /* bit 1 is the value of CKA_PRIVATE */ -#define SECKEY_CKA_ALWAYS_AUTHENTICATE (1U << 2) - -#define SECKEY_ATTRIBUTES_CACHED(key) \ - (0 != (key->staticflags & SECKEY_Attributes_Cached)) - -#define SECKEY_ATTRIBUTE_VALUE(key,attribute) \ - (0 != (key->staticflags & SECKEY_##attribute)) - -#define SECKEY_HAS_ATTRIBUTE_SET(key,attribute) \ - (0 != (key->staticflags & SECKEY_Attributes_Cached)) ? \ - (0 != (key->staticflags & SECKEY_##attribute)) : \ - PK11_HasAttributeSet(key->pkcs11Slot,key->pkcs11ID,attribute, PR_FALSE) - -#define SECKEY_HAS_ATTRIBUTE_SET_LOCK(key,attribute, haslock) \ - (0 != (key->staticflags & SECKEY_Attributes_Cached)) ? \ - (0 != (key->staticflags & SECKEY_##attribute)) : \ - PK11_HasAttributeSet(key->pkcs11Slot,key->pkcs11ID,attribute, haslock) - -/* -** A generic key structure -*/ -struct SECKEYPrivateKeyStr { - PLArenaPool *arena; - KeyType keyType; - PK11SlotInfo *pkcs11Slot; /* pkcs11 slot this key lives in */ - CK_OBJECT_HANDLE pkcs11ID; /* ID of pkcs11 object */ - PRBool pkcs11IsTemp; /* temp pkcs11 object, delete it when done */ - void *wincx; /* context for errors and pw prompts */ - PRUint32 staticflags; /* bit flag of cached PKCS#11 attributes */ -}; -typedef struct SECKEYPrivateKeyStr SECKEYPrivateKey; - -typedef struct { - PRCList links; - SECKEYPrivateKey *key; -} SECKEYPrivateKeyListNode; - -typedef struct { - PRCList list; - PLArenaPool *arena; -} SECKEYPrivateKeyList; - -typedef struct { - PRCList links; - SECKEYPublicKey *key; -} SECKEYPublicKeyListNode; - -typedef struct { - PRCList list; - PLArenaPool *arena; -} SECKEYPublicKeyList; -#endif /* _KEYTHI_H_ */ - diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/cryptohi/sechash.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/cryptohi/sechash.h deleted file mode 100755 index 5c58551..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/cryptohi/sechash.h +++ /dev/null @@ -1,58 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef _HASH_H_ -#define _HASH_H_ - -#include "seccomon.h" -#include "hasht.h" -#include "secoidt.h" - -SEC_BEGIN_PROTOS - -/* -** Generic hash api. -*/ - -extern unsigned int HASH_ResultLen(HASH_HashType type); - -extern unsigned int HASH_ResultLenContext(HASHContext *context); - -extern unsigned int HASH_ResultLenByOidTag(SECOidTag hashOid); - -extern SECStatus HASH_HashBuf(HASH_HashType type, - unsigned char *dest, - const unsigned char *src, - PRUint32 src_len); - -extern HASHContext * HASH_Create(HASH_HashType type); - -extern HASHContext * HASH_Clone(HASHContext *context); - -extern void HASH_Destroy(HASHContext *context); - -extern void HASH_Begin(HASHContext *context); - -extern void HASH_Update(HASHContext *context, - const unsigned char *src, - unsigned int len); - -extern void HASH_End(HASHContext *context, - unsigned char *result, - unsigned int *result_len, - unsigned int max_result_len); - -extern HASH_HashType HASH_GetType(HASHContext *context); - -extern const SECHashObject * HASH_GetHashObject(HASH_HashType type); - -extern const SECHashObject * HASH_GetHashObjectByOidTag(SECOidTag hashOid); - -extern HASH_HashType HASH_GetHashTypeByOidTag(SECOidTag hashOid); -extern SECOidTag HASH_GetHashOidTagByHMACOidTag(SECOidTag hmacOid); -extern SECOidTag HASH_GetHMACOidTagByHashOidTag(SECOidTag hashOid); - -SEC_END_PROTOS - -#endif /* _HASH_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/nss.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/nss.h deleted file mode 100755 index c11b0dc..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/nss.h +++ /dev/null @@ -1,319 +0,0 @@ -/* - * NSS utility functions - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef __nss_h_ -#define __nss_h_ - -/* The private macro _NSS_ECC_STRING is for NSS internal use only. */ -#ifndef NSS_DISABLE_ECC -#ifdef NSS_ECC_MORE_THAN_SUITE_B -#define _NSS_ECC_STRING " Extended ECC" -#else -#define _NSS_ECC_STRING " Basic ECC" -#endif -#else -#define _NSS_ECC_STRING "" -#endif - -/* The private macro _NSS_CUSTOMIZED is for NSS internal use only. */ -#if defined(NSS_ALLOW_UNSUPPORTED_CRITICAL) -#define _NSS_CUSTOMIZED " (Customized build)" -#else -#define _NSS_CUSTOMIZED -#endif - -/* - * NSS's major version, minor version, patch level, build number, and whether - * this is a beta release. - * - * The format of the version string should be - * ".[.[.]][ ][ ]" - */ -#define NSS_VERSION "3.16" _NSS_ECC_STRING _NSS_CUSTOMIZED -#define NSS_VMAJOR 3 -#define NSS_VMINOR 16 -#define NSS_VPATCH 0 -#define NSS_VBUILD 0 -#define NSS_BETA PR_FALSE - -#ifndef RC_INVOKED - -#include "seccomon.h" - -typedef struct NSSInitParametersStr NSSInitParameters; - -/* - * parameters used to initialize softoken. Mostly strings used to - * internationalize softoken. Memory for the strings are owned by the caller, - * who is free to free them once NSS_ContextInit returns. If the string - * parameter is NULL (as opposed to empty, zero length), then the softoken - * default is used. These are equivalent to the parameters for - * PK11_ConfigurePKCS11(). - * - * field names match their equivalent parameter names for softoken strings - * documented at https://developer.mozilla.org/en/PKCS11_Module_Specs. - * - * minPWLen - * Minimum password length in bytes. - * manufacturerID - * Override the default manufactureID value for the module returned in - * the CK_INFO, CK_SLOT_INFO, and CK_TOKEN_INFO structures with an - * internationalize string (UTF8). This value will be truncated at 32 - * bytes (not including the trailing NULL, partial UTF8 characters will be - * dropped). - * libraryDescription - * Override the default libraryDescription value for the module returned in - * the CK_INFO structure with an internationalize string (UTF8). This value - * will be truncated at 32 bytes(not including the trailing NULL, partial - * UTF8 characters will be dropped). - * cryptoTokenDescription - * Override the default label value for the internal crypto token returned - * in the CK_TOKEN_INFO structure with an internationalize string (UTF8). - * This value will be truncated at 32 bytes (not including the trailing - * NULL, partial UTF8 characters will be dropped). - * dbTokenDescription - * Override the default label value for the internal DB token returned in - * the CK_TOKEN_INFO structure with an internationalize string (UTF8). This - * value will be truncated at 32 bytes (not including the trailing NULL, - * partial UTF8 characters will be dropped). - * FIPSTokenDescription - * Override the default label value for the internal FIPS token returned in - * the CK_TOKEN_INFO structure with an internationalize string (UTF8). This - * value will be truncated at 32 bytes (not including the trailing NULL, - * partial UTF8 characters will be dropped). - * cryptoSlotDescription - * Override the default slotDescription value for the internal crypto token - * returned in the CK_SLOT_INFO structure with an internationalize string - * (UTF8). This value will be truncated at 64 bytes (not including the - * trailing NULL, partial UTF8 characters will be dropped). - * dbSlotDescription - * Override the default slotDescription value for the internal DB token - * returned in the CK_SLOT_INFO structure with an internationalize string - * (UTF8). This value will be truncated at 64 bytes (not including the - * trailing NULL, partial UTF8 characters will be dropped). - * FIPSSlotDescription - * Override the default slotDecription value for the internal FIPS token - * returned in the CK_SLOT_INFO structure with an internationalize string - * (UTF8). This value will be truncated at 64 bytes (not including the - * trailing NULL, partial UTF8 characters will be dropped). - * - */ -struct NSSInitParametersStr { - unsigned int length; /* allow this structure to grow in the future, - * must be set */ - PRBool passwordRequired; - int minPWLen; - char * manufactureID; /* variable names for strings match the */ - char * libraryDescription; /* parameter name in softoken */ - char * cryptoTokenDescription; - char * dbTokenDescription; - char * FIPSTokenDescription; - char * cryptoSlotDescription; - char * dbSlotDescription; - char * FIPSSlotDescription; -}; - - -SEC_BEGIN_PROTOS - -/* - * Return a boolean that indicates whether the underlying library - * will perform as the caller expects. - * - * The only argument is a string, which should be the version - * identifier of the NSS library. That string will be compared - * against a string that represents the actual build version of - * the NSS library. - */ -extern PRBool NSS_VersionCheck(const char *importedVersion); - -/* - * Returns a const string of the NSS library version. - */ -extern const char *NSS_GetVersion(void); - -/* - * Open the Cert, Key, and Security Module databases, read only. - * Initialize the Random Number Generator. - * Does not initialize the cipher policies or enables. - * Default policy settings disallow all ciphers. - */ -extern SECStatus NSS_Init(const char *configdir); - -/* - * Returns whether NSS has already been initialized or not. - */ -extern PRBool NSS_IsInitialized(void); - -/* - * Open the Cert, Key, and Security Module databases, read/write. - * Initialize the Random Number Generator. - * Does not initialize the cipher policies or enables. - * Default policy settings disallow all ciphers. - */ -extern SECStatus NSS_InitReadWrite(const char *configdir); - -/* - * Open the Cert, Key, and Security Module databases, read/write. - * Initialize the Random Number Generator. - * Does not initialize the cipher policies or enables. - * Default policy settings disallow all ciphers. - * - * This allows using application defined prefixes for the cert and key db's - * and an alternate name for the secmod database. NOTE: In future releases, - * the database prefixes my not necessarily map to database names. - * - * configdir - base directory where all the cert, key, and module datbases live. - * certPrefix - prefix added to the beginning of the cert database example: " - * "https-server1-" - * keyPrefix - prefix added to the beginning of the key database example: " - * "https-server1-" - * secmodName - name of the security module database (usually "secmod.db"). - * flags - change the open options of NSS_Initialize as follows: - * NSS_INIT_READONLY - Open the databases read only. - * NSS_INIT_NOCERTDB - Don't open the cert DB and key DB's, just - * initialize the volatile certdb. - * NSS_INIT_NOMODDB - Don't open the security module DB, just - * initialize the PKCS #11 module. - * NSS_INIT_FORCEOPEN - Continue to force initializations even if the - * databases cannot be opened. - * NSS_INIT_NOROOTINIT - Don't try to look for the root certs module - * automatically. - * NSS_INIT_OPTIMIZESPACE - Use smaller tables and caches. - * NSS_INIT_PK11THREADSAFE - only load PKCS#11 modules that are - * thread-safe, ie. that support locking - either OS - * locking or NSS-provided locks . If a PKCS#11 - * module isn't thread-safe, don't serialize its - * calls; just don't load it instead. This is necessary - * if another piece of code is using the same PKCS#11 - * modules that NSS is accessing without going through - * NSS, for example the Java SunPKCS11 provider. - * NSS_INIT_PK11RELOAD - ignore the CKR_CRYPTOKI_ALREADY_INITIALIZED - * error when loading PKCS#11 modules. This is necessary - * if another piece of code is using the same PKCS#11 - * modules that NSS is accessing without going through - * NSS, for example Java SunPKCS11 provider. - * NSS_INIT_NOPK11FINALIZE - never call C_Finalize on any - * PKCS#11 module. This may be necessary in order to - * ensure continuous operation and proper shutdown - * sequence if another piece of code is using the same - * PKCS#11 modules that NSS is accessing without going - * through NSS, for example Java SunPKCS11 provider. - * The following limitation applies when this is set : - * SECMOD_WaitForAnyTokenEvent will not use - * C_WaitForSlotEvent, in order to prevent the need for - * C_Finalize. This call will be emulated instead. - * NSS_INIT_RESERVED - Currently has no effect, but may be used in the - * future to trigger better cooperation between PKCS#11 - * modules used by both NSS and the Java SunPKCS11 - * provider. This should occur after a new flag is defined - * for C_Initialize by the PKCS#11 working group. - * NSS_INIT_COOPERATE - Sets 4 recommended options for applications that - * use both NSS and the Java SunPKCS11 provider. - * - * Also NOTE: This is not the recommended method for initializing NSS. - * The preferred method is NSS_init(). - */ -#define NSS_INIT_READONLY 0x1 -#define NSS_INIT_NOCERTDB 0x2 -#define NSS_INIT_NOMODDB 0x4 -#define NSS_INIT_FORCEOPEN 0x8 -#define NSS_INIT_NOROOTINIT 0x10 -#define NSS_INIT_OPTIMIZESPACE 0x20 -#define NSS_INIT_PK11THREADSAFE 0x40 -#define NSS_INIT_PK11RELOAD 0x80 -#define NSS_INIT_NOPK11FINALIZE 0x100 -#define NSS_INIT_RESERVED 0x200 - -#define NSS_INIT_COOPERATE NSS_INIT_PK11THREADSAFE | \ - NSS_INIT_PK11RELOAD | \ - NSS_INIT_NOPK11FINALIZE | \ - NSS_INIT_RESERVED - -#define SECMOD_DB "secmod.db" - -typedef struct NSSInitContextStr NSSInitContext; - - -extern SECStatus NSS_Initialize(const char *configdir, - const char *certPrefix, const char *keyPrefix, - const char *secmodName, PRUint32 flags); - -extern NSSInitContext *NSS_InitContext(const char *configdir, - const char *certPrefix, const char *keyPrefix, - const char *secmodName, NSSInitParameters *initParams, PRUint32 flags); - -extern SECStatus NSS_ShutdownContext(NSSInitContext *); - -/* - * same as NSS_Init, but checks to see if we need to merge an - * old database in. - * updatedir is the directory where the old database lives. - * updCertPrefix is the certPrefix for the old database. - * updKeyPrefix is the keyPrefix for the old database. - * updateID is a unique identifier chosen by the application for - * the specific database. - * updatName is the name the user will be prompted for when - * asking to authenticate to the old database */ -extern SECStatus NSS_InitWithMerge(const char *configdir, - const char *certPrefix, const char *keyPrefix, const char *secmodName, - const char *updatedir, const char *updCertPrefix, - const char *updKeyPrefix, const char *updateID, - const char *updateName, PRUint32 flags); -/* - * initialize NSS without a creating cert db's, key db's, or secmod db's. - */ -SECStatus NSS_NoDB_Init(const char *configdir); - -/* - * Allow applications and libraries to register with NSS so that they are called - * when NSS shuts down. - * - * void *appData application specific data passed in by the application at - * NSS_RegisterShutdown() time. - * void *nssData is NULL in this release, but is reserved for future versions of - * NSS to pass some future status information * back to the shutdown function. - * - * If the shutdown function returns SECFailure, - * Shutdown will still complete, but NSS_Shutdown() will return SECFailure. - */ -typedef SECStatus (*NSS_ShutdownFunc)(void *appData, void *nssData); - -/* - * Register a shutdown function. - */ -SECStatus NSS_RegisterShutdown(NSS_ShutdownFunc sFunc, void *appData); - -/* - * Remove an existing shutdown function (you may do this if your library is - * complete and going away, but NSS is still running). - */ -SECStatus NSS_UnregisterShutdown(NSS_ShutdownFunc sFunc, void *appData); - -/* - * Close the Cert, Key databases. - */ -extern SECStatus NSS_Shutdown(void); - -/* - * set the PKCS #11 strings for the internal token. - */ -void PK11_ConfigurePKCS11(const char *man, const char *libdesc, - const char *tokdesc, const char *ptokdesc, const char *slotdesc, - const char *pslotdesc, const char *fslotdesc, const char *fpslotdesc, - int minPwd, int pwRequired); - -/* - * Dump the contents of the certificate cache and the temporary cert store. - * Use to detect leaked references of certs at shutdown time. - */ -void nss_DumpCertificateCacheInfo(void); - -SEC_END_PROTOS - -#endif /* RC_INVOKED */ -#endif /* __nss_h_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/nssrenam.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/nssrenam.h deleted file mode 100755 index 17f072c..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/nssrenam.h +++ /dev/null @@ -1,15 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef __nssrenam_h_ -#define __nssrenam_h_ - -#define CERT_AddTempCertToPerm __CERT_AddTempCertToPerm -#define PK11_CreateContextByRawKey __PK11_CreateContextByRawKey -#define CERT_ClosePermCertDB __CERT_ClosePermCertDB -#define CERT_DecodeDERCertificate __CERT_DecodeDERCertificate -#define CERT_TraversePermCertsForNickname __CERT_TraversePermCertsForNickname -#define CERT_TraversePermCertsForSubject __CERT_TraversePermCertsForSubject - -#endif /* __nssrenam_h_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/dev3hack.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/dev3hack.h deleted file mode 100755 index 6b4f8de..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/dev3hack.h +++ /dev/null @@ -1,30 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef DEVNSS3HACK_H -#define DEVNSS3HACK_H - -#include "cert.h" - -PR_BEGIN_EXTERN_C - -NSS_EXTERN NSSToken * -nssToken_CreateFromPK11SlotInfo(NSSTrustDomain *td, PK11SlotInfo *nss3slot); - -NSS_EXTERN void -nssToken_UpdateName(NSSToken *); - -NSS_EXTERN PRStatus -nssToken_Refresh(NSSToken *); - -NSSTrustDomain * -nssToken_GetTrustDomain(NSSToken *token); - -void PK11Slot_SetNSSToken(PK11SlotInfo *sl, NSSToken *nsst); - -NSSToken * PK11Slot_GetNSSToken(PK11SlotInfo *sl); - -PR_END_EXTERN_C - -#endif /* DEVNSS3HACK_H */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/pk11func.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/pk11func.h deleted file mode 100755 index 331c0eb..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/pk11func.h +++ /dev/null @@ -1,15 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef _PK11FUNC_H_ -#define _PK11FUNC_H_ - -/* - * The original pk11func.h had a mix of public and private functions. - * Continue to provide those for backward compatibility. New code should - * include pk11pub.h instead of pk11func.h. - */ -#include "pk11pub.h" -#include "pk11priv.h" - -#endif diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/pk11pqg.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/pk11pqg.h deleted file mode 100755 index 02f9394..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/pk11pqg.h +++ /dev/null @@ -1,142 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/* Thse functions are stub functions which will get replaced with calls through - * PKCS #11. - */ - -#ifndef _PK11PQG_H_ -#define _PK11PQG_H_ 1 - -#include "blapit.h" - -SEC_BEGIN_PROTOS - -/* Generate PQGParams and PQGVerify structs. - * Length of seed and length of h both equal length of P. - * All lengths are specified by "j", according to the table above. - */ -extern SECStatus PK11_PQG_ParamGen(unsigned int j, PQGParams **pParams, - PQGVerify **pVfy); - -/* Generate PQGParams and PQGVerify structs. - * Length of P specified by j. Length of h will match length of P. - * Length of SEED in bytes specified in seedBytes. - * seedBbytes must be in the range [20..255] or an error will result. - */ -extern SECStatus PK11_PQG_ParamGenSeedLen( unsigned int j, - unsigned int seedBytes, PQGParams **pParams, PQGVerify **pVfy); - - -/* Generate PQGParams and PQGVerify structs. - * Length of P specified by L. - * if L is greater than 1024 then the resulting verify parameters will be - * DSA2. - * Length of Q specified by N. If zero, The PKCS #11 module will - * pick an appropriately sized Q for L. If N is specified and L = 1024, then - * the resulting verify parameters will be DSA2, Otherwise DSA1 parameters - * will be returned. - * Length of SEED in bytes specified in seedBytes. - * - * The underlying PKCS #11 module will check the values for L, N, - * and seedBytes. The rules for softoken are: - * - * If L <= 1024, then L must be between 512 and 1024 in increments of 64 bits. - * If L <= 1024, then N must be 0 or 160. - * If L >= 1024, then L and N must match the following table: - * L=1024 N=0 or 160 - * L=2048 N=0 or 224 - * L=2048 N=256 - * L=3072 N=0 or 256 - * if L <= 1024 - * seedBbytes must be in the range [20..256]. - * if L >= 1024 - * seedBbytes must be in the range [20..L/16]. - */ -extern SECStatus -PK11_PQG_ParamGenV2(unsigned int L, unsigned int N, unsigned int seedBytes, - PQGParams **pParams, PQGVerify **pVfy); - -/* Test PQGParams for validity as DSS PQG values. - * If vfy is non-NULL, test PQGParams to make sure they were generated - * using the specified seed, counter, and h values. - * - * Return value indicates whether Verification operation ran successfully - * to completion, but does not indicate if PQGParams are valid or not. - * If return value is SECSuccess, then *pResult has these meanings: - * SECSuccess: PQGParams are valid. - * SECFailure: PQGParams are invalid. - * - * Verify the following 12 facts about PQG counter SEED g and h - * These tests are specified in FIPS 186-3 Appendix A.1.1.1, A.1.1.3, and A.2.2 - * PQG_VerifyParams in softoken/freebl will automatically choose the - * appropriate test. - */ -extern SECStatus PK11_PQG_VerifyParams(const PQGParams *params, - const PQGVerify *vfy, SECStatus *result); -extern void PK11_PQG_DestroyParams(PQGParams *params); -extern void PK11_PQG_DestroyVerify(PQGVerify *vfy); - -/************************************************************************** - * Return a pointer to a new PQGParams struct that is constructed from * - * copies of the arguments passed in. * - * Return NULL on failure. * - **************************************************************************/ -extern PQGParams * PK11_PQG_NewParams(const SECItem * prime, const - SECItem * subPrime, const SECItem * base); - - -/************************************************************************** - * Fills in caller's "prime" SECItem with the prime value in params. - * Contents can be freed by calling SECITEM_FreeItem(prime, PR_FALSE); - **************************************************************************/ -extern SECStatus PK11_PQG_GetPrimeFromParams(const PQGParams *params, - SECItem * prime); - - -/************************************************************************** - * Fills in caller's "subPrime" SECItem with the prime value in params. - * Contents can be freed by calling SECITEM_FreeItem(subPrime, PR_FALSE); - **************************************************************************/ -extern SECStatus PK11_PQG_GetSubPrimeFromParams(const PQGParams *params, - SECItem * subPrime); - - -/************************************************************************** - * Fills in caller's "base" SECItem with the base value in params. - * Contents can be freed by calling SECITEM_FreeItem(base, PR_FALSE); - **************************************************************************/ -extern SECStatus PK11_PQG_GetBaseFromParams(const PQGParams *params, - SECItem *base); - - -/************************************************************************** - * Return a pointer to a new PQGVerify struct that is constructed from * - * copies of the arguments passed in. * - * Return NULL on failure. * - **************************************************************************/ -extern PQGVerify * PK11_PQG_NewVerify(unsigned int counter, - const SECItem * seed, const SECItem * h); - - -/************************************************************************** - * Returns "counter" value from the PQGVerify. - **************************************************************************/ -extern unsigned int PK11_PQG_GetCounterFromVerify(const PQGVerify *verify); - -/************************************************************************** - * Fills in caller's "seed" SECItem with the seed value in verify. - * Contents can be freed by calling SECITEM_FreeItem(seed, PR_FALSE); - **************************************************************************/ -extern SECStatus PK11_PQG_GetSeedFromVerify(const PQGVerify *verify, - SECItem *seed); - -/************************************************************************** - * Fills in caller's "h" SECItem with the h value in verify. - * Contents can be freed by calling SECITEM_FreeItem(h, PR_FALSE); - **************************************************************************/ -extern SECStatus PK11_PQG_GetHFromVerify(const PQGVerify *verify, SECItem * h); - -SEC_END_PROTOS - -#endif diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/pk11priv.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/pk11priv.h deleted file mode 100755 index c68293b..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/pk11priv.h +++ /dev/null @@ -1,192 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef _PK11PRIV_H_ -#define _PK11PRIV_H_ -#include "plarena.h" -#include "seccomon.h" -#include "secoidt.h" -#include "secdert.h" -#include "keyt.h" -#include "certt.h" -#include "pkcs11t.h" -#include "secmodt.h" -#include "seccomon.h" -#include "pkcs7t.h" -#include "cmsreclist.h" - -/* - * These are the private NSS functions. They are not exported by nss.def, and - * are not callable outside nss3.dll. - */ - -SEC_BEGIN_PROTOS - -/************************************************************ - * Generic Slot Lists Management - ************************************************************/ -PK11SlotList * PK11_NewSlotList(void); -PK11SlotList * PK11_GetPrivateKeyTokens(CK_MECHANISM_TYPE type, - PRBool needRW,void *wincx); -SECStatus PK11_AddSlotToList(PK11SlotList *list,PK11SlotInfo *slot, PRBool sorted); -SECStatus PK11_DeleteSlotFromList(PK11SlotList *list,PK11SlotListElement *le); -PK11SlotListElement *PK11_FindSlotElement(PK11SlotList *list, - PK11SlotInfo *slot); -PK11SlotInfo *PK11_FindSlotBySerial(char *serial); -int PK11_GetMaxKeyLength(CK_MECHANISM_TYPE type); - -/************************************************************ - * Generic Slot Management - ************************************************************/ -CK_OBJECT_HANDLE PK11_CopyKey(PK11SlotInfo *slot, CK_OBJECT_HANDLE srcObject); -SECStatus PK11_ReadAttribute(PK11SlotInfo *slot, CK_OBJECT_HANDLE id, - CK_ATTRIBUTE_TYPE type, PLArenaPool *arena, SECItem *result); -CK_ULONG PK11_ReadULongAttribute(PK11SlotInfo *slot, CK_OBJECT_HANDLE id, - CK_ATTRIBUTE_TYPE type); -char * PK11_MakeString(PLArenaPool *arena,char *space,char *staticSring, - int stringLen); -int PK11_MapError(CK_RV error); -CK_SESSION_HANDLE PK11_GetRWSession(PK11SlotInfo *slot); -void PK11_RestoreROSession(PK11SlotInfo *slot,CK_SESSION_HANDLE rwsession); -PRBool PK11_RWSessionHasLock(PK11SlotInfo *slot, - CK_SESSION_HANDLE session_handle); -PK11SlotInfo *PK11_NewSlotInfo(SECMODModule *mod); -void PK11_EnterSlotMonitor(PK11SlotInfo *); -void PK11_ExitSlotMonitor(PK11SlotInfo *); -void PK11_CleanKeyList(PK11SlotInfo *slot); - - -/************************************************************ - * Slot Password Management - ************************************************************/ -SECStatus PK11_DoPassword(PK11SlotInfo *slot, CK_SESSION_HANDLE session, - PRBool loadCerts, void *wincx, PRBool alreadyLocked, - PRBool contextSpecific); -SECStatus PK11_VerifyPW(PK11SlotInfo *slot,char *pw); -void PK11_HandlePasswordCheck(PK11SlotInfo *slot,void *wincx); -void PK11_SetVerifyPasswordFunc(PK11VerifyPasswordFunc func); -void PK11_SetIsLoggedInFunc(PK11IsLoggedInFunc func); - -/************************************************************ - * Manage the built-In Slot Lists - ************************************************************/ -SECStatus PK11_InitSlotLists(void); -void PK11_DestroySlotLists(void); -PK11SlotList *PK11_GetSlotList(CK_MECHANISM_TYPE type); -void PK11_LoadSlotList(PK11SlotInfo *slot, PK11PreSlotInfo *psi, int count); -void PK11_ClearSlotList(PK11SlotInfo *slot); - - -/****************************************************************** - * Slot initialization - ******************************************************************/ -SECStatus PK11_InitToken(PK11SlotInfo *slot, PRBool loadCerts); -void PK11_InitSlot(SECMODModule *mod,CK_SLOT_ID slotID,PK11SlotInfo *slot); -PRBool PK11_NeedPWInitForSlot(PK11SlotInfo *slot); -SECStatus PK11_ReadSlotCerts(PK11SlotInfo *slot); -void pk11_SetInternalKeySlot(PK11SlotInfo *slot); -PK11SlotInfo *pk11_SwapInternalKeySlot(PK11SlotInfo *slot); -void pk11_SetInternalKeySlotIfFirst(PK11SlotInfo *slot); - -/********************************************************************* - * Mechanism Mapping functions - *********************************************************************/ -void PK11_AddMechanismEntry(CK_MECHANISM_TYPE type, CK_KEY_TYPE key, - CK_MECHANISM_TYPE keygen, CK_MECHANISM_TYPE pad, - int ivLen, int blocksize); -CK_MECHANISM_TYPE PK11_GetKeyMechanism(CK_KEY_TYPE type); -CK_MECHANISM_TYPE PK11_GetKeyGenWithSize(CK_MECHANISM_TYPE type, int size); - -/********************************************************************** - * Symetric, Public, and Private Keys - **********************************************************************/ -/* Key Generation specialized for SDR (fixed DES3 key) */ -PK11SymKey *PK11_GenDES3TokenKey(PK11SlotInfo *slot, SECItem *keyid, void *cx); -SECKEYPublicKey *PK11_ExtractPublicKey(PK11SlotInfo *slot, KeyType keyType, - CK_OBJECT_HANDLE id); -CK_OBJECT_HANDLE PK11_FindObjectForCert(CERTCertificate *cert, - void *wincx, PK11SlotInfo **pSlot); -PK11SymKey * pk11_CopyToSlot(PK11SlotInfo *slot,CK_MECHANISM_TYPE type, - CK_ATTRIBUTE_TYPE operation, PK11SymKey *symKey); - -/********************************************************************** - * Certs - **********************************************************************/ -SECStatus PK11_TraversePrivateKeysInSlot( PK11SlotInfo *slot, - SECStatus(* callback)(SECKEYPrivateKey*, void*), void *arg); -SECKEYPrivateKey * PK11_FindPrivateKeyFromNickname(char *nickname, void *wincx); -CK_OBJECT_HANDLE * PK11_FindObjectsFromNickname(char *nickname, - PK11SlotInfo **slotptr, CK_OBJECT_CLASS objclass, int *returnCount, - void *wincx); -CK_OBJECT_HANDLE PK11_MatchItem(PK11SlotInfo *slot,CK_OBJECT_HANDLE peer, - CK_OBJECT_CLASS o_class); -CK_BBOOL PK11_HasAttributeSet( PK11SlotInfo *slot, - CK_OBJECT_HANDLE id, - CK_ATTRIBUTE_TYPE type, - PRBool haslock ); -CK_RV PK11_GetAttributes(PLArenaPool *arena,PK11SlotInfo *slot, - CK_OBJECT_HANDLE obj,CK_ATTRIBUTE *attr, int count); -int PK11_NumberCertsForCertSubject(CERTCertificate *cert); -SECStatus PK11_TraverseCertsForSubject(CERTCertificate *cert, - SECStatus(*callback)(CERTCertificate *, void *), void *arg); -SECStatus PK11_GetKEAMatchedCerts(PK11SlotInfo *slot1, - PK11SlotInfo *slot2, CERTCertificate **cert1, CERTCertificate **cert2); -SECStatus PK11_TraverseCertsInSlot(PK11SlotInfo *slot, - SECStatus(* callback)(CERTCertificate*, void *), void *arg); -SECStatus PK11_LookupCrls(CERTCrlHeadNode *nodes, int type, void *wincx); - - -/********************************************************************** - * Crypto Contexts - **********************************************************************/ -PK11Context * PK11_CreateContextByRawKey(PK11SlotInfo *slot, - CK_MECHANISM_TYPE type, PK11Origin origin, CK_ATTRIBUTE_TYPE operation, - SECItem *key, SECItem *param, void *wincx); -PRBool PK11_HashOK(SECOidTag hashAlg); - - -/********************************************************************** - * Functions which are deprecated.... - **********************************************************************/ - -SECItem * -PK11_FindCrlByName(PK11SlotInfo **slot, CK_OBJECT_HANDLE *handle, - SECItem *derName, int type, char **url); - -CK_OBJECT_HANDLE -PK11_PutCrl(PK11SlotInfo *slot, SECItem *crl, - SECItem *name, char *url, int type); - -SECItem * -PK11_FindSMimeProfile(PK11SlotInfo **slotp, char *emailAddr, SECItem *derSubj, - SECItem **profileTime); -SECStatus -PK11_SaveSMimeProfile(PK11SlotInfo *slot, char *emailAddr, SECItem *derSubj, - SECItem *emailProfile, SECItem *profileTime); - -PRBool PK11_IsPermObject(PK11SlotInfo *slot, CK_OBJECT_HANDLE handle); - -char * PK11_GetObjectNickname(PK11SlotInfo *slot, CK_OBJECT_HANDLE id) ; -SECStatus PK11_SetObjectNickname(PK11SlotInfo *slot, CK_OBJECT_HANDLE id, - const char *nickname) ; - - -/* private */ -SECStatus pk11_TraverseAllSlots( SECStatus (*callback)(PK11SlotInfo *,void *), - void *cbArg, PRBool forceLogin, void *pwArg); - -/* fetch multiple CRLs for a specific issuer */ -SECStatus pk11_RetrieveCrls(CERTCrlHeadNode *nodes, SECItem* issuer, - void *wincx); - -/* set global options for NSS PKCS#11 module loader */ -SECStatus pk11_setGlobalOptions(PRBool noSingleThreadedModules, - PRBool allowAlreadyInitializedModules, - PRBool dontFinalizeModules); - -/* return whether NSS is allowed to call C_Finalize */ -PRBool pk11_getFinalizeModulesOption(void); - -SEC_END_PROTOS - -#endif diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/pk11pub.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/pk11pub.h deleted file mode 100755 index c3beef9..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/pk11pub.h +++ /dev/null @@ -1,866 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef _PK11PUB_H_ -#define _PK11PUB_H_ -#include "plarena.h" -#include "seccomon.h" -#include "secoidt.h" -#include "secdert.h" -#include "keyt.h" -#include "certt.h" -#include "pkcs11t.h" -#include "secmodt.h" -#include "seccomon.h" -#include "pkcs7t.h" -#include "cmsreclist.h" - -/* - * Exported PK11 wrap functions. - */ - -SEC_BEGIN_PROTOS - -/************************************************************ - * Generic Slot Lists Management - ************************************************************/ -void PK11_FreeSlotList(PK11SlotList *list); -SECStatus PK11_FreeSlotListElement(PK11SlotList *list, PK11SlotListElement *le); -PK11SlotListElement * PK11_GetFirstSafe(PK11SlotList *list); -PK11SlotListElement *PK11_GetNextSafe(PK11SlotList *list, - PK11SlotListElement *le, PRBool restart); - -/************************************************************ - * Generic Slot Management - ************************************************************/ -PK11SlotInfo *PK11_ReferenceSlot(PK11SlotInfo *slot); -void PK11_FreeSlot(PK11SlotInfo *slot); -SECStatus PK11_DestroyObject(PK11SlotInfo *slot,CK_OBJECT_HANDLE object); -SECStatus PK11_DestroyTokenObject(PK11SlotInfo *slot,CK_OBJECT_HANDLE object); -PK11SlotInfo *PK11_GetInternalKeySlot(void); -PK11SlotInfo *PK11_GetInternalSlot(void); -SECStatus PK11_Logout(PK11SlotInfo *slot); -void PK11_LogoutAll(void); - - -/************************************************************ - * Slot Password Management - ************************************************************/ -void PK11_SetSlotPWValues(PK11SlotInfo *slot,int askpw, int timeout); -void PK11_GetSlotPWValues(PK11SlotInfo *slot,int *askpw, int *timeout); -SECStatus PK11_CheckSSOPassword(PK11SlotInfo *slot, char *ssopw); -SECStatus PK11_CheckUserPassword(PK11SlotInfo *slot, const char *pw); -PRBool PK11_IsLoggedIn(PK11SlotInfo *slot, void *wincx); -SECStatus PK11_InitPin(PK11SlotInfo *slot,const char *ssopw, - const char *pk11_userpwd); -SECStatus PK11_ChangePW(PK11SlotInfo *slot, const char *oldpw, - const char *newpw); -void PK11_SetPasswordFunc(PK11PasswordFunc func); -int PK11_GetMinimumPwdLength(PK11SlotInfo *slot); -SECStatus PK11_ResetToken(PK11SlotInfo *slot, char *sso_pwd); -SECStatus PK11_Authenticate(PK11SlotInfo *slot, PRBool loadCerts, void *wincx); -SECStatus PK11_TokenRefresh(PK11SlotInfo *slot); - - -/****************************************************************** - * Slot info functions - ******************************************************************/ -PK11SlotInfo *PK11_FindSlotByName(const char *name); -/****************************************************************** - * PK11_FindSlotsByNames searches for a PK11SlotInfo using one or - * more criteria : dllName, slotName and tokenName . In addition, if - * presentOnly is set , only slots with a token inserted will be - * returned. - ******************************************************************/ -PK11SlotList *PK11_FindSlotsByNames(const char *dllName, - const char* slotName, const char* tokenName, PRBool presentOnly); -PRBool PK11_IsReadOnly(PK11SlotInfo *slot); -PRBool PK11_IsInternal(PK11SlotInfo *slot); -PRBool PK11_IsInternalKeySlot(PK11SlotInfo *slot); -char * PK11_GetTokenName(PK11SlotInfo *slot); -char * PK11_GetSlotName(PK11SlotInfo *slot); -PRBool PK11_NeedLogin(PK11SlotInfo *slot); -PRBool PK11_IsFriendly(PK11SlotInfo *slot); -PRBool PK11_IsHW(PK11SlotInfo *slot); -PRBool PK11_IsRemovable(PK11SlotInfo *slot); -PRBool PK11_NeedUserInit(PK11SlotInfo *slot); -PRBool PK11_ProtectedAuthenticationPath(PK11SlotInfo *slot); -int PK11_GetSlotSeries(PK11SlotInfo *slot); -int PK11_GetCurrentWrapIndex(PK11SlotInfo *slot); -unsigned long PK11_GetDefaultFlags(PK11SlotInfo *slot); -CK_SLOT_ID PK11_GetSlotID(PK11SlotInfo *slot); -SECMODModuleID PK11_GetModuleID(PK11SlotInfo *slot); -SECStatus PK11_GetSlotInfo(PK11SlotInfo *slot, CK_SLOT_INFO *info); -SECStatus PK11_GetTokenInfo(PK11SlotInfo *slot, CK_TOKEN_INFO *info); -PRBool PK11_IsDisabled(PK11SlotInfo *slot); -PRBool PK11_HasRootCerts(PK11SlotInfo *slot); -PK11DisableReasons PK11_GetDisabledReason(PK11SlotInfo *slot); -/* Prevents the slot from being used, and set disable reason to user-disable */ -/* NOTE: Mechanisms that were ON continue to stay ON */ -/* Therefore, when the slot is enabled, it will remember */ -/* what mechanisms needs to be turned on */ -PRBool PK11_UserDisableSlot(PK11SlotInfo *slot); -/* Allow all mechanisms that are ON before UserDisableSlot() */ -/* was called to be available again */ -PRBool PK11_UserEnableSlot(PK11SlotInfo *slot); -/* - * wait for a specific slot event. - * event is a specific event to wait for. Currently only - * PK11TokenChangeOrRemovalEvent and PK11TokenPresentEvents are defined. - * timeout can be an interval time to wait, PR_INTERVAL_NO_WAIT (meaning only - * poll once), or PR_INTERVAL_NO_TIMEOUT (meaning block until a change). - * pollInterval is a suggested pulling interval value. '0' means use the - * default. Future implementations that don't poll may ignore this value. - * series is the current series for the last slot. This should be the series - * value for the slot the last time you read persistant information from the - * slot. For instance, if you publish a cert from the slot, you should obtain - * the slot series at that time. Then PK11_WaitForTokenEvent can detect a - * a change in the slot between the time you publish and the time - * PK11_WaitForTokenEvent is called, elliminating potential race conditions. - * - * The current status that is returned is: - * PK11TokenNotRemovable - always returned for any non-removable token. - * PK11TokenPresent - returned when the token is present and we are waiting - * on a PK11TokenPresentEvent. Then next event to look for is a - * PK11TokenChangeOrRemovalEvent. - * PK11TokenChanged - returned when the old token has been removed and a new - * token ad been inserted, and we are waiting for a - * PK11TokenChangeOrRemovalEvent. The next event to look for is another - * PK11TokenChangeOrRemovalEvent. - * PK11TokenRemoved - returned when the token is not present and we are - * waiting for a PK11TokenChangeOrRemovalEvent. The next event to look for - * is a PK11TokenPresentEvent. - */ -PK11TokenStatus PK11_WaitForTokenEvent(PK11SlotInfo *slot, PK11TokenEvent event, - PRIntervalTime timeout, PRIntervalTime pollInterval, int series); - -PRBool PK11_NeedPWInit(void); -PRBool PK11_TokenExists(CK_MECHANISM_TYPE); -SECStatus PK11_GetModInfo(SECMODModule *mod, CK_INFO *info); -PRBool PK11_IsFIPS(void); -SECMODModule *PK11_GetModule(PK11SlotInfo *slot); - -/********************************************************************* - * Slot mapping utility functions. - *********************************************************************/ -PRBool PK11_IsPresent(PK11SlotInfo *slot); -PRBool PK11_DoesMechanism(PK11SlotInfo *slot, CK_MECHANISM_TYPE type); -PK11SlotList * PK11_GetAllTokens(CK_MECHANISM_TYPE type,PRBool needRW, - PRBool loadCerts, void *wincx); -PK11SlotInfo *PK11_GetBestSlotMultipleWithAttributes(CK_MECHANISM_TYPE *type, - CK_FLAGS *mechFlag, unsigned int *keySize, - unsigned int count, void *wincx); -PK11SlotInfo *PK11_GetBestSlotMultiple(CK_MECHANISM_TYPE *type, - unsigned int count, void *wincx); -PK11SlotInfo *PK11_GetBestSlot(CK_MECHANISM_TYPE type, void *wincx); -PK11SlotInfo *PK11_GetBestSlotWithAttributes(CK_MECHANISM_TYPE type, - CK_FLAGS mechFlag, unsigned int keySize, void *wincx); -CK_MECHANISM_TYPE PK11_GetBestWrapMechanism(PK11SlotInfo *slot); -int PK11_GetBestKeyLength(PK11SlotInfo *slot, CK_MECHANISM_TYPE type); - -/* - * Open a new database using the softoken. The caller is responsible for making - * sure the module spec is correct and usable. The caller should ask for one - * new database per call if the caller wants to get meaningful information - * about the new database. - * - * moduleSpec is the same data that you would pass to softoken at - * initialization time under the 'tokens' options. For example, if you were - * to specify tokens=<0x4=[configdir='./mybackup' tokenDescription='Backup']> - * You would specify "configdir='./mybackup' tokenDescription='Backup'" as your - * module spec here. The slot ID will be calculated for you by - * SECMOD_OpenUserDB(). - * - * Typical parameters here are configdir, tokenDescription and flags. - * - * a Full list is below: - * - * - * configDir - The location of the databases for this token. If configDir is - * not specified, and noCertDB and noKeyDB is not specified, the load - * will fail. - * certPrefix - Cert prefix for this token. - * keyPrefix - Prefix for the key database for this token. (if not specified, - * certPrefix will be used). - * tokenDescription - The label value for this token returned in the - * CK_TOKEN_INFO structure with an internationalize string (UTF8). - * This value will be truncated at 32 bytes (no NULL, partial UTF8 - * characters dropped). You should specify a user friendly name here - * as this is the value the token will be referred to in most - * application UI's. You should make sure tokenDescription is unique. - * slotDescription - The slotDescription value for this token returned - * in the CK_SLOT_INFO structure with an internationalize string - * (UTF8). This value will be truncated at 64 bytes (no NULL, partial - * UTF8 characters dropped). This name will not change after the - * database is closed. It should have some number to make this unique. - * minPWLen - minimum password length for this token. - * flags - comma separated list of flag values, parsed case-insensitive. - * Valid flags are: - * readOnly - Databases should be opened read only. - * noCertDB - Don't try to open a certificate database. - * noKeyDB - Don't try to open a key database. - * forceOpen - Don't fail to initialize the token if the - * databases could not be opened. - * passwordRequired - zero length passwords are not acceptable - * (valid only if there is a keyDB). - * optimizeSpace - allocate smaller hash tables and lock tables. - * When this flag is not specified, Softoken will allocate - * large tables to prevent lock contention. - */ -PK11SlotInfo *SECMOD_OpenUserDB(const char *moduleSpec); -SECStatus SECMOD_CloseUserDB(PK11SlotInfo *slot); - -/* - * This is exactly the same as OpenUserDB except it can be called on any - * module that understands softoken style new slot entries. The resulting - * slot can be closed using SECMOD_CloseUserDB above. Value of moduleSpec - * is token specific. - */ -PK11SlotInfo *SECMOD_OpenNewSlot(SECMODModule *mod, const char *moduleSpec); - - -/* - * merge the permanent objects from on token to another - */ -SECStatus PK11_MergeTokens(PK11SlotInfo *targetSlot, PK11SlotInfo *sourceSlot, - PK11MergeLog *log, void *targetPwArg, void *sourcePwArg); - -/* - * create and destroy merge logs needed by PK11_MergeTokens - */ -PK11MergeLog * PK11_CreateMergeLog(void); -void PK11_DestroyMergeLog(PK11MergeLog *log); - - - -/********************************************************************* - * Mechanism Mapping functions - *********************************************************************/ -CK_KEY_TYPE PK11_GetKeyType(CK_MECHANISM_TYPE type,unsigned long len); -CK_MECHANISM_TYPE PK11_GetKeyGen(CK_MECHANISM_TYPE type); -int PK11_GetBlockSize(CK_MECHANISM_TYPE type,SECItem *params); -int PK11_GetIVLength(CK_MECHANISM_TYPE type); -SECItem *PK11_ParamFromIV(CK_MECHANISM_TYPE type,SECItem *iv); -unsigned char *PK11_IVFromParam(CK_MECHANISM_TYPE type,SECItem *param,int *len); -SECItem * PK11_BlockData(SECItem *data,unsigned long size); - -/* PKCS #11 to DER mapping functions */ -SECItem *PK11_ParamFromAlgid(SECAlgorithmID *algid); -SECItem *PK11_GenerateNewParam(CK_MECHANISM_TYPE, PK11SymKey *); -CK_MECHANISM_TYPE PK11_AlgtagToMechanism(SECOidTag algTag); -SECOidTag PK11_MechanismToAlgtag(CK_MECHANISM_TYPE type); -SECOidTag PK11_FortezzaMapSig(SECOidTag algTag); -SECStatus PK11_ParamToAlgid(SECOidTag algtag, SECItem *param, - PLArenaPool *arena, SECAlgorithmID *algid); -SECStatus PK11_SeedRandom(PK11SlotInfo *,unsigned char *data,int len); -SECStatus PK11_GenerateRandomOnSlot(PK11SlotInfo *,unsigned char *data,int len); -SECStatus PK11_RandomUpdate(void *data, size_t bytes); -SECStatus PK11_GenerateRandom(unsigned char *data,int len); - -/* warning: cannot work with pkcs 5 v2 - * use algorithm ID s instead of pkcs #11 mechanism pointers */ -CK_RV PK11_MapPBEMechanismToCryptoMechanism(CK_MECHANISM_PTR pPBEMechanism, - CK_MECHANISM_PTR pCryptoMechanism, - SECItem *pbe_pwd, PRBool bad3DES); -CK_MECHANISM_TYPE PK11_GetPadMechanism(CK_MECHANISM_TYPE); -CK_MECHANISM_TYPE PK11_MapSignKeyType(KeyType keyType); - -/********************************************************************** - * Symmetric, Public, and Private Keys - **********************************************************************/ -void PK11_FreeSymKey(PK11SymKey *key); -PK11SymKey *PK11_ReferenceSymKey(PK11SymKey *symKey); -PK11SymKey *PK11_ImportSymKey(PK11SlotInfo *slot, CK_MECHANISM_TYPE type, - PK11Origin origin, CK_ATTRIBUTE_TYPE operation, SECItem *key, void *wincx); -PK11SymKey *PK11_ImportSymKeyWithFlags(PK11SlotInfo *slot, - CK_MECHANISM_TYPE type, PK11Origin origin, CK_ATTRIBUTE_TYPE operation, - SECItem *key, CK_FLAGS flags, PRBool isPerm, void *wincx); -PK11SymKey *PK11_SymKeyFromHandle(PK11SlotInfo *slot, PK11SymKey *parent, - PK11Origin origin, CK_MECHANISM_TYPE type, CK_OBJECT_HANDLE keyID, - PRBool owner, void *wincx); -PK11SymKey *PK11_GetWrapKey(PK11SlotInfo *slot, int wrap, - CK_MECHANISM_TYPE type,int series, void *wincx); -/* - * This function is not thread-safe. It can only be called when only - * one thread has a reference to wrapKey. - */ -void PK11_SetWrapKey(PK11SlotInfo *slot, int wrap, PK11SymKey *wrapKey); -CK_MECHANISM_TYPE PK11_GetMechanism(PK11SymKey *symKey); -/* - * import a public key into the desired slot - * - * This function takes a public key structure and creates a public key in a - * given slot. If isToken is set, then a persistant public key is created. - * - * Note: it is possible for this function to return a handle for a key which - * is persistant, even if isToken is not set. - */ -CK_OBJECT_HANDLE PK11_ImportPublicKey(PK11SlotInfo *slot, - SECKEYPublicKey *pubKey, PRBool isToken); -PK11SymKey *PK11_KeyGen(PK11SlotInfo *slot,CK_MECHANISM_TYPE type, - SECItem *param, int keySize,void *wincx); -PK11SymKey *PK11_TokenKeyGen(PK11SlotInfo *slot, CK_MECHANISM_TYPE type, - SECItem *param, int keySize, SECItem *keyid, - PRBool isToken, void *wincx); -PK11SymKey *PK11_TokenKeyGenWithFlags(PK11SlotInfo *slot, - CK_MECHANISM_TYPE type, SECItem *param, - int keySize, SECItem *keyid, CK_FLAGS opFlags, - PK11AttrFlags attrFlags, void *wincx); -/* Generates a key using the exact template supplied by the caller. The other - * PK11_[Token]KeyGen mechanisms should be used instead of this one whenever - * they work because they include/exclude the CKA_VALUE_LEN template value - * based on the mechanism type as required by many tokens. - * - * keyGenType should be PK11_GetKeyGenWithSize(type, ) or it should - * be equal to type if PK11_GetKeyGenWithSize cannot be used (e.g. because - * pk11wrap does not know about the mechanisms). - */ -PK11SymKey *PK11_KeyGenWithTemplate(PK11SlotInfo *slot, CK_MECHANISM_TYPE type, - CK_MECHANISM_TYPE keyGenType, - SECItem *param, CK_ATTRIBUTE * attrs, - unsigned int attrsCount, void *wincx); -PK11SymKey * PK11_ListFixedKeysInSlot(PK11SlotInfo *slot, char *nickname, - void *wincx); -PK11SymKey *PK11_GetNextSymKey(PK11SymKey *symKey); -CK_KEY_TYPE PK11_GetSymKeyType(PK11SymKey *key); -CK_OBJECT_HANDLE PK11_GetSymKeyHandle(PK11SymKey *symKey); - - -/* - * PK11_SetSymKeyUserData - * sets generic user data on keys (usually a pointer to a data structure) - * that can later be retrieved by PK11_GetSymKeyUserData(). - * symKey - key where data will be set. - * data - data to be set. - * freefunc - function used to free the data. - * Setting user data on symKeys with existing user data already set will cause - * the existing user data to be freed before the new user data is set. - * Freeing user data is done by calling the user specified freefunc. - * If freefunc is NULL, the user data is assumed to be global or static an - * not freed. Passing NULL for user data to PK11_SetSymKeyUserData has the - * effect of freeing any existing user data, and clearing the user data - * pointer. If user data exists when the symKey is finally freed, that - * data will be freed with freefunc. - * - * Applications should only use this function on keys which the application - * has created directly, as there is only one user data value per key. - */ -void PK11_SetSymKeyUserData(PK11SymKey *symKey, void *data, - PK11FreeDataFunc freefunc); -/* PK11_GetSymKeyUserData - * retrieves generic user data which was set on a key by - * PK11_SetSymKeyUserData. - * symKey - key with data to be fetched - * - * If no data exists, or the data has been cleared, PK11_GetSymKeyUserData - * will return NULL. Returned data is still owned and managed by the SymKey, - * the caller should not free the data. - * - */ -void *PK11_GetSymKeyUserData(PK11SymKey *symKey); - -SECStatus PK11_PubWrapSymKey(CK_MECHANISM_TYPE type, SECKEYPublicKey *pubKey, - PK11SymKey *symKey, SECItem *wrappedKey); -SECStatus PK11_WrapSymKey(CK_MECHANISM_TYPE type, SECItem *params, - PK11SymKey *wrappingKey, PK11SymKey *symKey, SECItem *wrappedKey); -/* move a key to 'slot' optionally set the key attributes according to either - * operation or the flags and making the key permanent at the same time. - * If the key is moved to the same slot, operation and flags values are - * currently ignored */ -PK11SymKey *PK11_MoveSymKey(PK11SlotInfo *slot, CK_ATTRIBUTE_TYPE operation, - CK_FLAGS flags, PRBool perm, PK11SymKey *symKey); -/* - * derive a new key from the base key. - * PK11_Derive returns a key which can do exactly one operation, and is - * ephemeral (session key). - * PK11_DeriveWithFlags is the same as PK11_Derive, except you can use - * CKF_ flags to enable more than one operation. - * PK11_DeriveWithFlagsPerm is the same as PK11_DeriveWithFlags except you can - * (optionally) make the key permanent (token key). - */ -PK11SymKey *PK11_Derive(PK11SymKey *baseKey, CK_MECHANISM_TYPE mechanism, - SECItem *param, CK_MECHANISM_TYPE target, - CK_ATTRIBUTE_TYPE operation, int keySize); -PK11SymKey *PK11_DeriveWithFlags( PK11SymKey *baseKey, - CK_MECHANISM_TYPE derive, SECItem *param, CK_MECHANISM_TYPE target, - CK_ATTRIBUTE_TYPE operation, int keySize, CK_FLAGS flags); -PK11SymKey * PK11_DeriveWithFlagsPerm( PK11SymKey *baseKey, - CK_MECHANISM_TYPE derive, - SECItem *param, CK_MECHANISM_TYPE target, CK_ATTRIBUTE_TYPE operation, - int keySize, CK_FLAGS flags, PRBool isPerm); -PK11SymKey * -PK11_DeriveWithTemplate( PK11SymKey *baseKey, CK_MECHANISM_TYPE derive, - SECItem *param, CK_MECHANISM_TYPE target, CK_ATTRIBUTE_TYPE operation, - int keySize, CK_ATTRIBUTE *userAttr, unsigned int numAttrs, - PRBool isPerm); - - -PK11SymKey *PK11_PubDerive( SECKEYPrivateKey *privKey, - SECKEYPublicKey *pubKey, PRBool isSender, SECItem *randomA, SECItem *randomB, - CK_MECHANISM_TYPE derive, CK_MECHANISM_TYPE target, - CK_ATTRIBUTE_TYPE operation, int keySize,void *wincx) ; -PK11SymKey *PK11_PubDeriveWithKDF( SECKEYPrivateKey *privKey, - SECKEYPublicKey *pubKey, PRBool isSender, SECItem *randomA, SECItem *randomB, - CK_MECHANISM_TYPE derive, CK_MECHANISM_TYPE target, - CK_ATTRIBUTE_TYPE operation, int keySize, - CK_ULONG kdf, SECItem *sharedData, void *wincx); - -/* - * unwrap a new key with a symetric key. - * PK11_Unwrap returns a key which can do exactly one operation, and is - * ephemeral (session key). - * PK11_UnwrapWithFlags is the same as PK11_Unwrap, except you can use - * CKF_ flags to enable more than one operation. - * PK11_UnwrapWithFlagsPerm is the same as PK11_UnwrapWithFlags except you can - * (optionally) make the key permanent (token key). - */ -PK11SymKey *PK11_UnwrapSymKey(PK11SymKey *key, - CK_MECHANISM_TYPE wraptype, SECItem *param, SECItem *wrapppedKey, - CK_MECHANISM_TYPE target, CK_ATTRIBUTE_TYPE operation, int keySize); -PK11SymKey *PK11_UnwrapSymKeyWithFlags(PK11SymKey *wrappingKey, - CK_MECHANISM_TYPE wrapType, SECItem *param, SECItem *wrappedKey, - CK_MECHANISM_TYPE target, CK_ATTRIBUTE_TYPE operation, int keySize, - CK_FLAGS flags); -PK11SymKey * PK11_UnwrapSymKeyWithFlagsPerm(PK11SymKey *wrappingKey, - CK_MECHANISM_TYPE wrapType, - SECItem *param, SECItem *wrappedKey, - CK_MECHANISM_TYPE target, CK_ATTRIBUTE_TYPE operation, - int keySize, CK_FLAGS flags, PRBool isPerm); - -/* - * unwrap a new key with a private key. - * PK11_PubUnwrap returns a key which can do exactly one operation, and is - * ephemeral (session key). - * PK11_PubUnwrapWithFlagsPerm is the same as PK11_PubUnwrap except you can - * use * CKF_ flags to enable more than one operation, and optionally make - * the key permanent (token key). - */ -PK11SymKey *PK11_PubUnwrapSymKey(SECKEYPrivateKey *key, SECItem *wrapppedKey, - CK_MECHANISM_TYPE target, CK_ATTRIBUTE_TYPE operation, int keySize); -PK11SymKey * PK11_PubUnwrapSymKeyWithFlagsPerm(SECKEYPrivateKey *wrappingKey, - SECItem *wrappedKey, CK_MECHANISM_TYPE target, - CK_ATTRIBUTE_TYPE operation, int keySize, - CK_FLAGS flags, PRBool isPerm); -PK11SymKey *PK11_FindFixedKey(PK11SlotInfo *slot, CK_MECHANISM_TYPE type, - SECItem *keyID, void *wincx); -SECStatus PK11_DeleteTokenPrivateKey(SECKEYPrivateKey *privKey,PRBool force); -SECStatus PK11_DeleteTokenPublicKey(SECKEYPublicKey *pubKey); -SECStatus PK11_DeleteTokenSymKey(PK11SymKey *symKey); -SECStatus PK11_DeleteTokenCertAndKey(CERTCertificate *cert,void *wincx); -SECKEYPrivateKey * PK11_LoadPrivKey(PK11SlotInfo *slot, - SECKEYPrivateKey *privKey, SECKEYPublicKey *pubKey, - PRBool token, PRBool sensitive); -char * PK11_GetSymKeyNickname(PK11SymKey *symKey); -char * PK11_GetPrivateKeyNickname(SECKEYPrivateKey *privKey); -char * PK11_GetPublicKeyNickname(SECKEYPublicKey *pubKey); -SECStatus PK11_SetSymKeyNickname(PK11SymKey *symKey, const char *nickname); -SECStatus PK11_SetPrivateKeyNickname(SECKEYPrivateKey *privKey, - const char *nickname); -SECStatus PK11_SetPublicKeyNickname(SECKEYPublicKey *pubKey, - const char *nickname); - -/* size to hold key in bytes */ -unsigned int PK11_GetKeyLength(PK11SymKey *key); -/* size of actual secret parts of key in bits */ -/* algid is because RC4 strength is determined by the effective bits as well - * as the key bits */ -unsigned int PK11_GetKeyStrength(PK11SymKey *key,SECAlgorithmID *algid); -SECStatus PK11_ExtractKeyValue(PK11SymKey *symKey); -SECItem * PK11_GetKeyData(PK11SymKey *symKey); -PK11SlotInfo * PK11_GetSlotFromKey(PK11SymKey *symKey); -void *PK11_GetWindow(PK11SymKey *symKey); - -/* - * Explicitly set the key usage for the generated private key. - * - * This allows us to specify single use EC and RSA keys whose usage - * can be regulated by the underlying token. - * - * The underlying key usage is set using opFlags. opFlagsMask specifies - * which operations are specified by opFlags. For instance to turn encrypt - * on and signing off, opFlags would be CKF_ENCRYPT|CKF_DECRYPT and - * opFlagsMask would be CKF_ENCRYPT|CKF_DECRYPT|CKF_SIGN|CKF_VERIFY. You - * need to specify both the public and private key flags, - * PK11_GenerateKeyPairWithOpFlags will sort out the correct flag to the - * correct key type. Flags not specified in opFlagMask will be defaulted - * according to mechanism type and token capabilities. - */ -SECKEYPrivateKey *PK11_GenerateKeyPairWithOpFlags(PK11SlotInfo *slot, - CK_MECHANISM_TYPE type, void *param, SECKEYPublicKey **pubk, - PK11AttrFlags attrFlags, CK_FLAGS opFlags, CK_FLAGS opFlagsMask, - void *wincx); -/* - * The attrFlags is the logical OR of the PK11_ATTR_XXX bitflags. - * These flags apply to the private key. The PK11_ATTR_TOKEN, - * PK11_ATTR_SESSION, PK11_ATTR_MODIFIABLE, and PK11_ATTR_UNMODIFIABLE - * flags also apply to the public key. - */ -SECKEYPrivateKey *PK11_GenerateKeyPairWithFlags(PK11SlotInfo *slot, - CK_MECHANISM_TYPE type, void *param, SECKEYPublicKey **pubk, - PK11AttrFlags attrFlags, void *wincx); -SECKEYPrivateKey *PK11_GenerateKeyPair(PK11SlotInfo *slot, - CK_MECHANISM_TYPE type, void *param, SECKEYPublicKey **pubk, - PRBool isPerm, PRBool isSensitive, void *wincx); -SECKEYPrivateKey * PK11_FindPrivateKeyFromCert(PK11SlotInfo *slot, - CERTCertificate *cert, void *wincx); -SECKEYPrivateKey * PK11_FindKeyByAnyCert(CERTCertificate *cert, void *wincx); -SECKEYPrivateKey * PK11_FindKeyByKeyID(PK11SlotInfo *slot, SECItem *keyID, - void *wincx); -int PK11_GetPrivateModulusLen(SECKEYPrivateKey *key); - -SECStatus PK11_Decrypt(PK11SymKey *symkey, - CK_MECHANISM_TYPE mechanism, SECItem *param, - unsigned char *out, unsigned int *outLen, - unsigned int maxLen, - const unsigned char *enc, unsigned int encLen); -SECStatus PK11_Encrypt(PK11SymKey *symKey, - CK_MECHANISM_TYPE mechanism, SECItem *param, - unsigned char *out, unsigned int *outLen, - unsigned int maxLen, - const unsigned char *data, unsigned int dataLen); - -/* note: despite the name, this function takes a private key. */ -SECStatus PK11_PubDecryptRaw(SECKEYPrivateKey *key, - unsigned char *data, unsigned *outLen, - unsigned int maxLen, - const unsigned char *enc, unsigned encLen); -#define PK11_PrivDecryptRaw PK11_PubDecryptRaw -/* The encrypt function that complements the above decrypt function. */ -SECStatus PK11_PubEncryptRaw(SECKEYPublicKey *key, - unsigned char *enc, - const unsigned char *data, unsigned dataLen, - void *wincx); - -SECStatus PK11_PrivDecryptPKCS1(SECKEYPrivateKey *key, - unsigned char *data, unsigned *outLen, - unsigned int maxLen, - const unsigned char *enc, unsigned encLen); -/* The encrypt function that complements the above decrypt function. */ -SECStatus PK11_PubEncryptPKCS1(SECKEYPublicKey *key, - unsigned char *enc, - const unsigned char *data, unsigned dataLen, - void *wincx); - -SECStatus PK11_PrivDecrypt(SECKEYPrivateKey *key, - CK_MECHANISM_TYPE mechanism, SECItem *param, - unsigned char *out, unsigned int *outLen, - unsigned int maxLen, - const unsigned char *enc, unsigned int encLen); -SECStatus PK11_PubEncrypt(SECKEYPublicKey *key, - CK_MECHANISM_TYPE mechanism, SECItem *param, - unsigned char *out, unsigned int *outLen, - unsigned int maxLen, - const unsigned char *data, unsigned int dataLen, - void *wincx); - -SECStatus PK11_ImportPrivateKeyInfo(PK11SlotInfo *slot, - SECKEYPrivateKeyInfo *pki, SECItem *nickname, - SECItem *publicValue, PRBool isPerm, PRBool isPrivate, - unsigned int usage, void *wincx); -SECStatus PK11_ImportPrivateKeyInfoAndReturnKey(PK11SlotInfo *slot, - SECKEYPrivateKeyInfo *pki, SECItem *nickname, - SECItem *publicValue, PRBool isPerm, PRBool isPrivate, - unsigned int usage, SECKEYPrivateKey** privk, void *wincx); -SECStatus PK11_ImportDERPrivateKeyInfo(PK11SlotInfo *slot, - SECItem *derPKI, SECItem *nickname, - SECItem *publicValue, PRBool isPerm, PRBool isPrivate, - unsigned int usage, void *wincx); -SECStatus PK11_ImportDERPrivateKeyInfoAndReturnKey(PK11SlotInfo *slot, - SECItem *derPKI, SECItem *nickname, - SECItem *publicValue, PRBool isPerm, PRBool isPrivate, - unsigned int usage, SECKEYPrivateKey** privk, void *wincx); -SECStatus PK11_ImportEncryptedPrivateKeyInfo(PK11SlotInfo *slot, - SECKEYEncryptedPrivateKeyInfo *epki, SECItem *pwitem, - SECItem *nickname, SECItem *publicValue, PRBool isPerm, - PRBool isPrivate, KeyType type, - unsigned int usage, void *wincx); -SECStatus PK11_ImportEncryptedPrivateKeyInfoAndReturnKey(PK11SlotInfo *slot, - SECKEYEncryptedPrivateKeyInfo *epki, SECItem *pwitem, - SECItem *nickname, SECItem *publicValue, PRBool isPerm, - PRBool isPrivate, KeyType type, - unsigned int usage, SECKEYPrivateKey** privk, void *wincx); -SECItem *PK11_ExportDERPrivateKeyInfo(SECKEYPrivateKey *pk, void *wincx); -SECKEYPrivateKeyInfo *PK11_ExportPrivKeyInfo( - SECKEYPrivateKey *pk, void *wincx); -SECKEYPrivateKeyInfo *PK11_ExportPrivateKeyInfo( - CERTCertificate *cert, void *wincx); -SECKEYEncryptedPrivateKeyInfo *PK11_ExportEncryptedPrivKeyInfo( - PK11SlotInfo *slot, SECOidTag algTag, SECItem *pwitem, - SECKEYPrivateKey *pk, int iteration, void *wincx); -SECKEYEncryptedPrivateKeyInfo *PK11_ExportEncryptedPrivateKeyInfo( - PK11SlotInfo *slot, SECOidTag algTag, SECItem *pwitem, - CERTCertificate *cert, int iteration, void *wincx); -SECKEYPrivateKey *PK11_FindKeyByDERCert(PK11SlotInfo *slot, - CERTCertificate *cert, void *wincx); -SECKEYPublicKey *PK11_MakeKEAPubKey(unsigned char *data, int length); -SECStatus PK11_DigestKey(PK11Context *context, PK11SymKey *key); -PRBool PK11_VerifyKeyOK(PK11SymKey *key); -SECKEYPrivateKey *PK11_UnwrapPrivKey(PK11SlotInfo *slot, - PK11SymKey *wrappingKey, CK_MECHANISM_TYPE wrapType, - SECItem *param, SECItem *wrappedKey, SECItem *label, - SECItem *publicValue, PRBool token, PRBool sensitive, - CK_KEY_TYPE keyType, CK_ATTRIBUTE_TYPE *usage, int usageCount, - void *wincx); -SECStatus PK11_WrapPrivKey(PK11SlotInfo *slot, PK11SymKey *wrappingKey, - SECKEYPrivateKey *privKey, CK_MECHANISM_TYPE wrapType, - SECItem *param, SECItem *wrappedKey, void *wincx); -/* - * The caller of PK11_DEREncodePublicKey should free the returned SECItem with - * a SECITEM_FreeItem(..., PR_TRUE) call. - */ -SECItem* PK11_DEREncodePublicKey(SECKEYPublicKey *pubk); -PK11SymKey* PK11_CopySymKeyForSigning(PK11SymKey *originalKey, - CK_MECHANISM_TYPE mech); -SECKEYPrivateKeyList* PK11_ListPrivKeysInSlot(PK11SlotInfo *slot, - char *nickname, void *wincx); -SECKEYPublicKeyList* PK11_ListPublicKeysInSlot(PK11SlotInfo *slot, - char *nickname); -SECKEYPQGParams *PK11_GetPQGParamsFromPrivateKey(SECKEYPrivateKey *privKey); -/* deprecated */ -SECKEYPrivateKeyList* PK11_ListPrivateKeysInSlot(PK11SlotInfo *slot); - -PK11SymKey *PK11_ConvertSessionSymKeyToTokenSymKey(PK11SymKey *symk, - void *wincx); -SECKEYPrivateKey *PK11_ConvertSessionPrivKeyToTokenPrivKey( - SECKEYPrivateKey *privk, void* wincx); -SECKEYPrivateKey * PK11_CopyTokenPrivKeyToSessionPrivKey(PK11SlotInfo *destSlot, - SECKEYPrivateKey *privKey); - -/********************************************************************** - * Certs - **********************************************************************/ -SECItem *PK11_MakeIDFromPubKey(SECItem *pubKeyData); -SECStatus PK11_TraverseSlotCerts( - SECStatus(* callback)(CERTCertificate*,SECItem *,void *), - void *arg, void *wincx); -CERTCertificate * PK11_FindCertFromNickname(const char *nickname, void *wincx); -CERTCertList * PK11_FindCertsFromEmailAddress(const char *email, void *wincx); -CERTCertList * PK11_FindCertsFromNickname(const char *nickname, void *wincx); -CERTCertificate *PK11_GetCertFromPrivateKey(SECKEYPrivateKey *privKey); -SECStatus PK11_ImportCert(PK11SlotInfo *slot, CERTCertificate *cert, - CK_OBJECT_HANDLE key, const char *nickname, - PRBool includeTrust); -SECStatus PK11_ImportDERCert(PK11SlotInfo *slot, SECItem *derCert, - CK_OBJECT_HANDLE key, char *nickname, PRBool includeTrust); -PK11SlotInfo *PK11_ImportCertForKey(CERTCertificate *cert, - const char *nickname, void *wincx); -PK11SlotInfo *PK11_ImportDERCertForKey(SECItem *derCert, char *nickname, - void *wincx); -PK11SlotInfo *PK11_KeyForCertExists(CERTCertificate *cert, - CK_OBJECT_HANDLE *keyPtr, void *wincx); -PK11SlotInfo *PK11_KeyForDERCertExists(SECItem *derCert, - CK_OBJECT_HANDLE *keyPtr, void *wincx); -CERTCertificate * PK11_FindCertByIssuerAndSN(PK11SlotInfo **slot, - CERTIssuerAndSN *sn, void *wincx); -CERTCertificate * PK11_FindCertAndKeyByRecipientList(PK11SlotInfo **slot, - SEC_PKCS7RecipientInfo **array, SEC_PKCS7RecipientInfo **rip, - SECKEYPrivateKey**privKey, void *wincx); -int PK11_FindCertAndKeyByRecipientListNew(NSSCMSRecipient **recipientlist, - void *wincx); -SECStatus PK11_TraverseCertsForSubjectInSlot(CERTCertificate *cert, - PK11SlotInfo *slot, SECStatus(*callback)(CERTCertificate *, void *), - void *arg); -CERTCertificate *PK11_FindCertFromDERCert(PK11SlotInfo *slot, - CERTCertificate *cert, void *wincx); -CERTCertificate *PK11_FindCertFromDERCertItem(PK11SlotInfo *slot, - const SECItem *derCert, void *wincx); -SECStatus PK11_ImportCertForKeyToSlot(PK11SlotInfo *slot, CERTCertificate *cert, - char *nickname, PRBool addUsage, - void *wincx); -CERTCertificate *PK11_FindBestKEAMatch(CERTCertificate *serverCert,void *wincx); -PRBool PK11_FortezzaHasKEA(CERTCertificate *cert); -CK_OBJECT_HANDLE PK11_FindCertInSlot(PK11SlotInfo *slot, CERTCertificate *cert, - void *wincx); -SECStatus PK11_TraverseCertsForNicknameInSlot(SECItem *nickname, - PK11SlotInfo *slot, SECStatus(*callback)(CERTCertificate *, void *), - void *arg); -CERTCertList * PK11_ListCerts(PK11CertListType type, void *pwarg); -CERTCertList * PK11_ListCertsInSlot(PK11SlotInfo *slot); -CERTSignedCrl* PK11_ImportCRL(PK11SlotInfo * slot, SECItem *derCRL, char *url, - int type, void *wincx, PRInt32 importOptions, PLArenaPool* arena, PRInt32 decodeOptions); - -/********************************************************************** - * Sign/Verify - **********************************************************************/ - -/* - * Return the length in bytes of a signature generated with the - * private key. - * - * Return 0 or -1 on failure. (XXX Should we fix it to always return - * -1 on failure?) - */ -int PK11_SignatureLen(SECKEYPrivateKey *key); -PK11SlotInfo * PK11_GetSlotFromPrivateKey(SECKEYPrivateKey *key); -SECStatus PK11_Sign(SECKEYPrivateKey *key, SECItem *sig, - const SECItem *hash); -SECStatus PK11_SignWithSymKey(PK11SymKey *symKey, CK_MECHANISM_TYPE mechanism, - SECItem *param, SECItem *sig, const SECItem *data); -SECStatus PK11_VerifyRecover(SECKEYPublicKey *key, const SECItem *sig, - SECItem *dsig, void * wincx); -SECStatus PK11_Verify(SECKEYPublicKey *key, const SECItem *sig, - const SECItem *hash, void *wincx); - - - -/********************************************************************** - * Crypto Contexts - **********************************************************************/ -void PK11_DestroyContext(PK11Context *context, PRBool freeit); -PK11Context *PK11_CreateContextBySymKey(CK_MECHANISM_TYPE type, - CK_ATTRIBUTE_TYPE operation, PK11SymKey *symKey, SECItem *param); -PK11Context *PK11_CreateDigestContext(SECOidTag hashAlg); -PK11Context *PK11_CloneContext(PK11Context *old); -SECStatus PK11_DigestBegin(PK11Context *cx); -/* - * The output buffer 'out' must be big enough to hold the output of - * the hash algorithm 'hashAlg'. - */ -SECStatus PK11_HashBuf(SECOidTag hashAlg, unsigned char *out, - const unsigned char *in, PRInt32 len); -SECStatus PK11_DigestOp(PK11Context *context, const unsigned char *in, - unsigned len); -SECStatus PK11_CipherOp(PK11Context *context, unsigned char * out, int *outlen, - int maxout, const unsigned char *in, int inlen); -SECStatus PK11_Finalize(PK11Context *context); -SECStatus PK11_DigestFinal(PK11Context *context, unsigned char *data, - unsigned int *outLen, unsigned int length); -#define PK11_CipherFinal PK11_DigestFinal -SECStatus PK11_SaveContext(PK11Context *cx,unsigned char *save, - int *len, int saveLength); - -/* Save the context's state, with possible allocation. - * The caller may supply an already allocated buffer in preAllocBuf, - * with length pabLen. If the buffer is large enough for the context's - * state, it will receive the state. - * If the buffer is not large enough (or NULL), then a new buffer will - * be allocated with PORT_Alloc. - * In either case, the state will be returned as a buffer, and the length - * of the state will be given in *stateLen. - */ -unsigned char * -PK11_SaveContextAlloc(PK11Context *cx, - unsigned char *preAllocBuf, unsigned int pabLen, - unsigned int *stateLen); - -SECStatus PK11_RestoreContext(PK11Context *cx,unsigned char *save,int len); -SECStatus PK11_GenerateFortezzaIV(PK11SymKey *symKey,unsigned char *iv,int len); -void PK11_SetFortezzaHack(PK11SymKey *symKey) ; - - -/********************************************************************** - * PBE functions - **********************************************************************/ - -/* This function creates PBE parameters from the given inputs. The result - * can be used to create a password integrity key for PKCS#12, by sending - * the return value to PK11_KeyGen along with the appropriate mechanism. - */ -SECItem * -PK11_CreatePBEParams(SECItem *salt, SECItem *pwd, unsigned int iterations); - -/* free params created above (can be called after keygen is done */ -void PK11_DestroyPBEParams(SECItem *params); - -SECAlgorithmID * -PK11_CreatePBEAlgorithmID(SECOidTag algorithm, int iteration, SECItem *salt); - -/* use to create PKCS5 V2 algorithms with finder control than that provided - * by PK11_CreatePBEAlgorithmID. */ -SECAlgorithmID * -PK11_CreatePBEV2AlgorithmID(SECOidTag pbeAlgTag, SECOidTag cipherAlgTag, - SECOidTag prfAlgTag, int keyLength, int iteration, - SECItem *salt); -PK11SymKey * -PK11_PBEKeyGen(PK11SlotInfo *slot, SECAlgorithmID *algid, SECItem *pwitem, - PRBool faulty3DES, void *wincx); - -/* warning: cannot work with PKCS 5 v2 use PK11_PBEKeyGen instead */ -PK11SymKey * -PK11_RawPBEKeyGen(PK11SlotInfo *slot, CK_MECHANISM_TYPE type, SECItem *params, - SECItem *pwitem, PRBool faulty3DES, void *wincx); -SECItem * -PK11_GetPBEIV(SECAlgorithmID *algid, SECItem *pwitem); -/* - * Get the Mechanism and parameter of the base encryption or mac scheme from - * a PBE algorithm ID. - * Caller is responsible for freeing the return parameter (param). - */ -CK_MECHANISM_TYPE -PK11_GetPBECryptoMechanism(SECAlgorithmID *algid, - SECItem **param, SECItem *pwd); - -/********************************************************************** - * Functions to manage secmod flags - **********************************************************************/ -PK11DefaultArrayEntry *PK11_GetDefaultArray(int *size); -SECStatus PK11_UpdateSlotAttribute(PK11SlotInfo *slot, - const PK11DefaultArrayEntry *entry, - PRBool add); - -/********************************************************************** - * Functions to look at PKCS #11 dependent data - **********************************************************************/ -PK11GenericObject *PK11_FindGenericObjects(PK11SlotInfo *slot, - CK_OBJECT_CLASS objClass); -PK11GenericObject *PK11_GetNextGenericObject(PK11GenericObject *object); -PK11GenericObject *PK11_GetPrevGenericObject(PK11GenericObject *object); -SECStatus PK11_UnlinkGenericObject(PK11GenericObject *object); -SECStatus PK11_LinkGenericObject(PK11GenericObject *list, - PK11GenericObject *object); -SECStatus PK11_DestroyGenericObjects(PK11GenericObject *object); -SECStatus PK11_DestroyGenericObject(PK11GenericObject *object); -PK11GenericObject *PK11_CreateGenericObject(PK11SlotInfo *slot, - const CK_ATTRIBUTE *pTemplate, - int count, PRBool token); - -/* - * PK11_ReadRawAttribute and PK11_WriteRawAttribute are generic - * functions to read and modify the actual PKCS #11 attributes of - * the underlying pkcs #11 object. - * - * object is a pointer to an NSS object that represents the underlying - * PKCS #11 object. It's type must match the type of PK11ObjectType - * as follows: - * - * type object - * PK11_TypeGeneric PK11GenericObject * - * PK11_TypePrivKey SECKEYPrivateKey * - * PK11_TypePubKey SECKEYPublicKey * - * PK11_TypeSymKey PK11SymKey * - * - * All other types are considered invalid. If type does not match the object - * passed, unpredictable results will occur. - * - * PK11_ReadRawAttribute allocates the buffer for returning the attribute - * value. The caller of PK11_ReadRawAttribute should free the data buffer - * pointed to by item using a SECITEM_FreeItem(item, PR_FALSE) or - * PORT_Free(item->data) call. - */ -SECStatus PK11_ReadRawAttribute(PK11ObjectType type, void *object, - CK_ATTRIBUTE_TYPE attr, SECItem *item); -SECStatus PK11_WriteRawAttribute(PK11ObjectType type, void *object, - CK_ATTRIBUTE_TYPE attr, SECItem *item); - -/* - * PK11_GetAllSlotsForCert returns all the slots that a given certificate - * exists on, since it's possible for a cert to exist on more than one - * PKCS#11 token. - */ -PK11SlotList * -PK11_GetAllSlotsForCert(CERTCertificate *cert, void *arg); - -/********************************************************************** - * New functions which are already deprecated.... - **********************************************************************/ -SECItem * -PK11_GetLowLevelKeyIDForCert(PK11SlotInfo *slot, - CERTCertificate *cert, void *pwarg); -SECItem * -PK11_GetLowLevelKeyIDForPrivateKey(SECKEYPrivateKey *key); - -PRBool SECMOD_HasRootCerts(void); - -SEC_END_PROTOS - -#endif diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/pk11sdr.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/pk11sdr.h deleted file mode 100755 index 0ffa425..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/pk11sdr.h +++ /dev/null @@ -1,28 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef _PK11SDR_H_ -#define _PK11SDR_H_ - -#include "seccomon.h" - -SEC_BEGIN_PROTOS - -/* - * PK11SDR_Encrypt - encrypt data using the specified key id or SDR default - * result should be freed with SECItem_ZfreeItem - */ -SECStatus -PK11SDR_Encrypt(SECItem *keyid, SECItem *data, SECItem *result, void *cx); - -/* - * PK11SDR_Decrypt - decrypt data previously encrypted with PK11SDR_Encrypt - * result should be freed with SECItem_ZfreeItem - */ -SECStatus -PK11SDR_Decrypt(SECItem *data, SECItem *result, void *cx); - -SEC_END_PROTOS - -#endif diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/secmod.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/secmod.h deleted file mode 100755 index 0557334..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/secmod.h +++ /dev/null @@ -1,164 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef _SECMOD_H_ -#define _SECMOD_H_ -#include "seccomon.h" -#include "secmodt.h" -#include "prinrval.h" - -/* These mechanisms flags are visible to all other libraries. */ -/* They must be converted to internal SECMOD_*_FLAG */ -/* if used inside the functions of the security library */ -#define PUBLIC_MECH_RSA_FLAG 0x00000001ul -#define PUBLIC_MECH_DSA_FLAG 0x00000002ul -#define PUBLIC_MECH_RC2_FLAG 0x00000004ul -#define PUBLIC_MECH_RC4_FLAG 0x00000008ul -#define PUBLIC_MECH_DES_FLAG 0x00000010ul -#define PUBLIC_MECH_DH_FLAG 0x00000020ul -#define PUBLIC_MECH_FORTEZZA_FLAG 0x00000040ul -#define PUBLIC_MECH_RC5_FLAG 0x00000080ul -#define PUBLIC_MECH_SHA1_FLAG 0x00000100ul -#define PUBLIC_MECH_MD5_FLAG 0x00000200ul -#define PUBLIC_MECH_MD2_FLAG 0x00000400ul -#define PUBLIC_MECH_SSL_FLAG 0x00000800ul -#define PUBLIC_MECH_TLS_FLAG 0x00001000ul -#define PUBLIC_MECH_AES_FLAG 0x00002000ul -#define PUBLIC_MECH_SHA256_FLAG 0x00004000ul -#define PUBLIC_MECH_SHA512_FLAG 0x00008000ul -#define PUBLIC_MECH_CAMELLIA_FLAG 0x00010000ul -#define PUBLIC_MECH_SEED_FLAG 0x00020000ul - -#define PUBLIC_MECH_RANDOM_FLAG 0x08000000ul -#define PUBLIC_MECH_FRIENDLY_FLAG 0x10000000ul -#define PUBLIC_OWN_PW_DEFAULTS 0X20000000ul -#define PUBLIC_DISABLE_FLAG 0x40000000ul - -/* warning: reserved means reserved */ -#define PUBLIC_MECH_RESERVED_FLAGS 0x87FF0000ul - -/* These cipher flags are visible to all other libraries, */ -/* But they must be converted before used in functions */ -/* withing the security module */ -#define PUBLIC_CIPHER_FORTEZZA_FLAG 0x00000001ul - -/* warning: reserved means reserved */ -#define PUBLIC_CIPHER_RESERVED_FLAGS 0xFFFFFFFEul - -SEC_BEGIN_PROTOS - -/* - * the following functions are going to be deprecated in NSS 4.0 in - * favor of the new stan functions. - */ - -/* Initialization */ -extern SECMODModule *SECMOD_LoadModule(char *moduleSpec,SECMODModule *parent, - PRBool recurse); - -extern SECMODModule *SECMOD_LoadUserModule(char *moduleSpec,SECMODModule *parent, - PRBool recurse); - -SECStatus SECMOD_UnloadUserModule(SECMODModule *mod); - -SECMODModule * SECMOD_CreateModule(const char *lib, const char *name, - const char *param, const char *nss); -/* - * After a fork(), PKCS #11 says we need to call C_Initialize again in - * the child before we can use the module. This function causes this - * reinitialization. - * NOTE: Any outstanding handles will become invalid, which means your - * keys and contexts will fail, but new ones can be created. - * - * Setting 'force' to true means to do the reinitialization even if the - * PKCS #11 module does not seem to need it. This allows software modules - * which ignore fork to preserve their keys across the fork(). - */ -SECStatus SECMOD_RestartModules(PRBool force); - - -/* Module Management */ -char **SECMOD_GetModuleSpecList(SECMODModule *module); -SECStatus SECMOD_FreeModuleSpecList(SECMODModule *module,char **moduleSpecList); - - -/* protoypes */ -/* Get a list of active PKCS #11 modules */ -extern SECMODModuleList *SECMOD_GetDefaultModuleList(void); -/* Get a list of defined but not loaded PKCS #11 modules */ -extern SECMODModuleList *SECMOD_GetDeadModuleList(void); -/* Get a list of Modules which define PKCS #11 modules to load */ -extern SECMODModuleList *SECMOD_GetDBModuleList(void); - -/* lock to protect all three module lists above */ -extern SECMODListLock *SECMOD_GetDefaultModuleListLock(void); - -extern SECStatus SECMOD_UpdateModule(SECMODModule *module); - -/* lock management */ -extern void SECMOD_GetReadLock(SECMODListLock *); -extern void SECMOD_ReleaseReadLock(SECMODListLock *); - -/* Operate on modules by name */ -extern SECMODModule *SECMOD_FindModule(const char *name); -extern SECStatus SECMOD_DeleteModule(const char *name, int *type); -extern SECStatus SECMOD_DeleteModuleEx(const char * name, - SECMODModule *mod, - int *type, - PRBool permdb); -extern SECStatus SECMOD_DeleteInternalModule(const char *name); -extern PRBool SECMOD_CanDeleteInternalModule(void); -extern SECStatus SECMOD_AddNewModule(const char* moduleName, - const char* dllPath, - unsigned long defaultMechanismFlags, - unsigned long cipherEnableFlags); -extern SECStatus SECMOD_AddNewModuleEx(const char* moduleName, - const char* dllPath, - unsigned long defaultMechanismFlags, - unsigned long cipherEnableFlags, - char* modparms, - char* nssparms); - -/* database/memory management */ -extern SECMODModule *SECMOD_GetInternalModule(void); -extern SECMODModule *SECMOD_ReferenceModule(SECMODModule *module); -extern void SECMOD_DestroyModule(SECMODModule *module); -extern PK11SlotInfo *SECMOD_LookupSlot(SECMODModuleID module, - unsigned long slotID); -extern PK11SlotInfo *SECMOD_FindSlot(SECMODModule *module,const char *name); - -/* Funtion reports true if at least one of the modules */ -/* of modType has been installed */ -PRBool SECMOD_IsModulePresent( unsigned long int pubCipherEnableFlags ); - -/* accessors */ -PRBool SECMOD_GetSkipFirstFlag(SECMODModule *mod); -PRBool SECMOD_GetDefaultModDBFlag(SECMODModule *mod); - -/* Functions used to convert between internal & public representation - * of Mechanism Flags and Cipher Enable Flags */ -extern unsigned long SECMOD_PubMechFlagstoInternal(unsigned long publicFlags); -extern unsigned long SECMOD_PubCipherFlagstoInternal(unsigned long publicFlags); - -PRBool SECMOD_HasRemovableSlots(SECMODModule *mod); -PK11SlotInfo *SECMOD_WaitForAnyTokenEvent(SECMODModule *mod, - unsigned long flags, PRIntervalTime latency); -/* - * Warning: the SECMOD_CancelWait function is highly destructive, potentially - * finalizing the module 'mod' (causing inprogress operations to fail, - * and session key material to disappear). It should only be called when - * shutting down the module. - */ -SECStatus SECMOD_CancelWait(SECMODModule *mod); -/* - * check to see if the module has added new slots. PKCS 11 v2.20 allows for - * modules to add new slots, but never remove them. Slots not be added between - * a call to C_GetSlotLlist(Flag, NULL, &count) and the corresponding - * C_GetSlotList(flag, &data, &count) so that the array doesn't accidently - * grow on the caller. It is permissible for the slots to increase between - * corresponding calls with NULL to get the size. - */ -SECStatus SECMOD_UpdateSlotList(SECMODModule *mod); -SEC_END_PROTOS - -#endif diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/secmodi.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/secmodi.h deleted file mode 100755 index 4a86756..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/secmodi.h +++ /dev/null @@ -1,172 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/* - * Internal header file included only by files in pkcs11 dir, or in - * pkcs11 specific client and server files. - */ -#ifndef _SECMODI_H_ -#define _SECMODI_H_ 1 -#include "pkcs11.h" -#include "nssilock.h" -#include "secoidt.h" -#include "secdert.h" -#include "certt.h" -#include "secmodt.h" -#include "keyt.h" - -SEC_BEGIN_PROTOS - -/* proto-types */ -extern SECStatus SECMOD_DeletePermDB(SECMODModule *module); -extern SECStatus SECMOD_AddPermDB(SECMODModule *module); -extern SECStatus SECMOD_Shutdown(void); -void nss_DumpModuleLog(void); - -extern int secmod_PrivateModuleCount; - -extern void SECMOD_Init(void); -SECStatus secmod_ModuleInit(SECMODModule *mod, SECMODModule **oldModule, - PRBool* alreadyLoaded); - -/* list managment */ -extern SECStatus SECMOD_AddModuleToList(SECMODModule *newModule); -extern SECStatus SECMOD_AddModuleToDBOnlyList(SECMODModule *newModule); -extern SECStatus SECMOD_AddModuleToUnloadList(SECMODModule *newModule); -extern void SECMOD_RemoveList(SECMODModuleList **,SECMODModuleList *); -extern void SECMOD_AddList(SECMODModuleList *,SECMODModuleList *,SECMODListLock *); -extern SECMODListLock *SECMOD_NewListLock(void); -extern void SECMOD_DestroyListLock(SECMODListLock *); -extern void SECMOD_GetWriteLock(SECMODListLock *); -extern void SECMOD_ReleaseWriteLock(SECMODListLock *); - -/* Operate on modules by name */ -extern SECMODModule *SECMOD_FindModuleByID(SECMODModuleID); -extern SECMODModule *secmod_FindModuleByFuncPtr(void *funcPtr); - -/* database/memory management */ -extern SECMODModuleList *SECMOD_NewModuleListElement(void); -extern SECMODModuleList *SECMOD_DestroyModuleListElement(SECMODModuleList *); -extern void SECMOD_DestroyModuleList(SECMODModuleList *); -extern SECStatus SECMOD_AddModule(SECMODModule *newModule); - -extern unsigned long SECMOD_InternaltoPubMechFlags(unsigned long internalFlags); -extern unsigned long SECMOD_InternaltoPubCipherFlags(unsigned long internalFlags); - -/* Library functions */ -SECStatus secmod_LoadPKCS11Module(SECMODModule *, SECMODModule **oldModule); -SECStatus SECMOD_UnloadModule(SECMODModule *); -void SECMOD_SetInternalModule(SECMODModule *); -PRBool secmod_IsInternalKeySlot(SECMODModule *); -void secmod_SetInternalKeySlotFlag(SECMODModule *mod, PRBool val); - - -/* tools for checking if we are loading the same database twice */ -typedef struct SECMODConfigListStr SECMODConfigList; -/* collect all the databases in a given spec */ -SECMODConfigList *secmod_GetConfigList(PRBool isFIPS, char *spec, int *count); -/* see is a spec matches a database on the list */ -PRBool secmod_MatchConfigList(char *spec, - SECMODConfigList *conflist, int count); -/* free our list of databases */ -void secmod_FreeConfigList(SECMODConfigList *conflist, int count); - -/* parsing parameters */ -/* returned char * must be freed by caller with PORT_Free */ -/* children and ids are null terminated arrays which must be freed with - * secmod_FreeChildren */ -char *secmod_ParseModuleSpecForTokens(PRBool convert, - PRBool isFIPS, - char *moduleSpec, - char ***children, - CK_SLOT_ID **ids); -void secmod_FreeChildren(char **children, CK_SLOT_ID *ids); -char *secmod_MkAppendTokensList(PLArenaPool *arena, char *origModuleSpec, - char *newModuleSpec, CK_SLOT_ID newID, - char **children, CK_SLOT_ID *ids); - - -void SECMOD_SlotDestroyModule(SECMODModule *module, PRBool fromSlot); -CK_RV pk11_notify(CK_SESSION_HANDLE session, CK_NOTIFICATION event, - CK_VOID_PTR pdata); -void pk11_SignedToUnsigned(CK_ATTRIBUTE *attrib); -CK_OBJECT_HANDLE pk11_FindObjectByTemplate(PK11SlotInfo *slot, - CK_ATTRIBUTE *inTemplate,int tsize); -CK_OBJECT_HANDLE *pk11_FindObjectsByTemplate(PK11SlotInfo *slot, - CK_ATTRIBUTE *inTemplate,int tsize, int *objCount); - -#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_PTR)((x)->functionList)) -#define PK11_SETATTRS(x,id,v,l) (x)->type = (id); \ - (x)->pValue=(v); (x)->ulValueLen = (l); -SECStatus PK11_CreateNewObject(PK11SlotInfo *slot, CK_SESSION_HANDLE session, - const CK_ATTRIBUTE *theTemplate, int count, - PRBool token, CK_OBJECT_HANDLE *objectID); - -SECStatus pbe_PK11AlgidToParam(SECAlgorithmID *algid,SECItem *mech); -SECStatus PBE_PK11ParamToAlgid(SECOidTag algTag, SECItem *param, - PLArenaPool *arena, SECAlgorithmID *algId); - -PK11SymKey *pk11_TokenKeyGenWithFlagsAndKeyType(PK11SlotInfo *slot, - CK_MECHANISM_TYPE type, SECItem *param, CK_KEY_TYPE keyType, - int keySize, SECItem *keyId, CK_FLAGS opFlags, - PK11AttrFlags attrFlags, void *wincx); - -CK_MECHANISM_TYPE pk11_GetPBECryptoMechanism(SECAlgorithmID *algid, - SECItem **param, SECItem *pwd, PRBool faulty3DES); - - - -extern void pk11sdr_Init(void); -extern void pk11sdr_Shutdown(void); - -/* - * Private to pk11wrap. - */ - -PRBool pk11_LoginStillRequired(PK11SlotInfo *slot, void *wincx); -CK_SESSION_HANDLE pk11_GetNewSession(PK11SlotInfo *slot, PRBool *owner); -void pk11_CloseSession(PK11SlotInfo *slot, CK_SESSION_HANDLE sess, PRBool own); -PK11SymKey *pk11_ForceSlot(PK11SymKey *symKey, CK_MECHANISM_TYPE type, - CK_ATTRIBUTE_TYPE operation); -/* Convert key operation flags to PKCS #11 attributes. */ -unsigned int pk11_OpFlagsToAttributes(CK_FLAGS flags, - CK_ATTRIBUTE *attrs, CK_BBOOL *ckTrue); -/* Check for bad (conflicting) attribute flags */ -PRBool pk11_BadAttrFlags(PK11AttrFlags attrFlags); -/* Convert key attribute flags to PKCS #11 attributes. */ -unsigned int pk11_AttrFlagsToAttributes(PK11AttrFlags attrFlags, - CK_ATTRIBUTE *attrs, CK_BBOOL *ckTrue, CK_BBOOL *ckFalse); -PRBool pk11_FindAttrInTemplate(CK_ATTRIBUTE *attr, unsigned int numAttrs, - CK_ATTRIBUTE_TYPE target); - -CK_MECHANISM_TYPE pk11_mapWrapKeyType(KeyType keyType); -PK11SymKey *pk11_KeyExchange(PK11SlotInfo *slot, CK_MECHANISM_TYPE type, - CK_ATTRIBUTE_TYPE operation, CK_FLAGS flags, PRBool isPerm, - PK11SymKey *symKey); - -PRBool pk11_HandleTrustObject(PK11SlotInfo *slot, CERTCertificate *cert, - CERTCertTrust *trust); -CK_OBJECT_HANDLE pk11_FindPubKeyByAnyCert(CERTCertificate *cert, - PK11SlotInfo **slot, void *wincx); -SECStatus pk11_AuthenticateUnfriendly(PK11SlotInfo *slot, PRBool loadCerts, - void *wincx); -int PK11_NumberObjectsFor(PK11SlotInfo *slot, CK_ATTRIBUTE *findTemplate, - int templateCount); -SECItem *pk11_GetLowLevelKeyFromHandle(PK11SlotInfo *slot, - CK_OBJECT_HANDLE handle); -SECStatus PK11_TraverseSlot(PK11SlotInfo *slot, void *arg); -CK_OBJECT_HANDLE pk11_FindPrivateKeyFromCertID(PK11SlotInfo *slot, - SECItem *keyID); -SECKEYPrivateKey *PK11_MakePrivKey(PK11SlotInfo *slot, KeyType keyType, - PRBool isTemp, CK_OBJECT_HANDLE privID, void *wincx); -CERTCertificate *PK11_MakeCertFromHandle(PK11SlotInfo *slot, - CK_OBJECT_HANDLE certID, CK_ATTRIBUTE *privateLabel); - -SECItem *pk11_GenerateNewParamWithKeyLen(CK_MECHANISM_TYPE type, int keyLen); -SECItem *pk11_ParamFromIVWithLen(CK_MECHANISM_TYPE type, - SECItem *iv, int keyLen); - -SEC_END_PROTOS - -#endif - diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/secmodt.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/secmodt.h deleted file mode 100755 index 73d2a7e..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/secmodt.h +++ /dev/null @@ -1,448 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef _SECMODT_H_ -#define _SECMODT_H_ 1 - -#include "nssrwlkt.h" -#include "nssilckt.h" -#include "secoid.h" -#include "secasn1.h" -#include "pkcs11t.h" -#include "utilmodt.h" - -SEC_BEGIN_PROTOS - -/* find a better home for these... */ -extern const SEC_ASN1Template SECKEY_PointerToEncryptedPrivateKeyInfoTemplate[]; -SEC_ASN1_CHOOSER_DECLARE(SECKEY_PointerToEncryptedPrivateKeyInfoTemplate) -extern const SEC_ASN1Template SECKEY_EncryptedPrivateKeyInfoTemplate[]; -SEC_ASN1_CHOOSER_DECLARE(SECKEY_EncryptedPrivateKeyInfoTemplate) -extern const SEC_ASN1Template SECKEY_PrivateKeyInfoTemplate[]; -SEC_ASN1_CHOOSER_DECLARE(SECKEY_PrivateKeyInfoTemplate) -extern const SEC_ASN1Template SECKEY_PointerToPrivateKeyInfoTemplate[]; -SEC_ASN1_CHOOSER_DECLARE(SECKEY_PointerToPrivateKeyInfoTemplate) - -SEC_END_PROTOS - -/* PKCS11 needs to be included */ -typedef struct SECMODModuleStr SECMODModule; -typedef struct SECMODModuleListStr SECMODModuleList; -typedef NSSRWLock SECMODListLock; -typedef struct PK11SlotInfoStr PK11SlotInfo; /* defined in secmodti.h */ -typedef struct NSSUTILPreSlotInfoStr PK11PreSlotInfo; /* defined in secmodti.h */ -typedef struct PK11SymKeyStr PK11SymKey; /* defined in secmodti.h */ -typedef struct PK11ContextStr PK11Context; /* defined in secmodti.h */ -typedef struct PK11SlotListStr PK11SlotList; -typedef struct PK11SlotListElementStr PK11SlotListElement; -typedef struct PK11RSAGenParamsStr PK11RSAGenParams; -typedef unsigned long SECMODModuleID; -typedef struct PK11DefaultArrayEntryStr PK11DefaultArrayEntry; -typedef struct PK11GenericObjectStr PK11GenericObject; -typedef void (*PK11FreeDataFunc)(void *); - -struct SECMODModuleStr { - PLArenaPool *arena; - PRBool internal; /* true of internally linked modules, false - * for the loaded modules */ - PRBool loaded; /* Set to true if module has been loaded */ - PRBool isFIPS; /* Set to true if module is finst internal */ - char *dllName; /* name of the shared library which implements - * this module */ - char *commonName; /* name of the module to display to the user */ - void *library; /* pointer to the library. opaque. used only by - * pk11load.c */ - void *functionList; /* The PKCS #11 function table */ - PZLock *refLock; /* only used pk11db.c */ - int refCount; /* Module reference count */ - PK11SlotInfo **slots; /* array of slot points attached to this mod*/ - int slotCount; /* count of slot in above array */ - PK11PreSlotInfo *slotInfo; /* special info about slots default settings */ - int slotInfoCount; /* count */ - SECMODModuleID moduleID; /* ID so we can find this module again */ - PRBool isThreadSafe; - unsigned long ssl[2]; /* SSL cipher enable flags */ - char *libraryParams; /* Module specific parameters */ - void *moduleDBFunc; /* function to return module configuration data*/ - SECMODModule *parent; /* module that loaded us */ - PRBool isCritical; /* This module must load successfully */ - PRBool isModuleDB; /* this module has lists of PKCS #11 modules */ - PRBool moduleDBOnly; /* this module only has lists of PKCS #11 modules */ - int trustOrder; /* order for this module's certificate trust rollup */ - int cipherOrder; /* order for cipher operations */ - unsigned long evControlMask; /* control the running and shutdown of slot - * events (SECMOD_WaitForAnyTokenEvent) */ - CK_VERSION cryptokiVersion; /* version of this library */ -}; - -/* evControlMask flags */ -/* - * These bits tell the current state of a SECMOD_WaitForAnyTokenEvent. - * - * SECMOD_WAIT_PKCS11_EVENT - we're waiting in the PKCS #11 module in - * C_WaitForSlotEvent(). - * SECMOD_WAIT_SIMULATED_EVENT - we're waiting in the NSS simulation code - * which polls for token insertion and removal events. - * SECMOD_END_WAIT - SECMOD_CancelWait has been called while the module is - * waiting in SECMOD_WaitForAnyTokenEvent. SECMOD_WaitForAnyTokenEvent - * should return immediately to it's caller. - */ -#define SECMOD_END_WAIT 0x01 -#define SECMOD_WAIT_SIMULATED_EVENT 0x02 -#define SECMOD_WAIT_PKCS11_EVENT 0x04 - -struct SECMODModuleListStr { - SECMODModuleList *next; - SECMODModule *module; -}; - -struct PK11SlotListStr { - PK11SlotListElement *head; - PK11SlotListElement *tail; - PZLock *lock; -}; - -struct PK11SlotListElementStr { - PK11SlotListElement *next; - PK11SlotListElement *prev; - PK11SlotInfo *slot; - int refCount; -}; - -struct PK11RSAGenParamsStr { - int keySizeInBits; - unsigned long pe; -}; - -typedef enum { - PK11CertListUnique = 0, /* get one instance of all certs */ - PK11CertListUser = 1, /* get all instances of user certs */ - PK11CertListRootUnique = 2, /* get one instance of CA certs without a private key. - * deprecated. Use PK11CertListCAUnique - */ - PK11CertListCA = 3, /* get all instances of CA certs */ - PK11CertListCAUnique = 4, /* get one instance of CA certs */ - PK11CertListUserUnique = 5, /* get one instance of user certs */ - PK11CertListAll = 6 /* get all instances of all certs */ -} PK11CertListType; - -/* - * Entry into the Array which lists all the legal bits for the default flags - * in the slot, their definition, and the PKCS #11 mechanism the represent - * Always Statically allocated. - */ -struct PK11DefaultArrayEntryStr { - char *name; - unsigned long flag; - unsigned long mechanism; /* this is a long so we don't include the - * whole pkcs 11 world to use this header */ -}; - -/* - * PK11AttrFlags - * - * A 32-bit bitmask of PK11_ATTR_XXX flags - */ -typedef PRUint32 PK11AttrFlags; - -/* - * PK11_ATTR_XXX - * - * The following PK11_ATTR_XXX bitflags are used to specify - * PKCS #11 object attributes that have Boolean values. Some NSS - * functions have a "PK11AttrFlags attrFlags" parameter whose value - * is the logical OR of these bitflags. NSS use these bitflags on - * private keys or secret keys. Some of these bitflags also apply - * to the public keys associated with the private keys. - * - * For each PKCS #11 object attribute, we need two bitflags to - * specify not only "true" and "false" but also "default". For - * example, PK11_ATTR_PRIVATE and PK11_ATTR_PUBLIC control the - * CKA_PRIVATE attribute. If PK11_ATTR_PRIVATE is set, we add - * { CKA_PRIVATE, &cktrue, sizeof(CK_BBOOL) } - * to the template. If PK11_ATTR_PUBLIC is set, we add - * { CKA_PRIVATE, &ckfalse, sizeof(CK_BBOOL) } - * to the template. If neither flag is set, we don't add any - * CKA_PRIVATE entry to the template. - */ - -/* - * Attributes for PKCS #11 storage objects, which include not only - * keys but also certificates and domain parameters. - */ - -/* - * PK11_ATTR_TOKEN - * PK11_ATTR_SESSION - * - * These two flags determine whether the object is a token or - * session object. - * - * These two flags are related and cannot both be set. - * If the PK11_ATTR_TOKEN flag is set, the object is a token - * object. If the PK11_ATTR_SESSION flag is set, the object is - * a session object. If neither flag is set, the object is *by - * default* a session object. - * - * These two flags specify the value of the PKCS #11 CKA_TOKEN - * attribute. - */ -#define PK11_ATTR_TOKEN 0x00000001L -#define PK11_ATTR_SESSION 0x00000002L - -/* - * PK11_ATTR_PRIVATE - * PK11_ATTR_PUBLIC - * - * These two flags determine whether the object is a private or - * public object. A user may not access a private object until the - * user has authenticated to the token. - * - * These two flags are related and cannot both be set. - * If the PK11_ATTR_PRIVATE flag is set, the object is a private - * object. If the PK11_ATTR_PUBLIC flag is set, the object is a - * public object. If neither flag is set, it is token-specific - * whether the object is private or public. - * - * These two flags specify the value of the PKCS #11 CKA_PRIVATE - * attribute. NSS only uses this attribute on private and secret - * keys, so public keys created by NSS get the token-specific - * default value of the CKA_PRIVATE attribute. - */ -#define PK11_ATTR_PRIVATE 0x00000004L -#define PK11_ATTR_PUBLIC 0x00000008L - -/* - * PK11_ATTR_MODIFIABLE - * PK11_ATTR_UNMODIFIABLE - * - * These two flags determine whether the object is modifiable or - * read-only. - * - * These two flags are related and cannot both be set. - * If the PK11_ATTR_MODIFIABLE flag is set, the object can be - * modified. If the PK11_ATTR_UNMODIFIABLE flag is set, the object - * is read-only. If neither flag is set, the object is *by default* - * modifiable. - * - * These two flags specify the value of the PKCS #11 CKA_MODIFIABLE - * attribute. - */ -#define PK11_ATTR_MODIFIABLE 0x00000010L -#define PK11_ATTR_UNMODIFIABLE 0x00000020L - -/* Attributes for PKCS #11 key objects. */ - -/* - * PK11_ATTR_SENSITIVE - * PK11_ATTR_INSENSITIVE - * - * These two flags are related and cannot both be set. - * If the PK11_ATTR_SENSITIVE flag is set, the key is sensitive. - * If the PK11_ATTR_INSENSITIVE flag is set, the key is not - * sensitive. If neither flag is set, it is token-specific whether - * the key is sensitive or not. - * - * If a key is sensitive, certain attributes of the key cannot be - * revealed in plaintext outside the token. - * - * This flag specifies the value of the PKCS #11 CKA_SENSITIVE - * attribute. Although the default value of the CKA_SENSITIVE - * attribute for secret keys is CK_FALSE per PKCS #11, some FIPS - * tokens set the default value to CK_TRUE because only CK_TRUE - * is allowed. So in practice the default value of this attribute - * is token-specific, hence the need for two bitflags. - */ -#define PK11_ATTR_SENSITIVE 0x00000040L -#define PK11_ATTR_INSENSITIVE 0x00000080L - -/* - * PK11_ATTR_EXTRACTABLE - * PK11_ATTR_UNEXTRACTABLE - * - * These two flags are related and cannot both be set. - * If the PK11_ATTR_EXTRACTABLE flag is set, the key is extractable - * and can be wrapped. If the PK11_ATTR_UNEXTRACTABLE flag is set, - * the key is not extractable, and certain attributes of the key - * cannot be revealed in plaintext outside the token (just like a - * sensitive key). If neither flag is set, it is token-specific - * whether the key is extractable or not. - * - * These two flags specify the value of the PKCS #11 CKA_EXTRACTABLE - * attribute. - */ -#define PK11_ATTR_EXTRACTABLE 0x00000100L -#define PK11_ATTR_UNEXTRACTABLE 0x00000200L - -/* Cryptographic module types */ -#define SECMOD_EXTERNAL 0 /* external module */ -#define SECMOD_INTERNAL 1 /* internal default module */ -#define SECMOD_FIPS 2 /* internal fips module */ - -/* default module configuration strings */ -#define SECMOD_SLOT_FLAGS "slotFlags=[RSA,DSA,DH,RC2,RC4,DES,RANDOM,SHA1,MD5,MD2,SSL,TLS,AES,Camellia,SEED,SHA256,SHA512]" - -#define SECMOD_MAKE_NSS_FLAGS(fips,slot) \ -"Flags=internal,critical" fips " slotparams=(" #slot "={" SECMOD_SLOT_FLAGS "})" - -#define SECMOD_INT_NAME "NSS Internal PKCS #11 Module" -#define SECMOD_INT_FLAGS SECMOD_MAKE_NSS_FLAGS("",1) -#define SECMOD_FIPS_NAME "NSS Internal FIPS PKCS #11 Module" -#define SECMOD_FIPS_FLAGS SECMOD_MAKE_NSS_FLAGS(",fips",3) - -/* - * What is the origin of a given Key. Normally this doesn't matter, but - * the fortezza code needs to know if it needs to invoke the SSL3 fortezza - * hack. - */ -typedef enum { - PK11_OriginNULL = 0, /* There is not key, it's a null SymKey */ - PK11_OriginDerive = 1, /* Key was derived from some other key */ - PK11_OriginGenerated = 2, /* Key was generated (also PBE keys) */ - PK11_OriginFortezzaHack = 3,/* Key was marked for fortezza hack */ - PK11_OriginUnwrap = 4 /* Key was unwrapped or decrypted */ -} PK11Origin; - -/* PKCS #11 disable reasons */ -typedef enum { - PK11_DIS_NONE = 0, - PK11_DIS_USER_SELECTED = 1, - PK11_DIS_COULD_NOT_INIT_TOKEN = 2, - PK11_DIS_TOKEN_VERIFY_FAILED = 3, - PK11_DIS_TOKEN_NOT_PRESENT = 4 -} PK11DisableReasons; - -/* types of PKCS #11 objects - * used to identify which NSS data structure is - * passed to the PK11_Raw* functions. Types map as follows: - * PK11_TypeGeneric PK11GenericObject * - * PK11_TypePrivKey SECKEYPrivateKey * - * PK11_TypePubKey SECKEYPublicKey * - * PK11_TypeSymKey PK11SymKey * - * PK11_TypeCert CERTCertificate * (currently not used). - */ -typedef enum { - PK11_TypeGeneric = 0, - PK11_TypePrivKey = 1, - PK11_TypePubKey = 2, - PK11_TypeCert = 3, - PK11_TypeSymKey = 4 -} PK11ObjectType; - - - -/* function pointer type for password callback function. - * This type is passed in to PK11_SetPasswordFunc() - */ -typedef char *(PR_CALLBACK *PK11PasswordFunc)(PK11SlotInfo *slot, PRBool retry, void *arg); -typedef PRBool (PR_CALLBACK *PK11VerifyPasswordFunc)(PK11SlotInfo *slot, void *arg); -typedef PRBool (PR_CALLBACK *PK11IsLoggedInFunc)(PK11SlotInfo *slot, void *arg); - -/* - * Special strings the password callback function can return only if - * the slot is an protected auth path slot. - */ -#define PK11_PW_RETRY "RETRY" /* an failed attempt to authenticate - * has already been made, just retry - * the operation */ -#define PK11_PW_AUTHENTICATED "AUTH" /* a successful attempt to authenticate - * has completed. Continue without - * another call to C_Login */ -/* All other non-null values mean that that NSS could call C_Login to force - * the authentication. The following define is to aid applications in - * documenting that is what it's trying to do */ -#define PK11_PW_TRY "TRY" /* Default: a prompt has been presented - * to the user, initiate a C_Login - * to authenticate the token */ - -/* - * PKCS #11 key structures - */ - -/* -** Attributes -*/ -struct SECKEYAttributeStr { - SECItem attrType; - SECItem **attrValue; -}; -typedef struct SECKEYAttributeStr SECKEYAttribute; - -/* -** A PKCS#8 private key info object -*/ -struct SECKEYPrivateKeyInfoStr { - PLArenaPool *arena; - SECItem version; - SECAlgorithmID algorithm; - SECItem privateKey; - SECKEYAttribute **attributes; -}; -typedef struct SECKEYPrivateKeyInfoStr SECKEYPrivateKeyInfo; - -/* -** A PKCS#8 private key info object -*/ -struct SECKEYEncryptedPrivateKeyInfoStr { - PLArenaPool *arena; - SECAlgorithmID algorithm; - SECItem encryptedData; -}; -typedef struct SECKEYEncryptedPrivateKeyInfoStr SECKEYEncryptedPrivateKeyInfo; - -/* - * token removal detection - */ -typedef enum { - PK11TokenNotRemovable = 0, - PK11TokenPresent = 1, - PK11TokenChanged = 2, - PK11TokenRemoved = 3 -} PK11TokenStatus; - -typedef enum { - PK11TokenRemovedOrChangedEvent = 0, - PK11TokenPresentEvent = 1 -} PK11TokenEvent; - -/* - * CRL Import Flags - */ -#define CRL_IMPORT_DEFAULT_OPTIONS 0x00000000 -#define CRL_IMPORT_BYPASS_CHECKS 0x00000001 - - -/* - * Merge Error Log - */ -typedef struct PK11MergeLogStr PK11MergeLog; -typedef struct PK11MergeLogNodeStr PK11MergeLogNode; - -/* These need to be global, leave some open fields so we can 'expand' - * these without breaking binary compatibility */ -struct PK11MergeLogNodeStr { - PK11MergeLogNode *next; /* next entry in the list */ - PK11MergeLogNode *prev; /* last entry in the list */ - PK11GenericObject *object; /* object that failed */ - int error; /* what the error was */ - CK_RV reserved1; - unsigned long reserved2; /* future flags */ - unsigned long reserved3; /* future scalar */ - void *reserved4; /* future pointer */ - void *reserved5; /* future expansion pointer */ -}; - -struct PK11MergeLogStr { - PK11MergeLogNode *head; - PK11MergeLogNode *tail; - PLArenaPool *arena; - int version; - unsigned long reserved1; - unsigned long reserved2; - unsigned long reserved3; - void *reserverd4; - void *reserverd5; -}; - - -#endif /*_SECMODT_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/secmodti.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/secmodti.h deleted file mode 100755 index 2b63130..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/secmodti.h +++ /dev/null @@ -1,187 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/* - * Internal header file included only by files in pkcs11 dir, or in - * pkcs11 specific client and server files. - */ - -#ifndef _SECMODTI_H_ -#define _SECMODTI_H_ 1 -#include "prmon.h" -#include "prtypes.h" -#include "nssilckt.h" -#include "secmodt.h" -#include "pkcs11t.h" - -#include "nssdevt.h" - -/* internal data structures */ - -/* Traverse slots callback */ -typedef struct pk11TraverseSlotStr { - SECStatus (*callback)(PK11SlotInfo *,CK_OBJECT_HANDLE, void *); - void *callbackArg; - CK_ATTRIBUTE *findTemplate; - int templateCount; -} pk11TraverseSlot; - - -/* represent a pkcs#11 slot reference counted. */ -struct PK11SlotInfoStr { - /* the PKCS11 function list for this slot */ - void *functionList; - SECMODModule *module; /* our parent module */ - /* Boolean to indicate the current state of this slot */ - PRBool needTest; /* Has this slot been tested for Export complience */ - PRBool isPerm; /* is this slot a permanment device */ - PRBool isHW; /* is this slot a hardware device */ - PRBool isInternal; /* is this slot one of our internal PKCS #11 devices */ - PRBool disabled; /* is this slot disabled... */ - PK11DisableReasons reason; /* Why this slot is disabled */ - PRBool readOnly; /* is the token in this slot read-only */ - PRBool needLogin; /* does the token of the type that needs - * authentication (still true even if token is logged - * in) */ - PRBool hasRandom; /* can this token generated random numbers */ - PRBool defRWSession; /* is the default session RW (we open our default - * session rw if the token can only handle one session - * at a time. */ - PRBool isThreadSafe; /* copied from the module */ - /* The actual flags (many of which are distilled into the above PRBools) */ - CK_FLAGS flags; /* flags from PKCS #11 token Info */ - /* a default session handle to do quick and dirty functions */ - CK_SESSION_HANDLE session; - PZLock *sessionLock; /* lock for this session */ - /* our ID */ - CK_SLOT_ID slotID; - /* persistant flags saved from startup to startup */ - unsigned long defaultFlags; - /* keep track of who is using us so we don't accidently get freed while - * still in use */ - PRInt32 refCount; /* to be in/decremented by atomic calls ONLY! */ - PZLock *freeListLock; - PK11SymKey *freeSymKeysWithSessionHead; - PK11SymKey *freeSymKeysHead; - int keyCount; - int maxKeyCount; - /* Password control functions for this slot. many of these are only - * active if the appropriate flag is on in defaultFlags */ - int askpw; /* what our password options are */ - int timeout; /* If we're ask_timeout, what is our timeout time is - * seconds */ - int authTransact; /* allow multiple authentications off one password if - * they are all part of the same transaction */ - PRTime authTime; /* when were we last authenticated */ - int minPassword; /* smallest legal password */ - int maxPassword; /* largest legal password */ - PRUint16 series; /* break up the slot info into various groups of - * inserted tokens so that keys and certs can be - * invalidated */ - PRUint16 flagSeries;/* record the last series for the last event - * returned for this slot */ - PRBool flagState; /* record the state of the last event returned for this - * slot. */ - PRUint16 wrapKey; /* current wrapping key for SSL master secrets */ - CK_MECHANISM_TYPE wrapMechanism; - /* current wrapping mechanism for current wrapKey */ - CK_OBJECT_HANDLE refKeys[1]; /* array of existing wrapping keys for */ - CK_MECHANISM_TYPE *mechanismList; /* list of mechanism supported by this - * token */ - int mechanismCount; - /* cache the certificates stored on the token of this slot */ - CERTCertificate **cert_array; - int array_size; - int cert_count; - char serial[16]; - /* since these are odd sizes, keep them last. They are odd sizes to - * allow them to become null terminated strings */ - char slot_name[65]; - char token_name[33]; - PRBool hasRootCerts; - PRBool hasRootTrust; - PRBool hasRSAInfo; - CK_FLAGS RSAInfoFlags; - PRBool protectedAuthPath; - PRBool isActiveCard; - PRIntervalTime lastLoginCheck; - unsigned int lastState; - /* for Stan */ - NSSToken *nssToken; - /* fast mechanism lookup */ - char mechanismBits[256]; -}; - -/* Symetric Key structure. Reference Counted */ -struct PK11SymKeyStr { - CK_MECHANISM_TYPE type; /* type of operation this key was created for*/ - CK_OBJECT_HANDLE objectID; /* object id of this key in the slot */ - PK11SlotInfo *slot; /* Slot this key is loaded into */ - void *cx; /* window context in case we need to loggin */ - PK11SymKey *next; - PRBool owner; - SECItem data; /* raw key data if available */ - CK_SESSION_HANDLE session; - PRBool sessionOwner; - PRInt32 refCount; /* number of references to this key */ - int size; /* key size in bytes */ - PK11Origin origin; /* where this key came from - * (see def in secmodt.h) */ - PK11SymKey *parent; /* potential owner key of the session */ - PRUint16 series; /* break up the slot info into various groups - * of inserted tokens so that keys and certs - * can be invalidated */ - void *userData; /* random data the application can attach to - * this key */ - PK11FreeDataFunc freeFunc; /* function to free the user data */ -}; - - -/* - * hold a hash, encryption or signing context for multi-part operations. - * hold enough information so that multiple contexts can be interleaved - * if necessary. ... Not RefCounted. - */ -struct PK11ContextStr { - CK_ATTRIBUTE_TYPE operation; /* type of operation this context is doing - * (CKA_ENCRYPT, CKA_SIGN, CKA_HASH, etc. */ - PK11SymKey *key; /* symetric key used in this context */ - PK11SlotInfo *slot; /* slot this context is operationing on */ - CK_SESSION_HANDLE session; /* session this context is using */ - PZLock *sessionLock; /* lock before accessing a PKCS #11 - * session */ - PRBool ownSession;/* do we own the session? */ - void *cx; /* window context in case we need to loggin*/ - void *savedData;/* save data when we are multiplexing on a - * single context */ - unsigned long savedLength; /* length of the saved context */ - SECItem *param; /* mechanism parameters used to build this - context */ - PRBool init; /* has this contexted been initialized */ - CK_MECHANISM_TYPE type; /* what is the PKCS #11 this context is - * representing (usually what algorithm is - * being used (CKM_RSA_PKCS, CKM_DES, - * CKM_SHA, etc.*/ - PRBool fortezzaHack; /*Fortezza SSL has some special - * non-standard semantics*/ -}; - -/* - * structure to hold a pointer to a unique PKCS #11 object - * (pointer to the slot and the object id). - */ -struct PK11GenericObjectStr { - PK11GenericObject *prev; - PK11GenericObject *next; - PK11SlotInfo *slot; - CK_OBJECT_HANDLE objectID; -}; - - -#define MAX_TEMPL_ATTRS 16 /* maximum attributes in template */ - -/* This mask includes all CK_FLAGs with an equivalent CKA_ attribute. */ -#define CKF_KEY_OPERATION_FLAGS 0x000e7b00UL - - -#endif /* _SECMODTI_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/secpkcs5.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/secpkcs5.h deleted file mode 100755 index ac863b1..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pk11wrap/secpkcs5.h +++ /dev/null @@ -1,62 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef _SECPKCS5_H_ -#define _SECPKCS5_H_ -#include "seccomon.h" -#include "secmodt.h" - -/* used for V2 PKCS 12 Draft Spec */ -typedef enum { - pbeBitGenIDNull = 0, - pbeBitGenCipherKey = 0x01, - pbeBitGenCipherIV = 0x02, - pbeBitGenIntegrityKey = 0x03 -} PBEBitGenID; - -typedef struct PBEBitGenContextStr PBEBitGenContext; - -SEC_BEGIN_PROTOS - -/* private */ -SECAlgorithmID * -sec_pkcs5CreateAlgorithmID(SECOidTag algorithm, SECOidTag cipherAlgorithm, - SECOidTag prfAlg, SECOidTag *pPbeAlgorithm, - int keyLengh, SECItem *salt, int iteration); - -/* Get the initialization vector. The password is passed in, hashing - * is performed, and the initialization vector is returned. - * algid is a pointer to a PBE algorithm ID - * pwitem is the password - * If an error occurs or the algorithm id is not a PBE algrithm, - * NULL is returned. Otherwise, the iv is returned in a secitem. - */ -SECItem * -SEC_PKCS5GetIV(SECAlgorithmID *algid, SECItem *pwitem, PRBool faulty3DES); - -SECOidTag SEC_PKCS5GetCryptoAlgorithm(SECAlgorithmID *algid); -PRBool SEC_PKCS5IsAlgorithmPBEAlg(SECAlgorithmID *algid); -PRBool SEC_PKCS5IsAlgorithmPBEAlgTag(SECOidTag algTag); -SECOidTag SEC_PKCS5GetPBEAlgorithm(SECOidTag algTag, int keyLen); -int SEC_PKCS5GetKeyLength(SECAlgorithmID *algid); - -/********************************************************************** - * Deprecated PBE functions. Use the PBE functions in pk11func.h - * instead. - **********************************************************************/ - -PBEBitGenContext * -PBE_CreateContext(SECOidTag hashAlgorithm, PBEBitGenID bitGenPurpose, - SECItem *pwitem, SECItem *salt, unsigned int bitsNeeded, - unsigned int iterations); - -void -PBE_DestroyContext(PBEBitGenContext *context); - - -SECItem * -PBE_GenerateBits(PBEBitGenContext *context); - -SEC_END_PROTOS - -#endif /* _SECPKS5_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pkcs7/p7local.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pkcs7/p7local.h deleted file mode 100755 index a9b7887..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pkcs7/p7local.h +++ /dev/null @@ -1,139 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * Support routines for PKCS7 implementation, none of which are exported. - * This file should only contain things that are needed by both the - * encoding/creation side *and* the decoding/decryption side. Anything - * else should just be static routines in the appropriate file. - * - * Do not export this file! If something in here is really needed outside - * of pkcs7 code, first try to add a PKCS7 interface which will do it for - * you. If that has a problem, then just move out what you need, changing - * its name as appropriate! - */ - -#ifndef _P7LOCAL_H_ -#define _P7LOCAL_H_ - -#include "secpkcs7.h" -#include "secasn1t.h" - -extern const SEC_ASN1Template sec_PKCS7ContentInfoTemplate[]; - -/* opaque objects */ -typedef struct sec_pkcs7_cipher_object sec_PKCS7CipherObject; - - -/************************************************************************/ -SEC_BEGIN_PROTOS - -/* - * Look through a set of attributes and find one that matches the - * specified object ID. If "only" is true, then make sure that - * there is not more than one attribute of the same type. Otherwise, - * just return the first one found. (XXX Does anybody really want - * that first-found behavior? It was like that when I found it...) - */ -extern SEC_PKCS7Attribute *sec_PKCS7FindAttribute (SEC_PKCS7Attribute **attrs, - SECOidTag oidtag, - PRBool only); -/* - * Return the single attribute value, doing some sanity checking first: - * - Multiple values are *not* expected. - * - Empty values are *not* expected. - */ -extern SECItem *sec_PKCS7AttributeValue (SEC_PKCS7Attribute *attr); - -/* - * Encode a set of attributes (found in "src"). - */ -extern SECItem *sec_PKCS7EncodeAttributes (PLArenaPool *poolp, - SECItem *dest, void *src); - -/* - * Make sure that the order of the attributes guarantees valid DER - * (which must be in lexigraphically ascending order for a SET OF); - * if reordering is necessary it will be done in place (in attrs). - */ -extern SECStatus sec_PKCS7ReorderAttributes (SEC_PKCS7Attribute **attrs); - - -/* - * Create a context for decrypting, based on the given key and algorithm. - */ -extern sec_PKCS7CipherObject * -sec_PKCS7CreateDecryptObject (PK11SymKey *key, SECAlgorithmID *algid); - -/* - * Create a context for encrypting, based on the given key and algorithm, - * and fill in the algorithm id. - */ -extern sec_PKCS7CipherObject * -sec_PKCS7CreateEncryptObject (PLArenaPool *poolp, PK11SymKey *key, - SECOidTag algtag, SECAlgorithmID *algid); - -/* - * Destroy the given decryption or encryption object. - */ -extern void sec_PKCS7DestroyDecryptObject (sec_PKCS7CipherObject *obj); -extern void sec_PKCS7DestroyEncryptObject (sec_PKCS7CipherObject *obj); - -/* - * What will be the output length of the next call to encrypt/decrypt? - * Result can be used to perform memory allocations. Note that the amount - * is exactly accurate only when not doing a block cipher or when final - * is false, otherwise it is an upper bound on the amount because until - * we see the data we do not know how many padding bytes there are - * (always between 1 and the cipher block size). - * - * Note that this can return zero, which does not mean that the cipher - * operation can be skipped! (It simply means that there are not enough - * bytes to make up an entire block; the bytes will be reserved until - * there are enough to encrypt/decrypt at least one block.) However, - * if zero is returned it *does* mean that no output buffer need be - * passed in to the subsequent cipher operation, as no output bytes - * will be stored. - */ -extern unsigned int sec_PKCS7DecryptLength (sec_PKCS7CipherObject *obj, - unsigned int input_len, - PRBool final); -extern unsigned int sec_PKCS7EncryptLength (sec_PKCS7CipherObject *obj, - unsigned int input_len, - PRBool final); - -/* - * Decrypt a given length of input buffer (starting at "input" and - * containing "input_len" bytes), placing the decrypted bytes in - * "output" and storing the output length in "*output_len_p". - * "obj" is the return value from sec_PKCS7CreateDecryptObject. - * When "final" is true, this is the last of the data to be decrypted. - */ -extern SECStatus sec_PKCS7Decrypt (sec_PKCS7CipherObject *obj, - unsigned char *output, - unsigned int *output_len_p, - unsigned int max_output_len, - const unsigned char *input, - unsigned int input_len, - PRBool final); - -/* - * Encrypt a given length of input buffer (starting at "input" and - * containing "input_len" bytes), placing the encrypted bytes in - * "output" and storing the output length in "*output_len_p". - * "obj" is the return value from sec_PKCS7CreateEncryptObject. - * When "final" is true, this is the last of the data to be encrypted. - */ -extern SECStatus sec_PKCS7Encrypt (sec_PKCS7CipherObject *obj, - unsigned char *output, - unsigned int *output_len_p, - unsigned int max_output_len, - const unsigned char *input, - unsigned int input_len, - PRBool final); - -/************************************************************************/ -SEC_END_PROTOS - -#endif /* _P7LOCAL_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pkcs7/pkcs7t.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pkcs7/pkcs7t.h deleted file mode 100755 index d01b1ea..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pkcs7/pkcs7t.h +++ /dev/null @@ -1,235 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * Header for pkcs7 types. - */ - -#ifndef _PKCS7T_H_ -#define _PKCS7T_H_ - -#include "plarena.h" - -#include "seccomon.h" -#include "secoidt.h" -#include "certt.h" -#include "secmodt.h" - -/* Opaque objects */ -typedef struct SEC_PKCS7DecoderContextStr SEC_PKCS7DecoderContext; -typedef struct SEC_PKCS7EncoderContextStr SEC_PKCS7EncoderContext; - -/* legacy defines that haven't been active for years */ -typedef void *(*SECKEYGetPasswordKey)(void *arg, void *handle); - - -/* Non-opaque objects. NOTE, though: I want them to be treated as - * opaque as much as possible. If I could hide them completely, - * I would. (I tried, but ran into trouble that was taking me too - * much time to get out of.) I still intend to try to do so. - * In fact, the only type that "outsiders" should even *name* is - * SEC_PKCS7ContentInfo, and they should not reference its fields. - */ -/* rjr: PKCS #11 cert handling (pk11cert.c) does use SEC_PKCS7RecipientInfo's. - * This is because when we search the recipient list for the cert and key we - * want, we need to invert the order of the loops we used to have. The old - * loops were: - * - * For each recipient { - * find_cert = PK11_Find_AllCert(recipient->issuerSN); - * [which unrolls to... ] - * For each slot { - * Log into slot; - * search slot for cert; - * } - * } - * - * the new loop searchs all the recipients at once on a slot. this allows - * PKCS #11 to order slots in such a way that logout slots don't get checked - * if we can find the cert on a logged in slot. This eliminates lots of - * spurious password prompts when smart cards are installed... so why this - * comment? If you make SEC_PKCS7RecipientInfo completely opaque, you need - * to provide a non-opaque list of issuerSN's (the only field PKCS#11 needs - * and fix up pk11cert.c first. NOTE: Only S/MIME calls this special PKCS #11 - * function. - */ -typedef struct SEC_PKCS7ContentInfoStr SEC_PKCS7ContentInfo; -typedef struct SEC_PKCS7SignedDataStr SEC_PKCS7SignedData; -typedef struct SEC_PKCS7EncryptedContentInfoStr SEC_PKCS7EncryptedContentInfo; -typedef struct SEC_PKCS7EnvelopedDataStr SEC_PKCS7EnvelopedData; -typedef struct SEC_PKCS7SignedAndEnvelopedDataStr - SEC_PKCS7SignedAndEnvelopedData; -typedef struct SEC_PKCS7SignerInfoStr SEC_PKCS7SignerInfo; -typedef struct SEC_PKCS7RecipientInfoStr SEC_PKCS7RecipientInfo; -typedef struct SEC_PKCS7DigestedDataStr SEC_PKCS7DigestedData; -typedef struct SEC_PKCS7EncryptedDataStr SEC_PKCS7EncryptedData; -/* - * The following is not actually a PKCS7 type, but for now it is only - * used by PKCS7, so we have adopted it. If someone else *ever* needs - * it, its name should be changed and it should be moved out of here. - * Do not dare to use it without doing so! - */ -typedef struct SEC_PKCS7AttributeStr SEC_PKCS7Attribute; - -struct SEC_PKCS7ContentInfoStr { - PLArenaPool *poolp; /* local; not part of encoding */ - PRBool created; /* local; not part of encoding */ - int refCount; /* local; not part of encoding */ - SECOidData *contentTypeTag; /* local; not part of encoding */ - SECKEYGetPasswordKey pwfn; /* local; not part of encoding */ - void *pwfn_arg; /* local; not part of encoding */ - SECItem contentType; - union { - SECItem *data; - SEC_PKCS7DigestedData *digestedData; - SEC_PKCS7EncryptedData *encryptedData; - SEC_PKCS7EnvelopedData *envelopedData; - SEC_PKCS7SignedData *signedData; - SEC_PKCS7SignedAndEnvelopedData *signedAndEnvelopedData; - } content; -}; - -struct SEC_PKCS7SignedDataStr { - SECItem version; - SECAlgorithmID **digestAlgorithms; - SEC_PKCS7ContentInfo contentInfo; - SECItem **rawCerts; - CERTSignedCrl **crls; - SEC_PKCS7SignerInfo **signerInfos; - SECItem **digests; /* local; not part of encoding */ - CERTCertificate **certs; /* local; not part of encoding */ - CERTCertificateList **certLists; /* local; not part of encoding */ -}; -#define SEC_PKCS7_SIGNED_DATA_VERSION 1 /* what we *create* */ - -struct SEC_PKCS7EncryptedContentInfoStr { - SECOidData *contentTypeTag; /* local; not part of encoding */ - SECItem contentType; - SECAlgorithmID contentEncAlg; - SECItem encContent; - SECItem plainContent; /* local; not part of encoding */ - /* bytes not encrypted, but encoded */ - int keysize; /* local; not part of encoding */ - /* size of bulk encryption key - * (only used by creation code) */ - SECOidTag encalg; /* local; not part of encoding */ - /* oid tag of encryption algorithm - * (only used by creation code) */ -}; - -struct SEC_PKCS7EnvelopedDataStr { - SECItem version; - SEC_PKCS7RecipientInfo **recipientInfos; - SEC_PKCS7EncryptedContentInfo encContentInfo; -}; -#define SEC_PKCS7_ENVELOPED_DATA_VERSION 0 /* what we *create* */ - -struct SEC_PKCS7SignedAndEnvelopedDataStr { - SECItem version; - SEC_PKCS7RecipientInfo **recipientInfos; - SECAlgorithmID **digestAlgorithms; - SEC_PKCS7EncryptedContentInfo encContentInfo; - SECItem **rawCerts; - CERTSignedCrl **crls; - SEC_PKCS7SignerInfo **signerInfos; - SECItem **digests; /* local; not part of encoding */ - CERTCertificate **certs; /* local; not part of encoding */ - CERTCertificateList **certLists; /* local; not part of encoding */ - PK11SymKey *sigKey; /* local; not part of encoding */ -}; -#define SEC_PKCS7_SIGNED_AND_ENVELOPED_DATA_VERSION 1 /* what we *create* */ - -struct SEC_PKCS7SignerInfoStr { - SECItem version; - CERTIssuerAndSN *issuerAndSN; - SECAlgorithmID digestAlg; - SEC_PKCS7Attribute **authAttr; - SECAlgorithmID digestEncAlg; - SECItem encDigest; - SEC_PKCS7Attribute **unAuthAttr; - CERTCertificate *cert; /* local; not part of encoding */ - CERTCertificateList *certList; /* local; not part of encoding */ -}; -#define SEC_PKCS7_SIGNER_INFO_VERSION 1 /* what we *create* */ - -struct SEC_PKCS7RecipientInfoStr { - SECItem version; - CERTIssuerAndSN *issuerAndSN; - SECAlgorithmID keyEncAlg; - SECItem encKey; - CERTCertificate *cert; /* local; not part of encoding */ -}; -#define SEC_PKCS7_RECIPIENT_INFO_VERSION 0 /* what we *create* */ - -struct SEC_PKCS7DigestedDataStr { - SECItem version; - SECAlgorithmID digestAlg; - SEC_PKCS7ContentInfo contentInfo; - SECItem digest; -}; -#define SEC_PKCS7_DIGESTED_DATA_VERSION 0 /* what we *create* */ - -struct SEC_PKCS7EncryptedDataStr { - SECItem version; - SEC_PKCS7EncryptedContentInfo encContentInfo; -}; -#define SEC_PKCS7_ENCRYPTED_DATA_VERSION 0 /* what we *create* */ - -/* - * See comment above about this type not really belonging to PKCS7. - */ -struct SEC_PKCS7AttributeStr { - /* The following fields make up an encoded Attribute: */ - SECItem type; - SECItem **values; /* data may or may not be encoded */ - /* The following fields are not part of an encoded Attribute: */ - SECOidData *typeTag; - PRBool encoded; /* when true, values are encoded */ -}; - -/* - * Type of function passed to SEC_PKCS7Decode or SEC_PKCS7DecoderStart. - * If specified, this is where the content bytes (only) will be "sent" - * as they are recovered during the decoding. - * - * XXX Should just combine this with SEC_PKCS7EncoderContentCallback type - * and use a simpler, common name. - */ -typedef void (* SEC_PKCS7DecoderContentCallback)(void *arg, - const char *buf, - unsigned long len); - -/* - * Type of function passed to SEC_PKCS7Encode or SEC_PKCS7EncoderStart. - * This is where the encoded bytes will be "sent". - * - * XXX Should just combine this with SEC_PKCS7DecoderContentCallback type - * and use a simpler, common name. - */ -typedef void (* SEC_PKCS7EncoderOutputCallback)(void *arg, - const char *buf, - unsigned long len); - - -/* - * Type of function passed to SEC_PKCS7Decode or SEC_PKCS7DecoderStart - * to retrieve the decryption key. This function is inteded to be - * used for EncryptedData content info's which do not have a key available - * in a certificate, etc. - */ -typedef PK11SymKey * (* SEC_PKCS7GetDecryptKeyCallback)(void *arg, - SECAlgorithmID *algid); - -/* - * Type of function passed to SEC_PKCS7Decode or SEC_PKCS7DecoderStart. - * This function in intended to be used to verify that decrypting a - * particular crypto algorithm is allowed. Content types which do not - * require decryption will not need the callback. If the callback - * is not specified for content types which require decryption, the - * decryption will be disallowed. - */ -typedef PRBool (* SEC_PKCS7DecryptionAllowedCallback)(SECAlgorithmID *algid, - PK11SymKey *bulkkey); - -#endif /* _PKCS7T_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pkcs7/secmime.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pkcs7/secmime.h deleted file mode 100755 index a813d85..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pkcs7/secmime.h +++ /dev/null @@ -1,161 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * Header file for routines specific to S/MIME. Keep things that are pure - * pkcs7 out of here; this is for S/MIME policy, S/MIME interoperability, etc. - */ - -#ifndef _SECMIME_H_ -#define _SECMIME_H_ 1 - -#include "secpkcs7.h" - - -/************************************************************************/ -SEC_BEGIN_PROTOS - -/* - * Initialize the local recording of the user S/MIME cipher preferences. - * This function is called once for each cipher, the order being - * important (first call records greatest preference, and so on). - * When finished, it is called with a "which" of CIPHER_FAMILID_MASK. - * If the function is called again after that, it is assumed that - * the preferences are being reset, and the old preferences are - * discarded. - * - * XXX This is for a particular user, and right now the storage is - * XXX local, static. The preference should be stored elsewhere to allow - * XXX for multiple uses of one library? How does SSL handle this; - * XXX it has something similar? - * - * - The "which" values are defined in ciferfam.h (the SMIME_* values, - * for example SMIME_DES_CBC_56). - * - If "on" is non-zero then the named cipher is enabled, otherwise - * it is disabled. (It is not necessary to call the function for - * ciphers that are disabled, however, as that is the default.) - * - * If the cipher preference is successfully recorded, SECSuccess - * is returned. Otherwise SECFailure is returned. The only errors - * are due to failure allocating memory or bad parameters/calls: - * SEC_ERROR_XXX ("which" is not in the S/MIME cipher family) - * SEC_ERROR_XXX (function is being called more times than there - * are known/expected ciphers) - */ -extern SECStatus SECMIME_EnableCipher(long which, int on); - -/* - * Initialize the local recording of the S/MIME policy. - * This function is called to enable/disable a particular cipher. - * (S/MIME encryption or decryption using a particular cipher is only - * allowed if that cipher is currently enabled.) At startup, all S/MIME - * ciphers are disabled. From that point, this function can be called - * to enable a cipher -- it is not necessary to call this to disable - * a cipher unless that cipher was previously, explicitly enabled via - * this function. - * - * XXX This is for a the current module, I think, so local, static storage - * XXX is okay. Is that correct, or could multiple uses of the same - * XXX library expect to operate under different policies? - * - * - The "which" values are defined in ciferfam.h (the SMIME_* values, - * for example SMIME_DES_CBC_56). - * - If "on" is non-zero then the named cipher is enabled, otherwise - * it is disabled. - * - * If the cipher is successfully enabled/disabled, SECSuccess is - * returned. Otherwise SECFailure is returned. The only errors - * are due to bad parameters: - * SEC_ERROR_XXX ("which" is not in the S/MIME cipher family) - * SEC_ERROR_XXX ("which" exceeds expected maximum cipher; this is - * really an internal error) - */ -extern SECStatus SECMIME_SetPolicy(long which, int on); - -/* - * Does the current policy allow S/MIME decryption of this particular - * algorithm and keysize? - */ -extern PRBool SECMIME_DecryptionAllowed(SECAlgorithmID *algid, PK11SymKey *key); - -/* - * Does the current policy allow *any* S/MIME encryption (or decryption)? - * - * This tells whether or not *any* S/MIME encryption can be done, - * according to policy. Callers may use this to do nicer user interface - * (say, greying out a checkbox so a user does not even try to encrypt - * a message when they are not allowed to) or for any reason they want - * to check whether S/MIME encryption (or decryption, for that matter) - * may be done. - * - * It takes no arguments. The return value is a simple boolean: - * PR_TRUE means encryption (or decryption) is *possible* - * (but may still fail due to other reasons, like because we cannot - * find all the necessary certs, etc.; PR_TRUE is *not* a guarantee) - * PR_FALSE means encryption (or decryption) is not permitted - * - * There are no errors from this routine. - */ -extern PRBool SECMIME_EncryptionPossible(void); - -/* - * Start an S/MIME encrypting context. - * - * "scert" is the cert for the sender. It will be checked for validity. - * "rcerts" are the certs for the recipients. They will also be checked. - * - * "certdb" is the cert database to use for verifying the certs. - * It can be NULL if a default database is available (like in the client). - * - * This function already does all of the stuff specific to S/MIME protocol - * and local policy; the return value just needs to be passed to - * SEC_PKCS7Encode() or to SEC_PKCS7EncoderStart() to create the encoded data, - * and finally to SEC_PKCS7DestroyContentInfo(). - * - * An error results in a return value of NULL and an error set. - * (Retrieve specific errors via PORT_GetError()/XP_GetError().) - */ -extern SEC_PKCS7ContentInfo *SECMIME_CreateEncrypted(CERTCertificate *scert, - CERTCertificate **rcerts, - CERTCertDBHandle *certdb, - SECKEYGetPasswordKey pwfn, - void *pwfn_arg); - -/* - * Start an S/MIME signing context. - * - * "scert" is the cert that will be used to sign the data. It will be - * checked for validity. - * - * "certdb" is the cert database to use for verifying the cert. - * It can be NULL if a default database is available (like in the client). - * - * "digestalg" names the digest algorithm. (It should be SEC_OID_SHA1; - * XXX There should be SECMIME functions for hashing, or the hashing should - * be built into this interface, which we would like because we would - * support more smartcards that way, and then this argument should go away.) - * - * "digest" is the actual digest of the data. It must be provided in - * the case of detached data or NULL if the content will be included. - * - * This function already does all of the stuff specific to S/MIME protocol - * and local policy; the return value just needs to be passed to - * SEC_PKCS7Encode() or to SEC_PKCS7EncoderStart() to create the encoded data, - * and finally to SEC_PKCS7DestroyContentInfo(). - * - * An error results in a return value of NULL and an error set. - * (Retrieve specific errors via PORT_GetError()/XP_GetError().) - */ -extern SEC_PKCS7ContentInfo *SECMIME_CreateSigned(CERTCertificate *scert, - CERTCertificate *ecert, - CERTCertDBHandle *certdb, - SECOidTag digestalg, - SECItem *digest, - SECKEYGetPasswordKey pwfn, - void *pwfn_arg); - -/************************************************************************/ -SEC_END_PROTOS - -#endif /* _SECMIME_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pkcs7/secpkcs7.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pkcs7/secpkcs7.h deleted file mode 100755 index 22f147a..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/pkcs7/secpkcs7.h +++ /dev/null @@ -1,610 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * Interface to the PKCS7 implementation. - */ - -#ifndef _SECPKCS7_H_ -#define _SECPKCS7_H_ - -#include "seccomon.h" - -#include "secoidt.h" -#include "certt.h" -#include "keyt.h" -#include "hasht.h" -#include "pkcs7t.h" - -extern const SEC_ASN1Template sec_PKCS7ContentInfoTemplate[]; - -/************************************************************************/ -SEC_BEGIN_PROTOS - -/************************************************************************ - * Miscellaneous - ************************************************************************/ - -/* - * Returns the content type of the given contentInfo. - */ -extern SECOidTag SEC_PKCS7ContentType (SEC_PKCS7ContentInfo *cinfo); - -/* - * Destroy a PKCS7 contentInfo and all of its sub-pieces. - */ -extern void SEC_PKCS7DestroyContentInfo(SEC_PKCS7ContentInfo *contentInfo); - -/* - * Copy a PKCS7 contentInfo. A Destroy is needed on *each* copy. - */ -extern SEC_PKCS7ContentInfo * -SEC_PKCS7CopyContentInfo(SEC_PKCS7ContentInfo *contentInfo); - -/* - * Return a pointer to the actual content. In the case of those types - * which are encrypted, this returns the *plain* content. - */ -extern SECItem *SEC_PKCS7GetContent(SEC_PKCS7ContentInfo *cinfo); - -/************************************************************************ - * PKCS7 Decoding, Verification, etc.. - ************************************************************************/ - -extern SEC_PKCS7DecoderContext * -SEC_PKCS7DecoderStart(SEC_PKCS7DecoderContentCallback callback, - void *callback_arg, - SECKEYGetPasswordKey pwfn, void *pwfn_arg, - SEC_PKCS7GetDecryptKeyCallback decrypt_key_cb, - void *decrypt_key_cb_arg, - SEC_PKCS7DecryptionAllowedCallback decrypt_allowed_cb); - -extern SECStatus -SEC_PKCS7DecoderUpdate(SEC_PKCS7DecoderContext *p7dcx, - const char *buf, unsigned long len); - -extern SEC_PKCS7ContentInfo * -SEC_PKCS7DecoderFinish(SEC_PKCS7DecoderContext *p7dcx); - - -/* Abort the underlying ASN.1 stream & set an error */ -void SEC_PKCS7DecoderAbort(SEC_PKCS7DecoderContext *p7dcx, int error); - -extern SEC_PKCS7ContentInfo * -SEC_PKCS7DecodeItem(SECItem *p7item, - SEC_PKCS7DecoderContentCallback cb, void *cb_arg, - SECKEYGetPasswordKey pwfn, void *pwfn_arg, - SEC_PKCS7GetDecryptKeyCallback decrypt_key_cb, - void *decrypt_key_cb_arg, - SEC_PKCS7DecryptionAllowedCallback decrypt_allowed_cb); - -extern PRBool SEC_PKCS7ContainsCertsOrCrls(SEC_PKCS7ContentInfo *cinfo); - -/* checks to see if the contents of the content info is - * empty. it so, PR_TRUE is returned. PR_FALSE, otherwise. - * - * minLen is used to specify a minimum size. if content size <= minLen, - * content is assumed empty. - */ -extern PRBool -SEC_PKCS7IsContentEmpty(SEC_PKCS7ContentInfo *cinfo, unsigned int minLen); - -extern PRBool SEC_PKCS7ContentIsEncrypted(SEC_PKCS7ContentInfo *cinfo); - -/* - * If the PKCS7 content has a signature (not just *could* have a signature) - * return true; false otherwise. This can/should be called before calling - * VerifySignature, which will always indicate failure if no signature is - * present, but that does not mean there even was a signature! - * Note that the content itself can be empty (detached content was sent - * another way); it is the presence of the signature that matters. - */ -extern PRBool SEC_PKCS7ContentIsSigned(SEC_PKCS7ContentInfo *cinfo); - -/* - * SEC_PKCS7VerifySignature - * Look at a PKCS7 contentInfo and check if the signature is good. - * The verification checks that the signing cert is valid and trusted - * for the purpose specified by "certusage". - * - * In addition, if "keepcerts" is true, add any new certificates found - * into our local database. - */ -extern PRBool SEC_PKCS7VerifySignature(SEC_PKCS7ContentInfo *cinfo, - SECCertUsage certusage, - PRBool keepcerts); - -/* - * SEC_PKCS7VerifyDetachedSignature - * Look at a PKCS7 contentInfo and check if the signature matches - * a passed-in digest (calculated, supposedly, from detached contents). - * The verification checks that the signing cert is valid and trusted - * for the purpose specified by "certusage". - * - * In addition, if "keepcerts" is true, add any new certificates found - * into our local database. - */ -extern PRBool SEC_PKCS7VerifyDetachedSignature(SEC_PKCS7ContentInfo *cinfo, - SECCertUsage certusage, - const SECItem *detached_digest, - HASH_HashType digest_type, - PRBool keepcerts); - -/* - * SEC_PKCS7VerifyDetachedSignatureAtTime - * Look at a PKCS7 contentInfo and check if the signature matches - * a passed-in digest (calculated, supposedly, from detached contents). - * The verification checks that the signing cert is valid and trusted - * for the purpose specified by "certusage" at time "atTime". - * - * In addition, if "keepcerts" is true, add any new certificates found - * into our local database. - */ -extern PRBool -SEC_PKCS7VerifyDetachedSignatureAtTime(SEC_PKCS7ContentInfo *cinfo, - SECCertUsage certusage, - const SECItem *detached_digest, - HASH_HashType digest_type, - PRBool keepcerts, - PRTime atTime); - -/* - * SEC_PKCS7GetSignerCommonName, SEC_PKCS7GetSignerEmailAddress - * The passed-in contentInfo is espected to be Signed, and these - * functions return the specified portion of the full signer name. - * - * Returns a pointer to allocated memory, which must be freed. - * A NULL return value is an error. - */ -extern char *SEC_PKCS7GetSignerCommonName(SEC_PKCS7ContentInfo *cinfo); -extern char *SEC_PKCS7GetSignerEmailAddress(SEC_PKCS7ContentInfo *cinfo); - -/* - * Return the the signing time, in UTCTime format, of a PKCS7 contentInfo. - */ -extern SECItem *SEC_PKCS7GetSigningTime(SEC_PKCS7ContentInfo *cinfo); - - -/************************************************************************ - * PKCS7 Creation and Encoding. - ************************************************************************/ - -/* - * Start a PKCS7 signing context. - * - * "cert" is the cert that will be used to sign the data. It will be - * checked for validity. - * - * "certusage" describes the signing usage (e.g. certUsageEmailSigner) - * XXX Maybe SECCertUsage should be split so that our caller just says - * "email" and *we* add the "signing" part -- otherwise our caller - * could be lying about the usage; we do not want to allow encryption - * certs for signing or vice versa. - * - * "certdb" is the cert database to use for verifying the cert. - * It can be NULL if a default database is available (like in the client). - * - * "digestalg" names the digest algorithm (e.g. SEC_OID_SHA1). - * - * "digest" is the actual digest of the data. It must be provided in - * the case of detached data or NULL if the content will be included. - * - * The return value can be passed to functions which add things to - * it like attributes, then eventually to SEC_PKCS7Encode() or to - * SEC_PKCS7EncoderStart() to create the encoded data, and finally to - * SEC_PKCS7DestroyContentInfo(). - * - * An error results in a return value of NULL and an error set. - * (Retrieve specific errors via PORT_GetError()/XP_GetError().) - */ -extern SEC_PKCS7ContentInfo * -SEC_PKCS7CreateSignedData (CERTCertificate *cert, - SECCertUsage certusage, - CERTCertDBHandle *certdb, - SECOidTag digestalg, - SECItem *digest, - SECKEYGetPasswordKey pwfn, void *pwfn_arg); - -/* - * Create a PKCS7 certs-only container. - * - * "cert" is the (first) cert that will be included. - * - * "include_chain" specifies whether the entire chain for "cert" should - * be included. - * - * "certdb" is the cert database to use for finding the chain. - * It can be NULL in when "include_chain" is false, or when meaning - * use the default database. - * - * More certs and chains can be added via AddCertficate and AddCertChain. - * - * An error results in a return value of NULL and an error set. - * (Retrieve specific errors via PORT_GetError()/XP_GetError().) - */ -extern SEC_PKCS7ContentInfo * -SEC_PKCS7CreateCertsOnly (CERTCertificate *cert, - PRBool include_chain, - CERTCertDBHandle *certdb); - -/* - * Start a PKCS7 enveloping context. - * - * "cert" is the cert for the recipient. It will be checked for validity. - * - * "certusage" describes the encryption usage (e.g. certUsageEmailRecipient) - * XXX Maybe SECCertUsage should be split so that our caller just says - * "email" and *we* add the "recipient" part -- otherwise our caller - * could be lying about the usage; we do not want to allow encryption - * certs for signing or vice versa. - * - * "certdb" is the cert database to use for verifying the cert. - * It can be NULL if a default database is available (like in the client). - * - * "encalg" specifies the bulk encryption algorithm to use (e.g. SEC_OID_RC2). - * - * "keysize" specifies the bulk encryption key size, in bits. - * - * The return value can be passed to functions which add things to - * it like more recipients, then eventually to SEC_PKCS7Encode() or to - * SEC_PKCS7EncoderStart() to create the encoded data, and finally to - * SEC_PKCS7DestroyContentInfo(). - * - * An error results in a return value of NULL and an error set. - * (Retrieve specific errors via PORT_GetError()/XP_GetError().) - */ -extern SEC_PKCS7ContentInfo * -SEC_PKCS7CreateEnvelopedData (CERTCertificate *cert, - SECCertUsage certusage, - CERTCertDBHandle *certdb, - SECOidTag encalg, - int keysize, - SECKEYGetPasswordKey pwfn, void *pwfn_arg); - -/* - * XXX There will be a similar routine for creating signedAndEnvelopedData. - * But its parameters will be different and I have no plans to implement - * it any time soon because we have no current need for it. - */ - -/* - * Create an empty PKCS7 data content info. - * - * An error results in a return value of NULL and an error set. - * (Retrieve specific errors via PORT_GetError()/XP_GetError().) - */ -extern SEC_PKCS7ContentInfo *SEC_PKCS7CreateData (void); - -/* - * Create an empty PKCS7 encrypted content info. - * - * "algorithm" specifies the bulk encryption algorithm to use. - * - * An error results in a return value of NULL and an error set. - * (Retrieve specific errors via PORT_GetError()/XP_GetError().) - */ -extern SEC_PKCS7ContentInfo * -SEC_PKCS7CreateEncryptedData (SECOidTag algorithm, int keysize, - SECKEYGetPasswordKey pwfn, void *pwfn_arg); - -/* - * All of the following things return SECStatus to signal success or failure. - * Failure should have a more specific error status available via - * PORT_GetError()/XP_GetError(). - */ - -/* - * Add the specified attribute to the authenticated (i.e. signed) attributes - * of "cinfo" -- "oidtag" describes the attribute and "value" is the - * value to be associated with it. NOTE! "value" must already be encoded; - * no interpretation of "oidtag" is done. Also, it is assumed that this - * signedData has only one signer -- if we ever need to add attributes - * when there is more than one signature, we need a way to specify *which* - * signature should get the attribute. - * - * XXX Technically, a signed attribute can have multiple values; if/when - * we ever need to support an attribute which takes multiple values, we - * either need to change this interface or create an AddSignedAttributeValue - * which can be called subsequently, and would then append a value. - * - * "cinfo" should be of type signedData (the only kind of pkcs7 data - * that is allowed authenticated attributes); SECFailure will be returned - * if it is not. - */ -extern SECStatus SEC_PKCS7AddSignedAttribute (SEC_PKCS7ContentInfo *cinfo, - SECOidTag oidtag, - SECItem *value); - -/* - * Add "cert" and its entire chain to the set of certs included in "cinfo". - * - * "certdb" is the cert database to use for finding the chain. - * It can be NULL, meaning use the default database. - * - * "cinfo" should be of type signedData or signedAndEnvelopedData; - * SECFailure will be returned if it is not. - */ -extern SECStatus SEC_PKCS7AddCertChain (SEC_PKCS7ContentInfo *cinfo, - CERTCertificate *cert, - CERTCertDBHandle *certdb); - -/* - * Add "cert" to the set of certs included in "cinfo". - * - * "cinfo" should be of type signedData or signedAndEnvelopedData; - * SECFailure will be returned if it is not. - */ -extern SECStatus SEC_PKCS7AddCertificate (SEC_PKCS7ContentInfo *cinfo, - CERTCertificate *cert); - -/* - * Add another recipient to an encrypted message. - * - * "cinfo" should be of type envelopedData or signedAndEnvelopedData; - * SECFailure will be returned if it is not. - * - * "cert" is the cert for the recipient. It will be checked for validity. - * - * "certusage" describes the encryption usage (e.g. certUsageEmailRecipient) - * XXX Maybe SECCertUsage should be split so that our caller just says - * "email" and *we* add the "recipient" part -- otherwise our caller - * could be lying about the usage; we do not want to allow encryption - * certs for signing or vice versa. - * - * "certdb" is the cert database to use for verifying the cert. - * It can be NULL if a default database is available (like in the client). - */ -extern SECStatus SEC_PKCS7AddRecipient (SEC_PKCS7ContentInfo *cinfo, - CERTCertificate *cert, - SECCertUsage certusage, - CERTCertDBHandle *certdb); - -/* - * Add the signing time to the authenticated (i.e. signed) attributes - * of "cinfo". This is expected to be included in outgoing signed - * messages for email (S/MIME) but is likely useful in other situations. - * - * This should only be added once; a second call will either do - * nothing or replace an old signing time with a newer one. - * - * XXX This will probably just shove the current time into "cinfo" - * but it will not actually get signed until the entire item is - * processed for encoding. Is this (expected to be small) delay okay? - * - * "cinfo" should be of type signedData (the only kind of pkcs7 data - * that is allowed authenticated attributes); SECFailure will be returned - * if it is not. - */ -extern SECStatus SEC_PKCS7AddSigningTime (SEC_PKCS7ContentInfo *cinfo); - -/* - * Add the signer's symmetric capabilities to the authenticated - * (i.e. signed) attributes of "cinfo". This is expected to be - * included in outgoing signed messages for email (S/MIME). - * - * This can only be added once; a second call will return SECFailure. - * - * "cinfo" should be of type signedData or signedAndEnvelopedData; - * SECFailure will be returned if it is not. - */ -extern SECStatus SEC_PKCS7AddSymmetricCapabilities(SEC_PKCS7ContentInfo *cinfo); - -/* - * Mark that the signer's certificate and its issuing chain should - * be included in the encoded data. This is expected to be used - * in outgoing signed messages for email (S/MIME). - * - * "certdb" is the cert database to use for finding the chain. - * It can be NULL, meaning use the default database. - * - * "cinfo" should be of type signedData or signedAndEnvelopedData; - * SECFailure will be returned if it is not. - */ -extern SECStatus SEC_PKCS7IncludeCertChain (SEC_PKCS7ContentInfo *cinfo, - CERTCertDBHandle *certdb); - - -/* - * Set the content; it will be included and also hashed and/or encrypted - * as appropriate. This is for in-memory content (expected to be "small") - * that will be included in the PKCS7 object. All others should stream the - * content through when encoding (see SEC_PKCS7Encoder{Start,Update,Finish}). - * - * "buf" points to data of length "len"; it will be copied. - */ -extern SECStatus SEC_PKCS7SetContent (SEC_PKCS7ContentInfo *cinfo, - const char *buf, unsigned long len); - -/* - * Encode a PKCS7 object, in one shot. All necessary components - * of the object must already be specified. Either the data has - * already been included (via SetContent), or the data is detached, - * or there is no data at all (certs-only). - * - * "cinfo" specifies the object to be encoded. - * - * "outputfn" is where the encoded bytes will be passed. - * - * "outputarg" is an opaque argument to the above callback. - * - * "bulkkey" specifies the bulk encryption key to use. This argument - * can be NULL if no encryption is being done, or if the bulk key should - * be generated internally (usually the case for EnvelopedData but never - * for EncryptedData, which *must* provide a bulk encryption key). - * - * "pwfn" is a callback for getting the password which protects the - * private key of the signer. This argument can be NULL if it is known - * that no signing is going to be done. - * - * "pwfnarg" is an opaque argument to the above callback. - */ -extern SECStatus SEC_PKCS7Encode (SEC_PKCS7ContentInfo *cinfo, - SEC_PKCS7EncoderOutputCallback outputfn, - void *outputarg, - PK11SymKey *bulkkey, - SECKEYGetPasswordKey pwfn, - void *pwfnarg); - -/* - * Encode a PKCS7 object, in one shot. All necessary components - * of the object must already be specified. Either the data has - * already been included (via SetContent), or the data is detached, - * or there is no data at all (certs-only). The output, rather than - * being passed to an output function as is done above, is all put - * into a SECItem. - * - * "pool" specifies a pool from which to allocate the result. - * It can be NULL, in which case memory is allocated generically. - * - * "dest" specifies a SECItem in which to put the result data. - * It can be NULL, in which case the entire item is allocated, too. - * - * "cinfo" specifies the object to be encoded. - * - * "bulkkey" specifies the bulk encryption key to use. This argument - * can be NULL if no encryption is being done, or if the bulk key should - * be generated internally (usually the case for EnvelopedData but never - * for EncryptedData, which *must* provide a bulk encryption key). - * - * "pwfn" is a callback for getting the password which protects the - * private key of the signer. This argument can be NULL if it is known - * that no signing is going to be done. - * - * "pwfnarg" is an opaque argument to the above callback. - */ -extern SECItem *SEC_PKCS7EncodeItem (PLArenaPool *pool, - SECItem *dest, - SEC_PKCS7ContentInfo *cinfo, - PK11SymKey *bulkkey, - SECKEYGetPasswordKey pwfn, - void *pwfnarg); - -/* - * For those who want to simply point to the pkcs7 contentInfo ASN.1 - * template, and *not* call the encoding functions directly, the - * following function can be used -- after it is called, the entire - * PKCS7 contentInfo is ready to be encoded. - */ -extern SECStatus SEC_PKCS7PrepareForEncode (SEC_PKCS7ContentInfo *cinfo, - PK11SymKey *bulkkey, - SECKEYGetPasswordKey pwfn, - void *pwfnarg); - -/* - * Start the process of encoding a PKCS7 object. The first part of - * the encoded object will be passed to the output function right away; - * after that it is expected that SEC_PKCS7EncoderUpdate will be called, - * streaming in the actual content that is getting included as well as - * signed or encrypted (or both). - * - * "cinfo" specifies the object to be encoded. - * - * "outputfn" is where the encoded bytes will be passed. - * - * "outputarg" is an opaque argument to the above callback. - * - * "bulkkey" specifies the bulk encryption key to use. This argument - * can be NULL if no encryption is being done, or if the bulk key should - * be generated internally (usually the case for EnvelopedData but never - * for EncryptedData, which *must* provide a bulk encryption key). - * - * Returns an object to be passed to EncoderUpdate and EncoderFinish. - */ -extern SEC_PKCS7EncoderContext * -SEC_PKCS7EncoderStart (SEC_PKCS7ContentInfo *cinfo, - SEC_PKCS7EncoderOutputCallback outputfn, - void *outputarg, - PK11SymKey *bulkkey); - -/* - * Encode more contents, hashing and/or encrypting along the way. - */ -extern SECStatus SEC_PKCS7EncoderUpdate (SEC_PKCS7EncoderContext *p7ecx, - const char *buf, - unsigned long len); - -/* - * No more contents; finish the signature creation, if appropriate, - * and then the encoding. - * - * "pwfn" is a callback for getting the password which protects the - * signer's private key. This argument can be NULL if it is known - * that no signing is going to be done. - * - * "pwfnarg" is an opaque argument to the above callback. - */ -extern SECStatus SEC_PKCS7EncoderFinish (SEC_PKCS7EncoderContext *p7ecx, - SECKEYGetPasswordKey pwfn, - void *pwfnarg); - -/* Abort the underlying ASN.1 stream & set an error */ -void SEC_PKCS7EncoderAbort(SEC_PKCS7EncoderContext *p7dcx, int error); - -/* retrieve the algorithm ID used to encrypt the content info - * for encrypted and enveloped data. The SECAlgorithmID pointer - * returned needs to be freed as it is a copy of the algorithm - * id in the content info. - */ -extern SECAlgorithmID * -SEC_PKCS7GetEncryptionAlgorithm(SEC_PKCS7ContentInfo *cinfo); - -/* the content of an encrypted data content info is encrypted. - * it is assumed that for encrypted data, that the data has already - * been set and is in the "plainContent" field of the content info. - * - * cinfo is the content info to encrypt - * - * key is the key with which to perform the encryption. if the - * algorithm is a password based encryption algorithm, the - * key is actually a password which will be processed per - * PKCS #5. - * - * in the event of an error, SECFailure is returned. SECSuccess - * indicates a success. - */ -extern SECStatus -SEC_PKCS7EncryptContents(PLArenaPool *poolp, - SEC_PKCS7ContentInfo *cinfo, - SECItem *key, - void *wincx); - -/* the content of an encrypted data content info is decrypted. - * it is assumed that for encrypted data, that the data has already - * been set and is in the "encContent" field of the content info. - * - * cinfo is the content info to decrypt - * - * key is the key with which to perform the decryption. if the - * algorithm is a password based encryption algorithm, the - * key is actually a password which will be processed per - * PKCS #5. - * - * in the event of an error, SECFailure is returned. SECSuccess - * indicates a success. - */ -extern SECStatus -SEC_PKCS7DecryptContents(PLArenaPool *poolp, - SEC_PKCS7ContentInfo *cinfo, - SECItem *key, - void *wincx); - -/* retrieve the certificate list from the content info. the list - * is a pointer to the list in the content info. this should not - * be deleted or freed in any way short of calling - * SEC_PKCS7DestroyContentInfo - */ -extern SECItem ** -SEC_PKCS7GetCertificateList(SEC_PKCS7ContentInfo *cinfo); - -/* Returns the key length (in bits) of the algorithm used to encrypt - this object. Returns 0 if it's not encrypted, or the key length is - irrelevant. */ -extern int -SEC_PKCS7GetKeyLength(SEC_PKCS7ContentInfo *cinfo); - - -/************************************************************************/ -SEC_END_PROTOS - -#endif /* _SECPKCS7_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/smime/cms.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/smime/cms.h deleted file mode 100755 index 5b1d7a0..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/smime/cms.h +++ /dev/null @@ -1,1153 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * Interfaces of the CMS implementation. - */ - -#ifndef _CMS_H_ -#define _CMS_H_ - -#include "seccomon.h" - -#include "secoidt.h" -#include "certt.h" -#include "keyt.h" -#include "hasht.h" -#include "cmst.h" - -/************************************************************************/ -SEC_BEGIN_PROTOS - -/************************************************************************ - * cmsdecode.c - CMS decoding - ************************************************************************/ - -/* - * NSS_CMSDecoder_Start - set up decoding of a DER-encoded CMS message - * - * "poolp" - pointer to arena for message, or NULL if new pool should be created - * "cb", "cb_arg" - callback function and argument for delivery of inner content - * inner content will be stored in the message if cb is NULL. - * "pwfn", pwfn_arg" - callback function for getting token password - * "decrypt_key_cb", "decrypt_key_cb_arg" - callback function for getting bulk key for encryptedData - */ -extern NSSCMSDecoderContext * -NSS_CMSDecoder_Start(PLArenaPool *poolp, - NSSCMSContentCallback cb, void *cb_arg, - PK11PasswordFunc pwfn, void *pwfn_arg, - NSSCMSGetDecryptKeyCallback decrypt_key_cb, void *decrypt_key_cb_arg); - -/* - * NSS_CMSDecoder_Update - feed DER-encoded data to decoder - */ -extern SECStatus -NSS_CMSDecoder_Update(NSSCMSDecoderContext *p7dcx, const char *buf, unsigned long len); - -/* - * NSS_CMSDecoder_Cancel - cancel a decoding process - */ -extern void -NSS_CMSDecoder_Cancel(NSSCMSDecoderContext *p7dcx); - -/* - * NSS_CMSDecoder_Finish - mark the end of inner content and finish decoding - */ -extern NSSCMSMessage * -NSS_CMSDecoder_Finish(NSSCMSDecoderContext *p7dcx); - -/* - * NSS_CMSMessage_CreateFromDER - decode a CMS message from DER encoded data - */ -extern NSSCMSMessage * -NSS_CMSMessage_CreateFromDER(SECItem *DERmessage, - NSSCMSContentCallback cb, void *cb_arg, - PK11PasswordFunc pwfn, void *pwfn_arg, - NSSCMSGetDecryptKeyCallback decrypt_key_cb, void *decrypt_key_cb_arg); - -/************************************************************************ - * cmsencode.c - CMS encoding - ************************************************************************/ - -/* - * NSS_CMSEncoder_Start - set up encoding of a CMS message - * - * "cmsg" - message to encode - * "outputfn", "outputarg" - callback function for delivery of DER-encoded output - * will not be called if NULL. - * "dest" - if non-NULL, pointer to SECItem that will hold the DER-encoded output - * "destpoolp" - pool to allocate DER-encoded output in - * "pwfn", pwfn_arg" - callback function for getting token password - * "decrypt_key_cb", "decrypt_key_cb_arg" - callback function for getting bulk key for encryptedData - * "detached_digestalgs", "detached_digests" - digests from detached content - */ -extern NSSCMSEncoderContext * -NSS_CMSEncoder_Start(NSSCMSMessage *cmsg, - NSSCMSContentCallback outputfn, void *outputarg, - SECItem *dest, PLArenaPool *destpoolp, - PK11PasswordFunc pwfn, void *pwfn_arg, - NSSCMSGetDecryptKeyCallback decrypt_key_cb, void *decrypt_key_cb_arg, - SECAlgorithmID **detached_digestalgs, SECItem **detached_digests); - -/* - * NSS_CMSEncoder_Update - take content data delivery from the user - * - * "p7ecx" - encoder context - * "data" - content data - * "len" - length of content data - */ -extern SECStatus -NSS_CMSEncoder_Update(NSSCMSEncoderContext *p7ecx, const char *data, unsigned long len); - -/* - * NSS_CMSEncoder_Cancel - stop all encoding - */ -extern SECStatus -NSS_CMSEncoder_Cancel(NSSCMSEncoderContext *p7ecx); - -/* - * NSS_CMSEncoder_Finish - signal the end of data - * - * we need to walk down the chain of encoders and the finish them from the innermost out - */ -extern SECStatus -NSS_CMSEncoder_Finish(NSSCMSEncoderContext *p7ecx); - -/************************************************************************ - * cmsmessage.c - CMS message object - ************************************************************************/ - -/* - * NSS_CMSMessage_Create - create a CMS message object - * - * "poolp" - arena to allocate memory from, or NULL if new arena should be created - */ -extern NSSCMSMessage * -NSS_CMSMessage_Create(PLArenaPool *poolp); - -/* - * NSS_CMSMessage_SetEncodingParams - set up a CMS message object for encoding or decoding - * - * "cmsg" - message object - * "pwfn", pwfn_arg" - callback function for getting token password - * "decrypt_key_cb", "decrypt_key_cb_arg" - callback function for getting bulk key for encryptedData - * "detached_digestalgs", "detached_digests" - digests from detached content - * - * used internally. - */ -extern void -NSS_CMSMessage_SetEncodingParams(NSSCMSMessage *cmsg, - PK11PasswordFunc pwfn, void *pwfn_arg, - NSSCMSGetDecryptKeyCallback decrypt_key_cb, void *decrypt_key_cb_arg, - SECAlgorithmID **detached_digestalgs, SECItem **detached_digests); - -/* - * NSS_CMSMessage_Destroy - destroy a CMS message and all of its sub-pieces. - */ -extern void -NSS_CMSMessage_Destroy(NSSCMSMessage *cmsg); - -/* - * NSS_CMSMessage_Copy - return a copy of the given message. - * - * The copy may be virtual or may be real -- either way, the result needs - * to be passed to NSS_CMSMessage_Destroy later (as does the original). - */ -extern NSSCMSMessage * -NSS_CMSMessage_Copy(NSSCMSMessage *cmsg); - -/* - * NSS_CMSMessage_GetArena - return a pointer to the message's arena pool - */ -extern PLArenaPool * -NSS_CMSMessage_GetArena(NSSCMSMessage *cmsg); - -/* - * NSS_CMSMessage_GetContentInfo - return a pointer to the top level contentInfo - */ -extern NSSCMSContentInfo * -NSS_CMSMessage_GetContentInfo(NSSCMSMessage *cmsg); - -/* - * Return a pointer to the actual content. - * In the case of those types which are encrypted, this returns the *plain* content. - * In case of nested contentInfos, this descends and retrieves the innermost content. - */ -extern SECItem * -NSS_CMSMessage_GetContent(NSSCMSMessage *cmsg); - -/* - * NSS_CMSMessage_ContentLevelCount - count number of levels of CMS content objects in this message - * - * CMS data content objects do not count. - */ -extern int -NSS_CMSMessage_ContentLevelCount(NSSCMSMessage *cmsg); - -/* - * NSS_CMSMessage_ContentLevel - find content level #n - * - * CMS data content objects do not count. - */ -extern NSSCMSContentInfo * -NSS_CMSMessage_ContentLevel(NSSCMSMessage *cmsg, int n); - -/* - * NSS_CMSMessage_ContainsCertsOrCrls - see if message contains certs along the way - */ -extern PRBool -NSS_CMSMessage_ContainsCertsOrCrls(NSSCMSMessage *cmsg); - -/* - * NSS_CMSMessage_IsEncrypted - see if message contains a encrypted submessage - */ -extern PRBool -NSS_CMSMessage_IsEncrypted(NSSCMSMessage *cmsg); - -/* - * NSS_CMSMessage_IsSigned - see if message contains a signed submessage - * - * If the CMS message has a SignedData with a signature (not just a SignedData) - * return true; false otherwise. This can/should be called before calling - * VerifySignature, which will always indicate failure if no signature is - * present, but that does not mean there even was a signature! - * Note that the content itself can be empty (detached content was sent - * another way); it is the presence of the signature that matters. - */ -extern PRBool -NSS_CMSMessage_IsSigned(NSSCMSMessage *cmsg); - -/* - * NSS_CMSMessage_IsContentEmpty - see if content is empty - * - * returns PR_TRUE is innermost content length is < minLen - * XXX need the encrypted content length (why?) - */ -extern PRBool -NSS_CMSMessage_IsContentEmpty(NSSCMSMessage *cmsg, unsigned int minLen); - -/************************************************************************ - * cmscinfo.c - CMS contentInfo methods - ************************************************************************/ - -/* - * NSS_CMSContentInfo_Destroy - destroy a CMS contentInfo and all of its sub-pieces. - */ -extern void -NSS_CMSContentInfo_Destroy(NSSCMSContentInfo *cinfo); - -/* - * NSS_CMSContentInfo_GetChildContentInfo - get content's contentInfo (if it exists) - */ -extern NSSCMSContentInfo * -NSS_CMSContentInfo_GetChildContentInfo(NSSCMSContentInfo *cinfo); - -/* - * NSS_CMSContentInfo_SetContent - set cinfo's content type & content to CMS object - */ -extern SECStatus -NSS_CMSContentInfo_SetContent(NSSCMSMessage *cmsg, NSSCMSContentInfo *cinfo, SECOidTag type, void *ptr); - -/* - * NSS_CMSContentInfo_SetContent_XXXX - typesafe wrappers for NSS_CMSContentInfo_SetType - * set cinfo's content type & content to CMS object - */ -extern SECStatus -NSS_CMSContentInfo_SetContent_Data(NSSCMSMessage *cmsg, NSSCMSContentInfo *cinfo, SECItem *data, PRBool detached); - -extern SECStatus -NSS_CMSContentInfo_SetContent_SignedData(NSSCMSMessage *cmsg, NSSCMSContentInfo *cinfo, NSSCMSSignedData *sigd); - -extern SECStatus -NSS_CMSContentInfo_SetContent_EnvelopedData(NSSCMSMessage *cmsg, NSSCMSContentInfo *cinfo, NSSCMSEnvelopedData *envd); - -extern SECStatus -NSS_CMSContentInfo_SetContent_DigestedData(NSSCMSMessage *cmsg, NSSCMSContentInfo *cinfo, NSSCMSDigestedData *digd); - -extern SECStatus -NSS_CMSContentInfo_SetContent_EncryptedData(NSSCMSMessage *cmsg, NSSCMSContentInfo *cinfo, NSSCMSEncryptedData *encd); - -/* - * turn off streaming for this content type. - * This could fail with SEC_ERROR_NO_MEMORY in memory constrained conditions. - */ -extern SECStatus -NSS_CMSContentInfo_SetDontStream(NSSCMSContentInfo *cinfo, PRBool dontStream); - - -/* - * NSS_CMSContentInfo_GetContent - get pointer to inner content - * - * needs to be casted... - */ -extern void * -NSS_CMSContentInfo_GetContent(NSSCMSContentInfo *cinfo); - -/* - * NSS_CMSContentInfo_GetInnerContent - get pointer to innermost content - * - * this is typically only called by NSS_CMSMessage_GetContent() - */ -extern SECItem * -NSS_CMSContentInfo_GetInnerContent(NSSCMSContentInfo *cinfo); - -/* - * NSS_CMSContentInfo_GetContentType{Tag,OID} - find out (saving pointer to lookup result - * for future reference) and return the inner content type. - */ -extern SECOidTag -NSS_CMSContentInfo_GetContentTypeTag(NSSCMSContentInfo *cinfo); - -extern SECItem * -NSS_CMSContentInfo_GetContentTypeOID(NSSCMSContentInfo *cinfo); - -/* - * NSS_CMSContentInfo_GetContentEncAlgTag - find out (saving pointer to lookup result - * for future reference) and return the content encryption algorithm tag. - */ -extern SECOidTag -NSS_CMSContentInfo_GetContentEncAlgTag(NSSCMSContentInfo *cinfo); - -/* - * NSS_CMSContentInfo_GetContentEncAlg - find out and return the content encryption algorithm tag. - */ -extern SECAlgorithmID * -NSS_CMSContentInfo_GetContentEncAlg(NSSCMSContentInfo *cinfo); - -extern SECStatus -NSS_CMSContentInfo_SetContentEncAlg(PLArenaPool *poolp, NSSCMSContentInfo *cinfo, - SECOidTag bulkalgtag, SECItem *parameters, int keysize); - -extern SECStatus -NSS_CMSContentInfo_SetContentEncAlgID(PLArenaPool *poolp, NSSCMSContentInfo *cinfo, - SECAlgorithmID *algid, int keysize); - -extern void -NSS_CMSContentInfo_SetBulkKey(NSSCMSContentInfo *cinfo, PK11SymKey *bulkkey); - -extern PK11SymKey * -NSS_CMSContentInfo_GetBulkKey(NSSCMSContentInfo *cinfo); - -extern int -NSS_CMSContentInfo_GetBulkKeySize(NSSCMSContentInfo *cinfo); - -/************************************************************************ - * cmsutil.c - CMS misc utility functions - ************************************************************************/ - -/* - * NSS_CMSArray_SortByDER - sort array of objects by objects' DER encoding - * - * make sure that the order of the objects guarantees valid DER (which must be - * in lexigraphically ascending order for a SET OF); if reordering is necessary it - * will be done in place (in objs). - */ -extern SECStatus -NSS_CMSArray_SortByDER(void **objs, const SEC_ASN1Template *objtemplate, void **objs2); - -/* - * NSS_CMSUtil_DERCompare - for use with NSS_CMSArray_Sort to - * sort arrays of SECItems containing DER - */ -extern int -NSS_CMSUtil_DERCompare(void *a, void *b); - -/* - * NSS_CMSAlgArray_GetIndexByAlgID - find a specific algorithm in an array of - * algorithms. - * - * algorithmArray - array of algorithm IDs - * algid - algorithmid of algorithm to pick - * - * Returns: - * An integer containing the index of the algorithm in the array or -1 if - * algorithm was not found. - */ -extern int -NSS_CMSAlgArray_GetIndexByAlgID(SECAlgorithmID **algorithmArray, SECAlgorithmID *algid); - -/* - * NSS_CMSAlgArray_GetIndexByAlgID - find a specific algorithm in an array of - * algorithms. - * - * algorithmArray - array of algorithm IDs - * algiddata - id of algorithm to pick - * - * Returns: - * An integer containing the index of the algorithm in the array or -1 if - * algorithm was not found. - */ -extern int -NSS_CMSAlgArray_GetIndexByAlgTag(SECAlgorithmID **algorithmArray, SECOidTag algtag); - -extern const SECHashObject * -NSS_CMSUtil_GetHashObjByAlgID(SECAlgorithmID *algid); - -extern const SEC_ASN1Template * -NSS_CMSUtil_GetTemplateByTypeTag(SECOidTag type); - -extern size_t -NSS_CMSUtil_GetSizeByTypeTag(SECOidTag type); - -extern NSSCMSContentInfo * -NSS_CMSContent_GetContentInfo(void *msg, SECOidTag type); - -extern const char * -NSS_CMSUtil_VerificationStatusToString(NSSCMSVerificationStatus vs); - -/************************************************************************ - * cmssigdata.c - CMS signedData methods - ************************************************************************/ - -extern NSSCMSSignedData * -NSS_CMSSignedData_Create(NSSCMSMessage *cmsg); - -extern void -NSS_CMSSignedData_Destroy(NSSCMSSignedData *sigd); - -/* - * NSS_CMSSignedData_Encode_BeforeStart - do all the necessary things to a SignedData - * before start of encoding. - * - * In detail: - * - find out about the right value to put into sigd->version - * - come up with a list of digestAlgorithms (which should be the union of the algorithms - * in the signerinfos). - * If we happen to have a pre-set list of algorithms (and digest values!), we - * check if we have all the signerinfos' algorithms. If not, this is an error. - */ -extern SECStatus -NSS_CMSSignedData_Encode_BeforeStart(NSSCMSSignedData *sigd); - -extern SECStatus -NSS_CMSSignedData_Encode_BeforeData(NSSCMSSignedData *sigd); - -/* - * NSS_CMSSignedData_Encode_AfterData - do all the necessary things to a SignedData - * after all the encapsulated data was passed through the encoder. - * - * In detail: - * - create the signatures in all the SignerInfos - * - * Please note that nothing is done to the Certificates and CRLs in the message - this - * is entirely the responsibility of our callers. - */ -extern SECStatus -NSS_CMSSignedData_Encode_AfterData(NSSCMSSignedData *sigd); - -extern SECStatus -NSS_CMSSignedData_Decode_BeforeData(NSSCMSSignedData *sigd); - -/* - * NSS_CMSSignedData_Decode_AfterData - do all the necessary things to a SignedData - * after all the encapsulated data was passed through the decoder. - */ -extern SECStatus -NSS_CMSSignedData_Decode_AfterData(NSSCMSSignedData *sigd); - -/* - * NSS_CMSSignedData_Decode_AfterEnd - do all the necessary things to a SignedData - * after all decoding is finished. - */ -extern SECStatus -NSS_CMSSignedData_Decode_AfterEnd(NSSCMSSignedData *sigd); - -/* - * NSS_CMSSignedData_GetSignerInfos - retrieve the SignedData's signer list - */ -extern NSSCMSSignerInfo ** -NSS_CMSSignedData_GetSignerInfos(NSSCMSSignedData *sigd); - -extern int -NSS_CMSSignedData_SignerInfoCount(NSSCMSSignedData *sigd); - -extern NSSCMSSignerInfo * -NSS_CMSSignedData_GetSignerInfo(NSSCMSSignedData *sigd, int i); - -/* - * NSS_CMSSignedData_GetDigestAlgs - retrieve the SignedData's digest algorithm list - */ -extern SECAlgorithmID ** -NSS_CMSSignedData_GetDigestAlgs(NSSCMSSignedData *sigd); - -/* - * NSS_CMSSignedData_GetContentInfo - return pointer to this signedData's contentinfo - */ -extern NSSCMSContentInfo * -NSS_CMSSignedData_GetContentInfo(NSSCMSSignedData *sigd); - -/* - * NSS_CMSSignedData_GetCertificateList - retrieve the SignedData's certificate list - */ -extern SECItem ** -NSS_CMSSignedData_GetCertificateList(NSSCMSSignedData *sigd); - -extern SECStatus -NSS_CMSSignedData_ImportCerts(NSSCMSSignedData *sigd, CERTCertDBHandle *certdb, - SECCertUsage certusage, PRBool keepcerts); - -/* - * NSS_CMSSignedData_HasDigests - see if we have digests in place - */ -extern PRBool -NSS_CMSSignedData_HasDigests(NSSCMSSignedData *sigd); - -/* - * NSS_CMSSignedData_VerifySignerInfo - check a signature. - * - * The digests were either calculated during decoding (and are stored in the - * signedData itself) or set after decoding using NSS_CMSSignedData_SetDigests. - * - * The verification checks if the signing cert is valid and has a trusted chain - * for the purpose specified by "certusage". - */ -extern SECStatus -NSS_CMSSignedData_VerifySignerInfo(NSSCMSSignedData *sigd, int i, CERTCertDBHandle *certdb, - SECCertUsage certusage); - -/* - * NSS_CMSSignedData_VerifyCertsOnly - verify the certs in a certs-only message -*/ -extern SECStatus -NSS_CMSSignedData_VerifyCertsOnly(NSSCMSSignedData *sigd, - CERTCertDBHandle *certdb, - SECCertUsage usage); - -extern SECStatus -NSS_CMSSignedData_AddCertList(NSSCMSSignedData *sigd, CERTCertificateList *certlist); - -/* - * NSS_CMSSignedData_AddCertChain - add cert and its entire chain to the set of certs - */ -extern SECStatus -NSS_CMSSignedData_AddCertChain(NSSCMSSignedData *sigd, CERTCertificate *cert); - -extern SECStatus -NSS_CMSSignedData_AddCertificate(NSSCMSSignedData *sigd, CERTCertificate *cert); - -extern PRBool -NSS_CMSSignedData_ContainsCertsOrCrls(NSSCMSSignedData *sigd); - -extern SECStatus -NSS_CMSSignedData_AddSignerInfo(NSSCMSSignedData *sigd, - NSSCMSSignerInfo *signerinfo); - -extern SECStatus -NSS_CMSSignedData_SetDigests(NSSCMSSignedData *sigd, - SECAlgorithmID **digestalgs, - SECItem **digests); - -extern SECStatus -NSS_CMSSignedData_SetDigestValue(NSSCMSSignedData *sigd, - SECOidTag digestalgtag, - SECItem *digestdata); - -extern SECStatus -NSS_CMSSignedData_AddDigest(PLArenaPool *poolp, - NSSCMSSignedData *sigd, - SECOidTag digestalgtag, - SECItem *digest); - -extern SECItem * -NSS_CMSSignedData_GetDigestValue(NSSCMSSignedData *sigd, SECOidTag digestalgtag); - -/* - * NSS_CMSSignedData_CreateCertsOnly - create a certs-only SignedData. - * - * cert - base certificates that will be included - * include_chain - if true, include the complete cert chain for cert - * - * More certs and chains can be added via AddCertificate and AddCertChain. - * - * An error results in a return value of NULL and an error set. - */ -extern NSSCMSSignedData * -NSS_CMSSignedData_CreateCertsOnly(NSSCMSMessage *cmsg, CERTCertificate *cert, PRBool include_chain); - -/************************************************************************ - * cmssiginfo.c - signerinfo methods - ************************************************************************/ - -extern NSSCMSSignerInfo * -NSS_CMSSignerInfo_Create(NSSCMSMessage *cmsg, CERTCertificate *cert, SECOidTag digestalgtag); -extern NSSCMSSignerInfo * -NSS_CMSSignerInfo_CreateWithSubjKeyID(NSSCMSMessage *cmsg, SECItem *subjKeyID, SECKEYPublicKey *pubKey, SECKEYPrivateKey *signingKey, SECOidTag digestalgtag); - -/* - * NSS_CMSSignerInfo_Destroy - destroy a SignerInfo data structure - */ -extern void -NSS_CMSSignerInfo_Destroy(NSSCMSSignerInfo *si); - -/* - * NSS_CMSSignerInfo_Sign - sign something - * - */ -extern SECStatus -NSS_CMSSignerInfo_Sign(NSSCMSSignerInfo *signerinfo, SECItem *digest, SECItem *contentType); - -extern SECStatus -NSS_CMSSignerInfo_VerifyCertificate(NSSCMSSignerInfo *signerinfo, CERTCertDBHandle *certdb, - SECCertUsage certusage); - -/* - * NSS_CMSSignerInfo_Verify - verify the signature of a single SignerInfo - * - * Just verifies the signature. The assumption is that verification of the certificate - * is done already. - */ -extern SECStatus -NSS_CMSSignerInfo_Verify(NSSCMSSignerInfo *signerinfo, SECItem *digest, SECItem *contentType); - -extern NSSCMSVerificationStatus -NSS_CMSSignerInfo_GetVerificationStatus(NSSCMSSignerInfo *signerinfo); - -extern SECOidData * -NSS_CMSSignerInfo_GetDigestAlg(NSSCMSSignerInfo *signerinfo); - -extern SECOidTag -NSS_CMSSignerInfo_GetDigestAlgTag(NSSCMSSignerInfo *signerinfo); - -extern int -NSS_CMSSignerInfo_GetVersion(NSSCMSSignerInfo *signerinfo); - -extern CERTCertificateList * -NSS_CMSSignerInfo_GetCertList(NSSCMSSignerInfo *signerinfo); - -/* - * NSS_CMSSignerInfo_GetSigningTime - return the signing time, - * in UTCTime format, of a CMS signerInfo. - * - * sinfo - signerInfo data for this signer - * - * Returns a pointer to XXXX (what?) - * A return value of NULL is an error. - */ -extern SECStatus -NSS_CMSSignerInfo_GetSigningTime(NSSCMSSignerInfo *sinfo, PRTime *stime); - -/* - * Return the signing cert of a CMS signerInfo. - * - * the certs in the enclosing SignedData must have been imported already - */ -extern CERTCertificate * -NSS_CMSSignerInfo_GetSigningCertificate(NSSCMSSignerInfo *signerinfo, CERTCertDBHandle *certdb); - -/* - * NSS_CMSSignerInfo_GetSignerCommonName - return the common name of the signer - * - * sinfo - signerInfo data for this signer - * - * Returns a pointer to allocated memory, which must be freed with PORT_Free. - * A return value of NULL is an error. - */ -extern char * -NSS_CMSSignerInfo_GetSignerCommonName(NSSCMSSignerInfo *sinfo); - -/* - * NSS_CMSSignerInfo_GetSignerEmailAddress - return the common name of the signer - * - * sinfo - signerInfo data for this signer - * - * Returns a pointer to allocated memory, which must be freed. - * A return value of NULL is an error. - */ -extern char * -NSS_CMSSignerInfo_GetSignerEmailAddress(NSSCMSSignerInfo *sinfo); - -/* - * NSS_CMSSignerInfo_AddAuthAttr - add an attribute to the - * authenticated (i.e. signed) attributes of "signerinfo". - */ -extern SECStatus -NSS_CMSSignerInfo_AddAuthAttr(NSSCMSSignerInfo *signerinfo, NSSCMSAttribute *attr); - -/* - * NSS_CMSSignerInfo_AddUnauthAttr - add an attribute to the - * unauthenticated attributes of "signerinfo". - */ -extern SECStatus -NSS_CMSSignerInfo_AddUnauthAttr(NSSCMSSignerInfo *signerinfo, NSSCMSAttribute *attr); - -/* - * NSS_CMSSignerInfo_AddSigningTime - add the signing time to the - * authenticated (i.e. signed) attributes of "signerinfo". - * - * This is expected to be included in outgoing signed - * messages for email (S/MIME) but is likely useful in other situations. - * - * This should only be added once; a second call will do nothing. - * - * XXX This will probably just shove the current time into "signerinfo" - * but it will not actually get signed until the entire item is - * processed for encoding. Is this (expected to be small) delay okay? - */ -extern SECStatus -NSS_CMSSignerInfo_AddSigningTime(NSSCMSSignerInfo *signerinfo, PRTime t); - -/* - * NSS_CMSSignerInfo_AddSMIMECaps - add a SMIMECapabilities attribute to the - * authenticated (i.e. signed) attributes of "signerinfo". - * - * This is expected to be included in outgoing signed - * messages for email (S/MIME). - */ -extern SECStatus -NSS_CMSSignerInfo_AddSMIMECaps(NSSCMSSignerInfo *signerinfo); - -/* - * NSS_CMSSignerInfo_AddSMIMEEncKeyPrefs - add a SMIMEEncryptionKeyPreferences attribute to the - * authenticated (i.e. signed) attributes of "signerinfo". - * - * This is expected to be included in outgoing signed messages for email (S/MIME). - */ -SECStatus -NSS_CMSSignerInfo_AddSMIMEEncKeyPrefs(NSSCMSSignerInfo *signerinfo, CERTCertificate *cert, CERTCertDBHandle *certdb); - -/* - * NSS_CMSSignerInfo_AddMSSMIMEEncKeyPrefs - add a SMIMEEncryptionKeyPreferences attribute to the - * authenticated (i.e. signed) attributes of "signerinfo", using the OID preferred by Microsoft. - * - * This is expected to be included in outgoing signed messages for email (S/MIME), - * if compatibility with Microsoft mail clients is wanted. - */ -SECStatus -NSS_CMSSignerInfo_AddMSSMIMEEncKeyPrefs(NSSCMSSignerInfo *signerinfo, CERTCertificate *cert, CERTCertDBHandle *certdb); - -/* - * NSS_CMSSignerInfo_AddCounterSignature - countersign a signerinfo - */ -extern SECStatus -NSS_CMSSignerInfo_AddCounterSignature(NSSCMSSignerInfo *signerinfo, - SECOidTag digestalg, CERTCertificate signingcert); - -/* - * XXXX the following needs to be done in the S/MIME layer code - * after signature of a signerinfo is verified - */ -extern SECStatus -NSS_SMIMESignerInfo_SaveSMIMEProfile(NSSCMSSignerInfo *signerinfo); - -/* - * NSS_CMSSignerInfo_IncludeCerts - set cert chain inclusion mode for this signer - */ -extern SECStatus -NSS_CMSSignerInfo_IncludeCerts(NSSCMSSignerInfo *signerinfo, NSSCMSCertChainMode cm, SECCertUsage usage); - -/************************************************************************ - * cmsenvdata.c - CMS envelopedData methods - ************************************************************************/ - -/* - * NSS_CMSEnvelopedData_Create - create an enveloped data message - */ -extern NSSCMSEnvelopedData * -NSS_CMSEnvelopedData_Create(NSSCMSMessage *cmsg, SECOidTag algorithm, int keysize); - -/* - * NSS_CMSEnvelopedData_Destroy - destroy an enveloped data message - */ -extern void -NSS_CMSEnvelopedData_Destroy(NSSCMSEnvelopedData *edp); - -/* - * NSS_CMSEnvelopedData_GetContentInfo - return pointer to this envelopedData's contentinfo - */ -extern NSSCMSContentInfo * -NSS_CMSEnvelopedData_GetContentInfo(NSSCMSEnvelopedData *envd); - -/* - * NSS_CMSEnvelopedData_AddRecipient - add a recipientinfo to the enveloped data msg - * - * rip must be created on the same pool as edp - this is not enforced, though. - */ -extern SECStatus -NSS_CMSEnvelopedData_AddRecipient(NSSCMSEnvelopedData *edp, NSSCMSRecipientInfo *rip); - -/* - * NSS_CMSEnvelopedData_Encode_BeforeStart - prepare this envelopedData for encoding - * - * at this point, we need - * - recipientinfos set up with recipient's certificates - * - a content encryption algorithm (if none, 3DES will be used) - * - * this function will generate a random content encryption key (aka bulk key), - * initialize the recipientinfos with certificate identification and wrap the bulk key - * using the proper algorithm for every certificiate. - * it will finally set the bulk algorithm and key so that the encode step can find it. - */ -extern SECStatus -NSS_CMSEnvelopedData_Encode_BeforeStart(NSSCMSEnvelopedData *envd); - -/* - * NSS_CMSEnvelopedData_Encode_BeforeData - set up encryption - */ -extern SECStatus -NSS_CMSEnvelopedData_Encode_BeforeData(NSSCMSEnvelopedData *envd); - -/* - * NSS_CMSEnvelopedData_Encode_AfterData - finalize this envelopedData for encoding - */ -extern SECStatus -NSS_CMSEnvelopedData_Encode_AfterData(NSSCMSEnvelopedData *envd); - -/* - * NSS_CMSEnvelopedData_Decode_BeforeData - find our recipientinfo, - * derive bulk key & set up our contentinfo - */ -extern SECStatus -NSS_CMSEnvelopedData_Decode_BeforeData(NSSCMSEnvelopedData *envd); - -/* - * NSS_CMSEnvelopedData_Decode_AfterData - finish decrypting this envelopedData's content - */ -extern SECStatus -NSS_CMSEnvelopedData_Decode_AfterData(NSSCMSEnvelopedData *envd); - -/* - * NSS_CMSEnvelopedData_Decode_AfterEnd - finish decoding this envelopedData - */ -extern SECStatus -NSS_CMSEnvelopedData_Decode_AfterEnd(NSSCMSEnvelopedData *envd); - - -/************************************************************************ - * cmsrecinfo.c - CMS recipientInfo methods - ************************************************************************/ - -/* - * NSS_CMSRecipientInfo_Create - create a recipientinfo - * - * we currently do not create KeyAgreement recipientinfos with multiple recipientEncryptedKeys - * the certificate is supposed to have been verified by the caller - */ -extern NSSCMSRecipientInfo * -NSS_CMSRecipientInfo_Create(NSSCMSMessage *cmsg, CERTCertificate *cert); - -extern NSSCMSRecipientInfo * -NSS_CMSRecipientInfo_CreateWithSubjKeyID(NSSCMSMessage *cmsg, - SECItem *subjKeyID, - SECKEYPublicKey *pubKey); - -extern NSSCMSRecipientInfo * -NSS_CMSRecipientInfo_CreateWithSubjKeyIDFromCert(NSSCMSMessage *cmsg, - CERTCertificate *cert); - -/* - * NSS_CMSRecipientInfo_CreateNew - create a blank recipientinfo for - * applications which want to encode their own CMS structures and - * key exchange types. - */ -extern NSSCMSRecipientInfo * -NSS_CMSRecipientInfo_CreateNew(void* pwfn_arg); - -/* - * NSS_CMSRecipientInfo_CreateFromDER - create a recipientinfo from partially - * decoded DER data for applications which want to encode their own CMS - * structures and key exchange types. - */ -extern NSSCMSRecipientInfo * -NSS_CMSRecipientInfo_CreateFromDER(SECItem* input, void* pwfn_arg); - -extern void -NSS_CMSRecipientInfo_Destroy(NSSCMSRecipientInfo *ri); - -/* - * NSS_CMSRecipientInfo_GetCertAndKey - retrieve the cert and key from the - * recipientInfo struct. If retcert or retkey are NULL, the cert or - * key (respectively) would not be returned). This function is a no-op if both - * retcert and retkey are NULL. Caller inherits ownership of the cert and key - * he requested (and is responsible to free them). - */ -SECStatus NSS_CMSRecipientInfo_GetCertAndKey(NSSCMSRecipientInfo *ri, - CERTCertificate** retcert, SECKEYPrivateKey** retkey); - -extern int -NSS_CMSRecipientInfo_GetVersion(NSSCMSRecipientInfo *ri); - -extern SECItem * -NSS_CMSRecipientInfo_GetEncryptedKey(NSSCMSRecipientInfo *ri, int subIndex); - -/* - * NSS_CMSRecipientInfo_Encode - encode an NSS_CMSRecipientInfo as ASN.1 - */ -SECStatus NSS_CMSRecipientInfo_Encode(PLArenaPool* poolp, - const NSSCMSRecipientInfo *src, - SECItem* returned); - -extern SECOidTag -NSS_CMSRecipientInfo_GetKeyEncryptionAlgorithmTag(NSSCMSRecipientInfo *ri); - -extern SECStatus -NSS_CMSRecipientInfo_WrapBulkKey(NSSCMSRecipientInfo *ri, PK11SymKey *bulkkey, SECOidTag bulkalgtag); - -extern PK11SymKey * -NSS_CMSRecipientInfo_UnwrapBulkKey(NSSCMSRecipientInfo *ri, int subIndex, - CERTCertificate *cert, SECKEYPrivateKey *privkey, SECOidTag bulkalgtag); - -/************************************************************************ - * cmsencdata.c - CMS encryptedData methods - ************************************************************************/ -/* - * NSS_CMSEncryptedData_Create - create an empty encryptedData object. - * - * "algorithm" specifies the bulk encryption algorithm to use. - * "keysize" is the key size. - * - * An error results in a return value of NULL and an error set. - * (Retrieve specific errors via PORT_GetError()/XP_GetError().) - */ -extern NSSCMSEncryptedData * -NSS_CMSEncryptedData_Create(NSSCMSMessage *cmsg, SECOidTag algorithm, int keysize); - -/* - * NSS_CMSEncryptedData_Destroy - destroy an encryptedData object - */ -extern void -NSS_CMSEncryptedData_Destroy(NSSCMSEncryptedData *encd); - -/* - * NSS_CMSEncryptedData_GetContentInfo - return pointer to encryptedData object's contentInfo - */ -extern NSSCMSContentInfo * -NSS_CMSEncryptedData_GetContentInfo(NSSCMSEncryptedData *encd); - -/* - * NSS_CMSEncryptedData_Encode_BeforeStart - do all the necessary things to a EncryptedData - * before encoding begins. - * - * In particular: - * - set the correct version value. - * - get the encryption key - */ -extern SECStatus -NSS_CMSEncryptedData_Encode_BeforeStart(NSSCMSEncryptedData *encd); - -/* - * NSS_CMSEncryptedData_Encode_BeforeData - set up encryption - */ -extern SECStatus -NSS_CMSEncryptedData_Encode_BeforeData(NSSCMSEncryptedData *encd); - -/* - * NSS_CMSEncryptedData_Encode_AfterData - finalize this encryptedData for encoding - */ -extern SECStatus -NSS_CMSEncryptedData_Encode_AfterData(NSSCMSEncryptedData *encd); - -/* - * NSS_CMSEncryptedData_Decode_BeforeData - find bulk key & set up decryption - */ -extern SECStatus -NSS_CMSEncryptedData_Decode_BeforeData(NSSCMSEncryptedData *encd); - -/* - * NSS_CMSEncryptedData_Decode_AfterData - finish decrypting this encryptedData's content - */ -extern SECStatus -NSS_CMSEncryptedData_Decode_AfterData(NSSCMSEncryptedData *encd); - -/* - * NSS_CMSEncryptedData_Decode_AfterEnd - finish decoding this encryptedData - */ -extern SECStatus -NSS_CMSEncryptedData_Decode_AfterEnd(NSSCMSEncryptedData *encd); - -/************************************************************************ - * cmsdigdata.c - CMS encryptedData methods - ************************************************************************/ -/* - * NSS_CMSDigestedData_Create - create a digestedData object (presumably for encoding) - * - * version will be set by NSS_CMSDigestedData_Encode_BeforeStart - * digestAlg is passed as parameter - * contentInfo must be filled by the user - * digest will be calculated while encoding - */ -extern NSSCMSDigestedData * -NSS_CMSDigestedData_Create(NSSCMSMessage *cmsg, SECAlgorithmID *digestalg); - -/* - * NSS_CMSDigestedData_Destroy - destroy a digestedData object - */ -extern void -NSS_CMSDigestedData_Destroy(NSSCMSDigestedData *digd); - -/* - * NSS_CMSDigestedData_GetContentInfo - return pointer to digestedData object's contentInfo - */ -extern NSSCMSContentInfo * -NSS_CMSDigestedData_GetContentInfo(NSSCMSDigestedData *digd); - -/* - * NSS_CMSDigestedData_Encode_BeforeStart - do all the necessary things to a DigestedData - * before encoding begins. - * - * In particular: - * - set the right version number. The contentInfo's content type must be set up already. - */ -extern SECStatus -NSS_CMSDigestedData_Encode_BeforeStart(NSSCMSDigestedData *digd); - -/* - * NSS_CMSDigestedData_Encode_BeforeData - do all the necessary things to a DigestedData - * before the encapsulated data is passed through the encoder. - * - * In detail: - * - set up the digests if necessary - */ -extern SECStatus -NSS_CMSDigestedData_Encode_BeforeData(NSSCMSDigestedData *digd); - -/* - * NSS_CMSDigestedData_Encode_AfterData - do all the necessary things to a DigestedData - * after all the encapsulated data was passed through the encoder. - * - * In detail: - * - finish the digests - */ -extern SECStatus -NSS_CMSDigestedData_Encode_AfterData(NSSCMSDigestedData *digd); - -/* - * NSS_CMSDigestedData_Decode_BeforeData - do all the necessary things to a DigestedData - * before the encapsulated data is passed through the encoder. - * - * In detail: - * - set up the digests if necessary - */ -extern SECStatus -NSS_CMSDigestedData_Decode_BeforeData(NSSCMSDigestedData *digd); - -/* - * NSS_CMSDigestedData_Decode_AfterData - do all the necessary things to a DigestedData - * after all the encapsulated data was passed through the encoder. - * - * In detail: - * - finish the digests - */ -extern SECStatus -NSS_CMSDigestedData_Decode_AfterData(NSSCMSDigestedData *digd); - -/* - * NSS_CMSDigestedData_Decode_AfterEnd - finalize a digestedData. - * - * In detail: - * - check the digests for equality - */ -extern SECStatus -NSS_CMSDigestedData_Decode_AfterEnd(NSSCMSDigestedData *digd); - -/************************************************************************ - * cmsdigest.c - digestion routines - ************************************************************************/ - -/* - * NSS_CMSDigestContext_StartMultiple - start digest calculation using all the - * digest algorithms in "digestalgs" in parallel. - */ -extern NSSCMSDigestContext * -NSS_CMSDigestContext_StartMultiple(SECAlgorithmID **digestalgs); - -/* - * NSS_CMSDigestContext_StartSingle - same as NSS_CMSDigestContext_StartMultiple, but - * only one algorithm. - */ -extern NSSCMSDigestContext * -NSS_CMSDigestContext_StartSingle(SECAlgorithmID *digestalg); - -/* - * NSS_CMSDigestContext_Update - feed more data into the digest machine - */ -extern void -NSS_CMSDigestContext_Update(NSSCMSDigestContext *cmsdigcx, const unsigned char *data, int len); - -/* - * NSS_CMSDigestContext_Cancel - cancel digesting operation - */ -extern void -NSS_CMSDigestContext_Cancel(NSSCMSDigestContext *cmsdigcx); - -/* - * NSS_CMSDigestContext_FinishMultiple - finish the digests and put them - * into an array of SECItems (allocated on poolp) - */ -extern SECStatus -NSS_CMSDigestContext_FinishMultiple(NSSCMSDigestContext *cmsdigcx, PLArenaPool *poolp, - SECItem ***digestsp); - -/* - * NSS_CMSDigestContext_FinishSingle - same as NSS_CMSDigestContext_FinishMultiple, - * but for one digest. - */ -extern SECStatus -NSS_CMSDigestContext_FinishSingle(NSSCMSDigestContext *cmsdigcx, PLArenaPool *poolp, - SECItem *digest); - -/************************************************************************ - * - ************************************************************************/ - -/* shortcuts for basic use */ - -/* - * NSS_CMSDEREncode - DER Encode a CMS message, with input being - * the plaintext message and derOut being the output, - * stored in arena's pool. - */ -extern SECStatus -NSS_CMSDEREncode(NSSCMSMessage *cmsg, SECItem *input, SECItem *derOut, - PLArenaPool *arena); - - -/************************************************************************ - * - ************************************************************************/ - -/* - * define new S/MIME content type entries - * - * S/MIME uses the builtin PKCS7 oid types for encoding and decoding the - * various S/MIME content. Some applications have their own content type - * which is different from the standard content type defined by S/MIME. - * - * This function allows you to register new content types. There are basically - * Two different types of content, Wrappping content, and Data. - * - * For data types, All the functions below can be zero or NULL excext - * type and is isData, which should be your oid tag and PR_FALSE respectively - * - * For wrapping types, everything must be provided, or you will get encoder - * failures. - * - * If NSS doesn't already define the OID that you need, you can register - * your own with SECOID_AddEntry. - * - * Once you have defined your new content type, you can pass your new content - * type to NSS_CMSContentInfo_SetContent(). - * - * If you are using a wrapping type you can pass your own data structure in - * the ptr field, but it must contain and embedded NSSCMSGenericWrappingData - * structure as the first element. The size you pass to - * NSS_CMSType_RegisterContentType is the total size of your self defined - * data structure. NSS_CMSContentInfo_GetContent will return that data - * structure from the content info. Your ASN1Template will be evaluated - * against that data structure. - */ -SECStatus NSS_CMSType_RegisterContentType(SECOidTag type, - SEC_ASN1Template *asn1Template, size_t size, - NSSCMSGenericWrapperDataDestroy destroy, - NSSCMSGenericWrapperDataCallback decode_before, - NSSCMSGenericWrapperDataCallback decode_after, - NSSCMSGenericWrapperDataCallback decode_end, - NSSCMSGenericWrapperDataCallback encode_start, - NSSCMSGenericWrapperDataCallback encode_before, - NSSCMSGenericWrapperDataCallback encode_after, - PRBool isData); - -/************************************************************************/ -SEC_END_PROTOS - -#endif /* _CMS_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/smime/cmslocal.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/smime/cmslocal.h deleted file mode 100755 index ee00c05..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/smime/cmslocal.h +++ /dev/null @@ -1,353 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * Support routines for CMS implementation, none of which are exported. - * - * Do not export this file! If something in here is really needed outside - * of smime code, first try to add a CMS interface which will do it for - * you. If that has a problem, then just move out what you need, changing - * its name as appropriate! - */ - -#ifndef _CMSLOCAL_H_ -#define _CMSLOCAL_H_ - -#include "cms.h" -#include "cmsreclist.h" -#include "secasn1t.h" - -extern const SEC_ASN1Template NSSCMSContentInfoTemplate[]; - -struct NSSCMSContentInfoPrivateStr { - NSSCMSCipherContext *ciphcx; - NSSCMSDigestContext *digcx; - PRBool dontStream; -}; - -/************************************************************************/ -SEC_BEGIN_PROTOS - -/* - * private content Info stuff - */ - -/* initialize the private content info field. If this returns - * SECSuccess, the cinfo->private field is safe to dereference. - */ -SECStatus NSS_CMSContentInfo_Private_Init(NSSCMSContentInfo *cinfo); - - -/*********************************************************************** - * cmscipher.c - en/decryption routines - ***********************************************************************/ - -/* - * NSS_CMSCipherContext_StartDecrypt - create a cipher context to do decryption - * based on the given bulk * encryption key and algorithm identifier (which may include an iv). - */ -extern NSSCMSCipherContext * -NSS_CMSCipherContext_StartDecrypt(PK11SymKey *key, SECAlgorithmID *algid); - -/* - * NSS_CMSCipherContext_StartEncrypt - create a cipher object to do encryption, - * based on the given bulk encryption key and algorithm tag. Fill in the algorithm - * identifier (which may include an iv) appropriately. - */ -extern NSSCMSCipherContext * -NSS_CMSCipherContext_StartEncrypt(PLArenaPool *poolp, PK11SymKey *key, SECAlgorithmID *algid); - -extern void -NSS_CMSCipherContext_Destroy(NSSCMSCipherContext *cc); - -/* - * NSS_CMSCipherContext_DecryptLength - find the output length of the next call to decrypt. - * - * cc - the cipher context - * input_len - number of bytes used as input - * final - true if this is the final chunk of data - * - * Result can be used to perform memory allocations. Note that the amount - * is exactly accurate only when not doing a block cipher or when final - * is false, otherwise it is an upper bound on the amount because until - * we see the data we do not know how many padding bytes there are - * (always between 1 and bsize). - */ -extern unsigned int -NSS_CMSCipherContext_DecryptLength(NSSCMSCipherContext *cc, unsigned int input_len, PRBool final); - -/* - * NSS_CMSCipherContext_EncryptLength - find the output length of the next call to encrypt. - * - * cc - the cipher context - * input_len - number of bytes used as input - * final - true if this is the final chunk of data - * - * Result can be used to perform memory allocations. - */ -extern unsigned int -NSS_CMSCipherContext_EncryptLength(NSSCMSCipherContext *cc, unsigned int input_len, PRBool final); - -/* - * NSS_CMSCipherContext_Decrypt - do the decryption - * - * cc - the cipher context - * output - buffer for decrypted result bytes - * output_len_p - number of bytes in output - * max_output_len - upper bound on bytes to put into output - * input - pointer to input bytes - * input_len - number of input bytes - * final - true if this is the final chunk of data - * - * Decrypts a given length of input buffer (starting at "input" and - * containing "input_len" bytes), placing the decrypted bytes in - * "output" and storing the output length in "*output_len_p". - * "cc" is the return value from NSS_CMSCipher_StartDecrypt. - * When "final" is true, this is the last of the data to be decrypted. - */ -extern SECStatus -NSS_CMSCipherContext_Decrypt(NSSCMSCipherContext *cc, unsigned char *output, - unsigned int *output_len_p, unsigned int max_output_len, - const unsigned char *input, unsigned int input_len, - PRBool final); - -/* - * NSS_CMSCipherContext_Encrypt - do the encryption - * - * cc - the cipher context - * output - buffer for decrypted result bytes - * output_len_p - number of bytes in output - * max_output_len - upper bound on bytes to put into output - * input - pointer to input bytes - * input_len - number of input bytes - * final - true if this is the final chunk of data - * - * Encrypts a given length of input buffer (starting at "input" and - * containing "input_len" bytes), placing the encrypted bytes in - * "output" and storing the output length in "*output_len_p". - * "cc" is the return value from NSS_CMSCipher_StartEncrypt. - * When "final" is true, this is the last of the data to be encrypted. - */ -extern SECStatus -NSS_CMSCipherContext_Encrypt(NSSCMSCipherContext *cc, unsigned char *output, - unsigned int *output_len_p, unsigned int max_output_len, - const unsigned char *input, unsigned int input_len, - PRBool final); - -/************************************************************************ - * cmspubkey.c - public key operations - ************************************************************************/ - -/* - * NSS_CMSUtil_EncryptSymKey_RSA - wrap a symmetric key with RSA - * - * this function takes a symmetric key and encrypts it using an RSA public key - * according to PKCS#1 and RFC2633 (S/MIME) - */ -extern SECStatus -NSS_CMSUtil_EncryptSymKey_RSA(PLArenaPool *poolp, CERTCertificate *cert, - PK11SymKey *key, - SECItem *encKey); - -extern SECStatus -NSS_CMSUtil_EncryptSymKey_RSAPubKey(PLArenaPool *poolp, - SECKEYPublicKey *publickey, - PK11SymKey *bulkkey, SECItem *encKey); - -/* - * NSS_CMSUtil_DecryptSymKey_RSA - unwrap a RSA-wrapped symmetric key - * - * this function takes an RSA-wrapped symmetric key and unwraps it, returning a symmetric - * key handle. Please note that the actual unwrapped key data may not be allowed to leave - * a hardware token... - */ -extern PK11SymKey * -NSS_CMSUtil_DecryptSymKey_RSA(SECKEYPrivateKey *privkey, SECItem *encKey, SECOidTag bulkalgtag); - -extern SECStatus -NSS_CMSUtil_EncryptSymKey_ESDH(PLArenaPool *poolp, CERTCertificate *cert, PK11SymKey *key, - SECItem *encKey, SECItem **ukm, SECAlgorithmID *keyEncAlg, - SECItem *originatorPubKey); - -extern PK11SymKey * -NSS_CMSUtil_DecryptSymKey_ESDH(SECKEYPrivateKey *privkey, SECItem *encKey, - SECAlgorithmID *keyEncAlg, SECOidTag bulkalgtag, void *pwfn_arg); - -/************************************************************************ - * cmsreclist.c - recipient list stuff - ************************************************************************/ -extern NSSCMSRecipient **nss_cms_recipient_list_create(NSSCMSRecipientInfo **recipientinfos); -extern void nss_cms_recipient_list_destroy(NSSCMSRecipient **recipient_list); -extern NSSCMSRecipientEncryptedKey *NSS_CMSRecipientEncryptedKey_Create(PLArenaPool *poolp); - -/************************************************************************ - * cmsarray.c - misc array functions - ************************************************************************/ -/* - * NSS_CMSArray_Alloc - allocate an array in an arena - */ -extern void ** -NSS_CMSArray_Alloc(PLArenaPool *poolp, int n); - -/* - * NSS_CMSArray_Add - add an element to the end of an array - */ -extern SECStatus -NSS_CMSArray_Add(PLArenaPool *poolp, void ***array, void *obj); - -/* - * NSS_CMSArray_IsEmpty - check if array is empty - */ -extern PRBool -NSS_CMSArray_IsEmpty(void **array); - -/* - * NSS_CMSArray_Count - count number of elements in array - */ -extern int -NSS_CMSArray_Count(void **array); - -/* - * NSS_CMSArray_Sort - sort an array ascending, in place - * - * If "secondary" is not NULL, the same reordering gets applied to it. - * If "tertiary" is not NULL, the same reordering gets applied to it. - * "compare" is a function that returns - * < 0 when the first element is less than the second - * = 0 when the first element is equal to the second - * > 0 when the first element is greater than the second - */ -extern void -NSS_CMSArray_Sort(void **primary, int (*compare)(void *,void *), void **secondary, void **tertiary); - -/************************************************************************ - * cmsattr.c - misc attribute functions - ************************************************************************/ -/* - * NSS_CMSAttribute_Create - create an attribute - * - * if value is NULL, the attribute won't have a value. It can be added later - * with NSS_CMSAttribute_AddValue. - */ -extern NSSCMSAttribute * -NSS_CMSAttribute_Create(PLArenaPool *poolp, SECOidTag oidtag, SECItem *value, PRBool encoded); - -/* - * NSS_CMSAttribute_AddValue - add another value to an attribute - */ -extern SECStatus -NSS_CMSAttribute_AddValue(PLArenaPool *poolp, NSSCMSAttribute *attr, SECItem *value); - -/* - * NSS_CMSAttribute_GetType - return the OID tag - */ -extern SECOidTag -NSS_CMSAttribute_GetType(NSSCMSAttribute *attr); - -/* - * NSS_CMSAttribute_GetValue - return the first attribute value - * - * We do some sanity checking first: - * - Multiple values are *not* expected. - * - Empty values are *not* expected. - */ -extern SECItem * -NSS_CMSAttribute_GetValue(NSSCMSAttribute *attr); - -/* - * NSS_CMSAttribute_CompareValue - compare the attribute's first value against data - */ -extern PRBool -NSS_CMSAttribute_CompareValue(NSSCMSAttribute *attr, SECItem *av); - -/* - * NSS_CMSAttributeArray_Encode - encode an Attribute array as SET OF Attributes - * - * If you are wondering why this routine does not reorder the attributes - * first, and might be tempted to make it do so, see the comment by the - * call to ReorderAttributes in cmsencode.c. (Or, see who else calls this - * and think long and hard about the implications of making it always - * do the reordering.) - */ -extern SECItem * -NSS_CMSAttributeArray_Encode(PLArenaPool *poolp, NSSCMSAttribute ***attrs, SECItem *dest); - -/* - * NSS_CMSAttributeArray_Reorder - sort attribute array by attribute's DER encoding - * - * make sure that the order of the attributes guarantees valid DER (which must be - * in lexigraphically ascending order for a SET OF); if reordering is necessary it - * will be done in place (in attrs). - */ -extern SECStatus -NSS_CMSAttributeArray_Reorder(NSSCMSAttribute **attrs); - -/* - * NSS_CMSAttributeArray_FindAttrByOidTag - look through a set of attributes and - * find one that matches the specified object ID. - * - * If "only" is true, then make sure that there is not more than one attribute - * of the same type. Otherwise, just return the first one found. (XXX Does - * anybody really want that first-found behavior? It was like that when I found it...) - */ -extern NSSCMSAttribute * -NSS_CMSAttributeArray_FindAttrByOidTag(NSSCMSAttribute **attrs, SECOidTag oidtag, PRBool only); - -/* - * NSS_CMSAttributeArray_AddAttr - add an attribute to an - * array of attributes. - */ -extern SECStatus -NSS_CMSAttributeArray_AddAttr(PLArenaPool *poolp, NSSCMSAttribute ***attrs, NSSCMSAttribute *attr); - -/* - * NSS_CMSAttributeArray_SetAttr - set an attribute's value in a set of attributes - */ -extern SECStatus -NSS_CMSAttributeArray_SetAttr(PLArenaPool *poolp, NSSCMSAttribute ***attrs, SECOidTag type, SECItem *value, PRBool encoded); - -/* - * NSS_CMSSignedData_AddTempCertificate - add temporary certificate references. - * They may be needed for signature verification on the data, for example. - */ -extern SECStatus -NSS_CMSSignedData_AddTempCertificate(NSSCMSSignedData *sigd, CERTCertificate *cert); - -/* - * local function to handle compatibility issues - * by mapping a signature algorithm back to a digest. - */ -SECOidTag NSS_CMSUtil_MapSignAlgs(SECOidTag signAlg); - - -/************************************************************************/ - -/* - * local functions to handle user defined S/MIME content types - */ - - -PRBool NSS_CMSType_IsWrapper(SECOidTag type); -PRBool NSS_CMSType_IsData(SECOidTag type); -size_t NSS_CMSType_GetContentSize(SECOidTag type); -const SEC_ASN1Template * NSS_CMSType_GetTemplate(SECOidTag type); - -void NSS_CMSGenericWrapperData_Destroy(SECOidTag type, - NSSCMSGenericWrapperData *gd); -SECStatus NSS_CMSGenericWrapperData_Decode_BeforeData(SECOidTag type, - NSSCMSGenericWrapperData *gd); -SECStatus NSS_CMSGenericWrapperData_Decode_AfterData(SECOidTag type, - NSSCMSGenericWrapperData *gd); -SECStatus NSS_CMSGenericWrapperData_Decode_AfterEnd(SECOidTag type, - NSSCMSGenericWrapperData *gd); -SECStatus NSS_CMSGenericWrapperData_Encode_BeforeStart(SECOidTag type, - NSSCMSGenericWrapperData *gd); -SECStatus NSS_CMSGenericWrapperData_Encode_BeforeData(SECOidTag type, - NSSCMSGenericWrapperData *gd); -SECStatus NSS_CMSGenericWrapperData_Encode_AfterData(SECOidTag type, - NSSCMSGenericWrapperData *gd); - -SEC_END_PROTOS - -#endif /* _CMSLOCAL_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/smime/cmsreclist.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/smime/cmsreclist.h deleted file mode 100755 index 4c094d4..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/smime/cmsreclist.h +++ /dev/null @@ -1,26 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef _CMSRECLIST_H -#define _CMSRECLIST_H - -struct NSSCMSRecipientStr { - int riIndex; /* this recipient's index in recipientInfo array */ - int subIndex; /* index into recipientEncryptedKeys */ - /* (only in NSSCMSKeyAgreeRecipientInfoStr) */ - enum {RLIssuerSN=0, RLSubjKeyID=1} kind; /* for conversion recipientinfos -> recipientlist */ - union { - CERTIssuerAndSN * issuerAndSN; - SECItem * subjectKeyID; - } id; - - /* result data (filled out for each recipient that's us) */ - CERTCertificate * cert; - SECKEYPrivateKey * privkey; - PK11SlotInfo * slot; -}; - -typedef struct NSSCMSRecipientStr NSSCMSRecipient; - -#endif /* _CMSRECLIST_H */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/smime/cmst.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/smime/cmst.h deleted file mode 100755 index 7376322..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/smime/cmst.h +++ /dev/null @@ -1,496 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * Header for CMS types. - */ - -#ifndef _CMST_H_ -#define _CMST_H_ - -#include "seccomon.h" -#include "secoidt.h" -#include "certt.h" -#include "secmodt.h" -#include "secmodt.h" - -#include "plarena.h" - -/* Non-opaque objects. NOTE, though: I want them to be treated as - * opaque as much as possible. If I could hide them completely, - * I would. (I tried, but ran into trouble that was taking me too - * much time to get out of.) I still intend to try to do so. - * In fact, the only type that "outsiders" should even *name* is - * NSSCMSMessage, and they should not reference its fields. - */ -/* rjr: PKCS #11 cert handling (pk11cert.c) does use NSSCMSRecipientInfo's. - * This is because when we search the recipient list for the cert and key we - * want, we need to invert the order of the loops we used to have. The old - * loops were: - * - * For each recipient { - * find_cert = PK11_Find_AllCert(recipient->issuerSN); - * [which unrolls to... ] - * For each slot { - * Log into slot; - * search slot for cert; - * } - * } - * - * the new loop searchs all the recipients at once on a slot. this allows - * PKCS #11 to order slots in such a way that logout slots don't get checked - * if we can find the cert on a logged in slot. This eliminates lots of - * spurious password prompts when smart cards are installed... so why this - * comment? If you make NSSCMSRecipientInfo completely opaque, you need - * to provide a non-opaque list of issuerSN's (the only field PKCS#11 needs - * and fix up pk11cert.c first. NOTE: Only S/MIME calls this special PKCS #11 - * function. - */ - -typedef struct NSSCMSMessageStr NSSCMSMessage; - -typedef union NSSCMSContentUnion NSSCMSContent; -typedef struct NSSCMSContentInfoStr NSSCMSContentInfo; - -typedef struct NSSCMSSignedDataStr NSSCMSSignedData; -typedef struct NSSCMSSignerInfoStr NSSCMSSignerInfo; -typedef struct NSSCMSSignerIdentifierStr NSSCMSSignerIdentifier; - -typedef struct NSSCMSEnvelopedDataStr NSSCMSEnvelopedData; -typedef struct NSSCMSOriginatorInfoStr NSSCMSOriginatorInfo; -typedef struct NSSCMSRecipientInfoStr NSSCMSRecipientInfo; - -typedef struct NSSCMSDigestedDataStr NSSCMSDigestedData; -typedef struct NSSCMSEncryptedDataStr NSSCMSEncryptedData; - -typedef struct NSSCMSGenericWrapperDataStr NSSCMSGenericWrapperData; - -typedef struct NSSCMSAttributeStr NSSCMSAttribute; - -typedef struct NSSCMSDecoderContextStr NSSCMSDecoderContext; -typedef struct NSSCMSEncoderContextStr NSSCMSEncoderContext; - -typedef struct NSSCMSCipherContextStr NSSCMSCipherContext; -typedef struct NSSCMSDigestContextStr NSSCMSDigestContext; - -typedef struct NSSCMSContentInfoPrivateStr NSSCMSContentInfoPrivate; - -typedef SECStatus (*NSSCMSGenericWrapperDataCallback) - (NSSCMSGenericWrapperData *); -typedef void (*NSSCMSGenericWrapperDataDestroy) - (NSSCMSGenericWrapperData *); - -extern const SEC_ASN1Template NSSCMSGenericWrapperDataTemplate[]; -extern const SEC_ASN1Template NSS_PointerToCMSGenericWrapperDataTemplate[]; - -SEC_ASN1_CHOOSER_DECLARE(NSS_PointerToCMSGenericWrapperDataTemplate) -SEC_ASN1_CHOOSER_DECLARE(NSSCMSGenericWrapperDataTemplate) - - - -/* - * Type of function passed to NSSCMSDecode or NSSCMSDecoderStart. - * If specified, this is where the content bytes (only) will be "sent" - * as they are recovered during the decoding. - * And: - * Type of function passed to NSSCMSEncode or NSSCMSEncoderStart. - * This is where the DER-encoded bytes will be "sent". - * - * XXX Should just combine this with NSSCMSEncoderContentCallback type - * and use a simpler, common name. - */ -typedef void (*NSSCMSContentCallback)(void *arg, const char *buf, unsigned long len); - -/* - * Type of function passed to NSSCMSDecode or NSSCMSDecoderStart - * to retrieve the decryption key. This function is intended to be - * used for EncryptedData content info's which do not have a key available - * in a certificate, etc. - */ -typedef PK11SymKey *(*NSSCMSGetDecryptKeyCallback)(void *arg, SECAlgorithmID *algid); - - -/* ============================================================================= - * ENCAPSULATED CONTENTINFO & CONTENTINFO - */ - -union NSSCMSContentUnion { - /* either unstructured */ - SECItem * data; - /* or structured data */ - NSSCMSDigestedData * digestedData; - NSSCMSEncryptedData * encryptedData; - NSSCMSEnvelopedData * envelopedData; - NSSCMSSignedData * signedData; - NSSCMSGenericWrapperData * genericData; - /* or anonymous pointer to something */ - void * pointer; -}; - -struct NSSCMSContentInfoStr { - SECItem contentType; - NSSCMSContent content; - /* --------- local; not part of encoding --------- */ - SECOidData * contentTypeTag; - - /* additional info for encryptedData and envelopedData */ - /* we waste this space for signedData and digestedData. sue me. */ - - SECAlgorithmID contentEncAlg; - SECItem * rawContent; /* encrypted DER, optional */ - /* XXXX bytes not encrypted, but encoded? */ - /* --------- local; not part of encoding --------- */ - PK11SymKey * bulkkey; /* bulk encryption key */ - int keysize; /* size of bulk encryption key - * (only used by creation code) */ - SECOidTag contentEncAlgTag; /* oid tag of encryption algorithm - * (only used by creation code) */ - NSSCMSContentInfoPrivate *privateInfo; /* place for NSS private info */ - void *reserved; /* keep binary compatibility */ -}; - -/* ============================================================================= - * MESSAGE - */ - -struct NSSCMSMessageStr { - NSSCMSContentInfo contentInfo; /* "outer" cinfo */ - /* --------- local; not part of encoding --------- */ - PLArenaPool * poolp; - PRBool poolp_is_ours; - int refCount; - /* properties of the "inner" data */ - SECAlgorithmID ** detached_digestalgs; - SECItem ** detached_digests; - void * pwfn_arg; - NSSCMSGetDecryptKeyCallback decrypt_key_cb; - void * decrypt_key_cb_arg; -}; - -/* ============================================================================ - * GENERIC WRAPPER - * - * used for user defined types. - */ -struct NSSCMSGenericWrapperDataStr { - NSSCMSContentInfo contentInfo; - /* ---- local; not part of encoding ------ */ - NSSCMSMessage * cmsg; - /* wrapperspecific data starts here */ -}; - -/* ============================================================================= - * SIGNEDDATA - */ - -struct NSSCMSSignedDataStr { - SECItem version; - SECAlgorithmID ** digestAlgorithms; - NSSCMSContentInfo contentInfo; - SECItem ** rawCerts; - CERTSignedCrl ** crls; - NSSCMSSignerInfo ** signerInfos; - /* --------- local; not part of encoding --------- */ - NSSCMSMessage * cmsg; /* back pointer to message */ - SECItem ** digests; - CERTCertificate ** certs; - CERTCertificateList ** certLists; - CERTCertificate ** tempCerts; /* temporary certs, needed - * for example for signature - * verification */ -}; -#define NSS_CMS_SIGNED_DATA_VERSION_BASIC 1 /* what we *create* */ -#define NSS_CMS_SIGNED_DATA_VERSION_EXT 3 /* what we *create* */ - -typedef enum { - NSSCMSVS_Unverified = 0, - NSSCMSVS_GoodSignature = 1, - NSSCMSVS_BadSignature = 2, - NSSCMSVS_DigestMismatch = 3, - NSSCMSVS_SigningCertNotFound = 4, - NSSCMSVS_SigningCertNotTrusted = 5, - NSSCMSVS_SignatureAlgorithmUnknown = 6, - NSSCMSVS_SignatureAlgorithmUnsupported = 7, - NSSCMSVS_MalformedSignature = 8, - NSSCMSVS_ProcessingError = 9 -} NSSCMSVerificationStatus; - -typedef enum { - NSSCMSSignerID_IssuerSN = 0, - NSSCMSSignerID_SubjectKeyID = 1 -} NSSCMSSignerIDSelector; - -struct NSSCMSSignerIdentifierStr { - NSSCMSSignerIDSelector identifierType; - union { - CERTIssuerAndSN *issuerAndSN; - SECItem *subjectKeyID; - } id; -}; - -struct NSSCMSSignerInfoStr { - SECItem version; - NSSCMSSignerIdentifier signerIdentifier; - SECAlgorithmID digestAlg; - NSSCMSAttribute ** authAttr; - SECAlgorithmID digestEncAlg; - SECItem encDigest; - NSSCMSAttribute ** unAuthAttr; - /* --------- local; not part of encoding --------- */ - NSSCMSMessage * cmsg; /* back pointer to message */ - CERTCertificate * cert; - CERTCertificateList * certList; - PRTime signingTime; - NSSCMSVerificationStatus verificationStatus; - SECKEYPrivateKey * signingKey; /* Used if we're using subjKeyID*/ - SECKEYPublicKey * pubKey; -}; -#define NSS_CMS_SIGNER_INFO_VERSION_ISSUERSN 1 /* what we *create* */ -#define NSS_CMS_SIGNER_INFO_VERSION_SUBJKEY 3 /* what we *create* */ - -typedef enum { - NSSCMSCM_None = 0, - NSSCMSCM_CertOnly = 1, - NSSCMSCM_CertChain = 2, - NSSCMSCM_CertChainWithRoot = 3 -} NSSCMSCertChainMode; - -/* ============================================================================= - * ENVELOPED DATA - */ -struct NSSCMSEnvelopedDataStr { - SECItem version; - NSSCMSOriginatorInfo * originatorInfo; /* optional */ - NSSCMSRecipientInfo ** recipientInfos; - NSSCMSContentInfo contentInfo; - NSSCMSAttribute ** unprotectedAttr; - /* --------- local; not part of encoding --------- */ - NSSCMSMessage * cmsg; /* back pointer to message */ -}; -#define NSS_CMS_ENVELOPED_DATA_VERSION_REG 0 /* what we *create* */ -#define NSS_CMS_ENVELOPED_DATA_VERSION_ADV 2 /* what we *create* */ - -struct NSSCMSOriginatorInfoStr { - SECItem ** rawCerts; - CERTSignedCrl ** crls; - /* --------- local; not part of encoding --------- */ - CERTCertificate ** certs; -}; - -/* ----------------------------------------------------------------------------- - * key transport recipient info - */ -typedef enum { - NSSCMSRecipientID_IssuerSN = 0, - NSSCMSRecipientID_SubjectKeyID = 1, - NSSCMSRecipientID_BrandNew = 2 -} NSSCMSRecipientIDSelector; - -struct NSSCMSRecipientIdentifierStr { - NSSCMSRecipientIDSelector identifierType; - union { - CERTIssuerAndSN *issuerAndSN; - SECItem *subjectKeyID; - } id; -}; -typedef struct NSSCMSRecipientIdentifierStr NSSCMSRecipientIdentifier; - -struct NSSCMSKeyTransRecipientInfoStr { - SECItem version; - NSSCMSRecipientIdentifier recipientIdentifier; - SECAlgorithmID keyEncAlg; - SECItem encKey; -}; -typedef struct NSSCMSKeyTransRecipientInfoStr NSSCMSKeyTransRecipientInfo; - -/* - * View comments before NSSCMSRecipientInfoStr for purpose of this - * structure. - */ -struct NSSCMSKeyTransRecipientInfoExStr { - NSSCMSKeyTransRecipientInfo recipientInfo; - int version; /* version of this structure (0) */ - SECKEYPublicKey *pubKey; -}; - -typedef struct NSSCMSKeyTransRecipientInfoExStr NSSCMSKeyTransRecipientInfoEx; - -#define NSS_CMS_KEYTRANS_RECIPIENT_INFO_VERSION_ISSUERSN 0 /* what we *create* */ -#define NSS_CMS_KEYTRANS_RECIPIENT_INFO_VERSION_SUBJKEY 2 /* what we *create* */ - -/* ----------------------------------------------------------------------------- - * key agreement recipient info - */ -struct NSSCMSOriginatorPublicKeyStr { - SECAlgorithmID algorithmIdentifier; - SECItem publicKey; /* bit string! */ -}; -typedef struct NSSCMSOriginatorPublicKeyStr NSSCMSOriginatorPublicKey; - -typedef enum { - NSSCMSOriginatorIDOrKey_IssuerSN = 0, - NSSCMSOriginatorIDOrKey_SubjectKeyID = 1, - NSSCMSOriginatorIDOrKey_OriginatorPublicKey = 2 -} NSSCMSOriginatorIDOrKeySelector; - -struct NSSCMSOriginatorIdentifierOrKeyStr { - NSSCMSOriginatorIDOrKeySelector identifierType; - union { - CERTIssuerAndSN *issuerAndSN; /* static-static */ - SECItem *subjectKeyID; /* static-static */ - NSSCMSOriginatorPublicKey originatorPublicKey; /* ephemeral-static */ - } id; -}; -typedef struct NSSCMSOriginatorIdentifierOrKeyStr NSSCMSOriginatorIdentifierOrKey; - -struct NSSCMSRecipientKeyIdentifierStr { - SECItem * subjectKeyIdentifier; - SECItem * date; /* optional */ - SECItem * other; /* optional */ -}; -typedef struct NSSCMSRecipientKeyIdentifierStr NSSCMSRecipientKeyIdentifier; - -typedef enum { - NSSCMSKeyAgreeRecipientID_IssuerSN = 0, - NSSCMSKeyAgreeRecipientID_RKeyID = 1 -} NSSCMSKeyAgreeRecipientIDSelector; - -struct NSSCMSKeyAgreeRecipientIdentifierStr { - NSSCMSKeyAgreeRecipientIDSelector identifierType; - union { - CERTIssuerAndSN *issuerAndSN; - NSSCMSRecipientKeyIdentifier recipientKeyIdentifier; - } id; -}; -typedef struct NSSCMSKeyAgreeRecipientIdentifierStr NSSCMSKeyAgreeRecipientIdentifier; - -struct NSSCMSRecipientEncryptedKeyStr { - NSSCMSKeyAgreeRecipientIdentifier recipientIdentifier; - SECItem encKey; -}; -typedef struct NSSCMSRecipientEncryptedKeyStr NSSCMSRecipientEncryptedKey; - -struct NSSCMSKeyAgreeRecipientInfoStr { - SECItem version; - NSSCMSOriginatorIdentifierOrKey originatorIdentifierOrKey; - SECItem * ukm; /* optional */ - SECAlgorithmID keyEncAlg; - NSSCMSRecipientEncryptedKey ** recipientEncryptedKeys; -}; -typedef struct NSSCMSKeyAgreeRecipientInfoStr NSSCMSKeyAgreeRecipientInfo; - -#define NSS_CMS_KEYAGREE_RECIPIENT_INFO_VERSION 3 /* what we *create* */ - -/* ----------------------------------------------------------------------------- - * KEK recipient info - */ -struct NSSCMSKEKIdentifierStr { - SECItem keyIdentifier; - SECItem * date; /* optional */ - SECItem * other; /* optional */ -}; -typedef struct NSSCMSKEKIdentifierStr NSSCMSKEKIdentifier; - -struct NSSCMSKEKRecipientInfoStr { - SECItem version; - NSSCMSKEKIdentifier kekIdentifier; - SECAlgorithmID keyEncAlg; - SECItem encKey; -}; -typedef struct NSSCMSKEKRecipientInfoStr NSSCMSKEKRecipientInfo; - -#define NSS_CMS_KEK_RECIPIENT_INFO_VERSION 4 /* what we *create* */ - -/* ----------------------------------------------------------------------------- - * recipient info - */ - -typedef enum { - NSSCMSRecipientInfoID_KeyTrans = 0, - NSSCMSRecipientInfoID_KeyAgree = 1, - NSSCMSRecipientInfoID_KEK = 2 -} NSSCMSRecipientInfoIDSelector; - -/* - * In order to preserve backwards binary compatibility when implementing - * creation of Recipient Info's that uses subjectKeyID in the - * keyTransRecipientInfo we need to stash a public key pointer in this - * structure somewhere. We figured out that NSSCMSKeyTransRecipientInfo - * is the smallest member of the ri union. We're in luck since that's - * the very structure that would need to use the public key. So we created - * a new structure NSSCMSKeyTransRecipientInfoEx which has a member - * NSSCMSKeyTransRecipientInfo as the first member followed by a version - * and a public key pointer. This way we can keep backwards compatibility - * without changing the size of this structure. - * - * BTW, size of structure: - * NSSCMSKeyTransRecipientInfo: 9 ints, 4 pointers - * NSSCMSKeyAgreeRecipientInfo: 12 ints, 8 pointers - * NSSCMSKEKRecipientInfo: 10 ints, 7 pointers - * - * The new structure: - * NSSCMSKeyTransRecipientInfoEx: sizeof(NSSCMSKeyTransRecipientInfo) + - * 1 int, 1 pointer - */ - -struct NSSCMSRecipientInfoStr { - NSSCMSRecipientInfoIDSelector recipientInfoType; - union { - NSSCMSKeyTransRecipientInfo keyTransRecipientInfo; - NSSCMSKeyAgreeRecipientInfo keyAgreeRecipientInfo; - NSSCMSKEKRecipientInfo kekRecipientInfo; - NSSCMSKeyTransRecipientInfoEx keyTransRecipientInfoEx; - } ri; - /* --------- local; not part of encoding --------- */ - NSSCMSMessage * cmsg; /* back pointer to message */ - CERTCertificate * cert; /* recipient's certificate */ -}; - -/* ============================================================================= - * DIGESTED DATA - */ -struct NSSCMSDigestedDataStr { - SECItem version; - SECAlgorithmID digestAlg; - NSSCMSContentInfo contentInfo; - SECItem digest; - /* --------- local; not part of encoding --------- */ - NSSCMSMessage * cmsg; /* back pointer */ - SECItem cdigest; /* calculated digest */ -}; -#define NSS_CMS_DIGESTED_DATA_VERSION_DATA 0 /* what we *create* */ -#define NSS_CMS_DIGESTED_DATA_VERSION_ENCAP 2 /* what we *create* */ - -/* ============================================================================= - * ENCRYPTED DATA - */ -struct NSSCMSEncryptedDataStr { - SECItem version; - NSSCMSContentInfo contentInfo; - NSSCMSAttribute ** unprotectedAttr; /* optional */ - /* --------- local; not part of encoding --------- */ - NSSCMSMessage * cmsg; /* back pointer */ -}; -#define NSS_CMS_ENCRYPTED_DATA_VERSION 0 /* what we *create* */ -#define NSS_CMS_ENCRYPTED_DATA_VERSION_UPATTR 2 /* what we *create* */ - -/* - * ***************************************************************************** - * ***************************************************************************** - * ***************************************************************************** - */ - -/* - * See comment above about this type not really belonging to CMS. - */ -struct NSSCMSAttributeStr { - /* The following fields make up an encoded Attribute: */ - SECItem type; - SECItem ** values; /* data may or may not be encoded */ - /* The following fields are not part of an encoded Attribute: */ - SECOidData * typeTag; - PRBool encoded; /* when true, values are encoded */ -}; - -#endif /* _CMST_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/smime/smime.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/smime/smime.h deleted file mode 100755 index b1a7a0f..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/smime/smime.h +++ /dev/null @@ -1,138 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * Header file for routines specific to S/MIME. Keep things that are pure - * pkcs7 out of here; this is for S/MIME policy, S/MIME interoperability, etc. - */ - -#ifndef _SMIME_H_ -#define _SMIME_H_ 1 - -#include "cms.h" - - -/************************************************************************/ -SEC_BEGIN_PROTOS - -/* - * Initialize the local recording of the user S/MIME cipher preferences. - * This function is called once for each cipher, the order being - * important (first call records greatest preference, and so on). - * When finished, it is called with a "which" of CIPHER_FAMILID_MASK. - * If the function is called again after that, it is assumed that - * the preferences are being reset, and the old preferences are - * discarded. - * - * XXX This is for a particular user, and right now the storage is - * XXX local, static. The preference should be stored elsewhere to allow - * XXX for multiple uses of one library? How does SSL handle this; - * XXX it has something similar? - * - * - The "which" values are defined in ciferfam.h (the SMIME_* values, - * for example SMIME_DES_CBC_56). - * - If "on" is non-zero then the named cipher is enabled, otherwise - * it is disabled. (It is not necessary to call the function for - * ciphers that are disabled, however, as that is the default.) - * - * If the cipher preference is successfully recorded, SECSuccess - * is returned. Otherwise SECFailure is returned. The only errors - * are due to failure allocating memory or bad parameters/calls: - * SEC_ERROR_XXX ("which" is not in the S/MIME cipher family) - * SEC_ERROR_XXX (function is being called more times than there - * are known/expected ciphers) - */ -extern SECStatus NSS_SMIMEUtil_EnableCipher(long which, int on); - -/* - * Initialize the local recording of the S/MIME policy. - * This function is called to allow/disallow a particular cipher. - * - * XXX This is for the current module, I think, so local, static storage - * XXX is okay. Is that correct, or could multiple uses of the same - * XXX library expect to operate under different policies? - * - * - The "which" values are defined in ciferfam.h (the SMIME_* values, - * for example SMIME_DES_CBC_56). - * - If "on" is non-zero then the named cipher is enabled, otherwise - * it is disabled. - */ -extern SECStatus NSS_SMIMEUtils_AllowCipher(long which, int on); - -/* - * Does the current policy allow S/MIME decryption of this particular - * algorithm and keysize? - */ -extern PRBool NSS_SMIMEUtil_DecryptionAllowed(SECAlgorithmID *algid, PK11SymKey *key); - -/* - * Does the current policy allow *any* S/MIME encryption (or decryption)? - * - * This tells whether or not *any* S/MIME encryption can be done, - * according to policy. Callers may use this to do nicer user interface - * (say, greying out a checkbox so a user does not even try to encrypt - * a message when they are not allowed to) or for any reason they want - * to check whether S/MIME encryption (or decryption, for that matter) - * may be done. - * - * It takes no arguments. The return value is a simple boolean: - * PR_TRUE means encryption (or decryption) is *possible* - * (but may still fail due to other reasons, like because we cannot - * find all the necessary certs, etc.; PR_TRUE is *not* a guarantee) - * PR_FALSE means encryption (or decryption) is not permitted - * - * There are no errors from this routine. - */ -extern PRBool NSS_SMIMEUtil_EncryptionPossible(void); - -/* - * NSS_SMIMEUtil_CreateSMIMECapabilities - get S/MIME capabilities attr value - * - * scans the list of allowed and enabled ciphers and construct a PKCS9-compliant - * S/MIME capabilities attribute value. - */ -extern SECStatus NSS_SMIMEUtil_CreateSMIMECapabilities(PLArenaPool *poolp, SECItem *dest); - -/* - * NSS_SMIMEUtil_CreateSMIMEEncKeyPrefs - create S/MIME encryption key preferences attr value - */ -extern SECStatus NSS_SMIMEUtil_CreateSMIMEEncKeyPrefs(PLArenaPool *poolp, SECItem *dest, CERTCertificate *cert); - -/* - * NSS_SMIMEUtil_CreateMSSMIMEEncKeyPrefs - create S/MIME encryption key preferences attr value using MS oid - */ -extern SECStatus NSS_SMIMEUtil_CreateMSSMIMEEncKeyPrefs(PLArenaPool *poolp, SECItem *dest, CERTCertificate *cert); - -/* - * NSS_SMIMEUtil_GetCertFromEncryptionKeyPreference - find cert marked by EncryptionKeyPreference - * attribute - */ -extern CERTCertificate *NSS_SMIMEUtil_GetCertFromEncryptionKeyPreference(CERTCertDBHandle *certdb, SECItem *DERekp); - -/* - * NSS_SMIMEUtil_FindBulkAlgForRecipients - find bulk algorithm suitable for all recipients - */ -extern SECStatus -NSS_SMIMEUtil_FindBulkAlgForRecipients(CERTCertificate **rcerts, SECOidTag *bulkalgtag, int *keysize); - -/* - * Return a boolean that indicates whether the underlying library - * will perform as the caller expects. - * - * The only argument is a string, which should be the version - * identifier of the NSS library. That string will be compared - * against a string that represents the actual build version of - * the S/MIME library. - */ -extern PRBool NSSSMIME_VersionCheck(const char *importedVersion); - -/* - * Returns a const string of the S/MIME library version. - */ -extern const char *NSSSMIME_GetVersion(void); - -/************************************************************************/ -SEC_END_PROTOS - -#endif /* _SECMIME_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/SECerrs.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/SECerrs.h deleted file mode 100755 index 8b6b36f..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/SECerrs.h +++ /dev/null @@ -1,553 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* General security error codes */ -/* Caller must #include "secerr.h" */ - -ER3(SEC_ERROR_IO, SEC_ERROR_BASE + 0, -"An I/O error occurred during security authorization.") - -ER3(SEC_ERROR_LIBRARY_FAILURE, SEC_ERROR_BASE + 1, -"security library failure.") - -ER3(SEC_ERROR_BAD_DATA, SEC_ERROR_BASE + 2, -"security library: received bad data.") - -ER3(SEC_ERROR_OUTPUT_LEN, SEC_ERROR_BASE + 3, -"security library: output length error.") - -ER3(SEC_ERROR_INPUT_LEN, SEC_ERROR_BASE + 4, -"security library has experienced an input length error.") - -ER3(SEC_ERROR_INVALID_ARGS, SEC_ERROR_BASE + 5, -"security library: invalid arguments.") - -ER3(SEC_ERROR_INVALID_ALGORITHM, SEC_ERROR_BASE + 6, -"security library: invalid algorithm.") - -ER3(SEC_ERROR_INVALID_AVA, SEC_ERROR_BASE + 7, -"security library: invalid AVA.") - -ER3(SEC_ERROR_INVALID_TIME, SEC_ERROR_BASE + 8, -"Improperly formatted time string.") - -ER3(SEC_ERROR_BAD_DER, SEC_ERROR_BASE + 9, -"security library: improperly formatted DER-encoded message.") - -ER3(SEC_ERROR_BAD_SIGNATURE, SEC_ERROR_BASE + 10, -"Peer's certificate has an invalid signature.") - -ER3(SEC_ERROR_EXPIRED_CERTIFICATE, SEC_ERROR_BASE + 11, -"Peer's Certificate has expired.") - -ER3(SEC_ERROR_REVOKED_CERTIFICATE, SEC_ERROR_BASE + 12, -"Peer's Certificate has been revoked.") - -ER3(SEC_ERROR_UNKNOWN_ISSUER, SEC_ERROR_BASE + 13, -"Peer's Certificate issuer is not recognized.") - -ER3(SEC_ERROR_BAD_KEY, SEC_ERROR_BASE + 14, -"Peer's public key is invalid.") - -ER3(SEC_ERROR_BAD_PASSWORD, SEC_ERROR_BASE + 15, -"The security password entered is incorrect.") - -ER3(SEC_ERROR_RETRY_PASSWORD, SEC_ERROR_BASE + 16, -"New password entered incorrectly. Please try again.") - -ER3(SEC_ERROR_NO_NODELOCK, SEC_ERROR_BASE + 17, -"security library: no nodelock.") - -ER3(SEC_ERROR_BAD_DATABASE, SEC_ERROR_BASE + 18, -"security library: bad database.") - -ER3(SEC_ERROR_NO_MEMORY, SEC_ERROR_BASE + 19, -"security library: memory allocation failure.") - -ER3(SEC_ERROR_UNTRUSTED_ISSUER, SEC_ERROR_BASE + 20, -"Peer's certificate issuer has been marked as not trusted by the user.") - -ER3(SEC_ERROR_UNTRUSTED_CERT, SEC_ERROR_BASE + 21, -"Peer's certificate has been marked as not trusted by the user.") - -ER3(SEC_ERROR_DUPLICATE_CERT, (SEC_ERROR_BASE + 22), -"Certificate already exists in your database.") - -ER3(SEC_ERROR_DUPLICATE_CERT_NAME, (SEC_ERROR_BASE + 23), -"Downloaded certificate's name duplicates one already in your database.") - -ER3(SEC_ERROR_ADDING_CERT, (SEC_ERROR_BASE + 24), -"Error adding certificate to database.") - -ER3(SEC_ERROR_FILING_KEY, (SEC_ERROR_BASE + 25), -"Error refiling the key for this certificate.") - -ER3(SEC_ERROR_NO_KEY, (SEC_ERROR_BASE + 26), -"The private key for this certificate cannot be found in key database") - -ER3(SEC_ERROR_CERT_VALID, (SEC_ERROR_BASE + 27), -"This certificate is valid.") - -ER3(SEC_ERROR_CERT_NOT_VALID, (SEC_ERROR_BASE + 28), -"This certificate is not valid.") - -ER3(SEC_ERROR_CERT_NO_RESPONSE, (SEC_ERROR_BASE + 29), -"Cert Library: No Response") - -ER3(SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE, (SEC_ERROR_BASE + 30), -"The certificate issuer's certificate has expired. Check your system date and time.") - -ER3(SEC_ERROR_CRL_EXPIRED, (SEC_ERROR_BASE + 31), -"The CRL for the certificate's issuer has expired. Update it or check your system date and time.") - -ER3(SEC_ERROR_CRL_BAD_SIGNATURE, (SEC_ERROR_BASE + 32), -"The CRL for the certificate's issuer has an invalid signature.") - -ER3(SEC_ERROR_CRL_INVALID, (SEC_ERROR_BASE + 33), -"New CRL has an invalid format.") - -ER3(SEC_ERROR_EXTENSION_VALUE_INVALID, (SEC_ERROR_BASE + 34), -"Certificate extension value is invalid.") - -ER3(SEC_ERROR_EXTENSION_NOT_FOUND, (SEC_ERROR_BASE + 35), -"Certificate extension not found.") - -ER3(SEC_ERROR_CA_CERT_INVALID, (SEC_ERROR_BASE + 36), -"Issuer certificate is invalid.") - -ER3(SEC_ERROR_PATH_LEN_CONSTRAINT_INVALID, (SEC_ERROR_BASE + 37), -"Certificate path length constraint is invalid.") - -ER3(SEC_ERROR_CERT_USAGES_INVALID, (SEC_ERROR_BASE + 38), -"Certificate usages field is invalid.") - -ER3(SEC_INTERNAL_ONLY, (SEC_ERROR_BASE + 39), -"**Internal ONLY module**") - -ER3(SEC_ERROR_INVALID_KEY, (SEC_ERROR_BASE + 40), -"The key does not support the requested operation.") - -ER3(SEC_ERROR_UNKNOWN_CRITICAL_EXTENSION, (SEC_ERROR_BASE + 41), -"Certificate contains unknown critical extension.") - -ER3(SEC_ERROR_OLD_CRL, (SEC_ERROR_BASE + 42), -"New CRL is not later than the current one.") - -ER3(SEC_ERROR_NO_EMAIL_CERT, (SEC_ERROR_BASE + 43), -"Not encrypted or signed: you do not yet have an email certificate.") - -ER3(SEC_ERROR_NO_RECIPIENT_CERTS_QUERY, (SEC_ERROR_BASE + 44), -"Not encrypted: you do not have certificates for each of the recipients.") - -ER3(SEC_ERROR_NOT_A_RECIPIENT, (SEC_ERROR_BASE + 45), -"Cannot decrypt: you are not a recipient, or matching certificate and \ -private key not found.") - -ER3(SEC_ERROR_PKCS7_KEYALG_MISMATCH, (SEC_ERROR_BASE + 46), -"Cannot decrypt: key encryption algorithm does not match your certificate.") - -ER3(SEC_ERROR_PKCS7_BAD_SIGNATURE, (SEC_ERROR_BASE + 47), -"Signature verification failed: no signer found, too many signers found, \ -or improper or corrupted data.") - -ER3(SEC_ERROR_UNSUPPORTED_KEYALG, (SEC_ERROR_BASE + 48), -"Unsupported or unknown key algorithm.") - -ER3(SEC_ERROR_DECRYPTION_DISALLOWED, (SEC_ERROR_BASE + 49), -"Cannot decrypt: encrypted using a disallowed algorithm or key size.") - - -/* Fortezza Alerts */ -ER3(XP_SEC_FORTEZZA_BAD_CARD, (SEC_ERROR_BASE + 50), -"Fortezza card has not been properly initialized. \ -Please remove it and return it to your issuer.") - -ER3(XP_SEC_FORTEZZA_NO_CARD, (SEC_ERROR_BASE + 51), -"No Fortezza cards Found") - -ER3(XP_SEC_FORTEZZA_NONE_SELECTED, (SEC_ERROR_BASE + 52), -"No Fortezza card selected") - -ER3(XP_SEC_FORTEZZA_MORE_INFO, (SEC_ERROR_BASE + 53), -"Please select a personality to get more info on") - -ER3(XP_SEC_FORTEZZA_PERSON_NOT_FOUND, (SEC_ERROR_BASE + 54), -"Personality not found") - -ER3(XP_SEC_FORTEZZA_NO_MORE_INFO, (SEC_ERROR_BASE + 55), -"No more information on that Personality") - -ER3(XP_SEC_FORTEZZA_BAD_PIN, (SEC_ERROR_BASE + 56), -"Invalid Pin") - -ER3(XP_SEC_FORTEZZA_PERSON_ERROR, (SEC_ERROR_BASE + 57), -"Couldn't initialize Fortezza personalities.") -/* end fortezza alerts. */ - -ER3(SEC_ERROR_NO_KRL, (SEC_ERROR_BASE + 58), -"No KRL for this site's certificate has been found.") - -ER3(SEC_ERROR_KRL_EXPIRED, (SEC_ERROR_BASE + 59), -"The KRL for this site's certificate has expired.") - -ER3(SEC_ERROR_KRL_BAD_SIGNATURE, (SEC_ERROR_BASE + 60), -"The KRL for this site's certificate has an invalid signature.") - -ER3(SEC_ERROR_REVOKED_KEY, (SEC_ERROR_BASE + 61), -"The key for this site's certificate has been revoked.") - -ER3(SEC_ERROR_KRL_INVALID, (SEC_ERROR_BASE + 62), -"New KRL has an invalid format.") - -ER3(SEC_ERROR_NEED_RANDOM, (SEC_ERROR_BASE + 63), -"security library: need random data.") - -ER3(SEC_ERROR_NO_MODULE, (SEC_ERROR_BASE + 64), -"security library: no security module can perform the requested operation.") - -ER3(SEC_ERROR_NO_TOKEN, (SEC_ERROR_BASE + 65), -"The security card or token does not exist, needs to be initialized, or has been removed.") - -ER3(SEC_ERROR_READ_ONLY, (SEC_ERROR_BASE + 66), -"security library: read-only database.") - -ER3(SEC_ERROR_NO_SLOT_SELECTED, (SEC_ERROR_BASE + 67), -"No slot or token was selected.") - -ER3(SEC_ERROR_CERT_NICKNAME_COLLISION, (SEC_ERROR_BASE + 68), -"A certificate with the same nickname already exists.") - -ER3(SEC_ERROR_KEY_NICKNAME_COLLISION, (SEC_ERROR_BASE + 69), -"A key with the same nickname already exists.") - -ER3(SEC_ERROR_SAFE_NOT_CREATED, (SEC_ERROR_BASE + 70), -"error while creating safe object") - -ER3(SEC_ERROR_BAGGAGE_NOT_CREATED, (SEC_ERROR_BASE + 71), -"error while creating baggage object") - -ER3(XP_JAVA_REMOVE_PRINCIPAL_ERROR, (SEC_ERROR_BASE + 72), -"Couldn't remove the principal") - -ER3(XP_JAVA_DELETE_PRIVILEGE_ERROR, (SEC_ERROR_BASE + 73), -"Couldn't delete the privilege") - -ER3(XP_JAVA_CERT_NOT_EXISTS_ERROR, (SEC_ERROR_BASE + 74), -"This principal doesn't have a certificate") - -ER3(SEC_ERROR_BAD_EXPORT_ALGORITHM, (SEC_ERROR_BASE + 75), -"Required algorithm is not allowed.") - -ER3(SEC_ERROR_EXPORTING_CERTIFICATES, (SEC_ERROR_BASE + 76), -"Error attempting to export certificates.") - -ER3(SEC_ERROR_IMPORTING_CERTIFICATES, (SEC_ERROR_BASE + 77), -"Error attempting to import certificates.") - -ER3(SEC_ERROR_PKCS12_DECODING_PFX, (SEC_ERROR_BASE + 78), -"Unable to import. Decoding error. File not valid.") - -ER3(SEC_ERROR_PKCS12_INVALID_MAC, (SEC_ERROR_BASE + 79), -"Unable to import. Invalid MAC. Incorrect password or corrupt file.") - -ER3(SEC_ERROR_PKCS12_UNSUPPORTED_MAC_ALGORITHM, (SEC_ERROR_BASE + 80), -"Unable to import. MAC algorithm not supported.") - -ER3(SEC_ERROR_PKCS12_UNSUPPORTED_TRANSPORT_MODE,(SEC_ERROR_BASE + 81), -"Unable to import. Only password integrity and privacy modes supported.") - -ER3(SEC_ERROR_PKCS12_CORRUPT_PFX_STRUCTURE, (SEC_ERROR_BASE + 82), -"Unable to import. File structure is corrupt.") - -ER3(SEC_ERROR_PKCS12_UNSUPPORTED_PBE_ALGORITHM, (SEC_ERROR_BASE + 83), -"Unable to import. Encryption algorithm not supported.") - -ER3(SEC_ERROR_PKCS12_UNSUPPORTED_VERSION, (SEC_ERROR_BASE + 84), -"Unable to import. File version not supported.") - -ER3(SEC_ERROR_PKCS12_PRIVACY_PASSWORD_INCORRECT,(SEC_ERROR_BASE + 85), -"Unable to import. Incorrect privacy password.") - -ER3(SEC_ERROR_PKCS12_CERT_COLLISION, (SEC_ERROR_BASE + 86), -"Unable to import. Same nickname already exists in database.") - -ER3(SEC_ERROR_USER_CANCELLED, (SEC_ERROR_BASE + 87), -"The user pressed cancel.") - -ER3(SEC_ERROR_PKCS12_DUPLICATE_DATA, (SEC_ERROR_BASE + 88), -"Not imported, already in database.") - -ER3(SEC_ERROR_MESSAGE_SEND_ABORTED, (SEC_ERROR_BASE + 89), -"Message not sent.") - -ER3(SEC_ERROR_INADEQUATE_KEY_USAGE, (SEC_ERROR_BASE + 90), -"Certificate key usage inadequate for attempted operation.") - -ER3(SEC_ERROR_INADEQUATE_CERT_TYPE, (SEC_ERROR_BASE + 91), -"Certificate type not approved for application.") - -ER3(SEC_ERROR_CERT_ADDR_MISMATCH, (SEC_ERROR_BASE + 92), -"Address in signing certificate does not match address in message headers.") - -ER3(SEC_ERROR_PKCS12_UNABLE_TO_IMPORT_KEY, (SEC_ERROR_BASE + 93), -"Unable to import. Error attempting to import private key.") - -ER3(SEC_ERROR_PKCS12_IMPORTING_CERT_CHAIN, (SEC_ERROR_BASE + 94), -"Unable to import. Error attempting to import certificate chain.") - -ER3(SEC_ERROR_PKCS12_UNABLE_TO_LOCATE_OBJECT_BY_NAME, (SEC_ERROR_BASE + 95), -"Unable to export. Unable to locate certificate or key by nickname.") - -ER3(SEC_ERROR_PKCS12_UNABLE_TO_EXPORT_KEY, (SEC_ERROR_BASE + 96), -"Unable to export. Private Key could not be located and exported.") - -ER3(SEC_ERROR_PKCS12_UNABLE_TO_WRITE, (SEC_ERROR_BASE + 97), -"Unable to export. Unable to write the export file.") - -ER3(SEC_ERROR_PKCS12_UNABLE_TO_READ, (SEC_ERROR_BASE + 98), -"Unable to import. Unable to read the import file.") - -ER3(SEC_ERROR_PKCS12_KEY_DATABASE_NOT_INITIALIZED, (SEC_ERROR_BASE + 99), -"Unable to export. Key database corrupt or deleted.") - -ER3(SEC_ERROR_KEYGEN_FAIL, (SEC_ERROR_BASE + 100), -"Unable to generate public/private key pair.") - -ER3(SEC_ERROR_INVALID_PASSWORD, (SEC_ERROR_BASE + 101), -"Password entered is invalid. Please pick a different one.") - -ER3(SEC_ERROR_RETRY_OLD_PASSWORD, (SEC_ERROR_BASE + 102), -"Old password entered incorrectly. Please try again.") - -ER3(SEC_ERROR_BAD_NICKNAME, (SEC_ERROR_BASE + 103), -"Certificate nickname already in use.") - -ER3(SEC_ERROR_NOT_FORTEZZA_ISSUER, (SEC_ERROR_BASE + 104), -"Peer FORTEZZA chain has a non-FORTEZZA Certificate.") - -ER3(SEC_ERROR_CANNOT_MOVE_SENSITIVE_KEY, (SEC_ERROR_BASE + 105), -"A sensitive key cannot be moved to the slot where it is needed.") - -ER3(SEC_ERROR_JS_INVALID_MODULE_NAME, (SEC_ERROR_BASE + 106), -"Invalid module name.") - -ER3(SEC_ERROR_JS_INVALID_DLL, (SEC_ERROR_BASE + 107), -"Invalid module path/filename") - -ER3(SEC_ERROR_JS_ADD_MOD_FAILURE, (SEC_ERROR_BASE + 108), -"Unable to add module") - -ER3(SEC_ERROR_JS_DEL_MOD_FAILURE, (SEC_ERROR_BASE + 109), -"Unable to delete module") - -ER3(SEC_ERROR_OLD_KRL, (SEC_ERROR_BASE + 110), -"New KRL is not later than the current one.") - -ER3(SEC_ERROR_CKL_CONFLICT, (SEC_ERROR_BASE + 111), -"New CKL has different issuer than current CKL. Delete current CKL.") - -ER3(SEC_ERROR_CERT_NOT_IN_NAME_SPACE, (SEC_ERROR_BASE + 112), -"The Certifying Authority for this certificate is not permitted to issue a \ -certificate with this name.") - -ER3(SEC_ERROR_KRL_NOT_YET_VALID, (SEC_ERROR_BASE + 113), -"The key revocation list for this certificate is not yet valid.") - -ER3(SEC_ERROR_CRL_NOT_YET_VALID, (SEC_ERROR_BASE + 114), -"The certificate revocation list for this certificate is not yet valid.") - -ER3(SEC_ERROR_UNKNOWN_CERT, (SEC_ERROR_BASE + 115), -"The requested certificate could not be found.") - -ER3(SEC_ERROR_UNKNOWN_SIGNER, (SEC_ERROR_BASE + 116), -"The signer's certificate could not be found.") - -ER3(SEC_ERROR_CERT_BAD_ACCESS_LOCATION, (SEC_ERROR_BASE + 117), -"The location for the certificate status server has invalid format.") - -ER3(SEC_ERROR_OCSP_UNKNOWN_RESPONSE_TYPE, (SEC_ERROR_BASE + 118), -"The OCSP response cannot be fully decoded; it is of an unknown type.") - -ER3(SEC_ERROR_OCSP_BAD_HTTP_RESPONSE, (SEC_ERROR_BASE + 119), -"The OCSP server returned unexpected/invalid HTTP data.") - -ER3(SEC_ERROR_OCSP_MALFORMED_REQUEST, (SEC_ERROR_BASE + 120), -"The OCSP server found the request to be corrupted or improperly formed.") - -ER3(SEC_ERROR_OCSP_SERVER_ERROR, (SEC_ERROR_BASE + 121), -"The OCSP server experienced an internal error.") - -ER3(SEC_ERROR_OCSP_TRY_SERVER_LATER, (SEC_ERROR_BASE + 122), -"The OCSP server suggests trying again later.") - -ER3(SEC_ERROR_OCSP_REQUEST_NEEDS_SIG, (SEC_ERROR_BASE + 123), -"The OCSP server requires a signature on this request.") - -ER3(SEC_ERROR_OCSP_UNAUTHORIZED_REQUEST, (SEC_ERROR_BASE + 124), -"The OCSP server has refused this request as unauthorized.") - -ER3(SEC_ERROR_OCSP_UNKNOWN_RESPONSE_STATUS, (SEC_ERROR_BASE + 125), -"The OCSP server returned an unrecognizable status.") - -ER3(SEC_ERROR_OCSP_UNKNOWN_CERT, (SEC_ERROR_BASE + 126), -"The OCSP server has no status for the certificate.") - -ER3(SEC_ERROR_OCSP_NOT_ENABLED, (SEC_ERROR_BASE + 127), -"You must enable OCSP before performing this operation.") - -ER3(SEC_ERROR_OCSP_NO_DEFAULT_RESPONDER, (SEC_ERROR_BASE + 128), -"You must set the OCSP default responder before performing this operation.") - -ER3(SEC_ERROR_OCSP_MALFORMED_RESPONSE, (SEC_ERROR_BASE + 129), -"The response from the OCSP server was corrupted or improperly formed.") - -ER3(SEC_ERROR_OCSP_UNAUTHORIZED_RESPONSE, (SEC_ERROR_BASE + 130), -"The signer of the OCSP response is not authorized to give status for \ -this certificate.") - -ER3(SEC_ERROR_OCSP_FUTURE_RESPONSE, (SEC_ERROR_BASE + 131), -"The OCSP response is not yet valid (contains a date in the future).") - -ER3(SEC_ERROR_OCSP_OLD_RESPONSE, (SEC_ERROR_BASE + 132), -"The OCSP response contains out-of-date information.") - -ER3(SEC_ERROR_DIGEST_NOT_FOUND, (SEC_ERROR_BASE + 133), -"The CMS or PKCS #7 Digest was not found in signed message.") - -ER3(SEC_ERROR_UNSUPPORTED_MESSAGE_TYPE, (SEC_ERROR_BASE + 134), -"The CMS or PKCS #7 Message type is unsupported.") - -ER3(SEC_ERROR_MODULE_STUCK, (SEC_ERROR_BASE + 135), -"PKCS #11 module could not be removed because it is still in use.") - -ER3(SEC_ERROR_BAD_TEMPLATE, (SEC_ERROR_BASE + 136), -"Could not decode ASN.1 data. Specified template was invalid.") - -ER3(SEC_ERROR_CRL_NOT_FOUND, (SEC_ERROR_BASE + 137), -"No matching CRL was found.") - -ER3(SEC_ERROR_REUSED_ISSUER_AND_SERIAL, (SEC_ERROR_BASE + 138), -"You are attempting to import a cert with the same issuer/serial as \ -an existing cert, but that is not the same cert.") - -ER3(SEC_ERROR_BUSY, (SEC_ERROR_BASE + 139), -"NSS could not shutdown. Objects are still in use.") - -ER3(SEC_ERROR_EXTRA_INPUT, (SEC_ERROR_BASE + 140), -"DER-encoded message contained extra unused data.") - -ER3(SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE, (SEC_ERROR_BASE + 141), -"Unsupported elliptic curve.") - -ER3(SEC_ERROR_UNSUPPORTED_EC_POINT_FORM, (SEC_ERROR_BASE + 142), -"Unsupported elliptic curve point form.") - -ER3(SEC_ERROR_UNRECOGNIZED_OID, (SEC_ERROR_BASE + 143), -"Unrecognized Object Identifier.") - -ER3(SEC_ERROR_OCSP_INVALID_SIGNING_CERT, (SEC_ERROR_BASE + 144), -"Invalid OCSP signing certificate in OCSP response.") - -ER3(SEC_ERROR_REVOKED_CERTIFICATE_CRL, (SEC_ERROR_BASE + 145), -"Certificate is revoked in issuer's certificate revocation list.") - -ER3(SEC_ERROR_REVOKED_CERTIFICATE_OCSP, (SEC_ERROR_BASE + 146), -"Issuer's OCSP responder reports certificate is revoked.") - -ER3(SEC_ERROR_CRL_INVALID_VERSION, (SEC_ERROR_BASE + 147), -"Issuer's Certificate Revocation List has an unknown version number.") - -ER3(SEC_ERROR_CRL_V1_CRITICAL_EXTENSION, (SEC_ERROR_BASE + 148), -"Issuer's V1 Certificate Revocation List has a critical extension.") - -ER3(SEC_ERROR_CRL_UNKNOWN_CRITICAL_EXTENSION, (SEC_ERROR_BASE + 149), -"Issuer's V2 Certificate Revocation List has an unknown critical extension.") - -ER3(SEC_ERROR_UNKNOWN_OBJECT_TYPE, (SEC_ERROR_BASE + 150), -"Unknown object type specified.") - -ER3(SEC_ERROR_INCOMPATIBLE_PKCS11, (SEC_ERROR_BASE + 151), -"PKCS #11 driver violates the spec in an incompatible way.") - -ER3(SEC_ERROR_NO_EVENT, (SEC_ERROR_BASE + 152), -"No new slot event is available at this time.") - -ER3(SEC_ERROR_CRL_ALREADY_EXISTS, (SEC_ERROR_BASE + 153), -"CRL already exists.") - -ER3(SEC_ERROR_NOT_INITIALIZED, (SEC_ERROR_BASE + 154), -"NSS is not initialized.") - -ER3(SEC_ERROR_TOKEN_NOT_LOGGED_IN, (SEC_ERROR_BASE + 155), -"The operation failed because the PKCS#11 token is not logged in.") - -ER3(SEC_ERROR_OCSP_RESPONDER_CERT_INVALID, (SEC_ERROR_BASE + 156), -"Configured OCSP responder's certificate is invalid.") - -ER3(SEC_ERROR_OCSP_BAD_SIGNATURE, (SEC_ERROR_BASE + 157), -"OCSP response has an invalid signature.") - -ER3(SEC_ERROR_OUT_OF_SEARCH_LIMITS, (SEC_ERROR_BASE + 158), -"Cert validation search is out of search limits") - -ER3(SEC_ERROR_INVALID_POLICY_MAPPING, (SEC_ERROR_BASE + 159), -"Policy mapping contains anypolicy") - -ER3(SEC_ERROR_POLICY_VALIDATION_FAILED, (SEC_ERROR_BASE + 160), -"Cert chain fails policy validation") - -ER3(SEC_ERROR_UNKNOWN_AIA_LOCATION_TYPE, (SEC_ERROR_BASE + 161), -"Unknown location type in cert AIA extension") - -ER3(SEC_ERROR_BAD_HTTP_RESPONSE, (SEC_ERROR_BASE + 162), -"Server returned bad HTTP response") - -ER3(SEC_ERROR_BAD_LDAP_RESPONSE, (SEC_ERROR_BASE + 163), -"Server returned bad LDAP response") - -ER3(SEC_ERROR_FAILED_TO_ENCODE_DATA, (SEC_ERROR_BASE + 164), -"Failed to encode data with ASN1 encoder") - -ER3(SEC_ERROR_BAD_INFO_ACCESS_LOCATION, (SEC_ERROR_BASE + 165), -"Bad information access location in cert extension") - -ER3(SEC_ERROR_LIBPKIX_INTERNAL, (SEC_ERROR_BASE + 166), -"Libpkix internal error occurred during cert validation.") - -ER3(SEC_ERROR_PKCS11_GENERAL_ERROR, (SEC_ERROR_BASE + 167), -"A PKCS #11 module returned CKR_GENERAL_ERROR, indicating that an unrecoverable error has occurred.") - -ER3(SEC_ERROR_PKCS11_FUNCTION_FAILED, (SEC_ERROR_BASE + 168), -"A PKCS #11 module returned CKR_FUNCTION_FAILED, indicating that the requested function could not be performed. Trying the same operation again might succeed.") - -ER3(SEC_ERROR_PKCS11_DEVICE_ERROR, (SEC_ERROR_BASE + 169), -"A PKCS #11 module returned CKR_DEVICE_ERROR, indicating that a problem has occurred with the token or slot.") - -ER3(SEC_ERROR_BAD_INFO_ACCESS_METHOD, (SEC_ERROR_BASE + 170), -"Unknown information access method in certificate extension.") - -ER3(SEC_ERROR_CRL_IMPORT_FAILED, (SEC_ERROR_BASE + 171), -"Error attempting to import a CRL.") - -ER3(SEC_ERROR_EXPIRED_PASSWORD, (SEC_ERROR_BASE + 172), -"The password expired.") - -ER3(SEC_ERROR_LOCKED_PASSWORD, (SEC_ERROR_BASE + 173), -"The password is locked.") - -ER3(SEC_ERROR_UNKNOWN_PKCS11_ERROR, (SEC_ERROR_BASE + 174), -"Unknown PKCS #11 error.") - -ER3(SEC_ERROR_BAD_CRL_DP_URL, (SEC_ERROR_BASE + 175), -"Invalid or unsupported URL in CRL distribution point name.") - -ER3(SEC_ERROR_CERT_SIGNATURE_ALGORITHM_DISABLED, (SEC_ERROR_BASE + 176), -"The certificate was signed using a signature algorithm that is disabled because it is not secure.") - -ER3(SEC_ERROR_LEGACY_DATABASE, (SEC_ERROR_BASE + 177), -"The certificate/key database is in an old, unsupported format.") - -ER3(SEC_ERROR_APPLICATION_CALLBACK_ERROR, (SEC_ERROR_BASE + 178), -"The certificate was rejected by extra checks in the application.") - diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/base64.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/base64.h deleted file mode 100755 index 37ca874..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/base64.h +++ /dev/null @@ -1,41 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * base64.h - prototypes for base64 encoding/decoding - * Note: These functions are deprecated; see nssb64.h for new routines. - */ -#ifndef _BASE64_H_ -#define _BASE64_H_ - -#include "utilrename.h" -#include "seccomon.h" - -SEC_BEGIN_PROTOS - -/* -** Return an PORT_Alloc'd ascii string which is the base64 encoded -** version of the input string. -*/ -extern char *BTOA_DataToAscii(const unsigned char *data, unsigned int len); - -/* -** Return an PORT_Alloc'd string which is the base64 decoded version -** of the input string; set *lenp to the length of the returned data. -*/ -extern unsigned char *ATOB_AsciiToData(const char *string, unsigned int *lenp); - -/* -** Convert from ascii to binary encoding of an item. -*/ -extern SECStatus ATOB_ConvertAsciiToItem(SECItem *binary_item, const char *ascii); - -/* -** Convert from binary encoding of an item to ascii. -*/ -extern char *BTOA_ConvertItemToAscii(SECItem *binary_item); - -SEC_END_PROTOS - -#endif /* _BASE64_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/ciferfam.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/ciferfam.h deleted file mode 100755 index 78fc169..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/ciferfam.h +++ /dev/null @@ -1,59 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * ciferfam.h - cipher familie IDs used for configuring ciphers for export - * control - */ - -#ifndef _CIFERFAM_H_ -#define _CIFERFAM_H_ - -#include "utilrename.h" -/* Cipher Suite "Families" */ -#define CIPHER_FAMILY_PKCS12 "PKCS12" -#define CIPHER_FAMILY_SMIME "SMIME" -#define CIPHER_FAMILY_SSL2 "SSLv2" -#define CIPHER_FAMILY_SSL3 "SSLv3" -#define CIPHER_FAMILY_SSL "SSL" -#define CIPHER_FAMILY_ALL "" -#define CIPHER_FAMILY_UNKNOWN "UNKNOWN" - -#define CIPHER_FAMILYID_MASK 0xFFFF0000L -#define CIPHER_FAMILYID_SSL 0x00000000L -#define CIPHER_FAMILYID_SMIME 0x00010000L -#define CIPHER_FAMILYID_PKCS12 0x00020000L - -/* SMIME "Cipher Suites" */ -/* - * Note that it is assumed that the cipher number itself can be used - * as a bit position in a mask, and that mask is currently 32 bits wide. - * So, if you want to add a cipher that is greater than 0037, secmime.c - * needs to be made smarter at the same time. - */ -#define SMIME_RC2_CBC_40 (CIPHER_FAMILYID_SMIME | 0001) -#define SMIME_RC2_CBC_64 (CIPHER_FAMILYID_SMIME | 0002) -#define SMIME_RC2_CBC_128 (CIPHER_FAMILYID_SMIME | 0003) -#define SMIME_DES_CBC_56 (CIPHER_FAMILYID_SMIME | 0011) -#define SMIME_DES_EDE3_168 (CIPHER_FAMILYID_SMIME | 0012) -#define SMIME_AES_CBC_128 (CIPHER_FAMILYID_SMIME | 0013) -#define SMIME_AES_CBC_256 (CIPHER_FAMILYID_SMIME | 0014) -#define SMIME_RC5PAD_64_16_40 (CIPHER_FAMILYID_SMIME | 0021) -#define SMIME_RC5PAD_64_16_64 (CIPHER_FAMILYID_SMIME | 0022) -#define SMIME_RC5PAD_64_16_128 (CIPHER_FAMILYID_SMIME | 0023) -#define SMIME_FORTEZZA (CIPHER_FAMILYID_SMIME | 0031) - -/* PKCS12 "Cipher Suites" */ - -#define PKCS12_RC2_CBC_40 (CIPHER_FAMILYID_PKCS12 | 0001) -#define PKCS12_RC2_CBC_128 (CIPHER_FAMILYID_PKCS12 | 0002) -#define PKCS12_RC4_40 (CIPHER_FAMILYID_PKCS12 | 0011) -#define PKCS12_RC4_128 (CIPHER_FAMILYID_PKCS12 | 0012) -#define PKCS12_DES_56 (CIPHER_FAMILYID_PKCS12 | 0021) -#define PKCS12_DES_EDE3_168 (CIPHER_FAMILYID_PKCS12 | 0022) - -/* SMIME version numbers are negative, to avoid colliding with SSL versions */ -#define SMIME_LIBRARY_VERSION_1_0 -0x0100 - -#endif /* _CIFERFAM_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/hasht.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/hasht.h deleted file mode 100755 index 12c8040..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/hasht.h +++ /dev/null @@ -1,63 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef _HASHT_H_ -#define _HASHT_H_ - -#include "prtypes.h" - -/* Opaque objects */ -typedef struct SECHashObjectStr SECHashObject; -typedef struct HASHContextStr HASHContext; - -/* - * The hash functions the security library supports - * NOTE the order must match the definition of SECHashObjects[]! - */ -typedef enum { - HASH_AlgNULL = 0, - HASH_AlgMD2 = 1, - HASH_AlgMD5 = 2, - HASH_AlgSHA1 = 3, - HASH_AlgSHA256 = 4, - HASH_AlgSHA384 = 5, - HASH_AlgSHA512 = 6, - HASH_AlgSHA224 = 7, - HASH_AlgTOTAL -} HASH_HashType; - -/* - * Number of bytes each hash algorithm produces - */ -#define MD2_LENGTH 16 -#define MD5_LENGTH 16 -#define SHA1_LENGTH 20 -#define SHA224_LENGTH 28 -#define SHA256_LENGTH 32 -#define SHA384_LENGTH 48 -#define SHA512_LENGTH 64 -#define HASH_LENGTH_MAX SHA512_LENGTH - -/* - * Structure to hold hash computation info and routines - */ -struct SECHashObjectStr { - unsigned int length; /* hash output length (in bytes) */ - void * (*create)(void); - void * (*clone)(void *); - void (*destroy)(void *, PRBool); - void (*begin)(void *); - void (*update)(void *, const unsigned char *, unsigned int); - void (*end)(void *, unsigned char *, unsigned int *, unsigned int); - unsigned int blocklength; /* hash input block size (in bytes) */ - HASH_HashType type; - void (*end_raw)(void *, unsigned char *, unsigned int *, unsigned int); -}; - -struct HASHContextStr { - const struct SECHashObjectStr *hashobj; - void *hash_context; -}; - -#endif /* _HASHT_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/nssb64.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/nssb64.h deleted file mode 100755 index 1090744..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/nssb64.h +++ /dev/null @@ -1,94 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * Public prototypes for base64 encoding/decoding. - */ -#ifndef _NSSB64_H_ -#define _NSSB64_H_ - -#include "utilrename.h" -#include "seccomon.h" -#include "nssb64t.h" - -SEC_BEGIN_PROTOS - -/* - * Functions to start a base64 decoding/encoding context. - */ - -extern NSSBase64Decoder * -NSSBase64Decoder_Create (PRInt32 (*output_fn) (void *, const unsigned char *, - PRInt32), - void *output_arg); - -extern NSSBase64Encoder * -NSSBase64Encoder_Create (PRInt32 (*output_fn) (void *, const char *, PRInt32), - void *output_arg); - -/* - * Push data through the decoder/encoder, causing the output_fn (provided - * to Create) to be called with the decoded/encoded data. - */ - -extern SECStatus -NSSBase64Decoder_Update (NSSBase64Decoder *data, const char *buffer, - PRUint32 size); - -extern SECStatus -NSSBase64Encoder_Update (NSSBase64Encoder *data, const unsigned char *buffer, - PRUint32 size); - -/* - * When you're done processing, call this to close the context. - * If "abort_p" is false, then calling this may cause the output_fn - * to be called one last time (as the last buffered data is flushed out). - */ - -extern SECStatus -NSSBase64Decoder_Destroy (NSSBase64Decoder *data, PRBool abort_p); - -extern SECStatus -NSSBase64Encoder_Destroy (NSSBase64Encoder *data, PRBool abort_p); - -/* - * Perform base64 decoding from an ascii string "inStr" to an Item. - * The length of the input must be provided as "inLen". The Item - * may be provided (as "outItemOpt"); you can also pass in a NULL - * and the Item will be allocated for you. - * - * In any case, the data within the Item will be allocated for you. - * All allocation will happen out of the passed-in "arenaOpt", if non-NULL. - * If "arenaOpt" is NULL, standard allocation (heap) will be used and - * you will want to free the result via SECITEM_FreeItem. - * - * Return value is NULL on error, the Item (allocated or provided) otherwise. - */ -extern SECItem * -NSSBase64_DecodeBuffer (PLArenaPool *arenaOpt, SECItem *outItemOpt, - const char *inStr, unsigned int inLen); - -/* - * Perform base64 encoding of binary data "inItem" to an ascii string. - * The output buffer may be provided (as "outStrOpt"); you can also pass - * in a NULL and the buffer will be allocated for you. The result will - * be null-terminated, and if the buffer is provided, "maxOutLen" must - * specify the maximum length of the buffer and will be checked to - * supply sufficient space space for the encoded result. (If "outStrOpt" - * is NULL, "maxOutLen" is ignored.) - * - * If "outStrOpt" is NULL, allocation will happen out of the passed-in - * "arenaOpt", if *it* is non-NULL, otherwise standard allocation (heap) - * will be used. - * - * Return value is NULL on error, the output buffer (allocated or provided) - * otherwise. - */ -extern char * -NSSBase64_EncodeItem (PLArenaPool *arenaOpt, char *outStrOpt, - unsigned int maxOutLen, SECItem *inItem); - -SEC_END_PROTOS - -#endif /* _NSSB64_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/nssb64t.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/nssb64t.h deleted file mode 100755 index 75e7877..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/nssb64t.h +++ /dev/null @@ -1,15 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * Public data structures for base64 encoding/decoding. - */ -#ifndef _NSSB64T_H_ -#define _NSSB64T_H_ - -#include "utilrename.h" -typedef struct NSSBase64DecoderStr NSSBase64Decoder; -typedef struct NSSBase64EncoderStr NSSBase64Encoder; - -#endif /* _NSSB64T_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/nssilckt.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/nssilckt.h deleted file mode 100755 index 7108e0c..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/nssilckt.h +++ /dev/null @@ -1,191 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* -** nssilock.h - Instrumented locking functions for NSS -** -** Description: -** nssilock provides instrumentation for locks and monitors in -** the NSS libraries. The instrumentation, when enabled, causes -** each call to the instrumented function to record data about -** the call to an external file. The external file -** subsequently used to extract performance data and other -** statistical information about the operation of locks used in -** the nss library. -** -** To enable compilation with instrumentation, build NSS with -** the compile time switch NEED_NSS_ILOCK defined. -** -** say: "gmake OS_CFLAGS+=-DNEED_NSS_ILOCK" at make time. -** -** At runtime, to enable recording from nssilock, one or more -** environment variables must be set. For each nssILockType to -** be recorded, an environment variable of the form NSS_ILOCK_x -** must be set to 1. For example: -** -** set NSS_ILOCK_Cert=1 -** -** nssilock uses PRLOG is used to record to trace data. The -** PRLogModule name associated with nssilock data is: "nssilock". -** To enable recording of nssilock data you will need to set the -** environment variable NSPR_LOG_MODULES to enable -** recording for the nssilock log module. Similarly, you will -** need to set the environment variable NSPR_LOG_FILE to specify -** the filename to receive the recorded data. See prlog.h for usage. -** Example: -** -** export NSPR_LOG_MODULES=nssilock:6 -** export NSPR_LOG_FILE=xxxLogfile -** -** Operation: -** nssilock wraps calls to NSPR's PZLock and PZMonitor functions -** with similarly named functions: PZ_NewLock(), etc. When NSS is -** built with lock instrumentation enabled, the PZ* functions are -** compiled into NSS; when lock instrumentation is disabled, -** calls to PZ* functions are directly mapped to PR* functions -** and the instrumentation arguments to the PZ* functions are -** compiled away. -** -** -** File Format: -** The format of the external file is implementation -** dependent. Where NSPR's PR_LOG() function is used, the file -** contains data defined for PR_LOG() plus the data written by -** the wrapped function. On some platforms and under some -** circumstances, platform dependent logging or -** instrumentation probes may be used. In any case, the -** relevant data provided by the lock instrumentation is: -** -** lockType, func, address, duration, line, file [heldTime] -** -** where: -** -** lockType: a character representation of nssILockType for the -** call. e.g. ... "cert" -** -** func: the function doing the tracing. e.g. "NewLock" -** -** address: address of the instrumented lock or monitor -** -** duration: is how long was spent in the instrumented function, -** in PRIntervalTime "ticks". -** -** line: the line number within the calling function -** -** file: the file from which the call was made -** -** heldTime: how long the lock/monitor was held. field -** present only for PZ_Unlock() and PZ_ExitMonitor(). -** -** Design Notes: -** The design for lock instrumentation was influenced by the -** need to gather performance data on NSS 3.x. It is intended -** that the effort to modify NSS to use lock instrumentation -** be minimized. Existing calls to locking functions need only -** have their names changed to the instrumentation function -** names. -** -** Private NSS Interface: -** nssilock.h defines a private interface for use by NSS. -** nssilock.h is experimental in nature and is subject to -** change or revocation without notice. ... Don't mess with -** it. -** -*/ - -/* - * $Id: - */ - -#ifndef _NSSILCKT_H_ -#define _NSSILCKT_H_ - -#include "utilrename.h" -#include "prtypes.h" -#include "prmon.h" -#include "prlock.h" -#include "prcvar.h" - -typedef enum { - nssILockArena = 0, - nssILockSession = 1, - nssILockObject = 2, - nssILockRefLock = 3, - nssILockCert = 4, - nssILockCertDB = 5, - nssILockDBM = 6, - nssILockCache = 7, - nssILockSSL = 8, - nssILockList = 9, - nssILockSlot = 10, - nssILockFreelist = 11, - nssILockOID = 12, - nssILockAttribute = 13, - nssILockPK11cxt = 14, /* pk11context */ - nssILockRWLock = 15, - nssILockOther = 16, - nssILockSelfServ = 17, - nssILockKeyDB = 18, - nssILockLast /* don't use this one! */ -} nssILockType; - -/* -** conditionally compile in nssilock features -*/ -#if defined(NEED_NSS_ILOCK) - -/* -** Declare operation type enumerator -** enumerations identify the function being performed -*/ -typedef enum { - FlushTT = 0, - NewLock = 1, - Lock = 2, - Unlock = 3, - DestroyLock = 4, - NewCondVar = 5, - WaitCondVar = 6, - NotifyCondVar = 7, - NotifyAllCondVar = 8, - DestroyCondVar = 9, - NewMonitor = 10, - EnterMonitor = 11, - ExitMonitor = 12, - Notify = 13, - NotifyAll = 14, - Wait = 15, - DestroyMonitor = 16 -} nssILockOp; - -/* -** Declare the trace record -*/ -struct pzTrace_s { - PRUint32 threadID; /* PR_GetThreadID() */ - nssILockOp op; /* operation being performed */ - nssILockType ltype; /* lock type identifier */ - PRIntervalTime callTime; /* time spent in function */ - PRIntervalTime heldTime; /* lock held time, or -1 */ - void *lock; /* address of lock structure */ - PRIntn line; /* line number */ - char file[24]; /* filename */ -}; - -/* -** declare opaque types. See: nssilock.c -*/ -typedef struct pzlock_s PZLock; -typedef struct pzcondvar_s PZCondVar; -typedef struct pzmonitor_s PZMonitor; - -#else /* NEED_NSS_ILOCK */ - -#define PZLock PRLock -#define PZCondVar PRCondVar -#define PZMonitor PRMonitor - -#endif /* NEED_NSS_ILOCK */ - -#endif /* _NSSILCKT_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/nssilock.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/nssilock.h deleted file mode 100755 index a796e4a..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/nssilock.h +++ /dev/null @@ -1,288 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* -** nssilock.h - Instrumented locking functions for NSS -** -** Description: -** nssilock provides instrumentation for locks and monitors in -** the NSS libraries. The instrumentation, when enabled, causes -** each call to the instrumented function to record data about -** the call to an external file. The external file -** subsequently used to extract performance data and other -** statistical information about the operation of locks used in -** the nss library. -** -** To enable compilation with instrumentation, build NSS with -** the compile time switch NEED_NSS_ILOCK defined. -** -** say: "gmake OS_CFLAGS+=-DNEED_NSS_ILOCK" at make time. -** -** At runtime, to enable recording from nssilock, one or more -** environment variables must be set. For each nssILockType to -** be recorded, an environment variable of the form NSS_ILOCK_x -** must be set to 1. For example: -** -** set NSS_ILOCK_Cert=1 -** -** nssilock uses PRLOG is used to record to trace data. The -** PRLogModule name associated with nssilock data is: "nssilock". -** To enable recording of nssilock data you will need to set the -** environment variable NSPR_LOG_MODULES to enable -** recording for the nssilock log module. Similarly, you will -** need to set the environment variable NSPR_LOG_FILE to specify -** the filename to receive the recorded data. See prlog.h for usage. -** Example: -** -** export NSPR_LOG_MODULES=nssilock:6 -** export NSPR_LOG_FILE=xxxLogfile -** -** Operation: -** nssilock wraps calls to NSPR's PZLock and PZMonitor functions -** with similarly named functions: PZ_NewLock(), etc. When NSS is -** built with lock instrumentation enabled, the PZ* functions are -** compiled into NSS; when lock instrumentation is disabled, -** calls to PZ* functions are directly mapped to PR* functions -** and the instrumentation arguments to the PZ* functions are -** compiled away. -** -** -** File Format: -** The format of the external file is implementation -** dependent. Where NSPR's PR_LOG() function is used, the file -** contains data defined for PR_LOG() plus the data written by -** the wrapped function. On some platforms and under some -** circumstances, platform dependent logging or -** instrumentation probes may be used. In any case, the -** relevant data provided by the lock instrumentation is: -** -** lockType, func, address, duration, line, file [heldTime] -** -** where: -** -** lockType: a character representation of nssILockType for the -** call. e.g. ... "cert" -** -** func: the function doing the tracing. e.g. "NewLock" -** -** address: address of the instrumented lock or monitor -** -** duration: is how long was spent in the instrumented function, -** in PRIntervalTime "ticks". -** -** line: the line number within the calling function -** -** file: the file from which the call was made -** -** heldTime: how long the lock/monitor was held. field -** present only for PZ_Unlock() and PZ_ExitMonitor(). -** -** Design Notes: -** The design for lock instrumentation was influenced by the -** need to gather performance data on NSS 3.x. It is intended -** that the effort to modify NSS to use lock instrumentation -** be minimized. Existing calls to locking functions need only -** have their names changed to the instrumentation function -** names. -** -** Private NSS Interface: -** nssilock.h defines a private interface for use by NSS. -** nssilock.h is experimental in nature and is subject to -** change or revocation without notice. ... Don't mess with -** it. -** -*/ - -/* - * $Id: - */ - -#ifndef _NSSILOCK_H_ -#define _NSSILOCK_H_ - -#include "utilrename.h" -#include "prtypes.h" -#include "prmon.h" -#include "prlock.h" -#include "prcvar.h" - -#include "nssilckt.h" - -PR_BEGIN_EXTERN_C - -#if defined(NEED_NSS_ILOCK) - -#define PZ_NewLock(t) pz_NewLock((t),__FILE__,__LINE__) -extern PZLock * - pz_NewLock( - nssILockType ltype, - char *file, - PRIntn line - ); - -#define PZ_Lock(k) pz_Lock((k),__FILE__,__LINE__) -extern void - pz_Lock( - PZLock *lock, - char *file, - PRIntn line - ); - -#define PZ_Unlock(k) pz_Unlock((k),__FILE__,__LINE__) -extern PRStatus - pz_Unlock( - PZLock *lock, - char *file, - PRIntn line - ); - -#define PZ_DestroyLock(k) pz_DestroyLock((k),__FILE__,__LINE__) -extern void - pz_DestroyLock( - PZLock *lock, - char *file, - PRIntn line - ); - - -#define PZ_NewCondVar(l) pz_NewCondVar((l),__FILE__,__LINE__) -extern PZCondVar * - pz_NewCondVar( - PZLock *lock, - char *file, - PRIntn line - ); - -#define PZ_DestroyCondVar(v) pz_DestroyCondVar((v),__FILE__,__LINE__) -extern void - pz_DestroyCondVar( - PZCondVar *cvar, - char *file, - PRIntn line - ); - -#define PZ_WaitCondVar(v,t) pz_WaitCondVar((v),(t),__FILE__,__LINE__) -extern PRStatus - pz_WaitCondVar( - PZCondVar *cvar, - PRIntervalTime timeout, - char *file, - PRIntn line - ); - -#define PZ_NotifyCondVar(v) pz_NotifyCondVar((v),__FILE__,__LINE__) -extern PRStatus - pz_NotifyCondVar( - PZCondVar *cvar, - char *file, - PRIntn line - ); - -#define PZ_NotifyAllCondVar(v) pz_NotifyAllCondVar((v),__FILE__,__LINE__) -extern PRStatus - pz_NotifyAllCondVar( - PZCondVar *cvar, - char *file, - PRIntn line - ); - - -#define PZ_NewMonitor(t) pz_NewMonitor((t),__FILE__,__LINE__) -extern PZMonitor * - pz_NewMonitor( - nssILockType ltype, - char *file, - PRIntn line - ); - -#define PZ_DestroyMonitor(m) pz_DestroyMonitor((m),__FILE__,__LINE__) -extern void - pz_DestroyMonitor( - PZMonitor *mon, - char *file, - PRIntn line - ); - -#define PZ_EnterMonitor(m) pz_EnterMonitor((m),__FILE__,__LINE__) -extern void - pz_EnterMonitor( - PZMonitor *mon, - char *file, - PRIntn line - ); - - -#define PZ_ExitMonitor(m) pz_ExitMonitor((m),__FILE__,__LINE__) -extern PRStatus - pz_ExitMonitor( - PZMonitor *mon, - char *file, - PRIntn line - ); - -#define PZ_InMonitor(m) (PZ_GetMonitorEntryCount(m) > 0 ) -#define PZ_GetMonitorEntryCount(m) pz_GetMonitorEntryCount((m),__FILE__,__LINE__) -extern PRIntn - pz_GetMonitorEntryCount( - PZMonitor *mon, - char *file, - PRIntn line - ); - -#define PZ_Wait(m,i) pz_Wait((m),((i)),__FILE__,__LINE__) -extern PRStatus - pz_Wait( - PZMonitor *mon, - PRIntervalTime ticks, - char *file, - PRIntn line - ); - -#define PZ_Notify(m) pz_Notify((m),__FILE__,__LINE__) -extern PRStatus - pz_Notify( - PZMonitor *mon, - char *file, - PRIntn line - ); - -#define PZ_NotifyAll(m) pz_NotifyAll((m),__FILE__,__LINE__) -extern PRStatus - pz_NotifyAll( - PZMonitor *mon, - char *file, - PRIntn line - ); - -#define PZ_TraceFlush() pz_TraceFlush() -extern void pz_TraceFlush( void ); - -#else /* NEED_NSS_ILOCK */ - -#define PZ_NewLock(t) PR_NewLock() -#define PZ_DestroyLock(k) PR_DestroyLock((k)) -#define PZ_Lock(k) PR_Lock((k)) -#define PZ_Unlock(k) PR_Unlock((k)) - -#define PZ_NewCondVar(l) PR_NewCondVar((l)) -#define PZ_DestroyCondVar(v) PR_DestroyCondVar((v)) -#define PZ_WaitCondVar(v,t) PR_WaitCondVar((v),(t)) -#define PZ_NotifyCondVar(v) PR_NotifyCondVar((v)) -#define PZ_NotifyAllCondVar(v) PR_NotifyAllCondVar((v)) - -#define PZ_NewMonitor(t) PR_NewMonitor() -#define PZ_DestroyMonitor(m) PR_DestroyMonitor((m)) -#define PZ_EnterMonitor(m) PR_EnterMonitor((m)) -#define PZ_ExitMonitor(m) PR_ExitMonitor((m)) -#define PZ_InMonitor(m) PR_InMonitor((m)) -#define PZ_Wait(m,t) PR_Wait(((m)),((t))) -#define PZ_Notify(m) PR_Notify((m)) -#define PZ_NotifyAll(m) PR_Notify((m)) -#define PZ_TraceFlush() /* nothing */ - - -#endif /* NEED_NSS_ILOCK */ - -PR_END_EXTERN_C -#endif /* _NSSILOCK_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/nsslocks.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/nsslocks.h deleted file mode 100755 index 6098f56..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/nsslocks.h +++ /dev/null @@ -1,10 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * nsslocks.h - threadsafe functions to initialize lock pointers. - * - * NOTE - The interfaces formerly in this header were private and are now all - * obsolete. - */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/nssrwlk.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/nssrwlk.h deleted file mode 100755 index 3402c82..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/nssrwlk.h +++ /dev/null @@ -1,132 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* -** File: nsrwlock.h -** Description: API to basic reader-writer lock functions of NSS. -** These are re-entrant reader writer locks; that is, -** If I hold the write lock, I can ask for it and get it again. -** If I hold the write lock, I can also ask for and get a read lock. -** I can then release the locks in any order (read or write). -** I must release each lock type as many times as I acquired it. -** Otherwise, these are normal reader/writer locks. -** -** For deadlock detection, locks should be ranked, and no lock may be aquired -** while I hold a lock of higher rank number. -** If you don't want that feature, always use NSS_RWLOCK_RANK_NONE. -** Lock name is for debugging, and is optional (may be NULL) -**/ - -#ifndef nssrwlk_h___ -#define nssrwlk_h___ - -#include "utilrename.h" -#include "prtypes.h" -#include "nssrwlkt.h" - -#define NSS_RWLOCK_RANK_NONE 0 - -/* SEC_BEGIN_PROTOS */ -PR_BEGIN_EXTERN_C - -/*********************************************************************** -** FUNCTION: NSSRWLock_New -** DESCRIPTION: -** Returns a pointer to a newly created reader-writer lock object. -** INPUTS: Lock rank -** Lock name -** OUTPUTS: void -** RETURN: NSSRWLock* -** If the lock cannot be created because of resource constraints, NULL -** is returned. -** -***********************************************************************/ -extern NSSRWLock* NSSRWLock_New(PRUint32 lock_rank, const char *lock_name); - -/*********************************************************************** -** FUNCTION: NSSRWLock_AtomicCreate -** DESCRIPTION: -** Given the address of a NULL pointer to a NSSRWLock, -** atomically initializes that pointer to a newly created NSSRWLock. -** Returns the value placed into that pointer, or NULL. -** -** INPUTS: address of NSRWLock pointer -** Lock rank -** Lock name -** OUTPUTS: NSSRWLock* -** RETURN: NSSRWLock* -** If the lock cannot be created because of resource constraints, -** the pointer will be left NULL. -** -***********************************************************************/ -extern NSSRWLock * -nssRWLock_AtomicCreate( NSSRWLock ** prwlock, - PRUint32 lock_rank, - const char * lock_name); - -/*********************************************************************** -** FUNCTION: NSSRWLock_Destroy -** DESCRIPTION: -** Destroys a given RW lock object. -** INPUTS: NSSRWLock *lock - Lock to be freed. -** OUTPUTS: void -** RETURN: None -***********************************************************************/ -extern void NSSRWLock_Destroy(NSSRWLock *lock); - -/*********************************************************************** -** FUNCTION: NSSRWLock_LockRead -** DESCRIPTION: -** Apply a read lock (non-exclusive) on a RWLock -** INPUTS: NSSRWLock *lock - Lock to be read-locked. -** OUTPUTS: void -** RETURN: None -***********************************************************************/ -extern void NSSRWLock_LockRead(NSSRWLock *lock); - -/*********************************************************************** -** FUNCTION: NSSRWLock_LockWrite -** DESCRIPTION: -** Apply a write lock (exclusive) on a RWLock -** INPUTS: NSSRWLock *lock - Lock to write-locked. -** OUTPUTS: void -** RETURN: None -***********************************************************************/ -extern void NSSRWLock_LockWrite(NSSRWLock *lock); - -/*********************************************************************** -** FUNCTION: NSSRWLock_UnlockRead -** DESCRIPTION: -** Release a Read lock. Unlocking an unlocked lock has undefined results. -** INPUTS: NSSRWLock *lock - Lock to unlocked. -** OUTPUTS: void -** RETURN: void -***********************************************************************/ -extern void NSSRWLock_UnlockRead(NSSRWLock *lock); - -/*********************************************************************** -** FUNCTION: NSSRWLock_UnlockWrite -** DESCRIPTION: -** Release a Write lock. Unlocking an unlocked lock has undefined results. -** INPUTS: NSSRWLock *lock - Lock to unlocked. -** OUTPUTS: void -** RETURN: void -***********************************************************************/ -extern void NSSRWLock_UnlockWrite(NSSRWLock *lock); - -/*********************************************************************** -** FUNCTION: NSSRWLock_HaveWriteLock -** DESCRIPTION: -** Tells caller whether the current thread holds the write lock, or not. -** INPUTS: NSSRWLock *lock - Lock to test. -** OUTPUTS: void -** RETURN: PRBool PR_TRUE IFF the current thread holds the write lock. -***********************************************************************/ - -extern PRBool NSSRWLock_HaveWriteLock(NSSRWLock *rwlock); - -/* SEC_END_PROTOS */ -PR_END_EXTERN_C - -#endif /* nsrwlock_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/nssrwlkt.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/nssrwlkt.h deleted file mode 100755 index 5725103..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/nssrwlkt.h +++ /dev/null @@ -1,20 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef nssrwlkt_h___ -#define nssrwlkt_h___ - -#include "utilrename.h" -#include "nssilock.h" -/* - * NSSRWLock -- - * - * The reader writer lock, NSSRWLock, is an opaque object to the clients - * of NSS. All routines operate on a pointer to this opaque entity. - */ - -typedef struct nssRWLockStr NSSRWLock; - - -#endif /* nsrwlock_h___ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/nssutil.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/nssutil.h deleted file mode 100755 index da55273..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/nssutil.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * NSS utility functions - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef __nssutil_h_ -#define __nssutil_h_ - -#ifndef RC_INVOKED -#include "seccomon.h" -#endif - -/* - * NSS utilities's major version, minor version, patch level, build number, - * and whether this is a beta release. - * - * The format of the version string should be - * ".[.[.]][ ]" - */ -#define NSSUTIL_VERSION "3.16" -#define NSSUTIL_VMAJOR 3 -#define NSSUTIL_VMINOR 16 -#define NSSUTIL_VPATCH 0 -#define NSSUTIL_VBUILD 0 -#define NSSUTIL_BETA PR_FALSE - -SEC_BEGIN_PROTOS - -/* - * Returns a const string of the UTIL library version. - */ -extern const char *NSSUTIL_GetVersion(void); - -extern SECStatus -NSS_InitializePRErrorTable(void); - -SEC_END_PROTOS - -#endif /* __nssutil_h_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/pkcs11.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/pkcs11.h deleted file mode 100755 index 74ac250..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/pkcs11.h +++ /dev/null @@ -1,257 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/* - * Copyright (C) 1994-1999 RSA Security Inc. Licence to copy this document - * is granted provided that it is identified as "RSA Security In.c Public-Key - * Cryptography Standards (PKCS)" in all material mentioning or referencing - * this document. - * - * The latest version of this header can be found at: - * http://www.rsalabs.com/pkcs/pkcs-11/index.html - */ -#ifndef _PKCS11_H_ -#define _PKCS11_H_ 1 - -#ifdef __cplusplus -extern "C" { -#endif - -/* Before including this file (pkcs11.h) (or pkcs11t.h by - * itself), 6 platform-specific macros must be defined. These - * macros are described below, and typical definitions for them - * are also given. Be advised that these definitions can depend - * on both the platform and the compiler used (and possibly also - * on whether a PKCS #11 library is linked statically or - * dynamically). - * - * In addition to defining these 6 macros, the packing convention - * for PKCS #11 structures should be set. The PKCS #11 - * convention on packing is that structures should be 1-byte - * aligned. - * - * In a Win32 environment, this might be done by using the - * following preprocessor directive before including pkcs11.h - * or pkcs11t.h: - * - * #pragma pack(push, cryptoki, 1) - * - * and using the following preprocessor directive after including - * pkcs11.h or pkcs11t.h: - * - * #pragma pack(pop, cryptoki) - * - * In a UNIX environment, you're on your own here. You might - * not need to do anything. - * - * - * Now for the macros: - * - * - * 1. CK_PTR: The indirection string for making a pointer to an - * object. It can be used like this: - * - * typedef CK_BYTE CK_PTR CK_BYTE_PTR; - * - * In a Win32 environment, it might be defined by - * - * #define CK_PTR * - * - * In a UNIX environment, it might be defined by - * - * #define CK_PTR * - * - * - * 2. CK_DEFINE_FUNCTION(returnType, name): A macro which makes - * an exportable PKCS #11 library function definition out of a - * return type and a function name. It should be used in the - * following fashion to define the exposed PKCS #11 functions in - * a PKCS #11 library: - * - * CK_DEFINE_FUNCTION(CK_RV, C_Initialize)( - * CK_VOID_PTR pReserved - * ) - * { - * ... - * } - * - * For defining a function in a Win32 PKCS #11 .dll, it might be - * defined by - * - * #define CK_DEFINE_FUNCTION(returnType, name) \ - * returnType __declspec(dllexport) name - * - * In a UNIX environment, it might be defined by - * - * #define CK_DEFINE_FUNCTION(returnType, name) \ - * returnType name - * - * - * 3. CK_DECLARE_FUNCTION(returnType, name): A macro which makes - * an importable PKCS #11 library function declaration out of a - * return type and a function name. It should be used in the - * following fashion: - * - * extern CK_DECLARE_FUNCTION(CK_RV, C_Initialize)( - * CK_VOID_PTR pReserved - * ); - * - * For declaring a function in a Win32 PKCS #11 .dll, it might - * be defined by - * - * #define CK_DECLARE_FUNCTION(returnType, name) \ - * returnType __declspec(dllimport) name - * - * In a UNIX environment, it might be defined by - * - * #define CK_DECLARE_FUNCTION(returnType, name) \ - * returnType name - * - * - * 4. CK_DECLARE_FUNCTION_POINTER(returnType, name): A macro - * which makes a PKCS #11 API function pointer declaration or - * function pointer type declaration out of a return type and a - * function name. It should be used in the following fashion: - * - * // Define funcPtr to be a pointer to a PKCS #11 API function - * // taking arguments args and returning CK_RV. - * CK_DECLARE_FUNCTION_POINTER(CK_RV, funcPtr)(args); - * - * or - * - * // Define funcPtrType to be the type of a pointer to a - * // PKCS #11 API function taking arguments args and returning - * // CK_RV, and then define funcPtr to be a variable of type - * // funcPtrType. - * typedef CK_DECLARE_FUNCTION_POINTER(CK_RV, funcPtrType)(args); - * funcPtrType funcPtr; - * - * For accessing functions in a Win32 PKCS #11 .dll, in might be - * defined by - * - * #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \ - * returnType __declspec(dllimport) (* name) - * - * In a UNIX environment, it might be defined by - * - * #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \ - * returnType (* name) - * - * - * 5. CK_CALLBACK_FUNCTION(returnType, name): A macro which makes - * a function pointer type for an application callback out of - * a return type for the callback and a name for the callback. - * It should be used in the following fashion: - * - * CK_CALLBACK_FUNCTION(CK_RV, myCallback)(args); - * - * to declare a function pointer, myCallback, to a callback - * which takes arguments args and returns a CK_RV. It can also - * be used like this: - * - * typedef CK_CALLBACK_FUNCTION(CK_RV, myCallbackType)(args); - * myCallbackType myCallback; - * - * In a Win32 environment, it might be defined by - * - * #define CK_CALLBACK_FUNCTION(returnType, name) \ - * returnType (* name) - * - * In a UNIX environment, it might be defined by - * - * #define CK_CALLBACK_FUNCTION(returnType, name) \ - * returnType (* name) - * - * - * 6. NULL_PTR: This macro is the value of a NULL pointer. - * - * In any ANSI/ISO C environment (and in many others as well), - * this should be defined by - * - * #ifndef NULL_PTR - * #define NULL_PTR 0 - * #endif - */ - - -/* All the various PKCS #11 types and #define'd values are in the - * file pkcs11t.h. */ -#include "pkcs11t.h" - -#define __PASTE(x,y) x##y - - -/* packing defines */ -#include "pkcs11p.h" -/* ============================================================== - * Define the "extern" form of all the entry points. - * ============================================================== - */ - -#define CK_NEED_ARG_LIST 1 -#define CK_PKCS11_FUNCTION_INFO(name) \ - CK_DECLARE_FUNCTION(CK_RV, name) - -/* pkcs11f.h has all the information about the PKCS #11 - * function prototypes. */ -#include "pkcs11f.h" - -#undef CK_NEED_ARG_LIST -#undef CK_PKCS11_FUNCTION_INFO - - -/* ============================================================== - * Define the typedef form of all the entry points. That is, for - * each PKCS #11 function C_XXX, define a type CK_C_XXX which is - * a pointer to that kind of function. - * ============================================================== - */ - -#define CK_NEED_ARG_LIST 1 -#define CK_PKCS11_FUNCTION_INFO(name) \ - typedef CK_DECLARE_FUNCTION_POINTER(CK_RV, __PASTE(CK_,name)) - -/* pkcs11f.h has all the information about the PKCS #11 - * function prototypes. */ -#include "pkcs11f.h" - -#undef CK_NEED_ARG_LIST -#undef CK_PKCS11_FUNCTION_INFO - - -/* ============================================================== - * Define structed vector of entry points. A CK_FUNCTION_LIST - * contains a CK_VERSION indicating a library's PKCS #11 version - * and then a whole slew of function pointers to the routines in - * the library. This type was declared, but not defined, in - * pkcs11t.h. - * ============================================================== - */ - -#define CK_PKCS11_FUNCTION_INFO(name) \ - __PASTE(CK_,name) name; - -struct CK_FUNCTION_LIST { - - CK_VERSION version; /* PKCS #11 version */ - -/* Pile all the function pointers into the CK_FUNCTION_LIST. */ -/* pkcs11f.h has all the information about the PKCS #11 - * function prototypes. */ -#include "pkcs11f.h" - -}; - -#undef CK_PKCS11_FUNCTION_INFO - - -#undef __PASTE - -/* unpack */ -#include "pkcs11u.h" - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/pkcs11f.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/pkcs11f.h deleted file mode 100755 index 732b1a1..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/pkcs11f.h +++ /dev/null @@ -1,905 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/* - * Copyright (C) 1994-1999 RSA Security Inc. Licence to copy this document - * is granted provided that it is identified as "RSA Security In.c Public-Key - * Cryptography Standards (PKCS)" in all material mentioning or referencing - * this document. - */ -/* This function contains pretty much everything about all the */ -/* PKCS #11 function prototypes. Because this information is */ -/* used for more than just declaring function prototypes, the */ -/* order of the functions appearing herein is important, and */ -/* should not be altered. */ - - - -/* General-purpose */ - -/* C_Initialize initializes the PKCS #11 library. */ -CK_PKCS11_FUNCTION_INFO(C_Initialize) -#ifdef CK_NEED_ARG_LIST -( - CK_VOID_PTR pInitArgs /* if this is not NULL_PTR, it gets - * cast to CK_C_INITIALIZE_ARGS_PTR - * and dereferenced */ -); -#endif - - -/* C_Finalize indicates that an application is done with the - * PKCS #11 library. */ -CK_PKCS11_FUNCTION_INFO(C_Finalize) -#ifdef CK_NEED_ARG_LIST -( - CK_VOID_PTR pReserved /* reserved. Should be NULL_PTR */ -); -#endif - - -/* C_GetInfo returns general information about PKCS #11. */ -CK_PKCS11_FUNCTION_INFO(C_GetInfo) -#ifdef CK_NEED_ARG_LIST -( - CK_INFO_PTR pInfo /* location that receives information */ -); -#endif - - -/* C_GetFunctionList returns the function list. */ -CK_PKCS11_FUNCTION_INFO(C_GetFunctionList) -#ifdef CK_NEED_ARG_LIST -( - CK_FUNCTION_LIST_PTR_PTR ppFunctionList /* receives pointer to - * function list */ -); -#endif - - - -/* Slot and token management */ - -/* C_GetSlotList obtains a list of slots in the system. */ -CK_PKCS11_FUNCTION_INFO(C_GetSlotList) -#ifdef CK_NEED_ARG_LIST -( - CK_BBOOL tokenPresent, /* only slots with tokens? */ - CK_SLOT_ID_PTR pSlotList, /* receives array of slot IDs */ - CK_ULONG_PTR pulCount /* receives number of slots */ -); -#endif - - -/* C_GetSlotInfo obtains information about a particular slot in - * the system. */ -CK_PKCS11_FUNCTION_INFO(C_GetSlotInfo) -#ifdef CK_NEED_ARG_LIST -( - CK_SLOT_ID slotID, /* the ID of the slot */ - CK_SLOT_INFO_PTR pInfo /* receives the slot information */ -); -#endif - - -/* C_GetTokenInfo obtains information about a particular token - * in the system. */ -CK_PKCS11_FUNCTION_INFO(C_GetTokenInfo) -#ifdef CK_NEED_ARG_LIST -( - CK_SLOT_ID slotID, /* ID of the token's slot */ - CK_TOKEN_INFO_PTR pInfo /* receives the token information */ -); -#endif - - -/* C_GetMechanismList obtains a list of mechanism types - * supported by a token. */ -CK_PKCS11_FUNCTION_INFO(C_GetMechanismList) -#ifdef CK_NEED_ARG_LIST -( - CK_SLOT_ID slotID, /* ID of token's slot */ - CK_MECHANISM_TYPE_PTR pMechanismList, /* gets mech. array */ - CK_ULONG_PTR pulCount /* gets # of mechs. */ -); -#endif - - -/* C_GetMechanismInfo obtains information about a particular - * mechanism possibly supported by a token. */ -CK_PKCS11_FUNCTION_INFO(C_GetMechanismInfo) -#ifdef CK_NEED_ARG_LIST -( - CK_SLOT_ID slotID, /* ID of the token's slot */ - CK_MECHANISM_TYPE type, /* type of mechanism */ - CK_MECHANISM_INFO_PTR pInfo /* receives mechanism info */ -); -#endif - - -/* C_InitToken initializes a token. */ -CK_PKCS11_FUNCTION_INFO(C_InitToken) -#ifdef CK_NEED_ARG_LIST -/* pLabel changed from CK_CHAR_PTR to CK_UTF8CHAR_PTR for v2.10 */ -( - CK_SLOT_ID slotID, /* ID of the token's slot */ - CK_UTF8CHAR_PTR pPin, /* the SO's initial PIN */ - CK_ULONG ulPinLen, /* length in bytes of the PIN */ - CK_UTF8CHAR_PTR pLabel /* 32-byte token label (blank padded) */ -); -#endif - - -/* C_InitPIN initializes the normal user's PIN. */ -CK_PKCS11_FUNCTION_INFO(C_InitPIN) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_UTF8CHAR_PTR pPin, /* the normal user's PIN */ - CK_ULONG ulPinLen /* length in bytes of the PIN */ -); -#endif - - -/* C_SetPIN modifies the PIN of the user who is logged in. */ -CK_PKCS11_FUNCTION_INFO(C_SetPIN) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_UTF8CHAR_PTR pOldPin, /* the old PIN */ - CK_ULONG ulOldLen, /* length of the old PIN */ - CK_UTF8CHAR_PTR pNewPin, /* the new PIN */ - CK_ULONG ulNewLen /* length of the new PIN */ -); -#endif - - - -/* Session management */ - -/* C_OpenSession opens a session between an application and a - * token. */ -CK_PKCS11_FUNCTION_INFO(C_OpenSession) -#ifdef CK_NEED_ARG_LIST -( - CK_SLOT_ID slotID, /* the slot's ID */ - CK_FLAGS flags, /* from CK_SESSION_INFO */ - CK_VOID_PTR pApplication, /* passed to callback */ - CK_NOTIFY Notify, /* callback function */ - CK_SESSION_HANDLE_PTR phSession /* gets session handle */ -); -#endif - - -/* C_CloseSession closes a session between an application and a - * token. */ -CK_PKCS11_FUNCTION_INFO(C_CloseSession) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession /* the session's handle */ -); -#endif - - -/* C_CloseAllSessions closes all sessions with a token. */ -CK_PKCS11_FUNCTION_INFO(C_CloseAllSessions) -#ifdef CK_NEED_ARG_LIST -( - CK_SLOT_ID slotID /* the token's slot */ -); -#endif - - -/* C_GetSessionInfo obtains information about the session. */ -CK_PKCS11_FUNCTION_INFO(C_GetSessionInfo) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_SESSION_INFO_PTR pInfo /* receives session info */ -); -#endif - - -/* C_GetOperationState obtains the state of the cryptographic operation - * in a session. */ -CK_PKCS11_FUNCTION_INFO(C_GetOperationState) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* session's handle */ - CK_BYTE_PTR pOperationState, /* gets state */ - CK_ULONG_PTR pulOperationStateLen /* gets state length */ -); -#endif - - -/* C_SetOperationState restores the state of the cryptographic - * operation in a session. */ -CK_PKCS11_FUNCTION_INFO(C_SetOperationState) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* session's handle */ - CK_BYTE_PTR pOperationState, /* holds state */ - CK_ULONG ulOperationStateLen, /* holds state length */ - CK_OBJECT_HANDLE hEncryptionKey, /* en/decryption key */ - CK_OBJECT_HANDLE hAuthenticationKey /* sign/verify key */ -); -#endif - - -/* C_Login logs a user into a token. */ -CK_PKCS11_FUNCTION_INFO(C_Login) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_USER_TYPE userType, /* the user type */ - CK_UTF8CHAR_PTR pPin, /* the user's PIN */ - CK_ULONG ulPinLen /* the length of the PIN */ -); -#endif - - -/* C_Logout logs a user out from a token. */ -CK_PKCS11_FUNCTION_INFO(C_Logout) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession /* the session's handle */ -); -#endif - - - -/* Object management */ - -/* C_CreateObject creates a new object. */ -CK_PKCS11_FUNCTION_INFO(C_CreateObject) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_ATTRIBUTE_PTR pTemplate, /* the object's template */ - CK_ULONG ulCount, /* attributes in template */ - CK_OBJECT_HANDLE_PTR phObject /* gets new object's handle. */ -); -#endif - - -/* C_CopyObject copies an object, creating a new object for the - * copy. */ -CK_PKCS11_FUNCTION_INFO(C_CopyObject) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_OBJECT_HANDLE hObject, /* the object's handle */ - CK_ATTRIBUTE_PTR pTemplate, /* template for new object */ - CK_ULONG ulCount, /* attributes in template */ - CK_OBJECT_HANDLE_PTR phNewObject /* receives handle of copy */ -); -#endif - - -/* C_DestroyObject destroys an object. */ -CK_PKCS11_FUNCTION_INFO(C_DestroyObject) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_OBJECT_HANDLE hObject /* the object's handle */ -); -#endif - - -/* C_GetObjectSize gets the size of an object in bytes. */ -CK_PKCS11_FUNCTION_INFO(C_GetObjectSize) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_OBJECT_HANDLE hObject, /* the object's handle */ - CK_ULONG_PTR pulSize /* receives size of object */ -); -#endif - - -/* C_GetAttributeValue obtains the value of one or more object - * attributes. */ -CK_PKCS11_FUNCTION_INFO(C_GetAttributeValue) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_OBJECT_HANDLE hObject, /* the object's handle */ - CK_ATTRIBUTE_PTR pTemplate, /* specifies attrs; gets vals */ - CK_ULONG ulCount /* attributes in template */ -); -#endif - - -/* C_SetAttributeValue modifies the value of one or more object - * attributes */ -CK_PKCS11_FUNCTION_INFO(C_SetAttributeValue) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_OBJECT_HANDLE hObject, /* the object's handle */ - CK_ATTRIBUTE_PTR pTemplate, /* specifies attrs and values */ - CK_ULONG ulCount /* attributes in template */ -); -#endif - - -/* C_FindObjectsInit initializes a search for token and session - * objects that match a template. */ -CK_PKCS11_FUNCTION_INFO(C_FindObjectsInit) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_ATTRIBUTE_PTR pTemplate, /* attribute values to match */ - CK_ULONG ulCount /* attrs in search template */ -); -#endif - - -/* C_FindObjects continues a search for token and session - * objects that match a template, obtaining additional object - * handles. */ -CK_PKCS11_FUNCTION_INFO(C_FindObjects) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* session's handle */ - CK_OBJECT_HANDLE_PTR phObject, /* gets obj. handles */ - CK_ULONG ulMaxObjectCount, /* max handles to get */ - CK_ULONG_PTR pulObjectCount /* actual # returned */ -); -#endif - - -/* C_FindObjectsFinal finishes a search for token and session - * objects. */ -CK_PKCS11_FUNCTION_INFO(C_FindObjectsFinal) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession /* the session's handle */ -); -#endif - - - -/* Encryption and decryption */ - -/* C_EncryptInit initializes an encryption operation. */ -CK_PKCS11_FUNCTION_INFO(C_EncryptInit) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_MECHANISM_PTR pMechanism, /* the encryption mechanism */ - CK_OBJECT_HANDLE hKey /* handle of encryption key */ -); -#endif - - -/* C_Encrypt encrypts single-part data. */ -CK_PKCS11_FUNCTION_INFO(C_Encrypt) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* session's handle */ - CK_BYTE_PTR pData, /* the plaintext data */ - CK_ULONG ulDataLen, /* bytes of plaintext */ - CK_BYTE_PTR pEncryptedData, /* gets ciphertext */ - CK_ULONG_PTR pulEncryptedDataLen /* gets c-text size */ -); -#endif - - -/* C_EncryptUpdate continues a multiple-part encryption - * operation. */ -CK_PKCS11_FUNCTION_INFO(C_EncryptUpdate) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* session's handle */ - CK_BYTE_PTR pPart, /* the plaintext data */ - CK_ULONG ulPartLen, /* plaintext data len */ - CK_BYTE_PTR pEncryptedPart, /* gets ciphertext */ - CK_ULONG_PTR pulEncryptedPartLen /* gets c-text size */ -); -#endif - - -/* C_EncryptFinal finishes a multiple-part encryption - * operation. */ -CK_PKCS11_FUNCTION_INFO(C_EncryptFinal) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* session handle */ - CK_BYTE_PTR pLastEncryptedPart, /* last c-text */ - CK_ULONG_PTR pulLastEncryptedPartLen /* gets last size */ -); -#endif - - -/* C_DecryptInit initializes a decryption operation. */ -CK_PKCS11_FUNCTION_INFO(C_DecryptInit) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_MECHANISM_PTR pMechanism, /* the decryption mechanism */ - CK_OBJECT_HANDLE hKey /* handle of decryption key */ -); -#endif - - -/* C_Decrypt decrypts encrypted data in a single part. */ -CK_PKCS11_FUNCTION_INFO(C_Decrypt) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* session's handle */ - CK_BYTE_PTR pEncryptedData, /* ciphertext */ - CK_ULONG ulEncryptedDataLen, /* ciphertext length */ - CK_BYTE_PTR pData, /* gets plaintext */ - CK_ULONG_PTR pulDataLen /* gets p-text size */ -); -#endif - - -/* C_DecryptUpdate continues a multiple-part decryption - * operation. */ -CK_PKCS11_FUNCTION_INFO(C_DecryptUpdate) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* session's handle */ - CK_BYTE_PTR pEncryptedPart, /* encrypted data */ - CK_ULONG ulEncryptedPartLen, /* input length */ - CK_BYTE_PTR pPart, /* gets plaintext */ - CK_ULONG_PTR pulPartLen /* p-text size */ -); -#endif - - -/* C_DecryptFinal finishes a multiple-part decryption - * operation. */ -CK_PKCS11_FUNCTION_INFO(C_DecryptFinal) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_BYTE_PTR pLastPart, /* gets plaintext */ - CK_ULONG_PTR pulLastPartLen /* p-text size */ -); -#endif - - - -/* Message digesting */ - -/* C_DigestInit initializes a message-digesting operation. */ -CK_PKCS11_FUNCTION_INFO(C_DigestInit) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_MECHANISM_PTR pMechanism /* the digesting mechanism */ -); -#endif - - -/* C_Digest digests data in a single part. */ -CK_PKCS11_FUNCTION_INFO(C_Digest) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_BYTE_PTR pData, /* data to be digested */ - CK_ULONG ulDataLen, /* bytes of data to digest */ - CK_BYTE_PTR pDigest, /* gets the message digest */ - CK_ULONG_PTR pulDigestLen /* gets digest length */ -); -#endif - - -/* C_DigestUpdate continues a multiple-part message-digesting - * operation. */ -CK_PKCS11_FUNCTION_INFO(C_DigestUpdate) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_BYTE_PTR pPart, /* data to be digested */ - CK_ULONG ulPartLen /* bytes of data to be digested */ -); -#endif - - -/* C_DigestKey continues a multi-part message-digesting - * operation, by digesting the value of a secret key as part of - * the data already digested. */ -CK_PKCS11_FUNCTION_INFO(C_DigestKey) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_OBJECT_HANDLE hKey /* secret key to digest */ -); -#endif - - -/* C_DigestFinal finishes a multiple-part message-digesting - * operation. */ -CK_PKCS11_FUNCTION_INFO(C_DigestFinal) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_BYTE_PTR pDigest, /* gets the message digest */ - CK_ULONG_PTR pulDigestLen /* gets byte count of digest */ -); -#endif - - - -/* Signing and MACing */ - -/* C_SignInit initializes a signature (private key encryption) - * operation, where the signature is (will be) an appendix to - * the data, and plaintext cannot be recovered from the - *signature. */ -CK_PKCS11_FUNCTION_INFO(C_SignInit) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_MECHANISM_PTR pMechanism, /* the signature mechanism */ - CK_OBJECT_HANDLE hKey /* handle of signature key */ -); -#endif - - -/* C_Sign signs (encrypts with private key) data in a single - * part, where the signature is (will be) an appendix to the - * data, and plaintext cannot be recovered from the signature. */ -CK_PKCS11_FUNCTION_INFO(C_Sign) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_BYTE_PTR pData, /* the data to sign */ - CK_ULONG ulDataLen, /* count of bytes to sign */ - CK_BYTE_PTR pSignature, /* gets the signature */ - CK_ULONG_PTR pulSignatureLen /* gets signature length */ -); -#endif - - -/* C_SignUpdate continues a multiple-part signature operation, - * where the signature is (will be) an appendix to the data, - * and plaintext cannot be recovered from the signature. */ -CK_PKCS11_FUNCTION_INFO(C_SignUpdate) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_BYTE_PTR pPart, /* the data to sign */ - CK_ULONG ulPartLen /* count of bytes to sign */ -); -#endif - - -/* C_SignFinal finishes a multiple-part signature operation, - * returning the signature. */ -CK_PKCS11_FUNCTION_INFO(C_SignFinal) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_BYTE_PTR pSignature, /* gets the signature */ - CK_ULONG_PTR pulSignatureLen /* gets signature length */ -); -#endif - - -/* C_SignRecoverInit initializes a signature operation, where - * the data can be recovered from the signature. */ -CK_PKCS11_FUNCTION_INFO(C_SignRecoverInit) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_MECHANISM_PTR pMechanism, /* the signature mechanism */ - CK_OBJECT_HANDLE hKey /* handle of the signature key */ -); -#endif - - -/* C_SignRecover signs data in a single operation, where the - * data can be recovered from the signature. */ -CK_PKCS11_FUNCTION_INFO(C_SignRecover) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_BYTE_PTR pData, /* the data to sign */ - CK_ULONG ulDataLen, /* count of bytes to sign */ - CK_BYTE_PTR pSignature, /* gets the signature */ - CK_ULONG_PTR pulSignatureLen /* gets signature length */ -); -#endif - - - -/* Verifying signatures and MACs */ - -/* C_VerifyInit initializes a verification operation, where the - * signature is an appendix to the data, and plaintext cannot - * cannot be recovered from the signature (e.g. DSA). */ -CK_PKCS11_FUNCTION_INFO(C_VerifyInit) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_MECHANISM_PTR pMechanism, /* the verification mechanism */ - CK_OBJECT_HANDLE hKey /* verification key */ -); -#endif - - -/* C_Verify verifies a signature in a single-part operation, - * where the signature is an appendix to the data, and plaintext - * cannot be recovered from the signature. */ -CK_PKCS11_FUNCTION_INFO(C_Verify) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_BYTE_PTR pData, /* signed data */ - CK_ULONG ulDataLen, /* length of signed data */ - CK_BYTE_PTR pSignature, /* signature */ - CK_ULONG ulSignatureLen /* signature length*/ -); -#endif - - -/* C_VerifyUpdate continues a multiple-part verification - * operation, where the signature is an appendix to the data, - * and plaintext cannot be recovered from the signature. */ -CK_PKCS11_FUNCTION_INFO(C_VerifyUpdate) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_BYTE_PTR pPart, /* signed data */ - CK_ULONG ulPartLen /* length of signed data */ -); -#endif - - -/* C_VerifyFinal finishes a multiple-part verification - * operation, checking the signature. */ -CK_PKCS11_FUNCTION_INFO(C_VerifyFinal) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_BYTE_PTR pSignature, /* signature to verify */ - CK_ULONG ulSignatureLen /* signature length */ -); -#endif - - -/* C_VerifyRecoverInit initializes a signature verification - * operation, where the data is recovered from the signature. */ -CK_PKCS11_FUNCTION_INFO(C_VerifyRecoverInit) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_MECHANISM_PTR pMechanism, /* the verification mechanism */ - CK_OBJECT_HANDLE hKey /* verification key */ -); -#endif - - -/* C_VerifyRecover verifies a signature in a single-part - * operation, where the data is recovered from the signature. */ -CK_PKCS11_FUNCTION_INFO(C_VerifyRecover) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_BYTE_PTR pSignature, /* signature to verify */ - CK_ULONG ulSignatureLen, /* signature length */ - CK_BYTE_PTR pData, /* gets signed data */ - CK_ULONG_PTR pulDataLen /* gets signed data len */ -); -#endif - - - -/* Dual-function cryptographic operations */ - -/* C_DigestEncryptUpdate continues a multiple-part digesting - * and encryption operation. */ -CK_PKCS11_FUNCTION_INFO(C_DigestEncryptUpdate) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* session's handle */ - CK_BYTE_PTR pPart, /* the plaintext data */ - CK_ULONG ulPartLen, /* plaintext length */ - CK_BYTE_PTR pEncryptedPart, /* gets ciphertext */ - CK_ULONG_PTR pulEncryptedPartLen /* gets c-text length */ -); -#endif - - -/* C_DecryptDigestUpdate continues a multiple-part decryption and - * digesting operation. */ -CK_PKCS11_FUNCTION_INFO(C_DecryptDigestUpdate) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* session's handle */ - CK_BYTE_PTR pEncryptedPart, /* ciphertext */ - CK_ULONG ulEncryptedPartLen, /* ciphertext length */ - CK_BYTE_PTR pPart, /* gets plaintext */ - CK_ULONG_PTR pulPartLen /* gets plaintext len */ -); -#endif - - -/* C_SignEncryptUpdate continues a multiple-part signing and - * encryption operation. */ -CK_PKCS11_FUNCTION_INFO(C_SignEncryptUpdate) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* session's handle */ - CK_BYTE_PTR pPart, /* the plaintext data */ - CK_ULONG ulPartLen, /* plaintext length */ - CK_BYTE_PTR pEncryptedPart, /* gets ciphertext */ - CK_ULONG_PTR pulEncryptedPartLen /* gets c-text length */ -); -#endif - - -/* C_DecryptVerifyUpdate continues a multiple-part decryption and - * verify operation. */ -CK_PKCS11_FUNCTION_INFO(C_DecryptVerifyUpdate) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* session's handle */ - CK_BYTE_PTR pEncryptedPart, /* ciphertext */ - CK_ULONG ulEncryptedPartLen, /* ciphertext length */ - CK_BYTE_PTR pPart, /* gets plaintext */ - CK_ULONG_PTR pulPartLen /* gets p-text length */ -); -#endif - - - -/* Key management */ - -/* C_GenerateKey generates a secret key, creating a new key - * object. */ -CK_PKCS11_FUNCTION_INFO(C_GenerateKey) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_MECHANISM_PTR pMechanism, /* key generation mech. */ - CK_ATTRIBUTE_PTR pTemplate, /* template for new key */ - CK_ULONG ulCount, /* # of attrs in template */ - CK_OBJECT_HANDLE_PTR phKey /* gets handle of new key */ -); -#endif - - -/* C_GenerateKeyPair generates a public-key/private-key pair, - * creating new key objects. */ -CK_PKCS11_FUNCTION_INFO(C_GenerateKeyPair) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* session - * handle */ - CK_MECHANISM_PTR pMechanism, /* key-gen - * mech. */ - CK_ATTRIBUTE_PTR pPublicKeyTemplate, /* template - * for pub. - * key */ - CK_ULONG ulPublicKeyAttributeCount, /* # pub. - * attrs. */ - CK_ATTRIBUTE_PTR pPrivateKeyTemplate, /* template - * for priv. - * key */ - CK_ULONG ulPrivateKeyAttributeCount, /* # priv. - * attrs. */ - CK_OBJECT_HANDLE_PTR phPublicKey, /* gets pub. - * key - * handle */ - CK_OBJECT_HANDLE_PTR phPrivateKey /* gets - * priv. key - * handle */ -); -#endif - - -/* C_WrapKey wraps (i.e., encrypts) a key. */ -CK_PKCS11_FUNCTION_INFO(C_WrapKey) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_MECHANISM_PTR pMechanism, /* the wrapping mechanism */ - CK_OBJECT_HANDLE hWrappingKey, /* wrapping key */ - CK_OBJECT_HANDLE hKey, /* key to be wrapped */ - CK_BYTE_PTR pWrappedKey, /* gets wrapped key */ - CK_ULONG_PTR pulWrappedKeyLen /* gets wrapped key size */ -); -#endif - - -/* C_UnwrapKey unwraps (decrypts) a wrapped key, creating a new - * key object. */ -CK_PKCS11_FUNCTION_INFO(C_UnwrapKey) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* session's handle */ - CK_MECHANISM_PTR pMechanism, /* unwrapping mech. */ - CK_OBJECT_HANDLE hUnwrappingKey, /* unwrapping key */ - CK_BYTE_PTR pWrappedKey, /* the wrapped key */ - CK_ULONG ulWrappedKeyLen, /* wrapped key len */ - CK_ATTRIBUTE_PTR pTemplate, /* new key template */ - CK_ULONG ulAttributeCount, /* template length */ - CK_OBJECT_HANDLE_PTR phKey /* gets new handle */ -); -#endif - - -/* C_DeriveKey derives a key from a base key, creating a new key - * object. */ -CK_PKCS11_FUNCTION_INFO(C_DeriveKey) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* session's handle */ - CK_MECHANISM_PTR pMechanism, /* key deriv. mech. */ - CK_OBJECT_HANDLE hBaseKey, /* base key */ - CK_ATTRIBUTE_PTR pTemplate, /* new key template */ - CK_ULONG ulAttributeCount, /* template length */ - CK_OBJECT_HANDLE_PTR phKey /* gets new handle */ -); -#endif - - - -/* Random number generation */ - -/* C_SeedRandom mixes additional seed material into the token's - * random number generator. */ -CK_PKCS11_FUNCTION_INFO(C_SeedRandom) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_BYTE_PTR pSeed, /* the seed material */ - CK_ULONG ulSeedLen /* length of seed material */ -); -#endif - - -/* C_GenerateRandom generates random data. */ -CK_PKCS11_FUNCTION_INFO(C_GenerateRandom) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_BYTE_PTR RandomData, /* receives the random data */ - CK_ULONG ulRandomLen /* # of bytes to generate */ -); -#endif - - - -/* Parallel function management */ - -/* C_GetFunctionStatus is a legacy function; it obtains an - * updated status of a function running in parallel with an - * application. */ -CK_PKCS11_FUNCTION_INFO(C_GetFunctionStatus) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession /* the session's handle */ -); -#endif - - -/* C_CancelFunction is a legacy function; it cancels a function - * running in parallel. */ -CK_PKCS11_FUNCTION_INFO(C_CancelFunction) -#ifdef CK_NEED_ARG_LIST -( - CK_SESSION_HANDLE hSession /* the session's handle */ -); -#endif - - - -/* Functions added in for PKCS #11 Version 2.01 or later */ - -/* C_WaitForSlotEvent waits for a slot event (token insertion, - * removal, etc.) to occur. */ -CK_PKCS11_FUNCTION_INFO(C_WaitForSlotEvent) -#ifdef CK_NEED_ARG_LIST -( - CK_FLAGS flags, /* blocking/nonblocking flag */ - CK_SLOT_ID_PTR pSlot, /* location that receives the slot ID */ - CK_VOID_PTR pRserved /* reserved. Should be NULL_PTR */ -); -#endif diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/pkcs11n.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/pkcs11n.h deleted file mode 100755 index d48cef6..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/pkcs11n.h +++ /dev/null @@ -1,479 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef _PKCS11N_H_ -#define _PKCS11N_H_ - -/* - * pkcs11n.h - * - * This file contains the NSS-specific type definitions for Cryptoki - * (PKCS#11). - */ - -/* - * NSSCK_VENDOR_NSS - * - * Cryptoki reserves the high half of all the number spaces for - * vendor-defined use. I'd like to keep all of our NSS- - * specific values together, but not in the oh-so-obvious - * 0x80000001, 0x80000002, etc. area. So I've picked an offset, - * and constructed values for the beginnings of our spaces. - * - * Note that some "historical" Netscape values don't fall within - * this range. - */ -#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */ - -/* - * NSS-defined object classes - * - */ -#define CKO_NSS (CKO_VENDOR_DEFINED|NSSCK_VENDOR_NSS) - -#define CKO_NSS_CRL (CKO_NSS + 1) -#define CKO_NSS_SMIME (CKO_NSS + 2) -#define CKO_NSS_TRUST (CKO_NSS + 3) -#define CKO_NSS_BUILTIN_ROOT_LIST (CKO_NSS + 4) -#define CKO_NSS_NEWSLOT (CKO_NSS + 5) -#define CKO_NSS_DELSLOT (CKO_NSS + 6) - - -/* - * NSS-defined key types - * - */ -#define CKK_NSS (CKK_VENDOR_DEFINED|NSSCK_VENDOR_NSS) - -#define CKK_NSS_PKCS8 (CKK_NSS + 1) - -#define CKK_NSS_JPAKE_ROUND1 (CKK_NSS + 2) -#define CKK_NSS_JPAKE_ROUND2 (CKK_NSS + 3) - -#define CKK_NSS_CHACHA20 (CKK_NSS + 4) - -/* - * NSS-defined certificate types - * - */ -#define CKC_NSS (CKC_VENDOR_DEFINED|NSSCK_VENDOR_NSS) - -/* FAKE PKCS #11 defines */ -#define CKA_DIGEST 0x81000000L -#define CKA_FLAGS_ONLY 0 /* CKA_CLASS */ - -/* - * NSS-defined object attributes - * - */ -#define CKA_NSS (CKA_VENDOR_DEFINED|NSSCK_VENDOR_NSS) - -#define CKA_NSS_URL (CKA_NSS + 1) -#define CKA_NSS_EMAIL (CKA_NSS + 2) -#define CKA_NSS_SMIME_INFO (CKA_NSS + 3) -#define CKA_NSS_SMIME_TIMESTAMP (CKA_NSS + 4) -#define CKA_NSS_PKCS8_SALT (CKA_NSS + 5) -#define CKA_NSS_PASSWORD_CHECK (CKA_NSS + 6) -#define CKA_NSS_EXPIRES (CKA_NSS + 7) -#define CKA_NSS_KRL (CKA_NSS + 8) - -#define CKA_NSS_PQG_COUNTER (CKA_NSS + 20) -#define CKA_NSS_PQG_SEED (CKA_NSS + 21) -#define CKA_NSS_PQG_H (CKA_NSS + 22) -#define CKA_NSS_PQG_SEED_BITS (CKA_NSS + 23) -#define CKA_NSS_MODULE_SPEC (CKA_NSS + 24) -#define CKA_NSS_OVERRIDE_EXTENSIONS (CKA_NSS + 25) - -#define CKA_NSS_JPAKE_SIGNERID (CKA_NSS + 26) -#define CKA_NSS_JPAKE_PEERID (CKA_NSS + 27) -#define CKA_NSS_JPAKE_GX1 (CKA_NSS + 28) -#define CKA_NSS_JPAKE_GX2 (CKA_NSS + 29) -#define CKA_NSS_JPAKE_GX3 (CKA_NSS + 30) -#define CKA_NSS_JPAKE_GX4 (CKA_NSS + 31) -#define CKA_NSS_JPAKE_X2 (CKA_NSS + 32) -#define CKA_NSS_JPAKE_X2S (CKA_NSS + 33) - -/* - * Trust attributes: - * - * If trust goes standard, these probably will too. So I'll - * put them all in one place. - */ - -#define CKA_TRUST (CKA_NSS + 0x2000) - -/* "Usage" key information */ -#define CKA_TRUST_DIGITAL_SIGNATURE (CKA_TRUST + 1) -#define CKA_TRUST_NON_REPUDIATION (CKA_TRUST + 2) -#define CKA_TRUST_KEY_ENCIPHERMENT (CKA_TRUST + 3) -#define CKA_TRUST_DATA_ENCIPHERMENT (CKA_TRUST + 4) -#define CKA_TRUST_KEY_AGREEMENT (CKA_TRUST + 5) -#define CKA_TRUST_KEY_CERT_SIGN (CKA_TRUST + 6) -#define CKA_TRUST_CRL_SIGN (CKA_TRUST + 7) - -/* "Purpose" trust information */ -#define CKA_TRUST_SERVER_AUTH (CKA_TRUST + 8) -#define CKA_TRUST_CLIENT_AUTH (CKA_TRUST + 9) -#define CKA_TRUST_CODE_SIGNING (CKA_TRUST + 10) -#define CKA_TRUST_EMAIL_PROTECTION (CKA_TRUST + 11) -#define CKA_TRUST_IPSEC_END_SYSTEM (CKA_TRUST + 12) -#define CKA_TRUST_IPSEC_TUNNEL (CKA_TRUST + 13) -#define CKA_TRUST_IPSEC_USER (CKA_TRUST + 14) -#define CKA_TRUST_TIME_STAMPING (CKA_TRUST + 15) -#define CKA_TRUST_STEP_UP_APPROVED (CKA_TRUST + 16) - -#define CKA_CERT_SHA1_HASH (CKA_TRUST + 100) -#define CKA_CERT_MD5_HASH (CKA_TRUST + 101) - -/* NSS trust stuff */ - -/* HISTORICAL: define used to pass in the database key for DSA private keys */ -#define CKA_NETSCAPE_DB 0xD5A0DB00L -#define CKA_NETSCAPE_TRUST 0x80000001L - -/* FAKE PKCS #11 defines */ -#define CKM_FAKE_RANDOM 0x80000efeUL -#define CKM_INVALID_MECHANISM 0xffffffffUL - -/* - * NSS-defined crypto mechanisms - * - */ -#define CKM_NSS (CKM_VENDOR_DEFINED|NSSCK_VENDOR_NSS) - -#define CKM_NSS_AES_KEY_WRAP (CKM_NSS + 1) -#define CKM_NSS_AES_KEY_WRAP_PAD (CKM_NSS + 2) - -/* HKDF key derivation mechanisms. See CK_NSS_HKDFParams for documentation. */ -#define CKM_NSS_HKDF_SHA1 (CKM_NSS + 3) -#define CKM_NSS_HKDF_SHA256 (CKM_NSS + 4) -#define CKM_NSS_HKDF_SHA384 (CKM_NSS + 5) -#define CKM_NSS_HKDF_SHA512 (CKM_NSS + 6) - -/* J-PAKE round 1 key generation mechanisms. - * - * Required template attributes: CKA_PRIME, CKA_SUBPRIME, CKA_BASE, - * CKA_NSS_JPAKE_SIGNERID - * Output key type: CKK_NSS_JPAKE_ROUND1 - * Output key class: CKO_PRIVATE_KEY - * Parameter type: CK_NSS_JPAKERound1Params - * - */ -#define CKM_NSS_JPAKE_ROUND1_SHA1 (CKM_NSS + 7) -#define CKM_NSS_JPAKE_ROUND1_SHA256 (CKM_NSS + 8) -#define CKM_NSS_JPAKE_ROUND1_SHA384 (CKM_NSS + 9) -#define CKM_NSS_JPAKE_ROUND1_SHA512 (CKM_NSS + 10) - -/* J-PAKE round 2 key derivation mechanisms. - * - * Required template attributes: CKA_NSS_JPAKE_PEERID - * Input key type: CKK_NSS_JPAKE_ROUND1 - * Output key type: CKK_NSS_JPAKE_ROUND2 - * Output key class: CKO_PRIVATE_KEY - * Parameter type: CK_NSS_JPAKERound2Params - */ -#define CKM_NSS_JPAKE_ROUND2_SHA1 (CKM_NSS + 11) -#define CKM_NSS_JPAKE_ROUND2_SHA256 (CKM_NSS + 12) -#define CKM_NSS_JPAKE_ROUND2_SHA384 (CKM_NSS + 13) -#define CKM_NSS_JPAKE_ROUND2_SHA512 (CKM_NSS + 14) - -/* J-PAKE final key material derivation mechanisms - * - * Input key type: CKK_NSS_JPAKE_ROUND2 - * Output key type: CKK_GENERIC_SECRET - * Output key class: CKO_SECRET_KEY - * Parameter type: CK_NSS_JPAKEFinalParams - * - * You must apply a KDF (e.g. CKM_NSS_HKDF_*) to resultant keying material - * to get a key with uniformly distributed bits. - */ -#define CKM_NSS_JPAKE_FINAL_SHA1 (CKM_NSS + 15) -#define CKM_NSS_JPAKE_FINAL_SHA256 (CKM_NSS + 16) -#define CKM_NSS_JPAKE_FINAL_SHA384 (CKM_NSS + 17) -#define CKM_NSS_JPAKE_FINAL_SHA512 (CKM_NSS + 18) - -/* Constant-time MAC mechanisms: - * - * These operations verify a padded, MAC-then-encrypt block of data in - * constant-time. Because of the order of operations, the padding bytes are not - * protected by the MAC. However, disclosing the value of the padding bytes - * gives an attacker the ability to decrypt ciphertexts. Such disclosure can be - * as subtle as taking slightly less time to perform the MAC when the padding - * is one byte longer. See https://www.isg.rhul.ac.uk/tls/ - * - * CKM_NSS_HMAC_CONSTANT_TIME: performs an HMAC authentication. - * CKM_NSS_SSL3_MAC_CONSTANT_TIME: performs an authentication with SSLv3 MAC. - * - * Parameter type: CK_NSS_MAC_CONSTANT_TIME_PARAMS - */ -#define CKM_NSS_HMAC_CONSTANT_TIME (CKM_NSS + 19) -#define CKM_NSS_SSL3_MAC_CONSTANT_TIME (CKM_NSS + 20) - -/* TLS 1.2 mechanisms */ -#define CKM_NSS_TLS_PRF_GENERAL_SHA256 (CKM_NSS + 21) -#define CKM_NSS_TLS_MASTER_KEY_DERIVE_SHA256 (CKM_NSS + 22) -#define CKM_NSS_TLS_KEY_AND_MAC_DERIVE_SHA256 (CKM_NSS + 23) -#define CKM_NSS_TLS_MASTER_KEY_DERIVE_DH_SHA256 (CKM_NSS + 24) - -#define CKM_NSS_CHACHA20_KEY_GEN (CKM_NSS + 25) -#define CKM_NSS_CHACHA20_POLY1305 (CKM_NSS + 26) - -/* - * HISTORICAL: - * Do not attempt to use these. They are only used by NETSCAPE's internal - * PKCS #11 interface. Most of these are place holders for other mechanism - * and will change in the future. - */ -#define CKM_NETSCAPE_PBE_SHA1_DES_CBC 0x80000002UL -#define CKM_NETSCAPE_PBE_SHA1_TRIPLE_DES_CBC 0x80000003UL -#define CKM_NETSCAPE_PBE_SHA1_40_BIT_RC2_CBC 0x80000004UL -#define CKM_NETSCAPE_PBE_SHA1_128_BIT_RC2_CBC 0x80000005UL -#define CKM_NETSCAPE_PBE_SHA1_40_BIT_RC4 0x80000006UL -#define CKM_NETSCAPE_PBE_SHA1_128_BIT_RC4 0x80000007UL -#define CKM_NETSCAPE_PBE_SHA1_FAULTY_3DES_CBC 0x80000008UL -#define CKM_NETSCAPE_PBE_SHA1_HMAC_KEY_GEN 0x80000009UL -#define CKM_NETSCAPE_PBE_MD5_HMAC_KEY_GEN 0x8000000aUL -#define CKM_NETSCAPE_PBE_MD2_HMAC_KEY_GEN 0x8000000bUL - -#define CKM_TLS_PRF_GENERAL 0x80000373UL - -typedef struct CK_NSS_JPAKEPublicValue { - CK_BYTE * pGX; - CK_ULONG ulGXLen; - CK_BYTE * pGV; - CK_ULONG ulGVLen; - CK_BYTE * pR; - CK_ULONG ulRLen; -} CK_NSS_JPAKEPublicValue; - -typedef struct CK_NSS_JPAKERound1Params { - CK_NSS_JPAKEPublicValue gx1; /* out */ - CK_NSS_JPAKEPublicValue gx2; /* out */ -} CK_NSS_JPAKERound1Params; - -typedef struct CK_NSS_JPAKERound2Params { - CK_BYTE * pSharedKey; /* in */ - CK_ULONG ulSharedKeyLen; /* in */ - CK_NSS_JPAKEPublicValue gx3; /* in */ - CK_NSS_JPAKEPublicValue gx4; /* in */ - CK_NSS_JPAKEPublicValue A; /* out */ -} CK_NSS_JPAKERound2Params; - -typedef struct CK_NSS_JPAKEFinalParams { - CK_NSS_JPAKEPublicValue B; /* in */ -} CK_NSS_JPAKEFinalParams; - -/* macAlg: the MAC algorithm to use. This determines the hash function used in - * the HMAC/SSLv3 MAC calculations. - * ulBodyTotalLen: the total length of the data, including padding bytes and - * padding length. - * pHeader: points to a block of data that contains additional data to - * authenticate. For TLS this includes the sequence number etc. For SSLv3, - * this also includes the initial padding bytes. - * - * NOTE: the softoken's implementation of CKM_NSS_HMAC_CONSTANT_TIME and - * CKM_NSS_SSL3_MAC_CONSTANT_TIME requires that the sum of ulBodyTotalLen - * and ulHeaderLen be much smaller than 2^32 / 8 bytes because it uses an - * unsigned int variable to represent the length in bits. This should not - * be a problem because the SSL/TLS protocol limits the size of an SSL - * record to something considerably less than 2^32 bytes. - */ -typedef struct CK_NSS_MAC_CONSTANT_TIME_PARAMS { - CK_MECHANISM_TYPE macAlg; /* in */ - CK_ULONG ulBodyTotalLen; /* in */ - CK_BYTE * pHeader; /* in */ - CK_ULONG ulHeaderLen; /* in */ -} CK_NSS_MAC_CONSTANT_TIME_PARAMS; - -typedef struct CK_NSS_AEAD_PARAMS { - CK_BYTE_PTR pIv; /* This is the nonce. */ - CK_ULONG ulIvLen; - CK_BYTE_PTR pAAD; - CK_ULONG ulAADLen; - CK_ULONG ulTagLen; -} CK_NSS_AEAD_PARAMS; - -/* - * NSS-defined return values - * - */ -#define CKR_NSS (CKM_VENDOR_DEFINED|NSSCK_VENDOR_NSS) - -#define CKR_NSS_CERTDB_FAILED (CKR_NSS + 1) -#define CKR_NSS_KEYDB_FAILED (CKR_NSS + 2) - -/* Mandatory parameter for the CKM_NSS_HKDF_* key deriviation mechanisms. - See RFC 5869. - - bExtract: If set, HKDF-Extract will be applied to the input key. If - the optional salt is given, it is used; otherwise, the salt is - set to a sequence of zeros equal in length to the HMAC output. - If bExpand is not set, then the key template given to - C_DeriveKey must indicate an output key size less than or equal - to the output size of the HMAC. - - bExpand: If set, HKDF-Expand will be applied to the input key (if - bExtract is not set) or to the result of HKDF-Extract (if - bExtract is set). Any info given in the optional pInfo field will - be included in the calculation. - - The size of the output key must be specified in the template passed to - C_DeriveKey. -*/ -typedef struct CK_NSS_HKDFParams { - CK_BBOOL bExtract; - CK_BYTE_PTR pSalt; - CK_ULONG ulSaltLen; - CK_BBOOL bExpand; - CK_BYTE_PTR pInfo; - CK_ULONG ulInfoLen; -} CK_NSS_HKDFParams; - -/* - * Trust info - * - * This isn't part of the Cryptoki standard (yet), so I'm putting - * all the definitions here. Some of this would move to nssckt.h - * if trust info were made part of the standard. In view of this - * possibility, I'm putting my (NSS) values in the NSS - * vendor space, like everything else. - */ - -typedef CK_ULONG CK_TRUST; - -/* The following trust types are defined: */ -#define CKT_VENDOR_DEFINED 0x80000000 - -#define CKT_NSS (CKT_VENDOR_DEFINED|NSSCK_VENDOR_NSS) - -/* If trust goes standard, these'll probably drop out of vendor space. */ -#define CKT_NSS_TRUSTED (CKT_NSS + 1) -#define CKT_NSS_TRUSTED_DELEGATOR (CKT_NSS + 2) -#define CKT_NSS_MUST_VERIFY_TRUST (CKT_NSS + 3) -#define CKT_NSS_NOT_TRUSTED (CKT_NSS + 10) -#define CKT_NSS_TRUST_UNKNOWN (CKT_NSS + 5) /* default */ - -/* - * These may well remain NSS-specific; I'm only using them - * to cache resolution data. - */ -#define CKT_NSS_VALID_DELEGATOR (CKT_NSS + 11) - - -/* - * old definitions. They still exist, but the plain meaning of the - * labels have never been accurate to what was really implemented. - * The new labels correctly reflect what the values effectively mean. - */ -#if defined(__GNUC__) && (__GNUC__ > 3) -/* make GCC warn when we use these #defines */ -/* - * This is really painful because GCC doesn't allow us to mark random - * #defines as deprecated. We can only mark the following: - * functions, variables, and types. - * const variables will create extra storage for everyone including this - * header file, so it's undesirable. - * functions could be inlined to prevent storage creation, but will fail - * when constant values are expected (like switch statements). - * enum types do not seem to pay attention to the deprecated attribute. - * - * That leaves typedefs. We declare new types that we then deprecate, then - * cast the resulting value to the deprecated type in the #define, thus - * producting the warning when the #define is used. - */ -#if (__GNUC__ == 4) && (__GNUC_MINOR__ < 5) -/* The mac doesn't like the friendlier deprecate messages. I'm assuming this - * is a gcc version issue rather than mac or ppc specific */ -typedef CK_TRUST __CKT_NSS_UNTRUSTED __attribute__((deprecated)); -typedef CK_TRUST __CKT_NSS_VALID __attribute__ ((deprecated)); -typedef CK_TRUST __CKT_NSS_MUST_VERIFY __attribute__((deprecated)); -#else -/* when possible, get a full deprecation warning. This works on gcc 4.5 - * it may work on earlier versions of gcc */ -typedef CK_TRUST __CKT_NSS_UNTRUSTED __attribute__((deprecated - ("CKT_NSS_UNTRUSTED really means CKT_NSS_MUST_VERIFY_TRUST"))); -typedef CK_TRUST __CKT_NSS_VALID __attribute__ ((deprecated - ("CKT_NSS_VALID really means CKT_NSS_NOT_TRUSTED"))); -typedef CK_TRUST __CKT_NSS_MUST_VERIFY __attribute__((deprecated - ("CKT_NSS_MUST_VERIFY really functions as CKT_NSS_TRUST_UNKNOWN"))); -#endif -#define CKT_NSS_UNTRUSTED ((__CKT_NSS_UNTRUSTED)CKT_NSS_MUST_VERIFY_TRUST) -#define CKT_NSS_VALID ((__CKT_NSS_VALID) CKT_NSS_NOT_TRUSTED) -/* keep the old value for compatibility reasons*/ -#define CKT_NSS_MUST_VERIFY ((__CKT_NSS_MUST_VERIFY)(CKT_NSS +4)) -#else -#ifdef _WIN32 -/* This magic gets the windows compiler to give us a deprecation - * warning */ -#pragma deprecated(CKT_NSS_UNTRUSTED, CKT_NSS_MUST_VERIFY, CKT_NSS_VALID) -#endif -/* CKT_NSS_UNTRUSTED really means CKT_NSS_MUST_VERIFY_TRUST */ -#define CKT_NSS_UNTRUSTED CKT_NSS_MUST_VERIFY_TRUST -/* CKT_NSS_VALID really means CKT_NSS_NOT_TRUSTED */ -#define CKT_NSS_VALID CKT_NSS_NOT_TRUSTED -/* CKT_NSS_MUST_VERIFY was always treated as CKT_NSS_TRUST_UNKNOWN */ -#define CKT_NSS_MUST_VERIFY (CKT_NSS + 4) /*really means trust unknown*/ -#endif - -/* don't leave old programs in a lurch just yet, give them the old NETSCAPE - * synonym */ -#define CKO_NETSCAPE_CRL CKO_NSS_CRL -#define CKO_NETSCAPE_SMIME CKO_NSS_SMIME -#define CKO_NETSCAPE_TRUST CKO_NSS_TRUST -#define CKO_NETSCAPE_BUILTIN_ROOT_LIST CKO_NSS_BUILTIN_ROOT_LIST -#define CKO_NETSCAPE_NEWSLOT CKO_NSS_NEWSLOT -#define CKO_NETSCAPE_DELSLOT CKO_NSS_DELSLOT -#define CKK_NETSCAPE_PKCS8 CKK_NSS_PKCS8 -#define CKA_NETSCAPE_URL CKA_NSS_URL -#define CKA_NETSCAPE_EMAIL CKA_NSS_EMAIL -#define CKA_NETSCAPE_SMIME_INFO CKA_NSS_SMIME_INFO -#define CKA_NETSCAPE_SMIME_TIMESTAMP CKA_NSS_SMIME_TIMESTAMP -#define CKA_NETSCAPE_PKCS8_SALT CKA_NSS_PKCS8_SALT -#define CKA_NETSCAPE_PASSWORD_CHECK CKA_NSS_PASSWORD_CHECK -#define CKA_NETSCAPE_EXPIRES CKA_NSS_EXPIRES -#define CKA_NETSCAPE_KRL CKA_NSS_KRL -#define CKA_NETSCAPE_PQG_COUNTER CKA_NSS_PQG_COUNTER -#define CKA_NETSCAPE_PQG_SEED CKA_NSS_PQG_SEED -#define CKA_NETSCAPE_PQG_H CKA_NSS_PQG_H -#define CKA_NETSCAPE_PQG_SEED_BITS CKA_NSS_PQG_SEED_BITS -#define CKA_NETSCAPE_MODULE_SPEC CKA_NSS_MODULE_SPEC -#define CKM_NETSCAPE_AES_KEY_WRAP CKM_NSS_AES_KEY_WRAP -#define CKM_NETSCAPE_AES_KEY_WRAP_PAD CKM_NSS_AES_KEY_WRAP_PAD -#define CKR_NETSCAPE_CERTDB_FAILED CKR_NSS_CERTDB_FAILED -#define CKR_NETSCAPE_KEYDB_FAILED CKR_NSS_KEYDB_FAILED - -#define CKT_NETSCAPE_TRUSTED CKT_NSS_TRUSTED -#define CKT_NETSCAPE_TRUSTED_DELEGATOR CKT_NSS_TRUSTED_DELEGATOR -#define CKT_NETSCAPE_UNTRUSTED CKT_NSS_UNTRUSTED -#define CKT_NETSCAPE_MUST_VERIFY CKT_NSS_MUST_VERIFY -#define CKT_NETSCAPE_TRUST_UNKNOWN CKT_NSS_TRUST_UNKNOWN -#define CKT_NETSCAPE_VALID CKT_NSS_VALID -#define CKT_NETSCAPE_VALID_DELEGATOR CKT_NSS_VALID_DELEGATOR - -/* - * These are not really PKCS #11 values specifically. They are the 'loadable' - * module spec NSS uses. The are available for others to use as well, but not - * part of the formal PKCS #11 spec. - * - * The function 'FIND' returns an array of PKCS #11 initialization strings - * The function 'ADD' takes a PKCS #11 initialization string and stores it. - * The function 'DEL' takes a 'name= library=' value and deletes the associated - * string. - * The function 'RELEASE' frees the array returned by 'FIND' - */ -#define SECMOD_MODULE_DB_FUNCTION_FIND 0 -#define SECMOD_MODULE_DB_FUNCTION_ADD 1 -#define SECMOD_MODULE_DB_FUNCTION_DEL 2 -#define SECMOD_MODULE_DB_FUNCTION_RELEASE 3 -typedef char ** (PR_CALLBACK *SECMODModuleDBFunc)(unsigned long function, - char *parameters, void *moduleSpec); - -/* softoken slot ID's */ -#define SFTK_MIN_USER_SLOT_ID 4 -#define SFTK_MAX_USER_SLOT_ID 100 -#define SFTK_MIN_FIPS_USER_SLOT_ID 101 -#define SFTK_MAX_FIPS_USER_SLOT_ID 127 - - -#endif /* _PKCS11N_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/pkcs11p.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/pkcs11p.h deleted file mode 100755 index 744c820..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/pkcs11p.h +++ /dev/null @@ -1,22 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/* - * Copyright (C) 1994-1999 RSA Security Inc. Licence to copy this document - * is granted provided that it is identified as "RSA Security Inc. Public-Key - * Cryptography Standards (PKCS)" in all material mentioning or referencing - * this document. - */ -/* these data types are platform/implementation dependent. */ -/* - * Packing was removed from the shipped RSA header files, even - * though it's still needed. put in a central file to help merging.. - */ - -#if defined(_WIN32) -#ifdef _MSC_VER -#pragma warning(disable:4103) -#endif -#pragma pack(push, cryptoki, 1) -#endif - diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/pkcs11t.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/pkcs11t.h deleted file mode 100755 index b003461..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/pkcs11t.h +++ /dev/null @@ -1,1793 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/* License to copy and use this software is granted provided that it is - * identified as "RSA Security Inc. PKCS #11 Cryptographic Token Interface - * (Cryptoki)" in all material mentioning or referencing this software. - - * License is also granted to make and use derivative works provided that - * such works are identified as "derived from the RSA Security Inc. PKCS #11 - * Cryptographic Token Interface (Cryptoki)" in all material mentioning or - * referencing the derived work. - - * RSA Security Inc. makes no representations concerning either the - * merchantability of this software or the suitability of this software for - * any particular purpose. It is provided "as is" without express or implied - * warranty of any kind. - */ - - -#ifndef _PKCS11T_H_ -#define _PKCS11T_H_ 1 - -#define CK_TRUE 1 -#define CK_FALSE 0 - -#include "prtypes.h" - -#define CK_PTR * -#define CK_NULL_PTR 0 -#define CK_CALLBACK_FUNCTION(rtype,func) rtype (PR_CALLBACK * func) -#define CK_DECLARE_FUNCTION(rtype,func) extern rtype func -#define CK_DECLARE_FUNCTION_POINTER(rtype,func) rtype (PR_CALLBACK * func) - -#define CK_INVALID_SESSION 0 - -/* an unsigned 8-bit value */ -typedef unsigned char CK_BYTE; - -/* an unsigned 8-bit character */ -typedef CK_BYTE CK_CHAR; - -/* an 8-bit UTF-8 character */ -typedef CK_BYTE CK_UTF8CHAR; - -/* a BYTE-sized Boolean flag */ -typedef CK_BYTE CK_BBOOL; - -/* an unsigned value, at least 32 bits long */ -typedef unsigned long int CK_ULONG; - -/* a signed value, the same size as a CK_ULONG */ -/* CK_LONG is new for v2.0 */ -typedef long int CK_LONG; - -/* at least 32 bits; each bit is a Boolean flag */ -typedef CK_ULONG CK_FLAGS; - - -/* some special values for certain CK_ULONG variables */ -#define CK_UNAVAILABLE_INFORMATION (~0UL) -#define CK_EFFECTIVELY_INFINITE 0 - - -typedef CK_BYTE CK_PTR CK_BYTE_PTR; -typedef CK_CHAR CK_PTR CK_CHAR_PTR; -typedef CK_UTF8CHAR CK_PTR CK_UTF8CHAR_PTR; -typedef CK_ULONG CK_PTR CK_ULONG_PTR; -typedef void CK_PTR CK_VOID_PTR; - -/* Pointer to a CK_VOID_PTR-- i.e., pointer to pointer to void */ -typedef CK_VOID_PTR CK_PTR CK_VOID_PTR_PTR; - - -/* The following value is always invalid if used as a session */ -/* handle or object handle */ -#define CK_INVALID_HANDLE 0 - - -/* pack */ -#include "pkcs11p.h" - -typedef struct CK_VERSION { - CK_BYTE major; /* integer portion of version number */ - CK_BYTE minor; /* 1/100ths portion of version number */ -} CK_VERSION; - -typedef CK_VERSION CK_PTR CK_VERSION_PTR; - - -typedef struct CK_INFO { - /* manufacturerID and libraryDecription have been changed from - * CK_CHAR to CK_UTF8CHAR for v2.10 */ - CK_VERSION cryptokiVersion; /* PKCS #11 interface ver */ - CK_UTF8CHAR manufacturerID[32]; /* blank padded */ - CK_FLAGS flags; /* must be zero */ - - /* libraryDescription and libraryVersion are new for v2.0 */ - CK_UTF8CHAR libraryDescription[32]; /* blank padded */ - CK_VERSION libraryVersion; /* version of library */ -} CK_INFO; - -typedef CK_INFO CK_PTR CK_INFO_PTR; - - -/* CK_NOTIFICATION enumerates the types of notifications that - * PKCS #11 provides to an application */ -/* CK_NOTIFICATION has been changed from an enum to a CK_ULONG - * for v2.0 */ -typedef CK_ULONG CK_NOTIFICATION; -#define CKN_SURRENDER 0 - - -typedef CK_ULONG CK_SLOT_ID; - -typedef CK_SLOT_ID CK_PTR CK_SLOT_ID_PTR; - - -/* CK_SLOT_INFO provides information about a slot */ -typedef struct CK_SLOT_INFO { - /* slotDescription and manufacturerID have been changed from - * CK_CHAR to CK_UTF8CHAR for v2.10 */ - CK_UTF8CHAR slotDescription[64]; /* blank padded */ - CK_UTF8CHAR manufacturerID[32]; /* blank padded */ - CK_FLAGS flags; - - /* hardwareVersion and firmwareVersion are new for v2.0 */ - CK_VERSION hardwareVersion; /* version of hardware */ - CK_VERSION firmwareVersion; /* version of firmware */ -} CK_SLOT_INFO; - -/* flags: bit flags that provide capabilities of the slot - * Bit Flag Mask Meaning - */ -#define CKF_TOKEN_PRESENT 0x00000001 /* a token is there */ -#define CKF_REMOVABLE_DEVICE 0x00000002 /* removable devices*/ -#define CKF_HW_SLOT 0x00000004 /* hardware slot */ - -typedef CK_SLOT_INFO CK_PTR CK_SLOT_INFO_PTR; - - -/* CK_TOKEN_INFO provides information about a token */ -typedef struct CK_TOKEN_INFO { - /* label, manufacturerID, and model have been changed from - * CK_CHAR to CK_UTF8CHAR for v2.10 */ - CK_UTF8CHAR label[32]; /* blank padded */ - CK_UTF8CHAR manufacturerID[32]; /* blank padded */ - CK_UTF8CHAR model[16]; /* blank padded */ - CK_CHAR serialNumber[16]; /* blank padded */ - CK_FLAGS flags; /* see below */ - - /* ulMaxSessionCount, ulSessionCount, ulMaxRwSessionCount, - * ulRwSessionCount, ulMaxPinLen, and ulMinPinLen have all been - * changed from CK_USHORT to CK_ULONG for v2.0 */ - CK_ULONG ulMaxSessionCount; /* max open sessions */ - CK_ULONG ulSessionCount; /* sess. now open */ - CK_ULONG ulMaxRwSessionCount; /* max R/W sessions */ - CK_ULONG ulRwSessionCount; /* R/W sess. now open */ - CK_ULONG ulMaxPinLen; /* in bytes */ - CK_ULONG ulMinPinLen; /* in bytes */ - CK_ULONG ulTotalPublicMemory; /* in bytes */ - CK_ULONG ulFreePublicMemory; /* in bytes */ - CK_ULONG ulTotalPrivateMemory; /* in bytes */ - CK_ULONG ulFreePrivateMemory; /* in bytes */ - - /* hardwareVersion, firmwareVersion, and time are new for - * v2.0 */ - CK_VERSION hardwareVersion; /* version of hardware */ - CK_VERSION firmwareVersion; /* version of firmware */ - CK_CHAR utcTime[16]; /* time */ -} CK_TOKEN_INFO; - -/* The flags parameter is defined as follows: - * Bit Flag Mask Meaning - */ -#define CKF_RNG 0x00000001 /* has random # - * generator */ -#define CKF_WRITE_PROTECTED 0x00000002 /* token is - * write- - * protected */ -#define CKF_LOGIN_REQUIRED 0x00000004 /* user must - * login */ -#define CKF_USER_PIN_INITIALIZED 0x00000008 /* normal user's - * PIN is set */ - -/* CKF_RESTORE_KEY_NOT_NEEDED is new for v2.0. If it is set, - * that means that *every* time the state of cryptographic - * operations of a session is successfully saved, all keys - * needed to continue those operations are stored in the state */ -#define CKF_RESTORE_KEY_NOT_NEEDED 0x00000020 - -/* CKF_CLOCK_ON_TOKEN is new for v2.0. If it is set, that means - * that the token has some sort of clock. The time on that - * clock is returned in the token info structure */ -#define CKF_CLOCK_ON_TOKEN 0x00000040 - -/* CKF_PROTECTED_AUTHENTICATION_PATH is new for v2.0. If it is - * set, that means that there is some way for the user to login - * without sending a PIN through the PKCS #11 library itself */ -#define CKF_PROTECTED_AUTHENTICATION_PATH 0x00000100 - -/* CKF_DUAL_CRYPTO_OPERATIONS is new for v2.0. If it is true, - * that means that a single session with the token can perform - * dual simultaneous cryptographic operations (digest and - * encrypt; decrypt and digest; sign and encrypt; and decrypt - * and sign) */ -#define CKF_DUAL_CRYPTO_OPERATIONS 0x00000200 - -/* CKF_TOKEN_INITIALIZED if new for v2.10. If it is true, the - * token has been initialized using C_InitializeToken or an - * equivalent mechanism outside the scope of PKCS #11. - * Calling C_InitializeToken when this flag is set will cause - * the token to be reinitialized. */ -#define CKF_TOKEN_INITIALIZED 0x00000400 - -/* CKF_SECONDARY_AUTHENTICATION if new for v2.10. If it is - * true, the token supports secondary authentication for - * private key objects. This flag is deprecated in v2.11 and - onwards. */ -#define CKF_SECONDARY_AUTHENTICATION 0x00000800 - -/* CKF_USER_PIN_COUNT_LOW if new for v2.10. If it is true, an - * incorrect user login PIN has been entered at least once - * since the last successful authentication. */ -#define CKF_USER_PIN_COUNT_LOW 0x00010000 - -/* CKF_USER_PIN_FINAL_TRY if new for v2.10. If it is true, - * supplying an incorrect user PIN will it to become locked. */ -#define CKF_USER_PIN_FINAL_TRY 0x00020000 - -/* CKF_USER_PIN_LOCKED if new for v2.10. If it is true, the - * user PIN has been locked. User login to the token is not - * possible. */ -#define CKF_USER_PIN_LOCKED 0x00040000 - -/* CKF_USER_PIN_TO_BE_CHANGED if new for v2.10. If it is true, - * the user PIN value is the default value set by token - * initialization or manufacturing, or the PIN has been - * expired by the card. */ -#define CKF_USER_PIN_TO_BE_CHANGED 0x00080000 - -/* CKF_SO_PIN_COUNT_LOW if new for v2.10. If it is true, an - * incorrect SO login PIN has been entered at least once since - * the last successful authentication. */ -#define CKF_SO_PIN_COUNT_LOW 0x00100000 - -/* CKF_SO_PIN_FINAL_TRY if new for v2.10. If it is true, - * supplying an incorrect SO PIN will it to become locked. */ -#define CKF_SO_PIN_FINAL_TRY 0x00200000 - -/* CKF_SO_PIN_LOCKED if new for v2.10. If it is true, the SO - * PIN has been locked. SO login to the token is not possible. - */ -#define CKF_SO_PIN_LOCKED 0x00400000 - -/* CKF_SO_PIN_TO_BE_CHANGED if new for v2.10. If it is true, - * the SO PIN value is the default value set by token - * initialization or manufacturing, or the PIN has been - * expired by the card. */ -#define CKF_SO_PIN_TO_BE_CHANGED 0x00800000 - -typedef CK_TOKEN_INFO CK_PTR CK_TOKEN_INFO_PTR; - - -/* CK_SESSION_HANDLE is a PKCS #11-assigned value that - * identifies a session */ -typedef CK_ULONG CK_SESSION_HANDLE; - -typedef CK_SESSION_HANDLE CK_PTR CK_SESSION_HANDLE_PTR; - - -/* CK_USER_TYPE enumerates the types of PKCS #11 users */ -/* CK_USER_TYPE has been changed from an enum to a CK_ULONG for - * v2.0 */ -typedef CK_ULONG CK_USER_TYPE; -/* Security Officer */ -#define CKU_SO 0 -/* Normal user */ -#define CKU_USER 1 -/* Context specific (added in v2.20) */ -#define CKU_CONTEXT_SPECIFIC 2 - -/* CK_STATE enumerates the session states */ -/* CK_STATE has been changed from an enum to a CK_ULONG for - * v2.0 */ -typedef CK_ULONG CK_STATE; -#define CKS_RO_PUBLIC_SESSION 0 -#define CKS_RO_USER_FUNCTIONS 1 -#define CKS_RW_PUBLIC_SESSION 2 -#define CKS_RW_USER_FUNCTIONS 3 -#define CKS_RW_SO_FUNCTIONS 4 - - -/* CK_SESSION_INFO provides information about a session */ -typedef struct CK_SESSION_INFO { - CK_SLOT_ID slotID; - CK_STATE state; - CK_FLAGS flags; /* see below */ - - /* ulDeviceError was changed from CK_USHORT to CK_ULONG for - * v2.0 */ - CK_ULONG ulDeviceError; /* device-dependent error code */ -} CK_SESSION_INFO; - -/* The flags are defined in the following table: - * Bit Flag Mask Meaning - */ -#define CKF_RW_SESSION 0x00000002 /* session is r/w */ -#define CKF_SERIAL_SESSION 0x00000004 /* no parallel */ - -typedef CK_SESSION_INFO CK_PTR CK_SESSION_INFO_PTR; - - -/* CK_OBJECT_HANDLE is a token-specific identifier for an - * object */ -typedef CK_ULONG CK_OBJECT_HANDLE; - -typedef CK_OBJECT_HANDLE CK_PTR CK_OBJECT_HANDLE_PTR; - - -/* CK_OBJECT_CLASS is a value that identifies the classes (or - * types) of objects that PKCS #11 recognizes. It is defined - * as follows: */ -/* CK_OBJECT_CLASS was changed from CK_USHORT to CK_ULONG for - * v2.0 */ -typedef CK_ULONG CK_OBJECT_CLASS; - -/* The following classes of objects are defined: */ -/* CKO_HW_FEATURE is new for v2.10 */ -/* CKO_DOMAIN_PARAMETERS is new for v2.11 */ -/* CKO_MECHANISM is new for v2.20 */ -#define CKO_DATA 0x00000000 -#define CKO_CERTIFICATE 0x00000001 -#define CKO_PUBLIC_KEY 0x00000002 -#define CKO_PRIVATE_KEY 0x00000003 -#define CKO_SECRET_KEY 0x00000004 -#define CKO_HW_FEATURE 0x00000005 -#define CKO_DOMAIN_PARAMETERS 0x00000006 -#define CKO_MECHANISM 0x00000007 -#define CKO_VENDOR_DEFINED 0x80000000 - -typedef CK_OBJECT_CLASS CK_PTR CK_OBJECT_CLASS_PTR; - -/* CK_HW_FEATURE_TYPE is new for v2.10. CK_HW_FEATURE_TYPE is a - * value that identifies the hardware feature type of an object - * with CK_OBJECT_CLASS equal to CKO_HW_FEATURE. */ -typedef CK_ULONG CK_HW_FEATURE_TYPE; - -/* The following hardware feature types are defined */ -/* CKH_USER_INTERFACE is new for v2.20 */ -#define CKH_MONOTONIC_COUNTER 0x00000001 -#define CKH_CLOCK 0x00000002 -#define CKH_USER_INTERFACE 0x00000003 -#define CKH_VENDOR_DEFINED 0x80000000 - -/* CK_KEY_TYPE is a value that identifies a key type */ -/* CK_KEY_TYPE was changed from CK_USHORT to CK_ULONG for v2.0 */ -typedef CK_ULONG CK_KEY_TYPE; - -/* the following key types are defined: */ -#define CKK_RSA 0x00000000 -#define CKK_DSA 0x00000001 -#define CKK_DH 0x00000002 - -/* CKK_ECDSA and CKK_KEA are new for v2.0 */ -/* CKK_ECDSA is deprecated in v2.11, CKK_EC is preferred. */ -#define CKK_ECDSA 0x00000003 -#define CKK_EC 0x00000003 -#define CKK_X9_42_DH 0x00000004 -#define CKK_KEA 0x00000005 - -#define CKK_GENERIC_SECRET 0x00000010 -#define CKK_RC2 0x00000011 -#define CKK_RC4 0x00000012 -#define CKK_DES 0x00000013 -#define CKK_DES2 0x00000014 -#define CKK_DES3 0x00000015 - -/* all these key types are new for v2.0 */ -#define CKK_CAST 0x00000016 -#define CKK_CAST3 0x00000017 -/* CKK_CAST5 is deprecated in v2.11, CKK_CAST128 is preferred. */ -#define CKK_CAST5 0x00000018 -#define CKK_CAST128 0x00000018 -#define CKK_RC5 0x00000019 -#define CKK_IDEA 0x0000001A -#define CKK_SKIPJACK 0x0000001B -#define CKK_BATON 0x0000001C -#define CKK_JUNIPER 0x0000001D -#define CKK_CDMF 0x0000001E -#define CKK_AES 0x0000001F - -/* BlowFish and TwoFish are new for v2.20 */ -#define CKK_BLOWFISH 0x00000020 -#define CKK_TWOFISH 0x00000021 - -/* Camellia is proposed for v2.20 Amendment 3 */ -#define CKK_CAMELLIA 0x00000025 - -#define CKK_SEED 0x00000026 - -#define CKK_VENDOR_DEFINED 0x80000000 - - -/* CK_CERTIFICATE_TYPE is a value that identifies a certificate - * type */ -/* CK_CERTIFICATE_TYPE was changed from CK_USHORT to CK_ULONG - * for v2.0 */ -typedef CK_ULONG CK_CERTIFICATE_TYPE; - -/* The following certificate types are defined: */ -/* CKC_X_509_ATTR_CERT is new for v2.10 */ -/* CKC_WTLS is new for v2.20 */ -#define CKC_X_509 0x00000000 -#define CKC_X_509_ATTR_CERT 0x00000001 -#define CKC_WTLS 0x00000002 -#define CKC_VENDOR_DEFINED 0x80000000 - - -/* CK_ATTRIBUTE_TYPE is a value that identifies an attribute - * type */ -/* CK_ATTRIBUTE_TYPE was changed from CK_USHORT to CK_ULONG for - * v2.0 */ -typedef CK_ULONG CK_ATTRIBUTE_TYPE; - -/* The CKF_ARRAY_ATTRIBUTE flag identifies an attribute which - consists of an array of values. */ -#define CKF_ARRAY_ATTRIBUTE 0x40000000 - -/* The following attribute types are defined: */ -#define CKA_CLASS 0x00000000 -#define CKA_TOKEN 0x00000001 -#define CKA_PRIVATE 0x00000002 -#define CKA_LABEL 0x00000003 -#define CKA_APPLICATION 0x00000010 -#define CKA_VALUE 0x00000011 - -/* CKA_OBJECT_ID is new for v2.10 */ -#define CKA_OBJECT_ID 0x00000012 - -#define CKA_CERTIFICATE_TYPE 0x00000080 -#define CKA_ISSUER 0x00000081 -#define CKA_SERIAL_NUMBER 0x00000082 - -/* CKA_AC_ISSUER, CKA_OWNER, and CKA_ATTR_TYPES are new - * for v2.10 */ -#define CKA_AC_ISSUER 0x00000083 -#define CKA_OWNER 0x00000084 -#define CKA_ATTR_TYPES 0x00000085 - -/* CKA_TRUSTED is new for v2.11 */ -#define CKA_TRUSTED 0x00000086 - -/* CKA_CERTIFICATE_CATEGORY ... - * CKA_CHECK_VALUE are new for v2.20 */ -#define CKA_CERTIFICATE_CATEGORY 0x00000087 -#define CKA_JAVA_MIDP_SECURITY_DOMAIN 0x00000088 -#define CKA_URL 0x00000089 -#define CKA_HASH_OF_SUBJECT_PUBLIC_KEY 0x0000008A -#define CKA_HASH_OF_ISSUER_PUBLIC_KEY 0x0000008B -#define CKA_CHECK_VALUE 0x00000090 - -#define CKA_KEY_TYPE 0x00000100 -#define CKA_SUBJECT 0x00000101 -#define CKA_ID 0x00000102 -#define CKA_SENSITIVE 0x00000103 -#define CKA_ENCRYPT 0x00000104 -#define CKA_DECRYPT 0x00000105 -#define CKA_WRAP 0x00000106 -#define CKA_UNWRAP 0x00000107 -#define CKA_SIGN 0x00000108 -#define CKA_SIGN_RECOVER 0x00000109 -#define CKA_VERIFY 0x0000010A -#define CKA_VERIFY_RECOVER 0x0000010B -#define CKA_DERIVE 0x0000010C -#define CKA_START_DATE 0x00000110 -#define CKA_END_DATE 0x00000111 -#define CKA_MODULUS 0x00000120 -#define CKA_MODULUS_BITS 0x00000121 -#define CKA_PUBLIC_EXPONENT 0x00000122 -#define CKA_PRIVATE_EXPONENT 0x00000123 -#define CKA_PRIME_1 0x00000124 -#define CKA_PRIME_2 0x00000125 -#define CKA_EXPONENT_1 0x00000126 -#define CKA_EXPONENT_2 0x00000127 -#define CKA_COEFFICIENT 0x00000128 -#define CKA_PRIME 0x00000130 -#define CKA_SUBPRIME 0x00000131 -#define CKA_BASE 0x00000132 - -/* CKA_PRIME_BITS and CKA_SUB_PRIME_BITS are new for v2.11 */ -#define CKA_PRIME_BITS 0x00000133 -#define CKA_SUBPRIME_BITS 0x00000134 -#define CKA_SUB_PRIME_BITS CKA_SUBPRIME_BITS -/* (To retain backwards-compatibility) */ - -#define CKA_VALUE_BITS 0x00000160 -#define CKA_VALUE_LEN 0x00000161 - -/* CKA_EXTRACTABLE, CKA_LOCAL, CKA_NEVER_EXTRACTABLE, - * CKA_ALWAYS_SENSITIVE, CKA_MODIFIABLE, CKA_ECDSA_PARAMS, - * and CKA_EC_POINT are new for v2.0 */ -#define CKA_EXTRACTABLE 0x00000162 -#define CKA_LOCAL 0x00000163 -#define CKA_NEVER_EXTRACTABLE 0x00000164 -#define CKA_ALWAYS_SENSITIVE 0x00000165 - -/* CKA_KEY_GEN_MECHANISM is new for v2.11 */ -#define CKA_KEY_GEN_MECHANISM 0x00000166 - -#define CKA_MODIFIABLE 0x00000170 - -/* CKA_ECDSA_PARAMS is deprecated in v2.11, - * CKA_EC_PARAMS is preferred. */ -#define CKA_ECDSA_PARAMS 0x00000180 -#define CKA_EC_PARAMS 0x00000180 - -#define CKA_EC_POINT 0x00000181 - -/* CKA_SECONDARY_AUTH, CKA_AUTH_PIN_FLAGS, - * are new for v2.10. Deprecated in v2.11 and onwards. */ -#define CKA_SECONDARY_AUTH 0x00000200 -#define CKA_AUTH_PIN_FLAGS 0x00000201 - -/* CKA_ALWAYS_AUTHENTICATE ... - * CKA_UNWRAP_TEMPLATE are new for v2.20 */ -#define CKA_ALWAYS_AUTHENTICATE 0x00000202 - -#define CKA_WRAP_WITH_TRUSTED 0x00000210 -#define CKA_WRAP_TEMPLATE (CKF_ARRAY_ATTRIBUTE|0x00000211) -#define CKA_UNWRAP_TEMPLATE (CKF_ARRAY_ATTRIBUTE|0x00000212) - -/* CKA_HW_FEATURE_TYPE, CKA_RESET_ON_INIT, and CKA_HAS_RESET - * are new for v2.10 */ -#define CKA_HW_FEATURE_TYPE 0x00000300 -#define CKA_RESET_ON_INIT 0x00000301 -#define CKA_HAS_RESET 0x00000302 - -/* The following attributes are new for v2.20 */ -#define CKA_PIXEL_X 0x00000400 -#define CKA_PIXEL_Y 0x00000401 -#define CKA_RESOLUTION 0x00000402 -#define CKA_CHAR_ROWS 0x00000403 -#define CKA_CHAR_COLUMNS 0x00000404 -#define CKA_COLOR 0x00000405 -#define CKA_BITS_PER_PIXEL 0x00000406 -#define CKA_CHAR_SETS 0x00000480 -#define CKA_ENCODING_METHODS 0x00000481 -#define CKA_MIME_TYPES 0x00000482 -#define CKA_MECHANISM_TYPE 0x00000500 -#define CKA_REQUIRED_CMS_ATTRIBUTES 0x00000501 -#define CKA_DEFAULT_CMS_ATTRIBUTES 0x00000502 -#define CKA_SUPPORTED_CMS_ATTRIBUTES 0x00000503 -#define CKA_ALLOWED_MECHANISMS (CKF_ARRAY_ATTRIBUTE|0x00000600) - -#define CKA_VENDOR_DEFINED 0x80000000 - - -/* CK_ATTRIBUTE is a structure that includes the type, length - * and value of an attribute */ -typedef struct CK_ATTRIBUTE { - CK_ATTRIBUTE_TYPE type; - CK_VOID_PTR pValue; - - /* ulValueLen went from CK_USHORT to CK_ULONG for v2.0 */ - CK_ULONG ulValueLen; /* in bytes */ -} CK_ATTRIBUTE; - -typedef CK_ATTRIBUTE CK_PTR CK_ATTRIBUTE_PTR; - - -/* CK_DATE is a structure that defines a date */ -typedef struct CK_DATE{ - CK_CHAR year[4]; /* the year ("1900" - "9999") */ - CK_CHAR month[2]; /* the month ("01" - "12") */ - CK_CHAR day[2]; /* the day ("01" - "31") */ -} CK_DATE; - - -/* CK_MECHANISM_TYPE is a value that identifies a mechanism - * type */ -/* CK_MECHANISM_TYPE was changed from CK_USHORT to CK_ULONG for - * v2.0 */ -typedef CK_ULONG CK_MECHANISM_TYPE; - -/* the following mechanism types are defined: */ -#define CKM_RSA_PKCS_KEY_PAIR_GEN 0x00000000 -#define CKM_RSA_PKCS 0x00000001 -#define CKM_RSA_9796 0x00000002 -#define CKM_RSA_X_509 0x00000003 - -/* CKM_MD2_RSA_PKCS, CKM_MD5_RSA_PKCS, and CKM_SHA1_RSA_PKCS - * are new for v2.0. They are mechanisms which hash and sign */ -#define CKM_MD2_RSA_PKCS 0x00000004 -#define CKM_MD5_RSA_PKCS 0x00000005 -#define CKM_SHA1_RSA_PKCS 0x00000006 - -/* CKM_RIPEMD128_RSA_PKCS, CKM_RIPEMD160_RSA_PKCS, and - * CKM_RSA_PKCS_OAEP are new for v2.10 */ -#define CKM_RIPEMD128_RSA_PKCS 0x00000007 -#define CKM_RIPEMD160_RSA_PKCS 0x00000008 -#define CKM_RSA_PKCS_OAEP 0x00000009 - -/* CKM_RSA_X9_31_KEY_PAIR_GEN, CKM_RSA_X9_31, CKM_SHA1_RSA_X9_31, - * CKM_RSA_PKCS_PSS, and CKM_SHA1_RSA_PKCS_PSS are new for v2.11 */ -#define CKM_RSA_X9_31_KEY_PAIR_GEN 0x0000000A -#define CKM_RSA_X9_31 0x0000000B -#define CKM_SHA1_RSA_X9_31 0x0000000C -#define CKM_RSA_PKCS_PSS 0x0000000D -#define CKM_SHA1_RSA_PKCS_PSS 0x0000000E - -#define CKM_DSA_KEY_PAIR_GEN 0x00000010 -#define CKM_DSA 0x00000011 -#define CKM_DSA_SHA1 0x00000012 -#define CKM_DH_PKCS_KEY_PAIR_GEN 0x00000020 -#define CKM_DH_PKCS_DERIVE 0x00000021 - -/* CKM_X9_42_DH_KEY_PAIR_GEN, CKM_X9_42_DH_DERIVE, - * CKM_X9_42_DH_HYBRID_DERIVE, and CKM_X9_42_MQV_DERIVE are new for - * v2.11 */ -#define CKM_X9_42_DH_KEY_PAIR_GEN 0x00000030 -#define CKM_X9_42_DH_DERIVE 0x00000031 -#define CKM_X9_42_DH_HYBRID_DERIVE 0x00000032 -#define CKM_X9_42_MQV_DERIVE 0x00000033 - -/* CKM_SHA256/384/512 are new for v2.20 */ -#define CKM_SHA256_RSA_PKCS 0x00000040 -#define CKM_SHA384_RSA_PKCS 0x00000041 -#define CKM_SHA512_RSA_PKCS 0x00000042 -#define CKM_SHA256_RSA_PKCS_PSS 0x00000043 -#define CKM_SHA384_RSA_PKCS_PSS 0x00000044 -#define CKM_SHA512_RSA_PKCS_PSS 0x00000045 - -/* CKM_SHA224 new for v2.20 amendment 3 */ -#define CKM_SHA224_RSA_PKCS 0x00000046 -#define CKM_SHA224_RSA_PKCS_PSS 0x00000047 - -#define CKM_RC2_KEY_GEN 0x00000100 -#define CKM_RC2_ECB 0x00000101 -#define CKM_RC2_CBC 0x00000102 -#define CKM_RC2_MAC 0x00000103 - -/* CKM_RC2_MAC_GENERAL and CKM_RC2_CBC_PAD are new for v2.0 */ -#define CKM_RC2_MAC_GENERAL 0x00000104 -#define CKM_RC2_CBC_PAD 0x00000105 - -#define CKM_RC4_KEY_GEN 0x00000110 -#define CKM_RC4 0x00000111 -#define CKM_DES_KEY_GEN 0x00000120 -#define CKM_DES_ECB 0x00000121 -#define CKM_DES_CBC 0x00000122 -#define CKM_DES_MAC 0x00000123 - -/* CKM_DES_MAC_GENERAL and CKM_DES_CBC_PAD are new for v2.0 */ -#define CKM_DES_MAC_GENERAL 0x00000124 -#define CKM_DES_CBC_PAD 0x00000125 - -#define CKM_DES2_KEY_GEN 0x00000130 -#define CKM_DES3_KEY_GEN 0x00000131 -#define CKM_DES3_ECB 0x00000132 -#define CKM_DES3_CBC 0x00000133 -#define CKM_DES3_MAC 0x00000134 - -/* CKM_DES3_MAC_GENERAL, CKM_DES3_CBC_PAD, CKM_CDMF_KEY_GEN, - * CKM_CDMF_ECB, CKM_CDMF_CBC, CKM_CDMF_MAC, - * CKM_CDMF_MAC_GENERAL, and CKM_CDMF_CBC_PAD are new for v2.0 */ -#define CKM_DES3_MAC_GENERAL 0x00000135 -#define CKM_DES3_CBC_PAD 0x00000136 -#define CKM_CDMF_KEY_GEN 0x00000140 -#define CKM_CDMF_ECB 0x00000141 -#define CKM_CDMF_CBC 0x00000142 -#define CKM_CDMF_MAC 0x00000143 -#define CKM_CDMF_MAC_GENERAL 0x00000144 -#define CKM_CDMF_CBC_PAD 0x00000145 - -/* the following four DES mechanisms are new for v2.20 */ -#define CKM_DES_OFB64 0x00000150 -#define CKM_DES_OFB8 0x00000151 -#define CKM_DES_CFB64 0x00000152 -#define CKM_DES_CFB8 0x00000153 - -#define CKM_MD2 0x00000200 - -/* CKM_MD2_HMAC and CKM_MD2_HMAC_GENERAL are new for v2.0 */ -#define CKM_MD2_HMAC 0x00000201 -#define CKM_MD2_HMAC_GENERAL 0x00000202 - -#define CKM_MD5 0x00000210 - -/* CKM_MD5_HMAC and CKM_MD5_HMAC_GENERAL are new for v2.0 */ -#define CKM_MD5_HMAC 0x00000211 -#define CKM_MD5_HMAC_GENERAL 0x00000212 - -#define CKM_SHA_1 0x00000220 - -/* CKM_SHA_1_HMAC and CKM_SHA_1_HMAC_GENERAL are new for v2.0 */ -#define CKM_SHA_1_HMAC 0x00000221 -#define CKM_SHA_1_HMAC_GENERAL 0x00000222 - -/* CKM_RIPEMD128, CKM_RIPEMD128_HMAC, - * CKM_RIPEMD128_HMAC_GENERAL, CKM_RIPEMD160, CKM_RIPEMD160_HMAC, - * and CKM_RIPEMD160_HMAC_GENERAL are new for v2.10 */ -#define CKM_RIPEMD128 0x00000230 -#define CKM_RIPEMD128_HMAC 0x00000231 -#define CKM_RIPEMD128_HMAC_GENERAL 0x00000232 -#define CKM_RIPEMD160 0x00000240 -#define CKM_RIPEMD160_HMAC 0x00000241 -#define CKM_RIPEMD160_HMAC_GENERAL 0x00000242 - -/* CKM_SHA256/384/512 are new for v2.20 */ -#define CKM_SHA256 0x00000250 -#define CKM_SHA256_HMAC 0x00000251 -#define CKM_SHA256_HMAC_GENERAL 0x00000252 -#define CKM_SHA384 0x00000260 -#define CKM_SHA384_HMAC 0x00000261 -#define CKM_SHA384_HMAC_GENERAL 0x00000262 -#define CKM_SHA512 0x00000270 -#define CKM_SHA512_HMAC 0x00000271 -#define CKM_SHA512_HMAC_GENERAL 0x00000272 - -/* CKM_SHA224 new for v2.20 amendment 3 */ -#define CKM_SHA224 0x00000255 -#define CKM_SHA224_HMAC 0x00000256 -#define CKM_SHA224_HMAC_GENERAL 0x00000257 - -/* All of the following mechanisms are new for v2.0 */ -/* Note that CAST128 and CAST5 are the same algorithm */ -#define CKM_CAST_KEY_GEN 0x00000300 -#define CKM_CAST_ECB 0x00000301 -#define CKM_CAST_CBC 0x00000302 -#define CKM_CAST_MAC 0x00000303 -#define CKM_CAST_MAC_GENERAL 0x00000304 -#define CKM_CAST_CBC_PAD 0x00000305 -#define CKM_CAST3_KEY_GEN 0x00000310 -#define CKM_CAST3_ECB 0x00000311 -#define CKM_CAST3_CBC 0x00000312 -#define CKM_CAST3_MAC 0x00000313 -#define CKM_CAST3_MAC_GENERAL 0x00000314 -#define CKM_CAST3_CBC_PAD 0x00000315 -#define CKM_CAST5_KEY_GEN 0x00000320 -#define CKM_CAST128_KEY_GEN 0x00000320 -#define CKM_CAST5_ECB 0x00000321 -#define CKM_CAST128_ECB 0x00000321 -#define CKM_CAST5_CBC 0x00000322 -#define CKM_CAST128_CBC 0x00000322 -#define CKM_CAST5_MAC 0x00000323 -#define CKM_CAST128_MAC 0x00000323 -#define CKM_CAST5_MAC_GENERAL 0x00000324 -#define CKM_CAST128_MAC_GENERAL 0x00000324 -#define CKM_CAST5_CBC_PAD 0x00000325 -#define CKM_CAST128_CBC_PAD 0x00000325 -#define CKM_RC5_KEY_GEN 0x00000330 -#define CKM_RC5_ECB 0x00000331 -#define CKM_RC5_CBC 0x00000332 -#define CKM_RC5_MAC 0x00000333 -#define CKM_RC5_MAC_GENERAL 0x00000334 -#define CKM_RC5_CBC_PAD 0x00000335 -#define CKM_IDEA_KEY_GEN 0x00000340 -#define CKM_IDEA_ECB 0x00000341 -#define CKM_IDEA_CBC 0x00000342 -#define CKM_IDEA_MAC 0x00000343 -#define CKM_IDEA_MAC_GENERAL 0x00000344 -#define CKM_IDEA_CBC_PAD 0x00000345 -#define CKM_GENERIC_SECRET_KEY_GEN 0x00000350 -#define CKM_CONCATENATE_BASE_AND_KEY 0x00000360 -#define CKM_CONCATENATE_BASE_AND_DATA 0x00000362 -#define CKM_CONCATENATE_DATA_AND_BASE 0x00000363 -#define CKM_XOR_BASE_AND_DATA 0x00000364 -#define CKM_EXTRACT_KEY_FROM_KEY 0x00000365 -#define CKM_SSL3_PRE_MASTER_KEY_GEN 0x00000370 -#define CKM_SSL3_MASTER_KEY_DERIVE 0x00000371 -#define CKM_SSL3_KEY_AND_MAC_DERIVE 0x00000372 - -/* CKM_SSL3_MASTER_KEY_DERIVE_DH, CKM_TLS_PRE_MASTER_KEY_GEN, - * CKM_TLS_MASTER_KEY_DERIVE, CKM_TLS_KEY_AND_MAC_DERIVE, and - * CKM_TLS_MASTER_KEY_DERIVE_DH are new for v2.11 */ -#define CKM_SSL3_MASTER_KEY_DERIVE_DH 0x00000373 -#define CKM_TLS_PRE_MASTER_KEY_GEN 0x00000374 -#define CKM_TLS_MASTER_KEY_DERIVE 0x00000375 -#define CKM_TLS_KEY_AND_MAC_DERIVE 0x00000376 -#define CKM_TLS_MASTER_KEY_DERIVE_DH 0x00000377 - -/* CKM_TLS_PRF is new for v2.20 */ -#define CKM_TLS_PRF 0x00000378 - -#define CKM_SSL3_MD5_MAC 0x00000380 -#define CKM_SSL3_SHA1_MAC 0x00000381 -#define CKM_MD5_KEY_DERIVATION 0x00000390 -#define CKM_MD2_KEY_DERIVATION 0x00000391 -#define CKM_SHA1_KEY_DERIVATION 0x00000392 - -/* CKM_SHA256/384/512 are new for v2.20 */ -#define CKM_SHA256_KEY_DERIVATION 0x00000393 -#define CKM_SHA384_KEY_DERIVATION 0x00000394 -#define CKM_SHA512_KEY_DERIVATION 0x00000395 - -/* CKM_SHA224 new for v2.20 amendment 3 */ -#define CKM_SHA224_KEY_DERIVATION 0x00000396 - -#define CKM_PBE_MD2_DES_CBC 0x000003A0 -#define CKM_PBE_MD5_DES_CBC 0x000003A1 -#define CKM_PBE_MD5_CAST_CBC 0x000003A2 -#define CKM_PBE_MD5_CAST3_CBC 0x000003A3 -#define CKM_PBE_MD5_CAST5_CBC 0x000003A4 -#define CKM_PBE_MD5_CAST128_CBC 0x000003A4 -#define CKM_PBE_SHA1_CAST5_CBC 0x000003A5 -#define CKM_PBE_SHA1_CAST128_CBC 0x000003A5 -#define CKM_PBE_SHA1_RC4_128 0x000003A6 -#define CKM_PBE_SHA1_RC4_40 0x000003A7 -#define CKM_PBE_SHA1_DES3_EDE_CBC 0x000003A8 -#define CKM_PBE_SHA1_DES2_EDE_CBC 0x000003A9 -#define CKM_PBE_SHA1_RC2_128_CBC 0x000003AA -#define CKM_PBE_SHA1_RC2_40_CBC 0x000003AB - -/* CKM_PKCS5_PBKD2 is new for v2.10 */ -#define CKM_PKCS5_PBKD2 0x000003B0 - -#define CKM_PBA_SHA1_WITH_SHA1_HMAC 0x000003C0 - -/* WTLS mechanisms are new for v2.20 */ -#define CKM_WTLS_PRE_MASTER_KEY_GEN 0x000003D0 -#define CKM_WTLS_MASTER_KEY_DERIVE 0x000003D1 -#define CKM_WTLS_MASTER_KEY_DERIVE_DH_ECC 0x000003D2 -#define CKM_WTLS_PRF 0x000003D3 -#define CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE 0x000003D4 -#define CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE 0x000003D5 - -#define CKM_KEY_WRAP_LYNKS 0x00000400 -#define CKM_KEY_WRAP_SET_OAEP 0x00000401 - -/* CKM_CMS_SIG is new for v2.20 */ -#define CKM_CMS_SIG 0x00000500 - -/* Fortezza mechanisms */ -#define CKM_SKIPJACK_KEY_GEN 0x00001000 -#define CKM_SKIPJACK_ECB64 0x00001001 -#define CKM_SKIPJACK_CBC64 0x00001002 -#define CKM_SKIPJACK_OFB64 0x00001003 -#define CKM_SKIPJACK_CFB64 0x00001004 -#define CKM_SKIPJACK_CFB32 0x00001005 -#define CKM_SKIPJACK_CFB16 0x00001006 -#define CKM_SKIPJACK_CFB8 0x00001007 -#define CKM_SKIPJACK_WRAP 0x00001008 -#define CKM_SKIPJACK_PRIVATE_WRAP 0x00001009 -#define CKM_SKIPJACK_RELAYX 0x0000100a -#define CKM_KEA_KEY_PAIR_GEN 0x00001010 -#define CKM_KEA_KEY_DERIVE 0x00001011 -#define CKM_FORTEZZA_TIMESTAMP 0x00001020 -#define CKM_BATON_KEY_GEN 0x00001030 -#define CKM_BATON_ECB128 0x00001031 -#define CKM_BATON_ECB96 0x00001032 -#define CKM_BATON_CBC128 0x00001033 -#define CKM_BATON_COUNTER 0x00001034 -#define CKM_BATON_SHUFFLE 0x00001035 -#define CKM_BATON_WRAP 0x00001036 - -/* CKM_ECDSA_KEY_PAIR_GEN is deprecated in v2.11, - * CKM_EC_KEY_PAIR_GEN is preferred */ -#define CKM_ECDSA_KEY_PAIR_GEN 0x00001040 -#define CKM_EC_KEY_PAIR_GEN 0x00001040 - -#define CKM_ECDSA 0x00001041 -#define CKM_ECDSA_SHA1 0x00001042 - -/* CKM_ECDH1_DERIVE, CKM_ECDH1_COFACTOR_DERIVE, and CKM_ECMQV_DERIVE - * are new for v2.11 */ -#define CKM_ECDH1_DERIVE 0x00001050 -#define CKM_ECDH1_COFACTOR_DERIVE 0x00001051 -#define CKM_ECMQV_DERIVE 0x00001052 - -#define CKM_JUNIPER_KEY_GEN 0x00001060 -#define CKM_JUNIPER_ECB128 0x00001061 -#define CKM_JUNIPER_CBC128 0x00001062 -#define CKM_JUNIPER_COUNTER 0x00001063 -#define CKM_JUNIPER_SHUFFLE 0x00001064 -#define CKM_JUNIPER_WRAP 0x00001065 -#define CKM_FASTHASH 0x00001070 - -/* CKM_AES_KEY_GEN, CKM_AES_ECB, CKM_AES_CBC, CKM_AES_MAC, - * CKM_AES_MAC_GENERAL, CKM_AES_CBC_PAD, CKM_DSA_PARAMETER_GEN, - * CKM_DH_PKCS_PARAMETER_GEN, and CKM_X9_42_DH_PARAMETER_GEN are - * new for v2.11 */ -#define CKM_AES_KEY_GEN 0x00001080 -#define CKM_AES_ECB 0x00001081 -#define CKM_AES_CBC 0x00001082 -#define CKM_AES_MAC 0x00001083 -#define CKM_AES_MAC_GENERAL 0x00001084 -#define CKM_AES_CBC_PAD 0x00001085 -/* new for v2.20 amendment 3 */ -#define CKM_AES_CTR 0x00001086 -/* new for v2.30 */ -#define CKM_AES_GCM 0x00001087 -#define CKM_AES_CCM 0x00001088 -#define CKM_AES_CTS 0x00001089 - -/* BlowFish and TwoFish are new for v2.20 */ -#define CKM_BLOWFISH_KEY_GEN 0x00001090 -#define CKM_BLOWFISH_CBC 0x00001091 -#define CKM_TWOFISH_KEY_GEN 0x00001092 -#define CKM_TWOFISH_CBC 0x00001093 - -/* Camellia is proposed for v2.20 Amendment 3 */ -#define CKM_CAMELLIA_KEY_GEN 0x00000550 -#define CKM_CAMELLIA_ECB 0x00000551 -#define CKM_CAMELLIA_CBC 0x00000552 -#define CKM_CAMELLIA_MAC 0x00000553 -#define CKM_CAMELLIA_MAC_GENERAL 0x00000554 -#define CKM_CAMELLIA_CBC_PAD 0x00000555 -#define CKM_CAMELLIA_ECB_ENCRYPT_DATA 0x00000556 -#define CKM_CAMELLIA_CBC_ENCRYPT_DATA 0x00000557 - -#define CKM_SEED_KEY_GEN 0x00000650 -#define CKM_SEED_ECB 0x00000651 -#define CKM_SEED_CBC 0x00000652 -#define CKM_SEED_MAC 0x00000653 -#define CKM_SEED_MAC_GENERAL 0x00000654 -#define CKM_SEED_CBC_PAD 0x00000655 -#define CKM_SEED_ECB_ENCRYPT_DATA 0x00000656 -#define CKM_SEED_CBC_ENCRYPT_DATA 0x00000657 - -/* CKM_xxx_ENCRYPT_DATA mechanisms are new for v2.20 */ -#define CKM_DES_ECB_ENCRYPT_DATA 0x00001100 -#define CKM_DES_CBC_ENCRYPT_DATA 0x00001101 -#define CKM_DES3_ECB_ENCRYPT_DATA 0x00001102 -#define CKM_DES3_CBC_ENCRYPT_DATA 0x00001103 -#define CKM_AES_ECB_ENCRYPT_DATA 0x00001104 -#define CKM_AES_CBC_ENCRYPT_DATA 0x00001105 - -#define CKM_DSA_PARAMETER_GEN 0x00002000 -#define CKM_DH_PKCS_PARAMETER_GEN 0x00002001 -#define CKM_X9_42_DH_PARAMETER_GEN 0x00002002 - -#define CKM_VENDOR_DEFINED 0x80000000 - -typedef CK_MECHANISM_TYPE CK_PTR CK_MECHANISM_TYPE_PTR; - - -/* CK_MECHANISM is a structure that specifies a particular - * mechanism */ -typedef struct CK_MECHANISM { - CK_MECHANISM_TYPE mechanism; - CK_VOID_PTR pParameter; - - /* ulParameterLen was changed from CK_USHORT to CK_ULONG for - * v2.0 */ - CK_ULONG ulParameterLen; /* in bytes */ -} CK_MECHANISM; - -typedef CK_MECHANISM CK_PTR CK_MECHANISM_PTR; - - -/* CK_MECHANISM_INFO provides information about a particular - * mechanism */ -typedef struct CK_MECHANISM_INFO { - CK_ULONG ulMinKeySize; - CK_ULONG ulMaxKeySize; - CK_FLAGS flags; -} CK_MECHANISM_INFO; - -/* The flags are defined as follows: - * Bit Flag Mask Meaning */ -#define CKF_HW 0x00000001 /* performed by HW */ - -/* The flags CKF_ENCRYPT, CKF_DECRYPT, CKF_DIGEST, CKF_SIGN, - * CKG_SIGN_RECOVER, CKF_VERIFY, CKF_VERIFY_RECOVER, - * CKF_GENERATE, CKF_GENERATE_KEY_PAIR, CKF_WRAP, CKF_UNWRAP, - * and CKF_DERIVE are new for v2.0. They specify whether or not - * a mechanism can be used for a particular task */ -#define CKF_ENCRYPT 0x00000100 -#define CKF_DECRYPT 0x00000200 -#define CKF_DIGEST 0x00000400 -#define CKF_SIGN 0x00000800 -#define CKF_SIGN_RECOVER 0x00001000 -#define CKF_VERIFY 0x00002000 -#define CKF_VERIFY_RECOVER 0x00004000 -#define CKF_GENERATE 0x00008000 -#define CKF_GENERATE_KEY_PAIR 0x00010000 -#define CKF_WRAP 0x00020000 -#define CKF_UNWRAP 0x00040000 -#define CKF_DERIVE 0x00080000 - -/* CKF_EC_F_P, CKF_EC_F_2M, CKF_EC_ECPARAMETERS, CKF_EC_NAMEDCURVE, - * CKF_EC_UNCOMPRESS, and CKF_EC_COMPRESS are new for v2.11. They - * describe a token's EC capabilities not available in mechanism - * information. */ -#define CKF_EC_F_P 0x00100000 -#define CKF_EC_F_2M 0x00200000 -#define CKF_EC_ECPARAMETERS 0x00400000 -#define CKF_EC_NAMEDCURVE 0x00800000 -#define CKF_EC_UNCOMPRESS 0x01000000 -#define CKF_EC_COMPRESS 0x02000000 - -#define CKF_EXTENSION 0x80000000 /* FALSE for this version */ - -typedef CK_MECHANISM_INFO CK_PTR CK_MECHANISM_INFO_PTR; - - -/* CK_RV is a value that identifies the return value of a - * PKCS #11 function */ -/* CK_RV was changed from CK_USHORT to CK_ULONG for v2.0 */ -typedef CK_ULONG CK_RV; - -#define CKR_OK 0x00000000 -#define CKR_CANCEL 0x00000001 -#define CKR_HOST_MEMORY 0x00000002 -#define CKR_SLOT_ID_INVALID 0x00000003 - -/* CKR_FLAGS_INVALID was removed for v2.0 */ - -/* CKR_GENERAL_ERROR and CKR_FUNCTION_FAILED are new for v2.0 */ -#define CKR_GENERAL_ERROR 0x00000005 -#define CKR_FUNCTION_FAILED 0x00000006 - -/* CKR_ARGUMENTS_BAD, CKR_NO_EVENT, CKR_NEED_TO_CREATE_THREADS, - * and CKR_CANT_LOCK are new for v2.01 */ -#define CKR_ARGUMENTS_BAD 0x00000007 -#define CKR_NO_EVENT 0x00000008 -#define CKR_NEED_TO_CREATE_THREADS 0x00000009 -#define CKR_CANT_LOCK 0x0000000A - -#define CKR_ATTRIBUTE_READ_ONLY 0x00000010 -#define CKR_ATTRIBUTE_SENSITIVE 0x00000011 -#define CKR_ATTRIBUTE_TYPE_INVALID 0x00000012 -#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013 -#define CKR_DATA_INVALID 0x00000020 -#define CKR_DATA_LEN_RANGE 0x00000021 -#define CKR_DEVICE_ERROR 0x00000030 -#define CKR_DEVICE_MEMORY 0x00000031 -#define CKR_DEVICE_REMOVED 0x00000032 -#define CKR_ENCRYPTED_DATA_INVALID 0x00000040 -#define CKR_ENCRYPTED_DATA_LEN_RANGE 0x00000041 -#define CKR_FUNCTION_CANCELED 0x00000050 -#define CKR_FUNCTION_NOT_PARALLEL 0x00000051 - -/* CKR_FUNCTION_NOT_SUPPORTED is new for v2.0 */ -#define CKR_FUNCTION_NOT_SUPPORTED 0x00000054 - -#define CKR_KEY_HANDLE_INVALID 0x00000060 - -/* CKR_KEY_SENSITIVE was removed for v2.0 */ - -#define CKR_KEY_SIZE_RANGE 0x00000062 -#define CKR_KEY_TYPE_INCONSISTENT 0x00000063 - -/* CKR_KEY_NOT_NEEDED, CKR_KEY_CHANGED, CKR_KEY_NEEDED, - * CKR_KEY_INDIGESTIBLE, CKR_KEY_FUNCTION_NOT_PERMITTED, - * CKR_KEY_NOT_WRAPPABLE, and CKR_KEY_UNEXTRACTABLE are new for - * v2.0 */ -#define CKR_KEY_NOT_NEEDED 0x00000064 -#define CKR_KEY_CHANGED 0x00000065 -#define CKR_KEY_NEEDED 0x00000066 -#define CKR_KEY_INDIGESTIBLE 0x00000067 -#define CKR_KEY_FUNCTION_NOT_PERMITTED 0x00000068 -#define CKR_KEY_NOT_WRAPPABLE 0x00000069 -#define CKR_KEY_UNEXTRACTABLE 0x0000006A - -#define CKR_MECHANISM_INVALID 0x00000070 -#define CKR_MECHANISM_PARAM_INVALID 0x00000071 - -/* CKR_OBJECT_CLASS_INCONSISTENT and CKR_OBJECT_CLASS_INVALID - * were removed for v2.0 */ -#define CKR_OBJECT_HANDLE_INVALID 0x00000082 -#define CKR_OPERATION_ACTIVE 0x00000090 -#define CKR_OPERATION_NOT_INITIALIZED 0x00000091 -#define CKR_PIN_INCORRECT 0x000000A0 -#define CKR_PIN_INVALID 0x000000A1 -#define CKR_PIN_LEN_RANGE 0x000000A2 - -/* CKR_PIN_EXPIRED and CKR_PIN_LOCKED are new for v2.0 */ -#define CKR_PIN_EXPIRED 0x000000A3 -#define CKR_PIN_LOCKED 0x000000A4 - -#define CKR_SESSION_CLOSED 0x000000B0 -#define CKR_SESSION_COUNT 0x000000B1 -#define CKR_SESSION_HANDLE_INVALID 0x000000B3 -#define CKR_SESSION_PARALLEL_NOT_SUPPORTED 0x000000B4 -#define CKR_SESSION_READ_ONLY 0x000000B5 -#define CKR_SESSION_EXISTS 0x000000B6 - -/* CKR_SESSION_READ_ONLY_EXISTS and - * CKR_SESSION_READ_WRITE_SO_EXISTS are new for v2.0 */ -#define CKR_SESSION_READ_ONLY_EXISTS 0x000000B7 -#define CKR_SESSION_READ_WRITE_SO_EXISTS 0x000000B8 - -#define CKR_SIGNATURE_INVALID 0x000000C0 -#define CKR_SIGNATURE_LEN_RANGE 0x000000C1 -#define CKR_TEMPLATE_INCOMPLETE 0x000000D0 -#define CKR_TEMPLATE_INCONSISTENT 0x000000D1 -#define CKR_TOKEN_NOT_PRESENT 0x000000E0 -#define CKR_TOKEN_NOT_RECOGNIZED 0x000000E1 -#define CKR_TOKEN_WRITE_PROTECTED 0x000000E2 -#define CKR_UNWRAPPING_KEY_HANDLE_INVALID 0x000000F0 -#define CKR_UNWRAPPING_KEY_SIZE_RANGE 0x000000F1 -#define CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT 0x000000F2 -#define CKR_USER_ALREADY_LOGGED_IN 0x00000100 -#define CKR_USER_NOT_LOGGED_IN 0x00000101 -#define CKR_USER_PIN_NOT_INITIALIZED 0x00000102 -#define CKR_USER_TYPE_INVALID 0x00000103 - -/* CKR_USER_ANOTHER_ALREADY_LOGGED_IN and CKR_USER_TOO_MANY_TYPES - * are new to v2.01 */ -#define CKR_USER_ANOTHER_ALREADY_LOGGED_IN 0x00000104 -#define CKR_USER_TOO_MANY_TYPES 0x00000105 - -#define CKR_WRAPPED_KEY_INVALID 0x00000110 -#define CKR_WRAPPED_KEY_LEN_RANGE 0x00000112 -#define CKR_WRAPPING_KEY_HANDLE_INVALID 0x00000113 -#define CKR_WRAPPING_KEY_SIZE_RANGE 0x00000114 -#define CKR_WRAPPING_KEY_TYPE_INCONSISTENT 0x00000115 -#define CKR_RANDOM_SEED_NOT_SUPPORTED 0x00000120 - -/* These are new to v2.0 */ -#define CKR_RANDOM_NO_RNG 0x00000121 - -/* These are new to v2.11 */ -#define CKR_DOMAIN_PARAMS_INVALID 0x00000130 - -/* These are new to v2.0 */ -#define CKR_BUFFER_TOO_SMALL 0x00000150 -#define CKR_SAVED_STATE_INVALID 0x00000160 -#define CKR_INFORMATION_SENSITIVE 0x00000170 -#define CKR_STATE_UNSAVEABLE 0x00000180 - -/* These are new to v2.01 */ -#define CKR_CRYPTOKI_NOT_INITIALIZED 0x00000190 -#define CKR_CRYPTOKI_ALREADY_INITIALIZED 0x00000191 -#define CKR_MUTEX_BAD 0x000001A0 -#define CKR_MUTEX_NOT_LOCKED 0x000001A1 - -/* This is new to v2.20 */ -#define CKR_FUNCTION_REJECTED 0x00000200 - -#define CKR_VENDOR_DEFINED 0x80000000 - - -/* CK_NOTIFY is an application callback that processes events */ -typedef CK_CALLBACK_FUNCTION(CK_RV, CK_NOTIFY)( - CK_SESSION_HANDLE hSession, /* the session's handle */ - CK_NOTIFICATION event, - CK_VOID_PTR pApplication /* passed to C_OpenSession */ -); - - -/* CK_FUNCTION_LIST is a structure holding a PKCS #11 spec - * version and pointers of appropriate types to all the - * PKCS #11 functions */ -/* CK_FUNCTION_LIST is new for v2.0 */ -typedef struct CK_FUNCTION_LIST CK_FUNCTION_LIST; - -typedef CK_FUNCTION_LIST CK_PTR CK_FUNCTION_LIST_PTR; - -typedef CK_FUNCTION_LIST_PTR CK_PTR CK_FUNCTION_LIST_PTR_PTR; - - -/* CK_CREATEMUTEX is an application callback for creating a - * mutex object */ -typedef CK_CALLBACK_FUNCTION(CK_RV, CK_CREATEMUTEX)( - CK_VOID_PTR_PTR ppMutex /* location to receive ptr to mutex */ -); - - -/* CK_DESTROYMUTEX is an application callback for destroying a - * mutex object */ -typedef CK_CALLBACK_FUNCTION(CK_RV, CK_DESTROYMUTEX)( - CK_VOID_PTR pMutex /* pointer to mutex */ -); - - -/* CK_LOCKMUTEX is an application callback for locking a mutex */ -typedef CK_CALLBACK_FUNCTION(CK_RV, CK_LOCKMUTEX)( - CK_VOID_PTR pMutex /* pointer to mutex */ -); - - -/* CK_UNLOCKMUTEX is an application callback for unlocking a - * mutex */ -typedef CK_CALLBACK_FUNCTION(CK_RV, CK_UNLOCKMUTEX)( - CK_VOID_PTR pMutex /* pointer to mutex */ -); - - -/* CK_C_INITIALIZE_ARGS provides the optional arguments to - * C_Initialize */ -typedef struct CK_C_INITIALIZE_ARGS { - CK_CREATEMUTEX CreateMutex; - CK_DESTROYMUTEX DestroyMutex; - CK_LOCKMUTEX LockMutex; - CK_UNLOCKMUTEX UnlockMutex; - CK_FLAGS flags; - /* The official PKCS #11 spec does not have a 'LibraryParameters' field, but - * a reserved field. NSS needs a way to pass instance-specific information - * to the library (like where to find its config files, etc). This - * information is usually provided by the installer and passed uninterpreted - * by NSS to the library, though NSS does know the specifics of the softoken - * version of this parameter. Most compliant PKCS#11 modules expect this - * parameter to be NULL, and will return CKR_ARGUMENTS_BAD from - * C_Initialize if Library parameters is supplied. */ - CK_CHAR_PTR *LibraryParameters; - /* This field is only present if the LibraryParameters is not NULL. It must - * be NULL in all cases */ - CK_VOID_PTR pReserved; -} CK_C_INITIALIZE_ARGS; - -/* flags: bit flags that provide capabilities of the slot - * Bit Flag Mask Meaning - */ -#define CKF_LIBRARY_CANT_CREATE_OS_THREADS 0x00000001 -#define CKF_OS_LOCKING_OK 0x00000002 - -typedef CK_C_INITIALIZE_ARGS CK_PTR CK_C_INITIALIZE_ARGS_PTR; - - -/* additional flags for parameters to functions */ - -/* CKF_DONT_BLOCK is for the function C_WaitForSlotEvent */ -#define CKF_DONT_BLOCK 1 - -/* CK_RSA_PKCS_OAEP_MGF_TYPE is new for v2.10. - * CK_RSA_PKCS_OAEP_MGF_TYPE is used to indicate the Message - * Generation Function (MGF) applied to a message block when - * formatting a message block for the PKCS #1 OAEP encryption - * scheme. */ -typedef CK_ULONG CK_RSA_PKCS_MGF_TYPE; - -typedef CK_RSA_PKCS_MGF_TYPE CK_PTR CK_RSA_PKCS_MGF_TYPE_PTR; - -/* The following MGFs are defined */ -/* CKG_MGF1_SHA256, CKG_MGF1_SHA384, and CKG_MGF1_SHA512 - * are new for v2.20 */ -#define CKG_MGF1_SHA1 0x00000001 -#define CKG_MGF1_SHA256 0x00000002 -#define CKG_MGF1_SHA384 0x00000003 -#define CKG_MGF1_SHA512 0x00000004 - -/* v2.20 amendment 3 */ -#define CKG_MGF1_SHA224 0x00000005 - -/* CK_RSA_PKCS_OAEP_SOURCE_TYPE is new for v2.10. - * CK_RSA_PKCS_OAEP_SOURCE_TYPE is used to indicate the source - * of the encoding parameter when formatting a message block - * for the PKCS #1 OAEP encryption scheme. */ -typedef CK_ULONG CK_RSA_PKCS_OAEP_SOURCE_TYPE; - -typedef CK_RSA_PKCS_OAEP_SOURCE_TYPE CK_PTR CK_RSA_PKCS_OAEP_SOURCE_TYPE_PTR; - -/* The following encoding parameter sources are defined */ -#define CKZ_DATA_SPECIFIED 0x00000001 - -/* CK_RSA_PKCS_OAEP_PARAMS is new for v2.10. - * CK_RSA_PKCS_OAEP_PARAMS provides the parameters to the - * CKM_RSA_PKCS_OAEP mechanism. */ -typedef struct CK_RSA_PKCS_OAEP_PARAMS { - CK_MECHANISM_TYPE hashAlg; - CK_RSA_PKCS_MGF_TYPE mgf; - CK_RSA_PKCS_OAEP_SOURCE_TYPE source; - CK_VOID_PTR pSourceData; - CK_ULONG ulSourceDataLen; -} CK_RSA_PKCS_OAEP_PARAMS; - -typedef CK_RSA_PKCS_OAEP_PARAMS CK_PTR CK_RSA_PKCS_OAEP_PARAMS_PTR; - -/* CK_RSA_PKCS_PSS_PARAMS is new for v2.11. - * CK_RSA_PKCS_PSS_PARAMS provides the parameters to the - * CKM_RSA_PKCS_PSS mechanism(s). */ -typedef struct CK_RSA_PKCS_PSS_PARAMS { - CK_MECHANISM_TYPE hashAlg; - CK_RSA_PKCS_MGF_TYPE mgf; - CK_ULONG sLen; -} CK_RSA_PKCS_PSS_PARAMS; - -typedef CK_RSA_PKCS_PSS_PARAMS CK_PTR CK_RSA_PKCS_PSS_PARAMS_PTR; - -/* CK_EC_KDF_TYPE is new for v2.11. */ -typedef CK_ULONG CK_EC_KDF_TYPE; - -/* The following EC Key Derivation Functions are defined */ -#define CKD_NULL 0x00000001 -#define CKD_SHA1_KDF 0x00000002 -#define CKD_SHA224_KDF 0x00000005 -#define CKD_SHA256_KDF 0x00000006 -#define CKD_SHA384_KDF 0x00000007 -#define CKD_SHA512_KDF 0x00000008 - -/* CK_ECDH1_DERIVE_PARAMS is new for v2.11. - * CK_ECDH1_DERIVE_PARAMS provides the parameters to the - * CKM_ECDH1_DERIVE and CKM_ECDH1_COFACTOR_DERIVE mechanisms, - * where each party contributes one key pair. - */ -typedef struct CK_ECDH1_DERIVE_PARAMS { - CK_EC_KDF_TYPE kdf; - CK_ULONG ulSharedDataLen; - CK_BYTE_PTR pSharedData; - CK_ULONG ulPublicDataLen; - CK_BYTE_PTR pPublicData; -} CK_ECDH1_DERIVE_PARAMS; - -typedef CK_ECDH1_DERIVE_PARAMS CK_PTR CK_ECDH1_DERIVE_PARAMS_PTR; - - -/* CK_ECDH2_DERIVE_PARAMS is new for v2.11. - * CK_ECDH2_DERIVE_PARAMS provides the parameters to the - * CKM_ECMQV_DERIVE mechanism, where each party contributes two key pairs. */ -typedef struct CK_ECDH2_DERIVE_PARAMS { - CK_EC_KDF_TYPE kdf; - CK_ULONG ulSharedDataLen; - CK_BYTE_PTR pSharedData; - CK_ULONG ulPublicDataLen; - CK_BYTE_PTR pPublicData; - CK_ULONG ulPrivateDataLen; - CK_OBJECT_HANDLE hPrivateData; - CK_ULONG ulPublicDataLen2; - CK_BYTE_PTR pPublicData2; -} CK_ECDH2_DERIVE_PARAMS; - -typedef CK_ECDH2_DERIVE_PARAMS CK_PTR CK_ECDH2_DERIVE_PARAMS_PTR; - -typedef struct CK_ECMQV_DERIVE_PARAMS { - CK_EC_KDF_TYPE kdf; - CK_ULONG ulSharedDataLen; - CK_BYTE_PTR pSharedData; - CK_ULONG ulPublicDataLen; - CK_BYTE_PTR pPublicData; - CK_ULONG ulPrivateDataLen; - CK_OBJECT_HANDLE hPrivateData; - CK_ULONG ulPublicDataLen2; - CK_BYTE_PTR pPublicData2; - CK_OBJECT_HANDLE publicKey; -} CK_ECMQV_DERIVE_PARAMS; - -typedef CK_ECMQV_DERIVE_PARAMS CK_PTR CK_ECMQV_DERIVE_PARAMS_PTR; - -/* Typedefs and defines for the CKM_X9_42_DH_KEY_PAIR_GEN and the - * CKM_X9_42_DH_PARAMETER_GEN mechanisms (new for PKCS #11 v2.11) */ -typedef CK_ULONG CK_X9_42_DH_KDF_TYPE; -typedef CK_X9_42_DH_KDF_TYPE CK_PTR CK_X9_42_DH_KDF_TYPE_PTR; - -/* The following X9.42 DH key derivation functions are defined - (besides CKD_NULL already defined : */ -#define CKD_SHA1_KDF_ASN1 0x00000003 -#define CKD_SHA1_KDF_CONCATENATE 0x00000004 - -/* CK_X9_42_DH1_DERIVE_PARAMS is new for v2.11. - * CK_X9_42_DH1_DERIVE_PARAMS provides the parameters to the - * CKM_X9_42_DH_DERIVE key derivation mechanism, where each party - * contributes one key pair */ -typedef struct CK_X9_42_DH1_DERIVE_PARAMS { - CK_X9_42_DH_KDF_TYPE kdf; - CK_ULONG ulOtherInfoLen; - CK_BYTE_PTR pOtherInfo; - CK_ULONG ulPublicDataLen; - CK_BYTE_PTR pPublicData; -} CK_X9_42_DH1_DERIVE_PARAMS; - -typedef struct CK_X9_42_DH1_DERIVE_PARAMS CK_PTR CK_X9_42_DH1_DERIVE_PARAMS_PTR; - -/* CK_X9_42_DH2_DERIVE_PARAMS is new for v2.11. - * CK_X9_42_DH2_DERIVE_PARAMS provides the parameters to the - * CKM_X9_42_DH_HYBRID_DERIVE and CKM_X9_42_MQV_DERIVE key derivation - * mechanisms, where each party contributes two key pairs */ -typedef struct CK_X9_42_DH2_DERIVE_PARAMS { - CK_X9_42_DH_KDF_TYPE kdf; - CK_ULONG ulOtherInfoLen; - CK_BYTE_PTR pOtherInfo; - CK_ULONG ulPublicDataLen; - CK_BYTE_PTR pPublicData; - CK_ULONG ulPrivateDataLen; - CK_OBJECT_HANDLE hPrivateData; - CK_ULONG ulPublicDataLen2; - CK_BYTE_PTR pPublicData2; -} CK_X9_42_DH2_DERIVE_PARAMS; - -typedef CK_X9_42_DH2_DERIVE_PARAMS CK_PTR CK_X9_42_DH2_DERIVE_PARAMS_PTR; - -typedef struct CK_X9_42_MQV_DERIVE_PARAMS { - CK_X9_42_DH_KDF_TYPE kdf; - CK_ULONG ulOtherInfoLen; - CK_BYTE_PTR pOtherInfo; - CK_ULONG ulPublicDataLen; - CK_BYTE_PTR pPublicData; - CK_ULONG ulPrivateDataLen; - CK_OBJECT_HANDLE hPrivateData; - CK_ULONG ulPublicDataLen2; - CK_BYTE_PTR pPublicData2; - CK_OBJECT_HANDLE publicKey; -} CK_X9_42_MQV_DERIVE_PARAMS; - -typedef CK_X9_42_MQV_DERIVE_PARAMS CK_PTR CK_X9_42_MQV_DERIVE_PARAMS_PTR; - -/* CK_KEA_DERIVE_PARAMS provides the parameters to the - * CKM_KEA_DERIVE mechanism */ -/* CK_KEA_DERIVE_PARAMS is new for v2.0 */ -typedef struct CK_KEA_DERIVE_PARAMS { - CK_BBOOL isSender; - CK_ULONG ulRandomLen; - CK_BYTE_PTR pRandomA; - CK_BYTE_PTR pRandomB; - CK_ULONG ulPublicDataLen; - CK_BYTE_PTR pPublicData; -} CK_KEA_DERIVE_PARAMS; - -typedef CK_KEA_DERIVE_PARAMS CK_PTR CK_KEA_DERIVE_PARAMS_PTR; - - -/* CK_RC2_PARAMS provides the parameters to the CKM_RC2_ECB and - * CKM_RC2_MAC mechanisms. An instance of CK_RC2_PARAMS just - * holds the effective keysize */ -typedef CK_ULONG CK_RC2_PARAMS; - -typedef CK_RC2_PARAMS CK_PTR CK_RC2_PARAMS_PTR; - - -/* CK_RC2_CBC_PARAMS provides the parameters to the CKM_RC2_CBC - * mechanism */ -typedef struct CK_RC2_CBC_PARAMS { - /* ulEffectiveBits was changed from CK_USHORT to CK_ULONG for - * v2.0 */ - CK_ULONG ulEffectiveBits; /* effective bits (1-1024) */ - - CK_BYTE iv[8]; /* IV for CBC mode */ -} CK_RC2_CBC_PARAMS; - -typedef CK_RC2_CBC_PARAMS CK_PTR CK_RC2_CBC_PARAMS_PTR; - - -/* CK_RC2_MAC_GENERAL_PARAMS provides the parameters for the - * CKM_RC2_MAC_GENERAL mechanism */ -/* CK_RC2_MAC_GENERAL_PARAMS is new for v2.0 */ -typedef struct CK_RC2_MAC_GENERAL_PARAMS { - CK_ULONG ulEffectiveBits; /* effective bits (1-1024) */ - CK_ULONG ulMacLength; /* Length of MAC in bytes */ -} CK_RC2_MAC_GENERAL_PARAMS; - -typedef CK_RC2_MAC_GENERAL_PARAMS CK_PTR \ - CK_RC2_MAC_GENERAL_PARAMS_PTR; - - -/* CK_RC5_PARAMS provides the parameters to the CKM_RC5_ECB and - * CKM_RC5_MAC mechanisms */ -/* CK_RC5_PARAMS is new for v2.0 */ -typedef struct CK_RC5_PARAMS { - CK_ULONG ulWordsize; /* wordsize in bits */ - CK_ULONG ulRounds; /* number of rounds */ -} CK_RC5_PARAMS; - -typedef CK_RC5_PARAMS CK_PTR CK_RC5_PARAMS_PTR; - - -/* CK_RC5_CBC_PARAMS provides the parameters to the CKM_RC5_CBC - * mechanism */ -/* CK_RC5_CBC_PARAMS is new for v2.0 */ -typedef struct CK_RC5_CBC_PARAMS { - CK_ULONG ulWordsize; /* wordsize in bits */ - CK_ULONG ulRounds; /* number of rounds */ - CK_BYTE_PTR pIv; /* pointer to IV */ - CK_ULONG ulIvLen; /* length of IV in bytes */ -} CK_RC5_CBC_PARAMS; - -typedef CK_RC5_CBC_PARAMS CK_PTR CK_RC5_CBC_PARAMS_PTR; - - -/* CK_RC5_MAC_GENERAL_PARAMS provides the parameters for the - * CKM_RC5_MAC_GENERAL mechanism */ -/* CK_RC5_MAC_GENERAL_PARAMS is new for v2.0 */ -typedef struct CK_RC5_MAC_GENERAL_PARAMS { - CK_ULONG ulWordsize; /* wordsize in bits */ - CK_ULONG ulRounds; /* number of rounds */ - CK_ULONG ulMacLength; /* Length of MAC in bytes */ -} CK_RC5_MAC_GENERAL_PARAMS; - -typedef CK_RC5_MAC_GENERAL_PARAMS CK_PTR \ - CK_RC5_MAC_GENERAL_PARAMS_PTR; - - -/* CK_MAC_GENERAL_PARAMS provides the parameters to most block - * ciphers' MAC_GENERAL mechanisms. Its value is the length of - * the MAC */ -/* CK_MAC_GENERAL_PARAMS is new for v2.0 */ -typedef CK_ULONG CK_MAC_GENERAL_PARAMS; - -typedef CK_MAC_GENERAL_PARAMS CK_PTR CK_MAC_GENERAL_PARAMS_PTR; - -/* CK_DES/AES_ECB/CBC_ENCRYPT_DATA_PARAMS are new for v2.20 */ -typedef struct CK_DES_CBC_ENCRYPT_DATA_PARAMS { - CK_BYTE iv[8]; - CK_BYTE_PTR pData; - CK_ULONG length; -} CK_DES_CBC_ENCRYPT_DATA_PARAMS; - -typedef CK_DES_CBC_ENCRYPT_DATA_PARAMS CK_PTR CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR; - -typedef struct CK_AES_CBC_ENCRYPT_DATA_PARAMS { - CK_BYTE iv[16]; - CK_BYTE_PTR pData; - CK_ULONG length; -} CK_AES_CBC_ENCRYPT_DATA_PARAMS; - -typedef CK_AES_CBC_ENCRYPT_DATA_PARAMS CK_PTR CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR; - -/* CK_AES_CTR_PARAMS is new for PKCS #11 v2.20 amendment 3 */ -typedef struct CK_AES_CTR_PARAMS { - CK_ULONG ulCounterBits; - CK_BYTE cb[16]; -} CK_AES_CTR_PARAMS; - -typedef CK_AES_CTR_PARAMS CK_PTR CK_AES_CTR_PARAMS_PTR; - -/* CK_GCM_PARAMS is new for version 2.30 */ -typedef struct CK_GCM_PARAMS { - CK_BYTE_PTR pIv; - CK_ULONG ulIvLen; - CK_BYTE_PTR pAAD; - CK_ULONG ulAADLen; - CK_ULONG ulTagBits; -} CK_GCM_PARAMS; - -typedef CK_GCM_PARAMS CK_PTR CK_GCM_PARAMS_PTR; - -/* CK_CCM_PARAMS is new for version 2.30 */ -typedef struct CK_CCM_PARAMS { - CK_ULONG ulDataLen; - CK_BYTE_PTR pNonce; - CK_ULONG ulNonceLen; - CK_BYTE_PTR pAAD; - CK_ULONG ulAADLen; - CK_ULONG ulMACLen; -} CK_CCM_PARAMS; - -typedef CK_CCM_PARAMS CK_PTR CK_CCM_PARAMS_PTR; - -/* CK_SKIPJACK_PRIVATE_WRAP_PARAMS provides the parameters to the - * CKM_SKIPJACK_PRIVATE_WRAP mechanism */ -/* CK_SKIPJACK_PRIVATE_WRAP_PARAMS is new for v2.0 */ -typedef struct CK_SKIPJACK_PRIVATE_WRAP_PARAMS { - CK_ULONG ulPasswordLen; - CK_BYTE_PTR pPassword; - CK_ULONG ulPublicDataLen; - CK_BYTE_PTR pPublicData; - CK_ULONG ulPAndGLen; - CK_ULONG ulQLen; - CK_ULONG ulRandomLen; - CK_BYTE_PTR pRandomA; - CK_BYTE_PTR pPrimeP; - CK_BYTE_PTR pBaseG; - CK_BYTE_PTR pSubprimeQ; -} CK_SKIPJACK_PRIVATE_WRAP_PARAMS; - -typedef CK_SKIPJACK_PRIVATE_WRAP_PARAMS CK_PTR \ - CK_SKIPJACK_PRIVATE_WRAP_PTR; - - -/* CK_SKIPJACK_RELAYX_PARAMS provides the parameters to the - * CKM_SKIPJACK_RELAYX mechanism */ -/* CK_SKIPJACK_RELAYX_PARAMS is new for v2.0 */ -typedef struct CK_SKIPJACK_RELAYX_PARAMS { - CK_ULONG ulOldWrappedXLen; - CK_BYTE_PTR pOldWrappedX; - CK_ULONG ulOldPasswordLen; - CK_BYTE_PTR pOldPassword; - CK_ULONG ulOldPublicDataLen; - CK_BYTE_PTR pOldPublicData; - CK_ULONG ulOldRandomLen; - CK_BYTE_PTR pOldRandomA; - CK_ULONG ulNewPasswordLen; - CK_BYTE_PTR pNewPassword; - CK_ULONG ulNewPublicDataLen; - CK_BYTE_PTR pNewPublicData; - CK_ULONG ulNewRandomLen; - CK_BYTE_PTR pNewRandomA; -} CK_SKIPJACK_RELAYX_PARAMS; - -typedef CK_SKIPJACK_RELAYX_PARAMS CK_PTR \ - CK_SKIPJACK_RELAYX_PARAMS_PTR; - - -typedef struct CK_PBE_PARAMS { - CK_BYTE_PTR pInitVector; - CK_UTF8CHAR_PTR pPassword; - CK_ULONG ulPasswordLen; - CK_BYTE_PTR pSalt; - CK_ULONG ulSaltLen; - CK_ULONG ulIteration; -} CK_PBE_PARAMS; - -typedef CK_PBE_PARAMS CK_PTR CK_PBE_PARAMS_PTR; - - -/* CK_KEY_WRAP_SET_OAEP_PARAMS provides the parameters to the - * CKM_KEY_WRAP_SET_OAEP mechanism */ -/* CK_KEY_WRAP_SET_OAEP_PARAMS is new for v2.0 */ -typedef struct CK_KEY_WRAP_SET_OAEP_PARAMS { - CK_BYTE bBC; /* block contents byte */ - CK_BYTE_PTR pX; /* extra data */ - CK_ULONG ulXLen; /* length of extra data in bytes */ -} CK_KEY_WRAP_SET_OAEP_PARAMS; - -typedef CK_KEY_WRAP_SET_OAEP_PARAMS CK_PTR \ - CK_KEY_WRAP_SET_OAEP_PARAMS_PTR; - - -typedef struct CK_SSL3_RANDOM_DATA { - CK_BYTE_PTR pClientRandom; - CK_ULONG ulClientRandomLen; - CK_BYTE_PTR pServerRandom; - CK_ULONG ulServerRandomLen; -} CK_SSL3_RANDOM_DATA; - - -typedef struct CK_SSL3_MASTER_KEY_DERIVE_PARAMS { - CK_SSL3_RANDOM_DATA RandomInfo; - CK_VERSION_PTR pVersion; -} CK_SSL3_MASTER_KEY_DERIVE_PARAMS; - -typedef struct CK_SSL3_MASTER_KEY_DERIVE_PARAMS CK_PTR \ - CK_SSL3_MASTER_KEY_DERIVE_PARAMS_PTR; - - -typedef struct CK_SSL3_KEY_MAT_OUT { - CK_OBJECT_HANDLE hClientMacSecret; - CK_OBJECT_HANDLE hServerMacSecret; - CK_OBJECT_HANDLE hClientKey; - CK_OBJECT_HANDLE hServerKey; - CK_BYTE_PTR pIVClient; - CK_BYTE_PTR pIVServer; -} CK_SSL3_KEY_MAT_OUT; - -typedef CK_SSL3_KEY_MAT_OUT CK_PTR CK_SSL3_KEY_MAT_OUT_PTR; - - -typedef struct CK_SSL3_KEY_MAT_PARAMS { - CK_ULONG ulMacSizeInBits; - CK_ULONG ulKeySizeInBits; - CK_ULONG ulIVSizeInBits; - CK_BBOOL bIsExport; - CK_SSL3_RANDOM_DATA RandomInfo; - CK_SSL3_KEY_MAT_OUT_PTR pReturnedKeyMaterial; -} CK_SSL3_KEY_MAT_PARAMS; - -typedef CK_SSL3_KEY_MAT_PARAMS CK_PTR CK_SSL3_KEY_MAT_PARAMS_PTR; - -/* CK_TLS_PRF_PARAMS is new for version 2.20 */ -typedef struct CK_TLS_PRF_PARAMS { - CK_BYTE_PTR pSeed; - CK_ULONG ulSeedLen; - CK_BYTE_PTR pLabel; - CK_ULONG ulLabelLen; - CK_BYTE_PTR pOutput; - CK_ULONG_PTR pulOutputLen; -} CK_TLS_PRF_PARAMS; - -typedef CK_TLS_PRF_PARAMS CK_PTR CK_TLS_PRF_PARAMS_PTR; - -/* WTLS is new for version 2.20 */ -typedef struct CK_WTLS_RANDOM_DATA { - CK_BYTE_PTR pClientRandom; - CK_ULONG ulClientRandomLen; - CK_BYTE_PTR pServerRandom; - CK_ULONG ulServerRandomLen; -} CK_WTLS_RANDOM_DATA; - -typedef CK_WTLS_RANDOM_DATA CK_PTR CK_WTLS_RANDOM_DATA_PTR; - -typedef struct CK_WTLS_MASTER_KEY_DERIVE_PARAMS { - CK_MECHANISM_TYPE DigestMechanism; - CK_WTLS_RANDOM_DATA RandomInfo; - CK_BYTE_PTR pVersion; -} CK_WTLS_MASTER_KEY_DERIVE_PARAMS; - -typedef CK_WTLS_MASTER_KEY_DERIVE_PARAMS CK_PTR \ - CK_WTLS_MASTER_KEY_DERIVE_PARAMS_PTR; - -typedef struct CK_WTLS_PRF_PARAMS { - CK_MECHANISM_TYPE DigestMechanism; - CK_BYTE_PTR pSeed; - CK_ULONG ulSeedLen; - CK_BYTE_PTR pLabel; - CK_ULONG ulLabelLen; - CK_BYTE_PTR pOutput; - CK_ULONG_PTR pulOutputLen; -} CK_WTLS_PRF_PARAMS; - -typedef CK_WTLS_PRF_PARAMS CK_PTR CK_WTLS_PRF_PARAMS_PTR; - -typedef struct CK_WTLS_KEY_MAT_OUT { - CK_OBJECT_HANDLE hMacSecret; - CK_OBJECT_HANDLE hKey; - CK_BYTE_PTR pIV; -} CK_WTLS_KEY_MAT_OUT; - -typedef CK_WTLS_KEY_MAT_OUT CK_PTR CK_WTLS_KEY_MAT_OUT_PTR; - -typedef struct CK_WTLS_KEY_MAT_PARAMS { - CK_MECHANISM_TYPE DigestMechanism; - CK_ULONG ulMacSizeInBits; - CK_ULONG ulKeySizeInBits; - CK_ULONG ulIVSizeInBits; - CK_ULONG ulSequenceNumber; - CK_BBOOL bIsExport; - CK_WTLS_RANDOM_DATA RandomInfo; - CK_WTLS_KEY_MAT_OUT_PTR pReturnedKeyMaterial; -} CK_WTLS_KEY_MAT_PARAMS; - -typedef CK_WTLS_KEY_MAT_PARAMS CK_PTR CK_WTLS_KEY_MAT_PARAMS_PTR; - -/* CMS is new for version 2.20 */ -typedef struct CK_CMS_SIG_PARAMS { - CK_OBJECT_HANDLE certificateHandle; - CK_MECHANISM_PTR pSigningMechanism; - CK_MECHANISM_PTR pDigestMechanism; - CK_UTF8CHAR_PTR pContentType; - CK_BYTE_PTR pRequestedAttributes; - CK_ULONG ulRequestedAttributesLen; - CK_BYTE_PTR pRequiredAttributes; - CK_ULONG ulRequiredAttributesLen; -} CK_CMS_SIG_PARAMS; - -typedef CK_CMS_SIG_PARAMS CK_PTR CK_CMS_SIG_PARAMS_PTR; - -typedef struct CK_KEY_DERIVATION_STRING_DATA { - CK_BYTE_PTR pData; - CK_ULONG ulLen; -} CK_KEY_DERIVATION_STRING_DATA; - -typedef CK_KEY_DERIVATION_STRING_DATA CK_PTR \ - CK_KEY_DERIVATION_STRING_DATA_PTR; - - -/* The CK_EXTRACT_PARAMS is used for the - * CKM_EXTRACT_KEY_FROM_KEY mechanism. It specifies which bit - * of the base key should be used as the first bit of the - * derived key */ -/* CK_EXTRACT_PARAMS is new for v2.0 */ -typedef CK_ULONG CK_EXTRACT_PARAMS; - -typedef CK_EXTRACT_PARAMS CK_PTR CK_EXTRACT_PARAMS_PTR; - -/* CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE is new for v2.10. - * CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE is used to - * indicate the Pseudo-Random Function (PRF) used to generate - * key bits using PKCS #5 PBKDF2. */ -typedef CK_ULONG CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE; - -typedef CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE CK_PTR CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE_PTR; - -/* The following PRFs are defined in PKCS #5 v2.0. */ -#define CKP_PKCS5_PBKD2_HMAC_SHA1 0x00000001 - - -/* CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE is new for v2.10. - * CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE is used to indicate the - * source of the salt value when deriving a key using PKCS #5 - * PBKDF2. */ -typedef CK_ULONG CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE; - -typedef CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE CK_PTR CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE_PTR; - -/* The following salt value sources are defined in PKCS #5 v2.0. */ -#define CKZ_SALT_SPECIFIED 0x00000001 - -/* CK_PKCS5_PBKD2_PARAMS is new for v2.10. - * CK_PKCS5_PBKD2_PARAMS is a structure that provides the - * parameters to the CKM_PKCS5_PBKD2 mechanism. */ -typedef struct CK_PKCS5_PBKD2_PARAMS { - CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE saltSource; - CK_VOID_PTR pSaltSourceData; - CK_ULONG ulSaltSourceDataLen; - CK_ULONG iterations; - CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE prf; - CK_VOID_PTR pPrfData; - CK_ULONG ulPrfDataLen; - CK_UTF8CHAR_PTR pPassword; - CK_ULONG_PTR ulPasswordLen; -} CK_PKCS5_PBKD2_PARAMS; - -typedef CK_PKCS5_PBKD2_PARAMS CK_PTR CK_PKCS5_PBKD2_PARAMS_PTR; - -/* NSS Specific defines */ - -/* defines that have been deprecated in 2.20, but maintained in our - * header file for backward compatibility */ -#define CKO_KG_PARAMETERS CKO_DOMAIN_PARAMETERS -#define CKF_EC_FP CKF_EC_F_P -/* new in v2.11 deprecated by 2.20 */ -#define CKR_KEY_PARAMS_INVALID 0x0000006B - -/* stuff that for historic reasons is in this header file but should have - * been in pkcs11n.h */ -#define CKK_INVALID_KEY_TYPE 0xffffffff - -#include "pkcs11n.h" - -/* undo packing */ -#include "pkcs11u.h" - -#endif diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/pkcs11u.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/pkcs11u.h deleted file mode 100755 index f670094..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/pkcs11u.h +++ /dev/null @@ -1,20 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/* - * Copyright (C) 1994-1999 RSA Security Inc. Licence to copy this document - * is granted provided that it is identified as "RSA Security Inc. Public-Key - * Cryptography Standards (PKCS)" in all material mentioning or referencing - * this document. - */ -/* - * reset any packing set by pkcs11p.h - */ - -#if defined (_WIN32) -#ifdef _MSC_VER -#pragma warning(disable:4103) -#endif -#pragma pack(pop, cryptoki) -#endif - diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/portreg.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/portreg.h deleted file mode 100755 index 811f045..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/portreg.h +++ /dev/null @@ -1,83 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * shexp.h: Defines and prototypes for shell exp. match routines - * - * This routine will match a string with a shell expression. The expressions - * accepted are based loosely on the expressions accepted by zsh. - * - * o * matches anything - * o ? matches one character - * o \ will escape a special character - * o $ matches the end of the string - * Bracketed expressions: - * o [abc] matches one occurence of a, b, or c. - * o [^abc] matches any character except a, b, or c. - * To be matched between [ and ], these characters must be escaped: \ ] - * No other characters need be escaped between brackets. - * Unnecessary escaping is permitted. - * o [a-z] matches any character between a and z, inclusive. - * The two range-definition characters must be alphanumeric ASCII. - * If one is upper case and the other is lower case, then the ASCII - * non-alphanumeric characters between Z and a will also be in range. - * o [^a-z] matches any character except those between a and z, inclusive. - * These forms cannot be combined, e.g [a-gp-z] does not work. - * o Exclusions: - * As a top level, outter-most expression only, the expression - * foo~bar will match the expression foo, provided it does not also - * match the expression bar. Either expression or both may be a union. - * Except between brackets, any unescaped ~ is an exclusion. - * At most one exclusion is permitted. - * Exclusions cannot be nested (contain other exclusions). - * example: *~abc will match any string except abc - * o Unions: - * (foo|bar) will match either the expression foo, or the expression bar. - * At least one '|' separator is required. More are permitted. - * Expressions inside unions may not include unions or exclusions. - * Inside a union, to be matched and not treated as a special character, - * these characters must be escaped: \ ( | ) [ ~ except when they occur - * inside a bracketed expression, where only \ and ] require escaping. - * - * The public interface to these routines is documented below. - * - */ - -#ifndef SHEXP_H -#define SHEXP_H - -#include "utilrename.h" -/* - * Requires that the macro MALLOC be set to a "safe" malloc that will - * exit if no memory is available. - */ - - -/* --------------------------- Public routines ---------------------------- */ - - -/* - * shexp_valid takes a shell expression exp as input. It returns: - * - * NON_SXP if exp is a standard string - * INVALID_SXP if exp is a shell expression, but invalid - * VALID_SXP if exp is a valid shell expression - */ - -#define NON_SXP -1 -#define INVALID_SXP -2 -#define VALID_SXP 1 - -SEC_BEGIN_PROTOS - -extern int PORT_RegExpValid(const char *exp); - -extern int PORT_RegExpSearch(const char *str, const char *exp); - -/* same as above but uses case insensitive search */ -extern int PORT_RegExpCaseSearch(const char *str, const char *exp); - -SEC_END_PROTOS - -#endif diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secasn1.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secasn1.h deleted file mode 100755 index 3232277..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secasn1.h +++ /dev/null @@ -1,292 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * Support for encoding/decoding of ASN.1 using BER/DER (Basic/Distinguished - * Encoding Rules). The routines are found in and used extensively by the - * security library, but exported for other use. - */ - -#ifndef _SECASN1_H_ -#define _SECASN1_H_ - -#include "utilrename.h" -#include "plarena.h" - -#include "seccomon.h" -#include "secasn1t.h" - - -/************************************************************************/ -SEC_BEGIN_PROTOS - -/* - * XXX These function prototypes need full, explanatory comments. - */ - -/* -** Decoding. -*/ - -extern SEC_ASN1DecoderContext *SEC_ASN1DecoderStart(PLArenaPool *pool, - void *dest, - const SEC_ASN1Template *t); - -/* XXX char or unsigned char? */ -extern SECStatus SEC_ASN1DecoderUpdate(SEC_ASN1DecoderContext *cx, - const char *buf, - unsigned long len); - -extern SECStatus SEC_ASN1DecoderFinish(SEC_ASN1DecoderContext *cx); - -/* Higher level code detected an error, abort the rest of the processing */ -extern void SEC_ASN1DecoderAbort(SEC_ASN1DecoderContext *cx, int error); - -extern void SEC_ASN1DecoderSetFilterProc(SEC_ASN1DecoderContext *cx, - SEC_ASN1WriteProc fn, - void *arg, PRBool no_store); - -extern void SEC_ASN1DecoderClearFilterProc(SEC_ASN1DecoderContext *cx); - -extern void SEC_ASN1DecoderSetNotifyProc(SEC_ASN1DecoderContext *cx, - SEC_ASN1NotifyProc fn, - void *arg); - -extern void SEC_ASN1DecoderClearNotifyProc(SEC_ASN1DecoderContext *cx); - -extern SECStatus SEC_ASN1Decode(PLArenaPool *pool, void *dest, - const SEC_ASN1Template *t, - const char *buf, long len); - -/* Both classic ASN.1 and QuickDER have a feature that removes leading zeroes - out of SEC_ASN1_INTEGER if the caller sets siUnsignedInteger in the type - field of the target SECItem prior to calling the decoder. Otherwise, the - type field is ignored and untouched. For SECItem that are dynamically - allocated (from POINTER, SET OF, SEQUENCE OF) the decoder sets the type - field to siBuffer. */ - -extern SECStatus SEC_ASN1DecodeItem(PLArenaPool *pool, void *dest, - const SEC_ASN1Template *t, - const SECItem *src); - -extern SECStatus SEC_QuickDERDecodeItem(PLArenaPool* arena, void* dest, - const SEC_ASN1Template* templateEntry, - const SECItem* src); - -/* -** Encoding. -*/ - -extern SEC_ASN1EncoderContext *SEC_ASN1EncoderStart(const void *src, - const SEC_ASN1Template *t, - SEC_ASN1WriteProc fn, - void *output_arg); - -/* XXX char or unsigned char? */ -extern SECStatus SEC_ASN1EncoderUpdate(SEC_ASN1EncoderContext *cx, - const char *buf, - unsigned long len); - -extern void SEC_ASN1EncoderFinish(SEC_ASN1EncoderContext *cx); - -/* Higher level code detected an error, abort the rest of the processing */ -extern void SEC_ASN1EncoderAbort(SEC_ASN1EncoderContext *cx, int error); - -extern void SEC_ASN1EncoderSetNotifyProc(SEC_ASN1EncoderContext *cx, - SEC_ASN1NotifyProc fn, - void *arg); - -extern void SEC_ASN1EncoderClearNotifyProc(SEC_ASN1EncoderContext *cx); - -extern void SEC_ASN1EncoderSetStreaming(SEC_ASN1EncoderContext *cx); - -extern void SEC_ASN1EncoderClearStreaming(SEC_ASN1EncoderContext *cx); - -extern void sec_ASN1EncoderSetDER(SEC_ASN1EncoderContext *cx); - -extern void sec_ASN1EncoderClearDER(SEC_ASN1EncoderContext *cx); - -extern void SEC_ASN1EncoderSetTakeFromBuf(SEC_ASN1EncoderContext *cx); - -extern void SEC_ASN1EncoderClearTakeFromBuf(SEC_ASN1EncoderContext *cx); - -extern SECStatus SEC_ASN1Encode(const void *src, const SEC_ASN1Template *t, - SEC_ASN1WriteProc output_proc, - void *output_arg); - -/* - * If both pool and dest are NULL, the caller should free the returned SECItem - * with a SECITEM_FreeItem(..., PR_TRUE) call. If pool is NULL but dest is - * not NULL, the caller should free the data buffer pointed to by dest with a - * SECITEM_FreeItem(dest, PR_FALSE) or PORT_Free(dest->data) call. - */ -extern SECItem * SEC_ASN1EncodeItem(PLArenaPool *pool, SECItem *dest, - const void *src, const SEC_ASN1Template *t); - -extern SECItem * SEC_ASN1EncodeInteger(PLArenaPool *pool, - SECItem *dest, long value); - -extern SECItem * SEC_ASN1EncodeUnsignedInteger(PLArenaPool *pool, - SECItem *dest, - unsigned long value); - -extern SECStatus SEC_ASN1DecodeInteger(SECItem *src, - unsigned long *value); - -/* -** Utilities. -*/ - -/* - * We have a length that needs to be encoded; how many bytes will the - * encoding take? - */ -extern int SEC_ASN1LengthLength (unsigned long len); - -/* encode the length and return the number of bytes we encoded. Buffer - * must be pre allocated */ -extern int SEC_ASN1EncodeLength(unsigned char *buf,int value); - -/* - * Find the appropriate subtemplate for the given template. - * This may involve calling a "chooser" function, or it may just - * be right there. In either case, it is expected to *have* a - * subtemplate; this is asserted in debug builds (in non-debug - * builds, NULL will be returned). - * - * "thing" is a pointer to the structure being encoded/decoded - * "encoding", when true, means that we are in the process of encoding - * (as opposed to in the process of decoding) - */ -extern const SEC_ASN1Template * -SEC_ASN1GetSubtemplate (const SEC_ASN1Template *inTemplate, void *thing, - PRBool encoding); - -/* whether the template is for a primitive type or a choice of - * primitive types - */ -extern PRBool SEC_ASN1IsTemplateSimple(const SEC_ASN1Template *theTemplate); - -/************************************************************************/ - -/* - * Generic Templates - * One for each of the simple types, plus a special one for ANY, plus: - * - a pointer to each one of those - * - a set of each one of those - * - a sequence of each one of those - * - * Note that these are alphabetical (case insensitive); please add new - * ones in the appropriate place. - */ - -extern const SEC_ASN1Template SEC_AnyTemplate[]; -extern const SEC_ASN1Template SEC_BitStringTemplate[]; -extern const SEC_ASN1Template SEC_BMPStringTemplate[]; -extern const SEC_ASN1Template SEC_BooleanTemplate[]; -extern const SEC_ASN1Template SEC_EnumeratedTemplate[]; -extern const SEC_ASN1Template SEC_GeneralizedTimeTemplate[]; -extern const SEC_ASN1Template SEC_IA5StringTemplate[]; -extern const SEC_ASN1Template SEC_IntegerTemplate[]; -extern const SEC_ASN1Template SEC_NullTemplate[]; -extern const SEC_ASN1Template SEC_ObjectIDTemplate[]; -extern const SEC_ASN1Template SEC_OctetStringTemplate[]; -extern const SEC_ASN1Template SEC_PrintableStringTemplate[]; -extern const SEC_ASN1Template SEC_T61StringTemplate[]; -extern const SEC_ASN1Template SEC_UniversalStringTemplate[]; -extern const SEC_ASN1Template SEC_UTCTimeTemplate[]; -extern const SEC_ASN1Template SEC_UTF8StringTemplate[]; -extern const SEC_ASN1Template SEC_VisibleStringTemplate[]; - -extern const SEC_ASN1Template SEC_PointerToAnyTemplate[]; -extern const SEC_ASN1Template SEC_PointerToBitStringTemplate[]; -extern const SEC_ASN1Template SEC_PointerToBMPStringTemplate[]; -extern const SEC_ASN1Template SEC_PointerToBooleanTemplate[]; -extern const SEC_ASN1Template SEC_PointerToEnumeratedTemplate[]; -extern const SEC_ASN1Template SEC_PointerToGeneralizedTimeTemplate[]; -extern const SEC_ASN1Template SEC_PointerToIA5StringTemplate[]; -extern const SEC_ASN1Template SEC_PointerToIntegerTemplate[]; -extern const SEC_ASN1Template SEC_PointerToNullTemplate[]; -extern const SEC_ASN1Template SEC_PointerToObjectIDTemplate[]; -extern const SEC_ASN1Template SEC_PointerToOctetStringTemplate[]; -extern const SEC_ASN1Template SEC_PointerToPrintableStringTemplate[]; -extern const SEC_ASN1Template SEC_PointerToT61StringTemplate[]; -extern const SEC_ASN1Template SEC_PointerToUniversalStringTemplate[]; -extern const SEC_ASN1Template SEC_PointerToUTCTimeTemplate[]; -extern const SEC_ASN1Template SEC_PointerToUTF8StringTemplate[]; -extern const SEC_ASN1Template SEC_PointerToVisibleStringTemplate[]; - -extern const SEC_ASN1Template SEC_SequenceOfAnyTemplate[]; -extern const SEC_ASN1Template SEC_SequenceOfBitStringTemplate[]; -extern const SEC_ASN1Template SEC_SequenceOfBMPStringTemplate[]; -extern const SEC_ASN1Template SEC_SequenceOfBooleanTemplate[]; -extern const SEC_ASN1Template SEC_SequenceOfEnumeratedTemplate[]; -extern const SEC_ASN1Template SEC_SequenceOfGeneralizedTimeTemplate[]; -extern const SEC_ASN1Template SEC_SequenceOfIA5StringTemplate[]; -extern const SEC_ASN1Template SEC_SequenceOfIntegerTemplate[]; -extern const SEC_ASN1Template SEC_SequenceOfNullTemplate[]; -extern const SEC_ASN1Template SEC_SequenceOfObjectIDTemplate[]; -extern const SEC_ASN1Template SEC_SequenceOfOctetStringTemplate[]; -extern const SEC_ASN1Template SEC_SequenceOfPrintableStringTemplate[]; -extern const SEC_ASN1Template SEC_SequenceOfT61StringTemplate[]; -extern const SEC_ASN1Template SEC_SequenceOfUniversalStringTemplate[]; -extern const SEC_ASN1Template SEC_SequenceOfUTCTimeTemplate[]; -extern const SEC_ASN1Template SEC_SequenceOfUTF8StringTemplate[]; -extern const SEC_ASN1Template SEC_SequenceOfVisibleStringTemplate[]; - -extern const SEC_ASN1Template SEC_SetOfAnyTemplate[]; -extern const SEC_ASN1Template SEC_SetOfBitStringTemplate[]; -extern const SEC_ASN1Template SEC_SetOfBMPStringTemplate[]; -extern const SEC_ASN1Template SEC_SetOfBooleanTemplate[]; -extern const SEC_ASN1Template SEC_SetOfEnumeratedTemplate[]; -extern const SEC_ASN1Template SEC_SetOfGeneralizedTimeTemplate[]; -extern const SEC_ASN1Template SEC_SetOfIA5StringTemplate[]; -extern const SEC_ASN1Template SEC_SetOfIntegerTemplate[]; -extern const SEC_ASN1Template SEC_SetOfNullTemplate[]; -extern const SEC_ASN1Template SEC_SetOfObjectIDTemplate[]; -extern const SEC_ASN1Template SEC_SetOfOctetStringTemplate[]; -extern const SEC_ASN1Template SEC_SetOfPrintableStringTemplate[]; -extern const SEC_ASN1Template SEC_SetOfT61StringTemplate[]; -extern const SEC_ASN1Template SEC_SetOfUniversalStringTemplate[]; -extern const SEC_ASN1Template SEC_SetOfUTCTimeTemplate[]; -extern const SEC_ASN1Template SEC_SetOfUTF8StringTemplate[]; -extern const SEC_ASN1Template SEC_SetOfVisibleStringTemplate[]; - -/* - * Template for skipping a subitem; this only makes sense when decoding. - */ -extern const SEC_ASN1Template SEC_SkipTemplate[]; - -/* These functions simply return the address of the above-declared templates. -** This is necessary for Windows DLLs. Sigh. -*/ -SEC_ASN1_CHOOSER_DECLARE(SEC_AnyTemplate) -SEC_ASN1_CHOOSER_DECLARE(SEC_BMPStringTemplate) -SEC_ASN1_CHOOSER_DECLARE(SEC_BooleanTemplate) -SEC_ASN1_CHOOSER_DECLARE(SEC_BitStringTemplate) -SEC_ASN1_CHOOSER_DECLARE(SEC_GeneralizedTimeTemplate) -SEC_ASN1_CHOOSER_DECLARE(SEC_IA5StringTemplate) -SEC_ASN1_CHOOSER_DECLARE(SEC_IntegerTemplate) -SEC_ASN1_CHOOSER_DECLARE(SEC_NullTemplate) -SEC_ASN1_CHOOSER_DECLARE(SEC_ObjectIDTemplate) -SEC_ASN1_CHOOSER_DECLARE(SEC_OctetStringTemplate) -SEC_ASN1_CHOOSER_DECLARE(SEC_UTCTimeTemplate) -SEC_ASN1_CHOOSER_DECLARE(SEC_UTF8StringTemplate) - -SEC_ASN1_CHOOSER_DECLARE(SEC_PointerToAnyTemplate) -SEC_ASN1_CHOOSER_DECLARE(SEC_PointerToOctetStringTemplate) - -SEC_ASN1_CHOOSER_DECLARE(SEC_SetOfAnyTemplate) - -SEC_ASN1_CHOOSER_DECLARE(SEC_EnumeratedTemplate) -SEC_ASN1_CHOOSER_DECLARE(SEC_PointerToEnumeratedTemplate) -SEC_ASN1_CHOOSER_DECLARE(SEC_SequenceOfAnyTemplate) -SEC_ASN1_CHOOSER_DECLARE(SEC_SequenceOfObjectIDTemplate) -SEC_ASN1_CHOOSER_DECLARE(SEC_SkipTemplate) -SEC_ASN1_CHOOSER_DECLARE(SEC_UniversalStringTemplate) -SEC_ASN1_CHOOSER_DECLARE(SEC_PrintableStringTemplate) -SEC_ASN1_CHOOSER_DECLARE(SEC_T61StringTemplate) -SEC_ASN1_CHOOSER_DECLARE(SEC_PointerToGeneralizedTimeTemplate) -SEC_END_PROTOS -#endif /* _SECASN1_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secasn1t.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secasn1t.h deleted file mode 100755 index 738eef8..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secasn1t.h +++ /dev/null @@ -1,268 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * Types for encoding/decoding of ASN.1 using BER/DER (Basic/Distinguished - * Encoding Rules). - */ - -#ifndef _SECASN1T_H_ -#define _SECASN1T_H_ - -#include "utilrename.h" - -/* -** An array of these structures defines a BER/DER encoding for an object. -** -** The array usually starts with a dummy entry whose kind is SEC_ASN1_SEQUENCE; -** such an array is terminated with an entry where kind == 0. (An array -** which consists of a single component does not require a second dummy -** entry -- the array is only searched as long as previous component(s) -** instruct it.) -*/ -typedef struct sec_ASN1Template_struct { - /* - ** Kind of item being decoded/encoded, including tags and modifiers. - */ - unsigned long kind; - - /* - ** The value is the offset from the base of the structure to the - ** field that holds the value being decoded/encoded. - */ - unsigned long offset; - - /* - ** When kind suggests it (SEC_ASN1_POINTER, SEC_ASN1_GROUP, SEC_ASN1_INLINE, - ** or a component that is *not* a SEC_ASN1_UNIVERSAL), this points to - ** a sub-template for nested encoding/decoding, - ** OR, iff SEC_ASN1_DYNAMIC is set, then this is a pointer to a pointer - ** to a function which will return the appropriate template when called - ** at runtime. NOTE! that explicit level of indirection, which is - ** necessary because ANSI does not allow you to store a function - ** pointer directly as a "void *" so we must store it separately and - ** dereference it to get at the function pointer itself. - */ - const void *sub; - - /* - ** In the first element of a template array, the value is the size - ** of the structure to allocate when this template is being referenced - ** by another template via SEC_ASN1_POINTER or SEC_ASN1_GROUP. - ** In all other cases, the value is ignored. - */ - unsigned int size; -} SEC_ASN1Template; - - -/* default size used for allocation of encoding/decoding stuff */ -/* XXX what is the best value here? */ -#define SEC_ASN1_DEFAULT_ARENA_SIZE (2048) - -/* -** BER/DER values for ASN.1 identifier octets. -*/ -#define SEC_ASN1_TAG_MASK 0xff - -/* - * BER/DER universal type tag numbers. - * The values are defined by the X.208 standard; do not change them! - * NOTE: if you add anything to this list, you must add code to secasn1d.c - * to accept the tag, and probably also to secasn1e.c to encode it. - * XXX It appears some have been added recently without being added to - * the code; so need to go through the list now and double-check them all. - * (Look especially at those added in revision 1.10.) - */ -#define SEC_ASN1_TAGNUM_MASK 0x1f -#define SEC_ASN1_BOOLEAN 0x01 -#define SEC_ASN1_INTEGER 0x02 -#define SEC_ASN1_BIT_STRING 0x03 -#define SEC_ASN1_OCTET_STRING 0x04 -#define SEC_ASN1_NULL 0x05 -#define SEC_ASN1_OBJECT_ID 0x06 -#define SEC_ASN1_OBJECT_DESCRIPTOR 0x07 -/* External type and instance-of type 0x08 */ -#define SEC_ASN1_REAL 0x09 -#define SEC_ASN1_ENUMERATED 0x0a -#define SEC_ASN1_EMBEDDED_PDV 0x0b -#define SEC_ASN1_UTF8_STRING 0x0c -/* 0x0d */ -/* 0x0e */ -/* 0x0f */ -#define SEC_ASN1_SEQUENCE 0x10 -#define SEC_ASN1_SET 0x11 -#define SEC_ASN1_NUMERIC_STRING 0x12 -#define SEC_ASN1_PRINTABLE_STRING 0x13 -#define SEC_ASN1_T61_STRING 0x14 -#define SEC_ASN1_VIDEOTEX_STRING 0x15 -#define SEC_ASN1_IA5_STRING 0x16 -#define SEC_ASN1_UTC_TIME 0x17 -#define SEC_ASN1_GENERALIZED_TIME 0x18 -#define SEC_ASN1_GRAPHIC_STRING 0x19 -#define SEC_ASN1_VISIBLE_STRING 0x1a -#define SEC_ASN1_GENERAL_STRING 0x1b -#define SEC_ASN1_UNIVERSAL_STRING 0x1c -/* 0x1d */ -#define SEC_ASN1_BMP_STRING 0x1e -#define SEC_ASN1_HIGH_TAG_NUMBER 0x1f -#define SEC_ASN1_TELETEX_STRING SEC_ASN1_T61_STRING - -/* -** Modifiers to type tags. These are also specified by a/the -** standard, and must not be changed. -*/ - -#define SEC_ASN1_METHOD_MASK 0x20 -#define SEC_ASN1_PRIMITIVE 0x00 -#define SEC_ASN1_CONSTRUCTED 0x20 - -#define SEC_ASN1_CLASS_MASK 0xc0 -#define SEC_ASN1_UNIVERSAL 0x00 -#define SEC_ASN1_APPLICATION 0x40 -#define SEC_ASN1_CONTEXT_SPECIFIC 0x80 -#define SEC_ASN1_PRIVATE 0xc0 - -/* -** Our additions, used for templates. -** These are not defined by any standard; the values are used internally only. -** Just be careful to keep them out of the low 8 bits. -** XXX finish comments -*/ -#define SEC_ASN1_OPTIONAL 0x00100 -#define SEC_ASN1_EXPLICIT 0x00200 -#define SEC_ASN1_ANY 0x00400 -#define SEC_ASN1_INLINE 0x00800 -#define SEC_ASN1_POINTER 0x01000 -#define SEC_ASN1_GROUP 0x02000 /* with SET or SEQUENCE means - * SET OF or SEQUENCE OF */ -#define SEC_ASN1_DYNAMIC 0x04000 /* subtemplate is found by calling - * a function at runtime */ -#define SEC_ASN1_SKIP 0x08000 /* skip a field; only for decoding */ -#define SEC_ASN1_INNER 0x10000 /* with ANY means capture the - * contents only (not the id, len, - * or eoc); only for decoding */ -#define SEC_ASN1_SAVE 0x20000 /* stash away the encoded bytes first; - * only for decoding */ -#define SEC_ASN1_MAY_STREAM 0x40000 /* field or one of its sub-fields may - * stream in and so should encode as - * indefinite-length when streaming - * has been indicated; only for - * encoding */ -#define SEC_ASN1_SKIP_REST 0x80000 /* skip all following fields; - only for decoding */ -#define SEC_ASN1_CHOICE 0x100000 /* pick one from a template */ -#define SEC_ASN1_NO_STREAM 0X200000 /* This entry will not stream - even if the sub-template says - streaming is possible. Helps - to solve ambiguities with potential - streaming entries that are - optional */ -#define SEC_ASN1_DEBUG_BREAK 0X400000 /* put this in your template and the - decoder will assert when it - processes it. Only for use with - SEC_QuickDERDecodeItem */ - - - -/* Shorthand/Aliases */ -#define SEC_ASN1_SEQUENCE_OF (SEC_ASN1_GROUP | SEC_ASN1_SEQUENCE) -#define SEC_ASN1_SET_OF (SEC_ASN1_GROUP | SEC_ASN1_SET) -#define SEC_ASN1_ANY_CONTENTS (SEC_ASN1_ANY | SEC_ASN1_INNER) - -/* Maximum depth of nested SEQUENCEs and SETs */ -#define SEC_ASN1D_MAX_DEPTH 32 - -/* -** Function used for SEC_ASN1_DYNAMIC. -** "arg" is a pointer to the structure being encoded/decoded -** "enc", when true, means that we are encoding (false means decoding) -*/ -typedef const SEC_ASN1Template * SEC_ASN1TemplateChooser(void *arg, PRBool enc); -typedef SEC_ASN1TemplateChooser * SEC_ASN1TemplateChooserPtr; - -#if defined(_WIN32) || defined(ANDROID) -#define SEC_ASN1_GET(x) NSS_Get_##x(NULL, PR_FALSE) -#define SEC_ASN1_SUB(x) &p_NSS_Get_##x -#define SEC_ASN1_XTRN SEC_ASN1_DYNAMIC -#define SEC_ASN1_MKSUB(x) \ -static const SEC_ASN1TemplateChooserPtr p_NSS_Get_##x = &NSS_Get_##x; -#else -#define SEC_ASN1_GET(x) x -#define SEC_ASN1_SUB(x) x -#define SEC_ASN1_XTRN 0 -#define SEC_ASN1_MKSUB(x) -#endif - -#define SEC_ASN1_CHOOSER_DECLARE(x) \ -extern const SEC_ASN1Template * NSS_Get_##x (void *arg, PRBool enc); - -#define SEC_ASN1_CHOOSER_IMPLEMENT(x) \ -const SEC_ASN1Template * NSS_Get_##x(void * arg, PRBool enc) \ -{ return x; } - -/* -** Opaque object used by the decoder to store state. -*/ -typedef struct sec_DecoderContext_struct SEC_ASN1DecoderContext; - -/* -** Opaque object used by the encoder to store state. -*/ -typedef struct sec_EncoderContext_struct SEC_ASN1EncoderContext; - -/* - * This is used to describe to a filter function the bytes that are - * being passed to it. This is only useful when the filter is an "outer" - * one, meaning it expects to get *all* of the bytes not just the - * contents octets. - */ -typedef enum { - SEC_ASN1_Identifier = 0, - SEC_ASN1_Length = 1, - SEC_ASN1_Contents = 2, - SEC_ASN1_EndOfContents = 3 -} SEC_ASN1EncodingPart; - -/* - * Type of the function pointer used either for decoding or encoding, - * when doing anything "funny" (e.g. manipulating the data stream) - */ -typedef void (* SEC_ASN1NotifyProc)(void *arg, PRBool before, - void *dest, int real_depth); - -/* - * Type of the function pointer used for grabbing encoded bytes. - * This can be used during either encoding or decoding, as follows... - * - * When decoding, this can be used to filter the encoded bytes as they - * are parsed. This is what you would do if you wanted to process the data - * along the way (like to decrypt it, or to perform a hash on it in order - * to do a signature check later). See SEC_ASN1DecoderSetFilterProc(). - * When processing only part of the encoded bytes is desired, you "watch" - * for the field(s) you are interested in with a "notify proc" (see - * SEC_ASN1DecoderSetNotifyProc()) and for even finer granularity (e.g. to - * ignore all by the contents bytes) you pay attention to the "data_kind" - * parameter. - * - * When encoding, this is the specification for the output function which - * will receive the bytes as they are encoded. The output function can - * perform any postprocessing necessary (like hashing (some of) the data - * to create a digest that gets included at the end) as well as shoving - * the data off wherever it needs to go. (In order to "tune" any processing, - * you can set a "notify proc" as described above in the decoding case.) - * - * The parameters: - * - "arg" is an opaque pointer that you provided at the same time you - * specified a function of this type - * - "data" is a buffer of length "len", containing the encoded bytes - * - "depth" is how deep in a nested encoding we are (it is not usually - * valuable, but can be useful sometimes so I included it) - * - "data_kind" tells you if these bytes are part of the ASN.1 encoded - * octets for identifier, length, contents, or end-of-contents - */ -typedef void (* SEC_ASN1WriteProc)(void *arg, - const char *data, unsigned long len, - int depth, SEC_ASN1EncodingPart data_kind); - -#endif /* _SECASN1T_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/seccomon.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/seccomon.h deleted file mode 100755 index 4414974..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/seccomon.h +++ /dev/null @@ -1,92 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * seccomon.h - common data structures for security libraries - * - * This file should have lowest-common-denominator datastructures - * for security libraries. It should not be dependent on any other - * headers, and should not require linking with any libraries. - */ - -#ifndef _SECCOMMON_H_ -#define _SECCOMMON_H_ - -#include "utilrename.h" -#include "prtypes.h" - - -#ifdef __cplusplus -# define SEC_BEGIN_PROTOS extern "C" { -# define SEC_END_PROTOS } -#else -# define SEC_BEGIN_PROTOS -# define SEC_END_PROTOS -#endif - -#include "secport.h" - -typedef enum { - siBuffer = 0, - siClearDataBuffer = 1, - siCipherDataBuffer = 2, - siDERCertBuffer = 3, - siEncodedCertBuffer = 4, - siDERNameBuffer = 5, - siEncodedNameBuffer = 6, - siAsciiNameString = 7, - siAsciiString = 8, - siDEROID = 9, - siUnsignedInteger = 10, - siUTCTime = 11, - siGeneralizedTime = 12, - siVisibleString = 13, - siUTF8String = 14, - siBMPString = 15 -} SECItemType; - -typedef struct SECItemStr SECItem; - -struct SECItemStr { - SECItemType type; - unsigned char *data; - unsigned int len; -}; - -typedef struct SECItemArrayStr SECItemArray; - -struct SECItemArrayStr { - SECItem *items; - unsigned int len; -}; - -/* -** A status code. Status's are used by procedures that return status -** values. Again the motivation is so that a compiler can generate -** warnings when return values are wrong. Correct testing of status codes: -** -** SECStatus rv; -** rv = some_function (some_argument); -** if (rv != SECSuccess) -** do_an_error_thing(); -** -*/ -typedef enum _SECStatus { - SECWouldBlock = -2, - SECFailure = -1, - SECSuccess = 0 -} SECStatus; - -/* -** A comparison code. Used for procedures that return comparision -** values. Again the motivation is so that a compiler can generate -** warnings when return values are wrong. -*/ -typedef enum _SECComparison { - SECLessThan = -1, - SECEqual = 0, - SECGreaterThan = 1 -} SECComparison; - -#endif /* _SECCOMMON_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secder.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secder.h deleted file mode 100755 index 0da1b34..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secder.h +++ /dev/null @@ -1,174 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef _SECDER_H_ -#define _SECDER_H_ - -#include "utilrename.h" - -/* - * secder.h - public data structures and prototypes for the DER encoding and - * decoding utilities library - */ - -#include - -#include "plarena.h" -#include "prlong.h" - -#include "seccomon.h" -#include "secdert.h" -#include "prtime.h" - -SEC_BEGIN_PROTOS - -/* -** Encode a data structure into DER. -** "dest" will be filled in (and memory allocated) to hold the der -** encoded structure in "src" -** "t" is a template structure which defines the shape of the -** stored data -** "src" is a pointer to the structure that will be encoded -*/ -extern SECStatus DER_Encode(PLArenaPool *arena, SECItem *dest, DERTemplate *t, - void *src); - -extern SECStatus DER_Lengths(SECItem *item, int *header_len_p, - PRUint32 *contents_len_p); - -/* -** Lower level der subroutine that stores the standard header into "to". -** The header is of variable length, based on encodingLen. -** The return value is the new value of "to" after skipping over the header. -** "to" is where the header will be stored -** "code" is the der code to write -** "encodingLen" is the number of bytes of data that will follow -** the header -*/ -extern unsigned char *DER_StoreHeader(unsigned char *to, unsigned int code, - PRUint32 encodingLen); - -/* -** Return the number of bytes it will take to hold a der encoded length. -*/ -extern int DER_LengthLength(PRUint32 len); - -/* -** Store a der encoded *signed* integer (whose value is "src") into "dst". -** XXX This should really be enhanced to take a long. -*/ -extern SECStatus DER_SetInteger(PLArenaPool *arena, SECItem *dst, PRInt32 src); - -/* -** Store a der encoded *unsigned* integer (whose value is "src") into "dst". -** XXX This should really be enhanced to take an unsigned long. -*/ -extern SECStatus DER_SetUInteger(PLArenaPool *arena, SECItem *dst, PRUint32 src); - -/* -** Decode a der encoded *signed* integer that is stored in "src". -** If "-1" is returned, then the caller should check the error in -** XP_GetError() to see if an overflow occurred (SEC_ERROR_BAD_DER). -*/ -extern long DER_GetInteger(const SECItem *src); - -/* -** Decode a der encoded *unsigned* integer that is stored in "src". -** If the ULONG_MAX is returned, then the caller should check the error -** in XP_GetError() to see if an overflow occurred (SEC_ERROR_BAD_DER). -*/ -extern unsigned long DER_GetUInteger(SECItem *src); - -/* -** Convert an NSPR time value to a der encoded time value. -** "result" is the der encoded time (memory is allocated) -** "time" is the NSPR time value (Since Jan 1st, 1970). -** time must be on or after January 1, 1950, and -** before January 1, 2050 -** The caller is responsible for freeing up the buffer which -** result->data points to upon a successful operation. -*/ -extern SECStatus DER_TimeToUTCTime(SECItem *result, PRTime time); -extern SECStatus DER_TimeToUTCTimeArena(PLArenaPool* arenaOpt, - SECItem *dst, PRTime gmttime); - - -/* -** Convert an ascii encoded time value (according to DER rules) into -** an NSPR time value. -** "result" the resulting NSPR time -** "string" the der notation ascii value to decode -*/ -extern SECStatus DER_AsciiToTime(PRTime *result, const char *string); - -/* -** Same as DER_AsciiToTime except takes an SECItem instead of a string -*/ -extern SECStatus DER_UTCTimeToTime(PRTime *result, const SECItem *time); - -/* -** Convert a DER encoded UTC time to an ascii time representation -** "utctime" is the DER encoded UTC time to be converted. The -** caller is responsible for deallocating the returned buffer. -*/ -extern char *DER_UTCTimeToAscii(SECItem *utcTime); - -/* -** Convert a DER encoded UTC time to an ascii time representation, but only -** include the day, not the time. -** "utctime" is the DER encoded UTC time to be converted. -** The caller is responsible for deallocating the returned buffer. -*/ -extern char *DER_UTCDayToAscii(SECItem *utctime); -/* same thing for DER encoded GeneralizedTime */ -extern char *DER_GeneralizedDayToAscii(SECItem *gentime); -/* same thing for either DER UTCTime or GeneralizedTime */ -extern char *DER_TimeChoiceDayToAscii(SECItem *timechoice); - -/* -** Convert a PRTime to a DER encoded Generalized time -** gmttime must be on or after January 1, year 1 and -** before January 1, 10000. -*/ -extern SECStatus DER_TimeToGeneralizedTime(SECItem *dst, PRTime gmttime); -extern SECStatus DER_TimeToGeneralizedTimeArena(PLArenaPool* arenaOpt, - SECItem *dst, PRTime gmttime); - -/* -** Convert a DER encoded Generalized time value into an NSPR time value. -** "dst" the resulting NSPR time -** "string" the der notation ascii value to decode -*/ -extern SECStatus DER_GeneralizedTimeToTime(PRTime *dst, const SECItem *time); - -/* -** Convert from a PRTime UTC time value to a formatted ascii value. The -** caller is responsible for deallocating the returned buffer. -*/ -extern char *CERT_UTCTime2FormattedAscii (PRTime utcTime, char *format); -#define CERT_GeneralizedTime2FormattedAscii CERT_UTCTime2FormattedAscii - -/* -** Convert from a PRTime Generalized time value to a formatted ascii value. The -** caller is responsible for deallocating the returned buffer. -*/ -extern char *CERT_GenTime2FormattedAscii (PRTime genTime, char *format); - -/* -** decode a SECItem containing either a SEC_ASN1_GENERALIZED_TIME -** or a SEC_ASN1_UTC_TIME -*/ - -extern SECStatus DER_DecodeTimeChoice(PRTime* output, const SECItem* input); - -/* encode a PRTime to an ASN.1 DER SECItem containing either a - SEC_ASN1_GENERALIZED_TIME or a SEC_ASN1_UTC_TIME */ - -extern SECStatus DER_EncodeTimeChoice(PLArenaPool* arena, SECItem* output, - PRTime input); - -SEC_END_PROTOS - -#endif /* _SECDER_H_ */ - diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secdert.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secdert.h deleted file mode 100755 index 92936e6..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secdert.h +++ /dev/null @@ -1,129 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef _SECDERT_H_ -#define _SECDERT_H_ -/* - * secdert.h - public data structures for the DER encoding and - * decoding utilities library - */ - -#include "utilrename.h" -#include "seccomon.h" - -typedef struct DERTemplateStr DERTemplate; - -/* -** An array of these structures defines an encoding for an object using DER. -** The array usually starts with a dummy entry whose kind is DER_SEQUENCE; -** such an array is terminated with an entry where kind == 0. (An array -** which consists of a single component does not require a second dummy -** entry -- the array is only searched as long as previous component(s) -** instruct it.) -*/ -struct DERTemplateStr { - /* - ** Kind of item being decoded/encoded, including tags and modifiers. - */ - unsigned long kind; - - /* - ** Offset from base of structure to field that holds the value - ** being decoded/encoded. - */ - unsigned int offset; - - /* - ** When kind suggests it (DER_POINTER, DER_INDEFINITE, DER_INLINE), - ** this points to a sub-template for nested encoding/decoding. - */ - DERTemplate *sub; - - /* - ** Argument value, dependent on "kind" and/or template placement - ** within an array of templates: - ** - In the first element of a template array, the value is the - ** size of the structure to allocate when this template is being - ** referenced by another template via DER_POINTER or DER_INDEFINITE. - ** - In a component of a DER_SET or DER_SEQUENCE which is *not* a - ** DER_UNIVERSAL type (that is, it has a class tag for either - ** DER_APPLICATION, DER_CONTEXT_SPECIFIC, or DER_PRIVATE), the - ** value is the underlying type of item being decoded/encoded. - */ - unsigned long arg; -}; - -/************************************************************************/ - -/* default chunksize for arenas used for DER stuff */ -#define DER_DEFAULT_CHUNKSIZE (2048) - -/* -** BER/DER values for ASN.1 identifier octets. -*/ -#define DER_TAG_MASK 0xff - -/* - * BER/DER universal type tag numbers. - * The values are defined by the X.208 standard; do not change them! - * NOTE: if you add anything to this list, you must add code to derdec.c - * to accept the tag, and probably also to derenc.c to encode it. - */ -#define DER_TAGNUM_MASK 0x1f -#define DER_BOOLEAN 0x01 -#define DER_INTEGER 0x02 -#define DER_BIT_STRING 0x03 -#define DER_OCTET_STRING 0x04 -#define DER_NULL 0x05 -#define DER_OBJECT_ID 0x06 -#define DER_SEQUENCE 0x10 -#define DER_SET 0x11 -#define DER_PRINTABLE_STRING 0x13 -#define DER_T61_STRING 0x14 -#define DER_IA5_STRING 0x16 -#define DER_UTC_TIME 0x17 -#define DER_VISIBLE_STRING 0x1a -#define DER_HIGH_TAG_NUMBER 0x1f - -/* -** Modifiers to type tags. These are also specified by a/the -** standard, and must not be changed. -*/ - -#define DER_METHOD_MASK 0x20 -#define DER_PRIMITIVE 0x00 -#define DER_CONSTRUCTED 0x20 - -#define DER_CLASS_MASK 0xc0 -#define DER_UNIVERSAL 0x00 -#define DER_APPLICATION 0x40 -#define DER_CONTEXT_SPECIFIC 0x80 -#define DER_PRIVATE 0xc0 - -/* -** Our additions, used for templates. -** These are not defined by any standard; the values are used internally only. -** Just be careful to keep them out of the low 8 bits. -*/ -#define DER_OPTIONAL 0x00100 -#define DER_EXPLICIT 0x00200 -#define DER_ANY 0x00400 -#define DER_INLINE 0x00800 -#define DER_POINTER 0x01000 -#define DER_INDEFINITE 0x02000 -#define DER_DERPTR 0x04000 -#define DER_SKIP 0x08000 -#define DER_FORCE 0x10000 -#define DER_OUTER 0x40000 /* for DER_DERPTR */ - -/* -** Macro to convert der decoded bit string into a decoded octet -** string. All it needs to do is fiddle with the length code. -*/ -#define DER_ConvertBitString(item) \ -{ \ - (item)->len = ((item)->len + 7) >> 3; \ -} - -#endif /* _SECDERT_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secdig.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secdig.h deleted file mode 100755 index 94ff39e..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secdig.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * crypto.h - public data structures and prototypes for the crypto library - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef _SECDIG_H_ -#define _SECDIG_H_ - -#include "utilrename.h" -#include "secdigt.h" - -#include "seccomon.h" -#include "secasn1t.h" -#include "secdert.h" - -SEC_BEGIN_PROTOS - - -extern const SEC_ASN1Template sgn_DigestInfoTemplate[]; - -SEC_ASN1_CHOOSER_DECLARE(sgn_DigestInfoTemplate) - -/****************************************/ -/* -** Digest-info functions -*/ - -/* -** Create a new digest-info object -** "algorithm" one of SEC_OID_MD2, SEC_OID_MD5, or SEC_OID_SHA1 -** "sig" the raw signature data (from MD2 or MD5) -** "sigLen" the length of the signature data -** -** NOTE: this is a low level routine used to prepare some data for PKCS#1 -** digital signature formatting. -** -** XXX It might be nice to combine the create and encode functions. -** I think that is all anybody ever wants to do anyway. -*/ -extern SGNDigestInfo *SGN_CreateDigestInfo(SECOidTag algorithm, - const unsigned char *sig, - unsigned int sigLen); - -/* -** Destroy a digest-info object -*/ -extern void SGN_DestroyDigestInfo(SGNDigestInfo *info); - -/* -** Encode a digest-info object -** "poolp" is where to allocate the result from; it can be NULL in -** which case generic heap allocation (XP_ALLOC) will be used -** "dest" is where to store the result; it can be NULL, in which case -** it will be allocated (from poolp or heap, as explained above) -** "diginfo" is the object to be encoded -** The return value is NULL if any error occurred, otherwise it is the -** resulting SECItem (either allocated or the same as the "dest" parameter). -** -** XXX It might be nice to combine the create and encode functions. -** I think that is all anybody ever wants to do anyway. -*/ -extern SECItem *SGN_EncodeDigestInfo(PLArenaPool *poolp, SECItem *dest, - SGNDigestInfo *diginfo); - -/* -** Decode a DER encoded digest info objct. -** didata is thr source of the encoded digest. -** The return value is NULL if an error occurs. Otherwise, a -** digest info object which is allocated within it's own -** pool is returned. The digest info should be deleted -** by later calling SGN_DestroyDigestInfo. -*/ -extern SGNDigestInfo *SGN_DecodeDigestInfo(SECItem *didata); - - -/* -** Copy digest info. -** poolp is the arena to which the digest will be copied. -** a is the destination digest, it must be non-NULL. -** b is the source digest -** This function is for copying digests. It allows digests -** to be copied into a specified pool. If the digest is in -** the same pool as other data, you do not want to delete -** the digest by calling SGN_DestroyDigestInfo. -** A return value of SECFailure indicates an error. A return -** of SECSuccess indicates no error occurred. -*/ -extern SECStatus SGN_CopyDigestInfo(PLArenaPool *poolp, - SGNDigestInfo *a, - SGNDigestInfo *b); - -/* -** Compare two digest-info objects, returning the difference between -** them. -*/ -extern SECComparison SGN_CompareDigestInfo(SGNDigestInfo *a, SGNDigestInfo *b); - - -SEC_END_PROTOS - -#endif /* _SECDIG_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secdigt.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secdigt.h deleted file mode 100755 index 65ca22f..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secdigt.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * secdigt.h - public data structures for digestinfos from the util lib. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef _SECDIGT_H_ -#define _SECDIGT_H_ - -#include "utilrename.h" -#include "plarena.h" -#include "secoidt.h" -#include "secitem.h" - -/* -** A PKCS#1 digest-info object -*/ -struct SGNDigestInfoStr { - PLArenaPool * arena; - SECAlgorithmID digestAlgorithm; - SECItem digest; -}; -typedef struct SGNDigestInfoStr SGNDigestInfo; - - - -#endif /* _SECDIGT_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secerr.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secerr.h deleted file mode 100755 index 490daba..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secerr.h +++ /dev/null @@ -1,218 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef __SEC_ERR_H_ -#define __SEC_ERR_H_ - -#include "utilrename.h" - -#define SEC_ERROR_BASE (-0x2000) -#define SEC_ERROR_LIMIT (SEC_ERROR_BASE + 1000) - -#define IS_SEC_ERROR(code) \ - (((code) >= SEC_ERROR_BASE) && ((code) < SEC_ERROR_LIMIT)) - -#ifndef NO_SECURITY_ERROR_ENUM -typedef enum { -SEC_ERROR_IO = SEC_ERROR_BASE + 0, -SEC_ERROR_LIBRARY_FAILURE = SEC_ERROR_BASE + 1, -SEC_ERROR_BAD_DATA = SEC_ERROR_BASE + 2, -SEC_ERROR_OUTPUT_LEN = SEC_ERROR_BASE + 3, -SEC_ERROR_INPUT_LEN = SEC_ERROR_BASE + 4, -SEC_ERROR_INVALID_ARGS = SEC_ERROR_BASE + 5, -SEC_ERROR_INVALID_ALGORITHM = SEC_ERROR_BASE + 6, -SEC_ERROR_INVALID_AVA = SEC_ERROR_BASE + 7, -SEC_ERROR_INVALID_TIME = SEC_ERROR_BASE + 8, -SEC_ERROR_BAD_DER = SEC_ERROR_BASE + 9, -SEC_ERROR_BAD_SIGNATURE = SEC_ERROR_BASE + 10, -SEC_ERROR_EXPIRED_CERTIFICATE = SEC_ERROR_BASE + 11, -SEC_ERROR_REVOKED_CERTIFICATE = SEC_ERROR_BASE + 12, -SEC_ERROR_UNKNOWN_ISSUER = SEC_ERROR_BASE + 13, -SEC_ERROR_BAD_KEY = SEC_ERROR_BASE + 14, -SEC_ERROR_BAD_PASSWORD = SEC_ERROR_BASE + 15, -SEC_ERROR_RETRY_PASSWORD = SEC_ERROR_BASE + 16, -SEC_ERROR_NO_NODELOCK = SEC_ERROR_BASE + 17, -SEC_ERROR_BAD_DATABASE = SEC_ERROR_BASE + 18, -SEC_ERROR_NO_MEMORY = SEC_ERROR_BASE + 19, -SEC_ERROR_UNTRUSTED_ISSUER = SEC_ERROR_BASE + 20, -SEC_ERROR_UNTRUSTED_CERT = SEC_ERROR_BASE + 21, -SEC_ERROR_DUPLICATE_CERT = (SEC_ERROR_BASE + 22), -SEC_ERROR_DUPLICATE_CERT_NAME = (SEC_ERROR_BASE + 23), -SEC_ERROR_ADDING_CERT = (SEC_ERROR_BASE + 24), -SEC_ERROR_FILING_KEY = (SEC_ERROR_BASE + 25), -SEC_ERROR_NO_KEY = (SEC_ERROR_BASE + 26), -SEC_ERROR_CERT_VALID = (SEC_ERROR_BASE + 27), -SEC_ERROR_CERT_NOT_VALID = (SEC_ERROR_BASE + 28), -SEC_ERROR_CERT_NO_RESPONSE = (SEC_ERROR_BASE + 29), -SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE = (SEC_ERROR_BASE + 30), -SEC_ERROR_CRL_EXPIRED = (SEC_ERROR_BASE + 31), -SEC_ERROR_CRL_BAD_SIGNATURE = (SEC_ERROR_BASE + 32), -SEC_ERROR_CRL_INVALID = (SEC_ERROR_BASE + 33), -SEC_ERROR_EXTENSION_VALUE_INVALID = (SEC_ERROR_BASE + 34), -SEC_ERROR_EXTENSION_NOT_FOUND = (SEC_ERROR_BASE + 35), -SEC_ERROR_CA_CERT_INVALID = (SEC_ERROR_BASE + 36), -SEC_ERROR_PATH_LEN_CONSTRAINT_INVALID = (SEC_ERROR_BASE + 37), -SEC_ERROR_CERT_USAGES_INVALID = (SEC_ERROR_BASE + 38), -SEC_INTERNAL_ONLY = (SEC_ERROR_BASE + 39), -SEC_ERROR_INVALID_KEY = (SEC_ERROR_BASE + 40), -SEC_ERROR_UNKNOWN_CRITICAL_EXTENSION = (SEC_ERROR_BASE + 41), -SEC_ERROR_OLD_CRL = (SEC_ERROR_BASE + 42), -SEC_ERROR_NO_EMAIL_CERT = (SEC_ERROR_BASE + 43), -SEC_ERROR_NO_RECIPIENT_CERTS_QUERY = (SEC_ERROR_BASE + 44), -SEC_ERROR_NOT_A_RECIPIENT = (SEC_ERROR_BASE + 45), -SEC_ERROR_PKCS7_KEYALG_MISMATCH = (SEC_ERROR_BASE + 46), -SEC_ERROR_PKCS7_BAD_SIGNATURE = (SEC_ERROR_BASE + 47), -SEC_ERROR_UNSUPPORTED_KEYALG = (SEC_ERROR_BASE + 48), -SEC_ERROR_DECRYPTION_DISALLOWED = (SEC_ERROR_BASE + 49), -/* Fortezza Alerts */ -XP_SEC_FORTEZZA_BAD_CARD = (SEC_ERROR_BASE + 50), -XP_SEC_FORTEZZA_NO_CARD = (SEC_ERROR_BASE + 51), -XP_SEC_FORTEZZA_NONE_SELECTED = (SEC_ERROR_BASE + 52), -XP_SEC_FORTEZZA_MORE_INFO = (SEC_ERROR_BASE + 53), -XP_SEC_FORTEZZA_PERSON_NOT_FOUND = (SEC_ERROR_BASE + 54), -XP_SEC_FORTEZZA_NO_MORE_INFO = (SEC_ERROR_BASE + 55), -XP_SEC_FORTEZZA_BAD_PIN = (SEC_ERROR_BASE + 56), -XP_SEC_FORTEZZA_PERSON_ERROR = (SEC_ERROR_BASE + 57), -SEC_ERROR_NO_KRL = (SEC_ERROR_BASE + 58), -SEC_ERROR_KRL_EXPIRED = (SEC_ERROR_BASE + 59), -SEC_ERROR_KRL_BAD_SIGNATURE = (SEC_ERROR_BASE + 60), -SEC_ERROR_REVOKED_KEY = (SEC_ERROR_BASE + 61), -SEC_ERROR_KRL_INVALID = (SEC_ERROR_BASE + 62), -SEC_ERROR_NEED_RANDOM = (SEC_ERROR_BASE + 63), -SEC_ERROR_NO_MODULE = (SEC_ERROR_BASE + 64), -SEC_ERROR_NO_TOKEN = (SEC_ERROR_BASE + 65), -SEC_ERROR_READ_ONLY = (SEC_ERROR_BASE + 66), -SEC_ERROR_NO_SLOT_SELECTED = (SEC_ERROR_BASE + 67), -SEC_ERROR_CERT_NICKNAME_COLLISION = (SEC_ERROR_BASE + 68), -SEC_ERROR_KEY_NICKNAME_COLLISION = (SEC_ERROR_BASE + 69), -SEC_ERROR_SAFE_NOT_CREATED = (SEC_ERROR_BASE + 70), -SEC_ERROR_BAGGAGE_NOT_CREATED = (SEC_ERROR_BASE + 71), -XP_JAVA_REMOVE_PRINCIPAL_ERROR = (SEC_ERROR_BASE + 72), -XP_JAVA_DELETE_PRIVILEGE_ERROR = (SEC_ERROR_BASE + 73), -XP_JAVA_CERT_NOT_EXISTS_ERROR = (SEC_ERROR_BASE + 74), -SEC_ERROR_BAD_EXPORT_ALGORITHM = (SEC_ERROR_BASE + 75), -SEC_ERROR_EXPORTING_CERTIFICATES = (SEC_ERROR_BASE + 76), -SEC_ERROR_IMPORTING_CERTIFICATES = (SEC_ERROR_BASE + 77), -SEC_ERROR_PKCS12_DECODING_PFX = (SEC_ERROR_BASE + 78), -SEC_ERROR_PKCS12_INVALID_MAC = (SEC_ERROR_BASE + 79), -SEC_ERROR_PKCS12_UNSUPPORTED_MAC_ALGORITHM = (SEC_ERROR_BASE + 80), -SEC_ERROR_PKCS12_UNSUPPORTED_TRANSPORT_MODE = (SEC_ERROR_BASE + 81), -SEC_ERROR_PKCS12_CORRUPT_PFX_STRUCTURE = (SEC_ERROR_BASE + 82), -SEC_ERROR_PKCS12_UNSUPPORTED_PBE_ALGORITHM = (SEC_ERROR_BASE + 83), -SEC_ERROR_PKCS12_UNSUPPORTED_VERSION = (SEC_ERROR_BASE + 84), -SEC_ERROR_PKCS12_PRIVACY_PASSWORD_INCORRECT = (SEC_ERROR_BASE + 85), -SEC_ERROR_PKCS12_CERT_COLLISION = (SEC_ERROR_BASE + 86), -SEC_ERROR_USER_CANCELLED = (SEC_ERROR_BASE + 87), -SEC_ERROR_PKCS12_DUPLICATE_DATA = (SEC_ERROR_BASE + 88), -SEC_ERROR_MESSAGE_SEND_ABORTED = (SEC_ERROR_BASE + 89), -SEC_ERROR_INADEQUATE_KEY_USAGE = (SEC_ERROR_BASE + 90), -SEC_ERROR_INADEQUATE_CERT_TYPE = (SEC_ERROR_BASE + 91), -SEC_ERROR_CERT_ADDR_MISMATCH = (SEC_ERROR_BASE + 92), -SEC_ERROR_PKCS12_UNABLE_TO_IMPORT_KEY = (SEC_ERROR_BASE + 93), -SEC_ERROR_PKCS12_IMPORTING_CERT_CHAIN = (SEC_ERROR_BASE + 94), -SEC_ERROR_PKCS12_UNABLE_TO_LOCATE_OBJECT_BY_NAME = (SEC_ERROR_BASE + 95), -SEC_ERROR_PKCS12_UNABLE_TO_EXPORT_KEY = (SEC_ERROR_BASE + 96), -SEC_ERROR_PKCS12_UNABLE_TO_WRITE = (SEC_ERROR_BASE + 97), -SEC_ERROR_PKCS12_UNABLE_TO_READ = (SEC_ERROR_BASE + 98), -SEC_ERROR_PKCS12_KEY_DATABASE_NOT_INITIALIZED = (SEC_ERROR_BASE + 99), -SEC_ERROR_KEYGEN_FAIL = (SEC_ERROR_BASE + 100), -SEC_ERROR_INVALID_PASSWORD = (SEC_ERROR_BASE + 101), -SEC_ERROR_RETRY_OLD_PASSWORD = (SEC_ERROR_BASE + 102), -SEC_ERROR_BAD_NICKNAME = (SEC_ERROR_BASE + 103), -SEC_ERROR_NOT_FORTEZZA_ISSUER = (SEC_ERROR_BASE + 104), -SEC_ERROR_CANNOT_MOVE_SENSITIVE_KEY = (SEC_ERROR_BASE + 105), -SEC_ERROR_JS_INVALID_MODULE_NAME = (SEC_ERROR_BASE + 106), -SEC_ERROR_JS_INVALID_DLL = (SEC_ERROR_BASE + 107), -SEC_ERROR_JS_ADD_MOD_FAILURE = (SEC_ERROR_BASE + 108), -SEC_ERROR_JS_DEL_MOD_FAILURE = (SEC_ERROR_BASE + 109), -SEC_ERROR_OLD_KRL = (SEC_ERROR_BASE + 110), -SEC_ERROR_CKL_CONFLICT = (SEC_ERROR_BASE + 111), -SEC_ERROR_CERT_NOT_IN_NAME_SPACE = (SEC_ERROR_BASE + 112), -SEC_ERROR_KRL_NOT_YET_VALID = (SEC_ERROR_BASE + 113), -SEC_ERROR_CRL_NOT_YET_VALID = (SEC_ERROR_BASE + 114), -SEC_ERROR_UNKNOWN_CERT = (SEC_ERROR_BASE + 115), -SEC_ERROR_UNKNOWN_SIGNER = (SEC_ERROR_BASE + 116), -SEC_ERROR_CERT_BAD_ACCESS_LOCATION = (SEC_ERROR_BASE + 117), -SEC_ERROR_OCSP_UNKNOWN_RESPONSE_TYPE = (SEC_ERROR_BASE + 118), -SEC_ERROR_OCSP_BAD_HTTP_RESPONSE = (SEC_ERROR_BASE + 119), -SEC_ERROR_OCSP_MALFORMED_REQUEST = (SEC_ERROR_BASE + 120), -SEC_ERROR_OCSP_SERVER_ERROR = (SEC_ERROR_BASE + 121), -SEC_ERROR_OCSP_TRY_SERVER_LATER = (SEC_ERROR_BASE + 122), -SEC_ERROR_OCSP_REQUEST_NEEDS_SIG = (SEC_ERROR_BASE + 123), -SEC_ERROR_OCSP_UNAUTHORIZED_REQUEST = (SEC_ERROR_BASE + 124), -SEC_ERROR_OCSP_UNKNOWN_RESPONSE_STATUS = (SEC_ERROR_BASE + 125), -SEC_ERROR_OCSP_UNKNOWN_CERT = (SEC_ERROR_BASE + 126), -SEC_ERROR_OCSP_NOT_ENABLED = (SEC_ERROR_BASE + 127), -SEC_ERROR_OCSP_NO_DEFAULT_RESPONDER = (SEC_ERROR_BASE + 128), -SEC_ERROR_OCSP_MALFORMED_RESPONSE = (SEC_ERROR_BASE + 129), -SEC_ERROR_OCSP_UNAUTHORIZED_RESPONSE = (SEC_ERROR_BASE + 130), -SEC_ERROR_OCSP_FUTURE_RESPONSE = (SEC_ERROR_BASE + 131), -SEC_ERROR_OCSP_OLD_RESPONSE = (SEC_ERROR_BASE + 132), -/* smime stuff */ -SEC_ERROR_DIGEST_NOT_FOUND = (SEC_ERROR_BASE + 133), -SEC_ERROR_UNSUPPORTED_MESSAGE_TYPE = (SEC_ERROR_BASE + 134), -SEC_ERROR_MODULE_STUCK = (SEC_ERROR_BASE + 135), -SEC_ERROR_BAD_TEMPLATE = (SEC_ERROR_BASE + 136), -SEC_ERROR_CRL_NOT_FOUND = (SEC_ERROR_BASE + 137), -SEC_ERROR_REUSED_ISSUER_AND_SERIAL = (SEC_ERROR_BASE + 138), -SEC_ERROR_BUSY = (SEC_ERROR_BASE + 139), -SEC_ERROR_EXTRA_INPUT = (SEC_ERROR_BASE + 140), -/* error codes used by elliptic curve code */ -SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE = (SEC_ERROR_BASE + 141), -SEC_ERROR_UNSUPPORTED_EC_POINT_FORM = (SEC_ERROR_BASE + 142), -SEC_ERROR_UNRECOGNIZED_OID = (SEC_ERROR_BASE + 143), -SEC_ERROR_OCSP_INVALID_SIGNING_CERT = (SEC_ERROR_BASE + 144), -/* new revocation errors */ -SEC_ERROR_REVOKED_CERTIFICATE_CRL = (SEC_ERROR_BASE + 145), -SEC_ERROR_REVOKED_CERTIFICATE_OCSP = (SEC_ERROR_BASE + 146), -SEC_ERROR_CRL_INVALID_VERSION = (SEC_ERROR_BASE + 147), -SEC_ERROR_CRL_V1_CRITICAL_EXTENSION = (SEC_ERROR_BASE + 148), -SEC_ERROR_CRL_UNKNOWN_CRITICAL_EXTENSION = (SEC_ERROR_BASE + 149), -SEC_ERROR_UNKNOWN_OBJECT_TYPE = (SEC_ERROR_BASE + 150), -SEC_ERROR_INCOMPATIBLE_PKCS11 = (SEC_ERROR_BASE + 151), -SEC_ERROR_NO_EVENT = (SEC_ERROR_BASE + 152), -SEC_ERROR_CRL_ALREADY_EXISTS = (SEC_ERROR_BASE + 153), -SEC_ERROR_NOT_INITIALIZED = (SEC_ERROR_BASE + 154), -SEC_ERROR_TOKEN_NOT_LOGGED_IN = (SEC_ERROR_BASE + 155), -SEC_ERROR_OCSP_RESPONDER_CERT_INVALID = (SEC_ERROR_BASE + 156), -SEC_ERROR_OCSP_BAD_SIGNATURE = (SEC_ERROR_BASE + 157), - -SEC_ERROR_OUT_OF_SEARCH_LIMITS = (SEC_ERROR_BASE + 158), -SEC_ERROR_INVALID_POLICY_MAPPING = (SEC_ERROR_BASE + 159), -SEC_ERROR_POLICY_VALIDATION_FAILED = (SEC_ERROR_BASE + 160), -/* No longer used. Unknown AIA location types are now silently ignored. */ -SEC_ERROR_UNKNOWN_AIA_LOCATION_TYPE = (SEC_ERROR_BASE + 161), -SEC_ERROR_BAD_HTTP_RESPONSE = (SEC_ERROR_BASE + 162), -SEC_ERROR_BAD_LDAP_RESPONSE = (SEC_ERROR_BASE + 163), -SEC_ERROR_FAILED_TO_ENCODE_DATA = (SEC_ERROR_BASE + 164), -SEC_ERROR_BAD_INFO_ACCESS_LOCATION = (SEC_ERROR_BASE + 165), - -SEC_ERROR_LIBPKIX_INTERNAL = (SEC_ERROR_BASE + 166), - -SEC_ERROR_PKCS11_GENERAL_ERROR = (SEC_ERROR_BASE + 167), -SEC_ERROR_PKCS11_FUNCTION_FAILED = (SEC_ERROR_BASE + 168), -SEC_ERROR_PKCS11_DEVICE_ERROR = (SEC_ERROR_BASE + 169), - -SEC_ERROR_BAD_INFO_ACCESS_METHOD = (SEC_ERROR_BASE + 170), -SEC_ERROR_CRL_IMPORT_FAILED = (SEC_ERROR_BASE + 171), - -SEC_ERROR_EXPIRED_PASSWORD = (SEC_ERROR_BASE + 172), -SEC_ERROR_LOCKED_PASSWORD = (SEC_ERROR_BASE + 173), - -SEC_ERROR_UNKNOWN_PKCS11_ERROR = (SEC_ERROR_BASE + 174), - -SEC_ERROR_BAD_CRL_DP_URL = (SEC_ERROR_BASE + 175), - -SEC_ERROR_CERT_SIGNATURE_ALGORITHM_DISABLED = (SEC_ERROR_BASE + 176), - -SEC_ERROR_LEGACY_DATABASE = (SEC_ERROR_BASE + 177), - -SEC_ERROR_APPLICATION_CALLBACK_ERROR = (SEC_ERROR_BASE + 178), - -/* Add new error codes above here. */ -SEC_ERROR_END_OF_LIST -} SECErrorCodes; -#endif /* NO_SECURITY_ERROR_ENUM */ - -#endif /* __SEC_ERR_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secitem.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secitem.h deleted file mode 100755 index 290f2e5..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secitem.h +++ /dev/null @@ -1,118 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef _SECITEM_H_ -#define _SECITEM_H_ - -#include "utilrename.h" - -/* - * secitem.h - public data structures and prototypes for handling - * SECItems - */ - -#include "plarena.h" -#include "plhash.h" -#include "seccomon.h" - -SEC_BEGIN_PROTOS - -/* -** Allocate an item. If "arena" is not NULL, then allocate from there, -** otherwise allocate from the heap. If "item" is not NULL, allocate -** only the data buffer for the item, not the item itself. If "len" is -** 0, do not allocate the data buffer for the item; simply set the data -** field to NULL and the len field to 0. The item structure is allocated -** zero-filled; the data buffer is not zeroed. The caller is responsible -** for initializing the type field of the item. -** -** The resulting item is returned; NULL if any error occurs. -** -** XXX This probably should take a SECItemType, but since that is mostly -** unused and our improved APIs (aka Stan) are looming, I left it out. -*/ -extern SECItem *SECITEM_AllocItem(PLArenaPool *arena, SECItem *item, - unsigned int len); - -/* -** This is a legacy function containing bugs. It doesn't update item->len, -** and it has other issues as described in bug 298649 and bug 298938. -** However, the function is kept unchanged for consumers that might depend -** on the broken behaviour. New code should call SECITEM_ReallocItemV2. -** -** Reallocate the data for the specified "item". If "arena" is not NULL, -** then reallocate from there, otherwise reallocate from the heap. -** In the case where oldlen is 0, the data is allocated (not reallocated). -** In any case, "item" is expected to be a valid SECItem pointer; -** SECFailure is returned if it is not. If the allocation succeeds, -** SECSuccess is returned. -*/ -extern SECStatus SECITEM_ReallocItem( /* deprecated function */ - PLArenaPool *arena, SECItem *item, - unsigned int oldlen, unsigned int newlen); - -/* -** Reallocate the data for the specified "item". If "arena" is not NULL, -** then reallocate from there, otherwise reallocate from the heap. -** If item->data is NULL, the data is allocated (not reallocated). -** In any case, "item" is expected to be a valid SECItem pointer; -** SECFailure is returned if it is not, and the item will remain unchanged. -** If the allocation succeeds, the item is updated and SECSuccess is returned. - */ -extern SECStatus SECITEM_ReallocItemV2(PLArenaPool *arena, SECItem *item, - unsigned int newlen); - -/* -** Compare two items returning the difference between them. -*/ -extern SECComparison SECITEM_CompareItem(const SECItem *a, const SECItem *b); - -/* -** Compare two items -- if they are the same, return true; otherwise false. -*/ -extern PRBool SECITEM_ItemsAreEqual(const SECItem *a, const SECItem *b); - -/* -** Copy "from" to "to" -*/ -extern SECStatus SECITEM_CopyItem(PLArenaPool *arena, SECItem *to, - const SECItem *from); - -/* -** Allocate an item and copy "from" into it. -*/ -extern SECItem *SECITEM_DupItem(const SECItem *from); - -/* -** Allocate an item and copy "from" into it. The item itself and the -** data it points to are both allocated from the arena. If arena is -** NULL, this function is equivalent to SECITEM_DupItem. -*/ -extern SECItem *SECITEM_ArenaDupItem(PLArenaPool *arena, const SECItem *from); - -/* -** Free "zap". If freeit is PR_TRUE then "zap" itself is freed. -*/ -extern void SECITEM_FreeItem(SECItem *zap, PRBool freeit); - -/* -** Zero and then free "zap". If freeit is PR_TRUE then "zap" itself is freed. -*/ -extern void SECITEM_ZfreeItem(SECItem *zap, PRBool freeit); - -PLHashNumber PR_CALLBACK SECITEM_Hash ( const void *key); - -PRIntn PR_CALLBACK SECITEM_HashCompare ( const void *k1, const void *k2); - -extern SECItemArray *SECITEM_AllocArray(PLArenaPool *arena, - SECItemArray *array, - unsigned int len); -extern SECItemArray *SECITEM_DupArray(PLArenaPool *arena, - const SECItemArray *from); -extern void SECITEM_FreeArray(SECItemArray *array, PRBool freeit); -extern void SECITEM_ZfreeArray(SECItemArray *array, PRBool freeit); - -SEC_END_PROTOS - -#endif /* _SECITEM_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secoid.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secoid.h deleted file mode 100755 index 1908744..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secoid.h +++ /dev/null @@ -1,141 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef _SECOID_H_ -#define _SECOID_H_ - -#include "utilrename.h" - -/* - * secoid.h - public data structures and prototypes for ASN.1 OID functions - */ - -#include "plarena.h" - -#include "seccomon.h" -#include "secoidt.h" -#include "secasn1t.h" - -SEC_BEGIN_PROTOS - -extern const SEC_ASN1Template SECOID_AlgorithmIDTemplate[]; - -/* This functions simply returns the address of the above-declared template. */ -SEC_ASN1_CHOOSER_DECLARE(SECOID_AlgorithmIDTemplate) - -/* - * OID handling routines - */ -extern SECOidData *SECOID_FindOID( const SECItem *oid); -extern SECOidTag SECOID_FindOIDTag(const SECItem *oid); -extern SECOidData *SECOID_FindOIDByTag(SECOidTag tagnum); -extern SECOidData *SECOID_FindOIDByMechanism(unsigned long mechanism); - -/****************************************/ -/* -** Algorithm id handling operations -*/ - -/* -** Fill in an algorithm-ID object given a tag and some parameters. -** "aid" where the DER encoded algorithm info is stored (memory -** is allocated) -** "tag" the tag number defining the algorithm -** "params" if not NULL, the parameters to go with the algorithm -*/ -extern SECStatus SECOID_SetAlgorithmID(PLArenaPool *arena, SECAlgorithmID *aid, - SECOidTag tag, SECItem *params); - -/* -** Copy the "src" object to "dest". Memory is allocated in "dest" for -** each of the appropriate sub-objects. Memory in "dest" is not freed -** before memory is allocated (use SECOID_DestroyAlgorithmID(dest, PR_FALSE) -** to do that). -*/ -extern SECStatus SECOID_CopyAlgorithmID(PLArenaPool *arena, SECAlgorithmID *dest, - const SECAlgorithmID *src); - -/* -** Get the tag number for the given algorithm-id object. -*/ -extern SECOidTag SECOID_GetAlgorithmTag(const SECAlgorithmID *aid); - -/* -** Destroy an algorithm-id object. -** "aid" the certificate-request to destroy -** "freeit" if PR_TRUE then free the object as well as its sub-objects -*/ -extern void SECOID_DestroyAlgorithmID(SECAlgorithmID *aid, PRBool freeit); - -/* -** Compare two algorithm-id objects, returning the difference between -** them. -*/ -extern SECComparison SECOID_CompareAlgorithmID(SECAlgorithmID *a, - SECAlgorithmID *b); - -extern PRBool SECOID_KnownCertExtenOID (SECItem *extenOid); - -/* Given a tag number, return a string describing it. - */ -extern const char *SECOID_FindOIDTagDescription(SECOidTag tagnum); - -/* Add a dynamic SECOidData to the dynamic OID table. -** Routine copies the src entry, and returns the new SECOidTag. -** Returns SEC_OID_INVALID if failed to add for some reason. -*/ -extern SECOidTag SECOID_AddEntry(const SECOidData * src); - -/* - * initialize the oid data structures. - */ -extern SECStatus SECOID_Init(void); - -/* - * free up the oid data structures. - */ -extern SECStatus SECOID_Shutdown(void); - -/* if to->data is not NULL, and to->len is large enough to hold the result, - * then the resultant OID will be copyed into to->data, and to->len will be - * changed to show the actual OID length. - * Otherwise, memory for the OID will be allocated (from the caller's - * PLArenaPool, if pool is non-NULL) and to->data will receive the address - * of the allocated data, and to->len will receive the OID length. - * The original value of to->data is not freed when a new buffer is allocated. - * - * The input string may begin with "OID." and this still be ignored. - * The length of the input string is given in len. If len == 0, then - * len will be computed as strlen(from), meaning it must be NUL terminated. - * It is an error if from == NULL, or if *from == '\0'. - */ -extern SECStatus SEC_StringToOID(PLArenaPool *pool, SECItem *to, - const char *from, PRUint32 len); - -extern void UTIL_SetForkState(PRBool forked); - -/* - * Accessor functions for new opaque extended SECOID table. - * Any of these functions may return SECSuccess or SECFailure with the error - * code set to SEC_ERROR_UNKNOWN_OBJECT_TYPE if the SECOidTag is out of range. - */ - -/* The Get function outputs the 32-bit value associated with the SECOidTag. - * Flags bits are the NSS_USE_ALG_ #defines in "secoidt.h". - * Default value for any algorithm is 0xffffffff (enabled for all purposes). - * No value is output if function returns SECFailure. - */ -extern SECStatus NSS_GetAlgorithmPolicy(SECOidTag tag, PRUint32 *pValue); - -/* The Set function modifies the stored value according to the following - * algorithm: - * policy[tag] = (policy[tag] & ~clearBits) | setBits; - */ -extern SECStatus -NSS_SetAlgorithmPolicy(SECOidTag tag, PRUint32 setBits, PRUint32 clearBits); - - -SEC_END_PROTOS - -#endif /* _SECOID_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secoidt.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secoidt.h deleted file mode 100755 index ff0f527..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secoidt.h +++ /dev/null @@ -1,487 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef _SECOIDT_H_ -#define _SECOIDT_H_ - -#include "utilrename.h" - -/* - * secoidt.h - public data structures for ASN.1 OID functions - */ - -#include "secitem.h" - -typedef struct SECOidDataStr SECOidData; -typedef struct SECAlgorithmIDStr SECAlgorithmID; - -/* -** An X.500 algorithm identifier -*/ -struct SECAlgorithmIDStr { - SECItem algorithm; - SECItem parameters; -}; - -/* - * Misc object IDs - these numbers are for convenient handling. - * They are mapped into real object IDs - * - * NOTE: the order of these entries must mach the array "oids" of SECOidData - * in util/secoid.c. - */ -typedef enum { - SEC_OID_UNKNOWN = 0, - SEC_OID_MD2 = 1, - SEC_OID_MD4 = 2, - SEC_OID_MD5 = 3, - SEC_OID_SHA1 = 4, - SEC_OID_RC2_CBC = 5, - SEC_OID_RC4 = 6, - SEC_OID_DES_EDE3_CBC = 7, - SEC_OID_RC5_CBC_PAD = 8, - SEC_OID_DES_ECB = 9, - SEC_OID_DES_CBC = 10, - SEC_OID_DES_OFB = 11, - SEC_OID_DES_CFB = 12, - SEC_OID_DES_MAC = 13, - SEC_OID_DES_EDE = 14, - SEC_OID_ISO_SHA_WITH_RSA_SIGNATURE = 15, - SEC_OID_PKCS1_RSA_ENCRYPTION = 16, - SEC_OID_PKCS1_MD2_WITH_RSA_ENCRYPTION = 17, - SEC_OID_PKCS1_MD4_WITH_RSA_ENCRYPTION = 18, - SEC_OID_PKCS1_MD5_WITH_RSA_ENCRYPTION = 19, - SEC_OID_PKCS1_SHA1_WITH_RSA_ENCRYPTION = 20, - SEC_OID_PKCS5_PBE_WITH_MD2_AND_DES_CBC = 21, - SEC_OID_PKCS5_PBE_WITH_MD5_AND_DES_CBC = 22, - SEC_OID_PKCS5_PBE_WITH_SHA1_AND_DES_CBC = 23, - SEC_OID_PKCS7 = 24, - SEC_OID_PKCS7_DATA = 25, - SEC_OID_PKCS7_SIGNED_DATA = 26, - SEC_OID_PKCS7_ENVELOPED_DATA = 27, - SEC_OID_PKCS7_SIGNED_ENVELOPED_DATA = 28, - SEC_OID_PKCS7_DIGESTED_DATA = 29, - SEC_OID_PKCS7_ENCRYPTED_DATA = 30, - SEC_OID_PKCS9_EMAIL_ADDRESS = 31, - SEC_OID_PKCS9_UNSTRUCTURED_NAME = 32, - SEC_OID_PKCS9_CONTENT_TYPE = 33, - SEC_OID_PKCS9_MESSAGE_DIGEST = 34, - SEC_OID_PKCS9_SIGNING_TIME = 35, - SEC_OID_PKCS9_COUNTER_SIGNATURE = 36, - SEC_OID_PKCS9_CHALLENGE_PASSWORD = 37, - SEC_OID_PKCS9_UNSTRUCTURED_ADDRESS = 38, - SEC_OID_PKCS9_EXTENDED_CERTIFICATE_ATTRIBUTES = 39, - SEC_OID_PKCS9_SMIME_CAPABILITIES = 40, - SEC_OID_AVA_COMMON_NAME = 41, - SEC_OID_AVA_COUNTRY_NAME = 42, - SEC_OID_AVA_LOCALITY = 43, - SEC_OID_AVA_STATE_OR_PROVINCE = 44, - SEC_OID_AVA_ORGANIZATION_NAME = 45, - SEC_OID_AVA_ORGANIZATIONAL_UNIT_NAME = 46, - SEC_OID_AVA_DN_QUALIFIER = 47, - SEC_OID_AVA_DC = 48, - - SEC_OID_NS_TYPE_GIF = 49, - SEC_OID_NS_TYPE_JPEG = 50, - SEC_OID_NS_TYPE_URL = 51, - SEC_OID_NS_TYPE_HTML = 52, - SEC_OID_NS_TYPE_CERT_SEQUENCE = 53, - SEC_OID_MISSI_KEA_DSS_OLD = 54, - SEC_OID_MISSI_DSS_OLD = 55, - SEC_OID_MISSI_KEA_DSS = 56, - SEC_OID_MISSI_DSS = 57, - SEC_OID_MISSI_KEA = 58, - SEC_OID_MISSI_ALT_KEA = 59, - - /* Netscape private certificate extensions */ - SEC_OID_NS_CERT_EXT_NETSCAPE_OK = 60, - SEC_OID_NS_CERT_EXT_ISSUER_LOGO = 61, - SEC_OID_NS_CERT_EXT_SUBJECT_LOGO = 62, - SEC_OID_NS_CERT_EXT_CERT_TYPE = 63, - SEC_OID_NS_CERT_EXT_BASE_URL = 64, - SEC_OID_NS_CERT_EXT_REVOCATION_URL = 65, - SEC_OID_NS_CERT_EXT_CA_REVOCATION_URL = 66, - SEC_OID_NS_CERT_EXT_CA_CRL_URL = 67, - SEC_OID_NS_CERT_EXT_CA_CERT_URL = 68, - SEC_OID_NS_CERT_EXT_CERT_RENEWAL_URL = 69, - SEC_OID_NS_CERT_EXT_CA_POLICY_URL = 70, - SEC_OID_NS_CERT_EXT_HOMEPAGE_URL = 71, - SEC_OID_NS_CERT_EXT_ENTITY_LOGO = 72, - SEC_OID_NS_CERT_EXT_USER_PICTURE = 73, - SEC_OID_NS_CERT_EXT_SSL_SERVER_NAME = 74, - SEC_OID_NS_CERT_EXT_COMMENT = 75, - SEC_OID_NS_CERT_EXT_LOST_PASSWORD_URL = 76, - SEC_OID_NS_CERT_EXT_CERT_RENEWAL_TIME = 77, - SEC_OID_NS_KEY_USAGE_GOVT_APPROVED = 78, - - /* x.509 v3 Extensions */ - SEC_OID_X509_SUBJECT_DIRECTORY_ATTR = 79, - SEC_OID_X509_SUBJECT_KEY_ID = 80, - SEC_OID_X509_KEY_USAGE = 81, - SEC_OID_X509_PRIVATE_KEY_USAGE_PERIOD = 82, - SEC_OID_X509_SUBJECT_ALT_NAME = 83, - SEC_OID_X509_ISSUER_ALT_NAME = 84, - SEC_OID_X509_BASIC_CONSTRAINTS = 85, - SEC_OID_X509_NAME_CONSTRAINTS = 86, - SEC_OID_X509_CRL_DIST_POINTS = 87, - SEC_OID_X509_CERTIFICATE_POLICIES = 88, - SEC_OID_X509_POLICY_MAPPINGS = 89, - SEC_OID_X509_POLICY_CONSTRAINTS = 90, - SEC_OID_X509_AUTH_KEY_ID = 91, - SEC_OID_X509_EXT_KEY_USAGE = 92, - SEC_OID_X509_AUTH_INFO_ACCESS = 93, - - SEC_OID_X509_CRL_NUMBER = 94, - SEC_OID_X509_REASON_CODE = 95, - SEC_OID_X509_INVALID_DATE = 96, - /* End of x.509 v3 Extensions */ - - SEC_OID_X500_RSA_ENCRYPTION = 97, - - /* alg 1485 additions */ - SEC_OID_RFC1274_UID = 98, - SEC_OID_RFC1274_MAIL = 99, - - /* PKCS 12 additions */ - SEC_OID_PKCS12 = 100, - SEC_OID_PKCS12_MODE_IDS = 101, - SEC_OID_PKCS12_ESPVK_IDS = 102, - SEC_OID_PKCS12_BAG_IDS = 103, - SEC_OID_PKCS12_CERT_BAG_IDS = 104, - SEC_OID_PKCS12_OIDS = 105, - SEC_OID_PKCS12_PBE_IDS = 106, - SEC_OID_PKCS12_SIGNATURE_IDS = 107, - SEC_OID_PKCS12_ENVELOPING_IDS = 108, - /* SEC_OID_PKCS12_OFFLINE_TRANSPORT_MODE, - SEC_OID_PKCS12_ONLINE_TRANSPORT_MODE, */ - SEC_OID_PKCS12_PKCS8_KEY_SHROUDING = 109, - SEC_OID_PKCS12_KEY_BAG_ID = 110, - SEC_OID_PKCS12_CERT_AND_CRL_BAG_ID = 111, - SEC_OID_PKCS12_SECRET_BAG_ID = 112, - SEC_OID_PKCS12_X509_CERT_CRL_BAG = 113, - SEC_OID_PKCS12_SDSI_CERT_BAG = 114, - SEC_OID_PKCS12_PBE_WITH_SHA1_AND_128_BIT_RC4 = 115, - SEC_OID_PKCS12_PBE_WITH_SHA1_AND_40_BIT_RC4 = 116, - SEC_OID_PKCS12_PBE_WITH_SHA1_AND_TRIPLE_DES_CBC = 117, - SEC_OID_PKCS12_PBE_WITH_SHA1_AND_128_BIT_RC2_CBC = 118, - SEC_OID_PKCS12_PBE_WITH_SHA1_AND_40_BIT_RC2_CBC = 119, - SEC_OID_PKCS12_RSA_ENCRYPTION_WITH_128_BIT_RC4 = 120, - SEC_OID_PKCS12_RSA_ENCRYPTION_WITH_40_BIT_RC4 = 121, - SEC_OID_PKCS12_RSA_ENCRYPTION_WITH_TRIPLE_DES = 122, - SEC_OID_PKCS12_RSA_SIGNATURE_WITH_SHA1_DIGEST = 123, - /* end of PKCS 12 additions */ - - /* DSA signatures */ - SEC_OID_ANSIX9_DSA_SIGNATURE = 124, - SEC_OID_ANSIX9_DSA_SIGNATURE_WITH_SHA1_DIGEST = 125, - SEC_OID_BOGUS_DSA_SIGNATURE_WITH_SHA1_DIGEST = 126, - - /* Verisign OIDs */ - SEC_OID_VERISIGN_USER_NOTICES = 127, - - /* PKIX OIDs */ - SEC_OID_PKIX_CPS_POINTER_QUALIFIER = 128, - SEC_OID_PKIX_USER_NOTICE_QUALIFIER = 129, - SEC_OID_PKIX_OCSP = 130, - SEC_OID_PKIX_OCSP_BASIC_RESPONSE = 131, - SEC_OID_PKIX_OCSP_NONCE = 132, - SEC_OID_PKIX_OCSP_CRL = 133, - SEC_OID_PKIX_OCSP_RESPONSE = 134, - SEC_OID_PKIX_OCSP_NO_CHECK = 135, - SEC_OID_PKIX_OCSP_ARCHIVE_CUTOFF = 136, - SEC_OID_PKIX_OCSP_SERVICE_LOCATOR = 137, - SEC_OID_PKIX_REGCTRL_REGTOKEN = 138, - SEC_OID_PKIX_REGCTRL_AUTHENTICATOR = 139, - SEC_OID_PKIX_REGCTRL_PKIPUBINFO = 140, - SEC_OID_PKIX_REGCTRL_PKI_ARCH_OPTIONS = 141, - SEC_OID_PKIX_REGCTRL_OLD_CERT_ID = 142, - SEC_OID_PKIX_REGCTRL_PROTOCOL_ENC_KEY = 143, - SEC_OID_PKIX_REGINFO_UTF8_PAIRS = 144, - SEC_OID_PKIX_REGINFO_CERT_REQUEST = 145, - SEC_OID_EXT_KEY_USAGE_SERVER_AUTH = 146, - SEC_OID_EXT_KEY_USAGE_CLIENT_AUTH = 147, - SEC_OID_EXT_KEY_USAGE_CODE_SIGN = 148, - SEC_OID_EXT_KEY_USAGE_EMAIL_PROTECT = 149, - SEC_OID_EXT_KEY_USAGE_TIME_STAMP = 150, - SEC_OID_OCSP_RESPONDER = 151, - - /* Netscape Algorithm OIDs */ - SEC_OID_NETSCAPE_SMIME_KEA = 152, - - /* Skipjack OID -- ### mwelch temporary */ - SEC_OID_FORTEZZA_SKIPJACK = 153, - - /* PKCS 12 V2 oids */ - SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_128_BIT_RC4 = 154, - SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_40_BIT_RC4 = 155, - SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_3KEY_TRIPLE_DES_CBC = 156, - SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_2KEY_TRIPLE_DES_CBC = 157, - SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_128_BIT_RC2_CBC = 158, - SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_40_BIT_RC2_CBC = 159, - SEC_OID_PKCS12_SAFE_CONTENTS_ID = 160, - SEC_OID_PKCS12_PKCS8_SHROUDED_KEY_BAG_ID = 161, - - SEC_OID_PKCS12_V1_KEY_BAG_ID = 162, - SEC_OID_PKCS12_V1_PKCS8_SHROUDED_KEY_BAG_ID = 163, - SEC_OID_PKCS12_V1_CERT_BAG_ID = 164, - SEC_OID_PKCS12_V1_CRL_BAG_ID = 165, - SEC_OID_PKCS12_V1_SECRET_BAG_ID = 166, - SEC_OID_PKCS12_V1_SAFE_CONTENTS_BAG_ID = 167, - SEC_OID_PKCS9_X509_CERT = 168, - SEC_OID_PKCS9_SDSI_CERT = 169, - SEC_OID_PKCS9_X509_CRL = 170, - SEC_OID_PKCS9_FRIENDLY_NAME = 171, - SEC_OID_PKCS9_LOCAL_KEY_ID = 172, - SEC_OID_BOGUS_KEY_USAGE = 173, - - /*Diffe Helman OIDS */ - SEC_OID_X942_DIFFIE_HELMAN_KEY = 174, - - /* Netscape other name types */ - /* SEC_OID_NETSCAPE_NICKNAME is an otherName field of type IA5String - * in the subjectAltName certificate extension. NSS dropped support - * for SEC_OID_NETSCAPE_NICKNAME in NSS 3.13. */ - SEC_OID_NETSCAPE_NICKNAME = 175, - - /* Cert Server OIDS */ - SEC_OID_NETSCAPE_RECOVERY_REQUEST = 176, - - /* New PSM certificate management OIDs */ - SEC_OID_CERT_RENEWAL_LOCATOR = 177, - SEC_OID_NS_CERT_EXT_SCOPE_OF_USE = 178, - - /* CMS (RFC2630) OIDs */ - SEC_OID_CMS_EPHEMERAL_STATIC_DIFFIE_HELLMAN = 179, - SEC_OID_CMS_3DES_KEY_WRAP = 180, - SEC_OID_CMS_RC2_KEY_WRAP = 181, - - /* SMIME attributes */ - SEC_OID_SMIME_ENCRYPTION_KEY_PREFERENCE = 182, - - /* AES OIDs */ - SEC_OID_AES_128_ECB = 183, - SEC_OID_AES_128_CBC = 184, - SEC_OID_AES_192_ECB = 185, - SEC_OID_AES_192_CBC = 186, - SEC_OID_AES_256_ECB = 187, - SEC_OID_AES_256_CBC = 188, - - SEC_OID_SDN702_DSA_SIGNATURE = 189, - - SEC_OID_MS_SMIME_ENCRYPTION_KEY_PREFERENCE = 190, - - SEC_OID_SHA256 = 191, - SEC_OID_SHA384 = 192, - SEC_OID_SHA512 = 193, - - SEC_OID_PKCS1_SHA256_WITH_RSA_ENCRYPTION = 194, - SEC_OID_PKCS1_SHA384_WITH_RSA_ENCRYPTION = 195, - SEC_OID_PKCS1_SHA512_WITH_RSA_ENCRYPTION = 196, - - SEC_OID_AES_128_KEY_WRAP = 197, - SEC_OID_AES_192_KEY_WRAP = 198, - SEC_OID_AES_256_KEY_WRAP = 199, - - /* Elliptic Curve Cryptography (ECC) OIDs */ - SEC_OID_ANSIX962_EC_PUBLIC_KEY = 200, - SEC_OID_ANSIX962_ECDSA_SHA1_SIGNATURE = 201, - -#define SEC_OID_ANSIX962_ECDSA_SIGNATURE_WITH_SHA1_DIGEST \ - SEC_OID_ANSIX962_ECDSA_SHA1_SIGNATURE - - /* ANSI X9.62 named elliptic curves (prime field) */ - SEC_OID_ANSIX962_EC_PRIME192V1 = 202, - SEC_OID_ANSIX962_EC_PRIME192V2 = 203, - SEC_OID_ANSIX962_EC_PRIME192V3 = 204, - SEC_OID_ANSIX962_EC_PRIME239V1 = 205, - SEC_OID_ANSIX962_EC_PRIME239V2 = 206, - SEC_OID_ANSIX962_EC_PRIME239V3 = 207, - SEC_OID_ANSIX962_EC_PRIME256V1 = 208, - - /* SECG named elliptic curves (prime field) */ - SEC_OID_SECG_EC_SECP112R1 = 209, - SEC_OID_SECG_EC_SECP112R2 = 210, - SEC_OID_SECG_EC_SECP128R1 = 211, - SEC_OID_SECG_EC_SECP128R2 = 212, - SEC_OID_SECG_EC_SECP160K1 = 213, - SEC_OID_SECG_EC_SECP160R1 = 214, - SEC_OID_SECG_EC_SECP160R2 = 215, - SEC_OID_SECG_EC_SECP192K1 = 216, - /* SEC_OID_SECG_EC_SECP192R1 is SEC_OID_ANSIX962_EC_PRIME192V1 */ - SEC_OID_SECG_EC_SECP224K1 = 217, - SEC_OID_SECG_EC_SECP224R1 = 218, - SEC_OID_SECG_EC_SECP256K1 = 219, - /* SEC_OID_SECG_EC_SECP256R1 is SEC_OID_ANSIX962_EC_PRIME256V1 */ - SEC_OID_SECG_EC_SECP384R1 = 220, - SEC_OID_SECG_EC_SECP521R1 = 221, - - /* ANSI X9.62 named elliptic curves (characteristic two field) */ - SEC_OID_ANSIX962_EC_C2PNB163V1 = 222, - SEC_OID_ANSIX962_EC_C2PNB163V2 = 223, - SEC_OID_ANSIX962_EC_C2PNB163V3 = 224, - SEC_OID_ANSIX962_EC_C2PNB176V1 = 225, - SEC_OID_ANSIX962_EC_C2TNB191V1 = 226, - SEC_OID_ANSIX962_EC_C2TNB191V2 = 227, - SEC_OID_ANSIX962_EC_C2TNB191V3 = 228, - SEC_OID_ANSIX962_EC_C2ONB191V4 = 229, - SEC_OID_ANSIX962_EC_C2ONB191V5 = 230, - SEC_OID_ANSIX962_EC_C2PNB208W1 = 231, - SEC_OID_ANSIX962_EC_C2TNB239V1 = 232, - SEC_OID_ANSIX962_EC_C2TNB239V2 = 233, - SEC_OID_ANSIX962_EC_C2TNB239V3 = 234, - SEC_OID_ANSIX962_EC_C2ONB239V4 = 235, - SEC_OID_ANSIX962_EC_C2ONB239V5 = 236, - SEC_OID_ANSIX962_EC_C2PNB272W1 = 237, - SEC_OID_ANSIX962_EC_C2PNB304W1 = 238, - SEC_OID_ANSIX962_EC_C2TNB359V1 = 239, - SEC_OID_ANSIX962_EC_C2PNB368W1 = 240, - SEC_OID_ANSIX962_EC_C2TNB431R1 = 241, - - /* SECG named elliptic curves (characteristic two field) */ - SEC_OID_SECG_EC_SECT113R1 = 242, - SEC_OID_SECG_EC_SECT113R2 = 243, - SEC_OID_SECG_EC_SECT131R1 = 244, - SEC_OID_SECG_EC_SECT131R2 = 245, - SEC_OID_SECG_EC_SECT163K1 = 246, - SEC_OID_SECG_EC_SECT163R1 = 247, - SEC_OID_SECG_EC_SECT163R2 = 248, - SEC_OID_SECG_EC_SECT193R1 = 249, - SEC_OID_SECG_EC_SECT193R2 = 250, - SEC_OID_SECG_EC_SECT233K1 = 251, - SEC_OID_SECG_EC_SECT233R1 = 252, - SEC_OID_SECG_EC_SECT239K1 = 253, - SEC_OID_SECG_EC_SECT283K1 = 254, - SEC_OID_SECG_EC_SECT283R1 = 255, - SEC_OID_SECG_EC_SECT409K1 = 256, - SEC_OID_SECG_EC_SECT409R1 = 257, - SEC_OID_SECG_EC_SECT571K1 = 258, - SEC_OID_SECG_EC_SECT571R1 = 259, - - SEC_OID_NETSCAPE_AOLSCREENNAME = 260, - - SEC_OID_AVA_SURNAME = 261, - SEC_OID_AVA_SERIAL_NUMBER = 262, - SEC_OID_AVA_STREET_ADDRESS = 263, - SEC_OID_AVA_TITLE = 264, - SEC_OID_AVA_POSTAL_ADDRESS = 265, - SEC_OID_AVA_POSTAL_CODE = 266, - SEC_OID_AVA_POST_OFFICE_BOX = 267, - SEC_OID_AVA_GIVEN_NAME = 268, - SEC_OID_AVA_INITIALS = 269, - SEC_OID_AVA_GENERATION_QUALIFIER = 270, - SEC_OID_AVA_HOUSE_IDENTIFIER = 271, - SEC_OID_AVA_PSEUDONYM = 272, - - /* More OIDs */ - SEC_OID_PKIX_CA_ISSUERS = 273, - SEC_OID_PKCS9_EXTENSION_REQUEST = 274, - - /* new EC Signature oids */ - SEC_OID_ANSIX962_ECDSA_SIGNATURE_RECOMMENDED_DIGEST = 275, - SEC_OID_ANSIX962_ECDSA_SIGNATURE_SPECIFIED_DIGEST = 276, - SEC_OID_ANSIX962_ECDSA_SHA224_SIGNATURE = 277, - SEC_OID_ANSIX962_ECDSA_SHA256_SIGNATURE = 278, - SEC_OID_ANSIX962_ECDSA_SHA384_SIGNATURE = 279, - SEC_OID_ANSIX962_ECDSA_SHA512_SIGNATURE = 280, - - /* More id-ce and id-pe OIDs from RFC 3280 */ - SEC_OID_X509_HOLD_INSTRUCTION_CODE = 281, - SEC_OID_X509_DELTA_CRL_INDICATOR = 282, - SEC_OID_X509_ISSUING_DISTRIBUTION_POINT = 283, - SEC_OID_X509_CERT_ISSUER = 284, - SEC_OID_X509_FRESHEST_CRL = 285, - SEC_OID_X509_INHIBIT_ANY_POLICY = 286, - SEC_OID_X509_SUBJECT_INFO_ACCESS = 287, - - /* Camellia OIDs (RFC3657)*/ - SEC_OID_CAMELLIA_128_CBC = 288, - SEC_OID_CAMELLIA_192_CBC = 289, - SEC_OID_CAMELLIA_256_CBC = 290, - - /* PKCS 5 V2 OIDS */ - SEC_OID_PKCS5_PBKDF2 = 291, - SEC_OID_PKCS5_PBES2 = 292, - SEC_OID_PKCS5_PBMAC1 = 293, - SEC_OID_HMAC_SHA1 = 294, - SEC_OID_HMAC_SHA224 = 295, - SEC_OID_HMAC_SHA256 = 296, - SEC_OID_HMAC_SHA384 = 297, - SEC_OID_HMAC_SHA512 = 298, - - SEC_OID_PKIX_TIMESTAMPING = 299, - SEC_OID_PKIX_CA_REPOSITORY = 300, - - SEC_OID_ISO_SHA1_WITH_RSA_SIGNATURE = 301, - - SEC_OID_SEED_CBC = 302, - - SEC_OID_X509_ANY_POLICY = 303, - - SEC_OID_PKCS1_RSA_OAEP_ENCRYPTION = 304, - SEC_OID_PKCS1_MGF1 = 305, - SEC_OID_PKCS1_PSPECIFIED = 306, - SEC_OID_PKCS1_RSA_PSS_SIGNATURE = 307, - SEC_OID_PKCS1_SHA224_WITH_RSA_ENCRYPTION = 308, - - SEC_OID_SHA224 = 309, - - SEC_OID_EV_INCORPORATION_LOCALITY = 310, - SEC_OID_EV_INCORPORATION_STATE = 311, - SEC_OID_EV_INCORPORATION_COUNTRY = 312, - SEC_OID_BUSINESS_CATEGORY = 313, - - SEC_OID_NIST_DSA_SIGNATURE_WITH_SHA224_DIGEST = 314, - SEC_OID_NIST_DSA_SIGNATURE_WITH_SHA256_DIGEST = 315, - - /* Microsoft Trust List Signing - * szOID_KP_CTL_USAGE_SIGNING - * where KP stands for Key Purpose - */ - SEC_OID_MS_EXT_KEY_USAGE_CTL_SIGNING = 316, - - /* The 'name' attribute type in X.520 */ - SEC_OID_AVA_NAME = 317, - - SEC_OID_TOTAL -} SECOidTag; - -#define SEC_OID_SECG_EC_SECP192R1 SEC_OID_ANSIX962_EC_PRIME192V1 -#define SEC_OID_SECG_EC_SECP256R1 SEC_OID_ANSIX962_EC_PRIME256V1 -#define SEC_OID_PKCS12_KEY_USAGE SEC_OID_X509_KEY_USAGE - -/* fake OID for DSS sign/verify */ -#define SEC_OID_SHA SEC_OID_MISS_DSS - -typedef enum { - INVALID_CERT_EXTENSION = 0, - UNSUPPORTED_CERT_EXTENSION = 1, - SUPPORTED_CERT_EXTENSION = 2 -} SECSupportExtenTag; - -struct SECOidDataStr { - SECItem oid; - SECOidTag offset; - const char * desc; - unsigned long mechanism; - SECSupportExtenTag supportedExtension; - /* only used for x.509 v3 extensions, so - that we can print the names of those - extensions that we don't even support */ -}; - -/* New Opaque extended OID table API. - * These are algorithm policy Flags, used with functions - * NSS_SetAlgorithmPolicy & NSS_GetAlgorithmPolicy. - */ -#define NSS_USE_ALG_IN_CERT_SIGNATURE 0x00000001 /* CRLs and OCSP, too */ -#define NSS_USE_ALG_IN_CMS_SIGNATURE 0x00000002 /* used in S/MIME */ -#define NSS_USE_ALG_RESERVED 0xfffffffc /* may be used in future */ - -/* Code MUST NOT SET or CLEAR reserved bits, and must NOT depend on them - * being all zeros or having any other known value. The reserved bits - * must be ignored. - */ - - -#endif /* _SECOIDT_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secport.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secport.h deleted file mode 100755 index f01eb74..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/secport.h +++ /dev/null @@ -1,252 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * secport.h - portability interfaces for security libraries - */ - -#ifndef _SECPORT_H_ -#define _SECPORT_H_ - -#include "utilrename.h" -#include "prlink.h" - -/* - * define XP_WIN, XP_BEOS, or XP_UNIX, in case they are not defined - * by anyone else - */ -#ifdef _WINDOWS -# ifndef XP_WIN -# define XP_WIN -# endif -#if defined(_WIN32) || defined(WIN32) -# ifndef XP_WIN32 -# define XP_WIN32 -# endif -#endif -#endif - -#ifdef __BEOS__ -# ifndef XP_BEOS -# define XP_BEOS -# endif -#endif - -#ifdef unix -# ifndef XP_UNIX -# define XP_UNIX -# endif -#endif - -#include - -#include -#include -#include -#include -#include "prtypes.h" -#include "prlog.h" /* for PR_ASSERT */ -#include "plarena.h" -#include "plstr.h" - -/* - * HACK for NSS 2.8 to allow Admin to compile without source changes. - */ -#ifndef SEC_BEGIN_PROTOS -#include "seccomon.h" -#endif - -SEC_BEGIN_PROTOS - -extern void *PORT_Alloc(size_t len); -extern void *PORT_Realloc(void *old, size_t len); -extern void *PORT_AllocBlock(size_t len); -extern void *PORT_ReallocBlock(void *old, size_t len); -extern void PORT_FreeBlock(void *ptr); -extern void *PORT_ZAlloc(size_t len); -extern void PORT_Free(void *ptr); -extern void PORT_ZFree(void *ptr, size_t len); -extern char *PORT_Strdup(const char *s); -extern time_t PORT_Time(void); -extern void PORT_SetError(int value); -extern int PORT_GetError(void); - -extern PLArenaPool *PORT_NewArena(unsigned long chunksize); -extern void *PORT_ArenaAlloc(PLArenaPool *arena, size_t size); -extern void *PORT_ArenaZAlloc(PLArenaPool *arena, size_t size); -extern void PORT_FreeArena(PLArenaPool *arena, PRBool zero); -extern void *PORT_ArenaGrow(PLArenaPool *arena, void *ptr, - size_t oldsize, size_t newsize); -extern void *PORT_ArenaMark(PLArenaPool *arena); -extern void PORT_ArenaRelease(PLArenaPool *arena, void *mark); -extern void PORT_ArenaZRelease(PLArenaPool *arena, void *mark); -extern void PORT_ArenaUnmark(PLArenaPool *arena, void *mark); -extern char *PORT_ArenaStrdup(PLArenaPool *arena, const char *str); - -SEC_END_PROTOS - -#define PORT_Assert PR_ASSERT -#define PORT_ZNew(type) (type*)PORT_ZAlloc(sizeof(type)) -#define PORT_New(type) (type*)PORT_Alloc(sizeof(type)) -#define PORT_ArenaNew(poolp, type) \ - (type*) PORT_ArenaAlloc(poolp, sizeof(type)) -#define PORT_ArenaZNew(poolp, type) \ - (type*) PORT_ArenaZAlloc(poolp, sizeof(type)) -#define PORT_NewArray(type, num) \ - (type*) PORT_Alloc (sizeof(type)*(num)) -#define PORT_ZNewArray(type, num) \ - (type*) PORT_ZAlloc (sizeof(type)*(num)) -#define PORT_ArenaNewArray(poolp, type, num) \ - (type*) PORT_ArenaAlloc (poolp, sizeof(type)*(num)) -#define PORT_ArenaZNewArray(poolp, type, num) \ - (type*) PORT_ArenaZAlloc (poolp, sizeof(type)*(num)) - -/* Please, keep these defines sorted alphabetically. Thanks! */ - -#define PORT_Atoi(buff) (int)strtol(buff, NULL, 10) - -/* Returns a UTF-8 encoded constant error string for err. - * Returns NULL if initialization of the error tables fails - * due to insufficient memory. - * - * This string must not be modified by the application. - */ -#define PORT_ErrorToString(err) PR_ErrorToString((err), PR_LANGUAGE_I_DEFAULT) - -#define PORT_ErrorToName PR_ErrorToName - -#define PORT_Memcmp memcmp -#define PORT_Memcpy memcpy -#ifndef SUNOS4 -#define PORT_Memmove memmove -#else /*SUNOS4*/ -#define PORT_Memmove(s,ct,n) bcopy ((ct), (s), (n)) -#endif/*SUNOS4*/ -#define PORT_Memset memset - -#define PORT_Strcasecmp PL_strcasecmp -#define PORT_Strcat strcat -#define PORT_Strchr strchr -#define PORT_Strrchr strrchr -#define PORT_Strcmp strcmp -#define PORT_Strcpy strcpy -#define PORT_Strlen(s) strlen(s) -#define PORT_Strncasecmp PL_strncasecmp -#define PORT_Strncat strncat -#define PORT_Strncmp strncmp -#define PORT_Strncpy strncpy -#define PORT_Strpbrk strpbrk -#define PORT_Strstr strstr -#define PORT_Strtok strtok - -#define PORT_Tolower tolower - -typedef PRBool (PR_CALLBACK * PORTCharConversionWSwapFunc) (PRBool toUnicode, - unsigned char *inBuf, unsigned int inBufLen, - unsigned char *outBuf, unsigned int maxOutBufLen, - unsigned int *outBufLen, PRBool swapBytes); - -typedef PRBool (PR_CALLBACK * PORTCharConversionFunc) (PRBool toUnicode, - unsigned char *inBuf, unsigned int inBufLen, - unsigned char *outBuf, unsigned int maxOutBufLen, - unsigned int *outBufLen); - -SEC_BEGIN_PROTOS - -void PORT_SetUCS4_UTF8ConversionFunction(PORTCharConversionFunc convFunc); -void PORT_SetUCS2_ASCIIConversionFunction(PORTCharConversionWSwapFunc convFunc); -PRBool PORT_UCS4_UTF8Conversion(PRBool toUnicode, unsigned char *inBuf, - unsigned int inBufLen, unsigned char *outBuf, - unsigned int maxOutBufLen, unsigned int *outBufLen); -PRBool PORT_UCS2_ASCIIConversion(PRBool toUnicode, unsigned char *inBuf, - unsigned int inBufLen, unsigned char *outBuf, - unsigned int maxOutBufLen, unsigned int *outBufLen, - PRBool swapBytes); -void PORT_SetUCS2_UTF8ConversionFunction(PORTCharConversionFunc convFunc); -PRBool PORT_UCS2_UTF8Conversion(PRBool toUnicode, unsigned char *inBuf, - unsigned int inBufLen, unsigned char *outBuf, - unsigned int maxOutBufLen, unsigned int *outBufLen); - -/* One-way conversion from ISO-8859-1 to UTF-8 */ -PRBool PORT_ISO88591_UTF8Conversion(const unsigned char *inBuf, - unsigned int inBufLen, unsigned char *outBuf, - unsigned int maxOutBufLen, unsigned int *outBufLen); - -extern PRBool -sec_port_ucs4_utf8_conversion_function -( - PRBool toUnicode, - unsigned char *inBuf, - unsigned int inBufLen, - unsigned char *outBuf, - unsigned int maxOutBufLen, - unsigned int *outBufLen -); - -extern PRBool -sec_port_ucs2_utf8_conversion_function -( - PRBool toUnicode, - unsigned char *inBuf, - unsigned int inBufLen, - unsigned char *outBuf, - unsigned int maxOutBufLen, - unsigned int *outBufLen -); - -/* One-way conversion from ISO-8859-1 to UTF-8 */ -extern PRBool -sec_port_iso88591_utf8_conversion_function -( - const unsigned char *inBuf, - unsigned int inBufLen, - unsigned char *outBuf, - unsigned int maxOutBufLen, - unsigned int *outBufLen -); - -extern int NSS_PutEnv(const char * envVarName, const char * envValue); - -extern int NSS_SecureMemcmp(const void *a, const void *b, size_t n); - -#ifndef NSS_STATIC -/* - * Load a shared library called "newShLibName" in the same directory as - * a shared library that is already loaded, called existingShLibName. - * A pointer to a static function in that shared library, - * staticShLibFunc, is required. - * - * existingShLibName: - * The file name of the shared library that shall be used as the - * "reference library". The loader will attempt to load the requested - * library from the same directory as the reference library. - * - * staticShLibFunc: - * Pointer to a static function in the "reference library". - * - * newShLibName: - * The simple file name of the new shared library to be loaded. - * - * We use PR_GetLibraryFilePathname to get the pathname of the loaded - * shared lib that contains this function, and then do a - * PR_LoadLibraryWithFlags with an absolute pathname for the shared - * library to be loaded. - * - * On Windows, the "alternate search path" strategy is employed, if available. - * On Unix, if existingShLibName is a symbolic link, and no link exists for the - * new library, the original link will be resolved, and the new library loaded - * from the resolved location. - * - * If the new shared library is not found in the same location as the reference - * library, it will then be loaded from the normal system library path. - */ -PRLibrary * -PORT_LoadLibraryFromOrigin(const char* existingShLibName, - PRFuncPtr staticShLibFunc, - const char *newShLibName); -#endif /* NSS_STATIC */ - -SEC_END_PROTOS - -#endif /* _SECPORT_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/utilmodt.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/utilmodt.h deleted file mode 100755 index 825e59f..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/utilmodt.h +++ /dev/null @@ -1,42 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef _UTILMODT_H_ -#define _UTILMODT_H_ 1 - -/* - * these are SECMOD flags that would normally be in secmodt.h, but are needed - * for the parser in util. Fort this reason we preserve the SECMOD names. - */ -#define SECMOD_RSA_FLAG 0x00000001L -#define SECMOD_DSA_FLAG 0x00000002L -#define SECMOD_RC2_FLAG 0x00000004L -#define SECMOD_RC4_FLAG 0x00000008L -#define SECMOD_DES_FLAG 0x00000010L -#define SECMOD_DH_FLAG 0x00000020L -#define SECMOD_FORTEZZA_FLAG 0x00000040L -#define SECMOD_RC5_FLAG 0x00000080L -#define SECMOD_SHA1_FLAG 0x00000100L -#define SECMOD_MD5_FLAG 0x00000200L -#define SECMOD_MD2_FLAG 0x00000400L -#define SECMOD_SSL_FLAG 0x00000800L -#define SECMOD_TLS_FLAG 0x00001000L -#define SECMOD_AES_FLAG 0x00002000L -#define SECMOD_SHA256_FLAG 0x00004000L -#define SECMOD_SHA512_FLAG 0x00008000L /* also for SHA384 */ -#define SECMOD_CAMELLIA_FLAG 0x00010000L /* = PUBLIC_MECH_CAMELLIA_FLAG */ -#define SECMOD_SEED_FLAG 0x00020000L -/* reserved bit for future, do not use */ -#define SECMOD_RESERVED_FLAG 0X08000000L -#define SECMOD_FRIENDLY_FLAG 0x10000000L -#define SECMOD_RANDOM_FLAG 0x80000000L - -#define PK11_OWN_PW_DEFAULTS 0x20000000L -#define PK11_DISABLE_FLAG 0x40000000L - -/* need to make SECMOD and PK11 prefixes consistent. */ -#define SECMOD_OWN_PW_DEFAULTS PK11_OWN_PW_DEFAULTS -#define SECMOD_DISABLE_FLAG PK11_DISABLE_FLAG - -#endif /* _UTILMODT_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/utilpars.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/utilpars.h deleted file mode 100755 index e01ba14..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/utilpars.h +++ /dev/null @@ -1,56 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef _UTILPARS_H_ -#define _UTILPARS_H_ 1 - -#include "utilparst.h" -#include "plarena.h" - -/* handle a module db request */ -char ** NSSUTIL_DoModuleDBFunction(unsigned long function,char *parameters, void *args); - -/* parsing functions */ -char *NSSUTIL_ArgFetchValue(char *string, int *pcount); -char *NSSUTIL_ArgStrip(char *c); -char *NSSUTIL_ArgGetParamValue(char *paramName,char *parameters); -char *NSSUTIL_ArgSkipParameter(char *string); -char *NSSUTIL_ArgGetLabel(char *inString, int *next); -long NSSUTIL_ArgDecodeNumber(char *num); -PRBool NSSUTIL_ArgIsBlank(char c); -PRBool NSSUTIL_ArgHasFlag(char *label, char *flag, char *parameters); -long NSSUTIL_ArgReadLong(char *label,char *params, long defValue, - PRBool *isdefault); - -/* quoting functions */ -int NSSUTIL_EscapeSize(const char *string, char quote); -char *NSSUTIL_Escape(const char *string, char quote); -int NSSUTIL_QuoteSize(const char *string, char quote); -char *NSSUTIL_Quote(const char *string, char quote); -int NSSUTIL_DoubleEscapeSize(const char *string, char quote1, char quote2); -char *NSSUTIL_DoubleEscape(const char *string, char quote1, char quote2); - -unsigned long NSSUTIL_ArgParseSlotFlags(char *label,char *params); -struct NSSUTILPreSlotInfoStr *NSSUTIL_ArgParseSlotInfo(PLArenaPool *arena, - char *slotParams, int *retCount); -char * NSSUTIL_MkSlotString(unsigned long slotID, unsigned long defaultFlags, - unsigned long timeout, unsigned char askpw_in, - PRBool hasRootCerts, PRBool hasRootTrust); -SECStatus NSSUTIL_ArgParseModuleSpec(char *modulespec, char **lib, char **mod, - char **parameters, char **nss); -char *NSSUTIL_MkModuleSpec(char *dllName, char *commonName, - char *parameters, char *NSS); -void NSSUTIL_ArgParseCipherFlags(unsigned long *newCiphers,char *cipherList); -char * NSSUTIL_MkNSSString(char **slotStrings, int slotCount, PRBool internal, - PRBool isFIPS, PRBool isModuleDB, PRBool isModuleDBOnly, - PRBool isCritical, unsigned long trustOrder, - unsigned long cipherOrder, unsigned long ssl0, unsigned long ssl1); - -/* - * private functions for softoken. - */ -char * _NSSUTIL_GetSecmodName(char *param, NSSDBType *dbType, char **appName, char **filename,PRBool *rw); -const char *_NSSUTIL_EvaluateConfigDir(const char *configdir, NSSDBType *dbType, char **app); - -#endif /* _UTILPARS_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/utilparst.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/utilparst.h deleted file mode 100755 index 01d87ad..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/utilparst.h +++ /dev/null @@ -1,76 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef UTILPARS_T_H -#define UTILPARS_T_H 1 -#include "pkcs11t.h" - -/* - * macros to handle parsing strings of blank sparated arguments. - * Several NSSUTIL_HANDLE_STRING() macros should be places one after another with no intervening - * code. The first ones have precedence over the later ones. The last Macro should be - * NSSUTIL_HANDLE_FINAL_ARG. - * - * param is the input parameters. On exit param will point to the next parameter to parse. If the - * last paramter has been returned, param points to a null byte (*param = '0'); - * target is the location to store any data aquired from the parameter. Caller is responsible to free this data. - * value is the string value of the parameter. - * command is any commands you need to run to help process the parameter's data. - */ -#define NSSUTIL_HANDLE_STRING_ARG(param,target,value,command) \ - if (PORT_Strncasecmp(param,value,sizeof(value)-1) == 0) { \ - param += sizeof(value)-1; \ - if (target) PORT_Free(target); \ - target = NSSUTIL_ArgFetchValue(param,&next); \ - param += next; \ - command ;\ - } else - -#define NSSUTIL_HANDLE_FINAL_ARG(param) \ - { param = NSSUTIL_ArgSkipParameter(param); } param = NSSUTIL_ArgStrip(param); - -#define NSSUTIL_PATH_SEPARATOR "/" - -/* default module configuration strings */ -#define NSSUTIL_DEFAULT_INTERNAL_INIT1 \ - "library= name=\"NSS Internal PKCS #11 Module\" parameters=" -#define NSSUTIL_DEFAULT_INTERNAL_INIT2 \ - " NSS=\"Flags=internal,critical trustOrder=75 cipherOrder=100 slotParams=(1={" -#define NSSUTIL_DEFAULT_INTERNAL_INIT3 \ - " askpw=any timeout=30})\"" -#define NSSUTIL_DEFAULT_SFTKN_FLAGS \ - "slotFlags=[RSA,DSA,DH,RC2,RC4,DES,RANDOM,SHA1,MD5,MD2,SSL,TLS,AES,Camellia,SEED,SHA256,SHA512]" - -#define NSSUTIL_DEFAULT_CIPHER_ORDER 0 -#define NSSUTIL_DEFAULT_TRUST_ORDER 50 -#define NSSUTIL_ARG_ESCAPE '\\' - - -/* hold slot default flags until we initialize a slot. This structure is only - * useful between the time we define a module (either by hand or from the - * database) and the time the module is loaded. Not reference counted */ -struct NSSUTILPreSlotInfoStr { - CK_SLOT_ID slotID; /* slot these flags are for */ - unsigned long defaultFlags; /* bit mask of default implementation this slot - * provides */ - int askpw; /* slot specific password bits */ - long timeout; /* slot specific timeout value */ - char hasRootCerts; /* is this the root cert PKCS #11 module? */ - char hasRootTrust; /* is this the root cert PKCS #11 module? */ - int reserved0[2]; - void *reserved1[2]; -}; - - -/* - * private functions for softoken. - */ -typedef enum { - NSS_DB_TYPE_NONE= 0, - NSS_DB_TYPE_SQL, - NSS_DB_TYPE_EXTERN, - NSS_DB_TYPE_LEGACY, - NSS_DB_TYPE_MULTIACCESS -} NSSDBType; - -#endif /* UTILPARS_T_H */ diff --git a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/utilrename.h b/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/utilrename.h deleted file mode 100755 index 1aea3d2..0000000 --- a/thirdparties/common/include/webrtc-sdk/third_party/nss/nss/lib/util/utilrename.h +++ /dev/null @@ -1,162 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* - * utilrename.h - rename symbols moved from libnss3 to libnssutil3 - * - */ - -#ifndef _LIBUTIL_H_ -#define _LIBUTIL_H_ _LIBUTIL_H__Util - -#ifdef USE_UTIL_DIRECTLY - -/* functions moved from libnss3 */ -#define ATOB_AsciiToData ATOB_AsciiToData_Util -#define ATOB_ConvertAsciiToItem ATOB_ConvertAsciiToItem_Util -#define BTOA_ConvertItemToAscii BTOA_ConvertItemToAscii_Util -#define BTOA_DataToAscii BTOA_DataToAscii_Util -#define CERT_GenTime2FormattedAscii CERT_GenTime2FormattedAscii_Util -#define DER_AsciiToTime DER_AsciiToTime_Util -#define DER_DecodeTimeChoice DER_DecodeTimeChoice_Util -#define DER_Encode DER_Encode_Util -#define DER_EncodeTimeChoice DER_EncodeTimeChoice_Util -#define DER_GeneralizedDayToAscii DER_GeneralizedDayToAscii_Util -#define DER_GeneralizedTimeToTime DER_GeneralizedTimeToTime_Util -#define DER_GetInteger DER_GetInteger_Util -#define DER_Lengths DER_Lengths_Util -#define DER_TimeChoiceDayToAscii DER_TimeChoiceDayToAscii_Util -#define DER_TimeToGeneralizedTime DER_TimeToGeneralizedTime_Util -#define DER_TimeToGeneralizedTimeArena DER_TimeToGeneralizedTimeArena_Util -#define DER_TimeToUTCTime DER_TimeToUTCTime_Util -#define DER_UTCDayToAscii DER_UTCDayToAscii_Util -#define DER_UTCTimeToAscii DER_UTCTimeToAscii_Util -#define DER_UTCTimeToTime DER_UTCTimeToTime_Util -#define NSS_PutEnv NSS_PutEnv_Util -#define NSSBase64_DecodeBuffer NSSBase64_DecodeBuffer_Util -#define NSSBase64_EncodeItem NSSBase64_EncodeItem_Util -#define NSSBase64Decoder_Create NSSBase64Decoder_Create_Util -#define NSSBase64Decoder_Destroy NSSBase64Decoder_Destroy_Util -#define NSSBase64Decoder_Update NSSBase64Decoder_Update_Util -#define NSSBase64Encoder_Create NSSBase64Encoder_Create_Util -#define NSSBase64Encoder_Destroy NSSBase64Encoder_Destroy_Util -#define NSSBase64Encoder_Update NSSBase64Encoder_Update_Util -#define NSSRWLock_Destroy NSSRWLock_Destroy_Util -#define NSSRWLock_HaveWriteLock NSSRWLock_HaveWriteLock_Util -#define NSSRWLock_LockRead NSSRWLock_LockRead_Util -#define NSSRWLock_LockWrite NSSRWLock_LockWrite_Util -#define NSSRWLock_New NSSRWLock_New_Util -#define NSSRWLock_UnlockRead NSSRWLock_UnlockRead_Util -#define NSSRWLock_UnlockWrite NSSRWLock_UnlockWrite_Util -#define PORT_Alloc PORT_Alloc_Util -#define PORT_ArenaAlloc PORT_ArenaAlloc_Util -#define PORT_ArenaGrow PORT_ArenaGrow_Util -#define PORT_ArenaMark PORT_ArenaMark_Util -#define PORT_ArenaRelease PORT_ArenaRelease_Util -#define PORT_ArenaStrdup PORT_ArenaStrdup_Util -#define PORT_ArenaUnmark PORT_ArenaUnmark_Util -#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util -#define PORT_Free PORT_Free_Util -#define PORT_FreeArena PORT_FreeArena_Util -#define PORT_GetError PORT_GetError_Util -#define PORT_NewArena PORT_NewArena_Util -#define PORT_Realloc PORT_Realloc_Util -#define PORT_SetError PORT_SetError_Util -#define PORT_SetUCS2_ASCIIConversionFunction PORT_SetUCS2_ASCIIConversionFunction_Util -#define PORT_SetUCS2_UTF8ConversionFunction PORT_SetUCS2_UTF8ConversionFunction_Util -#define PORT_SetUCS4_UTF8ConversionFunction PORT_SetUCS4_UTF8ConversionFunction_Util -#define PORT_Strdup PORT_Strdup_Util -#define PORT_UCS2_ASCIIConversion PORT_UCS2_ASCIIConversion_Util -#define PORT_UCS2_UTF8Conversion PORT_UCS2_UTF8Conversion_Util -#define PORT_ZAlloc PORT_ZAlloc_Util -#define PORT_ZFree PORT_ZFree_Util -#define SEC_ASN1Decode SEC_ASN1Decode_Util -#define SEC_ASN1DecodeInteger SEC_ASN1DecodeInteger_Util -#define SEC_ASN1DecodeItem SEC_ASN1DecodeItem_Util -#define SEC_ASN1DecoderAbort SEC_ASN1DecoderAbort_Util -#define SEC_ASN1DecoderClearFilterProc SEC_ASN1DecoderClearFilterProc_Util -#define SEC_ASN1DecoderClearNotifyProc SEC_ASN1DecoderClearNotifyProc_Util -#define SEC_ASN1DecoderFinish SEC_ASN1DecoderFinish_Util -#define SEC_ASN1DecoderSetFilterProc SEC_ASN1DecoderSetFilterProc_Util -#define SEC_ASN1DecoderSetNotifyProc SEC_ASN1DecoderSetNotifyProc_Util -#define SEC_ASN1DecoderStart SEC_ASN1DecoderStart_Util -#define SEC_ASN1DecoderUpdate SEC_ASN1DecoderUpdate_Util -#define SEC_ASN1Encode SEC_ASN1Encode_Util -#define SEC_ASN1EncodeInteger SEC_ASN1EncodeInteger_Util -#define SEC_ASN1EncodeItem SEC_ASN1EncodeItem_Util -#define SEC_ASN1EncoderAbort SEC_ASN1EncoderAbort_Util -#define SEC_ASN1EncoderClearNotifyProc SEC_ASN1EncoderClearNotifyProc_Util -#define SEC_ASN1EncoderClearStreaming SEC_ASN1EncoderClearStreaming_Util -#define SEC_ASN1EncoderClearTakeFromBuf SEC_ASN1EncoderClearTakeFromBuf_Util -#define SEC_ASN1EncoderFinish SEC_ASN1EncoderFinish_Util -#define SEC_ASN1EncoderSetNotifyProc SEC_ASN1EncoderSetNotifyProc_Util -#define SEC_ASN1EncoderSetStreaming SEC_ASN1EncoderSetStreaming_Util -#define SEC_ASN1EncoderSetTakeFromBuf SEC_ASN1EncoderSetTakeFromBuf_Util -#define SEC_ASN1EncoderStart SEC_ASN1EncoderStart_Util -#define SEC_ASN1EncoderUpdate SEC_ASN1EncoderUpdate_Util -#define SEC_ASN1EncodeUnsignedInteger SEC_ASN1EncodeUnsignedInteger_Util -#define SEC_ASN1LengthLength SEC_ASN1LengthLength_Util -#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util -#define SECITEM_AllocItem SECITEM_AllocItem_Util -#define SECITEM_ArenaDupItem SECITEM_ArenaDupItem_Util -#define SECITEM_CompareItem SECITEM_CompareItem_Util -#define SECITEM_CopyItem SECITEM_CopyItem_Util -#define SECITEM_DupItem SECITEM_DupItem_Util -#define SECITEM_FreeItem SECITEM_FreeItem_Util -#define SECITEM_ItemsAreEqual SECITEM_ItemsAreEqual_Util -#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util -#define SECOID_AddEntry SECOID_AddEntry_Util -#define SECOID_CompareAlgorithmID SECOID_CompareAlgorithmID_Util -#define SECOID_CopyAlgorithmID SECOID_CopyAlgorithmID_Util -#define SECOID_DestroyAlgorithmID SECOID_DestroyAlgorithmID_Util -#define SECOID_FindOID SECOID_FindOID_Util -#define SECOID_FindOIDByTag SECOID_FindOIDByTag_Util -#define SECOID_FindOIDTag SECOID_FindOIDTag_Util -#define SECOID_FindOIDTagDescription SECOID_FindOIDTagDescription_Util -#define SECOID_GetAlgorithmTag SECOID_GetAlgorithmTag_Util -#define SECOID_SetAlgorithmID SECOID_SetAlgorithmID_Util -#define SGN_CompareDigestInfo SGN_CompareDigestInfo_Util -#define SGN_CopyDigestInfo SGN_CopyDigestInfo_Util -#define SGN_CreateDigestInfo SGN_CreateDigestInfo_Util -#define SGN_DestroyDigestInfo SGN_DestroyDigestInfo_Util - -/* templates moved from libnss3 */ -#define NSS_Get_SEC_AnyTemplate NSS_Get_SEC_AnyTemplate_Util -#define NSS_Get_SEC_BitStringTemplate NSS_Get_SEC_BitStringTemplate_Util -#define NSS_Get_SEC_BMPStringTemplate NSS_Get_SEC_BMPStringTemplate_Util -#define NSS_Get_SEC_BooleanTemplate NSS_Get_SEC_BooleanTemplate_Util -#define NSS_Get_SEC_GeneralizedTimeTemplate NSS_Get_SEC_GeneralizedTimeTemplate_Util -#define NSS_Get_SEC_IA5StringTemplate NSS_Get_SEC_IA5StringTemplate_Util -#define NSS_Get_SEC_IntegerTemplate NSS_Get_SEC_IntegerTemplate_Util -#define NSS_Get_SEC_NullTemplate NSS_Get_SEC_NullTemplate_Util -#define NSS_Get_SEC_ObjectIDTemplate NSS_Get_SEC_ObjectIDTemplate_Util -#define NSS_Get_SEC_OctetStringTemplate NSS_Get_SEC_OctetStringTemplate_Util -#define NSS_Get_SEC_PointerToAnyTemplate NSS_Get_SEC_PointerToAnyTemplate_Util -#define NSS_Get_SEC_PointerToOctetStringTemplate NSS_Get_SEC_PointerToOctetStringTemplate_Util -#define NSS_Get_SEC_SetOfAnyTemplate NSS_Get_SEC_SetOfAnyTemplate_Util -#define NSS_Get_SEC_UTCTimeTemplate NSS_Get_SEC_UTCTimeTemplate_Util -#define NSS_Get_SEC_UTF8StringTemplate NSS_Get_SEC_UTF8StringTemplate_Util -#define NSS_Get_SECOID_AlgorithmIDTemplate NSS_Get_SECOID_AlgorithmIDTemplate_Util -#define NSS_Get_sgn_DigestInfoTemplate NSS_Get_sgn_DigestInfoTemplate_Util -#define SEC_AnyTemplate SEC_AnyTemplate_Util -#define SEC_BitStringTemplate SEC_BitStringTemplate_Util -#define SEC_BMPStringTemplate SEC_BMPStringTemplate_Util -#define SEC_BooleanTemplate SEC_BooleanTemplate_Util -#define SEC_GeneralizedTimeTemplate SEC_GeneralizedTimeTemplate_Util -#define SEC_IA5StringTemplate SEC_IA5StringTemplate_Util -#define SEC_IntegerTemplate SEC_IntegerTemplate_Util -#define SEC_NullTemplate SEC_NullTemplate_Util -#define SEC_ObjectIDTemplate SEC_ObjectIDTemplate_Util -#define SEC_OctetStringTemplate SEC_OctetStringTemplate_Util -#define SEC_PointerToAnyTemplate SEC_PointerToAnyTemplate_Util -#define SEC_PointerToOctetStringTemplate SEC_PointerToOctetStringTemplate_Util -#define SEC_SetOfAnyTemplate SEC_SetOfAnyTemplate_Util -#define SEC_UTCTimeTemplate SEC_UTCTimeTemplate_Util -#define SEC_UTF8StringTemplate SEC_UTF8StringTemplate_Util -#define SECOID_AlgorithmIDTemplate SECOID_AlgorithmIDTemplate_Util -#define sgn_DigestInfoTemplate sgn_DigestInfoTemplate_Util - -#endif /* USE_UTIL_DIRECTLY */ - -#endif /* _LIBUTIL_H_ */ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/base/constructormagic.h b/thirdparties/common/include/webrtc-sdk/webrtc/base/constructormagic.h deleted file mode 100755 index c20be2b..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/base/constructormagic.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2004 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_BASE_CONSTRUCTORMAGIC_H_ -#define WEBRTC_BASE_CONSTRUCTORMAGIC_H_ - -#define DISALLOW_ASSIGN(TypeName) \ - void operator=(const TypeName&) - -// A macro to disallow the evil copy constructor and operator= functions -// This should be used in the private: declarations for a class. -// Undefine this, just in case. Some third-party includes have their own -// version. -#undef DISALLOW_COPY_AND_ASSIGN -#define DISALLOW_COPY_AND_ASSIGN(TypeName) \ - TypeName(const TypeName&); \ - DISALLOW_ASSIGN(TypeName) - -// Alternative, less-accurate legacy name. -#define DISALLOW_EVIL_CONSTRUCTORS(TypeName) \ - DISALLOW_COPY_AND_ASSIGN(TypeName) - -// A macro to disallow all the implicit constructors, namely the -// default constructor, copy constructor and operator= functions. -// -// This should be used in the private: declarations for a class -// that wants to prevent anyone from instantiating it. This is -// especially useful for classes containing only static methods. -#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ - TypeName(); \ - DISALLOW_EVIL_CONSTRUCTORS(TypeName) - - -#endif // WEBRTC_BASE_CONSTRUCTORMAGIC_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/common_types.h b/thirdparties/common/include/webrtc-sdk/webrtc/common_types.h deleted file mode 100755 index 6892a83..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/common_types.h +++ /dev/null @@ -1,788 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_COMMON_TYPES_H_ -#define WEBRTC_COMMON_TYPES_H_ - -#include -#include - -#include -#include - -#include "webrtc/typedefs.h" - -#if defined(_MSC_VER) -// Disable "new behavior: elements of array will be default initialized" -// warning. Affects OverUseDetectorOptions. -#pragma warning(disable:4351) -#endif - -#ifdef WEBRTC_EXPORT -#define WEBRTC_DLLEXPORT _declspec(dllexport) -#elif WEBRTC_DLL -#define WEBRTC_DLLEXPORT _declspec(dllimport) -#else -#define WEBRTC_DLLEXPORT -#endif - -#ifndef NULL -#define NULL 0 -#endif - -#define RTP_PAYLOAD_NAME_SIZE 32 - -#if defined(WEBRTC_WIN) || defined(WIN32) -// Compares two strings without regard to case. -#define STR_CASE_CMP(s1, s2) ::_stricmp(s1, s2) -// Compares characters of two strings without regard to case. -#define STR_NCASE_CMP(s1, s2, n) ::_strnicmp(s1, s2, n) -#else -#define STR_CASE_CMP(s1, s2) ::strcasecmp(s1, s2) -#define STR_NCASE_CMP(s1, s2, n) ::strncasecmp(s1, s2, n) -#endif - -namespace webrtc { - -class Config; - -class InStream -{ -public: - virtual int Read(void *buf,int len) = 0; - virtual int Rewind() {return -1;} - virtual ~InStream() {} -protected: - InStream() {} -}; - -class OutStream -{ -public: - virtual bool Write(const void *buf,int len) = 0; - virtual int Rewind() {return -1;} - virtual ~OutStream() {} -protected: - OutStream() {} -}; - -enum TraceModule -{ - kTraceUndefined = 0, - // not a module, triggered from the engine code - kTraceVoice = 0x0001, - // not a module, triggered from the engine code - kTraceVideo = 0x0002, - // not a module, triggered from the utility code - kTraceUtility = 0x0003, - kTraceRtpRtcp = 0x0004, - kTraceTransport = 0x0005, - kTraceSrtp = 0x0006, - kTraceAudioCoding = 0x0007, - kTraceAudioMixerServer = 0x0008, - kTraceAudioMixerClient = 0x0009, - kTraceFile = 0x000a, - kTraceAudioProcessing = 0x000b, - kTraceVideoCoding = 0x0010, - kTraceVideoMixer = 0x0011, - kTraceAudioDevice = 0x0012, - kTraceVideoRenderer = 0x0014, - kTraceVideoCapture = 0x0015, - kTraceRemoteBitrateEstimator = 0x0017, -}; - -enum TraceLevel -{ - kTraceNone = 0x0000, // no trace - kTraceStateInfo = 0x0001, - kTraceWarning = 0x0002, - kTraceError = 0x0004, - kTraceCritical = 0x0008, - kTraceApiCall = 0x0010, - kTraceDefault = 0x00ff, - - kTraceModuleCall = 0x0020, - kTraceMemory = 0x0100, // memory info - kTraceTimer = 0x0200, // timing info - kTraceStream = 0x0400, // "continuous" stream of data - - // used for debug purposes - kTraceDebug = 0x0800, // debug - kTraceInfo = 0x1000, // debug info - - // Non-verbose level used by LS_INFO of logging.h. Do not use directly. - kTraceTerseInfo = 0x2000, - - kTraceAll = 0xffff -}; - -// External Trace API -class TraceCallback { - public: - virtual void Print(TraceLevel level, const char* message, int length) = 0; - - protected: - virtual ~TraceCallback() {} - TraceCallback() {} -}; - -enum FileFormats -{ - kFileFormatWavFile = 1, - kFileFormatCompressedFile = 2, - kFileFormatAviFile = 3, - kFileFormatPreencodedFile = 4, - kFileFormatPcm16kHzFile = 7, - kFileFormatPcm8kHzFile = 8, - kFileFormatPcm32kHzFile = 9 -}; - -enum ProcessingTypes -{ - kPlaybackPerChannel = 0, - kPlaybackAllChannelsMixed, - kRecordingPerChannel, - kRecordingAllChannelsMixed, - kRecordingPreprocessing -}; - -enum FrameType -{ - kFrameEmpty = 0, - kAudioFrameSpeech = 1, - kAudioFrameCN = 2, - kVideoFrameKey = 3, // independent frame - kVideoFrameDelta = 4, // depends on the previus frame -}; - -// External transport callback interface -class Transport -{ -public: - virtual int SendPacket(int channel, const void *data, int len) = 0; - virtual int SendRTCPPacket(int channel, const void *data, int len) = 0; - -protected: - virtual ~Transport() {} - Transport() {} -}; - -// Statistics for an RTCP channel -struct RtcpStatistics { - RtcpStatistics() - : fraction_lost(0), - cumulative_lost(0), - extended_max_sequence_number(0), - jitter(0) {} - - uint8_t fraction_lost; - uint32_t cumulative_lost; - uint32_t extended_max_sequence_number; - uint32_t jitter; -}; - -// Callback, called whenever a new rtcp report block is transmitted. -class RtcpStatisticsCallback { - public: - virtual ~RtcpStatisticsCallback() {} - - virtual void StatisticsUpdated(const RtcpStatistics& statistics, - uint32_t ssrc) = 0; -}; - -// Statistics for RTCP packet types. -struct RtcpPacketTypeCounter { - RtcpPacketTypeCounter() - : nack_packets(0), - fir_packets(0), - pli_packets(0) {} - - void Add(const RtcpPacketTypeCounter& other) { - nack_packets += other.nack_packets; - fir_packets += other.fir_packets; - pli_packets += other.pli_packets; - } - - uint32_t nack_packets; - uint32_t fir_packets; - uint32_t pli_packets; -}; - -// Data usage statistics for a (rtp) stream -struct StreamDataCounters { - StreamDataCounters() - : bytes(0), - header_bytes(0), - padding_bytes(0), - packets(0), - retransmitted_packets(0), - fec_packets(0) {} - - uint32_t bytes; // Payload bytes, excluding RTP headers and padding. - uint32_t header_bytes; // Number of bytes used by RTP headers. - uint32_t padding_bytes; // Number of padding bytes. - uint32_t packets; // Number of packets. - uint32_t retransmitted_packets; // Number of retransmitted packets. - uint32_t fec_packets; // Number of redundancy packets. -}; - -// Callback, called whenever byte/packet counts have been updated. -class StreamDataCountersCallback { - public: - virtual ~StreamDataCountersCallback() {} - - virtual void DataCountersUpdated(const StreamDataCounters& counters, - uint32_t ssrc) = 0; -}; - -// Rate statistics for a stream -struct BitrateStatistics { - BitrateStatistics() : bitrate_bps(0), packet_rate(0), timestamp_ms(0) {} - - uint32_t bitrate_bps; // Bitrate in bits per second. - uint32_t packet_rate; // Packet rate in packets per second. - uint64_t timestamp_ms; // Ntp timestamp in ms at time of rate estimation. -}; - -// Callback, used to notify an observer whenever new rates have been estimated. -class BitrateStatisticsObserver { - public: - virtual ~BitrateStatisticsObserver() {} - - virtual void Notify(const BitrateStatistics& stats, uint32_t ssrc) = 0; -}; - -// Callback, used to notify an observer whenever frame counts have been updated -class FrameCountObserver { - public: - virtual ~FrameCountObserver() {} - virtual void FrameCountUpdated(FrameType frame_type, - uint32_t frame_count, - const unsigned int ssrc) = 0; -}; - -// ================================================================== -// Voice specific types -// ================================================================== - -// Each codec supported can be described by this structure. -struct CodecInst { - int pltype; - char plname[RTP_PAYLOAD_NAME_SIZE]; - int plfreq; - int pacsize; - int channels; - int rate; // bits/sec unlike {start,min,max}Bitrate elsewhere in this file! - - bool operator==(const CodecInst& other) const { - return pltype == other.pltype && - (STR_CASE_CMP(plname, other.plname) == 0) && - plfreq == other.plfreq && - pacsize == other.pacsize && - channels == other.channels && - rate == other.rate; - } - - bool operator!=(const CodecInst& other) const { - return !(*this == other); - } -}; - -// RTP -enum {kRtpCsrcSize = 15}; // RFC 3550 page 13 - -enum RTPDirections -{ - kRtpIncoming = 0, - kRtpOutgoing -}; - -enum PayloadFrequencies -{ - kFreq8000Hz = 8000, - kFreq16000Hz = 16000, - kFreq32000Hz = 32000 -}; - -enum VadModes // degree of bandwidth reduction -{ - kVadConventional = 0, // lowest reduction - kVadAggressiveLow, - kVadAggressiveMid, - kVadAggressiveHigh // highest reduction -}; - -struct NetworkStatistics // NETEQ statistics -{ - // current jitter buffer size in ms - uint16_t currentBufferSize; - // preferred (optimal) buffer size in ms - uint16_t preferredBufferSize; - // adding extra delay due to "peaky jitter" - bool jitterPeaksFound; - // loss rate (network + late) in percent (in Q14) - uint16_t currentPacketLossRate; - // late loss rate in percent (in Q14) - uint16_t currentDiscardRate; - // fraction (of original stream) of synthesized speech inserted through - // expansion (in Q14) - uint16_t currentExpandRate; - // fraction of synthesized speech inserted through pre-emptive expansion - // (in Q14) - uint16_t currentPreemptiveRate; - // fraction of data removed through acceleration (in Q14) - uint16_t currentAccelerateRate; - // clock-drift in parts-per-million (negative or positive) - int32_t clockDriftPPM; - // average packet waiting time in the jitter buffer (ms) - int meanWaitingTimeMs; - // median packet waiting time in the jitter buffer (ms) - int medianWaitingTimeMs; - // min packet waiting time in the jitter buffer (ms) - int minWaitingTimeMs; - // max packet waiting time in the jitter buffer (ms) - int maxWaitingTimeMs; - // added samples in off mode due to packet loss - int addedSamples; -}; - -// Statistics for calls to AudioCodingModule::PlayoutData10Ms(). -struct AudioDecodingCallStats { - AudioDecodingCallStats() - : calls_to_silence_generator(0), - calls_to_neteq(0), - decoded_normal(0), - decoded_plc(0), - decoded_cng(0), - decoded_plc_cng(0) {} - - int calls_to_silence_generator; // Number of calls where silence generated, - // and NetEq was disengaged from decoding. - int calls_to_neteq; // Number of calls to NetEq. - int decoded_normal; // Number of calls where audio RTP packet decoded. - int decoded_plc; // Number of calls resulted in PLC. - int decoded_cng; // Number of calls where comfort noise generated due to DTX. - int decoded_plc_cng; // Number of calls resulted where PLC faded to CNG. -}; - -typedef struct -{ - int min; // minumum - int max; // maximum - int average; // average -} StatVal; - -typedef struct // All levels are reported in dBm0 -{ - StatVal speech_rx; // long-term speech levels on receiving side - StatVal speech_tx; // long-term speech levels on transmitting side - StatVal noise_rx; // long-term noise/silence levels on receiving side - StatVal noise_tx; // long-term noise/silence levels on transmitting side -} LevelStatistics; - -typedef struct // All levels are reported in dB -{ - StatVal erl; // Echo Return Loss - StatVal erle; // Echo Return Loss Enhancement - StatVal rerl; // RERL = ERL + ERLE - // Echo suppression inside EC at the point just before its NLP - StatVal a_nlp; -} EchoStatistics; - -enum NsModes // type of Noise Suppression -{ - kNsUnchanged = 0, // previously set mode - kNsDefault, // platform default - kNsConference, // conferencing default - kNsLowSuppression, // lowest suppression - kNsModerateSuppression, - kNsHighSuppression, - kNsVeryHighSuppression, // highest suppression -}; - -enum AgcModes // type of Automatic Gain Control -{ - kAgcUnchanged = 0, // previously set mode - kAgcDefault, // platform default - // adaptive mode for use when analog volume control exists (e.g. for - // PC softphone) - kAgcAdaptiveAnalog, - // scaling takes place in the digital domain (e.g. for conference servers - // and embedded devices) - kAgcAdaptiveDigital, - // can be used on embedded devices where the capture signal level - // is predictable - kAgcFixedDigital -}; - -// EC modes -enum EcModes // type of Echo Control -{ - kEcUnchanged = 0, // previously set mode - kEcDefault, // platform default - kEcConference, // conferencing default (aggressive AEC) - kEcAec, // Acoustic Echo Cancellation - kEcAecm, // AEC mobile -}; - -// AECM modes -enum AecmModes // mode of AECM -{ - kAecmQuietEarpieceOrHeadset = 0, - // Quiet earpiece or headset use - kAecmEarpiece, // most earpiece use - kAecmLoudEarpiece, // Loud earpiece or quiet speakerphone use - kAecmSpeakerphone, // most speakerphone use (default) - kAecmLoudSpeakerphone // Loud speakerphone -}; - -// AGC configuration -typedef struct -{ - unsigned short targetLeveldBOv; - unsigned short digitalCompressionGaindB; - bool limiterEnable; -} AgcConfig; // AGC configuration parameters - -enum StereoChannel -{ - kStereoLeft = 0, - kStereoRight, - kStereoBoth -}; - -// Audio device layers -enum AudioLayers -{ - kAudioPlatformDefault = 0, - kAudioWindowsWave = 1, - kAudioWindowsCore = 2, - kAudioLinuxAlsa = 3, - kAudioLinuxPulse = 4 -}; - -// TODO(henrika): to be removed. -enum NetEqModes // NetEQ playout configurations -{ - // Optimized trade-off between low delay and jitter robustness for two-way - // communication. - kNetEqDefault = 0, - // Improved jitter robustness at the cost of increased delay. Can be - // used in one-way communication. - kNetEqStreaming = 1, - // Optimzed for decodability of fax signals rather than for perceived audio - // quality. - kNetEqFax = 2, - // Minimal buffer management. Inserts zeros for lost packets and during - // buffer increases. - kNetEqOff = 3, -}; - -// TODO(henrika): to be removed. -enum OnHoldModes // On Hold direction -{ - kHoldSendAndPlay = 0, // Put both sending and playing in on-hold state. - kHoldSendOnly, // Put only sending in on-hold state. - kHoldPlayOnly // Put only playing in on-hold state. -}; - -// TODO(henrika): to be removed. -enum AmrMode -{ - kRfc3267BwEfficient = 0, - kRfc3267OctetAligned = 1, - kRfc3267FileStorage = 2, -}; - -// ================================================================== -// Video specific types -// ================================================================== - -// Raw video types -enum RawVideoType -{ - kVideoI420 = 0, - kVideoYV12 = 1, - kVideoYUY2 = 2, - kVideoUYVY = 3, - kVideoIYUV = 4, - kVideoARGB = 5, - kVideoRGB24 = 6, - kVideoRGB565 = 7, - kVideoARGB4444 = 8, - kVideoARGB1555 = 9, - kVideoMJPEG = 10, - kVideoNV12 = 11, - kVideoNV21 = 12, - kVideoBGRA = 13, - kVideoUnknown = 99 -}; - -// Video codec -enum { kConfigParameterSize = 128}; -enum { kPayloadNameSize = 32}; -enum { kMaxSimulcastStreams = 4}; -enum { kMaxTemporalStreams = 4}; - -enum VideoCodecComplexity -{ - kComplexityNormal = 0, - kComplexityHigh = 1, - kComplexityHigher = 2, - kComplexityMax = 3 -}; - -enum VideoCodecProfile -{ - kProfileBase = 0x00, - kProfileMain = 0x01 -}; - -enum VP8ResilienceMode { - kResilienceOff, // The stream produced by the encoder requires a - // recovery frame (typically a key frame) to be - // decodable after a packet loss. - kResilientStream, // A stream produced by the encoder is resilient to - // packet losses, but packets within a frame subsequent - // to a loss can't be decoded. - kResilientFrames // Same as kResilientStream but with added resilience - // within a frame. -}; - -// VP8 specific -struct VideoCodecVP8 { - bool pictureLossIndicationOn; - bool feedbackModeOn; - VideoCodecComplexity complexity; - VP8ResilienceMode resilience; - unsigned char numberOfTemporalLayers; - bool denoisingOn; - bool errorConcealmentOn; - bool automaticResizeOn; - bool frameDroppingOn; - int keyFrameInterval; - - bool operator==(const VideoCodecVP8& other) const { - return pictureLossIndicationOn == other.pictureLossIndicationOn && - feedbackModeOn == other.feedbackModeOn && - complexity == other.complexity && - resilience == other.resilience && - numberOfTemporalLayers == other.numberOfTemporalLayers && - denoisingOn == other.denoisingOn && - errorConcealmentOn == other.errorConcealmentOn && - automaticResizeOn == other.automaticResizeOn && - frameDroppingOn == other.frameDroppingOn && - keyFrameInterval == other.keyFrameInterval; - } - - bool operator!=(const VideoCodecVP8& other) const { - return !(*this == other); - } -}; - -// Video codec types -enum VideoCodecType -{ - kVideoCodecVP8, - kVideoCodecI420, - kVideoCodecRED, - kVideoCodecULPFEC, - kVideoCodecGeneric, - kVideoCodecUnknown -}; - -union VideoCodecUnion -{ - VideoCodecVP8 VP8; -}; - - -// Simulcast is when the same stream is encoded multiple times with different -// settings such as resolution. -struct SimulcastStream { - unsigned short width; - unsigned short height; - unsigned char numberOfTemporalLayers; - unsigned int maxBitrate; // kilobits/sec. - unsigned int targetBitrate; // kilobits/sec. - unsigned int minBitrate; // kilobits/sec. - unsigned int qpMax; // minimum quality - - bool operator==(const SimulcastStream& other) const { - return width == other.width && - height == other.height && - numberOfTemporalLayers == other.numberOfTemporalLayers && - maxBitrate == other.maxBitrate && - targetBitrate == other.targetBitrate && - minBitrate == other.minBitrate && - qpMax == other.qpMax; - } - - bool operator!=(const SimulcastStream& other) const { - return !(*this == other); - } -}; - -enum VideoCodecMode { - kRealtimeVideo, - kScreensharing -}; - -// Common video codec properties -struct VideoCodec { - VideoCodecType codecType; - char plName[kPayloadNameSize]; - unsigned char plType; - - unsigned short width; - unsigned short height; - - unsigned int startBitrate; // kilobits/sec. - unsigned int maxBitrate; // kilobits/sec. - unsigned int minBitrate; // kilobits/sec. - unsigned int targetBitrate; // kilobits/sec. - - unsigned char maxFramerate; - - VideoCodecUnion codecSpecific; - - unsigned int qpMax; - unsigned char numberOfSimulcastStreams; - SimulcastStream simulcastStream[kMaxSimulcastStreams]; - - VideoCodecMode mode; - - // When using an external encoder/decoder this allows to pass - // extra options without requiring webrtc to be aware of them. - Config* extra_options; - - bool operator==(const VideoCodec& other) const { - bool ret = codecType == other.codecType && - (STR_CASE_CMP(plName, other.plName) == 0) && - plType == other.plType && - width == other.width && - height == other.height && - startBitrate == other.startBitrate && - maxBitrate == other.maxBitrate && - minBitrate == other.minBitrate && - targetBitrate == other.targetBitrate && - maxFramerate == other.maxFramerate && - qpMax == other.qpMax && - numberOfSimulcastStreams == other.numberOfSimulcastStreams && - mode == other.mode; - if (ret && codecType == kVideoCodecVP8) { - ret &= (codecSpecific.VP8 == other.codecSpecific.VP8); - } - - for (unsigned char i = 0; i < other.numberOfSimulcastStreams && ret; ++i) { - ret &= (simulcastStream[i] == other.simulcastStream[i]); - } - return ret; - } - - bool operator!=(const VideoCodec& other) const { - return !(*this == other); - } -}; - -// Bandwidth over-use detector options. These are used to drive -// experimentation with bandwidth estimation parameters. -// See modules/remote_bitrate_estimator/overuse_detector.h -struct OverUseDetectorOptions { - OverUseDetectorOptions() - : initial_slope(8.0/512.0), - initial_offset(0), - initial_e(), - initial_process_noise(), - initial_avg_noise(0.0), - initial_var_noise(50), - initial_threshold(25.0) { - initial_e[0][0] = 100; - initial_e[1][1] = 1e-1; - initial_e[0][1] = initial_e[1][0] = 0; - initial_process_noise[0] = 1e-10; - initial_process_noise[1] = 1e-2; - } - double initial_slope; - double initial_offset; - double initial_e[2][2]; - double initial_process_noise[2]; - double initial_avg_noise; - double initial_var_noise; - double initial_threshold; -}; - -// This structure will have the information about when packet is actually -// received by socket. -struct PacketTime { - PacketTime() : timestamp(-1), not_before(-1) {} - PacketTime(int64_t timestamp, int64_t not_before) - : timestamp(timestamp), not_before(not_before) { - } - - int64_t timestamp; // Receive time after socket delivers the data. - int64_t not_before; // Earliest possible time the data could have arrived, - // indicating the potential error in the |timestamp| - // value,in case the system is busy. - // For example, the time of the last select() call. - // If unknown, this value will be set to zero. -}; - -struct RTPHeaderExtension { - RTPHeaderExtension() - : hasTransmissionTimeOffset(false), - transmissionTimeOffset(0), - hasAbsoluteSendTime(false), - absoluteSendTime(0), - hasAudioLevel(false), - audioLevel(0) {} - - bool hasTransmissionTimeOffset; - int32_t transmissionTimeOffset; - bool hasAbsoluteSendTime; - uint32_t absoluteSendTime; - - // Audio Level includes both level in dBov and voiced/unvoiced bit. See: - // https://datatracker.ietf.org/doc/draft-lennox-avt-rtp-audio-level-exthdr/ - bool hasAudioLevel; - uint8_t audioLevel; -}; - -struct RTPHeader { - RTPHeader() - : markerBit(false), - payloadType(0), - sequenceNumber(0), - timestamp(0), - ssrc(0), - numCSRCs(0), - paddingLength(0), - headerLength(0), - payload_type_frequency(0), - extension() { - memset(&arrOfCSRCs, 0, sizeof(arrOfCSRCs)); - } - - bool markerBit; - uint8_t payloadType; - uint16_t sequenceNumber; - uint32_t timestamp; - uint32_t ssrc; - uint8_t numCSRCs; - uint32_t arrOfCSRCs[kRtpCsrcSize]; - uint8_t paddingLength; - uint16_t headerLength; - int payload_type_frequency; - RTPHeaderExtension extension; -}; - -} // namespace webrtc - -#endif // WEBRTC_COMMON_TYPES_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/common_video/interface/i420_video_frame.h b/thirdparties/common/include/webrtc-sdk/webrtc/common_video/interface/i420_video_frame.h deleted file mode 100755 index 3f90a8e..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/common_video/interface/i420_video_frame.h +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef COMMON_VIDEO_INTERFACE_I420_VIDEO_FRAME_H -#define COMMON_VIDEO_INTERFACE_I420_VIDEO_FRAME_H - -// I420VideoFrame class -// -// Storing and handling of YUV (I420) video frames. - -#include - -#include "webrtc/common_video/plane.h" -#include "webrtc/system_wrappers/interface/scoped_refptr.h" -#include "webrtc/typedefs.h" - -/* - * I420VideoFrame includes support for a reference counted impl. - */ - -namespace webrtc { - -enum PlaneType { - kYPlane = 0, - kUPlane = 1, - kVPlane = 2, - kNumOfPlanes = 3 -}; - -class I420VideoFrame { - public: - I420VideoFrame(); - virtual ~I420VideoFrame(); - // Infrastructure for refCount implementation. - // Implements dummy functions for reference counting so that non reference - // counted instantiation can be done. These functions should not be called - // when creating the frame with new I420VideoFrame(). - // Note: do not pass a I420VideoFrame created with new I420VideoFrame() or - // equivalent to a scoped_refptr or memory leak will occur. - virtual int32_t AddRef() {assert(false); return -1;} - virtual int32_t Release() {assert(false); return -1;} - - // CreateEmptyFrame: Sets frame dimensions and allocates buffers based - // on set dimensions - height and plane stride. - // If required size is bigger than the allocated one, new buffers of adequate - // size will be allocated. - // Return value: 0 on success ,-1 on error. - virtual int CreateEmptyFrame(int width, int height, - int stride_y, int stride_u, int stride_v); - - // CreateFrame: Sets the frame's members and buffers. If required size is - // bigger than allocated one, new buffers of adequate size will be allocated. - // Return value: 0 on success ,-1 on error. - virtual int CreateFrame(int size_y, const uint8_t* buffer_y, - int size_u, const uint8_t* buffer_u, - int size_v, const uint8_t* buffer_v, - int width, int height, - int stride_y, int stride_u, int stride_v); - - // Copy frame: If required size is bigger than allocated one, new buffers of - // adequate size will be allocated. - // Return value: 0 on success ,-1 on error. - virtual int CopyFrame(const I420VideoFrame& videoFrame); - - // Swap Frame. - virtual void SwapFrame(I420VideoFrame* videoFrame); - - // Get pointer to buffer per plane. - virtual uint8_t* buffer(PlaneType type); - // Overloading with const. - virtual const uint8_t* buffer(PlaneType type) const; - - // Get allocated size per plane. - virtual int allocated_size(PlaneType type) const; - - // Get allocated stride per plane. - virtual int stride(PlaneType type) const; - - // Set frame width. - virtual int set_width(int width); - - // Set frame height. - virtual int set_height(int height); - - // Get frame width. - virtual int width() const {return width_;} - - // Get frame height. - virtual int height() const {return height_;} - - // Set frame timestamp (90kHz). - virtual void set_timestamp(uint32_t timestamp) {timestamp_ = timestamp;} - - // Get frame timestamp (90kHz). - virtual uint32_t timestamp() const {return timestamp_;} - - // Set capture ntp time in miliseconds. - virtual void set_ntp_time_ms(int64_t ntp_time_ms) { - ntp_time_ms_ = ntp_time_ms; - } - - // Get capture ntp time in miliseconds. - virtual int64_t ntp_time_ms() const {return ntp_time_ms_;} - - // Set render time in miliseconds. - virtual void set_render_time_ms(int64_t render_time_ms) {render_time_ms_ = - render_time_ms;} - - // Get render time in miliseconds. - virtual int64_t render_time_ms() const {return render_time_ms_;} - - // Return true if underlying plane buffers are of zero size, false if not. - virtual bool IsZeroSize() const; - - // Reset underlying plane buffers sizes to 0. This function doesn't - // clear memory. - virtual void ResetSize(); - - // Return the handle of the underlying video frame. This is used when the - // frame is backed by a texture. The object should be destroyed when it is no - // longer in use, so the underlying resource can be freed. - virtual void* native_handle() const; - - protected: - // Verifies legality of parameters. - // Return value: 0 on success, -1 on error. - virtual int CheckDimensions(int width, int height, - int stride_y, int stride_u, int stride_v); - - private: - // Get the pointer to a specific plane. - const Plane* GetPlane(PlaneType type) const; - // Overloading with non-const. - Plane* GetPlane(PlaneType type); - - Plane y_plane_; - Plane u_plane_; - Plane v_plane_; - int width_; - int height_; - uint32_t timestamp_; - int64_t ntp_time_ms_; - int64_t render_time_ms_; -}; // I420VideoFrame - -} // namespace webrtc - -#endif // COMMON_VIDEO_INTERFACE_I420_VIDEO_FRAME_H diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/common_video/interface/native_handle.h b/thirdparties/common/include/webrtc-sdk/webrtc/common_video/interface/native_handle.h deleted file mode 100755 index d078d4c..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/common_video/interface/native_handle.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef COMMON_VIDEO_INTERFACE_NATIVEHANDLE_H_ -#define COMMON_VIDEO_INTERFACE_NATIVEHANDLE_H_ - -#include "webrtc/typedefs.h" - -namespace webrtc { - -// A class to store an opaque handle of the underlying video frame. This is used -// when the frame is backed by a texture. WebRTC carries the handle in -// TextureVideoFrame. This object keeps a reference to the handle. The reference -// is cleared when the object is destroyed. It is important to destroy the -// object as soon as possible so the texture can be recycled. -class NativeHandle { - public: - virtual ~NativeHandle() {} - // For scoped_refptr - virtual int32_t AddRef() = 0; - virtual int32_t Release() = 0; - - // Gets the handle. - virtual void* GetHandle() = 0; -}; - -} // namespace webrtc - -#endif // COMMON_VIDEO_INTERFACE_NATIVEHANDLE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/common_video/interface/texture_video_frame.h b/thirdparties/common/include/webrtc-sdk/webrtc/common_video/interface/texture_video_frame.h deleted file mode 100755 index e905ea7..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/common_video/interface/texture_video_frame.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef COMMON_VIDEO_INTERFACE_TEXTURE_VIDEO_FRAME_H -#define COMMON_VIDEO_INTERFACE_TEXTURE_VIDEO_FRAME_H - -// TextureVideoFrame class -// -// Storing and handling of video frames backed by textures. - -#include "webrtc/common_video/interface/i420_video_frame.h" -#include "webrtc/common_video/interface/native_handle.h" -#include "webrtc/system_wrappers/interface/scoped_refptr.h" -#include "webrtc/typedefs.h" - -namespace webrtc { - -class TextureVideoFrame : public I420VideoFrame { - public: - TextureVideoFrame(NativeHandle* handle, - int width, - int height, - uint32_t timestamp, - int64_t render_time_ms); - virtual ~TextureVideoFrame(); - - // I420VideoFrame implementation - virtual int CreateEmptyFrame(int width, - int height, - int stride_y, - int stride_u, - int stride_v) OVERRIDE; - virtual int CreateFrame(int size_y, - const uint8_t* buffer_y, - int size_u, - const uint8_t* buffer_u, - int size_v, - const uint8_t* buffer_v, - int width, - int height, - int stride_y, - int stride_u, - int stride_v) OVERRIDE; - virtual int CopyFrame(const I420VideoFrame& videoFrame) OVERRIDE; - virtual void SwapFrame(I420VideoFrame* videoFrame) OVERRIDE; - virtual uint8_t* buffer(PlaneType type) OVERRIDE; - virtual const uint8_t* buffer(PlaneType type) const OVERRIDE; - virtual int allocated_size(PlaneType type) const OVERRIDE; - virtual int stride(PlaneType type) const OVERRIDE; - virtual bool IsZeroSize() const OVERRIDE; - virtual void ResetSize() OVERRIDE; - virtual void* native_handle() const OVERRIDE; - - protected: - virtual int CheckDimensions( - int width, int height, int stride_y, int stride_u, int stride_v) OVERRIDE; - - private: - // An opaque handle that stores the underlying video frame. - scoped_refptr handle_; -}; - -} // namespace webrtc - -#endif // COMMON_VIDEO_INTERFACE_TEXTURE_VIDEO_FRAME_H diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/common_video/interface/video_image.h b/thirdparties/common/include/webrtc-sdk/webrtc/common_video/interface/video_image.h deleted file mode 100755 index c8df436..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/common_video/interface/video_image.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef COMMON_VIDEO_INTERFACE_VIDEO_IMAGE_H -#define COMMON_VIDEO_INTERFACE_VIDEO_IMAGE_H - -#include -#include "webrtc/typedefs.h" - -namespace webrtc -{ - -enum VideoFrameType -{ - kKeyFrame = 0, - kDeltaFrame = 1, - kGoldenFrame = 2, - kAltRefFrame = 3, - kSkipFrame = 4 -}; - -class EncodedImage -{ -public: - EncodedImage() - : _encodedWidth(0), - _encodedHeight(0), - _timeStamp(0), - capture_time_ms_(0), - _frameType(kDeltaFrame), - _buffer(NULL), - _length(0), - _size(0), - _completeFrame(false) {} - - EncodedImage(uint8_t* buffer, - uint32_t length, - uint32_t size) - : _encodedWidth(0), - _encodedHeight(0), - _timeStamp(0), - ntp_time_ms_(0), - capture_time_ms_(0), - _frameType(kDeltaFrame), - _buffer(buffer), - _length(length), - _size(size), - _completeFrame(false) {} - - uint32_t _encodedWidth; - uint32_t _encodedHeight; - uint32_t _timeStamp; - // NTP time of the capture time in local timebase in milliseconds. - int64_t ntp_time_ms_; - int64_t capture_time_ms_; - VideoFrameType _frameType; - uint8_t* _buffer; - uint32_t _length; - uint32_t _size; - bool _completeFrame; -}; - -} // namespace webrtc - -#endif // COMMON_VIDEO_INTERFACE_VIDEO_IMAGE_H diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/common_video/libyuv/include/scaler.h b/thirdparties/common/include/webrtc-sdk/webrtc/common_video/libyuv/include/scaler.h deleted file mode 100755 index ce7462c..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/common_video/libyuv/include/scaler.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -/* - * Interface to the LibYuv scaling functionality - */ - -#ifndef WEBRTC_COMMON_VIDEO_LIBYUV_INCLUDE_SCALER_H_ -#define WEBRTC_COMMON_VIDEO_LIBYUV_INCLUDE_SCALER_H_ - -#include "webrtc/common_video/interface/i420_video_frame.h" -#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" -#include "webrtc/typedefs.h" - -namespace webrtc { - -// Supported scaling types -enum ScaleMethod { - kScalePoint, // no interpolation - kScaleBilinear, - kScaleBox -}; - -class Scaler { - public: - Scaler(); - ~Scaler(); - - // Set interpolation properties: - // - // Return value: 0 - OK - // -1 - parameter error - int Set(int src_width, int src_height, - int dst_width, int dst_height, - VideoType src_video_type, VideoType dst_video_type, - ScaleMethod method); - - // Scale frame - // Memory is allocated by user. If dst_frame is not of sufficient size, - // the frame will be reallocated to the appropriate size. - // Return value: 0 - OK, - // -1 - parameter error - // -2 - scaler not set - int Scale(const I420VideoFrame& src_frame, - I420VideoFrame* dst_frame); - - private: - // Determine if the VideoTypes are currently supported. - bool SupportedVideoType(VideoType src_video_type, - VideoType dst_video_type); - - ScaleMethod method_; - int src_width_; - int src_height_; - int dst_width_; - int dst_height_; - bool set_; -}; - -} // namespace webrtc - -#endif // WEBRTC_COMMON_VIDEO_LIBYUV_INCLUDE_SCALER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/common_video/libyuv/include/webrtc_libyuv.h b/thirdparties/common/include/webrtc-sdk/webrtc/common_video/libyuv/include/webrtc_libyuv.h deleted file mode 100755 index 70d8e2a..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/common_video/libyuv/include/webrtc_libyuv.h +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -/* - * WebRTC's wrapper to libyuv. - */ - -#ifndef WEBRTC_COMMON_VIDEO_LIBYUV_INCLUDE_WEBRTC_LIBYUV_H_ -#define WEBRTC_COMMON_VIDEO_LIBYUV_INCLUDE_WEBRTC_LIBYUV_H_ - -#include - -#include "webrtc/common_types.h" // RawVideoTypes. -#include "webrtc/common_video/interface/i420_video_frame.h" -#include "webrtc/typedefs.h" - -namespace webrtc { - -// Supported video types. -enum VideoType { - kUnknown, - kI420, - kIYUV, - kRGB24, - kABGR, - kARGB, - kARGB4444, - kRGB565, - kARGB1555, - kYUY2, - kYV12, - kUYVY, - kMJPG, - kNV21, - kNV12, - kBGRA, -}; - -// This is the max PSNR value our algorithms can return. -const double kPerfectPSNR = 48.0f; - -// Conversion between the RawVideoType and the LibYuv videoType. -// TODO(wu): Consolidate types into one type throughout WebRtc. -VideoType RawVideoTypeToCommonVideoVideoType(RawVideoType type); - -// Supported rotation -// Direction of rotation - clockwise. -enum VideoRotationMode { - kRotateNone = 0, - kRotate90 = 90, - kRotate180 = 180, - kRotate270 = 270, -}; - -// Align integer values. -// Input: -// - value : Input value to be aligned. -// - alignment : Alignment basis (power of 2). -// Return value: An aligned form of the input value. -int AlignInt(int value, int alignment); - -// Align stride values for I420 Video frames. -// Input: -// - width : Image width. -// - stride_y : Pointer to the stride of the y plane. -// - stride_uv: Pointer to the stride of the u and v planes (setting identical -// values for both). -// Setting 16 byte alignment. -void Calc16ByteAlignedStride(int width, int* stride_y, int* stride_uv); - -// Calculate the required buffer size. -// Input: -// - type :The type of the designated video frame. -// - width :frame width in pixels. -// - height :frame height in pixels. -// Return value: :The required size in bytes to accommodate the specified -// video frame or -1 in case of an error . -int CalcBufferSize(VideoType type, int width, int height); - -// TODO(mikhal): Add unit test for these two functions and determine location. -// Print I420VideoFrame to file -// Input: -// - frame : Reference to video frame. -// - file : pointer to file object. It is assumed that the file is -// already open for writing. -// Return value: 0 if OK, < 0 otherwise. -int PrintI420VideoFrame(const I420VideoFrame& frame, FILE* file); - -// Extract buffer from I420VideoFrame (consecutive planes, no stride) -// Input: -// - frame : Reference to video frame. -// - size : pointer to the size of the allocated buffer. If size is -// insufficient, an error will be returned. -// - buffer : Pointer to buffer -// Return value: length of buffer if OK, < 0 otherwise. -int ExtractBuffer(const I420VideoFrame& input_frame, - int size, uint8_t* buffer); -// Convert To I420 -// Input: -// - src_video_type : Type of input video. -// - src_frame : Pointer to a source frame. -// - crop_x/crop_y : Starting positions for cropping (0 for no crop). -// - src_width : src width in pixels. -// - src_height : src height in pixels. -// - sample_size : Required only for the parsing of MJPG (set to 0 else). -// - rotate : Rotation mode of output image. -// Output: -// - dst_frame : Reference to a destination frame. -// Return value: 0 if OK, < 0 otherwise. - -int ConvertToI420(VideoType src_video_type, - const uint8_t* src_frame, - int crop_x, int crop_y, - int src_width, int src_height, - int sample_size, - VideoRotationMode rotation, - I420VideoFrame* dst_frame); - -// Convert From I420 -// Input: -// - src_frame : Reference to a source frame. -// - dst_video_type : Type of output video. -// - dst_sample_size : Required only for the parsing of MJPG. -// - dst_frame : Pointer to a destination frame. -// Return value: 0 if OK, < 0 otherwise. -// It is assumed that source and destination have equal height. -int ConvertFromI420(const I420VideoFrame& src_frame, - VideoType dst_video_type, int dst_sample_size, - uint8_t* dst_frame); -// ConvertFrom YV12. -// Interface - same as above. -int ConvertFromYV12(const I420VideoFrame& src_frame, - VideoType dst_video_type, int dst_sample_size, - uint8_t* dst_frame); - -// The following list describes designated conversion functions which -// are not covered by the previous general functions. -// Input and output descriptions mostly match the above descriptions, and are -// therefore omitted. -int ConvertRGB24ToARGB(const uint8_t* src_frame, - uint8_t* dst_frame, - int width, int height, - int dst_stride); -int ConvertNV12ToRGB565(const uint8_t* src_frame, - uint8_t* dst_frame, - int width, int height); - -// Mirror functions -// The following 2 functions perform mirroring on a given image -// (LeftRight/UpDown). -// Input: -// - src_frame : Pointer to a source frame. -// - dst_frame : Pointer to a destination frame. -// Return value: 0 if OK, < 0 otherwise. -// It is assumed that src and dst frames have equal dimensions. -int MirrorI420LeftRight(const I420VideoFrame* src_frame, - I420VideoFrame* dst_frame); -int MirrorI420UpDown(const I420VideoFrame* src_frame, - I420VideoFrame* dst_frame); - -// Compute PSNR for an I420 frame (all planes). -// Returns the PSNR in decibel, to a maximum of kInfinitePSNR. -double I420PSNR(const I420VideoFrame* ref_frame, - const I420VideoFrame* test_frame); -// Compute SSIM for an I420 frame (all planes). -double I420SSIM(const I420VideoFrame* ref_frame, - const I420VideoFrame* test_frame); -} - -#endif // WEBRTC_COMMON_VIDEO_LIBYUV_INCLUDE_WEBRTC_LIBYUV_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/common_video/plane.h b/thirdparties/common/include/webrtc-sdk/webrtc/common_video/plane.h deleted file mode 100755 index 4031e03..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/common_video/plane.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef COMMON_VIDEO_PLANE_H -#define COMMON_VIDEO_PLANE_H - -#include "webrtc/system_wrappers/interface/aligned_malloc.h" -#include "webrtc/system_wrappers/interface/scoped_ptr.h" -#include "webrtc/typedefs.h" - -namespace webrtc { - -// Helper class for I420VideoFrame: Store plane data and perform basic plane -// operations. -class Plane { - public: - Plane(); - ~Plane(); - // CreateEmptyPlane - set allocated size, actual plane size and stride: - // If current size is smaller than current size, then a buffer of sufficient - // size will be allocated. - // Return value: 0 on success ,-1 on error. - int CreateEmptyPlane(int allocated_size, int stride, int plane_size); - - // Copy the entire plane data. - // Return value: 0 on success ,-1 on error. - int Copy(const Plane& plane); - - // Copy buffer: If current size is smaller - // than current size, then a buffer of sufficient size will be allocated. - // Return value: 0 on success ,-1 on error. - int Copy(int size, int stride, const uint8_t* buffer); - - // Swap plane data. - void Swap(Plane& plane); - - // Get allocated size. - int allocated_size() const {return allocated_size_;} - - // Set actual size. - void ResetSize() {plane_size_ = 0;} - - // Return true is plane size is zero, false if not. - bool IsZeroSize() const {return plane_size_ == 0;} - - // Get stride value. - int stride() const {return stride_;} - - // Return data pointer. - const uint8_t* buffer() const {return buffer_.get();} - // Overloading with non-const. - uint8_t* buffer() {return buffer_.get();} - - private: - // Resize when needed: If current allocated size is less than new_size, buffer - // will be updated. Old data will be copied to new buffer. - // Return value: 0 on success ,-1 on error. - int MaybeResize(int new_size); - - scoped_ptr buffer_; - int allocated_size_; - int plane_size_; - int stride_; -}; // Plane - -} // namespace webrtc - -#endif // COMMON_VIDEO_PLANE_H diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/modules/interface/module.h b/thirdparties/common/include/webrtc-sdk/webrtc/modules/interface/module.h deleted file mode 100755 index c177fd1..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/modules/interface/module.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef MODULES_INTERFACE_MODULE_H_ -#define MODULES_INTERFACE_MODULE_H_ - -#include - -#include "webrtc/typedefs.h" - -namespace webrtc { - -class Module { - public: - // TODO(henrika): Remove this when chrome is updated. - // DEPRICATED Change the unique identifier of this object. - virtual int32_t ChangeUniqueId(const int32_t id) { return 0; } - - // Returns the number of milliseconds until the module want a worker - // thread to call Process. - virtual int32_t TimeUntilNextProcess() = 0; - - // Process any pending tasks such as timeouts. - virtual int32_t Process() = 0; - - protected: - virtual ~Module() {} -}; - -// Reference counted version of the module interface. -class RefCountedModule : public Module { - public: - // Increase the reference count by one. - // Returns the incremented reference count. - // TODO(perkj): Make this pure virtual when Chromium have implemented - // reference counting ADM and Video capture module. - virtual int32_t AddRef() { - assert(false && "Not implemented."); - return 1; - } - - // Decrease the reference count by one. - // Returns the decreased reference count. - // Returns 0 if the last reference was just released. - // When the reference count reach 0 the object will self-destruct. - // TODO(perkj): Make this pure virtual when Chromium have implemented - // reference counting ADM and Video capture module. - virtual int32_t Release() { - assert(false && "Not implemented."); - return 1; - } - - protected: - virtual ~RefCountedModule() {} -}; - -} // namespace webrtc - -#endif // MODULES_INTERFACE_MODULE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/modules/interface/module_common_types.h b/thirdparties/common/include/webrtc-sdk/webrtc/modules/interface/module_common_types.h deleted file mode 100755 index 14139ad..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/modules/interface/module_common_types.h +++ /dev/null @@ -1,902 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef MODULE_COMMON_TYPES_H -#define MODULE_COMMON_TYPES_H - -#include -#include // memcpy - -#include - -#include "webrtc/base/constructormagic.h" -#include "webrtc/common_types.h" -#include "webrtc/typedefs.h" - -#ifdef _WIN32 -// Remove warning "new behavior: elements of array will be default initialized". -#pragma warning(disable : 4351) -#endif - -namespace webrtc { - -struct RTPAudioHeader { - uint8_t numEnergy; // number of valid entries in arrOfEnergy - uint8_t arrOfEnergy[kRtpCsrcSize]; // one energy byte (0-9) per channel - bool isCNG; // is this CNG - uint8_t channel; // number of channels 2 = stereo -}; - -enum { - kNoPictureId = -1 -}; -enum { - kNoTl0PicIdx = -1 -}; -enum { - kNoTemporalIdx = -1 -}; -enum { - kNoKeyIdx = -1 -}; -enum { - kNoSimulcastIdx = 0 -}; - -struct RTPVideoHeaderVP8 { - void InitRTPVideoHeaderVP8() { - nonReference = false; - pictureId = kNoPictureId; - tl0PicIdx = kNoTl0PicIdx; - temporalIdx = kNoTemporalIdx; - layerSync = false; - keyIdx = kNoKeyIdx; - partitionId = 0; - beginningOfPartition = false; - } - - bool nonReference; // Frame is discardable. - int16_t pictureId; // Picture ID index, 15 bits; - // kNoPictureId if PictureID does not exist. - int16_t tl0PicIdx; // TL0PIC_IDX, 8 bits; - // kNoTl0PicIdx means no value provided. - int8_t temporalIdx; // Temporal layer index, or kNoTemporalIdx. - bool layerSync; // This frame is a layer sync frame. - // Disabled if temporalIdx == kNoTemporalIdx. - int keyIdx; // 5 bits; kNoKeyIdx means not used. - int partitionId; // VP8 partition ID - bool beginningOfPartition; // True if this packet is the first - // in a VP8 partition. Otherwise false -}; -union RTPVideoTypeHeader { - RTPVideoHeaderVP8 VP8; -}; - -enum RtpVideoCodecTypes { - kRtpVideoNone, - kRtpVideoGeneric, - kRtpVideoVp8 -}; -struct RTPVideoHeader { - uint16_t width; // size - uint16_t height; - - bool isFirstPacket; // first packet in frame - uint8_t simulcastIdx; // Index if the simulcast encoder creating - // this frame, 0 if not using simulcast. - RtpVideoCodecTypes codec; - RTPVideoTypeHeader codecHeader; -}; -union RTPTypeHeader { - RTPAudioHeader Audio; - RTPVideoHeader Video; -}; - -struct WebRtcRTPHeader { - RTPHeader header; - FrameType frameType; - RTPTypeHeader type; - // NTP time of the capture time in local timebase in milliseconds. - int64_t ntp_time_ms; -}; - -class RTPFragmentationHeader { - public: - RTPFragmentationHeader() - : fragmentationVectorSize(0), - fragmentationOffset(NULL), - fragmentationLength(NULL), - fragmentationTimeDiff(NULL), - fragmentationPlType(NULL) {}; - - ~RTPFragmentationHeader() { - delete[] fragmentationOffset; - delete[] fragmentationLength; - delete[] fragmentationTimeDiff; - delete[] fragmentationPlType; - } - - void CopyFrom(const RTPFragmentationHeader& src) { - if (this == &src) { - return; - } - - if (src.fragmentationVectorSize != fragmentationVectorSize) { - // new size of vectors - - // delete old - delete[] fragmentationOffset; - fragmentationOffset = NULL; - delete[] fragmentationLength; - fragmentationLength = NULL; - delete[] fragmentationTimeDiff; - fragmentationTimeDiff = NULL; - delete[] fragmentationPlType; - fragmentationPlType = NULL; - - if (src.fragmentationVectorSize > 0) { - // allocate new - if (src.fragmentationOffset) { - fragmentationOffset = new uint32_t[src.fragmentationVectorSize]; - } - if (src.fragmentationLength) { - fragmentationLength = new uint32_t[src.fragmentationVectorSize]; - } - if (src.fragmentationTimeDiff) { - fragmentationTimeDiff = new uint16_t[src.fragmentationVectorSize]; - } - if (src.fragmentationPlType) { - fragmentationPlType = new uint8_t[src.fragmentationVectorSize]; - } - } - // set new size - fragmentationVectorSize = src.fragmentationVectorSize; - } - - if (src.fragmentationVectorSize > 0) { - // copy values - if (src.fragmentationOffset) { - memcpy(fragmentationOffset, src.fragmentationOffset, - src.fragmentationVectorSize * sizeof(uint32_t)); - } - if (src.fragmentationLength) { - memcpy(fragmentationLength, src.fragmentationLength, - src.fragmentationVectorSize * sizeof(uint32_t)); - } - if (src.fragmentationTimeDiff) { - memcpy(fragmentationTimeDiff, src.fragmentationTimeDiff, - src.fragmentationVectorSize * sizeof(uint16_t)); - } - if (src.fragmentationPlType) { - memcpy(fragmentationPlType, src.fragmentationPlType, - src.fragmentationVectorSize * sizeof(uint8_t)); - } - } - } - - void VerifyAndAllocateFragmentationHeader(const uint16_t size) { - if (fragmentationVectorSize < size) { - uint16_t oldVectorSize = fragmentationVectorSize; - { - // offset - uint32_t* oldOffsets = fragmentationOffset; - fragmentationOffset = new uint32_t[size]; - memset(fragmentationOffset + oldVectorSize, 0, - sizeof(uint32_t) * (size - oldVectorSize)); - // copy old values - memcpy(fragmentationOffset, oldOffsets, - sizeof(uint32_t) * oldVectorSize); - delete[] oldOffsets; - } - // length - { - uint32_t* oldLengths = fragmentationLength; - fragmentationLength = new uint32_t[size]; - memset(fragmentationLength + oldVectorSize, 0, - sizeof(uint32_t) * (size - oldVectorSize)); - memcpy(fragmentationLength, oldLengths, - sizeof(uint32_t) * oldVectorSize); - delete[] oldLengths; - } - // time diff - { - uint16_t* oldTimeDiffs = fragmentationTimeDiff; - fragmentationTimeDiff = new uint16_t[size]; - memset(fragmentationTimeDiff + oldVectorSize, 0, - sizeof(uint16_t) * (size - oldVectorSize)); - memcpy(fragmentationTimeDiff, oldTimeDiffs, - sizeof(uint16_t) * oldVectorSize); - delete[] oldTimeDiffs; - } - // payload type - { - uint8_t* oldTimePlTypes = fragmentationPlType; - fragmentationPlType = new uint8_t[size]; - memset(fragmentationPlType + oldVectorSize, 0, - sizeof(uint8_t) * (size - oldVectorSize)); - memcpy(fragmentationPlType, oldTimePlTypes, - sizeof(uint8_t) * oldVectorSize); - delete[] oldTimePlTypes; - } - fragmentationVectorSize = size; - } - } - - uint16_t fragmentationVectorSize; // Number of fragmentations - uint32_t* fragmentationOffset; // Offset of pointer to data for each fragm. - uint32_t* fragmentationLength; // Data size for each fragmentation - uint16_t* fragmentationTimeDiff; // Timestamp difference relative "now" for - // each fragmentation - uint8_t* fragmentationPlType; // Payload type of each fragmentation - - private: - DISALLOW_COPY_AND_ASSIGN(RTPFragmentationHeader); -}; - -struct RTCPVoIPMetric { - // RFC 3611 4.7 - uint8_t lossRate; - uint8_t discardRate; - uint8_t burstDensity; - uint8_t gapDensity; - uint16_t burstDuration; - uint16_t gapDuration; - uint16_t roundTripDelay; - uint16_t endSystemDelay; - uint8_t signalLevel; - uint8_t noiseLevel; - uint8_t RERL; - uint8_t Gmin; - uint8_t Rfactor; - uint8_t extRfactor; - uint8_t MOSLQ; - uint8_t MOSCQ; - uint8_t RXconfig; - uint16_t JBnominal; - uint16_t JBmax; - uint16_t JBabsMax; -}; - -// Types for the FEC packet masks. The type |kFecMaskRandom| is based on a -// random loss model. The type |kFecMaskBursty| is based on a bursty/consecutive -// loss model. The packet masks are defined in -// modules/rtp_rtcp/fec_private_tables_random(bursty).h -enum FecMaskType { - kFecMaskRandom, - kFecMaskBursty, -}; - -// Struct containing forward error correction settings. -struct FecProtectionParams { - int fec_rate; - bool use_uep_protection; - int max_fec_frames; - FecMaskType fec_mask_type; -}; - -// Interface used by the CallStats class to distribute call statistics. -// Callbacks will be triggered as soon as the class has been registered to a -// CallStats object using RegisterStatsObserver. -class CallStatsObserver { - public: - virtual void OnRttUpdate(uint32_t rtt_ms) = 0; - - virtual ~CallStatsObserver() {} -}; - -// class describing a complete, or parts of an encoded frame. -class EncodedVideoData { - public: - EncodedVideoData() - : payloadType(0), - timeStamp(0), - renderTimeMs(0), - encodedWidth(0), - encodedHeight(0), - completeFrame(false), - missingFrame(false), - payloadData(NULL), - payloadSize(0), - bufferSize(0), - fragmentationHeader(), - frameType(kVideoFrameDelta), - codec(kVideoCodecUnknown) {}; - - EncodedVideoData(const EncodedVideoData& data) { - payloadType = data.payloadType; - timeStamp = data.timeStamp; - renderTimeMs = data.renderTimeMs; - encodedWidth = data.encodedWidth; - encodedHeight = data.encodedHeight; - completeFrame = data.completeFrame; - missingFrame = data.missingFrame; - payloadSize = data.payloadSize; - fragmentationHeader.CopyFrom(data.fragmentationHeader); - frameType = data.frameType; - codec = data.codec; - if (data.payloadSize > 0) { - payloadData = new uint8_t[data.payloadSize]; - memcpy(payloadData, data.payloadData, data.payloadSize); - } else { - payloadData = NULL; - } - } - - ~EncodedVideoData() { - delete[] payloadData; - }; - - EncodedVideoData& operator=(const EncodedVideoData& data) { - if (this == &data) { - return *this; - } - payloadType = data.payloadType; - timeStamp = data.timeStamp; - renderTimeMs = data.renderTimeMs; - encodedWidth = data.encodedWidth; - encodedHeight = data.encodedHeight; - completeFrame = data.completeFrame; - missingFrame = data.missingFrame; - payloadSize = data.payloadSize; - fragmentationHeader.CopyFrom(data.fragmentationHeader); - frameType = data.frameType; - codec = data.codec; - if (data.payloadSize > 0) { - delete[] payloadData; - payloadData = new uint8_t[data.payloadSize]; - memcpy(payloadData, data.payloadData, data.payloadSize); - bufferSize = data.payloadSize; - } - return *this; - }; - void VerifyAndAllocate(const uint32_t size) { - if (bufferSize < size) { - uint8_t* oldPayload = payloadData; - payloadData = new uint8_t[size]; - memcpy(payloadData, oldPayload, sizeof(uint8_t) * payloadSize); - - bufferSize = size; - delete[] oldPayload; - } - } - - uint8_t payloadType; - uint32_t timeStamp; - int64_t renderTimeMs; - uint32_t encodedWidth; - uint32_t encodedHeight; - bool completeFrame; - bool missingFrame; - uint8_t* payloadData; - uint32_t payloadSize; - uint32_t bufferSize; - RTPFragmentationHeader fragmentationHeader; - FrameType frameType; - VideoCodecType codec; -}; - -struct VideoContentMetrics { - VideoContentMetrics() - : motion_magnitude(0.0f), - spatial_pred_err(0.0f), - spatial_pred_err_h(0.0f), - spatial_pred_err_v(0.0f) {} - - void Reset() { - motion_magnitude = 0.0f; - spatial_pred_err = 0.0f; - spatial_pred_err_h = 0.0f; - spatial_pred_err_v = 0.0f; - } - float motion_magnitude; - float spatial_pred_err; - float spatial_pred_err_h; - float spatial_pred_err_v; -}; - -/************************************************* - * - * VideoFrame class - * - * The VideoFrame class allows storing and - * handling of video frames. - * - * - *************************************************/ -class VideoFrame { - public: - VideoFrame(); - ~VideoFrame(); - /** - * Verifies that current allocated buffer size is larger than or equal to the - * input size. - * If the current buffer size is smaller, a new allocation is made and the old - * buffer data - * is copied to the new buffer. - * Buffer size is updated to minimumSize. - */ - int32_t VerifyAndAllocate(const uint32_t minimumSize); - /** - * Update length of data buffer in frame. Function verifies that new length - * is less or - * equal to allocated size. - */ - int32_t SetLength(const uint32_t newLength); - /* - * Swap buffer and size data - */ - int32_t Swap(uint8_t*& newMemory, uint32_t& newLength, uint32_t& newSize); - /* - * Swap buffer and size data - */ - int32_t SwapFrame(VideoFrame& videoFrame); - /** - * Copy buffer: If newLength is bigger than allocated size, a new buffer of - * size length - * is allocated. - */ - int32_t CopyFrame(const VideoFrame& videoFrame); - /** - * Copy buffer: If newLength is bigger than allocated size, a new buffer of - * size length - * is allocated. - */ - int32_t CopyFrame(uint32_t length, const uint8_t* sourceBuffer); - /** - * Delete VideoFrame and resets members to zero - */ - void Free(); - /** - * Set frame timestamp (90kHz) - */ - void SetTimeStamp(const uint32_t timeStamp) { _timeStamp = timeStamp; } - /** - * Get pointer to frame buffer - */ - uint8_t* Buffer() const { return _buffer; } - - uint8_t*& Buffer() { return _buffer; } - - /** - * Get allocated buffer size - */ - uint32_t Size() const { return _bufferSize; } - /** - * Get frame length - */ - uint32_t Length() const { return _bufferLength; } - /** - * Get frame timestamp (90kHz) - */ - uint32_t TimeStamp() const { return _timeStamp; } - /** - * Get frame width - */ - uint32_t Width() const { return _width; } - /** - * Get frame height - */ - uint32_t Height() const { return _height; } - /** - * Set frame width - */ - void SetWidth(const uint32_t width) { _width = width; } - /** - * Set frame height - */ - void SetHeight(const uint32_t height) { _height = height; } - /** - * Set render time in miliseconds - */ - void SetRenderTime(const int64_t renderTimeMs) { - _renderTimeMs = renderTimeMs; - } - /** - * Get render time in miliseconds - */ - int64_t RenderTimeMs() const { return _renderTimeMs; } - - private: - void Set(uint8_t* buffer, uint32_t size, uint32_t length, uint32_t timeStamp); - - uint8_t* _buffer; // Pointer to frame buffer - uint32_t _bufferSize; // Allocated buffer size - uint32_t _bufferLength; // Length (in bytes) of buffer - uint32_t _timeStamp; // Timestamp of frame (90kHz) - uint32_t _width; - uint32_t _height; - int64_t _renderTimeMs; -}; // end of VideoFrame class declaration - -// inline implementation of VideoFrame class: -inline VideoFrame::VideoFrame() - : _buffer(0), - _bufferSize(0), - _bufferLength(0), - _timeStamp(0), - _width(0), - _height(0), - _renderTimeMs(0) { - // -} -inline VideoFrame::~VideoFrame() { - if (_buffer) { - delete[] _buffer; - _buffer = NULL; - } -} - -inline int32_t VideoFrame::VerifyAndAllocate(const uint32_t minimumSize) { - if (minimumSize < 1) { - return -1; - } - if (minimumSize > _bufferSize) { - // create buffer of sufficient size - uint8_t* newBufferBuffer = new uint8_t[minimumSize]; - if (_buffer) { - // copy old data - memcpy(newBufferBuffer, _buffer, _bufferSize); - delete[] _buffer; - } else { - memset(newBufferBuffer, 0, minimumSize * sizeof(uint8_t)); - } - _buffer = newBufferBuffer; - _bufferSize = minimumSize; - } - return 0; -} - -inline int32_t VideoFrame::SetLength(const uint32_t newLength) { - if (newLength > _bufferSize) { // can't accomodate new value - return -1; - } - _bufferLength = newLength; - return 0; -} - -inline int32_t VideoFrame::SwapFrame(VideoFrame& videoFrame) { - uint32_t tmpTimeStamp = _timeStamp; - uint32_t tmpWidth = _width; - uint32_t tmpHeight = _height; - int64_t tmpRenderTime = _renderTimeMs; - - _timeStamp = videoFrame._timeStamp; - _width = videoFrame._width; - _height = videoFrame._height; - _renderTimeMs = videoFrame._renderTimeMs; - - videoFrame._timeStamp = tmpTimeStamp; - videoFrame._width = tmpWidth; - videoFrame._height = tmpHeight; - videoFrame._renderTimeMs = tmpRenderTime; - - return Swap(videoFrame._buffer, videoFrame._bufferLength, - videoFrame._bufferSize); -} - -inline int32_t VideoFrame::Swap(uint8_t*& newMemory, uint32_t& newLength, - uint32_t& newSize) { - uint8_t* tmpBuffer = _buffer; - uint32_t tmpLength = _bufferLength; - uint32_t tmpSize = _bufferSize; - _buffer = newMemory; - _bufferLength = newLength; - _bufferSize = newSize; - newMemory = tmpBuffer; - newLength = tmpLength; - newSize = tmpSize; - return 0; -} - -inline int32_t VideoFrame::CopyFrame(uint32_t length, - const uint8_t* sourceBuffer) { - if (length > _bufferSize) { - int32_t ret = VerifyAndAllocate(length); - if (ret < 0) { - return ret; - } - } - memcpy(_buffer, sourceBuffer, length); - _bufferLength = length; - return 0; -} - -inline int32_t VideoFrame::CopyFrame(const VideoFrame& videoFrame) { - if (CopyFrame(videoFrame.Length(), videoFrame.Buffer()) != 0) { - return -1; - } - _timeStamp = videoFrame._timeStamp; - _width = videoFrame._width; - _height = videoFrame._height; - _renderTimeMs = videoFrame._renderTimeMs; - return 0; -} - -inline void VideoFrame::Free() { - _timeStamp = 0; - _bufferLength = 0; - _bufferSize = 0; - _height = 0; - _width = 0; - _renderTimeMs = 0; - - if (_buffer) { - delete[] _buffer; - _buffer = NULL; - } -} - -/* This class holds up to 60 ms of super-wideband (32 kHz) stereo audio. It - * allows for adding and subtracting frames while keeping track of the resulting - * states. - * - * Notes - * - The total number of samples in |data_| is - * samples_per_channel_ * num_channels_ - * - * - Stereo data is interleaved starting with the left channel. - * - * - The +operator assume that you would never add exactly opposite frames when - * deciding the resulting state. To do this use the -operator. - */ -class AudioFrame { - public: - // Stereo, 32 kHz, 60 ms (2 * 32 * 60) - static const int kMaxDataSizeSamples = 3840; - - enum VADActivity { - kVadActive = 0, - kVadPassive = 1, - kVadUnknown = 2 - }; - enum SpeechType { - kNormalSpeech = 0, - kPLC = 1, - kCNG = 2, - kPLCCNG = 3, - kUndefined = 4 - }; - - AudioFrame(); - virtual ~AudioFrame() {} - - // |interleaved_| is not changed by this method. - void UpdateFrame(int id, uint32_t timestamp, const int16_t* data, - int samples_per_channel, int sample_rate_hz, - SpeechType speech_type, VADActivity vad_activity, - int num_channels = 1, uint32_t energy = -1); - - AudioFrame& Append(const AudioFrame& rhs); - - void CopyFrom(const AudioFrame& src); - - void Mute(); - - AudioFrame& operator>>=(const int rhs); - AudioFrame& operator+=(const AudioFrame& rhs); - AudioFrame& operator-=(const AudioFrame& rhs); - - int id_; - // RTP timestamp of the first sample in the AudioFrame. - uint32_t timestamp_; - // NTP time of the estimated capture time in local timebase in milliseconds. - int64_t ntp_time_ms_; - int16_t data_[kMaxDataSizeSamples]; - int samples_per_channel_; - int sample_rate_hz_; - int num_channels_; - SpeechType speech_type_; - VADActivity vad_activity_; - // Note that there is no guarantee that |energy_| is correct. Any user of this - // member must verify that the value is correct. - // TODO(henrike) Remove |energy_|. - // See https://code.google.com/p/webrtc/issues/detail?id=3315. - uint32_t energy_; - bool interleaved_; - - private: - DISALLOW_COPY_AND_ASSIGN(AudioFrame); -}; - -inline AudioFrame::AudioFrame() - : id_(-1), - timestamp_(0), - ntp_time_ms_(0), - data_(), - samples_per_channel_(0), - sample_rate_hz_(0), - num_channels_(1), - speech_type_(kUndefined), - vad_activity_(kVadUnknown), - energy_(0xffffffff), - interleaved_(true) {} - -inline void AudioFrame::UpdateFrame(int id, uint32_t timestamp, - const int16_t* data, - int samples_per_channel, int sample_rate_hz, - SpeechType speech_type, - VADActivity vad_activity, int num_channels, - uint32_t energy) { - id_ = id; - timestamp_ = timestamp; - samples_per_channel_ = samples_per_channel; - sample_rate_hz_ = sample_rate_hz; - speech_type_ = speech_type; - vad_activity_ = vad_activity; - num_channels_ = num_channels; - energy_ = energy; - - const int length = samples_per_channel * num_channels; - assert(length <= kMaxDataSizeSamples && length >= 0); - if (data != NULL) { - memcpy(data_, data, sizeof(int16_t) * length); - } else { - memset(data_, 0, sizeof(int16_t) * length); - } -} - -inline void AudioFrame::CopyFrom(const AudioFrame& src) { - if (this == &src) return; - - id_ = src.id_; - timestamp_ = src.timestamp_; - samples_per_channel_ = src.samples_per_channel_; - sample_rate_hz_ = src.sample_rate_hz_; - speech_type_ = src.speech_type_; - vad_activity_ = src.vad_activity_; - num_channels_ = src.num_channels_; - energy_ = src.energy_; - interleaved_ = src.interleaved_; - - const int length = samples_per_channel_ * num_channels_; - assert(length <= kMaxDataSizeSamples && length >= 0); - memcpy(data_, src.data_, sizeof(int16_t) * length); -} - -inline void AudioFrame::Mute() { - memset(data_, 0, samples_per_channel_ * num_channels_ * sizeof(int16_t)); -} - -inline AudioFrame& AudioFrame::operator>>=(const int rhs) { - assert((num_channels_ > 0) && (num_channels_ < 3)); - if ((num_channels_ > 2) || (num_channels_ < 1)) return *this; - - for (int i = 0; i < samples_per_channel_ * num_channels_; i++) { - data_[i] = static_cast(data_[i] >> rhs); - } - return *this; -} - -inline AudioFrame& AudioFrame::Append(const AudioFrame& rhs) { - // Sanity check - assert((num_channels_ > 0) && (num_channels_ < 3)); - assert(interleaved_ == rhs.interleaved_); - if ((num_channels_ > 2) || (num_channels_ < 1)) return *this; - if (num_channels_ != rhs.num_channels_) return *this; - - if ((vad_activity_ == kVadActive) || rhs.vad_activity_ == kVadActive) { - vad_activity_ = kVadActive; - } else if (vad_activity_ == kVadUnknown || rhs.vad_activity_ == kVadUnknown) { - vad_activity_ = kVadUnknown; - } - if (speech_type_ != rhs.speech_type_) { - speech_type_ = kUndefined; - } - - int offset = samples_per_channel_ * num_channels_; - for (int i = 0; i < rhs.samples_per_channel_ * rhs.num_channels_; i++) { - data_[offset + i] = rhs.data_[i]; - } - samples_per_channel_ += rhs.samples_per_channel_; - return *this; -} - -inline AudioFrame& AudioFrame::operator+=(const AudioFrame& rhs) { - // Sanity check - assert((num_channels_ > 0) && (num_channels_ < 3)); - assert(interleaved_ == rhs.interleaved_); - if ((num_channels_ > 2) || (num_channels_ < 1)) return *this; - if (num_channels_ != rhs.num_channels_) return *this; - - bool noPrevData = false; - if (samples_per_channel_ != rhs.samples_per_channel_) { - if (samples_per_channel_ == 0) { - // special case we have no data to start with - samples_per_channel_ = rhs.samples_per_channel_; - noPrevData = true; - } else { - return *this; - } - } - - if ((vad_activity_ == kVadActive) || rhs.vad_activity_ == kVadActive) { - vad_activity_ = kVadActive; - } else if (vad_activity_ == kVadUnknown || rhs.vad_activity_ == kVadUnknown) { - vad_activity_ = kVadUnknown; - } - - if (speech_type_ != rhs.speech_type_) speech_type_ = kUndefined; - - if (noPrevData) { - memcpy(data_, rhs.data_, - sizeof(int16_t) * rhs.samples_per_channel_ * num_channels_); - } else { - // IMPROVEMENT this can be done very fast in assembly - for (int i = 0; i < samples_per_channel_ * num_channels_; i++) { - int32_t wrapGuard = - static_cast(data_[i]) + static_cast(rhs.data_[i]); - if (wrapGuard < -32768) { - data_[i] = -32768; - } else if (wrapGuard > 32767) { - data_[i] = 32767; - } else { - data_[i] = (int16_t)wrapGuard; - } - } - } - energy_ = 0xffffffff; - return *this; -} - -inline AudioFrame& AudioFrame::operator-=(const AudioFrame& rhs) { - // Sanity check - assert((num_channels_ > 0) && (num_channels_ < 3)); - assert(interleaved_ == rhs.interleaved_); - if ((num_channels_ > 2) || (num_channels_ < 1)) return *this; - - if ((samples_per_channel_ != rhs.samples_per_channel_) || - (num_channels_ != rhs.num_channels_)) { - return *this; - } - if ((vad_activity_ != kVadPassive) || rhs.vad_activity_ != kVadPassive) { - vad_activity_ = kVadUnknown; - } - speech_type_ = kUndefined; - - for (int i = 0; i < samples_per_channel_ * num_channels_; i++) { - int32_t wrapGuard = - static_cast(data_[i]) - static_cast(rhs.data_[i]); - if (wrapGuard < -32768) { - data_[i] = -32768; - } else if (wrapGuard > 32767) { - data_[i] = 32767; - } else { - data_[i] = (int16_t)wrapGuard; - } - } - energy_ = 0xffffffff; - return *this; -} - -inline bool IsNewerSequenceNumber(uint16_t sequence_number, - uint16_t prev_sequence_number) { - return sequence_number != prev_sequence_number && - static_cast(sequence_number - prev_sequence_number) < 0x8000; -} - -inline bool IsNewerTimestamp(uint32_t timestamp, uint32_t prev_timestamp) { - return timestamp != prev_timestamp && - static_cast(timestamp - prev_timestamp) < 0x80000000; -} - -inline uint16_t LatestSequenceNumber(uint16_t sequence_number1, - uint16_t sequence_number2) { - return IsNewerSequenceNumber(sequence_number1, sequence_number2) - ? sequence_number1 - : sequence_number2; -} - -inline uint32_t LatestTimestamp(uint32_t timestamp1, uint32_t timestamp2) { - return IsNewerTimestamp(timestamp1, timestamp2) ? timestamp1 : timestamp2; -} - -} // namespace webrtc - -#endif // MODULE_COMMON_TYPES_H diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/modules/video_capture/include/video_capture.h b/thirdparties/common/include/webrtc-sdk/webrtc/modules/video_capture/include/video_capture.h deleted file mode 100755 index 6966c23..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/modules/video_capture/include/video_capture.h +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_INCLUDE_VIDEO_CAPTURE_H_ -#define WEBRTC_MODULES_VIDEO_CAPTURE_INCLUDE_VIDEO_CAPTURE_H_ - -#include "webrtc/modules/interface/module.h" -#include "webrtc/modules/video_capture/include/video_capture_defines.h" - -#ifdef ANDROID -#include -#endif - -namespace webrtc { - -#if defined(ANDROID) -int32_t SetCaptureAndroidVM(JavaVM* javaVM); -#endif - -class VideoCaptureModule: public RefCountedModule { - public: - // Interface for receiving information about available camera devices. - class DeviceInfo { - public: - virtual uint32_t NumberOfDevices() = 0; - - // Returns the available capture devices. - // deviceNumber - Index of capture device. - // deviceNameUTF8 - Friendly name of the capture device. - // deviceUniqueIdUTF8 - Unique name of the capture device if it exist. - // Otherwise same as deviceNameUTF8. - // productUniqueIdUTF8 - Unique product id if it exist. - // Null terminated otherwise. - virtual int32_t GetDeviceName( - uint32_t deviceNumber, - char* deviceNameUTF8, - uint32_t deviceNameLength, - char* deviceUniqueIdUTF8, - uint32_t deviceUniqueIdUTF8Length, - char* productUniqueIdUTF8 = 0, - uint32_t productUniqueIdUTF8Length = 0) = 0; - - - // Returns the number of capabilities this device. - virtual int32_t NumberOfCapabilities( - const char* deviceUniqueIdUTF8) = 0; - - // Gets the capabilities of the named device. - virtual int32_t GetCapability( - const char* deviceUniqueIdUTF8, - const uint32_t deviceCapabilityNumber, - VideoCaptureCapability& capability) = 0; - - // Gets clockwise angle the captured frames should be rotated in order - // to be displayed correctly on a normally rotated display. - virtual int32_t GetOrientation( - const char* deviceUniqueIdUTF8, - VideoCaptureRotation& orientation) = 0; - - // Gets the capability that best matches the requested width, height and - // frame rate. - // Returns the deviceCapabilityNumber on success. - virtual int32_t GetBestMatchedCapability( - const char* deviceUniqueIdUTF8, - const VideoCaptureCapability& requested, - VideoCaptureCapability& resulting) = 0; - - // Display OS /capture device specific settings dialog - virtual int32_t DisplayCaptureSettingsDialogBox( - const char* deviceUniqueIdUTF8, - const char* dialogTitleUTF8, - void* parentWindow, - uint32_t positionX, - uint32_t positionY) = 0; - - virtual ~DeviceInfo() {} - }; - - class VideoCaptureEncodeInterface { - public: - virtual int32_t ConfigureEncoder(const VideoCodec& codec, - uint32_t maxPayloadSize) = 0; - // Inform the encoder about the new target bit rate. - // - newBitRate : New target bit rate in Kbit/s. - // - frameRate : The target frame rate. - virtual int32_t SetRates(int32_t newBitRate, int32_t frameRate) = 0; - // Inform the encoder about the packet loss and the round-trip time. - // - packetLoss : Fraction lost - // (loss rate in percent = 100 * packetLoss / 255). - // - rtt : Round-trip time in milliseconds. - virtual int32_t SetChannelParameters(uint32_t packetLoss, int rtt) = 0; - - // Encode the next frame as key frame. - virtual int32_t EncodeFrameType(const FrameType type) = 0; - protected: - virtual ~VideoCaptureEncodeInterface() { - } - }; - - // Register capture data callback - virtual void RegisterCaptureDataCallback( - VideoCaptureDataCallback& dataCallback) = 0; - - // Remove capture data callback - virtual void DeRegisterCaptureDataCallback() = 0; - - // Register capture callback. - virtual void RegisterCaptureCallback(VideoCaptureFeedBack& callBack) = 0; - - // Remove capture callback. - virtual void DeRegisterCaptureCallback() = 0; - - // Start capture device - virtual int32_t StartCapture( - const VideoCaptureCapability& capability) = 0; - - virtual int32_t StopCapture() = 0; - - // Returns the name of the device used by this module. - virtual const char* CurrentDeviceName() const = 0; - - // Returns true if the capture device is running - virtual bool CaptureStarted() = 0; - - // Gets the current configuration. - virtual int32_t CaptureSettings(VideoCaptureCapability& settings) = 0; - - virtual void SetCaptureDelay(int32_t delayMS) = 0; - - // Returns the current CaptureDelay. Only valid when the camera is running. - virtual int32_t CaptureDelay() = 0; - - // Set the rotation of the captured frames. - // If the rotation is set to the same as returned by - // DeviceInfo::GetOrientation the captured frames are - // displayed correctly if rendered. - virtual int32_t SetCaptureRotation(VideoCaptureRotation rotation) = 0; - - // Gets a pointer to an encode interface if the capture device supports the - // requested type and size. NULL otherwise. - virtual VideoCaptureEncodeInterface* GetEncodeInterface( - const VideoCodec& codec) = 0; - - virtual void EnableFrameRateCallback(const bool enable) = 0; - virtual void EnableNoPictureAlarm(const bool enable) = 0; - -protected: - virtual ~VideoCaptureModule() {}; -}; - -} // namespace webrtc -#endif // WEBRTC_MODULES_VIDEO_CAPTURE_INCLUDE_VIDEO_CAPTURE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/modules/video_capture/include/video_capture_defines.h b/thirdparties/common/include/webrtc-sdk/webrtc/modules/video_capture/include/video_capture_defines.h deleted file mode 100755 index 330bfc7..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/modules/video_capture/include/video_capture_defines.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_INCLUDE_VIDEO_CAPTURE_DEFINES_H_ -#define WEBRTC_MODULES_VIDEO_CAPTURE_INCLUDE_VIDEO_CAPTURE_DEFINES_H_ - -#include "webrtc/common_video/interface/i420_video_frame.h" -#include "webrtc/modules/interface/module_common_types.h" -#include "webrtc/typedefs.h" - -namespace webrtc -{ -// Defines -#ifndef NULL - #define NULL 0 -#endif - -enum {kVideoCaptureUniqueNameLength =1024}; //Max unique capture device name lenght -enum {kVideoCaptureDeviceNameLength =256}; //Max capture device name lenght -enum {kVideoCaptureProductIdLength =128}; //Max product id length - -// Enums -enum VideoCaptureRotation -{ - kCameraRotate0 = 0, - kCameraRotate90 = 5, - kCameraRotate180 = 10, - kCameraRotate270 = 15 -}; - -struct VideoCaptureCapability -{ - int32_t width; - int32_t height; - int32_t maxFPS; - int32_t expectedCaptureDelay; - RawVideoType rawType; - VideoCodecType codecType; - bool interlaced; - - VideoCaptureCapability() - { - width = 0; - height = 0; - maxFPS = 0; - expectedCaptureDelay = 0; - rawType = kVideoUnknown; - codecType = kVideoCodecUnknown; - interlaced = false; - } - ; - bool operator!=(const VideoCaptureCapability &other) const - { - if (width != other.width) - return true; - if (height != other.height) - return true; - if (maxFPS != other.maxFPS) - return true; - if (rawType != other.rawType) - return true; - if (codecType != other.codecType) - return true; - if (interlaced != other.interlaced) - return true; - return false; - } - bool operator==(const VideoCaptureCapability &other) const - { - return !operator!=(other); - } -}; - -enum VideoCaptureAlarm -{ - Raised = 0, - Cleared = 1 -}; - -/* External Capture interface. Returned by Create - and implemented by the capture module. - */ -class VideoCaptureExternal -{ -public: - // |capture_time| must be specified in the NTP time format in milliseconds. - virtual int32_t IncomingFrame(uint8_t* videoFrame, - int32_t videoFrameLength, - const VideoCaptureCapability& frameInfo, - int64_t captureTime = 0) = 0; - virtual int32_t IncomingI420VideoFrame(I420VideoFrame* video_frame, - int64_t captureTime = 0) = 0; - -protected: - ~VideoCaptureExternal() {} -}; - -// Callback class to be implemented by module user -class VideoCaptureDataCallback -{ -public: - virtual void OnIncomingCapturedFrame(const int32_t id, - I420VideoFrame& videoFrame) = 0; - virtual void OnCaptureDelayChanged(const int32_t id, - const int32_t delay) = 0; -protected: - virtual ~VideoCaptureDataCallback(){} -}; - -class VideoCaptureFeedBack -{ -public: - virtual void OnCaptureFrameRate(const int32_t id, - const uint32_t frameRate) = 0; - virtual void OnNoPictureAlarm(const int32_t id, - const VideoCaptureAlarm alarm) = 0; -protected: - virtual ~VideoCaptureFeedBack(){} -}; - -} // namespace webrtc - -#endif // WEBRTC_MODULES_VIDEO_CAPTURE_INCLUDE_VIDEO_CAPTURE_DEFINES_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/modules/video_capture/include/video_capture_factory.h b/thirdparties/common/include/webrtc-sdk/webrtc/modules/video_capture/include/video_capture_factory.h deleted file mode 100755 index ec92d31..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/modules/video_capture/include/video_capture_factory.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// This file contains interfaces used for creating the VideoCaptureModule -// and DeviceInfo. - -#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_INCLUDE_VIDEO_CAPTURE_FACTORY_H_ -#define WEBRTC_MODULES_VIDEO_CAPTURE_INCLUDE_VIDEO_CAPTURE_FACTORY_H_ - -#include "webrtc/modules/video_capture/include/video_capture.h" - -namespace webrtc { - -class VideoCaptureFactory { - public: - // Create a video capture module object - // id - unique identifier of this video capture module object. - // deviceUniqueIdUTF8 - name of the device. - // Available names can be found by using GetDeviceName - static VideoCaptureModule* Create(const int32_t id, - const char* deviceUniqueIdUTF8); - - // Create a video capture module object used for external capture. - // id - unique identifier of this video capture module object - // externalCapture - [out] interface to call when a new frame is captured. - static VideoCaptureModule* Create(const int32_t id, - VideoCaptureExternal*& externalCapture); - - static VideoCaptureModule::DeviceInfo* CreateDeviceInfo( - const int32_t id); - -#ifdef WEBRTC_ANDROID - static int32_t SetAndroidObjects(void* javaVM, void* javaContext); -#endif - - private: - ~VideoCaptureFactory(); -}; - -} // namespace webrtc - -#endif // WEBRTC_MODULES_VIDEO_CAPTURE_INCLUDE_VIDEO_CAPTURE_FACTORY_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/aligned_malloc.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/aligned_malloc.h deleted file mode 100755 index 5d343cd..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/aligned_malloc.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ALIGNED_MALLOC_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ALIGNED_MALLOC_H_ - -// The functions declared here -// 1) Allocates block of aligned memory. -// 2) Re-calculates a pointer such that it is aligned to a higher or equal -// address. -// Note: alignment must be a power of two. The alignment is in bytes. - -#include - -namespace webrtc { - -// Returns a pointer to the first boundry of |alignment| bytes following the -// address of |ptr|. -// Note that there is no guarantee that the memory in question is available. -// |ptr| has no requirements other than it can't be NULL. -void* GetRightAlign(const void* ptr, size_t alignment); - -// Allocates memory of |size| bytes aligned on an |alignment| boundry. -// The return value is a pointer to the memory. Note that the memory must -// be de-allocated using AlignedFree. -void* AlignedMalloc(size_t size, size_t alignment); -// De-allocates memory created using the AlignedMalloc() API. -void AlignedFree(void* mem_block); - -// Templated versions to facilitate usage of aligned malloc without casting -// to and from void*. -template -T* GetRightAlign(const T* ptr, size_t alignment) { - return reinterpret_cast(GetRightAlign(reinterpret_cast(ptr), - alignment)); -} -template -T* AlignedMalloc(size_t size, size_t alignment) { - return reinterpret_cast(AlignedMalloc(size, alignment)); -} - -// Deleter for use with scoped_ptr. E.g., use as -// scoped_ptr foo; -struct AlignedFreeDeleter { - inline void operator()(void* ptr) const { - AlignedFree(ptr); - } -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ALIGNED_MALLOC_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/asm_defines.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/asm_defines.h deleted file mode 100755 index 4b839a9..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/asm_defines.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ASM_DEFINES_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ASM_DEFINES_H_ - -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif - -// Define the macros used in ARM assembly code, so that for Mac or iOS builds -// we add leading underscores for the function names. -#ifdef __APPLE__ -.macro GLOBAL_FUNCTION name -.global _\name -.endm -.macro DEFINE_FUNCTION name -_\name: -.endm -.macro CALL_FUNCTION name -bl _\name -.endm -.macro GLOBAL_LABEL name -.global _\name -.endm -#else -.macro GLOBAL_FUNCTION name -.global \name -.endm -.macro DEFINE_FUNCTION name -\name: -.endm -.macro CALL_FUNCTION name -bl \name -.endm -.macro GLOBAL_LABEL name -.global \name -.endm -#endif - -// With Apple's clang compiler, for instructions ldrb, strh, etc., -// the condition code is after the width specifier. Here we define -// only the ones that are actually used in the assembly files. -#if (defined __llvm__) && (defined __APPLE__) -.macro streqh reg1, reg2, num -strheq \reg1, \reg2, \num -.endm -#endif - -.text - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ASM_DEFINES_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/atomic32.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/atomic32.h deleted file mode 100755 index 8633e26..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/atomic32.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Atomic, system independent 32-bit integer. Unless you know what you're -// doing, use locks instead! :-) -// -// Note: assumes 32-bit (or higher) system -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ATOMIC32_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ATOMIC32_H_ - -#include - -#include "webrtc/base/constructormagic.h" -#include "webrtc/common_types.h" - -namespace webrtc { - -// 32 bit atomic variable. Note that this class relies on the compiler to -// align the 32 bit value correctly (on a 32 bit boundary), so as long as you're -// not doing things like reinterpret_cast over some custom allocated memory -// without being careful with alignment, you should be fine. -class Atomic32 { - public: - Atomic32(int32_t initial_value = 0); - ~Atomic32(); - - // Prefix operator! - int32_t operator++(); - int32_t operator--(); - - int32_t operator+=(int32_t value); - int32_t operator-=(int32_t value); - - // Sets the value atomically to new_value if the value equals compare value. - // The function returns true if the exchange happened. - bool CompareExchange(int32_t new_value, int32_t compare_value); - int32_t Value() { - return *this += 0; - } - - private: - // Disable the + and - operator since it's unclear what these operations - // should do. - Atomic32 operator+(const Atomic32& other); - Atomic32 operator-(const Atomic32& other); - - // Checks if |_value| is 32bit aligned. - inline bool Is32bitAligned() const { - return (reinterpret_cast(&value_) & 3) == 0; - } - - DISALLOW_COPY_AND_ASSIGN(Atomic32); - - int32_t value_; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ATOMIC32_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/clock.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/clock.h deleted file mode 100755 index ce32691..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/clock.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_CLOCK_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_CLOCK_H_ - -#include "webrtc/typedefs.h" - -namespace webrtc { - -// January 1970, in NTP seconds. -const uint32_t kNtpJan1970 = 2208988800UL; - -// Magic NTP fractional unit. -const double kMagicNtpFractionalUnit = 4.294967296E+9; - -// A clock interface that allows reading of absolute and relative timestamps. -class Clock { - public: - virtual ~Clock() {} - - // Return a timestamp in milliseconds relative to some arbitrary source; the - // source is fixed for this clock. - virtual int64_t TimeInMilliseconds() = 0; - - // Return a timestamp in microseconds relative to some arbitrary source; the - // source is fixed for this clock. - virtual int64_t TimeInMicroseconds() = 0; - - // Retrieve an NTP absolute timestamp in seconds and fractions of a second. - virtual void CurrentNtp(uint32_t& seconds, uint32_t& fractions) = 0; - - // Retrieve an NTP absolute timestamp in milliseconds. - virtual int64_t CurrentNtpInMilliseconds() = 0; - - // Converts an NTP timestamp to a millisecond timestamp. - static int64_t NtpToMs(uint32_t seconds, uint32_t fractions); - - // Returns an instance of the real-time system clock implementation. - static Clock* GetRealTimeClock(); -}; - -class SimulatedClock : public Clock { - public: - explicit SimulatedClock(int64_t initial_time_us); - - virtual ~SimulatedClock() {} - - // Return a timestamp in milliseconds relative to some arbitrary source; the - // source is fixed for this clock. - virtual int64_t TimeInMilliseconds() OVERRIDE; - - // Return a timestamp in microseconds relative to some arbitrary source; the - // source is fixed for this clock. - virtual int64_t TimeInMicroseconds() OVERRIDE; - - // Retrieve an NTP absolute timestamp in milliseconds. - virtual void CurrentNtp(uint32_t& seconds, uint32_t& fractions) OVERRIDE; - - // Converts an NTP timestamp to a millisecond timestamp. - virtual int64_t CurrentNtpInMilliseconds() OVERRIDE; - - // Advance the simulated clock with a given number of milliseconds or - // microseconds. - void AdvanceTimeMilliseconds(int64_t milliseconds); - void AdvanceTimeMicroseconds(int64_t microseconds); - - private: - int64_t time_us_; -}; - -}; // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_CLOCK_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/compile_assert.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/compile_assert.h deleted file mode 100755 index a075184..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/compile_assert.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Borrowed from Chromium's src/base/macros.h. - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_COMPILE_ASSERT_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_COMPILE_ASSERT_H_ - -// The COMPILE_ASSERT macro can be used to verify that a compile time -// expression is true. For example, you could use it to verify the -// size of a static array: -// -// COMPILE_ASSERT(ARRAYSIZE_UNSAFE(content_type_names) == CONTENT_NUM_TYPES, -// content_type_names_incorrect_size); -// -// or to make sure a struct is smaller than a certain size: -// -// COMPILE_ASSERT(sizeof(foo) < 128, foo_too_large); -// -// The second argument to the macro is the name of the variable. If -// the expression is false, most compilers will issue a warning/error -// containing the name of the variable. - -// TODO(ajm): Hack to avoid multiple definitions until the base/ of webrtc and -// libjingle are merged. -#if !defined(COMPILE_ASSERT) -#if __cplusplus >= 201103L -// Under C++11, just use static_assert. -#define COMPILE_ASSERT(expr, msg) static_assert(expr, #msg) - -#else -template -struct CompileAssert { -}; - -#define COMPILE_ASSERT(expr, msg) \ - typedef CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] - -#endif // __cplusplus >= 201103L -#endif // !defined(COMPILE_ASSERT) - -// Implementation details of COMPILE_ASSERT: -// -// - COMPILE_ASSERT works by defining an array type that has -1 -// elements (and thus is invalid) when the expression is false. -// -// - The simpler definition -// -// #define COMPILE_ASSERT(expr, msg) typedef char msg[(expr) ? 1 : -1] -// -// does not work, as gcc supports variable-length arrays whose sizes -// are determined at run-time (this is gcc's extension and not part -// of the C++ standard). As a result, gcc fails to reject the -// following code with the simple definition: -// -// int foo; -// COMPILE_ASSERT(foo, msg); // not supposed to compile as foo is -// // not a compile-time constant. -// -// - By using the type CompileAssert<(bool(expr))>, we ensures that -// expr is a compile-time constant. (Template arguments must be -// determined at compile-time.) -// -// - The outer parentheses in CompileAssert<(bool(expr))> are necessary -// to work around a bug in gcc 3.4.4 and 4.0.1. If we had written -// -// CompileAssert -// -// instead, these compilers will refuse to compile -// -// COMPILE_ASSERT(5 > 0, some_message); -// -// (They seem to think the ">" in "5 > 0" marks the end of the -// template argument list.) -// -// - The array size is (bool(expr) ? 1 : -1), instead of simply -// -// ((expr) ? 1 : -1). -// -// This is to avoid running into a bug in MS VC 7.1, which -// causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1. - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_COMPILE_ASSERT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/compile_assert_c.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/compile_assert_c.h deleted file mode 100755 index d9ba866..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/compile_assert_c.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_COMPILE_ASSERT_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_COMPILE_ASSERT_H_ - -// Only use this for C files. For C++, use compile_assert.h. -// -// Use this macro to verify at compile time that certain restrictions are met. -// The argument is the boolean expression to evaluate. -// Example: -// COMPILE_ASSERT(sizeof(foo) < 128); -#define COMPILE_ASSERT(expression) switch (0) {case 0: case expression:;} - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_COMPILE_ASSERT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/condition_variable_wrapper.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/condition_variable_wrapper.h deleted file mode 100755 index 151f00e..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/condition_variable_wrapper.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_CONDITION_VARIABLE_WRAPPER_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_CONDITION_VARIABLE_WRAPPER_H_ - -namespace webrtc { - -class CriticalSectionWrapper; - -class ConditionVariableWrapper { - public: - // Factory method, constructor disabled. - static ConditionVariableWrapper* CreateConditionVariable(); - - virtual ~ConditionVariableWrapper() {} - - // Calling thread will atomically release crit_sect and wait until next - // some other thread calls Wake() or WakeAll(). - virtual void SleepCS(CriticalSectionWrapper& crit_sect) = 0; - - // Same as above but with a timeout. - virtual bool SleepCS(CriticalSectionWrapper& crit_sect, - unsigned long max_time_in_ms) = 0; - - // Wakes one thread calling SleepCS(). - virtual void Wake() = 0; - - // Wakes all threads calling SleepCS(). - virtual void WakeAll() = 0; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_CONDITION_VARIABLE_WRAPPER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/cpu_features_wrapper.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/cpu_features_wrapper.h deleted file mode 100755 index 5697c49..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/cpu_features_wrapper.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_CPU_FEATURES_WRAPPER_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_CPU_FEATURES_WRAPPER_H_ - -#if defined(__cplusplus) || defined(c_plusplus) -extern "C" { -#endif - -#include "webrtc/typedefs.h" - -// List of features in x86. -typedef enum { - kSSE2, - kSSE3 -} CPUFeature; - -// List of features in ARM. -enum { - kCPUFeatureARMv7 = (1 << 0), - kCPUFeatureVFPv3 = (1 << 1), - kCPUFeatureNEON = (1 << 2), - kCPUFeatureLDREXSTREX = (1 << 3) -}; - -typedef int (*WebRtc_CPUInfo)(CPUFeature feature); - -// Returns true if the CPU supports the feature. -extern WebRtc_CPUInfo WebRtc_GetCPUInfo; - -// No CPU feature is available => straight C path. -extern WebRtc_CPUInfo WebRtc_GetCPUInfoNoASM; - -// Return the features in an ARM device. -// It detects the features in the hardware platform, and returns supported -// values in the above enum definition as a bitmask. -extern uint64_t WebRtc_GetCPUFeaturesARM(void); - -#if defined(__cplusplus) || defined(c_plusplus) -} // extern "C" -#endif - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_CPU_FEATURES_WRAPPER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/cpu_info.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/cpu_info.h deleted file mode 100755 index fa8c388..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/cpu_info.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_CPU_INFO_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_CPU_INFO_H_ - -#include "webrtc/typedefs.h" - -namespace webrtc { - -class CpuInfo { - public: - static uint32_t DetectNumberOfCores(); - - private: - CpuInfo() {} - static uint32_t number_of_cores_; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_CPU_INFO_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/critical_section_wrapper.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/critical_section_wrapper.h deleted file mode 100755 index 4979b5c..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/critical_section_wrapper.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_CRITICAL_SECTION_WRAPPER_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_CRITICAL_SECTION_WRAPPER_H_ - -// If the critical section is heavily contended it may be beneficial to use -// read/write locks instead. - -#include "webrtc/common_types.h" -#include "webrtc/system_wrappers/interface/thread_annotations.h" - -namespace webrtc { -class LOCKABLE CriticalSectionWrapper { - public: - // Factory method, constructor disabled - static CriticalSectionWrapper* CreateCriticalSection(); - - virtual ~CriticalSectionWrapper() {} - - // Tries to grab lock, beginning of a critical section. Will wait for the - // lock to become available if the grab failed. - virtual void Enter() EXCLUSIVE_LOCK_FUNCTION() = 0; - - // Returns a grabbed lock, end of critical section. - virtual void Leave() UNLOCK_FUNCTION() = 0; -}; - -// RAII extension of the critical section. Prevents Enter/Leave mismatches and -// provides more compact critical section syntax. -class SCOPED_LOCKABLE CriticalSectionScoped { - public: - explicit CriticalSectionScoped(CriticalSectionWrapper* critsec) - EXCLUSIVE_LOCK_FUNCTION(critsec) - : ptr_crit_sec_(critsec) { - ptr_crit_sec_->Enter(); - } - - ~CriticalSectionScoped() UNLOCK_FUNCTION() { ptr_crit_sec_->Leave(); } - - private: - CriticalSectionWrapper* ptr_crit_sec_; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_CRITICAL_SECTION_WRAPPER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/data_log.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/data_log.h deleted file mode 100755 index 9608f2c..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/data_log.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// This singleton can be used for logging data for offline processing. Data -// logged with it can conveniently be parsed and processed with e.g. Matlab. -// -// Following is an example of the log file format, starting with the header -// row at line 1, and the data rows following. -// col1,col2,col3,multi-value-col4[3],,,col5 -// 123,10.2,-243,1,2,3,100 -// 241,12.3,233,1,2,3,200 -// 13,16.4,-13,1,2,3,300 -// -// As can be seen in the example, a multi-value-column is specified with the -// name followed the number of elements it contains. This followed by -// number of elements - 1 empty columns. -// -// Without multi-value-columns this format can be natively by Matlab. With -// multi-value-columns a small Matlab script is needed, available at -// trunk/tools/matlab/parseLog.m. -// -// Table names and column names are case sensitive. - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_DATA_LOG_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_DATA_LOG_H_ - -#include - -#include "webrtc/system_wrappers/interface/data_log_impl.h" - -namespace webrtc { - -class DataLog { - public: - // Creates a log which uses a separate thread (referred to as the file - // writer thread) for writing log rows to file. - // - // Calls to this function after the log object has been created will only - // increment the reference counter. - static int CreateLog(); - - // Decrements the reference counter and deletes the log when the counter - // reaches 0. Should be called equal number of times as successful calls to - // CreateLog or memory leak will occur. - static void ReturnLog(); - - // Combines the string table_name and the integer table_id into a new string - // table_name + _ + table_id. The new string will be lower-case. - static std::string Combine(const std::string& table_name, int table_id); - - // Adds a new table, with the name table_name, and creates the file, with the - // name table_name + ".txt", to which the table will be written. - // table_name is treated in a case sensitive way. - static int AddTable(const std::string& table_name); - - // Adds a new column to a table. The column will be a multi-value-column - // if multi_value_length is greater than 1. - // table_name and column_name are treated in a case sensitive way. - static int AddColumn(const std::string& table_name, - const std::string& column_name, - int multi_value_length); - - // Inserts a single value into a table with name table_name at the column with - // name column_name. - // Note that the ValueContainer makes use of the copy constructor, - // operator= and operator<< of the type T, and that the template type must - // implement a deep copy copy constructor and operator=. - // Copy constructor and operator= must not be disabled for the type T. - // table_name and column_name are treated in a case sensitive way. - template - static int InsertCell(const std::string& table_name, - const std::string& column_name, - T value) { - DataLogImpl* data_log = DataLogImpl::StaticInstance(); - if (data_log == NULL) - return -1; - return data_log->InsertCell( - table_name, - column_name, - new ValueContainer(value)); - } - - // Inserts an array of values into a table with name table_name at the - // column specified by column_name, which must be a multi-value-column. - // Note that the MultiValueContainer makes use of the copy constructor, - // operator= and operator<< of the type T, and that the template type - // must implement a deep copy copy constructor and operator=. - // Copy constructor and operator= must not be disabled for the type T. - // table_name and column_name are treated in a case sensitive way. - template - static int InsertCell(const std::string& table_name, - const std::string& column_name, - const T* array, - int length) { - DataLogImpl* data_log = DataLogImpl::StaticInstance(); - if (data_log == NULL) - return -1; - return data_log->InsertCell( - table_name, - column_name, - new MultiValueContainer(array, length)); - } - - // For the table with name table_name: Writes the current row to file. - // Starts a new empty row. - // table_name is treated in a case-sensitive way. - static int NextRow(const std::string& table_name); -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_DATA_LOG_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/data_log_c.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/data_log_c.h deleted file mode 100755 index 4ff8329..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/data_log_c.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// This is a pure C wrapper of the DataLog class. The functions are directly -// mapped here except for InsertCell as C does not support templates. -// See data_log.h for a description of the functions. - -#ifndef SRC_SYSTEM_WRAPPERS_INTERFACE_DATA_LOG_C_H_ -#define SRC_SYSTEM_WRAPPERS_INTERFACE_DATA_LOG_C_H_ - -#include // size_t - -#include "webrtc/typedefs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -// All char* parameters in this file are expected to be null-terminated -// character sequences. -int WebRtcDataLog_CreateLog(); -void WebRtcDataLog_ReturnLog(); -char* WebRtcDataLog_Combine(char* combined_name, size_t combined_len, - const char* table_name, int table_id); -int WebRtcDataLog_AddTable(const char* table_name); -int WebRtcDataLog_AddColumn(const char* table_name, const char* column_name, - int multi_value_length); - -int WebRtcDataLog_InsertCell_int(const char* table_name, - const char* column_name, - int value); -int WebRtcDataLog_InsertArray_int(const char* table_name, - const char* column_name, - const int* values, - int length); -int WebRtcDataLog_InsertCell_float(const char* table_name, - const char* column_name, - float value); -int WebRtcDataLog_InsertArray_float(const char* table_name, - const char* column_name, - const float* values, - int length); -int WebRtcDataLog_InsertCell_double(const char* table_name, - const char* column_name, - double value); -int WebRtcDataLog_InsertArray_double(const char* table_name, - const char* column_name, - const double* values, - int length); -int WebRtcDataLog_InsertCell_int32(const char* table_name, - const char* column_name, - int32_t value); -int WebRtcDataLog_InsertArray_int32(const char* table_name, - const char* column_name, - const int32_t* values, - int length); -int WebRtcDataLog_InsertCell_uint32(const char* table_name, - const char* column_name, - uint32_t value); -int WebRtcDataLog_InsertArray_uint32(const char* table_name, - const char* column_name, - const uint32_t* values, - int length); -int WebRtcDataLog_InsertCell_int64(const char* table_name, - const char* column_name, - int64_t value); -int WebRtcDataLog_InsertArray_int64(const char* table_name, - const char* column_name, - const int64_t* values, - int length); - -int WebRtcDataLog_NextRow(const char* table_name); - -#ifdef __cplusplus -} // end of extern "C" -#endif - -#endif // SRC_SYSTEM_WRAPPERS_INTERFACE_DATA_LOG_C_H_ // NOLINT diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/data_log_impl.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/data_log_impl.h deleted file mode 100755 index 0e5feef..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/data_log_impl.h +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// This file contains the helper classes for the DataLog APIs. See data_log.h -// for the APIs. -// -// These classes are helper classes used for logging data for offline -// processing. Data logged with these classes can conveniently be parsed and -// processed with e.g. Matlab. -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_DATA_LOG_IMPL_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_DATA_LOG_IMPL_H_ - -#include -#include -#include -#include - -#include "webrtc/system_wrappers/interface/scoped_ptr.h" -#include "webrtc/typedefs.h" - -namespace webrtc { - -class CriticalSectionWrapper; -class EventWrapper; -class LogTable; -class RWLockWrapper; -class ThreadWrapper; - -// All container classes need to implement a ToString-function to be -// writable to file. Enforce this via the Container interface. -class Container { - public: - virtual ~Container() {} - - virtual void ToString(std::string* container_string) const = 0; -}; - -template -class ValueContainer : public Container { - public: - explicit ValueContainer(T data) : data_(data) {} - - virtual void ToString(std::string* container_string) const { - *container_string = ""; - std::stringstream ss; - ss << data_ << ","; - ss >> *container_string; - } - - private: - T data_; -}; - -template -class MultiValueContainer : public Container { - public: - MultiValueContainer(const T* data, int length) - : data_(data, data + length) { - } - - virtual void ToString(std::string* container_string) const { - *container_string = ""; - std::stringstream ss; - for (size_t i = 0; i < data_.size(); ++i) - ss << data_[i] << ","; - *container_string += ss.str(); - } - - private: - std::vector data_; -}; - -class DataLogImpl { - public: - ~DataLogImpl(); - - // The implementation of the CreateLog() method declared in data_log.h. - // See data_log.h for a description. - static int CreateLog(); - - // The implementation of the StaticInstance() method declared in data_log.h. - // See data_log.h for a description. - static DataLogImpl* StaticInstance(); - - // The implementation of the ReturnLog() method declared in data_log.h. See - // data_log.h for a description. - static void ReturnLog(); - - // The implementation of the AddTable() method declared in data_log.h. See - // data_log.h for a description. - int AddTable(const std::string& table_name); - - // The implementation of the AddColumn() method declared in data_log.h. See - // data_log.h for a description. - int AddColumn(const std::string& table_name, - const std::string& column_name, - int multi_value_length); - - // Inserts a Container into a table with name table_name at the column - // with name column_name. - // column_name is treated in a case sensitive way. - int InsertCell(const std::string& table_name, - const std::string& column_name, - const Container* value_container); - - // The implementation of the NextRow() method declared in data_log.h. See - // data_log.h for a description. - int NextRow(const std::string& table_name); - - private: - DataLogImpl(); - - // Initializes the DataLogImpl object, allocates and starts the - // thread file_writer_thread_. - int Init(); - - // Write all complete rows in every table to file. - // This function should only be called by the file_writer_thread_ if that - // thread is running to avoid race conditions. - void Flush(); - - // Run() is called by the thread file_writer_thread_. - static bool Run(void* obj); - - // This function writes data to file. Note, it blocks if there is no data - // that should be written to file availble. Flush is the non-blocking - // version of this function. - void Process(); - - // Stops the continuous calling of Process(). - void StopThread(); - - // Collection of tables indexed by the table name as std::string. - typedef std::map TableMap; - typedef webrtc::scoped_ptr CritSectScopedPtr; - - static CritSectScopedPtr crit_sect_; - static DataLogImpl* instance_; - int counter_; - TableMap tables_; - EventWrapper* flush_event_; - ThreadWrapper* file_writer_thread_; - RWLockWrapper* tables_lock_; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_DATA_LOG_IMPL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/event_tracer.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/event_tracer.h deleted file mode 100755 index 80f0fa7..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/event_tracer.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// This file defines the interface for event tracing in WebRTC. -// -// Event log handlers are set through SetupEventTracer(). User of this API will -// provide two function pointers to handle event tracing calls. -// -// * GetCategoryEnabledPtr -// Event tracing system calls this function to determine if a particular -// event category is enabled. -// -// * AddTraceEventPtr -// Adds a tracing event. It is the user's responsibility to log the data -// provided. -// -// Parameters for the above two functions are described in trace_event.h. - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_EVENT_TRACER_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_EVENT_TRACER_H_ - -#include "webrtc/common_types.h" - -namespace webrtc { - -typedef const unsigned char* (*GetCategoryEnabledPtr)(const char* name); -typedef void (*AddTraceEventPtr)(char phase, - const unsigned char* category_enabled, - const char* name, - unsigned long long id, - int num_args, - const char** arg_names, - const unsigned char* arg_types, - const unsigned long long* arg_values, - unsigned char flags); - -// User of WebRTC can call this method to setup event tracing. -// -// This method must be called before any WebRTC methods. Functions -// provided should be thread-safe. -WEBRTC_DLLEXPORT void SetupEventTracer( - GetCategoryEnabledPtr get_category_enabled_ptr, - AddTraceEventPtr add_trace_event_ptr); - -// This class defines interface for the event tracing system to call -// internally. Do not call these methods directly. -class EventTracer { - public: - static const unsigned char* GetCategoryEnabled( - const char* name); - - static void AddTraceEvent( - char phase, - const unsigned char* category_enabled, - const char* name, - unsigned long long id, - int num_args, - const char** arg_names, - const unsigned char* arg_types, - const unsigned long long* arg_values, - unsigned char flags); -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_EVENT_TRACER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/event_wrapper.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/event_wrapper.h deleted file mode 100755 index 7a18232..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/event_wrapper.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_EVENT_WRAPPER_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_EVENT_WRAPPER_H_ - -namespace webrtc { -enum EventTypeWrapper { - kEventSignaled = 1, - kEventError = 2, - kEventTimeout = 3 -}; - -#define WEBRTC_EVENT_10_SEC 10000 -#define WEBRTC_EVENT_INFINITE 0xffffffff - -class EventWrapper { - public: - // Factory method. Constructor disabled. - static EventWrapper* Create(); - virtual ~EventWrapper() {} - - // Releases threads who are calling Wait() and has started waiting. Please - // note that a thread calling Wait() will not start waiting immediately. - // assumptions to the contrary is a very common source of issues in - // multithreaded programming. - // Set is sticky in the sense that it will release at least one thread - // either immediately or some time in the future. - virtual bool Set() = 0; - - // Prevents future Wait() calls from finishing without a new Set() call. - virtual bool Reset() = 0; - - // Puts the calling thread into a wait state. The thread may be released - // by a Set() call depending on if other threads are waiting and if so on - // timing. The thread that was released will call Reset() before leaving - // preventing more threads from being released. If multiple threads - // are waiting for the same Set(), only one (random) thread is guaranteed to - // be released. It is possible that multiple (random) threads are released - // Depending on timing. - virtual EventTypeWrapper Wait(unsigned long max_time) = 0; - - // Starts a timer that will call a non-sticky version of Set() either once - // or periodically. If the timer is periodic it ensures that there is no - // drift over time relative to the system clock. - virtual bool StartTimer(bool periodic, unsigned long time) = 0; - - virtual bool StopTimer() = 0; - -}; -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_EVENT_WRAPPER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/field_trial.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/field_trial.h deleted file mode 100755 index f2cf880..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/field_trial.h +++ /dev/null @@ -1,70 +0,0 @@ -// -// Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. -// -// Use of this source code is governed by a BSD-style license -// that can be found in the LICENSE file in the root of the source -// tree. An additional intellectual property rights grant can be found -// in the file PATENTS. All contributing project authors may -// be found in the AUTHORS file in the root of the source tree. -// - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_FIELD_TRIAL_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_FIELD_TRIAL_H_ - -#include - -#include "webrtc/common_types.h" - -// Field trials allow webrtc clients (such as Chrome) to turn on feature code -// in binaries out in the field and gather information with that. -// -// WebRTC clients MUST provide an implementation of: -// -// std::string webrtc::field_trial::FindFullName(const std::string& trial). -// -// Or link with a default one provided in: -// -// system_wrappers/source/system_wrappers.gyp:field_trial_default -// -// -// They are designed to wire up directly to chrome field trials and to speed up -// developers by reducing the need to wire APIs to control whether a feature is -// on/off. E.g. to experiment with a new method that could lead to a different -// trade-off between CPU/bandwidth: -// -// 1 - Develop the feature with default behaviour off: -// -// if (FieldTrial::FindFullName("WebRTCExperimenMethod2") == "Enabled") -// method2(); -// else -// method1(); -// -// 2 - Once the changes are rolled to chrome, the new code path can be -// controlled as normal chrome field trials. -// -// 3 - Evaluate the new feature and clean the code paths. -// -// Notes: -// - NOT every feature is a candidate to be controlled by this mechanism as -// it may require negotation between involved parties (e.g. SDP). -// -// TODO(andresp): since chrome --force-fieldtrials does not marks the trial -// as active it does not gets propaged to renderer process. For now one -// needs to push a config with start_active:true or run a local finch -// server. -// -// TODO(andresp): find out how to get bots to run tests with trials enabled. - -namespace webrtc { -namespace field_trial { - -// Returns the group name chosen for the named trial, or the empty string -// if the trial does not exists. -// -// Note: To keep things tidy append all the trial names with WebRTC. -std::string FindFullName(const std::string& name); - -} // namespace field_trial -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_FIELD_TRIAL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/file_wrapper.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/file_wrapper.h deleted file mode 100755 index 68dc005..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/file_wrapper.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_FILE_WRAPPER_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_FILE_WRAPPER_H_ - -#include -#include - -#include "webrtc/common_types.h" -#include "webrtc/typedefs.h" - -// Implementation of an InStream and OutStream that can read (exclusive) or -// write from/to a file. - -namespace webrtc { - -class FileWrapper : public InStream, public OutStream { - public: - static const size_t kMaxFileNameSize = 1024; - - // Factory method. Constructor disabled. - static FileWrapper* Create(); - - // Returns true if a file has been opened. - virtual bool Open() const = 0; - - // Opens a file in read or write mode, decided by the read_only parameter. - virtual int OpenFile(const char* file_name_utf8, - bool read_only, - bool loop = false, - bool text = false) = 0; - - // Initializes the wrapper from an existing handle. |read_only| must match in - // the mode the file was opened in. If |manage_file| is true, the wrapper - // takes ownership of |handle| and closes it in CloseFile(). - virtual int OpenFromFileHandle(FILE* handle, - bool manage_file, - bool read_only, - bool loop = false) = 0; - - virtual int CloseFile() = 0; - - // Limits the file size to |bytes|. Writing will fail after the cap - // is hit. Pass zero to use an unlimited size. - virtual int SetMaxFileSize(size_t bytes) = 0; - - // Flush any pending writes. - virtual int Flush() = 0; - - // Returns the opened file's name in |file_name_utf8|. Provide the size of - // the buffer in bytes in |size|. The name will be truncated if |size| is - // too small. - virtual int FileName(char* file_name_utf8, - size_t size) const = 0; - - // Write |format| to the opened file. Arguments are taken in the same manner - // as printf. That is, supply a format string containing text and - // specifiers. Returns the number of characters written or -1 on error. - virtual int WriteText(const char* format, ...) = 0; - - // Inherited from Instream. - // Reads |length| bytes from file to |buf|. Returns the number of bytes read - // or -1 on error. - virtual int Read(void* buf, int length) = 0; - - // Inherited from OutStream. - // Writes |length| bytes from |buf| to file. The actual writing may happen - // some time later. Call Flush() to force a write. - virtual bool Write(const void* buf, int length) = 0; - - // Inherited from both Instream and OutStream. - // Rewinds the file to the start. Only available when OpenFile() has been - // called with |loop| == true or |readOnly| == true. - virtual int Rewind() = 0; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_FILE_WRAPPER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/fix_interlocked_exchange_pointer_win.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/fix_interlocked_exchange_pointer_win.h deleted file mode 100755 index 8fb32ef..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/fix_interlocked_exchange_pointer_win.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Various inline functions and macros to fix compilation of 32 bit target -// on MSVC with /Wp64 flag enabled. - -// The original code can be found here: -// http://src.chromium.org/svn/trunk/src/base/fix_wp64.h - -#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_FIX_INTERLOCKED_EXCHANGE_POINTER_WINDOWS_H_ -#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_FIX_INTERLOCKED_EXCHANGE_POINTER_WINDOWS_H_ - -#include - -// Platform SDK fixes when building with /Wp64 for a 32 bits target. -#if !defined(_WIN64) && defined(_Wp64) - -#ifdef InterlockedExchangePointer -#undef InterlockedExchangePointer -// The problem is that the macro provided for InterlockedExchangePointer() is -// doing a (LONG) C-style cast that triggers invariably the warning C4312 when -// building on 32 bits. -inline void* InterlockedExchangePointer(void* volatile* target, void* value) { - return reinterpret_cast(static_cast(InterlockedExchange( - reinterpret_cast(target), - static_cast(reinterpret_cast(value))))); -} -#endif // #ifdef InterlockedExchangePointer - -#endif // #if !defined(_WIN64) && defined(_Wp64) - -#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_FIX_INTERLOCKED_EXCHANGE_POINTER_WINDOWS_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/logcat_trace_context.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/logcat_trace_context.h deleted file mode 100755 index d23e451..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/logcat_trace_context.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_LOGCAT_TRACE_CONTEXT_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_LOGCAT_TRACE_CONTEXT_H_ - -#include "webrtc/system_wrappers/interface/trace.h" - -#ifndef ANDROID -#error This file only makes sense to include on Android! -#endif - -namespace webrtc { - -// Scoped helper class for directing Traces to Android's logcat facility. While -// this object lives, Trace output will be sent to logcat. -class LogcatTraceContext : public webrtc::TraceCallback { - public: - LogcatTraceContext(); - virtual ~LogcatTraceContext(); - - // TraceCallback impl. - virtual void Print(TraceLevel level, const char* message, int length); -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_LOGCAT_TRACE_CONTEXT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/logging.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/logging.h deleted file mode 100755 index 41c436b..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/logging.h +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// This is a highly stripped-down version of libjingle's talk/base/logging.h. -// It is a thin wrapper around WEBRTC_TRACE, maintaining the libjingle log -// semantics to ease a transition to that format. - -// NOTE: LS_INFO maps to a new trace level which should be reserved for -// infrequent, non-verbose logs. The other levels below kTraceWarning have been -// rendered essentially useless due to their verbosity. Carefully consider the -// impact of adding a new LS_INFO log. If it will be logged at anything -// approaching a frame or packet frequency, use LS_VERBOSE if necessary, or -// preferably, do not log at all. - -// LOG(...) an ostream target that can be used to send formatted -// output to a variety of logging targets, such as debugger console, stderr, -// file, or any StreamInterface. -// The severity level passed as the first argument to the LOGging -// functions is used as a filter, to limit the verbosity of the logging. -// Static members of LogMessage documented below are used to control the -// verbosity and target of the output. -// There are several variations on the LOG macro which facilitate logging -// of common error conditions, detailed below. - -// LOG(sev) logs the given stream at severity "sev", which must be a -// compile-time constant of the LoggingSeverity type, without the namespace -// prefix. -// LOG_V(sev) Like LOG(), but sev is a run-time variable of the LoggingSeverity -// type (basically, it just doesn't prepend the namespace). -// LOG_F(sev) Like LOG(), but includes the name of the current function. - -// Additional helper macros added by WebRTC: -// LOG_API is a shortcut for API call logging. Pass in the input parameters of -// the method. For example: -// Foo(int bar, int baz) { -// LOG_API2(bar, baz); -// } -// -// LOG_FERR is a shortcut for logging a failed function call. For example: -// if (!Foo(bar)) { -// LOG_FERR1(LS_WARNING, Foo, bar); -// } - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_LOGGING_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_LOGGING_H_ - -#include - -namespace webrtc { - -////////////////////////////////////////////////////////////////////// - -// Note that the non-standard LoggingSeverity aliases exist because they are -// still in broad use. The meanings of the levels are: -// LS_SENSITIVE: Information which should only be logged with the consent -// of the user, due to privacy concerns. -// LS_VERBOSE: This level is for data which we do not want to appear in the -// normal debug log, but should appear in diagnostic logs. -// LS_INFO: Chatty level used in debugging for all sorts of things, the default -// in debug builds. -// LS_WARNING: Something that may warrant investigation. -// LS_ERROR: Something that should not have occurred. -enum LoggingSeverity { - LS_SENSITIVE, LS_VERBOSE, LS_INFO, LS_WARNING, LS_ERROR -}; - -class LogMessage { - public: - LogMessage(const char* file, int line, LoggingSeverity sev); - ~LogMessage(); - - static bool Loggable(LoggingSeverity sev); - std::ostream& stream() { return print_stream_; } - - private: - // The ostream that buffers the formatted message before output - std::ostringstream print_stream_; - - // The severity level of this message - LoggingSeverity severity_; -}; - -////////////////////////////////////////////////////////////////////// -// Macros which automatically disable logging when WEBRTC_LOGGING == 0 -////////////////////////////////////////////////////////////////////// - -#ifndef LOG -// The following non-obvious technique for implementation of a -// conditional log stream was stolen from google3/base/logging.h. - -// This class is used to explicitly ignore values in the conditional -// logging macros. This avoids compiler warnings like "value computed -// is not used" and "statement has no effect". - -class LogMessageVoidify { - public: - LogMessageVoidify() { } - // This has to be an operator with a precedence lower than << but - // higher than ?: - void operator&(std::ostream&) { } -}; - -#if defined(WEBRTC_RESTRICT_LOGGING) -// This should compile away logs matching the following condition. -#define RESTRICT_LOGGING_PRECONDITION(sev) \ - sev < webrtc::LS_INFO ? (void) 0 : -#else -#define RESTRICT_LOGGING_PRECONDITION(sev) -#endif - -#define LOG_SEVERITY_PRECONDITION(sev) \ - RESTRICT_LOGGING_PRECONDITION(sev) !(webrtc::LogMessage::Loggable(sev)) \ - ? (void) 0 \ - : webrtc::LogMessageVoidify() & - -#define LOG(sev) \ - LOG_SEVERITY_PRECONDITION(webrtc::sev) \ - webrtc::LogMessage(__FILE__, __LINE__, webrtc::sev).stream() - -// The _V version is for when a variable is passed in. It doesn't do the -// namespace concatination. -#define LOG_V(sev) \ - LOG_SEVERITY_PRECONDITION(sev) \ - webrtc::LogMessage(__FILE__, __LINE__, sev).stream() - -// The _F version prefixes the message with the current function name. -#if (defined(__GNUC__) && defined(_DEBUG)) || defined(WANT_PRETTY_LOG_F) -#define LOG_F(sev) LOG(sev) << __PRETTY_FUNCTION__ << ": " -#else -#define LOG_F(sev) LOG(sev) << __FUNCTION__ << ": " -#endif - -#define LOG_API0() LOG_F(LS_VERBOSE) -#define LOG_API1(v1) LOG_API0() << #v1 << "=" << v1 -#define LOG_API2(v1, v2) LOG_API1(v1) \ - << ", " << #v2 << "=" << v2 -#define LOG_API3(v1, v2, v3) LOG_API2(v1, v2) \ - << ", " << #v3 << "=" << v3 - -#define LOG_FERR0(sev, func) LOG(sev) << #func << " failed" -#define LOG_FERR1(sev, func, v1) LOG_FERR0(sev, func) \ - << ": " << #v1 << "=" << v1 -#define LOG_FERR2(sev, func, v1, v2) LOG_FERR1(sev, func, v1) \ - << ", " << #v2 << "=" << v2 -#define LOG_FERR3(sev, func, v1, v2, v3) LOG_FERR2(sev, func, v1, v2) \ - << ", " << #v3 << "=" << v3 -#define LOG_FERR4(sev, func, v1, v2, v3, v4) LOG_FERR3(sev, func, v1, v2, v3) \ - << ", " << #v4 << "=" << v4 - -#endif // LOG - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_LOGGING_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/ref_count.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/ref_count.h deleted file mode 100755 index 6861666..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/ref_count.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef SYSTEM_WRAPPERS_INTERFACE_REF_COUNT_H_ -#define SYSTEM_WRAPPERS_INTERFACE_REF_COUNT_H_ - -#include "webrtc/system_wrappers/interface/atomic32.h" - -namespace webrtc { - -// This class can be used for instantiating -// reference counted objects. -// int32_t AddRef() and int32_t Release(). -// Usage: -// RefCountImpl* implementation = new RefCountImpl(p); -// -// Example: -// class MyInterface { -// public: -// virtual void DoSomething() = 0; -// virtual int32_t AddRef() = 0; -// virtual int32_t Release() = 0: -// private: -// virtual ~MyInterface(){}; -// } -// class MyImplementation : public MyInterface { -// public: -// virtual DoSomething() { printf("hello"); }; -// }; -// MyImplementation* CreateMyImplementation() { -// RefCountImpl* implementation = -// new RefCountImpl(); -// return implementation; -// } - -template -class RefCountImpl : public T { - public: - RefCountImpl() : ref_count_(0) {} - - template - explicit RefCountImpl(P p) : T(p), ref_count_(0) {} - - template - RefCountImpl(P1 p1, P2 p2) : T(p1, p2), ref_count_(0) {} - - template - RefCountImpl(P1 p1, P2 p2, P3 p3) : T(p1, p2, p3), ref_count_(0) {} - - template - RefCountImpl(P1 p1, P2 p2, P3 p3, P4 p4) : T(p1, p2, p3, p4), ref_count_(0) {} - - template - RefCountImpl(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) - : T(p1, p2, p3, p4, p5), ref_count_(0) {} - - virtual int32_t AddRef() { - return ++ref_count_; - } - - virtual int32_t Release() { - int32_t ref_count; - ref_count = --ref_count_; - if (ref_count == 0) - delete this; - return ref_count; - } - - protected: - Atomic32 ref_count_; -}; - -} // namespace webrtc - -#endif // SYSTEM_WRAPPERS_INTERFACE_REF_COUNT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/rtp_to_ntp.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/rtp_to_ntp.h deleted file mode 100755 index dfc25cd..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/rtp_to_ntp.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef SYSTEM_WRAPPERS_INTERFACE_RTP_TO_NTP_H_ -#define SYSTEM_WRAPPERS_INTERFACE_RTP_TO_NTP_H_ - -#include - -#include "webrtc/typedefs.h" - -namespace webrtc { - -struct RtcpMeasurement { - RtcpMeasurement(); - RtcpMeasurement(uint32_t ntp_secs, uint32_t ntp_frac, uint32_t timestamp); - uint32_t ntp_secs; - uint32_t ntp_frac; - uint32_t rtp_timestamp; -}; - -typedef std::list RtcpList; - -// Updates |rtcp_list| with timestamps from the latest RTCP SR. -// |new_rtcp_sr| will be set to true if these are the timestamps which have -// never be added to |rtcp_list|. -bool UpdateRtcpList(uint32_t ntp_secs, - uint32_t ntp_frac, - uint32_t rtp_timestamp, - RtcpList* rtcp_list, - bool* new_rtcp_sr); - -// Converts an RTP timestamp to the NTP domain in milliseconds using two -// (RTP timestamp, NTP timestamp) pairs. -bool RtpToNtpMs(int64_t rtp_timestamp, const RtcpList& rtcp, - int64_t* timestamp_in_ms); - -// Returns 1 there has been a forward wrap around, 0 if there has been no wrap -// around and -1 if there has been a backwards wrap around (i.e. reordering). -int CheckForWrapArounds(uint32_t rtp_timestamp, uint32_t rtcp_rtp_timestamp); - -} // namespace webrtc - -#endif // SYSTEM_WRAPPERS_INTERFACE_RTP_TO_NTP_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/rw_lock_wrapper.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/rw_lock_wrapper.h deleted file mode 100755 index 91126e5..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/rw_lock_wrapper.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_RW_LOCK_WRAPPER_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_RW_LOCK_WRAPPER_H_ - -#include "webrtc/system_wrappers/interface/thread_annotations.h" - -// Note, Windows pre-Vista version of RW locks are not supported natively. For -// these OSs regular critical sections have been used to approximate RW lock -// functionality and will therefore have worse performance. - -namespace webrtc { - -class LOCKABLE RWLockWrapper { - public: - static RWLockWrapper* CreateRWLock(); - virtual ~RWLockWrapper() {} - - virtual void AcquireLockExclusive() EXCLUSIVE_LOCK_FUNCTION() = 0; - virtual void ReleaseLockExclusive() UNLOCK_FUNCTION() = 0; - - virtual void AcquireLockShared() SHARED_LOCK_FUNCTION() = 0; - virtual void ReleaseLockShared() UNLOCK_FUNCTION() = 0; -}; - -// RAII extensions of the RW lock. Prevents Acquire/Release missmatches and -// provides more compact locking syntax. -class SCOPED_LOCKABLE ReadLockScoped { - public: - ReadLockScoped(RWLockWrapper& rw_lock) SHARED_LOCK_FUNCTION(rw_lock) - : rw_lock_(rw_lock) { - rw_lock_.AcquireLockShared(); - } - - ~ReadLockScoped() UNLOCK_FUNCTION() { - rw_lock_.ReleaseLockShared(); - } - - private: - RWLockWrapper& rw_lock_; -}; - -class SCOPED_LOCKABLE WriteLockScoped { - public: - WriteLockScoped(RWLockWrapper& rw_lock) EXCLUSIVE_LOCK_FUNCTION(rw_lock) - : rw_lock_(rw_lock) { - rw_lock_.AcquireLockExclusive(); - } - - ~WriteLockScoped() UNLOCK_FUNCTION() { - rw_lock_.ReleaseLockExclusive(); - } - - private: - RWLockWrapper& rw_lock_; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_RW_LOCK_WRAPPER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/scoped_ptr.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/scoped_ptr.h deleted file mode 100755 index 42bb8a6..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/scoped_ptr.h +++ /dev/null @@ -1,566 +0,0 @@ -/* - * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Borrowed from Chromium's src/base/memory/scoped_ptr.h. - -// Scopers help you manage ownership of a pointer, helping you easily manage the -// a pointer within a scope, and automatically destroying the pointer at the -// end of a scope. There are two main classes you will use, which correspond -// to the operators new/delete and new[]/delete[]. -// -// Example usage (scoped_ptr): -// { -// scoped_ptr foo(new Foo("wee")); -// } // foo goes out of scope, releasing the pointer with it. -// -// { -// scoped_ptr foo; // No pointer managed. -// foo.reset(new Foo("wee")); // Now a pointer is managed. -// foo.reset(new Foo("wee2")); // Foo("wee") was destroyed. -// foo.reset(new Foo("wee3")); // Foo("wee2") was destroyed. -// foo->Method(); // Foo::Method() called. -// foo.get()->Method(); // Foo::Method() called. -// SomeFunc(foo.release()); // SomeFunc takes ownership, foo no longer -// // manages a pointer. -// foo.reset(new Foo("wee4")); // foo manages a pointer again. -// foo.reset(); // Foo("wee4") destroyed, foo no longer -// // manages a pointer. -// } // foo wasn't managing a pointer, so nothing was destroyed. -// -// Example usage (scoped_ptr): -// { -// scoped_ptr foo(new Foo[100]); -// foo.get()->Method(); // Foo::Method on the 0th element. -// foo[10].Method(); // Foo::Method on the 10th element. -// } -// -// These scopers also implement part of the functionality of C++11 unique_ptr -// in that they are "movable but not copyable." You can use the scopers in -// the parameter and return types of functions to signify ownership transfer -// in to and out of a function. When calling a function that has a scoper -// as the argument type, it must be called with the result of an analogous -// scoper's Pass() function or another function that generates a temporary; -// passing by copy will NOT work. Here is an example using scoped_ptr: -// -// void TakesOwnership(scoped_ptr arg) { -// // Do something with arg -// } -// scoped_ptr CreateFoo() { -// // No need for calling Pass() because we are constructing a temporary -// // for the return value. -// return scoped_ptr(new Foo("new")); -// } -// scoped_ptr PassThru(scoped_ptr arg) { -// return arg.Pass(); -// } -// -// { -// scoped_ptr ptr(new Foo("yay")); // ptr manages Foo("yay"). -// TakesOwnership(ptr.Pass()); // ptr no longer owns Foo("yay"). -// scoped_ptr ptr2 = CreateFoo(); // ptr2 owns the return Foo. -// scoped_ptr ptr3 = // ptr3 now owns what was in ptr2. -// PassThru(ptr2.Pass()); // ptr2 is correspondingly NULL. -// } -// -// Notice that if you do not call Pass() when returning from PassThru(), or -// when invoking TakesOwnership(), the code will not compile because scopers -// are not copyable; they only implement move semantics which require calling -// the Pass() function to signify a destructive transfer of state. CreateFoo() -// is different though because we are constructing a temporary on the return -// line and thus can avoid needing to call Pass(). -// -// Pass() properly handles upcast in initialization, i.e. you can use a -// scoped_ptr to initialize a scoped_ptr: -// -// scoped_ptr foo(new Foo()); -// scoped_ptr parent(foo.Pass()); -// -// PassAs<>() should be used to upcast return value in return statement: -// -// scoped_ptr CreateFoo() { -// scoped_ptr result(new FooChild()); -// return result.PassAs(); -// } -// -// Note that PassAs<>() is implemented only for scoped_ptr, but not for -// scoped_ptr. This is because casting array pointers may not be safe. - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_SCOPED_PTR_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_SCOPED_PTR_H_ - -// This is an implementation designed to match the anticipated future TR2 -// implementation of the scoped_ptr class. - -#include -#include -#include - -#include // For std::swap(). - -#include "webrtc/base/constructormagic.h" -#include "webrtc/system_wrappers/interface/compile_assert.h" -#include "webrtc/system_wrappers/interface/template_util.h" -#include "webrtc/system_wrappers/source/move.h" -#include "webrtc/typedefs.h" - -namespace webrtc { - -// Function object which deletes its parameter, which must be a pointer. -// If C is an array type, invokes 'delete[]' on the parameter; otherwise, -// invokes 'delete'. The default deleter for scoped_ptr. -template -struct DefaultDeleter { - DefaultDeleter() {} - template DefaultDeleter(const DefaultDeleter& other) { - // IMPLEMENTATION NOTE: C++11 20.7.1.1.2p2 only provides this constructor - // if U* is implicitly convertible to T* and U is not an array type. - // - // Correct implementation should use SFINAE to disable this - // constructor. However, since there are no other 1-argument constructors, - // using a COMPILE_ASSERT() based on is_convertible<> and requiring - // complete types is simpler and will cause compile failures for equivalent - // misuses. - // - // Note, the is_convertible check also ensures that U is not an - // array. T is guaranteed to be a non-array, so any U* where U is an array - // cannot convert to T*. - enum { T_must_be_complete = sizeof(T) }; - enum { U_must_be_complete = sizeof(U) }; - COMPILE_ASSERT((webrtc::is_convertible::value), - U_ptr_must_implicitly_convert_to_T_ptr); - } - inline void operator()(T* ptr) const { - enum { type_must_be_complete = sizeof(T) }; - delete ptr; - } -}; - -// Specialization of DefaultDeleter for array types. -template -struct DefaultDeleter { - inline void operator()(T* ptr) const { - enum { type_must_be_complete = sizeof(T) }; - delete[] ptr; - } - - private: - // Disable this operator for any U != T because it is undefined to execute - // an array delete when the static type of the array mismatches the dynamic - // type. - // - // References: - // C++98 [expr.delete]p3 - // http://cplusplus.github.com/LWG/lwg-defects.html#938 - template void operator()(U* array) const; -}; - -template -struct DefaultDeleter { - // Never allow someone to declare something like scoped_ptr. - COMPILE_ASSERT(sizeof(T) == -1, do_not_use_array_with_size_as_type); -}; - -// Function object which invokes 'free' on its parameter, which must be -// a pointer. Can be used to store malloc-allocated pointers in scoped_ptr: -// -// scoped_ptr foo_ptr( -// static_cast(malloc(sizeof(int)))); -struct FreeDeleter { - inline void operator()(void* ptr) const { - free(ptr); - } -}; - -namespace internal { - -// Minimal implementation of the core logic of scoped_ptr, suitable for -// reuse in both scoped_ptr and its specializations. -template -class scoped_ptr_impl { - public: - explicit scoped_ptr_impl(T* p) : data_(p) { } - - // Initializer for deleters that have data parameters. - scoped_ptr_impl(T* p, const D& d) : data_(p, d) {} - - // Templated constructor that destructively takes the value from another - // scoped_ptr_impl. - template - scoped_ptr_impl(scoped_ptr_impl* other) - : data_(other->release(), other->get_deleter()) { - // We do not support move-only deleters. We could modify our move - // emulation to have webrtc::subtle::move() and webrtc::subtle::forward() - // functions that are imperfect emulations of their C++11 equivalents, - // but until there's a requirement, just assume deleters are copyable. - } - - template - void TakeState(scoped_ptr_impl* other) { - // See comment in templated constructor above regarding lack of support - // for move-only deleters. - reset(other->release()); - get_deleter() = other->get_deleter(); - } - - ~scoped_ptr_impl() { - if (data_.ptr != NULL) { - // Not using get_deleter() saves one function call in non-optimized - // builds. - static_cast(data_)(data_.ptr); - } - } - - void reset(T* p) { - // This is a self-reset, which is no longer allowed: http://crbug.com/162971 - if (p != NULL && p == data_.ptr) - abort(); - - // Note that running data_.ptr = p can lead to undefined behavior if - // get_deleter()(get()) deletes this. In order to pevent this, reset() - // should update the stored pointer before deleting its old value. - // - // However, changing reset() to use that behavior may cause current code to - // break in unexpected ways. If the destruction of the owned object - // dereferences the scoped_ptr when it is destroyed by a call to reset(), - // then it will incorrectly dispatch calls to |p| rather than the original - // value of |data_.ptr|. - // - // During the transition period, set the stored pointer to NULL while - // deleting the object. Eventually, this safety check will be removed to - // prevent the scenario initially described from occuring and - // http://crbug.com/176091 can be closed. - T* old = data_.ptr; - data_.ptr = NULL; - if (old != NULL) - static_cast(data_)(old); - data_.ptr = p; - } - - T* get() const { return data_.ptr; } - - D& get_deleter() { return data_; } - const D& get_deleter() const { return data_; } - - void swap(scoped_ptr_impl& p2) { - // Standard swap idiom: 'using std::swap' ensures that std::swap is - // present in the overload set, but we call swap unqualified so that - // any more-specific overloads can be used, if available. - using std::swap; - swap(static_cast(data_), static_cast(p2.data_)); - swap(data_.ptr, p2.data_.ptr); - } - - T* release() { - T* old_ptr = data_.ptr; - data_.ptr = NULL; - return old_ptr; - } - - private: - // Needed to allow type-converting constructor. - template friend class scoped_ptr_impl; - - // Use the empty base class optimization to allow us to have a D - // member, while avoiding any space overhead for it when D is an - // empty class. See e.g. http://www.cantrip.org/emptyopt.html for a good - // discussion of this technique. - struct Data : public D { - explicit Data(T* ptr_in) : ptr(ptr_in) {} - Data(T* ptr_in, const D& other) : D(other), ptr(ptr_in) {} - T* ptr; - }; - - Data data_; - - DISALLOW_COPY_AND_ASSIGN(scoped_ptr_impl); -}; - -} // namespace internal - -// A scoped_ptr is like a T*, except that the destructor of scoped_ptr -// automatically deletes the pointer it holds (if any). -// That is, scoped_ptr owns the T object that it points to. -// Like a T*, a scoped_ptr may hold either NULL or a pointer to a T object. -// Also like T*, scoped_ptr is thread-compatible, and once you -// dereference it, you get the thread safety guarantees of T. -// -// The size of scoped_ptr is small. On most compilers, when using the -// DefaultDeleter, sizeof(scoped_ptr) == sizeof(T*). Custom deleters will -// increase the size proportional to whatever state they need to have. See -// comments inside scoped_ptr_impl<> for details. -// -// Current implementation targets having a strict subset of C++11's -// unique_ptr<> features. Known deficiencies include not supporting move-only -// deleteres, function pointers as deleters, and deleters with reference -// types. -template > -class scoped_ptr { - WEBRTC_MOVE_ONLY_TYPE_FOR_CPP_03(scoped_ptr, RValue) - - public: - // The element and deleter types. - typedef T element_type; - typedef D deleter_type; - - // Constructor. Defaults to initializing with NULL. - scoped_ptr() : impl_(NULL) { } - - // Constructor. Takes ownership of p. - explicit scoped_ptr(element_type* p) : impl_(p) { } - - // Constructor. Allows initialization of a stateful deleter. - scoped_ptr(element_type* p, const D& d) : impl_(p, d) { } - - // Constructor. Allows construction from a scoped_ptr rvalue for a - // convertible type and deleter. - // - // IMPLEMENTATION NOTE: C++11 unique_ptr<> keeps this constructor distinct - // from the normal move constructor. By C++11 20.7.1.2.1.21, this constructor - // has different post-conditions if D is a reference type. Since this - // implementation does not support deleters with reference type, - // we do not need a separate move constructor allowing us to avoid one - // use of SFINAE. You only need to care about this if you modify the - // implementation of scoped_ptr. - template - scoped_ptr(scoped_ptr other) : impl_(&other.impl_) { - COMPILE_ASSERT(!webrtc::is_array::value, U_cannot_be_an_array); - } - - // Constructor. Move constructor for C++03 move emulation of this type. - scoped_ptr(RValue rvalue) : impl_(&rvalue.object->impl_) { } - - // operator=. Allows assignment from a scoped_ptr rvalue for a convertible - // type and deleter. - // - // IMPLEMENTATION NOTE: C++11 unique_ptr<> keeps this operator= distinct from - // the normal move assignment operator. By C++11 20.7.1.2.3.4, this templated - // form has different requirements on for move-only Deleters. Since this - // implementation does not support move-only Deleters, we do not need a - // separate move assignment operator allowing us to avoid one use of SFINAE. - // You only need to care about this if you modify the implementation of - // scoped_ptr. - template - scoped_ptr& operator=(scoped_ptr rhs) { - COMPILE_ASSERT(!webrtc::is_array::value, U_cannot_be_an_array); - impl_.TakeState(&rhs.impl_); - return *this; - } - - // Reset. Deletes the currently owned object, if any. - // Then takes ownership of a new object, if given. - void reset(element_type* p = NULL) { impl_.reset(p); } - - // Accessors to get the owned object. - // operator* and operator-> will assert() if there is no current object. - element_type& operator*() const { - assert(impl_.get() != NULL); - return *impl_.get(); - } - element_type* operator->() const { - assert(impl_.get() != NULL); - return impl_.get(); - } - element_type* get() const { return impl_.get(); } - - // Access to the deleter. - deleter_type& get_deleter() { return impl_.get_deleter(); } - const deleter_type& get_deleter() const { return impl_.get_deleter(); } - - // Allow scoped_ptr to be used in boolean expressions, but not - // implicitly convertible to a real bool (which is dangerous). - // - // Note that this trick is only safe when the == and != operators - // are declared explicitly, as otherwise "scoped_ptr1 == - // scoped_ptr2" will compile but do the wrong thing (i.e., convert - // to Testable and then do the comparison). - private: - typedef webrtc::internal::scoped_ptr_impl - scoped_ptr::*Testable; - - public: - operator Testable() const { return impl_.get() ? &scoped_ptr::impl_ : NULL; } - - // Comparison operators. - // These return whether two scoped_ptr refer to the same object, not just to - // two different but equal objects. - bool operator==(const element_type* p) const { return impl_.get() == p; } - bool operator!=(const element_type* p) const { return impl_.get() != p; } - - // Swap two scoped pointers. - void swap(scoped_ptr& p2) { - impl_.swap(p2.impl_); - } - - // Release a pointer. - // The return value is the current pointer held by this object. - // If this object holds a NULL pointer, the return value is NULL. - // After this operation, this object will hold a NULL pointer, - // and will not own the object any more. - element_type* release() WARN_UNUSED_RESULT { - return impl_.release(); - } - - // C++98 doesn't support functions templates with default parameters which - // makes it hard to write a PassAs() that understands converting the deleter - // while preserving simple calling semantics. - // - // Until there is a use case for PassAs() with custom deleters, just ignore - // the custom deleter. - template - scoped_ptr PassAs() { - return scoped_ptr(Pass()); - } - - private: - // Needed to reach into |impl_| in the constructor. - template friend class scoped_ptr; - webrtc::internal::scoped_ptr_impl impl_; - - // Forbidden for API compatibility with std::unique_ptr. - explicit scoped_ptr(int disallow_construction_from_null); - - // Forbid comparison of scoped_ptr types. If U != T, it totally - // doesn't make sense, and if U == T, it still doesn't make sense - // because you should never have the same object owned by two different - // scoped_ptrs. - template bool operator==(scoped_ptr const& p2) const; - template bool operator!=(scoped_ptr const& p2) const; -}; - -template -class scoped_ptr { - WEBRTC_MOVE_ONLY_TYPE_FOR_CPP_03(scoped_ptr, RValue) - - public: - // The element and deleter types. - typedef T element_type; - typedef D deleter_type; - - // Constructor. Defaults to initializing with NULL. - scoped_ptr() : impl_(NULL) { } - - // Constructor. Stores the given array. Note that the argument's type - // must exactly match T*. In particular: - // - it cannot be a pointer to a type derived from T, because it is - // inherently unsafe in the general case to access an array through a - // pointer whose dynamic type does not match its static type (eg., if - // T and the derived types had different sizes access would be - // incorrectly calculated). Deletion is also always undefined - // (C++98 [expr.delete]p3). If you're doing this, fix your code. - // - it cannot be NULL, because NULL is an integral expression, not a - // pointer to T. Use the no-argument version instead of explicitly - // passing NULL. - // - it cannot be const-qualified differently from T per unique_ptr spec - // (http://cplusplus.github.com/LWG/lwg-active.html#2118). Users wanting - // to work around this may use implicit_cast(). - // However, because of the first bullet in this comment, users MUST - // NOT use implicit_cast() to upcast the static type of the array. - explicit scoped_ptr(element_type* array) : impl_(array) { } - - // Constructor. Move constructor for C++03 move emulation of this type. - scoped_ptr(RValue rvalue) : impl_(&rvalue.object->impl_) { } - - // operator=. Move operator= for C++03 move emulation of this type. - scoped_ptr& operator=(RValue rhs) { - impl_.TakeState(&rhs.object->impl_); - return *this; - } - - // Reset. Deletes the currently owned array, if any. - // Then takes ownership of a new object, if given. - void reset(element_type* array = NULL) { impl_.reset(array); } - - // Accessors to get the owned array. - element_type& operator[](size_t i) const { - assert(impl_.get() != NULL); - return impl_.get()[i]; - } - element_type* get() const { return impl_.get(); } - - // Access to the deleter. - deleter_type& get_deleter() { return impl_.get_deleter(); } - const deleter_type& get_deleter() const { return impl_.get_deleter(); } - - // Allow scoped_ptr to be used in boolean expressions, but not - // implicitly convertible to a real bool (which is dangerous). - private: - typedef webrtc::internal::scoped_ptr_impl - scoped_ptr::*Testable; - - public: - operator Testable() const { return impl_.get() ? &scoped_ptr::impl_ : NULL; } - - // Comparison operators. - // These return whether two scoped_ptr refer to the same object, not just to - // two different but equal objects. - bool operator==(element_type* array) const { return impl_.get() == array; } - bool operator!=(element_type* array) const { return impl_.get() != array; } - - // Swap two scoped pointers. - void swap(scoped_ptr& p2) { - impl_.swap(p2.impl_); - } - - // Release a pointer. - // The return value is the current pointer held by this object. - // If this object holds a NULL pointer, the return value is NULL. - // After this operation, this object will hold a NULL pointer, - // and will not own the object any more. - element_type* release() WARN_UNUSED_RESULT { - return impl_.release(); - } - - private: - // Force element_type to be a complete type. - enum { type_must_be_complete = sizeof(element_type) }; - - // Actually hold the data. - webrtc::internal::scoped_ptr_impl impl_; - - // Disable initialization from any type other than element_type*, by - // providing a constructor that matches such an initialization, but is - // private and has no definition. This is disabled because it is not safe to - // call delete[] on an array whose static type does not match its dynamic - // type. - template explicit scoped_ptr(U* array); - explicit scoped_ptr(int disallow_construction_from_null); - - // Disable reset() from any type other than element_type*, for the same - // reasons as the constructor above. - template void reset(U* array); - void reset(int disallow_reset_from_null); - - // Forbid comparison of scoped_ptr types. If U != T, it totally - // doesn't make sense, and if U == T, it still doesn't make sense - // because you should never have the same object owned by two different - // scoped_ptrs. - template bool operator==(scoped_ptr const& p2) const; - template bool operator!=(scoped_ptr const& p2) const; -}; - -} // namespace webrtc - -// Free functions -template -void swap(webrtc::scoped_ptr& p1, webrtc::scoped_ptr& p2) { - p1.swap(p2); -} - -template -bool operator==(T* p1, const webrtc::scoped_ptr& p2) { - return p1 == p2.get(); -} - -template -bool operator!=(T* p1, const webrtc::scoped_ptr& p2) { - return p1 != p2.get(); -} - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_SCOPED_PTR_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/scoped_refptr.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/scoped_refptr.h deleted file mode 100755 index b344d21..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/scoped_refptr.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef SYSTEM_WRAPPERS_INTERFACE_SCOPED_REFPTR_H_ -#define SYSTEM_WRAPPERS_INTERFACE_SCOPED_REFPTR_H_ - -#include - -namespace webrtc { - -// Extracted from Chromium's src/base/memory/ref_counted.h. - -// -// A smart pointer class for reference counted objects. Use this class instead -// of calling AddRef and Release manually on a reference counted object to -// avoid common memory leaks caused by forgetting to Release an object -// reference. Sample usage: -// -// class MyFoo : public RefCounted { -// ... -// }; -// -// void some_function() { -// scoped_refptr foo = new MyFoo(); -// foo->Method(param); -// // |foo| is released when this function returns -// } -// -// void some_other_function() { -// scoped_refptr foo = new MyFoo(); -// ... -// foo = NULL; // explicitly releases |foo| -// ... -// if (foo) -// foo->Method(param); -// } -// -// The above examples show how scoped_refptr acts like a pointer to T. -// Given two scoped_refptr classes, it is also possible to exchange -// references between the two objects, like so: -// -// { -// scoped_refptr a = new MyFoo(); -// scoped_refptr b; -// -// b.swap(a); -// // now, |b| references the MyFoo object, and |a| references NULL. -// } -// -// To make both |a| and |b| in the above example reference the same MyFoo -// object, simply use the assignment operator: -// -// { -// scoped_refptr a = new MyFoo(); -// scoped_refptr b; -// -// b = a; -// // now, |a| and |b| each own a reference to the same MyFoo object. -// } -// -template -class scoped_refptr { - public: - scoped_refptr() : ptr_(NULL) { - } - - scoped_refptr(T* p) : ptr_(p) { - if (ptr_) - ptr_->AddRef(); - } - - scoped_refptr(const scoped_refptr& r) : ptr_(r.ptr_) { - if (ptr_) - ptr_->AddRef(); - } - - template - scoped_refptr(const scoped_refptr& r) : ptr_(r.get()) { - if (ptr_) - ptr_->AddRef(); - } - - ~scoped_refptr() { - if (ptr_) - ptr_->Release(); - } - - T* get() const { return ptr_; } - operator T*() const { return ptr_; } - T* operator->() const { return ptr_; } - - // Release a pointer. - // The return value is the current pointer held by this object. - // If this object holds a NULL pointer, the return value is NULL. - // After this operation, this object will hold a NULL pointer, - // and will not own the object any more. - T* release() { - T* retVal = ptr_; - ptr_ = NULL; - return retVal; - } - - scoped_refptr& operator=(T* p) { - // AddRef first so that self assignment should work - if (p) - p->AddRef(); - if (ptr_ ) - ptr_->Release(); - ptr_ = p; - return *this; - } - - scoped_refptr& operator=(const scoped_refptr& r) { - return *this = r.ptr_; - } - - template - scoped_refptr& operator=(const scoped_refptr& r) { - return *this = r.get(); - } - - void swap(T** pp) { - T* p = ptr_; - ptr_ = *pp; - *pp = p; - } - - void swap(scoped_refptr& r) { - swap(&r.ptr_); - } - - protected: - T* ptr_; -}; -} // namespace webrtc - -#endif // SYSTEM_WRAPPERS_INTERFACE_SCOPED_REFPTR_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/scoped_vector.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/scoped_vector.h deleted file mode 100755 index 68db3a1..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/scoped_vector.h +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Borrowed from Chromium's src/base/memory/scoped_vector.h. - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_SCOPED_VECTOR_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_SCOPED_VECTOR_H_ - -#include -#include -#include - -#include "webrtc/system_wrappers/interface/stl_util.h" -#include "webrtc/system_wrappers/source/move.h" - -namespace webrtc { - -// ScopedVector wraps a vector deleting the elements from its -// destructor. -template -class ScopedVector { - WEBRTC_MOVE_ONLY_TYPE_FOR_CPP_03(ScopedVector, RValue) - - public: - typedef typename std::vector::allocator_type allocator_type; - typedef typename std::vector::size_type size_type; - typedef typename std::vector::difference_type difference_type; - typedef typename std::vector::pointer pointer; - typedef typename std::vector::const_pointer const_pointer; - typedef typename std::vector::reference reference; - typedef typename std::vector::const_reference const_reference; - typedef typename std::vector::value_type value_type; - typedef typename std::vector::iterator iterator; - typedef typename std::vector::const_iterator const_iterator; - typedef typename std::vector::reverse_iterator reverse_iterator; - typedef typename std::vector::const_reverse_iterator - const_reverse_iterator; - - ScopedVector() {} - ~ScopedVector() { clear(); } - ScopedVector(RValue other) { swap(*other.object); } - - ScopedVector& operator=(RValue rhs) { - swap(*rhs.object); - return *this; - } - - reference operator[](size_t index) { return v_[index]; } - const_reference operator[](size_t index) const { return v_[index]; } - - bool empty() const { return v_.empty(); } - size_t size() const { return v_.size(); } - - reverse_iterator rbegin() { return v_.rbegin(); } - const_reverse_iterator rbegin() const { return v_.rbegin(); } - reverse_iterator rend() { return v_.rend(); } - const_reverse_iterator rend() const { return v_.rend(); } - - iterator begin() { return v_.begin(); } - const_iterator begin() const { return v_.begin(); } - iterator end() { return v_.end(); } - const_iterator end() const { return v_.end(); } - - const_reference front() const { return v_.front(); } - reference front() { return v_.front(); } - const_reference back() const { return v_.back(); } - reference back() { return v_.back(); } - - void push_back(T* elem) { v_.push_back(elem); } - - void pop_back() { - assert(!empty()); - delete v_.back(); - v_.pop_back(); - } - - std::vector& get() { return v_; } - const std::vector& get() const { return v_; } - void swap(std::vector& other) { v_.swap(other); } - void swap(ScopedVector& other) { v_.swap(other.v_); } - void release(std::vector* out) { - out->swap(v_); - v_.clear(); - } - - void reserve(size_t capacity) { v_.reserve(capacity); } - - // Resize, deleting elements in the disappearing range if we are shrinking. - void resize(size_t new_size) { - if (v_.size() > new_size) - STLDeleteContainerPointers(v_.begin() + new_size, v_.end()); - v_.resize(new_size); - } - - template - void assign(InputIterator begin, InputIterator end) { - v_.assign(begin, end); - } - - void clear() { STLDeleteElements(&v_); } - - // Like |clear()|, but doesn't delete any elements. - void weak_clear() { v_.clear(); } - - // Lets the ScopedVector take ownership of |x|. - iterator insert(iterator position, T* x) { - return v_.insert(position, x); - } - - // Lets the ScopedVector take ownership of elements in [first,last). - template - void insert(iterator position, InputIterator first, InputIterator last) { - v_.insert(position, first, last); - } - - iterator erase(iterator position) { - delete *position; - return v_.erase(position); - } - - iterator erase(iterator first, iterator last) { - STLDeleteContainerPointers(first, last); - return v_.erase(first, last); - } - - // Like |erase()|, but doesn't delete the element at |position|. - iterator weak_erase(iterator position) { - return v_.erase(position); - } - - // Like |erase()|, but doesn't delete the elements in [first, last). - iterator weak_erase(iterator first, iterator last) { - return v_.erase(first, last); - } - - private: - std::vector v_; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_SCOPED_VECTOR_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/sleep.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/sleep.h deleted file mode 100755 index c0205bf..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/sleep.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -// An OS-independent sleep function. - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_SLEEP_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_SLEEP_H_ - -namespace webrtc { - -// This function sleeps for the specified number of milliseconds. -// It may return early if the thread is woken by some other event, -// such as the delivery of a signal on Unix. -void SleepMs(int msecs); - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_SLEEP_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/sort.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/sort.h deleted file mode 100755 index da6ff8d..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/sort.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Generic unstable sorting routines. - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_SORT_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_SORT_H_ - -#include "webrtc/common_types.h" -#include "webrtc/typedefs.h" - -namespace webrtc { - -enum Type { - TYPE_Word8, - TYPE_UWord8, - TYPE_Word16, - TYPE_UWord16, - TYPE_Word32, - TYPE_UWord32, - TYPE_Word64, - TYPE_UWord64, - TYPE_Float32, - TYPE_Float64 -}; - -// Sorts intrinsic data types. -// -// data [in/out] A pointer to an array of intrinsic type. -// Upon return it will be sorted in ascending order. -// num_of_elements The number of elements in the array. -// data_type Enum corresponding to the type of the array. -// -// returns 0 on success, -1 on failure. -int32_t Sort(void* data, uint32_t num_of_elements, Type data_type); - -// Sorts arbitrary data types. This requires an array of intrinsically typed -// key values which will be used to sort the data array. There must be a -// one-to-one correspondence between data elements and key elements, with -// corresponding elements sharing the same position in their respective -// arrays. -// -// data [in/out] A pointer to an array of arbitrary type. -// Upon return it will be sorted in ascending order. -// key [in] A pointer to an array of keys used to sort the -// data array. -// num_of_elements The number of elements in the arrays. -// size_of_element The size, in bytes, of the data array. -// key_type Enum corresponding to the type of the key array. -// -// returns 0 on success, -1 on failure. -// -int32_t KeySort(void* data, void* key, uint32_t num_of_elements, - uint32_t size_of_element, Type key_type); - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_SORT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/static_instance.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/static_instance.h deleted file mode 100755 index dad9c52..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/static_instance.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_STATIC_INSTANCE_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_STATIC_INSTANCE_H_ - -#include - -#include "webrtc/system_wrappers/interface/critical_section_wrapper.h" -#ifdef _WIN32 -#include "webrtc/system_wrappers/interface/fix_interlocked_exchange_pointer_win.h" -#endif - -namespace webrtc { - -enum CountOperation { - kRelease, - kAddRef, - kAddRefNoCreate -}; -enum CreateOperation { - kInstanceExists, - kCreate, - kDestroy -}; - -template -// Construct On First Use idiom. Avoids -// "static initialization order fiasco". -static T* GetStaticInstance(CountOperation count_operation) { - // TODO (hellner): use atomic wrapper instead. - static volatile long instance_count = 0; - static T* volatile instance = NULL; - CreateOperation state = kInstanceExists; -#ifndef _WIN32 - // This memory is staticly allocated once. The application does not try to - // free this memory. This approach is taken to avoid issues with - // destruction order for statically allocated memory. The memory will be - // reclaimed by the OS and memory leak tools will not recognize memory - // reachable from statics leaked so no noise is added by doing this. - static CriticalSectionWrapper* crit_sect( - CriticalSectionWrapper::CreateCriticalSection()); - CriticalSectionScoped lock(crit_sect); - - if (count_operation == - kAddRefNoCreate && instance_count == 0) { - return NULL; - } - if (count_operation == - kAddRef || - count_operation == kAddRefNoCreate) { - instance_count++; - if (instance_count == 1) { - state = kCreate; - } - } else { - instance_count--; - if (instance_count == 0) { - state = kDestroy; - } - } - if (state == kCreate) { - instance = T::CreateInstance(); - } else if (state == kDestroy) { - T* old_instance = instance; - instance = NULL; - // The state will not change past this point. Release the critical - // section while deleting the object in case it would be blocking on - // access back to this object. (This is the case for the tracing class - // since the thread owned by the tracing class also traces). - // TODO(hellner): this is a bit out of place but here goes, de-couple - // thread implementation with trace implementation. - crit_sect->Leave(); - if (old_instance) { - delete old_instance; - } - // Re-acquire the lock since the scoped critical section will release - // it. - crit_sect->Enter(); - return NULL; - } -#else // _WIN32 - if (count_operation == - kAddRefNoCreate && instance_count == 0) { - return NULL; - } - if (count_operation == kAddRefNoCreate) { - if (1 == InterlockedIncrement(&instance_count)) { - // The instance has been destroyed by some other thread. Rollback. - InterlockedDecrement(&instance_count); - assert(false); - return NULL; - } - // Sanity to catch corrupt state. - if (instance == NULL) { - assert(false); - InterlockedDecrement(&instance_count); - return NULL; - } - } else if (count_operation == kAddRef) { - if (instance_count == 0) { - state = kCreate; - } else { - if (1 == InterlockedIncrement(&instance_count)) { - // InterlockedDecrement because reference count should not be - // updated just yet (that's done when the instance is created). - InterlockedDecrement(&instance_count); - state = kCreate; - } - } - } else { - int new_value = InterlockedDecrement(&instance_count); - if (new_value == 0) { - state = kDestroy; - } - } - - if (state == kCreate) { - // Create instance and let whichever thread finishes first assign its - // local copy to the global instance. All other threads reclaim their - // local copy. - T* new_instance = T::CreateInstance(); - if (1 == InterlockedIncrement(&instance_count)) { - InterlockedExchangePointer(reinterpret_cast(&instance), - new_instance); - } else { - InterlockedDecrement(&instance_count); - if (new_instance) { - delete static_cast(new_instance); - } - } - } else if (state == kDestroy) { - T* old_value = static_cast(InterlockedExchangePointer( - reinterpret_cast(&instance), NULL)); - if (old_value) { - delete static_cast(old_value); - } - return NULL; - } -#endif // #ifndef _WIN32 - return instance; -} - -} // namspace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_STATIC_INSTANCE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/stl_util.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/stl_util.h deleted file mode 100755 index ebe855f..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/stl_util.h +++ /dev/null @@ -1,265 +0,0 @@ -/* - * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Borrowed from Chromium's src/base/stl_util.h. - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_STL_UTIL_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_STL_UTIL_H_ - -#include -#include -#include -#include -#include -#include - -namespace webrtc { - -// Clears internal memory of an STL object. -// STL clear()/reserve(0) does not always free internal memory allocated -// This function uses swap/destructor to ensure the internal memory is freed. -template -void STLClearObject(T* obj) { - T tmp; - tmp.swap(*obj); - // Sometimes "T tmp" allocates objects with memory (arena implementation?). - // Hence using additional reserve(0) even if it doesn't always work. - obj->reserve(0); -} - -// For a range within a container of pointers, calls delete (non-array version) -// on these pointers. -// NOTE: for these three functions, we could just implement a DeleteObject -// functor and then call for_each() on the range and functor, but this -// requires us to pull in all of algorithm.h, which seems expensive. -// For hash_[multi]set, it is important that this deletes behind the iterator -// because the hash_set may call the hash function on the iterator when it is -// advanced, which could result in the hash function trying to deference a -// stale pointer. -template -void STLDeleteContainerPointers(ForwardIterator begin, ForwardIterator end) { - while (begin != end) { - ForwardIterator temp = begin; - ++begin; - delete *temp; - } -} - -// For a range within a container of pairs, calls delete (non-array version) on -// BOTH items in the pairs. -// NOTE: Like STLDeleteContainerPointers, it is important that this deletes -// behind the iterator because if both the key and value are deleted, the -// container may call the hash function on the iterator when it is advanced, -// which could result in the hash function trying to dereference a stale -// pointer. -template -void STLDeleteContainerPairPointers(ForwardIterator begin, - ForwardIterator end) { - while (begin != end) { - ForwardIterator temp = begin; - ++begin; - delete temp->first; - delete temp->second; - } -} - -// For a range within a container of pairs, calls delete (non-array version) on -// the FIRST item in the pairs. -// NOTE: Like STLDeleteContainerPointers, deleting behind the iterator. -template -void STLDeleteContainerPairFirstPointers(ForwardIterator begin, - ForwardIterator end) { - while (begin != end) { - ForwardIterator temp = begin; - ++begin; - delete temp->first; - } -} - -// For a range within a container of pairs, calls delete. -// NOTE: Like STLDeleteContainerPointers, deleting behind the iterator. -// Deleting the value does not always invalidate the iterator, but it may -// do so if the key is a pointer into the value object. -template -void STLDeleteContainerPairSecondPointers(ForwardIterator begin, - ForwardIterator end) { - while (begin != end) { - ForwardIterator temp = begin; - ++begin; - delete temp->second; - } -} - -// To treat a possibly-empty vector as an array, use these functions. -// If you know the array will never be empty, you can use &*v.begin() -// directly, but that is undefined behaviour if |v| is empty. -template -inline T* vector_as_array(std::vector* v) { - return v->empty() ? NULL : &*v->begin(); -} - -template -inline const T* vector_as_array(const std::vector* v) { - return v->empty() ? NULL : &*v->begin(); -} - -// Return a mutable char* pointing to a string's internal buffer, -// which may not be null-terminated. Writing through this pointer will -// modify the string. -// -// string_as_array(&str)[i] is valid for 0 <= i < str.size() until the -// next call to a string method that invalidates iterators. -// -// As of 2006-04, there is no standard-blessed way of getting a -// mutable reference to a string's internal buffer. However, issue 530 -// (http://www.open-std.org/JTC1/SC22/WG21/docs/lwg-active.html#530) -// proposes this as the method. According to Matt Austern, this should -// already work on all current implementations. -inline char* string_as_array(std::string* str) { - // DO NOT USE const_cast(str->data()) - return str->empty() ? NULL : &*str->begin(); -} - -// The following functions are useful for cleaning up STL containers whose -// elements point to allocated memory. - -// STLDeleteElements() deletes all the elements in an STL container and clears -// the container. This function is suitable for use with a vector, set, -// hash_set, or any other STL container which defines sensible begin(), end(), -// and clear() methods. -// -// If container is NULL, this function is a no-op. -// -// As an alternative to calling STLDeleteElements() directly, consider -// STLElementDeleter (defined below), which ensures that your container's -// elements are deleted when the STLElementDeleter goes out of scope. -template -void STLDeleteElements(T* container) { - if (!container) - return; - STLDeleteContainerPointers(container->begin(), container->end()); - container->clear(); -} - -// Given an STL container consisting of (key, value) pairs, STLDeleteValues -// deletes all the "value" components and clears the container. Does nothing -// in the case it's given a NULL pointer. -template -void STLDeleteValues(T* container) { - if (!container) - return; - for (typename T::iterator i(container->begin()); i != container->end(); ++i) - delete i->second; - container->clear(); -} - - -// The following classes provide a convenient way to delete all elements or -// values from STL containers when they goes out of scope. This greatly -// simplifies code that creates temporary objects and has multiple return -// statements. Example: -// -// vector tmp_proto; -// STLElementDeleter > d(&tmp_proto); -// if (...) return false; -// ... -// return success; - -// Given a pointer to an STL container this class will delete all the element -// pointers when it goes out of scope. -template -class STLElementDeleter { - public: - STLElementDeleter(T* container) : container_(container) {} - ~STLElementDeleter() { STLDeleteElements(container_); } - - private: - T* container_; -}; - -// Given a pointer to an STL container this class will delete all the value -// pointers when it goes out of scope. -template -class STLValueDeleter { - public: - STLValueDeleter(T* container) : container_(container) {} - ~STLValueDeleter() { STLDeleteValues(container_); } - - private: - T* container_; -}; - -// Test to see if a set, map, hash_set or hash_map contains a particular key. -// Returns true if the key is in the collection. -template -bool ContainsKey(const Collection& collection, const Key& key) { - return collection.find(key) != collection.end(); -} - -// Returns true if the container is sorted. -template -bool STLIsSorted(const Container& cont) { - // Note: Use reverse iterator on container to ensure we only require - // value_type to implement operator<. - return std::adjacent_find(cont.rbegin(), cont.rend(), - std::less()) - == cont.rend(); -} - -// Returns a new ResultType containing the difference of two sorted containers. -template -ResultType STLSetDifference(const Arg1& a1, const Arg2& a2) { - assert(STLIsSorted(a1)); - assert(STLIsSorted(a2)); - ResultType difference; - std::set_difference(a1.begin(), a1.end(), - a2.begin(), a2.end(), - std::inserter(difference, difference.end())); - return difference; -} - -// Returns a new ResultType containing the union of two sorted containers. -template -ResultType STLSetUnion(const Arg1& a1, const Arg2& a2) { - assert(STLIsSorted(a1)); - assert(STLIsSorted(a2)); - ResultType result; - std::set_union(a1.begin(), a1.end(), - a2.begin(), a2.end(), - std::inserter(result, result.end())); - return result; -} - -// Returns a new ResultType containing the intersection of two sorted -// containers. -template -ResultType STLSetIntersection(const Arg1& a1, const Arg2& a2) { - assert(STLIsSorted(a1)); - assert(STLIsSorted(a2)); - ResultType result; - std::set_intersection(a1.begin(), a1.end(), - a2.begin(), a2.end(), - std::inserter(result, result.end())); - return result; -} - -// Returns true if the sorted container |a1| contains all elements of the sorted -// container |a2|. -template -bool STLIncludes(const Arg1& a1, const Arg2& a2) { - assert(STLIsSorted(a1)); - assert(STLIsSorted(a2)); - return std::includes(a1.begin(), a1.end(), - a2.begin(), a2.end()); -} - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_STL_UTIL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/stringize_macros.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/stringize_macros.h deleted file mode 100755 index ab8c43d..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/stringize_macros.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Modified from the Chromium original: -// src/base/strings/stringize_macros.h - -// This file defines preprocessor macros for stringizing preprocessor -// symbols (or their output) and manipulating preprocessor symbols -// that define strings. - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_STRINGIZE_MACROS_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_STRINGIZE_MACROS_H_ - -// This is not very useful as it does not expand defined symbols if -// called directly. Use its counterpart without the _NO_EXPANSION -// suffix, below. -#define STRINGIZE_NO_EXPANSION(x) #x - -// Use this to quote the provided parameter, first expanding it if it -// is a preprocessor symbol. -// -// For example, if: -// #define A FOO -// #define B(x) myobj->FunctionCall(x) -// -// Then: -// STRINGIZE(A) produces "FOO" -// STRINGIZE(B(y)) produces "myobj->FunctionCall(y)" -#define STRINGIZE(x) STRINGIZE_NO_EXPANSION(x) - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_STRINGIZE_MACROS_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/template_util.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/template_util.h deleted file mode 100755 index 410e04c..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/template_util.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Borrowed from Chromium's src/base/template_util.h. - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_TEMPLATE_UTIL_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_TEMPLATE_UTIL_H_ - -#include // For size_t. - -namespace webrtc { - -// Template definitions from tr1. - -template -struct integral_constant { - static const T value = v; - typedef T value_type; - typedef integral_constant type; -}; - -template const T integral_constant::value; - -typedef integral_constant true_type; -typedef integral_constant false_type; - -template struct is_pointer : false_type {}; -template struct is_pointer : true_type {}; - -template struct is_same : public false_type {}; -template struct is_same : true_type {}; - -template struct is_array : public false_type {}; -template struct is_array : public true_type {}; -template struct is_array : public true_type {}; - -template struct is_non_const_reference : false_type {}; -template struct is_non_const_reference : true_type {}; -template struct is_non_const_reference : false_type {}; - -template struct is_void : false_type {}; -template <> struct is_void : true_type {}; - -namespace internal { - -// Types YesType and NoType are guaranteed such that sizeof(YesType) < -// sizeof(NoType). -typedef char YesType; - -struct NoType { - YesType dummy[2]; -}; - -// This class is an implementation detail for is_convertible, and you -// don't need to know how it works to use is_convertible. For those -// who care: we declare two different functions, one whose argument is -// of type To and one with a variadic argument list. We give them -// return types of different size, so we can use sizeof to trick the -// compiler into telling us which function it would have chosen if we -// had called it with an argument of type From. See Alexandrescu's -// _Modern C++ Design_ for more details on this sort of trick. - -struct ConvertHelper { - template - static YesType Test(To); - - template - static NoType Test(...); - - template - static From& Create(); -}; - -// Used to determine if a type is a struct/union/class. Inspired by Boost's -// is_class type_trait implementation. -struct IsClassHelper { - template - static YesType Test(void(C::*)(void)); - - template - static NoType Test(...); -}; - -} // namespace internal - -// Inherits from true_type if From is convertible to To, false_type otherwise. -// -// Note that if the type is convertible, this will be a true_type REGARDLESS -// of whether or not the conversion would emit a warning. -template -struct is_convertible - : integral_constant( - internal::ConvertHelper::Create())) == - sizeof(internal::YesType)> { -}; - -template -struct is_class - : integral_constant(0)) == - sizeof(internal::YesType)> { -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_TEMPLATE_UTIL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/thread_annotations.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/thread_annotations.h deleted file mode 100755 index 612242d..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/thread_annotations.h +++ /dev/null @@ -1,99 +0,0 @@ -// -// Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. -// -// Use of this source code is governed by a BSD-style license -// that can be found in the LICENSE file in the root of the source -// tree. An additional intellectual property rights grant can be found -// in the file PATENTS. All contributing project authors may -// be found in the AUTHORS file in the root of the source tree. -// -// Borrowed from -// https://code.google.com/p/gperftools/source/browse/src/base/thread_annotations.h -// but adapted for clang attributes instead of the gcc. -// -// This header file contains the macro definitions for thread safety -// annotations that allow the developers to document the locking policies -// of their multi-threaded code. The annotations can also help program -// analysis tools to identify potential thread safety issues. - -#ifndef BASE_THREAD_ANNOTATIONS_H_ -#define BASE_THREAD_ANNOTATIONS_H_ - -#if defined(__clang__) && (!defined(SWIG)) -#define THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x)) -#else -#define THREAD_ANNOTATION_ATTRIBUTE__(x) // no-op -#endif - -// Document if a shared variable/field needs to be protected by a lock. -// GUARDED_BY allows the user to specify a particular lock that should be -// held when accessing the annotated variable, while GUARDED_VAR only -// indicates a shared variable should be guarded (by any lock). GUARDED_VAR -// is primarily used when the client cannot express the name of the lock. -#define GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x)) -#define GUARDED_VAR THREAD_ANNOTATION_ATTRIBUTE__(guarded) - -// Document if the memory location pointed to by a pointer should be guarded -// by a lock when dereferencing the pointer. Similar to GUARDED_VAR, -// PT_GUARDED_VAR is primarily used when the client cannot express the name -// of the lock. Note that a pointer variable to a shared memory location -// could itself be a shared variable. For example, if a shared global pointer -// q, which is guarded by mu1, points to a shared memory location that is -// guarded by mu2, q should be annotated as follows: -// int *q GUARDED_BY(mu1) PT_GUARDED_BY(mu2); -#define PT_GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE__(point_to_guarded_by(x)) -#define PT_GUARDED_VAR THREAD_ANNOTATION_ATTRIBUTE__(point_to_guarded) - -// Document the acquisition order between locks that can be held -// simultaneously by a thread. For any two locks that need to be annotated -// to establish an acquisition order, only one of them needs the annotation. -// (i.e. You don't have to annotate both locks with both ACQUIRED_AFTER -// and ACQUIRED_BEFORE.) -#define ACQUIRED_AFTER(x) THREAD_ANNOTATION_ATTRIBUTE__(acquired_after(x)) -#define ACQUIRED_BEFORE(x) THREAD_ANNOTATION_ATTRIBUTE__(acquired_before(x)) - -// The following three annotations document the lock requirements for -// functions/methods. - -// Document if a function expects certain locks to be held before it is called -#define EXCLUSIVE_LOCKS_REQUIRED(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(exclusive_locks_required(__VA_ARGS__)) - -#define SHARED_LOCKS_REQUIRED(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(shared_locks_required(__VA_ARGS__)) - -// Document the locks acquired in the body of the function. These locks -// cannot be held when calling this function (as google3's Mutex locks are -// non-reentrant). -#define LOCKS_EXCLUDED(x) THREAD_ANNOTATION_ATTRIBUTE__(locks_excluded(x)) - -// Document the lock the annotated function returns without acquiring it. -#define LOCK_RETURNED(x) THREAD_ANNOTATION_ATTRIBUTE__(lock_returned(x)) - -// Document if a class/type is a lockable type (such as the Mutex class). -#define LOCKABLE THREAD_ANNOTATION_ATTRIBUTE__(lockable) - -// Document if a class is a scoped lockable type (such as the MutexLock class). -#define SCOPED_LOCKABLE THREAD_ANNOTATION_ATTRIBUTE__(scoped_lockable) - -// The following annotations specify lock and unlock primitives. -#define EXCLUSIVE_LOCK_FUNCTION(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(exclusive_lock_function(__VA_ARGS__)) - -#define SHARED_LOCK_FUNCTION(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(shared_lock_function(__VA_ARGS__)) - -#define EXCLUSIVE_TRYLOCK_FUNCTION(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(exclusive_trylock_function(__VA_ARGS__)) - -#define SHARED_TRYLOCK_FUNCTION(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(shared_trylock_function(__VA_ARGS__)) - -#define UNLOCK_FUNCTION(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(unlock_function(__VA_ARGS__)) - -// An escape hatch for thread safety analysis to ignore the annotated function. -#define NO_THREAD_SAFETY_ANALYSIS \ - THREAD_ANNOTATION_ATTRIBUTE__(no_thread_safety_analysis) - -#endif // BASE_THREAD_ANNOTATIONS_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/thread_wrapper.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/thread_wrapper.h deleted file mode 100755 index 7fbf58c..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/thread_wrapper.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// System independant wrapper for spawning threads -// Note: the spawned thread will loop over the callback function until stopped. -// Note: The callback function is expected to return every 2 seconds or more -// often. - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_THREAD_WRAPPER_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_THREAD_WRAPPER_H_ - -#include "webrtc/common_types.h" -#include "webrtc/typedefs.h" - -namespace webrtc { - -// Object that will be passed by the spawned thread when it enters the callback -// function. -#define ThreadObj void* - -// Callback function that the spawned thread will enter once spawned. -// A return value of false is interpreted as that the function has no -// more work to do and that the thread can be released. -typedef bool(*ThreadRunFunction)(ThreadObj); - -enum ThreadPriority { - kLowPriority = 1, - kNormalPriority = 2, - kHighPriority = 3, - kHighestPriority = 4, - kRealtimePriority = 5 -}; - -class ThreadWrapper { - public: - enum {kThreadMaxNameLength = 64}; - - virtual ~ThreadWrapper() {}; - - // Factory method. Constructor disabled. - // - // func Pointer to a, by user, specified callback function. - // obj Object associated with the thread. Passed in the callback - // function. - // prio Thread priority. May require root/admin rights. - // thread_name NULL terminated thread name, will be visable in the Windows - // debugger. - static ThreadWrapper* CreateThread(ThreadRunFunction func, - ThreadObj obj, - ThreadPriority prio = kNormalPriority, - const char* thread_name = 0); - - // Get the current thread's kernel thread ID. - static uint32_t GetThreadId(); - - // Non blocking termination of the spawned thread. Note that it is not safe - // to delete this class until the spawned thread has been reclaimed. - virtual void SetNotAlive() = 0; - - // Tries to spawns a thread and returns true if that was successful. - // Additionally, it tries to set thread priority according to the priority - // from when CreateThread was called. However, failure to set priority will - // not result in a false return value. - // TODO(henrike): add a function for polling whether priority was set or - // not. - virtual bool Start(unsigned int& id) = 0; - - // Sets the threads CPU affinity. CPUs are listed 0 - (number of CPUs - 1). - // The numbers in processor_numbers specify which CPUs are allowed to run the - // thread. processor_numbers should not contain any duplicates and elements - // should be lower than (number of CPUs - 1). amount_of_processors should be - // equal to the number of processors listed in processor_numbers. - virtual bool SetAffinity(const int* processor_numbers, - const unsigned int amount_of_processors); - - // Stops the spawned thread and waits for it to be reclaimed with a timeout - // of two seconds. Will return false if the thread was not reclaimed. - // Multiple tries to Stop are allowed (e.g. to wait longer than 2 seconds). - // It's ok to call Stop() even if the spawned thread has been reclaimed. - virtual bool Stop() = 0; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_THREAD_WRAPPER_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/tick_util.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/tick_util.h deleted file mode 100755 index 0b7890e..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/tick_util.h +++ /dev/null @@ -1,298 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// System independant wrapper for polling elapsed time in ms and us. -// The implementation works in the tick domain which can be mapped over to the -// time domain. -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_TICK_UTIL_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_TICK_UTIL_H_ - -#if _WIN32 -// Note: The Windows header must always be included before mmsystem.h -#include -#include -#elif WEBRTC_LINUX -#include -#elif WEBRTC_MAC -#include -#include -#else -#include -#include -#endif - -#include "webrtc/typedefs.h" - -namespace webrtc { - -class TickInterval; - -// Class representing the current time. -class TickTime { - public: - TickTime(); - explicit TickTime(int64_t ticks); - - // Current time in the tick domain. - static TickTime Now(); - - // Now in the time domain in ms. - static int64_t MillisecondTimestamp(); - - // Now in the time domain in us. - static int64_t MicrosecondTimestamp(); - - // Returns the number of ticks in the tick domain. - int64_t Ticks() const; - - static int64_t MillisecondsToTicks(const int64_t ms); - - static int64_t TicksToMilliseconds(const int64_t ticks); - - // Returns a TickTime that is ticks later than the passed TickTime. - friend TickTime operator+(const TickTime lhs, const int64_t ticks); - TickTime& operator+=(const int64_t& ticks); - - // Returns a TickInterval that is the difference in ticks beween rhs and lhs. - friend TickInterval operator-(const TickTime& lhs, const TickTime& rhs); - - // Call to engage the fake clock. This is useful for tests since relying on - // a real clock often makes the test flaky. - static void UseFakeClock(int64_t start_millisecond); - - // Advance the fake clock. Must be called after UseFakeClock. - static void AdvanceFakeClock(int64_t milliseconds); - - private: - static int64_t QueryOsForTicks(); - - static bool use_fake_clock_; - static int64_t fake_ticks_; - - int64_t ticks_; -}; - -// Represents a time delta in ticks. -class TickInterval { - public: - TickInterval(); - - int64_t Milliseconds() const; - int64_t Microseconds() const; - - // Returns the sum of two TickIntervals as a TickInterval. - friend TickInterval operator+(const TickInterval& lhs, - const TickInterval& rhs); - TickInterval& operator+=(const TickInterval& rhs); - - // Returns a TickInterval corresponding to rhs - lhs. - friend TickInterval operator-(const TickInterval& lhs, - const TickInterval& rhs); - TickInterval& operator-=(const TickInterval& rhs); - - friend bool operator>(const TickInterval& lhs, const TickInterval& rhs); - friend bool operator<=(const TickInterval& lhs, const TickInterval& rhs); - friend bool operator<(const TickInterval& lhs, const TickInterval& rhs); - friend bool operator>=(const TickInterval& lhs, const TickInterval& rhs); - - private: - explicit TickInterval(int64_t interval); - - friend class TickTime; - friend TickInterval operator-(const TickTime& lhs, const TickTime& rhs); - - private: - int64_t interval_; -}; - -inline TickInterval operator+(const TickInterval& lhs, - const TickInterval& rhs) { - return TickInterval(lhs.interval_ + rhs.interval_); -} - -inline TickInterval operator-(const TickInterval& lhs, - const TickInterval& rhs) { - return TickInterval(lhs.interval_ - rhs.interval_); -} - -inline TickInterval operator-(const TickTime& lhs, const TickTime& rhs) { - return TickInterval(lhs.ticks_ - rhs.ticks_); -} - -inline TickTime operator+(const TickTime lhs, const int64_t ticks) { - TickTime time = lhs; - time.ticks_ += ticks; - return time; -} - -inline bool operator>(const TickInterval& lhs, const TickInterval& rhs) { - return lhs.interval_ > rhs.interval_; -} - -inline bool operator<=(const TickInterval& lhs, const TickInterval& rhs) { - return lhs.interval_ <= rhs.interval_; -} - -inline bool operator<(const TickInterval& lhs, const TickInterval& rhs) { - return lhs.interval_ <= rhs.interval_; -} - -inline bool operator>=(const TickInterval& lhs, const TickInterval& rhs) { - return lhs.interval_ >= rhs.interval_; -} - -inline TickTime::TickTime() - : ticks_(0) { -} - -inline TickTime::TickTime(int64_t ticks) - : ticks_(ticks) { -} - -inline TickTime TickTime::Now() { - if (use_fake_clock_) - return TickTime(fake_ticks_); - else - return TickTime(QueryOsForTicks()); -} - -inline int64_t TickTime::MillisecondTimestamp() { - int64_t ticks = TickTime::Now().Ticks(); -#if _WIN32 -#ifdef USE_QUERY_PERFORMANCE_COUNTER - LARGE_INTEGER qpfreq; - QueryPerformanceFrequency(&qpfreq); - return (ticks * 1000) / qpfreq.QuadPart; -#else - return ticks; -#endif -#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) - return ticks / 1000000LL; -#else - return ticks / 1000LL; -#endif -} - -inline int64_t TickTime::MicrosecondTimestamp() { - int64_t ticks = TickTime::Now().Ticks(); -#if _WIN32 -#ifdef USE_QUERY_PERFORMANCE_COUNTER - LARGE_INTEGER qpfreq; - QueryPerformanceFrequency(&qpfreq); - return (ticks * 1000) / (qpfreq.QuadPart / 1000); -#else - return ticks * 1000LL; -#endif -#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) - return ticks / 1000LL; -#else - return ticks; -#endif -} - -inline int64_t TickTime::Ticks() const { - return ticks_; -} - -inline int64_t TickTime::MillisecondsToTicks(const int64_t ms) { -#if _WIN32 -#ifdef USE_QUERY_PERFORMANCE_COUNTER - LARGE_INTEGER qpfreq; - QueryPerformanceFrequency(&qpfreq); - return (qpfreq.QuadPart * ms) / 1000; -#else - return ms; -#endif -#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) - return ms * 1000000LL; -#else - return ms * 1000LL; -#endif -} - -inline int64_t TickTime::TicksToMilliseconds(const int64_t ticks) { -#if _WIN32 -#ifdef USE_QUERY_PERFORMANCE_COUNTER - LARGE_INTEGER qpfreq; - QueryPerformanceFrequency(&qpfreq); - return (ticks * 1000) / qpfreq.QuadPart; -#else - return ticks; -#endif -#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) - return ticks / 1000000LL; -#else - return ticks / 1000LL; -#endif -} - -inline TickTime& TickTime::operator+=(const int64_t& ticks) { - ticks_ += ticks; - return *this; -} - -inline TickInterval::TickInterval() : interval_(0) { -} - -inline TickInterval::TickInterval(const int64_t interval) - : interval_(interval) { -} - -inline int64_t TickInterval::Milliseconds() const { -#if _WIN32 -#ifdef USE_QUERY_PERFORMANCE_COUNTER - LARGE_INTEGER qpfreq; - QueryPerformanceFrequency(&qpfreq); - return (interval_ * 1000) / qpfreq.QuadPart; -#else - // interval_ is in ms - return interval_; -#endif -#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) - // interval_ is in ns - return interval_ / 1000000; -#else - // interval_ is usecs - return interval_ / 1000; -#endif -} - -inline int64_t TickInterval::Microseconds() const { -#if _WIN32 -#ifdef USE_QUERY_PERFORMANCE_COUNTER - LARGE_INTEGER qpfreq; - QueryPerformanceFrequency(&qpfreq); - return (interval_ * 1000000) / qpfreq.QuadPart; -#else - // interval_ is in ms - return interval_ * 1000LL; -#endif -#elif defined(WEBRTC_LINUX) || defined(WEBRTC_MAC) - // interval_ is in ns - return interval_ / 1000; -#else - // interval_ is usecs - return interval_; -#endif -} - -inline TickInterval& TickInterval::operator+=(const TickInterval& rhs) { - interval_ += rhs.interval_; - return *this; -} - -inline TickInterval& TickInterval::operator-=(const TickInterval& rhs) { - interval_ -= rhs.interval_; - return *this; -} - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_TICK_UTIL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/timestamp_extrapolator.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/timestamp_extrapolator.h deleted file mode 100755 index d067198..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/timestamp_extrapolator.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef SYSTEM_WRAPPERS_INTERFACE_TIMESTAMP_EXTRAPOLATOR_H_ -#define SYSTEM_WRAPPERS_INTERFACE_TIMESTAMP_EXTRAPOLATOR_H_ - -#include "webrtc/system_wrappers/interface/rw_lock_wrapper.h" -#include "webrtc/typedefs.h" - -namespace webrtc -{ - -class TimestampExtrapolator -{ -public: - explicit TimestampExtrapolator(int64_t start_ms); - ~TimestampExtrapolator(); - void Update(int64_t tMs, uint32_t ts90khz); - int64_t ExtrapolateLocalTime(uint32_t timestamp90khz); - void Reset(int64_t start_ms); - -private: - void CheckForWrapArounds(uint32_t ts90khz); - bool DelayChangeDetection(double error); - RWLockWrapper* _rwLock; - double _w[2]; - double _P[2][2]; - int64_t _startMs; - int64_t _prevMs; - uint32_t _firstTimestamp; - int32_t _wrapArounds; - int64_t _prevUnwrappedTimestamp; - int64_t _prevWrapTimestamp; - const double _lambda; - bool _firstAfterReset; - uint32_t _packetCount; - const uint32_t _startUpFilterDelayInPackets; - - double _detectorAccumulatorPos; - double _detectorAccumulatorNeg; - const double _alarmThreshold; - const double _accDrift; - const double _accMaxError; - const double _P11; -}; - -} // namespace webrtc - -#endif // SYSTEM_WRAPPERS_INTERFACE_TIMESTAMP_EXTRAPOLATOR_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/trace.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/trace.h deleted file mode 100755 index 44ea658..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/trace.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - * - * System independent wrapper for logging runtime information to file. - * Note: All log messages will be written to the same trace file. - * Note: If too many messages are written to file there will be a build up of - * messages. Apply filtering to avoid that. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_TRACE_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_TRACE_H_ - -#include "webrtc/common_types.h" -#include "webrtc/typedefs.h" - -namespace webrtc { - -#if defined(WEBRTC_RESTRICT_LOGGING) -// Disable all TRACE macros. The LOG macro is still functional. -#define WEBRTC_TRACE true ? (void) 0 : Trace::Add -#else -#define WEBRTC_TRACE Trace::Add -#endif - -class Trace { - public: - // The length of the trace text preceeding the log message. - static const int kBoilerplateLength; - // The position of the timestamp text within a trace. - static const int kTimestampPosition; - // The length of the timestamp (without "delta" field). - static const int kTimestampLength; - - // Increments the reference count to the trace. - static void CreateTrace(); - // Decrements the reference count to the trace. - static void ReturnTrace(); - // Note: any instance that writes to the trace file should increment and - // decrement the reference count on construction and destruction, - // respectively. - - // Specifies what type of messages should be written to the trace file. The - // filter parameter is a bitmask where each message type is enumerated by the - // TraceLevel enumerator. TODO(hellner): why is the TraceLevel enumerator not - // defined in this file? - static void set_level_filter(uint32_t filter) { level_filter_ = filter; } - - // Returns what type of messages are written to the trace file. - static uint32_t level_filter() { return level_filter_; } - - // Sets the file name. If add_file_counter is false the same file will be - // reused when it fills up. If it's true a new file with incremented name - // will be used. - static int32_t SetTraceFile(const char* file_name, - const bool add_file_counter = false); - - // Returns the name of the file that the trace is currently writing to. - static int32_t TraceFile(char file_name[1024]); - - // Registers callback to receive trace messages. - // TODO(hellner): Why not use OutStream instead? Why is TraceCallback not - // defined in this file? - static int32_t SetTraceCallback(TraceCallback* callback); - - // Adds a trace message for writing to file. The message is put in a queue - // for writing to file whenever possible for performance reasons. I.e. there - // is a crash it is possible that the last, vital logs are not logged yet. - // level is the type of message to log. If that type of messages is - // filtered it will not be written to file. module is an identifier for what - // part of the code the message is coming. - // id is an identifier that should be unique for that set of classes that - // are associated (e.g. all instances owned by an engine). - // msg and the ellipsis are the same as e.g. sprintf. - // TODO(hellner) Why is TraceModule not defined in this file? - static void Add(const TraceLevel level, - const TraceModule module, - const int32_t id, - const char* msg, ...); - - private: - static uint32_t level_filter_; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_TRACE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/trace_event.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/trace_event.h deleted file mode 100755 index 23b16c7..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/trace_event.h +++ /dev/null @@ -1,912 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file under third_party_mods/chromium or at: -// http://src.chromium.org/svn/trunk/src/LICENSE - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_TRACE_EVENT_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_TRACE_EVENT_H_ - -#include - -#include "webrtc/system_wrappers/interface/event_tracer.h" - -#if defined(TRACE_EVENT0) -#error "Another copy of trace_event.h has already been included." -#endif - -// Extracted from Chromium's src/base/debug/trace_event.h. - -// This header is designed to give you trace_event macros without specifying -// how the events actually get collected and stored. If you need to expose trace -// event to some other universe, you can copy-and-paste this file, -// implement the TRACE_EVENT_API macros, and do any other necessary fixup for -// the target platform. The end result is that multiple libraries can funnel -// events through to a shared trace event collector. - -// Trace events are for tracking application performance and resource usage. -// Macros are provided to track: -// Begin and end of function calls -// Counters -// -// Events are issued against categories. Whereas LOG's -// categories are statically defined, TRACE categories are created -// implicitly with a string. For example: -// TRACE_EVENT_INSTANT0("MY_SUBSYSTEM", "SomeImportantEvent") -// -// Events can be INSTANT, or can be pairs of BEGIN and END in the same scope: -// TRACE_EVENT_BEGIN0("MY_SUBSYSTEM", "SomethingCostly") -// doSomethingCostly() -// TRACE_EVENT_END0("MY_SUBSYSTEM", "SomethingCostly") -// Note: our tools can't always determine the correct BEGIN/END pairs unless -// these are used in the same scope. Use ASYNC_BEGIN/ASYNC_END macros if you -// need them to be in separate scopes. -// -// A common use case is to trace entire function scopes. This -// issues a trace BEGIN and END automatically: -// void doSomethingCostly() { -// TRACE_EVENT0("MY_SUBSYSTEM", "doSomethingCostly"); -// ... -// } -// -// Additional parameters can be associated with an event: -// void doSomethingCostly2(int howMuch) { -// TRACE_EVENT1("MY_SUBSYSTEM", "doSomethingCostly", -// "howMuch", howMuch); -// ... -// } -// -// The trace system will automatically add to this information the -// current process id, thread id, and a timestamp in microseconds. -// -// To trace an asynchronous procedure such as an IPC send/receive, use -// ASYNC_BEGIN and ASYNC_END: -// [single threaded sender code] -// static int send_count = 0; -// ++send_count; -// TRACE_EVENT_ASYNC_BEGIN0("ipc", "message", send_count); -// Send(new MyMessage(send_count)); -// [receive code] -// void OnMyMessage(send_count) { -// TRACE_EVENT_ASYNC_END0("ipc", "message", send_count); -// } -// The third parameter is a unique ID to match ASYNC_BEGIN/ASYNC_END pairs. -// ASYNC_BEGIN and ASYNC_END can occur on any thread of any traced process. -// Pointers can be used for the ID parameter, and they will be mangled -// internally so that the same pointer on two different processes will not -// match. For example: -// class MyTracedClass { -// public: -// MyTracedClass() { -// TRACE_EVENT_ASYNC_BEGIN0("category", "MyTracedClass", this); -// } -// ~MyTracedClass() { -// TRACE_EVENT_ASYNC_END0("category", "MyTracedClass", this); -// } -// } -// -// Trace event also supports counters, which is a way to track a quantity -// as it varies over time. Counters are created with the following macro: -// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter", g_myCounterValue); -// -// Counters are process-specific. The macro itself can be issued from any -// thread, however. -// -// Sometimes, you want to track two counters at once. You can do this with two -// counter macros: -// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter0", g_myCounterValue[0]); -// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter1", g_myCounterValue[1]); -// Or you can do it with a combined macro: -// TRACE_COUNTER2("MY_SUBSYSTEM", "myCounter", -// "bytesPinned", g_myCounterValue[0], -// "bytesAllocated", g_myCounterValue[1]); -// This indicates to the tracing UI that these counters should be displayed -// in a single graph, as a summed area chart. -// -// Since counters are in a global namespace, you may want to disembiguate with a -// unique ID, by using the TRACE_COUNTER_ID* variations. -// -// By default, trace collection is compiled in, but turned off at runtime. -// Collecting trace data is the responsibility of the embedding -// application. In Chrome's case, navigating to about:tracing will turn on -// tracing and display data collected across all active processes. -// -// -// Memory scoping note: -// Tracing copies the pointers, not the string content, of the strings passed -// in for category, name, and arg_names. Thus, the following code will -// cause problems: -// char* str = strdup("impprtantName"); -// TRACE_EVENT_INSTANT0("SUBSYSTEM", str); // BAD! -// free(str); // Trace system now has dangling pointer -// -// To avoid this issue with the |name| and |arg_name| parameters, use the -// TRACE_EVENT_COPY_XXX overloads of the macros at additional runtime overhead. -// Notes: The category must always be in a long-lived char* (i.e. static const). -// The |arg_values|, when used, are always deep copied with the _COPY -// macros. -// -// When are string argument values copied: -// const char* arg_values are only referenced by default: -// TRACE_EVENT1("category", "name", -// "arg1", "literal string is only referenced"); -// Use TRACE_STR_COPY to force copying of a const char*: -// TRACE_EVENT1("category", "name", -// "arg1", TRACE_STR_COPY("string will be copied")); -// std::string arg_values are always copied: -// TRACE_EVENT1("category", "name", -// "arg1", std::string("string will be copied")); -// -// -// Thread Safety: -// Thread safety is provided by methods defined in event_tracer.h. See the file -// for details. - - -// By default, const char* argument values are assumed to have long-lived scope -// and will not be copied. Use this macro to force a const char* to be copied. -#define TRACE_STR_COPY(str) \ - webrtc::trace_event_internal::TraceStringWithCopy(str) - -// By default, uint64 ID argument values are not mangled with the Process ID in -// TRACE_EVENT_ASYNC macros. Use this macro to force Process ID mangling. -#define TRACE_ID_MANGLE(id) \ - webrtc::trace_event_internal::TraceID::ForceMangle(id) - -// Records a pair of begin and end events called "name" for the current -// scope, with 0, 1 or 2 associated arguments. If the category is not -// enabled, then this does nothing. -// - category and name strings must have application lifetime (statics or -// literals). They may not include " chars. -#define TRACE_EVENT0(category, name) \ - INTERNAL_TRACE_EVENT_ADD_SCOPED(category, name) -#define TRACE_EVENT1(category, name, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_SCOPED(category, name, arg1_name, arg1_val) -#define TRACE_EVENT2(category, name, arg1_name, arg1_val, arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_SCOPED(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) - -// Same as TRACE_EVENT except that they are not included in official builds. -#ifdef OFFICIAL_BUILD -#define UNSHIPPED_TRACE_EVENT0(category, name) (void)0 -#define UNSHIPPED_TRACE_EVENT1(category, name, arg1_name, arg1_val) (void)0 -#define UNSHIPPED_TRACE_EVENT2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) (void)0 -#define UNSHIPPED_TRACE_EVENT_INSTANT0(category, name) (void)0 -#define UNSHIPPED_TRACE_EVENT_INSTANT1(category, name, arg1_name, arg1_val) \ - (void)0 -#define UNSHIPPED_TRACE_EVENT_INSTANT2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) (void)0 -#else -#define UNSHIPPED_TRACE_EVENT0(category, name) \ - TRACE_EVENT0(category, name) -#define UNSHIPPED_TRACE_EVENT1(category, name, arg1_name, arg1_val) \ - TRACE_EVENT1(category, name, arg1_name, arg1_val) -#define UNSHIPPED_TRACE_EVENT2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - TRACE_EVENT2(category, name, arg1_name, arg1_val, arg2_name, arg2_val) -#define UNSHIPPED_TRACE_EVENT_INSTANT0(category, name) \ - TRACE_EVENT_INSTANT0(category, name) -#define UNSHIPPED_TRACE_EVENT_INSTANT1(category, name, arg1_name, arg1_val) \ - TRACE_EVENT_INSTANT1(category, name, arg1_name, arg1_val) -#define UNSHIPPED_TRACE_EVENT_INSTANT2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - TRACE_EVENT_INSTANT2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) -#endif - -// Records a single event called "name" immediately, with 0, 1 or 2 -// associated arguments. If the category is not enabled, then this -// does nothing. -// - category and name strings must have application lifetime (statics or -// literals). They may not include " chars. -#define TRACE_EVENT_INSTANT0(category, name) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, \ - category, name, TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_INSTANT1(category, name, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, \ - category, name, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) -#define TRACE_EVENT_INSTANT2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, \ - category, name, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, \ - arg2_name, arg2_val) -#define TRACE_EVENT_COPY_INSTANT0(category, name) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, \ - category, name, TRACE_EVENT_FLAG_COPY) -#define TRACE_EVENT_COPY_INSTANT1(category, name, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, \ - category, name, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val) -#define TRACE_EVENT_COPY_INSTANT2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, \ - category, name, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \ - arg2_name, arg2_val) - -// Records a single BEGIN event called "name" immediately, with 0, 1 or 2 -// associated arguments. If the category is not enabled, then this -// does nothing. -// - category and name strings must have application lifetime (statics or -// literals). They may not include " chars. -#define TRACE_EVENT_BEGIN0(category, name) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, \ - category, name, TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_BEGIN1(category, name, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, \ - category, name, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) -#define TRACE_EVENT_BEGIN2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, \ - category, name, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, \ - arg2_name, arg2_val) -#define TRACE_EVENT_COPY_BEGIN0(category, name) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, \ - category, name, TRACE_EVENT_FLAG_COPY) -#define TRACE_EVENT_COPY_BEGIN1(category, name, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, \ - category, name, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val) -#define TRACE_EVENT_COPY_BEGIN2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, \ - category, name, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \ - arg2_name, arg2_val) - -// Records a single END event for "name" immediately. If the category -// is not enabled, then this does nothing. -// - category and name strings must have application lifetime (statics or -// literals). They may not include " chars. -#define TRACE_EVENT_END0(category, name) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, \ - category, name, TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_END1(category, name, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, \ - category, name, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) -#define TRACE_EVENT_END2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, \ - category, name, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, \ - arg2_name, arg2_val) -#define TRACE_EVENT_COPY_END0(category, name) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, \ - category, name, TRACE_EVENT_FLAG_COPY) -#define TRACE_EVENT_COPY_END1(category, name, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, \ - category, name, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val) -#define TRACE_EVENT_COPY_END2(category, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, \ - category, name, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \ - arg2_name, arg2_val) - -// Records the value of a counter called "name" immediately. Value -// must be representable as a 32 bit integer. -// - category and name strings must have application lifetime (statics or -// literals). They may not include " chars. -#define TRACE_COUNTER1(category, name, value) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, \ - category, name, TRACE_EVENT_FLAG_NONE, \ - "value", static_cast(value)) -#define TRACE_COPY_COUNTER1(category, name, value) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, \ - category, name, TRACE_EVENT_FLAG_COPY, \ - "value", static_cast(value)) - -// Records the values of a multi-parted counter called "name" immediately. -// The UI will treat value1 and value2 as parts of a whole, displaying their -// values as a stacked-bar chart. -// - category and name strings must have application lifetime (statics or -// literals). They may not include " chars. -#define TRACE_COUNTER2(category, name, value1_name, value1_val, \ - value2_name, value2_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, \ - category, name, TRACE_EVENT_FLAG_NONE, \ - value1_name, static_cast(value1_val), \ - value2_name, static_cast(value2_val)) -#define TRACE_COPY_COUNTER2(category, name, value1_name, value1_val, \ - value2_name, value2_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, \ - category, name, TRACE_EVENT_FLAG_COPY, \ - value1_name, static_cast(value1_val), \ - value2_name, static_cast(value2_val)) - -// Records the value of a counter called "name" immediately. Value -// must be representable as a 32 bit integer. -// - category and name strings must have application lifetime (statics or -// literals). They may not include " chars. -// - |id| is used to disambiguate counters with the same name. It must either -// be a pointer or an integer value up to 64 bits. If it's a pointer, the bits -// will be xored with a hash of the process ID so that the same pointer on -// two different processes will not collide. -#define TRACE_COUNTER_ID1(category, name, id, value) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, \ - category, name, id, TRACE_EVENT_FLAG_NONE, \ - "value", static_cast(value)) -#define TRACE_COPY_COUNTER_ID1(category, name, id, value) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, \ - category, name, id, TRACE_EVENT_FLAG_COPY, \ - "value", static_cast(value)) - -// Records the values of a multi-parted counter called "name" immediately. -// The UI will treat value1 and value2 as parts of a whole, displaying their -// values as a stacked-bar chart. -// - category and name strings must have application lifetime (statics or -// literals). They may not include " chars. -// - |id| is used to disambiguate counters with the same name. It must either -// be a pointer or an integer value up to 64 bits. If it's a pointer, the bits -// will be xored with a hash of the process ID so that the same pointer on -// two different processes will not collide. -#define TRACE_COUNTER_ID2(category, name, id, value1_name, value1_val, \ - value2_name, value2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, \ - category, name, id, TRACE_EVENT_FLAG_NONE, \ - value1_name, static_cast(value1_val), \ - value2_name, static_cast(value2_val)) -#define TRACE_COPY_COUNTER_ID2(category, name, id, value1_name, value1_val, \ - value2_name, value2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, \ - category, name, id, TRACE_EVENT_FLAG_COPY, \ - value1_name, static_cast(value1_val), \ - value2_name, static_cast(value2_val)) - - -// Records a single ASYNC_BEGIN event called "name" immediately, with 0, 1 or 2 -// associated arguments. If the category is not enabled, then this -// does nothing. -// - category and name strings must have application lifetime (statics or -// literals). They may not include " chars. -// - |id| is used to match the ASYNC_BEGIN event with the ASYNC_END event. ASYNC -// events are considered to match if their category, name and id values all -// match. |id| must either be a pointer or an integer value up to 64 bits. If -// it's a pointer, the bits will be xored with a hash of the process ID so -// that the same pointer on two different processes will not collide. -// An asynchronous operation can consist of multiple phases. The first phase is -// defined by the ASYNC_BEGIN calls. Additional phases can be defined using the -// ASYNC_STEP macros. When the operation completes, call ASYNC_END. -// An ASYNC trace typically occur on a single thread (if not, they will only be -// drawn on the thread defined in the ASYNC_BEGIN event), but all events in that -// operation must use the same |name| and |id|. Each event can have its own -// args. -#define TRACE_EVENT_ASYNC_BEGIN0(category, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ - category, name, id, TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ - category, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) -#define TRACE_EVENT_ASYNC_BEGIN2(category, name, id, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ - category, name, id, TRACE_EVENT_FLAG_NONE, \ - arg1_name, arg1_val, arg2_name, arg2_val) -#define TRACE_EVENT_COPY_ASYNC_BEGIN0(category, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ - category, name, id, TRACE_EVENT_FLAG_COPY) -#define TRACE_EVENT_COPY_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ - category, name, id, TRACE_EVENT_FLAG_COPY, \ - arg1_name, arg1_val) -#define TRACE_EVENT_COPY_ASYNC_BEGIN2(category, name, id, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ - category, name, id, TRACE_EVENT_FLAG_COPY, \ - arg1_name, arg1_val, arg2_name, arg2_val) - -// Records a single ASYNC_STEP event for |step| immediately. If the category -// is not enabled, then this does nothing. The |name| and |id| must match the -// ASYNC_BEGIN event above. The |step| param identifies this step within the -// async event. This should be called at the beginning of the next phase of an -// asynchronous operation. -#define TRACE_EVENT_ASYNC_STEP0(category, name, id, step) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP, \ - category, name, id, TRACE_EVENT_FLAG_NONE, "step", step) -#define TRACE_EVENT_ASYNC_STEP1(category, name, id, step, \ - arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP, \ - category, name, id, TRACE_EVENT_FLAG_NONE, "step", step, \ - arg1_name, arg1_val) -#define TRACE_EVENT_COPY_ASYNC_STEP0(category, name, id, step) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP, \ - category, name, id, TRACE_EVENT_FLAG_COPY, "step", step) -#define TRACE_EVENT_COPY_ASYNC_STEP1(category, name, id, step, \ - arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP, \ - category, name, id, TRACE_EVENT_FLAG_COPY, "step", step, \ - arg1_name, arg1_val) - -// Records a single ASYNC_END event for "name" immediately. If the category -// is not enabled, then this does nothing. -#define TRACE_EVENT_ASYNC_END0(category, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ - category, name, id, TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_ASYNC_END1(category, name, id, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ - category, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) -#define TRACE_EVENT_ASYNC_END2(category, name, id, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ - category, name, id, TRACE_EVENT_FLAG_NONE, \ - arg1_name, arg1_val, arg2_name, arg2_val) -#define TRACE_EVENT_COPY_ASYNC_END0(category, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ - category, name, id, TRACE_EVENT_FLAG_COPY) -#define TRACE_EVENT_COPY_ASYNC_END1(category, name, id, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ - category, name, id, TRACE_EVENT_FLAG_COPY, \ - arg1_name, arg1_val) -#define TRACE_EVENT_COPY_ASYNC_END2(category, name, id, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ - category, name, id, TRACE_EVENT_FLAG_COPY, \ - arg1_name, arg1_val, arg2_name, arg2_val) - - -// Records a single FLOW_BEGIN event called "name" immediately, with 0, 1 or 2 -// associated arguments. If the category is not enabled, then this -// does nothing. -// - category and name strings must have application lifetime (statics or -// literals). They may not include " chars. -// - |id| is used to match the FLOW_BEGIN event with the FLOW_END event. FLOW -// events are considered to match if their category, name and id values all -// match. |id| must either be a pointer or an integer value up to 64 bits. If -// it's a pointer, the bits will be xored with a hash of the process ID so -// that the same pointer on two different processes will not collide. -// FLOW events are different from ASYNC events in how they are drawn by the -// tracing UI. A FLOW defines asynchronous data flow, such as posting a task -// (FLOW_BEGIN) and later executing that task (FLOW_END). Expect FLOWs to be -// drawn as lines or arrows from FLOW_BEGIN scopes to FLOW_END scopes. Similar -// to ASYNC, a FLOW can consist of multiple phases. The first phase is defined -// by the FLOW_BEGIN calls. Additional phases can be defined using the FLOW_STEP -// macros. When the operation completes, call FLOW_END. An async operation can -// span threads and processes, but all events in that operation must use the -// same |name| and |id|. Each event can have its own args. -#define TRACE_EVENT_FLOW_BEGIN0(category, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ - category, name, id, TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_FLOW_BEGIN1(category, name, id, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ - category, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) -#define TRACE_EVENT_FLOW_BEGIN2(category, name, id, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ - category, name, id, TRACE_EVENT_FLAG_NONE, \ - arg1_name, arg1_val, arg2_name, arg2_val) -#define TRACE_EVENT_COPY_FLOW_BEGIN0(category, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ - category, name, id, TRACE_EVENT_FLAG_COPY) -#define TRACE_EVENT_COPY_FLOW_BEGIN1(category, name, id, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ - category, name, id, TRACE_EVENT_FLAG_COPY, \ - arg1_name, arg1_val) -#define TRACE_EVENT_COPY_FLOW_BEGIN2(category, name, id, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ - category, name, id, TRACE_EVENT_FLAG_COPY, \ - arg1_name, arg1_val, arg2_name, arg2_val) - -// Records a single FLOW_STEP event for |step| immediately. If the category -// is not enabled, then this does nothing. The |name| and |id| must match the -// FLOW_BEGIN event above. The |step| param identifies this step within the -// async event. This should be called at the beginning of the next phase of an -// asynchronous operation. -#define TRACE_EVENT_FLOW_STEP0(category, name, id, step) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \ - category, name, id, TRACE_EVENT_FLAG_NONE, "step", step) -#define TRACE_EVENT_FLOW_STEP1(category, name, id, step, \ - arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \ - category, name, id, TRACE_EVENT_FLAG_NONE, "step", step, \ - arg1_name, arg1_val) -#define TRACE_EVENT_COPY_FLOW_STEP0(category, name, id, step) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \ - category, name, id, TRACE_EVENT_FLAG_COPY, "step", step) -#define TRACE_EVENT_COPY_FLOW_STEP1(category, name, id, step, \ - arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \ - category, name, id, TRACE_EVENT_FLAG_COPY, "step", step, \ - arg1_name, arg1_val) - -// Records a single FLOW_END event for "name" immediately. If the category -// is not enabled, then this does nothing. -#define TRACE_EVENT_FLOW_END0(category, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ - category, name, id, TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_FLOW_END1(category, name, id, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ - category, name, id, TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) -#define TRACE_EVENT_FLOW_END2(category, name, id, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ - category, name, id, TRACE_EVENT_FLAG_NONE, \ - arg1_name, arg1_val, arg2_name, arg2_val) -#define TRACE_EVENT_COPY_FLOW_END0(category, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ - category, name, id, TRACE_EVENT_FLAG_COPY) -#define TRACE_EVENT_COPY_FLOW_END1(category, name, id, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ - category, name, id, TRACE_EVENT_FLAG_COPY, \ - arg1_name, arg1_val) -#define TRACE_EVENT_COPY_FLOW_END2(category, name, id, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ - category, name, id, TRACE_EVENT_FLAG_COPY, \ - arg1_name, arg1_val, arg2_name, arg2_val) - - -//////////////////////////////////////////////////////////////////////////////// -// Implementation specific tracing API definitions. - -// Get a pointer to the enabled state of the given trace category. Only -// long-lived literal strings should be given as the category name. The returned -// pointer can be held permanently in a local static for example. If the -// unsigned char is non-zero, tracing is enabled. If tracing is enabled, -// TRACE_EVENT_API_ADD_TRACE_EVENT can be called. It's OK if tracing is disabled -// between the load of the tracing state and the call to -// TRACE_EVENT_API_ADD_TRACE_EVENT, because this flag only provides an early out -// for best performance when tracing is disabled. -// const unsigned char* -// TRACE_EVENT_API_GET_CATEGORY_ENABLED(const char* category_name) -#define TRACE_EVENT_API_GET_CATEGORY_ENABLED \ - webrtc::EventTracer::GetCategoryEnabled - -// Add a trace event to the platform tracing system. -// void TRACE_EVENT_API_ADD_TRACE_EVENT( -// char phase, -// const unsigned char* category_enabled, -// const char* name, -// unsigned long long id, -// int num_args, -// const char** arg_names, -// const unsigned char* arg_types, -// const unsigned long long* arg_values, -// unsigned char flags) -#define TRACE_EVENT_API_ADD_TRACE_EVENT webrtc::EventTracer::AddTraceEvent - -//////////////////////////////////////////////////////////////////////////////// - -// Implementation detail: trace event macros create temporary variables -// to keep instrumentation overhead low. These macros give each temporary -// variable a unique name based on the line number to prevent name collissions. -#define INTERNAL_TRACE_EVENT_UID3(a,b) \ - trace_event_unique_##a##b -#define INTERNAL_TRACE_EVENT_UID2(a,b) \ - INTERNAL_TRACE_EVENT_UID3(a,b) -#define INTERNAL_TRACE_EVENT_UID(name_prefix) \ - INTERNAL_TRACE_EVENT_UID2(name_prefix, __LINE__) - -// Implementation detail: internal macro to create static category. -#define INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category) \ - static const unsigned char* INTERNAL_TRACE_EVENT_UID(catstatic) = 0; \ - if (!INTERNAL_TRACE_EVENT_UID(catstatic)) { \ - INTERNAL_TRACE_EVENT_UID(catstatic) = \ - TRACE_EVENT_API_GET_CATEGORY_ENABLED(category); \ - } - -// Implementation detail: internal macro to create static category and add -// event if the category is enabled. -#define INTERNAL_TRACE_EVENT_ADD(phase, category, name, flags, ...) \ - do { \ - INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category); \ - if (*INTERNAL_TRACE_EVENT_UID(catstatic)) { \ - webrtc::trace_event_internal::AddTraceEvent( \ - phase, INTERNAL_TRACE_EVENT_UID(catstatic), name, \ - webrtc::trace_event_internal::kNoEventId, flags, ##__VA_ARGS__); \ - } \ - } while (0) - -// Implementation detail: internal macro to create static category and add begin -// event if the category is enabled. Also adds the end event when the scope -// ends. -#define INTERNAL_TRACE_EVENT_ADD_SCOPED(category, name, ...) \ - INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category); \ - webrtc::trace_event_internal::TraceEndOnScopeClose \ - INTERNAL_TRACE_EVENT_UID(profileScope); \ - if (*INTERNAL_TRACE_EVENT_UID(catstatic)) { \ - webrtc::trace_event_internal::AddTraceEvent( \ - TRACE_EVENT_PHASE_BEGIN, \ - INTERNAL_TRACE_EVENT_UID(catstatic), \ - name, webrtc::trace_event_internal::kNoEventId, \ - TRACE_EVENT_FLAG_NONE, ##__VA_ARGS__); \ - INTERNAL_TRACE_EVENT_UID(profileScope).Initialize( \ - INTERNAL_TRACE_EVENT_UID(catstatic), name); \ - } - -// Implementation detail: internal macro to create static category and add -// event if the category is enabled. -#define INTERNAL_TRACE_EVENT_ADD_WITH_ID(phase, category, name, id, flags, \ - ...) \ - do { \ - INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category); \ - if (*INTERNAL_TRACE_EVENT_UID(catstatic)) { \ - unsigned char trace_event_flags = flags | TRACE_EVENT_FLAG_HAS_ID; \ - webrtc::trace_event_internal::TraceID trace_event_trace_id( \ - id, &trace_event_flags); \ - webrtc::trace_event_internal::AddTraceEvent( \ - phase, INTERNAL_TRACE_EVENT_UID(catstatic), \ - name, trace_event_trace_id.data(), trace_event_flags, \ - ##__VA_ARGS__); \ - } \ - } while (0) - -// Notes regarding the following definitions: -// New values can be added and propagated to third party libraries, but existing -// definitions must never be changed, because third party libraries may use old -// definitions. - -// Phase indicates the nature of an event entry. E.g. part of a begin/end pair. -#define TRACE_EVENT_PHASE_BEGIN ('B') -#define TRACE_EVENT_PHASE_END ('E') -#define TRACE_EVENT_PHASE_INSTANT ('I') -#define TRACE_EVENT_PHASE_ASYNC_BEGIN ('S') -#define TRACE_EVENT_PHASE_ASYNC_STEP ('T') -#define TRACE_EVENT_PHASE_ASYNC_END ('F') -#define TRACE_EVENT_PHASE_FLOW_BEGIN ('s') -#define TRACE_EVENT_PHASE_FLOW_STEP ('t') -#define TRACE_EVENT_PHASE_FLOW_END ('f') -#define TRACE_EVENT_PHASE_METADATA ('M') -#define TRACE_EVENT_PHASE_COUNTER ('C') - -// Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT. -#define TRACE_EVENT_FLAG_NONE (static_cast(0)) -#define TRACE_EVENT_FLAG_COPY (static_cast(1 << 0)) -#define TRACE_EVENT_FLAG_HAS_ID (static_cast(1 << 1)) -#define TRACE_EVENT_FLAG_MANGLE_ID (static_cast(1 << 2)) - -// Type values for identifying types in the TraceValue union. -#define TRACE_VALUE_TYPE_BOOL (static_cast(1)) -#define TRACE_VALUE_TYPE_UINT (static_cast(2)) -#define TRACE_VALUE_TYPE_INT (static_cast(3)) -#define TRACE_VALUE_TYPE_DOUBLE (static_cast(4)) -#define TRACE_VALUE_TYPE_POINTER (static_cast(5)) -#define TRACE_VALUE_TYPE_STRING (static_cast(6)) -#define TRACE_VALUE_TYPE_COPY_STRING (static_cast(7)) - -namespace webrtc { -namespace trace_event_internal { - -// Specify these values when the corresponding argument of AddTraceEvent is not -// used. -const int kZeroNumArgs = 0; -const unsigned long long kNoEventId = 0; - -// TraceID encapsulates an ID that can either be an integer or pointer. Pointers -// are mangled with the Process ID so that they are unlikely to collide when the -// same pointer is used on different processes. -class TraceID { - public: - class ForceMangle { - public: - explicit ForceMangle(unsigned long long id) : data_(id) {} - explicit ForceMangle(unsigned long id) : data_(id) {} - explicit ForceMangle(unsigned int id) : data_(id) {} - explicit ForceMangle(unsigned short id) : data_(id) {} - explicit ForceMangle(unsigned char id) : data_(id) {} - explicit ForceMangle(long long id) - : data_(static_cast(id)) {} - explicit ForceMangle(long id) - : data_(static_cast(id)) {} - explicit ForceMangle(int id) - : data_(static_cast(id)) {} - explicit ForceMangle(short id) - : data_(static_cast(id)) {} - explicit ForceMangle(signed char id) - : data_(static_cast(id)) {} - - unsigned long long data() const { return data_; } - - private: - unsigned long long data_; - }; - - explicit TraceID(const void* id, unsigned char* flags) - : data_(static_cast( - reinterpret_cast(id))) { - *flags |= TRACE_EVENT_FLAG_MANGLE_ID; - } - explicit TraceID(ForceMangle id, unsigned char* flags) : data_(id.data()) { - *flags |= TRACE_EVENT_FLAG_MANGLE_ID; - } - explicit TraceID(unsigned long long id, unsigned char* flags) - : data_(id) { (void)flags; } - explicit TraceID(unsigned long id, unsigned char* flags) - : data_(id) { (void)flags; } - explicit TraceID(unsigned int id, unsigned char* flags) - : data_(id) { (void)flags; } - explicit TraceID(unsigned short id, unsigned char* flags) - : data_(id) { (void)flags; } - explicit TraceID(unsigned char id, unsigned char* flags) - : data_(id) { (void)flags; } - explicit TraceID(long long id, unsigned char* flags) - : data_(static_cast(id)) { (void)flags; } - explicit TraceID(long id, unsigned char* flags) - : data_(static_cast(id)) { (void)flags; } - explicit TraceID(int id, unsigned char* flags) - : data_(static_cast(id)) { (void)flags; } - explicit TraceID(short id, unsigned char* flags) - : data_(static_cast(id)) { (void)flags; } - explicit TraceID(signed char id, unsigned char* flags) - : data_(static_cast(id)) { (void)flags; } - - unsigned long long data() const { return data_; } - - private: - unsigned long long data_; -}; - -// Simple union to store various types as unsigned long long. -union TraceValueUnion { - bool as_bool; - unsigned long long as_uint; - long long as_int; - double as_double; - const void* as_pointer; - const char* as_string; -}; - -// Simple container for const char* that should be copied instead of retained. -class TraceStringWithCopy { - public: - explicit TraceStringWithCopy(const char* str) : str_(str) {} - operator const char* () const { return str_; } - private: - const char* str_; -}; - -// Define SetTraceValue for each allowed type. It stores the type and -// value in the return arguments. This allows this API to avoid declaring any -// structures so that it is portable to third_party libraries. -#define INTERNAL_DECLARE_SET_TRACE_VALUE(actual_type, \ - union_member, \ - value_type_id) \ - static inline void SetTraceValue(actual_type arg, \ - unsigned char* type, \ - unsigned long long* value) { \ - TraceValueUnion type_value; \ - type_value.union_member = arg; \ - *type = value_type_id; \ - *value = type_value.as_uint; \ - } -// Simpler form for int types that can be safely casted. -#define INTERNAL_DECLARE_SET_TRACE_VALUE_INT(actual_type, \ - value_type_id) \ - static inline void SetTraceValue(actual_type arg, \ - unsigned char* type, \ - unsigned long long* value) { \ - *type = value_type_id; \ - *value = static_cast(arg); \ - } - -INTERNAL_DECLARE_SET_TRACE_VALUE_INT(unsigned long long, TRACE_VALUE_TYPE_UINT) -INTERNAL_DECLARE_SET_TRACE_VALUE_INT(unsigned long, TRACE_VALUE_TYPE_UINT) -INTERNAL_DECLARE_SET_TRACE_VALUE_INT(unsigned int, TRACE_VALUE_TYPE_UINT) -INTERNAL_DECLARE_SET_TRACE_VALUE_INT(unsigned short, TRACE_VALUE_TYPE_UINT) -INTERNAL_DECLARE_SET_TRACE_VALUE_INT(unsigned char, TRACE_VALUE_TYPE_UINT) -INTERNAL_DECLARE_SET_TRACE_VALUE_INT(long long, TRACE_VALUE_TYPE_INT) -INTERNAL_DECLARE_SET_TRACE_VALUE_INT(long, TRACE_VALUE_TYPE_INT) -INTERNAL_DECLARE_SET_TRACE_VALUE_INT(int, TRACE_VALUE_TYPE_INT) -INTERNAL_DECLARE_SET_TRACE_VALUE_INT(short, TRACE_VALUE_TYPE_INT) -INTERNAL_DECLARE_SET_TRACE_VALUE_INT(signed char, TRACE_VALUE_TYPE_INT) -INTERNAL_DECLARE_SET_TRACE_VALUE(bool, as_bool, TRACE_VALUE_TYPE_BOOL) -INTERNAL_DECLARE_SET_TRACE_VALUE(double, as_double, TRACE_VALUE_TYPE_DOUBLE) -INTERNAL_DECLARE_SET_TRACE_VALUE(const void*, as_pointer, - TRACE_VALUE_TYPE_POINTER) -INTERNAL_DECLARE_SET_TRACE_VALUE(const char*, as_string, - TRACE_VALUE_TYPE_STRING) -INTERNAL_DECLARE_SET_TRACE_VALUE(const TraceStringWithCopy&, as_string, - TRACE_VALUE_TYPE_COPY_STRING) - -#undef INTERNAL_DECLARE_SET_TRACE_VALUE -#undef INTERNAL_DECLARE_SET_TRACE_VALUE_INT - -// std::string version of SetTraceValue so that trace arguments can be strings. -static inline void SetTraceValue(const std::string& arg, - unsigned char* type, - unsigned long long* value) { - TraceValueUnion type_value; - type_value.as_string = arg.c_str(); - *type = TRACE_VALUE_TYPE_COPY_STRING; - *value = type_value.as_uint; -} - -// These AddTraceEvent template functions are defined here instead of in the -// macro, because the arg_values could be temporary objects, such as -// std::string. In order to store pointers to the internal c_str and pass -// through to the tracing API, the arg_values must live throughout -// these procedures. - -static inline void AddTraceEvent(char phase, - const unsigned char* category_enabled, - const char* name, - unsigned long long id, - unsigned char flags) { - TRACE_EVENT_API_ADD_TRACE_EVENT( - phase, category_enabled, name, id, - kZeroNumArgs, NULL, NULL, NULL, - flags); -} - -template -static inline void AddTraceEvent(char phase, - const unsigned char* category_enabled, - const char* name, - unsigned long long id, - unsigned char flags, - const char* arg1_name, - const ARG1_TYPE& arg1_val) { - const int num_args = 1; - unsigned char arg_types[1]; - unsigned long long arg_values[1]; - SetTraceValue(arg1_val, &arg_types[0], &arg_values[0]); - TRACE_EVENT_API_ADD_TRACE_EVENT( - phase, category_enabled, name, id, - num_args, &arg1_name, arg_types, arg_values, - flags); -} - -template -static inline void AddTraceEvent(char phase, - const unsigned char* category_enabled, - const char* name, - unsigned long long id, - unsigned char flags, - const char* arg1_name, - const ARG1_TYPE& arg1_val, - const char* arg2_name, - const ARG2_TYPE& arg2_val) { - const int num_args = 2; - const char* arg_names[2] = { arg1_name, arg2_name }; - unsigned char arg_types[2]; - unsigned long long arg_values[2]; - SetTraceValue(arg1_val, &arg_types[0], &arg_values[0]); - SetTraceValue(arg2_val, &arg_types[1], &arg_values[1]); - TRACE_EVENT_API_ADD_TRACE_EVENT( - phase, category_enabled, name, id, - num_args, arg_names, arg_types, arg_values, - flags); -} - -// Used by TRACE_EVENTx macro. Do not use directly. -class TraceEndOnScopeClose { - public: - // Note: members of data_ intentionally left uninitialized. See Initialize. - TraceEndOnScopeClose() : p_data_(NULL) {} - ~TraceEndOnScopeClose() { - if (p_data_) - AddEventIfEnabled(); - } - - void Initialize(const unsigned char* category_enabled, - const char* name) { - data_.category_enabled = category_enabled; - data_.name = name; - p_data_ = &data_; - } - - private: - // Add the end event if the category is still enabled. - void AddEventIfEnabled() { - // Only called when p_data_ is non-null. - if (*p_data_->category_enabled) { - TRACE_EVENT_API_ADD_TRACE_EVENT( - TRACE_EVENT_PHASE_END, - p_data_->category_enabled, - p_data_->name, kNoEventId, - kZeroNumArgs, NULL, NULL, NULL, - TRACE_EVENT_FLAG_NONE); - } - } - - // This Data struct workaround is to avoid initializing all the members - // in Data during construction of this object, since this object is always - // constructed, even when tracing is disabled. If the members of Data were - // members of this class instead, compiler warnings occur about potential - // uninitialized accesses. - struct Data { - const unsigned char* category_enabled; - const char* name; - }; - Data* p_data_; - Data data_; -}; - -} // namespace trace_event_internal -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_TRACE_EVENT_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/utf_util_win.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/utf_util_win.h deleted file mode 100755 index f88f079..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/interface/utf_util_win.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Conversion functions for UTF-8 and UTF-16 strings on Windows. -// Duplicated from talk/base/win32.h. -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_UTF_UTIL_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_UTF_UTIL_H_ - -#ifdef WIN32 -#include -#include - -#include "webrtc/system_wrappers/interface/scoped_ptr.h" - -namespace webrtc { - -inline std::wstring ToUtf16(const char* utf8, size_t len) { - int len16 = ::MultiByteToWideChar(CP_UTF8, 0, utf8, static_cast(len), - NULL, 0); - scoped_ptr ws(new wchar_t[len16]); - ::MultiByteToWideChar(CP_UTF8, 0, utf8, static_cast(len), ws.get(), - len16); - return std::wstring(ws.get(), len16); -} - -inline std::wstring ToUtf16(const std::string& str) { - return ToUtf16(str.data(), str.length()); -} - -inline std::string ToUtf8(const wchar_t* wide, size_t len) { - int len8 = ::WideCharToMultiByte(CP_UTF8, 0, wide, static_cast(len), - NULL, 0, NULL, NULL); - scoped_ptr ns(new char[len8]); - ::WideCharToMultiByte(CP_UTF8, 0, wide, static_cast(len), ns.get(), len8, - NULL, NULL); - return std::string(ns.get(), len8); -} - -inline std::string ToUtf8(const wchar_t* wide) { - return ToUtf8(wide, wcslen(wide)); -} - -inline std::string ToUtf8(const std::wstring& wstr) { - return ToUtf8(wstr.data(), wstr.length()); -} - -} // namespace webrtc - -#endif // WIN32 -#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_UTF_UTIL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/condition_variable_event_win.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/condition_variable_event_win.h deleted file mode 100755 index fce45d3..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/condition_variable_event_win.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_CONDITION_VARIABLE_EVENT_WIN_H_ -#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_CONDITION_VARIABLE_EVENT_WIN_H_ - -#include - -#include "webrtc/system_wrappers/interface/condition_variable_wrapper.h" - -namespace webrtc { - -class ConditionVariableEventWin : public ConditionVariableWrapper { - public: - ConditionVariableEventWin(); - virtual ~ConditionVariableEventWin(); - - void SleepCS(CriticalSectionWrapper& crit_sect); - bool SleepCS(CriticalSectionWrapper& crit_sect, unsigned long max_time_inMS); - void Wake(); - void WakeAll(); - - private: - enum EventWakeUpType { - WAKEALL_0 = 0, - WAKEALL_1 = 1, - WAKE = 2, - EVENT_COUNT = 3 - }; - - unsigned int num_waiters_[2]; - EventWakeUpType eventID_; - CRITICAL_SECTION num_waiters_crit_sect_; - HANDLE events_[EVENT_COUNT]; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_CONDITION_VARIABLE_EVENT_WIN_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/condition_variable_native_win.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/condition_variable_native_win.h deleted file mode 100755 index 1fbce37..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/condition_variable_native_win.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_CONDITION_VARIABLE_NATIVE_WIN_H_ -#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_CONDITION_VARIABLE_NATIVE_WIN_H_ - -#include - -#include "webrtc/system_wrappers/interface/condition_variable_wrapper.h" - -namespace webrtc { - -#if !defined CONDITION_VARIABLE_INIT -typedef struct RTL_CONDITION_VARIABLE_ { - void* Ptr; -} RTL_CONDITION_VARIABLE, *PRTL_CONDITION_VARIABLE; - -typedef RTL_CONDITION_VARIABLE CONDITION_VARIABLE, *PCONDITION_VARIABLE; -#endif - -typedef void (WINAPI* PInitializeConditionVariable)(PCONDITION_VARIABLE); -typedef BOOL (WINAPI* PSleepConditionVariableCS)(PCONDITION_VARIABLE, - PCRITICAL_SECTION, DWORD); -typedef void (WINAPI* PWakeConditionVariable)(PCONDITION_VARIABLE); -typedef void (WINAPI* PWakeAllConditionVariable)(PCONDITION_VARIABLE); - -class ConditionVariableNativeWin : public ConditionVariableWrapper { - public: - static ConditionVariableWrapper* Create(); - virtual ~ConditionVariableNativeWin(); - - void SleepCS(CriticalSectionWrapper& crit_sect); - bool SleepCS(CriticalSectionWrapper& crit_sect, unsigned long max_time_inMS); - void Wake(); - void WakeAll(); - - private: - ConditionVariableNativeWin(); - - bool Init(); - - CONDITION_VARIABLE condition_variable_; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_CONDITION_VARIABLE_NATIVE_WIN_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/condition_variable_posix.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/condition_variable_posix.h deleted file mode 100755 index a014a3b..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/condition_variable_posix.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_CONDITION_VARIABLE_POSIX_H_ -#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_CONDITION_VARIABLE_POSIX_H_ - -#include - -#include "webrtc/system_wrappers/interface/condition_variable_wrapper.h" -#include "webrtc/typedefs.h" - -namespace webrtc { - -class ConditionVariablePosix : public ConditionVariableWrapper { - public: - static ConditionVariableWrapper* Create(); - virtual ~ConditionVariablePosix(); - - virtual void SleepCS(CriticalSectionWrapper& crit_sect) OVERRIDE; - virtual bool SleepCS(CriticalSectionWrapper& crit_sect, - unsigned long max_time_in_ms) OVERRIDE; - virtual void Wake() OVERRIDE; - virtual void WakeAll() OVERRIDE; - - private: - ConditionVariablePosix(); - int Construct(); - - private: - pthread_cond_t cond_; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_CONDITION_VARIABLE_POSIX_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/critical_section_posix.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/critical_section_posix.h deleted file mode 100755 index a5ec367..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/critical_section_posix.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_CRITICAL_SECTION_POSIX_H_ -#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_CRITICAL_SECTION_POSIX_H_ - -#include "webrtc/system_wrappers/interface/critical_section_wrapper.h" - -#include - -namespace webrtc { - -class CriticalSectionPosix : public CriticalSectionWrapper { - public: - CriticalSectionPosix(); - - virtual ~CriticalSectionPosix(); - - virtual void Enter() OVERRIDE; - virtual void Leave() OVERRIDE; - - private: - pthread_mutex_t mutex_; - friend class ConditionVariablePosix; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_CRITICAL_SECTION_POSIX_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/critical_section_win.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/critical_section_win.h deleted file mode 100755 index be237ac..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/critical_section_win.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_CRITICAL_SECTION_WIN_H_ -#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_CRITICAL_SECTION_WIN_H_ - -#include -#include "webrtc/system_wrappers/interface/critical_section_wrapper.h" -#include "webrtc/typedefs.h" - -namespace webrtc { - -class CriticalSectionWindows : public CriticalSectionWrapper { - public: - CriticalSectionWindows(); - - virtual ~CriticalSectionWindows(); - - virtual void Enter(); - virtual void Leave(); - - private: - CRITICAL_SECTION crit; - - friend class ConditionVariableEventWin; - friend class ConditionVariableNativeWin; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_CRITICAL_SECTION_WIN_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/data_log_c_helpers_unittest.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/data_log_c_helpers_unittest.h deleted file mode 100755 index ef86eae..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/data_log_c_helpers_unittest.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef SRC_SYSTEM_WRAPPERS_SOURCE_DATA_LOG_C_HELPERS_UNITTEST_H_ -#define SRC_SYSTEM_WRAPPERS_SOURCE_DATA_LOG_C_HELPERS_UNITTEST_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -int WebRtcDataLogCHelper_TestCreateLog(); - -int WebRtcDataLogCHelper_TestReturnLog(); - -int WebRtcDataLogCHelper_TestCombine(); - -int WebRtcDataLogCHelper_TestAddTable(); - -int WebRtcDataLogCHelper_TestAddColumn(); - -int WebRtcDataLogCHelper_TestNextRow(); - -int WebRtcDataLogCHelper_TestInsertCell_int(); - -int WebRtcDataLogCHelper_TestInsertArray_int(); - -int WebRtcDataLogCHelper_TestInsertCell_float(); - -int WebRtcDataLogCHelper_TestInsertArray_float(); - -int WebRtcDataLogCHelper_TestInsertCell_double(); - -int WebRtcDataLogCHelper_TestInsertArray_double(); - -int WebRtcDataLogCHelper_TestInsertCell_int32(); - -int WebRtcDataLogCHelper_TestInsertArray_int32(); - -int WebRtcDataLogCHelper_TestInsertCell_uint32(); - -int WebRtcDataLogCHelper_TestInsertArray_uint32(); - -int WebRtcDataLogCHelper_TestInsertCell_int64(); - -int WebRtcDataLogCHelper_TestInsertArray_int64(); - -#ifdef __cplusplus -} // end of extern "C" -#endif - -#endif // SRC_SYSTEM_WRAPPERS_SOURCE_DATA_LOG_C_HELPERS_UNITTEST_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/event_posix.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/event_posix.h deleted file mode 100755 index 5fbe061..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/event_posix.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_EVENT_POSIX_H_ -#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_EVENT_POSIX_H_ - -#include "webrtc/system_wrappers/interface/event_wrapper.h" - -#include -#include - -#include "webrtc/system_wrappers/interface/thread_wrapper.h" - -namespace webrtc { - -enum State { - kUp = 1, - kDown = 2 -}; - -class EventPosix : public EventWrapper { - public: - static EventWrapper* Create(); - - virtual ~EventPosix(); - - virtual EventTypeWrapper Wait(unsigned long max_time) OVERRIDE; - virtual bool Set() OVERRIDE; - virtual bool Reset() OVERRIDE; - - virtual bool StartTimer(bool periodic, unsigned long time) OVERRIDE; - virtual bool StopTimer() OVERRIDE; - - private: - EventPosix(); - int Construct(); - - static bool Run(ThreadObj obj); - bool Process(); - EventTypeWrapper Wait(timespec& wake_at); - - private: - pthread_cond_t cond_; - pthread_mutex_t mutex_; - - ThreadWrapper* timer_thread_; - EventPosix* timer_event_; - timespec created_at_; - - bool periodic_; - unsigned long time_; // In ms - unsigned long count_; - State state_; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_EVENT_POSIX_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/event_win.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/event_win.h deleted file mode 100755 index 55ed8eb..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/event_win.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_EVENT_WIN_H_ -#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_EVENT_WIN_H_ - -#include - -#include "webrtc/system_wrappers/interface/event_wrapper.h" - -#include "webrtc/typedefs.h" - -namespace webrtc { - -class EventWindows : public EventWrapper { - public: - EventWindows(); - virtual ~EventWindows(); - - virtual EventTypeWrapper Wait(unsigned long max_time); - virtual bool Set(); - virtual bool Reset(); - - virtual bool StartTimer(bool periodic, unsigned long time); - virtual bool StopTimer(); - - private: - HANDLE event_; - uint32_t timerID_; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_EVENT_WIN_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/file_impl.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/file_impl.h deleted file mode 100755 index 1abf010..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/file_impl.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_FILE_IMPL_H_ -#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_FILE_IMPL_H_ - -#include - -#include "webrtc/system_wrappers/interface/file_wrapper.h" -#include "webrtc/system_wrappers/interface/scoped_ptr.h" - -namespace webrtc { - -class RWLockWrapper; - -class FileWrapperImpl : public FileWrapper { - public: - FileWrapperImpl(); - virtual ~FileWrapperImpl(); - - virtual int FileName(char* file_name_utf8, - size_t size) const OVERRIDE; - - virtual bool Open() const OVERRIDE; - - virtual int OpenFile(const char* file_name_utf8, - bool read_only, - bool loop = false, - bool text = false) OVERRIDE; - - virtual int OpenFromFileHandle(FILE* handle, - bool manage_file, - bool read_only, - bool loop = false) OVERRIDE; - - virtual int CloseFile() OVERRIDE; - virtual int SetMaxFileSize(size_t bytes) OVERRIDE; - virtual int Flush() OVERRIDE; - - virtual int Read(void* buf, int length) OVERRIDE; - virtual bool Write(const void* buf, int length) OVERRIDE; - virtual int WriteText(const char* format, ...) OVERRIDE; - virtual int Rewind() OVERRIDE; - - private: - int CloseFileImpl(); - int FlushImpl(); - - scoped_ptr rw_lock_; - - FILE* id_; - bool managed_file_handle_; - bool open_; - bool looping_; - bool read_only_; - size_t max_size_in_bytes_; // -1 indicates file size limitation is off - size_t size_in_bytes_; - char file_name_utf8_[kMaxFileNameSize]; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_FILE_IMPL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/move.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/move.h deleted file mode 100755 index 2e93641..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/move.h +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// Borrowed from Chromium's src/base/move.h. - -#ifndef WEBRTC_SYSTEM_WRAPPERS_INTEFACE_MOVE_H_ -#define WEBRTC_SYSTEM_WRAPPERS_INTEFACE_MOVE_H_ - -// Macro with the boilerplate that makes a type move-only in C++03. -// -// USAGE -// -// This macro should be used instead of DISALLOW_COPY_AND_ASSIGN to create -// a "move-only" type. Unlike DISALLOW_COPY_AND_ASSIGN, this macro should be -// the first line in a class declaration. -// -// A class using this macro must call .Pass() (or somehow be an r-value already) -// before it can be: -// -// * Passed as a function argument -// * Used as the right-hand side of an assignment -// * Returned from a function -// -// Each class will still need to define their own "move constructor" and "move -// operator=" to make this useful. Here's an example of the macro, the move -// constructor, and the move operator= from the scoped_ptr class: -// -// template -// class scoped_ptr { -// MOVE_ONLY_TYPE_FOR_CPP_03(scoped_ptr, RValue) -// public: -// scoped_ptr(RValue& other) : ptr_(other.release()) { } -// scoped_ptr& operator=(RValue& other) { -// swap(other); -// return *this; -// } -// }; -// -// Note that the constructor must NOT be marked explicit. -// -// For consistency, the second parameter to the macro should always be RValue -// unless you have a strong reason to do otherwise. It is only exposed as a -// macro parameter so that the move constructor and move operator= don't look -// like they're using a phantom type. -// -// -// HOW THIS WORKS -// -// For a thorough explanation of this technique, see: -// -// http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Move_Constructor -// -// The summary is that we take advantage of 2 properties: -// -// 1) non-const references will not bind to r-values. -// 2) C++ can apply one user-defined conversion when initializing a -// variable. -// -// The first lets us disable the copy constructor and assignment operator -// by declaring private version of them with a non-const reference parameter. -// -// For l-values, direct initialization still fails like in -// DISALLOW_COPY_AND_ASSIGN because the copy constructor and assignment -// operators are private. -// -// For r-values, the situation is different. The copy constructor and -// assignment operator are not viable due to (1), so we are trying to call -// a non-existent constructor and non-existing operator= rather than a private -// one. Since we have not committed an error quite yet, we can provide an -// alternate conversion sequence and a constructor. We add -// -// * a private struct named "RValue" -// * a user-defined conversion "operator RValue()" -// * a "move constructor" and "move operator=" that take the RValue& as -// their sole parameter. -// -// Only r-values will trigger this sequence and execute our "move constructor" -// or "move operator=." L-values will match the private copy constructor and -// operator= first giving a "private in this context" error. This combination -// gives us a move-only type. -// -// For signaling a destructive transfer of data from an l-value, we provide a -// method named Pass() which creates an r-value for the current instance -// triggering the move constructor or move operator=. -// -// Other ways to get r-values is to use the result of an expression like a -// function call. -// -// Here's an example with comments explaining what gets triggered where: -// -// class Foo { -// MOVE_ONLY_TYPE_FOR_CPP_03(Foo, RValue); -// -// public: -// ... API ... -// Foo(RValue other); // Move constructor. -// Foo& operator=(RValue rhs); // Move operator= -// }; -// -// Foo MakeFoo(); // Function that returns a Foo. -// -// Foo f; -// Foo f_copy(f); // ERROR: Foo(Foo&) is private in this context. -// Foo f_assign; -// f_assign = f; // ERROR: operator=(Foo&) is private in this context. -// -// -// Foo f(MakeFoo()); // R-value so alternate conversion executed. -// Foo f_copy(f.Pass()); // R-value so alternate conversion executed. -// f = f_copy.Pass(); // R-value so alternate conversion executed. -// -// -// IMPLEMENTATION SUBTLETIES WITH RValue -// -// The RValue struct is just a container for a pointer back to the original -// object. It should only ever be created as a temporary, and no external -// class should ever declare it or use it in a parameter. -// -// It is tempting to want to use the RValue type in function parameters, but -// excluding the limited usage here for the move constructor and move -// operator=, doing so would mean that the function could take both r-values -// and l-values equially which is unexpected. See COMPARED To Boost.Move for -// more details. -// -// An alternate, and incorrect, implementation of the RValue class used by -// Boost.Move makes RValue a fieldless child of the move-only type. RValue& -// is then used in place of RValue in the various operators. The RValue& is -// "created" by doing *reinterpret_cast(this). This has the appeal -// of never creating a temporary RValue struct even with optimizations -// disabled. Also, by virtue of inheritance you can treat the RValue -// reference as if it were the move-only type itself. Unfortunately, -// using the result of this reinterpret_cast<> is actually undefined behavior -// due to C++98 5.2.10.7. In certain compilers (e.g., NaCl) the optimizer -// will generate non-working code. -// -// In optimized builds, both implementations generate the same assembly so we -// choose the one that adheres to the standard. -// -// -// WHY HAVE typedef void MoveOnlyTypeForCPP03 -// -// Callback<>/Bind() needs to understand movable-but-not-copyable semantics -// to call .Pass() appropriately when it is expected to transfer the value. -// The cryptic typedef MoveOnlyTypeForCPP03 is added to make this check -// easy and automatic in helper templates for Callback<>/Bind(). -// See IsMoveOnlyType template and its usage in base/callback_internal.h -// for more details. -// -// -// COMPARED TO C++11 -// -// In C++11, you would implement this functionality using an r-value reference -// and our .Pass() method would be replaced with a call to std::move(). -// -// This emulation also has a deficiency where it uses up the single -// user-defined conversion allowed by C++ during initialization. This can -// cause problems in some API edge cases. For instance, in scoped_ptr, it is -// impossible to make a function "void Foo(scoped_ptr p)" accept a -// value of type scoped_ptr even if you add a constructor to -// scoped_ptr<> that would make it look like it should work. C++11 does not -// have this deficiency. -// -// -// COMPARED TO Boost.Move -// -// Our implementation similar to Boost.Move, but we keep the RValue struct -// private to the move-only type, and we don't use the reinterpret_cast<> hack. -// -// In Boost.Move, RValue is the boost::rv<> template. This type can be used -// when writing APIs like: -// -// void MyFunc(boost::rv& f) -// -// that can take advantage of rv<> to avoid extra copies of a type. However you -// would still be able to call this version of MyFunc with an l-value: -// -// Foo f; -// MyFunc(f); // Uh oh, we probably just destroyed |f| w/o calling Pass(). -// -// unless someone is very careful to also declare a parallel override like: -// -// void MyFunc(const Foo& f) -// -// that would catch the l-values first. This was declared unsafe in C++11 and -// a C++11 compiler will explicitly fail MyFunc(f). Unfortunately, we cannot -// ensure this in C++03. -// -// Since we have no need for writing such APIs yet, our implementation keeps -// RValue private and uses a .Pass() method to do the conversion instead of -// trying to write a version of "std::move()." Writing an API like std::move() -// would require the RValue struct to be public. -// -// -// CAVEATS -// -// If you include a move-only type as a field inside a class that does not -// explicitly declare a copy constructor, the containing class's implicit -// copy constructor will change from Containing(const Containing&) to -// Containing(Containing&). This can cause some unexpected errors. -// -// http://llvm.org/bugs/show_bug.cgi?id=11528 -// -// The workaround is to explicitly declare your copy constructor. -// -#define WEBRTC_MOVE_ONLY_TYPE_FOR_CPP_03(type, rvalue_type) \ - private: \ - struct rvalue_type { \ - explicit rvalue_type(type* object) : object(object) {} \ - type* object; \ - }; \ - type(type&); \ - void operator=(type&); \ - public: \ - operator rvalue_type() { return rvalue_type(this); } \ - type Pass() { return type(rvalue_type(this)); } \ - typedef void MoveOnlyTypeForCPP03; \ - private: - -#endif // WEBRTC_SYSTEM_WRAPPERS_INTEFACE_MOVE_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/rw_lock_generic.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/rw_lock_generic.h deleted file mode 100755 index dd69f52..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/rw_lock_generic.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_RW_LOCK_GENERIC_H_ -#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_RW_LOCK_GENERIC_H_ - -#include "webrtc/system_wrappers/interface/rw_lock_wrapper.h" -#include "webrtc/typedefs.h" - -namespace webrtc { - -class CriticalSectionWrapper; -class ConditionVariableWrapper; - -class RWLockGeneric : public RWLockWrapper { - public: - RWLockGeneric(); - virtual ~RWLockGeneric(); - - virtual void AcquireLockExclusive() OVERRIDE; - virtual void ReleaseLockExclusive() OVERRIDE; - - virtual void AcquireLockShared() OVERRIDE; - virtual void ReleaseLockShared() OVERRIDE; - - private: - CriticalSectionWrapper* critical_section_; - ConditionVariableWrapper* read_condition_; - ConditionVariableWrapper* write_condition_; - - int readers_active_; - bool writer_active_; - int readers_waiting_; - int writers_waiting_; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_RW_LOCK_GENERIC_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/rw_lock_posix.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/rw_lock_posix.h deleted file mode 100755 index 6ce2b2d..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/rw_lock_posix.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_RW_LOCK_POSIX_H_ -#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_RW_LOCK_POSIX_H_ - -#include "webrtc/system_wrappers/interface/rw_lock_wrapper.h" -#include "webrtc/typedefs.h" - -#include - -namespace webrtc { - -class RWLockPosix : public RWLockWrapper { - public: - static RWLockPosix* Create(); - virtual ~RWLockPosix(); - - virtual void AcquireLockExclusive() OVERRIDE; - virtual void ReleaseLockExclusive() OVERRIDE; - - virtual void AcquireLockShared() OVERRIDE; - virtual void ReleaseLockShared() OVERRIDE; - - private: - RWLockPosix(); - bool Init(); - - pthread_rwlock_t lock_; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_RW_LOCK_POSIX_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/rw_lock_win.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/rw_lock_win.h deleted file mode 100755 index 6f7cd33..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/rw_lock_win.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_RW_LOCK_WIN_H_ -#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_RW_LOCK_WIN_H_ - -#include "webrtc/system_wrappers/interface/rw_lock_wrapper.h" - -#include - -namespace webrtc { - -class RWLockWin : public RWLockWrapper { - public: - static RWLockWin* Create(); - ~RWLockWin() {} - - virtual void AcquireLockExclusive(); - virtual void ReleaseLockExclusive(); - - virtual void AcquireLockShared(); - virtual void ReleaseLockShared(); - - private: - RWLockWin(); - static bool LoadModule(); - - SRWLOCK lock_; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_RW_LOCK_WIN_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/set_thread_name_win.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/set_thread_name_win.h deleted file mode 100755 index cca126f..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/set_thread_name_win.h +++ /dev/null @@ -1,108 +0,0 @@ -/* -Source: -http://msdn.microsoft.com/en-us/cc300389.aspx#P - -License: -This license governs use of code marked as “sample” or “example” available on -this web site without a license agreement, as provided under the section above -titled “NOTICE SPECIFIC TO SOFTWARE AVAILABLE ON THIS WEB SITE.” If you use -such code (the “software”), you accept this license. If you do not accept the -license, do not use the software. - -1. Definitions - -The terms “reproduce,” “reproduction,” “derivative works,” and “distribution” -have the same meaning here as under U.S. copyright law. - -A “contribution” is the original software, or any additions or changes to the -software. - -A “contributor” is any person that distributes its contribution under this -license. - -“Licensed patents” are a contributor’s patent claims that read directly on its -contribution. - -2. Grant of Rights - -(A) Copyright Grant - Subject to the terms of this license, including the -license conditions and limitations in section 3, each contributor grants you a -non-exclusive, worldwide, royalty-free copyright license to reproduce its -contribution, prepare derivative works of its contribution, and distribute its -contribution or any derivative works that you create. - -(B) Patent Grant - Subject to the terms of this license, including the license -conditions and limitations in section 3, each contributor grants you a -non-exclusive, worldwide, royalty-free license under its licensed patents to -make, have made, use, sell, offer for sale, import, and/or otherwise dispose -of its contribution in the software or derivative works of the contribution in -the software. - -3. Conditions and Limitations - -(A) No Trademark License- This license does not grant you rights to use any -contributors’ name, logo, or trademarks. - -(B) If you bring a patent claim against any contributor over patents that you -claim are infringed by the software, your patent license from such contributor -to the software ends automatically. - -(C) If you distribute any portion of the software, you must retain all -copyright, patent, trademark, and attribution notices that are present in the -software. - -(D) If you distribute any portion of the software in source code form, you may -do so only under this license by including a complete copy of this license -with your distribution. If you distribute any portion of the software in -compiled or object code form, you may only do so under a license that complies -with this license. - -(E) The software is licensed “as-is.” You bear the risk of using it. The -contributors give no express warranties, guarantees or conditions. You may -have additional consumer rights under your local laws which this license -cannot change. To the extent permitted under your local laws, the contributors -exclude the implied warranties of merchantability, fitness for a particular -purpose and non-infringement. - -(F) Platform Limitation - The licenses granted in sections 2(A) and 2(B) -extend only to the software or derivative works that you create that run on a -Microsoft Windows operating system product. -*/ - -/* - * The original code can be found here: - * http://msdn.microsoft.com/en-us/library/xcb2z8hs(VS.71).aspx - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_THREAD_WINDOWS_SET_NAME_H_ -#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_THREAD_WINDOWS_SET_NAME_H_ - -namespace webrtc { - -struct THREADNAME_INFO -{ - DWORD dwType; // must be 0x1000 - LPCSTR szName; // pointer to name (in user addr space) - DWORD dwThreadID; // thread ID (-1 = caller thread) - DWORD dwFlags; // reserved for future use, must be zero -}; - -void SetThreadName(DWORD dwThreadID, LPCSTR szThreadName) -{ - THREADNAME_INFO info; - info.dwType = 0x1000; - info.szName = szThreadName; - info.dwThreadID = dwThreadID; - info.dwFlags = 0; - - __try - { - RaiseException(0x406D1388, 0, sizeof(info) / sizeof(DWORD), - (ULONG_PTR*)&info); - } - __except (EXCEPTION_CONTINUE_EXECUTION) - { - } -} -} // namespace webrtc -#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_THREAD_WINDOWS_SET_NAME_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/thread_posix.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/thread_posix.h deleted file mode 100755 index c2025fd..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/thread_posix.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_THREAD_POSIX_H_ -#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_THREAD_POSIX_H_ - -#include "webrtc/system_wrappers/interface/thread_wrapper.h" - -#include - -namespace webrtc { - -class CriticalSectionWrapper; -class EventWrapper; - -int ConvertToSystemPriority(ThreadPriority priority, int min_prio, - int max_prio); - -class ThreadPosix : public ThreadWrapper { - public: - static ThreadWrapper* Create(ThreadRunFunction func, ThreadObj obj, - ThreadPriority prio, const char* thread_name); - - ThreadPosix(ThreadRunFunction func, ThreadObj obj, ThreadPriority prio, - const char* thread_name); - virtual ~ThreadPosix(); - - // From ThreadWrapper. - virtual void SetNotAlive() OVERRIDE; - virtual bool Start(unsigned int& id) OVERRIDE; - // Not implemented on Mac. - virtual bool SetAffinity(const int* processor_numbers, - unsigned int amount_of_processors) OVERRIDE; - virtual bool Stop() OVERRIDE; - - void Run(); - - private: - int Construct(); - - private: - ThreadRunFunction run_function_; - ThreadObj obj_; - - // Internal state. - CriticalSectionWrapper* crit_state_; // Protects alive_ and dead_ - bool alive_; - bool dead_; - ThreadPriority prio_; - EventWrapper* event_; - - // Zero-terminated thread name string. - char name_[kThreadMaxNameLength]; - bool set_thread_name_; - - // Handle to thread. -#if (defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID)) - pid_t pid_; -#endif - pthread_attr_t attr_; - pthread_t thread_; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_THREAD_POSIX_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/thread_win.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/thread_win.h deleted file mode 100755 index 1122676..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/thread_win.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_THREAD_WIN_H_ -#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_THREAD_WIN_H_ - -#include "webrtc/system_wrappers/interface/thread_wrapper.h" - -#include - -#include "webrtc/system_wrappers/interface/critical_section_wrapper.h" -#include "webrtc/system_wrappers/interface/event_wrapper.h" - -namespace webrtc { - -class ThreadWindows : public ThreadWrapper { - public: - ThreadWindows(ThreadRunFunction func, ThreadObj obj, ThreadPriority prio, - const char* thread_name); - virtual ~ThreadWindows(); - - virtual bool Start(unsigned int& id); - bool SetAffinity(const int* processor_numbers, - const unsigned int amount_of_processors); - virtual bool Stop(); - virtual void SetNotAlive(); - - static unsigned int WINAPI StartThread(LPVOID lp_parameter); - - protected: - virtual void Run(); - - private: - ThreadRunFunction run_function_; - ThreadObj obj_; - - bool alive_; - bool dead_; - - // TODO(hellner) - // do_not_close_handle_ member seem pretty redundant. Should be able to remove - // it. Basically it should be fine to reclaim the handle when calling stop - // and in the destructor. - bool do_not_close_handle_; - ThreadPriority prio_; - EventWrapper* event_; - CriticalSectionWrapper* critsect_stop_; - - HANDLE thread_; - unsigned int id_; - char name_[kThreadMaxNameLength]; - bool set_thread_name_; - -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_THREAD_WIN_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/trace_impl.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/trace_impl.h deleted file mode 100755 index 9e6e0a2..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/trace_impl.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_TRACE_IMPL_H_ -#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_TRACE_IMPL_H_ - -#include "webrtc/system_wrappers/interface/critical_section_wrapper.h" -#include "webrtc/system_wrappers/interface/event_wrapper.h" -#include "webrtc/system_wrappers/interface/file_wrapper.h" -#include "webrtc/system_wrappers/interface/static_instance.h" -#include "webrtc/system_wrappers/interface/thread_wrapper.h" -#include "webrtc/system_wrappers/interface/trace.h" - -namespace webrtc { - -// TODO(pwestin) WEBRTC_TRACE_MAX_QUEUE needs to be tweaked -// TODO(hellner) the buffer should be close to how much the system can write to -// file. Increasing the buffer will not solve anything. Sooner or -// later the buffer is going to fill up anyways. -#if defined(WEBRTC_IOS) -#define WEBRTC_TRACE_MAX_QUEUE 2000 -#else -#define WEBRTC_TRACE_MAX_QUEUE 8000 -#endif -#define WEBRTC_TRACE_NUM_ARRAY 2 -#define WEBRTC_TRACE_MAX_MESSAGE_SIZE 256 -// Total buffer size is WEBRTC_TRACE_NUM_ARRAY (number of buffer partitions) * -// WEBRTC_TRACE_MAX_QUEUE (number of lines per buffer partition) * -// WEBRTC_TRACE_MAX_MESSAGE_SIZE (number of 1 byte charachters per line) = -// 1 or 4 Mbyte. - -#define WEBRTC_TRACE_MAX_FILE_SIZE 100*1000 -// Number of rows that may be written to file. On average 110 bytes per row (max -// 256 bytes per row). So on average 110*100*1000 = 11 Mbyte, max 256*100*1000 = -// 25.6 Mbyte - -class TraceImpl : public Trace { - public: - virtual ~TraceImpl(); - - static TraceImpl* CreateInstance(); - static TraceImpl* GetTrace(const TraceLevel level = kTraceAll); - - int32_t SetTraceFileImpl(const char* file_name, const bool add_file_counter); - int32_t TraceFileImpl(char file_name[FileWrapper::kMaxFileNameSize]); - - int32_t SetTraceCallbackImpl(TraceCallback* callback); - - void AddImpl(const TraceLevel level, const TraceModule module, - const int32_t id, const char* msg); - - bool StopThread(); - - bool TraceCheck(const TraceLevel level) const; - - protected: - TraceImpl(); - - static TraceImpl* StaticInstance(CountOperation count_operation, - const TraceLevel level = kTraceAll); - - int32_t AddThreadId(char* trace_message) const; - - // OS specific implementations. - virtual int32_t AddTime(char* trace_message, - const TraceLevel level) const = 0; - - virtual int32_t AddBuildInfo(char* trace_message) const = 0; - virtual int32_t AddDateTimeInfo(char* trace_message) const = 0; - - static bool Run(void* obj); - bool Process(); - - private: - friend class Trace; - - int32_t AddLevel(char* sz_message, const TraceLevel level) const; - - int32_t AddModuleAndId(char* trace_message, const TraceModule module, - const int32_t id) const; - - int32_t AddMessage(char* trace_message, - const char msg[WEBRTC_TRACE_MAX_MESSAGE_SIZE], - const uint16_t written_so_far) const; - - void AddMessageToList( - const char trace_message[WEBRTC_TRACE_MAX_MESSAGE_SIZE], - const uint16_t length, - const TraceLevel level); - - bool UpdateFileName( - const char file_name_utf8[FileWrapper::kMaxFileNameSize], - char file_name_with_counter_utf8[FileWrapper::kMaxFileNameSize], - const uint32_t new_count) const; - - bool CreateFileName( - const char file_name_utf8[FileWrapper::kMaxFileNameSize], - char file_name_with_counter_utf8[FileWrapper::kMaxFileNameSize], - const uint32_t new_count) const; - - void WriteToFile(); - - CriticalSectionWrapper* critsect_interface_; - TraceCallback* callback_; - uint32_t row_count_text_; - uint32_t file_count_text_; - - FileWrapper& trace_file_; - ThreadWrapper& thread_; - EventWrapper& event_; - - // critsect_array_ protects active_queue_. - CriticalSectionWrapper* critsect_array_; - uint16_t next_free_idx_[WEBRTC_TRACE_NUM_ARRAY]; - TraceLevel level_[WEBRTC_TRACE_NUM_ARRAY][WEBRTC_TRACE_MAX_QUEUE]; - uint16_t length_[WEBRTC_TRACE_NUM_ARRAY][WEBRTC_TRACE_MAX_QUEUE]; - char* message_queue_[WEBRTC_TRACE_NUM_ARRAY][WEBRTC_TRACE_MAX_QUEUE]; - uint8_t active_queue_; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_TRACE_IMPL_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/trace_posix.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/trace_posix.h deleted file mode 100755 index 2056c70..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/trace_posix.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_TRACE_POSIX_H_ -#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_TRACE_POSIX_H_ - -#include "webrtc/system_wrappers/interface/critical_section_wrapper.h" -#include "webrtc/system_wrappers/source/trace_impl.h" - -namespace webrtc { - -class TracePosix : public TraceImpl { - public: - TracePosix(); - virtual ~TracePosix(); - - // This method can be called on several different threads different from - // the creating thread. - virtual int32_t AddTime(char* trace_message, const TraceLevel level) const - OVERRIDE; - - virtual int32_t AddBuildInfo(char* trace_message) const OVERRIDE; - virtual int32_t AddDateTimeInfo(char* trace_message) const OVERRIDE; - - private: - volatile mutable uint32_t prev_api_tick_count_; - volatile mutable uint32_t prev_tick_count_; - - CriticalSectionWrapper& crit_sect_; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_TRACE_POSIX_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/trace_win.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/trace_win.h deleted file mode 100755 index 1a87107..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/trace_win.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_TRACE_WIN_H_ -#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_TRACE_WIN_H_ - -#include -#include - -#include "webrtc/system_wrappers/source/trace_impl.h" - -namespace webrtc { - -class TraceWindows : public TraceImpl { - public: - TraceWindows(); - virtual ~TraceWindows(); - - virtual int32_t AddTime(char* trace_message, const TraceLevel level) const; - - virtual int32_t AddBuildInfo(char* trace_message) const; - virtual int32_t AddDateTimeInfo(char* trace_message) const; - private: - volatile mutable uint32_t prev_api_tick_count_; - volatile mutable uint32_t prev_tick_count_; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_TRACE_WIN_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/unittest_utilities.h b/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/unittest_utilities.h deleted file mode 100755 index b32308e..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/system_wrappers/source/unittest_utilities.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_UNITTEST_UTILITIES_H_ -#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_UNITTEST_UTILITIES_H_ - -// This file contains utilities that make it simpler to write unittests -// that are appropriate for the system_wrappers classes. - -#include -#include - -#include "webrtc/system_wrappers/interface/trace.h" - -namespace webrtc { - -class TestTraceCallback : public TraceCallback { - public: - virtual void Print(TraceLevel level, const char* msg, int length) { - if (msg) { - char* cmd_print = new char[length+1]; - memcpy(cmd_print, msg, length); - cmd_print[length] = '\0'; - printf("%s\n", cmd_print); - fflush(stdout); - delete[] cmd_print; - } - } -}; - -// A class that turns on tracing to stdout at the beginning of the test, -// and turns it off once the test is finished. -// Intended usage: -// class SomeTest : public ::testing::Test { -// protected: -// SomeTest() -// : trace_(false) {} // Change to true to turn on tracing. -// private: -// ScopedTracing trace_; -// } -class ScopedTracing { - public: - explicit ScopedTracing(bool logOn) { - logging_ = logOn; - StartTrace(); - } - - ~ScopedTracing() { - StopTrace(); - } - - private: - void StartTrace() { - if (logging_) { - Trace::CreateTrace(); - Trace::set_level_filter(webrtc::kTraceAll); - Trace::SetTraceCallback(&trace_); - } - } - - void StopTrace() { - if (logging_) { - Trace::SetTraceCallback(NULL); - Trace::ReturnTrace(); - } - } - - private: - bool logging_; - TestTraceCallback trace_; -}; - -} // namespace webrtc - -#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_UNITTEST_UTILITIES_H_ diff --git a/thirdparties/common/include/webrtc-sdk/webrtc/typedefs.h b/thirdparties/common/include/webrtc-sdk/webrtc/typedefs.h deleted file mode 100755 index d8977ff..0000000 --- a/thirdparties/common/include/webrtc-sdk/webrtc/typedefs.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// This file contains platform-specific typedefs and defines. -// Much of it is derived from Chromium's build/build_config.h. - -#ifndef WEBRTC_TYPEDEFS_H_ -#define WEBRTC_TYPEDEFS_H_ - -// Processor architecture detection. For more info on what's defined, see: -// http://msdn.microsoft.com/en-us/library/b0084kay.aspx -// http://www.agner.org/optimize/calling_conventions.pdf -// or with gcc, run: "echo | gcc -E -dM -" -#if defined(_M_X64) || defined(__x86_64__) -#define WEBRTC_ARCH_X86_FAMILY -#define WEBRTC_ARCH_X86_64 -#define WEBRTC_ARCH_64_BITS -#define WEBRTC_ARCH_LITTLE_ENDIAN -#elif defined(__aarch64__) -#define WEBRTC_ARCH_64_BITS -#define WEBRTC_ARCH_LITTLE_ENDIAN -#elif defined(_M_IX86) || defined(__i386__) -#define WEBRTC_ARCH_X86_FAMILY -#define WEBRTC_ARCH_X86 -#define WEBRTC_ARCH_32_BITS -#define WEBRTC_ARCH_LITTLE_ENDIAN -#elif defined(__ARMEL__) -// TODO(ajm): We'd prefer to control platform defines here, but this is -// currently provided by the Android makefiles. Commented to avoid duplicate -// definition warnings. -//#define WEBRTC_ARCH_ARM -// TODO(ajm): Chromium uses the following two defines. Should we switch? -//#define WEBRTC_ARCH_ARM_FAMILY -//#define WEBRTC_ARCH_ARMEL -#define WEBRTC_ARCH_32_BITS -#define WEBRTC_ARCH_LITTLE_ENDIAN -#elif defined(__MIPSEL__) -#define WEBRTC_ARCH_32_BITS -#define WEBRTC_ARCH_LITTLE_ENDIAN -#elif defined(__pnacl__) -#define WEBRTC_ARCH_32_BITS -#define WEBRTC_ARCH_LITTLE_ENDIAN -#else -#error Please add support for your architecture in typedefs.h -#endif - -#if !(defined(WEBRTC_ARCH_LITTLE_ENDIAN) ^ defined(WEBRTC_ARCH_BIG_ENDIAN)) -#error Define either WEBRTC_ARCH_LITTLE_ENDIAN or WEBRTC_ARCH_BIG_ENDIAN -#endif - -#if (defined(WEBRTC_ARCH_X86_FAMILY) && !defined(__SSE2__)) || \ - (defined(WEBRTC_ARCH_ARM_V7) && !defined(WEBRTC_ARCH_ARM_NEON)) -#define WEBRTC_CPU_DETECTION -#endif - -#if !defined(_MSC_VER) -#include -#else -// Define C99 equivalent types, since pre-2010 MSVC doesn't provide stdint.h. -typedef signed char int8_t; -typedef signed short int16_t; -typedef signed int int32_t; -typedef __int64 int64_t; -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -typedef unsigned __int64 uint64_t; -#endif - -// Borrowed from Chromium's base/compiler_specific.h. -// Annotate a virtual method indicating it must be overriding a virtual -// method in the parent class. -// Use like: -// virtual void foo() OVERRIDE; -#if defined(_MSC_VER) -#define OVERRIDE override -#elif defined(__clang__) -// Clang defaults to C++03 and warns about using override. Squelch that. -// Intentionally no push/pop here so all users of OVERRIDE ignore the warning -// too. This is like passing -Wno-c++11-extensions, except that GCC won't die -// (because it won't see this pragma). -#pragma clang diagnostic ignored "-Wc++11-extensions" -#define OVERRIDE override -#elif defined(__GNUC__) && __cplusplus >= 201103 && \ - (__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= 40700 -// GCC 4.7 supports explicit virtual overrides when C++11 support is enabled. -#define OVERRIDE override -#else -#define OVERRIDE -#endif - -// Annotate a function indicating the caller must examine the return value. -// Use like: -// int foo() WARN_UNUSED_RESULT; -// TODO(ajm): Hack to avoid multiple definitions until the base/ of webrtc and -// libjingle are merged. -#if !defined(WARN_UNUSED_RESULT) -#if defined(__GNUC__) -#define WARN_UNUSED_RESULT __attribute__((warn_unused_result)) -#else -#define WARN_UNUSED_RESULT -#endif -#endif // WARN_UNUSED_RESULT - -#endif // WEBRTC_TYPEDEFS_H_