void
empathy_tp_streamed_media_request_video_stream_direction (EmpathyTpStreamedMedia *call,
                                                gboolean is_sending)
{
  EmpathyTpStreamedMediaPriv *priv = GET_PRIV (call);
  guint new_direction;

  g_return_if_fail (EMPATHY_IS_TP_STREAMED_MEDIA (call));
  g_return_if_fail (priv->status == EMPATHY_TP_STREAMED_MEDIA_STATUS_ACCEPTED);

  DEBUG ("Requesting video stream direction - is_sending: %d", is_sending);

  if (!priv->video->exists)
    {
      if (is_sending)
          tp_streamed_media_request_streams_for_capabilities (call,
              EMPATHY_CAPABILITIES_VIDEO);
      return;
    }

  if (is_sending)
      new_direction = priv->video->direction | TP_MEDIA_STREAM_DIRECTION_SEND;
  else
      new_direction = priv->video->direction & ~TP_MEDIA_STREAM_DIRECTION_SEND;

  tp_cli_channel_type_streamed_media_call_request_stream_direction (priv->channel,
      -1, priv->video->id, new_direction,
      (tp_cli_channel_type_streamed_media_callback_for_request_stream_direction)
      tp_streamed_media_async_cb, NULL, NULL, G_OBJECT (call));
}
NS_IMETHODIMP
csTpChannelTypeStreamedMedia::CallRequestStreamDirection(PRUint32 aStreamID, PRUint32 aStreamDirection,
    csITpChannelTypeStreamedMediaRequestStreamDirectionCB *cb)
{
  if (!m_Proxy)
    return NS_ERROR_NOT_INITIALIZED;


  NS_IF_ADDREF(cb);
  tp_cli_channel_type_streamed_media_call_request_stream_direction(m_Proxy, -1,
      aStreamID, aStreamDirection,
      cb? RequestStreamDirectionResponse: NULL, cb? cb: NULL, NULL, NULL);

  return NS_OK;
}