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

media/gpu/v4l2: add VP8 accelerator supporting upstream UAPI

Add a new VP8 accelerator that supports the upstream UAPI for VP8.

This is just a port of the legacy VP8 accelerator to use the upstream
headers and request API. It has not been thoroughly tested yet.

Bug: 965375
Test: None yet.

Change-Id: Ib06b2cc39a32beefa7314ae03d9ea15f8abc90f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1761883
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693059}
parent cf3614db
...@@ -51,6 +51,8 @@ source_set("v4l2") { ...@@ -51,6 +51,8 @@ source_set("v4l2") {
"v4l2_video_decode_accelerator.h", "v4l2_video_decode_accelerator.h",
"v4l2_video_encode_accelerator.cc", "v4l2_video_encode_accelerator.cc",
"v4l2_video_encode_accelerator.h", "v4l2_video_encode_accelerator.h",
"v4l2_vp8_accelerator.cc",
"v4l2_vp8_accelerator.h",
"v4l2_vp8_accelerator_legacy.cc", "v4l2_vp8_accelerator_legacy.cc",
"v4l2_vp8_accelerator_legacy.h", "v4l2_vp8_accelerator_legacy.h",
"v4l2_vp9_accelerator.cc", "v4l2_vp9_accelerator.cc",
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include "media/gpu/v4l2/v4l2_h264_accelerator_legacy.h" #include "media/gpu/v4l2/v4l2_h264_accelerator_legacy.h"
#include "media/gpu/v4l2/v4l2_image_processor.h" #include "media/gpu/v4l2/v4l2_image_processor.h"
#include "media/gpu/v4l2/v4l2_vda_helpers.h" #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_vp8_accelerator_legacy.h"
#include "media/gpu/v4l2/v4l2_vp9_accelerator.h" #include "media/gpu/v4l2/v4l2_vp9_accelerator.h"
#include "ui/gl/gl_context.h" #include "ui/gl/gl_context.h"
...@@ -287,8 +288,13 @@ bool V4L2SliceVideoDecodeAccelerator::Initialize(const Config& config, ...@@ -287,8 +288,13 @@ bool V4L2SliceVideoDecodeAccelerator::Initialize(const Config& config,
} }
} else if (video_profile_ >= VP8PROFILE_MIN && } else if (video_profile_ >= VP8PROFILE_MIN &&
video_profile_ <= VP8PROFILE_MAX) { video_profile_ <= VP8PROFILE_MAX) {
decoder_.reset(new VP8Decoder( if (supports_requests_) {
std::make_unique<V4L2LegacyVP8Accelerator>(this, device_.get()))); decoder_.reset(new VP8Decoder(
std::make_unique<V4L2VP8Accelerator>(this, device_.get())));
} else {
decoder_.reset(new VP8Decoder(
std::make_unique<V4L2LegacyVP8Accelerator>(this, device_.get())));
}
} else if (video_profile_ >= VP9PROFILE_MIN && } else if (video_profile_ >= VP9PROFILE_MIN &&
video_profile_ <= VP9PROFILE_MAX) { video_profile_ <= VP9PROFILE_MAX) {
decoder_.reset(new VP9Decoder( decoder_.reset(new VP9Decoder(
......
This diff is collapsed.
// Copyright 2018 The Chromium Authors. All rights reserved.
// 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_VP8_ACCELERATOR_H_
#define MEDIA_GPU_V4L2_V4L2_VP8_ACCELERATOR_H_
#include <vector>
#include "base/macros.h"
#include "base/memory/scoped_refptr.h"
#include "media/gpu/vp8_decoder.h"
namespace media {
class V4L2Device;
class V4L2DecodeSurface;
class V4L2DecodeSurfaceHandler;
class V4L2VP8Accelerator : public VP8Decoder::VP8Accelerator {
public:
explicit V4L2VP8Accelerator(V4L2DecodeSurfaceHandler* surface_handler,
V4L2Device* device);
~V4L2VP8Accelerator() override;
// VP8Decoder::VP8Accelerator implementation.
scoped_refptr<VP8Picture> CreateVP8Picture() override;
bool SubmitDecode(scoped_refptr<VP8Picture> pic,
const Vp8ReferenceFrameVector& reference_frames) override;
bool OutputPicture(const scoped_refptr<VP8Picture>& pic) override;
private:
scoped_refptr<V4L2DecodeSurface> VP8PictureToV4L2DecodeSurface(
const scoped_refptr<VP8Picture>& pic);
V4L2DecodeSurfaceHandler* const surface_handler_;
V4L2Device* const device_;
DISALLOW_COPY_AND_ASSIGN(V4L2VP8Accelerator);
};
} // namespace media
#endif // MEDIA_GPU_V4L2_V4L2_VP8_ACCELERATOR_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