Prepare for hardware encoders

This commit is contained in:
loki
2020-03-25 10:51:32 +01:00
parent a9423574fe
commit 55705af922
6 changed files with 352 additions and 170 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ enum class capture_e : int {
class display_t {
public:
virtual capture_e snapshot(img_t *img, bool cursor) = 0;
virtual std::unique_ptr<img_t> alloc_img() = 0;
virtual std::shared_ptr<img_t> alloc_img() = 0;
virtual ~display_t() = default;
};
+4 -4
View File
@@ -176,8 +176,8 @@ struct x11_attr_t : public display_t {
return capture_e::ok;
}
std::unique_ptr<img_t> alloc_img() override {
return std::make_unique<x11_img_t>();
std::shared_ptr<img_t> alloc_img() override {
return std::make_shared<x11_img_t>();
}
xdisplay_t xdisplay;
@@ -251,8 +251,8 @@ struct shm_attr_t : public x11_attr_t {
return capture_e::ok;
}
std::unique_ptr<img_t> alloc_img() override {
return std::make_unique<shm_img_t>();
std::shared_ptr<img_t> alloc_img() override {
return std::make_shared<shm_img_t>();
}
int init() {
+2 -2
View File
@@ -339,8 +339,8 @@ public:
return capture_e::ok;
}
std::unique_ptr<::platf::img_t> alloc_img() override {
auto img = std::make_unique<img_t>();
std::shared_ptr<::platf::img_t> alloc_img() override {
auto img = std::make_shared<img_t>();
img->data = nullptr;
img->height = 0;