Debian Codegraph @

src/byzanzencoder.h

raw symbols SCIP
1 /* desktop session recorder
2 * Copyright (C) 2009 Benjamin Otte <[email protected]>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 3 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #include <glib-object.h>
19 #include <gio/gio.h>
20 #include <gdk/gdk.h>
21 #include <gtk/gtk.h>
22 #include <cairo.h>
23
24 #ifndef __HAVE_BYZANZ_ENCODER_H__
25 #define __HAVE_BYZANZ_ENCODER_H__
26
27 typedef struct _ByzanzEncoder ByzanzEncoder;
28 typedef struct _ByzanzEncoderClass ByzanzEncoderClass;
29 typedef gpointer ByzanzEncoderIter;
30
31 #define BYZANZ_TYPE_ENCODER (byzanz_encoder_get_type())
32 #define BYZANZ_IS_ENCODER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BYZANZ_TYPE_ENCODER))
33 #define BYZANZ_IS_ENCODER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BYZANZ_TYPE_ENCODER))
34 #define BYZANZ_ENCODER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BYZANZ_TYPE_ENCODER, ByzanzEncoder))
35 #define BYZANZ_ENCODER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BYZANZ_TYPE_ENCODER, ByzanzEncoderClass))
36 #define BYZANZ_ENCODER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BYZANZ_TYPE_ENCODER, ByzanzEncoderClass))
37
38 struct _ByzanzEncoder {
39 GObject object;
40
41 /*<private >*/
42 GInputStream * input_stream; /* stream to read from in byzanzserialize.h format */
43 GOutputStream * output_stream; /* stream we write to (passed to the vfuncs) */
44 gboolean record_audio; /* TRUE when we're recording audio */
45 GCancellable * cancellable; /* cancellable to use in thread */
46 GError * error; /* NULL or the encoding error */
47
48 GAsyncQueue * jobs; /* the stuff we still need to encode */
49 GThread * thread; /* the encoding thread */
50 };
51
52 struct _ByzanzEncoderClass {
53 GObjectClass object_class;
54
55 /*< protected >*/
56 GtkFileFilter * filter; /* filter to determine if a file should be encoded by this class */
57
58 /* default function run in thread */
59 gboolean (* run) (ByzanzEncoder * encoder,
60 GInputStream * input,
61 GOutputStream * output,
62 gboolean record_audio,
63 GCancellable * cancellable,
64 GError ** error);
65
66 /* functions called by the default function */
67 gboolean (* setup) (ByzanzEncoder * encoder,
68 GOutputStream * stream,
69 guint width,
70 guint height,
71 GCancellable * cancellable,
72 GError ** error);
73 gboolean (* process) (ByzanzEncoder * encoder,
74 GOutputStream * stream,
75 guint64 msecs,
76 cairo_surface_t * surface,
77 const cairo_region_t * region,
78 GCancellable * cancellable,
79 GError ** error);
80 gboolean (* close) (ByzanzEncoder * encoder,
81 GOutputStream * stream,
82 guint64 msecs,
83 GCancellable * cancellable,
84 GError ** error);
85 };
86
87 GType byzanz_encoder_get_type (void) G_GNUC_CONST;
88
89 ByzanzEncoder * byzanz_encoder_new (GType encoder_type,
90 GInputStream * input,
91 GOutputStream * output,
92 gboolean record_audio,
93 GCancellable * cancellable);
94 /*
95 void byzanz_encoder_process (ByzanzEncoder * encoder,
96 cairo_surface_t * surface,
97 const cairo_region_t * region,
98 const GTimeVal * total_elapsed);
99 void byzanz_encoder_close (ByzanzEncoder * encoder,
100 const GTimeVal * total_elapsed);
101 */
102 gboolean byzanz_encoder_is_running (ByzanzEncoder * encoder);
103 const GError * byzanz_encoder_get_error (ByzanzEncoder * encoder);
104
105 GtkFileFilter * byzanz_encoder_type_get_filter (GType encoder_type);
106 GType byzanz_encoder_get_type_from_filter
107 (GtkFileFilter * filter);
108 GType byzanz_encoder_get_type_from_file
109 (GFile * file);
110 GType byzanz_encoder_type_iter_init (ByzanzEncoderIter * iter);
111 GType byzanz_encoder_type_iter_next (ByzanzEncoderIter * iter);
112
113 #endif /* __HAVE_BYZANZ_ENCODER_H__ */