Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Side by Side Diff: content/common/gpu/media/vt_video_decode_accelerator.h

Issue 645713002: Switch to using make_context_current in VTVideoDecodeAccelerator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@vt_errror_handling
Patch Set: Rebase. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
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_
OLDNEW
« no previous file with comments | « content/common/gpu/media/gpu_video_decode_accelerator.cc ('k') | content/common/gpu/media/vt_video_decode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698