OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_GPU_GPU_VIDEO_DECODE_ACCELERATOR_H_ | 5 #ifndef CONTENT_GPU_GPU_VIDEO_DECODE_ACCELERATOR_H_ |
6 #define CONTENT_GPU_GPU_VIDEO_DECODE_ACCELERATOR_H_ | 6 #define CONTENT_GPU_GPU_VIDEO_DECODE_ACCELERATOR_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 virtual void NotifyError(media::VideoDecodeAccelerator::Error error) OVERRIDE; | 38 virtual void NotifyError(media::VideoDecodeAccelerator::Error error) OVERRIDE; |
39 virtual void NotifyEndOfBitstreamBuffer(int32 bitstream_buffer_id) OVERRIDE; | 39 virtual void NotifyEndOfBitstreamBuffer(int32 bitstream_buffer_id) OVERRIDE; |
40 virtual void NotifyFlushDone() OVERRIDE; | 40 virtual void NotifyFlushDone() OVERRIDE; |
41 virtual void NotifyAbortDone() OVERRIDE; | 41 virtual void NotifyAbortDone() OVERRIDE; |
42 | 42 |
43 // Function to delegate sending to actual sender. | 43 // Function to delegate sending to actual sender. |
44 virtual bool Send(IPC::Message* message); | 44 virtual bool Send(IPC::Message* message); |
45 | 45 |
46 void set_video_decode_accelerator( | 46 void set_video_decode_accelerator( |
47 media::VideoDecodeAccelerator* accelerator) { | 47 media::VideoDecodeAccelerator* accelerator) { |
48 DCHECK(!video_decode_accelerator_.get()); | 48 video_decode_accelerator_ = accelerator; |
49 video_decode_accelerator_.reset(accelerator); | |
50 } | 49 } |
51 | 50 |
52 private: | 51 private: |
53 // Handlers for IPC messages. | 52 // Handlers for IPC messages. |
54 void OnGetConfigs(const std::vector<uint32>& config, | 53 void OnGetConfigs(const std::vector<uint32>& config, |
55 std::vector<uint32>* configs); | 54 std::vector<uint32>* configs); |
56 void OnInitialize(const std::vector<uint32>& configs); | 55 void OnInitialize(const std::vector<uint32>& configs); |
57 void OnDecode(int32 id, base::SharedMemoryHandle handle, int32 size); | 56 void OnDecode(int32 id, base::SharedMemoryHandle handle, int32 size); |
58 void OnAssignGLESBuffers(const std::vector<int32> buffer_ids, | 57 void OnAssignGLESBuffers(const std::vector<int32> buffer_ids, |
59 const std::vector<uint32> texture_ids, | 58 const std::vector<uint32> texture_ids, |
60 const std::vector<uint32> context_ids, | 59 const std::vector<uint32> context_ids, |
61 const std::vector<gfx::Size> sizes); | 60 const std::vector<gfx::Size> sizes); |
62 void OnAssignSysmemBuffers(const std::vector<int32> buffer_ids, | 61 void OnAssignSysmemBuffers(const std::vector<int32> buffer_ids, |
63 const std::vector<base::SharedMemoryHandle> data, | 62 const std::vector<base::SharedMemoryHandle> data, |
64 const std::vector<gfx::Size> sizes); | 63 const std::vector<gfx::Size> sizes); |
65 void OnReusePictureBuffer(int32 picture_buffer_id); | 64 void OnReusePictureBuffer(int32 picture_buffer_id); |
66 void OnFlush(); | 65 void OnFlush(); |
67 void OnAbort(); | 66 void OnAbort(); |
68 | 67 |
69 // Pointer to the IPC message sender. | 68 // Pointer to the IPC message sender. |
70 IPC::Message::Sender* sender_; | 69 IPC::Message::Sender* sender_; |
71 | 70 |
72 // Route ID to communicate with the host. | 71 // Route ID to communicate with the host. |
73 int32 route_id_; | 72 int32 route_id_; |
74 | 73 |
75 // Pointer to the underlying VideoDecodeAccelerator. | 74 // Pointer to the underlying VideoDecodeAccelerator. |
76 scoped_ptr<media::VideoDecodeAccelerator> video_decode_accelerator_; | 75 media::VideoDecodeAccelerator* video_decode_accelerator_; |
77 | 76 |
78 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); | 77 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); |
79 }; | 78 }; |
80 | 79 |
81 #endif // CONTENT_GPU_GPU_VIDEO_DECODE_ACCELERATOR_H_ | 80 #endif // CONTENT_GPU_GPU_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |