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_FILTERS_GPU_VIDEO_DECODER_H_ | 5 #ifndef MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ |
6 #define MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ | 6 #define MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 // GPU-accelerated video decoder implementation. Relies on | 41 // GPU-accelerated video decoder implementation. Relies on |
42 // AcceleratedVideoDecoderMsg_Decode and friends. Can be created on any thread | 42 // AcceleratedVideoDecoderMsg_Decode and friends. Can be created on any thread |
43 // but must be accessed and destroyed on GpuVideoAcceleratorFactories's | 43 // but must be accessed and destroyed on GpuVideoAcceleratorFactories's |
44 // GetMessageLoop(). | 44 // GetMessageLoop(). |
45 class MEDIA_EXPORT GpuVideoDecoder | 45 class MEDIA_EXPORT GpuVideoDecoder |
46 : public VideoDecoder, | 46 : public VideoDecoder, |
47 public VideoDecodeAccelerator::Client { | 47 public VideoDecodeAccelerator::Client { |
48 public: | 48 public: |
49 GpuVideoDecoder(GpuVideoAcceleratorFactories* factories, | 49 GpuVideoDecoder(GpuVideoAcceleratorFactories* factories, |
50 const RequestSurfaceCB& request_surface_cb, | 50 const RequestSurfaceCB& request_surface_cb, |
51 scoped_refptr<MediaLog> media_log); | 51 MediaLog* media_log); |
52 | 52 |
53 // VideoDecoder implementation. | 53 // VideoDecoder implementation. |
54 std::string GetDisplayName() const override; | 54 std::string GetDisplayName() const override; |
55 void Initialize(const VideoDecoderConfig& config, | 55 void Initialize(const VideoDecoderConfig& config, |
56 bool low_delay, | 56 bool low_delay, |
57 CdmContext* cdm_context, | 57 CdmContext* cdm_context, |
58 const InitCB& init_cb, | 58 const InitCB& init_cb, |
59 const OutputCB& output_cb) override; | 59 const OutputCB& output_cb) override; |
60 void Decode(const scoped_refptr<DecoderBuffer>& buffer, | 60 void Decode(const scoped_refptr<DecoderBuffer>& buffer, |
61 const DecodeCB& decode_cb) override; | 61 const DecodeCB& decode_cb) override; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 void CompleteInitialization(int surface_id); | 165 void CompleteInitialization(int surface_id); |
166 | 166 |
167 bool needs_bitstream_conversion_; | 167 bool needs_bitstream_conversion_; |
168 | 168 |
169 GpuVideoAcceleratorFactories* factories_; | 169 GpuVideoAcceleratorFactories* factories_; |
170 | 170 |
171 // For requesting a suface to render to. If this is null the VDA will return | 171 // For requesting a suface to render to. If this is null the VDA will return |
172 // normal video frames and not render them to a surface. | 172 // normal video frames and not render them to a surface. |
173 RequestSurfaceCB request_surface_cb_; | 173 RequestSurfaceCB request_surface_cb_; |
174 | 174 |
175 scoped_refptr<MediaLog> media_log_; | 175 MediaLog* media_log_; |
176 | 176 |
177 // Populated during Initialize() (on success) and unchanged until an error | 177 // Populated during Initialize() (on success) and unchanged until an error |
178 // occurs. | 178 // occurs. |
179 std::unique_ptr<VideoDecodeAccelerator> vda_; | 179 std::unique_ptr<VideoDecodeAccelerator> vda_; |
180 | 180 |
181 // Whether |vda_->Initialize()| has been called. This is used to avoid | 181 // Whether |vda_->Initialize()| has been called. This is used to avoid |
182 // calling Initialize() again while a deferred initialization is in progress. | 182 // calling Initialize() again while a deferred initialization is in progress. |
183 bool vda_initialized_; | 183 bool vda_initialized_; |
184 | 184 |
185 InitCB init_cb_; | 185 InitCB init_cb_; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 // Bound to factories_->GetMessageLoop(). | 262 // Bound to factories_->GetMessageLoop(). |
263 // NOTE: Weak pointers must be invalidated before all other member variables. | 263 // NOTE: Weak pointers must be invalidated before all other member variables. |
264 base::WeakPtrFactory<GpuVideoDecoder> weak_factory_; | 264 base::WeakPtrFactory<GpuVideoDecoder> weak_factory_; |
265 | 265 |
266 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); | 266 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); |
267 }; | 267 }; |
268 | 268 |
269 } // namespace media | 269 } // namespace media |
270 | 270 |
271 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ | 271 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ |
OLD | NEW |