Modified in acordance to coding guidelines.
[glsdk/dual-decode.git] / src / gui.c
index b3aed4e6a9534c0d3fa7addc47fdee7043fd3505..a217ade9d85eadceca1aad78544a42972847e3bf 100644 (file)
--- a/src/gui.c
+++ b/src/gui.c
 #include <gst-controller.h>
 
 /******************************************************************************
- *     Static variables declaration
- ******************************************************************************/
+       
+                      Static variables declaration
+*****************************************************************************/
 static GUIWindow *window[]             = {NULL, NULL};
 static Pipeline *pipes[]               = {NULL, NULL};
 static GtkWidget *logWindow[]  = {NULL, NULL};
@@ -64,7 +66,9 @@ static GtkWidget *helpWindow  = NULL;
 
 
 /******************************************************************************
- *     Static functions declaration
+                          Static functions declaration
+
  ******************************************************************************/
 static gint setAbsolutePathname (gchar *file, gchar **uri)  ;
 static void setControlMode (GUIWindow *thisWindow,gint modeFlag,gint activeFlag);
@@ -126,7 +130,9 @@ last:
     return ret;                                                                 
 }        
 /******************************************************************************
- *     Callback functions definition
+                       Callback functions definition
+
  ******************************************************************************/
 
 /*Timer Interval Callback Function*/
@@ -150,10 +156,10 @@ static gboolean cbTimerInterval(gpointer data)
                                seekScaleValue);
                gtk_label_set_text (GTK_LABEL (window[DECODER_INDEX_SINGLE]->timeLabel),
                                timeLabelText);
-               g_signal_handler_unblock (GTK_RANGE (window[DECODER_INDEX_SINGLE]->seekScale),
+               g_signal_handler_unblock (GTK_RANGE(window[DECODER_INDEX_SINGLE]->seekScale),
                                window[DECODER_INDEX_SINGLE]->seekSignal);
 
-               g_signal_handler_block(GTK_RANGE (window[DECODER_INDEX_DOUBLE]->seekScale),
+               g_signal_handler_block (GTK_RANGE (window[DECODER_INDEX_DOUBLE]->seekScale),
                                window[DECODER_INDEX_DOUBLE]->seekSignal);
                gtk_range_set_value(GTK_RANGE (window[DECODER_INDEX_DOUBLE]->seekScale),
                                seekScaleValue);
@@ -167,22 +173,22 @@ static gboolean cbTimerInterval(gpointer data)
                                        &seekScaleValue,
                                        &timeLabelText);
                        
-            g_signal_handler_block(GTK_RANGE(window[DECODER_INDEX_SINGLE]->seekScale),
+            g_signal_handler_block (GTK_RANGE(window[DECODER_INDEX_SINGLE]->seekScale),
                                        window[DECODER_INDEX_SINGLE]->seekSignal);
-                       gtk_range_set_value(GTK_RANGE (window[DECODER_INDEX_SINGLE]->seekScale),
+                       gtk_range_set_value (GTK_RANGE (window[DECODER_INDEX_SINGLE]->seekScale),
                                        seekScaleValue);
-                       gtk_label_set_text(GTK_LABEL (window[DECODER_INDEX_SINGLE]->timeLabel),
+                       gtk_label_set_text (GTK_LABEL (window[DECODER_INDEX_SINGLE]->timeLabel),
                                        timeLabelText);
-                       g_signal_handler_unblock(GTK_RANGE (window[DECODER_INDEX_SINGLE]->seekScale),
+                       g_signal_handler_unblock (GTK_RANGE (window[DECODER_INDEX_SINGLE]->seekScale),
                                        window[DECODER_INDEX_SINGLE]->seekSignal);
                }else{
-                       ret = DualDecode_getMediaPosition(pipes[DECODER_INDEX_DOUBLE],
+                       ret = DualDecode_getMediaPosition (pipes[DECODER_INDEX_DOUBLE],
                                        &seekScaleValue,
                                        &timeLabelText);
 
-                       g_signal_handler_block(GTK_RANGE (window[DECODER_INDEX_DOUBLE]->seekScale),
+                       g_signal_handler_block (GTK_RANGE (window[DECODER_INDEX_DOUBLE]->seekScale),
                                        window[DECODER_INDEX_DOUBLE]->seekSignal);
-                       gtk_range_set_value(GTK_RANGE (window[DECODER_INDEX_DOUBLE]->seekScale),
+                       gtk_range_set_value (GTK_RANGE (window[DECODER_INDEX_DOUBLE]->seekScale),
                                        seekScaleValue);
                        gtk_label_set_text (GTK_LABEL(window[DECODER_INDEX_DOUBLE]->timeLabel),
                                        timeLabelText);
@@ -335,7 +341,9 @@ static gboolean cbPlayClicked(GtkWidget *widget, gpointer data)
                        }else if (GST_STATE_READY == 
                          DualDecode_getMediaState(pipes[DECODER_INDEX_SINGLE])){
                g_print ("\nPipeline state is READY\n");
-               DualDecode_setPipelineSink (pipes[DECODER_INDEX_SINGLE], window[DECODER_INDEX_SINGLE]->sink, NULL); 
+               DualDecode_setPipelineSink (pipes[DECODER_INDEX_SINGLE], 
+                                                 window[DECODER_INDEX_SINGLE]->sink, 
+                                                 NULL); 
                DualDecode_playMedia (pipes[DECODER_INDEX_SINGLE], filename[0],0);
                //DualDecode_seekMedia (pipes[DECODER_INDEX_SINGLE], 0);
             }
@@ -582,7 +590,9 @@ static gboolean cbHelpClosed (GtkWidget *widget, gpointer data){
     return TRUE;
 }
 /******************************************************************************
- *     static utility functions definition
+                       Static utility functions definition
+
  ******************************************************************************/
 static void setControlActive(GUIWindow *window, gboolean activeFlag)
 {
@@ -755,9 +765,11 @@ static void setup()
                        setControlMode(window[DECODER_INDEX_DOUBLE],
                                        CONTROL_MODE_NO_FILE,
                                        CONTROL_MODE_ACTIVE);
-             DualDecode_setPipelineSink (pipes[DECODER_INDEX_SINGLE], window[DECODER_INDEX_SINGLE]->sink,
+             DualDecode_setPipelineSink (pipes[DECODER_INDEX_SINGLE], 
+                                         window[DECODER_INDEX_SINGLE]->sink,
                                               NULL);                            
-             DualDecode_setPipelineSink (pipes[DECODER_INDEX_DOUBLE], window[DECODER_INDEX_DOUBLE]->sink,
+             DualDecode_setPipelineSink (pipes[DECODER_INDEX_DOUBLE], 
+                                         window[DECODER_INDEX_DOUBLE]->sink,
                                               NULL);
                        decodeMode = DECODE_MODE_DUAL;
                        setDecodeSwitch(DECODE_MODE_SINGLE);
@@ -769,8 +781,9 @@ static void setup()
                        setControlMode (window[DECODER_INDEX_DOUBLE],
                                        CONTROL_MODE_PLAYING,
                                        CONTROL_MODE_INACTIVE);
-            DualDecode_setPipelineSink (pipes[DECODER_INDEX_SINGLE], window[DECODER_INDEX_SINGLE]->sink,
-                                              window[DECODER_INDEX_DOUBLE]->sink);
+            DualDecode_setPipelineSink (pipes[DECODER_INDEX_SINGLE], 
+                                        window[DECODER_INDEX_SINGLE]->sink,
+                                        window[DECODER_INDEX_DOUBLE]->sink);
             DualDecode_setPipelineSink (pipes[DECODER_INDEX_DOUBLE], NULL,
                                             NULL);
                        DualDecode_playMedia (pipes[DECODER_INDEX_SINGLE],
@@ -782,9 +795,11 @@ static void setup()
                        setControlMode(window[DECODER_INDEX_SINGLE],
                                        CONTROL_MODE_PLAYING,
                                        CONTROL_MODE_ACTIVE);
-             DualDecode_setPipelineSink (pipes[DECODER_INDEX_SINGLE], window[DECODER_INDEX_SINGLE]->sink,
+             DualDecode_setPipelineSink (pipes[DECODER_INDEX_SINGLE], 
+                                         window[DECODER_INDEX_SINGLE]->sink,
                                               NULL);
-             DualDecode_setPipelineSink (pipes[DECODER_INDEX_DOUBLE], window[DECODER_INDEX_DOUBLE]->sink,
+             DualDecode_setPipelineSink (pipes[DECODER_INDEX_DOUBLE], 
+                                         window[DECODER_INDEX_DOUBLE]->sink,
                                               NULL);
 
                        DualDecode_playMedia(pipes[DECODER_INDEX_SINGLE],
@@ -1043,7 +1058,7 @@ static GstElement *createImageSinkFromWindow (GtkWidget * window, gchar *name)
     drawable = gtk_widget_get_window (GTK_WIDGET (window));                     
     if(FALSE == GDK_IS_DRAWABLE(drawable)){                                     
         /*TODO: A BUG HERE?*/                                                   
-        g_object_unref(G_OBJECT(sinkElement));                                         
+        g_object_unref (G_OBJECT (sinkElement));                                         
         sinkElement=NULL;                                                              
         goto return_pos;                                                        
     }