MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / createStreamingLoader

Method createStreamingLoader

Telegram/SourceFiles/data/data_photo.cpp:590–612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

588}
589
590auto PhotoData::createStreamingLoader(
591 Data::FileOrigin origin,
592 bool forceRemoteLoader) const
593-> std::unique_ptr<Media::Streaming::Loader> {
594 if (!hasVideo()) {
595 return nullptr;
596 }
597 constexpr auto large = PhotoSize::Large;
598 if (!forceRemoteLoader) {
599 const auto media = activeMediaView();
600 const auto bytes = media ? media->videoContent(large) : QByteArray();
601 if (media && !bytes.isEmpty()) {
602 return Media::Streaming::MakeBytesLoader(bytes);
603 }
604 }
605 return v::is<StorageFileLocation>(videoLocation(large).file().data)
606 ? std::make_unique<Media::Streaming::LoaderMtproto>(
607 &session().downloader(),
608 v::get<StorageFileLocation>(videoLocation(large).file().data),
609 videoByteSize(large),
610 origin)
611 : nullptr;
612}

Callers 1

sharedReaderMethod · 0.45

Calls 4

QByteArrayClass · 0.85
MakeBytesLoaderFunction · 0.85
videoContentMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected