Commit 2537f5aa authored by guoweis's avatar guoweis Committed by Commit bot

With the introduction of CVO, VideoRendererInterface implementation should...

With the introduction of CVO, VideoRendererInterface implementation should handle rotation frame by either rotating in renderer or calling into GetCopyWithRotationApplied.

BUG=webrtc:4145

Review URL: https://codereview.chromium.org/1025653004

Cr-Commit-Position: refs/heads/master@{#321871}
parent 2e16485f
......@@ -36,7 +36,6 @@ class MediaStreamRemoteVideoSource::RemoteVideoSourceDelegate
// Implements webrtc::VideoRendererInterface used for receiving video frames
// from the PeerConnection video track. May be called on a libjingle internal
// thread.
void SetSize(int width, int height) override;
void RenderFrame(const cricket::VideoFrame* frame) override;
void DoRenderFrameOnIOThread(
......@@ -64,24 +63,22 @@ MediaStreamRemoteVideoSource::
RemoteVideoSourceDelegate::~RemoteVideoSourceDelegate() {
}
void MediaStreamRemoteVideoSource::
RemoteVideoSourceDelegate::SetSize(int width, int height) {
}
void MediaStreamRemoteVideoSource::
RemoteVideoSourceDelegate::RenderFrame(
const cricket::VideoFrame* frame) {
void MediaStreamRemoteVideoSource::RemoteVideoSourceDelegate::RenderFrame(
const cricket::VideoFrame* incoming_frame) {
TRACE_EVENT0("webrtc", "RemoteVideoSourceDelegate::RenderFrame");
base::TimeDelta timestamp = base::TimeDelta::FromMicroseconds(
frame->GetElapsedTime() / rtc::kNumNanosecsPerMicrosec);
incoming_frame->GetElapsedTime() / rtc::kNumNanosecsPerMicrosec);
scoped_refptr<media::VideoFrame> video_frame;
if (frame->GetNativeHandle() != NULL) {
if (incoming_frame->GetNativeHandle() != NULL) {
NativeHandleImpl* handle =
static_cast<NativeHandleImpl*>(frame->GetNativeHandle());
static_cast<NativeHandleImpl*>(incoming_frame->GetNativeHandle());
video_frame = static_cast<media::VideoFrame*>(handle->GetHandle());
video_frame->set_timestamp(timestamp);
} else {
const cricket::VideoFrame* frame =
incoming_frame->GetCopyWithRotationApplied();
gfx::Size size(frame->GetWidth(), frame->GetHeight());
// Non-square pixels are unsupported.
......
......@@ -14,6 +14,7 @@
#include "third_party/libyuv/include/libyuv/convert_from.h"
#include "third_party/libyuv/include/libyuv/scale.h"
#include "third_party/webrtc/common_video/interface/video_frame_buffer.h"
#include "third_party/webrtc/common_video/rotation.h"
namespace content {
namespace {
......@@ -96,7 +97,7 @@ class WebRtcVideoCapturerAdapter::MediaVideoFrameFactory
base::Time::kNanosecondsPerMicrosecond;
captured_frame_.pixel_height = 1;
captured_frame_.pixel_width = 1;
captured_frame_.rotation = 0;
captured_frame_.rotation = webrtc::kVideoRotation_0;
captured_frame_.data = NULL;
captured_frame_.data_size = cricket::CapturedFrame::kUnknownDataSize;
captured_frame_.fourcc = static_cast<uint32>(cricket::FOURCC_ANY);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment