ViEExternalRendererImpl: Remove dependency to webrtc::VideoFrame

I had to use std::vector, because rtc::Buffer wasn't in rtc_base_approved.

R=mflodman@webrtc.org, pbos@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/34249004

Cr-Commit-Position: refs/heads/master@{#8426}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8426 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
magjed@webrtc.org 2015-02-19 10:03:52 +00:00
parent 3db042e2f0
commit 32c784c266
2 changed files with 11 additions and 16 deletions

View File

@ -149,8 +149,7 @@ ViEExternalRendererImpl::ViEExternalRendererImpl()
: external_renderer_(NULL),
external_renderer_format_(kVideoUnknown),
external_renderer_width_(0),
external_renderer_height_(0),
converted_frame_(new VideoFrame()) {
external_renderer_height_(0) {
}
int ViEExternalRendererImpl::SetViEExternalRenderer(
@ -196,8 +195,6 @@ int32_t ViEExternalRendererImpl::ConvertAndRenderFrame(
return 0;
}
VideoFrame* out_frame = converted_frame_.get();
// Convert to requested format.
VideoType type =
RawVideoTypeToCommonVideoVideoType(external_renderer_format_);
@ -208,7 +205,8 @@ int32_t ViEExternalRendererImpl::ConvertAndRenderFrame(
assert(false);
return -1;
}
converted_frame_->VerifyAndAllocate(buffer_size);
converted_frame_.resize(buffer_size);
uint8_t* out_frame = &converted_frame_[0];
switch (external_renderer_format_) {
case kVideoYV12:
@ -218,13 +216,9 @@ int32_t ViEExternalRendererImpl::ConvertAndRenderFrame(
case kVideoRGB24:
case kVideoRGB565:
case kVideoARGB4444:
case kVideoARGB1555 :
{
if (ConvertFromI420(video_frame, type, 0,
converted_frame_->Buffer()) < 0)
return -1;
converted_frame_->SetLength(buffer_size);
}
case kVideoARGB1555:
if (ConvertFromI420(video_frame, type, 0, out_frame) < 0)
return -1;
break;
case kVideoIYUV:
// no conversion available
@ -238,8 +232,8 @@ int32_t ViEExternalRendererImpl::ConvertAndRenderFrame(
NotifyFrameSizeChange(stream_id, video_frame);
if (out_frame) {
external_renderer_->DeliverFrame(out_frame->Buffer(),
out_frame->Length(),
external_renderer_->DeliverFrame(out_frame,
converted_frame_.size(),
video_frame.timestamp(),
video_frame.ntp_time_ms(),
video_frame.render_time_ms(),

View File

@ -11,8 +11,9 @@
#ifndef WEBRTC_VIDEO_ENGINE_VIE_RENDERER_H_
#define WEBRTC_VIDEO_ENGINE_VIE_RENDERER_H_
#include <vector>
#include "webrtc/modules/video_render/include/video_render_defines.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
#include "webrtc/video_engine/include/vie_render.h"
#include "webrtc/video_engine/vie_frame_provider_base.h"
@ -44,7 +45,7 @@ class ViEExternalRendererImpl : public VideoRenderCallback {
int external_renderer_width_;
int external_renderer_height_;
// Converted_frame_ in color format specified by render_format_.
scoped_ptr<VideoFrame> converted_frame_;
std::vector<uint8_t> converted_frame_;
};
class ViERenderer: public ViEFrameCallback {