-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
70be782
commit aad708c
Showing
9 changed files
with
165 additions
and
28 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/ContentApp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright (c) 2022 Project CHIP Authors | ||
* All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
package com.chip.casting; | ||
|
||
public class ContentApp | ||
{ | ||
private short endpointId; | ||
private List<Integer> clusterIds; | ||
|
||
private boolean isInitialized = false; | ||
|
||
public ContentApp(short endpointId, List<Integer> clusterIds) { | ||
this.endpointId = endpointId; | ||
this.clusterIds = clusterIds; | ||
this.isInitialized = true; | ||
} | ||
|
||
public short getEndpointId() { | ||
return endpointId; | ||
} | ||
|
||
public List<Integer> getClusterIds() { | ||
return clusterIds; | ||
} | ||
|
||
public boolean isInitialized() { | ||
return isInitialized; | ||
} | ||
} |
92 changes: 92 additions & 0 deletions
92
examples/tv-casting-app/android/App/app/src/main/jni/com/chip/casting/VideoPlayer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* | ||
* Copyright (c) 2022 Project CHIP Authors | ||
* All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
package com.chip.casting; | ||
|
||
public class VideoPlayer | ||
{ | ||
private long nodeId; | ||
private byte fabricIndex; | ||
private String deviceName; | ||
private short vendorId; | ||
private short productId; | ||
private short deviceType; | ||
private List<ContentApp> contentApps; | ||
private boolean isConnected = false; | ||
|
||
private boolean isInitialized = false; | ||
|
||
public VideoPlayer(long nodeId, byte fabricIndex, String deviceName, short vendorId, short productId, short deviceType, List<ContentApp> contentApps, boolean isConnected) { | ||
this.nodeId = nodeId; | ||
this.fabricIndex = fabricIndex; | ||
this.deviceName = deviceName; | ||
this.vendorId = vendorId; | ||
this.productId = productId; | ||
this.deviceType = deviceType; | ||
this.contentApps = contentApps; | ||
this.isConnected = isConnected; | ||
this.isInitialized = true; | ||
} | ||
|
||
public boolean equals(Object object) { | ||
if (this == object) return true; | ||
if (object == null || getClass() != object.getClass()) return false; | ||
if (!super.equals(object)) return false; | ||
VideoPlayer that = (VideoPlayer) object; | ||
return nodeId == that.nodeId && fabricIndex == that.fabricIndex; | ||
} | ||
|
||
public int hashCode() { | ||
return Objects.hash(super.hashCode(), nodeId, fabricIndex); | ||
} | ||
|
||
public long getNodeId() { | ||
return nodeId; | ||
} | ||
|
||
public byte getFabricIndex() { | ||
return fabricIndex; | ||
} | ||
|
||
public boolean isConnected() { | ||
return isConnected; | ||
} | ||
|
||
public List<ContentApp> getContentApps() { | ||
return contentApps; | ||
} | ||
|
||
public String getDeviceName() { | ||
return deviceName; | ||
} | ||
|
||
public short getVendorId() { | ||
return vendorId; | ||
} | ||
|
||
public short getProductId() { | ||
return productId; | ||
} | ||
|
||
public short getDeviceType() { | ||
return deviceType; | ||
} | ||
|
||
public boolean isInitialized() { | ||
return isInitialized; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters