Skip to content

Conversation

@andrewjl-mux
Copy link
Contributor

No description provided.

@andrewjl-mux andrewjl-mux changed the base branch from main to releases/v0.3.0 May 19, 2023 16:11
@andrewjl-mux andrewjl-mux changed the title Input Standardization 1 Upload Input Inspection and Standardization 1 May 19, 2023
@andrewjl-mux andrewjl-mux force-pushed the ajlb/input-standardization-1 branch from 4c9b36d to e6b5e63 Compare May 19, 2023 19:14
@andrewjl-mux andrewjl-mux force-pushed the ajlb/input-standardization-1 branch 2 times, most recently from e050506 to 94cb611 Compare May 19, 2023 20:46
@andrewjl-mux andrewjl-mux force-pushed the ajlb/input-standardization-1 branch from 6876978 to 8ad0cbb Compare May 19, 2023 23:23
@andrewjl-mux andrewjl-mux marked this pull request as ready for review May 20, 2023 00:19
@andrewjl-mux andrewjl-mux requested a review from a team as a code owner May 20, 2023 00:19
@andrewjl-mux andrewjl-mux force-pushed the ajlb/input-standardization-1 branch 4 times, most recently from 2a3556e to 32f4bc8 Compare May 22, 2023 16:03
@daytime-em daytime-em changed the base branch from releases/v0.3.0 to project/input-standardization May 26, 2023 21:39
@andrewjl-mux andrewjl-mux force-pushed the ajlb/input-standardization-1 branch from 32f4bc8 to 32fc017 Compare June 5, 2023 23:33
@andrewjl-mux andrewjl-mux changed the base branch from project/input-standardization to releases/v0.4.0 June 5, 2023 23:34
@andrewjl-mux andrewjl-mux changed the base branch from releases/v0.4.0 to project/input-standardization June 6, 2023 15:56
Copy link
Collaborator

@daytime-em daytime-em left a comment

Choose a reason for hiding this comment

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

The biggest changes I'm requesting are to remove !s in the API, which we can either avoid completely or make way safer than they currently are

@andrewjl-mux andrewjl-mux force-pushed the ajlb/input-standardization-1 branch 2 times, most recently from 4a3f4b1 to 144e07d Compare June 6, 2023 19:53
@andrewjl-mux andrewjl-mux requested review from a team, refactornator and tomkordic and removed request for refactornator June 6, 2023 20:10
@andrewjl-mux andrewjl-mux force-pushed the ajlb/input-standardization-1 branch from cf4b215 to 3157019 Compare June 15, 2023 18:59
@andrewjl-mux
Copy link
Contributor Author

Rebased against releases/0.4.0, merging to project branch.

@andrewjl-mux andrewjl-mux merged commit 0a9a81a into project/input-standardization Jun 15, 2023
@andrewjl-mux andrewjl-mux deleted the ajlb/input-standardization-1 branch June 15, 2023 19:06
andrewjl-mux added a commit that referenced this pull request Jun 26, 2023
Add scaffolding

Add initializers

Add internal and external state mapping

Remove duplicate status enum and add inline docs to external status

Add inline API docs to PHAsset-based MuxUpload constructor

Consolidate all `MuxUpload` options into a single struct `UploadOptions`

Declare asynchronous MuxUpload constructor in PHAsset extension

Place extension methods into dedicated directories

Polish inline API documentation

Add option variants as static members: defaults, disabled inputStandardization

Deprecate existing initializer, normally this API should be removed prior to GA, but since it
was the only initializer exposed up to this point removing it would break everybody. Instead deprecate and remove at a later date.

Store all upload-related options in UploadInfo

Use correct starting byte parameter when restarting upload

Hardcode request options when exporting AVAsset from PhotosKit

Update API doc with lifecycle details and note the placeholder implementation

Fix parameter name

Start method fixes: remove force unwrap and add missing start calls

chunkSize -> chunkSizeInBytes
andrewjl-mux added a commit that referenced this pull request Jun 30, 2023
Add scaffolding

Add initializers

Add internal and external state mapping

Remove duplicate status enum and add inline docs to external status

Add inline API docs to PHAsset-based MuxUpload constructor

Consolidate all `MuxUpload` options into a single struct `UploadOptions`

Declare asynchronous MuxUpload constructor in PHAsset extension

Place extension methods into dedicated directories

Polish inline API documentation

Add option variants as static members: defaults, disabled inputStandardization

Deprecate existing initializer, normally this API should be removed prior to GA, but since it
was the only initializer exposed up to this point removing it would break everybody. Instead deprecate and remove at a later date.

