goto ERROR; \
}
-/* pad probe for pipeilne debugging */
-gboolean __util_gst_pad_probe(GstPad *pad, GstBuffer *buffer, gpointer u_data);
-
-#define MM_PROBE_DEFAULT (0)
-#define MM_PROBE_TIMESTAMP (1)
-#define MM_PROBE_BUFFERSIZE (1 << 1)
-#define MM_PROBE_CAPS (1 << 2)
-#define MM_PROBE_BUFFER_DURATION (1 << 3)
-#define MM_PROBE_DROP_BUFFER (1 << 4)
-#define MM_PROBE_CLOCK_TIME (1 << 5)
-/* ... add more */
-
-/* messages are treated as warnings bcz those code should not be checked in.
- * and no error handling will supported for same manner.
- */
-#define MMPLAYER_ADD_PROBE(x_pad, x_flag) \
-debug_warning("adding pad probe\n"); \
-if ( ! gst_pad_add_buffer_probe(x_pad, \
- G_CALLBACK(__util_gst_pad_probe), \
- (gpointer)x_flag) ) \
-{ \
- debug_error("failed to add pad probe\n"); \
-}
-
-
/* generating dot */
#define MMPLAYER_GENERATE_DOT_IF_ENABLED( x_player, x_name ) \
if ( x_player->ini.generate_dot ) \
return util_is_midi_type_by_mem(prefix, size);
}
-/* messages are treated as warnings bcz those code should not be checked in.
- * and no error handling will supported for same manner.
- */
-gboolean
-__util_gst_pad_probe(GstPad *pad, GstBuffer *buffer, gpointer u_data)
-{
- gint flag = (gint) u_data;
- GstElement* parent = NULL;
- GstMapInfo mapinfo = {0, };
- gboolean ret = TRUE;
-
- /* show name as default */
- parent = (GstElement*)gst_object_get_parent(GST_OBJECT(pad));
- debug_log("PAD PROBE : %s:%s\n", GST_ELEMENT_NAME(parent), GST_PAD_NAME(pad));
-
- /* show time stamp */
- if ( flag & MM_PROBE_TIMESTAMP )
- {
- debug_log("ts : %u:%02u:%02u.%09u\n", GST_TIME_ARGS(GST_BUFFER_TIMESTAMP(buffer)));
- }
-
- /* show buffer size */
- gst_buffer_map(buffer, &mapinfo, GST_MAP_READ);
- if ( flag & MM_PROBE_BUFFERSIZE )
- {
- debug_log("buffer size : %ud\n", mapinfo.size);
- }
- gst_buffer_unmap(buffer, &mapinfo);
-
- /* show buffer duration */
- if ( flag & MM_PROBE_BUFFER_DURATION )
- {
- debug_log("dur : %lld\n", GST_BUFFER_DURATION(buffer));
- }
-
- /* show buffer caps */
- if ( flag & MM_PROBE_CAPS )
- {
- MMPLAYER_LOG_GST_CAPS_TYPE(gst_pad_get_current_caps(pad));
- }
-
- /* drop buffer if flag is on */
- if ( flag & MM_PROBE_DROP_BUFFER )
- {
- debug_log("dropping\n");
- ret = FALSE;
- }
-
- /* show clock time */
- if ( flag & MM_PROBE_CLOCK_TIME )
- {
- GstClock* clock = NULL;
- GstClockTime now = GST_CLOCK_TIME_NONE;
-
- clock = GST_ELEMENT_CLOCK ( parent );
-
- if ( clock )
- {
- now = gst_clock_get_time( clock );
- debug_log("clock time : %" GST_TIME_FORMAT "\n", GST_TIME_ARGS( now ));
- }
- }
-
- if ( parent )
- gst_object_unref(parent);
-
- return ret;
-}
-
char**
util_get_cookie_list ( const char *cookies )
{