diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-31 18:32:13 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-31 18:32:13 +0000 |
commit | acda308500fea6641a79f7584516d7d153a4a241 (patch) | |
tree | 7ce924637edc497b81c96829f6c754c60f2575e6 /content/renderer/pepper_plugin_delegate_impl.cc | |
parent | 100421d5653b09d8b61f14bee5465dfe9d1b934c (diff) | |
download | chromium_src-acda308500fea6641a79f7584516d7d153a4a241.zip chromium_src-acda308500fea6641a79f7584516d7d153a4a241.tar.gz chromium_src-acda308500fea6641a79f7584516d7d153a4a241.tar.bz2 |
Checking in major revision of Pepper video decode APIs.
Part of a patch by vmr@chromium.org:
http://codereview.chromium.org/6541068/
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6776008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80028 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/pepper_plugin_delegate_impl.cc')
-rw-r--r-- | content/renderer/pepper_plugin_delegate_impl.cc | 99 |
1 files changed, 4 insertions, 95 deletions
diff --git a/content/renderer/pepper_plugin_delegate_impl.cc b/content/renderer/pepper_plugin_delegate_impl.cc index 28bf23e..9bf35ce 100644 --- a/content/renderer/pepper_plugin_delegate_impl.cc +++ b/content/renderer/pepper_plugin_delegate_impl.cc @@ -282,94 +282,6 @@ void PlatformAudioImpl::OnLowLatencyCreated( } } -// Implements the VideoDecoder. -class PlatformVideoDecoderImpl - : public webkit::ppapi::PluginDelegate::PlatformVideoDecoder { - public: - PlatformVideoDecoderImpl() - : input_buffer_size_(0), - next_dib_id_(0), - dib_(NULL) { - memset(&decoder_config_, 0, sizeof(decoder_config_)); - memset(&flush_callback_, 0, sizeof(flush_callback_)); - } - - virtual bool Init(const PP_VideoDecoderConfig_Dev& decoder_config) { - decoder_config_ = decoder_config; - input_buffer_size_ = 1024 << 4; - - // Allocate the transport DIB. - TransportDIB* dib = TransportDIB::Create(input_buffer_size_, - next_dib_id_++); - if (!dib) - return false; - - // TODO(wjia): Create video decoder in GPU process. - // Meanwhile, delete |dib| to free the resource. - delete dib; - - return true; - } - - virtual bool Decode(PP_VideoCompressedDataBuffer_Dev& input_buffer) { - // TODO(wjia): Implement me! - NOTIMPLEMENTED(); - - input_buffers_.push(&input_buffer); - - // Copy input data to dib_ and send it to GPU video decoder. - - return false; - } - - virtual int32_t Flush(PP_CompletionCallback& callback) { - // TODO(wjia): Implement me! - NOTIMPLEMENTED(); - - // Do nothing if there is a flush pending. - if (flush_callback_.func) - return PP_ERROR_BADARGUMENT; - - flush_callback_ = callback; - - // Call GPU video decoder to flush. - - return PP_ERROR_WOULDBLOCK; - } - - virtual bool ReturnUncompressedDataBuffer( - PP_VideoUncompressedDataBuffer_Dev& buffer) { - // TODO(wjia): Implement me! - NOTIMPLEMENTED(); - - // Deliver the buffer to GPU video decoder. - - return false; - } - - void OnFlushDone() { - if (!flush_callback_.func) - return; - - flush_callback_.func(flush_callback_.user_data, PP_OK); - flush_callback_.func = NULL; - } - - virtual intptr_t GetSharedMemoryHandle() const { - return reinterpret_cast<intptr_t>(dib_.get()); - } - - private: - size_t input_buffer_size_; - int next_dib_id_; - scoped_ptr<TransportDIB> dib_; - PP_VideoDecoderConfig_Dev decoder_config_; - std::queue<PP_VideoCompressedDataBuffer_Dev*> input_buffers_; - PP_CompletionCallback flush_callback_; - - DISALLOW_COPY_AND_ASSIGN(PlatformVideoDecoderImpl); -}; - class DispatcherWrapper : public webkit::ppapi::PluginDelegate::OutOfProcessProxy { public: @@ -603,13 +515,10 @@ webkit::ppapi::PluginDelegate::PlatformContext3D* webkit::ppapi::PluginDelegate::PlatformVideoDecoder* PepperPluginDelegateImpl::CreateVideoDecoder( - const PP_VideoDecoderConfig_Dev& decoder_config) { - scoped_ptr<PlatformVideoDecoderImpl> decoder(new PlatformVideoDecoderImpl()); - - if (!decoder->Init(decoder_config)) - return NULL; - - return decoder.release(); + PP_VideoDecoderConfig_Dev* decoder_config) { + // TODO(vmr): Implement. + NOTIMPLEMENTED(); + return NULL; } void PepperPluginDelegateImpl::NumberOfFindResultsChanged(int identifier, |