OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ | 5 #ifndef CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ |
6 #define CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ | 6 #define CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <list> | 11 #include <list> |
12 #include <memory> | 12 #include <memory> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
19 #include "cc/cc_export.h" | 19 #include "cc/cc_export.h" |
20 #include "cc/resources/release_callback_impl.h" | 20 #include "cc/resources/release_callback_impl.h" |
21 #include "cc/resources/resource_format.h" | 21 #include "cc/resources/resource_format.h" |
22 #include "cc/resources/texture_mailbox.h" | 22 #include "cc/resources/texture_mailbox.h" |
| 23 #include "media/base/video_types.h" |
23 #include "ui/gfx/geometry/size.h" | 24 #include "ui/gfx/geometry/size.h" |
24 | 25 |
25 namespace media { | 26 namespace media { |
26 class SkCanvasVideoRenderer; | 27 class SkCanvasVideoRenderer; |
27 class VideoFrame; | 28 class VideoFrame; |
28 } | 29 } |
29 | 30 |
30 namespace cc { | 31 namespace cc { |
31 class ContextProvider; | 32 class ContextProvider; |
32 class ResourceProvider; | 33 class ResourceProvider; |
33 | 34 |
34 class CC_EXPORT VideoFrameExternalResources { | 35 class CC_EXPORT VideoFrameExternalResources { |
35 public: | 36 public: |
36 // Specifies what type of data is contained in the mailboxes, as well as how | 37 // Specifies what type of data is contained in the mailboxes, as well as how |
37 // many mailboxes will be present. | 38 // many mailboxes will be present. |
38 enum ResourceType { | 39 enum ResourceType { |
39 NONE, | 40 NONE, |
40 YUV_RESOURCE, | 41 YUV_RESOURCE, |
41 RGB_RESOURCE, | 42 RGB_RESOURCE, |
42 RGBA_PREMULTIPLIED_RESOURCE, | 43 RGBA_PREMULTIPLIED_RESOURCE, |
43 RGBA_RESOURCE, | 44 RGBA_RESOURCE, |
44 STREAM_TEXTURE_RESOURCE, | 45 STREAM_TEXTURE_RESOURCE, |
45 | 46 |
46 // TODO(danakj): Remove this and abstract TextureMailbox into | 47 // TODO(danakj): Remove this and abstract TextureMailbox into |
47 // "ExternalResource" that can hold a hardware or software backing. | 48 // "ExternalResource" that can hold a hardware or software backing. |
48 SOFTWARE_RESOURCE | 49 SOFTWARE_RESOURCE |
49 }; | 50 }; |
50 | 51 |
51 ResourceType type; | 52 ResourceType type; |
| 53 media::VideoPixelFormat pixel_format; |
52 std::vector<TextureMailbox> mailboxes; | 54 std::vector<TextureMailbox> mailboxes; |
53 std::vector<ReleaseCallbackImpl> release_callbacks; | 55 std::vector<ReleaseCallbackImpl> release_callbacks; |
54 bool read_lock_fences_enabled; | 56 bool read_lock_fences_enabled; |
55 | 57 |
56 // TODO(danakj): Remove these too. | 58 // TODO(danakj): Remove these too. |
57 std::vector<unsigned> software_resources; | 59 std::vector<unsigned> software_resources; |
58 ReleaseCallbackImpl software_release_callback; | 60 ReleaseCallbackImpl software_release_callback; |
59 | 61 |
60 // Used by hardware textures which do not return values in the 0-1 range. | 62 // Used by hardware textures which do not return values in the 0-1 range. |
61 // After a lookup, subtract offset and multiply by multiplier. | 63 // After a lookup, subtract offset and multiply by multiplier. |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 // Recycle resources so that we can reduce the number of allocations and | 184 // Recycle resources so that we can reduce the number of allocations and |
183 // data transfers. | 185 // data transfers. |
184 ResourceList all_resources_; | 186 ResourceList all_resources_; |
185 | 187 |
186 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); | 188 DISALLOW_COPY_AND_ASSIGN(VideoResourceUpdater); |
187 }; | 189 }; |
188 | 190 |
189 } // namespace cc | 191 } // namespace cc |
190 | 192 |
191 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ | 193 #endif // CC_RESOURCES_VIDEO_RESOURCE_UPDATER_H_ |
OLD | NEW |