OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ | 5 #ifndef MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ |
6 #define MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ | 6 #define MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "media/base/bitstream_buffer.h" | 11 #include "media/base/bitstream_buffer.h" |
12 #include "media/base/video_decoder_config.h" | 12 #include "media/base/video_decoder_config.h" |
13 #include "media/video/picture.h" | 13 #include "media/video/picture.h" |
14 #include "ui/gfx/size.h" | 14 #include "ui/gfx/size.h" |
15 | 15 |
16 typedef unsigned int GLenum; | |
17 | |
16 namespace media { | 18 namespace media { |
17 | 19 |
18 // Video decoder interface. | 20 // Video decoder interface. |
19 // This interface is extended by the various components that ultimately | 21 // This interface is extended by the various components that ultimately |
20 // implement the backend of PPB_VideoDecode_Dev. | 22 // implement the backend of PPB_VideoDecode_Dev. |
21 class MEDIA_EXPORT VideoDecodeAccelerator { | 23 class MEDIA_EXPORT VideoDecodeAccelerator { |
22 public: | 24 public: |
23 // Enumeration of potential errors generated by the API. | 25 // Enumeration of potential errors generated by the API. |
24 // Note: Keep these in sync with PP_VideoDecodeError_Dev. Also do not | 26 // Note: Keep these in sync with PP_VideoDecodeError_Dev. Also do not |
25 // rearrange, reuse or remove values as they are used for gathering UMA | 27 // rearrange, reuse or remove values as they are used for gathering UMA |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
136 // content/common/gpu/media should implement this, and implementations in | 138 // content/common/gpu/media should implement this, and implementations in |
137 // other processes should not override the default implementation. | 139 // other processes should not override the default implementation. |
138 // Returns true if VDA::Decode and VDA::Client callbacks can run on the IO | 140 // Returns true if VDA::Decode and VDA::Client callbacks can run on the IO |
139 // thread. Otherwise they will run on the GPU child thread. The purpose of | 141 // thread. Otherwise they will run on the GPU child thread. The purpose of |
140 // running Decode on the IO thread is to reduce decode latency. Note Decode | 142 // running Decode on the IO thread is to reduce decode latency. Note Decode |
141 // should return as soon as possible and not block on the IO thread. Also, | 143 // should return as soon as possible and not block on the IO thread. Also, |
142 // PictureReady should be run on the child thread if a picture is delivered | 144 // PictureReady should be run on the child thread if a picture is delivered |
143 // the first time so it can be cleared. | 145 // the first time so it can be cleared. |
144 virtual bool CanDecodeOnIOThread(); | 146 virtual bool CanDecodeOnIOThread(); |
145 | 147 |
148 // Windows creates a BGRA texture. | |
149 // FIXME: after moving to D3D11, remove this workaround. crbug.com/438691 | |
scherkus (not reviewing)
2014/12/08 22:51:36
ditto
| |
150 virtual GLenum GetSurfaceInternalFormat() const; | |
151 | |
146 protected: | 152 protected: |
147 // Do not delete directly; use Destroy() or own it with a scoped_ptr, which | 153 // Do not delete directly; use Destroy() or own it with a scoped_ptr, which |
148 // will Destroy() it properly by default. | 154 // will Destroy() it properly by default. |
149 virtual ~VideoDecodeAccelerator(); | 155 virtual ~VideoDecodeAccelerator(); |
150 }; | 156 }; |
151 | 157 |
152 } // namespace media | 158 } // namespace media |
153 | 159 |
154 namespace base { | 160 namespace base { |
155 | 161 |
156 template <class T> | 162 template <class T> |
157 struct DefaultDeleter; | 163 struct DefaultDeleter; |
158 | 164 |
159 // Specialize DefaultDeleter so that scoped_ptr<VideoDecodeAccelerator> always | 165 // Specialize DefaultDeleter so that scoped_ptr<VideoDecodeAccelerator> always |
160 // uses "Destroy()" instead of trying to use the destructor. | 166 // uses "Destroy()" instead of trying to use the destructor. |
161 template <> | 167 template <> |
162 struct MEDIA_EXPORT DefaultDeleter<media::VideoDecodeAccelerator> { | 168 struct MEDIA_EXPORT DefaultDeleter<media::VideoDecodeAccelerator> { |
163 public: | 169 public: |
164 void operator()(void* video_decode_accelerator) const; | 170 void operator()(void* video_decode_accelerator) const; |
165 }; | 171 }; |
166 | 172 |
167 } // namespace base | 173 } // namespace base |
168 | 174 |
169 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ | 175 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |