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

media/gpu/v4l2: rename V4L2VP9Accelerator to V4L2LegacyVP9Accelerator

Our current VP9 accelerator uses a Chromium-only, non mainline ABI to
communicate with the kernel. As we are about to introduce the
upstream-based ABI, and the corresponding VP9 accelerator, rename our
older one to "legacy" following the model already followed for H.264 and
VP8.

BUG=b:161415741
TEST=Chromium builds for arm-generic.

Change-Id: I582814b5efc2f6d10c9fd7a7305593dc211a61d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2423653Reviewed-by: default avatarFritz Koenig <frkoenig@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810045}
parent fb330662
......@@ -61,8 +61,8 @@ source_set("v4l2") {
"v4l2_vp8_accelerator.h",
"v4l2_vp8_accelerator_legacy.cc",
"v4l2_vp8_accelerator_legacy.h",
"v4l2_vp9_accelerator.cc",
"v4l2_vp9_accelerator.h",
"v4l2_vp9_accelerator_legacy.cc",
"v4l2_vp9_accelerator_legacy.h",
]
libs = [
......
......@@ -47,7 +47,7 @@
#include "media/gpu/v4l2/v4l2_vda_helpers.h"
#include "media/gpu/v4l2/v4l2_vp8_accelerator.h"
#include "media/gpu/v4l2/v4l2_vp8_accelerator_legacy.h"
#include "media/gpu/v4l2/v4l2_vp9_accelerator.h"
#include "media/gpu/v4l2/v4l2_vp9_accelerator_legacy.h"
#include "ui/gfx/native_pixmap_handle.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_image.h"
......@@ -315,7 +315,7 @@ bool V4L2SliceVideoDecodeAccelerator::Initialize(const Config& config,
} else if (video_profile_ >= VP9PROFILE_MIN &&
video_profile_ <= VP9PROFILE_MAX) {
decoder_ = std::make_unique<VP9Decoder>(
std::make_unique<V4L2VP9Accelerator>(this, device_.get()),
std::make_unique<V4L2LegacyVP9Accelerator>(this, device_.get()),
video_profile_);
} else {
NOTREACHED() << "Unsupported profile " << GetProfileName(video_profile_);
......
......@@ -25,7 +25,7 @@
#include "media/gpu/v4l2/v4l2_h264_accelerator_legacy.h"
#include "media/gpu/v4l2/v4l2_vp8_accelerator.h"
#include "media/gpu/v4l2/v4l2_vp8_accelerator_legacy.h"
#include "media/gpu/v4l2/v4l2_vp9_accelerator.h"
#include "media/gpu/v4l2/v4l2_vp9_accelerator_legacy.h"
namespace media {
......@@ -655,7 +655,8 @@ bool V4L2StatelessVideoDecoderBackend::CreateAvd() {
}
} else if (profile_ >= VP9PROFILE_MIN && profile_ <= VP9PROFILE_MAX) {
avd_ = std::make_unique<VP9Decoder>(
std::make_unique<V4L2VP9Accelerator>(this, device_.get()), profile_);
std::make_unique<V4L2LegacyVP9Accelerator>(this, device_.get()),
profile_);
} else {
VLOGF(1) << "Unsupported profile " << GetProfileName(profile_);
return false;
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "media/gpu/v4l2/v4l2_vp9_accelerator.h"
#include "media/gpu/v4l2/v4l2_vp9_accelerator_legacy.h"
#include <type_traits>
......@@ -178,7 +178,7 @@ class V4L2VP9Picture : public VP9Picture {
DISALLOW_COPY_AND_ASSIGN(V4L2VP9Picture);
};
V4L2VP9Accelerator::V4L2VP9Accelerator(
V4L2LegacyVP9Accelerator::V4L2LegacyVP9Accelerator(
V4L2DecodeSurfaceHandler* surface_handler,
V4L2Device* device)
: surface_handler_(surface_handler), device_(device) {
......@@ -191,9 +191,9 @@ V4L2VP9Accelerator::V4L2VP9Accelerator(
<< "Device requires frame context parsing";
}
V4L2VP9Accelerator::~V4L2VP9Accelerator() {}
V4L2LegacyVP9Accelerator::~V4L2LegacyVP9Accelerator() {}
scoped_refptr<VP9Picture> V4L2VP9Accelerator::CreateVP9Picture() {
scoped_refptr<VP9Picture> V4L2LegacyVP9Accelerator::CreateVP9Picture() {
scoped_refptr<V4L2DecodeSurface> dec_surface =
surface_handler_->CreateSurface();
if (!dec_surface)
......@@ -202,11 +202,12 @@ scoped_refptr<VP9Picture> V4L2VP9Accelerator::CreateVP9Picture() {
return new V4L2VP9Picture(std::move(dec_surface));
}
bool V4L2VP9Accelerator::SubmitDecode(scoped_refptr<VP9Picture> pic,
const Vp9SegmentationParams& segm_params,
const Vp9LoopFilterParams& lf_params,
const Vp9ReferenceFrameVector& ref_frames,
base::OnceClosure done_cb) {
bool V4L2LegacyVP9Accelerator::SubmitDecode(
scoped_refptr<VP9Picture> pic,
const Vp9SegmentationParams& segm_params,
const Vp9LoopFilterParams& lf_params,
const Vp9ReferenceFrameVector& ref_frames,
base::OnceClosure done_cb) {
const Vp9FrameHeader* frame_hdr = pic->frame_hdr.get();
DCHECK(frame_hdr);
......@@ -365,7 +366,7 @@ bool V4L2VP9Accelerator::SubmitDecode(scoped_refptr<VP9Picture> pic,
return true;
}
bool V4L2VP9Accelerator::OutputPicture(scoped_refptr<VP9Picture> pic) {
bool V4L2LegacyVP9Accelerator::OutputPicture(scoped_refptr<VP9Picture> pic) {
// TODO(crbug.com/647725): Insert correct color space.
surface_handler_->SurfaceReady(VP9PictureToV4L2DecodeSurface(pic.get()),
pic->bitstream_id(), pic->visible_rect(),
......@@ -373,8 +374,8 @@ bool V4L2VP9Accelerator::OutputPicture(scoped_refptr<VP9Picture> pic) {
return true;
}
bool V4L2VP9Accelerator::GetFrameContext(scoped_refptr<VP9Picture> pic,
Vp9FrameContext* frame_ctx) {
bool V4L2LegacyVP9Accelerator::GetFrameContext(scoped_refptr<VP9Picture> pic,
Vp9FrameContext* frame_ctx) {
struct v4l2_ctrl_vp9_entropy v4l2_entropy;
memset(&v4l2_entropy, 0, sizeof(v4l2_entropy));
......@@ -401,12 +402,12 @@ bool V4L2VP9Accelerator::GetFrameContext(scoped_refptr<VP9Picture> pic,
return true;
}
bool V4L2VP9Accelerator::IsFrameContextRequired() const {
bool V4L2LegacyVP9Accelerator::IsFrameContextRequired() const {
return device_needs_frame_context_;
}
scoped_refptr<V4L2DecodeSurface>
V4L2VP9Accelerator::VP9PictureToV4L2DecodeSurface(VP9Picture* pic) {
V4L2LegacyVP9Accelerator::VP9PictureToV4L2DecodeSurface(VP9Picture* pic) {
V4L2VP9Picture* v4l2_pic = pic->AsV4L2VP9Picture();
CHECK(v4l2_pic);
return v4l2_pic->dec_surface();
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef MEDIA_GPU_V4L2_V4L2_VP9_ACCELERATOR_H_
#define MEDIA_GPU_V4L2_V4L2_VP9_ACCELERATOR_H_
#ifndef MEDIA_GPU_V4L2_V4L2_VP9_ACCELERATOR_LEGACY_H_
#define MEDIA_GPU_V4L2_V4L2_VP9_ACCELERATOR_LEGACY_H_
#include <vector>
......@@ -19,11 +19,11 @@ class V4L2DecodeSurface;
class V4L2DecodeSurfaceHandler;
class V4L2Device;
class V4L2VP9Accelerator : public VP9Decoder::VP9Accelerator {
class V4L2LegacyVP9Accelerator : public VP9Decoder::VP9Accelerator {
public:
explicit V4L2VP9Accelerator(V4L2DecodeSurfaceHandler* surface_handler,
V4L2Device* device);
~V4L2VP9Accelerator() override;
explicit V4L2LegacyVP9Accelerator(V4L2DecodeSurfaceHandler* surface_handler,
V4L2Device* device);
~V4L2LegacyVP9Accelerator() override;
// VP9Decoder::VP9Accelerator implementation.
scoped_refptr<VP9Picture> CreateVP9Picture() override;
......@@ -50,9 +50,9 @@ class V4L2VP9Accelerator : public VP9Decoder::VP9Accelerator {
V4L2DecodeSurfaceHandler* const surface_handler_;
V4L2Device* const device_;
DISALLOW_COPY_AND_ASSIGN(V4L2VP9Accelerator);
DISALLOW_COPY_AND_ASSIGN(V4L2LegacyVP9Accelerator);
};
} // namespace media
#endif // MEDIA_GPU_V4L2_V4L2_VP9_ACCELERATOR_H_
#endif // MEDIA_GPU_V4L2_V4L2_VP9_ACCELERATOR_LEGACY_H_
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