mirror of
https://gitee.com/openharmony/xts_hats
synced 2024-11-27 09:00:57 +00:00
修改快速缩略图时间戳的判断条件
Signed-off-by: zhanghang133 <zhanghang133@huawei.com>
This commit is contained in:
parent
a7987da370
commit
30c9b33c03
@ -151,7 +151,7 @@ public:
|
||||
class StreamConsumer {
|
||||
public:
|
||||
void CalculateFps(int64_t timestamp, int32_t streamId);
|
||||
void ReturnTimeStamp(int64_t *g_timestamp, uint32_t lenght, int64_t timestamp, int32_t width);
|
||||
void ReturnTimeStamp(int64_t *g_timestamp, int64_t timestamp, enum StreamIntent streamIntent_);
|
||||
OHOS::sptr<OHOS::IBufferProducer> CreateProducer(std::function<void(void*, uint32_t)> callback);
|
||||
OHOS::sptr<BufferProducerSequenceable> CreateProducerSeq(std::function<void(void*, uint32_t)> callback);
|
||||
void TakeSnapshoe()
|
||||
@ -186,6 +186,7 @@ public:
|
||||
int64_t intervalTimestamp_ = 0;
|
||||
const int64_t ONESECOND_OF_MICROSECOND_UNIT = 1000000000;
|
||||
int64_t interval_ = ONESECOND_OF_MICROSECOND_UNIT;
|
||||
enum StreamIntent streamIntent_ = StreamIntent::PREVIEW;
|
||||
};
|
||||
|
||||
class DemoCameraDeviceCallback : public ICameraDeviceCallback {
|
||||
|
@ -291,6 +291,7 @@ HWTEST_F(CameraHdiTestV1_1, SUB_Driver_Camera_QuickThumbnail_0200, TestSize.Leve
|
||||
cameraTest->streamInfoCapture = std::make_shared<OHOS::HDI::Camera::V1_1::StreamInfo_V1_1>();
|
||||
cameraTest->streamInfoCapture->extendedStreamInfos = {extendedStreamInfo};
|
||||
cameraTest->DefaultInfosCapture(cameraTest->streamInfoCapture);
|
||||
consumer2->streamIntent_ = cameraTest->streamInfoCapture->v1_0.intent_;
|
||||
cameraTest->streamInfosV1_1.push_back(*cameraTest->streamInfoCapture);
|
||||
|
||||
cameraTest->rc = cameraTest->streamOperator_V1_1->CreateStreams_V1_1(cameraTest->streamInfosV1_1);
|
||||
|
@ -175,6 +175,7 @@ void Test::DefaultInfosPreview(
|
||||
{
|
||||
DefaultPreview(infos);
|
||||
std::shared_ptr<StreamConsumer> consumer_pre = std::make_shared<StreamConsumer>();
|
||||
consumer_pre->streamIntent_ = infos->v1_0.intent_;
|
||||
infos->v1_0.bufferQueue_ = consumer_pre->CreateProducerSeq([this](void* addr, uint32_t size) {
|
||||
DumpImageFile(streamIdPreview, "yuv", addr, size);
|
||||
});
|
||||
@ -187,6 +188,7 @@ void Test::DefaultInfosCapture(
|
||||
{
|
||||
DefaultCapture(infos);
|
||||
std::shared_ptr<StreamConsumer> consumer_capture = std::make_shared<StreamConsumer>();
|
||||
consumer_capture->streamIntent_ = infos->v1_0.intent_;
|
||||
infos->v1_0.bufferQueue_ = consumer_capture->CreateProducerSeq([this](void* addr, uint32_t size) {
|
||||
DumpImageFile(streamIdCapture, "jpeg", addr, size);
|
||||
});
|
||||
@ -377,9 +379,9 @@ void Test::StreamConsumer::CalculateFps(int64_t timestamp, int32_t streamId)
|
||||
timestampCount_++;
|
||||
}
|
||||
|
||||
void Test::StreamConsumer::ReturnTimeStamp(int64_t *g_timestamp, uint32_t lenght, int64_t timestamp, int32_t width)
|
||||
void Test::StreamConsumer::ReturnTimeStamp(int64_t *g_timestamp, int64_t timestamp, enum StreamIntent streamIntent_)
|
||||
{
|
||||
if (width != 0) {
|
||||
if (streamIntent_ == StreamIntent::STILL_CAPTURE) {
|
||||
if (g_timestamp[0] == 0) {
|
||||
g_timestamp[0] = timestamp;
|
||||
} else {
|
||||
@ -426,7 +428,7 @@ OHOS::sptr<OHOS::IBufferProducer> Test::StreamConsumer::CreateProducer(std::func
|
||||
buffer->GetExtraData()->ExtraGet(OHOS::Camera::streamId, streamId);
|
||||
buffer->GetExtraData()->ExtraGet(OHOS::Camera::captureId, captureId);
|
||||
buffer->GetExtraData()->ExtraGet(OHOS::Camera::dataWidth, width);
|
||||
ReturnTimeStamp(g_timestamp, sizeof(g_timestamp) / sizeof(g_timestamp[0]), timestamp, width);
|
||||
ReturnTimeStamp(g_timestamp, timestamp, this->streamIntent_);
|
||||
if (gotSize) {
|
||||
CalculateFps(timestamp, streamId);
|
||||
callback_(addr, gotSize);
|
||||
|
Loading…
Reference in New Issue
Block a user