Amazon AppStream
Developer Guide

This documentation is for an older version of Amazon AppStream. For information about the latest version, see the Amazon AppStream 2.0 Developer Guide.

Choosing a Color Subsampling Rate

Amazon AppStream streams the video at the YUV420 color subsampling rate to client applications. If your streaming application, client application and device support YUV444, you can set your client application to display the video at YUV444. The example client application in Amazon AppStream SDK is configured to accept and render a stream in the YUV444 color subsampling rate.

When the client application connects to the streaming application, Amazon AppStream compares the color subsampling options available on the client application with the options advertised on the streaming application. Amazon AppStream then selects the highest color resolution supported by both the client application and streaming application. Amazon AppStream then calls the XStxIClientListener2FcnSetConfiguration callback function that the client application supplied and passes the structure with the XStxChromaSampling setting.

The following excerpt from AndroidVideoDecoder.cpp illustrates this step. This file is in the <SDK_dir>\example_src\client\src\android\jni directory.

/** * Provide Chroma sampling capability. */ bool AndroidVideoDecoder::isChromaSamplingSupported(XStxChromaSampling chromaSampling) { // If we have hardware, then ask the hardware whether we have XSTX_H264_PROFILE_HIGH444. // If not, then we fall back to 420. if (androidHWDecodeAvailable() && (androidGetProfile()!=XSTX_H264_PROFILE_HIGH444)) { return chromaSampling == XSTX_CHROMA_SAMPLING_YUV420; } else { return chromaSampling == XSTX_CHROMA_SAMPLING_YUV420 || chromaSampling == XSTX_CHROMA_SAMPLING_YUV444; } }

The following excerpt from VideoPipeline.cpp illustrates this step. This file is in the <SDK_dir>\example_src\client\src\android\jni directory.

decoderCapabilities->mProfile = XSTX_H264_PROFILE_HIGH444;