!257 xts_dcts——Surface Refactoring step 1:separate IConsumerSurface from Surface

Merge pull request !257 from MingZhu/lmz_remote
This commit is contained in:
openharmony_ci 2023-02-16 12:21:54 +00:00 committed by Gitee
commit 98b240d002
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 5 additions and 4 deletions

View File

@ -25,7 +25,7 @@ StreamCustomer::~StreamCustomer() {}
sptr<OHOS::IBufferProducer> StreamCustomer::CreateProducer(CaptureMode mode,
const std::function<void(void*, uint32_t)> callback)
{
consumer_ = OHOS::Surface::CreateSurfaceAsConsumer();
consumer_ = OHOS::IConsumerSurface::Create();
if (consumer_ == nullptr) {
return nullptr;
}

View File

@ -26,6 +26,7 @@
#include "constants.h"
#include "camera.h"
#include "distributed_hardware_log.h"
#include "iconsumer_surface.h"
#include "v1_0/ioffline_stream_operator.h"
namespace OHOS {
@ -39,7 +40,7 @@ typedef enum {
class TestBuffersConsumerListener : public IBufferConsumerListener {
public:
TestBuffersConsumerListener(const sptr<Surface>& surface,
TestBuffersConsumerListener(const sptr<IConsumerSurface>& surface,
const std::function<void(void*, const uint32_t)> callback):callback_(callback), consumer_(surface)
{
}
@ -73,7 +74,7 @@ public:
}
private:
std::function<void(void*, uint32_t)> callback_;
sptr<Surface> consumer_;
sptr<IConsumerSurface> consumer_;
};
class StreamCustomer {
@ -84,7 +85,7 @@ public:
const std::function<void(void*, uint32_t)> callback);
private:
sptr<OHOS::Surface> consumer_ = nullptr;
sptr<OHOS::IConsumerSurface> consumer_ = nullptr;
};
} // namespace OHOS::Camera
}