gpt4 book ai didi

Android VideoView 准备失败; OMX-VDEC 报告第二个实例

转载 作者:搜寻专家 更新时间:2023-11-01 09:12:52 24 4
gpt4 key购买 nike

有问题的代码:

public class VideoPlayer extends Activity {
Bundle bundle;
VideoView vv;
String type;
Uri path;
Context mContext;
ImageView countImage;

@Override
public void onCreate(Bundle savedInstanceState) {
//Remove title bar
this.requestWindowFeature(Window.FEATURE_NO_TITLE);

//Remove notification bar
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

super.onCreate(savedInstanceState);
setContentView(R.layout.videoplayer);
mContext = getBaseContext();
vv = (VideoView) findViewById(R.id.videoView1);
countImage = (ImageView) findViewById(R.id.countdownNumber);
countImage.setVisibility(View.GONE);
getWindow().setFormat(PixelFormat.TRANSLUCENT);

// get details from the Bundle's extras.
bundle = getIntent().getExtras();
String playMode = bundle.getString("mode");

if (playMode.compareTo("single") == 0) { playSingle(); }
else if (playMode.compareTo("multi") == 0) { playMulti(); }
else { finish(); }
}


// --- PLAY SINGLE ---
public void playSingle() {
// retrieve name of video to play from the Bundle
String videoname = bundle.getString("videoname");
Uri path = Uri.parse("android.resource://com.sexinfo101.positions.guide/raw/video_" + videoname);
boolean result = false;
int test = mContext.getResources().getIdentifier("video_" + videoname, "raw", mContext.getPackageName());
if (test != 0) { result = true; }
if (!result) { finish(); }

vv.setMediaController(new MediaController(this));
vv.setVideoURI(path);
vv.requestFocus();
//vv.start();

vv.setOnPreparedListener(new OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
mp.setLooping(true);
vv.start();
}
});

vv.setOnCompletionListener(new OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mp) {
if (!mp.isPlaying()) {
mp.release();
finish(); // we're done here
}
}
});
}
}

logcat 输出:

08-06 15:22:30.770: ERROR/MediaPlayerService(116): Returning PV_PLAYER*************************
08-06 15:22:30.790: ERROR/PlayerDriver(116): Creating Non-Tunnel mode playback - uncompressed MIO
08-06 15:22:30.800: ERROR/OMX-VDEC-720P(116): In OMX vdec Constuctor
08-06 15:22:30.800: ERROR/OMX-VDEC-720P(116): Name of the device is Unknown
08-06 15:22:30.800: ERROR/OMX-VDEC-720P(116): omx_vdec::component_init(): Start of New Playback
08-06 15:22:30.800: ERROR/OMX-VDEC-720P(116): omx_vdec::component_init(): Open returned fd 30
08-06 15:22:31.300: ERROR/OMX-VDEC-720P(116): Reject Second instance of Decoder
08-06 15:22:31.300: ERROR/OMX-VDEC-720P(116): In OMX vdec Destructor
08-06 15:22:31.300: ERROR/OMX-VDEC-720P(116): Waiting on OMX Msg Thread exit
08-06 15:22:31.300: ERROR/OMX-VDEC-720P(116): Waiting on OMX Async Thread exit
08-06 15:22:31.300: ERROR/OMX-VDEC-720P(116): Exit OMX vdec Destructor
08-06 15:22:31.310: ERROR/PlayerDriver(116): Command PLAYER_PREPARE completed with an error or info PVMFErrResource
08-06 15:22:31.320: ERROR/MediaPlayer(1364): error (1, -17)
08-06 15:22:31.330: ERROR/MediaPlayer(1364): Error (1,-17)

后面是更多的 logcat 输出:

08-06 15:24:29.400: ERROR/AndroidRuntime(1364): FATAL EXCEPTION: main
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): java.lang.IllegalStateException
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at android.media.MediaPlayer._reset(Native Method)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at android.media.MediaPlayer.reset(MediaPlayer.java:1061)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at android.widget.VideoView.release(VideoView.java:510)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at android.widget.VideoView.access$2100(VideoView.java:50)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at android.widget.VideoView$6.surfaceDestroyed(VideoView.java:500)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at android.view.SurfaceView.reportSurfaceDestroyed(SurfaceView.java:568)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at android.view.SurfaceView.updateWindow(SurfaceView.java:472)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:206)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at android.view.View.dispatchDetachedFromWindow(View.java:6029)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1156)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1156)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:1156)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at android.view.ViewRoot.dispatchDetachedFromWindow(ViewRoot.java:1630)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at android.view.ViewRoot.doDie(ViewRoot.java:2720)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at android.view.ViewRoot.die(ViewRoot.java:2690)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:218)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at android.view.Window$LocalWindowManager.removeViewImmediate(Window.java:436)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3684)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at android.app.ActivityThread.access$2900(ActivityThread.java:125)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at android.os.Handler.dispatchMessage(Handler.java:99)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at android.os.Looper.loop(Looper.java:123)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at android.app.ActivityThread.main(ActivityThread.java:4627)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at java.lang.reflect.Method.invokeNative(Native Method)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at java.lang.reflect.Method.invoke(Method.java:521)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
08-06 15:24:29.400: ERROR/AndroidRuntime(1364): at dalvik.system.NativeStart.main(Native Method)

我怀疑 logcat 行“08-06 17:31:29.960: ERROR/OMX-VDEC-720P(116): Reject Second instance of Decoder”指向准备失败的原因,但我有不知道第二个实例来自哪里。它确实先于解码器的实际关闭,因此如果不是原因,它似乎至少暗示了一个原因。

有什么想法吗?在调试器中,我可以看到找到了一个有效的资源,并且在我从上面的代码中删除的多人游戏函数中将定时器换成处理程序和可运行程序之前,这段代码工作得很好。

最佳答案

好的,这原来是固件/操作系统/设备问题。这个问题可能是由我最近开始使用的 SuperBoot 引导 ROM 在我的华为 IDEOS X5 U8800 手机上获得 root 权限引起的。根据开发者的说法,这个引导 ROM 是为固件版本 136 开发的,我使用的是 135。升级后,一切似乎再次顺利运行,包括 WiFi 访问和一切:)

可以在此处找到讨论此问题的论坛线程的链接:http://android.modaco.com/topic/340374-25-may-r1-superboot-and-then-some-for-the-huawei-u8800-ideos-x5/

关于Android VideoView 准备失败; OMX-VDEC 报告第二个实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6967952/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com