This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PODS: | |
- AppsFlyer-SDK (2.5.3.15.1) | |
- Bolts (1.6.0): | |
- Bolts/AppLinks (= 1.6.0) | |
- Bolts/Tasks (= 1.6.0) | |
- Bolts/AppLinks (1.6.0): | |
- Bolts/Tasks | |
- Bolts/Tasks (1.6.0) | |
- FBSDKCoreKit (4.7.0): | |
- Bolts (~> 1.1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2016-08-11 11:31:14.785 Generate[471:146048] Warning: A long-running operation is being executed on the main thread. | |
Break on warnBlockingOperationOnMainThread() to debug. | |
2016-08-11 11:31:15.828 Generate[471:146048] Received memory warning. | |
2016-08-11 11:31:18.595 Generate[471:146048] Welcome | |
2016-08-11 11:31:19.296 Generate[471:146048] Warning: A long-running operation is being executed on the main thread. | |
Break on warnBlockingOperationOnMainThread() to debug. | |
2016-08-11 11:31:19.306 Generate[471:146048] Warning: A long-running operation is being executed on the main thread. | |
Break on warnBlockingOperationOnMainThread() to debug. | |
2016-08-11 11:31:19.308 Generate[471:146048] Warning: A long-running operation is being executed on the main thread. | |
Break on warnBlockingOperationOnMainThread() to debug. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.rawG8OutputTarget = [[GPUImageRawDataOutput alloc] initWithImageSize: aspectSize resultsInBGRAFormat:YES]; | |
[filterChain.output addTarget:self.rawG8OutputTarget]; | |
__weak GPUImageRawDataOutput *weakRawOutput = self.rawG8OutputTarget; | |
[self.rawG8OutputTarget setNewFrameAvailableBlock:^{ | |
GLubyte *outputBytes = [weakRawOutput rawBytesForImage]; | |
NSInteger bytesPerRow = [weakRawOutput bytesPerRowInOutput]; | |
//I use this variables to create the image to be streamed. | |
}]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let userId = AccessToken.current?.userId | |
let path = "/"+userId!+"/live_videos" | |
var title = "the title" | |
let descript = "my description" | |
let request : GraphRequest = GraphRequest(graphPath: path, | |
parameters:["title": title!, | |
"description": descript, | |
"privacy":"{'value':'SELF'}", | |
"save_vod": true, | |
"fields": ""], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let myPixelBuffy = [self pixelBufferFromCGImage:[[UIImage imageNamed:@"myImage.png"] CGImage]]; | |
- (CVPixelBufferRef)pixelBufferFromCGImage:(CGImageRef)image | |
{ | |
CGSize frameSize = CGSizeMake(CGImageGetWidth(image), CGImageGetHeight(image)); | |
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys: | |
[NSNumber numberWithBool:YES], kCVPixelBufferCGImageCompatibilityKey, | |
[NSNumber numberWithBool:YES], kCVPixelBufferCGBitmapContextCompatibilityKey, | |
nil]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var thePixelBuffer : CVPixelBuffer? | |
let testImage : UIImage = UIImage.init(named: "twdEnds.png")! | |
self.thePixelBuffer = self.pixelBufferFromImage(image: testImage) | |
func pixelBufferFromImage(image: UIImage) -> CVPixelBuffer { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func startPollingComments(){ | |
if let cStream = currentStream, connected == true{ | |
//the code would not continue if its NOT connected. hence the Timer shcedule will not be generated, this stops the polling | |
let stream = cStream as! FBLiveStream | |
stream.getLastComments(completion: { (comments, error) in | |
if (error == nil){ | |
self.onCommentsUpdate?(comments as! [Dictionary<String, Any>]) | |
} | |
Timer.scheduledTimer(withTimeInterval: 5.0, repeats: false, block: {timer in | |
self.startPollingComments() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pausePixelBuffer = CVPixelBuffer? | |
func pauseTheStream(){ | |
//Create your Pause Image | |
createOncePixelBuffer() | |
//Push your Pause Image into the stream | |
pushPixelBufferToStream(self.pausePixelBuffer) | |
//Pause the stream, the video should stop in the last frame, which is your image | |
rtmpStream.togglePause() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import AVFoundation | |
import lf | |
import GPUImage | |
import VideoToolbox | |
class G8LiveStreamer: NSObject { | |
var streamUrl:String? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lf | |
import UIKit | |
import XCGLogger | |
import AVFoundation | |
let sampleRate:Double = 44_100 | |
final class LiveViewController: UIViewController { | |
//..... |
OlderNewer