Skip to content

Commit

Permalink
Release v3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jodal committed Feb 15, 2016
2 parents ce6414e + 6e923e8 commit c8ae315
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ before_install:
- "wget -q -O - https://apt.mopidy.com/mopidy.gpg | sudo apt-key add -"
- "sudo wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/jessie.list"
- "sudo apt-get update -qq"
- "sudo apt-get install -y python-gst0.10 libffi-dev libspotify-dev python-all-dev"
- "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"

install:
- "pip install tox"
Expand Down
9 changes: 9 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Changelog
=========

v3.0.0 (2016-02-15)
-------------------

Feature release.

- Require Mopidy 2.0.

- Minor adjustments to work with GStreamer 1.

v2.3.1 (2016-02-14)
-------------------

Expand Down
2 changes: 1 addition & 1 deletion mopidy_spotify/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from mopidy import config, ext


__version__ = '2.3.1'
__version__ = '3.0.0'


class Extension(ext.Extension):
Expand Down
23 changes: 3 additions & 20 deletions mopidy_spotify/playback.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@


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

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

future = self.audio.set_appsrc(
LIBSPOTIFY_GST_CAPS,
GST_CAPS,
need_data=need_data_callback_bound,
enough_data=enough_data_callback_bound,
seek_data=seek_data_callback_bound)
Expand Down Expand Up @@ -163,23 +160,9 @@ def music_delivery_callback(
audio_format.sample_type == spotify.SampleType.INT16_NATIVE_ENDIAN)
assert known_format, 'Expects 16-bit signed integer samples'

capabilites = """
audio/x-raw-int,
endianness=(int)1234,
channels=(int)%(channels)d,
width=(int)16,
depth=(int)16,
signed=(boolean)true,
rate=(int)%(sample_rate)d
""" % {
'channels': audio_format.channels,
'sample_rate': audio_format.sample_rate,
}

duration = audio.calculate_duration(num_frames, audio_format.sample_rate)
buffer_ = audio.create_buffer(
bytes(frames), capabilites=capabilites,
timestamp=buffer_timestamp.get(), duration=duration)
bytes(frames), timestamp=buffer_timestamp.get(), duration=duration)

# We must block here to know if the buffer was consumed successfully.
consumed = audio_actor.emit_data(buffer_).get()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get_version(filename):
zip_safe=False,
include_package_data=True,
install_requires=[
'Mopidy >= 1.1, < 2',
'Mopidy >= 2.0',
'Pykka >= 1.1',
'pyspotify >= 2.0.5',
'requests >= 2.0',
Expand Down
4 changes: 2 additions & 2 deletions tests/test_playback.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def test_change_track_sets_up_appsrc(audio_mock, provider):
assert provider._buffer_timestamp.get() == 0
assert audio_mock.prepare_change.call_count == 0
audio_mock.set_appsrc.assert_called_once_with(
playback.LIBSPOTIFY_GST_CAPS,
playback.GST_CAPS,
need_data=mock.ANY, enough_data=mock.ANY, seek_data=mock.ANY)
assert audio_mock.start_playback.call_count == 0
audio_mock.set_metadata.assert_called_once_with(track)
Expand Down Expand Up @@ -302,7 +302,7 @@ def test_music_delivery_creates_gstreamer_buffer_and_gives_it_to_audio(

audio_lib_mock.calculate_duration.assert_called_once_with(1, 44100)
audio_lib_mock.create_buffer.assert_called_once_with(
frames, capabilites=mock.ANY, timestamp=mock.sentinel.timestamp,
frames, timestamp=mock.sentinel.timestamp,
duration=mock.sentinel.duration)
buffer_timestamp.increase.assert_called_once_with(mock.sentinel.duration)
audio_mock.emit_data.assert_called_once_with(mock.sentinel.gst_buffer)
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ envlist = py27, flake8
[testenv]
sitepackages = true
deps =
https://github.com/mopidy/mopidy/archive/develop.zip
-rdev-requirements.txt
commands =
py.test \
Expand Down

0 comments on commit c8ae315

Please sign in to comment.