From b5f6401b2de2a8961cf375fc4de98a660c00979e Mon Sep 17 00:00:00 2001 From: wangxiake Date: Wed, 10 Sep 2025 10:28:17 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E8=AA=BF=E7=94=A8=E6=8F=90=E5=8D=87?= =?UTF-8?q?=E7=B6=AB=E7=A8=8B=E5=84=AA=E5=85=88=E7=B4=9A=E7=9A=84=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20Signed-off-by:=20wangxiake=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../avmetadatahelper_impl.cpp | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp b/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp index 29fc160f0..1922252f7 100644 --- a/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp +++ b/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp @@ -137,6 +137,20 @@ Status AVMetadataHelperImpl::SetSourceInternel(const std::string &uri, bool isFo Status ret = mediaDemuxer_->SetDataSource(std::make_shared(uri)); CHECK_AND_RETURN_RET_LOG(ret == Status::OK, ret, "0x%{public}06" PRIXPTR " SetSourceInternel demuxer failed to call SetDataSource", FAKE_POINTER(this)); + bool isWatch = false; + if(isWatch){ + auto plugin = mediaDemuxer_->GetCurFFmpegPlugin(); + if (plugin != nullptr) { + Status boostRet = plugin->BoostReadThreadPriority(); + if (boostRet != Status::OK) { + MEDIA_LOGW("Failed to boost read thread priority, ret: %{public}d", static_cast(boostRet)); + } else { + MEDIA_LOGI("Successfully boosted read thread priority for watch device"); + } + } else { + MEDIA_LOGW("Plugin not available, cannot boost read thread priority"); + } + } return Status::OK; } @@ -166,6 +180,20 @@ Status AVMetadataHelperImpl::SetSourceInternel(const std::shared_ptrSetDataSource(std::make_shared(dataSrc)); CHECK_AND_RETURN_RET_LOG(ret == Status::OK, ret, "Failed to call SetDataSource"); + bool isWatch = false; + if(isWatch){ + auto plugin = mediaDemuxer_->GetCurFFmpegPlugin(); + if (plugin != nullptr) { + Status boostRet = plugin->BoostReadThreadPriority(); + if (boostRet != Status::OK) { + MEDIA_LOGW("Failed to boost read thread priority, ret: %{public}d", static_cast(boostRet)); + } else { + MEDIA_LOGI("Successfully boosted read thread priority for watch device"); + } + } else { + MEDIA_LOGW("Plugin not available, cannot boost read thread priority"); + } + } return Status::OK; } @@ -191,6 +219,20 @@ Status AVMetadataHelperImpl::SetSourceInternel(const std::string &uri, } CHECK_AND_RETURN_RET_LOG(ret == Status::OK, ret, "0x%{public}06" PRIXPTR " SetSourceInternel demuxer failed to call SetDataSource", FAKE_POINTER(this)); + bool isWatch = false; + if(isWatch){ + auto plugin = mediaDemuxer_->GetCurFFmpegPlugin(); + if (plugin != nullptr) { + Status boostRet = plugin->BoostReadThreadPriority(); + if (boostRet != Status::OK) { + MEDIA_LOGW("Failed to boost read thread priority, ret: %{public}d", static_cast(boostRet)); + } else { + MEDIA_LOGI("Successfully boosted read thread priority for watch device"); + } + } else { + MEDIA_LOGW("Plugin not available, cannot boost read thread priority"); + } + } return Status::OK; } -- Gitee From 2d3fa96ca85f8fdacfce73240945f25f60e1ea60 Mon Sep 17 00:00:00 2001 From: wangxiake Date: Wed, 10 Sep 2025 11:10:01 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=9C=A8media=5Fdemuxer=E4=B8=AD=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=20Signed-off-by:=20wangxiake=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../avmetadatahelper_impl.cpp | 54 ++++++------------- 1 file changed, 15 insertions(+), 39 deletions(-) diff --git a/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp b/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp index 1922252f7..3206cab57 100644 --- a/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp +++ b/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp @@ -137,19 +137,11 @@ Status AVMetadataHelperImpl::SetSourceInternel(const std::string &uri, bool isFo Status ret = mediaDemuxer_->SetDataSource(std::make_shared(uri)); CHECK_AND_RETURN_RET_LOG(ret == Status::OK, ret, "0x%{public}06" PRIXPTR " SetSourceInternel demuxer failed to call SetDataSource", FAKE_POINTER(this)); - bool isWatch = false; - if(isWatch){ - auto plugin = mediaDemuxer_->GetCurFFmpegPlugin(); - if (plugin != nullptr) { - Status boostRet = plugin->BoostReadThreadPriority(); - if (boostRet != Status::OK) { - MEDIA_LOGW("Failed to boost read thread priority, ret: %{public}d", static_cast(boostRet)); - } else { - MEDIA_LOGI("Successfully boosted read thread priority for watch device"); - } - } else { - MEDIA_LOGW("Plugin not available, cannot boost read thread priority"); - } + Status boostRet = mediaDemuxer_->BoostReadThreadPriority(); + if (boostRet != Status::OK) { + MEDIA_LOGW("Failed to boost read thread priority, ret: %{public}d", static_cast(boostRet)); + } else { + MEDIA_LOGI("Successfully boosted read thread priority for watch device"); } return Status::OK; } @@ -180,19 +172,11 @@ Status AVMetadataHelperImpl::SetSourceInternel(const std::shared_ptrSetDataSource(std::make_shared(dataSrc)); CHECK_AND_RETURN_RET_LOG(ret == Status::OK, ret, "Failed to call SetDataSource"); - bool isWatch = false; - if(isWatch){ - auto plugin = mediaDemuxer_->GetCurFFmpegPlugin(); - if (plugin != nullptr) { - Status boostRet = plugin->BoostReadThreadPriority(); - if (boostRet != Status::OK) { - MEDIA_LOGW("Failed to boost read thread priority, ret: %{public}d", static_cast(boostRet)); - } else { - MEDIA_LOGI("Successfully boosted read thread priority for watch device"); - } - } else { - MEDIA_LOGW("Plugin not available, cannot boost read thread priority"); - } + Status boostRet = mediaDemuxer_->BoostReadThreadPriority(); + if (boostRet != Status::OK) { + MEDIA_LOGW("Failed to boost read thread priority, ret: %{public}d", static_cast(boostRet)); + } else { + MEDIA_LOGI("Successfully boosted read thread priority for watch device"); } return Status::OK; } @@ -219,19 +203,11 @@ Status AVMetadataHelperImpl::SetSourceInternel(const std::string &uri, } CHECK_AND_RETURN_RET_LOG(ret == Status::OK, ret, "0x%{public}06" PRIXPTR " SetSourceInternel demuxer failed to call SetDataSource", FAKE_POINTER(this)); - bool isWatch = false; - if(isWatch){ - auto plugin = mediaDemuxer_->GetCurFFmpegPlugin(); - if (plugin != nullptr) { - Status boostRet = plugin->BoostReadThreadPriority(); - if (boostRet != Status::OK) { - MEDIA_LOGW("Failed to boost read thread priority, ret: %{public}d", static_cast(boostRet)); - } else { - MEDIA_LOGI("Successfully boosted read thread priority for watch device"); - } - } else { - MEDIA_LOGW("Plugin not available, cannot boost read thread priority"); - } + Status boostRet = mediaDemuxer_->BoostReadThreadPriority(); + if (boostRet != Status::OK) { + MEDIA_LOGW("Failed to boost read thread priority, ret: %{public}d", static_cast(boostRet)); + } else { + MEDIA_LOGI("Successfully boosted read thread priority for watch device"); } return Status::OK; } -- Gitee From 6eaa773a8bcd3eb8906c6c968ca54ddcf5ef18f6 Mon Sep 17 00:00:00 2001 From: wangxiake Date: Wed, 10 Sep 2025 11:48:21 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97=20Sign?= =?UTF-8?q?ed-off-by:=20wangxiake=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../histreamer/avmetadatahelper/avmetadatahelper_impl.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp b/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp index 3206cab57..cf5f43469 100644 --- a/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp +++ b/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp @@ -137,6 +137,7 @@ Status AVMetadataHelperImpl::SetSourceInternel(const std::string &uri, bool isFo Status ret = mediaDemuxer_->SetDataSource(std::make_shared(uri)); CHECK_AND_RETURN_RET_LOG(ret == Status::OK, ret, "0x%{public}06" PRIXPTR " SetSourceInternel demuxer failed to call SetDataSource", FAKE_POINTER(this)); + MEDIA_LOGI("Attempting to boost read thread priority for watch device"); Status boostRet = mediaDemuxer_->BoostReadThreadPriority(); if (boostRet != Status::OK) { MEDIA_LOGW("Failed to boost read thread priority, ret: %{public}d", static_cast(boostRet)); @@ -172,6 +173,7 @@ Status AVMetadataHelperImpl::SetSourceInternel(const std::shared_ptrSetDataSource(std::make_shared(dataSrc)); CHECK_AND_RETURN_RET_LOG(ret == Status::OK, ret, "Failed to call SetDataSource"); + MEDIA_LOGI("Attempting to boost read thread priority for watch device"); Status boostRet = mediaDemuxer_->BoostReadThreadPriority(); if (boostRet != Status::OK) { MEDIA_LOGW("Failed to boost read thread priority, ret: %{public}d", static_cast(boostRet)); @@ -203,6 +205,7 @@ Status AVMetadataHelperImpl::SetSourceInternel(const std::string &uri, } CHECK_AND_RETURN_RET_LOG(ret == Status::OK, ret, "0x%{public}06" PRIXPTR " SetSourceInternel demuxer failed to call SetDataSource", FAKE_POINTER(this)); + MEDIA_LOGI("Attempting to boost read thread priority for watch device"); Status boostRet = mediaDemuxer_->BoostReadThreadPriority(); if (boostRet != Status::OK) { MEDIA_LOGW("Failed to boost read thread priority, ret: %{public}d", static_cast(boostRet)); -- Gitee From cda7e1f77b76c3753ded700dc1f7f0199e0b2271 Mon Sep 17 00:00:00 2001 From: wangxiake Date: Wed, 10 Sep 2025 20:36:58 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=8B=E8=A1=A8?= =?UTF-8?q?=E5=88=A4=E6=96=AD=20Signed-off-by:=20wangxiake=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../avmetadatahelper_impl.cpp | 45 ++++++++++++------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp b/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp index cf5f43469..1f10740cb 100644 --- a/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp +++ b/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp @@ -137,12 +137,17 @@ Status AVMetadataHelperImpl::SetSourceInternel(const std::string &uri, bool isFo Status ret = mediaDemuxer_->SetDataSource(std::make_shared(uri)); CHECK_AND_RETURN_RET_LOG(ret == Status::OK, ret, "0x%{public}06" PRIXPTR " SetSourceInternel demuxer failed to call SetDataSource", FAKE_POINTER(this)); - MEDIA_LOGI("Attempting to boost read thread priority for watch device"); - Status boostRet = mediaDemuxer_->BoostReadThreadPriority(); - if (boostRet != Status::OK) { - MEDIA_LOGW("Failed to boost read thread priority, ret: %{public}d", static_cast(boostRet)); + bool isWatchDevice = mediaDemuxer_->IsWatchDevice(); + if (isWatchDevice) { + MEDIA_LOGI("Watch device detected, attempting to boost read thread priority"); + Status boostRet = mediaDemuxer_->BoostReadThreadPriority(); + if (boostRet != Status::OK) { + MEDIA_LOGW("Failed to boost read thread priority, ret: %{public}d", static_cast(boostRet)); + } else { + MEDIA_LOGI("Successfully boosted read thread priority for watch device"); + } } else { - MEDIA_LOGI("Successfully boosted read thread priority for watch device"); + MEDIA_LOGD("Non-watch device detected, skipping read thread priority boost"); } return Status::OK; } @@ -173,12 +178,17 @@ Status AVMetadataHelperImpl::SetSourceInternel(const std::shared_ptrSetDataSource(std::make_shared(dataSrc)); CHECK_AND_RETURN_RET_LOG(ret == Status::OK, ret, "Failed to call SetDataSource"); - MEDIA_LOGI("Attempting to boost read thread priority for watch device"); - Status boostRet = mediaDemuxer_->BoostReadThreadPriority(); - if (boostRet != Status::OK) { - MEDIA_LOGW("Failed to boost read thread priority, ret: %{public}d", static_cast(boostRet)); + bool isWatchDevice = mediaDemuxer_->IsWatchDevice(); + if (isWatchDevice) { + MEDIA_LOGI("Watch device detected, attempting to boost read thread priority"); + Status boostRet = mediaDemuxer_->BoostReadThreadPriority(); + if (boostRet != Status::OK) { + MEDIA_LOGW("Failed to boost read thread priority, ret: %{public}d", static_cast(boostRet)); + } else { + MEDIA_LOGI("Successfully boosted read thread priority for watch device"); + } } else { - MEDIA_LOGI("Successfully boosted read thread priority for watch device"); + MEDIA_LOGD("Non-watch device detected, skipping read thread priority boost"); } return Status::OK; } @@ -205,12 +215,17 @@ Status AVMetadataHelperImpl::SetSourceInternel(const std::string &uri, } CHECK_AND_RETURN_RET_LOG(ret == Status::OK, ret, "0x%{public}06" PRIXPTR " SetSourceInternel demuxer failed to call SetDataSource", FAKE_POINTER(this)); - MEDIA_LOGI("Attempting to boost read thread priority for watch device"); - Status boostRet = mediaDemuxer_->BoostReadThreadPriority(); - if (boostRet != Status::OK) { - MEDIA_LOGW("Failed to boost read thread priority, ret: %{public}d", static_cast(boostRet)); + bool isWatchDevice = mediaDemuxer_->IsWatchDevice(); + if (isWatchDevice) { + MEDIA_LOGI("Watch device detected, attempting to boost read thread priority"); + Status boostRet = mediaDemuxer_->BoostReadThreadPriority(); + if (boostRet != Status::OK) { + MEDIA_LOGW("Failed to boost read thread priority, ret: %{public}d", static_cast(boostRet)); + } else { + MEDIA_LOGI("Successfully boosted read thread priority for watch device"); + } } else { - MEDIA_LOGI("Successfully boosted read thread priority for watch device"); + MEDIA_LOGD("Non-watch device detected, skipping read thread priority boost"); } return Status::OK; } -- Gitee From a24519d6d12443e3b1af305a6a53438da3c2adc2 Mon Sep 17 00:00:00 2001 From: wangxiake Date: Wed, 10 Sep 2025 21:08:15 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97=20Sign?= =?UTF-8?q?ed-off-by:=20wangxiake=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../avmetadatahelper_impl.cpp | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp b/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp index 1f10740cb..3a5c443c0 100644 --- a/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp +++ b/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp @@ -139,16 +139,16 @@ Status AVMetadataHelperImpl::SetSourceInternel(const std::string &uri, bool isFo "0x%{public}06" PRIXPTR " SetSourceInternel demuxer failed to call SetDataSource", FAKE_POINTER(this)); bool isWatchDevice = mediaDemuxer_->IsWatchDevice(); if (isWatchDevice) { - MEDIA_LOGI("Watch device detected, attempting to boost read thread priority"); + MEDIA_LOGI("Watch detected, boosting read thread priority"); Status boostRet = mediaDemuxer_->BoostReadThreadPriority(); if (boostRet != Status::OK) { MEDIA_LOGW("Failed to boost read thread priority, ret: %{public}d", static_cast(boostRet)); } else { - MEDIA_LOGI("Successfully boosted read thread priority for watch device"); + MEDIA_LOGI("Successfully boosted read thread priority for watch"); } } else { - MEDIA_LOGD("Non-watch device detected, skipping read thread priority boost"); - } + MEDIA_LOGD("Non-watch detected, no boosting"); + } return Status::OK; } @@ -180,16 +180,16 @@ Status AVMetadataHelperImpl::SetSourceInternel(const std::shared_ptrIsWatchDevice(); if (isWatchDevice) { - MEDIA_LOGI("Watch device detected, attempting to boost read thread priority"); + MEDIA_LOGI("Watch detected, boosting read thread priority"); Status boostRet = mediaDemuxer_->BoostReadThreadPriority(); if (boostRet != Status::OK) { MEDIA_LOGW("Failed to boost read thread priority, ret: %{public}d", static_cast(boostRet)); } else { - MEDIA_LOGI("Successfully boosted read thread priority for watch device"); + MEDIA_LOGI("Successfully boosted read thread priority for watch"); } } else { - MEDIA_LOGD("Non-watch device detected, skipping read thread priority boost"); - } + MEDIA_LOGD("Non-watch detected, no boosting"); + } return Status::OK; } @@ -217,16 +217,16 @@ Status AVMetadataHelperImpl::SetSourceInternel(const std::string &uri, "0x%{public}06" PRIXPTR " SetSourceInternel demuxer failed to call SetDataSource", FAKE_POINTER(this)); bool isWatchDevice = mediaDemuxer_->IsWatchDevice(); if (isWatchDevice) { - MEDIA_LOGI("Watch device detected, attempting to boost read thread priority"); + MEDIA_LOGI("Watch detected, boosting read thread priority"); Status boostRet = mediaDemuxer_->BoostReadThreadPriority(); if (boostRet != Status::OK) { MEDIA_LOGW("Failed to boost read thread priority, ret: %{public}d", static_cast(boostRet)); } else { - MEDIA_LOGI("Successfully boosted read thread priority for watch device"); + MEDIA_LOGI("Successfully boosted read thread priority for watch"); } } else { - MEDIA_LOGD("Non-watch device detected, skipping read thread priority boost"); - } + MEDIA_LOGD("Non-watch detected, no boosting"); + } return Status::OK; } -- Gitee From 7bab4644f13a77f09f031f48f555def5b31ab256 Mon Sep 17 00:00:00 2001 From: wangxiake Date: Wed, 10 Sep 2025 21:24:07 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=97=A5=E5=BF=97=20Signed-off-by:=20wangx?= =?UTF-8?q?iake=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../avmetadatahelper/avmetadatahelper_impl.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp b/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp index 3a5c443c0..c67f7e36f 100644 --- a/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp +++ b/services/engine/histreamer/avmetadatahelper/avmetadatahelper_impl.cpp @@ -142,12 +142,12 @@ Status AVMetadataHelperImpl::SetSourceInternel(const std::string &uri, bool isFo MEDIA_LOGI("Watch detected, boosting read thread priority"); Status boostRet = mediaDemuxer_->BoostReadThreadPriority(); if (boostRet != Status::OK) { - MEDIA_LOGW("Failed to boost read thread priority, ret: %{public}d", static_cast(boostRet)); + MEDIA_LOGW("Boosting for watch ended in failure, ret: %{public}d", static_cast(boostRet)); } else { - MEDIA_LOGI("Successfully boosted read thread priority for watch"); + MEDIA_LOGI("Boosting for watch ended successfully"); } } else { - MEDIA_LOGD("Non-watch detected, no boosting"); + MEDIA_LOGD("Non-watch detected, not boosting"); } return Status::OK; } @@ -183,12 +183,12 @@ Status AVMetadataHelperImpl::SetSourceInternel(const std::shared_ptrBoostReadThreadPriority(); if (boostRet != Status::OK) { - MEDIA_LOGW("Failed to boost read thread priority, ret: %{public}d", static_cast(boostRet)); + MEDIA_LOGW("Boosting for watch ended in failure, ret: %{public}d", static_cast(boostRet)); } else { - MEDIA_LOGI("Successfully boosted read thread priority for watch"); + MEDIA_LOGI("Boosting for watch ended successfully"); } } else { - MEDIA_LOGD("Non-watch detected, no boosting"); + MEDIA_LOGD("Non-watch detected, not boosting"); } return Status::OK; } @@ -220,12 +220,12 @@ Status AVMetadataHelperImpl::SetSourceInternel(const std::string &uri, MEDIA_LOGI("Watch detected, boosting read thread priority"); Status boostRet = mediaDemuxer_->BoostReadThreadPriority(); if (boostRet != Status::OK) { - MEDIA_LOGW("Failed to boost read thread priority, ret: %{public}d", static_cast(boostRet)); + MEDIA_LOGW("Boosting ended in failure, ret: %{public}d", static_cast(boostRet)); } else { - MEDIA_LOGI("Successfully boosted read thread priority for watch"); + MEDIA_LOGI("Boosting ended successfully"); } } else { - MEDIA_LOGD("Non-watch detected, no boosting"); + MEDIA_LOGD("Non-watch detected, not boosting"); } return Status::OK; } -- Gitee