-
Notifications
You must be signed in to change notification settings - Fork 2
/
effect_player.hpp
48 lines (30 loc) · 1.46 KB
/
effect_player.hpp
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#pragma once
#include <interfaces/effect_player.hpp>
#include <bnb/effect_player/interfaces/all.hpp>
namespace bnb::oep
{
class effect_player : public bnb::oep::interfaces::effect_player
{
public:
effect_player(int32_t width, int32_t height);
~effect_player();
void surface_created(int32_t width, int32_t height) override;
void surface_changed(int32_t width, int32_t height) override;
void surface_destroyed() override;
bool load_effect(const std::string& effect) override;
bool call_js_method(const std::string& method, const std::string& param) override;
void eval_js(const std::string& script, oep_eval_js_result_cb result_callback) override;
void pause() override;
void resume() override;
void stop() override;
void push_frame(pixel_buffer_sptr image, bnb::oep::interfaces::rotation image_orientation, bool require_mirroring) override;
int64_t draw() override;
private:
bnb::image_format make_bnb_image_format(pixel_buffer_sptr image, interfaces::rotation orientation, bool require_mirroring);
bnb::yuv_format_t make_bnb_yuv_format(pixel_buffer_sptr image);
bnb::interfaces::pixel_format make_bnb_pixel_format(pixel_buffer_sptr image);
private:
std::shared_ptr<bnb::interfaces::effect_player> m_ep;
std::atomic_bool m_is_surface_created {false};
}; /* class effect_player */
} /* namespace bnb::oep */