diff options
author | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2012-06-10 14:29:58 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2012-06-10 14:30:51 +0100 |
commit | c372f2c88cc4cfd0cb9a8fab715dad55b9eb2405 (patch) | |
tree | de79d1f1e27d878632871dd3f013f0d4c2b8a4fb /gst | |
parent | 126df2548ded01f33ce2a489b6bf6f8d117c19ef (diff) |
dvdspu: allow debugging of render and highlight rectangles via environment variable
Enable debugging of rectangles via GST_DVD_SPU_DEBUG.
https://bugzilla.gnome.org/show_bug.cgi?id=667223
Diffstat (limited to 'gst')
-rw-r--r-- | gst/dvdspu/gstdvdspu.c | 15 | ||||
-rw-r--r-- | gst/dvdspu/gstdvdspu.h | 8 | ||||
-rw-r--r-- | gst/dvdspu/gstspu-vobsub-render.c | 8 |
3 files changed, 27 insertions, 4 deletions
diff --git a/gst/dvdspu/gstdvdspu.c b/gst/dvdspu/gstdvdspu.c index 94e69be86..4bb9b205f 100644 --- a/gst/dvdspu/gstdvdspu.c +++ b/gst/dvdspu/gstdvdspu.c @@ -48,6 +48,8 @@ GST_DEBUG_CATEGORY (dvdspu_debug); #define GST_CAT_DEFAULT dvdspu_debug +GstDVDSPUDebugFlags dvdspu_debug_flags; + /* Filter signals and args */ enum { @@ -1173,9 +1175,22 @@ gst_dvd_spu_change_state (GstElement * element, GstStateChange transition) static gboolean gst_dvd_spu_plugin_init (GstPlugin * plugin) { + const gchar *env; + GST_DEBUG_CATEGORY_INIT (dvdspu_debug, "gstspu", 0, "Sub-picture Overlay decoder/renderer"); + env = g_getenv ("GST_DVD_SPU_DEBUG"); + + dvdspu_debug_flags = 0; + if (env != NULL) { + if (strstr (env, "render-rectangle") != NULL) + dvdspu_debug_flags |= GST_DVD_SPU_DEBUG_RENDER_RECTANGLE; + if (strstr (env, "highlight-rectangle") != NULL) + dvdspu_debug_flags |= GST_DVD_SPU_DEBUG_HIGHLIGHT_RECTANGLE; + } + GST_INFO ("debug flags : 0x%02x", dvdspu_debug_flags); + return gst_element_register (plugin, "dvdspu", GST_RANK_PRIMARY, GST_TYPE_DVD_SPU); } diff --git a/gst/dvdspu/gstdvdspu.h b/gst/dvdspu/gstdvdspu.h index 22b48d1da..f2ae1b62c 100644 --- a/gst/dvdspu/gstdvdspu.h +++ b/gst/dvdspu/gstdvdspu.h @@ -127,6 +127,14 @@ struct _GstDVDSpuClass { GType gst_dvd_spu_get_type (void); +typedef enum { + GST_DVD_SPU_DEBUG_RENDER_RECTANGLE = (1 << 0), + GST_DVD_SPU_DEBUG_HIGHLIGHT_RECTANGLE = (1 << 1) +} GstDVDSPUDebugFlags; + +extern GstDVDSPUDebugFlags dvdspu_debug_flags; + + G_END_DECLS #endif /* __GST_DVD_SPU_H__ */ diff --git a/gst/dvdspu/gstspu-vobsub-render.c b/gst/dvdspu/gstspu-vobsub-render.c index 5174b15ab..c8022975a 100644 --- a/gst/dvdspu/gstspu-vobsub-render.c +++ b/gst/dvdspu/gstspu-vobsub-render.c @@ -384,8 +384,7 @@ gstspu_vobsub_clear_comp_buffers (SpuState * state) } static void -gstspu_vobsub_draw_highlight (SpuState * state, - GstBuffer * buf, SpuRect *rect) +gstspu_vobsub_draw_highlight (SpuState * state, GstBuffer * buf, SpuRect * rect) { guint8 *cur; gint16 pos; @@ -584,11 +583,12 @@ gstspu_vobsub_render (GstDVDSpu * dvdspu, GstBuffer * buf) } /* for debugging purposes, draw a faint rectangle at the edges of the disp_rect */ - if (FALSE) { + if ((dvdspu_debug_flags & GST_DVD_SPU_DEBUG_RENDER_RECTANGLE) != 0) { gstspu_vobsub_draw_highlight (state, buf, &state->vobsub.disp_rect); } /* For debugging purposes, draw a faint rectangle around the highlight rect */ - if (FALSE && state->vobsub.hl_rect.top != -1) { + if ((dvdspu_debug_flags & GST_DVD_SPU_DEBUG_HIGHLIGHT_RECTANGLE) != 0 + && state->vobsub.hl_rect.top != -1) { gstspu_vobsub_draw_highlight (state, buf, &state->vobsub.hl_rect); } } |