1 /*
2 * Copyright (c) 2010-2011, 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 */
42 /**
43 * @file gst-controller.h
44 *
45 * @brief Defines the structures and function prototypes.
46 */
50 /**
51 * @brief Defines the callback function pointer types
52 *
53 */
54 typedef void (*LogFunc) (gpointer data, gchar * string, ...) G_GNUC_PRINTF(2,3);
55 typedef void (*EOSFunc) (gpointer data);
56 typedef void (*ErrorFunc) (gpointer data);
58 /******************************************************************************
60 Structure Definitions
62 ******************************************************************************/
64 typedef struct Pipeline {
65 /* GStreamer pipeline */
66 GstElement *pipe;
68 /* callback functions */
69 LogFunc logFunc;
70 EOSFunc eosFunc;
71 ErrorFunc errFunc;
73 /* Signal for a pipeline */
74 gulong busSignal;
75 } Pipeline;
77 /******************************************************************************
79 Function Prototypes
81 ******************************************************************************/
83 /**
84 * @brief Sets the pipeline to PLAYING state.
85 * @param pipePtr Pointer to Pipeline structure
86 * @param filename Uri of the file to be played
87 * @param Position Position from where the playing should start
88 * @param drawArea1 Display in window1
89 * @param drawArea2 Display in window2
90 * @return TRUE if success, FALSE otherwise.
91 */
92 gboolean DualDecode_playMedia (Pipeline *pipePtr, gchar *filename, gint64 position,
93 GtkWidget *drawArea1, GtkWidget *drawArea2);
95 /**
96 * @brief Sets the pipeline to PAUSED state
97 * @param pipePtr Pointer to Pipeline structure
98 * @return TRUE if success, FALSE otherwise
99 */
100 gboolean DualDecode_pauseMedia (Pipeline *pipePtr);
102 /**
103 * @brief Resumes media playback for the pipeline
104 * @param pipePtr Pointer to Pipeline structure
105 * @return TRUE if success, FALSE otherwise
106 */
107 gboolean DualDecode_resumeMedia (Pipeline *pipePtr);
109 /**
110 * @brief Sets the pipeline to READY state
111 * @param pipePtr Pointer to Pipeline structure
112 * @return TRUE if success, FALSE otherwise
113 */
114 gboolean DualDecode_stopMedia (Pipeline *pipePtr);
116 /**
117 * @brief Create a Pipeline structure
118 * @param void
119 * @return Pipeline *pipe if success
120 NULL if failure
121 */
122 Pipeline * DualDecode createPipeline ();
124 /**
125 * @brief destroy a Pipeline structure
126 * @param pipePtr Pipeline structure
127 */
128 void DualDecode_destroyPipeline (Pipeline *pipePtr);