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 | project (audience) |
7 | |
8 | -set (DATADIR "${CMAKE_INSTALL_PREFIX}/share") |
9 | -set (PKGDATADIR "${DATADIR}/audience") |
10 | -set (GETTEXT_PACKAGE "audience") |
11 | +set (DATADIR ${CMAKE_INSTALL_PREFIX}/share) |
12 | +set (PKGDATADIR ${DATADIR}/${CMAKE_PROJECT_NAME}) |
13 | +set (GETTEXT_PACKAGE ${CMAKE_PROJECT_NAME}) |
14 | set (RELEASE_NAME "A modern media player.") |
15 | set (VERSION "0.1") |
16 | set (VERSION_INFO "The Red Comet") |
17 | |
18 | +add_definitions (-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\") |
19 | +add_definitions (-w) |
20 | + |
21 | # Data |
22 | -install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/16/audience.svg DESTINATION ${DATADIR}/icons/hicolor/16x16/apps/) |
23 | -install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/24/audience.svg DESTINATION ${DATADIR}/icons/hicolor/24x24/apps/) |
24 | -install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/32/audience.svg DESTINATION ${DATADIR}/icons/hicolor/32x32/apps/) |
25 | -install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/48/audience.svg DESTINATION ${DATADIR}/icons/hicolor/48x48/apps/) |
26 | -install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/64/audience.svg DESTINATION ${DATADIR}/icons/hicolor/64x64/apps/) |
27 | -install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/128/audience.svg DESTINATION ${DATADIR}/icons/hicolor/128x128/apps/) |
28 | -install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/audience.desktop DESTINATION ${DATADIR}/applications/) |
29 | +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/16/audience.svg DESTINATION ${DATADIR}/icons/hicolor/16x16/apps/) |
30 | +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/24/audience.svg DESTINATION ${DATADIR}/icons/hicolor/24x24/apps/) |
31 | +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/32/audience.svg DESTINATION ${DATADIR}/icons/hicolor/32x32/apps/) |
32 | +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/48/audience.svg DESTINATION ${DATADIR}/icons/hicolor/48x48/apps/) |
33 | +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/64/audience.svg DESTINATION ${DATADIR}/icons/hicolor/64x64/apps/) |
34 | +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/128/audience.svg DESTINATION ${DATADIR}/icons/hicolor/128x128/apps/) |
35 | +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/audience.desktop DESTINATION ${DATADIR}/applications/) |
36 | |
37 | # Configure file |
38 | -configure_file (${CMAKE_SOURCE_DIR}/Audience/Config.vala.cmake ${CMAKE_BINARY_DIR}/Audience/Config.vala) |
39 | -add_definitions(-DGETTEXT_PACKAGE="audience") |
40 | +configure_file (${CMAKE_SOURCE_DIR}/src/Config.vala.cmake ${CMAKE_BINARY_DIR}/src/Config.vala) |
41 | |
42 | set (CPACK_PACKAGE_VERSION ${VERSION}) |
43 | set (CPACK_SOURCE_GENERATOR "TGZ") |
44 | @@ -35,48 +37,42 @@ |
45 | add_custom_target (dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source) |
46 | |
47 | find_package(PkgConfig) |
48 | -pkg_check_modules(CLUTTER_GST_1 QUIET clutter-gst-2.0) |
49 | -if (CLUTTER_GST_1_FOUND) |
50 | - set(CLUTTER_GST_FLAGS "--define=HAS_CLUTTER_GST_1") |
51 | - set(GST_PACKAGES gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-tag-1.0) |
52 | -else (CLUTTER_GST_1_FOUND) |
53 | - set(CLUTTER_GST_FLAGS "") |
54 | - set(GST_PACKAGES gstreamer-0.10 gstreamer-pbutils-0.10 gstreamer-tag-0.10 gstreamer-interfaces-0.10) |
55 | -endif (CLUTTER_GST_1_FOUND) |
56 | - |
57 | -pkg_check_modules(DEPS REQUIRED granite clutter-gtk-1.0 ${GST_PACKAGES}) |
58 | - |
59 | -add_definitions(${DEPS_CFLAGS}) |
60 | -link_libraries(${DEPS_LIBRARIES}) |
61 | -link_directories(${DEPS_LIBRARY_DIRS}) |
62 | -find_package(Vala REQUIRED) |
63 | -include(ValaVersion) |
64 | +pkg_check_modules(DEPS REQUIRED granite clutter-gtk-1.0 gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-tag-1.0) |
65 | + |
66 | +add_definitions (${DEPS_CFLAGS}) |
67 | +link_libraries (${DEPS_LIBRARIES}) |
68 | +link_directories (${DEPS_LIBRARY_DIRS}) |
69 | +find_package (Vala REQUIRED) |
70 | +include (ValaVersion) |
71 | |
72 | ensure_vala_version("0.16.1" MINIMUM) |
73 | |
74 | include(ValaPrecompile) |
75 | vala_precompile(VALA_C |
76 | - Audience/Audience.vala |
77 | - Audience/Consts.vala |
78 | - Audience/Settings.vala |
79 | - Audience/Utils.vala |
80 | - ${CMAKE_BINARY_DIR}/Audience/Config.vala |
81 | - Audience/Widgets/TagView.vala |
82 | - Audience/Widgets/Button.vala |
83 | - Audience/Widgets/ControlsBar.vala |
84 | - Audience/Widgets/LLabel.vala |
85 | - Audience/Widgets/MediaSlider.vala |
86 | - Audience/Widgets/TopPanel.vala |
87 | - Audience/Widgets/Playlist.vala |
88 | - Audience/Widgets/VideoPlayer.vala |
89 | - Audience/desktop-launcher.vala |
90 | + ${CMAKE_BINARY_DIR}/src/Config.vala |
91 | + src/Audience.vala |
92 | + src/Consts.vala |
93 | + src/Settings.vala |
94 | + src/Utils.vala |
95 | + src/Widgets/TagView.vala |
96 | + src/Widgets/Button.vala |
97 | + src/Widgets/ControlsBar.vala |
98 | + src/Widgets/LLabel.vala |
99 | + src/Widgets/MediaSlider.vala |
100 | + src/Widgets/TopPanel.vala |
101 | + src/Widgets/Playlist.vala |
102 | + src/Widgets/VideoPlayer.vala |
103 | + src/desktop-launcher.vala |
104 | PACKAGES |
105 | granite |
106 | clutter-gtk-1.0 |
107 | gdk-x11-3.0 |
108 | - ${GST_PACKAGES} |
109 | + gstreamer-1.0 |
110 | + gstreamer-pbutils-1.0 |
111 | + gstreamer-tag-1.0 |
112 | OPTIONS |
113 | - ${CLUTTER_GST_FLAGS} |
114 | + --enable-experimental |
115 | + --target-glib=2.32 |
116 | --thread |
117 | -g |
118 | ) |
119 | @@ -86,8 +82,8 @@ |
120 | add_schema ("data/org.pantheon.audience.gschema.xml") |
121 | |
122 | add_subdirectory (po) |
123 | -add_executable(audience ${VALA_C}) |
124 | -install (TARGETS audience RUNTIME DESTINATION bin) |
125 | +add_executable(${CMAKE_PROJECT_NAME} ${VALA_C}) |
126 | +install (TARGETS ${CMAKE_PROJECT_NAME} RUNTIME DESTINATION bin) |
127 | |
128 | # uninstall target |
129 | configure_file( |
130 | |
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 | |
137 | public static dynamic Gst.Element get_clutter_sink () |
138 | { |
139 | -#if HAS_CLUTTER_GST_1 |
140 | var sink = Gst.ElementFactory.make ("autocluttersink", "videosink"); |
141 | if (sink == null) { |
142 | warning ("autocluttersink not available"); |
143 | sink = Gst.ElementFactory.make ("cluttersink", "videosink"); |
144 | } |
145 | -#else |
146 | - var sink = Gst.ElementFactory.make ("cluttersink", "videosink"); |
147 | -#endif |
148 | |
149 | return sink; |
150 | } |
151 | @@ -256,4 +252,4 @@ |
152 | |
153 | |
154 | } |
155 | -} |
156 | +} |
157 | \ No newline at end of file |
158 | |
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 | // preview.width is set in VideoPlayer.vala |
164 | |
165 | // connect gstreamer stuff |
166 | -#if HAS_CLUTTER_GST_1 |
167 | preview_playbin = Gst.ElementFactory.make ("playbin", "play"); |
168 | -#else |
169 | - preview_playbin = Gst.ElementFactory.make ("playbin2", "play"); |
170 | -#endif |
171 | preview_playbin.get_bus ().add_signal_watch (); |
172 | preview_playbin.get_bus ().message.connect ((msg) => { |
173 | switch (msg.type) { |
174 | @@ -142,12 +138,7 @@ |
175 | //buffering |
176 | if (this._buffered != 0.0){ |
177 | int64 duration; |
178 | -#if HAS_CLUTTER_GST_1 |
179 | preview_playbin.query_duration (Gst.Format.TIME, out duration); |
180 | -#else |
181 | - var time = Gst.Format.TIME; |
182 | - preview_playbin.query_duration (ref time, out duration); |
183 | -#endif |
184 | Drawing.cairo_half_pill (ctx, 2, 2, |
185 | (this._buffered / duration * this.bar.width) - 4, BAR_HEIGHT - 4, Gtk.PositionType.RIGHT); |
186 | ctx.set_source_rgb (0.6, 0.6, 0.6); |
187 | @@ -234,12 +225,7 @@ |
188 | } |
189 | |
190 | int64 duration; |
191 | -#if HAS_CLUTTER_GST_1 |
192 | preview_playbin.query_duration (Gst.Format.TIME, out duration); |
193 | -#else |
194 | - var time = Gst.Format.TIME; |
195 | - preview_playbin.query_duration (ref time, out duration); |
196 | -#endif |
197 | preview_playbin.seek (1.0, Gst.Format.TIME, Gst.SeekFlags.FLUSH | Gst.SeekFlags.KEY_UNIT, |
198 | Gst.SeekType.SET, (int64)(progress * duration), |
199 | Gst.SeekType.NONE, (int64)Gst.CLOCK_TIME_NONE); |
200 | @@ -250,4 +236,3 @@ |
201 | } |
202 | } |
203 | } |
204 | - |
205 | |
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 | |
211 | string desc; |
212 | string readable = null; |
213 | -#if HAS_CLUTTER_GST_1 |
214 | tags.get_string (Gst.Tags.LANGUAGE_CODE, out desc); |
215 | if (desc == null) |
216 | tags.get_string (Gst.Tags.CODEC, out desc); |
217 | - |
218 | + |
219 | if (desc != null) |
220 | readable = Gst.Tag.get_language_name (desc); |
221 | -#else |
222 | - tags.get_string (Gst.TAG_LANGUAGE_CODE, out desc); |
223 | - if (desc == null) |
224 | - tags.get_string (Gst.TAG_CODEC, out desc); |
225 | - |
226 | - if (desc != null) |
227 | - readable = Gst.tag_get_language_name (desc); |
228 | -#endif |
229 | + |
230 | if (target == "audio" && desc != null) { |
231 | this.languages.append (i.to_string (), readable == null ? desc : readable); |
232 | used ++; |
233 | } else if (desc != null) { |
234 | -#if HAS_CLUTTER_GST_1 |
235 | var language = Gst.Tag.get_language_name (desc); |
236 | -#else |
237 | - var language = Gst.tag_get_language_name (desc); |
238 | -#endif |
239 | this.subtitles.append (i.to_string (), language == null ? desc : language); |
240 | used ++; |
241 | } |
242 | @@ -259,4 +247,4 @@ |
243 | currently_parsing = false; |
244 | } |
245 | } |
246 | -} |
247 | +} |
248 | \ No newline at end of file |
249 | |
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 | get { |
255 | int64 length, prog; |
256 | |
257 | -#if HAS_CLUTTER_GST_1 |
258 | playbin.query_duration (Gst.Format.TIME, out length); |
259 | playbin.query_position (Gst.Format.TIME, out prog); |
260 | -#else |
261 | - var time = Gst.Format.TIME; |
262 | - playbin.query_duration (ref time, out length); |
263 | - playbin.query_position (ref time, out prog); |
264 | -#endif |
265 | |
266 | if (length == 0) |
267 | return 0; |
268 | @@ -71,12 +65,7 @@ |
269 | } |
270 | set { |
271 | int64 length; |
272 | -#if HAS_CLUTTER_GST_1 |
273 | playbin.query_duration (Gst.Format.TIME, out length); |
274 | -#else |
275 | - var time = Gst.Format.TIME; |
276 | - playbin.query_duration (ref time, out length); |
277 | -#endif |
278 | playbin.seek_simple (Gst.Format.TIME, Gst.SeekFlags.FLUSH | Gst.SeekFlags.ACCURATE, |
279 | (int64)(double.max (value, 0.0) * length)); |
280 | } |
281 | @@ -93,29 +82,17 @@ |
282 | |
283 | public string uri { |
284 | owned get { |
285 | -#if HAS_CLUTTER_GST_1 |
286 | return playbin.current_uri; |
287 | -#else |
288 | - return playbin.uri; |
289 | -#endif |
290 | } |
291 | set { |
292 | if (value == (string)playbin.uri) |
293 | return; |
294 | |
295 | try { |
296 | -#if HAS_CLUTTER_GST_1 |
297 | var info = new Gst.PbUtils.Discoverer (10 * Gst.SECOND).discover_uri (value); |
298 | -#else |
299 | - var info = new Gst.Discoverer (10 * Gst.SECOND).discover_uri (value); |
300 | -#endif |
301 | var video = info.get_video_streams (); |
302 | if (video.data != null) { |
303 | -#if HAS_CLUTTER_GST_1 |
304 | var video_info = (Gst.PbUtils.DiscovererVideoInfo)video.data; |
305 | -#else |
306 | - var video_info = (Gst.DiscovererVideoInfo)video.data; |
307 | -#endif |
308 | video_width = video_info.get_width (); |
309 | video_height = video_info.get_height (); |
310 | } |
311 | @@ -232,11 +209,7 @@ |
312 | video = new Clutter.Texture (); |
313 | video.reactive = true; |
314 | |
315 | -#if HAS_CLUTTER_GST_1 |
316 | playbin = Gst.ElementFactory.make ("playbin", "playbin"); |
317 | -#else |
318 | - playbin = Gst.ElementFactory.make ("playbin2", "playbin"); |
319 | -#endif |
320 | var video_sink = Audience.get_clutter_sink (); |
321 | video_sink.texture = video; |
322 | |
323 | @@ -253,14 +226,8 @@ |
324 | }); |
325 | Timeout.add (100, () => { |
326 | int64 length, prog; |
327 | -#if HAS_CLUTTER_GST_1 |
328 | playbin.query_position (Gst.Format.TIME, out prog); |
329 | playbin.query_duration (Gst.Format.TIME, out length); |
330 | -#else |
331 | - var format = Gst.Format.TIME; |
332 | - playbin.query_position (ref format, out prog); |
333 | - playbin.query_duration (ref format, out length); |
334 | -#endif |
335 | |
336 | if (length == 0) |
337 | return true; |
338 | @@ -379,11 +346,7 @@ |
339 | if (msg.get_structure () == null) |
340 | break; |
341 | |
342 | -#if HAS_CLUTTER_GST_1 |
343 | if (Gst.PbUtils.is_missing_plugin_message (msg)) { |
344 | -#else |
345 | - if (Gst.is_missing_plugin_message (msg)) { |
346 | -#endif |
347 | error (); |
348 | playbin.set_state (Gst.State.NULL); |
349 | |
350 | @@ -456,12 +419,7 @@ |
351 | void apply_subtitles () |
352 | { |
353 | int64 time; |
354 | -#if HAS_CLUTTER_GST_1 |
355 | playbin.query_position (Gst.Format.TIME, out time); |
356 | -#else |
357 | - var format = Gst.Format.TIME; |
358 | - playbin.query_position (ref format, out time); |
359 | -#endif |
360 | |
361 | playbin.get_state (null, null, Gst.CLOCK_TIME_NONE); |
362 | |
363 | @@ -548,11 +506,7 @@ |
364 | |
365 | void handle_missing_plugin (Gst.Message msg) |
366 | { |
367 | -#if HAS_CLUTTER_GST_1 |
368 | var detail = Gst.PbUtils.missing_plugin_message_get_description (msg); |
369 | -#else |
370 | - var detail = Gst.missing_plugin_message_get_description (msg); |
371 | -#endif |
372 | var dlg = new Gtk.Dialog.with_buttons ("Missing plugin", null, |
373 | Gtk.DialogFlags.MODAL); |
374 | var grid = new Gtk.Grid (); |
375 | @@ -574,15 +528,9 @@ |
376 | |
377 | dlg.show_all (); |
378 | if (dlg.run () == 0) { |
379 | -#if HAS_CLUTTER_GST_1 |
380 | var installer = Gst.PbUtils.missing_plugin_message_get_installer_detail (msg); |
381 | var context = new Gst.PbUtils.InstallPluginsContext (); |
382 | Gst.PbUtils.install_plugins_async ({installer}, context, |
383 | -#else |
384 | - var installer = Gst.missing_plugin_message_get_installer_detail (msg); |
385 | - var context = new Gst.InstallPluginsContext (); |
386 | - Gst.install_plugins_async ({installer}, context, |
387 | -#endif |
388 | () => { //finished |
389 | debug ("Finished plugin install\n"); |
390 | Gst.update_registry (); |
391 | @@ -645,4 +593,4 @@ |
392 | } catch (Error e) { warning (e.message); } |
393 | } |
394 | } |
395 | -} |
396 | +} |
397 | \ No newline at end of file |