summaryrefslogtreecommitdiff
path: root/chromium/media/gpu/gpu_video_decode_accelerator_helpers.cc
blob: 2de95be733c13f59405f3090f50f28eaf3b53f51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright 2019 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/gpu_video_decode_accelerator_helpers.h"

namespace media {

GpuVideoDecodeGLClient::GpuVideoDecodeGLClient() = default;
GpuVideoDecodeGLClient::~GpuVideoDecodeGLClient() = default;
GpuVideoDecodeGLClient::GpuVideoDecodeGLClient(const GpuVideoDecodeGLClient&) =
    default;
GpuVideoDecodeGLClient& GpuVideoDecodeGLClient::operator=(
    const GpuVideoDecodeGLClient&) = default;

SupportedVideoDecoderConfigs ConvertFromSupportedProfiles(
    const VideoDecodeAccelerator::SupportedProfiles& profiles,
    bool allow_encrypted) {
  SupportedVideoDecoderConfigs configs;
  for (const auto& profile : profiles) {
    configs.push_back(SupportedVideoDecoderConfig(
        profile.profile,           // profile_min
        profile.profile,           // profile_max
        profile.min_resolution,    // coded_size_min
        profile.max_resolution,    // coded_size_max
        allow_encrypted,           // allow_encrypted
        profile.encrypted_only));  // require_encrypted);
  }
  return configs;
}

}  // namespace media