[gstreamer-bugs] [Bug 503743] the dfbvideosink does not handle external surface correctly

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Sun Dec 16 04:49:45 PST 2007


If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=503743

  GStreamer | gst-plugins-bad | Ver: 0.10.4




------- Comment #1 from Huimin He  2007-12-16 12:49 UTC -------
Hi,

I just do a simple change,hope this info can help you.

here are the diff results:
100,101d99
< #define HHM_TEST
780,858d773
< #ifdef HHM_TEST
< 
<     if (!dfbvideosink->dfb) {
<       DFBGraphicsDeviceDescription hw_caps;
< 
<       GST_DEBUG_OBJECT (dfbvideosink, "initializing DirectFB");
< 
<       ret = DirectFBInit (0, NULL);
< 
<       if (ret != DFB_OK) {
<         GST_WARNING_OBJECT (dfbvideosink, "DirectFB initialization failed");
<         goto beach;
<       }
< 
<       ret = DirectFBCreate (&(dfbvideosink->dfb));
< 
<       if (ret != DFB_OK) {
<         GST_WARNING_OBJECT (dfbvideosink, "failed creating the DirectFB "
<             "main object");
<         goto beach;
<       }
< 
<             /* Get Hardware capabilities */
<       ret = dfbvideosink->dfb->GetDeviceDescription (dfbvideosink->dfb,
<           &hw_caps);
< 
<       if (ret != DFB_OK) {
<         GST_WARNING_OBJECT (dfbvideosink, "failed grabbing the hardware "
<             "capabilities");
<         goto beach;
<       }
< 
<       GST_DEBUG_OBJECT (dfbvideosink, "video card %s from vendor %s detected
"
<           "with %d bytes of video memory", hw_caps.name, hw_caps.vendor,
<           hw_caps.video_memory);
< 
<       if (hw_caps.acceleration_mask & DFXL_BLIT) {
<         GST_DEBUG_OBJECT (dfbvideosink, "Blit is accelerated");
<       }
<       if (hw_caps.acceleration_mask & DFXL_STRETCHBLIT) {
<         GST_DEBUG_OBJECT (dfbvideosink, "StretchBlit is accelerated");
<         dfbvideosink->hw_scaling = TRUE;
<       } else {
<         GST_DEBUG_OBJECT (dfbvideosink, "StretchBlit is not accelerated");
<         dfbvideosink->hw_scaling = FALSE;
<       }
< 
<       dfbvideosink->layer_id = -1;
< 
<       /* Inspect all the Display layers */
<       dfbvideosink->dfb->EnumDisplayLayers (dfbvideosink->dfb,
<           gst_dfbvideosink_enum_layers, dfbvideosink);
<       /* Inspect all Video modes */
<       dfbvideosink->dfb->EnumVideoModes (dfbvideosink->dfb,
<           gst_dfbvideosink_enum_vmodes, dfbvideosink);
< 
< 
<      if (!dfbvideosink->layer) {
<       GList *channels_list = NULL;
<       DFBDisplayLayerDescription dl_desc;
< 
<       /* Get the best Display Layer */
<       ret = dfbvideosink->dfb->GetDisplayLayer (dfbvideosink->dfb,
<           dfbvideosink->layer_id, &dfbvideosink->layer);
<       if (ret != DFB_OK) {
<         GST_WARNING_OBJECT (dfbvideosink, "failed getting display layer");
<         goto beach;
<       }
< 
<       ret = dfbvideosink->layer->SetCooperativeLevel (dfbvideosink->layer,
<           DFSCL_NORMAL);
< 
<       if (ret != DFB_OK) {
<         GST_WARNING_OBJECT (dfbvideosink, "failed setting display layer to "
<             "fullscreen mode");
<         goto beach;
<       }
< 
<       dfbvideosink->layer->GetDescription (dfbvideosink->layer, &dl_desc);
860,943d774
<       /* Check that this layer is able to do colorbalance settings */
<       if (dl_desc.caps & DLCAPS_BRIGHTNESS) {
<         channels_list = g_list_append (channels_list, "BRIGHTNESS");
<       }
<       if (dl_desc.caps & DLCAPS_CONTRAST) {
<         channels_list = g_list_append (channels_list, "CONTRAST");
<       }
<       if (dl_desc.caps & DLCAPS_HUE) {
<         channels_list = g_list_append (channels_list, "HUE");
<       }
<       if (dl_desc.caps & DLCAPS_SATURATION) {
<         channels_list = g_list_append (channels_list, "SATURATION");
<       }
< 
<       if (channels_list) {
<         GList *walk = channels_list;
< 
<         /* Generate Color balance channel list */
<         while (walk) {
<           GstColorBalanceChannel *channel = NULL;
< 
<           GST_DEBUG_OBJECT (dfbvideosink, "adding %s as a colorbalance
channel",
<               walk->data);
< 
<           channel = g_object_new (GST_TYPE_COLOR_BALANCE_CHANNEL, NULL);
<           channel->label = g_strdup (walk->data);
<           channel->min_value = 0x0000;
<           channel->max_value = 0xFFFF;
< 
<           dfbvideosink->cb_channels = g_list_append
(dfbvideosink->cb_channels,
<               channel);
< 
<           walk = g_list_next (walk);
<         }
< 
<         /* If the colorbalance settings have not been touched we get current
<            values as defaults and update our internal variables */
<         if (!dfbvideosink->cb_changed) {
<           DFBColorAdjustment cb_adjust;
< 
<           ret = dfbvideosink->layer->GetColorAdjustment (dfbvideosink->layer,
<               &cb_adjust);
< 
<           if (ret != DFB_OK) {
<             GST_WARNING_OBJECT (dfbvideosink, "failed when getting color "
<                 "adjustment from layer");
<           }
< 
<           if (cb_adjust.flags & DCAF_BRIGHTNESS) {
<             dfbvideosink->brightness = cb_adjust.brightness;
<           } else {
<             dfbvideosink->brightness = 0x8000;
<           }
<           if (cb_adjust.flags & DCAF_CONTRAST) {
<             dfbvideosink->contrast = cb_adjust.contrast;
<           } else {
<             dfbvideosink->contrast = 0x8000;
<           }
<           if (cb_adjust.flags & DCAF_HUE) {
<             dfbvideosink->hue = cb_adjust.hue;
<           } else {
<             dfbvideosink->hue = 0x8000;
<           }
<           if (cb_adjust.flags & DCAF_SATURATION) {
<             dfbvideosink->saturation = cb_adjust.saturation;
<           } else {
<             dfbvideosink->saturation = 0x8000;
<           }
<           GST_DEBUG_OBJECT (dfbvideosink, "brightness %d, contrast %d, "
<               "hue %d, saturation %d", dfbvideosink->brightness,
<               dfbvideosink->contrast, dfbvideosink->hue,
<               dfbvideosink->saturation);
<         }
< 
<         g_list_free (channels_list);
< 
<         gst_dfbvideosink_update_colorbalance (dfbvideosink);
<       }
< 
<       dfbvideosink->layer->SetBackgroundColor (dfbvideosink->layer,
<           0x00, 0x00, 0x00, 0xFF);
<         }
<         }
< #endif
1809,1813d1639
< #ifdef HHM_TEST
< if (dfbvideosink ->ext_surface)
< {
<     GST_DEBUG_OBJECT (dfbvideosink, "blitting to a External surface (vsync
%d)",
<         dfbvideosink->vsync);
1815,1858d1640
<     src.w = GST_VIDEO_SINK_WIDTH (dfbvideosink);
<     src.h = GST_VIDEO_SINK_HEIGHT (dfbvideosink);
< 
<     dfbvideosink->ext_surface->GetSize (dfbvideosink->ext_surface, &dst.w,
&dst.h);
< 
<     /* Unlocking surface before blit */
<     if (surface->locked) {
<       surface->surface->Unlock (surface->surface);
<       surface->locked = FALSE;
<     }
< 
<     gst_video_sink_center_rect (src, dst, &result, dfbvideosink->hw_scaling);
< 
<     /* If we are not using Flip we wait for VSYNC before blit */
<     if (!dfbvideosink->backbuffer && dfbvideosink->vsync) {
<       dfbvideosink->layer->WaitForSync (dfbvideosink->layer);
<     }
< 
< dfbvideosink->ext_surface->Clear(dfbvideosink->ext_surface,
0x00,0x00,0x00,0x00);
< 
<     if (dfbvideosink->hw_scaling) {
<       dfbvideosink->ext_surface->StretchBlit (dfbvideosink->ext_surface,
<           surface->surface, NULL, (DFBRectangle *) & result);
<     } else {
<       DFBRectangle clip;
< 
<       clip.x = clip.y = 0;
<       clip.w = result.w;
<       clip.h = result.h;
<       dfbvideosink->ext_surface->Blit (dfbvideosink->ext_surface,
surface->surface,
<           &clip, result.x, result.y);
<     }
< 
<     if (dfbvideosink->backbuffer) {
<       if (dfbvideosink->vsync) {
<         dfbvideosink->ext_surface->Flip (dfbvideosink->ext_surface, NULL,
<             DSFLIP_ONSYNC);
<       } else {
<         dfbvideosink->ext_surface->Flip (dfbvideosink->ext_surface, NULL,
DSFLIP_NONE);
<       }
<     }
<     goto beach;
< }
< #endif


-- 
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=503743.




More information about the Gstreamer-bugs mailing list