xref: /aosp_15_r20/external/webrtc/modules/video_coding/codecs/interface/mock_libvpx_interface.h (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1 /*
2  *  Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
3  *
4  *  Use of this source code is governed by a BSD-style license
5  *  that can be found in the LICENSE file in the root of the source
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 #ifndef MODULES_VIDEO_CODING_CODECS_INTERFACE_MOCK_LIBVPX_INTERFACE_H_
12 #define MODULES_VIDEO_CODING_CODECS_INTERFACE_MOCK_LIBVPX_INTERFACE_H_
13 
14 #include "modules/video_coding/codecs/interface/libvpx_interface.h"
15 #include "test/gmock.h"
16 #include "test/gtest.h"
17 
18 namespace webrtc {
19 
20 class MockLibvpxInterface : public LibvpxInterface {
21  public:
22   MOCK_METHOD(
23       vpx_image_t*,
24       img_alloc,
25       (vpx_image_t*, vpx_img_fmt_t, unsigned int, unsigned int, unsigned int),
26       (const, override));
27   MOCK_METHOD(vpx_image_t*,
28               img_wrap,
29               (vpx_image_t*,
30                vpx_img_fmt_t,
31                unsigned int,
32                unsigned int,
33                unsigned int,
34                unsigned char*),
35               (const, override));
36   MOCK_METHOD(void, img_free, (vpx_image_t * img), (const, override));
37   MOCK_METHOD(vpx_codec_err_t,
38               codec_enc_config_set,
39               (vpx_codec_ctx_t*, const vpx_codec_enc_cfg_t*),
40               (const, override));
41   MOCK_METHOD(vpx_codec_err_t,
42               codec_enc_config_default,
43               (vpx_codec_iface_t*, vpx_codec_enc_cfg_t*, unsigned int),
44               (const, override));
45   MOCK_METHOD(vpx_codec_err_t,
46               codec_enc_init,
47               (vpx_codec_ctx_t*,
48                vpx_codec_iface_t*,
49                const vpx_codec_enc_cfg_t*,
50                vpx_codec_flags_t),
51               (const, override));
52   MOCK_METHOD(vpx_codec_err_t,
53               codec_enc_init_multi,
54               (vpx_codec_ctx_t*,
55                vpx_codec_iface_t*,
56                vpx_codec_enc_cfg_t*,
57                int,
58                vpx_codec_flags_t,
59                vpx_rational_t*),
60               (const, override));
61   MOCK_METHOD(vpx_codec_err_t,
62               codec_destroy,
63               (vpx_codec_ctx_t*),
64               (const, override));
65   MOCK_METHOD(vpx_codec_err_t,
66               codec_control,
67               (vpx_codec_ctx_t*, vp8e_enc_control_id, uint32_t),
68               (const, override));
69   MOCK_METHOD(vpx_codec_err_t,
70               codec_control,
71               (vpx_codec_ctx_t*, vp8e_enc_control_id, int),
72               (const, override));
73   MOCK_METHOD(vpx_codec_err_t,
74               codec_control,
75               (vpx_codec_ctx_t*, vp8e_enc_control_id, int*),
76               (const, override));
77   MOCK_METHOD(vpx_codec_err_t,
78               codec_control,
79               (vpx_codec_ctx_t*, vp8e_enc_control_id, vpx_roi_map*),
80               (const, override));
81   MOCK_METHOD(vpx_codec_err_t,
82               codec_control,
83               (vpx_codec_ctx_t*, vp8e_enc_control_id, vpx_active_map*),
84               (const, override));
85   MOCK_METHOD(vpx_codec_err_t,
86               codec_control,
87               (vpx_codec_ctx_t*, vp8e_enc_control_id, vpx_scaling_mode*),
88               (const, override));
89   MOCK_METHOD(vpx_codec_err_t,
90               codec_control,
91               (vpx_codec_ctx_t*, vp8e_enc_control_id, vpx_svc_extra_cfg_t*),
92               (const, override));
93   MOCK_METHOD(vpx_codec_err_t,
94               codec_control,
95               (vpx_codec_ctx_t*, vp8e_enc_control_id, vpx_svc_frame_drop_t*),
96               (const, override));
97   MOCK_METHOD(vpx_codec_err_t,
98               codec_control,
99               (vpx_codec_ctx_t*, vp8e_enc_control_id, void*),
100               (const, override));
101   MOCK_METHOD(vpx_codec_err_t,
102               codec_control,
103               (vpx_codec_ctx_t*, vp8e_enc_control_id, vpx_svc_layer_id_t*),
104               (const, override));
105   MOCK_METHOD(vpx_codec_err_t,
106               codec_control,
107               (vpx_codec_ctx_t*,
108                vp8e_enc_control_id,
109                vpx_svc_ref_frame_config_t*),
110               (const, override));
111   MOCK_METHOD(vpx_codec_err_t,
112               codec_control,
113               (vpx_codec_ctx_t*,
114                vp8e_enc_control_id,
115                vpx_svc_spatial_layer_sync_t*),
116               (const, override));
117   MOCK_METHOD(vpx_codec_err_t,
118               codec_control,
119               (vpx_codec_ctx_t*, vp8e_enc_control_id, vpx_rc_funcs_t*),
120               (const, override));
121   MOCK_METHOD(vpx_codec_err_t,
122               codec_encode,
123               (vpx_codec_ctx_t*,
124                const vpx_image_t*,
125                vpx_codec_pts_t,
126                uint64_t,
127                vpx_enc_frame_flags_t,
128                uint64_t),
129               (const, override));
130   MOCK_METHOD(const vpx_codec_cx_pkt_t*,
131               codec_get_cx_data,
132               (vpx_codec_ctx_t*, vpx_codec_iter_t*),
133               (const, override));
134   MOCK_METHOD(const char*,
135               codec_error_detail,
136               (vpx_codec_ctx_t*),
137               (const, override));
138   MOCK_METHOD(const char*, codec_error, (vpx_codec_ctx_t*), (const, override));
139   MOCK_METHOD(const char*,
140               codec_err_to_string,
141               (vpx_codec_err_t),
142               (const, override));
143 };
144 
145 }  // namespace webrtc
146 
147 #endif  // MODULES_VIDEO_CODING_CODECS_INTERFACE_MOCK_LIBVPX_INTERFACE_H_
148