Re: [Ekiga-devel-list] Another try at gstreamer in ekiga



Le 22/02/2013 06:11, Craig Southeren a écrit :
On write, the timing will be provided by the incoming RTP data or the
jitter buffer, depending on
which type of media you are using.

I push data as I receive it on a set_frame_data method:
bool
GST::AudioOutputManager::set_frame_data (Ekiga::AudioOutputPS ps,
                                         const char* data,
                                         unsigned size,
                                         unsigned& written)
{
  bool result;
  unsigned ii = (ps == Ekiga::primary)?0:1;

  if (worker[ii]) {

    gst_helper_set_frame_data (worker[ii], data, size);
    written = size;
    result = true;
  } else {

    // we're closed already!
    written = 0;
    result = false;
  }
  return result;
}

and:

void
gst_helper_set_frame_data (gst_helper* self,
                           const char* data,
                           unsigned size)
{
  //g_message ("%s\n", __PRETTY_FUNCTION__);
  gchar* tmp = NULL;
  GstBuffer* buffer = NULL;
  static bool done = false;

  if (!done) {

    done = true;
GST_DEBUG_BIN_TO_DOT_FILE(GST_BIN(self->pipeline), GST_DEBUG_GRAPH_SHOW_ALL, "pipeline");
  }

  if (self->active) {

    tmp = (gchar*)g_malloc0 (size);
    memcpy (tmp, data, size);
    buffer = gst_app_buffer_new (tmp, size,
                                 (GstAppBufferFinalizeFunc)g_free, tmp);
    gst_app_src_push_buffer (GST_APP_SRC (self->active), buffer);
  }
}

Snark


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]