Class CodecDiscovery

java.lang.Object
com.amazonaws.ivs.broadcast.CodecDiscovery
All Implemented Interfaces:
Releasable

public class CodecDiscovery extends Object implements Releasable
The interaction point for discovering codecs for use with RTMP Broadcast.
  • Constructor Details

    • CodecDiscovery

      public CodecDiscovery(android.content.Context context)
      Create a new CodecDiscovery instance.
      Parameters:
      context - A context to allocate resources with. The associated application context will be retained.
  • Method Details

    • gatherAvailableCodecs

      public void gatherAvailableCodecs(@NonNull String customerID, @NonNull BroadcastConfiguration.Video videoConfig, @NonNull TypedLambda<List<CodecDiscovery.Result>> callback)
       Gather all codecs that are supported by the SDK for RTMP Broadcast.
       Each codec will be associated with either a BroadcastConfiguration.Video
       if the codec is supported, or a BroadcastException if the codec is not
       supported. Codec availability depends on the BroadcastConfiguration.Video
       provided, your AWS Customer ID, and the available encoders on your device.
       Regardless of if a codec is supported, a CodecDiscovery.Result will be returned for it.
      
       Certain encoders will support some dimensions but not others, so it is required
       that a BroadcastConfiguration.Video is provided to this API. A codec will be considered
       incompatible if the dimensions or frame rate isn't supported. Things like B-frame support,
       keyframe interval, and bitrate may be changed to provide compatibility, and those changes will
       be reflected in the `configuration` property of each CodecDiscovery.Result.
      
       H.264 will always be returned with a configuration identical to the configuration provided.
       All other codecs are subject to configuration changes.
      
       In order to use the discovered codec, the BroadcastConfiguration.Video on the
       CodecDiscovery.Result *must* be used, you can not manually assign a non H.264 codec
       to a BroadcastConfiguration.Video instance. If you only plan on using H.264, it
       is not necessary to use this API, the default BroadcastConfiguration.Video
       constructor will use H.264 by default.
      
       - Note: This API will perform short encoding sessions to guarantee compatibility with
       non-H.264 codecs. To ensure these encodes can complete by the deadline, this API should
       be invoked when the device is not using an excessive amount of CPU. Calling this API under
       heavy CPU load may result in codecs that would otherwise be compatible being returned as not
       compatible.
      
       - Warning: This API is in beta and may change in the future.
       
      Parameters:
      customerID - The AWS Customer ID associated with the IVS channel being streamed to.
      videoConfig - An BroadcastConfiguration.Video to test encoders against.
      callback - A callback that will provide an array of results for all IVS supported codecs. This will always be invoked asynchronously on the main thread.
    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • release

      public void release()
      Release the resources associated with this codec discovery session.
      Specified by:
      release in interface Releasable