make imageId_ non-static

Signed-off-by: y00656910 <yaoxingyu3@huawei.com>
Change-Id: I7350a2b95503795b638e13bba01f413ec9c59607
This commit is contained in:
y00656910 2024-01-15 09:26:08 +08:00
parent c724a29b6f
commit 50c14538f8
2 changed files with 2 additions and 3 deletions

View File

@ -133,7 +133,6 @@ static const uint8_t ASTC_HEADER_DIM_Y = 10;
PluginServer &ImageSource::pluginServer_ = ImageUtils::GetPluginServer(); PluginServer &ImageSource::pluginServer_ = ImageUtils::GetPluginServer();
ImageSource::FormatAgentMap ImageSource::formatAgentMap_ = InitClass(); ImageSource::FormatAgentMap ImageSource::formatAgentMap_ = InitClass();
uint64_t ImageSource::imageId_ = 0;
uint32_t ImageSource::GetSupportedFormats(set<string> &formats) uint32_t ImageSource::GetSupportedFormats(set<string> &formats)
{ {
@ -177,7 +176,6 @@ unique_ptr<ImageSource> ImageSource::DoImageSourceCreate(
{ {
ImageTrace imageTrace(traceName); ImageTrace imageTrace(traceName);
HiLog::Debug(LABEL, "[ImageSource]DoImageSourceCreate IN."); HiLog::Debug(LABEL, "[ImageSource]DoImageSourceCreate IN.");
imageId_ = GetNowTimeMicroSeconds() % NUM_ONE_MILLION;
errorCode = ERR_IMAGE_SOURCE_DATA; errorCode = ERR_IMAGE_SOURCE_DATA;
auto streamPtr = stream(); auto streamPtr = stream();
if (streamPtr == nullptr) { if (streamPtr == nullptr) {
@ -1094,6 +1092,7 @@ ImageSource::ImageSource(unique_ptr<SourceStream> &&stream, const SourceOptions
sourceOptions_.pixelFormat = opts.pixelFormat; sourceOptions_.pixelFormat = opts.pixelFormat;
sourceOptions_.size.width = opts.size.width; sourceOptions_.size.width = opts.size.width;
sourceOptions_.size.height = opts.size.height; sourceOptions_.size.height = opts.size.height;
imageId_ = GetNowTimeMicroSeconds() % NUM_ONE_MILLION;
} }
ImageSource::FormatAgentMap ImageSource::InitClass() ImageSource::FormatAgentMap ImageSource::InitClass()

View File

@ -289,7 +289,7 @@ private:
bool hasDesiredSizeOptions = false; bool hasDesiredSizeOptions = false;
MemoryUsagePreference preference_ = MemoryUsagePreference::DEFAULT; MemoryUsagePreference preference_ = MemoryUsagePreference::DEFAULT;
bool isAstc_ = false; bool isAstc_ = false;
static uint64_t imageId_; // generated from the last six bits of the current timestamp uint64_t imageId_; // generated from the last six bits of the current timestamp
}; };
} // namespace Media } // namespace Media
} // namespace OHOS } // namespace OHOS