Skip to content

Commit

Permalink
Remove StreamTags message
Browse files Browse the repository at this point in the history
  • Loading branch information
badaix committed Jan 31, 2023
1 parent 97e84f3 commit a3cd985
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 115 deletions.
8 changes: 0 additions & 8 deletions client/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,6 @@ void Controller::getNextMessage()
player_->setVolume(serverSettings_->getVolume() / 100., serverSettings_->isMuted());
// }
}
// else if (response->type == message_type::kStreamTags)
// {
// if (meta_)
// {
// auto stream_tags = msg::message_cast<msg::StreamTags>(std::move(response));
// meta_->push(stream_tags->msg);
// }
// }
else
{
LOG(WARNING, LOG_TAG) << "Unexpected message received, type: " << response->type << "\n";
Expand Down
4 changes: 1 addition & 3 deletions common/message/factory.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***
This file is part of snapcast
Copyright (C) 2014-2022 Johannes Pohl
Copyright (C) 2014-2023 Johannes Pohl
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -75,8 +75,6 @@ static std::unique_ptr<BaseMessage> createMessage(const BaseMessage& base_messag
return createMessage<Hello>(base_message, buffer);
case message_type::kServerSettings:
return createMessage<ServerSettings>(base_message, buffer);
// case message_type::kStreamTags:
// return createMessage<StreamTags>(base_message, buffer);
case message_type::kTime:
return createMessage<Time>(base_message, buffer);
case message_type::kWireChunk:
Expand Down
7 changes: 2 additions & 5 deletions common/message/message.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***
This file is part of snapcast
Copyright (C) 2014-2022 Johannes Pohl
Copyright (C) 2014-2023 Johannes Pohl
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -63,7 +63,7 @@ enum class message_type : uint16_t
kServerSettings = 3,
kTime = 4,
kHello = 5,
kStreamTags = 6,
// kStreamTags = 6,
kClientInfo = 7,

kFirst = kBase,
Expand Down Expand Up @@ -92,9 +92,6 @@ static std::ostream& operator<<(std::ostream& os, const message_type& msg_type)
case message_type::kHello:
os << "Hello";
break;
case message_type::kStreamTags:
os << "StreamTags";
break;
case message_type::kClientInfo:
os << "ClientInfo";
break;
Expand Down
80 changes: 0 additions & 80 deletions common/message/stream_tags.hpp

This file was deleted.

18 changes: 0 additions & 18 deletions doc/binary_protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ When a client joins a server, the following exchanges happen
1. Client opens a TCP socket to the server (default port is 1704)
1. Client sends a [Hello](#hello) message
1. Server sends a [Server Settings](#server-settings) message
1. Server sends a [Stream Tags](#stream-tags) message
1. Server sends a [Codec Header](#codec-header) message
1. Until the server sends this, the client shouldn't play any [Wire Chunk](#wire-chunk) messages
1. The server will now send [Wire Chunk](#wire-chunk) messages, which can be fed to the audio decoder.
Expand Down Expand Up @@ -123,20 +122,3 @@ Sample JSON payload (whitespace added for readability):
"Version": "0.17.1"
}
```

### Stream Tags

| Field | Type | Description |
|---------|--------|----------------------------------------------------------------|
| size | uint32 | Size of the following JSON string |
| payload | char[] | JSON string containing the message (not null terminated) |

Sample JSON payload (whitespace added for readability):

```json
{
"STREAM": "default"
}
```

[According to the source](https://github.com/badaix/snapcast/blob/master/common/message/stream_tags.hpp#L55-L56), these tags can vary based on the stream.
1 change: 0 additions & 1 deletion server/stream_server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class StreamServer : public StreamMessageReceiver
// void send(const msg::BaseMessage* message);

void addSession(std::shared_ptr<StreamSession> session);
// void onMetadataChanged(const PcmStream* pcmStream, std::shared_ptr<msg::StreamTags> meta);
void onChunkEncoded(const PcmStream* pcmStream, bool isDefaultStream, std::shared_ptr<msg::PcmChunk> chunk, double duration);

session_ptr getStreamSession(const std::string& clientId) const;
Expand Down

0 comments on commit a3cd985

Please sign in to comment.