1 /*\r
2 * Copyright (c) 2012-2013, Texas Instruments Incorporated\r
3 *\r
4 * Redistribution and use in source and binary forms, with or without\r
5 * modification, are permitted provided that the following conditions\r
6 * are met:\r
7 *\r
8 * * Redistributions of source code must retain the above copyright\r
9 * notice, this list of conditions and the following disclaimer.\r
10 *\r
11 * * Redistributions in binary form must reproduce the above copyright\r
12 * notice, this list of conditions and the following disclaimer in the\r
13 * documentation and/or other materials provided with the distribution.\r
14 *\r
15 * * Neither the name of Texas Instruments Incorporated nor the names of\r
16 * its contributors may be used to endorse or promote products derived\r
17 * from this software without specific prior written permission.\r
18 *\r
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\r
21 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\r
23 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\r
24 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r
25 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\r
26 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\r
27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\r
28 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r
29 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
30 *\r
31 * Contact information for paper mail:\r
32 * Texas Instruments\r
33 * Post Office Box 655303\r
34 * Dallas, Texas 75265\r
35 * Contact information:\r
36 * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm\r
37 * ?DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact\r
38 * ============================================================================\r
39 *\r
40 */\r
41 \r
42 /**\r
43 * @file common.h\r
44 *\r
45 * @brief Declares global variables and utility functions\r
46 */\r
47 #ifndef __COMMON_H__\r
48 #define __COMMON_H__\r
49 \r
50 #include <linux/limits.h>\r
51 #include <glib.h>\r
52 \r
53 /**\r
54 *Extern variables which flags passed as options.\r
55 */\r
56 \r
57 /**\r
58 * @brief The decode mode of the appplication : single, dual or none.\r
59 */\r
60 extern gint decodeMode; \r
61 \r
62 /**\r
63 * @brief Array to store filenames of the media files\r
64 */\r
65 \r
66 extern gchar *filename[];\r
67 \r
68 /**\r
69 * @brief Stores if version of the application is asked on the command line. \r
70 */\r
71 \r
72 extern gboolean version;\r
73 \r
74 /**\r
75 * @brief Video sink to be used.\r
76 */\r
77 \r
78 extern gchar *sink;\r
79 \r
80 /**\r
81 * @brief Variable for processing the filenames passed as command line \r
82 * arguments.\r
83 */\r
84 \r
85 extern gchar **files;\r
86 /**\r
87 * @brief Version of the application.\r
88 */\r
89 \r
90 extern const gchar *version_text;\r
91 \r
92 \r
93 /**\r
94 *Error codes\r
95 */\r
96 #define ERR_SUCCESS 0\r
97 #define ERR_XNOTFOUND -1\r
98 #define ERR_INVALIDPARAM -2\r
99 #define ERR_FILENOTFOUND -3\r
100 #define ERR_OPTIONPARSE -4\r
101 #define ERR_BUG -5\r
102 \r
103 /**\r
104 *Dual decode, maximum pipelines = 2\r
105 */\r
106 #define NUM_MAX_FILES 2\r
107 #define PATH_MAX_LEN (PATH_MAX + strlen("file://"))\r
108 \r
109 \r
110 /**\r
111 * Decode mode of the application.\r
112 * DECODE_MODE_NONE only applicable if \r
113 * application is started without any \r
114 * filename argument. This flag is used only\r
115 * for setting the mode of the application \r
116 * during startup\r
117 */\r
118 #define DECODE_MODE_NONE 0\r
119 #define DECODE_MODE_SINGLE 1 \r
120 #define DECODE_MODE_DUAL 2\r
121 \r
122 /**\r
123 * Initial position of the media file\r
124 */\r
125 #define SEEK_START 0\r
126 \r
127 #endif /*__COMMON_H__*/\r