Commit 99a2f1c2 authored by Rintaro Kuroiwa's avatar Rintaro Kuroiwa Committed by Commit Bot

Let CodecPicture hold DecryptConfig

- Added codec_picture.cc because the constructor and destructor are
  now "complex".
- The DecryptConfig describes the decryption config of the input
  stream for this picture

Bug: 838673
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I84f202faae6a1dde2e3fec5f0535d349c2ec3d96
Reviewed-on: https://chromium-review.googlesource.com/1038157Reviewed-by: default avatarPawel Osciak <posciak@chromium.org>
Commit-Queue: Rintaro Kuroiwa <rkuroiwa@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560285}
parent 03911097
......@@ -317,6 +317,7 @@ source_set("common") {
defines = [ "MEDIA_GPU_IMPLEMENTATION" ]
sources = [
"accelerated_video_decoder.h",
"codec_picture.cc",
"codec_picture.h",
"format_utils.cc",
"format_utils.h",
......
// 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.
#include "media/gpu/codec_picture.h"
namespace media {
CodecPicture::CodecPicture() {}
CodecPicture::~CodecPicture() {}
} // namespace media
\ No newline at end of file
......@@ -9,6 +9,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "media/base/decrypt_config.h"
#include "media/gpu/media_gpu_export.h"
#include "ui/gfx/geometry/rect.h"
......@@ -23,7 +24,7 @@ namespace media {
class MEDIA_GPU_EXPORT CodecPicture
: public base::RefCountedThreadSafe<CodecPicture> {
public:
CodecPicture() = default;
CodecPicture();
int32_t bitstream_id() const { return bitstream_id_; }
void set_bitstream_id(int32_t bitstream_id) { bitstream_id_ = bitstream_id; }
......@@ -31,13 +32,22 @@ class MEDIA_GPU_EXPORT CodecPicture
const gfx::Rect visible_rect() const { return visible_rect_; }
void set_visible_rect(const gfx::Rect& rect) { visible_rect_ = rect; }
// DecryptConfig returned by this method describes the decryption
// configuration of the input stream for this picture. Returns null if it is
// not encrypted.
const DecryptConfig* decrypt_config() const { return decrypt_config_.get(); }
void set_decrypt_config(std::unique_ptr<DecryptConfig> config) {
decrypt_config_ = std::move(config);
}
protected:
friend class base::RefCountedThreadSafe<CodecPicture>;
virtual ~CodecPicture() = default;
virtual ~CodecPicture();
private:
int32_t bitstream_id_ = -1;
gfx::Rect visible_rect_;
std::unique_ptr<DecryptConfig> decrypt_config_;
DISALLOW_COPY_AND_ASSIGN(CodecPicture);
};
......
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