Skip to content

Commit

Permalink
Merge pull request #45 from fastogt/master
Browse files Browse the repository at this point in the history
camera_with_rtmp: android build failure due to type mismatch #36
  • Loading branch information
pinkfish authored Feb 27, 2021
2 parents d38bd94 + b89c4df commit fcd9e01
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ class Camera(
orientationEventListener.enable()
val characteristics = cameraManager.getCameraCharacteristics(cameraName)
isFrontFacing = characteristics.get(CameraCharacteristics.LENS_FACING) == CameraMetadata.LENS_FACING_FRONT
sensorOrientation = characteristics.get(CameraCharacteristics.SENSOR_ORIENTATION)
sensorOrientation = characteristics.get(CameraCharacteristics.SENSOR_ORIENTATION)!!
currentOrientation = Math.round(activity.resources.configuration.orientation / 90.0).toInt() * 90
val preset = ResolutionPreset.valueOf(resolutionPreset!!)
recordingProfile = CameraUtils.getBestAvailableCamcorderProfileForResolutionPreset(cameraName, preset)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ object CameraUtils {
val characteristics = cameraManager.getCameraCharacteristics(cameraName)
details["name"] = cameraName
val sensorOrientation = characteristics.get(CameraCharacteristics.SENSOR_ORIENTATION)
details["sensorOrientation"] = sensorOrientation
details["sensorOrientation"] = sensorOrientation!!
val lensFacing = characteristics.get(CameraCharacteristics.LENS_FACING)
when (lensFacing) {
CameraMetadata.LENS_FACING_FRONT -> details["lensFacing"] = "front"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class VideoEncoder(
private fun sendSPSandPPS(mediaFormat: MediaFormat) {
//H265
if (type!!.equals(CodecUtil.H265_MIME)) {
val byteBufferList = extractVpsSpsPpsFromH265(mediaFormat.getByteBuffer("csd-0"))
val byteBufferList = extractVpsSpsPpsFromH265(mediaFormat.getByteBuffer("csd-0")!!)
getVideoData.onSpsPpsVps(byteBufferList!![1], byteBufferList[2], byteBufferList[0])
//H264
} else {
Expand Down Expand Up @@ -424,10 +424,10 @@ class VideoEncoder(
} else {
mediaCodec.getOutputBuffers().get(outBufferIndex)
}
processOutput(byteBuffer, mediaCodec, outBufferIndex, bufferInfo)
processOutput(byteBuffer!!, mediaCodec, outBufferIndex, bufferInfo)
}

companion object {
private val TAG: String? = "VideoEncoder"
}
}
}

0 comments on commit fcd9e01

Please sign in to comment.