{"action":"created","issue":{"url":"https://api.github.com/repos/cloudwebrtc/flutter-webrtc/issues/28","repository_url":"https://api.github.com/repos/cloudwebrtc/flutter-webrtc","labels_url":"https://api.github.com/repos/cloudwebrtc/flutter-webrtc/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/cloudwebrtc/flutter-webrtc/issues/28/comments","events_url":"https://api.github.com/repos/cloudwebrtc/flutter-webrtc/issues/28/events","html_url":"https://github.com/cloudwebrtc/flutter-webrtc/issues/28","id":383446502,"node_id":"MDU6SXNzdWUzODM0NDY1MDI=","number":28,"title":"Update WebRTC framework","user":{"login":"rostopira","id":16724952,"node_id":"MDQ6VXNlcjE2NzI0OTUy","avatar_url":"https://avatars1.githubusercontent.com/u/16724952?v=4","gravatar_id":"","url":"https://api.github.com/users/rostopira","html_url":"https://github.com/rostopira","followers_url":"https://api.github.com/users/rostopira/followers","following_url":"https://api.github.com/users/rostopira/following{/other_user}","gists_url":"https://api.github.com/users/rostopira/gists{/gist_id}","starred_url":"https://api.github.com/users/rostopira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rostopira/subscriptions","organizations_url":"https://api.github.com/users/rostopira/orgs","repos_url":"https://api.github.com/users/rostopira/repos","events_url":"https://api.github.com/users/rostopira/events{/privacy}","received_events_url":"https://api.github.com/users/rostopira/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-11-22T09:26:03Z","updated_at":"2018-11-23T18:42:43Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Currently I'm trying to update WebRTC\r\nGoal is to make this plugin easily updatable with rolling dependency version\r\nI've removed WebRTC.framework in root, and using CocoaPods dependency (just set `s.dependency 'GoogleWebRTC'` in podspec)\r\nHowever I'm stuck at updating FlutterRTCMediaStream.m\r\n\r\nFollowing code not working \r\n\r\n```\r\n    if (videoDevice) {\r\n        RTCVideoSource *videoSource = [self.peerConnectionFactory videoSource];\r\n        \r\n        // FIXME The effort above to find a videoDevice value which satisfies the\r\n        // specified constraints was pretty much wasted. Salvage facingMode for\r\n        // starters because it is kind of a common and hence important feature on\r\n        // a mobile device.\r\n        \r\n        RTCCameraVideoCapturer *capt = [[RTCCameraVideoCapturer alloc] initWithDelegate:videoSource];\r\n        AVCaptureDeviceFormat *selectedFormat = nil;\r\n        int currentDiff = INT_MAX;\r\n        int targetWidth = 1280;\r\n        int targetHeight = 720;\r\n        for (AVCaptureDeviceFormat *format in [RTCCameraVideoCapturer supportedFormatsForDevice:videoDevice]) {\r\n            CMVideoDimensions dimension = CMVideoFormatDescriptionGetDimensions(format.formatDescription);\r\n            FourCharCode pixelFormat = CMFormatDescriptionGetMediaSubType(format.formatDescription);\r\n            int diff = abs(targetWidth - dimension.width) + abs(targetHeight - dimension.height);\r\n            if (diff < currentDiff) {\r\n                selectedFormat = format;\r\n                currentDiff = diff;\r\n            } else if (diff == currentDiff && pixelFormat == [capt preferredOutputPixelFormat]) {\r\n                selectedFormat = format;\r\n            }\r\n        }\r\n        //NSLog(@\"test %@\", [(NSString *)selectedFormat lowercaseString]);\r\n        if (selectedFormat == nil) {\r\n            NSLog(@\"Capture format fucked up. Fallback\");\r\n            selectedFormat = [RTCCameraVideoCapturer supportedFormatsForDevice:videoDevice].firstObject;\r\n        }\r\n        [capt startCaptureWithDevice:videoDevice format:selectedFormat fps:30 completionHandler:^(NSError *error) {\r\n            NSLog(@\"Start capture error: %@\", [error localizedDescription]);\r\n        }];\r\n        \r\n        NSString *trackUUID = [[NSUUID UUID] UUIDString];\r\n        RTCVideoTrack *videoTrack = [self.peerConnectionFactory videoTrackWithSource:videoSource trackId:trackUUID];\r\n        [mediaStream addVideoTrack:videoTrack];\r\n        \r\n        successCallback(mediaStream);\r\n    } else {\r\n        // According to step 6.2.3 of the getUserMedia() algorithm, if there is no\r\n        // source, fail with a new OverconstrainedError.\r\n        errorCallback(@\"OverconstrainedError\", /* errorMessage */ nil);\r\n    }\r\n```"},"comment":{"url":"https://api.github.com/repos/cloudwebrtc/flutter-webrtc/issues/comments/441301920","html_url":"https://github.com/cloudwebrtc/flutter-webrtc/issues/28#issuecomment-441301920","issue_url":"https://api.github.com/repos/cloudwebrtc/flutter-webrtc/issues/28","id":441301920,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MTMwMTkyMA==","user":{"login":"rostopira","id":16724952,"node_id":"MDQ6VXNlcjE2NzI0OTUy","avatar_url":"https://avatars1.githubusercontent.com/u/16724952?v=4","gravatar_id":"","url":"https://api.github.com/users/rostopira","html_url":"https://github.com/rostopira","followers_url":"https://api.github.com/users/rostopira/followers","following_url":"https://api.github.com/users/rostopira/following{/other_user}","gists_url":"https://api.github.com/users/rostopira/gists{/gist_id}","starred_url":"https://api.github.com/users/rostopira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rostopira/subscriptions","organizations_url":"https://api.github.com/users/rostopira/orgs","repos_url":"https://api.github.com/users/rostopira/repos","events_url":"https://api.github.com/users/rostopira/events{/privacy}","received_events_url":"https://api.github.com/users/rostopira/received_events","type":"User","site_admin":false},"created_at":"2018-11-23T18:42:43Z","updated_at":"2018-11-23T18:42:43Z","author_association":"CONTRIBUTOR","body":"Here is my fork: https://github.com/rostopira/flutter-webrtc\r\nI will work on updating android for now"}}
{"actor":{"display_login":"rostopira"}}