Compare commits

..

1 Commits

Author SHA1 Message Date
5e2fe35427 Check homography
All checks were successful
Tests / Tests (pull_request) Successful in 10s
2024-11-07 11:06:07 +01:00
5 changed files with 390 additions and 244 deletions

View File

@@ -184,7 +184,6 @@ export type DoesNotOwnShotErrOtherErrorNeedsNote =
export type EditUserInputGql = {
fargoRating?: InputMaybe<Scalars["Int"]["input"]>;
username?: InputMaybe<Scalars["String"]["input"]>;
videosPrivateByDefault?: InputMaybe<Scalars["Boolean"]["input"]>;
};
export type EnumAggregation = {
@@ -1943,7 +1942,6 @@ export type HomographyInfoGql = {
crop: BoundingBoxGql;
destPoints: PocketPointsGql;
frameIndex: Scalars["Int"]["output"];
id: Scalars["Int"]["output"];
pockets: Array<BoundingBoxGql>;
sourcePoints: PocketPointsGql;
};
@@ -2004,13 +2002,13 @@ export type MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailed
export type Mutation = {
__typename?: "Mutation";
addAnnotationToShot: AddShotAnnotationReturn;
checkHomographyIsValid?: Maybe<HomographyInfoGql>;
createBucketSet: BucketSetGql;
createUploadStream: CreateUploadStreamReturn;
deleteVideo: Scalars["Boolean"]["output"];
editProfileImageUri: UserGql;
editUploadStream: Scalars["Boolean"]["output"];
editUser: UserGql;
findPrerecordTableLayout?: Maybe<HomographyInfoGql>;
followUser: UserGql;
getHlsInitUploadLink: GetUploadLinkReturn;
getProfileImageUploadLink: GetProfileUploadLinkReturn;
@@ -2027,6 +2025,11 @@ export type MutationAddAnnotationToShotArgs = {
shotId: Scalars["Int"]["input"];
};
export type MutationCheckHomographyIsValidArgs = {
b64Image: Scalars["String"]["input"];
videoId: Scalars["Int"]["input"];
};
export type MutationCreateBucketSetArgs = {
params: CreateBucketSetInput;
};
@@ -2052,11 +2055,6 @@ export type MutationEditUserArgs = {
input: EditUserInputGql;
};
export type MutationFindPrerecordTableLayoutArgs = {
b64Image: Scalars["String"]["input"];
videoId: Scalars["Int"]["input"];
};
export type MutationFollowUserArgs = {
followedUserId: Scalars["Int"]["input"];
};
@@ -2585,7 +2583,6 @@ export type UserGql = {
profileImageUri?: Maybe<Scalars["String"]["output"]>;
updatedAt?: Maybe<Scalars["DateTime"]["output"]>;
username: Scalars["String"]["output"];
videosPrivateByDefault?: Maybe<Scalars["Boolean"]["output"]>;
};
export type UserPlayTimeGql = {
@@ -2627,7 +2624,6 @@ export type VideoGql = {
name?: Maybe<Scalars["String"]["output"]>;
owner?: Maybe<UserGql>;
playlist?: Maybe<HlsPlaylistGql>;
private: Scalars["Boolean"]["output"];
screenshotUri?: Maybe<Scalars["String"]["output"]>;
shots: Array<ShotGql>;
startTime?: Maybe<Scalars["DateTime"]["output"]>;
@@ -2651,7 +2647,6 @@ export type VideoMetadataInput = {
framesPerSecond?: InputMaybe<Scalars["Float"]["input"]>;
gameType?: InputMaybe<Scalars["String"]["input"]>;
lastIntendedSegmentBound?: InputMaybe<Scalars["Int"]["input"]>;
private?: InputMaybe<Scalars["Boolean"]["input"]>;
resolution?: InputMaybe<VideoResolution>;
startTime?: InputMaybe<Scalars["DateTime"]["input"]>;
streamSegmentType?: InputMaybe<StreamSegmentTypeEnum>;
@@ -2669,7 +2664,6 @@ export type VideoProcessingErrorGql = {
export type VideoProcessingGql = {
__typename?: "VideoProcessingGQL";
errors: Array<VideoProcessingErrorGql>;
id: Scalars["Int"]["output"];
status: ProcessingStatusEnum;
statuses: Array<VideoProcessingStatusGql>;
};
@@ -2740,6 +2734,51 @@ export type GetAggregatedShotMetricsQuery = {
}>;
};
export type CheckHomographyIsValidMutationVariables = Exact<{
b64Image: Scalars["String"]["input"];
videoId: Scalars["Int"]["input"];
}>;
export type CheckHomographyIsValidMutation = {
__typename?: "Mutation";
checkHomographyIsValid?: {
__typename?: "HomographyInfoGQL";
frameIndex: number;
crop: {
__typename?: "BoundingBoxGQL";
left: number;
top: number;
width: number;
height: number;
};
pockets: Array<{
__typename?: "BoundingBoxGQL";
left: number;
top: number;
width: number;
height: number;
}>;
sourcePoints: {
__typename?: "PocketPointsGQL";
topLeft: { __typename?: "IntPoint2D"; x: number; y: number };
topSide: { __typename?: "IntPoint2D"; x: number; y: number };
topRight: { __typename?: "IntPoint2D"; x: number; y: number };
bottomLeft: { __typename?: "IntPoint2D"; x: number; y: number };
bottomSide: { __typename?: "IntPoint2D"; x: number; y: number };
bottomRight: { __typename?: "IntPoint2D"; x: number; y: number };
};
destPoints: {
__typename?: "PocketPointsGQL";
topLeft: { __typename?: "IntPoint2D"; x: number; y: number };
topSide: { __typename?: "IntPoint2D"; x: number; y: number };
topRight: { __typename?: "IntPoint2D"; x: number; y: number };
bottomLeft: { __typename?: "IntPoint2D"; x: number; y: number };
bottomSide: { __typename?: "IntPoint2D"; x: number; y: number };
bottomRight: { __typename?: "IntPoint2D"; x: number; y: number };
};
} | null;
};
export type GetDeployedConfigQueryVariables = Exact<{ [key: string]: never }>;
export type GetDeployedConfigQuery = {
@@ -2830,7 +2869,6 @@ export type VideoCardFieldsFragment = {
}>;
currentProcessing?: {
__typename?: "VideoProcessingGQL";
id: number;
status: ProcessingStatusEnum;
errors: Array<{ __typename?: "VideoProcessingErrorGQL"; message: string }>;
statuses: Array<{
@@ -2882,7 +2920,6 @@ export type GetVideoFeedQuery = {
}>;
currentProcessing?: {
__typename?: "VideoProcessingGQL";
id: number;
status: ProcessingStatusEnum;
errors: Array<{
__typename?: "VideoProcessingErrorGQL";
@@ -3452,8 +3489,6 @@ export type GetStreamMonitoringDetailsQuery = {
elapsedTime?: number | null;
currentHomography?: {
__typename?: "HomographyInfoGQL";
id: number;
frameIndex: number;
crop: {
__typename?: "BoundingBoxGQL";
left: number;
@@ -3667,7 +3702,6 @@ export type GetVideoQuery = {
} | null;
homographyHistory: Array<{
__typename?: "HomographyInfoGQL";
id: number;
frameIndex: number;
crop: {
__typename?: "BoundingBoxGQL";
@@ -3869,72 +3903,6 @@ export type GetHeaderInfoByVideoIdQuery = {
};
};
export type FindPrerecordTableLayoutMutationVariables = Exact<{
b64Image: Scalars["String"]["input"];
videoId: Scalars["Int"]["input"];
}>;
export type FindPrerecordTableLayoutMutation = {
__typename?: "Mutation";
findPrerecordTableLayout?: {
__typename?: "HomographyInfoGQL";
id: number;
frameIndex: number;
crop: {
__typename?: "BoundingBoxGQL";
left: number;
top: number;
width: number;
height: number;
};
pockets: Array<{
__typename?: "BoundingBoxGQL";
left: number;
top: number;
width: number;
height: number;
}>;
sourcePoints: {
__typename?: "PocketPointsGQL";
topLeft: { __typename?: "IntPoint2D"; x: number; y: number };
topSide: { __typename?: "IntPoint2D"; x: number; y: number };
topRight: { __typename?: "IntPoint2D"; x: number; y: number };
bottomLeft: { __typename?: "IntPoint2D"; x: number; y: number };
bottomSide: { __typename?: "IntPoint2D"; x: number; y: number };
bottomRight: { __typename?: "IntPoint2D"; x: number; y: number };
};
} | null;
};
export type HomographyInfoFragment = {
__typename?: "HomographyInfoGQL";
id: number;
frameIndex: number;
crop: {
__typename?: "BoundingBoxGQL";
left: number;
top: number;
width: number;
height: number;
};
pockets: Array<{
__typename?: "BoundingBoxGQL";
left: number;
top: number;
width: number;
height: number;
}>;
sourcePoints: {
__typename?: "PocketPointsGQL";
topLeft: { __typename?: "IntPoint2D"; x: number; y: number };
topSide: { __typename?: "IntPoint2D"; x: number; y: number };
topRight: { __typename?: "IntPoint2D"; x: number; y: number };
bottomLeft: { __typename?: "IntPoint2D"; x: number; y: number };
bottomSide: { __typename?: "IntPoint2D"; x: number; y: number };
bottomRight: { __typename?: "IntPoint2D"; x: number; y: number };
};
};
export type CreateUploadStreamMutationVariables = Exact<{
videoMetadataInput: VideoMetadataInput;
}>;
@@ -4138,7 +4106,6 @@ export const VideoCardFieldsFragmentDoc = gql`
name
}
currentProcessing {
id
errors {
message
}
@@ -4267,50 +4234,6 @@ export const VideoDurationDataFragmentDoc = gql`
${PlaylistWithSegmentStartTimesFragmentDoc}
${StreamWithEndFramesFragmentDoc}
`;
export const HomographyInfoFragmentDoc = gql`
fragment HomographyInfo on HomographyInfoGQL {
id
frameIndex
crop {
left
top
width
height
}
pockets {
left
top
width
height
}
sourcePoints {
topLeft {
x
y
}
topSide {
x
y
}
topRight {
x
y
}
bottomLeft {
x
y
}
bottomSide {
x
y
}
bottomRight {
x
y
}
}
}
`;
export const GetAggregatedShotMetricsDocument = gql`
query GetAggregatedShotMetrics($aggregateInput: AggregateInputGQL!) {
getAggregatedShotMetrics(aggregateInput: $aggregateInput) {
@@ -4391,6 +4314,121 @@ export type GetAggregatedShotMetricsQueryResult = Apollo.QueryResult<
GetAggregatedShotMetricsQuery,
GetAggregatedShotMetricsQueryVariables
>;
export const CheckHomographyIsValidDocument = gql`
mutation checkHomographyIsValid($b64Image: String!, $videoId: Int!) {
checkHomographyIsValid(b64Image: $b64Image, videoId: $videoId) {
frameIndex
crop {
left
top
width
height
}
pockets {
left
top
width
height
}
sourcePoints {
topLeft {
x
y
}
topSide {
x
y
}
topRight {
x
y
}
bottomLeft {
x
y
}
bottomSide {
x
y
}
bottomRight {
x
y
}
}
destPoints {
topLeft {
x
y
}
topSide {
x
y
}
topRight {
x
y
}
bottomLeft {
x
y
}
bottomSide {
x
y
}
bottomRight {
x
y
}
}
}
}
`;
export type CheckHomographyIsValidMutationFn = Apollo.MutationFunction<
CheckHomographyIsValidMutation,
CheckHomographyIsValidMutationVariables
>;
/**
* __useCheckHomographyIsValidMutation__
*
* To run a mutation, you first call `useCheckHomographyIsValidMutation` within a React component and pass it any options that fit your needs.
* When your component renders, `useCheckHomographyIsValidMutation` returns a tuple that includes:
* - A mutate function that you can call at any time to execute the mutation
* - An object with fields that represent the current status of the mutation's execution
*
* @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
*
* @example
* const [checkHomographyIsValidMutation, { data, loading, error }] = useCheckHomographyIsValidMutation({
* variables: {
* b64Image: // value for 'b64Image'
* videoId: // value for 'videoId'
* },
* });
*/
export function useCheckHomographyIsValidMutation(
baseOptions?: Apollo.MutationHookOptions<
CheckHomographyIsValidMutation,
CheckHomographyIsValidMutationVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useMutation<
CheckHomographyIsValidMutation,
CheckHomographyIsValidMutationVariables
>(CheckHomographyIsValidDocument, options);
}
export type CheckHomographyIsValidMutationHookResult = ReturnType<
typeof useCheckHomographyIsValidMutation
>;
export type CheckHomographyIsValidMutationResult =
Apollo.MutationResult<CheckHomographyIsValidMutation>;
export type CheckHomographyIsValidMutationOptions = Apollo.BaseMutationOptions<
CheckHomographyIsValidMutation,
CheckHomographyIsValidMutationVariables
>;
export const GetDeployedConfigDocument = gql`
query getDeployedConfig {
getDeployedConfig {
@@ -6183,7 +6221,44 @@ export const GetStreamMonitoringDetailsDocument = gql`
makePercentage
elapsedTime
currentHomography {
...HomographyInfo
crop {
left
top
width
height
}
pockets {
left
top
width
height
}
sourcePoints {
topLeft {
x
y
}
topSide {
x
y
}
topRight {
x
y
}
bottomLeft {
x
y
}
bottomSide {
x
y
}
bottomRight {
x
y
}
}
}
stream {
id
@@ -6204,7 +6279,6 @@ export const GetStreamMonitoringDetailsDocument = gql`
}
}
}
${HomographyInfoFragmentDoc}
`;
/**
@@ -6654,7 +6728,45 @@ export const GetVideoDocument = gql`
segmentDurations
}
homographyHistory {
...HomographyInfo
frameIndex
crop {
left
top
width
height
}
pockets {
left
top
width
height
}
sourcePoints {
topLeft {
x
y
}
topSide {
x
y
}
topRight {
x
y
}
bottomLeft {
x
y
}
bottomSide {
x
y
}
bottomRight {
x
y
}
}
}
stream {
id
@@ -6671,7 +6783,6 @@ export const GetVideoDocument = gql`
}
}
}
${HomographyInfoFragmentDoc}
`;
/**
@@ -7105,59 +7216,6 @@ export type GetHeaderInfoByVideoIdQueryResult = Apollo.QueryResult<
GetHeaderInfoByVideoIdQuery,
GetHeaderInfoByVideoIdQueryVariables
>;
export const FindPrerecordTableLayoutDocument = gql`
mutation FindPrerecordTableLayout($b64Image: String!, $videoId: Int!) {
findPrerecordTableLayout(b64Image: $b64Image, videoId: $videoId) {
...HomographyInfo
}
}
${HomographyInfoFragmentDoc}
`;
export type FindPrerecordTableLayoutMutationFn = Apollo.MutationFunction<
FindPrerecordTableLayoutMutation,
FindPrerecordTableLayoutMutationVariables
>;
/**
* __useFindPrerecordTableLayoutMutation__
*
* To run a mutation, you first call `useFindPrerecordTableLayoutMutation` within a React component and pass it any options that fit your needs.
* When your component renders, `useFindPrerecordTableLayoutMutation` returns a tuple that includes:
* - A mutate function that you can call at any time to execute the mutation
* - An object with fields that represent the current status of the mutation's execution
*
* @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
*
* @example
* const [findPrerecordTableLayoutMutation, { data, loading, error }] = useFindPrerecordTableLayoutMutation({
* variables: {
* b64Image: // value for 'b64Image'
* videoId: // value for 'videoId'
* },
* });
*/
export function useFindPrerecordTableLayoutMutation(
baseOptions?: Apollo.MutationHookOptions<
FindPrerecordTableLayoutMutation,
FindPrerecordTableLayoutMutationVariables
>,
) {
const options = { ...defaultOptions, ...baseOptions };
return Apollo.useMutation<
FindPrerecordTableLayoutMutation,
FindPrerecordTableLayoutMutationVariables
>(FindPrerecordTableLayoutDocument, options);
}
export type FindPrerecordTableLayoutMutationHookResult = ReturnType<
typeof useFindPrerecordTableLayoutMutation
>;
export type FindPrerecordTableLayoutMutationResult =
Apollo.MutationResult<FindPrerecordTableLayoutMutation>;
export type FindPrerecordTableLayoutMutationOptions =
Apollo.BaseMutationOptions<
FindPrerecordTableLayoutMutation,
FindPrerecordTableLayoutMutationVariables
>;
export const CreateUploadStreamDocument = gql`
mutation CreateUploadStream($videoMetadataInput: VideoMetadataInput!) {
createUploadStream(videoMetadata: $videoMetadataInput) {

View File

@@ -0,0 +1,69 @@
mutation checkHomographyIsValid($b64Image: String!, $videoId: Int!) {
checkHomographyIsValid(b64Image: $b64Image, videoId: $videoId) {
frameIndex
crop {
left
top
width
height
}
pockets {
left
top
width
height
}
sourcePoints {
topLeft {
x
y
}
topSide {
x
y
}
topRight {
x
y
}
bottomLeft {
x
y
}
bottomSide {
x
y
}
bottomRight {
x
y
}
}
destPoints {
topLeft {
x
y
}
topSide {
x
y
}
topRight {
x
y
}
bottomLeft {
x
y
}
bottomSide {
x
y
}
bottomRight {
x
y
}
}
}
}

View File

@@ -70,7 +70,6 @@ fragment VideoCardFields on VideoGQL {
name
}
currentProcessing {
id
errors {
message
}

View File

@@ -5,7 +5,44 @@ query GetStreamMonitoringDetails($videoId: Int!, $debuggingJson: JSON) {
makePercentage
elapsedTime
currentHomography {
...HomographyInfo
crop {
left
top
width
height
}
pockets {
left
top
width
height
}
sourcePoints {
topLeft {
x
y
}
topSide {
x
y
}
topRight {
x
y
}
bottomLeft {
x
y
}
bottomSide {
x
y
}
bottomRight {
x
y
}
}
}
stream {
id
@@ -117,7 +154,45 @@ query GetVideo($videoId: Int!) {
segmentDurations
}
homographyHistory {
...HomographyInfo
frameIndex
crop {
left
top
width
height
}
pockets {
left
top
width
height
}
sourcePoints {
topLeft {
x
y
}
topSide {
x
y
}
topRight {
x
y
}
bottomLeft {
x
y
}
bottomSide {
x
y
}
bottomRight {
x
y
}
}
}
stream {
id
@@ -213,52 +288,3 @@ query GetHeaderInfoByVideoId($videoId: Int!) {
startTime
}
}
mutation FindPrerecordTableLayout($b64Image: String!, $videoId: Int!) {
findPrerecordTableLayout(b64Image: $b64Image, videoId: $videoId) {
...HomographyInfo
}
}
fragment HomographyInfo on HomographyInfoGQL {
id
frameIndex
crop {
left
top
width
height
}
pockets {
left
top
width
height
}
sourcePoints {
topLeft {
x
y
}
topSide {
x
y
}
topRight {
x
y
}
bottomLeft {
x
y
}
bottomSide {
x
y
}
bottomRight {
x
y
}
}
}

View File

@@ -400,7 +400,6 @@ type UserGQL {
profileImageUri: String
createdAt: DateTime
updatedAt: DateTime
videosPrivateByDefault: Boolean
following: [UserGQL!]
followers: [UserGQL!]
}
@@ -438,7 +437,6 @@ type VideoGQL {
elapsedTime: Float
framesPerSecond: Float!
tableSize: Float!
private: Boolean!
stream: UploadStreamGQL
playlist: HLSPlaylistGQL
tags: [VideoTag!]!
@@ -511,7 +509,6 @@ type VideoTagClass {
}
type HomographyInfoGQL {
id: Int!
frameIndex: Int!
crop: BoundingBoxGQL!
pockets: [BoundingBoxGQL!]!
@@ -541,7 +538,6 @@ type IntPoint2D {
}
type VideoProcessingGQL {
id: Int!
errors: [VideoProcessingErrorGQL!]!
status: ProcessingStatusEnum!
statuses: [VideoProcessingStatusGQL!]!
@@ -672,7 +668,7 @@ type Mutation {
editUser(input: EditUserInputGQL!): UserGQL!
followUser(followedUserId: Int!): UserGQL!
unfollowUser(followedUserId: Int!): UserGQL!
findPrerecordTableLayout(b64Image: String!, videoId: Int!): HomographyInfoGQL
checkHomographyIsValid(b64Image: String!, videoId: Int!): HomographyInfoGQL
createUploadStream(
videoMetadata: VideoMetadataInput!
): CreateUploadStreamReturn!
@@ -761,7 +757,6 @@ type TooManyProfileImageUploadsErr {
input EditUserInputGQL {
username: String = null
fargoRating: Int = null
videosPrivateByDefault: Boolean = null
}
type CreateUploadStreamReturn {
@@ -776,7 +771,6 @@ input VideoMetadataInput {
tableSize: Float = null
lastIntendedSegmentBound: Int = null
streamSegmentType: StreamSegmentTypeEnum = null
private: Boolean = null
endStream: Boolean! = false
resolution: VideoResolution = null
framesPerSecond: Float = null