Store all upload-related options in UploadInfo

Use correct starting byte parameter when restarting upload

Hardcode request options when exporting AVAsset from PhotosKit

Update API doc with lifecycle details and note the placeholder implementation

Fix parameter name

Start method fixes: remove force unwrap and add missing start calls

chunkSize -> chunkSizeInBytes
andrewjl-mux added a commit that referenced this pull request Jun 30, 2023
Add scaffolding

Add initializers

Add internal and external state mapping

Remove duplicate status enum and add inline docs to external status

Add inline API docs to PHAsset-based MuxUpload constructor

Consolidate all `MuxUpload` options into a single struct `UploadOptions`

Declare asynchronous MuxUpload constructor in PHAsset extension

Place extension methods into dedicated directories

Polish inline API documentation

Add option variants as static members: defaults, disabled inputStandardization

Deprecate existing initializer, normally this API should be removed prior to GA, but since it
was the only initializer exposed up to this point removing it would break everybody. Instead deprecate and remove at a later date.

Store all upload-related options in UploadInfo

Use correct starting byte parameter when restarting upload

Hardcode request options when exporting AVAsset from PhotosKit

Update API doc with lifecycle details and note the placeholder implementation

Fix parameter name

Start method fixes: remove force unwrap and add missing start calls

chunkSize -> chunkSizeInBytes
andrewjl-mux added a commit that referenced this pull request Jun 30, 2023
Add scaffolding

Add initializers

Add internal and external state mapping

Remove duplicate status enum and add inline docs to external status

Add inline API docs to PHAsset-based MuxUpload constructor

Consolidate all `MuxUpload` options into a single struct `UploadOptions`

Declare asynchronous MuxUpload constructor in PHAsset extension

Place extension methods into dedicated directories

Polish inline API documentation

Add option variants as static members: defaults, disabled inputStandardization

Deprecate existing initializer, normally this API should be removed prior to GA, but since it
was the only initializer exposed up to this point removing it would break everybody. Instead deprecate and remove at a later date.

Store all upload-related options in UploadInfo

Use correct starting byte parameter when restarting upload

Hardcode request options when exporting AVAsset from PhotosKit

Update API doc with lifecycle details and note the placeholder implementation

Fix parameter name

Start method fixes: remove force unwrap and add missing start calls

chunkSize -> chunkSizeInBytes
andrewjl-mux added a commit that referenced this pull request Jul 6, 2023
Add scaffolding

Add initializers

Add internal and external state mapping

Remove duplicate status enum and add inline docs to external status

Add inline API docs to PHAsset-based MuxUpload constructor

Consolidate all `MuxUpload` options into a single struct `UploadOptions`

Declare asynchronous MuxUpload constructor in PHAsset extension

Place extension methods into dedicated directories

Polish inline API documentation

Add option variants as static members: defaults, disabled inputStandardization

Deprecate existing initializer, normally this API should be removed prior to GA, but since it
was the only initializer exposed up to this point removing it would break everybody. Instead deprecate and remove at a later date.

Store all upload-related options in UploadInfo

Use correct starting byte parameter when restarting upload

Hardcode request options when exporting AVAsset from PhotosKit

Update API doc with lifecycle details and note the placeholder implementation

Fix parameter name

Start method fixes: remove force unwrap and add missing start calls

chunkSize -> chunkSizeInBytes
andrewjl-mux added a commit that referenced this pull request Jul 7, 2023
Add scaffolding

Add initializers

Add internal and external state mapping

Remove duplicate status enum and add inline docs to external status

Add inline API docs to PHAsset-based MuxUpload constructor

Consolidate all `MuxUpload` options into a single struct `UploadOptions`

Declare asynchronous MuxUpload constructor in PHAsset extension

Place extension methods into dedicated directories

Polish inline API documentation

Add option variants as static members: defaults, disabled inputStandardization

Deprecate existing initializer, normally this API should be removed prior to GA, but since it
was the only initializer exposed up to this point removing it would break everybody. Instead deprecate and remove at a later date.

Store all upload-related options in UploadInfo

Use correct starting byte parameter when restarting upload

Hardcode request options when exporting AVAsset from PhotosKit

Update API doc with lifecycle details and note the placeholder implementation

Fix parameter name

Start method fixes: remove force unwrap and add missing start calls

chunkSize -> chunkSizeInBytes
andrewjl-mux added a commit that referenced this pull request Jul 7, 2023
Add scaffolding

Add initializers

Add internal and external state mapping

Remove duplicate status enum and add inline docs to external status

Add inline API docs to PHAsset-based MuxUpload constructor

Consolidate all `MuxUpload` options into a single struct `UploadOptions`

Declare asynchronous MuxUpload constructor in PHAsset extension

Place extension methods into dedicated directories

Polish inline API documentation

Add option variants as static members: defaults, disabled inputStandardization

Deprecate existing initializer, normally this API should be removed prior to GA, but since it
was the only initializer exposed up to this point removing it would break everybody. Instead deprecate and remove at a later date.

Store all upload-related options in UploadInfo

Use correct starting byte parameter when restarting upload

Hardcode request options when exporting AVAsset from PhotosKit

Update API doc with lifecycle details and note the placeholder implementation

Fix parameter name

Start method fixes: remove force unwrap and add missing start calls

chunkSize -> chunkSizeInBytes
andrewjl-mux added a commit that referenced this pull request Jul 7, 2023
Add scaffolding

Add initializers

Add internal and external state mapping

Remove duplicate status enum and add inline docs to external status

Add inline API docs to PHAsset-based MuxUpload constructor

Consolidate all `MuxUpload` options into a single struct `UploadOptions`

Declare asynchronous MuxUpload constructor in PHAsset extension

Place extension methods into dedicated directories

Polish inline API documentation

Add option variants as static members: defaults, disabled inputStandardization

Deprecate existing initializer, normally this API should be removed prior to GA, but since it
was the only initializer exposed up to this point removing it would break everybody. Instead deprecate and remove at a later date.

Store all upload-related options in UploadInfo

Use correct starting byte parameter when restarting upload

Hardcode request options when exporting AVAsset from PhotosKit

Update API doc with lifecycle details and note the placeholder implementation

Fix parameter name

Start method fixes: remove force unwrap and add missing start calls

chunkSize -> chunkSizeInBytes
andrewjl-mux added a commit that referenced this pull request Jul 7, 2023
Add scaffolding

Add initializers

Add internal and external state mapping

Remove duplicate status enum and add inline docs to external status

Add inline API docs to PHAsset-based MuxUpload constructor

Consolidate all `MuxUpload` options into a single struct `UploadOptions`

Declare asynchronous MuxUpload constructor in PHAsset extension

Place extension methods into dedicated directories

Polish inline API documentation

Add option variants as static members: defaults, disabled inputStandardization

Deprecate existing initializer, normally this API should be removed prior to GA, but since it
was the only initializer exposed up to this point removing it would break everybody. Instead deprecate and remove at a later date.

Store all upload-related options in UploadInfo

Use correct starting byte parameter when restarting upload

Hardcode request options when exporting AVAsset from PhotosKit

Update API doc with lifecycle details and note the placeholder implementation

Fix parameter name

Start method fixes: remove force unwrap and add missing start calls

chunkSize -> chunkSizeInBytes
andrewjl-mux added a commit that referenced this pull request Jul 12, 2023
Add scaffolding

Add initializers

Add internal and external state mapping

Remove duplicate status enum and add inline docs to external status

Add inline API docs to PHAsset-based MuxUpload constructor

Consolidate all `MuxUpload` options into a single struct `UploadOptions`

Declare asynchronous MuxUpload constructor in PHAsset extension

Place extension methods into dedicated directories

Polish inline API documentation

Add option variants as static members: defaults, disabled inputStandardization

Deprecate existing initializer, normally this API should be removed prior to GA, but since it
was the only initializer exposed up to this point removing it would break everybody. Instead deprecate and remove at a later date.

Store all upload-related options in UploadInfo

Use correct starting byte parameter when restarting upload

Hardcode request options when exporting AVAsset from PhotosKit

Update API doc with lifecycle details and note the placeholder implementation

Fix parameter name

Start method fixes: remove force unwrap and add missing start calls

chunkSize -> chunkSizeInBytes
andrewjl-mux added a commit that referenced this pull request Jul 12, 2023
Add scaffolding

Add initializers

Add internal and external state mapping

Remove duplicate status enum and add inline docs to external status

Add inline API docs to PHAsset-based MuxUpload constructor

Consolidate all `MuxUpload` options into a single struct `UploadOptions`

Declare asynchronous MuxUpload constructor in PHAsset extension

Place extension methods into dedicated directories

Polish inline API documentation

Add option variants as static members: defaults, disabled inputStandardization

Deprecate existing initializer, normally this API should be removed prior to GA, but since it
was the only initializer exposed up to this point removing it would break everybody. Instead deprecate and remove at a later date.

Store all upload-related options in UploadInfo

Use correct starting byte parameter when restarting upload

