From b885fb40ffc5a8c6b23cb31d7afb06015ec19252 Mon Sep 17 00:00:00 2001 From: sharpshooter Date: Fri, 20 Aug 2021 07:03:55 +0000 Subject: [PATCH 1/4] =?UTF-8?q?=E8=A7=A3=E5=86=B364bit=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/gstreamer/common/loader/gst_loader.cpp | 2 +- services/engine/gstreamer/player/gst_player_ctrl.cpp | 12 ++++++------ .../player/gst_player_video_renderer_ctrl.cpp | 4 ++-- .../sa_media/server/media_server_manager.cpp | 8 ++++---- services/utils/time_monitor.cpp | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/services/engine/gstreamer/common/loader/gst_loader.cpp b/services/engine/gstreamer/common/loader/gst_loader.cpp index 5fe7bb8b6..6ebe27a95 100644 --- a/services/engine/gstreamer/common/loader/gst_loader.cpp +++ b/services/engine/gstreamer/common/loader/gst_loader.cpp @@ -170,7 +170,7 @@ static void SplitString(const std::string &input, const std::string &delimiter, static void SetGstLogLevelFromSysPara() { std::string levelPara; - int res = OHOS::system::GetStringParameter("sys.media.log.level", levelPara, ""); + int32_t res = OHOS::system::GetStringParameter("sys.media.log.level", levelPara, ""); if (res != 0 || levelPara.empty()) { gst_debug_set_default_threshold (GST_LEVEL_WARNING); MEDIA_LOGD("sys.media.log.level not find"); diff --git a/services/engine/gstreamer/player/gst_player_ctrl.cpp b/services/engine/gstreamer/player/gst_player_ctrl.cpp index 36a4deea4..ca56d52f8 100644 --- a/services/engine/gstreamer/player/gst_player_ctrl.cpp +++ b/services/engine/gstreamer/player/gst_player_ctrl.cpp @@ -304,7 +304,7 @@ uint64_t GstPlayerCtrl::GetPosition() GstClockTime position = gst_player_get_position(gstPlayer_); uint64_t curTime = static_cast(position) / MICRO; curTime = std::min(curTime, sourceDuration_); - MEDIA_LOGD("GetPosition curTime(%{public}llu) duration(%{public}llu)", curTime, sourceDuration_); + MEDIA_LOGD("GetPosition curTime(0x%{public}" PRIu64 ") duration(0x%{public}" PRIu64 ")", curTime, sourceDuration_); return curTime; } @@ -551,7 +551,7 @@ void GstPlayerCtrl::ProcessSeekDone(const GstPlayer *cbPlayer, uint64_t position position = std::min(position, sourceDuration_); seekDoneNeedCb_ = true; seekDonePosition_ = position; - MEDIA_LOGI("gstplay seek Done: %{public}llu", seekDonePosition_); + MEDIA_LOGI("gstplay seek Done: (0x%{public}" PRIu64 ")", seekDonePosition_); } void GstPlayerCtrl::OnPositionUpdatedCb(const GstPlayer *player, guint64 position, const GstPlayerCtrl *self) @@ -574,7 +574,7 @@ void GstPlayerCtrl::ProcessPositionUpdated(const GstPlayer *cbPlayer, uint64_t p Format format; std::shared_ptr tempObs = obs_.lock(); if (tempObs != nullptr) { - MEDIA_LOGD("ProcessPositionUpdated %{public}llu, 0x%{public}06" PRIXPTR "", position, FAKE_POINTER(this)); + MEDIA_LOGD("ProcessPositionUpdated(0x%{public}" PRIu64 "), 0x%{public}06" PRIXPTR "", position, FAKE_POINTER(this)); tempObs->OnInfo(INFO_TYPE_POSITION_UPDATE, static_cast(position), format); } } @@ -616,7 +616,7 @@ void GstPlayerCtrl::OnNotify(PlayerStates state) case PLAYER_PAUSED: condVarPauseSync_.notify_all(); break; - case PLAYER_STOPPED: + case PLAYER_STOPPED: condVarStopSync_.notify_all(); break; default: @@ -627,7 +627,7 @@ void GstPlayerCtrl::OnNotify(PlayerStates state) void GstPlayerCtrl::OnSeekDone() { if (seekDoneNeedCb_) { - MEDIA_LOGI("On Seek Done: %{public}llu", seekDonePosition_); + MEDIA_LOGI("On Seek Done: (0x%{public}" PRIu64 ")", seekDonePosition_); std::shared_ptr tempObs = obs_.lock(); Format format; if (tempObs != nullptr) { @@ -698,7 +698,7 @@ void GstPlayerCtrl::InitDuration() CHECK_AND_RETURN_LOG(gstPlayer_ != nullptr, "gstPlayer_ is nullptr"); GstClockTime time = gst_player_get_duration(gstPlayer_); sourceDuration_ = static_cast(time) / MICRO; - MEDIA_LOGD("InitDuration duration(%{public}llu)", sourceDuration_); + MEDIA_LOGD("InitDuration duration(0x%{public}" PRIu64 ")", sourceDuration_); } } // Media } // OHOS \ No newline at end of file diff --git a/services/engine/gstreamer/player/gst_player_video_renderer_ctrl.cpp b/services/engine/gstreamer/player/gst_player_video_renderer_ctrl.cpp index ce0e08ce4..2e458cb7f 100644 --- a/services/engine/gstreamer/player/gst_player_video_renderer_ctrl.cpp +++ b/services/engine/gstreamer/player/gst_player_video_renderer_ctrl.cpp @@ -277,7 +277,7 @@ int32_t GstPlayerVideoRendererCtrl::PullVideoBuffer() void GstPlayerVideoRendererCtrl::SetSurfaceTimeFromSysPara() { std::string timeEnable; - int res = OHOS::system::GetStringParameter("sys.media.time.surface", timeEnable, ""); + int32_t res = OHOS::system::GetStringParameter("sys.media.time.surface", timeEnable, ""); if (res != 0 || timeEnable.empty()) { surfaceTimeEnable = false; MEDIA_LOGD("sys.media.time.surface=false"); @@ -304,7 +304,7 @@ int32_t GstPlayerVideoRendererCtrl::UpdateSurfaceBuffer(const GstBuffer &buffer) CHECK_AND_RETURN_RET_LOG(videoMeta != nullptr, ERR_INVALID_VALUE, "gst_buffer_get_video_meta failed.."); gsize size = gst_buffer_get_size(buf); - CHECK_AND_RETURN_RET_LOG(size > 0, ERR_INVALID_VALUE, "gst_buffer_get_size failed(%{public}d)..", size); + CHECK_AND_RETURN_RET_LOG(size > 0, ERR_INVALID_VALUE, "gst_buffer_get_size failed.."); BufferRequestConfig requestConfig; requestConfig.width = videoMeta->width; diff --git a/services/services/sa_media/server/media_server_manager.cpp b/services/services/sa_media/server/media_server_manager.cpp index 6c3f2697e..9c5192059 100644 --- a/services/services/sa_media/server/media_server_manager.cpp +++ b/services/services/sa_media/server/media_server_manager.cpp @@ -47,7 +47,7 @@ sptr MediaServerManager::CreateStubObject(StubType type) switch (type) { case RECORDER: { if (recorderStubList_.size() >= SERVER_MAX_NUMBER) { - MEDIA_LOGE("The number of recorder services(%{public}d) has reached the upper limit." + MEDIA_LOGE("The number of recorder services(%{public}zu) has reached the upper limit." "Please release the applied resources.", recorderStubList_.size()); return nullptr; } @@ -59,13 +59,13 @@ sptr MediaServerManager::CreateStubObject(StubType type) sptr object = recorderStub->AsObject(); if (object != nullptr) { recorderStubList_.push_back(object); - MEDIA_LOGD("The number of recorder services(%{public}d).", recorderStubList_.size()); + MEDIA_LOGD("The number of recorder services(%{public}zu).", recorderStubList_.size()); } return object; } case PLAYER: { if (playerStubList_.size() >= SERVER_MAX_NUMBER) { - MEDIA_LOGE("The number of player services(%{public}d) has reached the upper limit." + MEDIA_LOGE("The number of player services(%{public}zu) has reached the upper limit." "Please release the applied resources.", playerStubList_.size()); return nullptr; } @@ -77,7 +77,7 @@ sptr MediaServerManager::CreateStubObject(StubType type) sptr object = playerStub->AsObject(); if (object != nullptr) { playerStubList_.push_back(object); - MEDIA_LOGD("The number of player services(%{public}d).", playerStubList_.size()); + MEDIA_LOGD("The number of player services(%{public}zu).", playerStubList_.size()); } return object; } diff --git a/services/utils/time_monitor.cpp b/services/utils/time_monitor.cpp index a46d0ab41..527a7fd7f 100644 --- a/services/utils/time_monitor.cpp +++ b/services/utils/time_monitor.cpp @@ -49,7 +49,7 @@ void TimeMonitor::FinishTime() if (ret == -1) { MEDIA_LOGE("get current time failed!"); } - MEDIA_LOGD("%{public}s: elapsed time = %{public}lld ms", objectName_.c_str(), + MEDIA_LOGD("%{public}s: elapsed time = 0x%{public}" PRId64 " ms", objectName_.c_str(), (Timeval2Sec(finishTime_, TIME_VAL_MS) - Timeval2Sec(startTime_, TIME_VAL_MS))); isStart_ = false; } -- Gitee From 19f953542103fd0d616411c604b141eebfe9a37e Mon Sep 17 00:00:00 2001 From: sharpshooter Date: Fri, 20 Aug 2021 07:14:42 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=E8=A7=A3=E5=86=B364=E4=BD=8D=E7=BC=96?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/codec/hdi/vdec/src/gst_hdi_video_dec.c | 5 +++-- .../plugins/sink/audiosink/src/gst_audio_server_sink.cpp | 3 ++- .../gstreamer/recorder/element_wrapper/mux_sink_bin.cpp | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/services/engine/gstreamer/plugins/codec/hdi/vdec/src/gst_hdi_video_dec.c b/services/engine/gstreamer/plugins/codec/hdi/vdec/src/gst_hdi_video_dec.c index 292cfee2a..458118147 100644 --- a/services/engine/gstreamer/plugins/codec/hdi/vdec/src/gst_hdi_video_dec.c +++ b/services/engine/gstreamer/plugins/codec/hdi/vdec/src/gst_hdi_video_dec.c @@ -14,6 +14,7 @@ */ #include "gst_hdi_video_dec.h" +#include #include "gst_dec_surface.h" #include "securec.h" @@ -699,7 +700,7 @@ static gboolean gst_hdi_video_dec_fill_surface_buffer(const GstHDIVideoDec *self g_return_val_if_fail(self->hdi_video_out_format.vir_addr != NULL, FALSE); HI_MPI_SYS_Munmap(self->hdi_video_out_format.vir_addr, size); #endif - GST_DEBUG_OBJECT(self, "memcpy_s s %u %lld ", gst_buffer_get_size(outbuf), end - start); + GST_DEBUG_OBJECT(self, "memcpy_s s %u %" PRId64 " ", gst_buffer_get_size(outbuf), end - start); GST_BUFFER_PTS (frame->output_buffer) = GST_BUFFER_PTS (outbuf); return TRUE; } @@ -718,7 +719,7 @@ static gboolean gst_hdi_video_dec_fill_gst_buffer(const GstHDIVideoDec *self, co g_return_val_if_fail(self->hdi_video_out_format.vir_addr != NULL, FALSE); HI_MPI_SYS_Munmap(self->hdi_video_out_format.vir_addr, self->hdi_video_out_format.buffer_size); #endif - GST_DEBUG_OBJECT(self, "memcpy_s s %u %lld ", gst_buffer_get_size(outbuf), end - start); + GST_DEBUG_OBJECT(self, "memcpy_s s %u %" PRId64 " ", gst_buffer_get_size(outbuf), end - start); GST_BUFFER_PTS (frame->output_buffer) = GST_BUFFER_PTS (outbuf); return TRUE; } diff --git a/services/engine/gstreamer/plugins/sink/audiosink/src/gst_audio_server_sink.cpp b/services/engine/gstreamer/plugins/sink/audiosink/src/gst_audio_server_sink.cpp index 64633f0f4..70fef13b1 100644 --- a/services/engine/gstreamer/plugins/sink/audiosink/src/gst_audio_server_sink.cpp +++ b/services/engine/gstreamer/plugins/sink/audiosink/src/gst_audio_server_sink.cpp @@ -15,6 +15,7 @@ #include "config.h" #include "gst_audio_server_sink.h" +#include #include #include "gst/audio/audio.h" #include "media_errors.h" @@ -399,7 +400,7 @@ static GstFlowReturn gst_audio_server_sink_render(GstBaseSink *basesink, GstBuff if (sink->audio_sink->GetLatency(latency) != MSERR_OK) { GST_INFO_OBJECT(basesink, "fail to get latency"); } else { - GST_INFO_OBJECT(basesink, "frame render latency is %llu", latency); + GST_INFO_OBJECT(basesink, "frame render latency is (%" PRIu64 ")", latency); } } g_mutex_unlock(&sink->render_lock); diff --git a/services/engine/gstreamer/recorder/element_wrapper/mux_sink_bin.cpp b/services/engine/gstreamer/recorder/element_wrapper/mux_sink_bin.cpp index e3638fec9..21a7e0c90 100644 --- a/services/engine/gstreamer/recorder/element_wrapper/mux_sink_bin.cpp +++ b/services/engine/gstreamer/recorder/element_wrapper/mux_sink_bin.cpp @@ -181,10 +181,10 @@ int32_t MuxSinkBin::ConfigureMaxFileSize(const RecorderParam &recParam) { const MaxFileSize ¶m = static_cast(recParam); if (param.size <= 0) { - MEDIA_LOGE("Invalid max record file size: %{public}lld", param.size); + MEDIA_LOGE("Invalid max record file size: (%{public}" PRId64 ")", param.size); return ERR_INVALID_VALUE; } - MEDIA_LOGI("Set max filesize success: %{public}lld", param.size); + MEDIA_LOGI("Set max filesize success: (%{public}" PRId64 ")", param.size); MarkParameter(recParam.type); maxSize_ = param.size; @@ -336,7 +336,7 @@ GstPadProbeReturn MuxSinkBin::MuxerSinkPadProbe(const GstPad &pad, GstPadProbeIn void MuxSinkBin::Dump() { MEDIA_LOGI("file format = %{public}d, max duration = %{public}d, " - "max size = %{public}lld, fd = %{public}d, path = %{public}s", + "max size = %{public}" PRId64 ", fd = %{public}d, path = %{public}s", format_, maxDuration_, maxSize_, outFd_, outPath_.c_str()); } -- Gitee From 9e4e252a039e0c0ceee25a788ede2eac75c25ac8 Mon Sep 17 00:00:00 2001 From: sharpshooter Date: Fri, 20 Aug 2021 07:16:49 +0000 Subject: [PATCH 3/4] =?UTF-8?q?=E8=A7=A3=E5=86=B364=E4=BD=8D=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/utils/time_monitor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/utils/time_monitor.cpp b/services/utils/time_monitor.cpp index 527a7fd7f..588f6d867 100644 --- a/services/utils/time_monitor.cpp +++ b/services/utils/time_monitor.cpp @@ -49,7 +49,7 @@ void TimeMonitor::FinishTime() if (ret == -1) { MEDIA_LOGE("get current time failed!"); } - MEDIA_LOGD("%{public}s: elapsed time = 0x%{public}" PRId64 " ms", objectName_.c_str(), + MEDIA_LOGD("%{public}s: elapsed time = %{public}" PRId64 " ms", objectName_.c_str(), (Timeval2Sec(finishTime_, TIME_VAL_MS) - Timeval2Sec(startTime_, TIME_VAL_MS))); isStart_ = false; } -- Gitee From 32f23cf5e5702cc76a333eb225d92163655bc8a0 Mon Sep 17 00:00:00 2001 From: sharpshooter Date: Fri, 20 Aug 2021 07:19:25 +0000 Subject: [PATCH 4/4] =?UTF-8?q?=E8=A7=A3=E5=86=B364=E4=BD=8D=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/engine/gstreamer/player/gst_player_ctrl.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/services/engine/gstreamer/player/gst_player_ctrl.cpp b/services/engine/gstreamer/player/gst_player_ctrl.cpp index ca56d52f8..0d8de164a 100644 --- a/services/engine/gstreamer/player/gst_player_ctrl.cpp +++ b/services/engine/gstreamer/player/gst_player_ctrl.cpp @@ -304,7 +304,7 @@ uint64_t GstPlayerCtrl::GetPosition() GstClockTime position = gst_player_get_position(gstPlayer_); uint64_t curTime = static_cast(position) / MICRO; curTime = std::min(curTime, sourceDuration_); - MEDIA_LOGD("GetPosition curTime(0x%{public}" PRIu64 ") duration(0x%{public}" PRIu64 ")", curTime, sourceDuration_); + MEDIA_LOGD("GetPosition curTime(%{public}" PRIu64 ") duration(%{public}" PRIu64 ")", curTime, sourceDuration_); return curTime; } @@ -551,7 +551,7 @@ void GstPlayerCtrl::ProcessSeekDone(const GstPlayer *cbPlayer, uint64_t position position = std::min(position, sourceDuration_); seekDoneNeedCb_ = true; seekDonePosition_ = position; - MEDIA_LOGI("gstplay seek Done: (0x%{public}" PRIu64 ")", seekDonePosition_); + MEDIA_LOGI("gstplay seek Done: (%{public}" PRIu64 ")", seekDonePosition_); } void GstPlayerCtrl::OnPositionUpdatedCb(const GstPlayer *player, guint64 position, const GstPlayerCtrl *self) @@ -574,7 +574,7 @@ void GstPlayerCtrl::ProcessPositionUpdated(const GstPlayer *cbPlayer, uint64_t p Format format; std::shared_ptr tempObs = obs_.lock(); if (tempObs != nullptr) { - MEDIA_LOGD("ProcessPositionUpdated(0x%{public}" PRIu64 "), 0x%{public}06" PRIXPTR "", position, FAKE_POINTER(this)); + MEDIA_LOGD("ProcessPositionUpdated(%{public}" PRIu64 "), 0x%{public}06" PRIXPTR "", position, FAKE_POINTER(this)); tempObs->OnInfo(INFO_TYPE_POSITION_UPDATE, static_cast(position), format); } } @@ -627,7 +627,7 @@ void GstPlayerCtrl::OnNotify(PlayerStates state) void GstPlayerCtrl::OnSeekDone() { if (seekDoneNeedCb_) { - MEDIA_LOGI("On Seek Done: (0x%{public}" PRIu64 ")", seekDonePosition_); + MEDIA_LOGI("On Seek Done: (%{public}" PRIu64 ")", seekDonePosition_); std::shared_ptr tempObs = obs_.lock(); Format format; if (tempObs != nullptr) { @@ -698,7 +698,7 @@ void GstPlayerCtrl::InitDuration() CHECK_AND_RETURN_LOG(gstPlayer_ != nullptr, "gstPlayer_ is nullptr"); GstClockTime time = gst_player_get_duration(gstPlayer_); sourceDuration_ = static_cast(time) / MICRO; - MEDIA_LOGD("InitDuration duration(0x%{public}" PRIu64 ")", sourceDuration_); + MEDIA_LOGD("InitDuration duration(%{public}" PRIu64 ")", sourceDuration_); } } // Media } // OHOS \ No newline at end of file -- Gitee