gst_plugins_good/gst/camerabin/gstcamerabinxoverlay.c
branchRCL_3
changeset 30 7e817e7e631c
parent 2 5505e8908944
equal deleted inserted replaced
29:567bb019e3e3 30:7e817e7e631c
       
     1 /*
       
     2  * GStreamer
       
     3  * Copyright (C) 2008 Nokia Corporation <multimedia@maemo.org>
       
     4  *
       
     5  * This library is free software; you can redistribute it and/or
       
     6  * modify it under the terms of the GNU Library General Public
       
     7  * License as published by the Free Software Foundation; either
       
     8  * version 2 of the License, or (at your option) any later version.
       
     9  *
       
    10  * This library is distributed in the hope that it will be useful,
       
    11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    13  * Library General Public License for more details.
       
    14  *
       
    15  * You should have received a copy of the GNU Library General Public
       
    16  * License along with this library; if not, write to the
       
    17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
       
    18  * Boston, MA 02111-1307, USA.
       
    19  */
       
    20 
       
    21 /*
       
    22  * Includes
       
    23  */
       
    24 
       
    25 #ifdef HAVE_CONFIG_H
       
    26 #include <config.h>
       
    27 #endif
       
    28 
       
    29 #include "gstcamerabinxoverlay.h"
       
    30 #include "gstcamerabin.h"
       
    31 
       
    32 /*
       
    33  * static functions implementation
       
    34  */
       
    35 
       
    36 static void
       
    37 gst_camerabin_expose (GstXOverlay * overlay)
       
    38 {
       
    39   if (overlay && GST_CAMERABIN (overlay)->view_sink) {
       
    40     GstXOverlay *xoverlay = GST_X_OVERLAY (GST_CAMERABIN (overlay)->view_sink);
       
    41     gst_x_overlay_expose (xoverlay);
       
    42   }
       
    43 }
       
    44 
       
    45 static void
       
    46 gst_camerabin_set_xwindow_id (GstXOverlay * overlay, gulong xwindow_id)
       
    47 {
       
    48   if (overlay && GST_CAMERABIN (overlay)->view_sink) {
       
    49     GstXOverlay *xoverlay = GST_X_OVERLAY (GST_CAMERABIN (overlay)->view_sink);
       
    50     gst_x_overlay_set_xwindow_id (xoverlay, xwindow_id);
       
    51   }
       
    52 }
       
    53 
       
    54 static void
       
    55 gst_camerabin_set_event_handling (GstXOverlay * overlay, gboolean handle_events)
       
    56 {
       
    57   if (overlay && GST_CAMERABIN (overlay)->view_sink) {
       
    58     GstXOverlay *xoverlay = GST_X_OVERLAY (GST_CAMERABIN (overlay)->view_sink);
       
    59     gst_x_overlay_handle_events (xoverlay, handle_events);
       
    60   }
       
    61 }
       
    62 
       
    63 /*
       
    64  * extern functions implementation
       
    65  */
       
    66 
       
    67 void
       
    68 gst_camerabin_xoverlay_init (GstXOverlayClass * iface)
       
    69 {
       
    70   iface->set_xwindow_id = gst_camerabin_set_xwindow_id;
       
    71   iface->expose = gst_camerabin_expose;
       
    72   iface->handle_events = gst_camerabin_set_event_handling;
       
    73 }