Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6894613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:48:16+00:00 2026-05-27T06:48:16+00:00

I have created one thread for calling native function which are calling the MPEG2

  • 0

I have created one thread for calling native function which are calling the MPEG2 codec which is developed in C. And callback_handler is calling java function for giving image frame and handler is displaying the frames on image view. And it is working fine. but when I am trying to create two threads for calling native function for each thread and displaying two videos.I have created two handlers for each thread. but when I started the application it is calling native methods two times but after some function execution I am getting VM Aborting error. I have searched for that problem. And I found that one JNIEnv can have only one thread.And for that we should register thread JNIEnv with JavaVM. In callback_handler I am doing that by using this function

JNIEnv *env = RegisterWithVM(&jvm);
    if((NULL == env) || (NULL == jvm))
    {
        __android_log_print(ANDROID_LOG_INFO,"JNI", "callback_handler call failed\n");
        return;
    }

And I have also tried to attch the currentThread Enviroment with JavaVM in JNi native function using that code.

gJavaVM->GetEnv((void**) &env, JNI_VERSION_1_6);
gJavaVM->AttachCurrentThread(&env, NULL);

But after using this I am getting this error.

11-28 16:40:23.430: I/JNI(323): Loaded
11-28 16:40:23.430: I/JNI(323): Find the class
11-28 16:40:23.430: I/JNI(323): Registered...
11-28 16:40:23.430: I/JNI(323): Version...65540
11-28 16:40:23.440: I/JNI(323): CallDecoding function of thread is called
11-28 16:40:23.451: I/JNI(323): StartDecoding function is called
11-28 16:40:23.451: W/dalvikvm(323): JNI WARNING: threadid=7 using env from threadid=8
11-28 16:40:23.451: W/dalvikvm(323):              in Lcom/example/Internet_TV12;.CallDecoding1 (ILjava/lang/Object;)V (NewByteArray)
11-28 16:40:23.451: I/dalvikvm(323): "Thread-8" prio=5 tid=7 NATIVE
11-28 16:40:23.451: I/dalvikvm(323):   | group="main" sCount=0 dsCount=0 s=N obj=0x44ee97f0 self=0x131cc0
11-28 16:40:23.470: I/JNI(323): CallDecoding function of thread is called
11-28 16:40:23.470: I/JNI(323): In JNI interface image file opened 
11-28 16:40:23.470: I/JNI(323): StartDecoding function is called

11-28 16:40:23.499: I/dalvikvm(323):   | sysTid=331 nice=0 sched=0/0 cgrp=default handle=1153704
11-28 16:40:23.499: I/dalvikvm(323):   | schedstat=( 28746111 138980250 15 )
11-28 16:40:23.499: I/dalvikvm(323):   at com.example.Internet_TV12.CallDecoding1(Native Method)
11-28 16:40:23.499: I/dalvikvm(323):   at com.example.Internet_TV12$4.run(Internet_TV12.java:57)
11-28 16:40:23.499: I/dalvikvm(323):   at java.lang.Thread.run(Thread.java:1096)
11-28 16:40:23.499: E/dalvikvm(323): VM aborting

Can any body please help me to resolve this problem…

Thanks in Advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:48:17+00:00Added an answer on May 27, 2026 at 6:48 am

    It seems that you overwrite your env variable and then use it again in different thread.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created one application in flex that is accessing the Java webservice using
I have created a .NET DLL which makes some methods COM visible. One method
I have a collection of BufferedImage instances, one main image and some subimages created
I have created one table using the below command: create table Table1( Id int
I have created one aspx Page from that i need to access the property
I have created one user named tuser with create database rights in SQL server
hello i have created one windows application in c# .net and its working fine
I have created a one-time subscription in SSRS report manager 2008. However I keep
I have created a new method in one of the project's controllers that it
I have created two JavaScript files. One file is "validators.js" and the other is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.