GstKinesisWebRTC: Getting Started - GstKinesisWebrtc Credentials Setup

From RidgeRun Developer Connection
Jump to: navigation, search



Previous: Getting Started/AWS Setup Index Next: Getting Started/GStreamer Pipelines





You have 3 options to set the AWS credentials to the kinesiswebrtcbin element, in the following order:

  • Element Properties.
  • Environment variables.
  • Element Signals.

The properties will take precedence over environment variables and the environment variables over the signals.

Element Properties

Kinesiswebtcbin has 2 properties to set up the AWS credentials: access-key and secret-key. You must set them before the element starts in order to use them to connect to the Amazon Kinesis Signaling Server. Otherwise, the element will look for the other options or fail if none of them is set.

kinesiswebrtcbin name=bin access-key="<Your AWS account access key>" secret-key="<Your AWS account secret key>”

Environment Variables

You can set the AWS account credentials through the environment variables: AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY as follows:

export AWS_ACCESS_KEY_ID= <Your AWS account access key>
export AWS_SECRET_ACCESS_KEY= <Your AWS account secret key>

Element Signals

Kinesiswebtcbin has 2 signals to set up the AWS credentials: access-key and secret-key. You must connect to the signals before the element starts, when it is starting the element (if the credentials are not provided for other means) will trigger the signals and get the credentials from the callback return value. Here is an example:

static gchar*
access_key_handler (GstElement * webrtc, gpointer user_data)
{
return g_strdup("<Your AWS account access key>");
}

static gchar*
secret_key_handler (GstElement * webrtc, gpointer user_data)
{
  return g_strdup("<Your AWS account secret key>");
}

g_signal_connect (webrtcbin, "access-key", G_CALLBACK (access_key_handler), NULL);
g_signal_connect (webrtcbin, "secret-key", G_CALLBACK (secret_key_handler), NULL);



Previous: Getting Started/AWS Setup Index Next: Getting Started/GStreamer Pipelines