Source code

Revision control

Other Tools

1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
3
/* This Source Code Form is subject to the terms of the Mozilla Public
4
* License, v. 2.0. If a copy of the MPL was not distributed with this
5
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#ifndef GFX_IMAGETYPES_H
8
#define GFX_IMAGETYPES_H
9
10
#include <stdint.h> // for uint32_t
11
12
namespace mozilla {
13
14
enum class ImageFormat {
15
/**
16
* The PLANAR_YCBCR format creates a PlanarYCbCrImage. All backends should
17
* support this format, because the Ogg video decoder depends on it.
18
* The maximum image width and height is 16384.
19
*/
20
PLANAR_YCBCR,
21
22
/**
23
* The NV_IMAGE format creates a NVImage. The PLANAR_YCBCR together with this
24
* complete the YUV format family.
25
*/
26
NV_IMAGE,
27
28
/**
29
* The SHARED_RGB format creates a SharedRGBImage, which stores RGB data in
30
* shared memory. Some Android hardware video decoders require this format.
31
* Currently only used on Android.
32
*/
33
SHARED_RGB,
34
35
/**
36
* The CAIRO_SURFACE format creates a SourceSurfaceImage. All backends should
37
* support this format, because video rendering sometimes requires it.
38
*
39
* This format is useful even though a PaintedLayer could be used.
40
* It makes it easy to render a cairo surface when another Image format
41
* could be used. It can also avoid copying the surface data in some
42
* cases.
43
*
44
* Images in CAIRO_SURFACE format should only be created and
45
* manipulated on the main thread, since the underlying cairo surface
46
* is main-thread-only.
47
*/
48
CAIRO_SURFACE,
49
50
/**
51
* A MacIOSurface object.
52
*/
53
MAC_IOSURFACE,
54
55
/**
56
* An Android SurfaceTexture ID that can be shared across threads and
57
* processes.
58
*/
59
SURFACE_TEXTURE,
60
61
/**
62
* The D3D9_RGB32_TEXTURE format creates a D3D9SurfaceImage, and wraps a
63
* IDirect3DTexture9 in RGB32 layout.
64
*/
65
D3D9_RGB32_TEXTURE,
66
67
/**
68
* An Image type carries an opaque handle once for each stream.
69
* The opaque handle would be a platform specific identifier.
70
*/
71
OVERLAY_IMAGE,
72
73
/**
74
* A share handle to a ID3D11Texture2D.
75
*/
76
D3D11_SHARE_HANDLE_TEXTURE,
77
78
/**
79
* A wrapper around a drawable TextureClient.
80
*/
81
TEXTURE_WRAPPER,
82
83
/**
84
* A D3D11 backed YUV image.
85
*/
86
D3D11_YCBCR_IMAGE,
87
88
/**
89
* An opaque handle that refers to an Image stored in the GPU
90
* process.
91
*/
92
GPU_VIDEO,
93
94
/**
95
* The WAYLAND_DMABUF format creates a SharedDMABUFImage, which stores YUV
96
* data in DMABUF memory. Used on Wayland by VAAPI decoder.
97
*/
98
WAYLAND_DMABUF,
99
};
100
101
enum class StereoMode {
102
MONO,
103
LEFT_RIGHT,
104
RIGHT_LEFT,
105
BOTTOM_TOP,
106
TOP_BOTTOM,
107
MAX,
108
};
109
110
namespace layers {
111
112
typedef uint32_t ContainerFrameID;
113
constexpr ContainerFrameID kContainerFrameID_Invalid = 0;
114
115
typedef uint32_t ContainerProducerID;
116
constexpr ContainerProducerID kContainerProducerID_Invalid = 0;
117
118
} // namespace layers
119
120
} // namespace mozilla
121
122
#endif