diff options
| author | levlam <levlam@telegram.org> | 2022-10-20 23:23:40 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2022-10-20 23:23:40 +0300 |
| commit | 0d05683771475f5861f8c3a5a464ccbe514c5bb6 (patch) | |
| tree | d72776614bf966b8426e40a583fbe11fb7e2885c /td/telegram/VideoNotesManager.hpp | |
| parent | 14b80ecd6fdbfaadaa95987acf2206d06dfc92c9 (diff) | |
Support waveform for video notes.
Diffstat (limited to 'td/telegram/VideoNotesManager.hpp')
| -rw-r--r-- | td/telegram/VideoNotesManager.hpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/td/telegram/VideoNotesManager.hpp b/td/telegram/VideoNotesManager.hpp index cdfa23140..272fbe681 100644 --- a/td/telegram/VideoNotesManager.hpp +++ b/td/telegram/VideoNotesManager.hpp @@ -25,11 +25,13 @@ void VideoNotesManager::store_video_note(FileId file_id, StorerT &storer) const bool has_minithumbnail = !video_note->minithumbnail.empty(); bool has_thumbnail = video_note->thumbnail.file_id.is_valid(); bool is_transcribed = video_note->transcription_info != nullptr && video_note->transcription_info->is_transcribed(); + bool has_waveform = !video_note->waveform.empty(); BEGIN_STORE_FLAGS(); STORE_FLAG(has_duration); STORE_FLAG(has_minithumbnail); STORE_FLAG(has_thumbnail); STORE_FLAG(is_transcribed); + STORE_FLAG(has_waveform); END_STORE_FLAGS(); if (has_duration) { store(video_note->duration, storer); @@ -44,6 +46,9 @@ void VideoNotesManager::store_video_note(FileId file_id, StorerT &storer) const if (is_transcribed) { store(video_note->transcription_info, storer); } + if (has_waveform) { + store(video_note->waveform, storer); + } store(file_id, storer); } @@ -54,18 +59,21 @@ FileId VideoNotesManager::parse_video_note(ParserT &parser) { bool has_minithumbnail; bool has_thumbnail; bool is_transcribed; + bool has_waveform; if (parser.version() >= static_cast<int32>(Version::AddVideoNoteFlags)) { BEGIN_PARSE_FLAGS(); PARSE_FLAG(has_duration); PARSE_FLAG(has_minithumbnail); PARSE_FLAG(has_thumbnail); PARSE_FLAG(is_transcribed); + PARSE_FLAG(has_waveform); END_PARSE_FLAGS(); } else { has_duration = true; has_minithumbnail = parser.version() >= static_cast<int32>(Version::SupportMinithumbnails); has_thumbnail = true; is_transcribed = false; + has_waveform = false; } if (has_duration) { parse(video_note->duration, parser); @@ -80,6 +88,9 @@ FileId VideoNotesManager::parse_video_note(ParserT &parser) { if (is_transcribed) { parse(video_note->transcription_info, parser); } + if (has_waveform) { + parse(video_note->waveform, parser); + } parse(video_note->file_id, parser); if (parser.get_error() != nullptr || !video_note->file_id.is_valid()) { return FileId(); |
