Skip to content

Commit c8ae315

Browse files
committed
Release v3.0.0
2 parents ce6414e + 6e923e8 commit c8ae315

File tree

7 files changed

+18
-25
lines changed

7 files changed

+18
-25
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ before_install:
1414
- "wget -q -O - https://apt.mopidy.com/mopidy.gpg | sudo apt-key add -"
1515
- "sudo wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/jessie.list"
1616
- "sudo apt-get update -qq"
17-
- "sudo apt-get install -y python-gst0.10 libffi-dev libspotify-dev python-all-dev"
17+
- "sudo apt-get install -y gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0 python-gst-1.0 libffi-dev libspotify-dev python-all-dev"
1818

1919
install:
2020
- "pip install tox"

CHANGES.rst

+9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
Changelog
22
=========
33

4+
v3.0.0 (2016-02-15)
5+
-------------------
6+
7+
Feature release.
8+
9+
- Require Mopidy 2.0.
10+
11+
- Minor adjustments to work with GStreamer 1.
12+
413
v2.3.1 (2016-02-14)
514
-------------------
615

mopidy_spotify/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from mopidy import config, ext
66

77

8-
__version__ = '2.3.1'
8+
__version__ = '3.0.0'
99

1010

1111
class Extension(ext.Extension):

mopidy_spotify/playback.py

+3-20
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@
1313

1414

1515
# These GStreamer caps matches the audio data provided by libspotify
16-
LIBSPOTIFY_GST_CAPS = (
17-
'audio/x-raw-int, endianness=(int)1234, channels=(int)2, '
18-
'width=(int)16, depth=(int)16, signed=(boolean)true, '
19-
'rate=(int)44100')
16+
GST_CAPS = 'audio/x-raw,format=S16LE,rate=44100,channels=2,layout=interleaved'
2017

2118
# Extra log level with lower importance than DEBUG=10 for noisy debug logging
2219
TRACE_LOG_LEVEL = 5
@@ -76,7 +73,7 @@ def change_track(self, track):
7673
self.backend._session.player.play()
7774

7875
future = self.audio.set_appsrc(
79-
LIBSPOTIFY_GST_CAPS,
76+
GST_CAPS,
8077
need_data=need_data_callback_bound,
8178
enough_data=enough_data_callback_bound,
8279
seek_data=seek_data_callback_bound)
@@ -163,23 +160,9 @@ def music_delivery_callback(
163160
audio_format.sample_type == spotify.SampleType.INT16_NATIVE_ENDIAN)
164161
assert known_format, 'Expects 16-bit signed integer samples'
165162

166-
capabilites = """
167-
audio/x-raw-int,
168-
endianness=(int)1234,
169-
channels=(int)%(channels)d,
170-
width=(int)16,
171-
depth=(int)16,
172-
signed=(boolean)true,
173-
rate=(int)%(sample_rate)d
174-
""" % {
175-
'channels': audio_format.channels,
176-
'sample_rate': audio_format.sample_rate,
177-
}
178-
179163
duration = audio.calculate_duration(num_frames, audio_format.sample_rate)
180164
buffer_ = audio.create_buffer(
181-
bytes(frames), capabilites=capabilites,
182-
timestamp=buffer_timestamp.get(), duration=duration)
165+
bytes(frames), timestamp=buffer_timestamp.get(), duration=duration)
183166

184167
# We must block here to know if the buffer was consumed successfully.
185168
consumed = audio_actor.emit_data(buffer_).get()

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def get_version(filename):
2424
zip_safe=False,
2525
include_package_data=True,
2626
install_requires=[
27-
'Mopidy >= 1.1, < 2',
27+
'Mopidy >= 2.0',
2828
'Pykka >= 1.1',
2929
'pyspotify >= 2.0.5',
3030
'requests >= 2.0',

tests/test_playback.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def test_change_track_sets_up_appsrc(audio_mock, provider):
114114
assert provider._buffer_timestamp.get() == 0
115115
assert audio_mock.prepare_change.call_count == 0
116116
audio_mock.set_appsrc.assert_called_once_with(
117-
playback.LIBSPOTIFY_GST_CAPS,
117+
playback.GST_CAPS,
118118
need_data=mock.ANY, enough_data=mock.ANY, seek_data=mock.ANY)
119119
assert audio_mock.start_playback.call_count == 0
120120
audio_mock.set_metadata.assert_called_once_with(track)
@@ -302,7 +302,7 @@ def test_music_delivery_creates_gstreamer_buffer_and_gives_it_to_audio(
302302

303303
audio_lib_mock.calculate_duration.assert_called_once_with(1, 44100)
304304
audio_lib_mock.create_buffer.assert_called_once_with(
305-
frames, capabilites=mock.ANY, timestamp=mock.sentinel.timestamp,
305+
frames, timestamp=mock.sentinel.timestamp,
306306
duration=mock.sentinel.duration)
307307
buffer_timestamp.increase.assert_called_once_with(mock.sentinel.duration)
308308
audio_mock.emit_data.assert_called_once_with(mock.sentinel.gst_buffer)

tox.ini

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ envlist = py27, flake8
44
[testenv]
55
sitepackages = true
66
deps =
7+
https://github.com/mopidy/mopidy/archive/develop.zip
78
-rdev-requirements.txt
89
commands =
910
py.test \

0 commit comments

Comments
 (0)