mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 23:06:49 +00:00
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:
parent
798b78630f
commit
fa055153aa
1 changed files with 61 additions and 62 deletions
|
@ -99,8 +99,7 @@ static GstCaps
|
||||||
static void gst_directdraw_sink_cleanup (GstDirectDrawSink * ddrawsink);
|
static void gst_directdraw_sink_cleanup (GstDirectDrawSink * ddrawsink);
|
||||||
static void gst_directdraw_sink_bufferpool_clear (GstDirectDrawSink *
|
static void gst_directdraw_sink_bufferpool_clear (GstDirectDrawSink *
|
||||||
ddrawsink);
|
ddrawsink);
|
||||||
static void gst_directdraw_sink_ddraw_put (GstDirectDrawSink * ddrawsink,
|
static int gst_directdraw_sink_get_depth (LPDDPIXELFORMAT lpddpfPixelFormat);
|
||||||
GstDDrawSurface * surface);
|
|
||||||
static gboolean gst_ddrawvideosink_get_format_from_caps (GstDirectDrawSink *
|
static gboolean gst_ddrawvideosink_get_format_from_caps (GstDirectDrawSink *
|
||||||
ddrawsink, GstCaps * caps, DDPIXELFORMAT * pPixelFormat);
|
ddrawsink, GstCaps * caps, DDPIXELFORMAT * pPixelFormat);
|
||||||
static void gst_directdraw_sink_center_rect (GstDirectDrawSink * ddrawsink,
|
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 */
|
/* 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
|
static void
|
||||||
gst_ddrawsurface_init (GstDDrawSurface * surface, gpointer g_class)
|
gst_ddrawsurface_init (GstDDrawSurface * surface, gpointer g_class)
|
||||||
|
@ -250,11 +249,12 @@ gst_ddrawsurface_get_type (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_ddrawsurface_finalize (GstDDrawSurface * surface)
|
gst_ddrawsurface_finalize (GstMiniObject * mini_object)
|
||||||
{
|
{
|
||||||
GstDirectDrawSink *ddrawsink = NULL;
|
GstDirectDrawSink *ddrawsink = NULL;
|
||||||
|
GstDDrawSurface *surface;
|
||||||
|
|
||||||
g_return_if_fail (surface != NULL);
|
surface = (GstDDrawSurface *) mini_object;
|
||||||
|
|
||||||
ddrawsink = surface->ddrawsink;
|
ddrawsink = surface->ddrawsink;
|
||||||
if (!ddrawsink)
|
if (!ddrawsink)
|
||||||
|
@ -288,7 +288,7 @@ gst_ddrawsurface_finalize (GstDDrawSurface * surface)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
no_sink:
|
no_sink:
|
||||||
GST_WARNING (directdrawsink_debug, "no sink found");
|
GST_CAT_WARNING (directdrawsink_debug, "no sink found");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -597,7 +597,7 @@ gst_directdraw_sink_buffer_alloc (GstBaseSink * bsink, guint64 offset,
|
||||||
hres = IDirectDraw7_GetDisplayMode (ddrawsink->ddraw_object, &surface_desc);
|
hres = IDirectDraw7_GetDisplayMode (ddrawsink->ddraw_object, &surface_desc);
|
||||||
if (hres != DD_OK) {
|
if (hres != DD_OK) {
|
||||||
GST_CAT_DEBUG_OBJECT (directdrawsink_debug, ddrawsink,
|
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;
|
return GST_FLOW_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1486,9 +1486,6 @@ static GstCaps *
|
||||||
gst_directdraw_sink_get_ddrawcaps (GstDirectDrawSink * ddrawsink)
|
gst_directdraw_sink_get_ddrawcaps (GstDirectDrawSink * ddrawsink)
|
||||||
{
|
{
|
||||||
HRESULT hRes = S_OK;
|
HRESULT hRes = S_OK;
|
||||||
DWORD dwFourccCodeIndex = 0;
|
|
||||||
LPDWORD pdwFourccCodes = NULL;
|
|
||||||
DWORD dwNbFourccCodes = 0;
|
|
||||||
DDCAPS ddcaps_hardware;
|
DDCAPS ddcaps_hardware;
|
||||||
DDCAPS ddcaps_emulation;
|
DDCAPS ddcaps_emulation;
|
||||||
GstCaps *format_caps = NULL;
|
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)
|
* 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.
|
* and do not lock directdraw API calls.
|
||||||
*/
|
*/
|
||||||
if (0) {
|
#if 0
|
||||||
/* if (ddrawsink->ddraw_object) {*/
|
/* if (ddrawsink->ddraw_object) {*/
|
||||||
/* Creating an internal surface which will be used as GstBuffer, we used
|
/* Creating an internal surface which will be used as GstBuffer, we used
|
||||||
the detected pixel format and video dimensions */
|
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,
|
GST_CAT_INFO_OBJECT (directdrawsink_debug, ddrawsink,
|
||||||
"allocating a surface of %d bytes (stride=%ld)\n", size,
|
"allocating a surface of %d bytes (stride=%ld)\n", size,
|
||||||
surf_lock_desc.lPitch);
|
surf_lock_desc.lPitch);
|
||||||
} else {
|
|
||||||
|
#else
|
||||||
|
|
||||||
surface_pitch_bad:
|
surface_pitch_bad:
|
||||||
GST_BUFFER (surface)->malloc_data = g_malloc (size);
|
GST_BUFFER (surface)->malloc_data = g_malloc (size);
|
||||||
|
@ -1666,7 +1664,8 @@ gst_directdraw_sink_surface_create (GstDirectDrawSink * ddrawsink,
|
||||||
surface->surface = NULL;
|
surface->surface = NULL;
|
||||||
GST_CAT_INFO_OBJECT (directdrawsink_debug, ddrawsink,
|
GST_CAT_INFO_OBJECT (directdrawsink_debug, ddrawsink,
|
||||||
"allocating a system memory buffer of %d bytes", size);
|
"allocating a system memory buffer of %d bytes", size);
|
||||||
}
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Keep a ref to our sink */
|
/* Keep a ref to our sink */
|
||||||
surface->ddrawsink = gst_object_ref (ddrawsink);
|
surface->ddrawsink = gst_object_ref (ddrawsink);
|
||||||
|
|
Loading…
Reference in a new issue