10 #include "bnb/scene/interfaces/render_backend_type.hpp"
14 #include <bnb/types/base_types.hpp>
15 #include <bnb/types/full_image.hpp>
16 #include <bnb/utils/defs.hpp>
23 namespace bnb {
namespace interfaces {
25 class camera_poi_listener;
26 class effect_activation_completion_listener;
27 class effect_info_listener;
29 class effect_player_configuration;
30 class face_number_listener;
31 class frame_data_listener;
32 class frame_duration_listener;
33 class frame_processor;
35 enum class camera_orientation;
89 static std::shared_ptr<effect_player> create(
const std::shared_ptr<effect_player_configuration> & configuration);
95 virtual void add_frame_duration_listener(
const std::shared_ptr<frame_duration_listener> &
frame_duration_listener) = 0;
101 virtual void remove_frame_duration_listener(
const std::shared_ptr<frame_duration_listener> &
frame_duration_listener) = 0;
107 virtual void add_face_number_listener(
const std::shared_ptr<face_number_listener> &
face_number_listener) = 0;
113 virtual void remove_face_number_listener(
const std::shared_ptr<face_number_listener> &
face_number_listener) = 0;
119 virtual void add_frame_data_listener(
const std::shared_ptr<frame_data_listener> &
frame_data_listener) = 0;
125 virtual void remove_frame_data_listener(
const std::shared_ptr<frame_data_listener> &
frame_data_listener) = 0;
132 virtual void add_camera_poi_listener(
const std::shared_ptr<camera_poi_listener> &
camera_poi_listener) = 0;
138 virtual void remove_camera_poi_listener(
const std::shared_ptr<camera_poi_listener> &
camera_poi_listener) = 0;
144 virtual void add_effect_info_listener(
const std::shared_ptr<effect_info_listener> &
effect_info_listener) = 0;
150 virtual void remove_effect_info_listener(
const std::shared_ptr<effect_info_listener> &
effect_info_listener) = 0;
169 virtual void set_max_faces(int32_t max_faces) = 0;
185 virtual void set_external_camera_texture(int32_t name, int32_t width, int32_t height) = 0;
193 virtual void set_use_ext_cam_tex(
bool value) = 0;
200 virtual void surface_created(int32_t width, int32_t height) = 0;
206 virtual void surface_changed(int32_t width, int32_t height) = 0;
215 virtual void surface_destroyed() = 0;
225 virtual int64_t draw() = 0;
235 virtual int64_t draw_with_external_frame_data(
const std::shared_ptr<::bnb::interfaces::frame_data> &
frame_data) = 0;
242 virtual void capture_blit(int32_t capture_width, int32_t capture_height) = 0;
250 virtual ::bnb::interfaces::pixel_buffer read_pixels() = 0;
264 virtual ::bnb::data_t process_image(::bnb::full_image_t input_image, ::bnb::interfaces::pixel_format output_pixel_format) = 0;
277 virtual ::bnb::data_t process_image_frame_data(
const std::shared_ptr<::bnb::interfaces::frame_data> & input_frame_data, ::bnb::interfaces::pixel_format output_pixel_format) = 0;
287 virtual std::vector<uint8_t> process_image_data(
const std::vector<uint8_t> & input_image, int32_t width, int32_t height, camera_orientation orientation,
bool is_mirrored, ::bnb::interfaces::pixel_format input_pixel_format, ::bnb::interfaces::pixel_format output_pixel_format) = 0;
293 virtual void push_frame(::bnb::full_image_t full_image) = 0;
299 virtual void push_frame_with_number(::bnb::full_image_t full_image, int64_t frame_number) = 0;
306 virtual void push_frame_data(
const std::shared_ptr<::bnb::interfaces::frame_data> &
frame_data) = 0;
313 virtual void push_frame_data_with_number(
const std::shared_ptr<::bnb::interfaces::frame_data> &
frame_data, int64_t frame_number) = 0;
316 virtual void playback_play() = 0;
318 virtual void playback_pause() = 0;
320 virtual void playback_stop() = 0;
329 virtual std::shared_ptr<input_manager> get_input_manager() = 0;
339 virtual void start_video_processing(int64_t screen_width, int64_t screen_height, camera_orientation orientation,
bool reset_effect,
bool offline_mode) = 0;
345 virtual void stop_video_processing(
bool reset_effect) = 0;
355 virtual std::shared_ptr<::bnb::interfaces::frame_data> process_video_frame_data(
const std::shared_ptr<::bnb::interfaces::frame_data> & input_frame_data, std::optional<int32_t> recognizer_iterations) = 0;
365 virtual std::shared_ptr<::bnb::interfaces::frame_data> process_video_frame(::bnb::full_image_t input_image, std::optional<int32_t> recognizer_iterations) = 0;
375 virtual ::bnb::data_t draw_video_frame(
const std::shared_ptr<::bnb::interfaces::frame_data> & input_frame_data, int64_t time_ns, ::bnb::interfaces::pixel_format output_pixel_format) = 0;
381 virtual ::bnb::data_t draw_video_frame_allocated(
const std::shared_ptr<::bnb::interfaces::frame_data> & input_frame_data, int64_t time_ns, ::bnb::interfaces::pixel_format output_pixel_format, ::bnb::data_t allocated_buffer) = 0;
389 virtual void write_recorded_audio(
const std::string & filename, int64_t length_ms) = 0;
398 virtual void on_video_record_start(
bool play_audio_while_recording) = 0;
404 virtual void on_video_record_end() = 0;
410 virtual std::shared_ptr<::bnb::interfaces::effect_manager>
effect_manager() = 0;
416 virtual void set_recognizer_offline_mode(
bool on) = 0;
423 virtual void set_recognizer_use_future_filter(
bool on) = 0;
430 virtual void set_recognizer_use_future_interpolate(
bool on) = 0;
436 virtual void set_frame_processor(
const std::shared_ptr<::bnb::interfaces::frame_processor> & processor) = 0;
442 virtual std::shared_ptr<::bnb::interfaces::frame_processor>
frame_processor() = 0;
444 static void set_render_backend(::bnb::interfaces::render_backend_type backend_type);
446 static ::bnb::interfaces::render_backend_type get_current_render_backend_type();