init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
71
Telegram/SourceFiles/calls/calls_video_bubble.h
Normal file
71
Telegram/SourceFiles/calls/calls_video_bubble.h
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "ui/rect_part.h"
|
||||
#include "ui/rp_widget.h"
|
||||
|
||||
namespace Webrtc {
|
||||
class VideoTrack;
|
||||
enum class VideoState;
|
||||
} // namespace Webrtc
|
||||
|
||||
namespace Calls {
|
||||
|
||||
class VideoBubble final {
|
||||
public:
|
||||
VideoBubble(
|
||||
not_null<QWidget*> parent,
|
||||
not_null<Webrtc::VideoTrack*> track);
|
||||
|
||||
enum class DragMode {
|
||||
None,
|
||||
SnapToCorners,
|
||||
};
|
||||
void updateGeometry(
|
||||
DragMode mode,
|
||||
QRect boundingRect,
|
||||
QSize sizeMin = QSize(),
|
||||
QSize sizeMax = QSize());
|
||||
[[nodiscard]] QRect geometry() const;
|
||||
|
||||
[[nodiscard]] rpl::lifetime &lifetime() {
|
||||
return _content.lifetime();
|
||||
}
|
||||
|
||||
void setMirrored(bool mirrored) {
|
||||
_mirrored = mirrored;
|
||||
}
|
||||
|
||||
private:
|
||||
void setup();
|
||||
void paint();
|
||||
void setState(Webrtc::VideoState state);
|
||||
void applyDragMode(DragMode mode);
|
||||
void applyBoundingRect(QRect rect);
|
||||
void applySizeConstraints(QSize min, QSize max);
|
||||
void updateSizeToFrame(QSize frame);
|
||||
void updateVisibility();
|
||||
void setInnerSize(QSize size);
|
||||
void prepareFrame();
|
||||
|
||||
Ui::RpWidget _content;
|
||||
const not_null<Webrtc::VideoTrack*> _track;
|
||||
Webrtc::VideoState _state = Webrtc::VideoState();
|
||||
QImage _frame, _pausedFrame;
|
||||
QSize _min, _max, _size, _lastDraggableSize, _lastFrameSize;
|
||||
QRect _boundingRect;
|
||||
DragMode _dragMode = DragMode::None;
|
||||
RectPart _corner = RectPart::None;
|
||||
bool _dragging = false;
|
||||
bool _geometryDirty = false;
|
||||
bool _mirrored = true;
|
||||
|
||||
};
|
||||
|
||||
} // namespace Calls
|
||||
Reference in New Issue
Block a user