gstreamer_core/gst/gsttrace.h
branchRCL_3
changeset 30 7e817e7e631c
parent 29 567bb019e3e3
equal deleted inserted replaced
29:567bb019e3e3 30:7e817e7e631c
    90 #ifdef __SYMBIAN32__
    90 #ifdef __SYMBIAN32__
    91 IMPORT_C
    91 IMPORT_C
    92 #endif
    92 #endif
    93 
    93 
    94 
    94 
       
    95 
       
    96 
    95 GstTrace*	gst_trace_new			(gchar *filename, gint size);
    97 GstTrace*	gst_trace_new			(gchar *filename, gint size);
    96 #ifdef __SYMBIAN32__
    98 #ifdef __SYMBIAN32__
    97 IMPORT_C
    99 IMPORT_C
    98 #endif
   100 #endif
    99 
   101 
   128  * @trace: a #GstTrace
   130  * @trace: a #GstTrace
   129  *
   131  *
   130  * Retrieve the remaining size in the @trace buffer.
   132  * Retrieve the remaining size in the @trace buffer.
   131  */
   133  */
   132 #define 	gst_trace_get_remaining(trace) 	((trace)->bufsize - (trace)->bufoffset)
   134 #define 	gst_trace_get_remaining(trace) 	((trace)->bufsize - (trace)->bufoffset)
   133 #ifdef __SYMBIAN32__
       
   134 IMPORT_C
       
   135 #endif
       
   136 void 		gst_trace_set_default		(GstTrace *trace);
   135 void 		gst_trace_set_default		(GstTrace *trace);
   137 #ifdef __SYMBIAN32__
   136 #ifdef __SYMBIAN32__
   138 IMPORT_C
   137 IMPORT_C
   139 #endif
   138 #endif
   140 
   139 
   145 IMPORT_C
   144 IMPORT_C
   146 #endif
   145 #endif
   147 
   146 
   148 
   147 
   149 void 		gst_trace_read_tsc		(gint64 *dst);
   148 void 		gst_trace_read_tsc		(gint64 *dst);
   150 
   149 #ifdef __SYMBIAN32__
   151 
   150 IMPORT_C
   152 extern GStaticMutex     _gst_trace_mutex;
   151 #endif
   153 #ifdef __SYMBIAN32__
   152 
   154 IMPORT_C
       
   155 #endif
       
   156 
   153 
   157 
   154 
   158 gboolean		gst_alloc_trace_available	(void);
   155 gboolean		gst_alloc_trace_available	(void);
   159 #ifdef __SYMBIAN32__
   156 #ifdef __SYMBIAN32__
   160 IMPORT_C
   157 IMPORT_C
   221  *
   218  *
   222  * Use the tracer to trace a new memory allocation
   219  * Use the tracer to trace a new memory allocation
   223  */
   220  */
   224 #define	gst_alloc_trace_new(trace, mem) 		\
   221 #define	gst_alloc_trace_new(trace, mem) 		\
   225 G_STMT_START {						\
   222 G_STMT_START {						\
   226   if (G_UNLIKELY ((trace)->flags)) {                    \
   223   if ((trace)->flags & GST_ALLOC_TRACE_LIVE) 		\
   227     g_static_mutex_lock (&_gst_trace_mutex);            \
   224     (trace)->live++;					\
   228     if ((trace)->flags & GST_ALLOC_TRACE_LIVE) 		\
   225   if ((trace)->flags & GST_ALLOC_TRACE_MEM_LIVE) 	\
   229       (trace)->live++;					\
   226     (trace)->mem_live = 				\
   230     if ((trace)->flags & GST_ALLOC_TRACE_MEM_LIVE) 	\
   227       g_slist_prepend ((trace)->mem_live, mem);		\
   231       (trace)->mem_live = 				\
       
   232         g_slist_prepend ((trace)->mem_live, mem);	\
       
   233     g_static_mutex_unlock (&_gst_trace_mutex);          \
       
   234   }                                                     \
       
   235 } G_STMT_END
   228 } G_STMT_END
   236 
   229 
   237 /**
   230 /**
   238  * gst_alloc_trace_free:
   231  * gst_alloc_trace_free:
   239  * @trace: The tracer to use
   232  * @trace: The tracer to use
   241  *
   234  *
   242  * Trace a memory free operation
   235  * Trace a memory free operation
   243  */
   236  */
   244 #define	gst_alloc_trace_free(trace, mem) 		\
   237 #define	gst_alloc_trace_free(trace, mem) 		\
   245 G_STMT_START {						\
   238 G_STMT_START {						\
   246   if (G_UNLIKELY ((trace)->flags)) {                    \
   239   if ((trace)->flags & GST_ALLOC_TRACE_LIVE) 		\
   247     g_static_mutex_lock (&_gst_trace_mutex);            \
   240     (trace)->live--;					\
   248     if ((trace)->flags & GST_ALLOC_TRACE_LIVE) 		\
   241   if ((trace)->flags & GST_ALLOC_TRACE_MEM_LIVE) 	\
   249       (trace)->live--;					\
   242     (trace)->mem_live = 				\
   250     if ((trace)->flags & GST_ALLOC_TRACE_MEM_LIVE) 	\
   243       g_slist_remove ((trace)->mem_live, mem); 		\
   251       (trace)->mem_live = 				\
       
   252         g_slist_remove ((trace)->mem_live, mem); 	\
       
   253     g_static_mutex_unlock (&_gst_trace_mutex);          \
       
   254   }                                                     \
       
   255 } G_STMT_END
   244 } G_STMT_END
   256 
   245 
   257 #else
   246 #else
   258 #define	gst_alloc_trace_register(name) (NULL)
   247 #define	gst_alloc_trace_register(name) (NULL)
   259 #define	gst_alloc_trace_new(trace, mem)
   248 #define	gst_alloc_trace_new(trace, mem)