[
  {
    "path": ".classpath",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<classpath>\n\t<classpathentry kind=\"con\" path=\"com.android.ide.eclipse.adt.ANDROID_FRAMEWORK\"/>\n\t<classpathentry exported=\"true\" kind=\"con\" path=\"com.android.ide.eclipse.adt.LIBRARIES\"/>\n\t<classpathentry exported=\"true\" kind=\"con\" path=\"com.android.ide.eclipse.adt.DEPENDENCIES\"/>\n\t<classpathentry kind=\"src\" path=\"src\"/>\n\t<classpathentry kind=\"src\" path=\"gen\"/>\n\t<classpathentry kind=\"output\" path=\"bin/classes\"/>\n</classpath>\n"
  },
  {
    "path": ".gitattributes",
    "content": "# Auto detect text files and perform LF normalization\n* text=auto\n\n# Custom for Visual Studio\n*.cs     diff=csharp\n\n# Standard to msysgit\n*.doc\t diff=astextplain\n*.DOC\t diff=astextplain\n*.docx diff=astextplain\n*.DOCX diff=astextplain\n*.dot  diff=astextplain\n*.DOT  diff=astextplain\n*.pdf  diff=astextplain\n*.PDF\t diff=astextplain\n*.rtf\t diff=astextplain\n*.RTF\t diff=astextplain\n"
  },
  {
    "path": ".gitignore",
    "content": "# Windows image file caches\nThumbs.db\nehthumbs.db\n\n# Folder config file\nDesktop.ini\n\n# Recycle Bin used on file shares\n$RECYCLE.BIN/\n\n# Windows Installer files\n*.cab\n*.msi\n*.msm\n*.msp\n\n# Windows shortcuts\n*.lnk\n\n# =========================\n# Operating System Files\n# =========================\n\n# OSX\n# =========================\n\n.DS_Store\n.AppleDouble\n.LSOverride\n\n# Thumbnails\n._*\n\n# Files that might appear on external disk\n.Spotlight-V100\n.Trashes\n\n# Directories potentially created on remote AFP share\n.AppleDB\n.AppleDesktop\nNetwork Trash Folder\nTemporary Items\n.apdisk\n"
  },
  {
    "path": ".project",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<projectDescription>\n\t<name>MediaCodecEncode</name>\n\t<comment></comment>\n\t<projects>\n\t</projects>\n\t<buildSpec>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>org.eclipse.jdt.core.javabuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t\t<buildCommand>\n\t\t\t<name>com.android.ide.eclipse.adt.ApkBuilder</name>\n\t\t\t<arguments>\n\t\t\t</arguments>\n\t\t</buildCommand>\n\t</buildSpec>\n\t<natures>\n\t\t<nature>com.android.ide.eclipse.adt.AndroidNature</nature>\n\t\t<nature>org.eclipse.jdt.core.javanature</nature>\n\t</natures>\n</projectDescription>\n"
  },
  {
    "path": ".settings/org.eclipse.jdt.core.prefs",
    "content": "eclipse.preferences.version=1\norg.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6\norg.eclipse.jdt.core.compiler.compliance=1.6\norg.eclipse.jdt.core.compiler.source=1.6\n"
  },
  {
    "path": "MediaCodecEncodeH264.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module external.linked.project.id=\"MediaCodecEncodeH264\" external.linked.project.path=\"$MODULE_DIR$\" external.root.project.path=\"$MODULE_DIR$\" external.system.id=\"GRADLE\" type=\"JAVA_MODULE\" version=\"4\">\n  <component name=\"FacetManager\">\n    <facet type=\"java-gradle\" name=\"Java-Gradle\">\n      <configuration>\n        <option name=\"BUILD_FOLDER_PATH\" value=\"$MODULE_DIR$/build\" />\n        <option name=\"BUILDABLE\" value=\"false\" />\n      </configuration>\n    </facet>\n  </component>\n  <component name=\"NewModuleRootManager\" LANGUAGE_LEVEL=\"JDK_1_7\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <excludeFolder url=\"file://$MODULE_DIR$/.gradle\" />\n    </content>\n    <orderEntry type=\"inheritedJdk\" />\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n  </component>\n</module>"
  },
  {
    "path": "README.md",
    "content": "# MediaCodecEncodeH264\nMediaCodec 编码 onPreviewFrame 回调的YUV数据为 h264\n\n#2019.8.16\n1.更新为android studio工程;\n2.并且修复了android 6.0以上动态权限bug;\n3.修复android p崩溃bug\n"
  },
  {
    "path": "app/app.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module external.linked.project.id=\":app\" external.linked.project.path=\"$MODULE_DIR$\" external.root.project.path=\"$MODULE_DIR$/..\" external.system.id=\"GRADLE\" type=\"JAVA_MODULE\" version=\"4\">\n  <component name=\"FacetManager\">\n    <facet type=\"android-gradle\" name=\"Android-Gradle\">\n      <configuration>\n        <option name=\"GRADLE_PROJECT_PATH\" value=\":app\" />\n      </configuration>\n    </facet>\n    <facet type=\"android\" name=\"Android\">\n      <configuration>\n        <option name=\"SELECTED_BUILD_VARIANT\" value=\"debug\" />\n        <option name=\"ASSEMBLE_TASK_NAME\" value=\"assembleDebug\" />\n        <option name=\"COMPILE_JAVA_TASK_NAME\" value=\"compileDebugSources\" />\n        <afterSyncTasks>\n          <task>generateDebugSources</task>\n        </afterSyncTasks>\n        <option name=\"ALLOW_USER_CONFIGURATION\" value=\"false\" />\n        <option name=\"MANIFEST_FILE_RELATIVE_PATH\" value=\"/src/main/AndroidManifest.xml\" />\n        <option name=\"RES_FOLDER_RELATIVE_PATH\" value=\"/src/main/res\" />\n        <option name=\"RES_FOLDERS_RELATIVE_PATH\" value=\"file://$MODULE_DIR$/src/main/res;file://$MODULE_DIR$/build/generated/res/resValues/debug\" />\n        <option name=\"TEST_RES_FOLDERS_RELATIVE_PATH\" value=\"\" />\n        <option name=\"ASSETS_FOLDER_RELATIVE_PATH\" value=\"/src/main/assets\" />\n      </configuration>\n    </facet>\n  </component>\n  <component name=\"NewModuleRootManager\" LANGUAGE_LEVEL=\"JDK_1_7\">\n    <output url=\"file://$MODULE_DIR$/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes\" />\n    <output-test url=\"file://$MODULE_DIR$/build/intermediates/javac/debugUnitTest/compileDebugUnitTestJavaWithJavac/classes\" />\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/apt/debug\" isTestSource=\"false\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/aidl_source_output_dir/debug/compileDebugAidl/out\" isTestSource=\"false\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/buildConfig/debug\" isTestSource=\"false\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/renderscript_source_output_dir/debug/compileDebugRenderscript/out\" isTestSource=\"false\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/res/rs/debug\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/res/resValues/debug\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/apt/androidTest/debug\" isTestSource=\"true\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/aidl_source_output_dir/debugAndroidTest/compileDebugAndroidTestAidl/out\" isTestSource=\"true\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug\" isTestSource=\"true\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/renderscript_source_output_dir/debugAndroidTest/compileDebugAndroidTestRenderscript/out\" isTestSource=\"true\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/apt/test/debug\" isTestSource=\"true\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/res\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/resources\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/assets\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/aidl\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/java\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/rs\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/shaders\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/testDebug/res\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/testDebug/resources\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/testDebug/assets\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/testDebug/aidl\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/testDebug/java\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/testDebug/rs\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/testDebug/shaders\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTestDebug/res\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTestDebug/resources\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTestDebug/assets\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTestDebug/aidl\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTestDebug/java\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTestDebug/rs\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTestDebug/shaders\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/res\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/resources\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/assets\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/aidl\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/java\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/rs\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/shaders\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/res\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/resources\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/assets\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/aidl\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/java\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/rs\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/shaders\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/test/res\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/test/resources\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/test/assets\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/test/aidl\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/test/java\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/test/rs\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/test/shaders\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/generated/not_namespaced_r_class_sources\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/generated/source/r\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/annotation_processor_list\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/apk_list\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/blame\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/build-info\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/builds\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/bundle_manifest\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/check_manifest_result\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/compatible_screen_manifest\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/duplicate_classes_check\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/incremental\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/incremental-runtime-classes\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/incremental-verifier\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/instant-run-apk\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/instant_app_manifest\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/instant_run_app_info_output_file\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/instant_run_main_apk_resources\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/instant_run_merged_manifests\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/instant_run_split_apk_resources\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/javac\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/manifest-checker\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/merged_assets\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/merged_jni_libs\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/merged_manifests\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/merged_shaders\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/metadata_feature_manifest\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/prebuild\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/processed_res\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/reload-dex\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/res\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/resources\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/shader_assets\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/signing_config\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/split-apk\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/symbols\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/transforms\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/validate_signing_config\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/outputs\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/tmp\" />\n    </content>\n    <orderEntry type=\"jdk\" jdkName=\"Android API 28 Platform\" jdkType=\"Android SDK\" />\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Gradle: com.android.support:support-fragment:28.0.0@aar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: com.android.support:localbroadcastmanager:28.0.0@aar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: com.android.support:documentfile:28.0.0@aar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: com.android.support:animated-vector-drawable:28.0.0@aar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: com.android.support:slidingpanelayout:28.0.0@aar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: android.arch.lifecycle:viewmodel:1.1.1@aar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: com.android.support:appcompat-v7:28.0.0@aar\" level=\"project\" />\n    <orderEntry type=\"library\" scope=\"TEST\" name=\"Gradle: com.android.support.test.espresso:espresso-idling-resource:3.0.2@aar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: com.android.support:loader:28.0.0@aar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: android.arch.core:runtime:1.1.1@aar\" level=\"project\" />\n    <orderEntry type=\"library\" scope=\"TEST\" name=\"Gradle: com.android.support.test:runner:1.0.2@aar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: android.arch.lifecycle:livedata-core:1.1.1@aar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: com.android.support:collections:28.0.0@jar\" level=\"project\" />\n    <orderEntry type=\"library\" scope=\"TEST\" name=\"Gradle: com.squareup:javawriter:2.1.1@jar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: com.android.support:cursoradapter:28.0.0@aar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: android.arch.lifecycle:runtime:1.1.1@aar\" level=\"project\" />\n    <orderEntry type=\"library\" scope=\"TEST\" name=\"Gradle: com.android.support.test.espresso:espresso-core:3.0.2@aar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: com.android.support:support-compat:28.0.0@aar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: com.android.support:support-core-ui:28.0.0@aar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: com.android.support:asynclayoutinflater:28.0.0@aar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: com.android.support.constraint:constraint-layout:1.1.3@aar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: com.android.support:print:28.0.0@aar\" level=\"project\" />\n    <orderEntry type=\"library\" scope=\"TEST\" name=\"Gradle: com.google.code.findbugs:jsr305:2.0.1@jar\" level=\"project\" />\n    <orderEntry type=\"library\" scope=\"TEST\" name=\"Gradle: javax.inject:javax.inject:1@jar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: android.arch.core:common:1.1.1@jar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: com.android.support:versionedparcelable:28.0.0@aar\" level=\"project\" />\n    <orderEntry type=\"library\" scope=\"TEST\" name=\"Gradle: junit:junit:4.12@jar\" level=\"project\" />\n    <orderEntry type=\"library\" scope=\"TEST\" name=\"Gradle: org.hamcrest:hamcrest-core:1.3@jar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: com.android.support:viewpager:28.0.0@aar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: com.android.support:support-core-utils:28.0.0@aar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: com.android.support:support-vector-drawable:28.0.0@aar\" level=\"project\" />\n    <orderEntry type=\"library\" scope=\"TEST\" name=\"Gradle: com.android.support.test:monitor:1.0.2@aar\" level=\"project\" />\n    <orderEntry type=\"library\" scope=\"TEST\" name=\"Gradle: org.hamcrest:hamcrest-library:1.3@jar\" level=\"project\" />\n    <orderEntry type=\"library\" scope=\"TEST\" name=\"Gradle: org.hamcrest:hamcrest-integration:1.3@jar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: com.android.support:support-annotations:28.0.0@jar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: android.arch.lifecycle:common:1.1.1@jar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: com.android.support:interpolator:28.0.0@aar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: android.arch.lifecycle:livedata:1.1.1@aar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: com.android.support:drawerlayout:28.0.0@aar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: com.android.support:coordinatorlayout:28.0.0@aar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: com.android.support:customview:28.0.0@aar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: com.android.support:swiperefreshlayout:28.0.0@aar\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Gradle: com.android.support.constraint:constraint-layout-solver:1.1.3@jar\" level=\"project\" />\n    <orderEntry type=\"library\" scope=\"TEST\" name=\"Gradle: net.sf.kxml:kxml2:2.3.0@jar\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "app/build.gradle",
    "content": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 28\n    defaultConfig {\n        applicationId \"com.example.mediacodecencode\"\n        minSdkVersion 21\n        targetSdkVersion 28\n        versionCode 1\n        versionName \"1.0\"\n        testInstrumentationRunner \"android.support.test.runner.AndroidJUnitRunner\"\n    }\n\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'\n        }\n    }\n}\n\ndependencies {\n    implementation fileTree(dir: 'libs', include: ['*.jar'])\n    implementation 'com.android.support:appcompat-v7:28.0.0'\n    implementation 'com.android.support.constraint:constraint-layout:1.1.3'\n    testImplementation 'junit:junit:4.12'\n    androidTestImplementation 'com.android.support.test:runner:1.0.2'\n    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'\n}\n"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.example.mediacodecencode\"\n    android:versionCode=\"1\"\n    android:versionName=\"1.0\" >\n    \n    <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>\n    <uses-permission android:name=\"android.permission.CAMERA\" />\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@drawable/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\".MainActivity\"\n            android:label=\"@string/app_name\" >\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "app/src/main/java/com/example/mediacodecencode/AvcEncoder.java",
    "content": "package com.example.mediacodecencode;\n\nimport java.io.BufferedOutputStream;\nimport java.io.File;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.nio.ByteBuffer;\nimport android.annotation.SuppressLint;\nimport android.media.MediaCodec;\nimport android.media.MediaCodecInfo;\nimport android.media.MediaFormat;\nimport android.os.Environment;\nimport android.util.Log;\n\n\n\npublic class AvcEncoder \n{\n\tprivate final static String TAG = \"MeidaCodec\";\n\t\n\tprivate int TIMEOUT_USEC = 12000;\n\n\tprivate MediaCodec mediaCodec;\n\tint m_width;\n\tint m_height;\n\tint m_framerate;\n\tbyte[] m_info = null;\n\t \n\tpublic byte[] configbyte; \n\n\n\t@SuppressLint(\"NewApi\")\n\tpublic AvcEncoder(int width, int height, int framerate, int bitrate) { \n\t\t\n\t\tm_width  = width;\n\t\tm_height = height;\n\t\tm_framerate = framerate;\n\t\n\t    MediaFormat mediaFormat = MediaFormat.createVideoFormat(\"video/avc\", width, height);\n\t    mediaFormat.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420SemiPlanar);    \n\t    mediaFormat.setInteger(MediaFormat.KEY_BIT_RATE, width*height*5);\n\t    mediaFormat.setInteger(MediaFormat.KEY_FRAME_RATE, 30);\n\t    mediaFormat.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 1);\n\t    try {\n\t\t\tmediaCodec = MediaCodec.createEncoderByType(\"video/avc\");\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t    mediaCodec.configure(mediaFormat, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);\n\t    mediaCodec.start();\n\t    createfile();\n\t}\n\t\n\tprivate static String path = Environment.getExternalStorageDirectory().getAbsolutePath() + \"/test1.h264\";\n\tprivate BufferedOutputStream outputStream;\n\tFileOutputStream outStream;\n\tprivate void createfile(){\n\t\tFile file = new File(path);\n\t\tif(file.exists()){\n\t\t\tfile.delete();\n\t\t}\n\t    try {\n\t        outputStream = new BufferedOutputStream(new FileOutputStream(file));\n\t    } catch (Exception e){ \n\t        e.printStackTrace();\n\t    }\n\t}\n\n\t@SuppressLint(\"NewApi\")\n\tprivate void StopEncoder() {\n\t    try {\n\t        mediaCodec.stop();\n\t        mediaCodec.release();\n\t    } catch (Exception e){ \n\t        e.printStackTrace();\n\t    }\n\t}\n\t\n\tByteBuffer[] inputBuffers;\n\tByteBuffer[] outputBuffers;\n\n\tpublic boolean isRuning = false;\n\t\n\tpublic void StopThread(){\n\t\tisRuning = false;\n        try {\n        \tStopEncoder();\n\t\t\toutputStream.flush();\n\t        outputStream.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n\t\n\tint count = 0;\n\n\tpublic void StartEncoderThread(){\n\t\tThread EncoderThread = new Thread(new Runnable() {\n\n\t\t\t@SuppressLint(\"NewApi\")\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tisRuning = true;\n\t\t\t\tbyte[] input = null;\n\t\t\t\tlong pts =  0;\n\t\t\t\tlong generateIndex = 0;\n\n\t\t\t\twhile (isRuning) {\n\t\t\t\t\tif (MainActivity.YUVQueue.size() >0){\n\t\t\t\t\t\tinput = MainActivity.YUVQueue.poll();\n\t\t\t\t\t\tbyte[] yuv420sp = new byte[m_width*m_height*3/2];\n\t\t\t\t\t\tNV21ToNV12(input,yuv420sp,m_width,m_height);\n\t\t\t\t\t\tinput = yuv420sp;\n\t\t\t\t\t}\n\t\t\t\t\tif (input != null) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tlong startMs = System.currentTimeMillis();\n\t\t\t\t\t\t\tByteBuffer[] inputBuffers = mediaCodec.getInputBuffers();\n\t\t\t\t\t\t\tByteBuffer[] outputBuffers = mediaCodec.getOutputBuffers();\n\t\t\t\t\t\t\tint inputBufferIndex = mediaCodec.dequeueInputBuffer(-1);\n\t\t\t\t\t\t\tif (inputBufferIndex >= 0) {\n\t\t\t\t\t\t\t\tpts = computePresentationTime(generateIndex);\n\t\t\t\t\t\t\t\tByteBuffer inputBuffer = inputBuffers[inputBufferIndex];\n\t\t\t\t\t\t\t\tinputBuffer.clear();\n\t\t\t\t\t\t\t\tinputBuffer.put(input);\n\t\t\t\t\t\t\t\tmediaCodec.queueInputBuffer(inputBufferIndex, 0, input.length, pts, 0);\n\t\t\t\t\t\t\t\tgenerateIndex += 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tMediaCodec.BufferInfo bufferInfo = new MediaCodec.BufferInfo();\n\t\t\t\t\t\t\tint outputBufferIndex = mediaCodec.dequeueOutputBuffer(bufferInfo, TIMEOUT_USEC);\n\t\t\t\t\t\t\twhile (outputBufferIndex >= 0) {\n\t\t\t\t\t\t\t\t//Log.i(\"AvcEncoder\", \"Get H264 Buffer Success! flag = \"+bufferInfo.flags+\",pts = \"+bufferInfo.presentationTimeUs+\"\");\n\t\t\t\t\t\t\t\tByteBuffer outputBuffer = outputBuffers[outputBufferIndex];\n\t\t\t\t\t\t\t\tbyte[] outData = new byte[bufferInfo.size];\n\t\t\t\t\t\t\t\toutputBuffer.get(outData);\n\t\t\t\t\t\t\t\tif(bufferInfo.flags == 2){\n\t\t\t\t\t\t\t\t\tconfigbyte = new byte[bufferInfo.size];\n\t\t\t\t\t\t\t\t\tconfigbyte = outData;\n\t\t\t\t\t\t\t\t}else if(bufferInfo.flags == 1){\n\t\t\t\t\t\t\t\t\tbyte[] keyframe = new byte[bufferInfo.size + configbyte.length];\n\t\t\t\t\t\t\t\t\tSystem.arraycopy(configbyte, 0, keyframe, 0, configbyte.length);\n\t\t\t\t\t\t\t\t\tSystem.arraycopy(outData, 0, keyframe, configbyte.length, outData.length);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\toutputStream.write(keyframe, 0, keyframe.length);\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\toutputStream.write(outData, 0, outData.length);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tmediaCodec.releaseOutputBuffer(outputBufferIndex, false);\n\t\t\t\t\t\t\t\toutputBufferIndex = mediaCodec.dequeueOutputBuffer(bufferInfo, TIMEOUT_USEC);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} catch (Throwable t) {\n\t\t\t\t\t\t\tt.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tThread.sleep(500);\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tEncoderThread.start();\n\t\t\n\t}\n\t\n\tprivate void NV21ToNV12(byte[] nv21,byte[] nv12,int width,int height){\n\t\tif(nv21 == null || nv12 == null) {\n\t\t\treturn;\n\t\t}\n\t\tint framesize = width*height;\n\t\tint i = 0,j = 0;\n\t\tSystem.arraycopy(nv21, 0, nv12, 0, framesize);\n\t\tfor(i = 0; i < framesize; i++){\n\t\t\tnv12[i] = nv21[i];\n\t\t}\n\t\tfor (j = 0; j < framesize/2; j+=2)\n\t\t{\n\t\t  nv12[framesize + j-1] = nv21[j+framesize];\n\t\t}\n\t\tfor (j = 0; j < framesize/2; j+=2)\n\t\t{\n\t\t  nv12[framesize + j] = nv21[j+framesize-1];\n\t\t}\n\t}\n\t\n    /**\n     * Generates the presentation time for frame N, in microseconds.\n     */\n    private long computePresentationTime(long frameIndex) {\n        return 132 + frameIndex * 1000000 / m_framerate;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/example/mediacodecencode/MainActivity.java",
    "content": "package com.example.mediacodecencode;\n\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.concurrent.ArrayBlockingQueue;\nimport android.annotation.SuppressLint;\nimport android.annotation.TargetApi;\nimport android.app.Activity;\nimport android.app.AlertDialog;\nimport android.content.DialogInterface;\nimport android.content.pm.PackageManager;\nimport android.graphics.ImageFormat;\nimport android.hardware.Camera;\nimport android.hardware.Camera.Parameters;\nimport android.hardware.Camera.PreviewCallback;\nimport android.media.MediaCodecInfo;\nimport android.media.MediaCodecList;\nimport android.os.Build;\nimport android.os.Bundle;\nimport android.support.v4.app.ActivityCompat;\nimport android.support.v4.content.ContextCompat;\nimport android.util.Log;\nimport android.view.SurfaceHolder;\nimport android.view.SurfaceView;\n\npublic class MainActivity extends Activity  implements SurfaceHolder.Callback,PreviewCallback{\n\n\tprivate SurfaceView surfaceview;\n\t\n    private SurfaceHolder surfaceHolder;\n\t\n\tprivate Camera camera;\n\t\n    private Parameters parameters;\n    \n    int width = 640;\n    \n    int height = 480;\n    \n    int framerate = 24;\n    \n    int biterate = 8500*1000;\n    \n    private static int yuvqueuesize = 10;\n    \n\tpublic static ArrayBlockingQueue<byte[]> YUVQueue = new ArrayBlockingQueue<byte[]>(yuvqueuesize); \n\t\n\tprivate AvcEncoder avcCodec;\n    private final static int CAMERA_OK = 10001;\n    private static String[] PERMISSIONS_STORAGE = {\n            \"android.permission.CAMERA\",\n            \"android.permission.WRITE_EXTERNAL_STORAGE\" };\n\t\n\t@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_main);\n        surfaceview = findViewById(R.id.surfaceview);\n        SupportAvcCodec();\n        if (Build.VERSION.SDK_INT>22) {\n            if (!checkPermissionAllGranted(PERMISSIONS_STORAGE)){\n                ActivityCompat.requestPermissions(MainActivity.this,\n                        PERMISSIONS_STORAGE, CAMERA_OK);\n            }else{\n                init();\n            }\n        }else{\n            init();\n        }\n\n\t}\n\n\tprivate void init(){\n        surfaceHolder = surfaceview.getHolder();\n        surfaceHolder.addCallback(this);\n    }\n\n\n    private boolean checkPermissionAllGranted(String[] permissions) {\n        for (String permission : permissions) {\n            if (ContextCompat.checkSelfPermission(this, permission) != PackageManager.PERMISSION_GRANTED) {\n                // 只要有一个权限没有被授予, 则直接返回 false\n                return false;\n            }\n        }\n        return true;\n    }\n\n\n    @Override\n    public void onRequestPermissionsResult(int requestCode,String[] permissions,int[] grantResults) {\n        switch (requestCode) {\n            case CAMERA_OK:\n                if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {\n                    //这里已经获取到了摄像头的权限，想干嘛干嘛了可以\n                    init();\n                } else {\n                    showWaringDialog();\n                }\n                break;\n            default:\n                break;\n        }\n    }\n\n    private void showWaringDialog() {\n        AlertDialog dialog = new AlertDialog.Builder(this)\n                .setTitle(\"警告！\")\n                .setMessage(\"请前往设置->应用->PermissionDemo->权限中打开相关权限，否则功能无法正常运行！\")\n                .setPositiveButton(\"确定\", new DialogInterface.OnClickListener() {\n                    @Override\n                    public void onClick(DialogInterface dialog, int which) {\n                        // 一般情况下如果用户不授权的话，功能是无法运行的，做退出处理\n                        finish();\n                    }\n                }).show();\n    }\n\n\n\n    @Override\n    public void surfaceCreated(SurfaceHolder holder) {\n\n\t\t\n    }\n\n    @Override\n    public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {\n        camera = getBackCamera();\n        startcamera(camera);\n        avcCodec = new AvcEncoder(this.width,this.height,framerate,biterate);\n        avcCodec.StartEncoderThread();\n    }\n\n    @Override\n    public void surfaceDestroyed(SurfaceHolder holder) {\n        if (null != camera) {\n        \tcamera.setPreviewCallback(null);\n        \tcamera.stopPreview();\n            camera.release();\n            camera = null;\n            avcCodec.StopThread();\n        }\n    }\n\n\n\t@Override\n\tpublic void onPreviewFrame(byte[] data, android.hardware.Camera camera) {\n\t\t// TODO Auto-generated method stub\n\t\tputYUVData(data,data.length);\n\t}\n\t\n\tpublic void putYUVData(byte[] buffer, int length) {\n\t\tif (YUVQueue.size() >= 10) {\n\t\t\tYUVQueue.poll();\n\t\t}\n\t\tYUVQueue.add(buffer);\n\t}\n\t\n\t@SuppressLint(\"NewApi\")\n\tprivate boolean SupportAvcCodec(){\n\t\tif(Build.VERSION.SDK_INT>=18){\n\t\t\tfor(int j = MediaCodecList.getCodecCount() - 1; j >= 0; j--){\n\t\t\t\tMediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(j);\n\t\n\t\t\t\tString[] types = codecInfo.getSupportedTypes();\n\t\t\t\tfor (int i = 0; i < types.length; i++) {\n\t\t\t\t\tif (types[i].equalsIgnoreCase(\"video/avc\")) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\t\n\n    private void startcamera(Camera mCamera){\n        if(mCamera != null){\n            try {\n                mCamera.setPreviewCallback(this);\n                mCamera.setDisplayOrientation(90);\n                if(parameters == null){\n                    parameters = mCamera.getParameters();\n                }\n                parameters = mCamera.getParameters();\n                parameters.setPreviewFormat(ImageFormat.NV21);\n                parameters.setPreviewSize(width, height);\n                mCamera.setParameters(parameters);\n                mCamera.setPreviewDisplay(surfaceHolder);\n                mCamera.startPreview();\n\n            } catch (IOException e) {\n                e.printStackTrace();\n            }\n        }\n    }\n\n    @TargetApi(9)\n\tprivate Camera getBackCamera() {\n        Camera c = null;\n        try {\n            c = Camera.open(0); // attempt to get a Camera instance\n        } catch (Exception e) {\n            e.printStackTrace();\n        }\n        return c; // returns null if camera is unavailable\n    }\n\n\n}\n"
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "content": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\" >\n    \n    <SurfaceView \n        android:id=\"@+id/surfaceview\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"/>\n\n\n</RelativeLayout>\n"
  },
  {
    "path": "app/src/main/res/menu/main.xml",
    "content": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    tools:context=\"com.example.mediacodecencode.MainActivity\" >\n\n    <item\n        android:id=\"@+id/action_settings\"\n        android:orderInCategory=\"100\"\n        android:title=\"@string/action_settings\"\n        app:showAsAction=\"never\"/>\n\n</menu>\n"
  },
  {
    "path": "app/src/main/res/values/dimens.xml",
    "content": "<resources>\n\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"activity_vertical_margin\">16dp</dimen>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <string name=\"app_name\">MediaCodecEncode</string>\n    <string name=\"hello_world\">Hello world!</string>\n    <string name=\"action_settings\">Settings</string>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "content": "<resources>\n\n    <!--\n        Base application theme, dependent on API level. This theme is replaced\n        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"Theme.AppCompat.Light\">\n        <!--\n            Theme customizations available in newer API levels can go in\n            res/values-vXX/styles.xml, while customizations related to\n            backward-compatibility can go here.\n        -->\n    </style>\n\n    <!-- Application theme. -->\n    <style name=\"AppTheme\" parent=\"AppBaseTheme\">\n        <!-- All customizations that are NOT specific to a particular API-level can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values-v11/styles.xml",
    "content": "<resources>\n\n    <!--\n        Base application theme for API 11+. This theme completely replaces\n        AppBaseTheme from res/values/styles.xml on API 11+ devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"Theme.AppCompat.Light\">\n        <!-- API 11 theme customizations can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values-v14/styles.xml",
    "content": "<resources>\n\n    <!--\n        Base application theme for API 14+. This theme completely replaces\n        AppBaseTheme from BOTH res/values/styles.xml and\n        res/values-v11/styles.xml on API 14+ devices.\n    -->\n    <style name=\"AppBaseTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\">\n        <!-- API 14 theme customizations can go here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values-w820dp/dimens.xml",
    "content": "<resources>\n\n    <!--\n         Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively).\n    -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n\n</resources>\n"
  },
  {
    "path": "build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    repositories {\n        google()\n        jcenter()\n\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:3.4.0'\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        google()\n        jcenter()\n\n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-5.1.1-all.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "gradlew",
    "content": "#!/usr/bin/env sh\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn () {\n    echo \"$*\"\n}\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\n  NONSTOP* )\n    nonstop=true\n    ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" -a \"$nonstop\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n    JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Escape application args\nsave () {\n    for i do printf %s\\\\n \"$i\" | sed \"s/'/'\\\\\\\\''/g;1s/^/'/;\\$s/\\$/' \\\\\\\\/\" ; done\n    echo \" \"\n}\nAPP_ARGS=$(save \"$@\")\n\n# Collect all arguments for the java command, following the shell quoting and substitution rules\neval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS \"\\\"-Dorg.gradle.appname=$APP_BASE_NAME\\\"\" -classpath \"\\\"$CLASSPATH\\\"\" org.gradle.wrapper.GradleWrapperMain \"$APP_ARGS\"\n\n# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong\nif [ \"$(uname)\" = \"Darwin\" ] && [ \"$HOME\" = \"$PWD\" ]; then\n  cd \"$(dirname \"$0\")\"\nfi\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem  Gradle startup script for Windows\n@rem\n@rem ##########################################################################\n\n@rem Set local scope for the variables with windows NT shell\nif \"%OS%\"==\"Windows_NT\" setlocal\n\nset DIRNAME=%~dp0\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\nset APP_BASE_NAME=%~n0\nset APP_HOME=%DIRNAME%\n\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nset DEFAULT_JVM_OPTS=\n\n@rem Find java.exe\nif defined JAVA_HOME goto findJavaFromJavaHome\n\nset JAVA_EXE=java.exe\n%JAVA_EXE% -version >NUL 2>&1\nif \"%ERRORLEVEL%\" == \"0\" goto init\n\necho.\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:findJavaFromJavaHome\nset JAVA_HOME=%JAVA_HOME:\"=%\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\n\nif exist \"%JAVA_EXE%\" goto init\n\necho.\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:init\n@rem Get command-line arguments, handling Windows variants\n\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\n\n:win9xME_args\n@rem Slurp the command line arguments.\nset CMD_LINE_ARGS=\nset _SKIP=2\n\n:win9xME_args_slurp\nif \"x%~1\" == \"x\" goto execute\n\nset CMD_LINE_ARGS=%*\n\n:execute\n@rem Setup the command line\n\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\n\n@rem Execute Gradle\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\n\n:end\n@rem End local scope for the variables with windows NT shell\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\n\n:fail\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\nrem the _cmd.exe /c_ return code!\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\nexit /b 1\n\n:mainEnd\nif \"%OS%\"==\"Windows_NT\" endlocal\n\n:omega\n"
  },
  {
    "path": "local.properties",
    "content": "## This file must *NOT* be checked into Version Control Systems,\n# as it contains information specific to your local configuration.\n#\n# Location of the SDK. This is only used by Gradle.\n# For customization when using a Version Control System, please read the\n# header note.\n#Wed Jul 24 14:35:18 CST 2019\nndk.dir=/Users/apple/Library/Android/sdk/ndk-bundle\nsdk.dir=/Users/apple/Library/Android/sdk\n"
  },
  {
    "path": "settings.gradle",
    "content": "include ':app'\n"
  }
]