Hardcode request options when exporting AVAsset from PhotosKit

Update API doc with lifecycle details and note the placeholder implementation

Fix parameter name

Start method fixes: remove force unwrap and add missing start calls

chunkSize -> chunkSizeInBytes
andrewjl-mux added a commit that referenced this pull request Jul 12, 2023
Add scaffolding

Add initializers

Add internal and external state mapping

Remove duplicate status enum and add inline docs to external status

Add inline API docs to PHAsset-based MuxUpload constructor

Consolidate all `MuxUpload` options into a single struct `UploadOptions`

Declare asynchronous MuxUpload constructor in PHAsset extension

Place extension methods into dedicated directories

Polish inline API documentation

Add option variants as static members: defaults, disabled inputStandardization

Deprecate existing initializer, normally this API should be removed prior to GA, but since it
was the only initializer exposed up to this point removing it would break everybody. Instead deprecate and remove at a later date.

Store all upload-related options in UploadInfo

Use correct starting byte parameter when restarting upload

Hardcode request options when exporting AVAsset from PhotosKit

Update API doc with lifecycle details and note the placeholder implementation

Fix parameter name

Start method fixes: remove force unwrap and add missing start calls

chunkSize -> chunkSizeInBytes
andrewjl-mux added a commit that referenced this pull request Jul 18, 2023
Add scaffolding

Add initializers

Add internal and external state mapping

Remove duplicate status enum and add inline docs to external status

Add inline API docs to PHAsset-based MuxUpload constructor

Consolidate all `MuxUpload` options into a single struct `UploadOptions`

Declare asynchronous MuxUpload constructor in PHAsset extension

Place extension methods into dedicated directories

Polish inline API documentation

Add option variants as static members: defaults, disabled inputStandardization

Deprecate existing initializer, normally this API should be removed prior to GA, but since it
was the only initializer exposed up to this point removing it would break everybody. Instead deprecate and remove at a later date.

Store all upload-related options in UploadInfo

Use correct starting byte parameter when restarting upload

Hardcode request options when exporting AVAsset from PhotosKit

Update API doc with lifecycle details and note the placeholder implementation

Fix parameter name

Start method fixes: remove force unwrap and add missing start calls

chunkSize -> chunkSizeInBytes
andrewjl-mux added a commit that referenced this pull request Jul 19, 2023
Add scaffolding

Add initializers

Add internal and external state mapping

Remove duplicate status enum and add inline docs to external status

Add inline API docs to PHAsset-based MuxUpload constructor

Consolidate all `MuxUpload` options into a single struct `UploadOptions`

Declare asynchronous MuxUpload constructor in PHAsset extension

Place extension methods into dedicated directories

Polish inline API documentation

Add option variants as static members: defaults, disabled inputStandardization

Deprecate existing initializer, normally this API should be removed prior to GA, but since it
was the only initializer exposed up to this point removing it would break everybody. Instead deprecate and remove at a later date.

Store all upload-related options in UploadInfo

Use correct starting byte parameter when restarting upload

Hardcode request options when exporting AVAsset from PhotosKit

Update API doc with lifecycle details and note the placeholder implementation

Fix parameter name

Start method fixes: remove force unwrap and add missing start calls

