Merge lp:~tintou/audience/remove-gst-0.10 into lp:~audience-members/audience/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
Reviewer Review Type Date Requested Status
Audience Members Pending
Review via email: mp+217896@code.launchpad.net

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
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2014-01-11 14:55:28 +0000
+++ CMakeLists.txt 2014-05-01 09:17:54 +0000
@@ -6,25 +6,27 @@
66
7project (audience)7project (audience)
88
9set (DATADIR "${CMAKE_INSTALL_PREFIX}/share")9set (DATADIR ${CMAKE_INSTALL_PREFIX}/share)
10set (PKGDATADIR "${DATADIR}/audience")10set (PKGDATADIR ${DATADIR}/${CMAKE_PROJECT_NAME})
11set (GETTEXT_PACKAGE "audience")11set (GETTEXT_PACKAGE ${CMAKE_PROJECT_NAME})
12set (RELEASE_NAME "A modern media player.")12set (RELEASE_NAME "A modern media player.")
13set (VERSION "0.1")13set (VERSION "0.1")
14set (VERSION_INFO "The Red Comet")14set (VERSION_INFO "The Red Comet")
1515
16add_definitions (-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\")
17add_definitions (-w)
18
16# Data19# Data
17install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/16/audience.svg DESTINATION ${DATADIR}/icons/hicolor/16x16/apps/)20install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/16/audience.svg DESTINATION ${DATADIR}/icons/hicolor/16x16/apps/)
18install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/24/audience.svg DESTINATION ${DATADIR}/icons/hicolor/24x24/apps/)21install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/24/audience.svg DESTINATION ${DATADIR}/icons/hicolor/24x24/apps/)
19install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/32/audience.svg DESTINATION ${DATADIR}/icons/hicolor/32x32/apps/)22install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/32/audience.svg DESTINATION ${DATADIR}/icons/hicolor/32x32/apps/)
20install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/48/audience.svg DESTINATION ${DATADIR}/icons/hicolor/48x48/apps/)23install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/48/audience.svg DESTINATION ${DATADIR}/icons/hicolor/48x48/apps/)
21install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/64/audience.svg DESTINATION ${DATADIR}/icons/hicolor/64x64/apps/)24install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/64/audience.svg DESTINATION ${DATADIR}/icons/hicolor/64x64/apps/)
22install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/128/audience.svg DESTINATION ${DATADIR}/icons/hicolor/128x128/apps/)25install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/128/audience.svg DESTINATION ${DATADIR}/icons/hicolor/128x128/apps/)
23install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/audience.desktop DESTINATION ${DATADIR}/applications/)26install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/audience.desktop DESTINATION ${DATADIR}/applications/)
2427
25# Configure file28# Configure file
26configure_file (${CMAKE_SOURCE_DIR}/Audience/Config.vala.cmake ${CMAKE_BINARY_DIR}/Audience/Config.vala)29configure_file (${CMAKE_SOURCE_DIR}/src/Config.vala.cmake ${CMAKE_BINARY_DIR}/src/Config.vala)
27add_definitions(-DGETTEXT_PACKAGE="audience")
2830
29set (CPACK_PACKAGE_VERSION ${VERSION})31set (CPACK_PACKAGE_VERSION ${VERSION})
30set (CPACK_SOURCE_GENERATOR "TGZ")32set (CPACK_SOURCE_GENERATOR "TGZ")
@@ -35,48 +37,42 @@
35add_custom_target (dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)37add_custom_target (dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
3638
37find_package(PkgConfig)39find_package(PkgConfig)
38pkg_check_modules(CLUTTER_GST_1 QUIET clutter-gst-2.0)40pkg_check_modules(DEPS REQUIRED granite clutter-gtk-1.0 gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-tag-1.0)
39if (CLUTTER_GST_1_FOUND)41
40 set(CLUTTER_GST_FLAGS "--define=HAS_CLUTTER_GST_1")42add_definitions (${DEPS_CFLAGS})
41 set(GST_PACKAGES gstreamer-1.0 gstreamer-pbutils-1.0 gstreamer-tag-1.0)43link_libraries (${DEPS_LIBRARIES})
42else (CLUTTER_GST_1_FOUND)44link_directories (${DEPS_LIBRARY_DIRS})
43 set(CLUTTER_GST_FLAGS "")45find_package (Vala REQUIRED)
44 set(GST_PACKAGES gstreamer-0.10 gstreamer-pbutils-0.10 gstreamer-tag-0.10 gstreamer-interfaces-0.10)46include (ValaVersion)
45endif (CLUTTER_GST_1_FOUND)
46
47pkg_check_modules(DEPS REQUIRED granite clutter-gtk-1.0 ${GST_PACKAGES})
48
49add_definitions(${DEPS_CFLAGS})
50link_libraries(${DEPS_LIBRARIES})
51link_directories(${DEPS_LIBRARY_DIRS})
52find_package(Vala REQUIRED)
53include(ValaVersion)
5447
55ensure_vala_version("0.16.1" MINIMUM)48ensure_vala_version("0.16.1" MINIMUM)
5649
57include(ValaPrecompile)50include(ValaPrecompile)
58vala_precompile(VALA_C51vala_precompile(VALA_C
59 Audience/Audience.vala52 ${CMAKE_BINARY_DIR}/src/Config.vala
60 Audience/Consts.vala53 src/Audience.vala
61 Audience/Settings.vala54 src/Consts.vala
62 Audience/Utils.vala55 src/Settings.vala
63 ${CMAKE_BINARY_DIR}/Audience/Config.vala56 src/Utils.vala
64 Audience/Widgets/TagView.vala57 src/Widgets/TagView.vala
65 Audience/Widgets/Button.vala58 src/Widgets/Button.vala
66 Audience/Widgets/ControlsBar.vala59 src/Widgets/ControlsBar.vala
67 Audience/Widgets/LLabel.vala60 src/Widgets/LLabel.vala
68 Audience/Widgets/MediaSlider.vala61 src/Widgets/MediaSlider.vala
69 Audience/Widgets/TopPanel.vala62 src/Widgets/TopPanel.vala
70 Audience/Widgets/Playlist.vala63 src/Widgets/Playlist.vala
71 Audience/Widgets/VideoPlayer.vala64 src/Widgets/VideoPlayer.vala
72 Audience/desktop-launcher.vala65 src/desktop-launcher.vala
73PACKAGES66PACKAGES
74 granite67 granite
75 clutter-gtk-1.068 clutter-gtk-1.0
76 gdk-x11-3.069 gdk-x11-3.0
77 ${GST_PACKAGES}70 gstreamer-1.0
71 gstreamer-pbutils-1.0
72 gstreamer-tag-1.0
78OPTIONS73OPTIONS
79 ${CLUTTER_GST_FLAGS}74 --enable-experimental
75 --target-glib=2.32
80 --thread76 --thread
81 -g77 -g
82)78)
@@ -86,8 +82,8 @@
86add_schema ("data/org.pantheon.audience.gschema.xml")82add_schema ("data/org.pantheon.audience.gschema.xml")
8783
88add_subdirectory (po)84add_subdirectory (po)
89add_executable(audience ${VALA_C})85add_executable(${CMAKE_PROJECT_NAME} ${VALA_C})
90install (TARGETS audience RUNTIME DESTINATION bin)86install (TARGETS ${CMAKE_PROJECT_NAME} RUNTIME DESTINATION bin)
9187
92# uninstall target88# uninstall target
93configure_file(89configure_file(
9490
=== renamed directory 'Audience' => 'src'
=== modified file 'src/Utils.vala'
--- Audience/Utils.vala 2014-04-11 00:10:08 +0000
+++ src/Utils.vala 2014-05-01 09:17:54 +0000
@@ -87,15 +87,11 @@
8787
88 public static dynamic Gst.Element get_clutter_sink ()88 public static dynamic Gst.Element get_clutter_sink ()
89 {89 {
90#if HAS_CLUTTER_GST_1
91 var sink = Gst.ElementFactory.make ("autocluttersink", "videosink");90 var sink = Gst.ElementFactory.make ("autocluttersink", "videosink");
92 if (sink == null) {91 if (sink == null) {
93 warning ("autocluttersink not available");92 warning ("autocluttersink not available");
94 sink = Gst.ElementFactory.make ("cluttersink", "videosink");93 sink = Gst.ElementFactory.make ("cluttersink", "videosink");
95 }94 }
96#else
97 var sink = Gst.ElementFactory.make ("cluttersink", "videosink");
98#endif
9995
100 return sink;96 return sink;
101 }97 }
@@ -256,4 +252,4 @@
256252
257253
258 }254 }
259}255}
260\ No newline at end of file256\ No newline at end of file
261257
=== modified file 'src/Widgets/MediaSlider.vala'
--- Audience/Widgets/MediaSlider.vala 2013-05-19 17:10:26 +0000
+++ src/Widgets/MediaSlider.vala 2014-05-01 09:17:54 +0000
@@ -46,11 +46,7 @@
46 // preview.width is set in VideoPlayer.vala46 // preview.width is set in VideoPlayer.vala
4747
48 // connect gstreamer stuff48 // connect gstreamer stuff
49#if HAS_CLUTTER_GST_1
50 preview_playbin = Gst.ElementFactory.make ("playbin", "play");49 preview_playbin = Gst.ElementFactory.make ("playbin", "play");
51#else
52 preview_playbin = Gst.ElementFactory.make ("playbin2", "play");
53#endif
54 preview_playbin.get_bus ().add_signal_watch ();50 preview_playbin.get_bus ().add_signal_watch ();
55 preview_playbin.get_bus ().message.connect ((msg) => {51 preview_playbin.get_bus ().message.connect ((msg) => {
56 switch (msg.type) {52 switch (msg.type) {
@@ -142,12 +138,7 @@
142 //buffering138 //buffering
143 if (this._buffered != 0.0){139 if (this._buffered != 0.0){
144 int64 duration;140 int64 duration;
145#if HAS_CLUTTER_GST_1
146 preview_playbin.query_duration (Gst.Format.TIME, out duration);141 preview_playbin.query_duration (Gst.Format.TIME, out duration);
147#else
148 var time = Gst.Format.TIME;
149 preview_playbin.query_duration (ref time, out duration);
150#endif
151 Drawing.cairo_half_pill (ctx, 2, 2,142 Drawing.cairo_half_pill (ctx, 2, 2,
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);
153 ctx.set_source_rgb (0.6, 0.6, 0.6);144 ctx.set_source_rgb (0.6, 0.6, 0.6);
@@ -234,12 +225,7 @@
234 }225 }
235226
236 int64 duration;227 int64 duration;
237#if HAS_CLUTTER_GST_1
238 preview_playbin.query_duration (Gst.Format.TIME, out duration);228 preview_playbin.query_duration (Gst.Format.TIME, out duration);
239#else
240 var time = Gst.Format.TIME;
241 preview_playbin.query_duration (ref time, out duration);
242#endif
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,
244 Gst.SeekType.SET, (int64)(progress * duration),230 Gst.SeekType.SET, (int64)(progress * duration),
245 Gst.SeekType.NONE, (int64)Gst.CLOCK_TIME_NONE);231 Gst.SeekType.NONE, (int64)Gst.CLOCK_TIME_NONE);
@@ -250,4 +236,3 @@
250 }236 }
251 }237 }
252}238}
253
254239
=== modified file 'src/Widgets/TagView.vala'
--- Audience/Widgets/TagView.vala 2014-04-10 06:50:38 +0000
+++ src/Widgets/TagView.vala 2014-05-01 09:17:54 +0000
@@ -207,30 +207,18 @@
207 207
208 string desc;208 string desc;
209 string readable = null;209 string readable = null;
210#if HAS_CLUTTER_GST_1
211 tags.get_string (Gst.Tags.LANGUAGE_CODE, out desc);210 tags.get_string (Gst.Tags.LANGUAGE_CODE, out desc);
212 if (desc == null)211 if (desc == null)
213 tags.get_string (Gst.Tags.CODEC, out desc);212 tags.get_string (Gst.Tags.CODEC, out desc);
214 213
215 if (desc != null)214 if (desc != null)
216 readable = Gst.Tag.get_language_name (desc);215 readable = Gst.Tag.get_language_name (desc);
217#else216
218 tags.get_string (Gst.TAG_LANGUAGE_CODE, out desc);
219 if (desc == null)
220 tags.get_string (Gst.TAG_CODEC, out desc);
221
222 if (desc != null)
223 readable = Gst.tag_get_language_name (desc);
224#endif
225 if (target == "audio" && desc != null) {217 if (target == "audio" && desc != null) {
226 this.languages.append (i.to_string (), readable == null ? desc : readable);218 this.languages.append (i.to_string (), readable == null ? desc : readable);
227 used ++;219 used ++;
228 } else if (desc != null) {220 } else if (desc != null) {
229#if HAS_CLUTTER_GST_1
230 var language = Gst.Tag.get_language_name (desc);221 var language = Gst.Tag.get_language_name (desc);
231#else
232 var language = Gst.tag_get_language_name (desc);
233#endif
234 this.subtitles.append (i.to_string (), language == null ? desc : language);222 this.subtitles.append (i.to_string (), language == null ? desc : language);
235 used ++;223 used ++;
236 }224 }
@@ -259,4 +247,4 @@
259 currently_parsing = false;247 currently_parsing = false;
260 }248 }
261 }249 }
262}250}
263\ No newline at end of file251\ No newline at end of file
264252
=== modified file 'src/Widgets/VideoPlayer.vala'
--- Audience/Widgets/VideoPlayer.vala 2013-12-16 12:20:13 +0000
+++ src/Widgets/VideoPlayer.vala 2014-05-01 09:17:54 +0000
@@ -55,14 +55,8 @@
55 get {55 get {
56 int64 length, prog;56 int64 length, prog;
57 57
58#if HAS_CLUTTER_GST_1
59 playbin.query_duration (Gst.Format.TIME, out length);58 playbin.query_duration (Gst.Format.TIME, out length);
60 playbin.query_position (Gst.Format.TIME, out prog);59 playbin.query_position (Gst.Format.TIME, out prog);
61#else
62 var time = Gst.Format.TIME;
63 playbin.query_duration (ref time, out length);
64 playbin.query_position (ref time, out prog);
65#endif
66 60
67 if (length == 0)61 if (length == 0)
68 return 0;62 return 0;
@@ -71,12 +65,7 @@
71 }65 }
72 set {66 set {
73 int64 length;67 int64 length;
74#if HAS_CLUTTER_GST_1
75 playbin.query_duration (Gst.Format.TIME, out length);68 playbin.query_duration (Gst.Format.TIME, out length);
76#else
77 var time = Gst.Format.TIME;
78 playbin.query_duration (ref time, out length);
79#endif
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,
81 (int64)(double.max (value, 0.0) * length));70 (int64)(double.max (value, 0.0) * length));
82 }71 }
@@ -93,29 +82,17 @@
93 82
94 public string uri {83 public string uri {
95 owned get {84 owned get {
96#if HAS_CLUTTER_GST_1
97 return playbin.current_uri;85 return playbin.current_uri;
98#else
99 return playbin.uri;
100#endif
101 }86 }
102 set {87 set {
103 if (value == (string)playbin.uri)88 if (value == (string)playbin.uri)
104 return;89 return;
10590
106 try {91 try {
107#if HAS_CLUTTER_GST_1
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);
109#else
110 var info = new Gst.Discoverer (10 * Gst.SECOND).discover_uri (value);
111#endif
112 var video = info.get_video_streams ();93 var video = info.get_video_streams ();
113 if (video.data != null) {94 if (video.data != null) {
114#if HAS_CLUTTER_GST_1
115 var video_info = (Gst.PbUtils.DiscovererVideoInfo)video.data;95 var video_info = (Gst.PbUtils.DiscovererVideoInfo)video.data;
116#else
117 var video_info = (Gst.DiscovererVideoInfo)video.data;
118#endif
119 video_width = video_info.get_width ();96 video_width = video_info.get_width ();
120 video_height = video_info.get_height ();97 video_height = video_info.get_height ();
121 }98 }
@@ -232,11 +209,7 @@
232 video = new Clutter.Texture ();209 video = new Clutter.Texture ();
233 video.reactive = true;210 video.reactive = true;
234 211
235#if HAS_CLUTTER_GST_1
236 playbin = Gst.ElementFactory.make ("playbin", "playbin");212 playbin = Gst.ElementFactory.make ("playbin", "playbin");
237#else
238 playbin = Gst.ElementFactory.make ("playbin2", "playbin");
239#endif
240 var video_sink = Audience.get_clutter_sink ();213 var video_sink = Audience.get_clutter_sink ();
241 video_sink.texture = video;214 video_sink.texture = video;
242 215
@@ -253,14 +226,8 @@
253 });226 });
254 Timeout.add (100, () => {227 Timeout.add (100, () => {
255 int64 length, prog;228 int64 length, prog;
256#if HAS_CLUTTER_GST_1
257 playbin.query_position (Gst.Format.TIME, out prog);229 playbin.query_position (Gst.Format.TIME, out prog);
258 playbin.query_duration (Gst.Format.TIME, out length);230 playbin.query_duration (Gst.Format.TIME, out length);
259#else
260 var format = Gst.Format.TIME;
261 playbin.query_position (ref format, out prog);
262 playbin.query_duration (ref format, out length);
263#endif
264 231
265 if (length == 0)232 if (length == 0)
266 return true;233 return true;
@@ -379,11 +346,7 @@
379 if (msg.get_structure () == null)346 if (msg.get_structure () == null)
380 break;347 break;
381 348
382#if HAS_CLUTTER_GST_1
383 if (Gst.PbUtils.is_missing_plugin_message (msg)) {349 if (Gst.PbUtils.is_missing_plugin_message (msg)) {
384#else
385 if (Gst.is_missing_plugin_message (msg)) {
386#endif
387 error ();350 error ();
388 playbin.set_state (Gst.State.NULL);351 playbin.set_state (Gst.State.NULL);
389 352
@@ -456,12 +419,7 @@
456 void apply_subtitles ()419 void apply_subtitles ()
457 {420 {
458 int64 time;421 int64 time;
459#if HAS_CLUTTER_GST_1
460 playbin.query_position (Gst.Format.TIME, out time);422 playbin.query_position (Gst.Format.TIME, out time);
461#else
462 var format = Gst.Format.TIME;
463 playbin.query_position (ref format, out time);
464#endif
465423
466 playbin.get_state (null, null, Gst.CLOCK_TIME_NONE);424 playbin.get_state (null, null, Gst.CLOCK_TIME_NONE);
467425
@@ -548,11 +506,7 @@
548 506
549 void handle_missing_plugin (Gst.Message msg)507 void handle_missing_plugin (Gst.Message msg)
550 {508 {
551#if HAS_CLUTTER_GST_1
552 var detail = Gst.PbUtils.missing_plugin_message_get_description (msg);509 var detail = Gst.PbUtils.missing_plugin_message_get_description (msg);
553#else
554 var detail = Gst.missing_plugin_message_get_description (msg);
555#endif
556 var dlg = new Gtk.Dialog.with_buttons ("Missing plugin", null,510 var dlg = new Gtk.Dialog.with_buttons ("Missing plugin", null,
557 Gtk.DialogFlags.MODAL);511 Gtk.DialogFlags.MODAL);
558 var grid = new Gtk.Grid ();512 var grid = new Gtk.Grid ();
@@ -574,15 +528,9 @@
574528
575 dlg.show_all ();529 dlg.show_all ();
576 if (dlg.run () == 0) {530 if (dlg.run () == 0) {
577#if HAS_CLUTTER_GST_1
578 var installer = Gst.PbUtils.missing_plugin_message_get_installer_detail (msg);531 var installer = Gst.PbUtils.missing_plugin_message_get_installer_detail (msg);
579 var context = new Gst.PbUtils.InstallPluginsContext ();532 var context = new Gst.PbUtils.InstallPluginsContext ();
580 Gst.PbUtils.install_plugins_async ({installer}, context,533 Gst.PbUtils.install_plugins_async ({installer}, context,
581#else
582 var installer = Gst.missing_plugin_message_get_installer_detail (msg);
583 var context = new Gst.InstallPluginsContext ();
584 Gst.install_plugins_async ({installer}, context,
585#endif
586 () => { //finished534 () => { //finished
587 debug ("Finished plugin install\n");535 debug ("Finished plugin install\n");
588 Gst.update_registry ();536 Gst.update_registry ();
@@ -645,4 +593,4 @@
645 } catch (Error e) { warning (e.message); }593 } catch (Error e) { warning (e.message); }
646 }594 }
647 }595 }
648}596}
649\ No newline at end of file597\ No newline at end of file

Subscribers

People subscribed via source and target branches