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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
media / gpu / mac / video_toolbox_decompression_metadata.h [blame]
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef MEDIA_GPU_MAC_VIDEO_TOOLBOX_DECOMPRESSION_METADATA_H_
#define MEDIA_GPU_MAC_VIDEO_TOOLBOX_DECOMPRESSION_METADATA_H_
#include <optional>
#include "base/apple/scoped_cftyperef.h"
#include "base/memory/scoped_refptr.h"
#include "base/time/time.h"
#include "media/base/timestamp_constants.h"
#include "media/base/video_aspect_ratio.h"
#include "media/base/video_types.h"
#include "media/gpu/codec_picture.h"
#include "media/gpu/media_gpu_export.h"
#include "ui/gfx/color_space.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/hdr_metadata.h"
namespace media {
// Metadata used when creating a VideoToolbox session.
struct MEDIA_GPU_EXPORT VideoToolboxDecompressionSessionMetadata {
// Enables platform software decoders.
bool allow_software_decoding = false;
// Selects a pixel format based on bit depth.
uint8_t bit_depth = 8;
// Selects a pixel format based on chroma sampling.
VideoChromaSampling chroma_sampling = VideoChromaSampling::k420;
// Selects a pixel format with alpha.
bool has_alpha = false;
// Selects the output image size.
gfx::Rect visible_rect;
};
// Metadata used when decoding a frame.
struct MEDIA_GPU_EXPORT VideoToolboxDecodeMetadata {
VideoToolboxDecodeMetadata();
~VideoToolboxDecodeMetadata();
scoped_refptr<CodecPicture> picture;
base::TimeDelta timestamp = kNoTimestamp;
base::TimeDelta duration = kNoTimestamp;
VideoAspectRatio aspect_ratio;
gfx::ColorSpace color_space;
std::optional<gfx::HDRMetadata> hdr_metadata;
// The frame should be dropped after decoding. Used to implement Reset().
bool discard = false;
// Session metadata is included in case the decoder needs to be reconfigured.
// TODO(crbug.com/40227557): Pass separately, maybe even independently.
VideoToolboxDecompressionSessionMetadata session_metadata;
};
} // namespace media
#endif // MEDIA_GPU_MAC_VIDEO_TOOLBOX_DECOMPRESSION_METADATA_H_