Ejemplo n.º 1
0
static void
byzanz_session_constructed (GObject *object)
{
  ByzanzSession *session = BYZANZ_SESSION (object);
  GOutputStream *stream;

  session->recorder = byzanz_recorder_new (session->window, &session->area);
  g_signal_connect (session->recorder, "notify::recording", 
      G_CALLBACK (byzanz_session_recorder_notify_cb), session);
  g_signal_connect (session->recorder, "image", 
      G_CALLBACK (byzanz_session_recorder_image_cb), session);

  /* FIXME: make async */
  stream = G_OUTPUT_STREAM (g_file_replace (session->file, NULL, 
        FALSE, G_FILE_CREATE_REPLACE_DESTINATION, session->cancellable, &session->error));
  if (stream != NULL) {
    session->encoder = byzanz_encoder_new (session->encoder_type, 
        byzanz_queue_get_input_stream (session->queue),
        stream, session->record_audio, session->cancellable);
    g_signal_connect (session->encoder, "notify", 
        G_CALLBACK (byzanz_session_encoder_notify_cb), session);
    g_object_unref (stream);
    if (byzanz_encoder_get_error (session->encoder))
      byzanz_session_set_error (session, byzanz_encoder_get_error (session->encoder));
  }
  byzanz_serialize_header (byzanz_queue_get_output_stream (session->queue),
      session->area.width, session->area.height, session->cancellable, &session->error);

  if (G_OBJECT_CLASS (byzanz_session_parent_class)->constructed)
    G_OBJECT_CLASS (byzanz_session_parent_class)->constructed (object);
}
Ejemplo n.º 2
0
static gboolean
byzanz_encoder_byzanz_setup (ByzanzEncoder * encoder,
                             GOutputStream * stream,
                             guint           width,
                             guint           height,
                             GCancellable *  cancellable,
                             GError **	     error)
{
  return byzanz_serialize_header (stream, width, height, cancellable, error);
}