io.agora.rtc

## Class AgoraRtmpStreamingService

- java.lang.Object
- - io.agora.rtc.AgoraRtmpStreamingService

-     public class AgoraRtmpStreamingService
      extends java.lang.Object

  Wrapper for RTMP streaming service functionality.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private IRtmpStreamingObserver` | `_RtmpStreamingObserver` Observer for RTMP streaming events
    `private long` | `cptr` Native pointer to the RTMP streaming service instance.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AgoraRtmpStreamingService(long cptr)` Constructs an RTMP streaming service.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `addPublishStreamUrl(java.lang.String url, int transcoding_enabled)` Adds a publish stream URL.
    `void` | `destroy()` Destroys the RTMP streaming service and releases native resources.
    `private void` | `ndestroy()` Destroys the native RTMP streaming service.
    `int` | `registerObserver(IRtmpStreamingObserver observer)` Registers an RTMP streaming observer.
    `int` | `removePublishStreamUrl(java.lang.String url)` Removes a publish stream URL.
    `int` | `setLiveTranscoding(LiveTranscoding transcoding)` Sets live transcoding configuration.
    `int` | `unregisterObserver(IRtmpStreamingObserver observer)` Unregisters an RTMP streaming observer.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### cptr

          private long cptr

      Native pointer to the RTMP streaming service instance.

    - #### _RtmpStreamingObserver

          private IRtmpStreamingObserver _RtmpStreamingObserver

      Observer for RTMP streaming events

  - ### Constructor Detail

    - #### AgoraRtmpStreamingService

          public AgoraRtmpStreamingService(long cptr)

      Constructs an RTMP streaming service.
      Parameters:
        `cptr` - Native pointer to the RTMP streaming service instance

  - ### Method Detail

    - #### ndestroy

          private void ndestroy()

      Destroys the native RTMP streaming service.

    - #### destroy

          public void destroy()

      Destroys the RTMP streaming service and releases native resources.

    - #### addPublishStreamUrl

          public int addPublishStreamUrl(java.lang.String url,
                                         int transcoding_enabled)

      Adds a publish stream URL.
      Parameters:
        `url` - Stream URL
        `transcoding_enabled` - Whether transcoding is enabled
      Returns:
        0 on success, <0 on failure

    - #### removePublishStreamUrl

          public int removePublishStreamUrl(java.lang.String url)

      Removes a publish stream URL.
      Parameters:
        `url` - Stream URL to remove
      Returns:
        0 on success, <0 on failure

    - #### setLiveTranscoding

          public int setLiveTranscoding(LiveTranscoding transcoding)

      Sets live transcoding configuration.
      Parameters:
        `transcoding` - Live transcoding configuration
      Returns:
        0 on success, <0 on failure

    - #### registerObserver

          public int registerObserver(IRtmpStreamingObserver observer)

      Registers an RTMP streaming observer.
      Parameters:
        `observer` - Observer instance
      Returns:
        0 on success, <0 on failure

    - #### unregisterObserver

          public int unregisterObserver(IRtmpStreamingObserver observer)

      Unregisters an RTMP streaming observer.
      Parameters:
        `observer` - Observer instance
      Returns:
        0 on success, <0 on failure