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