From 0cdcd23a03ae78eb12bfbba9d71df7ef05e09448 Mon Sep 17 00:00:00 2001 From: "buildbot@webrtc.org" Date: Wed, 4 Jun 2014 01:31:14 +0000 Subject: [PATCH] (Auto)update libjingle 68501302-> 68506654 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6321 4adac7df-926f-26a2-2b94-8c16560cd09d --- talk/media/base/videoadapter.cc | 19 +++++++++++++------ talk/media/base/videoadapter.h | 10 +++++++--- talk/media/webrtc/webrtcvideoengine.cc | 9 ++------- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/talk/media/base/videoadapter.cc b/talk/media/base/videoadapter.cc index bcf89cbdb..76ec52775 100644 --- a/talk/media/base/videoadapter.cc +++ b/talk/media/base/videoadapter.cc @@ -261,7 +261,7 @@ int VideoAdapter::GetOutputNumPixels() const { // TODO(fbarchard): Add AdaptFrameRate function that only drops frames but // not resolution. -bool VideoAdapter::AdaptFrame(const VideoFrame* in_frame, +bool VideoAdapter::AdaptFrame(VideoFrame* in_frame, VideoFrame** out_frame) { talk_base::CritScope cs(&critical_section_); if (!in_frame || !out_frame) { @@ -326,12 +326,19 @@ bool VideoAdapter::AdaptFrame(const VideoFrame* in_frame, output_format_.height = static_cast(in_frame->GetHeight()); } - if (!StretchToOutputFrame(in_frame)) { - LOG(LS_VERBOSE) << "VAdapt Stretch Failed."; - return false; - } + if (!black_output_ && + in_frame->GetWidth() == static_cast(output_format_.width) && + in_frame->GetHeight() == static_cast(output_format_.height)) { + // The dimensions are correct and we aren't muting, so use the input frame. + *out_frame = in_frame; + } else { + if (!StretchToOutputFrame(in_frame)) { + LOG(LS_VERBOSE) << "VAdapt Stretch Failed."; + return false; + } - *out_frame = output_frame_.get(); + *out_frame = output_frame_.get(); + } ++frames_out_; if (in_frame->GetWidth() != (*out_frame)->GetWidth() || diff --git a/talk/media/base/videoadapter.h b/talk/media/base/videoadapter.h index 64a850f98..0634942d9 100644 --- a/talk/media/base/videoadapter.h +++ b/talk/media/base/videoadapter.h @@ -61,9 +61,13 @@ class VideoAdapter { // 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); + // Note that, if no adaptation is required, |out_frame| will refer directly + // in_frame. If a copy is always required, the caller must do an explicit + // copy. + // If a copy has taken place, |output_frame_| is owned by the VideoAdapter + // and will remain usable until the adapter is destroyed or AdaptFrame is + // called again. + bool AdaptFrame(VideoFrame* in_frame, VideoFrame** out_frame); void set_scale_third(bool enable); bool scale_third() const { return scale_third_; } diff --git a/talk/media/webrtc/webrtcvideoengine.cc b/talk/media/webrtc/webrtcvideoengine.cc index d13798627..a029ec27e 100644 --- a/talk/media/webrtc/webrtcvideoengine.cc +++ b/talk/media/webrtc/webrtcvideoengine.cc @@ -69,10 +69,6 @@ #if !defined(LIBPEERCONNECTION_LIB) #include "talk/media/webrtc/webrtcmediaengine.h" -#ifdef _WIN32 -#define strtok_r strtok_s -#endif // _WIN32 - WRME_EXPORT cricket::MediaEngineInterface* CreateWebRtcMediaEngine( webrtc::AudioDeviceModule* adm, webrtc::AudioDeviceModule* adm_sc, @@ -149,9 +145,8 @@ static int GetExternalVideoPayloadType(int index) { static void LogMultiline(talk_base::LoggingSeverity sev, char* text) { const char* delim = "\r\n"; - char* strtok_save; - for (char* tok = strtok_r(text, delim, &strtok_save); - tok; tok = strtok_r(NULL, delim, &strtok_save)) { + // TODO(fbarchard): Fix strtok lint warning. + for (char* tok = strtok(text, delim); tok; tok = strtok(NULL, delim)) { LOG_V(sev) << tok; } }