[MOVED FROM GOOD] sys/directdraw/gstdirectdrawsink.c: Bunch of small fixes: remove static function that doesn't exist; declare another ...

Original commit message from CVS:
* sys/directdraw/gstdirectdrawsink.c: (gst_ddrawsurface_finalize),
(gst_directdraw_sink_buffer_alloc),
(gst_directdraw_sink_get_ddrawcaps),
(gst_directdraw_sink_surface_create):
Bunch of small fixes: remove static function that doesn't exist;
declare another one that does; printf format fix; use right macro
when specifying debug category; remove a bunch of unused variables;
#if 0 out an unused chunk of code (partially fixes #439914).
This commit is contained in:
Tim-Philipp Müller 2007-05-20 14:59:46 +00:00 committed by Jan Schmidt
parent 032eeebb75
commit b7476655fb

View file

@ -99,8 +99,7 @@ static GstCaps
static void gst_directdraw_sink_cleanup (GstDirectDrawSink * ddrawsink);
static void gst_directdraw_sink_bufferpool_clear (GstDirectDrawSink *
ddrawsink);
static void gst_directdraw_sink_ddraw_put (GstDirectDrawSink * ddrawsink,
GstDDrawSurface * surface);
static int gst_directdraw_sink_get_depth (LPDDPIXELFORMAT lpddpfPixelFormat);
static gboolean gst_ddrawvideosink_get_format_from_caps (GstDirectDrawSink *
ddrawsink, GstCaps * caps, DDPIXELFORMAT * pPixelFormat);
static void gst_directdraw_sink_center_rect (GstDirectDrawSink * ddrawsink,
@ -203,7 +202,7 @@ gst_directdraw_sink_init_interfaces (GType type)
}
/* Subclass of GstBuffer which manages buffer_pool surfaces lifetime */
static void gst_ddrawsurface_finalize (GstDDrawSurface * surface);
static void gst_ddrawsurface_finalize (GstMiniObject * mini_object);
static void
gst_ddrawsurface_init (GstDDrawSurface * surface, gpointer g_class)
@ -250,11 +249,12 @@ gst_ddrawsurface_get_type (void)
}
static void
gst_ddrawsurface_finalize (GstDDrawSurface * surface)
gst_ddrawsurface_finalize (GstMiniObject * mini_object)
{
GstDirectDrawSink *ddrawsink = NULL;
GstDDrawSurface *surface;
g_return_if_fail (surface != NULL);
surface = (GstDDrawSurface *) mini_object;
ddrawsink = surface->ddrawsink;
if (!ddrawsink)
@ -288,7 +288,7 @@ gst_ddrawsurface_finalize (GstDDrawSurface * surface)
return;
no_sink:
GST_WARNING (directdrawsink_debug, "no sink found");
GST_CAT_WARNING (directdrawsink_debug, "no sink found");
return;
}
@ -597,7 +597,7 @@ gst_directdraw_sink_buffer_alloc (GstBaseSink * bsink, guint64 offset,
hres = IDirectDraw7_GetDisplayMode (ddrawsink->ddraw_object, &surface_desc);
if (hres != DD_OK) {
GST_CAT_DEBUG_OBJECT (directdrawsink_debug, ddrawsink,
"Can't get current display mode (error=%d)", hres);
"Can't get current display mode (error=%ld)", (glong) hres);
return GST_FLOW_ERROR;
}
@ -1486,9 +1486,6 @@ static GstCaps *
gst_directdraw_sink_get_ddrawcaps (GstDirectDrawSink * ddrawsink)
{
HRESULT hRes = S_OK;
DWORD dwFourccCodeIndex = 0;
LPDWORD pdwFourccCodes = NULL;
DWORD dwNbFourccCodes = 0;
DDCAPS ddcaps_hardware;
DDCAPS ddcaps_emulation;
GstCaps *format_caps = NULL;
@ -1611,7 +1608,7 @@ gst_directdraw_sink_surface_create (GstDirectDrawSink * ddrawsink,
* when a surface memory is locked but we need to disable this lock to return multiple buffers (surfaces)
* and do not lock directdraw API calls.
*/
if (0) {
#if 0
/* if (ddrawsink->ddraw_object) {*/
/* Creating an internal surface which will be used as GstBuffer, we used
the detected pixel format and video dimensions */
@ -1657,7 +1654,8 @@ gst_directdraw_sink_surface_create (GstDirectDrawSink * ddrawsink,
GST_CAT_INFO_OBJECT (directdrawsink_debug, ddrawsink,
"allocating a surface of %d bytes (stride=%ld)\n", size,
surf_lock_desc.lPitch);
} else {
#else
surface_pitch_bad:
GST_BUFFER (surface)->malloc_data = g_malloc (size);
@ -1666,7 +1664,8 @@ gst_directdraw_sink_surface_create (GstDirectDrawSink * ddrawsink,
surface->surface = NULL;
GST_CAT_INFO_OBJECT (directdrawsink_debug, ddrawsink,
"allocating a system memory buffer of %d bytes", size);
}
#endif
/* Keep a ref to our sink */
surface->ddrawsink = gst_object_ref (ddrawsink);