diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-14 22:53:39 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-14 22:53:39 +0000 |
commit | ef932ed16a50a6fa0adb801c32f3d4860e880bc9 (patch) | |
tree | 76ada28fef125550a957fc868d5cb2a4013b8f93 /media/video/picture.h | |
parent | 5b8149fa24feeeab86de1b86ee1da6abe68165f4 (diff) | |
download | chromium_src-ef932ed16a50a6fa0adb801c32f3d4860e880bc9.zip chromium_src-ef932ed16a50a6fa0adb801c32f3d4860e880bc9.tar.gz chromium_src-ef932ed16a50a6fa0adb801c32f3d4860e880bc9.tar.bz2 |
Draft version of the HW video decode tester and few other changes.
Intention is that this tester can be used to decouple HW decode accelerator
integration from running the whole Chrome browser.
Features:
- Independent GUnit executable, which should be possible to use in autotests.
- Mimics Renderer process from Gpu video pipeline perspective.
* Test bench contains implementation of FakeClient which essentially mimics
Renderer process from the GpuVideoDecodeAccelerator's point of view.
* FakeClient runs on it's own thread and will communicate with using the IPC
messages that are used also within the real use case.
* FakeClient will allocate memories using same SharedMemory stuff as the
real Renderer code.
* Currently reads H.264 Annex B bitstream from file and parses it to NAL
units before feeding to the decoder
* TODO: Polish and improving the features and configurability.
* TODO: GLES texture allocation for textures.
- Allows building various test cases and error behaviour as well both on
AcceleratedVideoDecoder interface as well as erroneous behaviour from the
client.
- Allows also checking expected order of calls if we want to enforce certain
behaviour across various implementations.
Patch by vmr@chromium.org:
http://codereview.chromium.org/6720040/
BUG=none
TEST=none
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81663 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/video/picture.h')
-rw-r--r-- | media/video/picture.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/media/video/picture.h b/media/video/picture.h new file mode 100644 index 0000000..ec84453 --- /dev/null +++ b/media/video/picture.h @@ -0,0 +1,65 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef MEDIA_VIDEO_PICTURE_H_ +#define MEDIA_VIDEO_PICTURE_H_ + +#include <vector> + +#include "base/compiler_specific.h" +#include "media/video/video_decode_accelerator.h" + +namespace media { + +// TODO(vmr): Evaluate the generalization potential of these interfaces & +// classes and refactor as needed with the rest of media stack. +class PictureBuffer : public VideoDecodeAccelerator::PictureBuffer { + public: + PictureBuffer(int32 id, gfx::Size pixel_size, + std::vector<uint32> color_format, MemoryType memory_type, + std::vector<DataPlaneHandle> data_plane_handles); + virtual ~PictureBuffer(); + + // VideoDecodeAccelerator::PictureBuffer implementation. + virtual int32 GetId() OVERRIDE; + virtual gfx::Size GetSize() OVERRIDE; + virtual const std::vector<uint32>& GetColorFormat() OVERRIDE; + virtual MemoryType GetMemoryType() OVERRIDE; + virtual std::vector<DataPlaneHandle>& GetPlaneHandles() OVERRIDE; + + private: + int32 id_; + gfx::Size pixel_size_; + std::vector<uint32> color_format_; + MemoryType memory_type_; + std::vector<DataPlaneHandle>& data_plane_handles_; + + DISALLOW_IMPLICIT_CONSTRUCTORS(PictureBuffer); +}; + +class Picture : public VideoDecodeAccelerator::Picture { + public: + Picture(PictureBuffer* picture_buffer, gfx::Size decoded_pixel_size, + gfx::Size visible_pixel_size, void* user_handle); + virtual ~Picture(); + + // VideoDecodeAccelerator::Picture implementation. + virtual PictureBuffer* picture_buffer() OVERRIDE; + virtual gfx::Size GetDecodedSize() const OVERRIDE; + virtual gfx::Size GetVisibleSize() const OVERRIDE; + virtual void* GetUserHandle() OVERRIDE; + + private: + // Pointer to the picture buffer which contains this picture. + PictureBuffer* picture_buffer_; + gfx::Size decoded_pixel_size_; + gfx::Size visible_pixel_size_; + void* user_handle_; + + DISALLOW_IMPLICIT_CONSTRUCTORS(Picture); +}; + +} // namespace media + +#endif // MEDIA_VIDEO_PICTURE_H_ |