2013-09-19 12:14:03 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2013 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.
|
|
|
|
|
*/
|
2013-12-11 16:26:16 +00:00
|
|
|
#include "webrtc/test/frame_generator.h"
|
2013-09-19 12:14:03 +00:00
|
|
|
|
2013-10-15 09:15:47 +00:00
|
|
|
#include <math.h>
|
2013-09-19 12:14:03 +00:00
|
|
|
#include <stdio.h>
|
2013-10-15 09:15:47 +00:00
|
|
|
#include <string.h>
|
2013-09-19 12:14:03 +00:00
|
|
|
|
2016-05-01 14:53:46 -07:00
|
|
|
#include <memory>
|
|
|
|
|
|
2017-01-10 07:44:26 -08:00
|
|
|
#include "webrtc/api/video/i420_buffer.h"
|
2015-02-18 12:46:06 +00:00
|
|
|
#include "webrtc/base/checks.h"
|
2016-10-31 05:48:07 -07:00
|
|
|
#include "webrtc/base/keep_ref_until_done.h"
|
2017-01-10 07:44:26 -08:00
|
|
|
#include "webrtc/common_video/include/video_frame_buffer.h"
|
2013-09-19 12:14:03 +00:00
|
|
|
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
|
2015-10-28 18:17:40 +01:00
|
|
|
#include "webrtc/system_wrappers/include/clock.h"
|
2016-09-30 04:14:07 -07:00
|
|
|
#include "webrtc/test/frame_utils.h"
|
2013-09-19 12:14:03 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
namespace test {
|
|
|
|
|
namespace {
|
|
|
|
|
|
2013-10-15 09:15:47 +00:00
|
|
|
class ChromaGenerator : public FrameGenerator {
|
|
|
|
|
public:
|
2016-10-02 23:45:26 -07:00
|
|
|
ChromaGenerator(size_t width, size_t height) : angle_(0.0) {
|
|
|
|
|
ChangeResolution(width, height);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ChangeResolution(size_t width, size_t height) override {
|
|
|
|
|
rtc::CritScope lock(&crit_);
|
|
|
|
|
width_ = width;
|
|
|
|
|
height_ = height;
|
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_CHECK(width_ > 0);
|
|
|
|
|
RTC_CHECK(height_ > 0);
|
|
|
|
|
half_width_ = (width_ + 1) / 2;
|
|
|
|
|
y_size_ = width_ * height_;
|
|
|
|
|
uv_size_ = half_width_ * ((height_ + 1) / 2);
|
2013-10-15 09:15:47 +00:00
|
|
|
}
|
|
|
|
|
|
2015-05-29 17:21:40 -07:00
|
|
|
VideoFrame* NextFrame() override {
|
2016-10-02 23:45:26 -07:00
|
|
|
rtc::CritScope lock(&crit_);
|
2013-10-15 09:15:47 +00:00
|
|
|
angle_ += 30.0;
|
|
|
|
|
uint8_t u = fabs(sin(angle_)) * 0xFF;
|
|
|
|
|
uint8_t v = fabs(cos(angle_)) * 0xFF;
|
|
|
|
|
|
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
|
|
|
// Ensure stride == width.
|
|
|
|
|
rtc::scoped_refptr<I420Buffer> buffer(I420Buffer::Create(
|
|
|
|
|
static_cast<int>(width_), static_cast<int>(height_),
|
|
|
|
|
static_cast<int>(width_), static_cast<int>(half_width_),
|
|
|
|
|
static_cast<int>(half_width_)));
|
|
|
|
|
|
|
|
|
|
memset(buffer->MutableDataY(), 0x80, y_size_);
|
|
|
|
|
memset(buffer->MutableDataU(), u, uv_size_);
|
|
|
|
|
memset(buffer->MutableDataV(), v, uv_size_);
|
|
|
|
|
|
|
|
|
|
frame_.reset(new VideoFrame(buffer, 0, 0, webrtc::kVideoRotation_0));
|
|
|
|
|
return frame_.get();
|
2013-10-15 09:15:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
2016-10-02 23:45:26 -07:00
|
|
|
rtc::CriticalSection crit_;
|
|
|
|
|
double angle_ GUARDED_BY(&crit_);
|
|
|
|
|
size_t width_ GUARDED_BY(&crit_);
|
|
|
|
|
size_t height_ GUARDED_BY(&crit_);
|
|
|
|
|
size_t half_width_ GUARDED_BY(&crit_);
|
|
|
|
|
size_t y_size_ GUARDED_BY(&crit_);
|
|
|
|
|
size_t uv_size_ GUARDED_BY(&crit_);
|
|
|
|
|
std::unique_ptr<VideoFrame> frame_ GUARDED_BY(&crit_);
|
2013-10-15 09:15:47 +00:00
|
|
|
};
|
|
|
|
|
|
2013-09-19 12:14:03 +00:00
|
|
|
class YuvFileGenerator : public FrameGenerator {
|
|
|
|
|
public:
|
2015-02-18 12:46:06 +00:00
|
|
|
YuvFileGenerator(std::vector<FILE*> files,
|
|
|
|
|
size_t width,
|
|
|
|
|
size_t height,
|
|
|
|
|
int frame_repeat_count)
|
|
|
|
|
: file_index_(0),
|
|
|
|
|
files_(files),
|
|
|
|
|
width_(width),
|
|
|
|
|
height_(height),
|
|
|
|
|
frame_size_(CalcBufferSize(kI420,
|
|
|
|
|
static_cast<int>(width_),
|
|
|
|
|
static_cast<int>(height_))),
|
|
|
|
|
frame_buffer_(new uint8_t[frame_size_]),
|
|
|
|
|
frame_display_count_(frame_repeat_count),
|
|
|
|
|
current_display_count_(0) {
|
2016-11-29 05:30:40 -08:00
|
|
|
RTC_DCHECK_GT(width, 0);
|
|
|
|
|
RTC_DCHECK_GT(height, 0);
|
|
|
|
|
RTC_DCHECK_GT(frame_repeat_count, 0);
|
2013-09-19 12:14:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual ~YuvFileGenerator() {
|
2015-02-18 12:46:06 +00:00
|
|
|
for (FILE* file : files_)
|
|
|
|
|
fclose(file);
|
2013-09-19 12:14:03 +00:00
|
|
|
}
|
|
|
|
|
|
2015-05-29 17:21:40 -07:00
|
|
|
VideoFrame* NextFrame() override {
|
2015-03-02 11:55:45 +00:00
|
|
|
if (current_display_count_ == 0)
|
|
|
|
|
ReadNextFrame();
|
|
|
|
|
if (++current_display_count_ >= frame_display_count_)
|
|
|
|
|
current_display_count_ = 0;
|
|
|
|
|
|
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
|
|
|
temp_frame_.reset(
|
|
|
|
|
new VideoFrame(last_read_buffer_, 0, 0, webrtc::kVideoRotation_0));
|
|
|
|
|
return temp_frame_.get();
|
2015-02-18 12:46:06 +00:00
|
|
|
}
|
2013-12-11 16:26:16 +00:00
|
|
|
|
2015-02-18 12:46:06 +00:00
|
|
|
void ReadNextFrame() {
|
2016-09-30 04:14:07 -07:00
|
|
|
last_read_buffer_ =
|
|
|
|
|
test::ReadI420Buffer(static_cast<int>(width_),
|
|
|
|
|
static_cast<int>(height_),
|
|
|
|
|
files_[file_index_]);
|
|
|
|
|
if (!last_read_buffer_) {
|
2015-02-18 12:46:06 +00:00
|
|
|
// No more frames to read in this file, rewind and move to next file.
|
|
|
|
|
rewind(files_[file_index_]);
|
|
|
|
|
file_index_ = (file_index_ + 1) % files_.size();
|
2016-09-30 04:14:07 -07:00
|
|
|
last_read_buffer_ =
|
|
|
|
|
test::ReadI420Buffer(static_cast<int>(width_),
|
|
|
|
|
static_cast<int>(height_),
|
|
|
|
|
files_[file_index_]);
|
|
|
|
|
RTC_CHECK(last_read_buffer_);
|
2015-02-18 12:46:06 +00:00
|
|
|
}
|
2013-09-19 12:14:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
2015-02-18 12:46:06 +00:00
|
|
|
size_t file_index_;
|
|
|
|
|
const std::vector<FILE*> files_;
|
|
|
|
|
const size_t width_;
|
|
|
|
|
const size_t height_;
|
|
|
|
|
const size_t frame_size_;
|
2016-05-01 14:53:46 -07:00
|
|
|
const std::unique_ptr<uint8_t[]> frame_buffer_;
|
2015-02-18 12:46:06 +00:00
|
|
|
const int frame_display_count_;
|
|
|
|
|
int current_display_count_;
|
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> last_read_buffer_;
|
|
|
|
|
std::unique_ptr<VideoFrame> temp_frame_;
|
2013-09-19 12:14:03 +00:00
|
|
|
};
|
2015-07-29 07:58:13 -07:00
|
|
|
|
|
|
|
|
class ScrollingImageFrameGenerator : public FrameGenerator {
|
|
|
|
|
public:
|
|
|
|
|
ScrollingImageFrameGenerator(Clock* clock,
|
|
|
|
|
const std::vector<FILE*>& files,
|
|
|
|
|
size_t source_width,
|
|
|
|
|
size_t source_height,
|
|
|
|
|
size_t target_width,
|
|
|
|
|
size_t target_height,
|
|
|
|
|
int64_t scroll_time_ms,
|
|
|
|
|
int64_t pause_time_ms)
|
|
|
|
|
: clock_(clock),
|
|
|
|
|
start_time_(clock->TimeInMilliseconds()),
|
|
|
|
|
scroll_time_(scroll_time_ms),
|
|
|
|
|
pause_time_(pause_time_ms),
|
|
|
|
|
num_frames_(files.size()),
|
2016-10-04 23:27:30 -07:00
|
|
|
target_width_(static_cast<int>(target_width)),
|
|
|
|
|
target_height_(static_cast<int>(target_height)),
|
2015-07-29 07:58:13 -07:00
|
|
|
current_frame_num_(num_frames_ - 1),
|
|
|
|
|
current_source_frame_(nullptr),
|
|
|
|
|
file_generator_(files, source_width, source_height, 1) {
|
2015-09-17 00:24:34 -07:00
|
|
|
RTC_DCHECK(clock_ != nullptr);
|
2016-11-28 15:21:39 -08:00
|
|
|
RTC_DCHECK_GT(num_frames_, 0);
|
2015-09-17 00:24:34 -07:00
|
|
|
RTC_DCHECK_GE(source_height, target_height);
|
|
|
|
|
RTC_DCHECK_GE(source_width, target_width);
|
|
|
|
|
RTC_DCHECK_GE(scroll_time_ms, 0);
|
|
|
|
|
RTC_DCHECK_GE(pause_time_ms, 0);
|
|
|
|
|
RTC_DCHECK_GT(scroll_time_ms + pause_time_ms, 0);
|
2015-07-29 07:58:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual ~ScrollingImageFrameGenerator() {}
|
|
|
|
|
|
|
|
|
|
VideoFrame* NextFrame() override {
|
|
|
|
|
const int64_t kFrameDisplayTime = scroll_time_ + pause_time_;
|
|
|
|
|
const int64_t now = clock_->TimeInMilliseconds();
|
|
|
|
|
int64_t ms_since_start = now - start_time_;
|
|
|
|
|
|
|
|
|
|
size_t frame_num = (ms_since_start / kFrameDisplayTime) % num_frames_;
|
|
|
|
|
UpdateSourceFrame(frame_num);
|
|
|
|
|
|
|
|
|
|
double scroll_factor;
|
|
|
|
|
int64_t time_into_frame = ms_since_start % kFrameDisplayTime;
|
|
|
|
|
if (time_into_frame < scroll_time_) {
|
|
|
|
|
scroll_factor = static_cast<double>(time_into_frame) / scroll_time_;
|
|
|
|
|
} else {
|
|
|
|
|
scroll_factor = 1.0;
|
|
|
|
|
}
|
|
|
|
|
CropSourceToScrolledImage(scroll_factor);
|
|
|
|
|
|
2016-12-15 06:29:53 -08:00
|
|
|
return current_frame_ ? &*current_frame_ : nullptr;
|
2015-07-29 07:58:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void UpdateSourceFrame(size_t frame_num) {
|
|
|
|
|
while (current_frame_num_ != frame_num) {
|
|
|
|
|
current_source_frame_ = file_generator_.NextFrame();
|
|
|
|
|
current_frame_num_ = (current_frame_num_ + 1) % num_frames_;
|
|
|
|
|
}
|
2015-09-17 00:24:34 -07:00
|
|
|
RTC_DCHECK(current_source_frame_ != nullptr);
|
2015-07-29 07:58:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CropSourceToScrolledImage(double scroll_factor) {
|
2016-10-04 23:27:30 -07:00
|
|
|
int scroll_margin_x = current_source_frame_->width() - target_width_;
|
2015-07-29 07:58:13 -07:00
|
|
|
int pixels_scrolled_x =
|
|
|
|
|
static_cast<int>(scroll_margin_x * scroll_factor + 0.5);
|
2016-10-04 23:27:30 -07:00
|
|
|
int scroll_margin_y = current_source_frame_->height() - target_height_;
|
2015-07-29 07:58:13 -07:00
|
|
|
int pixels_scrolled_y =
|
|
|
|
|
static_cast<int>(scroll_margin_y * scroll_factor + 0.5);
|
|
|
|
|
|
Reland of Delete webrtc::VideoFrame methods buffer and stride. (patchset #1 id:1 of https://codereview.webrtc.org/1983583002/ )
Reason for revert:
Should work after cl https://codereview.webrtc.org/1985693002/ is landed, which initializes the frames used by FakeWebRtcVideoCaptureModule. So intend to reland after that, with no changes.
Original issue's description:
> Revert of Delete webrtc::VideoFrame methods buffer and stride. (patchset #2 id:290001 of https://codereview.webrtc.org/1963413004/ )
>
> Reason for revert:
> Speculative revert to see if failures on the DrMemory bot are related to this cl. See e.g. here:
> https://build.chromium.org/p/client.webrtc/builders/Win%20DrMemory%20Full/builds/4243
>
> UNINITIALIZED READ: reading 0x04980040-0x04980060 32 byte(s) within 0x04980040-0x04980060
> # 0 CopyRow_AVX
> # 1 CopyPlane
> # 2 I420Copy
> # 3 webrtc::ExtractBuffer
> # 4 cricket::WebRtcVideoCapturer::SignalFrameCapturedOnStartThread
> # 5 cricket::WebRtcVideoCapturer::OnIncomingCapturedFrame
> # 6 FakeWebRtcVideoCaptureModule::SendFrame
> # 7 WebRtcVideoCapturerTest_TestCaptureVcm_Test::TestBody
> # 8 testing::internal::HandleSehExceptionsInMethodIfSupported<>
>
> Original issue's description:
> > Reland of Delete webrtc::VideoFrame methods buffer and stride. (patchset #1 id:1 of https://codereview.webrtc.org/1935443002/ )
> >
> > Reason for revert:
> > I plan to reland this change in a week or two, after downstream users are updated.
> >
> > Original issue's description:
> > > Revert of Delete webrtc::VideoFrame methods buffer and stride. (patchset #14 id:250001 of https://codereview.webrtc.org/1900673002/ )
> > >
> > > Reason for revert:
> > > Breaks chrome FYI bots.
> > >
> > > Original issue's description:
> > > > Delete webrtc::VideoFrame methods buffer and stride.
> > > >
> > > > To make the HasOneRef/IsMutable hack work, also had to change the
> > > > video_frame_buffer method to return a const ref to a scoped_ref_ptr,
> > > > to not imply an AddRef.
> > > >
> > > > BUG=webrtc:5682
> > >
> > > TBR=perkj@webrtc.org,magjed@webrtc.org,pbos@webrtc.org,pthatcher@webrtc.org,stefan@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:5682
> > >
> > > Committed: https://crrev.com/5b3c443d301f2c2f18dac5b02652c08b91ea3828
> > > Cr-Commit-Position: refs/heads/master@{#12558}
> >
> > TBR=perkj@webrtc.org,magjed@webrtc.org,pbos@webrtc.org,pthatcher@webrtc.org,stefan@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:5682
> >
> > Committed: https://crrev.com/d0dc66e0ea30c8614001e425a4ae0aa7dd56c2a7
> > Cr-Commit-Position: refs/heads/master@{#12721}
>
> TBR=perkj@webrtc.org,magjed@webrtc.org,pbos@webrtc.org,pthatcher@webrtc.org,stefan@webrtc.org,nisse@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:5682
>
> Committed: https://crrev.com/d49c30cd2fe442f2b5b4ecec8d5cbaa430464725
> Cr-Commit-Position: refs/heads/master@{#12745}
TBR=perkj@webrtc.org,magjed@webrtc.org,pbos@webrtc.org,pthatcher@webrtc.org,stefan@webrtc.org,tommi@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:5682
Review-Url: https://codereview.webrtc.org/1979193003
Cr-Commit-Position: refs/heads/master@{#12773}
2016-05-17 04:05:47 -07:00
|
|
|
int offset_y = (current_source_frame_->video_frame_buffer()->StrideY() *
|
2015-07-29 07:58:13 -07:00
|
|
|
pixels_scrolled_y) +
|
|
|
|
|
pixels_scrolled_x;
|
Reland of Delete webrtc::VideoFrame methods buffer and stride. (patchset #1 id:1 of https://codereview.webrtc.org/1983583002/ )
Reason for revert:
Should work after cl https://codereview.webrtc.org/1985693002/ is landed, which initializes the frames used by FakeWebRtcVideoCaptureModule. So intend to reland after that, with no changes.
Original issue's description:
> Revert of Delete webrtc::VideoFrame methods buffer and stride. (patchset #2 id:290001 of https://codereview.webrtc.org/1963413004/ )
>
> Reason for revert:
> Speculative revert to see if failures on the DrMemory bot are related to this cl. See e.g. here:
> https://build.chromium.org/p/client.webrtc/builders/Win%20DrMemory%20Full/builds/4243
>
> UNINITIALIZED READ: reading 0x04980040-0x04980060 32 byte(s) within 0x04980040-0x04980060
> # 0 CopyRow_AVX
> # 1 CopyPlane
> # 2 I420Copy
> # 3 webrtc::ExtractBuffer
> # 4 cricket::WebRtcVideoCapturer::SignalFrameCapturedOnStartThread
> # 5 cricket::WebRtcVideoCapturer::OnIncomingCapturedFrame
> # 6 FakeWebRtcVideoCaptureModule::SendFrame
> # 7 WebRtcVideoCapturerTest_TestCaptureVcm_Test::TestBody
> # 8 testing::internal::HandleSehExceptionsInMethodIfSupported<>
>
> Original issue's description:
> > Reland of Delete webrtc::VideoFrame methods buffer and stride. (patchset #1 id:1 of https://codereview.webrtc.org/1935443002/ )
> >
> > Reason for revert:
> > I plan to reland this change in a week or two, after downstream users are updated.
> >
> > Original issue's description:
> > > Revert of Delete webrtc::VideoFrame methods buffer and stride. (patchset #14 id:250001 of https://codereview.webrtc.org/1900673002/ )
> > >
> > > Reason for revert:
> > > Breaks chrome FYI bots.
> > >
> > > Original issue's description:
> > > > Delete webrtc::VideoFrame methods buffer and stride.
> > > >
> > > > To make the HasOneRef/IsMutable hack work, also had to change the
> > > > video_frame_buffer method to return a const ref to a scoped_ref_ptr,
> > > > to not imply an AddRef.
> > > >
> > > > BUG=webrtc:5682
> > >
> > > TBR=perkj@webrtc.org,magjed@webrtc.org,pbos@webrtc.org,pthatcher@webrtc.org,stefan@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:5682
> > >
> > > Committed: https://crrev.com/5b3c443d301f2c2f18dac5b02652c08b91ea3828
> > > Cr-Commit-Position: refs/heads/master@{#12558}
> >
> > TBR=perkj@webrtc.org,magjed@webrtc.org,pbos@webrtc.org,pthatcher@webrtc.org,stefan@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:5682
> >
> > Committed: https://crrev.com/d0dc66e0ea30c8614001e425a4ae0aa7dd56c2a7
> > Cr-Commit-Position: refs/heads/master@{#12721}
>
> TBR=perkj@webrtc.org,magjed@webrtc.org,pbos@webrtc.org,pthatcher@webrtc.org,stefan@webrtc.org,nisse@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:5682
>
> Committed: https://crrev.com/d49c30cd2fe442f2b5b4ecec8d5cbaa430464725
> Cr-Commit-Position: refs/heads/master@{#12745}
TBR=perkj@webrtc.org,magjed@webrtc.org,pbos@webrtc.org,pthatcher@webrtc.org,stefan@webrtc.org,tommi@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:5682
Review-Url: https://codereview.webrtc.org/1979193003
Cr-Commit-Position: refs/heads/master@{#12773}
2016-05-17 04:05:47 -07:00
|
|
|
int offset_u = (current_source_frame_->video_frame_buffer()->StrideU() *
|
2015-07-29 07:58:13 -07:00
|
|
|
(pixels_scrolled_y / 2)) +
|
|
|
|
|
(pixels_scrolled_x / 2);
|
Reland of Delete webrtc::VideoFrame methods buffer and stride. (patchset #1 id:1 of https://codereview.webrtc.org/1983583002/ )
Reason for revert:
Should work after cl https://codereview.webrtc.org/1985693002/ is landed, which initializes the frames used by FakeWebRtcVideoCaptureModule. So intend to reland after that, with no changes.
Original issue's description:
> Revert of Delete webrtc::VideoFrame methods buffer and stride. (patchset #2 id:290001 of https://codereview.webrtc.org/1963413004/ )
>
> Reason for revert:
> Speculative revert to see if failures on the DrMemory bot are related to this cl. See e.g. here:
> https://build.chromium.org/p/client.webrtc/builders/Win%20DrMemory%20Full/builds/4243
>
> UNINITIALIZED READ: reading 0x04980040-0x04980060 32 byte(s) within 0x04980040-0x04980060
> # 0 CopyRow_AVX
> # 1 CopyPlane
> # 2 I420Copy
> # 3 webrtc::ExtractBuffer
> # 4 cricket::WebRtcVideoCapturer::SignalFrameCapturedOnStartThread
> # 5 cricket::WebRtcVideoCapturer::OnIncomingCapturedFrame
> # 6 FakeWebRtcVideoCaptureModule::SendFrame
> # 7 WebRtcVideoCapturerTest_TestCaptureVcm_Test::TestBody
> # 8 testing::internal::HandleSehExceptionsInMethodIfSupported<>
>
> Original issue's description:
> > Reland of Delete webrtc::VideoFrame methods buffer and stride. (patchset #1 id:1 of https://codereview.webrtc.org/1935443002/ )
> >
> > Reason for revert:
> > I plan to reland this change in a week or two, after downstream users are updated.
> >
> > Original issue's description:
> > > Revert of Delete webrtc::VideoFrame methods buffer and stride. (patchset #14 id:250001 of https://codereview.webrtc.org/1900673002/ )
> > >
> > > Reason for revert:
> > > Breaks chrome FYI bots.
> > >
> > > Original issue's description:
> > > > Delete webrtc::VideoFrame methods buffer and stride.
> > > >
> > > > To make the HasOneRef/IsMutable hack work, also had to change the
> > > > video_frame_buffer method to return a const ref to a scoped_ref_ptr,
> > > > to not imply an AddRef.
> > > >
> > > > BUG=webrtc:5682
> > >
> > > TBR=perkj@webrtc.org,magjed@webrtc.org,pbos@webrtc.org,pthatcher@webrtc.org,stefan@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:5682
> > >
> > > Committed: https://crrev.com/5b3c443d301f2c2f18dac5b02652c08b91ea3828
> > > Cr-Commit-Position: refs/heads/master@{#12558}
> >
> > TBR=perkj@webrtc.org,magjed@webrtc.org,pbos@webrtc.org,pthatcher@webrtc.org,stefan@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:5682
> >
> > Committed: https://crrev.com/d0dc66e0ea30c8614001e425a4ae0aa7dd56c2a7
> > Cr-Commit-Position: refs/heads/master@{#12721}
>
> TBR=perkj@webrtc.org,magjed@webrtc.org,pbos@webrtc.org,pthatcher@webrtc.org,stefan@webrtc.org,nisse@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:5682
>
> Committed: https://crrev.com/d49c30cd2fe442f2b5b4ecec8d5cbaa430464725
> Cr-Commit-Position: refs/heads/master@{#12745}
TBR=perkj@webrtc.org,magjed@webrtc.org,pbos@webrtc.org,pthatcher@webrtc.org,stefan@webrtc.org,tommi@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:5682
Review-Url: https://codereview.webrtc.org/1979193003
Cr-Commit-Position: refs/heads/master@{#12773}
2016-05-17 04:05:47 -07:00
|
|
|
int offset_v = (current_source_frame_->video_frame_buffer()->StrideV() *
|
2015-07-29 07:58:13 -07:00
|
|
|
(pixels_scrolled_y / 2)) +
|
|
|
|
|
(pixels_scrolled_x / 2);
|
|
|
|
|
|
2016-10-31 05:48:07 -07:00
|
|
|
rtc::scoped_refptr<VideoFrameBuffer> frame_buffer(
|
|
|
|
|
current_source_frame_->video_frame_buffer());
|
2016-12-15 06:29:53 -08:00
|
|
|
current_frame_ = rtc::Optional<webrtc::VideoFrame>(webrtc::VideoFrame(
|
2016-10-31 05:48:07 -07:00
|
|
|
new rtc::RefCountedObject<webrtc::WrappedI420Buffer>(
|
|
|
|
|
target_width_, target_height_,
|
|
|
|
|
&frame_buffer->DataY()[offset_y], frame_buffer->StrideY(),
|
|
|
|
|
&frame_buffer->DataU()[offset_u], frame_buffer->StrideU(),
|
|
|
|
|
&frame_buffer->DataV()[offset_v], frame_buffer->StrideV(),
|
|
|
|
|
KeepRefUntilDone(frame_buffer)),
|
2016-12-15 06:29:53 -08:00
|
|
|
kVideoRotation_0, 0));
|
2015-07-29 07:58:13 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Clock* const clock_;
|
|
|
|
|
const int64_t start_time_;
|
|
|
|
|
const int64_t scroll_time_;
|
|
|
|
|
const int64_t pause_time_;
|
|
|
|
|
const size_t num_frames_;
|
2016-10-04 23:27:30 -07:00
|
|
|
const int target_width_;
|
|
|
|
|
const int target_height_;
|
|
|
|
|
|
2015-07-29 07:58:13 -07:00
|
|
|
size_t current_frame_num_;
|
|
|
|
|
VideoFrame* current_source_frame_;
|
2016-12-15 06:29:53 -08:00
|
|
|
rtc::Optional<VideoFrame> current_frame_;
|
2015-07-29 07:58:13 -07:00
|
|
|
YuvFileGenerator file_generator_;
|
|
|
|
|
};
|
|
|
|
|
|
2013-09-19 12:14:03 +00:00
|
|
|
} // namespace
|
|
|
|
|
|
2016-09-16 07:53:41 -07:00
|
|
|
FrameForwarder::FrameForwarder() : sink_(nullptr) {}
|
2017-02-01 08:38:12 -08:00
|
|
|
FrameForwarder::~FrameForwarder() {}
|
2016-09-16 07:53:41 -07:00
|
|
|
|
|
|
|
|
void FrameForwarder::IncomingCapturedFrame(const VideoFrame& video_frame) {
|
|
|
|
|
rtc::CritScope lock(&crit_);
|
|
|
|
|
if (sink_)
|
|
|
|
|
sink_->OnFrame(video_frame);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FrameForwarder::AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
|
|
|
|
|
const rtc::VideoSinkWants& wants) {
|
|
|
|
|
rtc::CritScope lock(&crit_);
|
|
|
|
|
RTC_DCHECK(!sink_ || sink_ == sink);
|
|
|
|
|
sink_ = sink;
|
2016-11-01 11:45:46 -07:00
|
|
|
sink_wants_ = wants;
|
2016-09-16 07:53:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FrameForwarder::RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) {
|
|
|
|
|
rtc::CritScope lock(&crit_);
|
|
|
|
|
RTC_DCHECK_EQ(sink, sink_);
|
|
|
|
|
sink_ = nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
2016-11-01 11:45:46 -07:00
|
|
|
rtc::VideoSinkWants FrameForwarder::sink_wants() const {
|
|
|
|
|
rtc::CritScope lock(&crit_);
|
|
|
|
|
return sink_wants_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool FrameForwarder::has_sinks() const {
|
|
|
|
|
rtc::CritScope lock(&crit_);
|
|
|
|
|
return sink_ != nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-18 12:46:06 +00:00
|
|
|
FrameGenerator* FrameGenerator::CreateChromaGenerator(size_t width,
|
|
|
|
|
size_t height) {
|
2013-10-15 09:15:47 +00:00
|
|
|
return new ChromaGenerator(width, height);
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-18 12:46:06 +00:00
|
|
|
FrameGenerator* FrameGenerator::CreateFromYuvFile(
|
|
|
|
|
std::vector<std::string> filenames,
|
|
|
|
|
size_t width,
|
|
|
|
|
size_t height,
|
|
|
|
|
int frame_repeat_count) {
|
2016-11-29 05:30:40 -08:00
|
|
|
RTC_DCHECK(!filenames.empty());
|
2015-02-18 12:46:06 +00:00
|
|
|
std::vector<FILE*> files;
|
|
|
|
|
for (const std::string& filename : filenames) {
|
|
|
|
|
FILE* file = fopen(filename.c_str(), "rb");
|
2015-09-17 00:24:34 -07:00
|
|
|
RTC_DCHECK(file != nullptr);
|
2015-02-18 12:46:06 +00:00
|
|
|
files.push_back(file);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new YuvFileGenerator(files, width, height, frame_repeat_count);
|
2013-09-19 12:14:03 +00:00
|
|
|
}
|
|
|
|
|
|
2015-07-29 07:58:13 -07:00
|
|
|
FrameGenerator* FrameGenerator::CreateScrollingInputFromYuvFiles(
|
|
|
|
|
Clock* clock,
|
|
|
|
|
std::vector<std::string> filenames,
|
|
|
|
|
size_t source_width,
|
|
|
|
|
size_t source_height,
|
|
|
|
|
size_t target_width,
|
|
|
|
|
size_t target_height,
|
|
|
|
|
int64_t scroll_time_ms,
|
|
|
|
|
int64_t pause_time_ms) {
|
2016-11-29 05:30:40 -08:00
|
|
|
RTC_DCHECK(!filenames.empty());
|
2015-07-29 07:58:13 -07:00
|
|
|
std::vector<FILE*> files;
|
|
|
|
|
for (const std::string& filename : filenames) {
|
|
|
|
|
FILE* file = fopen(filename.c_str(), "rb");
|
2015-09-17 00:24:34 -07:00
|
|
|
RTC_DCHECK(file != nullptr);
|
2015-07-29 07:58:13 -07:00
|
|
|
files.push_back(file);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new ScrollingImageFrameGenerator(
|
|
|
|
|
clock, files, source_width, source_height, target_width, target_height,
|
|
|
|
|
scroll_time_ms, pause_time_ms);
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-19 12:14:03 +00:00
|
|
|
} // namespace test
|
|
|
|
|
} // namespace webrtc
|