tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

mock_libvpx_interface.h (5652B)


      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 <cstdint>
     15 
     16 #include "modules/video_coding/codecs/interface/libvpx_interface.h"
     17 #include "test/gmock.h"
     18 #include "third_party/libvpx/source/libvpx/vpx/vp8cx.h"
     19 #include "third_party/libvpx/source/libvpx/vpx/vpx_codec.h"
     20 #include "third_party/libvpx/source/libvpx/vpx/vpx_encoder.h"
     21 #include "third_party/libvpx/source/libvpx/vpx/vpx_ext_ratectrl.h"
     22 #include "third_party/libvpx/source/libvpx/vpx/vpx_image.h"
     23 
     24 namespace webrtc {
     25 
     26 class MockLibvpxInterface : public LibvpxInterface {
     27 public:
     28  MOCK_METHOD(
     29      vpx_image_t*,
     30      img_alloc,
     31      (vpx_image_t*, vpx_img_fmt_t, unsigned int, unsigned int, unsigned int),
     32      (const, override));
     33  MOCK_METHOD(vpx_image_t*,
     34              img_wrap,
     35              (vpx_image_t*,
     36               vpx_img_fmt_t,
     37               unsigned int,
     38               unsigned int,
     39               unsigned int,
     40               unsigned char*),
     41              (const, override));
     42  MOCK_METHOD(void, img_free, (vpx_image_t * img), (const, override));
     43  MOCK_METHOD(vpx_codec_err_t,
     44              codec_enc_config_set,
     45              (vpx_codec_ctx_t*, const vpx_codec_enc_cfg_t*),
     46              (const, override));
     47  MOCK_METHOD(vpx_codec_err_t,
     48              codec_enc_config_default,
     49              (vpx_codec_iface_t*, vpx_codec_enc_cfg_t*, unsigned int),
     50              (const, override));
     51  MOCK_METHOD(vpx_codec_err_t,
     52              codec_enc_init,
     53              (vpx_codec_ctx_t*,
     54               vpx_codec_iface_t*,
     55               const vpx_codec_enc_cfg_t*,
     56               vpx_codec_flags_t),
     57              (const, override));
     58  MOCK_METHOD(vpx_codec_err_t,
     59              codec_enc_init_multi,
     60              (vpx_codec_ctx_t*,
     61               vpx_codec_iface_t*,
     62               vpx_codec_enc_cfg_t*,
     63               int,
     64               vpx_codec_flags_t,
     65               vpx_rational_t*),
     66              (const, override));
     67  MOCK_METHOD(vpx_codec_err_t,
     68              codec_destroy,
     69              (vpx_codec_ctx_t*),
     70              (const, override));
     71  MOCK_METHOD(vpx_codec_err_t,
     72              codec_control,
     73              (vpx_codec_ctx_t*, vp8e_enc_control_id, uint32_t),
     74              (const, override));
     75  MOCK_METHOD(vpx_codec_err_t,
     76              codec_control,
     77              (vpx_codec_ctx_t*, vp8e_enc_control_id, int),
     78              (const, override));
     79  MOCK_METHOD(vpx_codec_err_t,
     80              codec_control,
     81              (vpx_codec_ctx_t*, vp8e_enc_control_id, int*),
     82              (const, override));
     83  MOCK_METHOD(vpx_codec_err_t,
     84              codec_control,
     85              (vpx_codec_ctx_t*, vp8e_enc_control_id, vpx_roi_map*),
     86              (const, override));
     87  MOCK_METHOD(vpx_codec_err_t,
     88              codec_control,
     89              (vpx_codec_ctx_t*, vp8e_enc_control_id, vpx_active_map*),
     90              (const, override));
     91  MOCK_METHOD(vpx_codec_err_t,
     92              codec_control,
     93              (vpx_codec_ctx_t*, vp8e_enc_control_id, vpx_scaling_mode*),
     94              (const, override));
     95  MOCK_METHOD(vpx_codec_err_t,
     96              codec_control,
     97              (vpx_codec_ctx_t*, vp8e_enc_control_id, vpx_svc_extra_cfg_t*),
     98              (const, override));
     99  MOCK_METHOD(vpx_codec_err_t,
    100              codec_control,
    101              (vpx_codec_ctx_t*, vp8e_enc_control_id, vpx_svc_frame_drop_t*),
    102              (const, override));
    103  MOCK_METHOD(vpx_codec_err_t,
    104              codec_control,
    105              (vpx_codec_ctx_t*, vp8e_enc_control_id, void*),
    106              (const, override));
    107  MOCK_METHOD(vpx_codec_err_t,
    108              codec_control,
    109              (vpx_codec_ctx_t*, vp8e_enc_control_id, vpx_svc_layer_id_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_ref_frame_config_t*),
    116              (const, override));
    117  MOCK_METHOD(vpx_codec_err_t,
    118              codec_control,
    119              (vpx_codec_ctx_t*,
    120               vp8e_enc_control_id,
    121               vpx_svc_spatial_layer_sync_t*),
    122              (const, override));
    123  MOCK_METHOD(vpx_codec_err_t,
    124              codec_control,
    125              (vpx_codec_ctx_t*, vp8e_enc_control_id, vpx_rc_funcs_t*),
    126              (const, override));
    127  MOCK_METHOD(vpx_codec_err_t,
    128              codec_encode,
    129              (vpx_codec_ctx_t*,
    130               const vpx_image_t*,
    131               vpx_codec_pts_t,
    132               uint64_t,
    133               vpx_enc_frame_flags_t,
    134               uint64_t),
    135              (const, override));
    136  MOCK_METHOD(const vpx_codec_cx_pkt_t*,
    137              codec_get_cx_data,
    138              (vpx_codec_ctx_t*, vpx_codec_iter_t*),
    139              (const, override));
    140  MOCK_METHOD(const char*,
    141              codec_error_detail,
    142              (vpx_codec_ctx_t*),
    143              (const, override));
    144  MOCK_METHOD(const char*, codec_error, (vpx_codec_ctx_t*), (const, override));
    145  MOCK_METHOD(const char*,
    146              codec_err_to_string,
    147              (vpx_codec_err_t),
    148              (const, override));
    149 };
    150 
    151 }  // namespace webrtc
    152 
    153 #endif  // MODULES_VIDEO_CODING_CODECS_INTERFACE_MOCK_LIBVPX_INTERFACE_H_