chunkSize -> chunkSizeInBytes
andrewjl-mux added a commit that referenced this pull request Jul 20, 2023
Upload Input Inspection and Standardization 1 (#17)

Add scaffolding

Add initializers

Add internal and external state mapping

Remove duplicate status enum and add inline docs to external status

Add inline API docs to PHAsset-based MuxUpload constructor

Consolidate all `MuxUpload` options into a single struct `UploadOptions`

Declare asynchronous MuxUpload constructor in PHAsset extension

Place extension methods into dedicated directories

Polish inline API documentation

Add new API documentation and note the placeholder implementation

Add option variants as static members: defaults, disabled inputStandardization

Deprecate existing initializer, normally this API should be removed prior to GA, but since it was the only initializer exposed up to this point removing it would break everybody. Instead deprecate and remove at a later date.

Store all MuxUpload-related options in UploadInfo

Use correct starting byte parameter when restarting upload

Hardcode request options when exporting AVAsset from PhotosKit

chunkSize -> chunkSizeInBytes

Input standardization 2 (#41)

Maintain handle to canonical input asset inside UploadInput

If input standardized, standardized input URL is passed to UploadInfo
instead of the original input URL used for initializer

Note: SDK probably needs to re-export a high quality asset anyway so
possibly need a bridging status

Add dedicated internal initializer for MuxUpload error with unknown error code

Disable input standardization when running tests

Add inspection logic

Request local and remote assets

Status -> TransportStatus

Rely on input status in MuxUpload computed property getters

Expose progress from internal upload state if available

Track transport status inside of UploadInput

Transport status start time optional

Add TransportStatus docs

Inspect and check video track frame rate

Migrate tests for MuxUpload input result handler

Input standardization 3 (#46)

Standardize via export session

Back out outputURL construction into MuxUpload

Expose hook for client to cancel upload if standardization failed

Call cancellation hook if inspection fails. We're not sure if the input is standard or not so better to be safe
and confirm

Export based on maximum resolution set by client

Cleaner non standard input handler invocation (#57)

Add CustomStringConvertible conformance to maximum resolution (#56)

Update input state when upload is finished (#63)

Update input state when the upload succeeds or fails

Tweak input state definition, keep an error in the failed case and the success struct in the success case

NFC: remove some if let checks for the handler closure properties in MuxUpload and replace with ? operator. Keeps the existing logic.

Replace video file get with actual implementation (#64)

Reporting updates (#49)

Only mark upload as started if its ready

Add upload failed and input standardization events

Add standardization failure event handler to reporter

Add standardization success event handler to reporter

Rename method for upload success

Rename upload event to upload succeeded

Support dispatching multiple events at the same time

Naive non-thread safe implementation reporter networking

Change event type casing, individual files for events

Fix reporter test

Actually report upload failure

Read off file size

Use Date in events and serialize to ISO8601 string

Finangle duration and start time

Set correct version in correct place

Keep a session UUID

Route every request through one chokepoint

Upload failed test

Shared test encoder

Input standardization failed test

Input standardization succeeded test

Better organize expected json strings

Use a shared instance

Remove dupe file

Thread asset duration through inspection and standardization

Pass export error back

Include non standard input reasons

Workaround duration load pause

Avoid mutating while iterating when UploadManager makes delegate calls

Set custom HTTP request header for reporting (#67)

Remove Equatable and Hashable conformance from MuxUpload (#68)

Safe storage for MuxUpload (#71)

Intended to prevent a crash if MuxUpload is extended by the SDK client to conform to Equatable or Hashable protocols
cjpillsbury pushed a commit that referenced this pull request Jul 20, 2023
Upload Input Inspection and Standardization 1 (#17)

Add scaffolding

Add initializers

Add internal and external state mapping

Remove duplicate status enum and add inline docs to external status

Add inline API docs to PHAsset-based MuxUpload constructor

Consolidate all `MuxUpload` options into a single struct `UploadOptions`

Declare asynchronous MuxUpload constructor in PHAsset extension

Place extension methods into dedicated directories

Polish inline API documentation

Add new API documentation and note the placeholder implementation

Add option variants as static members: defaults, disabled inputStandardization

Deprecate existing initializer, normally this API should be removed prior to GA, but since it was the only initializer exposed up to this point removing it would break everybody. Instead deprecate and remove at a later date.

Store all MuxUpload-related options in UploadInfo

Use correct starting byte parameter when restarting upload

Hardcode request options when exporting AVAsset from PhotosKit

chunkSize -> chunkSizeInBytes

Input standardization 2 (#41)

Maintain handle to canonical input asset inside UploadInput

If input standardized, standardized input URL is passed to UploadInfo
instead of the original input URL used for initializer

Note: SDK probably needs to re-export a high quality asset anyway so
possibly need a bridging status

Add dedicated internal initializer for MuxUpload error with unknown error code

Disable input standardization when running tests

Add inspection logic

Request local and remote assets

Status -> TransportStatus

Rely on input status in MuxUpload computed property getters

Expose progress from internal upload state if available

Track transport status inside of UploadInput

Transport status start time optional

Add TransportStatus docs

Inspect and check video track frame rate

Migrate tests for MuxUpload input result handler

Input standardization 3 (#46)

Standardize via export session

Back out outputURL construction into MuxUpload

Expose hook for client to cancel upload if standardization failed

Call cancellation hook if inspection fails. We're not sure if the input is standard or not so better to be safe
and confirm

Export based on maximum resolution set by client

Cleaner non standard input handler invocation (#57)

Add CustomStringConvertible conformance to maximum resolution (#56)

Update input state when upload is finished (#63)

Update input state when the upload succeeds or fails

Tweak input state definition, keep an error in the failed case and the success struct in the success case

NFC: remove some if let checks for the handler closure properties in MuxUpload and replace with ? operator. Keeps the existing logic.

Replace video file get with actual implementation (#64)

Reporting updates (#49)

Only mark upload as started if its ready

Add upload failed and input standardization events

Add standardization failure event handler to reporter

Add standardization success event handler to reporter

Rename method for upload success

Rename upload event to upload succeeded

Support dispatching multiple events at the same time

Naive non-thread safe implementation reporter networking

Change event type casing, individual files for events

Fix reporter test

Actually report upload failure

Read off file size

Use Date in events and serialize to ISO8601 string

Finangle duration and start time

Set correct version in correct place

Keep a session UUID

Route every request through one chokepoint

Upload failed test

Shared test encoder

Input standardization failed test

Input standardization succeeded test

Better organize expected json strings

Use a shared instance

Remove dupe file

Thread asset duration through inspection and standardization

Pass export error back

Include non standard input reasons

Workaround duration load pause

Avoid mutating while iterating when UploadManager makes delegate calls

Set custom HTTP request header for reporting (#67)

Remove Equatable and Hashable conformance from MuxUpload (#68)

Safe storage for MuxUpload (#71)

Intended to prevent a crash if MuxUpload is extended by the SDK client to conform to Equatable or Hashable protocols
andrewjl-mux added a commit that referenced this pull request Jul 20, 2023
Upload Input Inspection and Standardization 1 (#17)

Add scaffolding

Add initializers

Add internal and external state mapping

Remove duplicate status enum and add inline docs to external status

Add inline API docs to PHAsset-based MuxUpload constructor

Consolidate all `MuxUpload` options into a single struct `UploadOptions`

Declare asynchronous MuxUpload constructor in PHAsset extension

Place extension methods into dedicated directories

Polish inline API documentation

Add new API documentation and note the placeholder implementation

Add option variants as static members: defaults, disabled inputStandardization

Deprecate existing initializer, normally this API should be removed prior to GA, but since it was the only initializer exposed up to this point removing it would break everybody. Instead deprecate and remove at a later date.

Store all MuxUpload-related options in UploadInfo

Use correct starting byte parameter when restarting upload

Hardcode request options when exporting AVAsset from PhotosKit

chunkSize -> chunkSizeInBytes

Input standardization 2 (#41)

Maintain handle to canonical input asset inside UploadInput

If input standardized, standardized input URL is passed to UploadInfo
instead of the original input URL used for initializer

Note: SDK probably needs to re-export a high quality asset anyway so
possibly need a bridging status

Add dedicated internal initializer for MuxUpload error with unknown error code

Disable input standardization when running tests

Add inspection logic

Request local and remote assets

Status -> TransportStatus

Rely on input status in MuxUpload computed property getters

Expose progress from internal upload state if available

Track transport status inside of UploadInput

Transport status start time optional

Add TransportStatus docs

Inspect and check video track frame rate

Migrate tests for MuxUpload input result handler

Input standardization 3 (#46)

Standardize via export session

Back out outputURL construction into MuxUpload

Expose hook for client to cancel upload if standardization failed

Call cancellation hook if inspection fails. We're not sure if the input is standard or not so better to be safe
and confirm

Export based on maximum resolution set by client

Cleaner non standard input handler invocation (#57)

Add CustomStringConvertible conformance to maximum resolution (#56)

Update input state when upload is finished (#63)

Update input state when the upload succeeds or fails

Tweak input state definition, keep an error in the failed case and the success struct in the success case

NFC: remove some if let checks for the handler closure properties in MuxUpload and replace with ? operator. Keeps the existing logic.

Replace video file get with actual implementation (#64)

Reporting updates (#49)

Only mark upload as started if its ready

Add upload failed and input standardization events

Add standardization failure event handler to reporter

Add standardization success event handler to reporter

Rename method for upload success

Rename upload event to upload succeeded

Support dispatching multiple events at the same time

Naive non-thread safe implementation reporter networking

Change event type casing, individual files for events

Fix reporter test

Actually report upload failure

Read off file size

Use Date in events and serialize to ISO8601 string

Finangle duration and start time

Set correct version in correct place

Keep a session UUID

Route every request through one chokepoint

Upload failed test

Shared test encoder

Input standardization failed test

Input standardization succeeded test

Better organize expected json strings

Use a shared instance

Remove dupe file

Thread asset duration through inspection and standardization

Pass export error back

Include non standard input reasons

Workaround duration load pause

Avoid mutating while iterating when UploadManager makes delegate calls

Set custom HTTP request header for reporting (#67)

Remove Equatable and Hashable conformance from MuxUpload (#68)

Safe storage for MuxUpload (#71)

Intended to prevent a crash if MuxUpload is extended by the SDK client to conform to Equatable or Hashable protocols
andrewjl-mux added a commit that referenced this pull request Jul 20, 2023
Upload Input Inspection and Standardization 1 (#17)

Add scaffolding

Add initializers

Add internal and external state mapping

Remove duplicate status enum and add inline docs to external status

Add inline API docs to PHAsset-based MuxUpload constructor

Consolidate all `MuxUpload` options into a single struct `UploadOptions`

Declare asynchronous MuxUpload constructor in PHAsset extension

Place extension methods into dedicated directories

Polish inline API documentation

Add new API documentation and note the placeholder implementation

Add option variants as static members: defaults, disabled inputStandardization

Deprecate existing initializer, normally this API should be removed prior to GA, but since it was the only initializer exposed up to this point removing it would break everybody. Instead deprecate and remove at a later date.

Store all MuxUpload-related options in UploadInfo

Use correct starting byte parameter when restarting upload

Hardcode request options when exporting AVAsset from PhotosKit

chunkSize -> chunkSizeInBytes

Input standardization 2 (#41)

Maintain handle to canonical input asset inside UploadInput

If input standardized, standardized input URL is passed to UploadInfo
instead of the original input URL used for initializer

Note: SDK probably needs to re-export a high quality asset anyway so
possibly need a bridging status

Add dedicated internal initializer for MuxUpload error with unknown error code

Disable input standardization when running tests

Add inspection logic

Request local and remote assets

Status -> TransportStatus

Rely on input status in MuxUpload computed property getters

Expose progress from internal upload state if available

Track transport status inside of UploadInput

Transport status start time optional

Add TransportStatus docs

Inspect and check video track frame rate

Migrate tests for MuxUpload input result handler

Input standardization 3 (#46)

Standardize via export session

Back out outputURL construction into MuxUpload

Expose hook for client to cancel upload if standardization failed

Call cancellation hook if inspection fails. We're not sure if the input is standard or not so better to be safe
and confirm

Export based on maximum resolution set by client

Cleaner non standard input handler invocation (#57)

Add CustomStringConvertible conformance to maximum resolution (#56)

Update input state when upload is finished (#63)

Update input state when the upload succeeds or fails

Tweak input state definition, keep an error in the failed case and the success struct in the success case

NFC: remove some if let checks for the handler closure properties in MuxUpload and replace with ? operator. Keeps the existing logic.

Replace video file get with actual implementation (#64)

Reporting updates (#49)

Only mark upload as started if its ready

Add upload failed and input standardization events

Add standardization failure event handler to reporter

Add standardization success event handler to reporter

Rename method for upload success

Rename upload event to upload succeeded

Support dispatching multiple events at the same time

Naive non-thread safe implementation reporter networking

Change event type casing, individual files for events

Fix reporter test

Actually report upload failure

Read off file size

Use Date in events and serialize to ISO8601 string

Finangle duration and start time

Set correct version in correct place

Keep a session UUID

Route every request through one chokepoint

Upload failed test

Shared test encoder

Input standardization failed test

Input standardization succeeded test

Better organize expected json strings

Use a shared instance

Remove dupe file

Thread asset duration through inspection and standardization

Pass export error back

Include non standard input reasons

Workaround duration load pause

Avoid mutating while iterating when UploadManager makes delegate calls

Set custom HTTP request header for reporting (#67)

Remove Equatable and Hashable conformance from MuxUpload (#68)

Safe storage for MuxUpload (#71)

Intended to prevent a crash if MuxUpload is extended by the SDK client to conform to Equatable or Hashable protocols
andrewjl-mux added a commit that referenced this pull request Jul 21, 2023
* Project Input standardization (#17) (#41) (#46) (#48) (#57)  (#77)

Add AVFoundation and PhotosKit initializers

Add internal and external state mapping

Remove duplicate status enum and add inline docs to external status

Add inline API docs to PHAsset-based MuxUpload constructor

Consolidate all `MuxUpload` options into a single struct `UploadOptions`

Declare asynchronous MuxUpload constructor in PHAsset extension

Place extension methods into dedicated directories

Polish inline API documentation

Add new API documentation and note the placeholder implementation

Add option variants as static members: defaults, disabled inputStandardization

Deprecate existing initializer, normally this API should be removed prior to GA, but since it was the only initializer exposed up to this point removing it would break everybody. Instead deprecate and remove at a later date.

Store all MuxUpload-related options in UploadInfo

Use correct starting byte parameter when restarting upload

If input standardized, standardized input URL is passed to UploadInfo
instead of the original input URL used for initializer

Note: SDK probably needs to re-export a high quality asset anyway so
possibly need a bridging status

Add dedicated internal initializer for MuxUpload error with unknown error code

Request local and remote assets

Standardize via AVFoundation asset export session

Expose hook for client to cancel upload if standardization failed

Call cancellation hook if inspection fails. We're not sure if the input is standard or not so better to be safe
and confirm

Export based on maximum resolution set by client

Cleaner non standard input handler invocation 

Add CustomStringConvertible conformance to maximum resolution (#56)

Only mark upload as started if its ready

Safe storage for MuxUpload (#71)

Intended to prevent a crash if MuxUpload is extended by the SDK client to conform to Equatable or Hashable protocols

Switch order of operations to avoid long pause on fetching duration

AVAsset sometimes hangs when asked to asynchronously fetch
duration when there aren't audio or video tracks present.

To avoid this after starting the upload, the inspection step will
get the video tracks first and get the duration afterwards.

---------

Co-authored-by: Emily Dixon <[email protected]>

* Minor example app renaming (#29)

* Use a UUID string as MuxUpload internal identifier (#30)

* Display a more specific error message when the direct upload POST request fails (#32)

* Use MuxUpload id instead if the input URL when looking up or writing state in the SDK (#33)

* Change upload creation example app method to use discardableResult (#34)

* Add dedicated internal initializer for MuxUpload error with unknown error code (#35)

* Rename enum and adjust to camel casing (#36)

* Adhere to Swift formatting guidelines, remove snake casing (#37)

* Fix potential crash in ChunkedFile (#38)

* Include Cloud shared asset sources when requesting assets (#40)

* Prevent arithmentic overflow when setting chunk content range value (#45)

* Remove force unwrap that can cause a crash (#47)

* Make internal class methods internal (#51)
tomkordic pushed a commit that referenced this pull request Mar 1, 2024
* Project Input standardization (#17) (#41) (#46) (#48) (#57)  (#77)

Add AVFoundation and PhotosKit initializers

Add internal and external state mapping

Remove duplicate status enum and add inline docs to external status

Add inline API docs to PHAsset-based MuxUpload constructor

Consolidate all `MuxUpload` options into a single struct `UploadOptions`

Declare asynchronous MuxUpload constructor in PHAsset extension

Place extension methods into dedicated directories

Polish inline API documentation

Add new API documentation and note the placeholder implementation

Add option variants as static members: defaults, disabled inputStandardization

Deprecate existing initializer, normally this API should be removed prior to GA, but since it was the only initializer exposed up to this point removing it would break everybody. Instead deprecate and remove at a later date.

Store all MuxUpload-related options in UploadInfo

Use correct starting byte parameter when restarting upload

If input standardized, standardized input URL is passed to UploadInfo
instead of the original input URL used for initializer

Note: SDK probably needs to re-export a high quality asset anyway so
possibly need a bridging status

Add dedicated internal initializer for MuxUpload error with unknown error code

Request local and remote assets

Standardize via AVFoundation asset export session

Expose hook for client to cancel upload if standardization failed

Call cancellation hook if inspection fails. We're not sure if the input is standard or not so better to be safe
and confirm

Export based on maximum resolution set by client

Cleaner non standard input handler invocation 

Add CustomStringConvertible conformance to maximum resolution (#56)

Only mark upload as started if its ready

Safe storage for MuxUpload (#71)

Intended to prevent a crash if MuxUpload is extended by the SDK client to conform to Equatable or Hashable protocols

Switch order of operations to avoid long pause on fetching duration

AVAsset sometimes hangs when asked to asynchronously fetch
duration when there aren't audio or video tracks present.

To avoid this after starting the upload, the inspection step will
get the video tracks first and get the duration afterwards.

---------

Co-authored-by: Emily Dixon <[email protected]>

* Minor example app renaming (#29)

* Use a UUID string as MuxUpload internal identifier (#30)

* Display a more specific error message when the direct upload POST request fails (#32)

* Use MuxUpload id instead if the input URL when looking up or writing state in the SDK (#33)

* Change upload creation example app method to use discardableResult (#34)

* Add dedicated internal initializer for MuxUpload error with unknown error code (#35)

* Rename enum and adjust to camel casing (#36)

* Adhere to Swift formatting guidelines, remove snake casing (#37)

* Fix potential crash in ChunkedFile (#38)

* Include Cloud shared asset sources when requesting assets (#40)

* Prevent arithmentic overflow when setting chunk content range value (#45)

* Remove force unwrap that can cause a crash (#47)

* Make internal class methods internal (#51)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants