Agora C++ API Reference for All Platforms

IAgoraRtmpStreamingService.h
1
2 // Copyright (c) 2019 Agora.io. All rights reserved
3
4 // This program is confidential and proprietary to Agora.io.
5 // And may not be copied, reproduced, modified, disclosed to others, published
6 // or used, in whole or in part, without the express prior written permission
7 // of Agora.io.
8
9 #pragma once // NOLINT(build/header_guard)
10
11 #include "AgoraBase.h"
12 #include "AgoraRefPtr.h"
13 #include "IAgoraService.h"
14 #include "NGIAgoraRtcConnection.h"
15 #include <api/cpp/aosl_ares_class.h>
16
17 namespace agora {
18 namespace rtc {
19
23 enum RTMP_CHANNEL_EVENT
24 {
28 RTMP_CHANNEL_EVENT_DISCONNECT = 0,
32 RTMP_CHANNEL_EVENT_LEAVE_CHANNEL = 1,
36 RTMP_CHANNEL_EVENT_BANNED_BY_SERVER = 2
37 };
41 class IRtmpStreamingObserver {
42 public:
57 virtual void onRtmpStreamingStateChanged(const char* url, RTMP_STREAM_PUBLISH_STATE state,
58 RTMP_STREAM_PUBLISH_REASON reason) {
59 (void)url;
60 (void)state;
61 (void)reason;
62 }
63
71 virtual void onRtmpStreamingEvent(const char* url, RTMP_STREAMING_EVENT eventCode) {
72 (void)url;
73 (void)eventCode;
74 }
85 virtual void onTranscodingUpdated() {}
86 };
90 class IRtmpStreamingService : public RefCountInterface {
91 public:
92
113 virtual int startRtmpStreamWithoutTranscoding(const char* url, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
114
136 virtual int startRtmpStreamWithTranscoding(const char* url, const LiveTranscoding& transcoding, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
137
147 virtual int updateRtmpTranscoding(const LiveTranscoding& transcoding, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
166 virtual int stopRtmpStream(const char* url, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
167
175 virtual int registerObserver(IRtmpStreamingObserver* observer, aosl_ref_t ares = AOSL_REF_INVALID) = 0;
183 virtual int unregisterObserver(IRtmpStreamingObserver* observer) = 0;
184
185 protected:
186 ~IRtmpStreamingService() {}
187 };
188
189
190
191
192 } // namespace rtc
193 } // namespace agora
agora::rtc::IRtmpStreamingObserver::onRtmpStreamingStateChanged
virtual void onRtmpStreamingStateChanged(const char *url, RTMP_STREAM_PUBLISH_STATE state, RTMP_STREAM_PUBLISH_REASON reason)
Definition: IAgoraRtmpStreamingService.h:57
agora::rtc::IRtmpStreamingObserver::onTranscodingUpdated
virtual void onTranscodingUpdated()
Definition: IAgoraRtmpStreamingService.h:85
agora::rtc::RTMP_STREAMING_EVENT
RTMP_STREAMING_EVENT
Definition: AgoraBase.h:3750
agora::rtc::LiveTranscoding
Definition: AgoraBase.h:3964
agora::rtc::IRtmpStreamingService::updateRtmpTranscoding
virtual int updateRtmpTranscoding(const LiveTranscoding &transcoding, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::IRtmpStreamingService::registerObserver
virtual int registerObserver(IRtmpStreamingObserver *observer, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::IRtmpStreamingService::unregisterObserver
virtual int unregisterObserver(IRtmpStreamingObserver *observer)=0
agora::rtc::RTMP_STREAM_PUBLISH_REASON
RTMP_STREAM_PUBLISH_REASON
Definition: AgoraBase.h:3667
agora
Definition: AgoraAtomicOps.h:21
agora::rtc::RTMP_CHANNEL_EVENT_DISCONNECT
@ RTMP_CHANNEL_EVENT_DISCONNECT
Definition: IAgoraRtmpStreamingService.h:28
agora::rtc::IRtmpStreamingService::~IRtmpStreamingService
~IRtmpStreamingService()
Definition: IAgoraRtmpStreamingService.h:186
agora::rtc::RTMP_STREAM_PUBLISH_STATE
RTMP_STREAM_PUBLISH_STATE
Definition: AgoraBase.h:3624
agora::rtc::IRtmpStreamingObserver::onRtmpStreamingEvent
virtual void onRtmpStreamingEvent(const char *url, RTMP_STREAMING_EVENT eventCode)
Definition: IAgoraRtmpStreamingService.h:71
agora::rtc::IRtmpStreamingService::startRtmpStreamWithoutTranscoding
virtual int startRtmpStreamWithoutTranscoding(const char *url, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::RTMP_CHANNEL_EVENT_BANNED_BY_SERVER
@ RTMP_CHANNEL_EVENT_BANNED_BY_SERVER
Definition: IAgoraRtmpStreamingService.h:36
agora::rtc::RTMP_CHANNEL_EVENT_LEAVE_CHANNEL
@ RTMP_CHANNEL_EVENT_LEAVE_CHANNEL
Definition: IAgoraRtmpStreamingService.h:32
agora::RefCountInterface
Definition: AgoraRefPtr.h:31
agora::rtc::IRtmpStreamingObserver
Definition: IAgoraRtmpStreamingService.h:41
agora::rtc::IRtmpStreamingService::startRtmpStreamWithTranscoding
virtual int startRtmpStreamWithTranscoding(const char *url, const LiveTranscoding &transcoding, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::IRtmpStreamingService::stopRtmpStream
virtual int stopRtmpStream(const char *url, aosl_ref_t ares=AOSL_REF_INVALID)=0
agora::rtc::IRtmpStreamingService
Definition: IAgoraRtmpStreamingService.h:90
agora::rtc::RTMP_CHANNEL_EVENT
RTMP_CHANNEL_EVENT
Definition: IAgoraRtmpStreamingService.h:24
rtc
Definition: video_node_i.h:28