rtc.avd_SDK-C++  3.2.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 rtc {
9 
17  public:
23  class IListener {
24  public:
26 
33  virtual void onCreateLive(Result result, const LiveInfo& info) = 0;
42  virtual void onSelectMedia4Live(Result result, const LiveId& lvbc_id) = 0;
49  virtual void onMixMedia4Live(Result result, const LiveId& lvbc_id) = 0;
57  virtual void onPauseResumeLive(Result result, const LiveId& lvbc_id) = 0;
65  virtual void onLiveInfo(Result result, const LiveInfo& info) = 0;
73  virtual void onDeleteLive(Result result, const LiveId& lvbc_id) = 0;
74  protected:
75  virtual ~IListener() {}
76  };
77  public:
82  static IMSvrLive* getSvrLive(IRoom *room);
88  virtual Result setListener(IListener* listener) = 0;
95  virtual Result createLive(LiveInfo& info) = 0;
107  virtual Result selectMedia4Live(const LiveId& lvbc_id, const DeviceId& selectedVideo, const UserId& audioUserId) = 0;
108 
114  struct MixVideos {
115  uint32 mixWidth; //混流输出视频分辨率宽
116  uint32 mixHeight; //混流输出视频分辨率高
117  uint32 backgroundColor; //如:"#C0C0C0" RGB
118  uint32 outBitrate; //混流输出码率
119  uint32 outFps; //混流输出帧率
120 
121  struct VideoItem {
122  DeviceId id; //摄像头Id,唯一标示一路共享的摄像头视频。
123  float x, y; //此视频在左上角左边位置(上边位置),即x坐标,取值0.0~1.0,内部取值为:width * X(height * Y)
124  float width, height; //此视频宽度(高度)比例,取值0.0~1.0,内部取值为:width * W(height * H)
125  uint16 zorder; //多个视频覆盖时,前后位置,zorder越小,视频越在下层,会被覆盖;取值0-10
126  uint16 alpha; //(暂不使用)透明度
127  IVideoRenderView::ScalingType render; //(暂不使用)视频渲染到混流视频上的渲染模式
128 
129  VideoItem() : x(0.0f), y(0.0f), width(0.0f), height(0.0f), zorder(0), alpha(0), render(IVideoRenderView::Scale_Aspect_Fit) {}
130  VideoItem(const DeviceId& aId, float ax, float ay, float aw, float ah, uint16 az) : id(aId), x(ax), y(ay), width(aw), height(ah) {}
131  };
132  typedef std::vector<VideoItem> VideosType;
134  public:
135  MixVideos() :mixWidth(0), mixHeight(0), backgroundColor(0), outBitrate(0), outFps(0){}
136  MixVideos(uint32 aw, uint32 ah, uint32 outbt) :mixWidth(aw), mixHeight(ah), backgroundColor(0), outBitrate(outbt), outFps(0){}
137  };
149  virtual Result mixMedia4Live(const LiveId& lvbc_id, const MixVideos& mixs, const UserId& audioUserId) = 0;
158  virtual Result pauseResumeLive(const LiveId& lvbc_id, bool isResume) = 0;
166  virtual Result getLiveInfo(const LiveId& lvbc_id) = 0;
174  virtual Result deleteLive(const LiveId& lvbc_id) = 0;
175  protected:
176  virtual ~IMSvrLive() {}
177  };
178 
179  RT_API_EXPORT const String toString(const IMSvrLive::MixVideos& obj);
180 } // namespace rtc
181 #endif//RT_IMSvrLive_H_
std::vector< VideoItem > VideosType
Definition: msvrlive.h:132
DeviceId id
Definition: msvrlive.h:122
Definition: annotationobject.h:71
Definition: msvrlive.h:121
unsigned short uint16
Definition: defines.h:389
MixVideos(uint32 aw, uint32 ah, uint32 outbt)
Definition: msvrlive.h:136
MixVideos()
Definition: msvrlive.h:135
视频混流信息结构.
Definition: msvrlive.h:114
String UserId
用户号类型,唯一标识房间内一个用户,长度不大于Max_UserId定义;由应用层定义传递给AVD SDK,要求保证房间内唯一
Definition: common.h:13
uint32 backgroundColor
Definition: msvrlive.h:117
int Result
返回值类型
Definition: combase.h:13
房间旁路直播管理接口.
Definition: msvrlive.h:16
String DeviceId
设备号类型,唯一标识房间内一个设备,长度不大于Max_DeviceId定义;定义如下:userId+"_"+md5[os.getdeviceid() or os.getsystemid()]
Definition: common.h:12
uint32 mixWidth
Definition: msvrlive.h:115
#define RT_API_EXPORT
Definition: defines.h:216
Definition: videorender.h:204
unsigned int uint32
Definition: defines.h:387
uint16 alpha
Definition: msvrlive.h:126
std::string String
定义的String类型
Definition: common.h:10
VideoItem()
Definition: msvrlive.h:129
uint32 outBitrate
Definition: msvrlive.h:118
const String toString(const RecordInfo &obj)
ScalingType
Definition: videorender.h:206
virtual ~IMSvrLive()
Definition: msvrlive.h:176
IVideoRenderView::ScalingType render
Definition: msvrlive.h:127
for live
Definition: common.h:581
float y
Definition: msvrlive.h:123
房间接口类
Definition: room.h:16
virtual ~IListener()
Definition: msvrlive.h:75
uint32 mixHeight
Definition: msvrlive.h:116
float width
Definition: msvrlive.h:124
uint16 zorder
Definition: msvrlive.h:125
直播频道回调接口类
Definition: msvrlive.h:23
uint32 outFps
Definition: msvrlive.h:119
DeviceId LiveId
直播频道ID类型
Definition: common.h:16
VideosType videos
Definition: msvrlive.h:133
VideoItem(const DeviceId &aId, float ax, float ay, float aw, float ah, uint16 az)
Definition: msvrlive.h:130