summaryrefslogtreecommitdiff
path: root/chromium/media/video/mock_gpu_memory_buffer_video_frame_pool.h
blob: 2509460b8e9d9a309353bd9016447d7e7584ff56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright 2015 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_MOCK_GPU_MEMORY_BUFFER_VIDEO_FRAME_POOL_H_
#define MEDIA_VIDEO_MOCK_GPU_MEMORY_BUFFER_VIDEO_FRAME_POOL_H_

#include "base/callback.h"
#include "media/video/gpu_memory_buffer_video_frame_pool.h"
#include "testing/gmock/include/gmock/gmock.h"

namespace media {

class MockGpuMemoryBufferVideoFramePool : public GpuMemoryBufferVideoFramePool {
 public:
  explicit MockGpuMemoryBufferVideoFramePool(
      std::vector<base::OnceClosure>* frame_ready_cbs);
  ~MockGpuMemoryBufferVideoFramePool() override;

  void MaybeCreateHardwareFrame(scoped_refptr<VideoFrame> video_frame,
                                FrameReadyCB frame_ready_cb) override;
  MOCK_METHOD0(Abort, void());

 private:
  std::vector<base::OnceClosure>* frame_ready_cbs_;
};

}  // namespace media

#endif  // MEDIA_VIDEO_MOCK_GPU_MEMORY_BUFFER_VIDEO_FRAME_POOL_H_