├── .gitignore ├── LICENSE ├── README.md └── RTScreenRecorder ├── RTScreenRecorder.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── RTScreenRecorder ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ └── Main.storyboard ├── Info.plist ├── RTScreenRecorder.h ├── RTScreenRecorder.m ├── ViewController.h ├── ViewController.m └── main.m ├── RTScreenRecorderTests ├── Info.plist └── RTScreenRecorderTests.m └── RTScreenRecorderUITests ├── Info.plist └── RTScreenRecorderUITests.m /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata 19 | 20 | ## Other 21 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | # Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RTScreenRecorder 2 | Screen Recorder provided you buffer accessing output or file output on OSX. 3 | -------------------------------------------------------------------------------- /RTScreenRecorder/RTScreenRecorder.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 500D614F1CA2D8BB003F76A2 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 500D614E1CA2D8BB003F76A2 /* AppDelegate.m */; }; 11 | 500D61521CA2D8BB003F76A2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 500D61511CA2D8BB003F76A2 /* main.m */; }; 12 | 500D61551CA2D8BB003F76A2 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 500D61541CA2D8BB003F76A2 /* ViewController.m */; }; 13 | 500D61571CA2D8BB003F76A2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 500D61561CA2D8BB003F76A2 /* Assets.xcassets */; }; 14 | 500D615A1CA2D8BB003F76A2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 500D61581CA2D8BB003F76A2 /* Main.storyboard */; }; 15 | 500D61651CA2D8BB003F76A2 /* RTScreenRecorderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 500D61641CA2D8BB003F76A2 /* RTScreenRecorderTests.m */; }; 16 | 500D61701CA2D8BB003F76A2 /* RTScreenRecorderUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 500D616F1CA2D8BB003F76A2 /* RTScreenRecorderUITests.m */; }; 17 | 500D617F1CA2DAAA003F76A2 /* RTScreenRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 500D617E1CA2DAAA003F76A2 /* RTScreenRecorder.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | 500D61611CA2D8BB003F76A2 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = 500D61421CA2D8BB003F76A2 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = 500D61491CA2D8BB003F76A2; 26 | remoteInfo = RTScreenRecorder; 27 | }; 28 | 500D616C1CA2D8BB003F76A2 /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = 500D61421CA2D8BB003F76A2 /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = 500D61491CA2D8BB003F76A2; 33 | remoteInfo = RTScreenRecorder; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | 500D614A1CA2D8BB003F76A2 /* RTScreenRecorder.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RTScreenRecorder.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | 500D614D1CA2D8BB003F76A2 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 40 | 500D614E1CA2D8BB003F76A2 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 41 | 500D61511CA2D8BB003F76A2 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 42 | 500D61531CA2D8BB003F76A2 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 43 | 500D61541CA2D8BB003F76A2 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 44 | 500D61561CA2D8BB003F76A2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 45 | 500D61591CA2D8BB003F76A2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 46 | 500D615B1CA2D8BB003F76A2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 47 | 500D61601CA2D8BB003F76A2 /* RTScreenRecorderTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RTScreenRecorderTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | 500D61641CA2D8BB003F76A2 /* RTScreenRecorderTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RTScreenRecorderTests.m; sourceTree = ""; }; 49 | 500D61661CA2D8BB003F76A2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 50 | 500D616B1CA2D8BB003F76A2 /* RTScreenRecorderUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RTScreenRecorderUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 500D616F1CA2D8BB003F76A2 /* RTScreenRecorderUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RTScreenRecorderUITests.m; sourceTree = ""; }; 52 | 500D61711CA2D8BB003F76A2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 53 | 500D617D1CA2DAAA003F76A2 /* RTScreenRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTScreenRecorder.h; sourceTree = ""; }; 54 | 500D617E1CA2DAAA003F76A2 /* RTScreenRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RTScreenRecorder.m; sourceTree = ""; }; 55 | /* End PBXFileReference section */ 56 | 57 | /* Begin PBXFrameworksBuildPhase section */ 58 | 500D61471CA2D8BB003F76A2 /* Frameworks */ = { 59 | isa = PBXFrameworksBuildPhase; 60 | buildActionMask = 2147483647; 61 | files = ( 62 | ); 63 | runOnlyForDeploymentPostprocessing = 0; 64 | }; 65 | 500D615D1CA2D8BB003F76A2 /* Frameworks */ = { 66 | isa = PBXFrameworksBuildPhase; 67 | buildActionMask = 2147483647; 68 | files = ( 69 | ); 70 | runOnlyForDeploymentPostprocessing = 0; 71 | }; 72 | 500D61681CA2D8BB003F76A2 /* Frameworks */ = { 73 | isa = PBXFrameworksBuildPhase; 74 | buildActionMask = 2147483647; 75 | files = ( 76 | ); 77 | runOnlyForDeploymentPostprocessing = 0; 78 | }; 79 | /* End PBXFrameworksBuildPhase section */ 80 | 81 | /* Begin PBXGroup section */ 82 | 500D61411CA2D8BB003F76A2 = { 83 | isa = PBXGroup; 84 | children = ( 85 | 500D614C1CA2D8BB003F76A2 /* RTScreenRecorder */, 86 | 500D61631CA2D8BB003F76A2 /* RTScreenRecorderTests */, 87 | 500D616E1CA2D8BB003F76A2 /* RTScreenRecorderUITests */, 88 | 500D614B1CA2D8BB003F76A2 /* Products */, 89 | ); 90 | sourceTree = ""; 91 | }; 92 | 500D614B1CA2D8BB003F76A2 /* Products */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 500D614A1CA2D8BB003F76A2 /* RTScreenRecorder.app */, 96 | 500D61601CA2D8BB003F76A2 /* RTScreenRecorderTests.xctest */, 97 | 500D616B1CA2D8BB003F76A2 /* RTScreenRecorderUITests.xctest */, 98 | ); 99 | name = Products; 100 | sourceTree = ""; 101 | }; 102 | 500D614C1CA2D8BB003F76A2 /* RTScreenRecorder */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 500D614D1CA2D8BB003F76A2 /* AppDelegate.h */, 106 | 500D614E1CA2D8BB003F76A2 /* AppDelegate.m */, 107 | 500D61531CA2D8BB003F76A2 /* ViewController.h */, 108 | 500D61541CA2D8BB003F76A2 /* ViewController.m */, 109 | 500D61561CA2D8BB003F76A2 /* Assets.xcassets */, 110 | 500D61581CA2D8BB003F76A2 /* Main.storyboard */, 111 | 500D615B1CA2D8BB003F76A2 /* Info.plist */, 112 | 500D61501CA2D8BB003F76A2 /* Supporting Files */, 113 | 500D617D1CA2DAAA003F76A2 /* RTScreenRecorder.h */, 114 | 500D617E1CA2DAAA003F76A2 /* RTScreenRecorder.m */, 115 | ); 116 | path = RTScreenRecorder; 117 | sourceTree = ""; 118 | }; 119 | 500D61501CA2D8BB003F76A2 /* Supporting Files */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 500D61511CA2D8BB003F76A2 /* main.m */, 123 | ); 124 | name = "Supporting Files"; 125 | sourceTree = ""; 126 | }; 127 | 500D61631CA2D8BB003F76A2 /* RTScreenRecorderTests */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | 500D61641CA2D8BB003F76A2 /* RTScreenRecorderTests.m */, 131 | 500D61661CA2D8BB003F76A2 /* Info.plist */, 132 | ); 133 | path = RTScreenRecorderTests; 134 | sourceTree = ""; 135 | }; 136 | 500D616E1CA2D8BB003F76A2 /* RTScreenRecorderUITests */ = { 137 | isa = PBXGroup; 138 | children = ( 139 | 500D616F1CA2D8BB003F76A2 /* RTScreenRecorderUITests.m */, 140 | 500D61711CA2D8BB003F76A2 /* Info.plist */, 141 | ); 142 | path = RTScreenRecorderUITests; 143 | sourceTree = ""; 144 | }; 145 | /* End PBXGroup section */ 146 | 147 | /* Begin PBXNativeTarget section */ 148 | 500D61491CA2D8BB003F76A2 /* RTScreenRecorder */ = { 149 | isa = PBXNativeTarget; 150 | buildConfigurationList = 500D61741CA2D8BB003F76A2 /* Build configuration list for PBXNativeTarget "RTScreenRecorder" */; 151 | buildPhases = ( 152 | 500D61461CA2D8BB003F76A2 /* Sources */, 153 | 500D61471CA2D8BB003F76A2 /* Frameworks */, 154 | 500D61481CA2D8BB003F76A2 /* Resources */, 155 | ); 156 | buildRules = ( 157 | ); 158 | dependencies = ( 159 | ); 160 | name = RTScreenRecorder; 161 | productName = RTScreenRecorder; 162 | productReference = 500D614A1CA2D8BB003F76A2 /* RTScreenRecorder.app */; 163 | productType = "com.apple.product-type.application"; 164 | }; 165 | 500D615F1CA2D8BB003F76A2 /* RTScreenRecorderTests */ = { 166 | isa = PBXNativeTarget; 167 | buildConfigurationList = 500D61771CA2D8BB003F76A2 /* Build configuration list for PBXNativeTarget "RTScreenRecorderTests" */; 168 | buildPhases = ( 169 | 500D615C1CA2D8BB003F76A2 /* Sources */, 170 | 500D615D1CA2D8BB003F76A2 /* Frameworks */, 171 | 500D615E1CA2D8BB003F76A2 /* Resources */, 172 | ); 173 | buildRules = ( 174 | ); 175 | dependencies = ( 176 | 500D61621CA2D8BB003F76A2 /* PBXTargetDependency */, 177 | ); 178 | name = RTScreenRecorderTests; 179 | productName = RTScreenRecorderTests; 180 | productReference = 500D61601CA2D8BB003F76A2 /* RTScreenRecorderTests.xctest */; 181 | productType = "com.apple.product-type.bundle.unit-test"; 182 | }; 183 | 500D616A1CA2D8BB003F76A2 /* RTScreenRecorderUITests */ = { 184 | isa = PBXNativeTarget; 185 | buildConfigurationList = 500D617A1CA2D8BB003F76A2 /* Build configuration list for PBXNativeTarget "RTScreenRecorderUITests" */; 186 | buildPhases = ( 187 | 500D61671CA2D8BB003F76A2 /* Sources */, 188 | 500D61681CA2D8BB003F76A2 /* Frameworks */, 189 | 500D61691CA2D8BB003F76A2 /* Resources */, 190 | ); 191 | buildRules = ( 192 | ); 193 | dependencies = ( 194 | 500D616D1CA2D8BB003F76A2 /* PBXTargetDependency */, 195 | ); 196 | name = RTScreenRecorderUITests; 197 | productName = RTScreenRecorderUITests; 198 | productReference = 500D616B1CA2D8BB003F76A2 /* RTScreenRecorderUITests.xctest */; 199 | productType = "com.apple.product-type.bundle.ui-testing"; 200 | }; 201 | /* End PBXNativeTarget section */ 202 | 203 | /* Begin PBXProject section */ 204 | 500D61421CA2D8BB003F76A2 /* Project object */ = { 205 | isa = PBXProject; 206 | attributes = { 207 | LastUpgradeCheck = 0720; 208 | ORGANIZATIONNAME = RavenTech; 209 | TargetAttributes = { 210 | 500D61491CA2D8BB003F76A2 = { 211 | CreatedOnToolsVersion = 7.2; 212 | }; 213 | 500D615F1CA2D8BB003F76A2 = { 214 | CreatedOnToolsVersion = 7.2; 215 | TestTargetID = 500D61491CA2D8BB003F76A2; 216 | }; 217 | 500D616A1CA2D8BB003F76A2 = { 218 | CreatedOnToolsVersion = 7.2; 219 | TestTargetID = 500D61491CA2D8BB003F76A2; 220 | }; 221 | }; 222 | }; 223 | buildConfigurationList = 500D61451CA2D8BB003F76A2 /* Build configuration list for PBXProject "RTScreenRecorder" */; 224 | compatibilityVersion = "Xcode 3.2"; 225 | developmentRegion = English; 226 | hasScannedForEncodings = 0; 227 | knownRegions = ( 228 | en, 229 | Base, 230 | ); 231 | mainGroup = 500D61411CA2D8BB003F76A2; 232 | productRefGroup = 500D614B1CA2D8BB003F76A2 /* Products */; 233 | projectDirPath = ""; 234 | projectRoot = ""; 235 | targets = ( 236 | 500D61491CA2D8BB003F76A2 /* RTScreenRecorder */, 237 | 500D615F1CA2D8BB003F76A2 /* RTScreenRecorderTests */, 238 | 500D616A1CA2D8BB003F76A2 /* RTScreenRecorderUITests */, 239 | ); 240 | }; 241 | /* End PBXProject section */ 242 | 243 | /* Begin PBXResourcesBuildPhase section */ 244 | 500D61481CA2D8BB003F76A2 /* Resources */ = { 245 | isa = PBXResourcesBuildPhase; 246 | buildActionMask = 2147483647; 247 | files = ( 248 | 500D61571CA2D8BB003F76A2 /* Assets.xcassets in Resources */, 249 | 500D615A1CA2D8BB003F76A2 /* Main.storyboard in Resources */, 250 | ); 251 | runOnlyForDeploymentPostprocessing = 0; 252 | }; 253 | 500D615E1CA2D8BB003F76A2 /* Resources */ = { 254 | isa = PBXResourcesBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | ); 258 | runOnlyForDeploymentPostprocessing = 0; 259 | }; 260 | 500D61691CA2D8BB003F76A2 /* Resources */ = { 261 | isa = PBXResourcesBuildPhase; 262 | buildActionMask = 2147483647; 263 | files = ( 264 | ); 265 | runOnlyForDeploymentPostprocessing = 0; 266 | }; 267 | /* End PBXResourcesBuildPhase section */ 268 | 269 | /* Begin PBXSourcesBuildPhase section */ 270 | 500D61461CA2D8BB003F76A2 /* Sources */ = { 271 | isa = PBXSourcesBuildPhase; 272 | buildActionMask = 2147483647; 273 | files = ( 274 | 500D61551CA2D8BB003F76A2 /* ViewController.m in Sources */, 275 | 500D617F1CA2DAAA003F76A2 /* RTScreenRecorder.m in Sources */, 276 | 500D61521CA2D8BB003F76A2 /* main.m in Sources */, 277 | 500D614F1CA2D8BB003F76A2 /* AppDelegate.m in Sources */, 278 | ); 279 | runOnlyForDeploymentPostprocessing = 0; 280 | }; 281 | 500D615C1CA2D8BB003F76A2 /* Sources */ = { 282 | isa = PBXSourcesBuildPhase; 283 | buildActionMask = 2147483647; 284 | files = ( 285 | 500D61651CA2D8BB003F76A2 /* RTScreenRecorderTests.m in Sources */, 286 | ); 287 | runOnlyForDeploymentPostprocessing = 0; 288 | }; 289 | 500D61671CA2D8BB003F76A2 /* Sources */ = { 290 | isa = PBXSourcesBuildPhase; 291 | buildActionMask = 2147483647; 292 | files = ( 293 | 500D61701CA2D8BB003F76A2 /* RTScreenRecorderUITests.m in Sources */, 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | }; 297 | /* End PBXSourcesBuildPhase section */ 298 | 299 | /* Begin PBXTargetDependency section */ 300 | 500D61621CA2D8BB003F76A2 /* PBXTargetDependency */ = { 301 | isa = PBXTargetDependency; 302 | target = 500D61491CA2D8BB003F76A2 /* RTScreenRecorder */; 303 | targetProxy = 500D61611CA2D8BB003F76A2 /* PBXContainerItemProxy */; 304 | }; 305 | 500D616D1CA2D8BB003F76A2 /* PBXTargetDependency */ = { 306 | isa = PBXTargetDependency; 307 | target = 500D61491CA2D8BB003F76A2 /* RTScreenRecorder */; 308 | targetProxy = 500D616C1CA2D8BB003F76A2 /* PBXContainerItemProxy */; 309 | }; 310 | /* End PBXTargetDependency section */ 311 | 312 | /* Begin PBXVariantGroup section */ 313 | 500D61581CA2D8BB003F76A2 /* Main.storyboard */ = { 314 | isa = PBXVariantGroup; 315 | children = ( 316 | 500D61591CA2D8BB003F76A2 /* Base */, 317 | ); 318 | name = Main.storyboard; 319 | sourceTree = ""; 320 | }; 321 | /* End PBXVariantGroup section */ 322 | 323 | /* Begin XCBuildConfiguration section */ 324 | 500D61721CA2D8BB003F76A2 /* Debug */ = { 325 | isa = XCBuildConfiguration; 326 | buildSettings = { 327 | ALWAYS_SEARCH_USER_PATHS = NO; 328 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 329 | CLANG_CXX_LIBRARY = "libc++"; 330 | CLANG_ENABLE_MODULES = YES; 331 | CLANG_ENABLE_OBJC_ARC = YES; 332 | CLANG_WARN_BOOL_CONVERSION = YES; 333 | CLANG_WARN_CONSTANT_CONVERSION = YES; 334 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 335 | CLANG_WARN_EMPTY_BODY = YES; 336 | CLANG_WARN_ENUM_CONVERSION = YES; 337 | CLANG_WARN_INT_CONVERSION = YES; 338 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 339 | CLANG_WARN_UNREACHABLE_CODE = YES; 340 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 341 | CODE_SIGN_IDENTITY = "-"; 342 | COPY_PHASE_STRIP = NO; 343 | DEBUG_INFORMATION_FORMAT = dwarf; 344 | ENABLE_STRICT_OBJC_MSGSEND = YES; 345 | ENABLE_TESTABILITY = YES; 346 | GCC_C_LANGUAGE_STANDARD = gnu99; 347 | GCC_DYNAMIC_NO_PIC = NO; 348 | GCC_NO_COMMON_BLOCKS = YES; 349 | GCC_OPTIMIZATION_LEVEL = 0; 350 | GCC_PREPROCESSOR_DEFINITIONS = ( 351 | "DEBUG=1", 352 | "$(inherited)", 353 | ); 354 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 355 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 356 | GCC_WARN_UNDECLARED_SELECTOR = YES; 357 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 358 | GCC_WARN_UNUSED_FUNCTION = YES; 359 | GCC_WARN_UNUSED_VARIABLE = YES; 360 | MACOSX_DEPLOYMENT_TARGET = 10.11; 361 | MTL_ENABLE_DEBUG_INFO = YES; 362 | ONLY_ACTIVE_ARCH = YES; 363 | SDKROOT = macosx; 364 | }; 365 | name = Debug; 366 | }; 367 | 500D61731CA2D8BB003F76A2 /* Release */ = { 368 | isa = XCBuildConfiguration; 369 | buildSettings = { 370 | ALWAYS_SEARCH_USER_PATHS = NO; 371 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 372 | CLANG_CXX_LIBRARY = "libc++"; 373 | CLANG_ENABLE_MODULES = YES; 374 | CLANG_ENABLE_OBJC_ARC = YES; 375 | CLANG_WARN_BOOL_CONVERSION = YES; 376 | CLANG_WARN_CONSTANT_CONVERSION = YES; 377 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 378 | CLANG_WARN_EMPTY_BODY = YES; 379 | CLANG_WARN_ENUM_CONVERSION = YES; 380 | CLANG_WARN_INT_CONVERSION = YES; 381 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 382 | CLANG_WARN_UNREACHABLE_CODE = YES; 383 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 384 | CODE_SIGN_IDENTITY = "-"; 385 | COPY_PHASE_STRIP = NO; 386 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 387 | ENABLE_NS_ASSERTIONS = NO; 388 | ENABLE_STRICT_OBJC_MSGSEND = YES; 389 | GCC_C_LANGUAGE_STANDARD = gnu99; 390 | GCC_NO_COMMON_BLOCKS = YES; 391 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 392 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 393 | GCC_WARN_UNDECLARED_SELECTOR = YES; 394 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 395 | GCC_WARN_UNUSED_FUNCTION = YES; 396 | GCC_WARN_UNUSED_VARIABLE = YES; 397 | MACOSX_DEPLOYMENT_TARGET = 10.11; 398 | MTL_ENABLE_DEBUG_INFO = NO; 399 | SDKROOT = macosx; 400 | }; 401 | name = Release; 402 | }; 403 | 500D61751CA2D8BB003F76A2 /* Debug */ = { 404 | isa = XCBuildConfiguration; 405 | buildSettings = { 406 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 407 | COMBINE_HIDPI_IMAGES = YES; 408 | INFOPLIST_FILE = RTScreenRecorder/Info.plist; 409 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 410 | PRODUCT_BUNDLE_IDENTIFIER = com.raventech.RTScreenRecorder; 411 | PRODUCT_NAME = "$(TARGET_NAME)"; 412 | }; 413 | name = Debug; 414 | }; 415 | 500D61761CA2D8BB003F76A2 /* Release */ = { 416 | isa = XCBuildConfiguration; 417 | buildSettings = { 418 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 419 | COMBINE_HIDPI_IMAGES = YES; 420 | INFOPLIST_FILE = RTScreenRecorder/Info.plist; 421 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 422 | PRODUCT_BUNDLE_IDENTIFIER = com.raventech.RTScreenRecorder; 423 | PRODUCT_NAME = "$(TARGET_NAME)"; 424 | }; 425 | name = Release; 426 | }; 427 | 500D61781CA2D8BB003F76A2 /* Debug */ = { 428 | isa = XCBuildConfiguration; 429 | buildSettings = { 430 | BUNDLE_LOADER = "$(TEST_HOST)"; 431 | COMBINE_HIDPI_IMAGES = YES; 432 | INFOPLIST_FILE = RTScreenRecorderTests/Info.plist; 433 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 434 | PRODUCT_BUNDLE_IDENTIFIER = com.raventech.RTScreenRecorderTests; 435 | PRODUCT_NAME = "$(TARGET_NAME)"; 436 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RTScreenRecorder.app/Contents/MacOS/RTScreenRecorder"; 437 | }; 438 | name = Debug; 439 | }; 440 | 500D61791CA2D8BB003F76A2 /* Release */ = { 441 | isa = XCBuildConfiguration; 442 | buildSettings = { 443 | BUNDLE_LOADER = "$(TEST_HOST)"; 444 | COMBINE_HIDPI_IMAGES = YES; 445 | INFOPLIST_FILE = RTScreenRecorderTests/Info.plist; 446 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 447 | PRODUCT_BUNDLE_IDENTIFIER = com.raventech.RTScreenRecorderTests; 448 | PRODUCT_NAME = "$(TARGET_NAME)"; 449 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RTScreenRecorder.app/Contents/MacOS/RTScreenRecorder"; 450 | }; 451 | name = Release; 452 | }; 453 | 500D617B1CA2D8BB003F76A2 /* Debug */ = { 454 | isa = XCBuildConfiguration; 455 | buildSettings = { 456 | COMBINE_HIDPI_IMAGES = YES; 457 | INFOPLIST_FILE = RTScreenRecorderUITests/Info.plist; 458 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 459 | PRODUCT_BUNDLE_IDENTIFIER = com.raventech.RTScreenRecorderUITests; 460 | PRODUCT_NAME = "$(TARGET_NAME)"; 461 | TEST_TARGET_NAME = RTScreenRecorder; 462 | USES_XCTRUNNER = YES; 463 | }; 464 | name = Debug; 465 | }; 466 | 500D617C1CA2D8BB003F76A2 /* Release */ = { 467 | isa = XCBuildConfiguration; 468 | buildSettings = { 469 | COMBINE_HIDPI_IMAGES = YES; 470 | INFOPLIST_FILE = RTScreenRecorderUITests/Info.plist; 471 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 472 | PRODUCT_BUNDLE_IDENTIFIER = com.raventech.RTScreenRecorderUITests; 473 | PRODUCT_NAME = "$(TARGET_NAME)"; 474 | TEST_TARGET_NAME = RTScreenRecorder; 475 | USES_XCTRUNNER = YES; 476 | }; 477 | name = Release; 478 | }; 479 | /* End XCBuildConfiguration section */ 480 | 481 | /* Begin XCConfigurationList section */ 482 | 500D61451CA2D8BB003F76A2 /* Build configuration list for PBXProject "RTScreenRecorder" */ = { 483 | isa = XCConfigurationList; 484 | buildConfigurations = ( 485 | 500D61721CA2D8BB003F76A2 /* Debug */, 486 | 500D61731CA2D8BB003F76A2 /* Release */, 487 | ); 488 | defaultConfigurationIsVisible = 0; 489 | defaultConfigurationName = Release; 490 | }; 491 | 500D61741CA2D8BB003F76A2 /* Build configuration list for PBXNativeTarget "RTScreenRecorder" */ = { 492 | isa = XCConfigurationList; 493 | buildConfigurations = ( 494 | 500D61751CA2D8BB003F76A2 /* Debug */, 495 | 500D61761CA2D8BB003F76A2 /* Release */, 496 | ); 497 | defaultConfigurationIsVisible = 0; 498 | }; 499 | 500D61771CA2D8BB003F76A2 /* Build configuration list for PBXNativeTarget "RTScreenRecorderTests" */ = { 500 | isa = XCConfigurationList; 501 | buildConfigurations = ( 502 | 500D61781CA2D8BB003F76A2 /* Debug */, 503 | 500D61791CA2D8BB003F76A2 /* Release */, 504 | ); 505 | defaultConfigurationIsVisible = 0; 506 | }; 507 | 500D617A1CA2D8BB003F76A2 /* Build configuration list for PBXNativeTarget "RTScreenRecorderUITests" */ = { 508 | isa = XCConfigurationList; 509 | buildConfigurations = ( 510 | 500D617B1CA2D8BB003F76A2 /* Debug */, 511 | 500D617C1CA2D8BB003F76A2 /* Release */, 512 | ); 513 | defaultConfigurationIsVisible = 0; 514 | }; 515 | /* End XCConfigurationList section */ 516 | }; 517 | rootObject = 500D61421CA2D8BB003F76A2 /* Project object */; 518 | } 519 | -------------------------------------------------------------------------------- /RTScreenRecorder/RTScreenRecorder.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RTScreenRecorder/RTScreenRecorder/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // RTScreenRecorder 4 | // 5 | // Created by 叔 陈 on 16/3/23. 6 | // Copyright © 2016年 RavenTech. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : NSObject 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /RTScreenRecorder/RTScreenRecorder/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // RTScreenRecorder 4 | // 5 | // Created by 叔 陈 on 16/3/23. 6 | // Copyright © 2016年 RavenTech. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 18 | // Insert code here to initialize your application 19 | } 20 | 21 | - (void)applicationWillTerminate:(NSNotification *)aNotification { 22 | // Insert code here to tear down your application 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /RTScreenRecorder/RTScreenRecorder/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /RTScreenRecorder/RTScreenRecorder/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | Default 511 | 512 | 513 | 514 | 515 | 516 | 517 | Left to Right 518 | 519 | 520 | 521 | 522 | 523 | 524 | Right to Left 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | Default 536 | 537 | 538 | 539 | 540 | 541 | 542 | Left to Right 543 | 544 | 545 | 546 | 547 | 548 | 549 | Right to Left 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | -------------------------------------------------------------------------------- /RTScreenRecorder/RTScreenRecorder/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | Copyright © 2016年 RavenTech. All rights reserved. 29 | NSMainStoryboardFile 30 | Main 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /RTScreenRecorder/RTScreenRecorder/RTScreenRecorder.h: -------------------------------------------------------------------------------- 1 | // 2 | // RTScreenRecorder.h 3 | // RTScreenRecorder 4 | // 5 | // Created by 叔 陈 on 16/3/23. 6 | // Copyright © 2016年 RavenTech. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface RTScreenRecorder : NSObject 13 | 14 | @property (retain) AVCaptureSession* session; 15 | @property (retain) AVCaptureScreenInput* input; 16 | @property (retain) AVCaptureOutput* output; 17 | 18 | @property NSURL* file; 19 | 20 | @property (copy) void (^callBack)(NSData *imageData); 21 | 22 | /** 23 | * Initialize recorder with a callback which included image for every frame 24 | * 25 | * @param callBack call back block that you can custom 26 | * 27 | * @return Instance of RTScreenRecorder 28 | */ 29 | - (instancetype)initWithCallBack:(void (^)(NSData *imageData))callBack; 30 | 31 | /** 32 | * Initialize recorder with a file URL that will be the destination file of the video 33 | * 34 | * @param fileName Exact file path 35 | * 36 | * @return Instance of RTScreenRecorder 37 | */ 38 | - (instancetype)initWithFileURL:(NSURL *)fileName; 39 | 40 | /** 41 | * Method you should call to start recording 42 | * 43 | * @return Bool value indicates the status of start operation 44 | */ 45 | - (BOOL) startRecording; 46 | 47 | /** 48 | * If you are using Capturing-To-File mode, you can pause recording and resume it. Otherwise you will receive NO from calling this method 49 | * 50 | * @return Bool value indicates the status of pause operation 51 | */ 52 | - (BOOL) pauseRecording; 53 | - (BOOL) resumeRecording; 54 | 55 | /** 56 | * Method you should call to stop recording 57 | * 58 | * @return Bool value indicates the status of stop operation 59 | */ 60 | - (BOOL) stopRecording; 61 | 62 | /** 63 | * Status of recording 64 | * 65 | * @return Bool value indicates the status of the recorder 66 | */ 67 | - (BOOL) isRecording; 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /RTScreenRecorder/RTScreenRecorder/RTScreenRecorder.m: -------------------------------------------------------------------------------- 1 | // 2 | // RTScreenRecorder.m 3 | // RTScreenRecorder 4 | // 5 | // Created by 叔 陈 on 16/3/23. 6 | // Copyright © 2016年 RavenTech. All rights reserved. 7 | // 8 | 9 | #import "RTScreenRecorder.h" 10 | 11 | @interface RTScreenRecorder () 12 | { 13 | BOOL recording; 14 | 15 | NSData *lastFrameData; 16 | } 17 | @end 18 | 19 | @implementation RTScreenRecorder 20 | 21 | @synthesize session; 22 | @synthesize input; 23 | @synthesize output; 24 | 25 | - (instancetype)initWithCallBack:(void (^)(NSData *imageData))callBack 26 | { 27 | self = [super init]; 28 | if(self) { 29 | self.callBack = callBack; 30 | 31 | recording = NO; 32 | 33 | self.session = [[AVCaptureSession alloc] init]; 34 | self.session.sessionPreset = AVCaptureSessionPresetLow; 35 | 36 | self.input = [[AVCaptureScreenInput alloc] initWithDisplayID:CGMainDisplayID()]; 37 | self.input.capturesMouseClicks = YES; 38 | self.input.minFrameDuration = CMTimeMake(1, 60); 39 | self.input.scaleFactor = 0.5f; 40 | self.input.cropRect = [self screenRect]; 41 | 42 | self.output = [[AVCaptureVideoDataOutput alloc] init]; 43 | [((AVCaptureVideoDataOutput *)self.output) setVideoSettings:[NSDictionary dictionaryWithObjectsAndKeys:@(kCVPixelFormatType_32BGRA),kCVPixelBufferPixelFormatTypeKey, nil]]; 44 | dispatch_queue_t queue = dispatch_queue_create("com.sergio.chan", 0); 45 | [(AVCaptureVideoDataOutput *)self.output setSampleBufferDelegate:self queue:queue]; 46 | //dispatch_release(queue); 47 | 48 | [self.session addInput:self.input]; 49 | [self.session addOutput:self.output]; 50 | } 51 | return self; 52 | } 53 | 54 | - (instancetype)initWithFileURL:(NSURL *)fileName 55 | { 56 | self = [super init]; 57 | if(self) { 58 | self.file = fileName; 59 | 60 | recording = NO; 61 | 62 | self.session = [[AVCaptureSession alloc] init]; 63 | self.session.sessionPreset = AVCaptureSessionPreset1280x720; 64 | 65 | self.input = [[AVCaptureScreenInput alloc] initWithDisplayID:CGMainDisplayID()]; 66 | self.input.capturesMouseClicks = YES; 67 | self.input.minFrameDuration = CMTimeMake(1, 60); 68 | self.input.scaleFactor = 0.5f; 69 | self.input.cropRect = [self screenRect]; 70 | 71 | self.output = [[AVCaptureMovieFileOutput alloc] init]; 72 | 73 | [self.session addInput:self.input]; 74 | [self.session addOutput:self.output]; 75 | } 76 | return self; 77 | } 78 | 79 | - (BOOL) startRecording 80 | { 81 | [self.session startRunning]; 82 | if ([self.output isKindOfClass:[AVCaptureMovieFileOutput class]]) { 83 | // Record to file 84 | [(AVCaptureMovieFileOutput *)self.output startRecordingToOutputFileURL:self.file recordingDelegate:self]; 85 | } 86 | recording = YES; 87 | return YES; 88 | } 89 | 90 | - (BOOL) pauseRecording 91 | { 92 | if ([self.output isKindOfClass:[AVCaptureMovieFileOutput class]]) { 93 | [(AVCaptureMovieFileOutput *)self.output pauseRecording]; 94 | recording = NO; 95 | return YES; 96 | } else { 97 | return NO; 98 | } 99 | } 100 | 101 | - (BOOL) resumeRecording 102 | { 103 | if ([self.output isKindOfClass:[AVCaptureMovieFileOutput class]]) { 104 | [(AVCaptureMovieFileOutput *)self.output resumeRecording]; 105 | recording = YES; 106 | return YES; 107 | } else { 108 | return NO; 109 | } 110 | } 111 | 112 | - (BOOL) stopRecording 113 | { 114 | [self.session stopRunning]; 115 | lastFrameData = nil; 116 | recording = NO; 117 | return YES; 118 | } 119 | 120 | - (BOOL) isRecording 121 | { 122 | return recording; 123 | } 124 | 125 | #pragma mark - Utilities 126 | 127 | - (NSRect)screenRect 128 | { 129 | NSRect screenRect; 130 | NSScreen *screen = [[NSScreen screens] objectAtIndex: 0]; 131 | screenRect = [screen frame]; 132 | 133 | return screenRect; 134 | } 135 | 136 | #pragma mark AVCaptureFileOutputDelegate 137 | 138 | - (void)captureOutput:(AVCaptureFileOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection { 139 | [self imageFromSampleBuffer:sampleBuffer]; 140 | } 141 | 142 | // Create a CGImageRef from sample buffer data 143 | - (void) imageFromSampleBuffer:(CMSampleBufferRef) sampleBuffer 144 | { 145 | @try { 146 | CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer); 147 | CVPixelBufferLockBaseAddress(imageBuffer,0); // Lock the image buffer 148 | 149 | uint8_t *baseAddress = (uint8_t *)CVPixelBufferGetBaseAddressOfPlane(imageBuffer, 0); // Get information of the image 150 | size_t bytesPerRow = CVPixelBufferGetBytesPerRow(imageBuffer); 151 | size_t width = CVPixelBufferGetWidth(imageBuffer); 152 | size_t height = CVPixelBufferGetHeight(imageBuffer); 153 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 154 | 155 | CGContextRef newContext = CGBitmapContextCreate(baseAddress, width, height, 8, bytesPerRow, colorSpace, kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst); 156 | CGImageRef newImage = CGBitmapContextCreateImage(newContext); 157 | CGContextRelease(newContext); 158 | 159 | CGColorSpaceRelease(colorSpace); 160 | CVPixelBufferUnlockBaseAddress(imageBuffer,0); 161 | 162 | NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc] initWithCGImage:newImage]; 163 | CGFloat imageCompression = 0.5; 164 | NSDictionary* jpegOptions = [NSDictionary dictionaryWithObjectsAndKeys: 165 | [NSNumber numberWithDouble:imageCompression], NSImageCompressionFactor, 166 | [NSNumber numberWithBool:NO], NSImageProgressive, 167 | nil]; 168 | NSData* jpegData = [bitmapRep representationUsingType:NSJPEGFileType properties:jpegOptions]; 169 | 170 | CGImageRelease(newImage); 171 | 172 | if (lastFrameData == nil) { 173 | lastFrameData = jpegData; 174 | } else { 175 | if([jpegData isEqualToData:lastFrameData]) { 176 | NSLog(@"Duplicate frame"); 177 | return; 178 | } else { 179 | lastFrameData = jpegData; 180 | } 181 | } 182 | dispatch_async(dispatch_get_main_queue(), ^{ 183 | if(self.callBack) { 184 | self.callBack(jpegData); 185 | } 186 | }); 187 | 188 | } 189 | @catch (NSException *exception) { 190 | NSLog(@"Error at %@",exception.debugDescription); 191 | } 192 | @finally { 193 | return; 194 | } 195 | } 196 | 197 | #pragma mark AVCaptureFileOutputRecordingDelegate 198 | 199 | - (void)captureOutput:(AVCaptureFileOutput *)captureOutput didFinishRecordingToOutputFileAtURL:(NSURL *)outputFileURL fromConnections:(NSArray *)connections error:(NSError *)error { 200 | } 201 | 202 | - (void)captureOutput:(AVCaptureFileOutput *)captureOutput didPauseRecordingToOutputFileAtURL:(NSURL *)fileURL fromConnections:(NSArray *)connections { 203 | } 204 | 205 | - (void)captureOutput:(AVCaptureFileOutput *)captureOutput didResumeRecordingToOutputFileAtURL:(NSURL *)fileURL fromConnections:(NSArray *)connections { 206 | } 207 | 208 | - (void)captureOutput:(AVCaptureFileOutput *)captureOutput didStartRecordingToOutputFileAtURL:(NSURL *)fileURL fromConnections:(NSArray *)connections { 209 | } 210 | 211 | - (void)captureOutput:(AVCaptureFileOutput *)captureOutput willFinishRecordingToOutputFileAtURL:(NSURL *)fileURL fromConnections:(NSArray *)connections error:(NSError *)error { 212 | } 213 | 214 | @end 215 | -------------------------------------------------------------------------------- /RTScreenRecorder/RTScreenRecorder/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // RTScreenRecorder 4 | // 5 | // Created by 叔 陈 on 16/3/23. 6 | // Copyright © 2016年 RavenTech. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "RTScreenRecorder.h" 11 | 12 | @interface ViewController : NSViewController 13 | 14 | @property (weak) IBOutlet NSImageView *imageView; 15 | @property (strong) RTScreenRecorder *recorder; 16 | 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /RTScreenRecorder/RTScreenRecorder/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // RTScreenRecorder 4 | // 5 | // Created by 叔 陈 on 16/3/23. 6 | // Copyright © 2016年 RavenTech. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @implementation ViewController 12 | 13 | - (void)viewDidLoad { 14 | [super viewDidLoad]; 15 | 16 | self.recorder = [[RTScreenRecorder alloc] initWithCallBack:^(NSData *imageData) { 17 | NSLog(@"image data size:%ld bytes",imageData.length); 18 | self.imageView.image = [[NSImage alloc] initWithData:imageData]; 19 | }]; 20 | // Do any additional setup after loading the view. 21 | } 22 | 23 | - (void)setRepresentedObject:(id)representedObject { 24 | [super setRepresentedObject:representedObject]; 25 | 26 | // Update the view, if already loaded. 27 | } 28 | 29 | - (IBAction)RecordButtonPressed:(id)sender { 30 | if([self.recorder isRecording]) { 31 | [self.recorder stopRecording]; 32 | } else { 33 | [self.recorder startRecording]; 34 | } 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /RTScreenRecorder/RTScreenRecorder/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // RTScreenRecorder 4 | // 5 | // Created by 叔 陈 on 16/3/23. 6 | // Copyright © 2016年 RavenTech. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, const char * argv[]) { 12 | return NSApplicationMain(argc, argv); 13 | } 14 | -------------------------------------------------------------------------------- /RTScreenRecorder/RTScreenRecorderTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /RTScreenRecorder/RTScreenRecorderTests/RTScreenRecorderTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // RTScreenRecorderTests.m 3 | // RTScreenRecorderTests 4 | // 5 | // Created by 叔 陈 on 16/3/23. 6 | // Copyright © 2016年 RavenTech. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RTScreenRecorderTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation RTScreenRecorderTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /RTScreenRecorder/RTScreenRecorderUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /RTScreenRecorder/RTScreenRecorderUITests/RTScreenRecorderUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // RTScreenRecorderUITests.m 3 | // RTScreenRecorderUITests 4 | // 5 | // Created by 叔 陈 on 16/3/23. 6 | // Copyright © 2016年 RavenTech. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RTScreenRecorderUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation RTScreenRecorderUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | --------------------------------------------------------------------------------