Commit Graph

455 Commits

Author SHA1 Message Date
John Preston ff0ff1d99c Fix stickers lagging on macOS. 2019-05-28 13:39:38 +02:00
23rd b4df7b4efd Replaced observable updatedNotifier() with rpl. 2019-05-27 15:35:03 +02:00
23rd a80f7c53ea Replaced Apple icons for touchbar with custom icons in audio player. 2019-05-27 15:35:01 +02:00
23rd ba1691bf7e Added custom close icon to touchbar
- Slightly refactored.
2019-05-27 15:35:00 +02:00
23rd 9059b2e617 Fixes for Audio Player in touchbar.
- Removed unused Platform::SetTouchBar.
 - Added rpl::event_stream in Media Player Instance for handle closing player.
 - Fixed hiding of touchbar when last track is ended.
 - Fixed display of time when last track is ended.
 - Slightly refactored.
2019-05-27 15:34:58 +02:00
23rd 58604406f8 Added initial implementation touchbar. 2019-05-27 15:34:54 +02:00
John Preston 3577e71782 Validate mime type of animated stickers. 2019-05-27 15:09:07 +02:00
John Preston cfff744cb1 Parse and render lottie in the background. 2019-05-27 14:11:26 +02:00
John Preston f073963582 Preview lottie animations in media viewer. 2019-05-27 14:11:26 +02:00
John Preston 22c2054dcf First attempt to use QtLottie. 2019-05-27 14:11:26 +02:00
John Preston 08bddc5579 Move messages data to AuthSession. 2019-05-01 16:11:42 +04:00
John Preston 08cd46cd4c Fix crash in streaming caching. 2019-04-12 18:49:37 +04:00
23rd fb847135b5 Added ability to edit GIFs.
- Added to Media::Clip::MakeReader new constructor to create
 animated preview with remoteContent.
2019-04-09 17:17:31 +04:00
John Preston b5be6df5e2 Copy text with expanded links only to external.
Paste valid custom links in message field if copied from messages.
2019-04-08 19:10:06 +04:00
John Preston 321e4ffe9c Don't auto-resume video when seeking. 2019-04-08 14:34:31 +04:00
John Preston 2bdce7dce6 Fix window activations handling without event loop nesting.
This was causing an assertion violation in Ui::PostponeCall.

- Add a generic Core::QtSignalProducer to convert Qt signals to rpl::producer.
- Track event loop nesting inside QtSignalProducer.
- Use QtSignalProducer for QWindow::activeChanged tracking.
2019-04-05 14:13:54 +04:00
John Preston 5f8ede194b Fix rendering of large images on macOS. 2019-04-03 16:42:08 +04:00
John Preston db631acf80 Remove old animations code. 2019-04-02 14:33:54 +04:00
John Preston 99bb09374d Use new animations engine everywhere. 2019-04-02 14:33:53 +04:00
John Preston a6e96f9a28 Use new animations engine in all Basic-s. 2019-04-02 14:33:53 +04:00
John Preston cd3c1c6dc0 Use new animations engine for typings. 2019-04-02 14:33:53 +04:00
John Preston 84e9e37353 Closed alpha version 1.6.3.1: Fix build for Xcode. 2019-03-29 14:24:08 +04:00
John Preston 95023ca770 Use StorageFileLocation in streaming loader. 2019-03-29 14:24:07 +04:00
John Preston aa8f62da9d Support new ('modern') API file locations. 2019-03-29 14:24:07 +04:00
John Preston bf182697b9 Use streaming player speed in 2x playback. 2019-03-26 16:51:40 +04:00
John Preston e87084715d Fix song / voice playback. 2019-03-26 16:51:40 +04:00
John Preston 3bd1bbc77a Use Streaming::Player in video messages playback. 2019-03-26 16:51:39 +04:00
John Preston 2701e63406 Allow revoking only sent messages. 2019-03-24 12:12:43 +04:00
John Preston a34e998c42 Handle fwd_from without a link to the account. 2019-03-24 12:12:42 +04:00
John Preston d1cf43f9a4 Fix streaming receivedTill reporting.
It was incorrect in case audio and video had different durations.
2019-03-24 12:12:40 +04:00
John Preston 31dbe2278e Fix possible crash in local file streaming.
Cache file size instead of requesting it from file system each time.
2019-03-20 14:21:50 +04:00
John Preston 9ed064b7fc Fix crash in streaming parts loading. 2019-03-20 13:41:13 +04:00
John Preston c0959ceaeb Start video when moving to it in media viewer.
Fixes #5796.
2019-03-18 11:44:49 +04:00
John Preston 6c382c647c Fix caching of first slice in header. 2019-03-18 11:00:11 +04:00
John Preston 8f9bed0443 Fix document caption in media viewer.
Regression was introduced in 5cae57601a.

Fixes #5799, fixes #5802, fixes #5804.
2019-03-17 23:00:09 +04:00
John Preston bc2b0f8392 Add button to download video files.
Fixes #5781.
2019-03-15 14:15:04 +04:00
John Preston f2a7cf5c64 Improve shared videos design. 2019-03-15 12:09:48 +04:00
John Preston 5cae57601a Allow video download from media viewer. 2019-03-14 16:03:02 +04:00
John Preston 2b7fb7a9a6 Pause music only when video playback starts. 2019-03-14 14:45:08 +04:00
John Preston feb238c5d9 Fix crash if asked to read more than 64MB at once. 2019-03-14 14:14:24 +04:00
John Preston bfb6ecbac7 Fail streaming on error in any stream. 2019-03-14 12:47:18 +04:00
John Preston 2152fe6a79 Beta version 1.5.17: Improve large file streaming.
Allow header for streaming up to 8 MB.
2019-03-13 20:56:04 +04:00
John Preston b65a24df96 Allow streaming videos with unknown duration.
When you stream image/gif as a soundless video the total duration is
unknown, so we accumulate packet->pts + packet->duration as duration.
2019-03-13 18:58:50 +04:00
John Preston c655bf852f Fix crash in video player seek. 2019-03-13 16:28:07 +04:00
John Preston be495c17bc Fix seek to video end. 2019-03-13 16:21:07 +04:00
John Preston 9785ff4be6 Add more checks in streaming. 2019-03-13 15:11:54 +04:00
John Preston 5ec37e9112 Use separate click handler for OpenWith. 2019-03-13 13:35:47 +04:00
John Preston e79ddf2459 Beta version 1.5.16: Fix audio stucking. 2019-03-12 18:57:48 +04:00
John Preston 5efe47cfb6 Beta version 1.5.16: Remove streaming logs. 2019-03-12 18:56:35 +04:00
John Preston ef682e7023 Fix photos in overview with disabled autodownload.
Fixes #5599, fixes #5747.
2019-03-12 12:55:26 +04:00
John Preston 846499a4fb Fix volume saving to settings. 2019-03-12 09:09:53 +04:00
John Preston c063d94aa5 Remove DocumentData::actionOnLoad. Fix GIF open. 2019-03-11 19:07:35 +04:00
John Preston 261720c941 Fix radial animations on macOS.
QOpenGLWidget doesn't draw antialiased ellipses and arcs,
so we use a software rasterizer and then draw the resulting image.
2019-03-11 13:51:15 +04:00
John Preston a886c598c1 Fix non-streamable videos layout. 2019-03-11 12:08:20 +04:00
John Preston 2ce4abfdfe Fix crash in media caching. 2019-03-11 12:08:20 +04:00
John Preston 18c42954ae Fix sparse frame painting on macOS. 2019-03-11 12:08:20 +04:00
John Preston b57b4fa0f8 Fix reading first slice for good header cache. 2019-03-11 12:08:20 +04:00
John Preston 3706be77ea Fix macOS media viewer controls hiding. 2019-03-11 12:08:19 +04:00
John Preston f481f1e142 Make videos larger, fix playback animation. 2019-03-11 12:08:19 +04:00
John Preston 84b09795f3 Store first slice in the header cache key. 2019-03-11 12:08:19 +04:00
John Preston a56a12a1ef Optimized video frame pushing. 2019-03-11 12:08:18 +04:00
John Preston 5c4b459f57 Use new animations in video viewer. 2019-03-11 12:08:18 +04:00
John Preston 92332b45ea Don't reset zoom on video seek. 2019-03-11 12:08:17 +04:00
John Preston b742c95516 Support streamed video rotation. 2019-03-11 12:08:16 +04:00
John Preston a59c3da3d0 Cache small files in one value. 2019-03-11 12:08:16 +04:00
John Preston 8399f4189f Don't show receivedTill for local loaders. 2019-03-11 12:08:16 +04:00
John Preston 67b9fe846b Improve video frame position checks. 2019-03-11 12:08:16 +04:00
John Preston 0f4ccce0e1 Update ffmpeg. 2019-03-11 12:08:15 +04:00
John Preston 01d763eed1 Use DocumentData::getDuration for all types. 2019-03-11 12:08:15 +04:00
John Preston 41c60419f1 Enable voice messages streaming. 2019-03-11 12:08:15 +04:00
John Preston 518d1da736 Fail streaming if no codec for a stream. 2019-03-11 12:08:14 +04:00
John Preston 22356eb01c Fix initial video duration display. 2019-03-11 12:08:14 +04:00
John Preston b5eb88a32f Closed alpha version 1.5.15.2. 2019-03-11 12:08:13 +04:00
John Preston 6887993f92 Report streaming failed. 2019-03-11 12:08:13 +04:00
John Preston 71b733a018 Display receivedTill in video player controls. 2019-03-11 12:08:13 +04:00
John Preston e2eb9cea00 Apply sample_aspect_ratio in streaming. 2019-03-11 12:08:12 +04:00
John Preston 99e96a5b13 Allow looping video without audio in streaming. 2019-03-11 12:08:12 +04:00
John Preston c27456277e Support streaming of local files. 2019-03-11 12:08:11 +04:00
John Preston dafa286b18 Show option to download on streaming error. 2019-03-11 12:08:11 +04:00
John Preston f0963a332a Fix crash on failed streaming. 2019-03-11 12:08:10 +04:00
John Preston 8171828c2a Fix build on GCC. 2019-03-11 12:08:09 +04:00
John Preston a8aa66d191 Check frame format before sws_getCachedContext. 2019-03-11 12:08:09 +04:00
John Preston c574119718 Implement file reference update in streaming. 2019-03-11 12:08:08 +04:00
John Preston 648cd44ddd Display correct video / music state. 2019-03-11 12:08:08 +04:00
John Preston fde8dd9607 Play streaming audio in player. 2019-03-11 12:08:08 +04:00
John Preston f1e0cd6c1d Play streaming video in mediaview. 2019-03-11 11:52:11 +04:00
John Preston 44df10d6cb Improve working with cache in streaming. 2019-03-11 11:49:54 +04:00
John Preston b6a757842a Pause loading if loaded for 1 minute. 2019-03-11 11:49:54 +04:00
John Preston 4636c74586 Remove from memory old file slices. 2019-03-11 11:49:54 +04:00
John Preston 2208621050 First version of caching in media streaming. 2019-03-11 11:49:54 +04:00
John Preston ccd04b98b9 Fix sync video to audio. 2019-03-11 11:49:54 +04:00
John Preston d37b65e624 If stuck wait for three seconds of packets. 2019-03-11 11:49:54 +04:00
John Preston 3e9b811875 Implement precise seek in streaming. 2019-03-11 11:49:54 +04:00
John Preston 44c562d8ba Fix streaming seek, display progress. 2019-03-11 11:49:53 +04:00
John Preston 93c548c013 Support streaming speed changing. 2019-03-11 11:49:53 +04:00
John Preston a7d9281768 Implement pause / resume in streaming. 2019-03-11 11:49:53 +04:00
John Preston 3b369fc98e Buffer audio when waiting data in streaming. 2019-03-11 11:49:53 +04:00
John Preston e5cd7e6d40 Fix streaming from the middle of the file. 2019-03-11 11:49:53 +04:00
John Preston 99d05ba967 Sync video stream to audio stream. 2019-03-11 11:49:53 +04:00
John Preston ec9512899e Support streaming playback speed 0.5 - 2. 2019-03-11 11:49:22 +04:00
John Preston 26ea6c4e63 Provide receivedTill for streamed tracks. 2019-03-11 11:49:22 +04:00
John Preston 8e44a7f5c4 Basic code for video streaming + testing on video. 2019-03-11 11:49:22 +04:00
John Preston a093cb6274 Move some logic to Media::Streaming::Player. 2019-03-11 11:49:21 +04:00
John Preston 64f2f330f6 Render first frame when starting streaming. 2019-03-11 11:49:21 +04:00
John Preston 473e30e594 Basic code for media streaming + testing on music. 2019-03-11 11:49:21 +04:00
23rd f48d8538c0 Added ability to see attached stickers on photos. 2019-03-10 22:10:36 +04:00
23rd 78d00bcf22 Refactored counting idle time.
- psIdleTime() was replaced with Platform::LastUserInputTime().
 - _lastTimeVideoPlayedAt was moved to Application as _lastNonIdleTime.
 - Call of updateNonIdle() was added while voice is recording.
 - Fixed #5695.
 - Thanks Preston. =)
