+2005-11-05 Julien MOUTTE <julien@moutte.net>
+
+ * ext/directfb/dfbvideosink.c: (gst_dfbvideosink_enum_layers),
+ (gst_dfbvideosink_setup), (gst_dfbvideosink_can_blit_from_format),
+ (gst_dfbvideosink_getcaps): Make acceleration detection work,
+ better, add safety checks and ARGB support for cards that
+ support it.
+
2005-11-04 Julien MOUTTE <julien@moutte.net>
* ext/directfb/dfbvideosink.c: (gst_dfbvideosink_surface_create),
GST_DEBUG ("getting primary surface");
dfbvideosink->layer->GetSurface (dfbvideosink->layer,
&dfbvideosink->primary);
+
+ dfbvideosink->primary->SetBlittingFlags (dfbvideosink->primary,
+ DSBLIT_NOFX);
}
dfbvideosink->primary->GetPixelFormat (dfbvideosink->primary,
IDirectFBSurface *surface = NULL;
DFBSurfaceDescription s_dsc;
DFBAccelerationMask mask;
- DFBDisplayLayerConfig dlc;
+ DFBDisplayLayerConfig dlc, prev_dlc;
g_return_val_if_fail (GST_IS_DFBVIDEOSINK (dfbvideosink), FALSE);
/* Create a surface of desired format */
s_dsc.flags = DSDESC_PIXELFORMAT | DSDESC_WIDTH | DSDESC_HEIGHT;
s_dsc.pixelformat = format;
- s_dsc.width = 1;
- s_dsc.height = 1;
+ s_dsc.width = 10;
+ s_dsc.height = 10;
ret = dfbvideosink->dfb->CreateSurface (dfbvideosink->dfb, &s_dsc, &surface);
if (ret != DFB_OK) {
goto beach;
}
+ /* Backup layer configuration */
+ ret = dfbvideosink->layer->GetConfiguration (dfbvideosink->layer, &prev_dlc);
+ if (ret != DFB_OK) {
+ GST_WARNING ("failed when getting current layer configuration");
+ goto beach;
+ }
+
/* Test configuration of the layer to this pixel format */
dlc.flags = DLCONF_PIXELFORMAT;
dlc.pixelformat = format;
} else {
GST_DEBUG ("blitting from format %s to our primary is not accelerated",
gst_dfbvideosink_get_format_name (format));
- res = TRUE;
+ res = FALSE;
+ }
+
+ /* Restore original layer configuration */
+ ret = dfbvideosink->layer->SetConfiguration (dfbvideosink->layer, &prev_dlc);
+ if (ret != DFB_OK) {
+ GST_WARNING ("failed when restoring layer configuration");
+ goto beach;
}
beach:
gst_caps_append (caps,
gst_dfbvideosink_get_caps_from_format (DSPF_RGB24));
}
+ /* There's something wrong with RGB32, ffmpegcolorspace ?
+ if (gst_dfbvideosink_can_blit_from_format (dfbvideosink, DSPF_RGB32)) {
+ gst_caps_append (caps,
+ gst_dfbvideosink_get_caps_from_format (DSPF_RGB32));
+ } */
+ if (gst_dfbvideosink_can_blit_from_format (dfbvideosink, DSPF_ARGB)) {
+ gst_caps_append (caps,
+ gst_dfbvideosink_get_caps_from_format (DSPF_ARGB));
+ }
if (gst_dfbvideosink_can_blit_from_format (dfbvideosink, DSPF_YUY2)) {
gst_caps_append (caps,
gst_dfbvideosink_get_caps_from_format (DSPF_YUY2));