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

Side by Side Diff: ppapi/proxy/ppp_video_decoder_proxy.cc

Issue 7844018: Revert 100748 - This patch tries to remove most of the manual registration for Pepper interfaces,... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 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 | « ppapi/proxy/ppp_video_decoder_proxy.h ('k') | ppapi/proxy/resource_creation_proxy.h » ('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) 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 #include "ppapi/proxy/ppp_video_decoder_proxy.h" 5 #include "ppapi/proxy/ppp_video_decoder_proxy.h"
6 6
7 #include "ppapi/proxy/host_dispatcher.h" 7 #include "ppapi/proxy/host_dispatcher.h"
8 #include "ppapi/proxy/plugin_resource_tracker.h" 8 #include "ppapi/proxy/plugin_resource_tracker.h"
9 #include "ppapi/proxy/ppapi_messages.h" 9 #include "ppapi/proxy/ppapi_messages.h"
10 #include "ppapi/proxy/ppb_video_decoder_proxy.h" 10 #include "ppapi/proxy/ppb_video_decoder_proxy.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 } 71 }
72 72
73 static const PPP_VideoDecoder_Dev video_decoder_interface = { 73 static const PPP_VideoDecoder_Dev video_decoder_interface = {
74 &ProvidePictureBuffers, 74 &ProvidePictureBuffers,
75 &DismissPictureBuffer, 75 &DismissPictureBuffer,
76 &PictureReady, 76 &PictureReady,
77 &EndOfStream, 77 &EndOfStream,
78 &NotifyError 78 &NotifyError
79 }; 79 };
80 80
81 InterfaceProxy* CreateVideoDecoderPPPProxy(Dispatcher* dispatcher) { 81 InterfaceProxy* CreateVideoDecoderPPPProxy(
82 return new PPP_VideoDecoder_Proxy(dispatcher); 82 Dispatcher* dispatcher, const void* target_interface) {
83 return new PPP_VideoDecoder_Proxy(dispatcher, target_interface);
83 } 84 }
84 85
85 } // namespace 86 } // namespace
86 87
87 PPP_VideoDecoder_Proxy::PPP_VideoDecoder_Proxy(Dispatcher* dispatcher) 88 PPP_VideoDecoder_Proxy::PPP_VideoDecoder_Proxy(
88 : InterfaceProxy(dispatcher), 89 Dispatcher* dispatcher, const void* target_interface)
89 ppp_video_decoder_impl_(NULL) { 90 : InterfaceProxy(dispatcher, target_interface) {
90 if (dispatcher->IsPlugin()) {
91 ppp_video_decoder_impl_ = static_cast<const PPP_VideoDecoder_Dev*>(
92 dispatcher->local_get_interface()(PPP_VIDEODECODER_DEV_INTERFACE));
93 }
94 } 91 }
95 92
96 PPP_VideoDecoder_Proxy::~PPP_VideoDecoder_Proxy() { 93 PPP_VideoDecoder_Proxy::~PPP_VideoDecoder_Proxy() {
97 } 94 }
98 95
99 // static 96 // static
100 const InterfaceProxy::Info* PPP_VideoDecoder_Proxy::GetInfo() { 97 const InterfaceProxy::Info* PPP_VideoDecoder_Proxy::GetInfo() {
101 static const Info info = { 98 static const Info info = {
102 &video_decoder_interface, 99 &video_decoder_interface,
103 PPP_VIDEODECODER_DEV_INTERFACE, 100 PPP_VIDEODECODER_DEV_INTERFACE,
(...skipping 21 matching lines...) Expand all
125 IPC_END_MESSAGE_MAP() 122 IPC_END_MESSAGE_MAP()
126 DCHECK(handled); 123 DCHECK(handled);
127 return handled; 124 return handled;
128 } 125 }
129 126
130 void PPP_VideoDecoder_Proxy::OnMsgProvidePictureBuffers( 127 void PPP_VideoDecoder_Proxy::OnMsgProvidePictureBuffers(
131 const HostResource& decoder, uint32_t req_num_of_bufs, 128 const HostResource& decoder, uint32_t req_num_of_bufs,
132 const PP_Size& dimensions) { 129 const PP_Size& dimensions) {
133 PP_Resource plugin_decoder = PluginResourceTracker::GetInstance()-> 130 PP_Resource plugin_decoder = PluginResourceTracker::GetInstance()->
134 PluginResourceForHostResource(decoder); 131 PluginResourceForHostResource(decoder);
135 ppp_video_decoder_impl_->ProvidePictureBuffers( 132 ppp_video_decoder_target()->ProvidePictureBuffers(
136 decoder.instance(), plugin_decoder, req_num_of_bufs, dimensions); 133 decoder.instance(), plugin_decoder, req_num_of_bufs, dimensions);
137 } 134 }
138 135
139 void PPP_VideoDecoder_Proxy::OnMsgDismissPictureBuffer( 136 void PPP_VideoDecoder_Proxy::OnMsgDismissPictureBuffer(
140 const HostResource& decoder, int32_t picture_id) { 137 const HostResource& decoder, int32_t picture_id) {
141 PP_Resource plugin_decoder = PluginResourceTracker::GetInstance()-> 138 PP_Resource plugin_decoder = PluginResourceTracker::GetInstance()->
142 PluginResourceForHostResource(decoder); 139 PluginResourceForHostResource(decoder);
143 ppp_video_decoder_impl_->DismissPictureBuffer( 140 ppp_video_decoder_target()->DismissPictureBuffer(
144 decoder.instance(), plugin_decoder, picture_id); 141 decoder.instance(), plugin_decoder, picture_id);
145 } 142 }
146 143
147 void PPP_VideoDecoder_Proxy::OnMsgPictureReady( 144 void PPP_VideoDecoder_Proxy::OnMsgPictureReady(
148 const HostResource& decoder, const PP_Picture_Dev& picture) { 145 const HostResource& decoder, const PP_Picture_Dev& picture) {
149 PP_Resource plugin_decoder = PluginResourceTracker::GetInstance()-> 146 PP_Resource plugin_decoder = PluginResourceTracker::GetInstance()->
150 PluginResourceForHostResource(decoder); 147 PluginResourceForHostResource(decoder);
151 ppp_video_decoder_impl_->PictureReady( 148 ppp_video_decoder_target()->PictureReady(
152 decoder.instance(), plugin_decoder, picture); 149 decoder.instance(), plugin_decoder, picture);
153 } 150 }
154 151
155 void PPP_VideoDecoder_Proxy::OnMsgNotifyEndOfStream( 152 void PPP_VideoDecoder_Proxy::OnMsgNotifyEndOfStream(
156 const HostResource& decoder) { 153 const HostResource& decoder) {
157 PP_Resource plugin_decoder = PluginResourceTracker::GetInstance()-> 154 PP_Resource plugin_decoder = PluginResourceTracker::GetInstance()->
158 PluginResourceForHostResource(decoder); 155 PluginResourceForHostResource(decoder);
159 ppp_video_decoder_impl_->EndOfStream(decoder.instance(), 156 ppp_video_decoder_target()->EndOfStream(decoder.instance(),
160 plugin_decoder); 157 plugin_decoder);
161 } 158 }
162 159
163 void PPP_VideoDecoder_Proxy::OnMsgNotifyError( 160 void PPP_VideoDecoder_Proxy::OnMsgNotifyError(
164 const HostResource& decoder, PP_VideoDecodeError_Dev error) { 161 const HostResource& decoder, PP_VideoDecodeError_Dev error) {
165 PP_Resource plugin_decoder = PluginResourceTracker::GetInstance()-> 162 PP_Resource plugin_decoder = PluginResourceTracker::GetInstance()->
166 PluginResourceForHostResource(decoder); 163 PluginResourceForHostResource(decoder);
167 ppp_video_decoder_impl_->NotifyError( 164 ppp_video_decoder_target()->NotifyError(
168 decoder.instance(), plugin_decoder, error); 165 decoder.instance(), plugin_decoder, error);
169 } 166 }
170 167
171 } // namespace proxy 168 } // namespace proxy
172 } // namespace ppapi 169 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppp_video_decoder_proxy.h ('k') | ppapi/proxy/resource_creation_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698