2019-03-10 22:02:58 +04:00
John Preston e174025a92
Fix travis build. 2019-03-09 15:27:36 +04:00
23rd 4ed1835d32 Fixed Ctrl + F shortcut for full screen toggle in media view. 2019-02-20 11:43:50 +04:00
John Preston fe618bd652 Use crl::time/now instead of TimeMs/getms. 2019-02-19 11:06:33 +04:00
John Preston 7c1704e68b Fix crash in EditCaptionBox. 2019-02-17 13:51:53 +04:00
John Preston 98cb85df66 Polymorphic classes without virtual dtor warning. 2019-02-15 15:55:34 +04:00
John Preston 032694ad9e Move files to media/audio and media/clip. 2019-02-13 15:41:33 +03:00
John Preston 5437215677 Use premultiplied format for GIF frames. 2019-02-13 15:19:05 +03:00
John Preston ae6c152988 Version 1.5.15: Fix macOS media viewer overlay.
Regression was introduced in c1a0dad2b7.
2019-02-12 19:55:35 +03:00
John Preston c1a0dad2b7 Use QOpenGLWidget for macOS media viewer overlay.
Also move mediaview to media/view/media_view_overlay_widget.
2019-02-12 14:00:47 +03:00
John Preston b28e374e06 Fix Media::Audio::Instance destruction. 2019-02-01 10:09:55 +03:00
John Preston a1baa23a52 Use both thumbnails in photos and documents.
Fixes #5602.
2019-01-28 13:10:45 +03:00
John Preston a70e72f75d Application->Sandbox, Messenger->Application. 2019-01-23 12:51:58 +04:00
John Preston c5a41e1f55 Divide data/data_peer and remove from PCH. 2019-01-17 12:21:29 +04:00
John Preston 0d6a36e187 Fix volume widget position.
Fixes #5467.
2019-01-17 12:20:50 +04:00
John Preston 6d08394adc Divide history_media_types to several modules. 2018-12-21 17:09:31 +04:00
John Preston 3bd0efa91e Use 1.7x instead of 2x in voice messages. 2018-12-03 19:33:34 +04:00
John Preston b3ffbeb63e Improve code for Shortcuts handling. 2018-11-20 19:38:40 +04:00
John Preston e3b6e1325e Use AL_DIRECT_CHANNELS_SOFT for audio playback.
See https://github.com/telegramdesktop/tdesktop/issues/2580.
2018-11-16 20:17:58 +04:00
John Preston 2d05281ba9 Add configuration for OpenAL effects usage. 2018-11-09 16:28:15 +04:00
John Preston 9a1069c1ae Fix resuming audio on call end. 2018-11-09 11:27:12 +04:00
John Preston 346cb4e203 Fix some bugs in double playback speed.
- Apply double speed for all voice tracks, not only for the current.
- Use dedicated atomic in Mixer for the voice speed (fix race).
- Store the playback speed in user settings, not in global settings.
- Use float64 for setting (just consistency, no float-s right now).
2018-11-08 17:06:22 +04:00
Magnus Groß de8518a112 Implement double playback speed
This adds double playback speed for both voice messages and round video
messages.
The 2x playback speed setting is global and is saved in local storage.

