C++SDK  1.0.0
msvrlive.h
浏览该文件的文档.
1 #ifndef RT_IMSvrLive_H_
2 #define RT_IMSvrLive_H_
3 
4 #include "common.h"
5 #include "room.h"
6 #include "videorender.h"
7 
8 namespace tee3 {
9  namespace avd {
10 
18  public:
24  class IListener {
25  public:
27 
34  virtual void onCreateLive(Result result, const LiveInfo& info) = 0;
43  virtual void onSelectMedia4Live(Result result, const LiveId& lvbc_id) = 0;
50  virtual void onMixMedia4Live(Result result, const LiveId& lvbc_id) = 0;
58  virtual void onPauseResumeLive(Result result, const LiveId& lvbc_id) = 0;
66  virtual void onLiveInfo(Result result, const LiveInfo& info) = 0;
74  virtual void onDeleteLive(Result result, const LiveId& lvbc_id) = 0;
75  protected:
76  virtual ~IListener() {}
77  };
78  public:
83  static IMSvrLive* getSvrLive(IRoom *room);
89  virtual Result setListener(IListener* listener) = 0;
96  virtual Result createLive(LiveInfo& info) = 0;
108  virtual Result selectMedia4Live(const LiveId& lvbc_id, const DeviceId& selectedVideo, const UserId& audioUserId) = 0;
109 
115  struct MixVideos {
116  uint32 mixWidth; //混流输出视频分辨率宽
117  uint32 mixHeight; //混流输出视频分辨率高
118  uint32 backgroundColor; //如:"#C0C0C0" RGB
119  uint32 outBitrate; //混流输出码率
120  uint32 outFps; //混流输出帧率
121 
122  struct VideoItem {
123  DeviceId id; //摄像头Id,唯一标示一路共享的摄像头视频。
124  float x, y; //此视频在左上角左边位置(上边位置),即x坐标,取值0.0~1.0,内部取值为:width * X(height * Y)
125  float width, height; //此视频宽度(高度)比例,取值0.0~1.0,内部取值为:width * W(height * H)
126  uint16 zorder; //多个视频覆盖时,前后位置,zorder越小,视频越在下层,会被覆盖;取值0-10
127  uint16 alpha; //(暂不使用)透明度
128  IVideoRenderView::ScalingType render; //(暂不使用)视频渲染到混流视频上的渲染模式
129 
130  VideoItem() : x(0.0f), y(0.0f), width(0.0f), height(0.0f), zorder(0), alpha(0), render(IVideoRenderView::Scale_Aspect_Fit) {}
131  VideoItem(const DeviceId& aId, float ax, float ay, float aw, float ah, uint16 az) : id(aId), x(ax), y(ay), width(aw), height(ah) {}
132  };
133  typedef std::vector<VideoItem> VideosType;
134  VideosType videos;
135  public:
136  MixVideos() :mixWidth(0), mixHeight(0), backgroundColor(0), outBitrate(0), outFps(0){}
137  MixVideos(uint32 aw, uint32 ah, uint32 outbt) :mixWidth(aw), mixHeight(ah), backgroundColor(0), outBitrate(outbt), outFps(0){}
138  };
150  virtual Result mixMedia4Live(const LiveId& lvbc_id, const MixVideos& mixs, const UserId& audioUserId) = 0;
159  virtual Result pauseResumeLive(const LiveId& lvbc_id, bool isResume) = 0;
167  virtual Result getLiveInfo(const LiveId& lvbc_id) = 0;
175  virtual Result deleteLive(const LiveId& lvbc_id) = 0;
176  protected:
177  virtual ~IMSvrLive() {}
178  };
179 
180  RT_API_EXPORT const String toString(const IMSvrLive::MixVideos& obj);
181  } // namespace avd
182 } // namespace tee3
183 #endif//RT_IMSvrLive_H_
uint32 outFps
Definition: msvrlive.h:120
Definition: msvrlive.h:17
unsigned short uint16
Definition: defines.h:395
NAMESPACE_TEE3_BEGIN typedef std::string String
Definition: common.h:10
Definition: videorender.h:198
String UserId
Definition: common.h:13
int Result
Definition: combase.h:13
Definition: msvrlive.h:115
IVideoRenderView::ScalingType render
Definition: msvrlive.h:128
String DeviceId
Definition: common.h:12
for live
Definition: common.h:545
Definition: room.h:17
#define RT_API_EXPORT
Definition: defines.h:188
uint32 backgroundColor
Definition: msvrlive.h:118
VideosType videos
Definition: msvrlive.h:134
ScalingType
Definition: videorender.h:200
MixVideos(uint32 aw, uint32 ah, uint32 outbt)
Definition: msvrlive.h:137
unsigned int uint32
Definition: defines.h:393
uint32 mixHeight
Definition: msvrlive.h:117
uint16 zorder
Definition: msvrlive.h:126
DeviceId id
Definition: msvrlive.h:123
float y
Definition: msvrlive.h:124
uint16 alpha
Definition: msvrlive.h:127
float width
Definition: msvrlive.h:125
virtual ~IListener()
Definition: msvrlive.h:76
const String toString(const RecordInfo &obj)
uint32 outBitrate
Definition: msvrlive.h:119
VideoItem()
Definition: msvrlive.h:130
Definition: audiocapture.h:5
virtual ~IMSvrLive()
Definition: msvrlive.h:177
uint32 mixWidth
Definition: msvrlive.h:116
Definition: msvrlive.h:24
DeviceId LiveId
Definition: common.h:16
std::vector< VideoItem > VideosType
Definition: msvrlive.h:133
VideoItem(const DeviceId &aId, float ax, float ay, float aw, float ah, uint16 az)
Definition: msvrlive.h:131
MixVideos()
Definition: msvrlive.h:136