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.

Lifecycle of a Streaming Application

Your application communicates with Amazon AppStream and clients through the libraries of the Amazon AppStream SDK.

The lifecycle of an application is as follows:

  1. Create the XStxServerLibrary object. This ensures that the loaded libraries match the version your application was compiled with. It also gives you a handle to an XStxServerLibrary object, which is required for the next step.

  2. Create the XStxServerManager object. This object communicates with Amazon AppStream to manage the assignment of client sessions to your application.

  3. Register an XStxIServerManagerListener event sink. Pass the location of a callback function to receive events from the XStxServerManager object.

  4. Start the XStxServerManager object. Your application calls XStxServerManagerStart to cause the XStxServerManager object to start accepting client sessions from Amazon AppStream.

  5. Wait for the XStxServerManager object to end the session. During this phase, your application receives events to its XStxIServerManagerListener callback function when the session manager accepts a new client session, prompts your application to persist state before a session ends, or terminates a client session.

    If the event is XStxIServerManagerListenerFcnServerInitialize, a new client session has begun, and your application is passed a handle to the XStxServer object it will use to stream content to the client. In this case, perform the following steps:

    1. Initialize the XStxServer object.

    2. Register event sinks for XStxIAudioSource, XStxIInputMapping, XStxIInputSink, XStxIRawInputSink, XStxIServerListener, and XStxIVideoSource events. These callback functions are how your application is notified about streaming events.

    3. Call methods of the XStxServer object to send audio and video frames. Repeat this step for the duration of the streaming session.

    4. Terminate the XStxServer object. When the client is disconnected or the application ends the client session, your application should call XStxServerTerminate to release resources allocated to the XStxServer object.

  6. Recycle the XStxServerLibrary and XStxServerManager objects. After the client session ends, release the resources allocated to the XStxServerLibrary and XStxServerManager objects.