Fixes #4907
2018-11-08 17:05:34 +04:00
John Preston ef38572d5a Detect and send supports_streaming bit for videos. 2018-11-07 18:10:00 +04:00
John Preston ef64d9c188 Show round videos in Info layer. 2018-11-05 17:18:54 +04:00
John Preston 466444e17d Extract float player controller. 2018-11-05 15:16:09 +04:00
John Preston b420f5b41b Fix crash in round video playback. 2018-11-05 14:00:53 +04:00
John Preston 5192049194 Resume audio when call ends. 2018-11-04 15:51:39 +04:00
John Preston da358615e0 Generate high quality video thumbnail when loaded. 2018-11-04 15:51:38 +04:00
John Preston bf31722931 Show collage/slideshow as an album in MediaView. 2018-11-04 15:51:38 +04:00
John Preston 595134cab5 Move image-related modules to ui/image/. 2018-11-04 15:51:37 +04:00
John Preston 113f665295 Move Image and derived to ui/image. 2018-11-04 15:51:36 +04:00
John Preston 2812d2911f Remove media_volume icon, use volume slider. 2018-10-15 11:06:27 +03:00
John Preston 2e5a0e056c Move to std::optional. 2018-09-21 19:28:46 +03:00
John Preston 1ffbec0215 Finish animations disabling.
Replace some infinite animations with static layouts.
2018-09-20 21:26:10 +03:00
John Preston 0c8709ca5f Replace App::self() with Auth().user().
Always have self Auth().user() when AuthSession exists.
2018-09-19 19:22:13 +03:00
John Preston 069232ec1b Allow changing limits for cache in Settings. 2018-09-01 18:56:08 +03:00
John Preston 9147c12687 Add basic implementation of Storage::Cache DB. 2018-09-01 18:56:08 +03:00
John Preston 839885910c Pass FileOrigin in all file downloads. 2018-08-20 17:26:28 +03:00
John Preston fddc3d6ad9 Workaround MSVC 15.8 regressions. 2018-08-17 14:01:16 +03:00
John Preston 777bf7d8d9 Fix video seeking.
Regression was introduced in d0e854e9d8.

Each time you hide() a widget its mousePress state is reset and
mouseMoveEvent() / mouseReleaseEvent() handlers are never called.

So you can't toggle (hide + show) widgets that are mouse-pressed.

Fixes #4802.
2018-06-06 11:58:07 +03:00
John Preston a42fb1f7b7 Fix microphone sandbox access request.
Fixes #4783.
2018-06-04 18:39:20 +03:00
John Preston dd81f5d59f Replace base::lambda with shorter term.
base::lambda -> Fn (type alias for std::function).
base::lambda_once -> FnMut (type alias for base::unique_function).
base::lambda_guarded -> crl::guard.
base::lambda_call_type_t -> crl::deduced_call_type.
2018-06-04 18:38:27 +03:00
John Preston d0e854e9d8 Allow showing boxes in passport panel. 2018-06-03 23:16:35 +03:00