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

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

Issue 185403020: Make VEA client of command buffer; move sync. IPC to VDA/VEA::Initialize() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: f2a9ccb5 Rebase, posciak@ comments. Created 6 years, 9 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
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 CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ 5 #ifndef CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_
6 #define CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ 6 #define CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_
7 7
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 // IPC::Listener implementation. 43 // IPC::Listener implementation.
44 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 44 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
45 45
46 // media::VideoDecodeAccelerator::Client implementation. 46 // media::VideoDecodeAccelerator::Client implementation.
47 virtual void ProvidePictureBuffers(uint32 requested_num_of_buffers, 47 virtual void ProvidePictureBuffers(uint32 requested_num_of_buffers,
48 const gfx::Size& dimensions, 48 const gfx::Size& dimensions,
49 uint32 texture_target) OVERRIDE; 49 uint32 texture_target) OVERRIDE;
50 virtual void DismissPictureBuffer(int32 picture_buffer_id) OVERRIDE; 50 virtual void DismissPictureBuffer(int32 picture_buffer_id) OVERRIDE;
51 virtual void PictureReady(const media::Picture& picture) OVERRIDE; 51 virtual void PictureReady(const media::Picture& picture) OVERRIDE;
52 virtual void NotifyInitializeDone() OVERRIDE;
53 virtual void NotifyError(media::VideoDecodeAccelerator::Error error) OVERRIDE; 52 virtual void NotifyError(media::VideoDecodeAccelerator::Error error) OVERRIDE;
54 virtual void NotifyEndOfBitstreamBuffer(int32 bitstream_buffer_id) OVERRIDE; 53 virtual void NotifyEndOfBitstreamBuffer(int32 bitstream_buffer_id) OVERRIDE;
55 virtual void NotifyFlushDone() OVERRIDE; 54 virtual void NotifyFlushDone() OVERRIDE;
56 virtual void NotifyResetDone() OVERRIDE; 55 virtual void NotifyResetDone() OVERRIDE;
57 56
58 // GpuCommandBufferStub::DestructionObserver implementation. 57 // GpuCommandBufferStub::DestructionObserver implementation.
59 virtual void OnWillDestroyStub() OVERRIDE; 58 virtual void OnWillDestroyStub() OVERRIDE;
60 59
61 // Function to delegate sending to actual sender. 60 // Function to delegate sending to actual sender.
62 virtual bool Send(IPC::Message* message) OVERRIDE; 61 virtual bool Send(IPC::Message* message) OVERRIDE;
63 62
64 // Initialize the accelerator with the given profile and send the 63 // Initialize the accelerator with the given profile and send the
65 // |init_done_msg| when done. 64 // |init_done_msg| when done.
66 // The renderer process handle is valid as long as we have a channel between
67 // GPU process and the renderer.
68 void Initialize(const media::VideoCodecProfile profile, 65 void Initialize(const media::VideoCodecProfile profile,
69 IPC::Message* init_done_msg); 66 IPC::Message* init_done_msg);
70 67
71 private: 68 private:
72 class MessageFilter; 69 class MessageFilter;
73 70
74 // We only allow self-delete, from OnWillDestroyStub(), after cleanup there. 71 // We only allow self-delete, from OnWillDestroyStub(), after cleanup there.
75 virtual ~GpuVideoDecodeAccelerator(); 72 virtual ~GpuVideoDecodeAccelerator();
76 73
77 // Handlers for IPC messages. 74 // Handlers for IPC messages.
78 void OnDecode(base::SharedMemoryHandle handle, int32 id, uint32 size); 75 void OnDecode(base::SharedMemoryHandle handle, int32 id, uint32 size);
79 void OnAssignPictureBuffers(const std::vector<int32>& buffer_ids, 76 void OnAssignPictureBuffers(const std::vector<int32>& buffer_ids,
80 const std::vector<uint32>& texture_ids); 77 const std::vector<uint32>& texture_ids);
81 void OnReusePictureBuffer(int32 picture_buffer_id); 78 void OnReusePictureBuffer(int32 picture_buffer_id);
82 void OnFlush(); 79 void OnFlush();
83 void OnReset(); 80 void OnReset();
84 void OnDestroy(); 81 void OnDestroy();
85 82
86 // Called on IO thread when |filter_| has been removed. 83 // Called on IO thread when |filter_| has been removed.
87 void OnFilterRemoved(); 84 void OnFilterRemoved();
88 85
89 // Sets the texture to cleared. 86 // Sets the texture to cleared.
90 void SetTextureCleared(const media::Picture& picture); 87 void SetTextureCleared(const media::Picture& picture);
91 88
92 // Message to Send() when initialization is done. Is only non-NULL during
93 // initialization and is owned by the IPC channel underlying the
94 // GpuCommandBufferStub.
95 IPC::Message* init_done_msg_;
96
97 // Route ID to communicate with the host. 89 // Route ID to communicate with the host.
98 int32 host_route_id_; 90 int32 host_route_id_;
99 91
100 // Unowned pointer to the underlying GpuCommandBufferStub. 92 // Unowned pointer to the underlying GpuCommandBufferStub. |this| is
93 // registered as a DestuctionObserver of |stub_| and will self-delete when
94 // |stub_| goes is destroyed.
101 GpuCommandBufferStub* stub_; 95 GpuCommandBufferStub* stub_;
102 96
103 // The underlying VideoDecodeAccelerator. 97 // The underlying VideoDecodeAccelerator.
104 scoped_ptr<VideoDecodeAcceleratorImpl> video_decode_accelerator_; 98 scoped_ptr<VideoDecodeAcceleratorImpl> video_decode_accelerator_;
105 99
106 // Callback for making the relevant context current for GL calls. 100 // Callback for making the relevant context current for GL calls.
107 // Returns false if failed. 101 // Returns false if failed.
108 base::Callback<bool(void)> make_context_current_; 102 base::Callback<bool(void)> make_context_current_;
109 103
110 // The texture dimensions as requested by ProvidePictureBuffers(). 104 // The texture dimensions as requested by ProvidePictureBuffers().
(...skipping 25 matching lines...) Expand all
136 130
137 // A map from picture buffer ID to TextureRef that have not been cleared. 131 // A map from picture buffer ID to TextureRef that have not been cleared.
138 std::map<int32, scoped_refptr<gpu::gles2::TextureRef> > uncleared_textures_; 132 std::map<int32, scoped_refptr<gpu::gles2::TextureRef> > uncleared_textures_;
139 133
140 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); 134 DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator);
141 }; 135 };
142 136
143 } // namespace content 137 } // namespace content
144 138
145 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_ 139 #endif // CONTENT_COMMON_GPU_MEDIA_GPU_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698