summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authorJulien Moutte <julien@moutte.net>2005-12-16 14:47:59 +0000
committerJulien Moutte <julien@moutte.net>2005-12-16 14:47:59 +0000
commit16c5bb7972229922980c3de23a664e0b8872ca5a (patch)
treec0c8f3293635932e3aa80c61fd920379fcb15f30 /ext
parent09a66d6dce83348e095fb5e22dd9c44a6a724cdc (diff)
downloadgst-plugins-bad-16c5bb7972229922980c3de23a664e0b8872ca5a.tar.gz
gst-plugins-bad-16c5bb7972229922980c3de23a664e0b8872ca5a.tar.bz2
gst-plugins-bad-16c5bb7972229922980c3de23a664e0b8872ca5a.zip
ext/directfb/dfbvideosink.c: Always prefer the primary layer.
Original commit message from CVS: 2005-12-16 Julien MOUTTE <julien@moutte.net> * ext/directfb/dfbvideosink.c: (gst_dfbvideosink_enum_layers), (gst_dfbvideosink_init): Always prefer the primary layer.
Diffstat (limited to 'ext')
-rw-r--r--ext/directfb/dfbvideosink.c39
1 files changed, 25 insertions, 14 deletions
diff --git a/ext/directfb/dfbvideosink.c b/ext/directfb/dfbvideosink.c
index 9f9e527d..23f23ba1 100644
--- a/ext/directfb/dfbvideosink.c
+++ b/ext/directfb/dfbvideosink.c
@@ -367,50 +367,61 @@ gst_dfbvideosink_enum_layers (DFBDisplayLayerID id,
dfbvideosink = GST_DFBVIDEOSINK (data);
- GST_DEBUG ("inspecting display layer %d with name: %s", id, desc.name);
+ GST_DEBUG_OBJECT (dfbvideosink, "inspecting display layer %d with name: %s",
+ id, desc.name);
if ((desc.type & DLTF_VIDEO) && (desc.caps & DLCAPS_SURFACE)) {
- GST_DEBUG ("this layer can handle live video and has a surface");
- goto beach; /* It seems that kind of overlay is not very well supported */
+ GST_DEBUG_OBJECT (dfbvideosink,
+ "this layer can handle live video and has a surface");
} else {
if (desc.caps & DLCAPS_SURFACE) {
- GST_DEBUG ("this layer can not handle live video but has a surface");
+ GST_DEBUG_OBJECT (dfbvideosink,
+ "this layer can not handle live video but has a surface");
} else {
- GST_DEBUG ("no we can't use that layer, really...");
+ GST_DEBUG_OBJECT (dfbvideosink, "no we can't use that layer, really...");
goto beach;
}
}
ret = dfbvideosink->dfb->GetDisplayLayer (dfbvideosink->dfb, id, &layer);
if (ret != DFB_OK) {
- GST_WARNING ("failed getting display layer %s", desc.name);
+ GST_WARNING_OBJECT (dfbvideosink, "failed getting display layer %s",
+ desc.name);
goto beach;
}
ret = layer->GetConfiguration (layer, &dlc);
if (ret != DFB_OK) {
- GST_WARNING ("failed getting display layer configuration");
+ GST_WARNING_OBJECT (dfbvideosink,
+ "failed getting display layer configuration");
goto beach;
}
if ((dlc.flags & DLCONF_BUFFERMODE) && (dlc.buffermode & DLBM_FRONTONLY)) {
- GST_DEBUG ("no backbuffer");
+ GST_DEBUG_OBJECT (dfbvideosink, "no backbuffer");
}
if ((dlc.flags & DLCONF_BUFFERMODE) && (dlc.buffermode & DLBM_BACKVIDEO)) {
- GST_DEBUG ("backbuffer is in video memory");
+ GST_DEBUG_OBJECT (dfbvideosink, "backbuffer is in video memory");
backbuffer = TRUE;
}
if ((dlc.flags & DLCONF_BUFFERMODE) && (dlc.buffermode & DLBM_BACKSYSTEM)) {
- GST_DEBUG ("backbuffer is in system memory");
+ GST_DEBUG_OBJECT (dfbvideosink, "backbuffer is in system memory");
backbuffer = TRUE;
}
if ((dlc.flags & DLCONF_BUFFERMODE) && (dlc.buffermode & DLBM_TRIPLE)) {
- GST_DEBUG ("triple buffering");
+ GST_DEBUG_OBJECT (dfbvideosink, "triple buffering");
backbuffer = TRUE;
}
- dfbvideosink->backbuffer = backbuffer;
- dfbvideosink->layer_id = id;
+ /* If the primary is suitable we prefer using it */
+ if (dfbvideosink->layer_id != DLID_PRIMARY) {
+ GST_DEBUG_OBJECT (dfbvideosink, "selecting layer named %s", desc.name);
+ dfbvideosink->layer_id = id;
+ dfbvideosink->backbuffer = backbuffer;
+ } else {
+ GST_DEBUG_OBJECT (dfbvideosink, "layer %s is suitable but the primary "
+ "is currently selected and we prefer that one", desc.name);
+ }
beach:
if (layer) {
@@ -1760,7 +1771,7 @@ gst_dfbvideosink_init (GstDfbVideoSink * dfbvideosink)
dfbvideosink->dfb = NULL;
dfbvideosink->vmodes = NULL;
- dfbvideosink->layer_id = 0;
+ dfbvideosink->layer_id = -1;
dfbvideosink->layer = NULL;
dfbvideosink->primary = NULL;
dfbvideosink->event_buffer = NULL;