GST_DEBUG_CATEGORY (dvdspu_debug);
#define GST_CAT_DEFAULT dvdspu_debug
+GstDVDSPUDebugFlags dvdspu_debug_flags;
+
/* Filter signals and args */
enum
{
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);
}
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__ */
}
/* 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, frame, &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, frame, &state->vobsub.hl_rect);
}
}