Can an Android (Java not C/C++) plugin alter unity textures?












2















I'm trying to use an Android plugin to get around the fact that Unity does not support Video Textures on mobile. I do this by getting the texture ID of the texture that will be used for video (supplied by Texture2D.GetNativeTextureID()) which i then pass into the Java Plugin.



The plugin then follows a standard MediaPlayer implementation to play the video into a Surface Texture, which has been assigned the aforementioned texture ID.



When i call the MediaPlayer.Start() method, LogCat outputs as if the media player is working normally/as hoped, however the texture never changes in the app. I'm calling the plugin (and even initializing it) from the OnPreRender() method of a monobehaviour script, along with making sure to call GL.InvalidateState() too.



Here's a look at the relevant code:



Constructor:



public VideoPlayer(String _path, Context _cont) {
m_MediaPlayer = new MediaPlayer();
try {
Uri uri = Uri.parse(_path);
m_MediaPlayer.setDataSource(_cont, uri);
m_MediaPlayer.setOnPreparedListener(this);
}
catch (IOException e) {
Log.e(TAG, "Error setting data source: " + e.getMessage());
}
}


Surface Texture Prep:



public void PrepareVideo(int _texPtr) {
try {
m_SurfTex = new SurfaceTexture(_texPtr);
m_SurfTex.setOnFrameAvailableListener(this);
Log.i(TAG, "Surface Texture ready");
Surface surface = new Surface(m_SurfTex);
m_MediaPlayer.setSurface(surface);
Log.i(TAG, "Surface Ready");
surface.release();
m_Ready = true;
m_MediaPlayer.prepare();
}
catch (IOException | IllegalStateException e) {
Log.e(TAG, "Error preparing player: " + e.getMessage());
m_Ready = false;
}
}


I'd like to know if this type of process is possible with my current setup, or will have to look into writing something using the NDK instead? Specifically, can a surface texture alter a texture produced in Unity?










share|improve this question


















  • 1





    not sure you can do this from Java. For sure from a C++ plugin you can use native texture ptr, as shown in the relative example in the doc: docs.unity3d.com/Manual/NativePluginInterface.html

    – Heisenbug
    Jun 13 '15 at 9:49











  • Yea it seems to be the case...

    – sh3rifme
    Jun 14 '15 at 10:53
















2















I'm trying to use an Android plugin to get around the fact that Unity does not support Video Textures on mobile. I do this by getting the texture ID of the texture that will be used for video (supplied by Texture2D.GetNativeTextureID()) which i then pass into the Java Plugin.



The plugin then follows a standard MediaPlayer implementation to play the video into a Surface Texture, which has been assigned the aforementioned texture ID.



When i call the MediaPlayer.Start() method, LogCat outputs as if the media player is working normally/as hoped, however the texture never changes in the app. I'm calling the plugin (and even initializing it) from the OnPreRender() method of a monobehaviour script, along with making sure to call GL.InvalidateState() too.



Here's a look at the relevant code:



Constructor:



public VideoPlayer(String _path, Context _cont) {
m_MediaPlayer = new MediaPlayer();
try {
Uri uri = Uri.parse(_path);
m_MediaPlayer.setDataSource(_cont, uri);
m_MediaPlayer.setOnPreparedListener(this);
}
catch (IOException e) {
Log.e(TAG, "Error setting data source: " + e.getMessage());
}
}


Surface Texture Prep:



public void PrepareVideo(int _texPtr) {
try {
m_SurfTex = new SurfaceTexture(_texPtr);
m_SurfTex.setOnFrameAvailableListener(this);
Log.i(TAG, "Surface Texture ready");
Surface surface = new Surface(m_SurfTex);
m_MediaPlayer.setSurface(surface);
Log.i(TAG, "Surface Ready");
surface.release();
m_Ready = true;
m_MediaPlayer.prepare();
}
catch (IOException | IllegalStateException e) {
Log.e(TAG, "Error preparing player: " + e.getMessage());
m_Ready = false;
}
}


I'd like to know if this type of process is possible with my current setup, or will have to look into writing something using the NDK instead? Specifically, can a surface texture alter a texture produced in Unity?










