mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-14 13:28:31 +00:00
[libvpx] Update to v1.12.0
This commit is contained in:
1 parent
287a71dc66
commit
b5046d2a76
572 files changed
+52900
-29493
No files matched your search
@@ -27,8 +27,8 @@ class YUVVideoSource : public VideoSource {
|
||||
YUVVideoSource(const std::string &file_name, vpx_img_fmt format,
|
||||
unsigned int width, unsigned int height, int rate_numerator,
|
||||
int rate_denominator, unsigned int start, int limit)
|
||||
: file_name_(file_name), input_file_(NULL), img_(NULL), start_(start),
|
||||
limit_(limit), frame_(0), width_(0), height_(0),
|
||||
: file_name_(file_name), input_file_(nullptr), img_(nullptr),
|
||||
start_(start), limit_(limit), frame_(0), width_(0), height_(0),
|
||||
format_(VPX_IMG_FMT_NONE), framerate_numerator_(rate_numerator),
|
||||
framerate_denominator_(rate_denominator) {
|
||||
// This initializes format_, raw_size_, width_, height_ and allocates img.
|
||||
@@ -43,7 +43,7 @@ class YUVVideoSource : public VideoSource {
|
||||
virtual void Begin() {
|
||||
if (input_file_) fclose(input_file_);
|
||||
input_file_ = OpenTestDataFile(file_name_);
|
||||
ASSERT_TRUE(input_file_ != NULL)
|
||||
ASSERT_NE(input_file_, nullptr)
|
||||
<< "Input file open failed. Filename: " << file_name_;
|
||||
if (start_) {
|
||||
fseek(input_file_, static_cast<unsigned>(raw_size_) * start_, SEEK_SET);
|
||||
@@ -58,7 +58,9 @@ class YUVVideoSource : public VideoSource {
|
||||
FillFrame();
|
||||
}
|
||||
|
||||
virtual vpx_image_t *img() const { return (frame_ < limit_) ? img_ : NULL; }
|
||||
virtual vpx_image_t *img() const {
|
||||
return (frame_ < limit_) ? img_ : nullptr;
|
||||
}
|
||||
|
||||
// Models a stream where Timebase = 1/FPS, so pts == frame.
|
||||
virtual vpx_codec_pts_t pts() const { return frame_; }
|
||||
@@ -78,12 +80,13 @@ class YUVVideoSource : public VideoSource {
|
||||
vpx_img_fmt format) {
|
||||
if (width != width_ || height != height_ || format != format_) {
|
||||
vpx_img_free(img_);
|
||||
img_ = vpx_img_alloc(NULL, format, width, height, 1);
|
||||
ASSERT_TRUE(img_ != NULL);
|
||||
img_ = vpx_img_alloc(nullptr, format, width, height, 1);
|
||||
ASSERT_NE(img_, nullptr);
|
||||
width_ = width;
|
||||
height_ = height;
|
||||
format_ = format;
|
||||
switch (format) {
|
||||
case VPX_IMG_FMT_NV12:
|
||||
case VPX_IMG_FMT_I420: raw_size_ = width * height * 3 / 2; break;
|
||||
case VPX_IMG_FMT_I422: raw_size_ = width * height * 2; break;
|
||||
case VPX_IMG_FMT_I440: raw_size_ = width * height * 2; break;
|
||||
@@ -98,7 +101,7 @@ class YUVVideoSource : public VideoSource {
|
||||
}
|
||||
|
||||
virtual void FillFrame() {
|
||||
ASSERT_TRUE(input_file_ != NULL);
|
||||
ASSERT_NE(input_file_, nullptr);
|
||||
// Read a frame from input_file.
|
||||
if (fread(img_->img_data, raw_size_, 1, input_file_) == 0) {
|
||||
limit_ = frame_;
|
||||
|
||||
Reference in new issue
Block a user