2013-10-05 42 views
0

我已經使用不同的RTSP鏈接到目前爲止在Android中的Vitamio播放器上運行。我正在使用最新版本f Vitamio ..我正在使用Vitmaio的示例應用程序。只有HTTP,MMS和RTMP鏈接工作.. 以下是代碼.. VideoView.java無法通過Android上的Vitamio運行RTSP鏈接

public class VideoViewDemo extends Activity { 

    /** 
    * TODO: Set the path variable to a streaming video URL or a local media 
    * file path. 
    */ 
    private String path = "RTSP Link here"; 
    private VideoView mVideoView; 

    @Override 
    public void onCreate(Bundle icicle) { 
     super.onCreate(icicle); 
     if (!LibsChecker.checkVitamioLibs(this)) 
      return; 
     setContentView(R.layout.videoview); 
     mVideoView = (VideoView) findViewById(R.id.surface_view); 

     if (path == "") { 
      // Tell the user to provide a media file URL/path. 
      Toast.makeText(
        VideoViewDemo.this, 
        "Please edit VideoViewDemo Activity, and set path" 
          + " variable to your media file URL/path", 
        Toast.LENGTH_LONG).show(); 
      return; 
     } else { 
      /* 
      * Alternatively,for streaming media you can use 
      * mVideoView.setVideoURI(Uri.parse(URLstring)); 
      */ 
      mVideoView.setVideoPath(path); 
      mVideoView.setBufferSize(2048); 
      mVideoView.setVideoQuality(16); 
      mVideoView.setMediaController(new MediaController(this)); 
      mVideoView.requestFocus(); 
      // this.myVideoView.setOnBufferingUpdateListener(this.mBufferingUpdateListener); 

      mVideoView 
        .setOnPreparedListener(new MediaPlayer.OnPreparedListener() { 
         @Override 
         public void onPrepared(MediaPlayer mediaPlayer) { 
          // optional need Vitamio 4.0 
          mediaPlayer.setPlaybackSpeed(1.0f); 
         } 
        }); 
     } 

    } 
} 

LogCat..

