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

Conflicts:

	gst/dvdspu/gstspu-vobsub-render.c
This commit is contained in:
Tim-Philipp Müller 2012-06-10 14:29:58 +01:00 committed by Sebastian Dröge
parent 4e627c3e0d
commit b7e82b27be
3 changed files with 26 additions and 2 deletions

View file

@ -48,6 +48,8 @@
GST_DEBUG_CATEGORY (dvdspu_debug);
#define GST_CAT_DEFAULT dvdspu_debug
GstDVDSPUDebugFlags dvdspu_debug_flags;
/* Filter signals and args */
enum
{
@ -1201,9 +1203,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);
}

View file

@ -124,6 +124,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__ */

View file

@ -591,11 +591,12 @@ gstspu_vobsub_render (GstDVDSpu * dvdspu, GstVideoFrame * frame)
}
/* 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);
}
}