{"id":100235,"date":"2020-05-21T04:59:53","date_gmt":"2020-05-20T20:59:53","guid":{"rendered":"http:\/\/4563.org\/?p=100235"},"modified":"2020-05-22T22:09:45","modified_gmt":"2020-05-22T14:09:45","slug":"%e5%8f%91%e5%b8%83%e4%b8%80%e4%b8%aa%e5%bc%80%e6%ba%90-android-%e7%9f%ad%e8%a7%86%e9%a2%91-sdk-%e6%bb%a1%e8%b6%b3-android-%e9%9f%b3%e8%a7%86%e9%a2%91%e5%a4%a7%e9%83%a8%e5%88%86%e9%9c%80%e6%b1%82-gith","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=100235","title":{"rendered":"\u53d1\u5e03\u4e00\u4e2a\u5f00\u6e90 Android \u77ed\u89c6\u9891 SDK, \u6ee1\u8db3 Android \u97f3\u89c6\u9891\u5927\u90e8\u5206\u9700\u6c42 github: https:\/\/github.com\/wlanjie\/trinity"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u53d1\u5e03\u4e00\u4e2a\u5f00\u6e90 Android \u77ed\u89c6\u9891 SDK, \u6ee1\u8db3 Android \u97f3\u89c6\u9891\u5927\u90e8\u5206\u9700\u6c42 github: https:\/\/github.com\/wlanjie\/trinity               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wlanjie888 <\/span>  <span><i><\/i> 0<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<h1>trinity<\/h1>\n<p> <\/p>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/05\/20200522_5ec7dd090fe9c.jpg\" alt=\"\u53d1\u5e03\u4e00\u4e2a\u5f00\u6e90 Android \u77ed\u89c6\u9891 SDK, \u6ee1\u8db3 Android \u97f3\u89c6\u9891\u5927\u90e8\u5206\u9700\u6c42 github: https:\/\/github.com\/wlanjie\/trinity\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/05\/20200522_5ec7dd0da947e.svg\" alt=\"\u53d1\u5e03\u4e00\u4e2a\u5f00\u6e90 Android \u77ed\u89c6\u9891 SDK, \u6ee1\u8db3 Android \u97f3\u89c6\u9891\u5927\u90e8\u5206\u9700\u6c42 github: https:\/\/github.com\/wlanjie\/trinity\" \/> <img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/05\/20200522_5ec7dd1192c05.svg\" alt=\"\u53d1\u5e03\u4e00\u4e2a\u5f00\u6e90 Android \u77ed\u89c6\u9891 SDK, \u6ee1\u8db3 Android \u97f3\u89c6\u9891\u5927\u90e8\u5206\u9700\u6c42 github: https:\/\/github.com\/wlanjie\/trinity\" \/> <img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/05\/20200522_5ec7dd168d5aa.svg\" alt=\"\u53d1\u5e03\u4e00\u4e2a\u5f00\u6e90 Android \u77ed\u89c6\u9891 SDK, \u6ee1\u8db3 Android \u97f3\u89c6\u9891\u5927\u90e8\u5206\u9700\u6c42 github: https:\/\/github.com\/wlanjie\/trinity\" \/> <img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/05\/20200522_5ec7dd1c49aa5.svg\" alt=\"\u53d1\u5e03\u4e00\u4e2a\u5f00\u6e90 Android \u77ed\u89c6\u9891 SDK, \u6ee1\u8db3 Android \u97f3\u89c6\u9891\u5927\u90e8\u5206\u9700\u6c42 github: https:\/\/github.com\/wlanjie\/trinity\" \/> <img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/05\/20200522_5ec7dd210985f.svg\" alt=\"\u53d1\u5e03\u4e00\u4e2a\u5f00\u6e90 Android \u77ed\u89c6\u9891 SDK, \u6ee1\u8db3 Android \u97f3\u89c6\u9891\u5927\u90e8\u5206\u9700\u6c42 github: https:\/\/github.com\/wlanjie\/trinity\" \/><\/p>\n<p><strong>trinity \u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u62cd\u6444\u548c\u77ed\u89c6\u9891\u5904\u7406\u5de5\u5177\uff0c\u7528 kotlin \u548c c++\u7f16\u5199\uff0c\u5b9e\u73b0\u4e86\u5927\u90e8\u5206\u77ed\u89c6\u9891\u7f16\u8f91\u8f6f\u4ef6\u70ed\u95e8\u529f\u80fd\u3002<\/strong><\/p>\n<p>apk \u4e0b\u8f7d<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/05\/screen_shot.gif\" alt=\"\u53d1\u5e03\u4e00\u4e2a\u5f00\u6e90 Android \u77ed\u89c6\u9891 SDK, \u6ee1\u8db3 Android \u97f3\u89c6\u9891\u5927\u90e8\u5206\u9700\u6c42 github: https:\/\/github.com\/wlanjie\/trinity\" \/><\/p>\n<h2>QQ \u4ea4\u6d41\u7fa4<\/h2>\n<pre><code>125218305 <\/code><\/pre>\n<h2>\u8054\u7cfb\u6211<\/h2>\n<ul>\n<li>email: [email&#160;protected]<\/li>\n<\/ul>\n<h2>git commit \u89c4\u8303<\/h2>\n<ul>\n<li>\u9075\u5faa git cz<\/li>\n<\/ul>\n<h2>\u4ee3\u7801\u89c4\u8303<\/h2>\n<ul>\n<li>kotlin \u7f29\u8fdb\u4f7f\u7528 2 \u7a7a\u683c\u7f29\u8fdb<\/li>\n<li>c++\u4ee3\u7801\u9075\u5faagoogle c++\u98ce\u683c\u6307\u5357<\/li>\n<\/ul>\n<h2>\u7cfb\u7edf\u7248\u672c<\/h2>\n<p>\u652f\u6301 Android 4.3 \u53ca\u4ee5\u4e0a\u7248\u672c<\/p>\n<h2>\u5f00\u53d1\u73af\u5883<\/h2>\n<ul>\n<li>Android Studio 3.5<\/li>\n<li>NDK r20<\/li>\n<li>kotlin 1.3.41<\/li>\n<\/ul>\n<h2>\u4f7f\u7528\u7684\u5f00\u6e90\u5e93<\/h2>\n<ul>\n<li>fdk-aac<\/li>\n<li>ffmpeg 3.4<\/li>\n<li>libx264<\/li>\n<li>xlogger<\/li>\n<li>mnnkit<\/li>\n<\/ul>\n<h2>\u529f\u80fd<\/h2>\n<table>\n<tbody>\n<tr>\n<td>\u89c6\u9891\u62cd\u6444 <\/td>\n<\/tr>\n<tr>\n<td>\u529f\u80fd\u8bf4\u660e<\/td>\n<td>\u662f\u5426\u652f\u6301<\/td>\n<\/tr>\n<tr>\n<td>\u591a\u6bb5\u5f55\u5236<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u81ea\u5b9a\u4e49\u65f6\u957f<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u81ea\u5b9a\u4e49\u76f8\u673a\u914d\u7f6e<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u6444\u50cf\u5934\u5207\u6362<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u95ea\u5149\u706f<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u7126\u8ddd\u8c03\u8282<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u624b\u52a8\u5bf9\u7126<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u9759\u97f3<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u7f8e\u989c<\/td>\n<td>x<\/td>\n<\/tr>\n<tr>\n<td>\u78e8\u76ae<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u81ea\u5b9a\u4e49\u5206\u8fa8\u7387\u53ca\u7801\u7387<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u5f55\u5236\u80cc\u666f\u97f3<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u5f55\u5236\u53d8\u901f<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u8f6f\u786c\u7f16\u7801<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u89c6\u9891\u7f16\u8f91 <\/td>\n<\/tr>\n<tr>\n<td>\u591a\u6bb5\u7f16\u8f91<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u66ff\u6362\u7247\u6bb5<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u8bbe\u7f6e\u7247\u6bb5\u65f6\u95f4<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u80cc\u666f\u97f3\u4e50<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u786c\u89e3\u7801<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u8f6f\u89e3\u7801<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u56fe\u7247\u89c6\u9891\u6df7\u5408<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u7279\u6548 <\/td>\n<\/tr>\n<tr>\n<td>\u6ee4\u955c<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u95ea\u767d<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u4e24\u5206\u5c4f<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u4e09\u5206\u5c4f<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u56db\u5206\u5c4f<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u516d\u5206\u5c4f<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u4e5d\u5206\u5c4f<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u6a21\u7cca\u5206\u5c4f<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u9ad8\u65af\u6a21\u7cca<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u7075\u9b42\u51fa\u7a8d<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u6296\u52a8<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u6bdb\u523a<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>70s<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u5012\u8ba1\u65f6<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u7231\u5fc3\u5149\u6591<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u4eba\u8138\u8bc6\u522b <\/td>\n<\/tr>\n<tr>\n<td>\u73ab\u7470\u773c\u5986<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u738b\u5983<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u8d34\u7eb8\u5986<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u98d8\u843d\u5c0f\u732a<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<tr>\n<td>\u732b\u5934<\/td>\n<td>\u221a<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u4eba\u8138\u7279\u6548<\/h2>\n<p> <img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/05\/roseEye.png\" alt=\"\u53d1\u5e03\u4e00\u4e2a\u5f00\u6e90 Android \u77ed\u89c6\u9891 SDK, \u6ee1\u8db3 Android \u97f3\u89c6\u9891\u5927\u90e8\u5206\u9700\u6c42 github: https:\/\/github.com\/wlanjie\/trinity\" \/> <\/p>\n<h2>\u7279\u6548\u8c03\u8bd5<\/h2>\n<p>\u9879\u76ee\u4e2d\u4f7f\u7528 xcode \u8c03\u8bd5\u7279\u6548\u6548\u679c, \u4f7f\u7528\u524d\u9700\u8981\u5b89\u88c5 glfw<\/p>\n<pre><code>brew install glfw <\/code><\/pre>\n<p>\u7136\u540e\u4f7f\u7528 xcode \u6253\u5f00<code>library\/src\/main\/cpp\/opengl.xcodeproj<\/code>\u5373\u53ef<br \/> \u5207\u6362\u6548\u679c\u8c03\u7528\u4ee3\u7801<\/p>\n<pre><code>image_process.OnAction(\"param\/blurScreen\", 0); <\/code><\/pre>\n<h2>\u81ea\u52a8\u5316\u6d4b\u8bd5<\/h2>\n<ul>\n<li>\u81ea\u52a8\u5316\u6d4b\u8bd5\u4f7f\u7528uiautomator2\u5177\u4f53\u4f7f\u7528\u8bf7\u53c2\u8003\u6587\u6863 \u4f7f\u7528\u65b9\u5f0f\u5982\u4e0b:<\/li>\n<\/ul>\n<pre><code>cd trinity python trinity.py <\/code><\/pre>\n<p>\u7136\u540e\u4f7f\u7528<\/p>\n<pre><code>adb devices <\/code><\/pre>\n<p>\u5728\u7ec8\u7aef\u8f93\u5165\u8bbe\u5907\u540d\u5373\u53ef<\/p>\n<h2>\u6027\u80fd<\/h2>\n<p> <img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/05\/memory.png\" alt=\"\u53d1\u5e03\u4e00\u4e2a\u5f00\u6e90 Android \u77ed\u89c6\u9891 SDK, \u6ee1\u8db3 Android \u97f3\u89c6\u9891\u5927\u90e8\u5206\u9700\u6c42 github: https:\/\/github.com\/wlanjie\/trinity\" \/> <\/p>\n<h2>\u4f7f\u7528<\/h2>\n<p>&lt;font color=red&gt;\u6ce8\u610f: SDK \u4e2d\u4e0d\u505a\u6743\u9650\u5224\u65ad,\u4f7f\u7528\u65f6\u9700\u8981\u7531\u8c03\u7528\u65b9\u7533\u8bf7\u597d\u6743\u9650, SDK \u4e2d\u6d89\u53ca\u5230\u7684\u65f6\u95f4\u5747\u4e3a\u6beb\u79d2&lt;\/font&gt;<\/p>\n<h3>\u6dfb\u52a0 jcenter \u4f9d\u8d56<\/h3>\n<pre><code>dependencies {     implementation 'com.github.wlanjie:trinity:0.2.8' } <\/code><\/pre>\n<h3>\u6743\u9650\u8981\u6c42<\/h3>\n<pre><code>&lt;uses-permission android:name=\"android.permission.CAMERA\" \/&gt; &lt;uses-permission android:name=\"android.permission.RECORD_AUDIO\" \/&gt; &lt;uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" \/&gt; &lt;uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" \/&gt; <\/code><\/pre>\n<h2>\u5f55\u5236<\/h2>\n<h3>\u914d\u7f6e\u53c2\u6570<\/h3>\n<ul>\n<li>\u521b\u5efa\u5f55\u5236\u9884\u89c8 view<\/li>\n<\/ul>\n<pre><code>val preview = findViewById&lt;TrinityPreviewView&gt;(R.id.preview) <\/code><\/pre>\n<ul>\n<li>\u521b\u5efa\u5f55\u5236\u63a5\u53e3\u5b9e\u4f8b<\/li>\n<\/ul>\n<pre><code>mRecord = TrinityRecord(preview) <\/code><\/pre>\n<ul>\n<li>\u9500\u6bc1\u5f55\u5236\u63a5\u53e3\u5b9e\u4f8b<\/li>\n<\/ul>\n<pre><code>mRecord.release() <\/code><\/pre>\n<h3>\u56de\u8c03\u8bbe\u7f6e<\/h3>\n<ul>\n<li>\u8bbe\u7f6e\u89c6\u9891\u6e32\u67d3\u56de\u8c03<\/li>\n<\/ul>\n<pre><code>mRecord.setOnRenderListener(this) <\/code><\/pre>\n<ul>\n<li>\u8bbe\u7f6e\u5f55\u5236\u8fdb\u5ea6\u56de\u8c03<\/li>\n<\/ul>\n<pre><code>mRecord.setOnRecordingListener(this) <\/code><\/pre>\n<ul>\n<li>\u8bbe\u7f6e\u76f8\u673a\u56de\u8c03<\/li>\n<\/ul>\n<pre><code>mRecord.setCameraCallback(this) <\/code><\/pre>\n<h3>\u5f00\u542f\u9884\u89c8<\/h3>\n<ul>\n<li>\u5f00\u59cb\u9884\u89c8<\/li>\n<\/ul>\n<pre><code>mRecord.startPreview() <\/code><\/pre>\n<ul>\n<li>\u7ed3\u675f\u9884\u89c8<\/li>\n<\/ul>\n<pre><code>mRecord.stopPreview() <\/code><\/pre>\n<ul>\n<li>\u8bbe\u7f6e\u9884\u89c8\u7c7b\u578b<\/li>\n<\/ul>\n<pre><code>\/\/ \u8bbe\u7f6e\u663e\u793a\u7c7b\u578b \/\/ \u5305\u542b\u88c1\u526a\u663e\u793a, \u539f\u6bd4\u4f8b\u4e0a\u4e0b\u7559\u9ed1\u663e\u793a mRecord.setFrame(mFrame) <\/code><\/pre>\n<h3>\u5f55\u5236\u63a7\u5236 \/\u7ba1\u7406<\/h3>\n<ul>\n<li>\u5207\u6362\u6444\u50cf\u5934<\/li>\n<\/ul>\n<pre><code>mRecord.switchCamera() <\/code><\/pre>\n<ul>\n<li>\u83b7\u53d6\u5f53\u524d\u6444\u50cf\u5934<\/li>\n<\/ul>\n<pre><code>\/\/ \u8fd4\u56de\u5f53\u524d\u6444\u50cf\u5934 id val facing = mRecord.getCameraFacing() <\/code><\/pre>\n<ul>\n<li>\u5f00\u5173\u95ea\u5149\u706f<\/li>\n<\/ul>\n<pre><code>mRecord.flash(mFlash) <\/code><\/pre>\n<ul>\n<li>\u8bbe\u7f6e zoom<\/li>\n<\/ul>\n<pre><code>\/\/ \u8bbe\u7f6e\u7126\u8ddd\u7f29\u653e, 0-100 100 \u4e3a\u6700\u5927\u7f29\u653e mRecord.setZoom(0) <\/code><\/pre>\n<ul>\n<li>\u8bbe\u7f6e\u66dd\u5149\u5ea6<\/li>\n<\/ul>\n<pre><code>\/\/ \u8bbe\u7f6e\u76f8\u673a\u66dd\u5149\u5ea6, 100 \u4e3a\u6700\u5927\u66dd\u5149 mRecord.setExposureCompensation(0) <\/code><\/pre>\n<ul>\n<li>\u624b\u52a8\u5bf9\u7126<\/li>\n<\/ul>\n<pre><code>\/\/ \u8bbe\u7f6e\u624b\u52a8\u5bf9\u7126, \u53c2\u6570\u4e3a x \u548c y mRecord.focus(mPointF) <\/code><\/pre>\n<ul>\n<li>\u8bbe\u7f6e\u5f55\u5236\u89c6\u9891\u7684\u89d2\u5ea6<\/li>\n<\/ul>\n<pre><code>\/**  * @param rotation \u65cb\u8f6c\u89d2\u5ea6\u5305\u542b 0 90 180 270  *\/ mRecord.setRecordRotation(0) <\/code><\/pre>\n<ul>\n<li>\u8bbe\u7f6e\u9759\u97f3\u5f55\u5236<\/li>\n<\/ul>\n<pre><code>mRecord.setMute(false) <\/code><\/pre>\n<ul>\n<li>\u500d\u901f\u5f55\u5236<\/li>\n<\/ul>\n<pre><code>\/**  * @param speed \u901f\u5ea6\u5305\u542b 0.25 0.5 1.0 2.0 4.0 \u500d\u901f  *\/ mRecord.setSpeed(mSpeed) <\/code><\/pre>\n<h3>\u5f00\u59cb\u5f55\u5236<\/h3>\n<ul>\n<li>\u5f00\u59cb\u5f55\u5236\u4e00\u6bb5\u89c6\u9891<\/li>\n<\/ul>\n<pre><code>\/**  * \u5f00\u59cb\u5f55\u5236\u4e00\u6bb5\u89c6\u9891  * @param path \u5f55\u5236\u7684\u89c6\u9891\u4fdd\u5b58\u7684\u5730\u5740  * @param width \u5f55\u5236\u89c6\u9891\u7684\u5bbd, SDK \u4e2d\u4f1a\u505a 16 \u500d\u6574\u6570\u7684\u8fd0\u7b97, \u53ef\u80fd\u6700\u7ec8\u8f93\u51fa\u89c6\u9891\u7684\u5bbd\u548c\u8bbe\u7f6e\u8fdb\u53bb\u7684\u4e0d\u4e00\u81f4  * @param height \u5f55\u5236\u89c6\u9891\u7684\u9ad8, SDK \u4e2d\u4f1a\u505a 16 \u500d\u6574\u6570\u7684\u8fd0\u7b97, \u53ef\u80fd\u6700\u7ec8\u8f93\u51fa\u89c6\u9891\u7684\u5bbd\u548c\u8bbe\u7f6e\u8fdb\u53bb\u7684\u4e0d\u4e00\u81f4  * @param videoBitRate \u89c6\u9891\u8f93\u51fa\u7684\u7801\u7387, \u5982\u679c\u8bbe\u7f6e\u7684\u662f 2000, \u5219\u4e3a 2M, \u6700\u7ec8\u8f93\u51fa\u7684\u548c\u8bbe\u7f6e\u7684\u53ef\u80fd\u6709\u5dee\u522b  * @param frameRate \u89c6\u9891\u8f93\u51fa\u7684\u5e27\u7387  * @param useHardWareEncode \u662f\u5426\u4f7f\u7528\u786c\u7f16\u7801, \u5982\u679c\u8bbe\u7f6e\u4e3a true, \u800c\u786c\u7f16\u7801\u4e0d\u652f\u6301,\u5219\u81ea\u52a8\u5207\u6362\u5230\u8f6f\u7f16\u7801  * @param audioSampleRate \u97f3\u9891\u7684\u91c7\u6837\u7387  * @param audioChannel \u97f3\u9891\u7684\u58f0\u9053\u6570  * @param audioBitRate \u97f3\u9891\u7684\u7801\u7387  * @param duration \u9700\u8981\u5f55\u5236\u591a\u5c11\u65f6\u95f4  * @return Int ErrorCode.SUCCESS \u4e3a\u6210\u529f,\u5176\u5b83\u4e3a\u5931\u8d25  * @throws InitRecorderFailException  *\/ mRecord.startRecording(\"\/sdcard\/a.mp4\",                       720,                       1280,                       2000, \/\/ 2M \u7801\u7387                       30,                       false,                       44100,                       1, \/\/ \u5355\u58f0\u9053                       128, \/\/ 128K \u7801\u7387                       Int.MAX_VALUE) <\/code><\/pre>\n<ul>\n<li>\u7ed3\u675f\u5f55\u5236<\/li>\n<\/ul>\n<pre><code>mRecord.stopRecording() <\/code><\/pre>\n<h3>\u89c6\u9891\u7f16\u8f91<\/h3>\n<h4>\u521d\u59cb\u5316<\/h4>\n<ul>\n<li>\u521b\u5efa\u7f16\u8f91\u5668\u5b9e\u4f8b<\/li>\n<\/ul>\n<pre><code>mVideoEditor = TrinityCore.createEditor(this) <\/code><\/pre>\n<ul>\n<li>\u8bbe\u7f6e\u9884\u89c8\u753b\u9762<\/li>\n<\/ul>\n<pre><code>val surfaceView = findViewById&lt;SurfaceView&gt;(R.id.surface_view) mVideoEditor.setSurfaceView(surfaceView) <\/code><\/pre>\n<h4>\u5bfc\u5165\u89c6\u9891<\/h4>\n<ul>\n<li>\u6dfb\u52a0\u4e00\u4e2a\u7247\u6bb5<\/li>\n<\/ul>\n<pre><code>val clip = MediaClip(file.absolutePath) mVideoEditor.insertClip(clip) <\/code><\/pre>\n<ul>\n<li>\u6839\u636e\u4e0b\u6807\u6dfb\u52a0\u7247\u6bb5<\/li>\n<\/ul>\n<pre><code>val clip = MediaClip(file.absolutePath) mVideoEditor.insertClip(0, clip) <\/code><\/pre>\n<ul>\n<li>\u5220\u9664\u4e00\u4e2a\u7247\u6bb5<\/li>\n<\/ul>\n<pre><code>\/**  * \u6839\u636e\u4e0b\u6807\u5220\u9664\u4e00\u4e2a\u7247\u6bb5  *\/ mVideoEditor.removeClip(index) <\/code><\/pre>\n<ul>\n<li>\u83b7\u53d6\u7247\u6bb5\u7684\u6570\u91cf<\/li>\n<\/ul>\n<pre><code>val count = mVideoEditor.getClipsCount() <\/code><\/pre>\n<ul>\n<li>\u6839\u636e\u4e0b\u6807\u83b7\u53d6\u4e00\u4e2a\u7247\u6bb5<\/li>\n<\/ul>\n<pre><code>\/**  * \u5982\u679c\u7247\u6bb5\u4e0d\u5b58\u5728, \u8fd4\u56de\u4e00\u4e2a null  *\/ val clip = mVideoEditor.getClip(index) <\/code><\/pre>\n<ul>\n<li>\u6839\u636e\u4e0b\u6807\u66ff\u6362\u4e00\u4e2a\u7247\u6bb5<\/li>\n<\/ul>\n<pre><code>mVideoEditor.replaceClip(index, clip) <\/code><\/pre>\n<ul>\n<li>\u83b7\u53d6\u6240\u6709\u7247\u6bb5<\/li>\n<\/ul>\n<pre><code>\/**  * \u8fd4\u56de\u6240\u6709\u7247\u6bb5\u7684\u96c6\u5408  *\/ val clips = mVideoEditor.getVideoClips() <\/code><\/pre>\n<ul>\n<li>\u83b7\u53d6\u6240\u6709\u7247\u6bb5\u7684\u65f6\u95f4\u603b\u957f<\/li>\n<\/ul>\n<pre><code>val duration = mVideoEditor.getVideoDuration() <\/code><\/pre>\n<ul>\n<li>\u83b7\u53d6\u5f53\u524d\u64ad\u653e\u7247\u6bb5\u7684\u8fdb\u5ea6<\/li>\n<\/ul>\n<pre><code>val current = mVideoEditor.getCurrentPosition() <\/code><\/pre>\n<ul>\n<li>\u83b7\u53d6\u6307\u5b9a\u7247\u6bb5\u7684\u5f00\u59cb\u548c\u7ed3\u675f\u65f6\u95f4<\/li>\n<\/ul>\n<pre><code>val timeRange = mVideoEditor.getClipTimeRange(index) <\/code><\/pre>\n<ul>\n<li>\u6839\u636e\u65f6\u95f4\u67e5\u627e\u7247\u6bb5\u7684\u4e0b\u6807<\/li>\n<\/ul>\n<pre><code>val index = mVideoEditor.getClipIndex(time) <\/code><\/pre>\n<h4>\u80cc\u666f\u97f3\u4e50<\/h4>\n<ul>\n<li>\u6dfb\u52a0\u80cc\u666f\u97f3\u4e50<\/li>\n<\/ul>\n<pre><code>\/**  * @param config \u80cc\u666f\u97f3\u4e50 json \u5185\u5bb9  * \u5177\u4f53 json \u5185\u5bb9\u5982\u4e0b:  * {  *    \"path\": \"\/sdcard\/trinity.mp3\",  *    \"startTime\": 0,  *    \"endTime\": 2000  * }  * json \u53c2\u6570\u89e3\u91ca:  * path: \u97f3\u4e50\u7684\u672c\u5730\u5730\u5740  * startTime: \u8fd9\u4e2a\u97f3\u4e50\u7684\u5f00\u59cb\u65f6\u95f4  * endTime: \u8fd9\u4e2a\u97f3\u4e50\u7684\u7ed3\u675f\u65f6\u95f4 2000 \u4ee3\u8868\u8fd9\u4e2a\u97f3\u4e50\u53ea\u64ad\u653e 2 \u79d2\u949f  *\/ val actionId = mVideoEditor.addMusic(config) <\/code><\/pre>\n<ul>\n<li>\u66f4\u65b0\u80cc\u666f\u97f3\u4e50<\/li>\n<\/ul>\n<pre><code>\/**  * @param config \u80cc\u666f\u97f3\u4e50 json \u5185\u5bb9  * \u5177\u4f53 json \u5185\u5bb9\u5982\u4e0b:  * {  *    \"path\": \"\/sdcard\/trinity.mp3\",  *    \"startTime\": 2000,  *    \"endTime\": 4000  * }  * json \u53c2\u6570\u89e3\u91ca:  * path: \u97f3\u4e50\u7684\u672c\u5730\u5730\u5740  * startTime: \u8fd9\u4e2a\u97f3\u4e50\u7684\u5f00\u59cb\u65f6\u95f4  * endTime: \u8fd9\u4e2a\u97f3\u4e50\u7684\u7ed3\u675f\u65f6\u95f4 4000 \u4ee3\u8868\u8fd9\u4e2a\u97f3\u4e50\u4ece\u5f00\u59cb\u65f6\u95f4\u5230\u7ed3\u675f\u65f6\u95f4\u64ad\u653e 2 \u79d2\u949f  *\/ val actionId = mVideoEditor.addMusic(config) <\/code><\/pre>\n<ul>\n<li>\u5220\u9664\u80cc\u666f\u97f3\u4e50<\/li>\n<\/ul>\n<pre><code>\/** * \u5220\u9664\u80cc\u666f\u97f3\u4e50 * @param actionId \u5fc5\u987b\u4e3a\u6dfb\u52a0\u80cc\u666f\u97f3\u4e50\u65f6\u8fd4\u56de\u7684 actionId *\/ mVideoEditor.deleteMusic(actionId) <\/code><\/pre>\n<h4>\u6dfb\u52a0\u7279\u6548<\/h4>\n<ul>\n<li>\u6dfb\u52a0\u666e\u901a\u6ee4\u955c<\/li>\n<\/ul>\n<pre><code>\/** * \u6dfb\u52a0\u6ee4\u955c * \u5982: content.json \u7684\u7edd\u5bf9\u8def\u5f84\u4e3a \/sdcard\/Android\/com.trinity.sample\/cache\/filters\/config.json * \u4f20\u5165\u7684\u8def\u5f84\u53ea\u9700\u8981 \/sdcard\/Android\/com.trinity.sample\/cache\/filters \u5373\u53ef * \u5982\u679c\u5f53\u524d\u8def\u5f84\u4e0d\u5305\u542b config.json \u5219\u6dfb\u52a0\u5931\u8d25 * \u5177\u4f53 json \u5185\u5bb9\u5982\u4e0b: * { *  \"type\": 0, *  \"intensity\": 1.0, *  \"lut\": \"lut_124\/lut_124.png\" * } * * json \u53c2\u6570\u89e3\u91ca: * type: \u4fdd\u7559\u5b57\u6bb5, \u76ee\u524d\u6682\u65e0\u4f5c\u7528 * intensity: \u6ee4\u955c\u900f\u660e\u5ea6, 0.0 \u65f6\u548c\u6444\u50cf\u5934\u91c7\u96c6\u7684\u65e0\u5dee\u522b * lut: \u6ee4\u955c\u989c\u8272\u8868\u7684\u5730\u5740, \u5fc5\u987b\u4e3a\u672c\u5730\u5730\u5740, \u800c\u4e14\u4e3a\u76f8\u5bf9\u8def\u5f84 *      sdk \u5185\u90e8\u4f1a\u8fdb\u884c\u8def\u5f84\u62fc\u63a5 * @param configPath \u6ee4\u955c config.json \u7684\u7236\u76ee\u5f55 * @return \u8fd4\u56de\u5f53\u524d\u6ee4\u955c\u7684\u552f\u4e00 id *\/ val actionId = mVideoEditor.addFilter(config) <\/code><\/pre>\n<ul>\n<li>\u66f4\u65b0\u6ee4\u955c<\/li>\n<\/ul>\n<pre><code>\/** * \u66f4\u65b0\u6ee4\u955c * @param configPath config.json \u7684\u8def\u5f84, \u76ee\u524d\u5bf9\u79f0 addFilter \u8bf4\u660e * @param startTime \u6ee4\u955c\u7684\u5f00\u59cb\u65f6\u95f4 * @param endTime \u6ee4\u955c\u7684\u7ed3\u675f\u65f6\u95f4 * @param actionId \u9700\u8981\u66f4\u65b0\u54ea\u4e2a\u6ee4\u955c, \u5fc5\u987b\u4e3a addFilter \u8fd4\u56de\u7684 actionId *\/ mVideoEditor.updateFilter(config, 0, 2000, actionId) <\/code><\/pre>\n<ul>\n<li>\u5220\u9664\u6ee4\u955c<\/li>\n<\/ul>\n<pre><code> \/**    * \u5220\u9664\u6ee4\u955c    * @param actionId \u9700\u8981\u5220\u9664\u54ea\u4e2a\u6ee4\u955c, \u5fc5\u987b\u4e3a addFilter \u65f6\u8fd4\u56de\u7684 actionId    *\/ mVideoEditor.deleteFilter(actionId)    <\/code><\/pre>\n<ul>\n<li>\u6dfb\u52a0\u6296\u97f3\u7279\u6548<\/li>\n<\/ul>\n<pre><code>\/** * \u6dfb\u52a0\u7279\u6548 * \u5982: content.json \u7684\u7edd\u5bf9\u8def\u5f84\u4e3a \/sdcard\/Android\/com.trinity.sample\/cache\/effects\/config.json * \u4f20\u5165\u7684\u8def\u5f84\u53ea\u9700\u8981 \/sdcard\/Android\/com.trinity.sample\/cache\/effects \u5373\u53ef * \u5982\u679c\u5f53\u524d\u8def\u5f84\u4e0d\u5305\u542b config.json \u5219\u6dfb\u52a0\u5931\u8d25 * @param configPath \u6ee4\u955c config.json \u7684\u7236\u76ee\u5f55 * @return \u8fd4\u56de\u5f53\u524d\u7279\u6548\u7684\u552f\u4e00 id *\/ val actionId = mVideoEditor.addAction(configPath) <\/code><\/pre>\n<ul>\n<li>\u66f4\u65b0\u6296\u97f3\u7279\u6548<\/li>\n<\/ul>\n<pre><code>\/** * \u66f4\u65b0\u6307\u5b9a\u7279\u6548 * @param startTime \u7279\u6548\u7684\u5f00\u59cb\u65f6\u95f4 * @param endTime \u7279\u6548\u7684\u7ed3\u675f\u65f6\u95f4 * @param actionId \u9700\u8981\u66f4\u65b0\u54ea\u4e2a\u7279\u6548, \u5fc5\u987b\u4e3a addAction \u8fd4\u56de\u7684 actionId *\/ mVideoEditor.updateAction(0, 2000, actionId) <\/code><\/pre>\n<ul>\n<li>\u5220\u9664\u6296\u97f3\u7279\u6548<\/li>\n<\/ul>\n<pre><code>\/** * \u5220\u9664\u4e00\u4e2a\u7279\u6548 * @param actionId \u9700\u8981\u5220\u9664\u54ea\u4e2a\u7279\u6548, \u5fc5\u987b\u4e3a addAction \u8fd4\u56de\u7684 actionId *\/ mVideoEditor.deleteAction(actionId) <\/code><\/pre>\n<h4>\u5f00\u59cb\u9884\u89c8<\/h4>\n<ul>\n<li>\u64ad\u653e<\/li>\n<\/ul>\n<pre><code>\/**  * @param repeat \u662f\u5426\u5faa\u73af\u64ad\u653e  *\/ mVideoEditor.play(repeat) <\/code><\/pre>\n<ul>\n<li>\u6682\u505c<\/li>\n<\/ul>\n<pre><code>mVideoEditor.pause() <\/code><\/pre>\n<ul>\n<li>\u7ee7\u7eed\u64ad\u653e<\/li>\n<\/ul>\n<pre><code>mVideoEditor.resume() <\/code><\/pre>\n<ul>\n<li>\u505c\u6b62\u64ad\u653e<\/li>\n<\/ul>\n<pre><code>mVideoEditor.stop() <\/code><\/pre>\n<h4>\u91ca\u653e\u8d44\u6e90<\/h4>\n<pre><code>mVideoEditor.destroy() <\/code><\/pre>\n<h3>\u5bfc\u51fa\u89c6\u9891<\/h3>\n<ul>\n<li>\u521b\u5efa\u5bfc\u51fa\u5b9e\u4f8b<\/li>\n<\/ul>\n<pre><code>val export = TrinityCore.createExport(this) <\/code><\/pre>\n<ul>\n<li>\u5f00\u59cb\u5bfc\u51fa<\/li>\n<\/ul>\n<pre><code>\/**   * \u5f00\u59cb\u5bfc\u51fa   * @param info \u5bfc\u51fa\u5b9e\u4f53\u7c7b   * @param l \u5bfc\u51fa\u56de\u8c03 \u5305\u542b\u6210\u529f \u5931\u8d25 \u548c\u8fdb\u5ea6\u56de\u8c03   * @return Int ErrorCode.SUCCESS \u4e3a\u6210\u529f,\u5176\u5b83\u4e3a\u5931\u8d25   *\/ \/\/ \u521b\u5efa\u5b9e\u4f53\u7c7b, \u5fc5\u987b\u4f20\u5165\u89c6\u9891\u8f93\u51fa\u5730\u5740   val exportVideoInfo = VideoExportInfo(\"\/sdcard\/export.mp4\") \/\/ \u4f7f\u7528\u786c\u89e3\u7801 exportVideoInfo.mediaCodecDecode = true \/\/ \u4f7f\u7528\u786c\u7f16\u7801 exportVideoInfo.mediaCodecEncode = true   \/\/ \u89c6\u9891\u5bbd exportVideoInfo.width = 544 \/\/ \u89c6\u9891\u9ad8 exportVideoInfo.height = 960 \/\/ \u5e27\u7387 exportVideoInfo.frameRate = 25 \/\/ \u89c6\u9891\u7801\u7387 2M exportVideoInfo.videoBitRate = 2000 \/\/ \u91c7\u6837\u7387 exportVideoInfo.sampleRate = 44100 \/\/ \u58f0\u9053\u6570 exportVideoInfo.channelCount = 1 \/\/ \u97f3\u9891\u7801\u7387 128K exportVideoInfo.audioBitRate = 128 export.export(exportVideoInfo, this) <\/code><\/pre>\n<ul>\n<li>\u53d6\u6d88<\/li>\n<\/ul>\n<pre><code>export.cancel() <\/code><\/pre>\n<ul>\n<li>\u91ca\u653e<\/li>\n<\/ul>\n<pre><code>export.release() <\/code><\/pre>\n<pre><code>Copyright 2019 Trinity, Inc.  Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at     http:\/\/www.apache.org\/licenses\/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. <\/code><\/pre>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>0<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u53d1\u5e03\u4e00\u4e2a\u5f00\u6e90 Android \u77ed\u89c6&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/100235"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=100235"}],"version-history":[{"count":1,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/100235\/revisions"}],"predecessor-version":[{"id":100239,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/100235\/revisions\/100239"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=100235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=100235"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=100235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}