summaryrefslogtreecommitdiffstats
path: root/media/video
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-07 18:59:36 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-07 18:59:36 +0000
commit3b098bbef42fa93a2c17c96c888a65564191f767 (patch)
tree0509385a390e0ff9b348e96382c10074127319f6 /media/video
parentc7b7800afbf7aadb5c9f99c95209237cdf869678 (diff)
downloadchromium_src-3b098bbef42fa93a2c17c96c888a65564191f767.zip
chromium_src-3b098bbef42fa93a2c17c96c888a65564191f767.tar.gz
chromium_src-3b098bbef42fa93a2c17c96c888a65564191f767.tar.bz2
Implement GpuVideoDecoderHost and unit tests
Add the following feature to GpuVideoDecoderHost: 1. Video frame allocation / release. 2. ProduceVideoFrame / ConsumeVideoFrame using frames allocated. 3. Change GpuVideoDecoder creation to asynchronous. BUG=53714 TEST=unit_tests --gtest_filter=GpuVideoDecoder* Review URL: http://codereview.chromium.org/3397027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61824 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/video')
-rw-r--r--media/video/mock_objects.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/media/video/mock_objects.h b/media/video/mock_objects.h
index a975ea8..24cd4d3 100644
--- a/media/video/mock_objects.h
+++ b/media/video/mock_objects.h
@@ -5,6 +5,7 @@
#ifndef MEDIA_VIDEO_MOCK_OBJECTS_H_
#define MEDIA_VIDEO_MOCK_OBJECTS_H_
+#include "media/video/video_decode_context.h"
#include "media/video/video_decode_engine.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -29,6 +30,25 @@ class MockVideoDecodeEngine : public VideoDecodeEngine {
DISALLOW_COPY_AND_ASSIGN(MockVideoDecodeEngine);
};
+class MockVideoDecodeContext : public VideoDecodeContext {
+ public:
+ MockVideoDecodeContext() {}
+ virtual ~MockVideoDecodeContext() {}
+
+ MOCK_METHOD0(GetDevice, void*());
+ MOCK_METHOD6(AllocateVideoFrames, void(
+ int n, size_t width, size_t height, VideoFrame::Format format,
+ std::vector<scoped_refptr<VideoFrame> >* frames,
+ Task* task));
+ MOCK_METHOD0(ReleaseAllVideoFrames, void());
+ MOCK_METHOD3(UploadToVideoFrame, void(
+ void* buffer, scoped_refptr<VideoFrame> frame, Task* task));
+ MOCK_METHOD1(Destroy, void(Task* task));
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MockVideoDecodeContext);
+};
+
} // namespace media
#endif // MEDIA_VIDEO_MOCK_OBJECTS_H_