diff --git a/services/engine/gstreamer/common/loader/gst_loader.cpp b/services/engine/gstreamer/common/loader/gst_loader.cpp index 5fe7bb8b6e7cc54c693cf8020e69680c2afdcdaf..6ebe27a95bbae3af7c4e06c4dd14d0598f1cdd7e 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 36a4deea4011acb59aea533b4035778a89a0420e..0d8de164ad53acabd4af7ade97a51eb7adc647c8 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(%{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: %{public}llu", 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 %{public}llu, 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); } } @@ -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: (%{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(%{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 ce0e08ce4f3910b1953fb5fb9e8b5b6f8175b99e..2e458cb7f68b13ef4f41ff8027d7e7be57b2a88a 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/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 292cfee2aecb7be06959cddd5eaa3665e7dec780..4581181471eca72fe834d5ec355a23391137c3af 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 64633f0f469241a2c82c2831b59669bb5fc58c0e..70fef13b19a4e19c35787dab929f850e21af3a22 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 e3638fec90c6ad36a16019c0e09c03083687db3c..21a7e0c908f9a1a6be628e0a03c49e72159d93b7 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()); } diff --git a/services/services/sa_media/server/media_server_manager.cpp b/services/services/sa_media/server/media_server_manager.cpp index 6c3f2697ea2c6bd7c0c942d63fbe7e9c60660c8e..9c51920597d4a81ecc3ff49a9957991dea86a2b1 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 a46d0ab41a2ff0574277e39cb39aad5fcf9d0974..588f6d8679bcfdff99bf761c2c76553d9852926d 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 = %{public}" PRId64 " ms", objectName_.c_str(), (Timeval2Sec(finishTime_, TIME_VAL_MS) - Timeval2Sec(startTime_, TIME_VAL_MS))); isStart_ = false; }