25 lines
728 B
Swift
25 lines
728 B
Swift
// Copyright 2013 The Flutter Authors
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
import AVFoundation
|
|
|
|
@testable import camera_avfoundation
|
|
|
|
/// Mock implementation of `AssetWriterInput` protocol which allows injecting a custom
|
|
/// implementation.
|
|
final class MockAssetWriterInput: NSObject, AssetWriterInput {
|
|
var appendStub: ((CMSampleBuffer) -> Bool)?
|
|
|
|
var avInput: AVAssetWriterInput {
|
|
preconditionFailure("Attempted to access unimplemented property: avInput")
|
|
}
|
|
|
|
var expectsMediaDataInRealTime = false
|
|
|
|
var isReadyForMoreMediaData = false
|
|
|
|
func append(_ sampleBuffer: CMSampleBuffer) -> Bool {
|
|
return appendStub?(sampleBuffer) ?? false
|
|
}
|
|
}
|