Skip to content

Commit

Permalink
Update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
pinkfish committed Jul 10, 2020
1 parent c6619dc commit c8d9fb7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 23 deletions.
42 changes: 19 additions & 23 deletions ios/Classes/FlutterRTMPStreaming.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,14 @@ public class FlutterRTMPStreaming : NSObject {
self.rtmpStream.orientation = orientation
print(String(format:"Orient %d", orientation.rawValue))
/*
self.rotationEffect = RotationEffect(orientation: orientation)
if (self.rtmpStream.registerVideoEffect(self.rotationEffect!)) {
print("Added rotation effect");
}else {
print("Failed to add rotation effect");
}
*/
self.rotationEffect = RotationEffect(orientation: orientation)
if (self.rtmpStream.registerVideoEffect(self.rotationEffect!)) {
print("Added rotation effect");
}else {
print("Failed to add rotation effect");
}
*/
}
print("after womble")
self.rtmpConnection.connect(self.url ?? "frog")
}
}
Expand Down Expand Up @@ -195,29 +194,26 @@ class MyRTMPStreamQoSDelagate: RTMPStreamDelegate {

func didPublishSufficientBW(_ stream: RTMPStream, withConnection: RTMPConnection) {
guard var videoBitrate = stream.videoSettings[.bitrate] as? UInt32 else { return }
print("didPublishSufficientBW \(videoBitrate)")

videoBitrate = videoBitrate + incrementBitrate
if videoBitrate > maxBitrate {
videoBitrate = maxBitrate
var newVideoBitrate = videoBitrate + incrementBitrate
if newVideoBitrate > maxBitrate {
newVideoBitrate = maxBitrate
}
print("didPublishSufficientBW update: \(videoBitrate)")
stream.videoSettings[.bitrate] = videoBitrate
print("didPublishSufficientBW update: \(stream.videoSettings[.bitrate])")
print("didPublishSufficientBW update: \(videoBitrate) -> \(newVideoBitrate)")
stream.videoSettings[.bitrate] = newVideoBitrate
}


// detect upload insufficent BandWidth
func didPublishInsufficientBW(_ stream:RTMPStream, withConnection:RTMPConnection) {
guard var videoBitrate = stream.videoSettings[.bitrate] as? UInt32 else { return }
print("didPublishInsufficientBW \(videoBitrate)")

videoBitrate = UInt32(videoBitrate / 2)
if videoBitrate < minBitrate {
videoBitrate = minBitrate

var newVideoBitrate = UInt32(videoBitrate / 2)
if newVideoBitrate < minBitrate {
newVideoBitrate = minBitrate
}
print("didPublishInsufficientBW update: \(videoBitrate)")
stream.videoSettings[.bitrate] = videoBitrate
print("didPublishInsufficientBW update: \(videoBitrate) -> \(newVideoBitrate)")
stream.videoSettings[.bitrate] = newVideoBitrate
}

func clear() {
Expand All @@ -232,7 +228,7 @@ final class RotationEffect: VideoEffect {
}
override func execute(_ image: CIImage, info: CMSampleBuffer?) -> CIImage {
guard #available(iOS 11.0, *) else {
return image
return image
}
switch orientation {
case .landscapeLeft:
Expand Down
1 change: 1 addition & 0 deletions ios/Classes/RtmppublisherPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ - (UIImageOrientation)getImageRotation {
float yxAtan = (atan2(_motionManager.accelerometerData.acceleration.y,
_motionManager.accelerometerData.acceleration.x)) *
180 / M_PI;
NSLog(@"getImageRotation: '%@'", yxAtan);
if (isNearValue(-90.0, yxAtan)) {
return UIImageOrientationRight;
} else if (isNearValueABS(180.0, yxAtan)) {
Expand Down

0 comments on commit c8d9fb7

Please sign in to comment.