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" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // "seek". | 125 // "seek". |
126 virtual void Reset() = 0; | 126 virtual void Reset() = 0; |
127 | 127 |
128 // Destroys the decoder: all pending inputs are dropped immediately and the | 128 // Destroys the decoder: all pending inputs are dropped immediately and the |
129 // component is freed. This call may asynchornously free system resources, | 129 // component is freed. This call may asynchornously free system resources, |
130 // but its client-visible effects are synchronous. After this method returns | 130 // but its client-visible effects are synchronous. After this method returns |
131 // no more callbacks will be made on the client. Deletes |this| | 131 // no more callbacks will be made on the client. Deletes |this| |
132 // unconditionally, so make sure to drop all pointers to it! | 132 // unconditionally, so make sure to drop all pointers to it! |
133 virtual void Destroy() = 0; | 133 virtual void Destroy() = 0; |
134 | 134 |
135 // GPU PROCESS ONLY. Implementations of this interface in the | |
136 // content/common/gpu/media should implement this, and implementations in | |
137 // other processes should not override the default implementation. | |
138 // 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 | |
140 // 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, | |
142 // PictureReady should be run on the child thread if a picture is delivered | |
143 // the first time so it can be cleared. | |
144 virtual bool CanDecodeOnIOThread(); | |
145 | |
146 protected: | 135 protected: |
147 // Do not delete directly; use Destroy() or own it with a scoped_ptr, which | 136 // Do not delete directly; use Destroy() or own it with a scoped_ptr, which |
148 // will Destroy() it properly by default. | 137 // will Destroy() it properly by default. |
149 virtual ~VideoDecodeAccelerator(); | 138 virtual ~VideoDecodeAccelerator(); |
150 }; | 139 }; |
151 | 140 |
152 } // namespace media | 141 } // namespace media |
153 | 142 |
154 namespace base { | 143 namespace base { |
155 | 144 |
156 template <class T> | 145 template <class T> |
157 struct DefaultDeleter; | 146 struct DefaultDeleter; |
158 | 147 |
159 // Specialize DefaultDeleter so that scoped_ptr<VideoDecodeAccelerator> always | 148 // Specialize DefaultDeleter so that scoped_ptr<VideoDecodeAccelerator> always |
160 // uses "Destroy()" instead of trying to use the destructor. | 149 // uses "Destroy()" instead of trying to use the destructor. |
161 template <> | 150 template <> |
162 struct MEDIA_EXPORT DefaultDeleter<media::VideoDecodeAccelerator> { | 151 struct MEDIA_EXPORT DefaultDeleter<media::VideoDecodeAccelerator> { |
163 public: | 152 public: |
164 void operator()(void* video_decode_accelerator) const; | 153 void operator()(void* video_decode_accelerator) const; |
165 }; | 154 }; |
166 | 155 |
167 } // namespace base | 156 } // namespace base |
168 | 157 |
169 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ | 158 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |