]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/dual-decode.git/blob - include/gst-controller.h
Fixed copyright, including header files and permissions issues.
[glsdk/dual-decode.git] / include / gst-controller.h
1 /*                                                                              
2  *  Copyright (c) 2012-2013, Texas Instruments Incorporated                     
3  *                                                                              
4  *  Redistribution and use in source and binary forms, with or without          
5  *  modification, are permitted provided that the following conditions          
6  *  are met:                                                                    
7  *                                                                              
8  *  *  Redistributions of source code must retain the above copyright           
9  *   notice, this list of conditions and the following disclaimer.              
10  *                                                                              
11  *  *  Redistributions in binary form must reproduce the above copyright        
12  *   notice, this list of conditions and the following disclaimer in the        
13  *   documentation and/or other materials provided with the distribution.       
14  *                                                                              
15  *  *  Neither the name of Texas Instruments Incorporated nor the names of      
16  *   its contributors may be used to endorse or promote products derived        
17  *   from this software without specific prior written permission.              
18  *                                                                              
19  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
20  *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,       
21  *  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR      
22  *  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR            
23  *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,       
24  *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,         
25  *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 
26  *  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,    
27  *  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR     
28  *  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,              
29  *  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                          
30  *                                                                              
31  *  Contact information for paper mail:                                         
32  *  Texas Instruments                                                           
33  *  Post Office Box 655303                                                      
34  *  Dallas, Texas 75265                                                         
35  *  Contact information:                                                        
36  *  http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
37  *  DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact                             
38  *  ============================================================================
39  *                                                                              
40  */                                                                             
41                                                                                 
42 /**                                                                             
43  * @file  gst-controller.h                                                                
44  *                                                                              
45  * @brief Defines the structures and function prototypes.                                                                       
46  */
47  
48 #include <gtk/gtk.h>
49 #include <gst/gst.h>
51 #define NANOSEC 1e9     
52 #define SS 0
53 #define MM 1
54 #define HH 2
55 /**
56  *    @brief    Defines the callback function pointer types
57  *      
58  */
59 typedef void (*LogFunc) (gpointer data, gchar * string, ...) G_GNUC_PRINTF(2,3);
60 typedef void (*EOSFunc) (gpointer data);
61 typedef void (*ErrorFunc) (gpointer data);
63 /******************************************************************************
65                             Structure Definitions
66         
67 ******************************************************************************/
69 typedef struct Pipeline {
70     /* GStreamer pipeline */
71     GstElement *pipe;
73     /* callback functions */
74     LogFunc  logFunc;
75         EOSFunc eosFunc;
76         ErrorFunc errFunc;
78     /* Signal for a pipeline */
79     gulong busSignal;
80 } Pipeline;
82 /****************************************************************************** 
83                                                                                 
84                             Function Prototypes                              
85                                                                                 
86 ******************************************************************************/ 
88 /**
89  *    @brief    Sets the pipeline to PLAYING state.
90  *    @param pipePtr     Pointer to Pipeline structure  
91  *    @param filename    Uri of the file to be played
92  *    @param Position    Position from where the playing should start
93  *    @param drawArea1   Display in window1
94  *    @param drawArea2   Display in window2 
95  *    @return   TRUE if success, FALSE otherwise.
96 */
97 gboolean DualDecode_playMedia (Pipeline *pipePtr, gchar *filename, gint64 position,
98                                GtkWidget *drawArea1, GtkWidget *drawArea2);
100 /**
101  *    @brief    Sets the pipeline to PAUSED state
102  *    @param pipePtr    Pointer to Pipeline structure
103  *    @return    TRUE if success, FALSE otherwise
104 */
105 gboolean DualDecode_pauseMedia (Pipeline *pipePtr);
107 /**                                                                             
108  *    @brief    Resumes media playback for the pipeline                              
109  *    @param pipePtr    Pointer to Pipeline structure                                             
110  *    @return    TRUE if success, FALSE otherwise                               
111 */
112 gboolean DualDecode_resumeMedia (Pipeline *pipePtr);
114 /**                                                                             
115  *    @brief    Sets the pipeline to READY state                              
116  *    @param pipePtr    Pointer to Pipeline structure                                         
117  *    @return    TRUE if success, FALSE otherwise                               
118 */
119 gboolean DualDecode_stopMedia (Pipeline *pipePtr);
121 /**                                                                             
122  *    @brief    Create a Pipeline structure                              
123  *    @param void                                     
124  *    @return Pipeline *pipe if success
125               NULL if failure                                  
126 */
128 gboolean DualDecode_seekMedia(Pipeline *pipePtr, gint64 position);
130 Pipeline * DualDecode_createPipeline ();
132 /**                                                                             
133  *    @brief                    destroy a Pipeline structure                              
134  *    @param pipePtr    Pipeline structure                                     
135 */
136 void DualDecode_destroyPipeline (Pipeline *pipePtr);
138 /**                                                                             
139  *    @brief                    Get state of the pipeline
140  *    @param pipePtr    Pipeline structure                                     
141  *        @return                       pipeline GstState
142 */
143 GstState DualDecode_getMediaState (Pipeline *pipePtr);
145 gboolean DualDecode_getMediaPosition (Pipeline *pipePtr, gdouble *seekScaleValue,
146                                       gchar **timeLabelText);