// // Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #pragma once #include "td/telegram/VideosManager.h" #include "td/telegram/files/FileId.hpp" #include "td/telegram/Photo.hpp" #include "td/telegram/Version.h" #include "td/utils/common.h" #include "td/utils/tl_helpers.h" namespace td { template void VideosManager::store_video(FileId file_id, StorerT &storer) const { const Video *video = get_video(file_id); CHECK(video != nullptr); bool has_animated_thumbnail = video->animated_thumbnail.file_id.is_valid(); bool has_preload_prefix_size = video->preload_prefix_size != 0; bool has_precise_duration = video->precise_duration != 0 && video->precise_duration != video->duration; bool has_start_ts = video->start_ts != 0.0; BEGIN_STORE_FLAGS(); STORE_FLAG(video->has_stickers); STORE_FLAG(video->supports_streaming); STORE_FLAG(has_animated_thumbnail); STORE_FLAG(has_preload_prefix_size); STORE_FLAG(has_precise_duration); STORE_FLAG(video->is_animation); STORE_FLAG(has_start_ts); END_STORE_FLAGS(); store(video->file_name, storer); store(video->mime_type, storer); store(video->duration, storer); store(video->dimensions, storer); store(video->minithumbnail, storer); store(video->thumbnail, storer); store(file_id, storer); if (video->has_stickers) { store(video->sticker_file_ids, storer); } if (has_animated_thumbnail) { store(video->animated_thumbnail, storer); } if (has_preload_prefix_size) { store(video->preload_prefix_size, storer); } if (has_precise_duration) { store(video->precise_duration, storer); } if (has_start_ts) { store(video->start_ts, storer); } } template FileId VideosManager::parse_video(ParserT &parser) { auto video = make_unique