summaryrefslogtreecommitdiffstats
path: root/webkit/plugins
diff options
context:
space:
mode:
authordavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-10 18:55:06 +0000
committerdavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-10 18:55:06 +0000
commite0b3ea152c9450288319cd65329a8f664cac9107 (patch)
tree6472d42e6d5d847ea3bb8a42ee0d536d3673f998 /webkit/plugins
parentd2f777617b4c8873e6b72dcd3a0fd6809f7e4dbb (diff)
downloadchromium_src-e0b3ea152c9450288319cd65329a8f664cac9107.zip
chromium_src-e0b3ea152c9450288319cd65329a8f664cac9107.tar.gz
chromium_src-e0b3ea152c9450288319cd65329a8f664cac9107.tar.bz2
Revert 88698 - Implement AssignGLESBuffers for VideoDecode PPAPI
Fills in implementation for AssignGLESBuffers where it was missing. Also updates OmxVideoDecodeAccelerator to reflect the changes. BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/6965010 TBR=vrk@google.com Review URL: http://codereview.chromium.org/7044115 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88702 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins')
-rw-r--r--webkit/plugins/ppapi/mock_plugin_delegate.cc3
-rw-r--r--webkit/plugins/ppapi/mock_plugin_delegate.h3
-rw-r--r--webkit/plugins/ppapi/plugin_delegate.h7
-rw-r--r--webkit/plugins/ppapi/ppb_video_decoder_impl.cc41
-rw-r--r--webkit/plugins/ppapi/ppb_video_decoder_impl.h3
5 files changed, 15 insertions, 42 deletions
diff --git a/webkit/plugins/ppapi/mock_plugin_delegate.cc b/webkit/plugins/ppapi/mock_plugin_delegate.cc
index 476d4c9..9905791 100644
--- a/webkit/plugins/ppapi/mock_plugin_delegate.cc
+++ b/webkit/plugins/ppapi/mock_plugin_delegate.cc
@@ -45,8 +45,7 @@ MockPluginDelegate::PlatformContext3D* MockPluginDelegate::CreateContext3D() {
MockPluginDelegate::PlatformVideoDecoder*
MockPluginDelegate::CreateVideoDecoder(
- media::VideoDecodeAccelerator::Client* client,
- int command_buffer_route_id) {
+ media::VideoDecodeAccelerator::Client* client) {
return NULL;
}
diff --git a/webkit/plugins/ppapi/mock_plugin_delegate.h b/webkit/plugins/ppapi/mock_plugin_delegate.h
index 0b91348..940dece 100644
--- a/webkit/plugins/ppapi/mock_plugin_delegate.h
+++ b/webkit/plugins/ppapi/mock_plugin_delegate.h
@@ -23,8 +23,7 @@ class MockPluginDelegate : public PluginDelegate {
virtual PlatformImage2D* CreateImage2D(int width, int height);
virtual PlatformContext3D* CreateContext3D();
virtual PlatformVideoDecoder* CreateVideoDecoder(
- media::VideoDecodeAccelerator::Client* client,
- int command_buffer_route_id);
+ media::VideoDecodeAccelerator::Client* client);
virtual PlatformAudio* CreateAudio(uint32_t sample_rate,
uint32_t sample_count,
PlatformAudio::Client* client);
diff --git a/webkit/plugins/ppapi/plugin_delegate.h b/webkit/plugins/ppapi/plugin_delegate.h
index c72eaaa..931a39d 100644
--- a/webkit/plugins/ppapi/plugin_delegate.h
+++ b/webkit/plugins/ppapi/plugin_delegate.h
@@ -174,10 +174,6 @@ class PluginDelegate {
// destroyed.
virtual ::gpu::CommandBuffer* GetCommandBuffer() = 0;
- // If the command buffer is routed in the GPU channel, return the route id.
- // Otherwise return 0.
- virtual int GetCommandBufferRouteId() = 0;
-
// Set an optional callback that will be invoked when the context is lost
// (e.g. gpu process crash). Takes ownership of the callback.
virtual void SetContextLostCallback(Callback0::Type* callback) = 0;
@@ -262,8 +258,7 @@ class PluginDelegate {
// The caller will own the pointer returned from this.
virtual PlatformVideoDecoder* CreateVideoDecoder(
- media::VideoDecodeAccelerator::Client* client,
- int command_buffer_route_id) = 0;
+ media::VideoDecodeAccelerator::Client* client) = 0;
// The caller is responsible for calling Shutdown() on the returned pointer
// to clean up the corresponding resources allocated during this call.
diff --git a/webkit/plugins/ppapi/ppb_video_decoder_impl.cc b/webkit/plugins/ppapi/ppb_video_decoder_impl.cc
index 47777c4..5fd318a 100644
--- a/webkit/plugins/ppapi/ppb_video_decoder_impl.cc
+++ b/webkit/plugins/ppapi/ppb_video_decoder_impl.cc
@@ -7,7 +7,6 @@
#include <string>
#include "base/logging.h"
-#include "base/message_loop.h"
#include "media/video/picture.h"
#include "ppapi/c/dev/pp_video_dev.h"
#include "ppapi/c/dev/ppb_video_decoder_dev.h"
@@ -19,7 +18,6 @@
#include "webkit/plugins/ppapi/plugin_module.h"
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
#include "webkit/plugins/ppapi/ppb_buffer_impl.h"
-#include "webkit/plugins/ppapi/ppb_context_3d_impl.h"
#include "webkit/plugins/ppapi/resource_tracker.h"
#include "webkit/plugins/ppapi/var.h"
@@ -56,7 +54,6 @@ PP_Resource Create(PP_Instance instance_id) {
}
int32_t Initialize(PP_Resource video_decoder,
- PP_Resource context_id,
const PP_VideoConfigElement* decoder_config,
struct PP_CompletionCallback callback) {
scoped_refptr<PPB_VideoDecoder_Impl> decoder(
@@ -64,7 +61,7 @@ int32_t Initialize(PP_Resource video_decoder,
if (!decoder)
return PP_ERROR_BADRESOURCE;
- return decoder->Initialize(context_id, decoder_config, callback);
+ return decoder->Initialize(decoder_config, callback);
}
PP_Bool IsVideoDecoder(PP_Resource resource) {
@@ -223,29 +220,15 @@ bool PPB_VideoDecoder_Impl::GetConfigs(
}
int32_t PPB_VideoDecoder_Impl::Initialize(
- PP_Resource context_id,
const PP_VideoConfigElement* decoder_config,
PP_CompletionCallback callback) {
if (!callback.func)
return PP_ERROR_BADARGUMENT;
-
if (!instance())
return PP_ERROR_FAILED;
- scoped_refptr<webkit::ppapi::PPB_Context3D_Impl> context3d =
- webkit::ppapi::Resource::GetAs<webkit::ppapi::PPB_Context3D_Impl>(
- context_id);
- if (!context3d)
- return PP_ERROR_BADRESOURCE;
-
- int command_buffer_route_id =
- context3d->platform_context()->GetCommandBufferRouteId();
- if (command_buffer_route_id == 0)
- return PP_ERROR_FAILED;
-
platform_video_decoder_.reset(
- instance()->delegate()->CreateVideoDecoder(
- this, command_buffer_route_id));
+ instance()->delegate()->CreateVideoDecoder(this));
if (!platform_video_decoder_.get())
return PP_ERROR_FAILED;
@@ -365,8 +348,7 @@ void PPB_VideoDecoder_Impl::ProvidePictureBuffers(
PP_Size out_dim = PP_MakeSize(dimensions.width(), dimensions.height());
ScopedResourceId resource(this);
ppp_videodecoder_->ProvidePictureBuffers(
- instance()->pp_instance(), resource.id, requested_num_of_buffers,
- out_dim, out_type);
+ resource.id, requested_num_of_buffers, out_dim, out_type);
}
void PPB_VideoDecoder_Impl::PictureReady(const media::Picture& picture) {
@@ -376,8 +358,7 @@ void PPB_VideoDecoder_Impl::PictureReady(const media::Picture& picture) {
ScopedResourceId resource(this);
PP_Picture_Dev out_pic;
CopyToPictureDev(picture, &out_pic);
- ppp_videodecoder_->PictureReady(
- instance()->pp_instance(), resource.id, out_pic);
+ ppp_videodecoder_->PictureReady(resource.id, out_pic);
}
void PPB_VideoDecoder_Impl::DismissPictureBuffer(int32 picture_buffer_id) {
@@ -385,8 +366,7 @@ void PPB_VideoDecoder_Impl::DismissPictureBuffer(int32 picture_buffer_id) {
return;
ScopedResourceId resource(this);
- ppp_videodecoder_->DismissPictureBuffer(
- instance()->pp_instance(), resource.id, picture_buffer_id);
+ ppp_videodecoder_->DismissPictureBuffer(resource.id, picture_buffer_id);
}
void PPB_VideoDecoder_Impl::NotifyEndOfStream() {
@@ -394,7 +374,7 @@ void PPB_VideoDecoder_Impl::NotifyEndOfStream() {
return;
ScopedResourceId resource(this);
- ppp_videodecoder_->EndOfStream(instance()->pp_instance(), resource.id);
+ ppp_videodecoder_->EndOfStream(resource.id);
}
void PPB_VideoDecoder_Impl::NotifyError(
@@ -407,7 +387,7 @@ void PPB_VideoDecoder_Impl::NotifyError(
// PP_VideoDecodeError_Dev have identical enum values. There is no compiler
// assert to guarantee this. We either need to add such asserts or
// merge these two enums.
- ppp_videodecoder_->NotifyError(instance()->pp_instance(), resource.id,
+ ppp_videodecoder_->NotifyError(resource.id,
static_cast<PP_VideoDecodeError_Dev>(error));
}
@@ -449,17 +429,18 @@ void PPB_VideoDecoder_Impl::NotifyInitializeDone() {
// These functions are declared in picture.h but are defined here because of
// dependencies (we can't depend on ppapi types from media).
-// TODO(fischman/vrk): Find a way to clean this up as it violates the spirit of
-// checkdeps.
namespace media {
BaseBuffer::BaseBuffer(const PP_BufferInfo_Dev& info)
: id_(info.id),
size_(info.size.width, info.size.height) {
}
+// TODO(vrk): This assigns the PP_Resource context to be
+// the context_id. Not sure what it's actually supposed to be.
GLESBuffer::GLESBuffer(const PP_GLESBuffer_Dev& buffer)
: BaseBuffer(buffer.info),
- texture_id_(buffer.texture_id) {
+ texture_id_(buffer.texture_id),
+ context_id_(buffer.context) {
}
SysmemBuffer::SysmemBuffer(const PP_SysmemBuffer_Dev& buffer)
diff --git a/webkit/plugins/ppapi/ppb_video_decoder_impl.h b/webkit/plugins/ppapi/ppb_video_decoder_impl.h
index 7af31a0..f67aa83 100644
--- a/webkit/plugins/ppapi/ppb_video_decoder_impl.h
+++ b/webkit/plugins/ppapi/ppb_video_decoder_impl.h
@@ -46,8 +46,7 @@ class PPB_VideoDecoder_Impl : public Resource,
PP_VideoConfigElement* matching_configs,
uint32_t matching_configs_size,
uint32_t* num_of_matching_configs);
- int32_t Initialize(PP_Resource context_id,
- const PP_VideoConfigElement* dec_config,
+ int32_t Initialize(const PP_VideoConfigElement* dec_config,
PP_CompletionCallback callback);
int32_t Decode(const PP_VideoBitstreamBuffer_Dev* bitstream_buffer,
PP_CompletionCallback callback);