Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera disconnected + stream normalization improvements #1701

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the source and license for this image?

Copy link
Contributor Author

@DevonRD DevonRD Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't think of that when I found it, but after looking back it seems it was made by someone on a GitHub PR in 2020:
FAForever/downlords-faf-client#1665

Unsure if this is an issue. Opinions on this? There weren't many other good ones I could find that looked clean in this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repo is MIT licensed. But does that cover non-merged content? I’m not sure.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 11 additions & 5 deletions photon-client/src/components/app/photon-camera-stream.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<script setup lang="ts">
import { computed, inject, ref, onBeforeUnmount } from "vue";
import { useStateStore } from "@/stores/StateStore";
import loadingImage from "@/assets/images/loading.svg";
import loadingImage from "@/assets/images/loading-transparent.gif";
import type { StyleValue } from "vue/types/jsx";
import PvIcon from "@/components/common/pv-icon.vue";
import type { UiCameraConfiguration } from "@/types/SettingTypes";

const props = defineProps<{
streamType: "Raw" | "Processed";
id: string;
outerId?: string;
cameraSettings: UiCameraConfiguration;
}>();

Expand Down Expand Up @@ -91,7 +90,7 @@ onBeforeUnmount(() => {
</script>

<template>
<div :id="outerId" class="stream-container" :style="containerStyle">
<div class="stream-container" :style="containerStyle">
<img :src="loadingImage" class="stream-loading" />
<img
:id="id"
Expand Down Expand Up @@ -131,18 +130,25 @@ onBeforeUnmount(() => {
display: flex;
position: relative;
width: 100%;
height: 100%;
max-width: 100%;
max-height: 100%;
justify-content: center;
align-items: center;
}

.stream-loading {
position: absolute;
width: 100%;
height: 100%;
width: 25%;
height: 25%;
object-fit: contain;
}

.stream-video {
position: absolute;
width: 100%;
height: 100%;
object-fit: contain;
}

.stream-overlay {
Expand Down
8 changes: 4 additions & 4 deletions photon-client/src/components/common/pv-camera-info-card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ const cameraInfoFor: any = (camera: PVCameraInfo) => {
<td>Path:</td>
<td style="word-break: break-all">{{ cameraInfoFor(camera).path }}</td>
</tr>
<tr v-if="cameraInfoFor(camera).otherPaths !== undefined && cameraInfoFor(camera).otherPaths !== null">
<td>Other Paths:</td>
<td>{{ cameraInfoFor(camera).otherPaths }}</td>
</tr>
<tr v-if="cameraInfoFor(camera).uniquePath !== undefined && cameraInfoFor(camera).uniquePath !== null">
<td>Unique Path:</td>
<td style="word-break: break-all">{{ cameraInfoFor(camera).uniquePath }}</td>
</tr>
<tr v-if="cameraInfoFor(camera).otherPaths !== undefined && cameraInfoFor(camera).otherPaths !== null">
<td>Other Paths:</td>
<td>{{ cameraInfoFor(camera).otherPaths }}</td>
</tr>
</tbody>
</v-simple-table>
</div>
Expand Down
16 changes: 8 additions & 8 deletions photon-client/src/components/common/pv-camera-match-card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,6 @@ const cameraInfoFor = (camera: PVCameraInfo): any => {
<td style="word-break: break-all">{{ cameraInfoFor(saved).path }}</td>
<td style="word-break: break-all">{{ cameraInfoFor(current).path }}</td>
</tr>
<tr
v-if="cameraInfoFor(saved).otherPaths !== undefined && cameraInfoFor(saved).otherPaths !== null"
:class="!_.isEqual(cameraInfoFor(saved).otherPaths, cameraInfoFor(current).otherPaths) ? 'mismatch' : ''"
>
<td>Other Paths:</td>
<td>{{ cameraInfoFor(saved).otherPaths }}</td>
<td>{{ cameraInfoFor(current).otherPaths }}</td>
</tr>
<tr
v-if="cameraInfoFor(saved).uniquePath !== undefined && cameraInfoFor(saved).uniquePath !== null"
:class="cameraInfoFor(saved).uniquePath !== cameraInfoFor(current).uniquePath ? 'mismatch' : ''"
Expand All @@ -111,6 +103,14 @@ const cameraInfoFor = (camera: PVCameraInfo): any => {
<td style="word-break: break-all">{{ cameraInfoFor(saved).uniquePath }}</td>
<td style="word-break: break-all">{{ cameraInfoFor(current).uniquePath }}</td>
</tr>
<tr
v-if="cameraInfoFor(saved).otherPaths !== undefined && cameraInfoFor(saved).otherPaths !== null"
:class="!_.isEqual(cameraInfoFor(saved).otherPaths, cameraInfoFor(current).otherPaths) ? 'mismatch' : ''"
>
<td>Other Paths:</td>
<td>{{ cameraInfoFor(saved).otherPaths }}</td>
<td>{{ cameraInfoFor(current).otherPaths }}</td>
</tr>
</tbody>
</v-simple-table>
</div>
Expand Down
7 changes: 7 additions & 0 deletions photon-client/src/components/common/pv-input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const handleKeydown = ({ key }) => {
:error-messages="errorMessage"
:rules="rules"
hide-details="auto"
class="light-error"
@keydown="handleKeydown"
/>
</v-col>
Expand All @@ -74,3 +75,9 @@ const handleKeydown = ({ key }) => {
margin-top: 0px;
}
</style>
<style>
.light-error .error--text {
color: red !important;
caret-color: red !important;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ const supportedModels = computed(() => {
named <code>note-640-640-yolov5s-labels.txt</code>. Note that ONLY 640x640 YOLOv5 & YOLOv8 models
trained and converted to `.rknn` format for RK3588 CPUs are currently supported!
<v-row class="mt-6 ml-4 mr-8">
<v-file-input label="RKNN File" v-model="importRKNNFile" accept=".rknn" />
<v-file-input v-model="importRKNNFile" label="RKNN File" accept=".rknn" />
</v-row>
<v-row class="mt-6 ml-4 mr-8">
<v-file-input label="Labels File" v-model="importLabelsFile" accept=".txt" />
<v-file-input v-model="importLabelsFile" label="Labels File" accept=".txt" />
</v-row>
<v-row
class="mt-12 ml-8 mr-8 mb-1"
Expand Down
Loading
Loading