10-06 02:41:00.638: D/Vitamio[Player](30388): [udp @ 0x53de8b00] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required) 
10-06 02:41:00.638: D/Vitamio[Player](30388): [udp @ 0x52467ef0] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required) 
10-06 02:41:00.958: D/Vitamio[Player](30388): [udp @ 0x54d603a0] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required) 
10-06 02:41:00.958: D/Vitamio[Player](30388): [udp @ 0x53cc9960] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required) 
10-06 02:41:07.563: D/Vitamio[Player](30388): Input #0, rtsp, from 'rtsp://dawnstream.hostingmadeeasy.com/dawn': 
10-06 02:41:07.563: D/Vitamio[Player](30388): Metadata: 
10-06 02:41:07.563: D/Vitamio[Player](30388):  title   : 
10-06 02:41:07.563: D/Vitamio[Player](30388): DawnNews TV(dawn.tvpakistan.com) 
10-06 02:41:07.563: D/Vitamio[Player](30388):  WMFSDKNeeded : 
10-06 02:41:07.563: D/Vitamio[Player](30388): 0.0.0.0000 
10-06 02:41:07.563: D/Vitamio[Player](30388):  DeviceConformanceTemplate: 
10-06 02:41:07.563: D/Vitamio[Player](30388): [email protected] 
10-06 02:41:07.563: D/Vitamio[Player](30388):  WMFSDKVersion : 
10-06 02:41:07.563: D/Vitamio[Player](30388): 9.00.00.3272 
10-06 02:41:07.563: D/Vitamio[Player](30388):  IsVBR   : 
10-06 02:41:07.563: D/Vitamio[Player](30388): 0 
10-06 02:41:07.563: D/Vitamio[Player](30388): Duration: 
10-06 02:41:07.563: D/Vitamio[Player](30388): 00:00:00.00 
10-06 02:41:07.563: D/Vitamio[Player](30388): , start: 
10-06 02:41:07.563: D/Vitamio[Player](30388): 310903.847000 
10-06 02:41:07.563: D/Vitamio[Player](30388): , bitrate: 
10-06 02:41:07.563: D/Vitamio[Player](30388): N/A 
10-06 02:41:07.568: D/Vitamio[Player](30388):  Stream #0:0 
10-06 02:41:07.568: D/Vitamio[Player](30388): : Audio: wmav2 (a[1][0][0]/0x0161), 32000 Hz, 2 channels, fltp, 40 kb/s 
10-06 02:41:07.573: D/Vitamio[Player](30388):  Stream #0:1 
10-06 02:41:07.573: D/Vitamio[Player](30388): : Video: wmv3 (Main) (WMV3/0x33564D57), yuv420p, 320x240, 65 kb/s 
10-06 02:41:07.573: D/Vitamio[Player](30388): , 25 tbr 
10-06 02:41:07.573: D/Vitamio[Player](30388): , 1k tbn 
10-06 02:41:07.573: D/Vitamio[Player](30388): , 1k tbc 
10-06 02:41:07.578: I/Vitamio[Player](30388): METADATA: DawnNews TV(dawn.tvpakistan.com)[email protected] 
10-06 02:41:07.583: I/Vitamio[Player](30388): META AUDIO: 0, META SUBTITLE: 
10-06 02:41:07.583: D/Vitamio[Player](30388): FIND CODEC_ID 86024 
10-06 02:41:07.583: I/Vitamio[Player](30388): WOW: BRILLIANT C COUNT 4 
10-06 02:41:07.593: D/Vitamio[Player](30388): OPEN CODEC wmav2 
10-06 02:41:07.593: I/Vitamio[Player](30388): OPEN STREAM AUDIO BEGIN 
10-06 02:41:07.593: I/Vitamio[Player](30388): Copyright (c) YIXIA (http://yixia.com). 
10-06 02:41:07.593: I/Vitamio[Player](30388): THIS SOFTWARE (Vitamio) IS WORK OF YIXIA (http://yixia.com) 
10-06 02:41:07.593: I/Vitamio[Player](30388): Application package name: io.vov.vitamio.demo 
10-06 02:41:07.593: I/Vitamio[Player](30388): 2, 32000, 0 
10-06 02:41:07.593: D/Vitamio[Player](30388): THREAD AUDIO_DECODE START 
10-06 02:41:07.628: D/Vitamio[Player](30388): THREAD AUDIO_OUTPUT START 
10-06 02:41:07.643: I/Vitamio[Player](30388): OPEN STREAM AUDIO END 
10-06 02:41:07.643: I/Vitamio[Player](30388): Copyright (c) YIXIA (http://yixia.com). 
10-06 02:41:07.643: I/Vitamio[Player](30388): THIS SOFTWARE (Vitamio) IS WORK OF YIXIA (http://yixia.com) 
10-06 02:41:07.643: I/Vitamio[Player](30388): Application package name: io.vov.vitamio.demo 
10-06 02:41:07.643: D/Vitamio[Player](30388): SURFACE INIT OK 
10-06 02:41:07.643: D/Vitamio[Player](30388): FIND CODEC_ID 72 
10-06 02:41:07.643: I/Vitamio[Player](30388): WOW: BRILLIANT C COUNT 4 
10-06 02:41:07.663: D/Vitamio[Player](30388): OPEN CODEC wmv3 
10-06 02:41:07.663: I/Vitamio[Player](30388): OPEN STREAM VIDEO BEGIN 
10-06 02:41:07.663: D/Vitamio[Player](30388): New video size 320 x 240 
10-06 02:41:07.668: D/Vitamio[Player](30388): onVideoSizeChanged: (320x240) 
10-06 02:41:07.673: I/Vitamio[Player](30388): OPEN STREAM VIDEO END 
10-06 02:41:07.673: D/Vitamio[Player](30388): CLEAN START 
10-06 02:41:07.673: D/Vitamio[Player](30388): prepared 
10-06 02:41:07.673: D/Vitamio[Player](30388): CLEAN END 
10-06 02:41:07.673: I/Vitamio[Player](30388): THREAD PREPARE DETTACHED 
10-06 02:41:07.673: I/Vitamio[Player](30388): THREAD PREPARE END 
10-06 02:41:07.673: D/Vitamio[Player](30388): VIDEO: 320x240x1.333333, Surface: 320x240, LP: 720x540, Window: 720x1280x0.562500 
10-06 02:41:07.683: I/Vitamio[Player](30388): THREAD ANALYTICS START 
10-06 02:41:07.688: D/Vitamio[Player](30388): GET CPU FATURE: V5TE V6 VFP V7A VFPV3 NEON 
10-06 02:41:07.688: D/Vitamio[Player](30388): THREAD DEMUX START 
10-06 02:41:07.693: D/Vitamio[Player](30388): THREAD VIDEO_DECODE START 
10-06 02:41:07.698: I/Vitamio[Player](30388): CC: ARMYUV420 0 
10-06 02:41:07.698: D/Vitamio[Player](30388): THREAD VIDEO_DISPLAY START 
10-06 02:41:07.728: D/Vitamio[Player](30388): New video size 320 x 240 
10-06 02:41:07.733: D/Vitamio[Player](30388): New video size 320 x 240 
10-06 02:41:07.753: D/Vitamio[Player](30388): onPrepared 
10-06 02:41:07.753: A/libc(30388): Fatal signal 11 (SIGSEGV) at 0x00000058 (code=1), thread 30388 (ov.vitamio.demo) 
10-06 02:41:08.508: D/Vitamio[Player](30830): CPU implementer:0x41 
10-06 02:41:08.508: D/Vitamio[Player](30830): Serial:0000000000000000 
10-06 02:41:08.508: D/Vitamio[Player](30830): CPU architecture:7 
10-06 02:41:08.508: D/Vitamio[Player](30830): Hardware:endeavoru 
10-06 02:41:08.508: D/Vitamio[Player](30830): CPU revision:9 
10-06 02:41:08.508: D/Vitamio[Player](30830): CPU variant:0x2 
10-06 02:41:08.508: D/Vitamio[Player](30830): CPU part:0xc09 
10-06 02:41:08.508: D/Vitamio[Player](30830): Revision:0000 
10-06 02:41:08.508: D/Vitamio[Player](30830): BogoMIPS:1992.29 
10-06 02:41:08.508: D/Vitamio[Player](30830): processor:3 
10-06 02:41:08.508: D/Vitamio[Player](30830): Features:swp half thumb fastmult vfp edsp neon vfpv3 tls 
10-06 02:41:08.508: D/Vitamio[Player](30830): Processor:ARMv7 Processor rev 9 (v7l) 
10-06 02:41:08.508: D/Vitamio[Player](30830): CPU architecture: 7 
10-06 02:41:08.508: D/Vitamio[Player](30830): GET CPU FATURE: V5TE V6 VFP V7A VFPV3 NEON 
10-06 02:41:08.513: I/Vitamio[Player](30830): isNativeLibsInited, APP VERSION: 2, Vitamio Library version: 2 
10-06 02:41:08.603: E/(30830): file /data/data/com.nvidia.NvCPLSvc/files/driverlist.txt: not found! 
10-06 02:41:08.603: I/(30830): Attempting to load EGL implementation /system/lib//egl/libEGL_tegra_impl 
10-06 02:41:08.608: I/(30830): Loaded EGL implementation /system/lib//egl/libEGL_tegra_impl 
10-06 02:41:08.638: I/(30830): Loading GLESv2 implementation /system/lib//egl/libGLESv2_tegra_impl 

但HTTP協議流工作正常..

更新 Android在每個RTSP鏈接上拋出此錯誤 Fatal signal 11 (SIGSEGV) at 0x00000058 (code=1), thread 26050 (ov.vitamio.demo) 現在,如果有人能幫我解決這個問題。謝謝。

+0

什麼是你使用的設備? – crossle

+0

@CrossleSong HTC One X –

回答

4

我有同樣的問題,我發現,如果我評論的代碼

mMediaPlayer.getMetadata(); 

在源文件MediaPlayerDemo_Video.java,該演示將運行正常。

我想也許有關於在Vitamio的lib中從直播流獲取元數據的問題。

希望此信息可能對您有所幫助。

+0

謝謝!這是問題.. @ pxd你能告訴VideoView的解決方案是什麼...它也不工作.. –

2

打開VideoView.java文件 而將這段代碼

Metadata data = mp.getMetadata(); 

    if (data != null) { 
     mCanPause = !data.has(Metadata.PAUSE_AVAILABLE) 
       || data.getBoolean(Metadata.PAUSE_AVAILABLE); 
     mCanSeekBack = !data.has(Metadata.SEEK_BACKWARD_AVAILABLE) 
       || data.getBoolean(Metadata.SEEK_BACKWARD_AVAILABLE); 
     mCanSeekForward = !data.has(Metadata.SEEK_FORWARD_AVAILABLE) 
       || data.getBoolean(Metadata.SEEK_FORWARD_AVAILABLE); 
    } else { 
     mCanPause = mCanSeekBack = mCanSeekForward = true; 
    } 

通過這個

mCanPause = mCanSeekBack = mCanSeekForward = true; 
+0

偉大的..它的工作。但它是「VideoView.java」而不是「ViewView.java」。不管怎樣,謝謝。 :) –

+0

感謝您注意,它的VideoView) – Rusty