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
-
Constructor Summary
ConstructorDescriptionCodecDiscovery
(android.content.Context context) Create a newCodecDiscovery
instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
finalize()
void
gatherAvailableCodecs
(String customerID, BroadcastConfiguration.Video videoConfig, TypedLambda<List<CodecDiscovery.Result>> callback) Gather all codecs that are supported by the SDK for RTMP Broadcast.void
release()
Release the resources associated with this codec discovery session.
-
Constructor Details
-
CodecDiscovery
public CodecDiscovery(android.content.Context context) Create a newCodecDiscovery
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 aBroadcastException
if the codec is not supported. Codec availability depends on theBroadcastConfiguration.Video
provided, your AWS Customer ID, and the available encoders on your device. Regardless of if a codec is supported, aCodecDiscovery.Result
will be returned for it. Certain encoders will support some dimensions but not others, so it is required that aBroadcastConfiguration.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 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.Video
on theCodecDiscovery.Result
*must* be used, you can not manually assign a non H.264 codec to aBroadcastConfiguration.Video
instance. If you only plan on using H.264, it is not necessary to use this API, the defaultBroadcastConfiguration.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
- AnBroadcastConfiguration.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
-
release
public void release()Release the resources associated with this codec discovery session.- Specified by:
release
in interfaceReleasable
-