Merge lp:~tintou/audience/remove-gst-0.10 into lp:~audience-members/audience/trunk
- remove-gst-0.10
- Merge into trunk
Proposed by
Corentin Noël
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 336 | ||||
Proposed branch: | lp:~tintou/audience/remove-gst-0.10 | ||||
Merge into: | lp:~audience-members/audience/trunk | ||||
Diff against target: |
397 lines (+47/-134) 5 files modified
CMakeLists.txt (+42/-46) src/Utils.vala (+1/-5) src/Widgets/MediaSlider.vala (+0/-15) src/Widgets/TagView.vala (+3/-15) src/Widgets/VideoPlayer.vala (+1/-53) |
||||
To merge this branch: | bzr merge lp:~tintou/audience/remove-gst-0.10 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Audience Members | Pending | ||
Review via email: mp+217896@code.launchpad.net |
Commit message
Description of the change
Remove GStreamer 0.10 to keep the code simple
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2014-01-11 14:55:28 +0000 | |||
3 | +++ CMakeLists.txt 2014-05-01 09:17:54 +0000 | |||
4 | @@ -6,25 +6,27 @@ | |||
5 | 6 | 6 | ||
6 | 7 | project (audience) | 7 | project (audience) |
7 | 8 | 8 | ||
11 | 9 | set (DATADIR "${CMAKE_INSTALL_PREFIX}/share") | 9 | set (DATADIR ${CMAKE_INSTALL_PREFIX}/share) |
12 | 10 | set (PKGDATADIR "${DATADIR}/audience") | 10 | set (PKGDATADIR ${DATADIR}/${CMAKE_PROJECT_NAME}) |
13 | 11 | set (GETTEXT_PACKAGE "audience") | 11 | set (GETTEXT_PACKAGE ${CMAKE_PROJECT_NAME}) |
14 | 12 | set (RELEASE_NAME "A modern media player.") | 12 | set (RELEASE_NAME "A modern media player.") |
15 | 13 | set (VERSION "0.1") | 13 | set (VERSION "0.1") |
16 | 14 | set (VERSION_INFO "The Red Comet") | 14 | set (VERSION_INFO "The Red Comet") |
17 | 15 | 15 | ||
18 | 16 | add_definitions (-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\") | ||
19 | 17 | add_definitions (-w) | ||
20 | 18 | |||
21 | 16 | # Data | 19 | # Data |
29 | 17 | install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/16/audience.svg DESTINATION ${DATADIR}/icons/hicolor/16x16/apps/) | 20 | install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/16/audience.svg DESTINATION ${DATADIR}/icons/hicolor/16x16/apps/) |
30 | 18 | install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/24/audience.svg DESTINATION ${DATADIR}/icons/hicolor/24x24/apps/) | 21 | install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/24/audience.svg DESTINATION ${DATADIR}/icons/hicolor/24x24/apps/) |
31 | 19 | install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/32/audience.svg DESTINATION ${DATADIR}/icons/hicolor/32x32/apps/) | 22 | install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/32/audience.svg DESTINATION ${DATADIR}/icons/hicolor/32x32/apps/) |
32 | 20 | install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/48/audience.svg DESTINATION ${DATADIR}/icons/hicolor/48x48/apps/) | 23 | install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/48/audience.svg DESTINATION ${DATADIR}/icons/hicolor/48x48/apps/) |
33 | 21 | install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/64/audience.svg DESTINATION ${DATADIR}/icons/hicolor/64x64/apps/) | 24 | install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/64/audience.svg DESTINATION ${DATADIR}/icons/hicolor/64x64/apps/) |
34 | 22 | install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/128/audience.svg DESTINATION ${DATADIR}/icons/hicolor/128x128/apps/) | 25 | install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/128/audience.svg DESTINATION ${DATADIR}/icons/hicolor/128x128/apps/) |
35 | 23 | install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/audience.desktop DESTINATION ${DATADIR}/applications/) | 26 | install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/audience.desktop DESTINATION ${DATADIR}/applications/) |
36 | 24 | 27 | ||
37 | 25 | # Configure file | 28 | # Configure file |
40 | 26 | configure_file (${CMAKE_SOURCE_DIR}/Audience/Config.vala.cmake ${CMAKE_BINARY_DIR}/Audience/Config.vala) | 29 | configure_file (${CMAKE_SOURCE_DIR}/src/Config.vala.cmake ${CMAKE_BINARY_DIR}/src/Config.vala) |
39 | 27 | add_definitions(-DGETTEXT_PACKAGE="audience") | ||
41 | 28 | 30 | ||
42 | 29 | set (CPACK_PACKAGE_VERSION ${VERSION}) | 31 | set (CPACK_PACKAGE_VERSION ${VERSION}) |
43 | 30 | set (CPACK_SOURCE_GENERATOR "TGZ") | 32 | set (CPACK_SOURCE_GENERATOR "TGZ") |
44 | @@ -35,48 +37,42 @@ | |||
45 | 35 | add_custom_target (dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source) | 37 | add_custom_target (dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source) |
46 | 36 | 38 | ||
47 | 37 | find_package(PkgConfig) | 39 | find_package(PkgConfig) |
64 | 38 | pkg_check_modules(CLUTTER_GST_1 QUIET clutter-gst-2.0) | 40 | pkg_check_modules(DEPS REQUIRED granite clutter-gtk-1.0 gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-tag-1.0) |
65 | 39 | if (CLUTTER_GST_1_FOUND) | 41 | |
66 | 40 | set(CLUTTER_GST_FLAGS "--define=HAS_CLUTTER_GST_1") | 42 | add_definitions (${DEPS_CFLAGS}) |
67 | 41 | set(GST_PACKAGES gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-tag-1.0) | 43 | link_libraries (${DEPS_LIBRARIES}) |
68 | 42 | else (CLUTTER_GST_1_FOUND) | 44 | link_directories (${DEPS_LIBRARY_DIRS}) |
69 | 43 | set(CLUTTER_GST_FLAGS "") | 45 | find_package (Vala REQUIRED) |
70 | 44 | set(GST_PACKAGES gstreamer-0.10 gstreamer-pbutils-0.10 gstreamer-tag-0.10 gstreamer-interfaces-0.10) | 46 | include (ValaVersion) |
55 | 45 | endif (CLUTTER_GST_1_FOUND) | ||
56 | 46 | |||
57 | 47 | pkg_check_modules(DEPS REQUIRED granite clutter-gtk-1.0 ${GST_PACKAGES}) | ||
58 | 48 | |||
59 | 49 | add_definitions(${DEPS_CFLAGS}) | ||
60 | 50 | link_libraries(${DEPS_LIBRARIES}) | ||
61 | 51 | link_directories(${DEPS_LIBRARY_DIRS}) | ||
62 | 52 | find_package(Vala REQUIRED) | ||
63 | 53 | include(ValaVersion) | ||
71 | 54 | 47 | ||
72 | 55 | ensure_vala_version("0.16.1" MINIMUM) | 48 | ensure_vala_version("0.16.1" MINIMUM) |
73 | 56 | 49 | ||
74 | 57 | include(ValaPrecompile) | 50 | include(ValaPrecompile) |
75 | 58 | vala_precompile(VALA_C | 51 | vala_precompile(VALA_C |
90 | 59 | Audience/Audience.vala | 52 | ${CMAKE_BINARY_DIR}/src/Config.vala |
91 | 60 | Audience/Consts.vala | 53 | src/Audience.vala |
92 | 61 | Audience/Settings.vala | 54 | src/Consts.vala |
93 | 62 | Audience/Utils.vala | 55 | src/Settings.vala |
94 | 63 | ${CMAKE_BINARY_DIR}/Audience/Config.vala | 56 | src/Utils.vala |
95 | 64 | Audience/Widgets/TagView.vala | 57 | src/Widgets/TagView.vala |
96 | 65 | Audience/Widgets/Button.vala | 58 | src/Widgets/Button.vala |
97 | 66 | Audience/Widgets/ControlsBar.vala | 59 | src/Widgets/ControlsBar.vala |
98 | 67 | Audience/Widgets/LLabel.vala | 60 | src/Widgets/LLabel.vala |
99 | 68 | Audience/Widgets/MediaSlider.vala | 61 | src/Widgets/MediaSlider.vala |
100 | 69 | Audience/Widgets/TopPanel.vala | 62 | src/Widgets/TopPanel.vala |
101 | 70 | Audience/Widgets/Playlist.vala | 63 | src/Widgets/Playlist.vala |
102 | 71 | Audience/Widgets/VideoPlayer.vala | 64 | src/Widgets/VideoPlayer.vala |
103 | 72 | Audience/desktop-launcher.vala | 65 | src/desktop-launcher.vala |
104 | 73 | PACKAGES | 66 | PACKAGES |
105 | 74 | granite | 67 | granite |
106 | 75 | clutter-gtk-1.0 | 68 | clutter-gtk-1.0 |
107 | 76 | gdk-x11-3.0 | 69 | gdk-x11-3.0 |
109 | 77 | ${GST_PACKAGES} | 70 | gstreamer-1.0 |
110 | 71 | gstreamer-pbutils-1.0 | ||
111 | 72 | gstreamer-tag-1.0 | ||
112 | 78 | OPTIONS | 73 | OPTIONS |
114 | 79 | ${CLUTTER_GST_FLAGS} | 74 | --enable-experimental |
115 | 75 | --target-glib=2.32 | ||
116 | 80 | --thread | 76 | --thread |
117 | 81 | -g | 77 | -g |
118 | 82 | ) | 78 | ) |
119 | @@ -86,8 +82,8 @@ | |||
120 | 86 | add_schema ("data/org.pantheon.audience.gschema.xml") | 82 | add_schema ("data/org.pantheon.audience.gschema.xml") |
121 | 87 | 83 | ||
122 | 88 | add_subdirectory (po) | 84 | add_subdirectory (po) |
125 | 89 | add_executable(audience ${VALA_C}) | 85 | add_executable(${CMAKE_PROJECT_NAME} ${VALA_C}) |
126 | 90 | install (TARGETS audience RUNTIME DESTINATION bin) | 86 | install (TARGETS ${CMAKE_PROJECT_NAME} RUNTIME DESTINATION bin) |
127 | 91 | 87 | ||
128 | 92 | # uninstall target | 88 | # uninstall target |
129 | 93 | configure_file( | 89 | configure_file( |
130 | 94 | 90 | ||
131 | === renamed directory 'Audience' => 'src' | |||
132 | === modified file 'src/Utils.vala' | |||
133 | --- Audience/Utils.vala 2014-04-11 00:10:08 +0000 | |||
134 | +++ src/Utils.vala 2014-05-01 09:17:54 +0000 | |||
135 | @@ -87,15 +87,11 @@ | |||
136 | 87 | 87 | ||
137 | 88 | public static dynamic Gst.Element get_clutter_sink () | 88 | public static dynamic Gst.Element get_clutter_sink () |
138 | 89 | { | 89 | { |
139 | 90 | #if HAS_CLUTTER_GST_1 | ||
140 | 91 | var sink = Gst.ElementFactory.make ("autocluttersink", "videosink"); | 90 | var sink = Gst.ElementFactory.make ("autocluttersink", "videosink"); |
141 | 92 | if (sink == null) { | 91 | if (sink == null) { |
142 | 93 | warning ("autocluttersink not available"); | 92 | warning ("autocluttersink not available"); |
143 | 94 | sink = Gst.ElementFactory.make ("cluttersink", "videosink"); | 93 | sink = Gst.ElementFactory.make ("cluttersink", "videosink"); |
144 | 95 | } | 94 | } |
145 | 96 | #else | ||
146 | 97 | var sink = Gst.ElementFactory.make ("cluttersink", "videosink"); | ||
147 | 98 | #endif | ||
148 | 99 | 95 | ||
149 | 100 | return sink; | 96 | return sink; |
150 | 101 | } | 97 | } |
151 | @@ -256,4 +252,4 @@ | |||
152 | 256 | 252 | ||
153 | 257 | 253 | ||
154 | 258 | } | 254 | } |
156 | 259 | } | 255 | } |
157 | 260 | \ No newline at end of file | 256 | \ No newline at end of file |
158 | 261 | 257 | ||
159 | === modified file 'src/Widgets/MediaSlider.vala' | |||
160 | --- Audience/Widgets/MediaSlider.vala 2013-05-19 17:10:26 +0000 | |||
161 | +++ src/Widgets/MediaSlider.vala 2014-05-01 09:17:54 +0000 | |||
162 | @@ -46,11 +46,7 @@ | |||
163 | 46 | // preview.width is set in VideoPlayer.vala | 46 | // preview.width is set in VideoPlayer.vala |
164 | 47 | 47 | ||
165 | 48 | // connect gstreamer stuff | 48 | // connect gstreamer stuff |
166 | 49 | #if HAS_CLUTTER_GST_1 | ||
167 | 50 | preview_playbin = Gst.ElementFactory.make ("playbin", "play"); | 49 | preview_playbin = Gst.ElementFactory.make ("playbin", "play"); |
168 | 51 | #else | ||
169 | 52 | preview_playbin = Gst.ElementFactory.make ("playbin2", "play"); | ||
170 | 53 | #endif | ||
171 | 54 | preview_playbin.get_bus ().add_signal_watch (); | 50 | preview_playbin.get_bus ().add_signal_watch (); |
172 | 55 | preview_playbin.get_bus ().message.connect ((msg) => { | 51 | preview_playbin.get_bus ().message.connect ((msg) => { |
173 | 56 | switch (msg.type) { | 52 | switch (msg.type) { |
174 | @@ -142,12 +138,7 @@ | |||
175 | 142 | //buffering | 138 | //buffering |
176 | 143 | if (this._buffered != 0.0){ | 139 | if (this._buffered != 0.0){ |
177 | 144 | int64 duration; | 140 | int64 duration; |
178 | 145 | #if HAS_CLUTTER_GST_1 | ||
179 | 146 | preview_playbin.query_duration (Gst.Format.TIME, out duration); | 141 | preview_playbin.query_duration (Gst.Format.TIME, out duration); |
180 | 147 | #else | ||
181 | 148 | var time = Gst.Format.TIME; | ||
182 | 149 | preview_playbin.query_duration (ref time, out duration); | ||
183 | 150 | #endif | ||
184 | 151 | Drawing.cairo_half_pill (ctx, 2, 2, | 142 | Drawing.cairo_half_pill (ctx, 2, 2, |
185 | 152 | (this._buffered / duration * this.bar.width) - 4, BAR_HEIGHT - 4, Gtk.PositionType.RIGHT); | 143 | (this._buffered / duration * this.bar.width) - 4, BAR_HEIGHT - 4, Gtk.PositionType.RIGHT); |
186 | 153 | ctx.set_source_rgb (0.6, 0.6, 0.6); | 144 | ctx.set_source_rgb (0.6, 0.6, 0.6); |
187 | @@ -234,12 +225,7 @@ | |||
188 | 234 | } | 225 | } |
189 | 235 | 226 | ||
190 | 236 | int64 duration; | 227 | int64 duration; |
191 | 237 | #if HAS_CLUTTER_GST_1 | ||
192 | 238 | preview_playbin.query_duration (Gst.Format.TIME, out duration); | 228 | preview_playbin.query_duration (Gst.Format.TIME, out duration); |
193 | 239 | #else | ||
194 | 240 | var time = Gst.Format.TIME; | ||
195 | 241 | preview_playbin.query_duration (ref time, out duration); | ||
196 | 242 | #endif | ||
197 | 243 | preview_playbin.seek (1.0, Gst.Format.TIME, Gst.SeekFlags.FLUSH | Gst.SeekFlags.KEY_UNIT, | 229 | preview_playbin.seek (1.0, Gst.Format.TIME, Gst.SeekFlags.FLUSH | Gst.SeekFlags.KEY_UNIT, |
198 | 244 | Gst.SeekType.SET, (int64)(progress * duration), | 230 | Gst.SeekType.SET, (int64)(progress * duration), |
199 | 245 | Gst.SeekType.NONE, (int64)Gst.CLOCK_TIME_NONE); | 231 | Gst.SeekType.NONE, (int64)Gst.CLOCK_TIME_NONE); |
200 | @@ -250,4 +236,3 @@ | |||
201 | 250 | } | 236 | } |
202 | 251 | } | 237 | } |
203 | 252 | } | 238 | } |
204 | 253 | |||
205 | 254 | 239 | ||
206 | === modified file 'src/Widgets/TagView.vala' | |||
207 | --- Audience/Widgets/TagView.vala 2014-04-10 06:50:38 +0000 | |||
208 | +++ src/Widgets/TagView.vala 2014-05-01 09:17:54 +0000 | |||
209 | @@ -207,30 +207,18 @@ | |||
210 | 207 | 207 | ||
211 | 208 | string desc; | 208 | string desc; |
212 | 209 | string readable = null; | 209 | string readable = null; |
213 | 210 | #if HAS_CLUTTER_GST_1 | ||
214 | 211 | tags.get_string (Gst.Tags.LANGUAGE_CODE, out desc); | 210 | tags.get_string (Gst.Tags.LANGUAGE_CODE, out desc); |
215 | 212 | if (desc == null) | 211 | if (desc == null) |
216 | 213 | tags.get_string (Gst.Tags.CODEC, out desc); | 212 | tags.get_string (Gst.Tags.CODEC, out desc); |
218 | 214 | 213 | ||
219 | 215 | if (desc != null) | 214 | if (desc != null) |
220 | 216 | readable = Gst.Tag.get_language_name (desc); | 215 | readable = Gst.Tag.get_language_name (desc); |
229 | 217 | #else | 216 | |
222 | 218 | tags.get_string (Gst.TAG_LANGUAGE_CODE, out desc); | ||
223 | 219 | if (desc == null) | ||
224 | 220 | tags.get_string (Gst.TAG_CODEC, out desc); | ||
225 | 221 | |||
226 | 222 | if (desc != null) | ||
227 | 223 | readable = Gst.tag_get_language_name (desc); | ||
228 | 224 | #endif | ||
230 | 225 | if (target == "audio" && desc != null) { | 217 | if (target == "audio" && desc != null) { |
231 | 226 | this.languages.append (i.to_string (), readable == null ? desc : readable); | 218 | this.languages.append (i.to_string (), readable == null ? desc : readable); |
232 | 227 | used ++; | 219 | used ++; |
233 | 228 | } else if (desc != null) { | 220 | } else if (desc != null) { |
234 | 229 | #if HAS_CLUTTER_GST_1 | ||
235 | 230 | var language = Gst.Tag.get_language_name (desc); | 221 | var language = Gst.Tag.get_language_name (desc); |
236 | 231 | #else | ||
237 | 232 | var language = Gst.tag_get_language_name (desc); | ||
238 | 233 | #endif | ||
239 | 234 | this.subtitles.append (i.to_string (), language == null ? desc : language); | 222 | this.subtitles.append (i.to_string (), language == null ? desc : language); |
240 | 235 | used ++; | 223 | used ++; |
241 | 236 | } | 224 | } |
242 | @@ -259,4 +247,4 @@ | |||
243 | 259 | currently_parsing = false; | 247 | currently_parsing = false; |
244 | 260 | } | 248 | } |
245 | 261 | } | 249 | } |
247 | 262 | } | 250 | } |
248 | 263 | \ No newline at end of file | 251 | \ No newline at end of file |
249 | 264 | 252 | ||
250 | === modified file 'src/Widgets/VideoPlayer.vala' | |||
251 | --- Audience/Widgets/VideoPlayer.vala 2013-12-16 12:20:13 +0000 | |||
252 | +++ src/Widgets/VideoPlayer.vala 2014-05-01 09:17:54 +0000 | |||
253 | @@ -55,14 +55,8 @@ | |||
254 | 55 | get { | 55 | get { |
255 | 56 | int64 length, prog; | 56 | int64 length, prog; |
256 | 57 | 57 | ||
257 | 58 | #if HAS_CLUTTER_GST_1 | ||
258 | 59 | playbin.query_duration (Gst.Format.TIME, out length); | 58 | playbin.query_duration (Gst.Format.TIME, out length); |
259 | 60 | playbin.query_position (Gst.Format.TIME, out prog); | 59 | playbin.query_position (Gst.Format.TIME, out prog); |
260 | 61 | #else | ||
261 | 62 | var time = Gst.Format.TIME; | ||
262 | 63 | playbin.query_duration (ref time, out length); | ||
263 | 64 | playbin.query_position (ref time, out prog); | ||
264 | 65 | #endif | ||
265 | 66 | 60 | ||
266 | 67 | if (length == 0) | 61 | if (length == 0) |
267 | 68 | return 0; | 62 | return 0; |
268 | @@ -71,12 +65,7 @@ | |||
269 | 71 | } | 65 | } |
270 | 72 | set { | 66 | set { |
271 | 73 | int64 length; | 67 | int64 length; |
272 | 74 | #if HAS_CLUTTER_GST_1 | ||
273 | 75 | playbin.query_duration (Gst.Format.TIME, out length); | 68 | playbin.query_duration (Gst.Format.TIME, out length); |
274 | 76 | #else | ||
275 | 77 | var time = Gst.Format.TIME; | ||
276 | 78 | playbin.query_duration (ref time, out length); | ||
277 | 79 | #endif | ||
278 | 80 | playbin.seek_simple (Gst.Format.TIME, Gst.SeekFlags.FLUSH | Gst.SeekFlags.ACCURATE, | 69 | playbin.seek_simple (Gst.Format.TIME, Gst.SeekFlags.FLUSH | Gst.SeekFlags.ACCURATE, |
279 | 81 | (int64)(double.max (value, 0.0) * length)); | 70 | (int64)(double.max (value, 0.0) * length)); |
280 | 82 | } | 71 | } |
281 | @@ -93,29 +82,17 @@ | |||
282 | 93 | 82 | ||
283 | 94 | public string uri { | 83 | public string uri { |
284 | 95 | owned get { | 84 | owned get { |
285 | 96 | #if HAS_CLUTTER_GST_1 | ||
286 | 97 | return playbin.current_uri; | 85 | return playbin.current_uri; |
287 | 98 | #else | ||
288 | 99 | return playbin.uri; | ||
289 | 100 | #endif | ||
290 | 101 | } | 86 | } |
291 | 102 | set { | 87 | set { |
292 | 103 | if (value == (string)playbin.uri) | 88 | if (value == (string)playbin.uri) |
293 | 104 | return; | 89 | return; |
294 | 105 | 90 | ||
295 | 106 | try { | 91 | try { |
296 | 107 | #if HAS_CLUTTER_GST_1 | ||
297 | 108 | var info = new Gst.PbUtils.Discoverer (10 * Gst.SECOND).discover_uri (value); | 92 | var info = new Gst.PbUtils.Discoverer (10 * Gst.SECOND).discover_uri (value); |
298 | 109 | #else | ||
299 | 110 | var info = new Gst.Discoverer (10 * Gst.SECOND).discover_uri (value); | ||
300 | 111 | #endif | ||
301 | 112 | var video = info.get_video_streams (); | 93 | var video = info.get_video_streams (); |
302 | 113 | if (video.data != null) { | 94 | if (video.data != null) { |
303 | 114 | #if HAS_CLUTTER_GST_1 | ||
304 | 115 | var video_info = (Gst.PbUtils.DiscovererVideoInfo)video.data; | 95 | var video_info = (Gst.PbUtils.DiscovererVideoInfo)video.data; |
305 | 116 | #else | ||
306 | 117 | var video_info = (Gst.DiscovererVideoInfo)video.data; | ||
307 | 118 | #endif | ||
308 | 119 | video_width = video_info.get_width (); | 96 | video_width = video_info.get_width (); |
309 | 120 | video_height = video_info.get_height (); | 97 | video_height = video_info.get_height (); |
310 | 121 | } | 98 | } |
311 | @@ -232,11 +209,7 @@ | |||
312 | 232 | video = new Clutter.Texture (); | 209 | video = new Clutter.Texture (); |
313 | 233 | video.reactive = true; | 210 | video.reactive = true; |
314 | 234 | 211 | ||
315 | 235 | #if HAS_CLUTTER_GST_1 | ||
316 | 236 | playbin = Gst.ElementFactory.make ("playbin", "playbin"); | 212 | playbin = Gst.ElementFactory.make ("playbin", "playbin"); |
317 | 237 | #else | ||
318 | 238 | playbin = Gst.ElementFactory.make ("playbin2", "playbin"); | ||
319 | 239 | #endif | ||
320 | 240 | var video_sink = Audience.get_clutter_sink (); | 213 | var video_sink = Audience.get_clutter_sink (); |
321 | 241 | video_sink.texture = video; | 214 | video_sink.texture = video; |
322 | 242 | 215 | ||
323 | @@ -253,14 +226,8 @@ | |||
324 | 253 | }); | 226 | }); |
325 | 254 | Timeout.add (100, () => { | 227 | Timeout.add (100, () => { |
326 | 255 | int64 length, prog; | 228 | int64 length, prog; |
327 | 256 | #if HAS_CLUTTER_GST_1 | ||
328 | 257 | playbin.query_position (Gst.Format.TIME, out prog); | 229 | playbin.query_position (Gst.Format.TIME, out prog); |
329 | 258 | playbin.query_duration (Gst.Format.TIME, out length); | 230 | playbin.query_duration (Gst.Format.TIME, out length); |
330 | 259 | #else | ||
331 | 260 | var format = Gst.Format.TIME; | ||
332 | 261 | playbin.query_position (ref format, out prog); | ||
333 | 262 | playbin.query_duration (ref format, out length); | ||
334 | 263 | #endif | ||
335 | 264 | 231 | ||
336 | 265 | if (length == 0) | 232 | if (length == 0) |
337 | 266 | return true; | 233 | return true; |
338 | @@ -379,11 +346,7 @@ | |||
339 | 379 | if (msg.get_structure () == null) | 346 | if (msg.get_structure () == null) |
340 | 380 | break; | 347 | break; |
341 | 381 | 348 | ||
342 | 382 | #if HAS_CLUTTER_GST_1 | ||
343 | 383 | if (Gst.PbUtils.is_missing_plugin_message (msg)) { | 349 | if (Gst.PbUtils.is_missing_plugin_message (msg)) { |
344 | 384 | #else | ||
345 | 385 | if (Gst.is_missing_plugin_message (msg)) { | ||
346 | 386 | #endif | ||
347 | 387 | error (); | 350 | error (); |
348 | 388 | playbin.set_state (Gst.State.NULL); | 351 | playbin.set_state (Gst.State.NULL); |
349 | 389 | 352 | ||
350 | @@ -456,12 +419,7 @@ | |||
351 | 456 | void apply_subtitles () | 419 | void apply_subtitles () |
352 | 457 | { | 420 | { |
353 | 458 | int64 time; | 421 | int64 time; |
354 | 459 | #if HAS_CLUTTER_GST_1 | ||
355 | 460 | playbin.query_position (Gst.Format.TIME, out time); | 422 | playbin.query_position (Gst.Format.TIME, out time); |
356 | 461 | #else | ||
357 | 462 | var format = Gst.Format.TIME; | ||
358 | 463 | playbin.query_position (ref format, out time); | ||
359 | 464 | #endif | ||
360 | 465 | 423 | ||
361 | 466 | playbin.get_state (null, null, Gst.CLOCK_TIME_NONE); | 424 | playbin.get_state (null, null, Gst.CLOCK_TIME_NONE); |
362 | 467 | 425 | ||
363 | @@ -548,11 +506,7 @@ | |||
364 | 548 | 506 | ||
365 | 549 | void handle_missing_plugin (Gst.Message msg) | 507 | void handle_missing_plugin (Gst.Message msg) |
366 | 550 | { | 508 | { |
367 | 551 | #if HAS_CLUTTER_GST_1 | ||
368 | 552 | var detail = Gst.PbUtils.missing_plugin_message_get_description (msg); | 509 | var detail = Gst.PbUtils.missing_plugin_message_get_description (msg); |
369 | 553 | #else | ||
370 | 554 | var detail = Gst.missing_plugin_message_get_description (msg); | ||
371 | 555 | #endif | ||
372 | 556 | var dlg = new Gtk.Dialog.with_buttons ("Missing plugin", null, | 510 | var dlg = new Gtk.Dialog.with_buttons ("Missing plugin", null, |
373 | 557 | Gtk.DialogFlags.MODAL); | 511 | Gtk.DialogFlags.MODAL); |
374 | 558 | var grid = new Gtk.Grid (); | 512 | var grid = new Gtk.Grid (); |
375 | @@ -574,15 +528,9 @@ | |||
376 | 574 | 528 | ||
377 | 575 | dlg.show_all (); | 529 | dlg.show_all (); |
378 | 576 | if (dlg.run () == 0) { | 530 | if (dlg.run () == 0) { |
379 | 577 | #if HAS_CLUTTER_GST_1 | ||
380 | 578 | var installer = Gst.PbUtils.missing_plugin_message_get_installer_detail (msg); | 531 | var installer = Gst.PbUtils.missing_plugin_message_get_installer_detail (msg); |
381 | 579 | var context = new Gst.PbUtils.InstallPluginsContext (); | 532 | var context = new Gst.PbUtils.InstallPluginsContext (); |
382 | 580 | Gst.PbUtils.install_plugins_async ({installer}, context, | 533 | Gst.PbUtils.install_plugins_async ({installer}, context, |
383 | 581 | #else | ||
384 | 582 | var installer = Gst.missing_plugin_message_get_installer_detail (msg); | ||
385 | 583 | var context = new Gst.InstallPluginsContext (); | ||
386 | 584 | Gst.install_plugins_async ({installer}, context, | ||
387 | 585 | #endif | ||
388 | 586 | () => { //finished | 534 | () => { //finished |
389 | 587 | debug ("Finished plugin install\n"); | 535 | debug ("Finished plugin install\n"); |
390 | 588 | Gst.update_registry (); | 536 | Gst.update_registry (); |
391 | @@ -645,4 +593,4 @@ | |||
392 | 645 | } catch (Error e) { warning (e.message); } | 593 | } catch (Error e) { warning (e.message); } |
393 | 646 | } | 594 | } |
394 | 647 | } | 595 | } |
396 | 648 | } | 596 | } |
397 | 649 | \ No newline at end of file | 597 | \ No newline at end of file |