Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CONTENT_COMMON_GPU_MEDIA_VT_VIDEO_DECODE_ACCELERATOR_H_ | 5 #ifndef CONTENT_COMMON_GPU_MEDIA_VT_VIDEO_DECODE_ACCELERATOR_H_ |
| 6 #define CONTENT_COMMON_GPU_MEDIA_VT_VIDEO_DECODE_ACCELERATOR_H_ | 6 #define CONTENT_COMMON_GPU_MEDIA_VT_VIDEO_DECODE_ACCELERATOR_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 26 } // namespace base | 26 } // namespace base |
| 27 | 27 |
| 28 namespace content { | 28 namespace content { |
| 29 | 29 |
| 30 // VideoToolbox.framework implementation of the VideoDecodeAccelerator | 30 // VideoToolbox.framework implementation of the VideoDecodeAccelerator |
| 31 // interface for Mac OS X (currently limited to 10.9+). | 31 // interface for Mac OS X (currently limited to 10.9+). |
| 32 class VTVideoDecodeAccelerator | 32 class VTVideoDecodeAccelerator |
| 33 : public media::VideoDecodeAccelerator, | 33 : public media::VideoDecodeAccelerator, |
| 34 public base::NonThreadSafe { | 34 public base::NonThreadSafe { |
| 35 public: | 35 public: |
| 36 explicit VTVideoDecodeAccelerator(CGLContextObj cgl_context); | 36 explicit VTVideoDecodeAccelerator( |
| 37 CGLContextObj cgl_context, | |
|
Pawel Osciak
2014/10/20 08:03:29
Bad indent.
sandersd (OOO until July 31)
2014/10/20 17:55:50
Done.
| |
| 38 const base::Callback<bool(void)>& make_context_current); | |
| 37 virtual ~VTVideoDecodeAccelerator(); | 39 virtual ~VTVideoDecodeAccelerator(); |
| 38 | 40 |
| 39 // VideoDecodeAccelerator implementation. | 41 // VideoDecodeAccelerator implementation. |
| 40 virtual bool Initialize( | 42 virtual bool Initialize( |
| 41 media::VideoCodecProfile profile, | 43 media::VideoCodecProfile profile, |
| 42 Client* client) override; | 44 Client* client) override; |
| 43 virtual void Decode(const media::BitstreamBuffer& bitstream) override; | 45 virtual void Decode(const media::BitstreamBuffer& bitstream) override; |
| 44 virtual void AssignPictureBuffers( | 46 virtual void AssignPictureBuffers( |
| 45 const std::vector<media::PictureBuffer>& pictures) override; | 47 const std::vector<media::PictureBuffer>& pictures) override; |
| 46 virtual void ReusePictureBuffer(int32_t picture_id) override; | 48 virtual void ReusePictureBuffer(int32_t picture_id) override; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 116 void CompleteAction(Action action); | 118 void CompleteAction(Action action); |
| 117 | 119 |
| 118 // Complete all actions pending for a particular |bitstream_id|. | 120 // Complete all actions pending for a particular |bitstream_id|. |
| 119 // Warning: Do not call if there is a pending ACTION_DESTROY. | 121 // Warning: Do not call if there is a pending ACTION_DESTROY. |
| 120 void CompleteActions(int32_t bitstream_id); | 122 void CompleteActions(int32_t bitstream_id); |
| 121 | 123 |
| 122 // | 124 // |
| 123 // GPU thread state. | 125 // GPU thread state. |
| 124 // | 126 // |
| 125 CGLContextObj cgl_context_; | 127 CGLContextObj cgl_context_; |
| 128 base::Callback<bool(void)> make_context_current_; | |
| 126 media::VideoDecodeAccelerator::Client* client_; | 129 media::VideoDecodeAccelerator::Client* client_; |
| 127 bool has_error_; // client_->NotifyError() called. | 130 bool has_error_; // client_->NotifyError() called. |
| 128 gfx::Size texture_size_; | 131 gfx::Size texture_size_; |
| 129 std::queue<PendingAction> pending_actions_; | 132 std::queue<PendingAction> pending_actions_; |
| 130 std::queue<int32_t> pending_bitstream_ids_; | 133 std::queue<int32_t> pending_bitstream_ids_; |
| 131 | 134 |
| 132 // Texture IDs of pictures. | 135 // Texture IDs of pictures. |
| 133 // TODO(sandersd): A single map of structs holding picture data. | 136 // TODO(sandersd): A single map of structs holding picture data. |
| 134 std::map<int32_t, uint32_t> texture_ids_; | 137 std::map<int32_t, uint32_t> texture_ids_; |
| 135 | 138 |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 163 // Declared last to ensure that all decoder thread tasks complete before any | 166 // Declared last to ensure that all decoder thread tasks complete before any |
| 164 // state is destructed. | 167 // state is destructed. |
| 165 base::Thread decoder_thread_; | 168 base::Thread decoder_thread_; |
| 166 | 169 |
| 167 DISALLOW_COPY_AND_ASSIGN(VTVideoDecodeAccelerator); | 170 DISALLOW_COPY_AND_ASSIGN(VTVideoDecodeAccelerator); |
| 168 }; | 171 }; |
| 169 | 172 |
| 170 } // namespace content | 173 } // namespace content |
| 171 | 174 |
| 172 #endif // CONTENT_COMMON_GPU_MEDIA_VT_VIDEO_DECODE_ACCELERATOR_H_ | 175 #endif // CONTENT_COMMON_GPU_MEDIA_VT_VIDEO_DECODE_ACCELERATOR_H_ |
| OLD | NEW |