Commit cd1cf992 authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Commit Bot

media/gpu/v4l2vd: use make_unique() to build unique_ptrs

Reported by clang-tidy.

Bug: None
Test: video_decode_accelerator_tests --use_vd passes on Hana.
Change-Id: I43bf640830297ef3daeaf3c938585ce36167939b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2364340
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Fritz Koenig <frkoenig@chromium.org>
Reviewed-by: default avatarFritz Koenig <frkoenig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799685}
parent 459a18f9
......@@ -8,6 +8,8 @@
#include <linux/media.h>
#include <sys/ioctl.h>
#include <memory>
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/posix/eintr_wrapper.h"
......@@ -636,25 +638,24 @@ bool V4L2StatelessVideoDecoderBackend::CreateAvd() {
if (profile_ >= H264PROFILE_MIN && profile_ <= H264PROFILE_MAX) {
if (input_queue_->SupportsRequests()) {
avd_.reset(new H264Decoder(
std::make_unique<V4L2H264Accelerator>(this, device_.get()),
profile_));
avd_ = std::make_unique<H264Decoder>(
std::make_unique<V4L2H264Accelerator>(this, device_.get()), profile_);
} else {
avd_.reset(new H264Decoder(
avd_ = std::make_unique<H264Decoder>(
std::make_unique<V4L2LegacyH264Accelerator>(this, device_.get()),
profile_));
profile_);
}
} else if (profile_ >= VP8PROFILE_MIN && profile_ <= VP8PROFILE_MAX) {
if (input_queue_->SupportsRequests()) {
avd_.reset(new VP8Decoder(
std::make_unique<V4L2VP8Accelerator>(this, device_.get())));
avd_ = std::make_unique<VP8Decoder>(
std::make_unique<V4L2VP8Accelerator>(this, device_.get()));
} else {
avd_.reset(new VP8Decoder(
std::make_unique<V4L2LegacyVP8Accelerator>(this, device_.get())));
avd_ = std::make_unique<VP8Decoder>(
std::make_unique<V4L2LegacyVP8Accelerator>(this, device_.get()));
}
} else if (profile_ >= VP9PROFILE_MIN && profile_ <= VP9PROFILE_MAX) {
avd_.reset(new VP9Decoder(
std::make_unique<V4L2VP9Accelerator>(this, device_.get()), profile_));
avd_ = std::make_unique<VP9Decoder>(
std::make_unique<V4L2VP9Accelerator>(this, device_.get()), profile_);
} else {
VLOGF(1) << "Unsupported profile " << GetProfileName(profile_);
return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment