Ignore title parameter for navigator.registerProtocolHandler
[chromium-blink-merge.git] / media / cast / test / fake_video_encode_accelerator.h
bloba4f834faeb52a9db087186170cea75b039b4290f
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MEDIA_CAST_TEST_FAKE_MOCK_VIDEO_ENCODE_ACCELERATOR_H_
6 #define MEDIA_CAST_TEST_FAKE_MOCK_VIDEO_ENCODE_ACCELERATOR_H_
8 #include "media/video/video_encode_accelerator.h"
10 #include <list>
12 #include "base/memory/weak_ptr.h"
13 #include "media/base/bitstream_buffer.h"
15 namespace base {
16 class SingleThreadTaskRunner;
17 } // namespace base
19 namespace media {
20 namespace cast {
21 namespace test {
23 class FakeVideoEncodeAccelerator : public VideoEncodeAccelerator {
24 public:
25 explicit FakeVideoEncodeAccelerator(
26 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
27 virtual ~FakeVideoEncodeAccelerator();
29 virtual bool Initialize(media::VideoFrame::Format input_format,
30 const gfx::Size& input_visible_size,
31 VideoCodecProfile output_profile,
32 uint32 initial_bitrate,
33 Client* client) OVERRIDE;
35 virtual void Encode(const scoped_refptr<VideoFrame>& frame,
36 bool force_keyframe) OVERRIDE;
38 virtual void UseOutputBitstreamBuffer(const BitstreamBuffer& buffer) OVERRIDE;
40 virtual void RequestEncodingParametersChange(uint32 bitrate,
41 uint32 framerate) OVERRIDE;
43 virtual void Destroy() OVERRIDE;
45 void SendDummyFrameForTesting(bool key_frame);
47 private:
48 void DoRequireBitstreamBuffers(unsigned int input_count,
49 const gfx::Size& input_coded_size,
50 size_t output_buffer_size) const;
51 void DoBitstreamBufferReady(int32 bitstream_buffer_id,
52 size_t payload_size,
53 bool key_frame) const;
55 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
57 VideoEncodeAccelerator::Client* client_;
58 bool first_;
60 std::list<int32> available_buffer_ids_;
62 base::WeakPtrFactory<FakeVideoEncodeAccelerator> weak_this_factory_;
64 DISALLOW_COPY_AND_ASSIGN(FakeVideoEncodeAccelerator);
67 } // namespace test
68 } // namespace cast
69 } // namespace media
71 #endif // MEDIA_CAST_TEST_FAKE_MOCK_VIDEO_ENCODE_ACCELERATOR_H_