From 74c1340dbdd48f620d0f884739fa68f1a8c61fc0 Mon Sep 17 00:00:00 2001 From: LGH W Date: Mon, 30 Dec 2024 16:08:21 +0800 Subject: [PATCH 1/2] dotting reporting unit type Signed-off-by: LGH W --- components/viz/common/quads/compositor_frame_metadata.h | 4 ++-- ohos_nweb/src/sysevent/event_reporter.cc | 6 +++--- ohos_nweb/src/sysevent/event_reporter.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/viz/common/quads/compositor_frame_metadata.h b/components/viz/common/quads/compositor_frame_metadata.h index 857cfae631..dfd54d9685 100644 --- a/components/viz/common/quads/compositor_frame_metadata.h +++ b/components/viz/common/quads/compositor_frame_metadata.h @@ -87,8 +87,8 @@ class VIZ_COMMON_EXPORT CompositorFrameMetadata { #if defined(REPORT_SYS_EVENT) // For video frame drop sysevent report - int64_t dropped_frame_count = 0; - int64_t dropped_frame_duration = 0; + uint32_t dropped_frame_count = 0; + uint64_t dropped_frame_duration = 0; #endif bool may_contain_video = false; diff --git a/ohos_nweb/src/sysevent/event_reporter.cc b/ohos_nweb/src/sysevent/event_reporter.cc index 55ddc4708d..f87d0d8402 100644 --- a/ohos_nweb/src/sysevent/event_reporter.cc +++ b/ohos_nweb/src/sysevent/event_reporter.cc @@ -214,11 +214,11 @@ void ReportAudioFrameDropStats(int frameCount) { {AUDIO_BLANK_FRAME_COUNT, std::to_string(frameCount)}); } -void ReportVideoFrameDropStats(int64_t frameCount, int64_t frameDuration) { +void ReportVideoFrameDropStats(uint32_t frameCount, uint64_t frameDuration) { OhosAdapterHelper::GetInstance().GetHiSysEventAdapterInstance().Write( VIDEO_FRAME_DROP_STATISTICS, HiSysEventAdapter::EventType::STATISTIC, - {VIDEO_FRAME_DROPPED_COUNT, std::to_string(frameCount), - VIDEO_FRAME_DROPPED_DURATION, std::to_string(frameDuration)}); + {VIDEO_FRAME_DROPPED_COUNT, frameCount, + VIDEO_FRAME_DROPPED_DURATION, frameDuration}); } void ReportSiteIsolationMode(const std::string site_isolation_status) { diff --git a/ohos_nweb/src/sysevent/event_reporter.h b/ohos_nweb/src/sysevent/event_reporter.h index 1331cf9635..a761483569 100644 --- a/ohos_nweb/src/sysevent/event_reporter.h +++ b/ohos_nweb/src/sysevent/event_reporter.h @@ -63,7 +63,7 @@ void ReportVideoPlayErrorInfo(const std::string errorType, void ReportAudioFrameDropStats(int frameCount); -void ReportVideoFrameDropStats(int64_t frameCount, int64_t frameDuration); +void ReportVideoFrameDropStats(uint32_t frameCount, uint64_t frameDuration); void ReportSiteIsolationMode(const std::string site_isolation_status); #endif -- Gitee From d80484a0eed135ee78f03648c22ad2fcdf4dff16 Mon Sep 17 00:00:00 2001 From: LGH W Date: Mon, 30 Dec 2024 17:54:53 +0800 Subject: [PATCH 2/2] dotting reporting unit type Signed-off-by: LGH W --- components/viz/common/quads/compositor_frame_metadata.h | 4 ++-- .../viz/service/frame_sinks/compositor_frame_sink_impl.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/viz/common/quads/compositor_frame_metadata.h b/components/viz/common/quads/compositor_frame_metadata.h index dfd54d9685..857cfae631 100644 --- a/components/viz/common/quads/compositor_frame_metadata.h +++ b/components/viz/common/quads/compositor_frame_metadata.h @@ -87,8 +87,8 @@ class VIZ_COMMON_EXPORT CompositorFrameMetadata { #if defined(REPORT_SYS_EVENT) // For video frame drop sysevent report - uint32_t dropped_frame_count = 0; - uint64_t dropped_frame_duration = 0; + int64_t dropped_frame_count = 0; + int64_t dropped_frame_duration = 0; #endif bool may_contain_video = false; diff --git a/components/viz/service/frame_sinks/compositor_frame_sink_impl.cc b/components/viz/service/frame_sinks/compositor_frame_sink_impl.cc index d8e93555ed..5f80ece24c 100644 --- a/components/viz/service/frame_sinks/compositor_frame_sink_impl.cc +++ b/components/viz/service/frame_sinks/compositor_frame_sink_impl.cc @@ -156,8 +156,8 @@ void CompositorFrameSinkImpl::SubmitCompositorFrame( absl::optional hit_test_region_list, uint64_t submit_time) { #if defined(REPORT_SYS_EVENT) - auto count = frame.metadata.dropped_frame_count; - auto duration = frame.metadata.dropped_frame_duration; + uint32_t count = static_cast(frame.metadata.dropped_frame_count); + uint64_t duration = static_cast(frame.metadata.dropped_frame_duration); if (!!count && !!duration) { ReportVideoFrameDropStats(count, duration); } -- Gitee