1 /* |
|
2 * GStreamer |
|
3 * Copyright (C) 2008 Nokia Corporation <multimedia@maemo.org> |
|
4 * |
|
5 * This library is free software; you can redistribute it and/or |
|
6 * modify it under the terms of the GNU Library General Public |
|
7 * License as published by the Free Software Foundation; either |
|
8 * version 2 of the License, or (at your option) any later version. |
|
9 * |
|
10 * This library is distributed in the hope that it will be useful, |
|
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 * Library General Public License for more details. |
|
14 * |
|
15 * You should have received a copy of the GNU Library General Public |
|
16 * License along with this library; if not, write to the |
|
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
|
18 * Boston, MA 02111-1307, USA. |
|
19 */ |
|
20 |
|
21 #ifndef __CAMERABIN_GENERAL_H_ |
|
22 #define __CAMERABIN_GENERAL_H_ |
|
23 |
|
24 #include <sys/time.h> |
|
25 #include <time.h> |
|
26 |
|
27 #include <gst/gst.h> |
|
28 |
|
29 |
|
30 typedef struct timeval TIME_TYPE; |
|
31 #define GET_TIME(t) do { gettimeofday(&(t), NULL); } while(0) |
|
32 #define DIFF_TIME(t2,t1,d) do { d = ((t2).tv_sec - (t1).tv_sec) * 1000000 + \ |
|
33 (t2).tv_usec - (t1).tv_usec; } while(0) |
|
34 |
|
35 #define _INIT_TIMER_BLOCK TIME_TYPE t1, t2; guint32 d; do {;}while (0) |
|
36 |
|
37 #define _OPEN_TIMER_BLOCK { GET_TIME(t1); do {;}while (0) |
|
38 #define _CLOSE_TIMER_BLOCK GET_TIME(t2); DIFF_TIME(t2,t1,d); \ |
|
39 GST_DEBUG("elapsed time = %u\n", d); \ |
|
40 } do {;}while (0) |
|
41 |
|
42 |
|
43 extern void |
|
44 camerabin_general_dbg_set_probe (GstElement * elem, gchar * pad_name, |
|
45 gboolean buf, gboolean evt); |
|
46 |
|
47 gboolean gst_camerabin_try_add_element (GstBin * bin, GstElement * new_elem); |
|
48 |
|
49 gboolean gst_camerabin_add_element (GstBin * bin, GstElement * new_elem); |
|
50 |
|
51 GstElement *gst_camerabin_create_and_add_element (GstBin * bin, |
|
52 const gchar * elem_name); |
|
53 |
|
54 void gst_camerabin_remove_elements_from_bin (GstBin * bin); |
|
55 |
|
56 gboolean |
|
57 gst_camerabin_drop_eos_probe (GstPad * pad, GstEvent * event, gpointer u_data); |
|
58 |
|
59 GST_DEBUG_CATEGORY_EXTERN (gst_camerabin_debug); |
|
60 #define GST_CAT_DEFAULT gst_camerabin_debug |
|
61 |
|
62 #endif /* #ifndef __CAMERABIN_GENERAL_H_ */ |
|