share|improve this question


















  • 1





    not sure you can do this from Java. For sure from a C++ plugin you can use native texture ptr, as shown in the relative example in the doc: docs.unity3d.com/Manual/NativePluginInterface.html

    – Heisenbug
    Jun 13 '15 at 9:49











  • Yea it seems to be the case...

    – sh3rifme
    Jun 14 '15 at 10:53














2












2








2








I'm trying to use an Android plugin to get around the fact that Unity does not support Video Textures on mobile. I do this by getting the texture ID of the texture that will be used for video (supplied by Texture2D.GetNativeTextureID()) which i then pass into the Java Plugin.



The plugin then follows a standard MediaPlayer implementation to play the video into a Surface Texture, which has been assigned the aforementioned texture ID.



When i call the MediaPlayer.Start() method, LogCat outputs as if the media player is working normally/as hoped, however the texture never changes in the app. I'm calling the plugin (and even initializing it) from the OnPreRender() method of a monobehaviour script, along with making sure to call GL.InvalidateState() too.



Here's a look at the relevant code:



Constructor:



public VideoPlayer(String _path, Context _cont) {
m_MediaPlayer = new MediaPlayer();
try {
Uri uri = Uri.parse(_path);
m_MediaPlayer.setDataSource(_cont, uri);
m_MediaPlayer.setOnPreparedListener(this);
}
catch (IOException e) {
Log.e(TAG, "Error setting data source: " + e.getMessage());
}
}


Surface Texture Prep:



public void PrepareVideo(int _texPtr) {
try {
m_SurfTex = new SurfaceTexture(_texPtr);
m_SurfTex.setOnFrameAvailableListener(this);
Log.i(TAG, "Surface Texture ready");
Surface surface = new Surface(m_SurfTex);
m_MediaPlayer.setSurface(surface);
Log.i(TAG, "Surface Ready");
surface.release();
m_Ready = true;
m_MediaPlayer.prepare();
}
catch (IOException | IllegalStateException e) {
Log.e(TAG, "Error preparing player: " + e.getMessage());
m_Ready = false;
}
}


I'd like to know if this type of process is possible with my current setup, or will have to look into writing something using the NDK instead? Specifically, can a surface texture alter a texture produced in Unity?










share|improve this question














I'm trying to use an Android plugin to get around the fact that Unity does not support Video Textures on mobile. I do this by getting the texture ID of the texture that will be used for video (supplied by Texture2D.GetNativeTextureID()) which i then pass into the Java Plugin.



The plugin then follows a standard MediaPlayer implementation to play the video into a Surface Texture, which has been assigned the aforementioned texture ID.



When i call the MediaPlayer.Start() method, LogCat outputs as if the media player is working normally/as hoped, however the texture never changes in the app. I'm calling the plugin (and even initializing it) from the OnPreRender() method of a monobehaviour script, along with making sure to call GL.InvalidateState() too.



Here's a look at the relevant code:



Constructor:



public VideoPlayer(String _path, Context _cont) {
m_MediaPlayer = new MediaPlayer();
try {
Uri uri = Uri.parse(_path);
m_MediaPlayer.setDataSource(_cont, uri);
m_MediaPlayer.setOnPreparedListener(this);
}
catch (IOException e) {
Log.e(TAG, "Error setting data source: " + e.getMessage());
}
}


Surface Texture Prep:



public void PrepareVideo(int _texPtr) {
try {
m_SurfTex = new SurfaceTexture(_texPtr);
m_SurfTex.setOnFrameAvailableListener(this);
Log.i(TAG, "Surface Texture ready");
Surface surface = new Surface(m_SurfTex);
m_MediaPlayer.setSurface(surface);
Log.i(TAG, "Surface Ready");
surface.release();
m_Ready = true;
m_MediaPlayer.prepare();
}
catch (IOException | IllegalStateException e) {
Log.e(TAG, "Error preparing player: " + e.getMessage());
m_Ready = false;
}
}


I'd like to know if this type of process is possible with my current setup, or will have to look into writing something using the NDK instead? Specifically, can a surface texture alter a texture produced in Unity?







java android unity3d android-mediaplayer






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jun 12 '15 at 15:22









sh3rifmesh3rifme

629619




629619








  • 1





    not sure you can do this from Java. For sure from a C++ plugin you can use native texture ptr, as shown in the relative example in the doc: docs.unity3d.com/Manual/NativePluginInterface.html

    – Heisenbug
    Jun 13 '15 at 9:49











  • Yea it seems to be the case...

    – sh3rifme
    Jun 14 '15 at 10:53














  • 1





    not sure you can do this from Java. For sure from a C++ plugin you can use native texture ptr, as shown in the relative example in the doc: docs.unity3d.com/Manual/NativePluginInterface.html

    – Heisenbug
    Jun 13 '15 at 9:49











  • Yea it seems to be the case...

    – sh3rifme
    Jun 14 '15 at 10:53








1




1





not sure you can do this from Java. For sure from a C++ plugin you can use native texture ptr, as shown in the relative example in the doc: docs.unity3d.com/Manual/NativePluginInterface.html

– Heisenbug
Jun 13 '15 at 9:49





not sure you can do this from Java. For sure from a C++ plugin you can use native texture ptr, as shown in the relative example in the doc: docs.unity3d.com/Manual/NativePluginInterface.html

– Heisenbug
Jun 13 '15 at 9:49













Yea it seems to be the case...

– sh3rifme
Jun 14 '15 at 10:53





Yea it seems to be the case...

– sh3rifme
Jun 14 '15 at 10:53












2 Answers
2






active

oldest

votes


















1














Did you try creating the surfacetexture in the unity rendering thread, for example by overriding runglthreadsjobs in an extended UnityPlayer? That would make sure it bound to the correct glcontext AFAIK.



I have tried sharing contexts, but couldn't get it to work as documentation is sparse and unity is pretty closed down.



In unity 4.2 its a lot easier apparently.






share|improve this answer
























  • I attempted something similar to that with no luck, though I didn't do it by overriding runglthreadsjobs, and instead initialized the texture in the OnPreRender() call on the main camera of the scene iirc. I'm not working on the project anymore and unfortunately I don't know if that ever worked, as I moved my focus elsewhere in the app after a bunch of strife with that issue. But thank you for the answer!

    – sh3rifme
    Feb 24 '16 at 17:37













  • I actually did get it to work later. I shared opengl contexts and passed the Unity native texture ID to Android with a JavaObject call. You have to catch (in runGLThreadsJobs) and pass the Unity context as the subcontext (IIRC). It works pretty well, but I have not tried on many phones. Context sharing is iffy sometimes and it's not done a lot, but as long as both contexts are in the same app there is a good chance it will work well. Other way around (to Unity) is a lot harder since you don't get the chance to pass a subcontext to Unity.

    – RobotRock
    Feb 24 '16 at 21:08











  • @RobotRock how do you do that in practice? I can't understand how to "catch" the context from RunGLThreadsJobs. Actually I can't even find RunGLThreadsJobs, all I can find is executeGLThreadJobs, did you mean this one? Right now I'm creating the texture in the java plugin (GLES20.glGenTextures) and passing the texture ID to unity with a sendmessage. Unity then uses the ID to create an external texture (Texture2D.CreateExternalTexture), but it doesn't seem to work. I'm getting "bindTextureImage: clearing GL error: 0x502" and nothing is being displayed. Could you share some piece of code maybe?

    – UB-
    Mar 21 '16 at 22:40











  • Yeah, I meant that one. I opensourced my project recently that does it: github.com/Kjos/HoloKilo Have at it :)

    – RobotRock
    Mar 22 '16 at 8:25



















0














It would appears that while i have found nothing explicitly states that this CAN be done, there is no real information or any examples of it having been done before.



I'll be attempting a re-working of this in native C++ code.






share|improve this answer
























  • Mind sharing your solution then? Even today, the new unity VideoPlayer in android is still buggy. The prepare function freezes the app. I am here looking to implement this.

    – TatiOverflow
    Nov 9 '17 at 18:04






  • 1





    @TatiOverflow I sadly never managed to implement it.

    – sh3rifme
    Nov 21 '17 at 14:28











  • thanks. I ended up buying easy movie texture to deal with android side of things. amazing that a third party can implement the video correctly but unity can't.

    – TatiOverflow
    Nov 24 '17 at 19:22











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f30806718%2fcan-an-android-java-not-c-c-plugin-alter-unity-textures%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














Did you try creating the surfacetexture in the unity rendering thread, for example by overriding runglthreadsjobs in an extended UnityPlayer? That would make sure it bound to the correct glcontext AFAIK.



I have tried sharing contexts, but couldn't get it to work as documentation is sparse and unity is pretty closed down.



In unity 4.2 its a lot easier apparently.






share|improve this answer
























  • I attempted something similar to that with no luck, though I didn't do it by overriding runglthreadsjobs, and instead initialized the texture in the OnPreRender() call on the main camera of the scene iirc. I'm not working on the project anymore and unfortunately I don't know if that ever worked, as I moved my focus elsewhere in the app after a bunch of strife with that issue. But thank you for the answer!

    – sh3rifme
    Feb 24 '16 at 17:37













  • I actually did get it to work later. I shared opengl contexts and passed the Unity native texture ID to Android with a JavaObject call. You have to catch (in runGLThreadsJobs) and pass the Unity context as the subcontext (IIRC). It works pretty well, but I have not tried on many phones. Context sharing is iffy sometimes and it's not done a lot, but as long as both contexts are in the same app there is a good chance it will work well. Other way around (to Unity) is a lot harder since you don't get the chance to pass a subcontext to Unity.

    – RobotRock
    Feb 24 '16 at 21:08











  • @RobotRock how do you do that in practice? I can't understand how to "catch" the context from RunGLThreadsJobs. Actually I can't even find RunGLThreadsJobs, all I can find is executeGLThreadJobs, did you mean this one? Right now I'm creating the texture in the java plugin (GLES20.glGenTextures) and passing the texture ID to unity with a sendmessage. Unity then uses the ID to create an external texture (Texture2D.CreateExternalTexture), but it doesn't seem to work. I'm getting "bindTextureImage: clearing GL error: 0x502" and nothing is being displayed. Could you share some piece of code maybe?

    – UB-
    Mar 21 '16 at 22:40











  • Yeah, I meant that one. I opensourced my project recently that does it: github.com/Kjos/HoloKilo Have at it :)

    – RobotRock
    Mar 22 '16 at 8:25
















1














Did you try creating the surfacetexture in the unity rendering thread, for example by overriding runglthreadsjobs in an extended UnityPlayer? That would make sure it bound to the correct glcontext AFAIK.



I have tried sharing contexts, but couldn't get it to work as documentation is sparse and unity is pretty closed down.



In unity 4.2 its a lot easier apparently.






share|improve this answer
























  • I attempted something similar to that with no luck, though I didn't do it by overriding runglthreadsjobs, and instead initialized the texture in the OnPreRender() call on the main camera of the scene iirc. I'm not working on the project anymore and unfortunately I don't know if that ever worked, as I moved my focus elsewhere in the app after a bunch of strife with that issue. But thank you for the answer!

    – sh3rifme
    Feb 24 '16 at 17:37













  • I actually did get it to work later. I shared opengl contexts and passed the Unity native texture ID to Android with a JavaObject call. You have to catch (in runGLThreadsJobs) and pass the Unity context as the subcontext (IIRC). It works pretty well, but I have not tried on many phones. Context sharing is iffy sometimes and it's not done a lot, but as long as both contexts are in the same app there is a good chance it will work well. Other way around (to Unity) is a lot harder since you don't get the chance to pass a subcontext to Unity.

    – RobotRock
    Feb 24 '16 at 21:08











  • @RobotRock how do you do that in practice? I can't understand how to "catch" the context from RunGLThreadsJobs. Actually I can't even find RunGLThreadsJobs, all I can find is executeGLThreadJobs, did you mean this one? Right now I'm creating the texture in the java plugin (GLES20.glGenTextures) and passing the texture ID to unity with a sendmessage. Unity then uses the ID to create an external texture (Texture2D.CreateExternalTexture), but it doesn't seem to work. I'm getting "bindTextureImage: clearing GL error: 0x502" and nothing is being displayed. Could you share some piece of code maybe?

    – UB-
    Mar 21 '16 at 22:40











  • Yeah, I meant that one. I opensourced my project recently that does it: github.com/Kjos/HoloKilo Have at it :)

    – RobotRock
    Mar 22 '16 at 8:25














1












1








1







Did you try creating the surfacetexture in the unity rendering thread, for example by overriding runglthreadsjobs in an extended UnityPlayer? That would make sure it bound to the correct glcontext AFAIK.



I have tried sharing contexts, but couldn't get it to work as documentation is sparse and unity is pretty closed down.



In unity 4.2 its a lot easier apparently.






share|improve this answer













Did you try creating the surfacetexture in the unity rendering thread, for example by overriding runglthreadsjobs in an extended UnityPlayer? That would make sure it bound to the correct glcontext AFAIK.



I have tried sharing contexts, but couldn't get it to work as documentation is sparse and unity is pretty closed down.



In unity 4.2 its a lot easier apparently.







share|improve this answer












share|improve this answer



share|improve this answer










answered Dec 23 '15 at 0:59









RobotRockRobotRock

2,03233172




2,03233172













  • I attempted something similar to that with no luck, though I didn't do it by overriding runglthreadsjobs, and instead initialized the texture in the OnPreRender() call on the main camera of the scene iirc. I'm not working on the project anymore and unfortunately I don't know if that ever worked, as I moved my focus elsewhere in the app after a bunch of strife with that issue. But thank you for the answer!

    – sh3rifme
    Feb 24 '16 at 17:37













  • I actually did get it to work later. I shared opengl contexts and passed the Unity native texture ID to Android with a JavaObject call. You have to catch (in runGLThreadsJobs) and pass the Unity context as the subcontext (IIRC). It works pretty well, but I have not tried on many phones. Context sharing is iffy sometimes and it's not done a lot, but as long as both contexts are in the same app there is a good chance it will work well. Other way around (to Unity) is a lot harder since you don't get the chance to pass a subcontext to Unity.

    – RobotRock
    Feb 24 '16 at 21:08











  • @RobotRock how do you do that in practice? I can't understand how to "catch" the context from RunGLThreadsJobs. Actually I can't even find RunGLThreadsJobs, all I can find is executeGLThreadJobs, did you mean this one? Right now I'm creating the texture in the java plugin (GLES20.glGenTextures) and passing the texture ID to unity with a sendmessage. Unity then uses the ID to create an external texture (Texture2D.CreateExternalTexture), but it doesn't seem to work. I'm getting "bindTextureImage: clearing GL error: 0x502" and nothing is being displayed. Could you share some piece of code maybe?

    – UB-
    Mar 21 '16 at 22:40











  • Yeah, I meant that one. I opensourced my project recently that does it: github.com/Kjos/HoloKilo Have at it :)

    – RobotRock
    Mar 22 '16 at 8:25



















  • I attempted something similar to that with no luck, though I didn't do it by overriding runglthreadsjobs, and instead initialized the texture in the OnPreRender() call on the main camera of the scene iirc. I'm not working on the project anymore and unfortunately I don't know if that ever worked, as I moved my focus elsewhere in the app after a bunch of strife with that issue. But thank you for the answer!

    – sh3rifme
    Feb 24 '16 at 17:37













  • I actually did get it to work later. I shared opengl contexts and passed the Unity native texture ID to Android with a JavaObject call. You have to catch (in runGLThreadsJobs) and pass the Unity context as the subcontext (IIRC). It works pretty well, but I have not tried on many phones. Context sharing is iffy sometimes and it's not done a lot, but as long as both contexts are in the same app there is a good chance it will work well. Other way around (to Unity) is a lot harder since you don't get the chance to pass a subcontext to Unity.

    – RobotRock
    Feb 24 '16 at 21:08











  • @RobotRock how do you do that in practice? I can't understand how to "catch" the context from RunGLThreadsJobs. Actually I can't even find RunGLThreadsJobs, all I can find is executeGLThreadJobs, did you mean this one? Right now I'm creating the texture in the java plugin (GLES20.glGenTextures) and passing the texture ID to unity with a sendmessage. Unity then uses the ID to create an external texture (Texture2D.CreateExternalTexture), but it doesn't seem to work. I'm getting "bindTextureImage: clearing GL error: 0x502" and nothing is being displayed. Could you share some piece of code maybe?

    – UB-
    Mar 21 '16 at 22:40











  • Yeah, I meant that one. I opensourced my project recently that does it: github.com/Kjos/HoloKilo Have at it :)

    – RobotRock
    Mar 22 '16 at 8:25

















I attempted something similar to that with no luck, though I didn't do it by overriding runglthreadsjobs, and instead initialized the texture in the OnPreRender() call on the main camera of the scene iirc. I'm not working on the project anymore and unfortunately I don't know if that ever worked, as I moved my focus elsewhere in the app after a bunch of strife with that issue. But thank you for the answer!

– sh3rifme
Feb 24 '16 at 17:37







I attempted something similar to that with no luck, though I didn't do it by overriding runglthreadsjobs, and instead initialized the texture in the OnPreRender() call on the main camera of the scene iirc. I'm not working on the project anymore and unfortunately I don't know if that ever worked, as I moved my focus elsewhere in the app after a bunch of strife with that issue. But thank you for the answer!

– sh3rifme
Feb 24 '16 at 17:37















I actually did get it to work later. I shared opengl contexts and passed the Unity native texture ID to Android with a JavaObject call. You have to catch (in runGLThreadsJobs) and pass the Unity context as the subcontext (IIRC). It works pretty well, but I have not tried on many phones. Context sharing is iffy sometimes and it's not done a lot, but as long as both contexts are in the same app there is a good chance it will work well. Other way around (to Unity) is a lot harder since you don't get the chance to pass a subcontext to Unity.

– RobotRock
Feb 24 '16 at 21:08





I actually did get it to work later. I shared opengl contexts and passed the Unity native texture ID to Android with a JavaObject call. You have to catch (in runGLThreadsJobs) and pass the Unity context as the subcontext (IIRC). It works pretty well, but I have not tried on many phones. Context sharing is iffy sometimes and it's not done a lot, but as long as both contexts are in the same app there is a good chance it will work well. Other way around (to Unity) is a lot harder since you don't get the chance to pass a subcontext to Unity.

– RobotRock
Feb 24 '16 at 21:08













@RobotRock how do you do that in practice? I can't understand how to "catch" the context from RunGLThreadsJobs. Actually I can't even find RunGLThreadsJobs, all I can find is executeGLThreadJobs, did you mean this one? Right now I'm creating the texture in the java plugin (GLES20.glGenTextures) and passing the texture ID to unity with a sendmessage. Unity then uses the ID to create an external texture (Texture2D.CreateExternalTexture), but it doesn't seem to work. I'm getting "bindTextureImage: clearing GL error: 0x502" and nothing is being displayed. Could you share some piece of code maybe?

– UB-
Mar 21 '16 at 22:40





@RobotRock how do you do that in practice? I can't understand how to "catch" the context from RunGLThreadsJobs. Actually I can't even find RunGLThreadsJobs, all I can find is executeGLThreadJobs, did you mean this one? Right now I'm creating the texture in the java plugin (GLES20.glGenTextures) and passing the texture ID to unity with a sendmessage. Unity then uses the ID to create an external texture (Texture2D.CreateExternalTexture), but it doesn't seem to work. I'm getting "bindTextureImage: clearing GL error: 0x502" and nothing is being displayed. Could you share some piece of code maybe?

– UB-
Mar 21 '16 at 22:40













Yeah, I meant that one. I opensourced my project recently that does it: github.com/Kjos/HoloKilo Have at it :)

– RobotRock
Mar 22 '16 at 8:25





Yeah, I meant that one. I opensourced my project recently that does it: github.com/Kjos/HoloKilo Have at it :)

– RobotRock
Mar 22 '16 at 8:25













0














It would appears that while i have found nothing explicitly states that this CAN be done, there is no real information or any examples of it having been done before.



I'll be attempting a re-working of this in native C++ code.






share|improve this answer
























  • Mind sharing your solution then? Even today, the new unity VideoPlayer in android is still buggy. The prepare function freezes the app. I am here looking to implement this.

    – TatiOverflow
    Nov 9 '17 at 18:04






  • 1





    @TatiOverflow I sadly never managed to implement it.

    – sh3rifme
    Nov 21 '17 at 14:28











  • thanks. I ended up buying easy movie texture to deal with android side of things. amazing that a third party can implement the video correctly but unity can't.

    – TatiOverflow
    Nov 24 '17 at 19:22
















0














It would appears that while i have found nothing explicitly states that this CAN be done, there is no real information or any examples of it having been done before.



I'll be attempting a re-working of this in native C++ code.






share|improve this answer
























  • Mind sharing your solution then? Even today, the new unity VideoPlayer in android is still buggy. The prepare function freezes the app. I am here looking to implement this.

    – TatiOverflow
    Nov 9 '17 at 18:04






  • 1





    @TatiOverflow I sadly never managed to implement it.

    – sh3rifme
    Nov 21 '17 at 14:28











  • thanks. I ended up buying easy movie texture to deal with android side of things. amazing that a third party can implement the video correctly but unity can't.

    – TatiOverflow
    Nov 24 '17 at 19:22














0












0








0







It would appears that while i have found nothing explicitly states that this CAN be done, there is no real information or any examples of it having been done before.



I'll be attempting a re-working of this in native C++ code.






share|improve this answer













It would appears that while i have found nothing explicitly states that this CAN be done, there is no real information or any examples of it having been done before.



I'll be attempting a re-working of this in native C++ code.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jun 15 '15 at 15:51









sh3rifmesh3rifme

629619




629619













  • Mind sharing your solution then? Even today, the new unity VideoPlayer in android is still buggy. The prepare function freezes the app. I am here looking to implement this.

    – TatiOverflow
    Nov 9 '17 at 18:04






  • 1





    @TatiOverflow I sadly never managed to implement it.

    – sh3rifme
    Nov 21 '17 at 14:28











  • thanks. I ended up buying easy movie texture to deal with android side of things. amazing that a third party can implement the video correctly but unity can't.

    – TatiOverflow
    Nov 24 '17 at 19:22



















  • Mind sharing your solution then? Even today, the new unity VideoPlayer in android is still buggy. The prepare function freezes the app. I am here looking to implement this.

    – TatiOverflow
    Nov 9 '17 at 18:04






  • 1





    @TatiOverflow I sadly never managed to implement it.

    – sh3rifme
    Nov 21 '17 at 14:28











  • thanks. I ended up buying easy movie texture to deal with android side of things. amazing that a third party can implement the video correctly but unity can't.

    – TatiOverflow
    Nov 24 '17 at 19:22

















Mind sharing your solution then? Even today, the new unity VideoPlayer in android is still buggy. The prepare function freezes the app. I am here looking to implement this.

– TatiOverflow
Nov 9 '17 at 18:04





Mind sharing your solution then? Even today, the new unity VideoPlayer in android is still buggy. The prepare function freezes the app. I am here looking to implement this.

– TatiOverflow
Nov 9 '17 at 18:04




1




1





@TatiOverflow I sadly never managed to implement it.

– sh3rifme
Nov 21 '17 at 14:28





@TatiOverflow I sadly never managed to implement it.

– sh3rifme
Nov 21 '17 at 14:28













thanks. I ended up buying easy movie texture to deal with android side of things. amazing that a third party can implement the video correctly but unity can't.

– TatiOverflow
Nov 24 '17 at 19:22





thanks. I ended up buying easy movie texture to deal with android side of things. amazing that a third party can implement the video correctly but unity can't.

– TatiOverflow
Nov 24 '17 at 19:22


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f30806718%2fcan-an-android-java-not-c-c-plugin-alter-unity-textures%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

鏡平學校

ꓛꓣだゔៀៅຸ໢ທຮ໕໒ ,ໂ'໥໓າ໼ឨឲ៵៭ៈゎゔit''䖳𥁄卿' ☨₤₨こゎもょの;ꜹꟚꞖꞵꟅꞛေၦေɯ,ɨɡ𛃵𛁹ޝ޳ޠ޾,ޤޒޯ޾𫝒𫠁သ𛅤チョ'サノބޘދ𛁐ᶿᶇᶀᶋᶠ㨑㽹⻮ꧬ꧹؍۩وَؠ㇕㇃㇪ ㇦㇋㇋ṜẰᵡᴠ 軌ᵕ搜۳ٰޗޮ޷ސޯ𫖾𫅀ल, ꙭ꙰ꚅꙁꚊꞻꝔ꟠Ꝭㄤﺟޱސꧨꧼ꧴ꧯꧽ꧲ꧯ'⽹⽭⾁⿞⼳⽋២៩ញណើꩯꩤ꩸ꩮᶻᶺᶧᶂ𫳲𫪭𬸄𫵰𬖩𬫣𬊉ၲ𛅬㕦䬺𫝌𫝼,,𫟖𫞽ហៅ஫㆔ాఆఅꙒꚞꙍ,Ꙟ꙱エ ,ポテ,フࢰࢯ𫟠𫞶 𫝤𫟠ﺕﹱﻜﻣ𪵕𪭸𪻆𪾩𫔷ġ,ŧآꞪ꟥,ꞔꝻ♚☹⛵𛀌ꬷꭞȄƁƪƬșƦǙǗdžƝǯǧⱦⱰꓕꓢႋ神 ဴ၀க௭எ௫ឫោ ' េㇷㇴㇼ神ㇸㇲㇽㇴㇼㇻㇸ'ㇸㇿㇸㇹㇰㆣꓚꓤ₡₧ ㄨㄟ㄂ㄖㄎ໗ツڒذ₶।ऩछएोञयूटक़कयँृी,冬'𛅢𛅥ㇱㇵㇶ𥄥𦒽𠣧𠊓𧢖𥞘𩔋цѰㄠſtʯʭɿʆʗʍʩɷɛ,əʏダヵㄐㄘR{gỚṖḺờṠṫảḙḭᴮᵏᴘᵀᵷᵕᴜᴏᵾq﮲ﲿﴽﭙ軌ﰬﶚﶧ﫲Ҝжюїкӈㇴffצּ﬘﭅﬈軌'ffistfflſtffतभफɳɰʊɲʎ𛁱𛁖𛁮𛀉 𛂯𛀞నఋŀŲ 𫟲𫠖𫞺ຆຆ ໹້໕໗ๆทԊꧢꧠ꧰ꓱ⿝⼑ŎḬẃẖỐẅ ,ờỰỈỗﮊDžȩꭏꭎꬻ꭮ꬿꭖꭥꭅ㇭神 ⾈ꓵꓑ⺄㄄ㄪㄙㄅㄇstA۵䞽ॶ𫞑𫝄㇉㇇゜軌𩜛𩳠Jﻺ‚Üမ႕ႌႊၐၸဓၞၞၡ៸wyvtᶎᶪᶹစဎ꣡꣰꣢꣤ٗ؋لㇳㇾㇻㇱ㆐㆔,,㆟Ⱶヤマފ޼ޝަݿݞݠݷݐ',ݘ,ݪݙݵ𬝉𬜁𫝨𫞘くせぉて¼óû×ó£…𛅑הㄙくԗԀ5606神45,神796'𪤻𫞧ꓐ㄁ㄘɥɺꓵꓲ3''7034׉ⱦⱠˆ“𫝋ȍ,ꩲ軌꩷ꩶꩧꩫఞ۔فڱێظペサ神ナᴦᵑ47 9238їﻂ䐊䔉㠸﬎ffiﬣ,לּᴷᴦᵛᵽ,ᴨᵤ ᵸᵥᴗᵈꚏꚉꚟ⻆rtǟƴ𬎎

Why https connections are so slow when debugging (stepping over) in Java?