mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 00:31:13 +00:00
dfbvideosink: Also consider non-accelerated DirectFB surfaces
Fixes bug #631390.
This commit is contained in:
parent
d536b73e25
commit
8f7183dc85
1 changed files with 48 additions and 37 deletions
|
@ -998,7 +998,7 @@ beach:
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_dfbvideosink_can_blit_from_format (GstDfbVideoSink * dfbvideosink,
|
gst_dfbvideosink_can_blit_from_format (GstDfbVideoSink * dfbvideosink,
|
||||||
DFBSurfacePixelFormat format)
|
DFBSurfacePixelFormat format, gboolean accelerated)
|
||||||
{
|
{
|
||||||
gboolean res = FALSE;
|
gboolean res = FALSE;
|
||||||
DFBResult ret;
|
DFBResult ret;
|
||||||
|
@ -1058,14 +1058,14 @@ gst_dfbvideosink_can_blit_from_format (GstDfbVideoSink * dfbvideosink,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Blitting from this format to our primary is accelerated */
|
/* Blitting from this format to our primary is accelerated */
|
||||||
if (mask & DFXL_BLIT) {
|
if ((mask & DFXL_BLIT) && accelerated) {
|
||||||
GST_DEBUG_OBJECT (dfbvideosink, "blitting from format %s to our primary "
|
GST_DEBUG_OBJECT (dfbvideosink, "blitting from format %s to our primary "
|
||||||
"is accelerated", gst_dfbvideosink_get_format_name (format));
|
"is accelerated", gst_dfbvideosink_get_format_name (format));
|
||||||
res = TRUE;
|
res = TRUE;
|
||||||
} else {
|
} else if (!accelerated) {
|
||||||
GST_DEBUG_OBJECT (dfbvideosink, "blitting from format %s to our primary "
|
GST_DEBUG_OBJECT (dfbvideosink, "blitting from format %s to our primary "
|
||||||
"is not accelerated", gst_dfbvideosink_get_format_name (format));
|
"is not accelerated", gst_dfbvideosink_get_format_name (format));
|
||||||
res = FALSE;
|
res = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Restore original layer configuration */
|
/* Restore original layer configuration */
|
||||||
|
@ -1165,41 +1165,52 @@ gst_dfbvideosink_getcaps (GstBaseSink * bsink)
|
||||||
caps = gst_dfbvideosink_get_caps_from_format (dfbvideosink->pixel_format);
|
caps = gst_dfbvideosink_get_caps_from_format (dfbvideosink->pixel_format);
|
||||||
} else {
|
} else {
|
||||||
/* Try some formats */
|
/* Try some formats */
|
||||||
|
gboolean accelerated = TRUE;
|
||||||
caps = gst_caps_new_empty ();
|
caps = gst_caps_new_empty ();
|
||||||
|
|
||||||
if (gst_dfbvideosink_can_blit_from_format (dfbvideosink, DSPF_RGB16)) {
|
do {
|
||||||
gst_caps_append (caps,
|
if (gst_dfbvideosink_can_blit_from_format (dfbvideosink, DSPF_RGB16,
|
||||||
gst_dfbvideosink_get_caps_from_format (DSPF_RGB16));
|
accelerated)) {
|
||||||
}
|
gst_caps_append (caps,
|
||||||
if (gst_dfbvideosink_can_blit_from_format (dfbvideosink, DSPF_RGB24)) {
|
gst_dfbvideosink_get_caps_from_format (DSPF_RGB16));
|
||||||
gst_caps_append (caps,
|
}
|
||||||
gst_dfbvideosink_get_caps_from_format (DSPF_RGB24));
|
if (gst_dfbvideosink_can_blit_from_format (dfbvideosink, DSPF_RGB24,
|
||||||
}
|
accelerated)) {
|
||||||
/* There's something wrong with RGB32, ffmpegcolorspace ?
|
gst_caps_append (caps,
|
||||||
if (gst_dfbvideosink_can_blit_from_format (dfbvideosink, DSPF_RGB32)) {
|
gst_dfbvideosink_get_caps_from_format (DSPF_RGB24));
|
||||||
gst_caps_append (caps,
|
}
|
||||||
gst_dfbvideosink_get_caps_from_format (DSPF_RGB32));
|
if (gst_dfbvideosink_can_blit_from_format (dfbvideosink, DSPF_RGB32,
|
||||||
} */
|
accelerated)) {
|
||||||
if (gst_dfbvideosink_can_blit_from_format (dfbvideosink, DSPF_ARGB)) {
|
gst_caps_append (caps,
|
||||||
gst_caps_append (caps,
|
gst_dfbvideosink_get_caps_from_format (DSPF_RGB32));
|
||||||
gst_dfbvideosink_get_caps_from_format (DSPF_ARGB));
|
}
|
||||||
}
|
if (gst_dfbvideosink_can_blit_from_format (dfbvideosink, DSPF_ARGB,
|
||||||
if (gst_dfbvideosink_can_blit_from_format (dfbvideosink, DSPF_YUY2)) {
|
accelerated)) {
|
||||||
gst_caps_append (caps,
|
gst_caps_append (caps,
|
||||||
gst_dfbvideosink_get_caps_from_format (DSPF_YUY2));
|
gst_dfbvideosink_get_caps_from_format (DSPF_ARGB));
|
||||||
}
|
}
|
||||||
if (gst_dfbvideosink_can_blit_from_format (dfbvideosink, DSPF_UYVY)) {
|
if (gst_dfbvideosink_can_blit_from_format (dfbvideosink, DSPF_YUY2,
|
||||||
gst_caps_append (caps,
|
accelerated)) {
|
||||||
gst_dfbvideosink_get_caps_from_format (DSPF_UYVY));
|
gst_caps_append (caps,
|
||||||
}
|
gst_dfbvideosink_get_caps_from_format (DSPF_YUY2));
|
||||||
if (gst_dfbvideosink_can_blit_from_format (dfbvideosink, DSPF_I420)) {
|
}
|
||||||
gst_caps_append (caps,
|
if (gst_dfbvideosink_can_blit_from_format (dfbvideosink, DSPF_UYVY,
|
||||||
gst_dfbvideosink_get_caps_from_format (DSPF_I420));
|
accelerated)) {
|
||||||
}
|
gst_caps_append (caps,
|
||||||
if (gst_dfbvideosink_can_blit_from_format (dfbvideosink, DSPF_YV12)) {
|
gst_dfbvideosink_get_caps_from_format (DSPF_UYVY));
|
||||||
gst_caps_append (caps,
|
}
|
||||||
gst_dfbvideosink_get_caps_from_format (DSPF_YV12));
|
if (gst_dfbvideosink_can_blit_from_format (dfbvideosink, DSPF_I420,
|
||||||
}
|
accelerated)) {
|
||||||
|
gst_caps_append (caps,
|
||||||
|
gst_dfbvideosink_get_caps_from_format (DSPF_I420));
|
||||||
|
}
|
||||||
|
if (gst_dfbvideosink_can_blit_from_format (dfbvideosink, DSPF_YV12,
|
||||||
|
accelerated)) {
|
||||||
|
gst_caps_append (caps,
|
||||||
|
gst_dfbvideosink_get_caps_from_format (DSPF_YV12));
|
||||||
|
}
|
||||||
|
accelerated = !accelerated;
|
||||||
|
} while (accelerated == FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue