-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
52 changed files
with
747 additions
and
546 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ package com.haishinkit.app | |
data class Preference(var rtmpURL: String, var streamName: String) { | ||
companion object { | ||
var shared = Preference( | ||
"rtmp://test:[email protected].3/live", | ||
"rtmp://test:[email protected].4/live", | ||
"live" | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
haishinkit/src/main/java/com/haishinkit/graphics/GraphicsContext.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.haishinkit.graphics | ||
|
||
object GraphicsContext { | ||
val textureRenderer by lazy { TextureRenderer.create() } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
haishinkit/src/main/java/com/haishinkit/graphics/PixelTransformFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
haishinkit/src/main/java/com/haishinkit/graphics/Texture.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.haishinkit.graphics | ||
|
||
import android.util.Size | ||
import android.view.Surface | ||
|
||
interface Texture { | ||
enum class ReadyState { | ||
CREATED, RELEASING, RELEASED | ||
} | ||
|
||
val id: Int | ||
val surface: Surface? | ||
val readyState: ReadyState | ||
val imageExtent: Size | ||
var imageOrientation: ImageOrientation | ||
fun update() | ||
fun release() | ||
fun dispose() | ||
} |
44 changes: 44 additions & 0 deletions
44
haishinkit/src/main/java/com/haishinkit/graphics/TextureRenderer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.haishinkit.graphics | ||
|
||
import com.haishinkit.event.IEventDispatcher | ||
import kotlin.reflect.KClass | ||
|
||
interface TextureRenderer : IEventDispatcher { | ||
fun createTexture(width: Int, height: Int, format: Int): Texture | ||
fun registerTexture(texture: Texture?) | ||
|
||
companion object { | ||
const val FRAME_UPDATED_EVENT = "frameUpdatedEvent" | ||
|
||
private var textureLoaders: MutableList<KClass<*>> = mutableListOf() | ||
|
||
internal fun create(): TextureRenderer { | ||
if (textureLoaders.isEmpty()) { | ||
return com.haishinkit.graphics.gles.TextureRenderer() | ||
} | ||
return try { | ||
val textureLoaderClass = textureLoaders.first() | ||
textureLoaderClass.java.newInstance() as TextureRenderer | ||
} catch (e: Exception) { | ||
com.haishinkit.graphics.gles.TextureRenderer() | ||
} | ||
} | ||
|
||
fun <T : TextureRenderer> registerTextureLoader(clazz: KClass<T>) { | ||
for (i in 0 until textureLoaders.size) { | ||
if (textureLoaders[i] == clazz) { | ||
return | ||
} | ||
} | ||
textureLoaders.add(clazz) | ||
} | ||
|
||
fun <T : TextureRenderer> unregisterTextureLoader(clazz: KClass<T>) { | ||
for (i in (0 until textureLoaders.size).reversed()) { | ||
if (textureLoaders[i] == clazz) { | ||
textureLoaders.removeAt(i) | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.