Commit 5cd02a97 authored by fischman@chromium.org's avatar fischman@chromium.org

Updated OMX decoder for recent PPAPI changes, and added to the build.

Had to move from content/gpu to content/common/gpu to allow gpu_video_service.cc
to depend on the decoder.
Removed some dead code and did some random cleanup while I was in there.

BUG=none
TEST=chrome compiles on cros/arm!

Review URL: http://codereview.chromium.org/7057027

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86681 0039d316-1c4b-4281-b951-d872f2087c98
parent 11f764bb
...@@ -3471,22 +3471,6 @@ ...@@ -3471,22 +3471,6 @@
# '<(DEPTH)/ui/gfx/size.cc', # '<(DEPTH)/ui/gfx/size.cc',
# '<(DEPTH)/ui/gfx/size.h', # '<(DEPTH)/ui/gfx/size.h',
# ], # ],
# 'conditions': [
# ['target_arch=="arm"', {
# 'sources': [
# '<(DEPTH)/content/gpu/gles2_texture_to_egl_image_translator.cc',
# '<(DEPTH)/content/gpu/gles2_texture_to_egl_image_translator.h',
# '<(DEPTH)/content/gpu/omx_video_decode_accelerator.cc',
# '<(DEPTH)/content/gpu/omx_video_decode_accelerator.h',
# ],
# 'link_settings': {
# 'libraries': [
# '-lEGL',
# '-lGLESv2',
# ],
# },
# }],
# ],
# }, # },
{ {
'target_name': 'plugin_tests', 'target_name': 'plugin_tests',
......
...@@ -6,4 +6,5 @@ include_rules = [ ...@@ -6,4 +6,5 @@ include_rules = [
"+media/base", "+media/base",
"+media/video", "+media/video",
"+skia", "+skia",
"+third_party/openmax",
] ]
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "content/gpu/gles2_texture_to_egl_image_translator.h" #include "content/common/gpu/gles2_texture_to_egl_image_translator.h"
#include "base/logging.h"
// Get EGL extension functions. // Get EGL extension functions.
static PFNEGLCREATEIMAGEKHRPROC egl_create_image_khr = static PFNEGLCREATEIMAGEKHRPROC egl_create_image_khr =
...@@ -69,5 +71,3 @@ void Gles2TextureToEglImageTranslator::DestroyEglImage(EGLImageKHR egl_image) { ...@@ -69,5 +71,3 @@ void Gles2TextureToEglImageTranslator::DestroyEglImage(EGLImageKHR egl_image) {
} }
egl_destroy_image_khr(egl_display_, egl_image); egl_destroy_image_khr(egl_display_, egl_image);
} }
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CONTENT_GPU_GLES2_TEXTURE_TO_EGL_IMAGE_TRANSLATOR_H_ #ifndef CONTENT_COMMON_GPU_GLES2_TEXTURE_TO_EGL_IMAGE_TRANSLATOR_H_
#define CONTENT_GPU_GLES2_TEXTURE_TO_EGL_IMAGE_TRANSLATOR_H_ #define CONTENT_COMMON_GPU_GLES2_TEXTURE_TO_EGL_IMAGE_TRANSLATOR_H_
#include <EGL/egl.h> #include <EGL/egl.h>
#include <EGL/eglext.h> #include <EGL/eglext.h>
...@@ -36,6 +36,4 @@ class Gles2TextureToEglImageTranslator { ...@@ -36,6 +36,4 @@ class Gles2TextureToEglImageTranslator {
DISALLOW_IMPLICIT_CONSTRUCTORS(Gles2TextureToEglImageTranslator); DISALLOW_IMPLICIT_CONSTRUCTORS(Gles2TextureToEglImageTranslator);
}; };
#endif // CONTENT_GPU_GLES2_TEXTURE_TO_EGL_IMAGE_TRANSLATOR_H_ #endif // CONTENT_COMMON_GPU_GLES2_TEXTURE_TO_EGL_IMAGE_TRANSLATOR_H_
...@@ -108,7 +108,7 @@ void GpuVideoDecodeAccelerator::OnGetConfigs( ...@@ -108,7 +108,7 @@ void GpuVideoDecodeAccelerator::OnGetConfigs(
void GpuVideoDecodeAccelerator::OnInitialize( void GpuVideoDecodeAccelerator::OnInitialize(
const std::vector<uint32>& configs) { const std::vector<uint32>& configs) {
if (!video_decode_accelerator_) if (!video_decode_accelerator_.get())
return; return;
video_decode_accelerator_->Initialize(configs); video_decode_accelerator_->Initialize(configs);
...@@ -117,7 +117,7 @@ void GpuVideoDecodeAccelerator::OnInitialize( ...@@ -117,7 +117,7 @@ void GpuVideoDecodeAccelerator::OnInitialize(
void GpuVideoDecodeAccelerator::OnDecode(int32 id, void GpuVideoDecodeAccelerator::OnDecode(int32 id,
base::SharedMemoryHandle handle, base::SharedMemoryHandle handle,
int32 size) { int32 size) {
if (!video_decode_accelerator_) if (!video_decode_accelerator_.get())
return; return;
video_decode_accelerator_->Decode(media::BitstreamBuffer(id, handle, size)); video_decode_accelerator_->Decode(media::BitstreamBuffer(id, handle, size));
} }
...@@ -140,14 +140,14 @@ void GpuVideoDecodeAccelerator::OnAssignSysmemBuffers( ...@@ -140,14 +140,14 @@ void GpuVideoDecodeAccelerator::OnAssignSysmemBuffers(
} }
void GpuVideoDecodeAccelerator::OnReusePictureBuffer(int32 picture_buffer_id) { void GpuVideoDecodeAccelerator::OnReusePictureBuffer(int32 picture_buffer_id) {
if (!video_decode_accelerator_) if (!video_decode_accelerator_.get())
return; return;
video_decode_accelerator_->ReusePictureBuffer(picture_buffer_id); video_decode_accelerator_->ReusePictureBuffer(picture_buffer_id);
} }
void GpuVideoDecodeAccelerator::OnFlush() { void GpuVideoDecodeAccelerator::OnFlush() {
if (!video_decode_accelerator_) if (!video_decode_accelerator_.get())
return; return;
if (!video_decode_accelerator_->Flush()) { if (!video_decode_accelerator_->Flush()) {
...@@ -157,7 +157,7 @@ void GpuVideoDecodeAccelerator::OnFlush() { ...@@ -157,7 +157,7 @@ void GpuVideoDecodeAccelerator::OnFlush() {
} }
void GpuVideoDecodeAccelerator::OnAbort() { void GpuVideoDecodeAccelerator::OnAbort() {
if (!video_decode_accelerator_) if (!video_decode_accelerator_.get())
return; return;
video_decode_accelerator_->Abort(); video_decode_accelerator_->Abort();
......
...@@ -45,7 +45,8 @@ class GpuVideoDecodeAccelerator ...@@ -45,7 +45,8 @@ class GpuVideoDecodeAccelerator
void set_video_decode_accelerator( void set_video_decode_accelerator(
media::VideoDecodeAccelerator* accelerator) { media::VideoDecodeAccelerator* accelerator) {
video_decode_accelerator_ = accelerator; DCHECK(!video_decode_accelerator_.get());
video_decode_accelerator_.reset(accelerator);
} }
private: private:
...@@ -72,7 +73,7 @@ class GpuVideoDecodeAccelerator ...@@ -72,7 +73,7 @@ class GpuVideoDecodeAccelerator
int32 route_id_; int32 route_id_;
// Pointer to the underlying VideoDecodeAccelerator. // Pointer to the underlying VideoDecodeAccelerator.
media::VideoDecodeAccelerator* video_decode_accelerator_; scoped_ptr<media::VideoDecodeAccelerator> video_decode_accelerator_;
DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator);
}; };
......
...@@ -8,6 +8,10 @@ ...@@ -8,6 +8,10 @@
#include "content/common/gpu/gpu_messages.h" #include "content/common/gpu/gpu_messages.h"
#include "content/common/gpu/gpu_video_decode_accelerator.h" #include "content/common/gpu/gpu_video_decode_accelerator.h"
#if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)
#include "content/common/gpu/omx_video_decode_accelerator.h"
#endif // defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)
GpuVideoService::GpuVideoService() { GpuVideoService::GpuVideoService() {
// TODO(jiesun): move this time consuming stuff out of here. // TODO(jiesun): move this time consuming stuff out of here.
IntializeGpuVideoService(); IntializeGpuVideoService();
...@@ -57,6 +61,10 @@ bool GpuVideoService::CreateVideoDecoder( ...@@ -57,6 +61,10 @@ bool GpuVideoService::CreateVideoDecoder(
// Create GpuVideoDecodeAccelerator and add to map. // Create GpuVideoDecodeAccelerator and add to map.
scoped_refptr<GpuVideoDecodeAccelerator> decoder = scoped_refptr<GpuVideoDecodeAccelerator> decoder =
new GpuVideoDecodeAccelerator(channel, decoder_host_id); new GpuVideoDecodeAccelerator(channel, decoder_host_id);
#if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)
decoder->set_video_decode_accelerator(
new OmxVideoDecodeAccelerator(decoder, MessageLoop::current()));
#endif // defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)
bool result = decoder_map_.insert(std::make_pair(decoder_id, decoder)).second; bool result = decoder_map_.insert(std::make_pair(decoder_id, decoder)).second;
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CONTENT_GPU_OMX_VIDEO_DECODE_ACCELERATOR_H_ #ifndef CONTENT_COMMON_GPU_OMX_VIDEO_DECODE_ACCELERATOR_H_
#define CONTENT_GPU_OMX_VIDEO_DECODE_ACCELERATOR_H_ #define CONTENT_COMMON_GPU_OMX_VIDEO_DECODE_ACCELERATOR_H_
#include <dlfcn.h> #include <dlfcn.h>
#include <map> #include <map>
...@@ -30,20 +30,25 @@ class OmxVideoDecodeAccelerator : public media::VideoDecodeAccelerator { ...@@ -30,20 +30,25 @@ class OmxVideoDecodeAccelerator : public media::VideoDecodeAccelerator {
virtual ~OmxVideoDecodeAccelerator(); virtual ~OmxVideoDecodeAccelerator();
// media::VideoDecodeAccelerator implementation. // media::VideoDecodeAccelerator implementation.
const std::vector<uint32>& GetConfig( void GetConfigs(const std::vector<uint32>& requested_configs,
const std::vector<uint32>& prototype_config); std::vector<uint32>* matched_configs) OVERRIDE;
bool Initialize(const std::vector<uint32>& config); bool Initialize(const std::vector<uint32>& config) OVERRIDE;
bool Decode(const media::BitstreamBuffer& bitstream_buffer, bool Decode(const media::BitstreamBuffer& bitstream_buffer) OVERRIDE;
const media::VideoDecodeAcceleratorCallback& callback); virtual void AssignGLESBuffers(
void AssignPictureBuffer(std::vector<PictureBuffer*> picture_buffers); const std::vector<media::GLESBuffer>& buffers) OVERRIDE;
void ReusePictureBuffer(int32 picture_buffer_id); virtual void AssignSysmemBuffers(
bool Flush(const media::VideoDecodeAcceleratorCallback& callback); const std::vector<media::SysmemBuffer>& buffers) OVERRIDE;
bool Abort(const media::VideoDecodeAcceleratorCallback& callback); void ReusePictureBuffer(int32 picture_buffer_id) OVERRIDE;
bool Flush() OVERRIDE;
bool Abort() OVERRIDE;
private: private:
MessageLoop* message_loop_; MessageLoop* message_loop_;
OMX_HANDLETYPE component_handle_; OMX_HANDLETYPE component_handle_;
// Common initialization code for Assign{GLES,Sysmem}Buffers.
void AssignBuffersHelper(const std::vector<media::BaseBuffer*>& buffers);
// Create the Component for OMX. Handles all OMX initialization. // Create the Component for OMX. Handles all OMX initialization.
bool CreateComponent(); bool CreateComponent();
// Buffer allocation/free methods for input and output buffers. // Buffer allocation/free methods for input and output buffers.
...@@ -102,18 +107,13 @@ class OmxVideoDecodeAccelerator : public media::VideoDecodeAccelerator { ...@@ -102,18 +107,13 @@ class OmxVideoDecodeAccelerator : public media::VideoDecodeAccelerator {
std::queue<OMX_BUFFERHEADERTYPE*> free_input_buffers_; std::queue<OMX_BUFFERHEADERTYPE*> free_input_buffers_;
// For output buffer recycling cases. // For output buffer recycling cases.
std::vector<media::VideoDecodeAccelerator::PictureBuffer*> std::vector<media::BaseBuffer*> assigned_picture_buffers_;
assigned_picture_buffers_; typedef std::pair<int32, OMX_BUFFERHEADERTYPE*> OutputPicture;
typedef std::pair<PictureBuffer*,
OMX_BUFFERHEADERTYPE*> OutputPicture;
std::vector<OutputPicture> output_pictures_; std::vector<OutputPicture> output_pictures_;
// To expose client callbacks from VideoDecodeAccelerator. // To expose client callbacks from VideoDecodeAccelerator.
Client* client_; Client* client_;
media::VideoDecodeAcceleratorCallback flush_done_callback_;
media::VideoDecodeAcceleratorCallback abort_done_callback_;
std::vector<uint32> texture_ids_; std::vector<uint32> texture_ids_;
std::vector<uint32> context_ids_; std::vector<uint32> context_ids_;
// Method to handle events // Method to handle events
...@@ -127,14 +127,10 @@ class OmxVideoDecodeAccelerator : public media::VideoDecodeAccelerator { ...@@ -127,14 +127,10 @@ class OmxVideoDecodeAccelerator : public media::VideoDecodeAccelerator {
// Method to receive buffers from component's output port // Method to receive buffers from component's output port
void FillBufferDoneTask(OMX_BUFFERHEADERTYPE* buffer); void FillBufferDoneTask(OMX_BUFFERHEADERTYPE* buffer);
typedef std::pair<OMX_BUFFERHEADERTYPE*, uint32> OMXbufferTexture; typedef std::pair<OMX_BUFFERHEADERTYPE*, uint32> OMXbufferTexture;
// void pointer to hold EGLImage handle.
void* egl_image_;
typedef std::map< typedef std::map<OMX_BUFFERHEADERTYPE*,
OMX_BUFFERHEADERTYPE*, std::pair<base::SharedMemory*, int32> > OMXBufferIdMap;
std::pair<base::SharedMemory*, OMXBufferIdMap omx_buff_ids_;
media::VideoDecodeAcceleratorCallback> > OMXBufferCallbackMap;
OMXBufferCallbackMap omx_buff_cb_;
// Method used the change the state of the port. // Method used the change the state of the port.
void ChangePort(OMX_COMMANDTYPE cmd, int port_index); void ChangePort(OMX_COMMANDTYPE cmd, int port_index);
...@@ -162,4 +158,4 @@ class OmxVideoDecodeAccelerator : public media::VideoDecodeAccelerator { ...@@ -162,4 +158,4 @@ class OmxVideoDecodeAccelerator : public media::VideoDecodeAccelerator {
OMX_BUFFERHEADERTYPE* buffer); OMX_BUFFERHEADERTYPE* buffer);
}; };
#endif // CONTENT_GPU_OMX_VIDEO_DECODE_ACCELERATOR_H_ #endif // CONTENT_COMMON_GPU_OMX_VIDEO_DECODE_ACCELERATOR_H_
...@@ -289,6 +289,23 @@ ...@@ -289,6 +289,23 @@
'../gpu/gpu.gyp:command_buffer_service', '../gpu/gpu.gyp:command_buffer_service',
], ],
}], }],
['target_arch=="arm"', {
'sources': [
'common/gpu/gles2_texture_to_egl_image_translator.cc',
'common/gpu/gles2_texture_to_egl_image_translator.h',
'common/gpu/omx_video_decode_accelerator.cc',
'common/gpu/omx_video_decode_accelerator.h',
],
'include_dirs': [
'<(DEPTH)/third_party/openmax/il',
],
'link_settings': {
'libraries': [
'-lEGL',
'-lGLESv2',
],
},
}],
], ],
}, },
], ],
......
...@@ -8,5 +8,4 @@ include_rules = [ ...@@ -8,5 +8,4 @@ include_rules = [
"+media/video", "+media/video",
"+sandbox", "+sandbox",
"+skia", "+skia",
"+third_party/openmax",
] ]
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "ipc/ipc_message_utils.h" #include "ipc/ipc_message_utils.h"
using media::VideoDecodeAccelerator; using media::VideoDecodeAccelerator;
using media::VideoDecodeAcceleratorCallback;
GpuVideoDecodeAcceleratorHost::GpuVideoDecodeAcceleratorHost( GpuVideoDecodeAcceleratorHost::GpuVideoDecodeAcceleratorHost(
MessageRouter* router, MessageRouter* router,
...@@ -105,11 +104,11 @@ void GpuVideoDecodeAcceleratorHost::AssignGLESBuffers( ...@@ -105,11 +104,11 @@ void GpuVideoDecodeAcceleratorHost::AssignGLESBuffers(
std::vector<uint32> context_ids; std::vector<uint32> context_ids;
std::vector<gfx::Size> sizes; std::vector<gfx::Size> sizes;
for (uint32 i = 0; i < buffers.size(); i++) { for (uint32 i = 0; i < buffers.size(); i++) {
const media::BufferInfo& info = buffers[i].buffer_info(); const media::GLESBuffer& buffer = buffers[i];
texture_ids.push_back(buffers[i].texture_id()); texture_ids.push_back(buffer.texture_id());
context_ids.push_back(buffers[i].context_id()); context_ids.push_back(buffer.context_id());
buffer_ids.push_back(info.id()); buffer_ids.push_back(buffer.id());
sizes.push_back(info.size()); sizes.push_back(buffer.size());
} }
if (!ipc_sender_->Send(new AcceleratedVideoDecoderMsg_AssignGLESBuffers( if (!ipc_sender_->Send(new AcceleratedVideoDecoderMsg_AssignGLESBuffers(
decoder_id_, buffer_ids, texture_ids, context_ids, sizes))) { decoder_id_, buffer_ids, texture_ids, context_ids, sizes))) {
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "content/renderer/render_thread.h" #include "content/renderer/render_thread.h"
using media::BitstreamBuffer; using media::BitstreamBuffer;
using media::VideoDecodeAcceleratorCallback;
PlatformVideoDecoderImpl::PlatformVideoDecoderImpl( PlatformVideoDecoderImpl::PlatformVideoDecoderImpl(
VideoDecodeAccelerator::Client* client) VideoDecodeAccelerator::Client* client)
......
...@@ -6,25 +6,22 @@ ...@@ -6,25 +6,22 @@
namespace media { namespace media {
BaseBuffer::~BaseBuffer() {}
// Implementations for the other constructors are found in // Implementations for the other constructors are found in
// webkit/plugins/ppapi/ppb_video_decoder_impl.cc. // webkit/plugins/ppapi/ppb_video_decoder_impl.cc.
// They are not included in this file because it would require // They are not included in this file because it would require
// media/ to depend on files in ppapi/. // media/ to depend on files in ppapi/.
BufferInfo::BufferInfo(int32 id, gfx::Size size) BaseBuffer::BaseBuffer(int32 id, gfx::Size size) : id_(id), size_(size) {
: id_(id),
size_(size) {
} }
GLESBuffer::GLESBuffer( GLESBuffer::GLESBuffer(
int32 id, gfx::Size size, uint32 texture_id, uint32 context_id) int32 id, gfx::Size size, uint32 texture_id, uint32 context_id)
: texture_id_(texture_id), : BaseBuffer(id, size), texture_id_(texture_id), context_id_(context_id) {
context_id_(context_id),
info_(id, size) {
} }
SysmemBuffer::SysmemBuffer(int32 id, gfx::Size size, void* data) SysmemBuffer::SysmemBuffer(int32 id, gfx::Size size, void* data)
: data_(data), : BaseBuffer(id, size), data_(data) {
info_(id, size) {
} }
Picture::Picture(int32 picture_buffer_id, int32 bitstream_buffer_id, Picture::Picture(int32 picture_buffer_id, int32 bitstream_buffer_id,
......
...@@ -15,12 +15,13 @@ struct PP_SysmemBuffer_Dev; ...@@ -15,12 +15,13 @@ struct PP_SysmemBuffer_Dev;
namespace media { namespace media {
// Information about the picture buffer. // Common information about GLES & Sysmem picture buffers.
// This is the media-namespace equivalent of PP_BufferInfo_Dev. // This is the media-namespace equivalent of PP_BufferInfo_Dev.
class BufferInfo { class BaseBuffer {
public: public:
BufferInfo(int32 id, gfx::Size size); BaseBuffer(int32 id, gfx::Size size);
BufferInfo(const PP_BufferInfo_Dev& info); BaseBuffer(const PP_BufferInfo_Dev& info);
virtual ~BaseBuffer();
// Returns the client-specified id of the buffer. // Returns the client-specified id of the buffer.
int32 id() const { int32 id() const {
...@@ -39,7 +40,7 @@ class BufferInfo { ...@@ -39,7 +40,7 @@ class BufferInfo {
// A picture buffer that is composed of a GLES2 texture and context. // A picture buffer that is composed of a GLES2 texture and context.
// This is the media-namespace equivalent of PP_GLESBuffer_Dev. // This is the media-namespace equivalent of PP_GLESBuffer_Dev.
class GLESBuffer { class GLESBuffer : public BaseBuffer {
public: public:
GLESBuffer(int32 id, gfx::Size size, uint32 texture_id, uint32 context_id); GLESBuffer(int32 id, gfx::Size size, uint32 texture_id, uint32 context_id);
GLESBuffer(const PP_GLESBuffer_Dev& buffer); GLESBuffer(const PP_GLESBuffer_Dev& buffer);
...@@ -56,20 +57,14 @@ class GLESBuffer { ...@@ -56,20 +57,14 @@ class GLESBuffer {
return context_id_; return context_id_;
} }
// Returns information regarding the buffer.
const BufferInfo& buffer_info() const {
return info_;
}
private: private:
uint32 texture_id_; uint32 texture_id_;
uint32 context_id_; uint32 context_id_;
BufferInfo info_;
}; };
// A picture buffer that lives in system memory. // A picture buffer that lives in system memory.
// This is the media-namespace equivalent of PP_SysmemBuffer_Dev. // This is the media-namespace equivalent of PP_SysmemBuffer_Dev.
class SysmemBuffer { class SysmemBuffer : public BaseBuffer {
public: public:
SysmemBuffer(int32 id, gfx::Size size, void* data); SysmemBuffer(int32 id, gfx::Size size, void* data);
SysmemBuffer(const PP_SysmemBuffer_Dev&); SysmemBuffer(const PP_SysmemBuffer_Dev&);
...@@ -79,14 +74,8 @@ class SysmemBuffer { ...@@ -79,14 +74,8 @@ class SysmemBuffer {
return data_; return data_;
} }
// Returns information regarding the buffer.
const BufferInfo& buffer_info() const {
return info_;
}
private: private:
void* data_; void* data_;
BufferInfo info_;
}; };
// A decoded picture frame. // A decoded picture frame.
...@@ -103,7 +92,9 @@ class Picture { ...@@ -103,7 +92,9 @@ class Picture {
} }
// Returns the id of the bitstream buffer from which this frame was decoded. // Returns the id of the bitstream buffer from which this frame was decoded.
// TODO(vrk): Handle the case where a picture can span multiple buffers. // TODO(fischman,vrk): Remove this field; pictures can span arbitrarily many
// BitstreamBuffers, and it's not clear what clients would do with this
// information, anyway.
int32 bitstream_buffer_id() const { int32 bitstream_buffer_id() const {
return bitstream_buffer_id_; return bitstream_buffer_id_;
} }
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
namespace media { namespace media {
typedef Callback0::Type VideoDecodeAcceleratorCallback;
// Enumeration defining global dictionary ranges for various purposes that are // Enumeration defining global dictionary ranges for various purposes that are
// used to handle the configurations of the video decoder. // used to handle the configurations of the video decoder.
enum VideoAttributeKey { enum VideoAttributeKey {
......
...@@ -398,7 +398,7 @@ void PPB_VideoDecoder_Impl::NotifyFlushDone() { ...@@ -398,7 +398,7 @@ void PPB_VideoDecoder_Impl::NotifyFlushDone() {
// These functions are declared in picture.h but are defined here because of // These functions are declared in picture.h but are defined here because of
// dependencies (we can't depend on ppapi types from media). // dependencies (we can't depend on ppapi types from media).
namespace media { namespace media {
BufferInfo::BufferInfo(const PP_BufferInfo_Dev& info) BaseBuffer::BaseBuffer(const PP_BufferInfo_Dev& info)
: id_(info.id), : id_(info.id),
size_(info.size.width, info.size.height) { size_(info.size.width, info.size.height) {
} }
...@@ -406,13 +406,13 @@ BufferInfo::BufferInfo(const PP_BufferInfo_Dev& info) ...@@ -406,13 +406,13 @@ BufferInfo::BufferInfo(const PP_BufferInfo_Dev& info)
// TODO(vrk): This assigns the PP_Resource context to be // TODO(vrk): This assigns the PP_Resource context to be
// the context_id. Not sure what it's actually supposed to be. // the context_id. Not sure what it's actually supposed to be.
GLESBuffer::GLESBuffer(const PP_GLESBuffer_Dev& buffer) GLESBuffer::GLESBuffer(const PP_GLESBuffer_Dev& buffer)
: texture_id_(buffer.texture_id), : BaseBuffer(buffer.info),
context_id_(buffer.context), texture_id_(buffer.texture_id),
info_(buffer.info) { context_id_(buffer.context) {
} }
SysmemBuffer::SysmemBuffer(const PP_SysmemBuffer_Dev& buffer) SysmemBuffer::SysmemBuffer(const PP_SysmemBuffer_Dev& buffer)
: info_(buffer.info) { : BaseBuffer(buffer.info) {
scoped_refptr<webkit::ppapi::PPB_Buffer_Impl> pepper_buffer = scoped_refptr<webkit::ppapi::PPB_Buffer_Impl> pepper_buffer =
webkit::ppapi::Resource::GetAs<webkit::ppapi::PPB_Buffer_Impl>( webkit::ppapi::Resource::GetAs<webkit::ppapi::PPB_Buffer_Impl>(
buffer.data); buffer.data);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment