rectangle: clear rectangle struct before use

This commit is contained in:
Wim Taymans 2014-12-16 13:35:14 +01:00
parent 79b56ebcc9
commit 87f5574e39
6 changed files with 30 additions and 18 deletions

View file

@ -1744,7 +1744,9 @@ gst_dfbvideosink_show_frame (GstBaseSink * bsink, GstBuffer * buf)
{ {
GstDfbVideoSink *dfbvideosink = NULL; GstDfbVideoSink *dfbvideosink = NULL;
DFBResult res; DFBResult res;
GstVideoRectangle dst, src, result; GstVideoRectangle dst = { 0, };
GstVideoRectangle src = { 0, };
GstVideoRectangle result;
GstFlowReturn ret = GST_FLOW_OK; GstFlowReturn ret = GST_FLOW_OK;
gboolean mem_cpy = TRUE; gboolean mem_cpy = TRUE;
GstMetaDfbSurface *meta; GstMetaDfbSurface *meta;
@ -1975,7 +1977,9 @@ gst_dfbvideosink_navigation_send_event (GstNavigation * navigation,
{ {
GstDfbVideoSink *dfbvideosink = GST_DFBVIDEOSINK (navigation); GstDfbVideoSink *dfbvideosink = GST_DFBVIDEOSINK (navigation);
GstEvent *event; GstEvent *event;
GstVideoRectangle src, dst, result; GstVideoRectangle dst = { 0, };
GstVideoRectangle src = { 0, };
GstVideoRectangle result;
double x, y, old_x, old_y; double x, y, old_x, old_y;
GstPad *pad = NULL; GstPad *pad = NULL;

View file

@ -944,7 +944,9 @@ gst_sdlvideosink_navigation_send_event (GstNavigation * navigation,
{ {
GstSDLVideoSink *sdlvideosink = GST_SDLVIDEOSINK (navigation); GstSDLVideoSink *sdlvideosink = GST_SDLVIDEOSINK (navigation);
GstEvent *event; GstEvent *event;
GstVideoRectangle src, dst, result; GstVideoRectangle dst = { 0, };
GstVideoRectangle src = { 0, };
GstVideoRectangle result;
double x, y, old_x, old_y; double x, y, old_x, old_y;
GstPad *pad = NULL; GstPad *pad = NULL;

View file

@ -237,7 +237,8 @@ gst_wl_window_is_toplevel (GstWlWindow * window)
static void static void
gst_wl_window_resize_video_surface (GstWlWindow * window, gboolean commit) gst_wl_window_resize_video_surface (GstWlWindow * window, gboolean commit)
{ {
GstVideoRectangle src, res; GstVideoRectangle src = { 0, };
GstVideoRectangle res;
/* center the video_subsurface inside area_subsurface */ /* center the video_subsurface inside area_subsurface */
src.w = window->video_width; src.w = window->video_width;
@ -256,7 +257,8 @@ gst_wl_window_resize_video_surface (GstWlWindow * window, gboolean commit)
struct wl_region *region; struct wl_region *region;
region = wl_compositor_create_region (window->display->compositor); region = wl_compositor_create_region (window->display->compositor);
wl_region_add(region, 0, 0, window->render_rectangle.w, window->render_rectangle.h); wl_region_add (region, 0, 0, window->render_rectangle.w,
window->render_rectangle.h);
wl_surface_set_input_region (window->area_surface, region); wl_surface_set_input_region (window->area_surface, region);
wl_region_destroy (region); wl_region_destroy (region);
} }

View file

@ -92,7 +92,8 @@ static gboolean gst_ddrawvideosink_get_format_from_caps (GstDirectDrawSink *
static void gst_directdraw_sink_center_rect (GstDirectDrawSink * ddrawsink, static void gst_directdraw_sink_center_rect (GstDirectDrawSink * ddrawsink,
RECT src, RECT dst, RECT * result); RECT src, RECT dst, RECT * result);
static const char *DDErrorString (HRESULT hr); static const char *DDErrorString (HRESULT hr);
static long FAR PASCAL WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); static long FAR PASCAL WndProc (HWND hWnd, UINT message, WPARAM wParam,
LPARAM lParam);
/* surfaces management functions */ /* surfaces management functions */
static void gst_directdraw_sink_surface_destroy (GstDirectDrawSink * ddrawsink, static void gst_directdraw_sink_surface_destroy (GstDirectDrawSink * ddrawsink,
@ -209,9 +210,11 @@ gst_directdraw_sink_navigation_send_event (GstNavigation * navigation,
{ {
GstDirectDrawSink *ddrawsink = GST_DIRECTDRAW_SINK (navigation); GstDirectDrawSink *ddrawsink = GST_DIRECTDRAW_SINK (navigation);
GstEvent *event; GstEvent *event;
GstVideoRectangle src, dst, result; GstVideoRectangle src = { 0, };
GstVideoRectangle dst = { 0, };
GstVideoRectangle result;
RECT rect; RECT rect;
gdouble x, y, old_x, old_y, xscale = 1.0, yscale=1.0; gdouble x, y, old_x, old_y, xscale = 1.0, yscale = 1.0;
GstPad *pad = NULL; GstPad *pad = NULL;
src.w = GST_VIDEO_SINK_WIDTH (ddrawsink); src.w = GST_VIDEO_SINK_WIDTH (ddrawsink);
@ -519,7 +522,7 @@ gst_directdraw_sink_init (GstDirectDrawSink * ddrawsink,
ddrawsink->video_window = NULL; ddrawsink->video_window = NULL;
ddrawsink->our_video_window = TRUE; ddrawsink->our_video_window = TRUE;
ddrawsink->previous_wndproc = NULL; ddrawsink->previous_wndproc = NULL;
ddrawsink->previous_user_data = (LONG_PTR)NULL; ddrawsink->previous_user_data = (LONG_PTR) NULL;
ddrawsink->last_buffer = NULL; ddrawsink->last_buffer = NULL;
ddrawsink->caps = NULL; ddrawsink->caps = NULL;
ddrawsink->window_thread = NULL; ddrawsink->window_thread = NULL;
@ -1575,14 +1578,15 @@ WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
/* Temporarily restore the previous user_data */ /* Temporarily restore the previous user_data */
if (ddrawsink->previous_user_data) if (ddrawsink->previous_user_data)
SetWindowLongPtr ( hWnd, GWLP_USERDATA, ddrawsink->previous_user_data ); SetWindowLongPtr (hWnd, GWLP_USERDATA, ddrawsink->previous_user_data);
/* Call previous WndProc */ /* Call previous WndProc */
ret = CallWindowProc ( ret =
ddrawsink->previous_wndproc, hWnd, message, wParam, lParam); CallWindowProc (ddrawsink->previous_wndproc, hWnd, message, wParam,
lParam);
/* Point the user_data back to our ddraw_sink */ /* Point the user_data back to our ddraw_sink */
SetWindowLongPtr ( hWnd, GWLP_USERDATA, (LONG_PTR)ddrawsink ); SetWindowLongPtr (hWnd, GWLP_USERDATA, (LONG_PTR) ddrawsink);
} else { } else {
/* if there was no previous custom WndProc, call Window's default one */ /* if there was no previous custom WndProc, call Window's default one */
ret = DefWindowProc (hWnd, message, wParam, lParam); ret = DefWindowProc (hWnd, message, wParam, lParam);

View file

@ -564,7 +564,8 @@ gst_pvrvideosink_blit (GstPVRVideoSink * pvrvideosink, GstBuffer * buffer)
} }
if (pvrvideosink->keep_aspect) { if (pvrvideosink->keep_aspect) {
GstVideoRectangle src, dst; GstVideoRectangle src = { 0, };
GstVideoRectangle dst = { 0, };
src.w = GST_VIDEO_SINK_WIDTH (pvrvideosink); src.w = GST_VIDEO_SINK_WIDTH (pvrvideosink);
src.h = GST_VIDEO_SINK_HEIGHT (pvrvideosink); src.h = GST_VIDEO_SINK_HEIGHT (pvrvideosink);

View file

@ -674,9 +674,8 @@ gst_vdp_vpp_drain (GstVdpVideoPostProcess * vpp)
GstVdpOutputBuffer *outbuf; GstVdpOutputBuffer *outbuf;
GstStructure *structure; GstStructure *structure;
GstVideoRectangle src_r = { 0, } GstVideoRectangle src_r = { 0, };
, dest_r = { GstVideoRectangle dest_r = { 0, };
0,};
VdpRect rect; VdpRect rect;
GstVdpDevice *device; GstVdpDevice *device;
@ -705,7 +704,7 @@ gst_vdp_vpp_drain (GstVdpVideoPostProcess * vpp)
goto invalid_caps; goto invalid_caps;
if (vpp->force_aspect_ratio) { if (vpp->force_aspect_ratio) {
GstVideoRectangle res_r; GstVideoRectangle res_r = { 0, };
gst_video_sink_center_rect (src_r, dest_r, &res_r, TRUE); gst_video_sink_center_rect (src_r, dest_r, &res_r, TRUE);
rect.x0 = res_r.x; rect.x0 = res_r.x;