-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scala Wrapper Not Working #24
Comments
Can you try to initialize as follow?
|
I tried, it gives syntax error. However, if I try |
I think it might be related to the underlying native object being destroyed before the Scala counterpart is gone. Can you try the following? I will try to create a helloworld example for Scala as well.
FYI: I didn't have the chance to test this snippet yet. It might be a while before I can provide a well tested sample. |
I got the same error with the above code as well. As soon as I access the movie instance within loop, it breaks. |
I also tried the following, but still the same error.
|
Ok, I'll have to do a deeper dive it seems. I'll keep the thread posted.
Best,
Can
…On Dec 6, 2018, 2:34 AM -0800, Khuram U. Khalid ***@***.***>, wrote:
I also tried the following, but still the same error.
object UsingMovie {
def apply[T](src: String)(f: demux.Movie => T): T = {
val movie = demux.Movie(src)
try {
f(movie)
} finally {
movie.close()
}
}
}
object App {
def main(args: Array[String]): Unit = {
UsingMovie("helloworld.mp4") { movie =>
println("video track duration: %d".format(movie.videoTrack.duration()))
}
}
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Many thanks. |
Native library throws exception when initialising
demux.Movie
object withByteData(arrayOfBytes)
Expected behavior
Should initialise the Movie object without exception.
Actual behavior
Native code throws exception.
Steps to reproduce the behavior
If possible, can you provide a Scala example.
hs_err_pid22716.log
The text was updated successfully, but these errors were encountered: