webrtc_m130/test/fake_texture_frame.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.5 KiB
C
Raw Normal View History

/*
* Copyright (c) 2015 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 TEST_FAKE_TEXTURE_FRAME_H_
#define TEST_FAKE_TEXTURE_FRAME_H_
#include "api/video/i420_buffer.h"
#include "api/video/video_frame.h"
#include "common_video/include/video_frame_buffer.h"
#include "rtc_base/checks.h"
namespace webrtc {
namespace test {
class FakeNativeBuffer : public VideoFrameBuffer {
public:
static VideoFrame CreateFrame(int width,
int height,
uint32_t timestamp,
int64_t render_time_ms,
VideoRotation rotation);
FakeNativeBuffer(int width, int height) : width_(width), height_(height) {}
Type type() const override { return Type::kNative; }
int width() const override { return width_; }
int height() const override { return height_; }
private:
rtc::scoped_refptr<I420BufferInterface> ToI420() override {
Reland of Update test code to use I420Buffer when writing pixel data. (patchset #1 id:1 of https://codereview.webrtc.org/2343083002/ ) Reason for revert: Will fix android build failure. Original issue's description: > Revert of Update test code to use I420Buffer when writing pixel data. (patchset #2 id:140001 of https://codereview.webrtc.org/2342783003/ ) > > Reason for revert: > I was too impatient; this made android builds fail instead. See https://build.chromium.org/p/client.webrtc/builders/Linux32%20ARM/builds/585/steps/compile/logs/stdio > > Original issue's description: > > Reland of Update test code to use I420Buffer when writing pixel data. (patchset #1 id:1 of https://codereview.webrtc.org/2342123003/ ) > > > > Reason for revert: > > Intending to fix problem and reland. > > > > Original issue's description: > > > Revert of Update test code to use I420Buffer when writing pixel data. (patchset #5 id:80001 of https://codereview.webrtc.org/2333373007/ ) > > > > > > Reason for revert: > > > Fails 64-bit windows builds, it turns out I missed some of the needed int/size_t casts. Example https://build.chromium.org/p/client.webrtc/waterfall?builder=Win64%20Release > > > > > > Hope our windows try bots get back in working shape soon. > > > > > > Original issue's description: > > > > Update test code to use I420Buffer when writing pixel data. > > > > > > > > VideoFrameBuffer and VideoFrame will become immutable. > > > > > > > > BUG=webrtc:5921 > > > > R=magjed@webrtc.org, phoglund@webrtc.org > > > > > > > > Committed: https://crrev.com/280ad1514e44bf6717e5871526dd4632f759eb3d > > > > Cr-Commit-Position: refs/heads/master@{#14249} > > > > > > TBR=phoglund@webrtc.org,palmkvist@webrtc.org,magjed@webrtc.org > > > # Skipping CQ checks because original CL landed less than 1 days ago. > > > NOPRESUBMIT=true > > > NOTREECHECKS=true > > > NOTRY=true > > > BUG=webrtc:5921 > > > > > > Committed: https://crrev.com/fbf14607267adf03d235273283ca452a1e564861 > > > Cr-Commit-Position: refs/heads/master@{#14251} > > > > TBR=phoglund@webrtc.org,palmkvist@webrtc.org,magjed@webrtc.org > > # Skipping CQ checks because original CL landed less than 1 days ago. > > NOPRESUBMIT=true > > NOTREECHECKS=true > > NOTRY=true > > BUG=webrtc:5921 > > > > Committed: https://crrev.com/d21534a8cfe636bbcf3d7bb151945590abc92b2a > > Cr-Commit-Position: refs/heads/master@{#14258} > > TBR=phoglund@webrtc.org,palmkvist@webrtc.org,magjed@webrtc.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=webrtc:5921 > > Committed: https://crrev.com/3011627142bccdd73fce9fec854abb1f6b02b5c1 > Cr-Commit-Position: refs/heads/master@{#14259} TBR=phoglund@webrtc.org,palmkvist@webrtc.org,magjed@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true BUG=webrtc:5921 Review-Url: https://codereview.webrtc.org/2347863002 Cr-Commit-Position: refs/heads/master@{#14283}
2016-09-19 00:34:46 -07:00
rtc::scoped_refptr<I420Buffer> buffer = I420Buffer::Create(width_, height_);
I420Buffer::SetBlack(buffer);
return buffer;
}
const int width_;
const int height_;
};
} // namespace test
} // namespace webrtc
#endif // TEST_FAKE_TEXTURE_FRAME_H_