From f92a1fa60c44045c6a56336b8fe2e736cd115502 Mon Sep 17 00:00:00 2001 From: chenning Date: Fri, 29 Aug 2025 09:17:59 +0800 Subject: [PATCH 1/2] dash code sync Signed-off-by: chenning --- interfaces/plugin/source_plugin.h | 21 ++++----- .../media_engine/modules/source/source.cpp | 30 ++++++------ services/media_engine/modules/source/source.h | 8 ++-- .../source/data_stream_source_plugin.cpp | 25 ++++++---- .../source/data_stream_source_plugin.h | 1 + .../plugins/source/file_fd_source_plugin.cpp | 9 ++-- .../plugins/source/file_source_plugin.cpp | 8 +--- .../plugins/source/http_source/BUILD.gn | 1 + .../dash/dash_media_downloader.cpp | 14 ++++-- .../http_source/dash/dash_media_downloader.h | 2 +- .../dash/dash_segment_downloader.cpp | 46 +++++++++++++------ .../dash/dash_segment_downloader.h | 5 +- 12 files changed, 100 insertions(+), 70 deletions(-) diff --git a/interfaces/plugin/source_plugin.h b/interfaces/plugin/source_plugin.h index 290d8c1c8..353b87747 100644 --- a/interfaces/plugin/source_plugin.h +++ b/interfaces/plugin/source_plugin.h @@ -232,9 +232,9 @@ public: return Status::OK; } - virtual Status SelectStream(int32_t streamID) + virtual bool IsLocalFd() { - return Status::OK; + return false; } virtual Status Pause() @@ -246,7 +246,10 @@ public: { return Status::OK; } - + virtual Status SelectStream(int32_t streamID) + { + return Status::OK; + } virtual void SetEnableOnlineFdCache(bool isEnableFdCache) { (void)isEnableFdCache; @@ -275,10 +278,6 @@ public: virtual void NotifyInitSuccess() {} - virtual bool IsLocalFd() - { - return false; - } virtual uint64_t GetCachedDuration() { return 0; @@ -288,10 +287,6 @@ public: { return false; } - virtual uint64_t GetMemorySize() - { - return 0; - } virtual std::string GetContentType() { return ""; @@ -300,6 +295,10 @@ public: { return false; } + virtual uint64_t GetMemorySize() + { + return 0; + } }; /// Source plugin api major number. diff --git a/services/media_engine/modules/source/source.cpp b/services/media_engine/modules/source/source.cpp index 5761ae32a..c8326e4f6 100644 --- a/services/media_engine/modules/source/source.cpp +++ b/services/media_engine/modules/source/source.cpp @@ -133,6 +133,7 @@ Status Source::SetExtraCache(uint64_t cacheDuration) void Source::SetBundleName(const std::string& bundleName) { if (plugin_ != nullptr) { + MEDIA_LOG_I("SetBundleName bundleName: " PUBLIC_LOG_S, bundleName.c_str()); plugin_->SetBundleName(bundleName); } } @@ -543,12 +544,19 @@ Status Source::FindPlugin(const std::shared_ptr& source) return Status::ERROR_UNSUPPORTED_FORMAT; } +bool Source::IsLocalFd() +{ + FALSE_RETURN_V_MSG_W(plugin_ != nullptr, false, "IsLocalFd source plugin is nullptr"); + return plugin_->IsLocalFd(); +} + int64_t Source::GetDuration() { - FALSE_RETURN_V_MSG_W(seekToTimeFlag_, Plugins::HST_TIME_NONE, "Source GetDuration return -1 for isHls false."); + FALSE_RETURN_V_MSG_W(seekToTimeFlag_, Plugins::HST_TIME_NONE, "Source GetDuration return -1 for isHls false"); + FALSE_RETURN_V_MSG_W(plugin_ != nullptr, Plugins::HST_TIME_NONE, "Source GetDuration error, plugin_ is nullptr"); int64_t duration; Status ret = plugin_->GetDuration(duration); - FALSE_RETURN_V_MSG_W(ret == Status::OK, Plugins::HST_TIME_NONE, "Source GetDuration from source plugin failed."); + FALSE_RETURN_V_MSG_W(ret == Status::OK, Plugins::HST_TIME_NONE, "Source GetDuration from source plugin failed"); return duration; } @@ -599,12 +607,6 @@ void Source::NotifyInitSuccess() plugin_->NotifyInitSuccess(); } -bool Source::IsLocalFd() -{ - FALSE_RETURN_V_MSG_W(plugin_ != nullptr, false, "IsLocalFd source plugin is nullptr"); - return plugin_->IsLocalFd(); -} - uint64_t Source::GetCachedDuration() { FALSE_RETURN_V_MSG_E(plugin_ != nullptr, 0, "plugin_ is nullptr"); @@ -623,18 +625,18 @@ bool Source::IsFlvLive() return plugin_->IsFlvLive(); } -uint64_t Source::GetMemorySize() -{ - FALSE_RETURN_V_MSG_E(plugin_ != nullptr, 0, "plugin_ is nullptr"); - return plugin_->GetMemorySize(); -} - bool Source::IsHlsFmp4() { FALSE_RETURN_V_MSG_E(plugin_ != nullptr, false, "plugin_ is nullptr"); return plugin_->IsHlsFmp4(); } +uint64_t Source::GetMemorySize() +{ + FALSE_RETURN_V_MSG_E(plugin_ != nullptr, 0, "plugin_ is nullptr"); + return plugin_->GetMemorySize(); +} + Status Source::StopBufferring(bool isAppBackground) { FALSE_RETURN_V_MSG_E(plugin_ != nullptr, Status::ERROR_NULL_POINTER, "plugin_ is nullptr"); diff --git a/services/media_engine/modules/source/source.h b/services/media_engine/modules/source/source.h index 6680cf478..cd7193cd3 100644 --- a/services/media_engine/modules/source/source.h +++ b/services/media_engine/modules/source/source.h @@ -98,8 +98,10 @@ public: bool CanAutoSelectBitRate() override; bool IsSeekToTimeSupported(); + bool IsLocalFd(); int64_t GetDuration(); Status SeekToTime(int64_t seekTime, SeekMode mode); + Status SeekTo(uint64_t offset); Status GetBitRates(std::vector& bitRates); Status SelectBitRate(uint32_t bitRate); Status AutoSelectBitRate(uint32_t bitRate); @@ -111,7 +113,6 @@ public: void SetDemuxerState(int32_t streamId); Status GetStreamInfo(std::vector& streams); Status Read(int32_t streamID, std::shared_ptr& buffer, uint64_t offset, size_t expectedLen); - Status SeekTo(uint64_t offset); void SetInterruptState(bool isInterruptNeeded); Status GetDownloadInfo(DownloadInfo& downloadInfo); Status GetPlaybackInfo(PlaybackInfo& playbackInfo); @@ -123,14 +124,13 @@ public: bool SetInitialBufferSize(int32_t offset, int32_t size); Status SetPerfRecEnabled(bool perfRecEnabled); void NotifyInitSuccess(); - bool IsLocalFd(); - bool IsFlvLiveStream() const; uint64_t GetCachedDuration(); void RestartAndClearBuffer(); bool IsFlvLive(); - uint64_t GetMemorySize(); + bool IsFlvLiveStream() const; std::string GetContentType(); bool IsHlsFmp4(); + uint64_t GetMemorySize(); Status StopBufferring(bool isAppBackground); private: diff --git a/services/media_engine/plugins/source/data_stream_source_plugin.cpp b/services/media_engine/plugins/source/data_stream_source_plugin.cpp index 995e2fe4d..1e42347df 100644 --- a/services/media_engine/plugins/source/data_stream_source_plugin.cpp +++ b/services/media_engine/plugins/source/data_stream_source_plugin.cpp @@ -155,15 +155,8 @@ Status DataStreamSourcePlugin::Read(std::shared_ptr& buffer, ui return Status::OK; } FALSE_RETURN_V_MSG(dataSrc_ != nullptr, Status::ERROR_WRONG_STATE, "dataSrc_ is nullptr!"); - if (seekable_ == Plugins::Seekable::SEEKABLE) { - FALSE_RETURN_V(static_cast(offset_) <= size_, Status::END_OF_STREAM); - expectedLen = std::min(static_cast(size_ - offset_), expectedLen); - expectedLen = std::min(static_cast(memory->GetSize()), expectedLen); - realLen = dataSrc_->ReadAt(static_cast(offset_), expectedLen, memory); - } else { - expectedLen = std::min(static_cast(memory->GetSize()), expectedLen); - realLen = dataSrc_->ReadAt(expectedLen, memory); - } + auto ret = ReadAt(memory, expectedLen, realLen); + FALSE_RETURN_V(ret == Status::OK, ret); FALSE_RETURN_V_MSG(realLen > MediaDataSourceError::SOURCE_ERROR_IO, Status::ERROR_UNKNOWN, "read data error! realLen:" PUBLIC_LOG_D32, realLen); FALSE_RETURN_V_MSG_W(realLen != MediaDataSourceError::SOURCE_ERROR_EOF, Status::END_OF_STREAM, "eos reached!"); @@ -194,6 +187,20 @@ Status DataStreamSourcePlugin::Read(std::shared_ptr& buffer, ui return Status::OK; } +Status DataStreamSourcePlugin::ReadAt(std::shared_ptr memory, size_t &expectedLen, int32_t &realLen) +{ + if (seekable_ == Plugins::Seekable::SEEKABLE) { + FALSE_RETURN_V(static_cast(offset_) <= size_, Status::END_OF_STREAM); + expectedLen = std::min(static_cast(size_ - offset_), expectedLen); + expectedLen = std::min(static_cast(memory->GetSize()), expectedLen); + realLen = dataSrc_->ReadAt(static_cast(offset_), expectedLen, memory); + } else { + expectedLen = std::min(static_cast(memory->GetSize()), expectedLen); + realLen = dataSrc_->ReadAt(expectedLen, memory); + } + return Status::OK; +} + uint32_t DataStreamSourcePlugin::GetRetryTime() { MEDIA_LOG_I("read again. retryTimes:" PUBLIC_LOG_U32, retryTimes_); diff --git a/services/media_engine/plugins/source/data_stream_source_plugin.h b/services/media_engine/plugins/source/data_stream_source_plugin.h index 834018e52..6439f87e9 100644 --- a/services/media_engine/plugins/source/data_stream_source_plugin.h +++ b/services/media_engine/plugins/source/data_stream_source_plugin.h @@ -51,6 +51,7 @@ private: void WaitForRetry(uint32_t time); std::shared_ptr GetMemory(); void ResetPool(); + Status ReadAt(std::shared_ptr memory, size_t &expectedLen, int32_t &readLen); Plugins::Seekable seekable_ {Plugins::Seekable::INVALID}; std::shared_ptr dataSrc_; std::shared_ptr pool_; diff --git a/services/media_engine/plugins/source/file_fd_source_plugin.cpp b/services/media_engine/plugins/source/file_fd_source_plugin.cpp index 50dc74414..061bf0595 100644 --- a/services/media_engine/plugins/source/file_fd_source_plugin.cpp +++ b/services/media_engine/plugins/source/file_fd_source_plugin.cpp @@ -31,7 +31,6 @@ #include "osal/filesystem/file_system.h" #include "file_fd_source_plugin.h" #include "common/media_core.h" -#include namespace { constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { LOG_CORE, LOG_DOMAIN_SYSTEM_PLAYER, "FileFdSourcePlugin" }; @@ -129,13 +128,13 @@ FileFdSourcePlugin::FileFdSourcePlugin(std::string name) FileFdSourcePlugin::~FileFdSourcePlugin() { - MEDIA_LOG_D("~FileFdSourcePlugin in."); + MEDIA_LOG_I("~FileFdSourcePlugin in."); steadyClock_.Reset(); SetInterruptState(true); - MEDIA_LOG_D("~FileFdSourcePlugin isInterrupted_ " PUBLIC_LOG_D32, isInterrupted_.load()); + MEDIA_LOG_I("~FileFdSourcePlugin isInterrupted_ " PUBLIC_LOG_D32, isInterrupted_.load()); FALSE_RETURN_MSG(downloadTask_ != nullptr, "~FileFdSourcePlugin out."); downloadTask_->Stop(); - MEDIA_LOG_D("~FileFdSourcePlugin out."); + MEDIA_LOG_I("~FileFdSourcePlugin out."); } Status FileFdSourcePlugin::SetCallback(Callback* cb) @@ -154,7 +153,7 @@ Status FileFdSourcePlugin::SetSource(std::shared_ptr source) return err; } CheckFileType(); - if (isCloudFile_) { + if (isCloudFile_ && isEnableFdCache_) { ringBuffer_ = std::make_shared(CACHE_SIZE); FALSE_RETURN_V_MSG_E(!(ringBuffer_ == nullptr || !ringBuffer_->Init()), Status::ERROR_NO_MEMORY, "memory is not enough ringBuffer_"); diff --git a/services/media_engine/plugins/source/file_source_plugin.cpp b/services/media_engine/plugins/source/file_source_plugin.cpp index 69d1735cf..459ae5bef 100644 --- a/services/media_engine/plugins/source/file_source_plugin.cpp +++ b/services/media_engine/plugins/source/file_source_plugin.cpp @@ -150,7 +150,7 @@ Status FileSourcePlugin::SetSource(std::shared_ptr source) MEDIA_LOG_D("IN"); auto err = ParseFileName(source->GetSourceUri()); if (err != Status::OK) { - MEDIA_LOG_E("Parse file name from uri fail, uri: %{private}s", source->GetSourceUri().c_str()); + MEDIA_LOG_E("Parse file name from uri fail, uri: " PUBLIC_LOG_S, source->GetSourceUri().c_str()); return err; } return OpenFile(); @@ -193,11 +193,7 @@ Status FileSourcePlugin::Read(int32_t streamId, std::shared_ptr& buffer, MEDIA_LOG_E("Read bufData GetWritableAddr fail"); return Status::ERROR_NO_MEMORY; } - void* addr = bufData->GetWritableAddr(expectedLen); - if (addr == nullptr) { - return Status::ERROR_AGAIN; - } - auto size = std::fread(addr, sizeof(char), expectedLen, fp_); + auto size = std::fread(bufDataAddr, sizeof(char), expectedLen, fp_); bufData->UpdateDataSize(size); position_ += bufData->GetSize(); MEDIA_LOG_DD("position_: " PUBLIC_LOG_U64 ", readSize: " PUBLIC_LOG_ZU, position_, bufData->GetSize()); diff --git a/services/media_engine/plugins/source/http_source/BUILD.gn b/services/media_engine/plugins/source/http_source/BUILD.gn index c4bd536dd..9a61891f0 100644 --- a/services/media_engine/plugins/source/http_source/BUILD.gn +++ b/services/media_engine/plugins/source/http_source/BUILD.gn @@ -137,6 +137,7 @@ ohos_static_library("media_plugin_HttpSource_static") { "media_foundation:media_foundation", "openssl:libcrypto_shared", "safwk:system_ability_fwk", + "netmanager_base:net_conn_manager_if", ] subsystem_name = "multimedia" diff --git a/services/media_engine/plugins/source/http_source/dash/dash_media_downloader.cpp b/services/media_engine/plugins/source/http_source/dash/dash_media_downloader.cpp index e201f51fa..78d4d20d7 100644 --- a/services/media_engine/plugins/source/http_source/dash/dash_media_downloader.cpp +++ b/services/media_engine/plugins/source/http_source/dash/dash_media_downloader.cpp @@ -150,6 +150,7 @@ std::shared_ptr DashMediaDownloader::GetSegmentDownloader if (iter != segmentDownloaders_.end()) { segmentDownloader = *iter; } + return segmentDownloader; } @@ -398,6 +399,9 @@ void DashMediaDownloader::SetIsTriggerAutoMode(bool isAuto) void DashMediaDownloader::SetDownloadErrorState() { MEDIA_LOG_I("Dash SetDownloadErrorState"); + if (callback_) { + callback_->OnEvent({PluginEventType::CLIENT_ERROR, {NetworkClientErrorCode::ERROR_TIME_OUT}, "download"}); + } downloadErrorState_ = true; } @@ -1218,6 +1222,11 @@ bool DashMediaDownloader::GetPlayable() } } +bool DashMediaDownloader::GetBufferingTimeOut() +{ + return false; +} + void DashMediaDownloader::SetAppUid(int32_t appUid) { for (size_t i = 0; i < segmentDownloaders_.size(); i++) { @@ -1225,11 +1234,6 @@ void DashMediaDownloader::SetAppUid(int32_t appUid) } } -bool DashMediaDownloader::GetBufferingTimeOut() -{ - return false; -} - void DashMediaDownloader::NotifyInitSuccess() { for (size_t i = 0; i < segmentDownloaders_.size(); i++) { diff --git a/services/media_engine/plugins/source/http_source/dash/dash_media_downloader.h b/services/media_engine/plugins/source/http_source/dash/dash_media_downloader.h index 1f1730d0d..2a902f70d 100644 --- a/services/media_engine/plugins/source/http_source/dash/dash_media_downloader.h +++ b/services/media_engine/plugins/source/http_source/dash/dash_media_downloader.h @@ -68,8 +68,8 @@ public: void GetPlaybackInfo(PlaybackInfo& playbackInfo) override; uint64_t GetBufferSize() const override; bool GetPlayable() override; - void SetAppUid(int32_t appUid) override; bool GetBufferingTimeOut() override; + void SetAppUid(int32_t appUid) override; void NotifyInitSuccess() override; uint64_t GetMemorySize() override; std::string GetContentType() override; diff --git a/services/media_engine/plugins/source/http_source/dash/dash_segment_downloader.cpp b/services/media_engine/plugins/source/http_source/dash/dash_segment_downloader.cpp index af39a391b..afd0eb402 100644 --- a/services/media_engine/plugins/source/http_source/dash/dash_segment_downloader.cpp +++ b/services/media_engine/plugins/source/http_source/dash/dash_segment_downloader.cpp @@ -83,6 +83,7 @@ DashSegmentDownloader::DashSegmentDownloader(Callback *callback, int streamId, M downloadRequest_ = nullptr; mediaSegment_ = nullptr; + loopInterruptClock_.Reset(); recordData_ = std::make_shared(); } @@ -500,8 +501,8 @@ bool DashSegmentDownloader::ReadInitSegment(uint8_t *buff, uint32_t wantReadLeng if (unReadSize > 0) { realReadLength = unReadSize > wantReadLength ? wantReadLength : unReadSize; std::string readStr = initSegment->content_.substr(initSegment->readIndex_); - CHECK_AND_RETURN_RET_LOG(wantReadLength <= VID_RING_BUFFER_SIZE, 1, "too large"); - CHECK_AND_RETURN_RET_LOG(realReadLength <= VID_RING_BUFFER_SIZE, 1, "too large"); + CHECK_AND_RETURN_RET_LOG(wantReadLength <= VID_RING_BUFFER_SIZE * BYTE_TO_BIT, 1, "too large"); + CHECK_AND_RETURN_RET_LOG(realReadLength <= VID_RING_BUFFER_SIZE * BYTE_TO_BIT, 1, "too large"); memcpy_s(buff, wantReadLength, readStr.c_str(), realReadLength); initSegment->readIndex_ += realReadLength; if (initSegment->readIndex_ == contentLen && initSegment->isDownloadFinish_) { @@ -888,9 +889,16 @@ uint32_t DashSegmentDownloader::SaveData(uint8_t* data, uint32_t len, bool notBl MEDIA_LOG_E("SaveData:error streamId:" PUBLIC_LOG_D32 ", len:" PUBLIC_LOG_D32, streamId_, len); return 0; } + UpdateMediaSegments(bufferTail, len); + return len; +} +void DashSegmentDownloader::UpdateMediaSegments(size_t bufferTail, uint32_t len) +{ std::lock_guard lock(segmentMutex_); + int64_t loopStartTime = loopInterruptClock_.ElapsedSeconds(); for (const auto &mediaSegment: segmentList_) { + CheckLoopTimeout(loopStartTime); if (mediaSegment == nullptr || mediaSegment->isEos_) { continue; } @@ -902,7 +910,6 @@ uint32_t DashSegmentDownloader::SaveData(uint8_t* data, uint32_t len, bool notBl UpdateBufferSegment(mediaSegment, len); break; } - return len; } void DashSegmentDownloader::UpdateBufferSegment(const std::shared_ptr &mediaSegment, uint32_t len) @@ -1033,11 +1040,11 @@ void DashSegmentDownloader::PutRequestIntoDownloader(unsigned int duration, int6 if (startPos >= 0 && endPos > 0) { requestWholeFile = false; } - RequestInfo mediaSouce; - mediaSouce.url = url; - mediaSouce.timeoutMs = HTTP_TIME_OUT_MS; + RequestInfo requestInfo; + requestInfo.url = url; + requestInfo.timeoutMs = HTTP_TIME_OUT_MS; downloadRequest_ = std::make_shared(duration, dataSave_, - realStatusCallback, mediaSouce, requestWholeFile); + realStatusCallback, requestInfo, requestWholeFile); downloadRequest_->SetDownloadDoneCb(downloadDoneCallback); downloadRequest_->SetRequestProtocolType(RequestProtocolType::DASH); if (!requestWholeFile && (endPos > startPos)) { @@ -1136,13 +1143,6 @@ std::shared_ptr DashSegmentDownloader::GetDashInitSegment(int32 return segment; } -void DashSegmentDownloader::SetAppUid(int32_t appUid) -{ - if (downloader_) { - downloader_->SetAppUid(appUid); - } -} - void DashSegmentDownloader::SetInterruptState(bool isInterruptNeeded) { FALSE_RETURN(downloader_ != nullptr && buffer_ != nullptr); @@ -1152,6 +1152,13 @@ void DashSegmentDownloader::SetInterruptState(bool isInterruptNeeded) } } +void DashSegmentDownloader::SetAppUid(int32_t appUid) +{ + if (downloader_) { + downloader_->SetAppUid(appUid); + } +} + bool DashSegmentDownloader::GetBufferringStatus() const { return isBuffering_.load(); @@ -1220,6 +1227,17 @@ bool DashSegmentDownloader::GetBufferingTimeOut() } } +bool DashSegmentDownloader::CheckLoopTimeout(int64_t startLoopTime) +{ + int64_t now = loopInterruptClock_.ElapsedSeconds(); + int64_t loopDuration = now > startLoopTime ? now - startLoopTime : 0; + bool isLoopTimeOut = loopDuration > LOOP_TIMEOUT ? true : false; + if (isLoopTimeOut) { + MEDIA_LOG_E("loop timeout"); + } + return isLoopTimeOut; +} + Status DashSegmentDownloader::StopBufferring(bool isAppBackground) { MEDIA_LOG_I("DashSegmentDownloader:StopBufferring enter"); diff --git a/services/media_engine/plugins/source/http_source/dash/dash_segment_downloader.h b/services/media_engine/plugins/source/http_source/dash/dash_segment_downloader.h index a780a7d3b..6348d3795 100644 --- a/services/media_engine/plugins/source/http_source/dash/dash_segment_downloader.h +++ b/services/media_engine/plugins/source/http_source/dash/dash_segment_downloader.h @@ -167,8 +167,8 @@ public: void GetIp(std::string& ip); bool GetDownloadFinishState(); std::pair GetDownloadRecordData(); - void SetAppUid(int32_t appUid); void SetInterruptState(bool isInterruptNeeded); + void SetAppUid(int32_t appUid); uint64_t GetBufferSize() const; bool GetBufferringStatus() const; uint32_t GetCachedPercent(); @@ -209,6 +209,8 @@ private: void DoBufferingEndEvent(); bool GetBufferingTimeOut(); bool IsNeedBufferForPlaying(); + void UpdateMediaSegments(size_t bufferTail, uint32_t len); + bool CheckLoopTimeout(int64_t startLoopTime); private: static constexpr uint32_t MIN_RETENTION_DURATION_MS = 5 * 1000; @@ -265,6 +267,7 @@ private: std::atomic isDemuxerInitSuccess_ {false}; std::shared_ptr sourceLoader_ {nullptr}; std::atomic canWrite_{true}; + SteadyClock loopInterruptClock_; }; } } -- Gitee From 86b4a5c63a43e67c8cd5316b807d54b9eb80fc7f Mon Sep 17 00:00:00 2001 From: chenning Date: Fri, 29 Aug 2025 01:20:13 +0000 Subject: [PATCH 2/2] update services/media_engine/plugins/source/data_stream_source_plugin.h. Signed-off-by: chenning --- .../media_engine/plugins/source/data_stream_source_plugin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/media_engine/plugins/source/data_stream_source_plugin.h b/services/media_engine/plugins/source/data_stream_source_plugin.h index 6439f87e9..d9e9c8ecd 100644 --- a/services/media_engine/plugins/source/data_stream_source_plugin.h +++ b/services/media_engine/plugins/source/data_stream_source_plugin.h @@ -51,7 +51,7 @@ private: void WaitForRetry(uint32_t time); std::shared_ptr GetMemory(); void ResetPool(); - Status ReadAt(std::shared_ptr memory, size_t &expectedLen, int32_t &readLen); + Status ReadAt(std::shared_ptr memory, size_t &expectedLen, int32_t &realLen); Plugins::Seekable seekable_ {Plugins::Seekable::INVALID}; std::shared_ptr dataSrc_; std::shared_ptr pool_; -- Gitee