2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
10 #ifndef WEBRTC_VIDEO_ENGINE_TEST_LIBVIETEST_INCLUDE_VIE_EXTERNAL_RENDER_H_
11 #define WEBRTC_VIDEO_ENGINE_TEST_LIBVIETEST_INCLUDE_VIE_EXTERNAL_RENDER_H_
13 #include "webrtc/system_wrappers/interface/tick_util.h"
14 #include "webrtc/video_engine/include/vie_render.h"
18 // A render filter which passes frames directly to an external renderer. This
19 // is different from plugging the external renderer directly into the sending
20 // side since this will only run on frames that actually get sent and not on
21 // frames that only get captured.
22 class ExternalRendererEffectFilter : public webrtc::ViEEffectFilter {
24 explicit ExternalRendererEffectFilter(webrtc::ExternalRenderer* renderer)
25 : width_(0), height_(0), renderer_(renderer) {}
26 virtual ~ExternalRendererEffectFilter() {}
27 virtual int Transform(int size,
28 unsigned char* frame_buffer,
30 unsigned int timestamp,
32 unsigned int height) {
33 if (width != width_ || height_ != height) {
34 renderer_->FrameSizeChange(width, height, 1);
38 return renderer_->DeliverFrame(frame_buffer,
42 webrtc::TickTime::MillisecondTimestamp(),
49 webrtc::ExternalRenderer* renderer_;
54 #endif // WEBRTC_VIDEO_ENGINE_TEST_LIBVIETEST_INCLUDE_VIE_EXTERNAL_RENDER_H_