[byzanz] Get rid of byzanz_session_prepare()
- From: Benjamin Otte <otte src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [byzanz] Get rid of byzanz_session_prepare()
- Date: Wed, 26 Aug 2009 10:21:37 +0000 (UTC)
commit a309f39efc98e222e3933abd7d50d2658fee465a
Author: Benjamin Otte <otte gnome org>
Date: Wed Aug 19 19:30:30 2009 +0200
Get rid of byzanz_session_prepare()
Deciding when and what to quantize is not the job of the API calling us,
but of the encoder.
src/byzanzapplet.c | 1 -
src/byzanzsession.c | 26 ++++++--------------------
src/byzanzsession.h | 1 -
src/record.c | 12 +-----------
4 files changed, 7 insertions(+), 33 deletions(-)
---
diff --git a/src/byzanzapplet.c b/src/byzanzapplet.c
index 37c2768..7a59e74 100644
--- a/src/byzanzapplet.c
+++ b/src/byzanzapplet.c
@@ -259,7 +259,6 @@ byzanz_applet_start_recording (AppletPrivate *priv)
g_object_unref (window);
}
if (priv->rec) {
- byzanz_session_prepare (priv->rec);
byzanz_session_start (priv->rec);
g_get_current_time (&priv->start);
}
diff --git a/src/byzanzsession.c b/src/byzanzsession.c
index c4bbbf2..14b5fe3 100644
--- a/src/byzanzsession.c
+++ b/src/byzanzsession.c
@@ -49,7 +49,6 @@
typedef enum {
RECORDER_STATE_ERROR,
RECORDER_STATE_CREATED,
- RECORDER_STATE_PREPARED,
RECORDER_STATE_RECORDING,
RECORDER_STATE_STOPPED
} SessionState;
@@ -746,9 +745,6 @@ byzanz_session_state_advance (ByzanzSession *session)
{
switch (session->state) {
case RECORDER_STATE_CREATED:
- byzanz_session_prepare (session);
- break;
- case RECORDER_STATE_PREPARED:
byzanz_session_start (session);
break;
case RECORDER_STATE_RECORDING:
@@ -898,30 +894,20 @@ byzanz_session_new_fd (gint fd, GdkWindow *window, GdkRectangle *area,
}
void
-byzanz_session_prepare (ByzanzSession *rec)
+byzanz_session_start (ByzanzSession *rec)
{
+ Display *dpy;
SessionJob *job;
- GdkRegion *region;
GTimeVal tv;
-
+
g_return_if_fail (BYZANZ_IS_RECORDER (rec));
g_return_if_fail (rec->state == RECORDER_STATE_CREATED);
- region = gdk_region_rectangle (&rec->area);
+ rec->region = gdk_region_rectangle (&rec->area);
g_get_current_time (&tv);
- job = session_job_new (rec, RECORDER_JOB_QUANTIZE, &tv, region);
+ job = session_job_new (rec, RECORDER_JOB_QUANTIZE, &tv, rec->region);
g_async_queue_push (rec->jobs, job);
- //g_print ("pushing QUANTIZE\n");
- rec->state = RECORDER_STATE_PREPARED;
-}
-
-void
-byzanz_session_start (ByzanzSession *rec)
-{
- Display *dpy;
-
- g_return_if_fail (BYZANZ_IS_RECORDER (rec));
- g_return_if_fail (rec->state == RECORDER_STATE_PREPARED);
+ rec->region = NULL;
g_assert (rec->region == NULL);
diff --git a/src/byzanzsession.h b/src/byzanzsession.h
index 722c1ea..500322e 100644
--- a/src/byzanzsession.h
+++ b/src/byzanzsession.h
@@ -36,7 +36,6 @@ ByzanzSession * byzanz_session_new_fd (gint fd,
GdkRectangle * area,
gboolean loop,
gboolean record_cursor);
-void byzanz_session_prepare (ByzanzSession * session);
void byzanz_session_start (ByzanzSession * session);
void byzanz_session_stop (ByzanzSession * session);
void byzanz_session_destroy (ByzanzSession * session);
diff --git a/src/record.c b/src/record.c
index d7afa43..fe2f64a 100644
--- a/src/record.c
+++ b/src/record.c
@@ -87,16 +87,6 @@ start_recording (gpointer session)
return FALSE;
}
-static gboolean
-prepare_recording (gpointer session)
-{
- verbose_print (_("Preparing recording. Will start in 1 second...\n"));
- byzanz_session_prepare (session);
- g_timeout_add (1000, start_recording, session);
-
- return FALSE;
-}
-
int
main (int argc, char **argv)
{
@@ -141,7 +131,7 @@ main (int argc, char **argv)
delay = (delay - 1) * 1000;
duration = MAX (duration, 0);
duration *= 1000;
- g_timeout_add (delay, prepare_recording, rec);
+ g_timeout_add (delay, start_recording, rec);
gtk_main ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]