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

Side by Side Diff: media/filters/gpu_video_decoder.h

Issue 9416087: Add texture target field to video frame (for use by native textures). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: (c) 2011 -> (c) 2012 Created 8 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « media/base/video_frame.cc ('k') | media/filters/gpu_video_decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <deque> 8 #include <deque>
9 #include <list> 9 #include <list>
10 #include <map> 10 #include <map>
(...skipping 22 matching lines...) Expand all
33 // Helper interface for specifying factories needed to instantiate a 33 // Helper interface for specifying factories needed to instantiate a
34 // GpuVideoDecoder. 34 // GpuVideoDecoder.
35 class MEDIA_EXPORT Factories : public base::RefCountedThreadSafe<Factories> { 35 class MEDIA_EXPORT Factories : public base::RefCountedThreadSafe<Factories> {
36 public: 36 public:
37 // Caller owns returned pointer. 37 // Caller owns returned pointer.
38 virtual VideoDecodeAccelerator* CreateVideoDecodeAccelerator( 38 virtual VideoDecodeAccelerator* CreateVideoDecodeAccelerator(
39 VideoDecodeAccelerator::Profile, VideoDecodeAccelerator::Client*) = 0; 39 VideoDecodeAccelerator::Profile, VideoDecodeAccelerator::Client*) = 0;
40 40
41 // Allocate & delete native textures. 41 // Allocate & delete native textures.
42 virtual bool CreateTextures(int32 count, const gfx::Size& size, 42 virtual bool CreateTextures(int32 count, const gfx::Size& size,
43 std::vector<uint32>* texture_ids) = 0; 43 std::vector<uint32>* texture_ids,
44 uint32* texture_target) = 0;
44 virtual void DeleteTexture(uint32 texture_id) = 0; 45 virtual void DeleteTexture(uint32 texture_id) = 0;
45 46
46 // Allocate & return a shared memory segment. Caller is responsible for 47 // Allocate & return a shared memory segment. Caller is responsible for
47 // Close()ing the returned pointer. 48 // Close()ing the returned pointer.
48 virtual base::SharedMemory* CreateSharedMemory(size_t size) = 0; 49 virtual base::SharedMemory* CreateSharedMemory(size_t size) = 0;
49 50
50 protected: 51 protected:
51 friend class base::RefCountedThreadSafe<Factories>; 52 friend class base::RefCountedThreadSafe<Factories>;
52 virtual ~Factories(); 53 virtual ~Factories();
53 }; 54 };
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 // Book-keeping variables. 178 // Book-keeping variables.
178 struct BufferPair { 179 struct BufferPair {
179 BufferPair(SHMBuffer* s, const scoped_refptr<Buffer>& b); 180 BufferPair(SHMBuffer* s, const scoped_refptr<Buffer>& b);
180 ~BufferPair(); 181 ~BufferPair();
181 SHMBuffer* shm_buffer; 182 SHMBuffer* shm_buffer;
182 scoped_refptr<Buffer> buffer; 183 scoped_refptr<Buffer> buffer;
183 }; 184 };
184 std::map<int32, BufferPair> bitstream_buffers_in_decoder_; 185 std::map<int32, BufferPair> bitstream_buffers_in_decoder_;
185 std::map<int32, PictureBuffer> picture_buffers_in_decoder_; 186 std::map<int32, PictureBuffer> picture_buffers_in_decoder_;
186 187
188 // The texture target used for decoded pictures.
189 uint32 decoder_texture_target_;
190
187 struct BufferTimeData { 191 struct BufferTimeData {
188 BufferTimeData(int32 bbid, base::TimeDelta ts, base::TimeDelta dur); 192 BufferTimeData(int32 bbid, base::TimeDelta ts, base::TimeDelta dur);
189 ~BufferTimeData(); 193 ~BufferTimeData();
190 int32 bitstream_buffer_id; 194 int32 bitstream_buffer_id;
191 base::TimeDelta timestamp; 195 base::TimeDelta timestamp;
192 base::TimeDelta duration; 196 base::TimeDelta duration;
193 }; 197 };
194 std::list<BufferTimeData> input_buffer_time_data_; 198 std::list<BufferTimeData> input_buffer_time_data_;
195 199
196 // picture_buffer_id and the frame wrapping the corresponding Picture, for 200 // picture_buffer_id and the frame wrapping the corresponding Picture, for
197 // frames that have been decoded but haven't been requested by a Read() yet. 201 // frames that have been decoded but haven't been requested by a Read() yet.
198 std::list<scoped_refptr<VideoFrame> > ready_video_frames_; 202 std::list<scoped_refptr<VideoFrame> > ready_video_frames_;
199 int64 next_picture_buffer_id_; 203 int64 next_picture_buffer_id_;
200 int64 next_bitstream_buffer_id_; 204 int64 next_bitstream_buffer_id_;
201 205
202 // Indicates PrepareForShutdownHack()'s been called. Makes further calls to 206 // Indicates PrepareForShutdownHack()'s been called. Makes further calls to
203 // this class not require the render thread's loop to be processing. 207 // this class not require the render thread's loop to be processing.
204 bool shutting_down_; 208 bool shutting_down_;
205 209
206 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder); 210 DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder);
207 }; 211 };
208 212
209 } // namespace media 213 } // namespace media
210 214
211 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_ 215 #endif // MEDIA_FILTERS_GPU_VIDEO_DECODER_H_
OLDNEW
« no previous file with comments | « media/base/video_frame.cc ('k') | media/filters/gpu_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698