Showing preview only (711K chars total). Download the full file or copy to clipboard to get everything.
Repository: bilibili/DanmakuFlameMaster
Branch: master
Commit: e2846461a09e
Files: 135
Total size: 663.3 KB
Directory structure:
gitextract_ewo3zqa2/
├── .gitignore
├── .gitmodules
├── .travis.yml
├── DanmakuFlameMaster/
│ ├── build.gradle
│ ├── gradle.properties
│ └── src/
│ ├── androidTest/
│ │ └── java/
│ │ └── tv/
│ │ └── cjump/
│ │ └── jni/
│ │ └── NativeBitmapFactoryTest.java
│ └── main/
│ ├── .classpath
│ ├── .project
│ ├── .settings/
│ │ ├── org.eclipse.jdt.core.prefs
│ │ └── org.eclipse.jdt.ui.prefs
│ ├── AndroidManifest.xml
│ ├── build.xml
│ ├── java/
│ │ ├── master/
│ │ │ └── flame/
│ │ │ └── danmaku/
│ │ │ ├── controller/
│ │ │ │ ├── CacheManagingDrawTask.java
│ │ │ │ ├── DanmakuFilters.java
│ │ │ │ ├── DrawHandler.java
│ │ │ │ ├── DrawHelper.java
│ │ │ │ ├── DrawTask.java
│ │ │ │ ├── IDanmakuView.java
│ │ │ │ ├── IDanmakuViewController.java
│ │ │ │ ├── IDrawTask.java
│ │ │ │ └── UpdateThread.java
│ │ │ ├── danmaku/
│ │ │ │ ├── loader/
│ │ │ │ │ ├── ILoader.java
│ │ │ │ │ ├── IllegalDataException.java
│ │ │ │ │ └── android/
│ │ │ │ │ ├── AcFunDanmakuLoader.java
│ │ │ │ │ ├── BiliDanmakuLoader.java
│ │ │ │ │ └── DanmakuLoaderFactory.java
│ │ │ │ ├── model/
│ │ │ │ │ ├── AbsDanmakuSync.java
│ │ │ │ │ ├── AbsDisplayer.java
│ │ │ │ │ ├── AlphaValue.java
│ │ │ │ │ ├── BaseDanmaku.java
│ │ │ │ │ ├── Danmaku.java
│ │ │ │ │ ├── DanmakuTimer.java
│ │ │ │ │ ├── Duration.java
│ │ │ │ │ ├── FBDanmaku.java
│ │ │ │ │ ├── FTDanmaku.java
│ │ │ │ │ ├── GlobalFlagValues.java
│ │ │ │ │ ├── ICacheManager.java
│ │ │ │ │ ├── IDanmakuIterator.java
│ │ │ │ │ ├── IDanmakus.java
│ │ │ │ │ ├── IDisplayer.java
│ │ │ │ │ ├── IDrawingCache.java
│ │ │ │ │ ├── L2RDanmaku.java
│ │ │ │ │ ├── R2LDanmaku.java
│ │ │ │ │ ├── SpecialDanmaku.java
│ │ │ │ │ ├── android/
│ │ │ │ │ │ ├── AndroidDisplayer.java
│ │ │ │ │ │ ├── BaseCacheStuffer.java
│ │ │ │ │ │ ├── CachingPolicy.java
│ │ │ │ │ │ ├── DanmakuContext.java
│ │ │ │ │ │ ├── DanmakuFactory.java
│ │ │ │ │ │ ├── Danmakus.java
│ │ │ │ │ │ ├── DrawingCache.java
│ │ │ │ │ │ ├── DrawingCacheHolder.java
│ │ │ │ │ │ ├── DrawingCachePoolManager.java
│ │ │ │ │ │ ├── SimpleTextCacheStuffer.java
│ │ │ │ │ │ ├── SpannedCacheStuffer.java
│ │ │ │ │ │ └── ViewCacheStuffer.java
│ │ │ │ │ └── objectpool/
│ │ │ │ │ ├── FinitePool.java
│ │ │ │ │ ├── Pool.java
│ │ │ │ │ ├── Poolable.java
│ │ │ │ │ ├── PoolableManager.java
│ │ │ │ │ ├── Pools.java
│ │ │ │ │ └── SynchronizedPool.java
│ │ │ │ ├── parser/
│ │ │ │ │ ├── BaseDanmakuParser.java
│ │ │ │ │ ├── IDataSource.java
│ │ │ │ │ └── android/
│ │ │ │ │ ├── AndroidFileSource.java
│ │ │ │ │ └── JSONSource.java
│ │ │ │ ├── renderer/
│ │ │ │ │ ├── IRenderer.java
│ │ │ │ │ ├── Renderer.java
│ │ │ │ │ └── android/
│ │ │ │ │ ├── DanmakuRenderer.java
│ │ │ │ │ └── DanmakusRetainer.java
│ │ │ │ └── util/
│ │ │ │ ├── DanmakuUtils.java
│ │ │ │ ├── IOUtils.java
│ │ │ │ └── SystemClock.java
│ │ │ └── ui/
│ │ │ └── widget/
│ │ │ ├── DanmakuSurfaceView.java
│ │ │ ├── DanmakuTextureView.java
│ │ │ ├── DanmakuTouchHelper.java
│ │ │ ├── DanmakuView.java
│ │ │ └── FakeDanmakuView.java
│ │ └── tv/
│ │ └── cjump/
│ │ └── jni/
│ │ ├── DeviceUtils.java
│ │ └── NativeBitmapFactory.java
│ ├── lint.xml
│ ├── proguard-project.txt
│ └── project.properties
├── LICENSE
├── README.md
├── Sample/
│ ├── build.gradle
│ └── src/
│ └── main/
│ ├── .classpath
│ ├── .project
│ ├── .settings/
│ │ └── org.eclipse.jdt.core.prefs
│ ├── AndroidManifest.xml
│ ├── java/
│ │ └── com/
│ │ └── sample/
│ │ ├── BiliDanmukuParser.java
│ │ ├── MainActivity.java
│ │ └── UglyViewCacheStufferSampleActivity.java
│ ├── project.properties
│ └── res/
│ ├── layout/
│ │ ├── activity_main.xml
│ │ ├── layout_view_cache.xml
│ │ └── media_controller.xml
│ ├── menu/
│ │ └── main.xml
│ ├── raw/
│ │ └── comments.xml
│ └── values/
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── build.gradle
├── gradle/
│ ├── gradle-bintray-upload.gradle
│ ├── gradle-mvn-push.gradle
│ └── wrapper/
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── ndkbitmap-armv5/
│ ├── .gitignore
│ ├── build.gradle
│ ├── gradle.properties
│ ├── proguard-rules.pro
│ └── src/
│ ├── androidTest/
│ │ └── java/
│ │ └── tv/
│ │ └── cjump/
│ │ └── ndkbitmap_armv5/
│ │ └── ApplicationTest.java
│ └── main/
│ ├── AndroidManifest.xml
│ ├── java/
│ │ └── tv/
│ │ └── cjump/
│ │ └── ndkbitmap_armv5/
│ │ └── Pragma.java
│ └── res/
│ └── values/
│ └── strings.xml
├── ndkbitmap-armv7a/
│ ├── .gitignore
│ ├── build.gradle
│ ├── gradle.properties
│ ├── proguard-rules.pro
│ └── src/
│ ├── androidTest/
│ │ └── java/
│ │ └── tv/
│ │ └── cjump/
│ │ └── ndkbitmap_armv7a/
│ │ └── ApplicationTest.java
│ └── main/
│ ├── AndroidManifest.xml
│ ├── java/
│ │ └── tv/
│ │ └── cjump/
│ │ └── ndkbitmap_armv7a/
│ │ └── Pragma.java
│ └── res/
│ └── values/
│ └── strings.xml
├── ndkbitmap-x86/
│ ├── .gitignore
│ ├── build.gradle
│ ├── gradle.properties
│ ├── proguard-rules.pro
│ └── src/
│ ├── androidTest/
│ │ └── java/
│ │ └── tv/
│ │ └── cjump/
│ │ └── ndkbitmap_x86/
│ │ └── ApplicationTest.java
│ └── main/
│ ├── AndroidManifest.xml
│ ├── java/
│ │ └── tv/
│ │ └── cjump/
│ │ └── ndkbitmap_x86/
│ │ └── Pragma.java
│ └── res/
│ └── values/
│ └── strings.xml
└── settings.gradle
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# built application files
*.apk
*.ap_
*.com
*.class
*.dll
*.exe
*.o
# files for the dex VM
*.dex
# Java class files
*.class
# generated files
bin/
gen/
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
proguard/
# Intellij project files
*.iml
*.ipr
*.iws
.idea/
.DS_Store
.idea/
.gradle
build/
*.iml
out/
================================================
FILE: .gitmodules
================================================
================================================
FILE: .travis.yml
================================================
language: android
android:
components:
- platform-tools
- tools
- build-tools-26.0.2
- android-25
- extra-android-support
- extra-android-m2repository
script:
- ./gradlew check -i
- ./gradlew assemble
after_failure:
- cat /home/travis/build/Bilibili/DanmakuFlameMaster/DanmakuFlameMaster/build/outputs/lint-results.html
- cat /home/travis/build/Bilibili/DanmakuFlameMaster/DanmakuFlameMaster/build/outputs/lint-results.xml
================================================
FILE: DanmakuFlameMaster/build.gradle
================================================
/*
* Copyright (C) 2013 Chen Hui <calmer91@gmail.com>
*
* 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.
*/
apply plugin: 'com.android.library'
def SourcePath = 'src/main/'
android {
compileSdkVersion 25
buildToolsVersion "26.0.2"
defaultConfig {
minSdkVersion 9
targetSdkVersion 25
versionName VERSION_NAME
versionCode Integer.parseInt(VERSION_CODE)
}
sourceSets {
main {
manifest.srcFile "${SourcePath}AndroidManifest.xml"
java.srcDirs = ["${SourcePath}java"]
jniLibs.srcDirs = ["${SourcePath}libs"]
}
androidTest.setRoot("${SourcePath}../androidTest")
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
if (rootProject.file('gradle/gradle-mvn-push.gradle').exists()) {
apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
}
if (rootProject.file('gradle/gradle-bintray-upload.gradle').exists()) {
apply from: rootProject.file('gradle/gradle-bintray-upload.gradle')
}
================================================
FILE: DanmakuFlameMaster/gradle.properties
================================================
POM_NAME=DanmakuFlameMaster
BINTRAY_POM_NAME=dfm
POM_ARTIFACT_ID=dfm
POM_PACKAGING=aar
================================================
FILE: DanmakuFlameMaster/src/androidTest/java/tv/cjump/jni/NativeBitmapFactoryTest.java
================================================
package tv.cjump.jni;
import android.app.ActivityManager;
import android.app.Instrumentation;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Debug;
import master.flame.danmaku.danmaku.util.SystemClock;
import android.test.InstrumentationTestCase;
import android.util.Log;
import junit.framework.Assert;
import junit.framework.TestCase;
import java.util.ArrayList;
import java.util.Locale;
/**
* Created by ch on 15-6-12.
*/
public class NativeBitmapFactoryTest extends InstrumentationTestCase {
private static final int DEFAULT_MESSAGE_SIZE = 1024;
private static final int BYTES_IN_MEGABYTE = 1024 * 1024;
private static final int BITMAP_WIDTH = 200;
private static final int BITMAP_HEIGHT = 200;
private static final String TAG = NativeBitmapFactoryTest.class.getSimpleName();
public void testLoadLibs() {
NativeBitmapFactory.loadLibs();
boolean isInNativeAlloc = NativeBitmapFactory.isInNativeAlloc();
Assert.assertTrue("NativeBitmapFactory is not supported on your OS", isInNativeAlloc);
}
public void testNativeBitmap() {
Bitmap bitmap = NativeBitmapFactory.createBitmap(BITMAP_WIDTH, BITMAP_HEIGHT, Bitmap.Config.ARGB_8888);
accessBitmap(bitmap);
bitmap.recycle();
gcAndWait();
}
public void testDalvikBitmap() {
Bitmap bitmap = Bitmap.createBitmap(BITMAP_WIDTH, BITMAP_HEIGHT, Bitmap.Config.ARGB_8888);
accessBitmap(bitmap);
bitmap.recycle();
gcAndWait();
}
public void testNativeBitmaps() {
StringBuilder sb = new StringBuilder(DEFAULT_MESSAGE_SIZE);
appendValue(sb, "\n\n", "===== before create 50 NativeBitmap", "\n\n");
updateHeapValue(sb);
final String message = sb.toString();
Log.i(TAG, message);
sb = new StringBuilder();
ArrayList<Bitmap> bitmaps = new ArrayList<>();
for (int i = 0; i < 150; i++) {
Bitmap bitmap = NativeBitmapFactory.createBitmap(BITMAP_WIDTH, BITMAP_HEIGHT, Bitmap.Config.ARGB_8888);
accessBitmap(bitmap);
bitmaps.add(bitmap);
}
updateHeapValue(sb);
Log.d(TAG, sb.toString());
for (Bitmap bitmap : bitmaps) {
bitmap.recycle();
}
gcAndWait();
}
public Context getContext(){
return getInstrumentation().getTargetContext();
}
private void updateHeapValue(StringBuilder sb) {
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
ActivityManager activityManager = (ActivityManager) getContext().getSystemService(Context.ACTIVITY_SERVICE);
activityManager.getMemoryInfo(mi);
long availableMegs = mi.availMem;
final Runtime runtime = Runtime.getRuntime();
final long heapMemory = runtime.totalMemory() - runtime.freeMemory();
// When changing format of output below, make sure to sync "scripts/test_runner.py" as well.
appendSize(sb, "System availMem: ", availableMegs, "\n");
appendSize(sb, "Java heap size: ", heapMemory, "\n");
appendSize(sb, "Native heap size: ", Debug.getNativeHeapSize(), "\n");
}
public void testDalvikBitmaps() {
StringBuilder sb = new StringBuilder(DEFAULT_MESSAGE_SIZE);
appendValue(sb, "\n\n", "===== before create 50 DalvikBitmap", "\n\n");
updateHeapValue(sb);
final String message = sb.toString();
Log.i(TAG, message);
sb = new StringBuilder();
ArrayList<Bitmap> bitmaps = new ArrayList<>();
for (int i = 0; i < 150; i++) {
Bitmap bitmap = Bitmap.createBitmap(BITMAP_WIDTH, BITMAP_HEIGHT, Bitmap.Config.ARGB_8888);
accessBitmap(bitmap);
bitmaps.add(bitmap);
}
updateHeapValue(sb);
Log.d(TAG, sb.toString());
for (Bitmap bitmap : bitmaps) {
bitmap.recycle();
}
gcAndWait();
}
public void testReleaseLibs() {
NativeBitmapFactory.releaseLibs();
}
private void accessBitmap(Bitmap bitmap) {
boolean result = (bitmap != null && bitmap.getWidth() == BITMAP_WIDTH && bitmap.getHeight() == BITMAP_HEIGHT);
if (result) {
if (android.os.Build.VERSION.SDK_INT >= 17 && !bitmap.isPremultiplied()) {
bitmap.setPremultiplied(true);
}
Canvas canvas = new Canvas(bitmap);
Paint paint = new Paint();
paint.setColor(Color.RED);
paint.setTextSize(20f);
canvas.drawRect(0f, 0f, (float) bitmap.getWidth(), (float) bitmap.getHeight(),
paint);
canvas.drawText("TestLib", 0, 0, paint);
}
}
private void gcAndWait() {
System.gc();
SystemClock.sleep(10000);
// try {
// Debug.dumpHprofData("/sdcard/nbf_test_dump.hprof");
// } catch (IOException e) {
// e.printStackTrace();
// }
}
private static void appendSize(StringBuilder sb, String prefix, long bytes, String suffix) {
String value = String.format(Locale.getDefault(), "%.2f", (float) bytes / BYTES_IN_MEGABYTE);
appendValue(sb, prefix, value + " MB", suffix);
}
private static void appendTime(StringBuilder sb, String prefix, long timeMs, String suffix) {
appendValue(sb, prefix, timeMs + " ms", suffix);
}
private static void appendNumber(StringBuilder sb, String prefix, long number, String suffix) {
appendValue(sb, prefix, number + "", suffix);
}
private static void appendValue(StringBuilder sb, String prefix, String value, String suffix) {
sb.append(prefix).append(value).append(suffix);
}
}
================================================
FILE: DanmakuFlameMaster/src/main/.classpath
================================================
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="java"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
================================================
FILE: DanmakuFlameMaster/src/main/.project
================================================
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>DanmakuFlameMaster</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
================================================
FILE: DanmakuFlameMaster/src/main/.settings/org.eclipse.jdt.core.prefs
================================================
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
org.eclipse.jdt.core.formatter.blank_lines_before_method=1
org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
org.eclipse.jdt.core.formatter.blank_lines_before_package=1
org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true
org.eclipse.jdt.core.formatter.comment.format_block_comments=true
org.eclipse.jdt.core.formatter.comment.format_header=false
org.eclipse.jdt.core.formatter.comment.format_html=true
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
org.eclipse.jdt.core.formatter.comment.format_line_comments=true
org.eclipse.jdt.core.formatter.comment.format_source_code=true
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
org.eclipse.jdt.core.formatter.comment.line_length=80
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
org.eclipse.jdt.core.formatter.compact_else_if=true
org.eclipse.jdt.core.formatter.continuation_indentation=2
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_empty_lines=false
org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
org.eclipse.jdt.core.formatter.indentation.size=4
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.join_lines_in_comments=true
org.eclipse.jdt.core.formatter.join_wrapped_lines=true
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
org.eclipse.jdt.core.formatter.lineSplit=300
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
org.eclipse.jdt.core.formatter.tabulation.char=space
org.eclipse.jdt.core.formatter.tabulation.size=4
org.eclipse.jdt.core.formatter.use_on_off_tags=false
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
================================================
FILE: DanmakuFlameMaster/src/main/.settings/org.eclipse.jdt.ui.prefs
================================================
eclipse.preferences.version=1
formatter_profile=_AndroidCodeStyle
formatter_settings_version=12
org.eclipse.jdt.ui.ignorelowercasenames=true
org.eclipse.jdt.ui.importorder=android;com;dalvik;gov;junit;libcore;net;org;java;javax;
org.eclipse.jdt.ui.ondemandthreshold=99
org.eclipse.jdt.ui.staticondemandthreshold=99
================================================
FILE: DanmakuFlameMaster/src/main/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2013 Chen Hui <calmer91@gmail.com>
~
~ 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.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="master.flame.danmaku"
android:versionCode="9025"
android:versionName="0.9.25" >
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="22" />
</manifest>
================================================
FILE: DanmakuFlameMaster/src/main/build.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project name="DanmakuFlameMaster" default="help">
<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. -->
<property file="local.properties" />
<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:
source.dir
The name of the source directory. Default is 'src'.
out.dir
The name of the output directory. Default is 'bin'.
For other overridable properties, look at the beginning of the rules
files in the SDK, at tools/ant/build.xml
Properties related to the SDK location or the project target should
be updated using the 'android' tool with the 'update' action.
This file is an integral part of the build system for your
application and should be checked into Version Control Systems.
-->
<property file="ant.properties" />
<!-- if sdk.dir was not set from one of the property file, then
get it from the ANDROID_HOME env var.
This must be done before we load project.properties since
the proguard config can use sdk.dir -->
<property environment="env" />
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
<isset property="env.ANDROID_HOME" />
</condition>
<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
unless="sdk.dir"
/>
<!--
Import per project custom build rules if present at the root of the project.
This is the place to put custom intermediary targets such as:
-pre-build
-pre-compile
-post-compile (This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir})
-post-package
-post-build
-pre-clean
-->
<import file="custom_rules.xml" optional="true" />
<!-- Import the actual build file.
To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.
***********************
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
-->
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />
</project>
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/CacheManagingDrawTask.java
================================================
/*
* Copyright (C) 2013 Chen Hui <calmer91@gmail.com>
*
* 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.
*/
package master.flame.danmaku.controller;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Message;
import master.flame.danmaku.danmaku.model.AbsDisplayer;
import master.flame.danmaku.danmaku.model.BaseDanmaku;
import master.flame.danmaku.danmaku.model.DanmakuTimer;
import master.flame.danmaku.danmaku.model.ICacheManager;
import master.flame.danmaku.danmaku.model.IDanmakus;
import master.flame.danmaku.danmaku.model.IDrawingCache;
import master.flame.danmaku.danmaku.model.android.CachingPolicy;
import master.flame.danmaku.danmaku.model.android.DanmakuContext;
import master.flame.danmaku.danmaku.model.android.DanmakuContext.DanmakuConfigTag;
import master.flame.danmaku.danmaku.model.android.Danmakus;
import master.flame.danmaku.danmaku.model.android.DrawingCache;
import master.flame.danmaku.danmaku.model.android.DrawingCachePoolManager;
import master.flame.danmaku.danmaku.model.objectpool.Pool;
import master.flame.danmaku.danmaku.model.objectpool.Pools;
import master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState;
import master.flame.danmaku.danmaku.util.DanmakuUtils;
import master.flame.danmaku.danmaku.util.SystemClock;
import tv.cjump.jni.NativeBitmapFactory;
public class CacheManagingDrawTask extends DrawTask {
private static final int MAX_CACHE_SCREEN_SIZE = 3;
private int mMaxCacheSize = 2;
private CacheManager mCacheManager;
private DanmakuTimer mCacheTimer;
private final Object mDrawingNotify = new Object();
private int mRemaininCacheCount;
public CacheManagingDrawTask(DanmakuTimer timer, DanmakuContext config, TaskListener taskListener) {
super(timer, config, taskListener);
NativeBitmapFactory.loadLibs();
mMaxCacheSize = (int) Math.max(1024 * 1024 * 4, Runtime.getRuntime().maxMemory() * config.cachingPolicy.maxCachePoolSizeFactorPercentage);
mCacheManager = new CacheManager(mMaxCacheSize, MAX_CACHE_SCREEN_SIZE);
mRenderer.setCacheManager(mCacheManager);
}
@Override
protected void initTimer(DanmakuTimer timer) {
mTimer = timer;
mCacheTimer = new DanmakuTimer();
mCacheTimer.update(timer.currMillisecond);
}
@Override
public void addDanmaku(BaseDanmaku danmaku) {
super.addDanmaku(danmaku);
if (mCacheManager == null)
return;
mCacheManager.addDanmaku(danmaku);
}
@Override
public void invalidateDanmaku(BaseDanmaku item, boolean remeasure) {
super.invalidateDanmaku(item, remeasure);
if (mCacheManager == null) {
return;
}
mCacheManager.invalidateDanmaku(item, remeasure);
}
@Override
public void removeAllDanmakus(boolean isClearDanmakusOnScreen) {
super.removeAllDanmakus(isClearDanmakusOnScreen);
if (mCacheManager != null) {
mCacheManager.requestClearAll();
}
}
@Override
protected void onDanmakuRemoved(BaseDanmaku danmaku) {
super.onDanmakuRemoved(danmaku);
if (mCacheManager != null) {
if (++mRemaininCacheCount > 5) { // control frequency (it does not require very precise
mCacheManager.requestClearTimeout();
mRemaininCacheCount = 0;
}
} else {
IDrawingCache<?> cache = danmaku.getDrawingCache();
if (cache != null) {
if (cache.hasReferences()) {
cache.decreaseReference();
} else {
cache.destroy();
}
danmaku.cache = null;
}
}
}
@Override
public RenderingState draw(AbsDisplayer displayer) {
RenderingState result = super.draw(displayer);
synchronized (mDrawingNotify) {
mDrawingNotify.notify();
}
if (result != null && mCacheManager != null) {
if (result.totalDanmakuCount - result.lastTotalDanmakuCount < -20) {
mCacheManager.requestClearTimeout();
mCacheManager.requestBuild(-mContext.mDanmakuFactory.MAX_DANMAKU_DURATION);
}
}
return result;
}
@Override
public void seek(long mills) {
super.seek(mills);
if (mCacheManager == null) {
start();
}
mCacheManager.seek(mills);
}
@Override
public void start() {
super.start();
NativeBitmapFactory.loadLibs();
if (mCacheManager == null) {
mCacheManager = new CacheManager(mMaxCacheSize, MAX_CACHE_SCREEN_SIZE);
mCacheManager.begin();
mRenderer.setCacheManager(mCacheManager);
} else {
mCacheManager.resume();
}
}
@Override
public void quit() {
super.quit();
reset();
mRenderer.setCacheManager(null);
if (mCacheManager != null) {
mCacheManager.end();
mCacheManager = null;
}
NativeBitmapFactory.releaseLibs();
}
@Override
public void prepare() {
if (mParser == null) {
return;
}
loadDanmakus(mParser);
mCacheManager.begin();
}
@Override
public void onPlayStateChanged(int state) {
super.onPlayStateChanged(state);
if (mCacheManager != null) {
mCacheManager.onPlayStateChanged(state);
}
}
@Override
public void requestSync(long fromTimeMills, long toTimeMills, long offsetMills) {
super.requestSync(fromTimeMills, toTimeMills, offsetMills);
if (mCacheManager != null) {
mCacheManager.seek(toTimeMills);
}
}
public class CacheManager implements ICacheManager {
@SuppressWarnings("unused")
private static final String TAG = "CacheManager";
public static final byte RESULT_SUCCESS = 0;
public static final byte RESULT_FAILED = 1;
public static final byte RESULT_FAILED_OVERSIZE = 2;
public HandlerThread mThread;
Danmakus mCaches = new Danmakus();
DrawingCachePoolManager mCachePoolManager = new DrawingCachePoolManager();
Pool<DrawingCache> mCachePool = Pools.finitePool(mCachePoolManager, 800);
private int mMaxSize;
private int mRealSize;
private int mScreenSize = 3;
private CacheHandler mHandler;
private boolean mEndFlag;
public CacheManager(int maxSize, int screenSize) {
mEndFlag = false;
mRealSize = 0;
mMaxSize = maxSize;
mScreenSize = screenSize;
}
public void seek(long mills) {
if (mHandler == null)
return;
mHandler.requestCancelCaching();
mHandler.removeMessages(CacheHandler.BUILD_CACHES);
mHandler.obtainMessage(CacheHandler.SEEK, mills).sendToTarget();
}
@Override
public void addDanmaku(BaseDanmaku danmaku) {
if (mHandler != null) {
if (danmaku.isLive && danmaku.forceBuildCacheInSameThread) {
if (!danmaku.isTimeOut()) {
mHandler.createCache(danmaku);
}
return;
}
mHandler.obtainMessage(CacheHandler.ADD_DANMAKU, danmaku).sendToTarget();
}
}
public void invalidateDanmaku(BaseDanmaku danmaku, boolean remeasure) {
if (mHandler != null) {
mHandler.requestCancelCaching();
mHandler.obtainMessage(CacheHandler.REBUILD_CACHE, danmaku).sendToTarget();
mHandler.sendEmptyMessage(CacheHandler.DISABLE_CANCEL_FLAG);
requestBuild(0);
}
}
public void begin() {
mEndFlag = false;
if (mThread == null) {
mThread = new HandlerThread("DFM Cache-Building Thread");
mThread.start();
}
if (mHandler == null)
mHandler = new CacheHandler(mThread.getLooper());
mHandler.begin();
}
public void end() {
mEndFlag = true;
synchronized (mDrawingNotify) {
mDrawingNotify.notifyAll();
}
if (mHandler != null) {
mHandler.removeCallbacksAndMessages(null);
mHandler.pause();
mHandler = null;
}
if (mThread != null) {
try {
mThread.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
mThread.quit();
mThread = null;
}
}
public void resume() {
if (mHandler != null) {
mHandler.resume();
} else {
begin();
}
}
public void onPlayStateChanged(int state) {
if (mHandler != null) {
mHandler.onPlayStateChanged(state == IDrawTask.PLAY_STATE_PLAYING);
}
}
public float getPoolPercent() {
if (mMaxSize == 0) {
return 0;
}
return mRealSize / (float) mMaxSize;
}
public boolean isPoolFull() {
return mRealSize + 5120 >= mMaxSize;
}
private void evictAll() {
if (mCaches != null) {
mCaches.forEach(new IDanmakus.DefaultConsumer<BaseDanmaku>() {
@Override
public int accept(BaseDanmaku danmaku) {
entryRemoved(true, danmaku, null);
return ACTION_CONTINUE;
}
});
mCaches.clear();
}
mRealSize = 0;
}
private void evictAllNotInScreen() {
if (mCaches != null) {
mCaches.forEach(new IDanmakus.DefaultConsumer<BaseDanmaku>() {
@Override
public int accept(BaseDanmaku danmaku) {
if (danmaku.isOutside()) {
entryRemoved(true, danmaku, null);
return ACTION_REMOVE;
}
return ACTION_CONTINUE;
}
});
}
}
protected void entryRemoved(boolean evicted, BaseDanmaku oldValue, BaseDanmaku newValue) {
IDrawingCache<?> cache = oldValue.getDrawingCache();
if (cache != null) {
long releasedSize = clearCache(oldValue);
if (oldValue.isTimeOut()) {
mContext.getDisplayer().getCacheStuffer().releaseResource(oldValue);
}
if (releasedSize <= 0) return;
mRealSize -= releasedSize;
mCachePool.release((DrawingCache) cache);
}
}
private long clearCache(BaseDanmaku oldValue) {
IDrawingCache cache = oldValue.cache;
if (cache == null) {
return 0;
}
if (cache.hasReferences()) {
cache.decreaseReference();
oldValue.cache = null;
return 0;
}
long size = sizeOf(oldValue);
cache.destroy();
oldValue.cache = null;
return size;
}
protected int sizeOf(BaseDanmaku value) {
if (value.cache != null && !value.cache.hasReferences()) {
return value.cache.size();
}
return 0;
}
private void clearCachePool() {
DrawingCache item;
while ((item = mCachePool.acquire()) != null) {
item.destroy();
}
}
private boolean push(BaseDanmaku item, int itemSize, boolean forcePush) {
int size = itemSize; //sizeOf(item);
if (size > 0) {
clearTimeOutAndFilteredCaches(size, forcePush);
// may be a risk of OOM if (mRealSize + size) is still larger than mMaxSize
}
this.mCaches.addItem(item);
mRealSize += size;
//Log.i("DFM CACHE", "realsize:"+mRealSize + ",size" + size);
return true;
}
private void clearTimeOutCaches() {
mCaches.forEach(new IDanmakus.DefaultConsumer<BaseDanmaku>() {
@Override
public int accept(BaseDanmaku val) {
if (val.isTimeOut()) {
IDrawingCache<?> cache = val.cache;
if (mContext.cachingPolicy.periodOfRecycle == CachingPolicy.CACHE_PERIOD_NOT_RECYCLE && cache != null && !cache.hasReferences()) {
if (cache.size() / (float) mMaxCacheSize < mContext.cachingPolicy.forceRecyleThreshold) {
return ACTION_CONTINUE;
}
//else 回收尺寸过大的cache
}
if (!mEndFlag) {
synchronized (mDrawingNotify) {
try {
mDrawingNotify.wait(30);
} catch (InterruptedException e) {
e.printStackTrace();
return ACTION_BREAK;
}
}
}
entryRemoved(false, val, null);
return ACTION_REMOVE;
} else {
return ACTION_BREAK;
}
}
});
}
private BaseDanmaku findReusableCache(final BaseDanmaku refDanmaku,
final boolean strictMode,
final int maximumTimes) {
int slopPixel = 0;
if (!strictMode) {
slopPixel = mDisp.getSlopPixel() * 2;
}
final int finalSlopPixel = slopPixel + mContext.cachingPolicy.reusableOffsetPixel;
IDanmakus.Consumer<BaseDanmaku, BaseDanmaku> consumer = new IDanmakus.Consumer<BaseDanmaku, BaseDanmaku>() {
int count = 0;
BaseDanmaku mResult;
@Override
public BaseDanmaku result() {
return mResult;
}
@Override
public int accept(BaseDanmaku danmaku) {
if (count++ >= maximumTimes) {
return ACTION_BREAK;
}
IDrawingCache<?> cache = danmaku.getDrawingCache();
if (cache == null || cache.get() == null) {
return ACTION_CONTINUE;
}
if (danmaku.paintWidth == refDanmaku.paintWidth
&& danmaku.paintHeight == refDanmaku.paintHeight
&& danmaku.underlineColor == refDanmaku.underlineColor
&& danmaku.borderColor == refDanmaku.borderColor
&& danmaku.textColor == refDanmaku.textColor
&& danmaku.text.equals(refDanmaku.text)
&& danmaku.tag == refDanmaku.tag) {
mResult = danmaku;
return ACTION_BREAK;
}
if (strictMode) {
return ACTION_CONTINUE;
}
if (!danmaku.isTimeOut()) {
return ACTION_BREAK;
}
if (cache.hasReferences()) {
return ACTION_CONTINUE;
}
float widthGap = cache.width() - refDanmaku.paintWidth;
float heightGap = cache.height() - refDanmaku.paintHeight;
if (widthGap >= 0 && widthGap <= finalSlopPixel &&
heightGap >= 0 && heightGap <= finalSlopPixel) {
mResult = danmaku;
return ACTION_BREAK;
}
return ACTION_CONTINUE;
}
};
mCaches.forEach(consumer);
return consumer.result();
}
public class CacheHandler extends Handler {
private static final int PREPARE = 0x1;
public static final int ADD_DANMAKU = 0x2;
public static final int BUILD_CACHES = 0x3;
public static final int CLEAR_TIMEOUT_CACHES = 0x4;
public static final int SEEK = 0x5;
public static final int QUIT = 0x6;
public static final int CLEAR_ALL_CACHES = 0x7;
public static final int CLEAR_OUTSIDE_CACHES = 0x8;
public static final int CLEAR_OUTSIDE_CACHES_AND_RESET = 0x9;
public static final int DISPATCH_ACTIONS = 0x10;
public static final int REBUILD_CACHE = 0x11;
public static final int DISABLE_CANCEL_FLAG = 0x12;
private boolean mPause;
private boolean mIsPlayerPause;
private boolean mSeekedFlag;
private boolean mCancelFlag;
public CacheHandler(android.os.Looper looper) {
super(looper);
}
public void requestCancelCaching() {
mCancelFlag = true;
}
@Override
public void handleMessage(Message msg) {
int what = msg.what;
switch (what) {
case PREPARE:
evictAllNotInScreen();
for (int i = 0; i < 300; i++) {
mCachePool.release(new DrawingCache());
}
case DISPATCH_ACTIONS:
//Log.e(TAG,"dispatch_actions:"+mCacheTimer.currMillisecond+":"+mTimer.currMillisecond);
long delayed = dispatchAction();
if (delayed <= 0) {
delayed = mContext.mDanmakuFactory.MAX_DANMAKU_DURATION / 2;
}
sendEmptyMessageDelayed(DISPATCH_ACTIONS, delayed);
break;
case BUILD_CACHES:
removeMessages(BUILD_CACHES);
boolean repositioned = ((mTaskListener != null && mReadyState == false) || mSeekedFlag);
prepareCaches(repositioned);
if (repositioned)
mSeekedFlag = false;
if (mTaskListener != null && mReadyState == false) {
mTaskListener.ready();
mReadyState = true;
}
// Log.i(TAG,"BUILD_CACHES:"+mCacheTimer.currMillisecond+":"+mTimer.currMillisecond);
break;
case ADD_DANMAKU:
BaseDanmaku item = (BaseDanmaku) msg.obj;
addDanmakuAndBuildCache(item);
break;
case REBUILD_CACHE:
BaseDanmaku cacheitem = (BaseDanmaku) msg.obj;
if (cacheitem != null) {
IDrawingCache<?> cache = cacheitem.getDrawingCache();
boolean requestRemeasure = 0 != (cacheitem.requestFlags & BaseDanmaku.FLAG_REQUEST_REMEASURE);
if (!requestRemeasure && cache != null && cache.get() !=null && !cache.hasReferences()) {
cache = DanmakuUtils.buildDanmakuDrawingCache(cacheitem, mDisp, (DrawingCache) cacheitem.cache, mContext.cachingPolicy.bitsPerPixelOfCache);
cacheitem.cache = cache;
push(cacheitem, 0, true);
return;
}
if (cacheitem.isLive) {
clearCache(cacheitem);
createCache(cacheitem);
} else {
if (cache != null && cache.hasReferences()) {
cache.destroy();
}
entryRemoved(true, cacheitem, null);
addDanmakuAndBuildCache(cacheitem);
}
}
break;
case CLEAR_TIMEOUT_CACHES:
clearTimeOutCaches();
break;
case SEEK:
Long seekMills = (Long) msg.obj;
if (seekMills != null) {
long seekCacheTime = seekMills.longValue();
long oldCacheTime = mCacheTimer.currMillisecond;
mCacheTimer.update(seekCacheTime);
mSeekedFlag = true;
long firstCacheTime = getFirstCacheTime();
if (seekCacheTime > oldCacheTime || firstCacheTime - seekCacheTime > mContext.mDanmakuFactory.MAX_DANMAKU_DURATION) {
evictAllNotInScreen();
} else {
clearTimeOutCaches();
}
prepareCaches(true);
resume();
}
break;
case QUIT:
removeCallbacksAndMessages(null);
mPause = true;
evictAll();
clearCachePool();
this.getLooper().quit();
break;
case CLEAR_ALL_CACHES:
evictAll();
mCacheTimer.update(mTimer.currMillisecond - mContext.mDanmakuFactory.MAX_DANMAKU_DURATION);
mSeekedFlag = true;
break;
case CLEAR_OUTSIDE_CACHES:
evictAllNotInScreen();
mCacheTimer.update(mTimer.currMillisecond);
break;
case CLEAR_OUTSIDE_CACHES_AND_RESET:
evictAllNotInScreen();
mCacheTimer.update(mTimer.currMillisecond);
requestClear();
break;
case DISABLE_CANCEL_FLAG:
mCancelFlag = false;
break;
}
}
private long dispatchAction() {
if (mCacheTimer.currMillisecond <= mTimer.currMillisecond - mContext.mDanmakuFactory.MAX_DANMAKU_DURATION) {
if (mContext.cachingPolicy.periodOfRecycle != CachingPolicy.CACHE_PERIOD_NOT_RECYCLE) {
evictAllNotInScreen();
}
mCacheTimer.update(mTimer.currMillisecond);
sendEmptyMessage(BUILD_CACHES);
return 0;
}
float level = getPoolPercent();
BaseDanmaku firstCache = mCaches.first();
//TODO 如果firstcache大于当前时间超过半屏并且水位在0.5f以下,
long gapTime = firstCache != null ? firstCache.getActualTime() - mTimer.currMillisecond : 0;
long doubleScreenDuration = mContext.mDanmakuFactory.MAX_DANMAKU_DURATION * 2;
if (level < 0.6f && gapTime > mContext.mDanmakuFactory.MAX_DANMAKU_DURATION) {
mCacheTimer.update(mTimer.currMillisecond);
removeMessages(BUILD_CACHES);
sendEmptyMessage(BUILD_CACHES);
return 0;
} else if (level > 0.4f && gapTime < -doubleScreenDuration) {
// clear timeout caches
removeMessages(CLEAR_TIMEOUT_CACHES);
sendEmptyMessage(CLEAR_TIMEOUT_CACHES);
return 0;
}
if (level >= 0.9f) {
return 0;
}
// check cache time
long deltaTime = mCacheTimer.currMillisecond - mTimer.currMillisecond;
if (firstCache != null && firstCache.isTimeOut() && deltaTime < -mContext.mDanmakuFactory.MAX_DANMAKU_DURATION) {
mCacheTimer.update(mTimer.currMillisecond);
sendEmptyMessage(CLEAR_OUTSIDE_CACHES);
sendEmptyMessage(BUILD_CACHES);
return 0;
} else if (deltaTime > doubleScreenDuration) {
return 0;
}
removeMessages(BUILD_CACHES);
sendEmptyMessage(BUILD_CACHES);
return 0;
}
private void releaseDanmakuCache(BaseDanmaku item, DrawingCache cache) {
if (cache == null) {
cache = (DrawingCache) item.cache;
}
item.cache = null;
if (cache == null) {
return;
}
cache.destroy(); //fixme: consider hasReferences?
mCachePool.release(cache);
}
private void preMeasure() {
// pre measure
IDanmakus danmakus = null;
try {
long begin = mTimer.currMillisecond;
long end = begin + mContext.mDanmakuFactory.MAX_DANMAKU_DURATION * 2;
danmakus = danmakuList.subnew(begin - mContext.mDanmakuFactory.MAX_DANMAKU_DURATION, end);
} catch (Exception e) {
}
if (danmakus == null || danmakus.isEmpty()) {
return;
}
danmakus.forEach(new IDanmakus.DefaultConsumer<BaseDanmaku>() {
@Override
public int accept(BaseDanmaku item) {
if (mPause || mCancelFlag) {
return ACTION_BREAK;
}
if (!item.hasPassedFilter()) {
mContext.mDanmakuFilters.filter(item, 0, 0, null, true, mContext);
}
if (item.isFiltered()) {
return ACTION_CONTINUE;
}
if (!item.isMeasured()) {
item.measure(mDisp, true);
}
if (!item.isPrepared()) {
item.prepare(mDisp, true);
}
return ACTION_CONTINUE;
}
});
}
private long prepareCaches(final boolean repositioned) {
preMeasure();
final long curr = mCacheTimer.currMillisecond - 30;
final long end = curr + mContext.mDanmakuFactory.MAX_DANMAKU_DURATION * mScreenSize;
if (end < mTimer.currMillisecond) {
return 0;
}
final long startTime = SystemClock.uptimeMillis();
IDanmakus danmakus = null;
int tryCount = 0;
boolean hasException = false;
do {
try {
danmakus = danmakuList.subnew(curr, end);
} catch (Exception e) {
hasException = true;
SystemClock.sleep(10);
}
} while (++tryCount < 3 && danmakus == null && hasException);
if (danmakus == null) {
mCacheTimer.update(end);
return 0;
}
final BaseDanmaku first = danmakus.first();
final BaseDanmaku last = danmakus.last();
if (first == null || last == null) {
mCacheTimer.update(end);
return 0;
}
long deltaTime = first.getActualTime() - mTimer.currMillisecond;
long sleepTime = (deltaTime < 0 ? 30 : 30 + 10 * deltaTime / mContext.mDanmakuFactory.MAX_DANMAKU_DURATION);
sleepTime = Math.min(100, sleepTime);
if (repositioned) {
sleepTime = 0;
}
final long finalSleepTime = sleepTime;
BaseDanmaku item = null;
long consumingTime = 0;
int orderInScreen = 0;
int currScreenIndex = 0;
final int sizeInScreen = danmakus.size();
// String message = "";
danmakus.forEach(new IDanmakus.DefaultConsumer<BaseDanmaku>() {
int orderInScreen = 0;
int currScreenIndex = 0;
@Override
public int accept(BaseDanmaku item) {
if (mPause || mCancelFlag) {
return ACTION_BREAK;
}
if (last.getActualTime() < mTimer.currMillisecond) {
return ACTION_BREAK;
}
IDrawingCache<?> cache = item.getDrawingCache();
if (cache != null && cache.get() != null) {
return ACTION_CONTINUE;
}
if (repositioned == false && (item.isTimeOut() || !item.isOutside())) {
return ACTION_CONTINUE;
}
if (!item.hasPassedFilter()) {
mContext.mDanmakuFilters.filter(item, orderInScreen, sizeInScreen, null, true, mContext);
}
//Log.e("prepareCache", currScreenIndex+","+indexInScreen+"," + item.time+"skip:"+skip);
if (item.priority == 0 && item.isFiltered()) {
return ACTION_CONTINUE;
}
if (item.getType() == BaseDanmaku.TYPE_SCROLL_RL) {
// 同屏弹幕密度只对滚动弹幕有效
int screenIndex = (int) ((item.getActualTime() - curr) / mContext.mDanmakuFactory.MAX_DANMAKU_DURATION);
if (currScreenIndex == screenIndex)
orderInScreen++;
else {
orderInScreen = 0;
currScreenIndex = screenIndex;
}
}
if (!repositioned && !mIsPlayerPause) {
try {
synchronized (mDrawingNotify) {
mDrawingNotify.wait(finalSleepTime);
}
} catch (InterruptedException e) {
e.printStackTrace();
return ACTION_BREAK;
}
}
// build cache
buildCache(item, false);
if (!repositioned) {
long consumingTime = SystemClock.uptimeMillis() - startTime;
if (consumingTime >= mContext.mDanmakuFactory.COMMON_DANMAKU_DURATION * mScreenSize) {
// message = "break at consumingTime out:" + consumingTime;
return ACTION_BREAK;
}
}
return ACTION_CONTINUE;
}
});
consumingTime = SystemClock.uptimeMillis() - startTime;
if (item != null) {
mCacheTimer.update(item.getTime());
//Log.i("cache","stop at :"+item.time+","+count+",size:"+danmakus.size()+","+message);
} else {
mCacheTimer.update(end);
}
return consumingTime;
}
public boolean createCache(BaseDanmaku item) {
// measure
if (!item.isMeasured()) {
item.measure(mDisp, true);
}
DrawingCache cache = null;
try {
cache = mCachePool.acquire();
cache = DanmakuUtils.buildDanmakuDrawingCache(item, mDisp, cache, mContext.cachingPolicy.bitsPerPixelOfCache);
item.cache = cache;
} catch (OutOfMemoryError e) {
//Log.e("cache", "break at error: oom");
if (cache != null) {
mCachePool.release(cache);
}
item.cache = null;
return false;
} catch (Exception e) {
//Log.e("cache", "break at exception:" + e.getMessage());
if (cache != null) {
mCachePool.release(cache);
}
item.cache = null;
return false;
}
return true;
}
private byte buildCache(BaseDanmaku item, boolean forceInsert) {
// measure
if (!item.isMeasured()) {
item.measure(mDisp, true);
}
DrawingCache cache = null;
try {
// try to find reuseable cache
BaseDanmaku danmaku = findReusableCache(item, true, mContext.cachingPolicy.maxTimesOfStrictReusableFinds);
if (danmaku != null) {
cache = (DrawingCache) danmaku.cache;
}
if (cache != null) {
cache.increaseReference();
item.cache = cache;
//Log.w("cache", danmaku.text + "DrawingCache hit!!:" + item.paintWidth + "," + danmaku.paintWidth);
mCacheManager.push(item, 0, forceInsert);
return RESULT_SUCCESS;
}
// try to find reuseable cache from timeout || no-refrerence caches
danmaku = findReusableCache(item, false, mContext.cachingPolicy.maxTimesOfReusableFinds);
if (danmaku != null) {
cache = (DrawingCache) danmaku.cache;
}
if (cache != null) {
danmaku.cache = null;
//Log.e("cache", danmaku.text + "DrawingCache hit!!:" + item.paintWidth + "," + danmaku.paintWidth);
cache = DanmakuUtils.buildDanmakuDrawingCache(item, mDisp, cache, mContext.cachingPolicy.bitsPerPixelOfCache); //redraw
item.cache = cache;
mCacheManager.push(item, 0, forceInsert);
return RESULT_SUCCESS;
}
// guess cache size
int cacheSize = DanmakuUtils.getCacheSize((int) item.paintWidth, (int) item.paintHeight, mContext.cachingPolicy.bitsPerPixelOfCache / 8);
if (cacheSize * 2 > mMaxCacheSize) { // block large-size cache
// Log.d("cache", "cache is too large:"+cacheSize);
return RESULT_FAILED;
}
if (!forceInsert && (mRealSize + cacheSize > mMaxSize)) {
// Log.d("cache", "break at MaxSize:"+mMaxSize);
mCacheManager.clearTimeOutAndFilteredCaches(cacheSize, false);
return RESULT_FAILED;
}
cache = mCachePool.acquire();
cache = DanmakuUtils.buildDanmakuDrawingCache(item, mDisp, cache, mContext.cachingPolicy.bitsPerPixelOfCache);
item.cache = cache;
boolean pushed = mCacheManager.push(item, sizeOf(item), forceInsert);
if (!pushed) {
releaseDanmakuCache(item, cache);
//Log.e("cache", "break at push failed:" + mMaxSize);
}
return pushed ? RESULT_SUCCESS : RESULT_FAILED;
} catch (OutOfMemoryError e) {
//Log.e("cache", "break at error: oom");
releaseDanmakuCache(item, cache);
return RESULT_FAILED;
} catch (Exception e) {
//Log.e("cache", "break at exception:" + e.getMessage());
releaseDanmakuCache(item, cache);
return RESULT_FAILED;
}
}
private final void addDanmakuAndBuildCache(BaseDanmaku danmaku) {
if (danmaku.isTimeOut() || (danmaku.getActualTime() > mCacheTimer.currMillisecond + mContext.mDanmakuFactory.MAX_DANMAKU_DURATION && !danmaku.isLive)) {
return;
}
if (danmaku.priority == 0 && danmaku.isFiltered()) {
return;
}
IDrawingCache<?> cache = danmaku.getDrawingCache();
if (cache == null || cache.get() == null) {
buildCache(danmaku, true);
}
}
public void begin() {
sendEmptyMessage(PREPARE);
sendEmptyMessageDelayed(CLEAR_TIMEOUT_CACHES, mContext.mDanmakuFactory.MAX_DANMAKU_DURATION);
}
public void pause() {
mPause = true;
sendEmptyMessage(QUIT);
}
public void resume() {
sendEmptyMessage(DISABLE_CANCEL_FLAG);
mPause = false;
removeMessages(DISPATCH_ACTIONS);
sendEmptyMessage(DISPATCH_ACTIONS);
sendEmptyMessageDelayed(CLEAR_TIMEOUT_CACHES, mContext.mDanmakuFactory.MAX_DANMAKU_DURATION);
}
public boolean isPause() {
return mPause;
}
public void requestBuildCacheAndDraw(long correctionTime) {
removeMessages(CacheHandler.BUILD_CACHES);
mSeekedFlag = true;
sendEmptyMessage(DISABLE_CANCEL_FLAG);
mCacheTimer.update(mTimer.currMillisecond + correctionTime);
sendEmptyMessage(CacheHandler.BUILD_CACHES);
}
public void onPlayStateChanged(boolean isPlaying) {
mIsPlayerPause = !isPlaying;
}
}
private void clearTimeOutAndFilteredCaches(int expectedFreeSize, final boolean forcePush) {
final int fexpectedFreeSize = expectedFreeSize;
mCaches.forEach(new IDanmakus.DefaultConsumer<BaseDanmaku>() {
@Override
public int accept(BaseDanmaku oldValue) {
if (mEndFlag) {
return IDanmakus.Consumer.ACTION_BREAK;
}
if (mRealSize + fexpectedFreeSize > mMaxSize) {
if (oldValue.isTimeOut() || oldValue.isFiltered()) {
entryRemoved(false, oldValue, null);
return IDanmakus.Consumer.ACTION_REMOVE;
} else if (forcePush) {
return IDanmakus.Consumer.ACTION_BREAK;
}
} else {
return IDanmakus.Consumer.ACTION_BREAK;
}
return IDanmakus.Consumer.ACTION_CONTINUE;
}
});
}
public long getFirstCacheTime() {
if (mCaches != null && mCaches.size() > 0) {
BaseDanmaku firstItem = mCaches.first();
if (firstItem == null)
return 0;
return firstItem.getActualTime();
}
return 0;
}
public void requestBuild(long correctionTime) {
if (mHandler != null) {
mHandler.requestBuildCacheAndDraw(correctionTime);
}
}
public void requestClearAll() {
if (mHandler == null) {
return;
}
mHandler.removeMessages(CacheHandler.BUILD_CACHES);
mHandler.removeMessages(CacheHandler.DISABLE_CANCEL_FLAG);
mHandler.requestCancelCaching();
mHandler.removeMessages(CacheHandler.CLEAR_ALL_CACHES);
mHandler.sendEmptyMessage(CacheHandler.CLEAR_ALL_CACHES);
}
public void requestClearUnused() {
if (mHandler == null) {
return;
}
mHandler.removeMessages(CacheHandler.CLEAR_OUTSIDE_CACHES_AND_RESET);
mHandler.sendEmptyMessage(CacheHandler.CLEAR_OUTSIDE_CACHES_AND_RESET);
}
public void requestClearTimeout() {
if (mHandler == null) {
return;
}
mHandler.removeMessages(CacheHandler.CLEAR_TIMEOUT_CACHES);
mHandler.sendEmptyMessage(CacheHandler.CLEAR_TIMEOUT_CACHES);
}
public void post(Runnable runnable) {
if (mHandler == null) {
return;
}
mHandler.post(runnable);
}
}
@Override
public boolean onDanmakuConfigChanged(DanmakuContext config, DanmakuConfigTag tag,
Object... values) {
if (super.handleOnDanmakuConfigChanged(config, tag, values)) {
// do nothing
} else if (DanmakuConfigTag.SCROLL_SPEED_FACTOR.equals(tag)) {
mDisp.resetSlopPixel(mContext.scaleTextSize);
requestClear();
} else if (tag.isVisibilityRelatedTag()) {
if (values != null && values.length > 0) {
if (values[0] != null && ((values[0] instanceof Boolean) == false || ((Boolean) values[0]).booleanValue())) {
if (mCacheManager != null) {
mCacheManager.requestBuild(0l);
}
}
}
requestClear();
} else if (DanmakuConfigTag.TRANSPARENCY.equals(tag) || DanmakuConfigTag.SCALE_TEXTSIZE.equals(tag) || DanmakuConfigTag.DANMAKU_STYLE.equals(tag)) {
if (DanmakuConfigTag.SCALE_TEXTSIZE.equals(tag)) {
mDisp.resetSlopPixel(mContext.scaleTextSize);
}
if (mCacheManager != null) {
mCacheManager.requestClearAll();
mCacheManager.requestBuild(-mContext.mDanmakuFactory.MAX_DANMAKU_DURATION);
}
} else {
if (mCacheManager != null) {
mCacheManager.requestClearUnused();
mCacheManager.requestBuild(0l);
}
}
if (mTaskListener != null && mCacheManager != null) {
mCacheManager.post(new Runnable() {
@Override
public void run() {
mTaskListener.onDanmakuConfigChanged();
}
});
}
return true;
}
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/DanmakuFilters.java
================================================
package master.flame.danmaku.controller;
import master.flame.danmaku.danmaku.model.Duration;
import master.flame.danmaku.danmaku.util.SystemClock;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
import master.flame.danmaku.danmaku.model.BaseDanmaku;
import master.flame.danmaku.danmaku.model.DanmakuTimer;
import master.flame.danmaku.danmaku.model.IDanmakus;
import master.flame.danmaku.danmaku.model.android.DanmakuContext;
import master.flame.danmaku.danmaku.model.android.Danmakus;
public class DanmakuFilters {
public static final int FILTER_TYPE_TYPE = 1;
public static final int FILYER_TYPE_QUANTITY = 2;
public static final int FILTER_TYPE_ELAPSED_TIME = 4;
public static final int FILTER_TYPE_TEXTCOLOR = 8;
public static final int FILTER_TYPE_USER_ID = 16;
public static final int FILTER_TYPE_USER_HASH = 32;
public static final int FILTER_TYPE_USER_GUEST = 64;
public static final int FILTER_TYPE_DUPLICATE_MERGE = 128;
public static final int FILTER_TYPE_MAXIMUM_LINES = 256;
public static final int FILTER_TYPE_OVERLAPPING = 512;
public interface IDanmakuFilter<T> {
/*
* 是否过滤
*/
boolean filter(BaseDanmaku danmaku, int index, int totalsizeInScreen,
DanmakuTimer timer, boolean fromCachingTask, DanmakuContext config);
void setData(T data);
void reset();
void clear();
}
public static abstract class BaseDanmakuFilter<T> implements IDanmakuFilter<T> {
@Override
public void clear() {
}
}
/**
* 根据弹幕类型过滤
*
* @author ch
*/
public static class TypeDanmakuFilter extends BaseDanmakuFilter<List<Integer>> {
final List<Integer> mFilterTypes = Collections.synchronizedList(new ArrayList<Integer>());
public void enableType(Integer type) {
if (!mFilterTypes.contains(type))
mFilterTypes.add(type);
}
public void disableType(Integer type) {
if (mFilterTypes.contains(type))
mFilterTypes.remove(type);
}
@Override
public boolean filter(BaseDanmaku danmaku, int orderInScreen, int totalsizeInScreen,
DanmakuTimer timer, boolean fromCachingTask, DanmakuContext config) {
boolean filtered = danmaku != null && mFilterTypes.contains(danmaku.getType());
if (filtered) {
danmaku.mFilterParam |= FILTER_TYPE_TYPE;
}
return filtered;
}
@Override
public void setData(List<Integer> data) {
reset();
if (data != null) {
for (Integer i : data) {
enableType(i);
}
}
}
@Override
public void reset() {
mFilterTypes.clear();
}
}
/**
* 根据同屏数量过滤弹幕
*
* @author ch
*/
public static class QuantityDanmakuFilter extends BaseDanmakuFilter<Integer> {
protected int mMaximumSize = -1;
protected BaseDanmaku mLastSkipped = null;
private float mFilterFactor = 1f;
private boolean needFilter(BaseDanmaku danmaku, int orderInScreen,
int totalSizeInScreen, DanmakuTimer timer, boolean fromCachingTask, DanmakuContext context) {
if (mMaximumSize <= 0 || danmaku.getType() != BaseDanmaku.TYPE_SCROLL_RL) {
return false;
}
if (mLastSkipped == null || mLastSkipped.isTimeOut()) {
mLastSkipped = danmaku;
return false;
}
long gapTime = danmaku.getActualTime() - mLastSkipped.getActualTime();
Duration maximumScrollDuration = context.mDanmakuFactory.MAX_Duration_Scroll_Danmaku;
if (gapTime >= 0 && maximumScrollDuration != null && gapTime < (maximumScrollDuration.value * mFilterFactor)) {
return true;
}
if (orderInScreen > mMaximumSize) {
return true;
}
mLastSkipped = danmaku;
return false;
}
@Override
public synchronized boolean filter(BaseDanmaku danmaku, int orderInScreen,
int totalsizeInScreen, DanmakuTimer timer, boolean fromCachingTask, DanmakuContext config) {
boolean filtered = needFilter(danmaku, orderInScreen, totalsizeInScreen, timer, fromCachingTask, config);
if (filtered) {
danmaku.mFilterParam |= FILYER_TYPE_QUANTITY;
}
return filtered;
}
@Override
public void setData(Integer data) {
reset();
if (data == null)
return;
if (data != mMaximumSize) {
mMaximumSize = data + data / 5;
mFilterFactor = 1f / (float) mMaximumSize;
}
}
@Override
public synchronized void reset() {
mLastSkipped = null;
}
@Override
public void clear() {
reset();
}
}
/**
* 根据绘制耗时过滤弹幕
*
* @author ch
*/
public static class ElapsedTimeFilter extends BaseDanmakuFilter<Object> {
long mMaxTime = 20; // 绘制超过20ms就跳过 ,默认保持接近50fps
private synchronized boolean needFilter(BaseDanmaku danmaku, int orderInScreen,
int totalsizeInScreen, DanmakuTimer timer, boolean fromCachingTask) {
if (timer == null || !danmaku.isOutside()) {
return false;
}
long elapsedTime = SystemClock.uptimeMillis() - timer.currMillisecond;
if (elapsedTime >= mMaxTime) {
return true;
}
return false;
}
@Override
public boolean filter(BaseDanmaku danmaku, int orderInScreen,
int totalsizeInScreen, DanmakuTimer timer, boolean fromCachingTask, DanmakuContext config) {
boolean filtered = needFilter(danmaku, orderInScreen, totalsizeInScreen, timer, fromCachingTask);
if (filtered) {
danmaku.mFilterParam |= FILTER_TYPE_ELAPSED_TIME;
}
return filtered;
}
@Override
public void setData(Object data) {
reset();
}
@Override
public synchronized void reset() {
}
@Override
public void clear() {
reset();
}
}
/**
* 根据文本颜色白名单过滤
*
* @author ch
*/
public static class TextColorFilter extends BaseDanmakuFilter<List<Integer>> {
public List<Integer> mWhiteList = new ArrayList<Integer>();
private void addToWhiteList(Integer color) {
if (!mWhiteList.contains(color)) {
mWhiteList.add(color);
}
}
@Override
public boolean filter(BaseDanmaku danmaku, int index, int totalsizeInScreen,
DanmakuTimer timer, boolean fromCachingTask, DanmakuContext config) {
boolean filtered = danmaku != null && !mWhiteList.contains(danmaku.textColor);
if (filtered) {
danmaku.mFilterParam |= FILTER_TYPE_TEXTCOLOR;
}
return filtered;
}
@Override
public void setData(List<Integer> data) {
reset();
if (data != null) {
for (Integer i : data) {
addToWhiteList(i);
}
}
}
@Override
public void reset() {
mWhiteList.clear();
}
}
/**
* 根据用户标识黑名单过滤
*
* @author ch
*/
public static abstract class UserFilter<T> extends BaseDanmakuFilter<List<T>> {
public List<T> mBlackList = new ArrayList<T>();
private void addToBlackList(T id) {
if (!mBlackList.contains(id)) {
mBlackList.add(id);
}
}
@Override
public abstract boolean filter(BaseDanmaku danmaku, int index, int totalsizeInScreen,
DanmakuTimer timer, boolean fromCachingTask, DanmakuContext config);
@Override
public void setData(List<T> data) {
reset();
if (data != null) {
for (T i : data) {
addToBlackList(i);
}
}
}
@Override
public void reset() {
mBlackList.clear();
}
}
/**
* 根据用户Id黑名单过滤
*
* @author ch
*/
public static class UserIdFilter extends UserFilter<Integer> {
@Override
public boolean filter(BaseDanmaku danmaku, int index, int totalsizeInScreen,
DanmakuTimer timer, boolean fromCachingTask, DanmakuContext config) {
boolean filtered = danmaku != null && mBlackList.contains(danmaku.userId);
if (filtered) {
danmaku.mFilterParam |= FILTER_TYPE_USER_ID;
}
return filtered;
}
}
/**
* 根据用户hash黑名单过滤
*
* @author ch
*/
public static class UserHashFilter extends UserFilter<String> {
@Override
public boolean filter(BaseDanmaku danmaku, int index, int totalsizeInScreen,
DanmakuTimer timer, boolean fromCachingTask, DanmakuContext config) {
boolean filtered = danmaku != null && mBlackList.contains(danmaku.userHash);
if (filtered) {
danmaku.mFilterParam |= FILTER_TYPE_USER_HASH;
}
return filtered;
}
}
/**
* 屏蔽游客弹幕
*
* @author ch
*/
public static class GuestFilter extends BaseDanmakuFilter<Boolean> {
private Boolean mBlock = false;
@Override
public boolean filter(BaseDanmaku danmaku, int index, int totalsizeInScreen,
DanmakuTimer timer, boolean fromCachingTask, DanmakuContext config) {
boolean filtered = mBlock && danmaku.isGuest;
if (filtered) {
danmaku.mFilterParam |= FILTER_TYPE_USER_GUEST;
}
return filtered;
}
@Override
public void setData(Boolean data) {
mBlock = data;
}
@Override
public void reset() {
mBlock = false;
}
}
public static class DuplicateMergingFilter extends BaseDanmakuFilter<Void> {
protected final IDanmakus blockedDanmakus = new Danmakus(Danmakus.ST_BY_LIST);
protected final LinkedHashMap<String, BaseDanmaku> currentDanmakus = new LinkedHashMap<String, BaseDanmaku>();
private final IDanmakus passedDanmakus = new Danmakus(Danmakus.ST_BY_LIST);
private final void removeTimeoutDanmakus(final IDanmakus danmakus, final long limitTime) {
danmakus.forEachSync(new IDanmakus.DefaultConsumer<BaseDanmaku>() {
long startTime = SystemClock.uptimeMillis();
@Override
public int accept(BaseDanmaku item) {
try {
if (SystemClock.uptimeMillis() - startTime > limitTime) {
return ACTION_BREAK;
}
if (item.isTimeOut()) {
return ACTION_REMOVE;
} else {
return ACTION_BREAK;
}
} catch (Exception e) {
return ACTION_BREAK;
}
}
});
}
private void removeTimeoutDanmakus(LinkedHashMap<String, BaseDanmaku> danmakus,
int limitTime) {
Iterator<Entry<String, BaseDanmaku>> it = danmakus.entrySet().iterator();
long startTime = SystemClock.uptimeMillis();
while (it.hasNext()) {
try {
Entry<String, BaseDanmaku> entry = it.next();
BaseDanmaku item = entry.getValue();
if (item.isTimeOut()) {
it.remove();
} else {
break;
}
} catch (Exception e) {
break;
}
if (SystemClock.uptimeMillis() - startTime > limitTime) {
break;
}
}
}
public synchronized boolean needFilter(BaseDanmaku danmaku, int index, int totalsizeInScreen,
DanmakuTimer timer, boolean fromCachingTask) {
removeTimeoutDanmakus(blockedDanmakus, 2);
removeTimeoutDanmakus(passedDanmakus, 2);
removeTimeoutDanmakus(currentDanmakus, 3);
if (blockedDanmakus.contains(danmaku) && !danmaku.isOutside()) {
return true;
}
if (passedDanmakus.contains(danmaku)) {
return false;
}
if (currentDanmakus.containsKey(danmaku.text)) {
currentDanmakus.put(String.valueOf(danmaku.text), danmaku);
blockedDanmakus.removeItem(danmaku);
blockedDanmakus.addItem(danmaku);
return true;
} else {
currentDanmakus.put(String.valueOf(danmaku.text), danmaku);
passedDanmakus.addItem(danmaku);
return false;
}
}
@Override
public boolean filter(BaseDanmaku danmaku, int index, int totalsizeInScreen,
DanmakuTimer timer, boolean fromCachingTask, DanmakuContext config) {
boolean filtered = needFilter(danmaku, index, totalsizeInScreen, timer, fromCachingTask);
if (filtered) {
danmaku.mFilterParam |= FILTER_TYPE_DUPLICATE_MERGE;
}
return filtered;
}
@Override
public void setData(Void data) {
}
@Override
public synchronized void reset() {
passedDanmakus.clear();
blockedDanmakus.clear();
currentDanmakus.clear();
}
@Override
public void clear() {
reset();
}
}
public static class MaximumLinesFilter extends BaseDanmakuFilter<Map<Integer, Integer>> {
private Map<Integer, Integer> mMaximumLinesPairs;
@Override
public boolean filter(BaseDanmaku danmaku, int lines, int totalsizeInScreen, DanmakuTimer timer, boolean willHit, DanmakuContext config) {
boolean filtered = false;
if (mMaximumLinesPairs != null) {
Integer maxLines = mMaximumLinesPairs.get(danmaku.getType());
filtered = (maxLines != null && lines >= maxLines);
if (filtered) {
danmaku.mFilterParam |= FILTER_TYPE_MAXIMUM_LINES;
}
}
return filtered;
}
@Override
public void setData(Map<Integer, Integer> data) {
mMaximumLinesPairs = data;
}
@Override
public void reset() {
mMaximumLinesPairs = null;
}
}
public static class OverlappingFilter extends BaseDanmakuFilter<Map<Integer, Boolean>> {
private Map<Integer, Boolean> mEnabledPairs;
@Override
public boolean filter(BaseDanmaku danmaku, int index, int totalsizeInScreen, DanmakuTimer timer, boolean willHit, DanmakuContext config) {
boolean filtered = false;
if (mEnabledPairs != null) {
Boolean enabledValue = mEnabledPairs.get(danmaku.getType());
filtered = enabledValue != null && enabledValue && willHit;
if (filtered) {
danmaku.mFilterParam |= FILTER_TYPE_OVERLAPPING;
}
}
return filtered;
}
@Override
public void setData(Map<Integer, Boolean> data) {
mEnabledPairs = data;
}
@Override
public void reset() {
mEnabledPairs = null;
}
}
public final static String TAG_TYPE_DANMAKU_FILTER = "1010_Filter";
public final static String TAG_QUANTITY_DANMAKU_FILTER = "1011_Filter";
public final static String TAG_ELAPSED_TIME_FILTER = "1012_Filter";
public final static String TAG_TEXT_COLOR_DANMAKU_FILTER = "1013_Filter";
public final static String TAG_USER_ID_FILTER = "1014_Filter";
public final static String TAG_USER_HASH_FILTER = "1015_Filter";
public final static String TAG_GUEST_FILTER = "1016_Filter";
public final static String TAG_DUPLICATE_FILTER = "1017_Filter";
public final static String TAG_MAXIMUN_LINES_FILTER = "1018_Filter";
public final static String TAG_OVERLAPPING_FILTER = "1019_Filter";
public final static String TAG_PRIMARY_CUSTOM_FILTER = "2000_Primary_Custom_Filter";
public final Exception filterException = new Exception("not suuport this filter tag");
public void filter(BaseDanmaku danmaku, int index, int totalsizeInScreen,
DanmakuTimer timer, boolean fromCachingTask, DanmakuContext context) {
for (IDanmakuFilter<?> f : mFilterArray) {
if (f != null) {
boolean filtered = f.filter(danmaku, index, totalsizeInScreen, timer, fromCachingTask, context);
danmaku.filterResetFlag = context.mGlobalFlagValues.FILTER_RESET_FLAG;
if (filtered) {
break;
}
}
}
}
public boolean filterSecondary(BaseDanmaku danmaku, int lines, int totalsizeInScreen,
DanmakuTimer timer, boolean willHit, DanmakuContext context) {
for (IDanmakuFilter<?> f : mFilterArraySecondary) {
if (f != null) {
boolean filtered = f.filter(danmaku, lines, totalsizeInScreen, timer, willHit, context);
danmaku.filterResetFlag = context.mGlobalFlagValues.FILTER_RESET_FLAG;
if (filtered) {
return true;
}
}
}
return false;
}
private final Map<String, IDanmakuFilter<?>> filters = Collections
.synchronizedSortedMap(new TreeMap<String, IDanmakuFilter<?>>());
private final Map<String, IDanmakuFilter<?>> filtersSecondary = Collections
.synchronizedSortedMap(new TreeMap<String, IDanmakuFilter<?>>());
IDanmakuFilter<?>[] mFilterArray = new IDanmakuFilter[0];
IDanmakuFilter<?>[] mFilterArraySecondary = new IDanmakuFilter[0];
public IDanmakuFilter<?> get(String tag) {
return get(tag, true);
}
public IDanmakuFilter<?> get(String tag, boolean primary) {
IDanmakuFilter<?> f = primary ? filters.get(tag) : filtersSecondary.get(tag);
if (f == null) {
f = registerFilter(tag, primary);
}
return f;
}
public IDanmakuFilter<?> registerFilter(String tag) {
return registerFilter(tag, true);
}
public IDanmakuFilter<?> registerFilter(String tag, boolean primary) {
if (tag == null) {
throwFilterException();
return null;
}
IDanmakuFilter<?> filter = filters.get(tag);
if (filter == null) {
if (TAG_TYPE_DANMAKU_FILTER.equals(tag)) {
filter = new TypeDanmakuFilter();
} else if (TAG_QUANTITY_DANMAKU_FILTER.equals(tag)) {
filter = new QuantityDanmakuFilter();
} else if (TAG_ELAPSED_TIME_FILTER.equals(tag)) {
filter = new ElapsedTimeFilter();
} else if (TAG_TEXT_COLOR_DANMAKU_FILTER.equals(tag)) {
filter = new TextColorFilter();
} else if (TAG_USER_ID_FILTER.equals(tag)) {
filter = new UserIdFilter();
} else if (TAG_USER_HASH_FILTER.equals(tag)) {
filter = new UserHashFilter();
} else if (TAG_GUEST_FILTER.equals(tag)) {
filter = new GuestFilter();
} else if (TAG_DUPLICATE_FILTER.equals(tag)) {
filter = new DuplicateMergingFilter();
} else if (TAG_MAXIMUN_LINES_FILTER.equals(tag)) {
filter = new MaximumLinesFilter();
} else if (TAG_OVERLAPPING_FILTER.equals(tag)) {
filter = new OverlappingFilter();
}
}
if (filter == null) {
throwFilterException();
return null;
}
filter.setData(null);
if (primary) {
filters.put(tag, filter);
mFilterArray = filters.values().toArray(mFilterArray);
} else {
filtersSecondary.put(tag, filter);
mFilterArraySecondary = filtersSecondary.values().toArray(mFilterArraySecondary);
}
return filter;
}
public void registerFilter(BaseDanmakuFilter filter) {
filters.put(TAG_PRIMARY_CUSTOM_FILTER + "_" + filter.hashCode(), filter);
mFilterArray = filters.values().toArray(mFilterArray);
}
public void unregisterFilter(String tag) {
unregisterFilter(tag, true);
}
public void unregisterFilter(String tag, boolean primary) {
IDanmakuFilter<?> f = primary ? filters.remove(tag) : filtersSecondary.remove(tag);
if (f != null) {
f.clear();
if (primary) {
mFilterArray = filters.values().toArray(mFilterArray);
} else {
mFilterArraySecondary = filtersSecondary.values().toArray(mFilterArraySecondary);
}
}
}
public void unregisterFilter(BaseDanmakuFilter filter) {
filters.remove(TAG_PRIMARY_CUSTOM_FILTER + "_" + filter.hashCode());
mFilterArray = filters.values().toArray(mFilterArray);
}
public void clear() {
for (IDanmakuFilter<?> f : mFilterArray) {
if (f != null)
f.clear();
}
for (IDanmakuFilter<?> f : mFilterArraySecondary) {
if (f != null)
f.clear();
}
}
public void reset() {
for (IDanmakuFilter<?> f : mFilterArray) {
if (f != null)
f.reset();
}
for (IDanmakuFilter<?> f : mFilterArraySecondary) {
if (f != null)
f.reset();
}
}
public void release() {
clear();
filters.clear();
mFilterArray = new IDanmakuFilter[0];
filtersSecondary.clear();
mFilterArraySecondary = new IDanmakuFilter[0];
}
private void throwFilterException() {
try {
throw filterException;
} catch (Exception e) {
}
}
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/DrawHandler.java
================================================
/*
* Copyright (C) 2013 Chen Hui <calmer91@gmail.com>
*
* 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.
*/
package master.flame.danmaku.controller;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Canvas;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.util.DisplayMetrics;
import android.view.Choreographer;
import java.util.LinkedList;
import master.flame.danmaku.danmaku.model.AbsDanmakuSync;
import master.flame.danmaku.danmaku.model.AbsDisplayer;
import master.flame.danmaku.danmaku.model.BaseDanmaku;
import master.flame.danmaku.danmaku.model.DanmakuTimer;
import master.flame.danmaku.danmaku.model.IDanmakus;
import master.flame.danmaku.danmaku.model.IDisplayer;
import master.flame.danmaku.danmaku.model.android.DanmakuContext;
import master.flame.danmaku.danmaku.parser.BaseDanmakuParser;
import master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState;
import master.flame.danmaku.danmaku.util.SystemClock;
import tv.cjump.jni.DeviceUtils;
public class DrawHandler extends Handler {
private DanmakuContext mContext;
private FrameCallback mFrameCallback;
public interface Callback {
public void prepared();
public void updateTimer(DanmakuTimer timer);
public void danmakuShown(BaseDanmaku danmaku);
public void drawingFinished();
}
public static final int START = 1;
public static final int UPDATE = 2;
public static final int RESUME = 3;
public static final int SEEK_POS = 4;
public static final int PREPARE = 5;
private static final int QUIT = 6;
private static final int PAUSE = 7;
private static final int SHOW_DANMAKUS = 8;
private static final int HIDE_DANMAKUS = 9;
private static final int NOTIFY_DISP_SIZE_CHANGED = 10;
private static final int NOTIFY_RENDERING = 11;
private static final int UPDATE_WHEN_PAUSED = 12;
private static final int CLEAR_DANMAKUS_ON_SCREEN = 13;
private static final int FORCE_RENDER = 14;
private static final long INDEFINITE_TIME = 10000000;
private long pausedPosition = 0;
private boolean quitFlag = true;
private long mTimeBase;
private boolean mReady;
private Callback mCallback;
private DanmakuTimer timer = new DanmakuTimer();
private BaseDanmakuParser mParser;
public IDrawTask drawTask;
private IDanmakuViewController mDanmakuView;
private boolean mDanmakusVisible = true;
private AbsDisplayer mDisp;
private final RenderingState mRenderingState = new RenderingState();
private static final int MAX_RECORD_SIZE = 500;
private LinkedList<Long> mDrawTimes = new LinkedList<>();
private UpdateThread mThread;
private boolean mUpdateInSeparateThread;
private long mCordonTime = 30;
private long mCordonTime2 = 60;
private long mFrameUpdateRate = 16;
@SuppressWarnings("unused")
private long mThresholdTime;
private long mLastDeltaTime;
private boolean mInSeekingAction;
private long mDesireSeekingTime;
private long mRemainingTime;
private boolean mInSyncAction;
private boolean mInWaitingState;
private boolean mIdleSleep;
private boolean mNonBlockModeEnable;
public DrawHandler(Looper looper, IDanmakuViewController view, boolean danmakuVisibile) {
super(looper);
mIdleSleep = !DeviceUtils.isProblemBoxDevice();
bindView(view);
if (danmakuVisibile) {
showDanmakus(null);
} else {
hideDanmakus(false);
}
mDanmakusVisible = danmakuVisibile;
}
private void bindView(IDanmakuViewController view) {
this.mDanmakuView = view;
}
public void setIdleSleep(boolean enable) {
mIdleSleep = enable;
}
public void enableNonBlockMode(boolean enable) {
mNonBlockModeEnable = enable;
}
public void setConfig(DanmakuContext config) {
mContext = config;
}
public void setParser(BaseDanmakuParser parser) {
mParser = parser;
DanmakuTimer timer = parser.getTimer();
if (timer != null) {
this.timer = timer;
}
}
public void setCallback(Callback cb) {
mCallback = cb;
}
public void quit() {
quitFlag = true;
sendEmptyMessage(QUIT);
}
public boolean isStop() {
return quitFlag;
}
@Override
public void handleMessage(Message msg) {
int what = msg.what;
switch (what) {
case PREPARE:
mTimeBase = SystemClock.uptimeMillis();
if (mParser == null || !mDanmakuView.isViewReady()) {
sendEmptyMessageDelayed(PREPARE, 100);
} else {
prepare(new Runnable() {
@Override
public void run() {
pausedPosition = 0;
mReady = true;
if (mCallback != null) {
mCallback.prepared();
}
}
});
}
break;
case SHOW_DANMAKUS:
mDanmakusVisible = true;
Long start = (Long) msg.obj;
boolean resume = false;
if (drawTask != null) {
if (start == null) {
timer.update(getCurrentTime());
drawTask.requestClear();
} else {
drawTask.start();
drawTask.seek(start);
drawTask.requestClear();
resume = true;
}
}
if (quitFlag && mDanmakuView != null) {
mDanmakuView.drawDanmakus();
}
notifyRendering();
if (!resume) {
break;
}
case START:
Long startTime = (Long) msg.obj;
if (startTime != null) {
pausedPosition = startTime;
} else {
pausedPosition = 0;
}
case SEEK_POS:
if (what == SEEK_POS) {
quitFlag = true;
quitUpdateThread();
Long position = (Long) msg.obj;
long deltaMs = position - timer.currMillisecond;
mTimeBase -= deltaMs;
timer.update(position);
mContext.mGlobalFlagValues.updateMeasureFlag();
if (drawTask != null)
drawTask.seek(position);
pausedPosition = position;
}
case RESUME:
removeMessages(DrawHandler.PAUSE);
quitFlag = false;
if (mReady) {
mRenderingState.reset();
mDrawTimes.clear();
mTimeBase = SystemClock.uptimeMillis() - pausedPosition;
timer.update(pausedPosition);
removeMessages(RESUME);
sendEmptyMessage(UPDATE);
drawTask.start();
notifyRendering();
mInSeekingAction = false;
if (drawTask != null) {
drawTask.onPlayStateChanged(IDrawTask.PLAY_STATE_PLAYING);
}
} else {
sendEmptyMessageDelayed(RESUME, 100);
}
break;
case UPDATE:
if (mContext.updateMethod == 0) {
updateInChoreographer();
} else if (mContext.updateMethod == 1) {
updateInNewThread();
} else if (mContext.updateMethod == 2) {
updateInCurrentThread();
}
break;
case NOTIFY_DISP_SIZE_CHANGED:
mContext.mDanmakuFactory.notifyDispSizeChanged(mContext);
Boolean updateFlag = (Boolean) msg.obj;
if (updateFlag != null && updateFlag) {
mContext.mGlobalFlagValues.updateMeasureFlag();
mContext.mGlobalFlagValues.updateVisibleFlag();
drawTask.requestClearRetainer();
}
break;
case HIDE_DANMAKUS:
mDanmakusVisible = false;
if (mDanmakuView != null) {
mDanmakuView.clear();
}
if(this.drawTask != null) {
this.drawTask.requestClear();
this.drawTask.requestHide();
}
Boolean quitDrawTask = (Boolean) msg.obj;
if (quitDrawTask && this.drawTask != null) {
this.drawTask.quit();
}
if (!quitDrawTask) {
break;
}
case PAUSE:
removeMessages(DrawHandler.RESUME);
removeMessages(UPDATE);
if (drawTask != null) {
drawTask.onPlayStateChanged(IDrawTask.PLAY_STATE_PAUSE);
}
case QUIT:
if (what == QUIT) {
removeCallbacksAndMessages(null);
}
quitFlag = true;
syncTimerIfNeeded();
pausedPosition = timer.currMillisecond;
if (mUpdateInSeparateThread) {
notifyRendering();
quitUpdateThread();
}
if (mFrameCallback != null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
Choreographer.getInstance().removeFrameCallback(mFrameCallback);
}
}
if (what == QUIT){
if (this.drawTask != null){
this.drawTask.quit();
}
if (mParser != null) {
mParser.release();
}
if (this.getLooper() != Looper.getMainLooper())
this.getLooper().quit();
}
break;
case NOTIFY_RENDERING:
notifyRendering();
break;
case UPDATE_WHEN_PAUSED:
if (quitFlag && mDanmakuView != null) {
drawTask.requestClear();
mDanmakuView.drawDanmakus();
notifyRendering();
}
break;
case CLEAR_DANMAKUS_ON_SCREEN:
if (drawTask != null) {
drawTask.clearDanmakusOnScreen(getCurrentTime());
}
break;
case FORCE_RENDER:
if (drawTask != null) {
drawTask.requestRender();
}
break;
}
}
private synchronized void quitUpdateThread() {
UpdateThread thread = mThread;
mThread = null;
if (thread != null) {
synchronized (drawTask) {
drawTask.notifyAll();
}
thread.quit();
try {
thread.join(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
private void updateInCurrentThread() {
if (quitFlag) {
return;
}
long startMS = SystemClock.uptimeMillis();
long d = syncTimer(startMS);
if (d < 0 && !mNonBlockModeEnable) {
removeMessages(UPDATE);
sendEmptyMessageDelayed(UPDATE, 60 - d);
return;
}
d = mDanmakuView.drawDanmakus();
removeMessages(UPDATE);
if (d > mCordonTime2) { // this situation may be cuased by ui-thread waiting of DanmakuView, so we sync-timer at once
timer.add(d);
mDrawTimes.clear();
}
if (!mDanmakusVisible) {
waitRendering(INDEFINITE_TIME);
return;
} else if (mRenderingState.nothingRendered && mIdleSleep) {
long dTime = mRenderingState.endTime - timer.currMillisecond;
if (dTime > 500) {
waitRendering(dTime - 10);
return;
}
}
if (d < mFrameUpdateRate) {
sendEmptyMessageDelayed(UPDATE, mFrameUpdateRate - d);
return;
}
sendEmptyMessage(UPDATE);
}
private void updateInNewThread() {
if (mThread != null) {
return;
}
mThread = new UpdateThread("DFM Update") {
@Override
public void run() {
long lastTime = SystemClock.uptimeMillis();
long dTime = 0;
while (!isQuited() && !quitFlag) {
long startMS = SystemClock.uptimeMillis();
dTime = SystemClock.uptimeMillis() - lastTime;
long diffTime = mFrameUpdateRate - dTime;
if (diffTime > 1 && !mNonBlockModeEnable) {
SystemClock.sleep(1);
continue;
}
lastTime = startMS;
long d = syncTimer(startMS);
if (d < 0 && !mNonBlockModeEnable) {
SystemClock.sleep(60 - d);
continue;
}
d = mDanmakuView.drawDanmakus();
if (d > mCordonTime2) { // this situation may be cuased by ui-thread waiting of DanmakuView, so we sync-timer at once
timer.add(d);
mDrawTimes.clear();
}
if (!mDanmakusVisible) {
waitRendering(INDEFINITE_TIME);
} else if (mRenderingState.nothingRendered && mIdleSleep) {
dTime = mRenderingState.endTime - timer.currMillisecond;
if (dTime > 500) {
notifyRendering();
waitRendering(dTime - 10);
}
}
}
}
};
mThread.start();
}
@TargetApi(16)
private class FrameCallback implements Choreographer.FrameCallback {
@Override
public void doFrame(long frameTimeNanos) {
sendEmptyMessage(UPDATE);
}
};
@TargetApi(16)
private void updateInChoreographer() {
if (quitFlag) {
return;
}
Choreographer.getInstance().postFrameCallback(mFrameCallback);
long startMS = SystemClock.uptimeMillis();
long d = syncTimer(startMS);
if (d < 0) {
removeMessages(UPDATE);
return;
}
d = mDanmakuView.drawDanmakus();
removeMessages(UPDATE);
if (d > mCordonTime2) { // this situation may be cuased by ui-thread waiting of DanmakuView, so we sync-timer at once
timer.add(d);
mDrawTimes.clear();
}
if (!mDanmakusVisible) {
waitRendering(INDEFINITE_TIME);
return;
} else if (mRenderingState.nothingRendered && mIdleSleep) {
long dTime = mRenderingState.endTime - timer.currMillisecond;
if (dTime > 500) {
waitRendering(dTime - 10);
return;
}
}
}
private final long syncTimer(long startMS) {
if (mInSeekingAction || mInSyncAction) {
return 0;
}
mInSyncAction = true;
long d = 0;
long time = startMS - mTimeBase;
if (mNonBlockModeEnable) {
if (mCallback != null) {
mCallback.updateTimer(timer);
d = timer.lastInterval();
}
} else if (!mDanmakusVisible || mRenderingState.nothingRendered || mInWaitingState) {
timer.update(time);
mRemainingTime = 0;
if (mCallback != null) {
mCallback.updateTimer(timer);
}
} else {
long gapTime = time - timer.currMillisecond;
long averageTime = Math.max(mFrameUpdateRate, getAverageRenderingTime());
if (gapTime > 2000 || mRenderingState.consumingTime > mCordonTime || averageTime > mCordonTime) {
d = gapTime;
gapTime = 0;
} else {
d = averageTime + gapTime / mFrameUpdateRate;
d = Math.max(mFrameUpdateRate, d);
d = Math.min(mCordonTime, d);
long a = d - mLastDeltaTime;
if (a > 3 && a < 8 && mLastDeltaTime >= mFrameUpdateRate && mLastDeltaTime <= mCordonTime) {
d = mLastDeltaTime;
}
gapTime -= d;
mLastDeltaTime = d;
}
mRemainingTime = gapTime;
timer.add(d);
if (mCallback != null) {
mCallback.updateTimer(timer);
}
// Log.e("DrawHandler", time+"|d:" + d + "RemaingTime:" + mRemainingTime + ",gapTime:" + gapTime + ",rtim:" + mRenderingState.consumingTime + ",average:" + averageTime);
}
mInSyncAction = false;
return d;
}
private void syncTimerIfNeeded() {
if (mInWaitingState) {
syncTimer(SystemClock.uptimeMillis());
}
}
private void initRenderingConfigs() {
long averageFrameConsumingTime = 16;
mCordonTime = Math.max(33, (long) (averageFrameConsumingTime * 2.5f));
mCordonTime2 = (long) (mCordonTime * 2.5f);
mFrameUpdateRate = Math.max(16, averageFrameConsumingTime / 15 * 15);
mThresholdTime = mFrameUpdateRate + 3;
// Log.i("DrawHandler", "initRenderingConfigs test-fps:" + averageFrameConsumingTime + "ms,mCordonTime:"
// + mCordonTime + ",mFrameRefreshingRate:" + mFrameUpdateRate);
}
private void prepare(final Runnable runnable) {
if (drawTask == null) {
drawTask = createDrawTask(mDanmakuView.isDanmakuDrawingCacheEnabled(), timer,
mDanmakuView.getContext(), mDanmakuView.getViewWidth(), mDanmakuView.getViewHeight(),
mDanmakuView.isHardwareAccelerated(), new IDrawTask.TaskListener() {
@Override
public void ready() {
initRenderingConfigs();
runnable.run();
}
@Override
public void onDanmakuAdd(BaseDanmaku danmaku) {
if (danmaku.isTimeOut()) {
return;
}
long delay = danmaku.getActualTime() - getCurrentTime();
if (delay < mContext.mDanmakuFactory.MAX_DANMAKU_DURATION && (mInWaitingState || mRenderingState.nothingRendered)) {
notifyRendering();
} else if (delay > 0 && delay <= mContext.mDanmakuFactory.MAX_DANMAKU_DURATION) {
sendEmptyMessageDelayed(NOTIFY_RENDERING, delay);
}
}
@Override
public void onDanmakuShown(BaseDanmaku danmaku) {
if (mCallback != null) {
mCallback.danmakuShown(danmaku);
}
}
@Override
public void onDanmakusDrawingFinished() {
if (mCallback != null) {
mCallback.drawingFinished();
}
}
@Override
public void onDanmakuConfigChanged() {
redrawIfNeeded();
}
});
} else {
runnable.run();
}
}
public boolean isPrepared() {
return mReady;
}
private IDrawTask createDrawTask(boolean useDrwaingCache, DanmakuTimer timer,
Context context,
int width, int height,
boolean isHardwareAccelerated,
IDrawTask.TaskListener taskListener) {
mDisp = mContext.getDisplayer();
mDisp.setSize(width, height);
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
mDisp.setDensities(displayMetrics.density, displayMetrics.densityDpi,
displayMetrics.scaledDensity);
mDisp.resetSlopPixel(mContext.scaleTextSize);
mDisp.setHardwareAccelerated(isHardwareAccelerated);
IDrawTask task = useDrwaingCache ?
new CacheManagingDrawTask(timer, mContext, taskListener)
: new DrawTask(timer, mContext, taskListener);
task.setParser(mParser);
task.prepare();
obtainMessage(NOTIFY_DISP_SIZE_CHANGED, false).sendToTarget();
return task;
}
public void seekTo(Long ms) {
mInSeekingAction = true;
mDesireSeekingTime = ms;
removeMessages(DrawHandler.UPDATE);
removeMessages(DrawHandler.RESUME);
removeMessages(DrawHandler.SEEK_POS);
obtainMessage(DrawHandler.SEEK_POS, ms).sendToTarget();
}
public void addDanmaku(BaseDanmaku item) {
if (drawTask != null) {
item.flags = mContext.mGlobalFlagValues;
item.setTimer(timer);
drawTask.addDanmaku(item);
obtainMessage(NOTIFY_RENDERING).sendToTarget();
}
}
public void invalidateDanmaku(BaseDanmaku item, boolean remeasure) {
if (drawTask != null && item != null) {
drawTask.invalidateDanmaku(item, remeasure);
}
redrawIfNeeded();
}
public void resume() {
removeMessages(DrawHandler.PAUSE);
sendEmptyMessage(DrawHandler.RESUME);
}
public void prepare() {
mReady = false;
if (Build.VERSION.SDK_INT < 16 && mContext.updateMethod == 0) {
mContext.updateMethod = 2;
}
if (mContext.updateMethod == 0) {
mFrameCallback = new FrameCallback();
}
mUpdateInSeparateThread = (mContext.updateMethod == 1);
sendEmptyMessage(DrawHandler.PREPARE);
}
public void pause() {
removeMessages(DrawHandler.RESUME);
syncTimerIfNeeded();
sendEmptyMessage(DrawHandler.PAUSE);
}
public void showDanmakus(Long position) {
if (mDanmakusVisible)
return;
mDanmakusVisible = true;
removeMessages(SHOW_DANMAKUS);
removeMessages(HIDE_DANMAKUS);
obtainMessage(SHOW_DANMAKUS, position).sendToTarget();
}
public long hideDanmakus(boolean quitDrawTask) {
if (!mDanmakusVisible)
return timer.currMillisecond;
mDanmakusVisible = false;
removeMessages(SHOW_DANMAKUS);
removeMessages(HIDE_DANMAKUS);
obtainMessage(HIDE_DANMAKUS, quitDrawTask).sendToTarget();
return timer.currMillisecond;
}
public void forceRender() {
removeMessages(FORCE_RENDER);
obtainMessage(FORCE_RENDER).sendToTarget();
}
public boolean getVisibility() {
return mDanmakusVisible;
}
public RenderingState draw(Canvas canvas) {
if (drawTask == null)
return mRenderingState;
if (!mInWaitingState) {
AbsDanmakuSync danmakuSync = mContext.danmakuSync;
if (danmakuSync != null) {
do {
boolean isSyncPlayingState = danmakuSync.isSyncPlayingState();
if (!isSyncPlayingState && quitFlag) {
break;
}
int syncState = danmakuSync.getSyncState();
if (syncState == AbsDanmakuSync.SYNC_STATE_PLAYING) {
long fromTime = timer.currMillisecond;
long toTime = danmakuSync.getUptimeMillis();
long offset = toTime - fromTime;
if (Math.abs(offset) > danmakuSync.getThresholdTimeMills()) {
if (isSyncPlayingState && quitFlag) {
resume();
}
drawTask.requestSync(fromTime, toTime, offset);
timer.update(toTime);
mTimeBase -= offset;
mRemainingTime = 0;
}
} else if (syncState == AbsDanmakuSync.SYNC_STATE_HALT) {
if (isSyncPlayingState && !quitFlag) {
pause();
}
}
} while (false);
}
}
mDisp.setExtraData(canvas);
mRenderingState.set(drawTask.draw(mDisp));
recordRenderingTime();
return mRenderingState;
}
private void redrawIfNeeded() {
if (quitFlag && mDanmakusVisible) {
removeMessages(UPDATE_WHEN_PAUSED);
sendEmptyMessageDelayed(UPDATE_WHEN_PAUSED, 100);
}
}
private void notifyRendering() {
if (!mInWaitingState) {
return;
}
if(drawTask != null) {
drawTask.requestClear();
}
if (mUpdateInSeparateThread) {
synchronized (this) {
mDrawTimes.clear();
}
synchronized (drawTask) {
drawTask.notifyAll();
}
} else {
mDrawTimes.clear();
removeMessages(UPDATE);
sendEmptyMessage(UPDATE);
}
mInWaitingState = false;
}
private void waitRendering(long dTime) {
if (isStop() || !isPrepared() || mInSeekingAction) {
return;
}
mRenderingState.sysTime = SystemClock.uptimeMillis();
mInWaitingState = true;
if (mUpdateInSeparateThread) {
if (mThread == null) {
return;
}
try {
synchronized (drawTask) {
if (dTime == INDEFINITE_TIME) {
drawTask.wait();
} else {
drawTask.wait(dTime);
}
sendEmptyMessage(NOTIFY_RENDERING);
}
} catch (InterruptedException e) {
e.printStackTrace();
}
} else {
if (dTime == INDEFINITE_TIME) {
removeMessages(NOTIFY_RENDERING);
removeMessages(UPDATE);
} else {
removeMessages(NOTIFY_RENDERING);
removeMessages(UPDATE);
sendEmptyMessageDelayed(NOTIFY_RENDERING, dTime);
}
}
}
private synchronized long getAverageRenderingTime() {
int frames = mDrawTimes.size();
if(frames <= 0)
return 0;
Long first = mDrawTimes.peekFirst();
Long last = mDrawTimes.peekLast();
if (first == null || last == null) {
return 0;
}
long dtime = last - first;
return dtime / frames;
}
private synchronized void recordRenderingTime() {
long lastTime = SystemClock.uptimeMillis();
mDrawTimes.addLast(lastTime);
int frames = mDrawTimes.size();
if (frames > MAX_RECORD_SIZE) {
mDrawTimes.removeFirst();
frames = MAX_RECORD_SIZE;
}
}
public IDisplayer getDisplayer(){
return mDisp;
}
public void notifyDispSizeChanged(int width, int height) {
if (mDisp == null) {
return;
}
if (mDisp.getWidth() != width || mDisp.getHeight() != height) {
mDisp.setSize(width, height);
obtainMessage(NOTIFY_DISP_SIZE_CHANGED, true).sendToTarget();
}
}
public void removeAllDanmakus(boolean isClearDanmakusOnScreen) {
if (drawTask != null) {
drawTask.removeAllDanmakus(isClearDanmakusOnScreen);
}
}
public void removeAllLiveDanmakus() {
if (drawTask != null) {
drawTask.removeAllLiveDanmakus();
}
}
public IDanmakus getCurrentVisibleDanmakus() {
if (drawTask != null) {
return drawTask.getVisibleDanmakusOnTime(getCurrentTime());
}
return null;
}
public long getCurrentTime() {
if (!mReady) {
return 0;
}
if (mInSeekingAction) {
return mDesireSeekingTime;
}
if (quitFlag || !mInWaitingState) {
return timer.currMillisecond - mRemainingTime;
}
return SystemClock.uptimeMillis() - mTimeBase;
}
public void clearDanmakusOnScreen() {
obtainMessage(CLEAR_DANMAKUS_ON_SCREEN).sendToTarget();
}
public DanmakuContext getConfig() {
return mContext;
}
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/DrawHelper.java
================================================
/*
* Copyright (C) 2013 Chen Hui <calmer91@gmail.com>
*
* 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.
*/
package master.flame.danmaku.controller;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.RectF;
public class DrawHelper {
public static Paint PAINT, PAINT_FPS;
public static RectF RECT;
private static boolean USE_DRAWCOLOR_TO_CLEAR_CANVAS = true;
private static boolean USE_DRAWCOLOR_MODE_CLEAR = true;
static {
PAINT = new Paint();
PAINT.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
PAINT.setColor(Color.TRANSPARENT);
RECT = new RectF();
}
public static void useDrawColorToClearCanvas(boolean use, boolean useClearMode) {
USE_DRAWCOLOR_TO_CLEAR_CANVAS = use;
USE_DRAWCOLOR_MODE_CLEAR = useClearMode;
}
public static void drawFPS(Canvas canvas, String text) {
if (PAINT_FPS == null) {
PAINT_FPS = new Paint();
PAINT_FPS.setColor(Color.RED);
PAINT_FPS.setTextSize(30);
}
int top = canvas.getHeight() - 50;
clearCanvas(canvas, 10, top - 50, (int) (PAINT_FPS.measureText(text) + 20), canvas.getHeight());
canvas.drawText(text, 10, top, PAINT_FPS);
}
public static void clearCanvas(Canvas canvas) {
if (USE_DRAWCOLOR_TO_CLEAR_CANVAS) {
if(USE_DRAWCOLOR_MODE_CLEAR) {
canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);
} else {
canvas.drawColor(Color.TRANSPARENT);
}
} else {
RECT.set(0, 0, canvas.getWidth(), canvas.getHeight());
clearCanvas(canvas, RECT);
}
}
public static void fillTransparent(Canvas canvas){
canvas.drawColor(0x00000000, PorterDuff.Mode.CLEAR);
}
public static void clearCanvas(Canvas canvas, float left, float top, float right, float bottom) {
RECT.set(left, top, right, bottom);
clearCanvas(canvas, RECT);
}
private static void clearCanvas(Canvas canvas, RectF rect) {
if (rect.width() <= 0 || rect.height() <= 0) {
return;
}
canvas.drawRect(rect, PAINT);
}
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/DrawTask.java
================================================
/*
* Copyright (C) 2013 Chen Hui <calmer91@gmail.com>
*
* 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.
*/
package master.flame.danmaku.controller;
import android.graphics.Canvas;
import master.flame.danmaku.danmaku.model.AbsDisplayer;
import master.flame.danmaku.danmaku.model.BaseDanmaku;
import master.flame.danmaku.danmaku.model.DanmakuTimer;
import master.flame.danmaku.danmaku.model.IDanmakus;
import master.flame.danmaku.danmaku.model.android.DanmakuContext;
import master.flame.danmaku.danmaku.model.android.DanmakuContext.ConfigChangedCallback;
import master.flame.danmaku.danmaku.model.android.DanmakuContext.DanmakuConfigTag;
import master.flame.danmaku.danmaku.model.android.Danmakus;
import master.flame.danmaku.danmaku.parser.BaseDanmakuParser;
import master.flame.danmaku.danmaku.renderer.IRenderer;
import master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState;
import master.flame.danmaku.danmaku.renderer.android.DanmakuRenderer;
import master.flame.danmaku.danmaku.util.SystemClock;
public class DrawTask implements IDrawTask {
protected final DanmakuContext mContext;
protected final AbsDisplayer mDisp;
protected IDanmakus danmakuList;
protected BaseDanmakuParser mParser;
TaskListener mTaskListener;
final IRenderer mRenderer;
DanmakuTimer mTimer;
private IDanmakus danmakus = new Danmakus(Danmakus.ST_BY_LIST);
protected boolean clearRetainerFlag;
private long mStartRenderTime = 0;
private final RenderingState mRenderingState = new RenderingState();
protected boolean mReadyState;
private long mLastBeginMills;
private long mLastEndMills;
protected int mPlayState;
private boolean mIsHidden;
private BaseDanmaku mLastDanmaku;
private Danmakus mLiveDanmakus = new Danmakus(Danmakus.ST_BY_LIST);
private IDanmakus mRunningDanmakus;
private boolean mRequestRender;
private ConfigChangedCallback mConfigChangedCallback = new ConfigChangedCallback() {
@Override
public boolean onDanmakuConfigChanged(DanmakuContext config, DanmakuConfigTag tag, Object... values) {
return DrawTask.this.onDanmakuConfigChanged(config, tag, values);
}
};
public DrawTask(DanmakuTimer timer, DanmakuContext context,
TaskListener taskListener) {
if (context == null) {
throw new IllegalArgumentException("context is null");
}
mContext = context;
mDisp = context.getDisplayer();
mTaskListener = taskListener;
mRenderer = new DanmakuRenderer(context);
mRenderer.setOnDanmakuShownListener(new IRenderer.OnDanmakuShownListener() {
@Override
public void onDanmakuShown(BaseDanmaku danmaku) {
if (mTaskListener != null) {
mTaskListener.onDanmakuShown(danmaku);
}
}
});
mRenderer.setVerifierEnabled(mContext.isPreventOverlappingEnabled() || mContext.isMaxLinesLimited());
initTimer(timer);
Boolean enable = mContext.isDuplicateMergingEnabled();
if (enable != null) {
if(enable) {
mContext.mDanmakuFilters.registerFilter(DanmakuFilters.TAG_DUPLICATE_FILTER);
} else {
mContext.mDanmakuFilters.unregisterFilter(DanmakuFilters.TAG_DUPLICATE_FILTER);
}
}
}
protected void initTimer(DanmakuTimer timer) {
mTimer = timer;
}
@Override
public synchronized void addDanmaku(BaseDanmaku item) {
if (danmakuList == null)
return;
if (item.isLive) {
mLiveDanmakus.addItem(item);
removeUnusedLiveDanmakusIn(10);
}
item.index = danmakuList.size();
boolean subAdded = true;
if (mLastBeginMills <= item.getActualTime() && item.getActualTime() <= mLastEndMills) {
synchronized (danmakus) {
subAdded = danmakus.addItem(item);
}
} else if (item.isLive) {
subAdded = false;
}
boolean added = false;
synchronized (danmakuList) {
added = danmakuList.addItem(item);
}
if (!subAdded || !added) {
mLastBeginMills = mLastEndMills = 0;
}
if (added && mTaskListener != null) {
mTaskListener.onDanmakuAdd(item);
}
if (mLastDanmaku == null || (item != null && mLastDanmaku != null && item.getActualTime() > mLastDanmaku.getActualTime())) {
mLastDanmaku = item;
}
}
@Override
public void invalidateDanmaku(BaseDanmaku item, boolean remeasure) {
mContext.getDisplayer().getCacheStuffer().clearCache(item);
item.requestFlags |= BaseDanmaku.FLAG_REQUEST_INVALIDATE;
if (remeasure) {
item.paintWidth = -1;
item.paintHeight = -1;
item.requestFlags |= BaseDanmaku.FLAG_REQUEST_REMEASURE;
item.measureResetFlag++;
}
}
@Override
public synchronized void removeAllDanmakus(boolean isClearDanmakusOnScreen) {
if (danmakuList == null || danmakuList.isEmpty())
return;
synchronized (danmakuList) {
if (!isClearDanmakusOnScreen) {
long beginMills = mTimer.currMillisecond - mContext.mDanmakuFactory.MAX_DANMAKU_DURATION - 100;
long endMills = mTimer.currMillisecond + mContext.mDanmakuFactory.MAX_DANMAKU_DURATION;
IDanmakus tempDanmakus = danmakuList.subnew(beginMills, endMills);
if (tempDanmakus != null)
danmakus = tempDanmakus;
}
danmakuList.clear();
}
}
protected void onDanmakuRemoved(BaseDanmaku danmaku) {
// override by CacheManagingDrawTask
}
@Override
public synchronized void removeAllLiveDanmakus() {
if (danmakus == null || danmakus.isEmpty())
return;
synchronized (danmakus) {
danmakus.forEachSync(new IDanmakus.DefaultConsumer<BaseDanmaku>() {
@Override
public int accept(BaseDanmaku danmaku) {
if (danmaku.isLive) {
onDanmakuRemoved(danmaku);
return ACTION_REMOVE;
}
return ACTION_CONTINUE;
}
});
}
}
protected synchronized void removeUnusedLiveDanmakusIn(final int msec) {
if (danmakuList == null || danmakuList.isEmpty() || mLiveDanmakus.isEmpty())
return;
mLiveDanmakus.forEachSync(new IDanmakus.DefaultConsumer<BaseDanmaku>() {
long startTime = SystemClock.uptimeMillis();
@Override
public int accept(BaseDanmaku danmaku) {
boolean isTimeout = danmaku.isTimeOut();
if (SystemClock.uptimeMillis() - startTime > msec) {
return ACTION_BREAK;
}
if (isTimeout) {
danmakuList.removeItem(danmaku);
onDanmakuRemoved(danmaku);
return ACTION_REMOVE;
} else {
return ACTION_BREAK;
}
}
});
}
@Override
public IDanmakus getVisibleDanmakusOnTime(long time) {
long beginMills = time - mContext.mDanmakuFactory.MAX_DANMAKU_DURATION - 100;
long endMills = time + mContext.mDanmakuFactory.MAX_DANMAKU_DURATION;
IDanmakus subDanmakus = null;
int i = 0;
while (i++ < 3) { //avoid ConcurrentModificationException
try {
subDanmakus = danmakuList.subnew(beginMills, endMills);
break;
} catch (Exception e) {
}
}
final IDanmakus visibleDanmakus = new Danmakus();
if (null != subDanmakus && !subDanmakus.isEmpty()) {
subDanmakus.forEachSync(new IDanmakus.DefaultConsumer<BaseDanmaku>() {
@Override
public int accept(BaseDanmaku danmaku) {
if (danmaku.isShown() && !danmaku.isOutside()) {
visibleDanmakus.addItem(danmaku);
}
return ACTION_CONTINUE;
}
});
}
return visibleDanmakus;
}
@Override
public synchronized RenderingState draw(AbsDisplayer displayer) {
return drawDanmakus(displayer,mTimer);
}
@Override
public void reset() {
if (danmakus != null)
danmakus = new Danmakus();
if (mRenderer != null)
mRenderer.clear();
}
@Override
public void seek(long mills) {
reset();
mContext.mGlobalFlagValues.updateVisibleFlag();
mContext.mGlobalFlagValues.updateFirstShownFlag();
mContext.mGlobalFlagValues.updateSyncOffsetTimeFlag();
mContext.mGlobalFlagValues.updatePrepareFlag();
mRunningDanmakus = new Danmakus(Danmakus.ST_BY_LIST);
mStartRenderTime = mills < 1000 ? 0 : mills;
mRenderingState.reset();
mRenderingState.endTime = mStartRenderTime;
mLastBeginMills = mLastEndMills = 0;
if (danmakuList != null) {
BaseDanmaku last = danmakuList.last();
if (last != null && !last.isTimeOut()) {
mLastDanmaku = last;
}
}
}
@Override
public void clearDanmakusOnScreen(long currMillis) {
reset();
mContext.mGlobalFlagValues.updateVisibleFlag();
mContext.mGlobalFlagValues.updateFirstShownFlag();
mStartRenderTime = currMillis;
}
@Override
public void start() {
mContext.registerConfigChangedCallback(mConfigChangedCallback);
}
@Override
public void quit() {
mContext.unregisterAllConfigChangedCallbacks();
if (mRenderer != null)
mRenderer.release();
}
public void prepare() {
if (mParser == null) {
return;
}
loadDanmakus(mParser);
mLastBeginMills = mLastEndMills = 0;
if (mTaskListener != null) {
mTaskListener.ready();
mReadyState = true;
}
}
@Override
public void onPlayStateChanged(int state) {
mPlayState = state;
}
protected void loadDanmakus(BaseDanmakuParser parser) {
danmakuList = parser.setConfig(mContext).setDisplayer(mDisp).setTimer(mTimer).setListener(new BaseDanmakuParser.Listener() {
@Override
public void onDanmakuAdd(BaseDanmaku danmaku) {
if (mTaskListener != null) {
mTaskListener.onDanmakuAdd(danmaku);
}
}
}).getDanmakus();
mContext.mGlobalFlagValues.resetAll();
if(danmakuList != null) {
mLastDanmaku = danmakuList.last();
}
}
public void setParser(BaseDanmakuParser parser) {
mParser = parser;
mReadyState = false;
}
protected RenderingState drawDanmakus(AbsDisplayer disp, DanmakuTimer timer) {
if (clearRetainerFlag) {
mRenderer.clearRetainer();
clearRetainerFlag = false;
}
if (danmakuList != null) {
Canvas canvas = (Canvas) disp.getExtraData();
DrawHelper.clearCanvas(canvas);
if (mIsHidden && !mRequestRender) {
return mRenderingState;
}
mRequestRender = false;
RenderingState renderingState = mRenderingState;
// prepare screenDanmakus
long beginMills = timer.currMillisecond - mContext.mDanmakuFactory.MAX_DANMAKU_DURATION - 100;
long endMills = timer.currMillisecond + mContext.mDanmakuFactory.MAX_DANMAKU_DURATION;
IDanmakus screenDanmakus = danmakus;
if(mLastBeginMills > beginMills || timer.currMillisecond > mLastEndMills) {
screenDanmakus = danmakuList.sub(beginMills, endMills);
if (screenDanmakus != null) {
danmakus = screenDanmakus;
}
mLastBeginMills = beginMills;
mLastEndMills = endMills;
} else {
beginMills = mLastBeginMills;
endMills = mLastEndMills;
}
// prepare runningDanmakus to draw (in sync-mode)
IDanmakus runningDanmakus = mRunningDanmakus;
beginTracing(renderingState, runningDanmakus, screenDanmakus);
if (runningDanmakus != null && !runningDanmakus.isEmpty()) {
mRenderingState.isRunningDanmakus = true;
mRenderer.draw(disp, runningDanmakus, 0, mRenderingState);
}
// draw screenDanmakus
mRenderingState.isRunningDanmakus = false;
if (screenDanmakus != null && !screenDanmakus.isEmpty()) {
mRenderer.draw(mDisp, screenDanmakus, mStartRenderTime, renderingState);
endTracing(renderingState);
if (renderingState.nothingRendered) {
if(mLastDanmaku != null && mLastDanmaku.isTimeOut()) {
mLastDanmaku = null;
if (mTaskListener != null) {
mTaskListener.onDanmakusDrawingFinished();
}
}
if (renderingState.beginTime == RenderingState.UNKNOWN_TIME) {
renderingState.beginTime = beginMills;
}
if (renderingState.endTime == RenderingState.UNKNOWN_TIME) {
renderingState.endTime = endMills;
}
}
return renderingState;
} else {
renderingState.nothingRendered = true;
renderingState.beginTime = beginMills;
renderingState.endTime = endMills;
return renderingState;
}
}
return null;
}
@Override
public void requestClear() {
mLastBeginMills = mLastEndMills = 0;
mIsHidden = false;
}
@Override
public void requestClearRetainer() {
clearRetainerFlag = true;
}
@Override
public void requestSync(long fromTimeMills, long toTimeMills, final long offsetMills) {
// obtain the running-danmakus which was drawn on screen
IDanmakus runningDanmakus = mRenderingState.obtainRunningDanmakus();
mRunningDanmakus = runningDanmakus;
// set offset time for each running-danmakus
runningDanmakus.forEachSync(new IDanmakus.DefaultConsumer<BaseDanmaku>() {
@Override
public int accept(BaseDanmaku danmaku) {
if (danmaku.isOutside()) {
return ACTION_REMOVE;
}
danmaku.setTimeOffset(offsetMills + danmaku.timeOffset);
if (danmaku.timeOffset == 0) {
return ACTION_REMOVE;
}
return ACTION_CONTINUE;
}
});
mStartRenderTime = toTimeMills;
}
public boolean onDanmakuConfigChanged(DanmakuContext config, DanmakuConfigTag tag,
Object... values) {
boolean handled = handleOnDanmakuConfigChanged(config, tag, values);
if (mTaskListener != null) {
mTaskListener.onDanmakuConfigChanged();
}
return handled;
}
protected boolean handleOnDanmakuConfigChanged(DanmakuContext config, DanmakuConfigTag tag, Object[] values) {
boolean handled = false;
if (tag == null || DanmakuConfigTag.MAXIMUM_NUMS_IN_SCREEN.equals(tag)) {
handled = true;
} else if (DanmakuConfigTag.DUPLICATE_MERGING_ENABLED.equals(tag)) {
Boolean enable = (Boolean) values[0];
if (enable != null) {
if (enable) {
mContext.mDanmakuFilters.registerFilter(DanmakuFilters.TAG_DUPLICATE_FILTER);
} else {
mContext.mDanmakuFilters.unregisterFilter(DanmakuFilters.TAG_DUPLICATE_FILTER);
}
handled = true;
}
} else if (DanmakuConfigTag.SCALE_TEXTSIZE.equals(tag) || DanmakuConfigTag.SCROLL_SPEED_FACTOR.equals(tag) || DanmakuConfigTag.DANMAKU_MARGIN.equals(tag)) {
requestClearRetainer();
handled = false;
} else if (DanmakuConfigTag.MAXIMUN_LINES.equals(tag) || DanmakuConfigTag.OVERLAPPING_ENABLE.equals(tag)) {
if (mRenderer != null) {
mRenderer.setVerifierEnabled(mContext.isPreventOverlappingEnabled() || mContext.isMaxLinesLimited());
}
handled = true;
} else if (DanmakuConfigTag.ALIGN_BOTTOM.equals(tag)) {
Boolean enable = (Boolean) values[0];
if (enable != null) {
if (mRenderer != null) {
mRenderer.alignBottom(enable);
}
handled = true;
}
}
return handled;
}
@Override
public void requestHide() {
mIsHidden = true;
}
@Override
public void requestRender() {
this.mRequestRender = true;
}
private void beginTracing(RenderingState renderingState, IDanmakus runningDanmakus, IDanmakus screenDanmakus) {
renderingState.reset();
renderingState.timer.update(SystemClock.uptimeMillis());
renderingState.indexInScreen = 0;
renderingState.totalSizeInScreen = (runningDanmakus != null ? runningDanmakus.size() : 0) + (screenDanmakus != null ? screenDanmakus.size() : 0);
}
private void endTracing(RenderingState renderingState) {
renderingState.nothingRendered = (renderingState.totalDanmakuCount == 0);
if (renderingState.nothingRendered) {
renderingState.beginTime = RenderingState.UNKNOWN_TIME;
}
BaseDanmaku lastDanmaku = renderingState.lastDanmaku;
renderingState.lastDanmaku = null;
renderingState.endTime = lastDanmaku != null ? lastDanmaku.getActualTime() : RenderingState.UNKNOWN_TIME;
renderingState.consumingTime = renderingState.timer.update(SystemClock.uptimeMillis());
}
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/IDanmakuView.java
================================================
package master.flame.danmaku.controller;
import android.view.View;
import master.flame.danmaku.controller.DrawHandler.Callback;
import master.flame.danmaku.danmaku.model.BaseDanmaku;
import master.flame.danmaku.danmaku.model.IDanmakus;
import master.flame.danmaku.danmaku.model.android.DanmakuContext;
import master.flame.danmaku.danmaku.parser.BaseDanmakuParser;
public interface IDanmakuView {
public final static int THREAD_TYPE_NORMAL_PRIORITY = 0x0;
public final static int THREAD_TYPE_MAIN_THREAD = 0x1;
public final static int THREAD_TYPE_HIGH_PRIORITY = 0x2;
public final static int THREAD_TYPE_LOW_PRIORITY = 0x3;
public boolean isPrepared();
public boolean isPaused();
public boolean isHardwareAccelerated();
/**
*
* @param type One of THREAD_TYPE_MAIN_THREAD, THREAD_TYPE_HIGH_PRIORITY, THREAD_TYPE_NORMAL_PRIORITY, or THREAD_TYPE_LOW_PRIORITY.
*/
public void setDrawingThreadType(int type);
public void enableDanmakuDrawingCache(boolean enable);
public boolean isDanmakuDrawingCacheEnabled();
public void showFPS(boolean show);
/**
* danmaku.isLive == true的情况下,请在非UI线程中使用此方法,避免可能卡住主线程
* @param item
*/
public void addDanmaku(BaseDanmaku item);
public void invalidateDanmaku(BaseDanmaku item, boolean remeasure);
public void removeAllDanmakus(boolean isClearDanmakusOnScreen);
public void removeAllLiveDanmakus();
public IDanmakus getCurrentVisibleDanmakus();
public void setCallback(Callback callback);
/**
* for getting the accurate play-time. use this method intead of parser.getTimer().currMillisecond
* @return
*/
public long getCurrentTime();
public DanmakuContext getConfig();
// ------------- Android View方法 --------------------
public View getView();
public int getWidth();
public int getHeight();
public void setVisibility(int visibility);
public boolean isShown();
// ------------- 播放控制 -------------------
public void prepare(BaseDanmakuParser parser, DanmakuContext config);
public void seekTo(Long ms);
public void start();
public void start(long postion);
public void stop();
public void pause();
public void resume();
public void release();
public void toggle();
public void show();
public void hide();
/**
* show the danmakuview again if you called hideAndPauseDrawTask()
* @param position The position you want to resume
* @see #hideAndPauseDrawTask
*/
public void showAndResumeDrawTask(Long position);
/**
* hide the danmakuview and pause the drawtask
* @return the paused position
* @see #showAndResumeDrawTask
*/
public long hideAndPauseDrawTask();
public void clearDanmakusOnScreen();
// ------------- Click Listener -------------------
public interface OnDanmakuClickListener {
/**
* @param danmakus all to be clicked, this value may be empty;
* danmakus.last() is the latest danmaku which may be null;
* @return True if the event was handled, false otherwise.
*/
boolean onDanmakuClick(IDanmakus danmakus);
boolean onDanmakuLongClick(IDanmakus danmakus);
boolean onViewClick(IDanmakuView view);
}
public void setOnDanmakuClickListener(OnDanmakuClickListener listener);
public void setOnDanmakuClickListener(OnDanmakuClickListener listener, float xOff, float yOff);
public OnDanmakuClickListener getOnDanmakuClickListener();
public float getXOff();
public float getYOff();
void forceRender();
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/IDanmakuViewController.java
================================================
package master.flame.danmaku.controller;
import android.content.Context;
/**
* For internal control. DO NOT ACCESS this interface.
*/
public interface IDanmakuViewController {
public boolean isViewReady();
public int getViewWidth();
public int getViewHeight();
public Context getContext();
public long drawDanmakus();
public void clear();
public boolean isHardwareAccelerated();
public boolean isDanmakuDrawingCacheEnabled();
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/IDrawTask.java
================================================
/*
* Copyright (C) 2013 Chen Hui <calmer91@gmail.com>
*
* 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.
*/
package master.flame.danmaku.controller;
import master.flame.danmaku.danmaku.model.AbsDisplayer;
import master.flame.danmaku.danmaku.model.BaseDanmaku;
import master.flame.danmaku.danmaku.model.IDanmakus;
import master.flame.danmaku.danmaku.parser.BaseDanmakuParser;
import master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState;
public interface IDrawTask {
public static final int PLAY_STATE_PLAYING = 1;
public static final int PLAY_STATE_PAUSE = 2;
public void addDanmaku(BaseDanmaku item);
public void removeAllDanmakus(boolean isClearDanmakusOnScreen);
public void removeAllLiveDanmakus();
public void clearDanmakusOnScreen(long currMillis);
public IDanmakus getVisibleDanmakusOnTime(long time);
public RenderingState draw(AbsDisplayer displayer);
public void reset();
public void seek(long mills);
public void start();
public void quit();
public void prepare();
public void onPlayStateChanged(int state);
public void requestClear();
void requestClearRetainer();
void requestSync(long fromTimeMills, long toTimeMills, long offsetMills);
public void setParser(BaseDanmakuParser parser);
void invalidateDanmaku(BaseDanmaku item, boolean remeasure);
public interface TaskListener {
public void ready();
public void onDanmakuAdd(BaseDanmaku danmaku);
public void onDanmakuShown(BaseDanmaku danmaku);
public void onDanmakuConfigChanged();
public void onDanmakusDrawingFinished();
}
public void requestHide();
void requestRender();
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/UpdateThread.java
================================================
package master.flame.danmaku.controller;
public class UpdateThread extends Thread {
public UpdateThread(String name) {
super(name);
}
volatile boolean mIsQuited;
public void quit() {
mIsQuited = true;
}
public boolean isQuited() {
return mIsQuited;
}
@Override
public void run() {
if (mIsQuited)
return;
}
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/loader/ILoader.java
================================================
/*
* Copyright (C) 2013 Chen Hui <calmer91@gmail.com>
*
* 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.
*/
package master.flame.danmaku.danmaku.loader;
import java.io.InputStream;
import master.flame.danmaku.danmaku.parser.IDataSource;
public interface ILoader {
/**
* @return data source
*/
IDataSource<?> getDataSource();
/**
* @param uri 弹幕文件地址(http:// file://)
*/
void load(String uri) throws IllegalDataException;
/**
*
* @param in stream from Internet or local file
*/
void load(InputStream in) throws IllegalDataException;
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/loader/IllegalDataException.java
================================================
package master.flame.danmaku.danmaku.loader;
/**
* Thrown when data is loading which can not be reasonably deal with.
* @author yrom
*
*/
public class IllegalDataException extends Exception {
private static final long serialVersionUID = 10441759254L;
public IllegalDataException() {
super();
}
public IllegalDataException(String detailMessage, Throwable throwable) {
super(detailMessage, throwable);
}
public IllegalDataException(String detailMessage) {
super(detailMessage);
}
public IllegalDataException(Throwable throwable) {
super(throwable);
}
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/loader/android/AcFunDanmakuLoader.java
================================================
package master.flame.danmaku.danmaku.loader.android;
import java.io.InputStream;
import master.flame.danmaku.danmaku.loader.ILoader;
import master.flame.danmaku.danmaku.loader.IllegalDataException;
import master.flame.danmaku.danmaku.parser.android.JSONSource;
import android.net.Uri;
/**
* Ac danmaku loader
* @author yrom
*
*/
public class AcFunDanmakuLoader implements ILoader{
private AcFunDanmakuLoader(){}
private static volatile AcFunDanmakuLoader instance;
private JSONSource dataSource;
public static ILoader instance() {
if(instance == null){
synchronized (AcFunDanmakuLoader.class){
if(instance == null)
instance = new AcFunDanmakuLoader();
}
}
return instance;
}
@Override
public JSONSource getDataSource() {
return dataSource;
}
@Override
public void load(String uri) throws IllegalDataException {
try {
dataSource = new JSONSource(Uri.parse(uri));
} catch (Exception e) {
throw new IllegalDataException(e);
}
}
@Override
public void load(InputStream in) throws IllegalDataException {
try {
dataSource = new JSONSource(in);
} catch (Exception e) {
throw new IllegalDataException(e);
}
}
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/loader/android/BiliDanmakuLoader.java
================================================
/*
* Copyright (C) 2013 Chen Hui <calmer91@gmail.com>
*
* 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.
*/
package master.flame.danmaku.danmaku.loader.android;
import java.io.InputStream;
import master.flame.danmaku.danmaku.loader.ILoader;
import master.flame.danmaku.danmaku.loader.IllegalDataException;
import master.flame.danmaku.danmaku.parser.android.AndroidFileSource;
public class BiliDanmakuLoader implements ILoader {
private static BiliDanmakuLoader _instance;
private AndroidFileSource dataSource;
private BiliDanmakuLoader() {
}
public static BiliDanmakuLoader instance() {
if (_instance == null) {
_instance = new BiliDanmakuLoader();
}
return _instance;
}
public void load(String uri) throws IllegalDataException {
try {
dataSource = new AndroidFileSource(uri);
} catch (Exception e) {
throw new IllegalDataException(e);
}
}
public void load(InputStream stream) {
dataSource = new AndroidFileSource(stream);
}
@Override
public AndroidFileSource getDataSource() {
return dataSource;
}
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/loader/android/DanmakuLoaderFactory.java
================================================
/*
* Copyright (C) 2013 Chen Hui <calmer91@gmail.com>
*
* 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.
*/
package master.flame.danmaku.danmaku.loader.android;
import master.flame.danmaku.danmaku.loader.ILoader;
public class DanmakuLoaderFactory {
public static String TAG_BILI = "bili";
public static String TAG_ACFUN = "acfun";
public static ILoader create(String tag) {
if (TAG_BILI.equalsIgnoreCase(tag)) {
return BiliDanmakuLoader.instance();
} else if(TAG_ACFUN.equalsIgnoreCase(tag))
return AcFunDanmakuLoader.instance();
return null;
}
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/AbsDanmakuSync.java
================================================
package master.flame.danmaku.danmaku.model;
public abstract class AbsDanmakuSync {
public static final int SYNC_STATE_HALT = 1;
public static final int SYNC_STATE_PLAYING = 2;
/**
* Get the uptime of timer synchronization
*
* @return
*/
public abstract long getUptimeMillis();
/**
* Get the state of timer synchronization
*
* @return SYNC_STATE_HALT or SYNC_STATE_PLAYING
*/
public abstract int getSyncState();
/**
* Get the threshold-time of timer synchronization
* This value should be greater than or equal to 1000L
*
* @return
*/
public long getThresholdTimeMills() {
return 1500L;
}
/**
* synchronize pause/resume state with outside playback
* @return
*/
public boolean isSyncPlayingState() {
return false;
}
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/AbsDisplayer.java
================================================
package master.flame.danmaku.danmaku.model;
import master.flame.danmaku.danmaku.model.android.BaseCacheStuffer;
public abstract class AbsDisplayer<T, F> implements IDisplayer {
public abstract T getExtraData();
public abstract void setExtraData(T data);
@Override
public boolean isHardwareAccelerated() {
return false;
}
public abstract void drawDanmaku(BaseDanmaku danmaku, T canvas, float left, float top, boolean fromWorkerThread);
public abstract void clearTextHeightCache();
public abstract void setTypeFace(F font);
public abstract void setFakeBoldText(boolean bold);
public abstract void setTransparency(int newTransparency);
public abstract void setScaleTextSizeFactor(float factor);
public abstract void setCacheStuffer(BaseCacheStuffer cacheStuffer);
public abstract BaseCacheStuffer getCacheStuffer();
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/AlphaValue.java
================================================
package master.flame.danmaku.danmaku.model;
public class AlphaValue {
public static int MAX = 255;
public static int TRANSPARENT = 0;
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/BaseDanmaku.java
================================================
/*
* Copyright (C) 2013 Chen Hui <calmer91@gmail.com>
*
* 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.
*/
package master.flame.danmaku.danmaku.model;
import android.util.SparseArray;
public abstract class BaseDanmaku {
public final static String DANMAKU_BR_CHAR = "/n";
public final static int TYPE_SCROLL_RL = 1;
public final static int TYPE_SCROLL_LR = 6;
public final static int TYPE_FIX_TOP = 5;
public final static int TYPE_FIX_BOTTOM = 4;
public final static int TYPE_SPECIAL = 7;
public final static int TYPE_MOVEABLE_XXX = 0; // TODO: add more type
public final static int INVISIBLE = 0;
public final static int VISIBLE = 1;
public final static int FLAG_REQUEST_REMEASURE = 0x1;
public final static int FLAG_REQUEST_INVALIDATE = 0x2;
/**
* 显示时间(毫秒)
*/
private long time;
/**
* 偏移时间
*/
public long timeOffset;
/**
* 文本
*/
public CharSequence text;
/**
* 多行文本: 如果有包含换行符需事先拆分到lines
*/
public String[] lines;
/**
* 保存一些数据的引用(库内部使用, 外部使用请用tag)
*/
public Object obj;
/**
* 可保存一些自定义数据的引用(外部使用).
* 除非主动set null,否则不会自动释放引用.
* 确定你会主动set null, 否则不要使用这个字段引用大内存的对象实例.
*/
public Object tag;
/**
* 文本颜色
*/
public int textColor;
/**
* Z轴角度
*/
public float rotationZ;
/**
* Y轴角度
*/
public float rotationY;
/**
* 阴影/描边颜色
*/
public int textShadowColor;
/**
* 下划线颜色,0表示无下划线
*/
public int underlineColor = 0;
/**
* 字体大小
*/
public float textSize = -1;
/**
* 框的颜色,0表示无框
*/
public int borderColor = 0;
/**
* 内边距(像素)
*/
public int padding = 0;
/**
* 弹幕优先级,0为低优先级,>0为高优先级不会被过滤器过滤
*/
public byte priority = 0;
/**
* 占位宽度
*/
public float paintWidth = -1;
/**
* 占位高度
*/
public float paintHeight = -1;
/**
* 存活时间(毫秒)
*/
public Duration duration;
/**
* 索引/编号
*/
public int index;
/**
* 是否可见
*/
public int visibility;
/**
* 重置位 visible
*/
private int visibleResetFlag = 0;
/**
* 重置位 measure
*/
public int measureResetFlag = 0;
/**
* 重置位 offset time
*/
public int syncTimeOffsetResetFlag = 0;
/**
* 重置位 prepare
*/
public int prepareResetFlag = -1;
/**
* 绘制用缓存
*/
public IDrawingCache<?> cache;
/**
* 是否是直播弹幕
*/
public boolean isLive;
/**
* 临时, 是否在同线程创建缓存
*/
public boolean forceBuildCacheInSameThread;
/**
* 弹幕发布者id, 0表示游客
*/
public int userId = 0;
/**
* 弹幕发布者id
*/
public String userHash;
/**
* 是否游客
*/
public boolean isGuest;
/**
* 计时
*/
protected DanmakuTimer mTimer;
/**
* 透明度
*/
protected int alpha = AlphaValue.MAX;
public int mFilterParam = 0;
public int filterResetFlag = -1;
public GlobalFlagValues flags = null;
public int requestFlags = 0;
/**
* 标记是否首次显示,首次显示后将置为FIRST_SHOWN_RESET_FLAG
*/
public int firstShownFlag = -1;
private SparseArray<Object> mTags = new SparseArray<>();
public long getDuration() {
return duration.value;
}
public void setDuration(Duration duration) {
this.duration = duration;
}
public int draw(IDisplayer displayer) {
return displayer.draw(this);
}
public boolean isMeasured() {
return paintWidth > -1 && paintHeight > -1
&& measureResetFlag == flags.MEASURE_RESET_FLAG;
}
public void measure(IDisplayer displayer, boolean fromWorkerThread) {
displayer.measure(this, fromWorkerThread);
this.measureResetFlag = flags.MEASURE_RESET_FLAG;
}
public boolean isPrepared() {
return this.prepareResetFlag == flags.PREPARE_RESET_FLAG;
}
public void prepare(IDisplayer displayer, boolean fromWorkerThread) {
displayer.prepare(this, fromWorkerThread);
this.prepareResetFlag = flags.PREPARE_RESET_FLAG;
}
public IDrawingCache<?> getDrawingCache() {
return cache;
}
public boolean isShown() {
return this.visibility == VISIBLE
&& visibleResetFlag == flags.VISIBLE_RESET_FLAG;
}
public boolean isTimeOut() {
return mTimer == null || isTimeOut(mTimer.currMillisecond);
}
public boolean isTimeOut(long ctime) {
return ctime - getActualTime() >= duration.value;
}
public boolean isOutside() {
return mTimer == null || isOutside(mTimer.currMillisecond);
}
public boolean isOutside(long ctime) {
long dtime = ctime - getActualTime();
return dtime <= 0 || dtime >= duration.value;
}
public boolean isLate() {
return mTimer == null || mTimer.currMillisecond < getActualTime();
}
public boolean hasPassedFilter() {
if (filterResetFlag != flags.FILTER_RESET_FLAG) {
mFilterParam = 0;
return false;
}
return true;
}
public boolean isFiltered() {
return filterResetFlag == flags.FILTER_RESET_FLAG && mFilterParam != 0;
}
public boolean isFilteredBy(int flag) {
return filterResetFlag == flags.FILTER_RESET_FLAG && (mFilterParam & flag) == flag;
}
public void setVisibility(boolean b) {
if (b) {
this.visibleResetFlag = flags.VISIBLE_RESET_FLAG;
this.visibility = VISIBLE;
} else
this.visibility = INVISIBLE;
}
public abstract void layout(IDisplayer displayer, float x, float y);
public abstract float[] getRectAtTime(IDisplayer displayer, long currTime);
public abstract float getLeft();
public abstract float getTop();
public abstract float getRight();
public abstract float getBottom();
/**
* return the type of Danmaku
*
* @return TYPE_SCROLL_RL = 0 TYPE_SCROLL_RL = 1 TYPE_SCROLL_LR = 2
* TYPE_FIX_TOP = 3; TYPE_FIX_BOTTOM = 4;
*/
public abstract int getType();
public DanmakuTimer getTimer() {
return mTimer;
}
public void setTimer(DanmakuTimer timer) {
mTimer = timer;
}
public int getAlpha() {
return alpha;
}
public void setTag(Object tag) {
this.tag = tag;
}
public void setTag(int key, Object tag) {
this.mTags.put(key, tag);
}
public Object getTag(int key) {
if (mTags == null) {
return null;
}
return mTags.get(key);
}
public void setTimeOffset(long timeOffset) {
this.timeOffset = timeOffset;
this.syncTimeOffsetResetFlag = flags.SYNC_TIME_OFFSET_RESET_FLAG;
}
public void setTime(long time) {
this.time = time;
this.timeOffset = 0;
}
public long getTime() {
return time;
}
public long getActualTime() {
if (flags == null || flags.SYNC_TIME_OFFSET_RESET_FLAG != this.syncTimeOffsetResetFlag) {
this.timeOffset = 0;
return time;
}
return time + timeOffset;
}
public boolean isOffset() {
if (flags == null || flags.SYNC_TIME_OFFSET_RESET_FLAG != this.syncTimeOffsetResetFlag) {
this.timeOffset = 0;
return false;
}
return timeOffset != 0;
}
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/Danmaku.java
================================================
/*
* Copyright (C) 2013 Chen Hui <calmer91@gmail.com>
*
* 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.
*/
package master.flame.danmaku.danmaku.model;
import master.flame.danmaku.danmaku.util.DanmakuUtils;
public class Danmaku extends BaseDanmaku {
public Danmaku(CharSequence text) {
DanmakuUtils.fillText(this, text);
}
@Override
public boolean isShown() {
return false;
}
@Override
public void layout(IDisplayer displayer, float x, float y) {
}
@Override
public float[] getRectAtTime(IDisplayer displayer, long time) {
return null;
}
@Override
public float getLeft() {
return 0;
}
@Override
public float getTop() {
return 0;
}
@Override
public float getRight() {
return 0;
}
@Override
public float getBottom() {
return 0;
}
@Override
public int getType() {
return 0;
}
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/DanmakuTimer.java
================================================
/*
* Copyright (C) 2013 Chen Hui <calmer91@gmail.com>
*
* 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.
*/
package master.flame.danmaku.danmaku.model;
public class DanmakuTimer {
public long currMillisecond;
private long lastInterval;
public DanmakuTimer() {
}
public DanmakuTimer(long curr) {
update(curr);
}
public long update(long curr) {
lastInterval = curr - currMillisecond;
currMillisecond = curr;
return lastInterval;
}
public long add(long mills) {
return update(currMillisecond + mills);
}
public long lastInterval() {
return lastInterval;
}
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/Duration.java
================================================
package master.flame.danmaku.danmaku.model;
public class Duration implements Cloneable {
private long mInitialDuration;
private float factor = 1.0f;
public long value;
public Duration(long initialDuration) {
mInitialDuration = initialDuration;
value = initialDuration;
}
public void setValue(long initialDuration) {
mInitialDuration = initialDuration;
value = (long) (mInitialDuration * factor);
}
public void setFactor(float f) {
if (factor != f) {
factor = f;
value = (long) (mInitialDuration * f);
}
}
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/FBDanmaku.java
================================================
/*
* Copyright (C) 2013 Chen Hui <calmer91@gmail.com>
*
* 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.
*/
package master.flame.danmaku.danmaku.model;
public class FBDanmaku extends FTDanmaku {
public FBDanmaku(Duration duration) {
super(duration);
}
@Override
public int getType() {
return TYPE_FIX_BOTTOM;
}
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/FTDanmaku.java
================================================
/*
* Copyright (C) 2013 Chen Hui <calmer91@gmail.com>
*
* 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.
*/
package master.flame.danmaku.danmaku.model;
/**
* 顶部固定弹幕
*/
public class FTDanmaku extends BaseDanmaku {
private float x = 0;
protected float y = -1;
private float[] RECT = null;
private float mLastLeft;
private float mLastPaintWidth;
private int mLastDispWidth;
public FTDanmaku(Duration duration) {
this.duration = duration;
}
@Override
public void layout(IDisplayer displayer, float x, float y) {
if (mTimer != null) {
long deltaDuration = mTimer.currMillisecond - getActualTime();
if (deltaDuration > 0 && deltaDuration < duration.value) {
if (!this.isShown()) {
this.x = getLeft(displayer);
this.y = y;
this.setVisibility(true);
}
return;
}
this.setVisibility(false);
this.y = -1;
this.x = displayer.getWidth();
}
}
protected float getLeft(IDisplayer displayer) {
if (mLastDispWidth == displayer.getWidth() && mLastPaintWidth == paintWidth) {
return mLastLeft;
}
float left = (displayer.getWidth() - paintWidth) / 2;
mLastDispWidth = displayer.getWidth();
mLastPaintWidth = paintWidth;
mLastLeft = left;
return left;
}
@Override
public float[] getRectAtTime(IDisplayer displayer, long time) {
if (!isMeasured())
return null;
float left = getLeft(displayer);
if (RECT == null) {
RECT = new float[4];
}
RECT[0] = left;
RECT[1] = y;
RECT[2] = left + paintWidth;
RECT[3] = y + paintHeight;
return RECT;
}
@Override
public float getLeft() {
return x;
}
@Override
public float getTop() {
return y;
}
@Override
public float getRight() {
return x + paintWidth;
}
@Override
public float getBottom() {
return y + paintHeight;
}
@Override
public int getType() {
return TYPE_FIX_TOP;
}
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/GlobalFlagValues.java
================================================
package master.flame.danmaku.danmaku.model;
public class GlobalFlagValues {
public int MEASURE_RESET_FLAG = 0;
public int VISIBLE_RESET_FLAG = 0;
public int FILTER_RESET_FLAG = 0;
public int FIRST_SHOWN_RESET_FLAG = 0;
public int SYNC_TIME_OFFSET_RESET_FLAG = 0;
public int PREPARE_RESET_FLAG = 0;
public void resetAll() {
VISIBLE_RESET_FLAG = 0;
MEASURE_RESET_FLAG = 0;
FILTER_RESET_FLAG = 0;
FIRST_SHOWN_RESET_FLAG = 0;
SYNC_TIME_OFFSET_RESET_FLAG = 0;
PREPARE_RESET_FLAG = 0;
}
public void updateAll() {
VISIBLE_RESET_FLAG++;
MEASURE_RESET_FLAG++;
FILTER_RESET_FLAG++;
FIRST_SHOWN_RESET_FLAG++;
SYNC_TIME_OFFSET_RESET_FLAG++;
PREPARE_RESET_FLAG++;
}
public void updateVisibleFlag() {
VISIBLE_RESET_FLAG++;
}
public void updateMeasureFlag() {
MEASURE_RESET_FLAG++;
}
public void updateFilterFlag() {
FILTER_RESET_FLAG++;
}
public void updateFirstShownFlag() {
FIRST_SHOWN_RESET_FLAG++;
}
public void updateSyncOffsetTimeFlag() {
SYNC_TIME_OFFSET_RESET_FLAG++;
}
public void updatePrepareFlag() {
PREPARE_RESET_FLAG++;
}
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/ICacheManager.java
================================================
/*
* Copyright (C) 2013 Chen Hui <calmer91@gmail.com>
*
* 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.
*/
package master.flame.danmaku.danmaku.model;
/**
* Created by ch on 15-11-15.
*/
public interface ICacheManager {
void addDanmaku(BaseDanmaku danmaku);
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/IDanmakuIterator.java
================================================
package master.flame.danmaku.danmaku.model;
public interface IDanmakuIterator {
public BaseDanmaku next();
public boolean hasNext();
public void reset();
public void remove();
}
================================================
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/IDanmakus.java
================================================
/*
* Copyright (C) 2013 Chen Hui <calmer91@gmail.com>
*
* 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.
*/
package master.flame.danmaku.danmaku.model;
import java.util.Collection;
import java.util.Comparator;
import master.flame.danmaku.danmaku.util.DanmakuUtils;
public interface IDanmakus {
abstract class Consumer<Progress, Result> {
public static final int ACTION_CONTINUE = 0;
public static final int ACTION_BREAK = 1;
public static final int ACTION_REMOVE = 2;
public static final int ACTION_REMOVE_AND_BREAK = 3;
/**
* Performs this operation on the given argument.
*
* @param t the input argument
* @return next action of the loop
*
* @see #ACTION_CONTINUE
* @see #ACTION_BREAK
* @see #ACTION_REMOVE
*/
public abstract int accept(Progress t);
public void before() {
}
public void after() {
}
public Result result() {
return null;
}
}
abstract class DefaultConsumer<Progress> extends Consumer<Progress, Void> {
}
int ST_BY_TIME = 0;
int ST_BY_YPOS = 1;
int ST_BY_YPOS_DESC = 2;
/**
* this type is used to iterate/remove/insert elements, not support sub/subnew
*/
int ST_BY_LIST = 4;
gitextract_ewo3zqa2/ ├── .gitignore ├── .gitmodules ├── .travis.yml ├── DanmakuFlameMaster/ │ ├── build.gradle │ ├── gradle.properties │ └── src/ │ ├── androidTest/ │ │ └── java/ │ │ └── tv/ │ │ └── cjump/ │ │ └── jni/ │ │ └── NativeBitmapFactoryTest.java │ └── main/ │ ├── .classpath │ ├── .project │ ├── .settings/ │ │ ├── org.eclipse.jdt.core.prefs │ │ └── org.eclipse.jdt.ui.prefs │ ├── AndroidManifest.xml │ ├── build.xml │ ├── java/ │ │ ├── master/ │ │ │ └── flame/ │ │ │ └── danmaku/ │ │ │ ├── controller/ │ │ │ │ ├── CacheManagingDrawTask.java │ │ │ │ ├── DanmakuFilters.java │ │ │ │ ├── DrawHandler.java │ │ │ │ ├── DrawHelper.java │ │ │ │ ├── DrawTask.java │ │ │ │ ├── IDanmakuView.java │ │ │ │ ├── IDanmakuViewController.java │ │ │ │ ├── IDrawTask.java │ │ │ │ └── UpdateThread.java │ │ │ ├── danmaku/ │ │ │ │ ├── loader/ │ │ │ │ │ ├── ILoader.java │ │ │ │ │ ├── IllegalDataException.java │ │ │ │ │ └── android/ │ │ │ │ │ ├── AcFunDanmakuLoader.java │ │ │ │ │ ├── BiliDanmakuLoader.java │ │ │ │ │ └── DanmakuLoaderFactory.java │ │ │ │ ├── model/ │ │ │ │ │ ├── AbsDanmakuSync.java │ │ │ │ │ ├── AbsDisplayer.java │ │ │ │ │ ├── AlphaValue.java │ │ │ │ │ ├── BaseDanmaku.java │ │ │ │ │ ├── Danmaku.java │ │ │ │ │ ├── DanmakuTimer.java │ │ │ │ │ ├── Duration.java │ │ │ │ │ ├── FBDanmaku.java │ │ │ │ │ ├── FTDanmaku.java │ │ │ │ │ ├── GlobalFlagValues.java │ │ │ │ │ ├── ICacheManager.java │ │ │ │ │ ├── IDanmakuIterator.java │ │ │ │ │ ├── IDanmakus.java │ │ │ │ │ ├── IDisplayer.java │ │ │ │ │ ├── IDrawingCache.java │ │ │ │ │ ├── L2RDanmaku.java │ │ │ │ │ ├── R2LDanmaku.java │ │ │ │ │ ├── SpecialDanmaku.java │ │ │ │ │ ├── android/ │ │ │ │ │ │ ├── AndroidDisplayer.java │ │ │ │ │ │ ├── BaseCacheStuffer.java │ │ │ │ │ │ ├── CachingPolicy.java │ │ │ │ │ │ ├── DanmakuContext.java │ │ │ │ │ │ ├── DanmakuFactory.java │ │ │ │ │ │ ├── Danmakus.java │ │ │ │ │ │ ├── DrawingCache.java │ │ │ │ │ │ ├── DrawingCacheHolder.java │ │ │ │ │ │ ├── DrawingCachePoolManager.java │ │ │ │ │ │ ├── SimpleTextCacheStuffer.java │ │ │ │ │ │ ├── SpannedCacheStuffer.java │ │ │ │ │ │ └── ViewCacheStuffer.java │ │ │ │ │ └── objectpool/ │ │ │ │ │ ├── FinitePool.java │ │ │ │ │ ├── Pool.java │ │ │ │ │ ├── Poolable.java │ │ │ │ │ ├── PoolableManager.java │ │ │ │ │ ├── Pools.java │ │ │ │ │ └── SynchronizedPool.java │ │ │ │ ├── parser/ │ │ │ │ │ ├── BaseDanmakuParser.java │ │ │ │ │ ├── IDataSource.java │ │ │ │ │ └── android/ │ │ │ │ │ ├── AndroidFileSource.java │ │ │ │ │ └── JSONSource.java │ │ │ │ ├── renderer/ │ │ │ │ │ ├── IRenderer.java │ │ │ │ │ ├── Renderer.java │ │ │ │ │ └── android/ │ │ │ │ │ ├── DanmakuRenderer.java │ │ │ │ │ └── DanmakusRetainer.java │ │ │ │ └── util/ │ │ │ │ ├── DanmakuUtils.java │ │ │ │ ├── IOUtils.java │ │ │ │ └── SystemClock.java │ │ │ └── ui/ │ │ │ └── widget/ │ │ │ ├── DanmakuSurfaceView.java │ │ │ ├── DanmakuTextureView.java │ │ │ ├── DanmakuTouchHelper.java │ │ │ ├── DanmakuView.java │ │ │ └── FakeDanmakuView.java │ │ └── tv/ │ │ └── cjump/ │ │ └── jni/ │ │ ├── DeviceUtils.java │ │ └── NativeBitmapFactory.java │ ├── lint.xml │ ├── proguard-project.txt │ └── project.properties ├── LICENSE ├── README.md ├── Sample/ │ ├── build.gradle │ └── src/ │ └── main/ │ ├── .classpath │ ├── .project │ ├── .settings/ │ │ └── org.eclipse.jdt.core.prefs │ ├── AndroidManifest.xml │ ├── java/ │ │ └── com/ │ │ └── sample/ │ │ ├── BiliDanmukuParser.java │ │ ├── MainActivity.java │ │ └── UglyViewCacheStufferSampleActivity.java │ ├── project.properties │ └── res/ │ ├── layout/ │ │ ├── activity_main.xml │ │ ├── layout_view_cache.xml │ │ └── media_controller.xml │ ├── menu/ │ │ └── main.xml │ ├── raw/ │ │ └── comments.xml │ └── values/ │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── gradle/ │ ├── gradle-bintray-upload.gradle │ ├── gradle-mvn-push.gradle │ └── wrapper/ │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── gradlew ├── gradlew.bat ├── ndkbitmap-armv5/ │ ├── .gitignore │ ├── build.gradle │ ├── gradle.properties │ ├── proguard-rules.pro │ └── src/ │ ├── androidTest/ │ │ └── java/ │ │ └── tv/ │ │ └── cjump/ │ │ └── ndkbitmap_armv5/ │ │ └── ApplicationTest.java │ └── main/ │ ├── AndroidManifest.xml │ ├── java/ │ │ └── tv/ │ │ └── cjump/ │ │ └── ndkbitmap_armv5/ │ │ └── Pragma.java │ └── res/ │ └── values/ │ └── strings.xml ├── ndkbitmap-armv7a/ │ ├── .gitignore │ ├── build.gradle │ ├── gradle.properties │ ├── proguard-rules.pro │ └── src/ │ ├── androidTest/ │ │ └── java/ │ │ └── tv/ │ │ └── cjump/ │ │ └── ndkbitmap_armv7a/ │ │ └── ApplicationTest.java │ └── main/ │ ├── AndroidManifest.xml │ ├── java/ │ │ └── tv/ │ │ └── cjump/ │ │ └── ndkbitmap_armv7a/ │ │ └── Pragma.java │ └── res/ │ └── values/ │ └── strings.xml ├── ndkbitmap-x86/ │ ├── .gitignore │ ├── build.gradle │ ├── gradle.properties │ ├── proguard-rules.pro │ └── src/ │ ├── androidTest/ │ │ └── java/ │ │ └── tv/ │ │ └── cjump/ │ │ └── ndkbitmap_x86/ │ │ └── ApplicationTest.java │ └── main/ │ ├── AndroidManifest.xml │ ├── java/ │ │ └── tv/ │ │ └── cjump/ │ │ └── ndkbitmap_x86/ │ │ └── Pragma.java │ └── res/ │ └── values/ │ └── strings.xml └── settings.gradle
SYMBOL INDEX (1286 symbols across 78 files)
FILE: DanmakuFlameMaster/src/androidTest/java/tv/cjump/jni/NativeBitmapFactoryTest.java
class NativeBitmapFactoryTest (line 24) | public class NativeBitmapFactoryTest extends InstrumentationTestCase {
method testLoadLibs (line 33) | public void testLoadLibs() {
method testNativeBitmap (line 39) | public void testNativeBitmap() {
method testDalvikBitmap (line 46) | public void testDalvikBitmap() {
method testNativeBitmaps (line 53) | public void testNativeBitmaps() {
method getContext (line 74) | public Context getContext(){
method updateHeapValue (line 78) | private void updateHeapValue(StringBuilder sb) {
method testDalvikBitmaps (line 92) | public void testDalvikBitmaps() {
method testReleaseLibs (line 113) | public void testReleaseLibs() {
method accessBitmap (line 118) | private void accessBitmap(Bitmap bitmap) {
method gcAndWait (line 134) | private void gcAndWait() {
method appendSize (line 144) | private static void appendSize(StringBuilder sb, String prefix, long b...
method appendTime (line 149) | private static void appendTime(StringBuilder sb, String prefix, long t...
method appendNumber (line 153) | private static void appendNumber(StringBuilder sb, String prefix, long...
method appendValue (line 157) | private static void appendValue(StringBuilder sb, String prefix, Strin...
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/CacheManagingDrawTask.java
class CacheManagingDrawTask (line 42) | public class CacheManagingDrawTask extends DrawTask {
method CacheManagingDrawTask (line 55) | public CacheManagingDrawTask(DanmakuTimer timer, DanmakuContext config...
method initTimer (line 63) | @Override
method addDanmaku (line 70) | @Override
method invalidateDanmaku (line 78) | @Override
method removeAllDanmakus (line 87) | @Override
method onDanmakuRemoved (line 95) | @Override
method draw (line 116) | @Override
method seek (line 131) | @Override
method start (line 140) | @Override
method quit (line 153) | @Override
method prepare (line 165) | @Override
method onPlayStateChanged (line 174) | @Override
method requestSync (line 182) | @Override
class CacheManager (line 190) | public class CacheManager implements ICacheManager {
method CacheManager (line 216) | public CacheManager(int maxSize, int screenSize) {
method seek (line 223) | public void seek(long mills) {
method addDanmaku (line 231) | @Override
method invalidateDanmaku (line 244) | public void invalidateDanmaku(BaseDanmaku danmaku, boolean remeasure) {
method begin (line 253) | public void begin() {
method end (line 264) | public void end() {
method resume (line 285) | public void resume() {
method onPlayStateChanged (line 293) | public void onPlayStateChanged(int state) {
method getPoolPercent (line 299) | public float getPoolPercent() {
method isPoolFull (line 306) | public boolean isPoolFull() {
method evictAll (line 310) | private void evictAll() {
method evictAllNotInScreen (line 324) | private void evictAllNotInScreen() {
method entryRemoved (line 339) | protected void entryRemoved(boolean evicted, BaseDanmaku oldValue, B...
method clearCache (line 352) | private long clearCache(BaseDanmaku oldValue) {
method sizeOf (line 368) | protected int sizeOf(BaseDanmaku value) {
method clearCachePool (line 375) | private void clearCachePool() {
method push (line 382) | private boolean push(BaseDanmaku item, int itemSize, boolean forcePu...
method clearTimeOutCaches (line 394) | private void clearTimeOutCaches() {
method findReusableCache (line 425) | private BaseDanmaku findReusableCache(final BaseDanmaku refDanmaku,
class CacheHandler (line 484) | public class CacheHandler extends Handler {
method CacheHandler (line 518) | public CacheHandler(android.os.Looper looper) {
method requestCancelCaching (line 522) | public void requestCancelCaching() {
method handleMessage (line 526) | @Override
method dispatchAction (line 629) | private long dispatchAction() {
method releaseDanmakuCache (line 674) | private void releaseDanmakuCache(BaseDanmaku item, DrawingCache ca...
method preMeasure (line 686) | private void preMeasure() {
method prepareCaches (line 722) | private long prepareCaches(final boolean repositioned) {
method createCache (line 840) | public boolean createCache(BaseDanmaku item) {
method buildCache (line 868) | private byte buildCache(BaseDanmaku item, boolean forceInsert) {
method addDanmakuAndBuildCache (line 937) | private final void addDanmakuAndBuildCache(BaseDanmaku danmaku) {
method begin (line 950) | public void begin() {
method pause (line 955) | public void pause() {
method resume (line 960) | public void resume() {
method isPause (line 968) | public boolean isPause() {
method requestBuildCacheAndDraw (line 972) | public void requestBuildCacheAndDraw(long correctionTime) {
method onPlayStateChanged (line 980) | public void onPlayStateChanged(boolean isPlaying) {
method clearTimeOutAndFilteredCaches (line 985) | private void clearTimeOutAndFilteredCaches(int expectedFreeSize, fin...
method getFirstCacheTime (line 1008) | public long getFirstCacheTime() {
method requestBuild (line 1018) | public void requestBuild(long correctionTime) {
method requestClearAll (line 1024) | public void requestClearAll() {
method requestClearUnused (line 1035) | public void requestClearUnused() {
method requestClearTimeout (line 1043) | public void requestClearTimeout() {
method post (line 1051) | public void post(Runnable runnable) {
method onDanmakuConfigChanged (line 1060) | @Override
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/DanmakuFilters.java
class DanmakuFilters (line 22) | public class DanmakuFilters {
type IDanmakuFilter (line 36) | public interface IDanmakuFilter<T> {
method filter (line 40) | boolean filter(BaseDanmaku danmaku, int index, int totalsizeInScreen,
method setData (line 43) | void setData(T data);
method reset (line 45) | void reset();
method clear (line 47) | void clear();
class BaseDanmakuFilter (line 51) | public static abstract class BaseDanmakuFilter<T> implements IDanmakuF...
method clear (line 53) | @Override
class TypeDanmakuFilter (line 65) | public static class TypeDanmakuFilter extends BaseDanmakuFilter<List<I...
method enableType (line 69) | public void enableType(Integer type) {
method disableType (line 74) | public void disableType(Integer type) {
method filter (line 79) | @Override
method setData (line 89) | @Override
method reset (line 99) | @Override
class QuantityDanmakuFilter (line 111) | public static class QuantityDanmakuFilter extends BaseDanmakuFilter<In...
method needFilter (line 118) | private boolean needFilter(BaseDanmaku danmaku, int orderInScreen,
method filter (line 143) | @Override
method setData (line 153) | @Override
method reset (line 164) | @Override
method clear (line 169) | @Override
class ElapsedTimeFilter (line 180) | public static class ElapsedTimeFilter extends BaseDanmakuFilter<Object> {
method needFilter (line 184) | private synchronized boolean needFilter(BaseDanmaku danmaku, int ord...
method filter (line 197) | @Override
method setData (line 207) | @Override
method reset (line 212) | @Override
method clear (line 217) | @Override
class TextColorFilter (line 229) | public static class TextColorFilter extends BaseDanmakuFilter<List<Int...
method addToWhiteList (line 233) | private void addToWhiteList(Integer color) {
method filter (line 239) | @Override
method setData (line 249) | @Override
method reset (line 259) | @Override
class UserFilter (line 271) | public static abstract class UserFilter<T> extends BaseDanmakuFilter<L...
method addToBlackList (line 275) | private void addToBlackList(T id) {
method filter (line 281) | @Override
method setData (line 285) | @Override
method reset (line 295) | @Override
class UserIdFilter (line 307) | public static class UserIdFilter extends UserFilter<Integer> {
method filter (line 309) | @Override
class UserHashFilter (line 326) | public static class UserHashFilter extends UserFilter<String> {
method filter (line 328) | @Override
class GuestFilter (line 345) | public static class GuestFilter extends BaseDanmakuFilter<Boolean> {
method filter (line 349) | @Override
method setData (line 359) | @Override
method reset (line 364) | @Override
class DuplicateMergingFilter (line 371) | public static class DuplicateMergingFilter extends BaseDanmakuFilter<V...
method removeTimeoutDanmakus (line 377) | private final void removeTimeoutDanmakus(final IDanmakus danmakus, f...
method removeTimeoutDanmakus (line 398) | private void removeTimeoutDanmakus(LinkedHashMap<String, BaseDanmaku...
method needFilter (line 420) | public synchronized boolean needFilter(BaseDanmaku danmaku, int inde...
method filter (line 444) | @Override
method setData (line 454) | @Override
method reset (line 459) | @Override
method clear (line 466) | @Override
class MaximumLinesFilter (line 473) | public static class MaximumLinesFilter extends BaseDanmakuFilter<Map<I...
method filter (line 477) | @Override
method setData (line 490) | @Override
method reset (line 495) | @Override
class OverlappingFilter (line 501) | public static class OverlappingFilter extends BaseDanmakuFilter<Map<In...
method filter (line 505) | @Override
method setData (line 518) | @Override
method reset (line 523) | @Override
method filter (line 553) | public void filter(BaseDanmaku danmaku, int index, int totalsizeInScreen,
method filterSecondary (line 566) | public boolean filterSecondary(BaseDanmaku danmaku, int lines, int tot...
method get (line 587) | public IDanmakuFilter<?> get(String tag) {
method get (line 591) | public IDanmakuFilter<?> get(String tag, boolean primary) {
method registerFilter (line 599) | public IDanmakuFilter<?> registerFilter(String tag) {
method registerFilter (line 603) | public IDanmakuFilter<?> registerFilter(String tag, boolean primary) {
method registerFilter (line 647) | public void registerFilter(BaseDanmakuFilter filter) {
method unregisterFilter (line 652) | public void unregisterFilter(String tag) {
method unregisterFilter (line 656) | public void unregisterFilter(String tag, boolean primary) {
method unregisterFilter (line 668) | public void unregisterFilter(BaseDanmakuFilter filter) {
method clear (line 673) | public void clear() {
method reset (line 684) | public void reset() {
method release (line 695) | public void release() {
method throwFilterException (line 703) | private void throwFilterException() {
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/DrawHandler.java
class DrawHandler (line 43) | public class DrawHandler extends Handler {
type Callback (line 48) | public interface Callback {
method prepared (line 49) | public void prepared();
method updateTimer (line 51) | public void updateTimer(DanmakuTimer timer);
method danmakuShown (line 53) | public void danmakuShown(BaseDanmaku danmaku);
method drawingFinished (line 55) | public void drawingFinished();
method DrawHandler (line 146) | public DrawHandler(Looper looper, IDanmakuViewController view, boolean...
method bindView (line 158) | private void bindView(IDanmakuViewController view) {
method setIdleSleep (line 162) | public void setIdleSleep(boolean enable) {
method enableNonBlockMode (line 166) | public void enableNonBlockMode(boolean enable) {
method setConfig (line 170) | public void setConfig(DanmakuContext config) {
method setParser (line 174) | public void setParser(BaseDanmakuParser parser) {
method setCallback (line 182) | public void setCallback(Callback cb) {
method quit (line 186) | public void quit() {
method isStop (line 191) | public boolean isStop() {
method handleMessage (line 195) | @Override
method quitUpdateThread (line 368) | private synchronized void quitUpdateThread() {
method updateInCurrentThread (line 384) | private void updateInCurrentThread() {
method updateInNewThread (line 419) | private void updateInNewThread() {
class FrameCallback (line 462) | @TargetApi(16)
method doFrame (line 464) | @Override
method updateInChoreographer (line 470) | @TargetApi(16)
method syncTimer (line 501) | private final long syncTimer(long startMS) {
method syncTimerIfNeeded (line 548) | private void syncTimerIfNeeded() {
method initRenderingConfigs (line 554) | private void initRenderingConfigs() {
method prepare (line 564) | private void prepare(final Runnable runnable) {
method isPrepared (line 612) | public boolean isPrepared() {
method createDrawTask (line 616) | private IDrawTask createDrawTask(boolean useDrwaingCache, DanmakuTimer...
method seekTo (line 637) | public void seekTo(Long ms) {
method addDanmaku (line 646) | public void addDanmaku(BaseDanmaku item) {
method invalidateDanmaku (line 655) | public void invalidateDanmaku(BaseDanmaku item, boolean remeasure) {
method resume (line 662) | public void resume() {
method prepare (line 667) | public void prepare() {
method pause (line 679) | public void pause() {
method showDanmakus (line 685) | public void showDanmakus(Long position) {
method hideDanmakus (line 694) | public long hideDanmakus(boolean quitDrawTask) {
method forceRender (line 704) | public void forceRender() {
method getVisibility (line 709) | public boolean getVisibility() {
method draw (line 713) | public RenderingState draw(Canvas canvas) {
method redrawIfNeeded (line 753) | private void redrawIfNeeded() {
method notifyRendering (line 760) | private void notifyRendering() {
method waitRendering (line 782) | private void waitRendering(long dTime) {
method getAverageRenderingTime (line 816) | private synchronized long getAverageRenderingTime() {
method recordRenderingTime (line 829) | private synchronized void recordRenderingTime() {
method getDisplayer (line 839) | public IDisplayer getDisplayer(){
method notifyDispSizeChanged (line 843) | public void notifyDispSizeChanged(int width, int height) {
method removeAllDanmakus (line 853) | public void removeAllDanmakus(boolean isClearDanmakusOnScreen) {
method removeAllLiveDanmakus (line 859) | public void removeAllLiveDanmakus() {
method getCurrentVisibleDanmakus (line 865) | public IDanmakus getCurrentVisibleDanmakus() {
method getCurrentTime (line 873) | public long getCurrentTime() {
method clearDanmakusOnScreen (line 886) | public void clearDanmakusOnScreen() {
method getConfig (line 890) | public DanmakuContext getConfig() {
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/DrawHelper.java
class DrawHelper (line 26) | public class DrawHelper {
method useDrawColorToClearCanvas (line 43) | public static void useDrawColorToClearCanvas(boolean use, boolean useC...
method drawFPS (line 48) | public static void drawFPS(Canvas canvas, String text) {
method clearCanvas (line 60) | public static void clearCanvas(Canvas canvas) {
method fillTransparent (line 73) | public static void fillTransparent(Canvas canvas){
method clearCanvas (line 77) | public static void clearCanvas(Canvas canvas, float left, float top, f...
method clearCanvas (line 82) | private static void clearCanvas(Canvas canvas, RectF rect) {
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/DrawTask.java
class DrawTask (line 35) | public class DrawTask implements IDrawTask {
method onDanmakuConfigChanged (line 78) | @Override
method DrawTask (line 84) | public DrawTask(DanmakuTimer timer, DanmakuContext context,
method initTimer (line 114) | protected void initTimer(DanmakuTimer timer) {
method addDanmaku (line 118) | @Override
method invalidateDanmaku (line 150) | @Override
method removeAllDanmakus (line 162) | @Override
method onDanmakuRemoved (line 178) | protected void onDanmakuRemoved(BaseDanmaku danmaku) {
method removeAllLiveDanmakus (line 182) | @Override
method removeUnusedLiveDanmakusIn (line 200) | protected synchronized void removeUnusedLiveDanmakusIn(final int msec) {
method getVisibleDanmakusOnTime (line 224) | @Override
method draw (line 254) | @Override
method reset (line 259) | @Override
method seek (line 267) | @Override
method clearDanmakusOnScreen (line 288) | @Override
method start (line 296) | @Override
method quit (line 301) | @Override
method prepare (line 308) | public void prepare() {
method onPlayStateChanged (line 320) | @Override
method loadDanmakus (line 325) | protected void loadDanmakus(BaseDanmakuParser parser) {
method setParser (line 340) | public void setParser(BaseDanmakuParser parser) {
method drawDanmakus (line 345) | protected RenderingState drawDanmakus(AbsDisplayer disp, DanmakuTimer ...
method requestClear (line 413) | @Override
method requestClearRetainer (line 419) | @Override
method requestSync (line 424) | @Override
method onDanmakuConfigChanged (line 446) | public boolean onDanmakuConfigChanged(DanmakuContext config, DanmakuCo...
method handleOnDanmakuConfigChanged (line 455) | protected boolean handleOnDanmakuConfigChanged(DanmakuContext config, ...
method requestHide (line 489) | @Override
method requestRender (line 494) | @Override
method beginTracing (line 499) | private void beginTracing(RenderingState renderingState, IDanmakus run...
method endTracing (line 506) | private void endTracing(RenderingState renderingState) {
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/IDanmakuView.java
type IDanmakuView (line 12) | public interface IDanmakuView {
method isPrepared (line 20) | public boolean isPrepared();
method isPaused (line 22) | public boolean isPaused();
method isHardwareAccelerated (line 24) | public boolean isHardwareAccelerated();
method setDrawingThreadType (line 29) | public void setDrawingThreadType(int type);
method enableDanmakuDrawingCache (line 31) | public void enableDanmakuDrawingCache(boolean enable);
method isDanmakuDrawingCacheEnabled (line 33) | public boolean isDanmakuDrawingCacheEnabled();
method showFPS (line 35) | public void showFPS(boolean show);
method addDanmaku (line 41) | public void addDanmaku(BaseDanmaku item);
method invalidateDanmaku (line 43) | public void invalidateDanmaku(BaseDanmaku item, boolean remeasure);
method removeAllDanmakus (line 45) | public void removeAllDanmakus(boolean isClearDanmakusOnScreen);
method removeAllLiveDanmakus (line 47) | public void removeAllLiveDanmakus();
method getCurrentVisibleDanmakus (line 49) | public IDanmakus getCurrentVisibleDanmakus();
method setCallback (line 51) | public void setCallback(Callback callback);
method getCurrentTime (line 57) | public long getCurrentTime();
method getConfig (line 59) | public DanmakuContext getConfig();
method getView (line 63) | public View getView();
method getWidth (line 65) | public int getWidth();
method getHeight (line 67) | public int getHeight();
method setVisibility (line 69) | public void setVisibility(int visibility);
method isShown (line 71) | public boolean isShown();
method prepare (line 76) | public void prepare(BaseDanmakuParser parser, DanmakuContext config);
method seekTo (line 78) | public void seekTo(Long ms);
method start (line 80) | public void start();
method start (line 82) | public void start(long postion);
method stop (line 84) | public void stop();
method pause (line 86) | public void pause();
method resume (line 88) | public void resume();
method release (line 90) | public void release();
method toggle (line 92) | public void toggle();
method show (line 94) | public void show();
method hide (line 96) | public void hide();
method showAndResumeDrawTask (line 103) | public void showAndResumeDrawTask(Long position);
method hideAndPauseDrawTask (line 110) | public long hideAndPauseDrawTask();
method clearDanmakusOnScreen (line 112) | public void clearDanmakusOnScreen();
type OnDanmakuClickListener (line 115) | public interface OnDanmakuClickListener {
method onDanmakuClick (line 121) | boolean onDanmakuClick(IDanmakus danmakus);
method onDanmakuLongClick (line 123) | boolean onDanmakuLongClick(IDanmakus danmakus);
method onViewClick (line 125) | boolean onViewClick(IDanmakuView view);
method setOnDanmakuClickListener (line 128) | public void setOnDanmakuClickListener(OnDanmakuClickListener listener);
method setOnDanmakuClickListener (line 130) | public void setOnDanmakuClickListener(OnDanmakuClickListener listener,...
method getOnDanmakuClickListener (line 132) | public OnDanmakuClickListener getOnDanmakuClickListener();
method getXOff (line 134) | public float getXOff();
method getYOff (line 136) | public float getYOff();
method forceRender (line 138) | void forceRender();
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/IDanmakuViewController.java
type IDanmakuViewController (line 8) | public interface IDanmakuViewController {
method isViewReady (line 10) | public boolean isViewReady();
method getViewWidth (line 12) | public int getViewWidth();
method getViewHeight (line 14) | public int getViewHeight();
method getContext (line 16) | public Context getContext();
method drawDanmakus (line 18) | public long drawDanmakus();
method clear (line 20) | public void clear();
method isHardwareAccelerated (line 22) | public boolean isHardwareAccelerated();
method isDanmakuDrawingCacheEnabled (line 24) | public boolean isDanmakuDrawingCacheEnabled();
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/IDrawTask.java
type IDrawTask (line 25) | public interface IDrawTask {
method addDanmaku (line 29) | public void addDanmaku(BaseDanmaku item);
method removeAllDanmakus (line 31) | public void removeAllDanmakus(boolean isClearDanmakusOnScreen);
method removeAllLiveDanmakus (line 33) | public void removeAllLiveDanmakus();
method clearDanmakusOnScreen (line 35) | public void clearDanmakusOnScreen(long currMillis);
method getVisibleDanmakusOnTime (line 37) | public IDanmakus getVisibleDanmakusOnTime(long time);
method draw (line 39) | public RenderingState draw(AbsDisplayer displayer);
method reset (line 41) | public void reset();
method seek (line 43) | public void seek(long mills);
method start (line 45) | public void start();
method quit (line 47) | public void quit();
method prepare (line 49) | public void prepare();
method onPlayStateChanged (line 51) | public void onPlayStateChanged(int state);
method requestClear (line 53) | public void requestClear();
method requestClearRetainer (line 55) | void requestClearRetainer();
method requestSync (line 57) | void requestSync(long fromTimeMills, long toTimeMills, long offsetMills);
method setParser (line 59) | public void setParser(BaseDanmakuParser parser);
method invalidateDanmaku (line 61) | void invalidateDanmaku(BaseDanmaku item, boolean remeasure);
type TaskListener (line 63) | public interface TaskListener {
method ready (line 64) | public void ready();
method onDanmakuAdd (line 66) | public void onDanmakuAdd(BaseDanmaku danmaku);
method onDanmakuShown (line 68) | public void onDanmakuShown(BaseDanmaku danmaku);
method onDanmakuConfigChanged (line 70) | public void onDanmakuConfigChanged();
method onDanmakusDrawingFinished (line 72) | public void onDanmakusDrawingFinished();
method requestHide (line 75) | public void requestHide();
method requestRender (line 77) | void requestRender();
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/UpdateThread.java
class UpdateThread (line 4) | public class UpdateThread extends Thread {
method UpdateThread (line 6) | public UpdateThread(String name) {
method quit (line 12) | public void quit() {
method isQuited (line 16) | public boolean isQuited() {
method run (line 20) | @Override
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/loader/ILoader.java
type ILoader (line 23) | public interface ILoader {
method getDataSource (line 27) | IDataSource<?> getDataSource();
method load (line 31) | void load(String uri) throws IllegalDataException;
method load (line 36) | void load(InputStream in) throws IllegalDataException;
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/loader/IllegalDataException.java
class IllegalDataException (line 7) | public class IllegalDataException extends Exception {
method IllegalDataException (line 11) | public IllegalDataException() {
method IllegalDataException (line 15) | public IllegalDataException(String detailMessage, Throwable throwable) {
method IllegalDataException (line 19) | public IllegalDataException(String detailMessage) {
method IllegalDataException (line 23) | public IllegalDataException(Throwable throwable) {
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/loader/android/AcFunDanmakuLoader.java
class AcFunDanmakuLoader (line 14) | public class AcFunDanmakuLoader implements ILoader{
method AcFunDanmakuLoader (line 15) | private AcFunDanmakuLoader(){}
method instance (line 19) | public static ILoader instance() {
method getDataSource (line 29) | @Override
method load (line 34) | @Override
method load (line 43) | @Override
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/loader/android/BiliDanmakuLoader.java
class BiliDanmakuLoader (line 25) | public class BiliDanmakuLoader implements ILoader {
method BiliDanmakuLoader (line 31) | private BiliDanmakuLoader() {
method instance (line 35) | public static BiliDanmakuLoader instance() {
method load (line 42) | public void load(String uri) throws IllegalDataException {
method load (line 50) | public void load(InputStream stream) {
method getDataSource (line 54) | @Override
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/loader/android/DanmakuLoaderFactory.java
class DanmakuLoaderFactory (line 21) | public class DanmakuLoaderFactory {
method create (line 26) | public static ILoader create(String tag) {
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/AbsDanmakuSync.java
class AbsDanmakuSync (line 3) | public abstract class AbsDanmakuSync {
method getUptimeMillis (line 14) | public abstract long getUptimeMillis();
method getSyncState (line 21) | public abstract int getSyncState();
method getThresholdTimeMills (line 29) | public long getThresholdTimeMills() {
method isSyncPlayingState (line 37) | public boolean isSyncPlayingState() {
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/AbsDisplayer.java
class AbsDisplayer (line 5) | public abstract class AbsDisplayer<T, F> implements IDisplayer {
method getExtraData (line 7) | public abstract T getExtraData();
method setExtraData (line 9) | public abstract void setExtraData(T data);
method isHardwareAccelerated (line 11) | @Override
method drawDanmaku (line 16) | public abstract void drawDanmaku(BaseDanmaku danmaku, T canvas, float ...
method clearTextHeightCache (line 18) | public abstract void clearTextHeightCache();
method setTypeFace (line 20) | public abstract void setTypeFace(F font);
method setFakeBoldText (line 22) | public abstract void setFakeBoldText(boolean bold);
method setTransparency (line 24) | public abstract void setTransparency(int newTransparency);
method setScaleTextSizeFactor (line 26) | public abstract void setScaleTextSizeFactor(float factor);
method setCacheStuffer (line 28) | public abstract void setCacheStuffer(BaseCacheStuffer cacheStuffer);
method getCacheStuffer (line 30) | public abstract BaseCacheStuffer getCacheStuffer();
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/AlphaValue.java
class AlphaValue (line 4) | public class AlphaValue {
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/BaseDanmaku.java
class BaseDanmaku (line 21) | public abstract class BaseDanmaku {
method getDuration (line 221) | public long getDuration() {
method setDuration (line 225) | public void setDuration(Duration duration) {
method draw (line 229) | public int draw(IDisplayer displayer) {
method isMeasured (line 233) | public boolean isMeasured() {
method measure (line 238) | public void measure(IDisplayer displayer, boolean fromWorkerThread) {
method isPrepared (line 243) | public boolean isPrepared() {
method prepare (line 247) | public void prepare(IDisplayer displayer, boolean fromWorkerThread) {
method getDrawingCache (line 252) | public IDrawingCache<?> getDrawingCache() {
method isShown (line 256) | public boolean isShown() {
method isTimeOut (line 261) | public boolean isTimeOut() {
method isTimeOut (line 265) | public boolean isTimeOut(long ctime) {
method isOutside (line 269) | public boolean isOutside() {
method isOutside (line 273) | public boolean isOutside(long ctime) {
method isLate (line 278) | public boolean isLate() {
method hasPassedFilter (line 282) | public boolean hasPassedFilter() {
method isFiltered (line 290) | public boolean isFiltered() {
method isFilteredBy (line 294) | public boolean isFilteredBy(int flag) {
method setVisibility (line 298) | public void setVisibility(boolean b) {
method layout (line 306) | public abstract void layout(IDisplayer displayer, float x, float y);
method getRectAtTime (line 308) | public abstract float[] getRectAtTime(IDisplayer displayer, long currT...
method getLeft (line 310) | public abstract float getLeft();
method getTop (line 312) | public abstract float getTop();
method getRight (line 314) | public abstract float getRight();
method getBottom (line 316) | public abstract float getBottom();
method getType (line 324) | public abstract int getType();
method getTimer (line 326) | public DanmakuTimer getTimer() {
method setTimer (line 330) | public void setTimer(DanmakuTimer timer) {
method getAlpha (line 334) | public int getAlpha() {
method setTag (line 338) | public void setTag(Object tag) {
method setTag (line 342) | public void setTag(int key, Object tag) {
method getTag (line 346) | public Object getTag(int key) {
method setTimeOffset (line 353) | public void setTimeOffset(long timeOffset) {
method setTime (line 358) | public void setTime(long time) {
method getTime (line 363) | public long getTime() {
method getActualTime (line 367) | public long getActualTime() {
method isOffset (line 375) | public boolean isOffset() {
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/Danmaku.java
class Danmaku (line 21) | public class Danmaku extends BaseDanmaku {
method Danmaku (line 23) | public Danmaku(CharSequence text) {
method isShown (line 27) | @Override
method layout (line 32) | @Override
method getRectAtTime (line 37) | @Override
method getLeft (line 42) | @Override
method getTop (line 47) | @Override
method getRight (line 52) | @Override
method getBottom (line 57) | @Override
method getType (line 62) | @Override
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/DanmakuTimer.java
class DanmakuTimer (line 19) | public class DanmakuTimer {
method DanmakuTimer (line 24) | public DanmakuTimer() {
method DanmakuTimer (line 28) | public DanmakuTimer(long curr) {
method update (line 32) | public long update(long curr) {
method add (line 38) | public long add(long mills) {
method lastInterval (line 42) | public long lastInterval() {
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/Duration.java
class Duration (line 4) | public class Duration implements Cloneable {
method Duration (line 12) | public Duration(long initialDuration) {
method setValue (line 17) | public void setValue(long initialDuration) {
method setFactor (line 22) | public void setFactor(float f) {
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/FBDanmaku.java
class FBDanmaku (line 19) | public class FBDanmaku extends FTDanmaku {
method FBDanmaku (line 21) | public FBDanmaku(Duration duration) {
method getType (line 25) | @Override
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/FTDanmaku.java
class FTDanmaku (line 22) | public class FTDanmaku extends BaseDanmaku {
method FTDanmaku (line 36) | public FTDanmaku(Duration duration) {
method layout (line 40) | @Override
method getLeft (line 60) | protected float getLeft(IDisplayer displayer) {
method getRectAtTime (line 71) | @Override
method getLeft (line 86) | @Override
method getTop (line 91) | @Override
method getRight (line 96) | @Override
method getBottom (line 101) | @Override
method getType (line 106) | @Override
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/GlobalFlagValues.java
class GlobalFlagValues (line 3) | public class GlobalFlagValues {
method resetAll (line 12) | public void resetAll() {
method updateAll (line 21) | public void updateAll() {
method updateVisibleFlag (line 30) | public void updateVisibleFlag() {
method updateMeasureFlag (line 34) | public void updateMeasureFlag() {
method updateFilterFlag (line 38) | public void updateFilterFlag() {
method updateFirstShownFlag (line 42) | public void updateFirstShownFlag() {
method updateSyncOffsetTimeFlag (line 46) | public void updateSyncOffsetTimeFlag() {
method updatePrepareFlag (line 50) | public void updatePrepareFlag() {
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/ICacheManager.java
type ICacheManager (line 22) | public interface ICacheManager {
method addDanmaku (line 23) | void addDanmaku(BaseDanmaku danmaku);
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/IDanmakuIterator.java
type IDanmakuIterator (line 3) | public interface IDanmakuIterator {
method next (line 5) | public BaseDanmaku next();
method hasNext (line 7) | public boolean hasNext();
method reset (line 9) | public void reset();
method remove (line 11) | public void remove();
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/IDanmakus.java
type IDanmakus (line 24) | public interface IDanmakus {
class Consumer (line 26) | abstract class Consumer<Progress, Result> {
method accept (line 43) | public abstract int accept(Progress t);
method before (line 45) | public void before() {
method after (line 49) | public void after() {
method result (line 53) | public Result result() {
class DefaultConsumer (line 58) | abstract class DefaultConsumer<Progress> extends Consumer<Progress, Vo...
method addItem (line 74) | boolean addItem(BaseDanmaku item);
method removeItem (line 76) | boolean removeItem(BaseDanmaku item);
method subnew (line 78) | IDanmakus subnew(long startTime, long endTime);
method sub (line 80) | IDanmakus sub(long startTime, long endTime);
method size (line 82) | int size();
method clear (line 84) | void clear();
method first (line 86) | BaseDanmaku first();
method last (line 88) | BaseDanmaku last();
method contains (line 90) | boolean contains(BaseDanmaku item);
method isEmpty (line 92) | boolean isEmpty();
method setSubItemsDuplicateMergingEnabled (line 94) | void setSubItemsDuplicateMergingEnabled(boolean enable);
method getCollection (line 96) | Collection<BaseDanmaku> getCollection();
method forEachSync (line 98) | void forEachSync(Consumer<? super BaseDanmaku, ?> consumer);
method forEach (line 100) | void forEach(Consumer<? super BaseDanmaku, ?> consumer);
method obtainSynchronizer (line 102) | Object obtainSynchronizer();
class BaseComparator (line 104) | class BaseComparator implements Comparator<BaseDanmaku> {
method BaseComparator (line 108) | public BaseComparator(boolean duplicateMergingEnabled) {
method setDuplicateMergingEnabled (line 112) | public void setDuplicateMergingEnabled(boolean enable) {
method compare (line 116) | @Override
class TimeComparator (line 126) | class TimeComparator extends BaseComparator {
method TimeComparator (line 128) | public TimeComparator(boolean duplicateMergingEnabled) {
method compare (line 132) | @Override
class YPosComparator (line 138) | class YPosComparator extends BaseComparator {
method YPosComparator (line 140) | public YPosComparator(boolean duplicateMergingEnabled) {
method compare (line 144) | @Override
class YPosDescComparator (line 153) | class YPosDescComparator extends BaseComparator {
method YPosDescComparator (line 155) | public YPosDescComparator(boolean duplicateMergingEnabled) {
method compare (line 159) | @Override
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/IDisplayer.java
type IDisplayer (line 20) | public interface IDisplayer {
method getWidth (line 28) | int getWidth();
method getHeight (line 30) | int getHeight();
method getDensity (line 32) | float getDensity();
method getDensityDpi (line 34) | int getDensityDpi();
method draw (line 36) | int draw(BaseDanmaku danmaku);
method recycle (line 38) | void recycle(BaseDanmaku danmaku);
method getScaledDensity (line 40) | float getScaledDensity();
method getSlopPixel (line 42) | int getSlopPixel();
method prepare (line 44) | void prepare(BaseDanmaku danmaku, boolean fromWorkerThread);
method measure (line 46) | void measure(BaseDanmaku danmaku, boolean fromWorkerThread);
method getStrokeWidth (line 48) | float getStrokeWidth();
method setHardwareAccelerated (line 50) | void setHardwareAccelerated(boolean enable);
method isHardwareAccelerated (line 52) | boolean isHardwareAccelerated();
method getMaximumCacheWidth (line 54) | int getMaximumCacheWidth();
method getMaximumCacheHeight (line 56) | int getMaximumCacheHeight();
method resetSlopPixel (line 61) | void resetSlopPixel(float factor);
method setDensities (line 63) | void setDensities(float density, int densityDpi, float scaledDensity);
method setSize (line 65) | void setSize(int width, int height);
method setDanmakuStyle (line 67) | void setDanmakuStyle(int style, float[] data);
method setMargin (line 69) | void setMargin(int m);
method getMargin (line 71) | int getMargin();
method setAllMarginTop (line 73) | void setAllMarginTop(int m);
method getAllMarginTop (line 75) | int getAllMarginTop();
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/IDrawingCache.java
type IDrawingCache (line 4) | public interface IDrawingCache<T> {
method build (line 6) | public void build(int w, int h, int density, boolean checkSizeEquals, ...
method erase (line 8) | public void erase();
method get (line 10) | public T get();
method destroy (line 12) | public void destroy();
method size (line 14) | public int size();
method width (line 16) | public int width();
method height (line 18) | public int height();
method hasReferences (line 20) | public boolean hasReferences();
method increaseReference (line 22) | public void increaseReference();
method decreaseReference (line 24) | public void decreaseReference();
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/L2RDanmaku.java
class L2RDanmaku (line 20) | public class L2RDanmaku extends R2LDanmaku {
method L2RDanmaku (line 22) | public L2RDanmaku(Duration duration) {
method layout (line 26) | @Override
method getRectAtTime (line 45) | @Override
method getAccurateLeft (line 60) | protected float getAccurateLeft(IDisplayer displayer, long currTime) {
method getLeft (line 68) | @Override
method getTop (line 73) | @Override
method getRight (line 78) | @Override
method getBottom (line 83) | @Override
method getType (line 88) | @Override
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/R2LDanmaku.java
class R2LDanmaku (line 21) | public class R2LDanmaku extends BaseDanmaku {
method R2LDanmaku (line 39) | public R2LDanmaku(Duration duration) {
method layout (line 43) | @Override
method getAccurateLeft (line 62) | protected float getAccurateLeft(IDisplayer displayer, long currTime) {
method getRectAtTime (line 71) | @Override
method getLeft (line 86) | @Override
method getTop (line 91) | @Override
method getRight (line 96) | @Override
method getBottom (line 101) | @Override
method getType (line 106) | @Override
method measure (line 111) | @Override
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/SpecialDanmaku.java
class SpecialDanmaku (line 19) | public class SpecialDanmaku extends BaseDanmaku {
class ScaleFactor (line 21) | public static class ScaleFactor {
method ScaleFactor (line 28) | public ScaleFactor(int width, int height, float scaleX, float scaleY) {
method update (line 32) | public void update(int width, int height, float scaleX, float scaleY) {
method isUpdated (line 42) | public boolean isUpdated(int flag, int width, int height) {
class Point (line 47) | private class Point {
method Point (line 50) | public Point(float x, float y) {
method getDistance (line 55) | public float getDistance(Point p) {
class LinePath (line 62) | public class LinePath {
method setPoints (line 67) | public void setPoints(Point pBegin, Point pEnd) {
method getDistance (line 74) | public float getDistance() {
method getBeginPoint (line 78) | public float[] getBeginPoint() {
method getEndPoint (line 84) | public float[] getEndPoint() {
method measure (line 131) | @Override
method layout (line 140) | @Override
method getRectAtTime (line 145) | @Override
method getQuadEaseOutProgress (line 244) | private final static float getQuadEaseOutProgress(long ctime, long dur...
method getLeft (line 256) | @Override
method getTop (line 261) | @Override
method getRight (line 266) | @Override
method getBottom (line 271) | @Override
method getType (line 276) | @Override
method setTranslationData (line 281) | public void setTranslationData(float beginX, float beginY, float endX,...
method setAlphaData (line 293) | public void setAlphaData(int beginAlpha, int endAlpha, long alphaDurat...
method setLinePathData (line 303) | public void setLinePathData(float[][] points) {
method setScaleFactor (line 333) | public void setScaleFactor(ScaleFactor scaleFactor) {
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/android/AndroidDisplayer.java
class AndroidDisplayer (line 37) | public class AndroidDisplayer extends AbsDisplayer<Canvas, Typeface> {
class DisplayerConfig (line 39) | public static class DisplayerConfig {
method DisplayerConfig (line 108) | public DisplayerConfig() {
method setTypeface (line 121) | public void setTypeface(Typeface typeface) {
method setShadowRadius (line 125) | public void setShadowRadius(float shadowRadius) {
method setStrokeWidth (line 129) | public void setStrokeWidth(float s) {
method setProjectionConfig (line 134) | public void setProjectionConfig(float offsetX, float offsetY, int al...
method setFakeBoldText (line 142) | public void setFakeBoldText(boolean fakeBoldText) {
method setTransparency (line 146) | public void setTransparency(int newTransparency) {
method setScaleTextSizeFactor (line 151) | public void setScaleTextSizeFactor(float factor) {
method applyTextScaleConfig (line 156) | private void applyTextScaleConfig(BaseDanmaku danmaku, Paint paint) {
method hasStroke (line 169) | public boolean hasStroke(BaseDanmaku danmaku) {
method getBorderPaint (line 173) | public Paint getBorderPaint(BaseDanmaku danmaku) {
method getUnderlinePaint (line 178) | public Paint getUnderlinePaint(BaseDanmaku danmaku) {
method getPaint (line 183) | public TextPaint getPaint(BaseDanmaku danmaku, boolean fromWorkerThr...
method applyPaintConfig (line 204) | public void applyPaintConfig(BaseDanmaku danmaku, Paint paint, boole...
method clearTextHeightCache (line 237) | public void clearTextHeightCache() {
method getStrokeWidth (line 241) | public float getStrokeWidth() {
method definePaintParams (line 254) | public void definePaintParams(boolean fromWorkerThread) {
method AndroidDisplayer (line 270) | public AndroidDisplayer() {
method getMaximumBitmapWidth (line 274) | @SuppressLint("NewApi")
method getMaximumBitmapHeight (line 283) | @SuppressLint("NewApi")
method setTypeFace (line 292) | public void setTypeFace(Typeface font) {
method setShadowRadius (line 296) | public void setShadowRadius(float s) {
method setPaintStorkeWidth (line 300) | public void setPaintStorkeWidth(float s) {
method setProjectionConfig (line 304) | public void setProjectionConfig(float offsetX, float offsetY, int alph...
method setFakeBoldText (line 308) | public void setFakeBoldText(boolean fakeBoldText) {
method setTransparency (line 312) | @Override
method setScaleTextSizeFactor (line 317) | @Override
method setCacheStuffer (line 322) | @Override
method getCacheStuffer (line 329) | @Override
method setMargin (line 334) | @Override
method getMargin (line 339) | @Override
method setAllMarginTop (line 344) | @Override
method getAllMarginTop (line 349) | @Override
method update (line 376) | private void update(Canvas c) {
method getWidth (line 388) | @Override
method getHeight (line 393) | @Override
method getDensity (line 398) | @Override
method getDensityDpi (line 403) | @Override
method draw (line 408) | @Override
method recycle (line 461) | @Override
method resetPaintAlpha (line 468) | private void resetPaintAlpha(Paint paint) {
method restoreCanvas (line 474) | private void restoreCanvas(Canvas canvas) {
method saveCanvas (line 478) | private int saveCanvas(BaseDanmaku danmaku, Canvas canvas, float left,...
method drawDanmaku (line 494) | @Override
method getPaint (line 502) | private synchronized TextPaint getPaint(BaseDanmaku danmaku, boolean f...
method prepare (line 506) | @Override
method measure (line 513) | @Override
method calcPaintWH (line 525) | private void calcPaintWH(BaseDanmaku danmaku, TextPaint paint, boolean...
method setDanmakuPaintWidthAndHeight (line 530) | private void setDanmakuPaintWidthAndHeight(BaseDanmaku danmaku, float ...
method clearTextHeightCache (line 541) | @Override
method getScaledDensity (line 547) | @Override
method resetSlopPixel (line 552) | @Override
method getSlopPixel (line 561) | @Override
method setDensities (line 566) | @Override
method setSize (line 573) | @Override
method setDanmakuStyle (line 580) | @Override
method setExtraData (line 610) | @Override
method getExtraData (line 615) | @Override
method getStrokeWidth (line 620) | @Override
method setHardwareAccelerated (line 625) | @Override
method isHardwareAccelerated (line 630) | @Override
method getMaximumCacheWidth (line 635) | @Override
method getMaximumCacheHeight (line 640) | @Override
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/android/BaseCacheStuffer.java
class BaseCacheStuffer (line 13) | public abstract class BaseCacheStuffer {
class Proxy (line 15) | public static abstract class Proxy {
method prepareDrawing (line 22) | public abstract void prepareDrawing(BaseDanmaku danmaku, boolean fro...
method releaseResource (line 24) | public abstract void releaseResource(BaseDanmaku danmaku);
method prepare (line 30) | public void prepare(BaseDanmaku danmaku, boolean fromWorkerThread) {
method measure (line 41) | public abstract void measure(BaseDanmaku danmaku, TextPaint paint, boo...
method clearCaches (line 46) | public abstract void clearCaches();
method drawDanmaku (line 48) | public abstract void drawDanmaku(BaseDanmaku danmaku, Canvas canvas, f...
method drawCache (line 50) | public boolean drawCache(BaseDanmaku danmaku, Canvas canvas, float lef...
method clearCache (line 61) | public void clearCache(BaseDanmaku danmaku) {
method setProxy (line 65) | public void setProxy(Proxy adapter) {
method releaseResource (line 69) | public void releaseResource(BaseDanmaku danmaku) {
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/android/CachingPolicy.java
class CachingPolicy (line 14) | public class CachingPolicy {
method CachingPolicy (line 26) | public CachingPolicy(int bitsPerPixelOfCache, float maxCachePoolSizeFa...
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/android/DanmakuContext.java
class DanmakuContext (line 21) | public class DanmakuContext implements Cloneable {
method create (line 23) | public static DanmakuContext create() {
type DanmakuConfigTag (line 27) | public enum DanmakuConfigTag {
method isVisibilityRelatedTag (line 30) | public boolean isVisibilityRelatedTag() {
method getBaseComparator (line 111) | public IDanmakus.BaseComparator getBaseComparator() {
method setBaseComparator (line 115) | public void setBaseComparator(IDanmakus.BaseComparator baseComparator) {
method getDisplayer (line 119) | public AbsDisplayer getDisplayer() {
method setTypeface (line 137) | public DanmakuContext setTypeface(Typeface font) {
method setDanmakuTransparency (line 147) | public DanmakuContext setDanmakuTransparency(float p) {
method setScaleTextSize (line 157) | public DanmakuContext setScaleTextSize(float p) {
method setDanmakuMargin (line 169) | public DanmakuContext setDanmakuMargin(int m) {
method setMarginTop (line 180) | public DanmakuContext setMarginTop(int m) {
method getFTDanmakuVisibility (line 188) | public boolean getFTDanmakuVisibility() {
method setFTDanmakuVisibility (line 197) | public DanmakuContext setFTDanmakuVisibility(boolean visible) {
method setFilterData (line 208) | private <T> void setFilterData(String tag, T data) {
method setFilterData (line 212) | private <T> void setFilterData(String tag, T data, boolean primary) {
method setDanmakuVisible (line 218) | private void setDanmakuVisible(boolean visible, int type) {
method getFBDanmakuVisibility (line 229) | public boolean getFBDanmakuVisibility() {
method setFBDanmakuVisibility (line 238) | public DanmakuContext setFBDanmakuVisibility(boolean visible) {
method getL2RDanmakuVisibility (line 252) | public boolean getL2RDanmakuVisibility() {
method setL2RDanmakuVisibility (line 261) | public DanmakuContext setL2RDanmakuVisibility(boolean visible) {
method getR2LDanmakuVisibility (line 275) | public boolean getR2LDanmakuVisibility() {
method setR2LDanmakuVisibility (line 284) | public DanmakuContext setR2LDanmakuVisibility(boolean visible) {
method getSpecialDanmakuVisibility (line 298) | public boolean getSpecialDanmakuVisibility() {
method setSpecialDanmakuVisibility (line 307) | public DanmakuContext setSpecialDanmakuVisibility(boolean visible) {
method setMaximumVisibleSizeInScreen (line 324) | public DanmakuContext setMaximumVisibleSizeInScreen(int maxSize) {
method setDanmakuStyle (line 360) | public DanmakuContext setDanmakuStyle(int style, float... values) {
method setDanmakuBold (line 372) | public DanmakuContext setDanmakuBold(boolean bold) {
method setColorValueWhiteList (line 383) | public DanmakuContext setColorValueWhiteList(Integer... colors) {
method getColorValueWhiteList (line 396) | public List<Integer> getColorValueWhiteList(){
method setUserHashBlackList (line 405) | public DanmakuContext setUserHashBlackList(String... hashes) {
method removeUserHashBlackList (line 418) | public DanmakuContext removeUserHashBlackList(String... hashes){
method addUserHashBlackList (line 436) | public DanmakuContext addUserHashBlackList(String... hashes){
method getUserHashBlackList (line 447) | public List<String> getUserHashBlackList(){
method setUserIdBlackList (line 457) | public DanmakuContext setUserIdBlackList(Integer... ids) {
method removeUserIdBlackList (line 470) | public DanmakuContext removeUserIdBlackList(Integer... ids){
method addUserIdBlackList (line 488) | public DanmakuContext addUserIdBlackList(Integer... ids){
method getUserIdBlackList (line 499) | public List<Integer> getUserIdBlackList(){
method blockGuestDanmaku (line 508) | public DanmakuContext blockGuestDanmaku(boolean block) {
method setScrollSpeedFactor (line 527) | public DanmakuContext setScrollSpeedFactor(float p){
method setDuplicateMergingEnabled (line 543) | public DanmakuContext setDuplicateMergingEnabled(boolean enable) {
method isDuplicateMergingEnabled (line 552) | public boolean isDuplicateMergingEnabled() {
method alignBottom (line 556) | public DanmakuContext alignBottom(boolean enable) {
method isAlignBottom (line 565) | public boolean isAlignBottom() {
method setMaximumLines (line 576) | public DanmakuContext setMaximumLines(Map<Integer, Integer> pairs) {
method setOverlapping (line 588) | @Deprecated
method preventOverlapping (line 600) | public DanmakuContext preventOverlapping(Map<Integer, Boolean> pairs) {
method isMaxLinesLimited (line 612) | public boolean isMaxLinesLimited() {
method isPreventOverlappingEnabled (line 616) | public boolean isPreventOverlappingEnabled() {
method setCacheStuffer (line 626) | public DanmakuContext setCacheStuffer(BaseCacheStuffer cacheStuffer, B...
method setDanmakuSync (line 635) | public DanmakuContext setDanmakuSync(AbsDanmakuSync danmakuSync) {
method setCachingPolicy (line 640) | public DanmakuContext setCachingPolicy(CachingPolicy cachingPolicy) {
type ConfigChangedCallback (line 645) | public interface ConfigChangedCallback {
method onDanmakuConfigChanged (line 646) | public boolean onDanmakuConfigChanged(DanmakuContext config, Danmaku...
method registerConfigChangedCallback (line 650) | public void registerConfigChangedCallback(ConfigChangedCallback listen...
method unregisterConfigChangedCallback (line 662) | public void unregisterConfigChangedCallback(ConfigChangedCallback list...
method unregisterAllConfigChangedCallbacks (line 673) | public void unregisterAllConfigChangedCallbacks() {
method notifyConfigureChanged (line 680) | private void notifyConfigureChanged(DanmakuConfigTag tag, Object... va...
method registerFilter (line 691) | public DanmakuContext registerFilter(DanmakuFilters.BaseDanmakuFilter ...
method unregisterFilter (line 697) | public DanmakuContext unregisterFilter(DanmakuFilters.BaseDanmakuFilte...
method resetContext (line 703) | public DanmakuContext resetContext() {
method clone (line 712) | @Override
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/android/DanmakuFactory.java
class DanmakuFactory (line 30) | public class DanmakuFactory {
method create (line 67) | public static DanmakuFactory create() {
method DanmakuFactory (line 71) | protected DanmakuFactory() {
method resetDurationsData (line 75) | public void resetDurationsData() {
method notifyDispSizeChanged (line 84) | public void notifyDispSizeChanged(DanmakuContext context) {
method createDanmaku (line 90) | public BaseDanmaku createDanmaku(int type) {
method createDanmaku (line 94) | public BaseDanmaku createDanmaku(int type, DanmakuContext context) {
method createDanmaku (line 102) | public BaseDanmaku createDanmaku(int type, IDisplayer disp, float view...
method createDanmaku (line 118) | public BaseDanmaku createDanmaku(int type, int viewportWidth, int view...
method createDanmaku (line 132) | public BaseDanmaku createDanmaku(int type, float viewportWidth, float ...
method updateScaleFactor (line 185) | private void updateScaleFactor(int width, int height, float scaleX, fl...
method updateViewportState (line 192) | public boolean updateViewportState(float viewportWidth, float viewport...
method updateSpecialDanmakusDate (line 212) | private synchronized void updateSpecialDanmakusDate(int width, int hei...
method updateMaxDanmakuDuration (line 218) | public void updateMaxDanmakuDuration() {
method updateDurationFactor (line 230) | public void updateDurationFactor(float f) {
method fillTranslationData (line 249) | public void fillTranslationData(BaseDanmaku item, float beginX, float ...
method fillLinePathData (line 259) | public static void fillLinePathData(BaseDanmaku item, float[][] points...
method fillAlphaData (line 279) | public void fillAlphaData(BaseDanmaku item, int beginAlpha, int endAlpha,
method updateSpecicalDanmakuDuration (line 287) | private void updateSpecicalDanmakuDuration(BaseDanmaku item) {
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/android/Danmakus.java
class Danmakus (line 31) | public class Danmakus implements IDanmakus {
method Danmakus (line 52) | public Danmakus() {
method Danmakus (line 56) | public Danmakus(int sortType) {
method Danmakus (line 60) | public Danmakus(int sortType, boolean duplicateMergingEnabled) {
method Danmakus (line 64) | public Danmakus(int sortType, boolean duplicateMergingEnabled, BaseCom...
method Danmakus (line 85) | public Danmakus(Collection<BaseDanmaku> items) {
method Danmakus (line 89) | public Danmakus(boolean duplicateMergingEnabled) {
method setItems (line 93) | public void setItems(Collection<BaseDanmaku> items) {
method addItem (line 109) | @Override
method removeItem (line 126) | @Override
method subset (line 143) | private Collection<BaseDanmaku> subset(long startTime, long endTime) {
method subnew (line 163) | @Override
method sub (line 173) | @Override
method createItem (line 215) | private BaseDanmaku createItem(String text) {
method size (line 219) | public int size() {
method clear (line 223) | @Override
method first (line 238) | @Override
method last (line 249) | @Override
method contains (line 260) | @Override
method isEmpty (line 265) | @Override
method setDuplicateMergingEnabled (line 270) | private void setDuplicateMergingEnabled(boolean enable) {
method setSubItemsDuplicateMergingEnabled (line 275) | @Override
method getCollection (line 286) | @Override
method forEachSync (line 291) | @Override
method forEach (line 298) | @Override
method obtainSynchronizer (line 322) | @Override
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/android/DrawingCache.java
class DrawingCache (line 7) | public class DrawingCache implements IDrawingCache<DrawingCacheHolder>, ...
method DrawingCache (line 19) | public DrawingCache() {
method build (line 23) | @Override
method erase (line 30) | @Override
method get (line 35) | @Override
method destroy (line 44) | @Override
method size (line 53) | @Override
method setNextPoolable (line 58) | @Override
method getNextPoolable (line 63) | @Override
method isPooled (line 68) | @Override
method setPooled (line 73) | @Override
method hasReferences (line 78) | @Override
method increaseReference (line 83) | @Override
method decreaseReference (line 88) | @Override
method width (line 93) | @Override
method height (line 98) | @Override
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/android/DrawingCacheHolder.java
class DrawingCacheHolder (line 13) | public class DrawingCacheHolder {
method DrawingCacheHolder (line 31) | public DrawingCacheHolder() {
method buildCache (line 35) | public void buildCache(int w, int h, int density, boolean checkSizeEqu...
method erase (line 66) | public void erase() {
method recycle (line 71) | public synchronized void recycle() {
method splitWith (line 82) | @SuppressLint("NewApi")
method eraseBitmap (line 124) | private void eraseBitmap(Bitmap bmp) {
method eraseBitmapArray (line 130) | private void eraseBitmapArray() {
method recycleBitmapArray (line 140) | private void recycleBitmapArray() {
method draw (line 155) | public final synchronized boolean draw(Canvas canvas, float left, floa...
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/android/DrawingCachePoolManager.java
class DrawingCachePoolManager (line 6) | public class DrawingCachePoolManager implements PoolableManager<DrawingC...
method newInstance (line 8) | @Override
method onAcquired (line 13) | @Override
method onReleased (line 18) | @Override
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/android/SimpleTextCacheStuffer.java
class SimpleTextCacheStuffer (line 16) | public class SimpleTextCacheStuffer extends BaseCacheStuffer {
method getCacheHeight (line 20) | protected Float getCacheHeight(BaseDanmaku danmaku, Paint paint) {
method measure (line 31) | @Override
method drawStroke (line 57) | protected void drawStroke(BaseDanmaku danmaku, String lineText, Canvas...
method drawText (line 65) | protected void drawText(BaseDanmaku danmaku, String lineText, Canvas c...
method clearCaches (line 76) | @Override
method drawBackground (line 81) | protected void drawBackground(BaseDanmaku danmaku, Canvas canvas, floa...
method drawDanmaku (line 85) | @Override
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/android/SpannedCacheStuffer.java
class SpannedCacheStuffer (line 17) | public class SpannedCacheStuffer extends SimpleTextCacheStuffer {
method measure (line 19) | @Override
method drawStroke (line 34) | @Override
method drawText (line 41) | @Override
method clearCaches (line 83) | @Override
method clearCache (line 89) | @Override
method releaseResource (line 97) | @Override
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/android/ViewCacheStuffer.java
class ViewCacheStuffer (line 14) | public abstract class ViewCacheStuffer<VH extends ViewCacheStuffer.ViewH...
class ViewHolder (line 16) | public static abstract class ViewHolder {
method ViewHolder (line 20) | public ViewHolder(View itemView) {
method measure (line 27) | public void measure(int widthMeasureSpec, int heightMeasureSpec) {
method getMeasureWidth (line 31) | public int getMeasureWidth() {
method getMeasureHeight (line 35) | public int getMeasureHeight() {
method layout (line 39) | public void layout(int l, int t, int r, int b) {
method draw (line 43) | public void draw(Canvas canvas, AndroidDisplayer.DisplayerConfig dis...
method onCreateViewHolder (line 58) | public abstract VH onCreateViewHolder(int viewType);
method onBindViewHolder (line 60) | public abstract void onBindViewHolder(int viewType, VH viewHolder, Bas...
method getItemViewType (line 62) | public int getItemViewType(int position, BaseDanmaku danmaku) {
method ViewCacheStuffer (line 66) | public ViewCacheStuffer() {
method measure (line 71) | @Override
method clearCaches (line 91) | @Override
method releaseResource (line 96) | @Override
method drawDanmaku (line 102) | @Override
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/objectpool/FinitePool.java
class FinitePool (line 19) | class FinitePool<T extends Poolable<T>> implements Pool<T> {
method FinitePool (line 35) | FinitePool(PoolableManager<T> manager) {
method FinitePool (line 41) | FinitePool(PoolableManager<T> manager, int limit) {
method acquire (line 51) | public T acquire() {
method release (line 71) | public void release(T element) {
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/objectpool/Pool.java
type Pool (line 19) | public interface Pool<T extends Poolable<T>> {
method acquire (line 20) | T acquire();
method release (line 22) | void release(T element);
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/objectpool/Poolable.java
type Poolable (line 19) | public interface Poolable<T> {
method setNextPoolable (line 20) | void setNextPoolable(T element);
method getNextPoolable (line 22) | T getNextPoolable();
method isPooled (line 24) | boolean isPooled();
method setPooled (line 26) | void setPooled(boolean isPooled);
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/objectpool/PoolableManager.java
type PoolableManager (line 19) | public interface PoolableManager<T extends Poolable<T>> {
method newInstance (line 20) | T newInstance();
method onAcquired (line 22) | void onAcquired(T element);
method onReleased (line 24) | void onReleased(T element);
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/objectpool/Pools.java
class Pools (line 19) | public class Pools {
method Pools (line 20) | private Pools() {
method simplePool (line 23) | public static <T extends Poolable<T>> Pool<T> simplePool(PoolableManag...
method finitePool (line 27) | public static <T extends Poolable<T>> Pool<T> finitePool(PoolableManag...
method synchronizedPool (line 31) | public static <T extends Poolable<T>> Pool<T> synchronizedPool(Pool<T>...
method synchronizedPool (line 35) | public static <T extends Poolable<T>> Pool<T> synchronizedPool(Pool<T>...
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/objectpool/SynchronizedPool.java
class SynchronizedPool (line 19) | class SynchronizedPool<T extends Poolable<T>> implements Pool<T> {
method SynchronizedPool (line 24) | public SynchronizedPool(Pool<T> pool) {
method SynchronizedPool (line 29) | public SynchronizedPool(Pool<T> pool, Object lock) {
method acquire (line 34) | public T acquire() {
method release (line 40) | public void release(T element) {
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/parser/BaseDanmakuParser.java
class BaseDanmakuParser (line 28) | public abstract class BaseDanmakuParser {
type Listener (line 30) | public interface Listener {
method onDanmakuAdd (line 31) | void onDanmakuAdd(BaseDanmaku danmaku);
method setDisplayer (line 48) | public BaseDanmakuParser setDisplayer(IDisplayer disp){
method getDisplayer (line 59) | public IDisplayer getDisplayer(){
method setListener (line 63) | public BaseDanmakuParser setListener(Listener listener) {
method getViewportSizeFactor (line 72) | protected float getViewportSizeFactor() {
method load (line 76) | public BaseDanmakuParser load(IDataSource<?> source) {
method setTimer (line 81) | public BaseDanmakuParser setTimer(DanmakuTimer timer) {
method getTimer (line 86) | public DanmakuTimer getTimer() {
method getDanmakus (line 90) | public IDanmakus getDanmakus() {
method releaseDataSource (line 100) | protected void releaseDataSource() {
method parse (line 106) | protected abstract IDanmakus parse();
method release (line 108) | public void release() {
method setConfig (line 112) | public BaseDanmakuParser setConfig(DanmakuContext config) {
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/parser/IDataSource.java
type IDataSource (line 19) | public interface IDataSource<T> {
method data (line 24) | public T data();
method release (line 26) | public void release();
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/parser/android/AndroidFileSource.java
class AndroidFileSource (line 28) | public class AndroidFileSource implements IDataSource<InputStream> {
method AndroidFileSource (line 32) | public AndroidFileSource(String filepath) {
method AndroidFileSource (line 36) | public AndroidFileSource(Uri uri) {
method AndroidFileSource (line 40) | public AndroidFileSource(File file) {
method AndroidFileSource (line 44) | public AndroidFileSource(InputStream stream) {
method fillStreamFromFile (line 48) | public void fillStreamFromFile(File file) {
method fillStreamFromUri (line 56) | public void fillStreamFromUri(Uri uri) {
method fillStreamFromHttpFile (line 65) | public void fillStreamFromHttpFile(Uri uri) {
method release (line 79) | @Override
method data (line 85) | @Override
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/parser/android/JSONSource.java
class JSONSource (line 23) | public class JSONSource implements IDataSource<JSONArray>{
method JSONSource (line 26) | public JSONSource(String json) throws JSONException{
method JSONSource (line 30) | public JSONSource(InputStream in) throws JSONException{
method init (line 34) | private void init(InputStream in) throws JSONException {
method JSONSource (line 42) | public JSONSource(URL url) throws JSONException, IOException{
method JSONSource (line 46) | public JSONSource(File file) throws FileNotFoundException, JSONException{
method JSONSource (line 50) | public JSONSource(Uri uri) throws IOException, JSONException {
method init (line 59) | private void init(String json) throws JSONException {
method data (line 64) | public JSONArray data(){
method release (line 68) | @Override
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/renderer/IRenderer.java
type IRenderer (line 27) | public interface IRenderer {
type OnDanmakuShownListener (line 33) | interface OnDanmakuShownListener {
method onDanmakuShown (line 34) | void onDanmakuShown(BaseDanmaku danmaku);
class Area (line 37) | class Area {
method setEdge (line 43) | public void setEdge(int maxWidth, int maxHeight) {
method reset (line 48) | public void reset() {
method resizeToMax (line 52) | public void resizeToMax() {
method set (line 56) | public void set(float left, float top, float right, float bottom) {
class RenderingState (line 65) | public class RenderingState {
method addTotalCount (line 92) | public int addTotalCount(int count) {
method addCount (line 97) | public int addCount(int type, int count) {
method reset (line 118) | public void reset() {
method set (line 128) | public void set(RenderingState other) {
method appendToRunningDanmakus (line 147) | public void appendToRunningDanmakus(BaseDanmaku danmaku) {
method obtainRunningDanmakus (line 153) | public IDanmakus obtainRunningDanmakus() {
method draw (line 166) | void draw(IDisplayer disp, IDanmakus danmakus, long startRenderTime, R...
method clear (line 168) | void clear();
method clearRetainer (line 170) | void clearRetainer();
method release (line 172) | void release();
method setVerifierEnabled (line 174) | void setVerifierEnabled(boolean enabled);
method setCacheManager (line 176) | void setCacheManager(ICacheManager cacheManager);
method setOnDanmakuShownListener (line 178) | void setOnDanmakuShownListener(OnDanmakuShownListener onDanmakuShownLi...
method removeOnDanmakuShownListener (line 180) | void removeOnDanmakuShownListener();
method alignBottom (line 182) | void alignBottom(boolean enable);
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/renderer/Renderer.java
class Renderer (line 19) | public abstract class Renderer implements IRenderer {
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/renderer/android/DanmakuRenderer.java
class DanmakuRenderer (line 30) | public class DanmakuRenderer extends Renderer {
class Consumer (line 32) | private class Consumer extends IDanmakus.DefaultConsumer<BaseDanmaku> {
method accept (line 38) | @Override
method after (line 111) | @Override
method skipLayout (line 122) | @Override
method DanmakuRenderer (line 136) | public DanmakuRenderer(DanmakuContext config) {
method clear (line 141) | @Override
method clearRetainer (line 147) | @Override
method release (line 152) | @Override
method setVerifierEnabled (line 158) | @Override
method draw (line 163) | @Override
method setCacheManager (line 172) | public void setCacheManager(ICacheManager cacheManager) {
method setOnDanmakuShownListener (line 176) | @Override
method removeOnDanmakuShownListener (line 181) | @Override
method alignBottom (line 186) | public void alignBottom(boolean enable) {
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/renderer/android/DanmakusRetainer.java
class DanmakusRetainer (line 25) | public class DanmakusRetainer {
method DanmakusRetainer (line 35) | public DanmakusRetainer(boolean alignBottom) {
method alignBottom (line 39) | public void alignBottom(boolean alignBottom) {
method fix (line 50) | public void fix(BaseDanmaku danmaku, IDisplayer disp, Verifier verifie...
method clear (line 73) | public void clear() {
method release (line 88) | public void release(){
type Verifier (line 92) | public interface Verifier {
method skipLayout (line 94) | public boolean skipLayout(BaseDanmaku danmaku, float fixedTop, int l...
type IDanmakusRetainer (line 98) | public interface IDanmakusRetainer {
method fix (line 100) | public void fix(BaseDanmaku drawItem, IDisplayer disp, Verifier veri...
method clear (line 102) | public void clear();
class RetainerState (line 106) | private static class RetainerState {
class AlignTopRetainer (line 115) | private static class AlignTopRetainer implements IDanmakusRetainer {
class RetainerConsumer (line 116) | protected class RetainerConsumer extends IDanmakus.Consumer<BaseDanm...
method before (line 124) | @Override
method accept (line 131) | @Override
method result (line 173) | @Override
method fix (line 192) | @Override
method isOutVerticalEdge (line 279) | protected boolean isOutVerticalEdge(boolean overwriteInsert, BaseDan...
method clear (line 287) | @Override
class FTDanmakusRetainer (line 295) | private static class FTDanmakusRetainer extends AlignTopRetainer {
method isOutVerticalEdge (line 297) | @Override
class AlignBottomRetainer (line 308) | private static class AlignBottomRetainer extends FTDanmakusRetainer {
class RetainerConsumer (line 309) | protected class RetainerConsumer extends IDanmakus.Consumer<BaseDanm...
method before (line 316) | @Override
method accept (line 323) | @Override
method result (line 360) | @Override
method fix (line 374) | @Override
method isOutVerticalEdge (line 436) | protected boolean isOutVerticalEdge(boolean overwriteInsert, BaseDan...
method clear (line 444) | @Override
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/util/DanmakuUtils.java
class DanmakuUtils (line 27) | public class DanmakuUtils {
method willHitInDuration (line 36) | public static boolean willHitInDuration(IDisplayer disp, BaseDanmaku d...
method checkHitAtTime (line 62) | private static boolean checkHitAtTime(IDisplayer disp, BaseDanmaku d1,...
method checkHit (line 70) | private static boolean checkHit(int type1, int type2, float[] rectArr1,
method buildDanmakuDrawingCache (line 87) | public static DrawingCache buildDanmakuDrawingCache(BaseDanmaku danmak...
method getCacheSize (line 104) | public static int getCacheSize(int w, int h, int bytesPerPixel) {
method isDuplicate (line 108) | public final static boolean isDuplicate(BaseDanmaku obj1, BaseDanmaku ...
method compare (line 128) | public final static int compare(BaseDanmaku obj1, BaseDanmaku obj2) {
method isOverSize (line 156) | public final static boolean isOverSize(IDisplayer disp, BaseDanmaku it...
method fillText (line 160) | public static void fillText(BaseDanmaku danmaku, CharSequence text) {
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/util/IOUtils.java
class IOUtils (line 11) | public class IOUtils {
method getString (line 12) | public static String getString(InputStream in){
method getBytes (line 16) | public static byte[] getBytes(InputStream in){
method closeQuietly (line 30) | public static void closeQuietly(InputStream in){
method closeQuietly (line 36) | public static void closeQuietly(OutputStream out){
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/util/SystemClock.java
class SystemClock (line 6) | public class SystemClock {
method uptimeMillis (line 7) | public static final long uptimeMillis() {
method sleep (line 11) | public static final void sleep(long mills) {
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/ui/widget/DanmakuSurfaceView.java
class DanmakuSurfaceView (line 47) | public class DanmakuSurfaceView extends SurfaceView implements IDanmakuV...
method DanmakuSurfaceView (line 77) | public DanmakuSurfaceView(Context context) {
method init (line 82) | private void init() {
method DanmakuSurfaceView (line 94) | public DanmakuSurfaceView(Context context, AttributeSet attrs) {
method DanmakuSurfaceView (line 99) | public DanmakuSurfaceView(Context context, AttributeSet attrs, int def...
method addDanmaku (line 104) | public void addDanmaku(BaseDanmaku item) {
method invalidateDanmaku (line 110) | @Override
method removeAllDanmakus (line 117) | @Override
method removeAllLiveDanmakus (line 124) | @Override
method getCurrentVisibleDanmakus (line 131) | @Override
method setCallback (line 140) | public void setCallback(Callback callback) {
method surfaceCreated (line 147) | @Override
method surfaceChanged (line 157) | @Override
method surfaceDestroyed (line 164) | @Override
method release (line 169) | @Override
method stop (line 175) | @Override
method stopDraw (line 180) | private synchronized void stopDraw() {
method getLooper (line 197) | protected synchronized Looper getLooper(int type){
method prepare (line 224) | private void prepare() {
method prepare (line 229) | @Override
method isPrepared (line 238) | @Override
method getConfig (line 243) | @Override
method showFPS (line 251) | @Override
method fps (line 258) | private float fps() {
method drawDanmakus (line 272) | @Override
method toggle (line 301) | public void toggle() {
method pause (line 312) | @Override
method resume (line 318) | @Override
method isPaused (line 327) | @Override
method restart (line 335) | public void restart() {
method start (line 340) | @Override
method start (line 345) | @Override
method onTouchEvent (line 355) | @Override
method seekTo (line 364) | public void seekTo(Long ms) {
method enableDanmakuDrawingCache (line 370) | public void enableDanmakuDrawingCache(boolean enable) {
method isDanmakuDrawingCacheEnabled (line 374) | @Override
method isViewReady (line 379) | @Override
method getViewWidth (line 384) | @Override
method getViewHeight (line 389) | @Override
method getView (line 394) | @Override
method show (line 399) | @Override
method showAndResumeDrawTask (line 404) | @Override
method hide (line 413) | @Override
method hideAndPauseDrawTask (line 422) | @Override
method setOnDanmakuClickListener (line 431) | @Override
method setOnDanmakuClickListener (line 436) | @Override
method getOnDanmakuClickListener (line 443) | @Override
method getXOff (line 448) | @Override
method getYOff (line 453) | @Override
method forceRender (line 458) | @Override
method clear (line 463) | @Override
method isShown (line 475) | @Override
method setDrawingThreadType (line 480) | @Override
method getCurrentTime (line 485) | @Override
method isHardwareAccelerated (line 493) | @Override
method clearDanmakusOnScreen (line 498) | @Override
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/ui/widget/DanmakuTextureView.java
class DanmakuTextureView (line 52) | @SuppressLint("NewApi")
method DanmakuTextureView (line 82) | public DanmakuTextureView(Context context) {
method init (line 87) | @TargetApi(Build.VERSION_CODES.HONEYCOMB)
method DanmakuTextureView (line 99) | public DanmakuTextureView(Context context, AttributeSet attrs) {
method DanmakuTextureView (line 104) | public DanmakuTextureView(Context context, AttributeSet attrs, int def...
method addDanmaku (line 109) | public void addDanmaku(BaseDanmaku item) {
method invalidateDanmaku (line 115) | @Override
method removeAllDanmakus (line 122) | @Override
method removeAllLiveDanmakus (line 129) | @Override
method getCurrentVisibleDanmakus (line 136) | @Override
method setCallback (line 145) | public void setCallback(Callback callback) {
method onSurfaceTextureAvailable (line 152) | @Override
method onSurfaceTextureDestroyed (line 157) | @Override
method onSurfaceTextureSizeChanged (line 163) | @Override
method onSurfaceTextureUpdated (line 170) | @Override
method release (line 175) | @Override
method stop (line 181) | @Override
method stopDraw (line 186) | private synchronized void stopDraw() {
method getLooper (line 203) | protected synchronized Looper getLooper(int type){
method prepare (line 230) | private void prepare() {
method prepare (line 235) | @Override
method isPrepared (line 244) | @Override
method getConfig (line 249) | @Override
method showFPS (line 257) | @Override
method fps (line 264) | private float fps() {
method drawDanmakus (line 279) | @Override
method toggle (line 308) | public void toggle() {
method pause (line 319) | @Override
method resume (line 325) | @Override
method isPaused (line 334) | @Override
method restart (line 342) | public void restart() {
method start (line 347) | @Override
method start (line 352) | @Override
method onTouchEvent (line 362) | @Override
method seekTo (line 371) | public void seekTo(Long ms) {
method enableDanmakuDrawingCache (line 377) | public void enableDanmakuDrawingCache(boolean enable) {
method isDanmakuDrawingCacheEnabled (line 381) | @Override
method isViewReady (line 386) | @Override
method getViewWidth (line 391) | @Override
method getViewHeight (line 396) | @Override
method getView (line 401) | @Override
method show (line 406) | @Override
method showAndResumeDrawTask (line 411) | @Override
method hide (line 420) | @Override
method hideAndPauseDrawTask (line 429) | @Override
method setOnDanmakuClickListener (line 438) | @Override
method setOnDanmakuClickListener (line 443) | @Override
method getOnDanmakuClickListener (line 450) | @Override
method getXOff (line 455) | @Override
method getYOff (line 460) | @Override
method forceRender (line 465) | @Override
method clear (line 470) | @Override
method isShown (line 483) | @Override
method setDrawingThreadType (line 488) | @Override
method getCurrentTime (line 493) | @Override
method isHardwareAccelerated (line 501) | @Override
method clearDanmakusOnScreen (line 506) | @Override
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/ui/widget/DanmakuTouchHelper.java
class DanmakuTouchHelper (line 18) | public class DanmakuTouchHelper {
method onDown (line 26) | @Override
method onSingleTapConfirmed (line 39) | @Override
method onLongPress (line 52) | @Override
method DanmakuTouchHelper (line 67) | private DanmakuTouchHelper(IDanmakuView danmakuView) {
method instance (line 73) | public static synchronized DanmakuTouchHelper instance(IDanmakuView da...
method onTouchEvent (line 77) | public boolean onTouchEvent(MotionEvent event) {
method performDanmakuClick (line 81) | private boolean performDanmakuClick(IDanmakus danmakus, boolean isLong...
method performViewClick (line 93) | private boolean performViewClick() {
method touchHitDanmaku (line 101) | private IDanmakus touchHitDanmaku(final float x, final float y) {
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/ui/widget/DanmakuView.java
class DanmakuView (line 46) | public class DanmakuView extends View implements IDanmakuView, IDanmakuV...
method DanmakuView (line 84) | public DanmakuView(Context context) {
method init (line 89) | private void init() {
method DanmakuView (line 97) | public DanmakuView(Context context, AttributeSet attrs) {
method DanmakuView (line 102) | public DanmakuView(Context context, AttributeSet attrs, int defStyle) {
method addDanmaku (line 107) | public void addDanmaku(BaseDanmaku item) {
method invalidateDanmaku (line 113) | @Override
method removeAllDanmakus (line 120) | @Override
method removeAllLiveDanmakus (line 127) | @Override
method getCurrentVisibleDanmakus (line 134) | @Override
method setCallback (line 143) | public void setCallback(Callback callback) {
method release (line 150) | @Override
method stop (line 156) | @Override
method stopDraw (line 161) | private synchronized void stopDraw() {
method getLooper (line 183) | protected synchronized Looper getLooper(int type) {
method prepare (line 210) | private void prepare() {
method prepare (line 215) | @Override
method isPrepared (line 224) | @Override
method getConfig (line 229) | @Override
method showFPS (line 237) | @Override
method fps (line 246) | private float fps() {
method drawDanmakus (line 260) | @Override
method postInvalidateCompat (line 271) | @SuppressLint("NewApi")
method lockCanvas (line 281) | protected void lockCanvas() {
method lockCanvasAndClear (line 302) | private void lockCanvasAndClear() {
method unlockCanvasAndPost (line 307) | private void unlockCanvasAndPost() {
method onDraw (line 314) | @Override
method onLayout (line 340) | @Override
method toggle (line 349) | public void toggle() {
method pause (line 360) | @Override
method run (line 371) | @Override
method resume (line 386) | @Override
method isPaused (line 396) | @Override
method restart (line 404) | public void restart() {
method start (line 409) | @Override
method start (line 414) | @Override
method onTouchEvent (line 428) | @Override
method seekTo (line 437) | public void seekTo(Long ms) {
method enableDanmakuDrawingCache (line 444) | public void enableDanmakuDrawingCache(boolean enable) {
method isDanmakuDrawingCacheEnabled (line 448) | @Override
method isViewReady (line 453) | @Override
method getViewWidth (line 458) | @Override
method getViewHeight (line 463) | @Override
method getView (line 468) | @Override
method show (line 473) | @Override
method showAndResumeDrawTask (line 478) | @Override
method hide (line 488) | @Override
method hideAndPauseDrawTask (line 497) | @Override
method clear (line 506) | @Override
method isShown (line 519) | @Override
method setDrawingThreadType (line 524) | @Override
method getCurrentTime (line 529) | @Override
method isHardwareAccelerated (line 537) | @Override
method clearDanmakusOnScreen (line 548) | @Override
method setOnDanmakuClickListener (line 555) | @Override
method setOnDanmakuClickListener (line 560) | @Override
method getOnDanmakuClickListener (line 567) | @Override
method getXOff (line 572) | @Override
method getYOff (line 577) | @Override
method forceRender (line 582) | public void forceRender() {
FILE: DanmakuFlameMaster/src/main/java/master/flame/danmaku/ui/widget/FakeDanmakuView.java
class FakeDanmakuView (line 27) | public class FakeDanmakuView extends DanmakuView implements DrawHandler....
class CustomParser (line 29) | private class CustomParser extends BaseDanmakuParser {
method CustomParser (line 36) | public CustomParser(BaseDanmakuParser baseParser, long stTime, long ...
method parse (line 42) | @Override
method setDisplayer (line 103) | @Override
method getViewportSizeFactor (line 117) | @Override
type OnFrameAvailableListener (line 127) | public interface OnFrameAvailableListener {
method onConfig (line 129) | void onConfig(DanmakuContext config);
method onFrameAvailable (line 131) | void onFrameAvailable(long timeMills, Bitmap bitmap);
method onFramesFinished (line 133) | void onFramesFinished(long timeMills);
method onFailed (line 135) | void onFailed(int errorCode, String msg);
method FakeDanmakuView (line 153) | public FakeDanmakuView(Context context) {
method FakeDanmakuView (line 157) | public FakeDanmakuView(Context context, int width, int height, float s...
method initBufferCanvas (line 165) | public void initBufferCanvas(int width, int height) {
method drawDanmakus (line 170) | @Override
method release (line 227) | @Override
method onDraw (line 234) | @Override
method isShown (line 239) | @Override
method isViewReady (line 244) | @Override
method getViewWidth (line 249) | @Override
method getViewHeight (line 254) | @Override
method prepare (line 259) | @Override
method setTimeRange (line 285) | public void setTimeRange(final long beginMills, final long endMills) {
method setOnFrameAvailableListener (line 291) | public void setOnFrameAvailableListener(OnFrameAvailableListener onFra...
method getFrameAtTime (line 295) | public void getFrameAtTime(final int frameRate) {
method prepared (line 323) | @Override
method updateTimer (line 328) | @Override
method danmakuShown (line 336) | @Override
method drawingFinished (line 341) | @Override
FILE: DanmakuFlameMaster/src/main/java/tv/cjump/jni/DeviceUtils.java
class DeviceUtils (line 15) | public class DeviceUtils {
type ARCH (line 21) | public static enum ARCH {
method getMyCpuArch (line 35) | public static synchronized ARCH getMyCpuArch() {
method get_CPU_ABI (line 78) | public static String get_CPU_ABI() {
method get_CPU_ABI2 (line 82) | public static String get_CPU_ABI2() {
method supportABI (line 101) | public static boolean supportABI(String requestAbi) {
method supportX86 (line 111) | public static boolean supportX86() {
method supportMips (line 115) | public static boolean supportMips() {
method isARMSimulatedByX86 (line 119) | public static boolean isARMSimulatedByX86() {
method isMiBox2Device (line 124) | public static boolean isMiBox2Device() {
method isMagicBoxDevice (line 131) | public static boolean isMagicBoxDevice() {
method isProblemBoxDevice (line 138) | public static boolean isProblemBoxDevice() {
method isRealARMArch (line 142) | public static boolean isRealARMArch() {
method isRealX86Arch (line 147) | public static boolean isRealX86Arch() {
FILE: DanmakuFlameMaster/src/main/java/tv/cjump/jni/NativeBitmapFactory.java
class NativeBitmapFactory (line 14) | public class NativeBitmapFactory {
method isInNativeAlloc (line 21) | public static boolean isInNativeAlloc() {
method loadLibs (line 25) | public static void loadLibs() {
method releaseLibs (line 75) | public static synchronized void releaseLibs() {
method initField (line 85) | static void initField() {
method testLib (line 95) | @SuppressLint("NewApi")
method getNativeConfig (line 134) | public static int getNativeConfig(Bitmap.Config config) {
method createBitmap (line 148) | public static Bitmap createBitmap(int width, int height, Bitmap.Config...
method recycle (line 152) | public static void recycle(Bitmap bitmap) {
method createBitmap (line 156) | public static synchronized Bitmap createBitmap(int width, int height, ...
method createNativeBitmap (line 164) | private static Bitmap createNativeBitmap(int width, int height, Config...
method init (line 174) | private static native boolean init();
method release (line 176) | private static native boolean release();
method createBitmap (line 178) | private static native Bitmap createBitmap(int width, int height, int n...
method createBitmap19 (line 181) | private static native Bitmap createBitmap19(int width, int height, int...
FILE: Sample/src/main/java/com/sample/BiliDanmukuParser.java
class BiliDanmukuParser (line 47) | public class BiliDanmukuParser extends BaseDanmakuParser {
method parse (line 56) | @Override
class XmlContentHandler (line 78) | public class XmlContentHandler extends DefaultHandler {
method getResult (line 90) | public Danmakus getResult() {
method startDocument (line 94) | @Override
method endDocument (line 99) | @Override
method startElement (line 104) | @Override
method endElement (line 139) | @Override
method characters (line 157) | @Override
method decodeXmlString (line 270) | private String decodeXmlString(String title) {
method isPercentageNumber (line 288) | private boolean isPercentageNumber(String number) {
method parseFloat (line 293) | private float parseFloat(String floatStr) {
method parseInteger (line 301) | private int parseInteger(String intStr) {
method parseLong (line 309) | private long parseLong(String longStr) {
method setDisplayer (line 317) | @Override
FILE: Sample/src/main/java/com/sample/MainActivity.java
class MainActivity (line 54) | public class MainActivity extends Activity implements View.OnClickListen...
method prepareDrawing (line 84) | @Override
method releaseResource (line 123) | @Override
class BackgroundCacheStuffer (line 132) | private static class BackgroundCacheStuffer extends SpannedCacheStuffer {
method measure (line 136) | @Override
method drawBackground (line 142) | @Override
method drawStroke (line 148) | @Override
method onCreate (line 154) | @Override
method createParser (line 161) | private BaseDanmakuParser createParser(InputStream stream) {
method findViews (line 187) | private void findViews() {
method onPause (line 290) | @Override
method onResume (line 298) | @Override
method onDestroy (line 306) | @Override
method onBackPressed (line 316) | @Override
method onCreateOptionsMenu (line 326) | @Override
method onClick (line 332) | @Override
class AsyncAddTask (line 372) | class AsyncAddTask extends TimerTask {
method run (line 374) | @Override
method addDanmaku (line 383) | private void addDanmaku(boolean islive) {
method addDanmaKuShowTextAndImage (line 404) | private void addDanmaKuShowTextAndImage(boolean islive) {
method createSpannable (line 421) | private SpannableStringBuilder createSpannable(Drawable drawable) {
method onConfigurationChanged (line 431) | @Override
FILE: Sample/src/main/java/com/sample/UglyViewCacheStufferSampleActivity.java
class UglyViewCacheStufferSampleActivity (line 67) | public class UglyViewCacheStufferSampleActivity extends Activity impleme...
method prepareDrawing (line 97) | @Override
method releaseResource (line 136) | @Override
class BackgroundCacheStuffer (line 146) | private static class BackgroundCacheStuffer extends SpannedCacheStuffer {
method measure (line 150) | @Override
method drawBackground (line 156) | @Override
method drawStroke (line 162) | @Override
class MyViewHolder (line 168) | public class MyViewHolder extends ViewCacheStuffer.ViewHolder {
method MyViewHolder (line 173) | public MyViewHolder(View itemView) {
class MyImageWare (line 181) | public static class MyImageWare extends NonViewAware {
method MyImageWare (line 189) | public MyImageWare(String imageUri, BaseDanmaku danmaku, int width, ...
method getId (line 200) | @Override
method getImageUri (line 205) | public String getImageUri() {
method MyImageWare (line 209) | private MyImageWare(ImageSize imageSize, ViewScaleType scaleType) {
method MyImageWare (line 213) | private MyImageWare(String imageUri, ImageSize imageSize, ViewScaleT...
method setImageDrawable (line 217) | @Override
method setImageBitmap (line 222) | @Override
method onCreate (line 239) | @Override
method createParser (line 251) | private BaseDanmakuParser createParser(InputStream stream) {
method findViews (line 277) | private void findViews() {
method onPause (line 446) | @Override
method onResume (line 454) | @Override
method onDestroy (line 462) | @Override
method onBackPressed (line 473) | @Override
method onCreateOptionsMenu (line 483) | @Override
method onClick (line 489) | @Override
class AsyncAddTask (line 529) | class AsyncAddTask extends TimerTask {
method run (line 531) | @Override
method addDanmaku (line 542) | private void addDanmaku(boolean islive) {
method addDanmaKuShowTextAndImage (line 563) | private void addDanmaKuShowTextAndImage(boolean islive) {
method createSpannable (line 581) | private SpannableStringBuilder createSpannable(Drawable drawable) {
FILE: ndkbitmap-armv5/src/androidTest/java/tv/cjump/ndkbitmap_armv5/ApplicationTest.java
class ApplicationTest (line 9) | public class ApplicationTest extends ApplicationTestCase<Application> {
method ApplicationTest (line 10) | public ApplicationTest() {
FILE: ndkbitmap-armv5/src/main/java/tv/cjump/ndkbitmap_armv5/Pragma.java
class Pragma (line 3) | public class Pragma {
FILE: ndkbitmap-armv7a/src/androidTest/java/tv/cjump/ndkbitmap_armv7a/ApplicationTest.java
class ApplicationTest (line 9) | public class ApplicationTest extends ApplicationTestCase<Application> {
method ApplicationTest (line 10) | public ApplicationTest() {
FILE: ndkbitmap-armv7a/src/main/java/tv/cjump/ndkbitmap_armv7a/Pragma.java
class Pragma (line 3) | public class Pragma {
FILE: ndkbitmap-x86/src/androidTest/java/tv/cjump/ndkbitmap_x86/ApplicationTest.java
class ApplicationTest (line 9) | public class ApplicationTest extends ApplicationTestCase<Application> {
method ApplicationTest (line 10) | public ApplicationTest() {
FILE: ndkbitmap-x86/src/main/java/tv/cjump/ndkbitmap_x86/Pragma.java
class Pragma (line 3) | public class Pragma {
Condensed preview — 135 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (722K chars).
[
{
"path": ".gitignore",
"chars": 359,
"preview": "# built application files\n*.apk\n*.ap_\n*.com\n*.class\n*.dll\n*.exe\n*.o\n\n# files for the dex VM\n*.dex\n\n# Java class files\n*."
},
{
"path": ".gitmodules",
"chars": 1,
"preview": "\n"
},
{
"path": ".travis.yml",
"chars": 463,
"preview": "language: android\nandroid:\n components:\n - platform-tools\n - tools\n - build-tools-26.0.2\n - android-25\n "
},
{
"path": "DanmakuFlameMaster/build.gradle",
"chars": 1600,
"preview": "/*\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\n *\n * Licensed under the Apache License, Version 2.0 (the \"Licens"
},
{
"path": "DanmakuFlameMaster/gradle.properties",
"chars": 86,
"preview": "POM_NAME=DanmakuFlameMaster\nBINTRAY_POM_NAME=dfm\nPOM_ARTIFACT_ID=dfm\nPOM_PACKAGING=aar"
},
{
"path": "DanmakuFlameMaster/src/androidTest/java/tv/cjump/jni/NativeBitmapFactoryTest.java",
"chars": 5872,
"preview": "package tv.cjump.jni;\n\nimport android.app.ActivityManager;\nimport android.app.Instrumentation;\nimport android.content.Co"
},
{
"path": "DanmakuFlameMaster/src/main/.classpath",
"chars": 467,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<classpath>\n\t<classpathentry kind=\"src\" path=\"java\"/>\n\t<classpathentry kind=\"con\""
},
{
"path": "DanmakuFlameMaster/src/main/.project",
"chars": 854,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<projectDescription>\r\n\t<name>DanmakuFlameMaster</name>\r\n\t<comment></comment>\r\n\t<"
},
{
"path": "DanmakuFlameMaster/src/main/.settings/org.eclipse.jdt.core.prefs",
"chars": 23660,
"preview": "eclipse.preferences.version=1\norg.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6\norg.eclipse.jdt.core.compiler.com"
},
{
"path": "DanmakuFlameMaster/src/main/.settings/org.eclipse.jdt.ui.prefs",
"chars": 315,
"preview": "eclipse.preferences.version=1\nformatter_profile=_AndroidCodeStyle\nformatter_settings_version=12\norg.eclipse.jdt.ui.ignor"
},
{
"path": "DanmakuFlameMaster/src/main/AndroidManifest.xml",
"chars": 945,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n ~ Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\n ~\n ~ Licensed under "
},
{
"path": "DanmakuFlameMaster/src/main/build.xml",
"chars": 3930,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project name=\"DanmakuFlameMaster\" default=\"help\">\n\n <!-- The local.properties"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/CacheManagingDrawTask.java",
"chars": 44352,
"preview": "/*\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\n *\n * Licensed under the Apache License, Version 2.0 (the \"Licens"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/DanmakuFilters.java",
"chars": 23175,
"preview": "\npackage master.flame.danmaku.controller;\n\nimport master.flame.danmaku.danmaku.model.Duration;\nimport master.flame.danma"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/DrawHandler.java",
"chars": 30191,
"preview": "/*\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\n *\n * Licensed under the Apache License, Version 2.0 (the \"Licens"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/DrawHelper.java",
"chars": 2974,
"preview": "/*\r\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/DrawTask.java",
"chars": 19391,
"preview": "/*\r\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/IDanmakuView.java",
"chars": 3739,
"preview": "\npackage master.flame.danmaku.controller;\n\nimport android.view.View;\n\nimport master.flame.danmaku.controller.DrawHandler"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/IDanmakuViewController.java",
"chars": 473,
"preview": "package master.flame.danmaku.controller;\n\nimport android.content.Context;\n\n/**\n * For internal control. DO NOT ACCESS th"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/IDrawTask.java",
"chars": 2296,
"preview": "/*\r\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/UpdateThread.java",
"chars": 404,
"preview": "\npackage master.flame.danmaku.controller;\n\npublic class UpdateThread extends Thread {\n\n public UpdateThread(String na"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/loader/ILoader.java",
"chars": 1144,
"preview": "/*\r\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/loader/IllegalDataException.java",
"chars": 607,
"preview": "package master.flame.danmaku.danmaku.loader;\r\n/**\r\n * Thrown when data is loading which can not be reasonably deal with."
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/loader/android/AcFunDanmakuLoader.java",
"chars": 1232,
"preview": "package master.flame.danmaku.danmaku.loader.android;\r\n\r\nimport java.io.InputStream;\r\n\r\nimport master.flame.danmaku.danma"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/loader/android/BiliDanmakuLoader.java",
"chars": 1742,
"preview": "/*\r\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/loader/android/DanmakuLoaderFactory.java",
"chars": 1162,
"preview": "/*\r\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/AbsDanmakuSync.java",
"chars": 868,
"preview": "package master.flame.danmaku.danmaku.model;\n\npublic abstract class AbsDanmakuSync {\n\n public static final int SYNC_ST"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/AbsDisplayer.java",
"chars": 896,
"preview": "package master.flame.danmaku.danmaku.model;\n\nimport master.flame.danmaku.danmaku.model.android.BaseCacheStuffer;\n\npublic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/AlphaValue.java",
"chars": 159,
"preview": "\r\npackage master.flame.danmaku.danmaku.model;\r\n\r\npublic class AlphaValue {\r\n\r\n public static int MAX = 255;\r\n\r\n pu"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/BaseDanmaku.java",
"chars": 8375,
"preview": "/*\r\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/Danmaku.java",
"chars": 1532,
"preview": "/*\r\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/DanmakuTimer.java",
"chars": 1217,
"preview": "/*\r\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/Duration.java",
"chars": 628,
"preview": "\npackage master.flame.danmaku.danmaku.model;\n\npublic class Duration implements Cloneable {\n\n private long mInitialDur"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/FBDanmaku.java",
"chars": 894,
"preview": "/*\r\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/FTDanmaku.java",
"chars": 2862,
"preview": "/*\r\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/GlobalFlagValues.java",
"chars": 1266,
"preview": "package master.flame.danmaku.danmaku.model;\n\npublic class GlobalFlagValues {\n\n public int MEASURE_RESET_FLAG = 0;\n "
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/ICacheManager.java",
"chars": 779,
"preview": "/*\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\n *\n * Licensed under the Apache License, Version 2.0 (the \"Licens"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/IDanmakuIterator.java",
"chars": 212,
"preview": "package master.flame.danmaku.danmaku.model;\n\npublic interface IDanmakuIterator {\n\n public BaseDanmaku next();\n \n "
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/IDanmakus.java",
"chars": 4550,
"preview": "/*\r\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/IDisplayer.java",
"chars": 1826,
"preview": "/*\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\n *\n * Licensed under the Apache License, Version 2.0 (the \"Licens"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/IDrawingCache.java",
"chars": 492,
"preview": "\r\npackage master.flame.danmaku.danmaku.model;\r\n\r\npublic interface IDrawingCache<T> {\r\n\r\n public void build(int w, int"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/L2RDanmaku.java",
"chars": 2601,
"preview": "/*\r\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/R2LDanmaku.java",
"chars": 3090,
"preview": "/*\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\n *\n * Licensed under the Apache License, Version 2.0 (the \"Licens"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/SpecialDanmaku.java",
"chars": 11279,
"preview": "/*\r\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/android/AndroidDisplayer.java",
"chars": 20498,
"preview": "/*\r\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/android/BaseCacheStuffer.java",
"chars": 2201,
"preview": "package master.flame.danmaku.danmaku.model.android;\n\nimport android.graphics.Canvas;\nimport android.graphics.Paint;\nimpo"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/android/CachingPolicy.java",
"chars": 2825,
"preview": "package master.flame.danmaku.danmaku.model.android;\n\n/**\n * Created by ch on 17/4/28. <br/>\n * The cacing policy apply t"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/android/DanmakuContext.java",
"chars": 23179,
"preview": "\npackage master.flame.danmaku.danmaku.model.android;\n\nimport android.graphics.Typeface;\n\nimport java.lang.ref.WeakRefere"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/android/DanmakuFactory.java",
"chars": 11395,
"preview": "/*\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\n *\n * Licensed under the Apache License, Version 2.0 (the \"Licens"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/android/Danmakus.java",
"chars": 9788,
"preview": "/*\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\n *\n * Licensed under the Apache License, Version 2.0 (the \"Licens"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/android/DrawingCache.java",
"chars": 2301,
"preview": "\r\npackage master.flame.danmaku.danmaku.model.android;\r\n\r\nimport master.flame.danmaku.danmaku.model.IDrawingCache;\r\nimpor"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/android/DrawingCacheHolder.java",
"chars": 6166,
"preview": "\r\npackage master.flame.danmaku.danmaku.model.android;\r\n\r\nimport android.annotation.SuppressLint;\r\nimport android.graphic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/android/DrawingCachePoolManager.java",
"chars": 459,
"preview": "\r\npackage master.flame.danmaku.danmaku.model.android;\r\n\r\nimport master.flame.danmaku.danmaku.model.objectpool.PoolableMa"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/android/SimpleTextCacheStuffer.java",
"chars": 6878,
"preview": "package master.flame.danmaku.danmaku.model.android;\n\nimport android.graphics.Canvas;\nimport android.graphics.Paint;\nimpo"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/android/SpannedCacheStuffer.java",
"chars": 3888,
"preview": "package master.flame.danmaku.danmaku.model.android;\n\nimport android.graphics.Canvas;\nimport android.graphics.Paint;\nimpo"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/android/ViewCacheStuffer.java",
"chars": 5721,
"preview": "package master.flame.danmaku.danmaku.model.android;\n\nimport android.graphics.Canvas;\nimport android.graphics.Paint;\nimpo"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/objectpool/FinitePool.java",
"chars": 2400,
"preview": "/*\n * Copyright (C) 2009 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/objectpool/Pool.java",
"chars": 773,
"preview": "/*\n * Copyright (C) 2009 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/objectpool/Poolable.java",
"chars": 837,
"preview": "/*\n * Copyright (C) 2009 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/objectpool/PoolableManager.java",
"chars": 824,
"preview": "/*\n * Copyright (C) 2009 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/objectpool/Pools.java",
"chars": 1319,
"preview": "/*\n * Copyright (C) 2009 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/model/objectpool/SynchronizedPool.java",
"chars": 1245,
"preview": "/*\n * Copyright (C) 2009 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"Lice"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/parser/BaseDanmakuParser.java",
"chars": 3344,
"preview": "/*\r\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/parser/IDataSource.java",
"chars": 895,
"preview": "/*\r\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/parser/android/AndroidFileSource.java",
"chars": 2582,
"preview": "/*\r\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/parser/android/JSONSource.java",
"chars": 1950,
"preview": "package master.flame.danmaku.danmaku.parser.android;\r\n\r\nimport java.io.File;\r\nimport java.io.FileInputStream;\r\nimport ja"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/renderer/IRenderer.java",
"chars": 6185,
"preview": "/*\r\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/renderer/Renderer.java",
"chars": 745,
"preview": "/*\r\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/renderer/android/DanmakuRenderer.java",
"chars": 7081,
"preview": "/*\r\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/renderer/android/DanmakusRetainer.java",
"chars": 16783,
"preview": "/*\r\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/util/DanmakuUtils.java",
"chars": 5779,
"preview": "/*\r\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/util/IOUtils.java",
"chars": 1147,
"preview": "package master.flame.danmaku.danmaku.util;\r\n\r\nimport java.io.ByteArrayOutputStream;\r\nimport java.io.IOException;\r\nimport"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/danmaku/util/SystemClock.java",
"chars": 320,
"preview": "package master.flame.danmaku.danmaku.util;\n\n/**\n * Created by ch on 15-12-9.\n */\npublic class SystemClock {\n public s"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/ui/widget/DanmakuSurfaceView.java",
"chars": 13838,
"preview": "/*\r\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"Lic"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/ui/widget/DanmakuTextureView.java",
"chars": 13390,
"preview": "/*\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\n *\n * Licensed under the Apache License, Version 2.0 (the \"Licens"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/ui/widget/DanmakuTouchHelper.java",
"chars": 4683,
"preview": "package master.flame.danmaku.ui.widget;\n\nimport android.graphics.RectF;\nimport android.nfc.Tag;\nimport android.util.Log;"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/ui/widget/DanmakuView.java",
"chars": 15511,
"preview": "/*\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\n *\n * Licensed under the Apache License, Version 2.0 (the \"Licens"
},
{
"path": "DanmakuFlameMaster/src/main/java/master/flame/danmaku/ui/widget/FakeDanmakuView.java",
"chars": 12231,
"preview": "package master.flame.danmaku.ui.widget;\n\nimport android.content.Context;\nimport android.graphics.Bitmap;\nimport android."
},
{
"path": "DanmakuFlameMaster/src/main/java/tv/cjump/jni/DeviceUtils.java",
"chars": 4454,
"preview": "\npackage tv.cjump.jni;\n\nimport android.os.Build;\nimport android.os.Environment;\nimport android.text.TextUtils;\nimport an"
},
{
"path": "DanmakuFlameMaster/src/main/java/tv/cjump/jni/NativeBitmapFactory.java",
"chars": 6111,
"preview": "\npackage tv.cjump.jni;\n\nimport android.annotation.SuppressLint;\nimport android.graphics.Bitmap;\nimport android.graphics."
},
{
"path": "DanmakuFlameMaster/src/main/lint.xml",
"chars": 53,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<lint>\n</lint>"
},
{
"path": "DanmakuFlameMaster/src/main/proguard-project.txt",
"chars": 781,
"preview": "# To enable ProGuard in your project, edit project.properties\n# to define the proguard.config property as described in t"
},
{
"path": "DanmakuFlameMaster/src/main/project.properties",
"chars": 600,
"preview": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# T"
},
{
"path": "LICENSE",
"chars": 10464,
"preview": "Apache License\r\nVersion 2.0, January 2004\r\nhttp://www.apache.org/licenses/\r\n\r\nTERMS AND CONDITIONS FOR USE, REPRODUCTION"
},
{
"path": "README.md",
"chars": 1609,
"preview": "DanmakuFlameMaster\n==================\n\nandroid上开源弹幕解析绘制引擎项目。[ 2013 Chen Hui <calmer91@gmail.com>\n *\n * Licensed under the Apache License, Version 2.0 (the \"Licens"
},
{
"path": "Sample/src/main/.classpath",
"chars": 476,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<classpath>\r\n\t<classpathentry kind=\"src\" path=\"java\"/>\r\n\t<classpathentry kind=\"s"
},
{
"path": "Sample/src/main/.project",
"chars": 842,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<projectDescription>\r\n\t<name>Sample</name>\r\n\t<comment></comment>\r\n\t<projects>\r\n\t"
},
{
"path": "Sample/src/main/.settings/org.eclipse.jdt.core.prefs",
"chars": 173,
"preview": "eclipse.preferences.version=1\norg.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6\norg.eclipse.jdt.core.compiler.com"
},
{
"path": "Sample/src/main/AndroidManifest.xml",
"chars": 1243,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n packag"
},
{
"path": "Sample/src/main/java/com/sample/BiliDanmukuParser.java",
"chars": 13188,
"preview": "/*\n * Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\n *\n * Licensed under the Apache License, Version 2.0 (the \"Licens"
},
{
"path": "Sample/src/main/java/com/sample/MainActivity.java",
"chars": 17187,
"preview": "\r\npackage com.sample;\r\n\r\nimport android.app.Activity;\r\nimport android.content.pm.ActivityInfo;\r\nimport android.content.r"
},
{
"path": "Sample/src/main/java/com/sample/UglyViewCacheStufferSampleActivity.java",
"chars": 24022,
"preview": "\npackage com.sample;\n\nimport android.app.Activity;\nimport android.content.pm.ActivityInfo;\nimport android.graphics.Bitma"
},
{
"path": "Sample/src/main/project.properties",
"chars": 628,
"preview": "# This file is automatically generated by Android Tools.\n# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n#\n# T"
},
{
"path": "Sample/src/main/res/layout/activity_main.xml",
"chars": 1807,
"preview": "<!--\r\n ~ Copyright (C) 2013 Chen Hui <calmer91@gmail.com>\r\n ~\r\n ~ Licensed under the Apache License, Version 2.0 (the"
},
{
"path": "Sample/src/main/res/layout/layout_view_cache.xml",
"chars": 731,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n andr"
},
{
"path": "Sample/src/main/res/layout/media_controller.xml",
"chars": 2637,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n and"
},
{
"path": "Sample/src/main/res/menu/main.xml",
"chars": 244,
"preview": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <item android:id=\"@+id/action_settings\"\n an"
},
{
"path": "Sample/src/main/res/raw/comments.xml",
"chars": 143427,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><i><chatserver>chat.bilibili.com</chatserver><chatid>8729348</chatid><mission>0</m"
},
{
"path": "Sample/src/main/res/values/dimens.xml",
"chars": 209,
"preview": "<resources>\n <!-- Default screen margins, per the Android Design guidelines. -->\n <dimen name=\"activity_horizontal"
},
{
"path": "Sample/src/main/res/values/strings.xml",
"chars": 702,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<resources>\r\n\r\n <string name=\"app_name\">Danmaku Flame Master\r\n </string>\r\n"
},
{
"path": "Sample/src/main/res/values/styles.xml",
"chars": 680,
"preview": "<resources>\n\n <!--\n Base application theme, dependent on API level. This theme is replaced\n by AppBaseT"
},
{
"path": "build.gradle",
"chars": 397,
"preview": "buildscript {\r\n repositories {\r\n jcenter()\r\n google()\r\n }\r\n dependencies {\r\n classpath 'co"
},
{
"path": "gradle/gradle-bintray-upload.gradle",
"chars": 2269,
"preview": "/*\n * Copyright 2015 Chen Hui <calmer91@gmail.com>\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");"
},
{
"path": "gradle/gradle-mvn-push.gradle",
"chars": 3699,
"preview": "/*\n * Copyright (c) 2013 Chris Banes\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may no"
},
{
"path": "gradle/wrapper/gradle-wrapper.properties",
"chars": 230,
"preview": "#Tue Feb 06 14:51:25 CST 2018\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
},
{
"path": "gradle.properties",
"chars": 657,
"preview": "VERSION_CODE=9025\nVERSION_NAME=0.9.25\nGROUP=com.github.ctiao\nPOM_NAME=dfm\nPOM_ARTIFACT_ID=common\nPOM_PACKAGING=aar\n\nPOM_"
},
{
"path": "gradlew",
"chars": 5080,
"preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n## Gradle start "
},
{
"path": "gradlew.bat",
"chars": 2404,
"preview": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@r"
},
{
"path": "ndkbitmap-armv5/.gitignore",
"chars": 7,
"preview": "/build\n"
},
{
"path": "ndkbitmap-armv5/build.gradle",
"chars": 834,
"preview": "apply plugin: 'com.android.library'\n\nandroid {\n compileSdkVersion 25\n buildToolsVersion \"26.0.2\"\n\n defaultConfi"
},
{
"path": "ndkbitmap-armv5/gradle.properties",
"chars": 107,
"preview": "POM_NAME=ndkbitmap-armv5\nBINTRAY_POM_NAME=ndkbitmap-armv5\nPOM_ARTIFACT_ID=ndkbitmap-armv5\nPOM_PACKAGING=aar"
},
{
"path": "ndkbitmap-armv5/proguard-rules.pro",
"chars": 651,
"preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /d"
},
{
"path": "ndkbitmap-armv5/src/androidTest/java/tv/cjump/ndkbitmap_armv5/ApplicationTest.java",
"chars": 355,
"preview": "package tv.cjump.ndkbitmap_armv5;\n\nimport android.app.Application;\nimport android.test.ApplicationTestCase;\n\n/**\n * <a h"
},
{
"path": "ndkbitmap-armv5/src/main/AndroidManifest.xml",
"chars": 143,
"preview": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n package=\"tv.cjump.ndkbitmap_armv5\">\n\n <appli"
},
{
"path": "ndkbitmap-armv5/src/main/java/tv/cjump/ndkbitmap_armv5/Pragma.java",
"chars": 59,
"preview": "package tv.cjump.ndkbitmap_armv5;\n\npublic class Pragma {\n}\n"
},
{
"path": "ndkbitmap-armv5/src/main/res/values/strings.xml",
"chars": 78,
"preview": "<resources>\n <string name=\"app_name\">ndkbitmap-armv5</string>\n</resources>\n"
},
{
"path": "ndkbitmap-armv7a/.gitignore",
"chars": 7,
"preview": "/build\n"
},
{
"path": "ndkbitmap-armv7a/build.gradle",
"chars": 834,
"preview": "apply plugin: 'com.android.library'\n\nandroid {\n compileSdkVersion 25\n buildToolsVersion \"26.0.2\"\n\n defaultConfi"
},
{
"path": "ndkbitmap-armv7a/gradle.properties",
"chars": 110,
"preview": "POM_NAME=ndkbitmap-armv7a\nBINTRAY_POM_NAME=ndkbitmap-armv7a\nPOM_ARTIFACT_ID=ndkbitmap-armv7a\nPOM_PACKAGING=aar"
},
{
"path": "ndkbitmap-armv7a/proguard-rules.pro",
"chars": 651,
"preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /d"
},
{
"path": "ndkbitmap-armv7a/src/androidTest/java/tv/cjump/ndkbitmap_armv7a/ApplicationTest.java",
"chars": 356,
"preview": "package tv.cjump.ndkbitmap_armv7a;\n\nimport android.app.Application;\nimport android.test.ApplicationTestCase;\n\n/**\n * <a "
},
{
"path": "ndkbitmap-armv7a/src/main/AndroidManifest.xml",
"chars": 144,
"preview": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n package=\"tv.cjump.ndkbitmap_armv7a\">\n\n <appl"
},
{
"path": "ndkbitmap-armv7a/src/main/java/tv/cjump/ndkbitmap_armv7a/Pragma.java",
"chars": 60,
"preview": "package tv.cjump.ndkbitmap_armv7a;\n\npublic class Pragma {\n}\n"
},
{
"path": "ndkbitmap-armv7a/src/main/res/values/strings.xml",
"chars": 79,
"preview": "<resources>\n <string name=\"app_name\">ndkbitmap-armv7a</string>\n</resources>\n"
},
{
"path": "ndkbitmap-x86/.gitignore",
"chars": 7,
"preview": "/build\n"
},
{
"path": "ndkbitmap-x86/build.gradle",
"chars": 834,
"preview": "apply plugin: 'com.android.library'\n\nandroid {\n compileSdkVersion 25\n buildToolsVersion \"26.0.2\"\n\n defaultConfi"
},
{
"path": "ndkbitmap-x86/gradle.properties",
"chars": 104,
"preview": "POM_NAME=ndkbitmap-armv7a\nBINTRAY_POM_NAME=ndkbitmap-x86\nPOM_ARTIFACT_ID=ndkbitmap-x86\nPOM_PACKAGING=aar"
},
{
"path": "ndkbitmap-x86/proguard-rules.pro",
"chars": 651,
"preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /d"
},
{
"path": "ndkbitmap-x86/src/androidTest/java/tv/cjump/ndkbitmap_x86/ApplicationTest.java",
"chars": 353,
"preview": "package tv.cjump.ndkbitmap_x86;\n\nimport android.app.Application;\nimport android.test.ApplicationTestCase;\n\n/**\n * <a hre"
},
{
"path": "ndkbitmap-x86/src/main/AndroidManifest.xml",
"chars": 141,
"preview": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n package=\"tv.cjump.ndkbitmap_x86\">\n\n <applica"
},
{
"path": "ndkbitmap-x86/src/main/java/tv/cjump/ndkbitmap_x86/Pragma.java",
"chars": 57,
"preview": "package tv.cjump.ndkbitmap_x86;\n\npublic class Pragma {\n}\n"
},
{
"path": "ndkbitmap-x86/src/main/res/values/strings.xml",
"chars": 76,
"preview": "<resources>\n <string name=\"app_name\">ndkbitmap-x86</string>\n</resources>\n"
},
{
"path": "settings.gradle",
"chars": 100,
"preview": "include ':DanmakuFlameMaster', ':Sample', ':ndkbitmap-armv5', ':ndkbitmap-armv7a', ':ndkbitmap-x86'\n"
}
]
// ... and 1 more files (download for full content)
About this extraction
This page contains the full source code of the bilibili/DanmakuFlameMaster GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 135 files (663.3 KB), approximately 197.6k tokens, and a symbol index with 1286 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.