static void
tp_streamed_media_request_streams_for_capabilities (EmpathyTpStreamedMedia *call,
                                          EmpathyCapabilities capabilities)
{
  EmpathyTpStreamedMediaPriv *priv = GET_PRIV (call);
  GArray *stream_types;
  guint handle;
  guint stream_type;

  if (capabilities == EMPATHY_CAPABILITIES_UNKNOWN)
      capabilities = EMPATHY_CAPABILITIES_AUDIO | EMPATHY_CAPABILITIES_VIDEO;

  DEBUG ("Requesting new stream for capabilities %d",
      capabilities);

  stream_types = g_array_new (FALSE, FALSE, sizeof (guint));
  handle = empathy_contact_get_handle (priv->contact);

  if (capabilities & EMPATHY_CAPABILITIES_AUDIO)
    {
      stream_type = TP_MEDIA_STREAM_TYPE_AUDIO;
      g_array_append_val (stream_types, stream_type);
    }
  if (capabilities & EMPATHY_CAPABILITIES_VIDEO)
    {
      stream_type = TP_MEDIA_STREAM_TYPE_VIDEO;
      g_array_append_val (stream_types, stream_type);
    }

  tp_cli_channel_type_streamed_media_call_request_streams (priv->channel, -1,
      handle, stream_types, tp_streamed_media_request_streams_cb, NULL, NULL,
      G_OBJECT (call));

  g_array_unref (stream_types);
}
NS_IMETHODIMP
csTpChannelTypeStreamedMedia::CallRequestStreams(PRUint32 aContactHandle, PRUint32 aTypesCount, PRUint32 *aTypes,
    csITpChannelTypeStreamedMediaRequestStreamsCB *cb)
{
  if (!m_Proxy)
    return NS_ERROR_NOT_INITIALIZED;

  GArray *cTypes = g_array_new(false, false, sizeof(guint ));
  for (PRUint32 i=0; i<aTypesCount; i++)
    g_array_append_val(cTypes, aTypes[i]);

  NS_IF_ADDREF(cb);
  tp_cli_channel_type_streamed_media_call_request_streams(m_Proxy, -1,
      aContactHandle, cTypes,
      cb? RequestStreamsResponse: NULL, cb? cb: NULL, NULL, NULL);

  return NS_OK;
}