Instance Method

appendSampleBuffer:

Appends samples to the receiver.

Declaration

- (BOOL)appendSampleBuffer:(CMSampleBufferRef)sampleBuffer;

Parameters

sampleBuffer

The CMSampleBuffer to be appended.

Return Value

YES if sampleBuffer as appended successfully, otherwise NO.

Discussion

The timing information in the sample buffer, considered relative to the time passed to the asset writer’s startSessionAtSourceTime: will be used to determine the timing of those samples in the output file.

The appended sample buffers are expected to be ordered according to storage requirements. If you're working with sample buffers containing compressed video, they should be ordered and appended according to their decode timestamp.

If NO is returned, clients can check the value of the AVAssetWriter status property to determine whether the writing operation completed, failed, or was cancelled.  If the status is AVAssetWriterStatusFailed, The AVAssetWriter error property will contain an instance of NSErrorß that describes the failure.

Do not modify sampleBuffer or its contents after you have passed it to this method.

See Also

Adding Media Samples

readyForMoreMediaData

A Boolean value that indicates the readiness of the input to accept more media data.

- markAsFinished

Tells the writer it can't append more buffers to this input.

- requestMediaDataWhenReadyOnQueue:usingBlock:

Instructs the receiver to invoke a block repeatedly, at its convenience, to gather media data for writing to the output.