Commit ee2a19b1 authored by fischman@chromium.org's avatar fischman@chromium.org

Revert 86681 - 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

TBR=fischman@chromium.org
Review URL: http://codereview.chromium.org/6979017

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86687 0039d316-1c4b-4281-b951-d872f2087c98
parent 76420799
...@@ -3471,6 +3471,22 @@ ...@@ -3471,6 +3471,22 @@
# '<(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,5 +6,4 @@ include_rules = [ ...@@ -6,5 +6,4 @@ include_rules = [
"+media/base", "+media/base",
"+media/video", "+media/video",
"+skia", "+skia",
"+third_party/openmax",
] ]
...@@ -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_.get()) if (!video_decode_accelerator_)
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_.get()) if (!video_decode_accelerator_)
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_.get()) if (!video_decode_accelerator_)
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_.get()) if (!video_decode_accelerator_)
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_.get()) if (!video_decode_accelerator_)
return; return;
video_decode_accelerator_->Abort(); video_decode_accelerator_->Abort();
......
...@@ -45,8 +45,7 @@ class GpuVideoDecodeAccelerator ...@@ -45,8 +45,7 @@ class GpuVideoDecodeAccelerator
void set_video_decode_accelerator( void set_video_decode_accelerator(
media::VideoDecodeAccelerator* accelerator) { media::VideoDecodeAccelerator* accelerator) {
DCHECK(!video_decode_accelerator_.get()); video_decode_accelerator_ = accelerator;
video_decode_accelerator_.reset(accelerator);
} }
private: private:
...@@ -73,7 +72,7 @@ class GpuVideoDecodeAccelerator ...@@ -73,7 +72,7 @@ class GpuVideoDecodeAccelerator
int32 route_id_; int32 route_id_;
// Pointer to the underlying VideoDecodeAccelerator. // Pointer to the underlying VideoDecodeAccelerator.
scoped_ptr<media::VideoDecodeAccelerator> video_decode_accelerator_; media::VideoDecodeAccelerator* video_decode_accelerator_;
DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator); DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAccelerator);
}; };
......
...@@ -8,10 +8,6 @@ ...@@ -8,10 +8,6 @@
#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();
...@@ -61,10 +57,6 @@ bool GpuVideoService::CreateVideoDecoder( ...@@ -61,10 +57,6 @@ 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;
......
...@@ -289,23 +289,6 @@ ...@@ -289,23 +289,6 @@
'../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,4 +8,5 @@ include_rules = [ ...@@ -8,4 +8,5 @@ include_rules = [
"+media/video", "+media/video",
"+sandbox", "+sandbox",
"+skia", "+skia",
"+third_party/openmax",
] ]
...@@ -2,9 +2,7 @@ ...@@ -2,9 +2,7 @@
// 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/common/gpu/gles2_texture_to_egl_image_translator.h" #include "content/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 =
...@@ -71,3 +69,5 @@ void Gles2TextureToEglImageTranslator::DestroyEglImage(EGLImageKHR egl_image) { ...@@ -71,3 +69,5 @@ 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_COMMON_GPU_GLES2_TEXTURE_TO_EGL_IMAGE_TRANSLATOR_H_ #ifndef CONTENT_GPU_GLES2_TEXTURE_TO_EGL_IMAGE_TRANSLATOR_H_
#define CONTENT_COMMON_GPU_GLES2_TEXTURE_TO_EGL_IMAGE_TRANSLATOR_H_ #define CONTENT_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,4 +36,6 @@ class Gles2TextureToEglImageTranslator { ...@@ -36,4 +36,6 @@ class Gles2TextureToEglImageTranslator {
DISALLOW_IMPLICIT_CONSTRUCTORS(Gles2TextureToEglImageTranslator); DISALLOW_IMPLICIT_CONSTRUCTORS(Gles2TextureToEglImageTranslator);
}; };
#endif // CONTENT_COMMON_GPU_GLES2_TEXTURE_TO_EGL_IMAGE_TRANSLATOR_H_ #endif // CONTENT_GPU_GLES2_TEXTURE_TO_EGL_IMAGE_TRANSLATOR_H_
...@@ -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_COMMON_GPU_OMX_VIDEO_DECODE_ACCELERATOR_H_ #ifndef CONTENT_GPU_OMX_VIDEO_DECODE_ACCELERATOR_H_
#define CONTENT_COMMON_GPU_OMX_VIDEO_DECODE_ACCELERATOR_H_ #define CONTENT_GPU_OMX_VIDEO_DECODE_ACCELERATOR_H_
#include <dlfcn.h> #include <dlfcn.h>
#include <map> #include <map>
...@@ -30,25 +30,20 @@ class OmxVideoDecodeAccelerator : public media::VideoDecodeAccelerator { ...@@ -30,25 +30,20 @@ class OmxVideoDecodeAccelerator : public media::VideoDecodeAccelerator {
virtual ~OmxVideoDecodeAccelerator(); virtual ~OmxVideoDecodeAccelerator();
// media::VideoDecodeAccelerator implementation. // media::VideoDecodeAccelerator implementation.
void GetConfigs(const std::vector<uint32>& requested_configs, const std::vector<uint32>& GetConfig(
std::vector<uint32>* matched_configs) OVERRIDE; const std::vector<uint32>& prototype_config);
bool Initialize(const std::vector<uint32>& config) OVERRIDE; bool Initialize(const std::vector<uint32>& config);
bool Decode(const media::BitstreamBuffer& bitstream_buffer) OVERRIDE; bool Decode(const media::BitstreamBuffer& bitstream_buffer,
virtual void AssignGLESBuffers( const media::VideoDecodeAcceleratorCallback& callback);
const std::vector<media::GLESBuffer>& buffers) OVERRIDE; void AssignPictureBuffer(std::vector<PictureBuffer*> picture_buffers);
virtual void AssignSysmemBuffers( void ReusePictureBuffer(int32 picture_buffer_id);
const std::vector<media::SysmemBuffer>& buffers) OVERRIDE; bool Flush(const media::VideoDecodeAcceleratorCallback& callback);
void ReusePictureBuffer(int32 picture_buffer_id) OVERRIDE; bool Abort(const media::VideoDecodeAcceleratorCallback& callback);
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.
...@@ -107,13 +102,18 @@ class OmxVideoDecodeAccelerator : public media::VideoDecodeAccelerator { ...@@ -107,13 +102,18 @@ 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::BaseBuffer*> assigned_picture_buffers_; std::vector<media::VideoDecodeAccelerator::PictureBuffer*>
typedef std::pair<int32, OMX_BUFFERHEADERTYPE*> OutputPicture; assigned_picture_buffers_;
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,10 +127,14 @@ class OmxVideoDecodeAccelerator : public media::VideoDecodeAccelerator { ...@@ -127,10 +127,14 @@ 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<OMX_BUFFERHEADERTYPE*, typedef std::map<
std::pair<base::SharedMemory*, int32> > OMXBufferIdMap; OMX_BUFFERHEADERTYPE*,
OMXBufferIdMap omx_buff_ids_; std::pair<base::SharedMemory*,
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);
...@@ -158,4 +162,4 @@ class OmxVideoDecodeAccelerator : public media::VideoDecodeAccelerator { ...@@ -158,4 +162,4 @@ class OmxVideoDecodeAccelerator : public media::VideoDecodeAccelerator {
OMX_BUFFERHEADERTYPE* buffer); OMX_BUFFERHEADERTYPE* buffer);
}; };
#endif // CONTENT_COMMON_GPU_OMX_VIDEO_DECODE_ACCELERATOR_H_ #endif // CONTENT_GPU_OMX_VIDEO_DECODE_ACCELERATOR_H_
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#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,
...@@ -104,11 +105,11 @@ void GpuVideoDecodeAcceleratorHost::AssignGLESBuffers( ...@@ -104,11 +105,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::GLESBuffer& buffer = buffers[i]; const media::BufferInfo& info = buffers[i].buffer_info();
texture_ids.push_back(buffer.texture_id()); texture_ids.push_back(buffers[i].texture_id());
context_ids.push_back(buffer.context_id()); context_ids.push_back(buffers[i].context_id());
buffer_ids.push_back(buffer.id()); buffer_ids.push_back(info.id());
sizes.push_back(buffer.size()); sizes.push_back(info.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,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#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,22 +6,25 @@ ...@@ -6,22 +6,25 @@
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/.
BaseBuffer::BaseBuffer(int32 id, gfx::Size size) : id_(id), size_(size) { BufferInfo::BufferInfo(int32 id, gfx::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)
: BaseBuffer(id, size), texture_id_(texture_id), context_id_(context_id) { : texture_id_(texture_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)
: BaseBuffer(id, size), data_(data) { : 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,13 +15,12 @@ struct PP_SysmemBuffer_Dev; ...@@ -15,13 +15,12 @@ struct PP_SysmemBuffer_Dev;
namespace media { namespace media {
// Common information about GLES & Sysmem picture buffers. // Information about the picture buffer.
// This is the media-namespace equivalent of PP_BufferInfo_Dev. // This is the media-namespace equivalent of PP_BufferInfo_Dev.
class BaseBuffer { class BufferInfo {
public: public:
BaseBuffer(int32 id, gfx::Size size); BufferInfo(int32 id, gfx::Size size);
BaseBuffer(const PP_BufferInfo_Dev& info); BufferInfo(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 {
...@@ -40,7 +39,7 @@ class BaseBuffer { ...@@ -40,7 +39,7 @@ class BaseBuffer {
// 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 : public BaseBuffer { class GLESBuffer {
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);
...@@ -57,14 +56,20 @@ class GLESBuffer : public BaseBuffer { ...@@ -57,14 +56,20 @@ class GLESBuffer : public BaseBuffer {
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 : public BaseBuffer { class SysmemBuffer {
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&);
...@@ -74,8 +79,14 @@ class SysmemBuffer : public BaseBuffer { ...@@ -74,8 +79,14 @@ class SysmemBuffer : public BaseBuffer {
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.
...@@ -92,9 +103,7 @@ class Picture { ...@@ -92,9 +103,7 @@ 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(fischman,vrk): Remove this field; pictures can span arbitrarily many // TODO(vrk): Handle the case where a picture can span multiple buffers.
// 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,6 +15,8 @@ ...@@ -15,6 +15,8 @@
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 {
BaseBuffer::BaseBuffer(const PP_BufferInfo_Dev& info) BufferInfo::BufferInfo(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 @@ BaseBuffer::BaseBuffer(const PP_BufferInfo_Dev& info) ...@@ -406,13 +406,13 @@ BaseBuffer::BaseBuffer(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)
: BaseBuffer(buffer.info), : texture_id_(buffer.texture_id),
texture_id_(buffer.texture_id), context_id_(buffer.context),
context_id_(buffer.context) { info_(buffer.info) {
} }
SysmemBuffer::SysmemBuffer(const PP_SysmemBuffer_Dev& buffer) SysmemBuffer::SysmemBuffer(const PP_SysmemBuffer_Dev& buffer)
: BaseBuffer(buffer.info) { : info_(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