2022-02-26 12:47:33 +00:00
|
|
|
/*
|
|
|
|
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 "base/weak_ptr.h"
|
|
|
|
#include "base/object_ptr.h"
|
2022-03-01 05:19:00 +00:00
|
|
|
#include "calls/group/calls_group_common.h"
|
2022-02-26 12:47:33 +00:00
|
|
|
|
|
|
|
class PeerData;
|
|
|
|
|
|
|
|
namespace Ui {
|
2022-08-08 15:19:04 +00:00
|
|
|
class Show;
|
2022-02-26 12:47:33 +00:00
|
|
|
class BoxContent;
|
2022-02-28 16:21:28 +00:00
|
|
|
class VerticalLayout;
|
2022-02-26 12:47:33 +00:00
|
|
|
} // namespace Ui
|
|
|
|
|
2022-02-28 16:21:28 +00:00
|
|
|
namespace style {
|
|
|
|
struct FlatLabel;
|
|
|
|
struct RoundButton;
|
|
|
|
struct IconButton;
|
2022-03-01 05:57:57 +00:00
|
|
|
struct PopupMenu;
|
2022-02-28 16:21:28 +00:00
|
|
|
} // namespace style
|
|
|
|
|
2022-02-26 12:47:33 +00:00
|
|
|
namespace Calls::Group {
|
|
|
|
|
|
|
|
struct JoinInfo;
|
|
|
|
|
|
|
|
class StartRtmpProcess final {
|
|
|
|
public:
|
|
|
|
StartRtmpProcess() = default;
|
|
|
|
~StartRtmpProcess();
|
|
|
|
|
|
|
|
void start(
|
|
|
|
not_null<PeerData*> peer,
|
2022-08-08 15:19:04 +00:00
|
|
|
std::shared_ptr<Ui::Show> show,
|
2022-02-26 12:47:33 +00:00
|
|
|
Fn<void(JoinInfo)> done);
|
2022-08-08 15:19:04 +00:00
|
|
|
void close();
|
2022-02-26 12:47:33 +00:00
|
|
|
|
2022-02-28 16:21:28 +00:00
|
|
|
static void FillRtmpRows(
|
|
|
|
not_null<Ui::VerticalLayout*> container,
|
|
|
|
bool divider,
|
2022-08-08 15:19:04 +00:00
|
|
|
std::shared_ptr<Ui::Show> show,
|
2022-03-01 05:19:00 +00:00
|
|
|
rpl::producer<RtmpInfo> &&data,
|
2022-02-28 16:21:28 +00:00
|
|
|
const style::FlatLabel *labelStyle,
|
|
|
|
const style::IconButton *showButtonStyle,
|
|
|
|
const style::FlatLabel *subsectionTitleStyle,
|
2022-03-01 05:57:57 +00:00
|
|
|
const style::RoundButton *attentionButtonStyle,
|
|
|
|
const style::PopupMenu *popupMenuStyle);
|
2022-02-28 16:21:28 +00:00
|
|
|
|
2022-02-26 12:47:33 +00:00
|
|
|
private:
|
|
|
|
void requestUrl(bool revoke);
|
2022-03-01 05:19:00 +00:00
|
|
|
void processUrl(RtmpInfo data);
|
2022-02-26 12:47:33 +00:00
|
|
|
void createBox();
|
|
|
|
void finish(JoinInfo info);
|
|
|
|
|
|
|
|
struct RtmpRequest {
|
|
|
|
not_null<PeerData*> peer;
|
2022-03-01 05:19:00 +00:00
|
|
|
rpl::variable<RtmpInfo> data;
|
2022-08-08 15:19:04 +00:00
|
|
|
std::shared_ptr<Ui::Show> show;
|
2022-02-26 12:47:33 +00:00
|
|
|
Fn<void(JoinInfo)> done;
|
|
|
|
base::has_weak_ptr guard;
|
|
|
|
QPointer<Ui::BoxContent> box;
|
|
|
|
rpl::lifetime lifetime;
|
|
|
|
mtpRequestId id = 0;
|
|
|
|
};
|
|
|
|
std::unique_ptr<RtmpRequest> _request;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Calls::Group
|