Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
huiping192 committed Sep 12, 2023
1 parent 6a19182 commit d1a8f3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Sources/HPLiveKit/Coder/LiveVideoH264Encoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class LiveVideoH264Encoder: VideoEncoder {
isBackground = false
}

func encodeVideoData(sampleBuffer: CMSampleBuffer) {
func encode(sampleBuffer: CMSampleBuffer) {
guard !isBackground else { return }
guard let compressionSession = compressionSession else { return }
guard let imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer) else { return }
Expand Down Expand Up @@ -197,7 +197,7 @@ class LiveVideoH264Encoder: VideoEncoder {
}
}

func stopEncoder() {
func stop() {
guard let compressionSession = compressionSession else { return }
VTCompressionSessionCompleteFrames(compressionSession, untilPresentationTimeStamp: CMTime.indefinite)
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/HPLiveKit/Coder/VideoEncoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protocol VideoEncoder: AnyObject {

// Method to encode a video frame.
// The sample buffer contains the raw video data that needs to be encoded.
func encodeVideoData(sampleBuffer: CMSampleBuffer)
func encode(sampleBuffer: CMSampleBuffer)

// Property representing the bit rate of the video encoder.
// Higher bit rate generally means better video quality but increased bandwidth consumption.
Expand All @@ -37,5 +37,5 @@ protocol VideoEncoder: AnyObject {

// Method to stop the encoder.
// This can be useful to release resources when encoding is not needed.
func stopEncoder()
func stop()
}

0 comments on commit d1a8f3d

Please sign in to comment.