mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
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:
parent
4e627c3e0d
commit
b7e82b27be
3 changed files with 26 additions and 2 deletions
|
@ -48,6 +48,8 @@
|
||||||
GST_DEBUG_CATEGORY (dvdspu_debug);
|
GST_DEBUG_CATEGORY (dvdspu_debug);
|
||||||
#define GST_CAT_DEFAULT dvdspu_debug
|
#define GST_CAT_DEFAULT dvdspu_debug
|
||||||
|
|
||||||
|
GstDVDSPUDebugFlags dvdspu_debug_flags;
|
||||||
|
|
||||||
/* Filter signals and args */
|
/* Filter signals and args */
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
|
@ -1201,9 +1203,22 @@ gst_dvd_spu_change_state (GstElement * element, GstStateChange transition)
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_dvd_spu_plugin_init (GstPlugin * plugin)
|
gst_dvd_spu_plugin_init (GstPlugin * plugin)
|
||||||
{
|
{
|
||||||
|
const gchar *env;
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_INIT (dvdspu_debug, "gstspu",
|
GST_DEBUG_CATEGORY_INIT (dvdspu_debug, "gstspu",
|
||||||
0, "Sub-picture Overlay decoder/renderer");
|
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",
|
return gst_element_register (plugin, "dvdspu",
|
||||||
GST_RANK_PRIMARY, GST_TYPE_DVD_SPU);
|
GST_RANK_PRIMARY, GST_TYPE_DVD_SPU);
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,6 +124,14 @@ struct _GstDVDSpuClass {
|
||||||
|
|
||||||
GType gst_dvd_spu_get_type (void);
|
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
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GST_DVD_SPU_H__ */
|
#endif /* __GST_DVD_SPU_H__ */
|
||||||
|
|
|
@ -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 */
|
/* 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);
|
gstspu_vobsub_draw_highlight (state, frame, &state->vobsub.disp_rect);
|
||||||
}
|
}
|
||||||
/* For debugging purposes, draw a faint rectangle around the highlight 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);
|
gstspu_vobsub_draw_highlight (state, frame, &state->vobsub.hl_rect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue