Package com.amazonaws.ivs.broadcast
Class CodecDiscovery
java.lang.Object
com.amazonaws.ivs.broadcast.CodecDiscovery
- All Implemented Interfaces:
Releasable
The interaction point for discovering codecs for use with RTMP Broadcast.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionCodecDiscovery(android.content.Context context) Create a newCodecDiscoveryinstance. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidfinalize()voidgatherAvailableCodecs(String customerID, BroadcastConfiguration.Video videoConfig, TypedLambda<List<CodecDiscovery.Result>> callback) Gather all codecs that are supported by the SDK for RTMP Broadcast.voidrelease()Release the resources associated with this codec discovery session.
-
Constructor Details
-
CodecDiscovery
public CodecDiscovery(android.content.Context context) Create a newCodecDiscoveryinstance.- 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.Videoif the codec is supported, or aBroadcastExceptionif the codec is not supported. Codec availability depends on theBroadcastConfiguration.Videoprovided, your AWS Customer ID, and the available encoders on your device. Regardless of if a codec is supported, aCodecDiscovery.Resultwill be returned for it. Certain encoders will support some dimensions but not others, so it is required that aBroadcastConfiguration.Videois 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 eachCodecDiscovery.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, theBroadcastConfiguration.Videoon theCodecDiscovery.Result*must* be used, you can not manually assign a non H.264 codec to aBroadcastConfiguration.Videoinstance. If you only plan on using H.264, it is not necessary to use this API, the defaultBroadcastConfiguration.Videoconstructor 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- AnBroadcastConfiguration.Videoto 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
-
release
public void release()Release the resources associated with this codec discovery session.- Specified by:
releasein interfaceReleasable
-