Skip to content

Commit

Permalink
Align naming in Media Playback cluster XML with the spec. (#24509)
Browse files Browse the repository at this point in the history
* Align naming in Media Playback cluster XML with the spec.

* Auto-update ZAP files.

* Regenerate generated code.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Nov 15, 2023
1 parent 9a09ecf commit 1761076
Show file tree
Hide file tree
Showing 55 changed files with 397 additions and 349 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18311,7 +18311,7 @@
"outgoing": 1
},
{
"name": "StopPlayback",
"name": "Stop",
"code": 2,
"mfgCode": null,
"source": "client",
Expand Down Expand Up @@ -18455,7 +18455,7 @@
"code": 3,
"mfgCode": null,
"side": "server",
"type": "PlaybackPosition",
"type": "PlaybackPositionStruct",
"included": 0,
"storageOption": "External",
"singleton": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2639,7 +2639,7 @@ server cluster MediaPlayback = 1286 {

command Play(): PlaybackResponse = 0;
command Pause(): PlaybackResponse = 1;
command StopPlayback(): PlaybackResponse = 2;
command Stop(): PlaybackResponse = 2;
}

server cluster MediaInput = 1287 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17811,7 +17811,7 @@
"outgoing": 1
},
{
"name": "StopPlayback",
"name": "Stop",
"code": 2,
"mfgCode": null,
"source": "client",
Expand Down Expand Up @@ -17965,7 +17965,7 @@
"code": 3,
"mfgCode": null,
"side": "server",
"type": "PlaybackPosition",
"type": "PlaybackPositionStruct",
"included": 0,
"storageOption": "External",
"singleton": 0,
Expand Down
2 changes: 1 addition & 1 deletion examples/thermostat/thermostat-common/thermostat.zap
Original file line number Diff line number Diff line change
Expand Up @@ -13401,7 +13401,7 @@
"outgoing": 1
},
{
"name": "StopPlayback",
"name": "Stop",
"code": 2,
"mfgCode": null,
"source": "client",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Commands::PlaybackResponse::Type AppMediaPlaybackManager::HandleMediaRequest(Med

CHIP_ERROR AppMediaPlaybackManager::HandleGetSampledPosition(AttributeValueEncoder & aEncoder)
{
Structs::PlaybackPosition::Type response;
Structs::PlaybackPositionStruct::Type response;
response.updatedAt = 0;
response.position = Nullable<uint64_t>(0);

Expand Down
12 changes: 6 additions & 6 deletions examples/tv-app/android/java/AppImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,12 @@ constexpr CommandId contentLauncherOutgoingCommands[] = {
};
// TODO: Sort out when the optional commands here should be listed.
constexpr CommandId mediaPlaybackIncomingCommands[] = {
app::Clusters::MediaPlayback::Commands::Play::Id, app::Clusters::MediaPlayback::Commands::Pause::Id,
app::Clusters::MediaPlayback::Commands::StopPlayback::Id, app::Clusters::MediaPlayback::Commands::StartOver::Id,
app::Clusters::MediaPlayback::Commands::Previous::Id, app::Clusters::MediaPlayback::Commands::Next::Id,
app::Clusters::MediaPlayback::Commands::Rewind::Id, app::Clusters::MediaPlayback::Commands::FastForward::Id,
app::Clusters::MediaPlayback::Commands::SkipForward::Id, app::Clusters::MediaPlayback::Commands::SkipBackward::Id,
app::Clusters::MediaPlayback::Commands::Seek::Id, kInvalidCommandId,
app::Clusters::MediaPlayback::Commands::Play::Id, app::Clusters::MediaPlayback::Commands::Pause::Id,
app::Clusters::MediaPlayback::Commands::Stop::Id, app::Clusters::MediaPlayback::Commands::StartOver::Id,
app::Clusters::MediaPlayback::Commands::Previous::Id, app::Clusters::MediaPlayback::Commands::Next::Id,
app::Clusters::MediaPlayback::Commands::Rewind::Id, app::Clusters::MediaPlayback::Commands::FastForward::Id,
app::Clusters::MediaPlayback::Commands::SkipForward::Id, app::Clusters::MediaPlayback::Commands::SkipBackward::Id,
app::Clusters::MediaPlayback::Commands::Seek::Id, kInvalidCommandId,
};
constexpr CommandId mediaPlaybackOutgoingCommands[] = {
app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id,
Expand Down
2 changes: 1 addition & 1 deletion examples/tv-app/android/java/MediaPlaybackManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ Commands::PlaybackResponse::Type MediaPlaybackManager::HandleMediaRequest(MediaP

CHIP_ERROR MediaPlaybackManager::HandleGetSampledPosition(AttributeValueEncoder & aEncoder)
{
Structs::PlaybackPosition::Type response;
Structs::PlaybackPositionStruct::Type response;
response.updatedAt = 0;
response.position = Nullable<uint64_t>(0);

Expand Down
12 changes: 6 additions & 6 deletions examples/tv-app/linux/AppImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,12 @@ constexpr CommandId contentLauncherOutgoingCommands[] = {
};
// TODO: Sort out when the optional commands here should be listed.
constexpr CommandId mediaPlaybackIncomingCommands[] = {
app::Clusters::MediaPlayback::Commands::Play::Id, app::Clusters::MediaPlayback::Commands::Pause::Id,
app::Clusters::MediaPlayback::Commands::StopPlayback::Id, app::Clusters::MediaPlayback::Commands::StartOver::Id,
app::Clusters::MediaPlayback::Commands::Previous::Id, app::Clusters::MediaPlayback::Commands::Next::Id,
app::Clusters::MediaPlayback::Commands::Rewind::Id, app::Clusters::MediaPlayback::Commands::FastForward::Id,
app::Clusters::MediaPlayback::Commands::SkipForward::Id, app::Clusters::MediaPlayback::Commands::SkipBackward::Id,
app::Clusters::MediaPlayback::Commands::Seek::Id, kInvalidCommandId,
app::Clusters::MediaPlayback::Commands::Play::Id, app::Clusters::MediaPlayback::Commands::Pause::Id,
app::Clusters::MediaPlayback::Commands::Stop::Id, app::Clusters::MediaPlayback::Commands::StartOver::Id,
app::Clusters::MediaPlayback::Commands::Previous::Id, app::Clusters::MediaPlayback::Commands::Next::Id,
app::Clusters::MediaPlayback::Commands::Rewind::Id, app::Clusters::MediaPlayback::Commands::FastForward::Id,
app::Clusters::MediaPlayback::Commands::SkipForward::Id, app::Clusters::MediaPlayback::Commands::SkipBackward::Id,
app::Clusters::MediaPlayback::Commands::Seek::Id, kInvalidCommandId,
};
constexpr CommandId mediaPlaybackOutgoingCommands[] = {
app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ using chip::app::AttributeValueEncoder;
using chip::app::CommandResponseHelper;
using MediaPlaybackDelegate = chip::app::Clusters::MediaPlayback::Delegate;
using PlaybackResponseType = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Type;
using PlaybackPositionType = chip::app::Clusters::MediaPlayback::Structs::PlaybackPosition::Type;
using PlaybackPositionType = chip::app::Clusters::MediaPlayback::Structs::PlaybackPositionStruct::Type;

class MediaPlaybackManager : public MediaPlaybackDelegate
{
Expand Down
8 changes: 4 additions & 4 deletions examples/tv-app/tv-common/tv-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1676,15 +1676,15 @@ server cluster MediaPlayback = 1286 {
kVariableSpeed = 0x2;
}

struct PlaybackPosition {
int64u updatedAt = 0;
struct PlaybackPositionStruct {
epoch_us updatedAt = 0;
nullable int64u position = 1;
}

readonly attribute PlaybackStateEnum currentState = 0;
readonly attribute nullable epoch_us startTime = 1;
readonly attribute nullable int64u duration = 2;
readonly attribute nullable PlaybackPosition sampledPosition = 3;
readonly attribute nullable PlaybackPositionStruct sampledPosition = 3;
readonly attribute single playbackSpeed = 4;
readonly attribute nullable int64u seekRangeEnd = 5;
readonly attribute nullable int64u seekRangeStart = 6;
Expand Down Expand Up @@ -1713,7 +1713,7 @@ server cluster MediaPlayback = 1286 {

command Play(): PlaybackResponse = 0;
command Pause(): PlaybackResponse = 1;
command StopPlayback(): PlaybackResponse = 2;
command Stop(): PlaybackResponse = 2;
command StartOver(): PlaybackResponse = 3;
command Previous(): PlaybackResponse = 4;
command Next(): PlaybackResponse = 5;
Expand Down
8 changes: 4 additions & 4 deletions examples/tv-app/tv-common/tv-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -8039,7 +8039,7 @@
"outgoing": 0
},
{
"name": "StopPlayback",
"name": "Stop",
"code": 2,
"mfgCode": null,
"source": "client",
Expand Down Expand Up @@ -8183,7 +8183,7 @@
"code": 3,
"mfgCode": null,
"side": "server",
"type": "PlaybackPosition",
"type": "PlaybackPositionStruct",
"included": 1,
"storageOption": "External",
"singleton": 0,
Expand Down Expand Up @@ -11129,7 +11129,7 @@
"outgoing": 1
},
{
"name": "StopPlayback",
"name": "Stop",
"code": 2,
"mfgCode": null,
"source": "client",
Expand Down Expand Up @@ -11291,7 +11291,7 @@
"code": 3,
"mfgCode": null,
"side": "server",
"type": "PlaybackPosition",
"type": "PlaybackPositionStruct",
"included": 1,
"storageOption": "External",
"singleton": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class PauseCommand : public MediaCommandBase<chip::app::Clusters::MediaPlayback:
CHIP_ERROR Invoke(std::function<void(CHIP_ERROR)> responseCallback);
};

class StopPlaybackCommand : public MediaCommandBase<chip::app::Clusters::MediaPlayback::Commands::StopPlayback::Type,
class StopPlaybackCommand : public MediaCommandBase<chip::app::Clusters::MediaPlayback::Commands::Stop::Type,
chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType>
{
public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ CHIP_ERROR PauseCommand::Invoke(std::function<void(CHIP_ERROR)> responseCallback

CHIP_ERROR StopPlaybackCommand::Invoke(std::function<void(CHIP_ERROR)> responseCallback)
{
MediaPlayback::Commands::StopPlayback::Type request;
MediaPlayback::Commands::Stop::Type request;
return MediaCommandBase::Invoke(request, responseCallback);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1785,7 +1785,7 @@ client cluster MediaPlayback = 1286 {

command Play(): PlaybackResponse = 0;
command Pause(): PlaybackResponse = 1;
command StopPlayback(): PlaybackResponse = 2;
command Stop(): PlaybackResponse = 2;
command StartOver(): PlaybackResponse = 3;
command Previous(): PlaybackResponse = 4;
command Next(): PlaybackResponse = 5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12573,7 +12573,7 @@
"outgoing": 1
},
{
"name": "StopPlayback",
"name": "Stop",
"code": 2,
"mfgCode": null,
"source": "client",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ bool emberAfMediaPlaybackClusterPauseCallback(app::CommandHandler * command, con
return true;
}

bool emberAfMediaPlaybackClusterStopPlaybackCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath,
const Commands::StopPlayback::DecodableType & commandData)
bool emberAfMediaPlaybackClusterStopCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath,
const Commands::Stop::DecodableType & commandData)
{
CHIP_ERROR err = CHIP_NO_ERROR;
EndpointId endpoint = commandPath.mEndpointId;
Expand Down
58 changes: 29 additions & 29 deletions src/app/tests/suites/TV_MediaPlaybackCluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ tests:
command: "readAttribute"
attribute: "SampledPosition"
response:
value: { updatedAt: 0, position: 0 }
value: { UpdatedAt: 0, Position: 0 }

- label: "Read attribute playback speed"
command: "readAttribute"
Expand All @@ -74,111 +74,111 @@ tests:
command: "play"
response:
values:
- name: "data"
- name: "Data"
value: "data response"
- name: "status"
- name: "Status"
value: 0

- label: "Media Playback Pause Command"
command: "pause"
response:
values:
- name: "data"
- name: "Data"
value: "data response"
- name: "status"
- name: "Status"
value: 0

- label: "Media Playback Stop Command"
command: "stopPlayback"
command: "Stop"
response:
values:
- name: "data"
- name: "Data"
value: "data response"
- name: "status"
- name: "Status"
value: 0

- label: "Media Playback Start Over Command"
command: "startOver"
response:
values:
- name: "data"
- name: "Data"
value: "data response"
- name: "status"
- name: "Status"
value: 0

- label: "Media Playback Previous Command"
command: "previous"
response:
values:
- name: "data"
- name: "Data"
value: "data response"
- name: "status"
- name: "Status"
value: 0

- label: "Media Playback Next Command"
command: "next"
response:
values:
- name: "data"
- name: "Data"
value: "data response"
- name: "status"
- name: "Status"
value: 0

- label: "Media Playback Rewind Command"
command: "rewind"
response:
values:
- name: "data"
- name: "Data"
value: "data response"
- name: "status"
- name: "Status"
value: 0

- label: "Media Playback Fast Forward Command"
command: "fastForward"
response:
values:
- name: "data"
- name: "Data"
value: "data response"
- name: "status"
- name: "Status"
value: 0

- label: "Media Playback Skip Forward Command"
command: "skipForward"
arguments:
values:
- name: "deltaPositionMilliseconds"
- name: "DeltaPositionMilliseconds"
value: 500
response:
values:
- name: "data"
- name: "Data"
value: "data response"
- name: "status"
- name: "Status"
value: 0

- label: "Read attribute position after skip forward"
command: "readAttribute"
attribute: "SampledPosition"
response:
value: { updatedAt: 0, position: 500 }
value: { UpdatedAt: 0, Position: 500 }

- label: "Media Playback Skip Backward Command"
command: "skipBackward"
arguments:
values:
- name: "deltaPositionMilliseconds"
- name: "DeltaPositionMilliseconds"
value: 100
response:
values:
- name: "data"
- name: "Data"
value: "data response"
- name: "status"
- name: "Status"
value: 0

- label: "Read attribute position after skip backward"
command: "readAttribute"
attribute: "SampledPosition"
response:
value: { updatedAt: 0, position: 400 }
value: { UpdatedAt: 0, Position: 400 }

- label: "Media Playback Seek Command"
command: "seek"
Expand All @@ -188,13 +188,13 @@ tests:
value: 1000
response:
values:
- name: "data"
- name: "Data"
value: "data response"
- name: "status"
- name: "Status"
value: 0

- label: "Read attribute position after seek"
command: "readAttribute"
attribute: "SampledPosition"
response:
value: { updatedAt: 0, position: 1000 }
value: { UpdatedAt: 0, Position: 1000 }
Loading

0 comments on commit 1761076

Please sign in to comment.