Autore Topic: Problema con visualizzazione video  (Letto 1475 volte)

Offline -Bruno90-

  • Nuovo arrivato
  • *
  • Post: 41
  • Respect: 0
    • Mostra profilo
  • Dispositivo Android:
    HTC wildfire
  • Sistema operativo:
    Windows XP
Problema con visualizzazione video
« il: 26 Gennaio 2011, 15:03:37 CET »
0
ciao a tutti.
nella mia applicazione vorrei poter vedere un video (meglio la preview) appena registrato lanciando l'activity MediaStore.ACTION_VIDEO_CAPTURE
ora, la registrazione del video non dà problemi in quanto il video lo salvo e riesco a vederlo entrando in video.
Del video ho a disposizione l'uri che mi viene settato con l'istruzione:
Codice (Java): [Seleziona]
videoUri = getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);quando utilizzo una VideoView mi esce l'alert "impossibile riprodurre il video".
appena premo il pulsante salva l'app esegue:
Codice (Java): [Seleziona]
if (requestCode == VIDEO_CAPTURE) {
                    if (resultCode == RESULT_OK) {
                        //use imageUri here to access the image
                        video.setVideoURI(videoUri);
                        video.setMediaController(new MediaController(this));
                        video.requestFocus();
                        ETLat.setText(""+videoUri);
                    } else if (resultCode == RESULT_CANCELED) {
                        Toast.makeText(this, "Video was not taken", Toast.LENGTH_SHORT);
                    } else {
                        Toast.makeText(this, "Video was not taken", Toast.LENGTH_SHORT);
                    }
                }

e il logcat:
01-26 14:52:07.800: VERBOSE/Camcorder(4087): --onActivityResult--requestCode: 2002
01-26 14:52:07.800: VERBOSE/Camcorder(4087): --onActivityResult--resultCode: -1
01-26 14:52:07.800: VERBOSE/Camcorder(4087): --onActivityResult--data: Intent { act=inline-data }
01-26 14:52:07.816: ERROR/WindowManager(2486): Overwriting rotation value from 1
01-26 14:52:07.835: INFO/copybit(2486): [createPP] fimc version : 50 86
01-26 14:52:07.839: VERBOSE/MediaPlayer-JNI(3543): native_setup
01-26 14:52:07.839: VERBOSE/MediaPlayer(3543): constructor
01-26 14:52:07.839: VERBOSE/MediaPlayer(3543): setListener
01-26 14:52:07.839: INFO/MediaPlayer(3543): uri is:content://media/external/images/media/22
01-26 14:52:07.843: INFO/MediaPlayer(3543): inside  getAudioFilePath: content://media/external/images/media/22
01-26 14:52:07.847: INFO/MediaPlayer(3543): The actual path is:/mnt/sdcard/DCIM/Camera/1296049906490.jpg
01-26 14:52:07.847: INFO/MediaPlayer(3543): path is: /mnt/sdcard/DCIM/Camera/1296049906490.jpg
01-26 14:52:07.847: INFO/MediaPlayer(3543): file path found for DRM file:path is: /mnt/sdcard/DCIM/Camera/1296049906490.jpg
01-26 14:52:07.847: VERBOSE/MediaPlayer-JNI(3543): setDataSource: path /mnt/sdcard/DCIM/Camera/1296049906490.jpg
01-26 14:52:07.847: VERBOSE/MediaPlayer(3543): setDataSource(/mnt/sdcard/DCIM/Camera/1296049906490.jpg)
01-26 14:52:07.847: VERBOSE/PVPlayer(2393): PVPlayer constructor
01-26 14:52:07.847: VERBOSE/PVPlayer(2393): construct PlayerDriver
01-26 14:52:07.847: VERBOSE/PlayerDriver(2393): constructor
01-26 14:52:07.847: VERBOSE/PlayerDriver(2393): OpenCore hardware module not found
01-26 14:52:07.847: VERBOSE/PlayerDriver(2393): start player thread
01-26 14:52:07.851: VERBOSE/PlayerDriver(2393): startPlayerThread

ad un certo punto però il logcat dice:
01-26 14:52:07.862: VERBOSE/PVPlayer(2393):   data source = /mnt/sdcard/DCIM/Camera/1296049906490.jpg
01-26 14:52:07.870: VERBOSE/PlayerDriver(2393): Send player code: 3
01-26 14:52:07.870: VERBOSE/PlayerDriver(2393): handleSetDataSource
01-26 14:52:07.870: VERBOSE/PlayerDriver(2393): handleSetDataSource- scanning for extension
01-26 14:52:07.870: DEBUG/(2393): PVFile::GetFileName
01-26 14:52:07.874: VERBOSE/PlayerDriver(2393): HandleInformationalEvent: 26
01-26 14:52:07.874: VERBOSE/PlayerDriver(2393): HandleInformationalEvent: type=26 UNHANDLED
01-26 14:52:07.874: ERROR/MediaPlayerService(2393): Client::notify In
01-26 14:52:07.874: ERROR/MediaPlayer(3543): message received msg=200, ext1=1, ext2=26
01-26 14:52:07.874: WARN/MediaPlayer(3543): info/warning (1, 26)
01-26 14:52:07.874: ERROR/MediaPlayer(3543): callback application
01-26 14:52:07.874: ERROR/MediaPlayer(3543): back from callback
01-26 14:52:07.874: VERBOSE/PlayerDriver(2393): CommandCompleted
01-26 14:52:07.874: VERBOSE/PlayerDriver(2393): Completed command PLAYER_SET_DATA_SOURCE status=-4
01-26 14:52:07.874: ERROR/PlayerDriver(2393): Command PLAYER_SET_DATA_SOURCE completed with an error or info -4!!!!!!!!!
01-26 14:52:07.874: ERROR/MediaPlayerService(2393): Client::notify In
01-26 14:52:07.874: ERROR/MediaPlayer(3543): message received msg=100, ext1=-4, ext2=-4
01-26 14:52:07.874: ERROR/MediaPlayer(3543): error (-4, -4) !!!!!!!!!!!
01-26 14:52:07.874: ERROR/MediaPlayer(3543): callback application
01-26 14:52:07.874: ERROR/MediaPlayer(3543): back from callback
01-26 14:52:07.874: VERBOSE/PVPlayer(2393): run_init s=-2147483648, cancelled=0
01-26 14:52:07.874: VERBOSE/PlayerDriver(2393): HandleInformationalEvent: 27
01-26 14:52:07.874: WARN/PlayerDriver(2393): PVMFInfoErrorHandlingComplete
01-26 14:52:07.890: INFO/MediaPlayer(3543): Info (1,26)
01-26 14:52:07.890: ERROR/MediaPlayer(3543): Error (-4,-4)  !!!!!!!!!!!

come potrei risolvere???
grazie in anticipo

Offline -Bruno90-

  • Nuovo arrivato
  • *
  • Post: 41
  • Respect: 0
    • Mostra profilo
  • Dispositivo Android:
    HTC wildfire
  • Sistema operativo:
    Windows XP
Re:Problema con visualizzazione video
« Risposta #1 il: 27 Gennaio 2011, 15:56:13 CET »
0
Ho provato con il codice delle ApiDemos di google la VideoView_Demo, modificandolo settando
mVideoView.setVideoURI(videoUri);
ed estraendo l'uri desiderato da un db esterno.
Anche in questo caso l'app nn riesce ad eseguire il video:
logcat

01-27 15:47:49.546: INFO/ActivityManager(2486): Start proc pack.ProvaVideo for activity pack.ProvaVideo/.ProvaVideo: pid=16432 uid=10081 gids={1015}
01-27 15:47:49.812: INFO/copybit(2486): [createPP] fimc version : 50 8c
01-27 15:47:49.815: VERBOSE/MediaPlayer-JNI(16432): native_setup
01-27 15:47:49.815: VERBOSE/MediaPlayer(16432): constructor
01-27 15:47:49.815: VERBOSE/MediaPlayer(16432): setListener
01-27 15:47:49.815: INFO/MediaPlayer(16432): uri is:content://media/external/images/media/43
01-27 15:47:49.815: INFO/MediaPlayer(16432): inside  getAudioFilePath: content://media/external/images/media/43
01-27 15:47:49.831: INFO/MediaPlayer(16432): path is null
01-27 15:47:49.839: DEBUG/MediaPlayer(16432): Couldn't open file on client side, trying server side
01-27 15:47:49.839: VERBOSE/MediaPlayer-JNI(16432): setDataSource: path content://media/external/images/media/43
01-27 15:47:49.839: VERBOSE/MediaPlayer(16432): setDataSource(content://media/external/images/media/43)
01-27 15:47:49.843: ERROR/MediaPlayerService(2393): Couldn't open fd for content://media/external/images/media/43
01-27 15:47:49.843: ERROR/MediaPlayer(16432): Unable to to create media player
01-27 15:47:49.851: WARN/VideoView(16432): Unable to open content: content://media/external/images/media/43
01-27 15:47:49.851: WARN/VideoView(16432): java.io.IOException: setDataSource failed.: status=0x80000000
01-27 15:47:49.851: WARN/VideoView(16432):     at android.media.MediaPlayer.setDataSource(Native Method)
01-27 15:47:49.851: WARN/VideoView(16432):     at android.media.MediaPlayer.setDataSource(MediaPlayer.java:745)
01-27 15:47:49.851: WARN/VideoView(16432):     at android.widget.VideoView.openVideo(VideoView.java:226)
01-27 15:47:49.851: WARN/VideoView(16432):     at android.widget.VideoView.access$2000(VideoView.java:50)
01-27 15:47:49.851: WARN/VideoView(16432):     at android.widget.VideoView$6.surfaceCreated(VideoView.java:479)
01-27 15:47:49.851: WARN/VideoView(16432):     at android.view.SurfaceView.updateWindow(SurfaceView.java:532)
01-27 15:47:49.851: WARN/VideoView(16432):     at android.view.SurfaceView.dispatchDraw(SurfaceView.java:339)
01-27 15:47:49.851: WARN/VideoView(16432):     at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
01-27 15:47:49.851: WARN/VideoView(16432):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
01-27 15:47:49.851: WARN/VideoView(16432):     at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
01-27 15:47:49.851: WARN/VideoView(16432):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
01-27 15:47:49.851: WARN/VideoView(16432):     at android.view.View.draw(View.java:6743)
01-27 15:47:49.851: WARN/VideoView(16432):     at android.widget.FrameLayout.draw(FrameLayout.java:352)
01-27 15:47:49.851: WARN/VideoView(16432):     at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
01-27 15:47:49.851: WARN/VideoView(16432):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
01-27 15:47:49.851: WARN/VideoView(16432):     at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
01-27 15:47:49.851: WARN/VideoView(16432):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
01-27 15:47:49.851: WARN/VideoView(16432):     at android.view.View.draw(View.java:6743)
01-27 15:47:49.851: WARN/VideoView(16432):     at android.widget.FrameLayout.draw(FrameLayout.java:352)
01-27 15:47:49.851: WARN/VideoView(16432):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2049)
01-27 15:47:49.851: WARN/VideoView(16432):     at android.view.ViewRoot.draw(ViewRoot.java:1429)
01-27 15:47:49.851: WARN/VideoView(16432):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1172)
01-27 15:47:49.851: WARN/VideoView(16432):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1749)
01-27 15:47:49.851: WARN/VideoView(16432):     at android.os.Handler.dispatchMessage(Handler.java:99)
01-27 15:47:49.851: WARN/VideoView(16432):     at android.os.Looper.loop(Looper.java:123)
01-27 15:47:49.851: WARN/VideoView(16432):     at android.app.ActivityThread.main(ActivityThread.java:4627)
01-27 15:47:49.851: WARN/VideoView(16432):     at java.lang.reflect.Method.invokeNative(Native Method)
01-27 15:47:49.851: WARN/VideoView(16432):     at java.lang.reflect.Method.invoke(Method.java:521)
01-27 15:47:49.851: WARN/VideoView(16432):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:871)
01-27 15:47:49.851: WARN/VideoView(16432):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
01-27 15:47:49.851: WARN/VideoView(16432):     at dalvik.system.NativeStart.main(Native Method)
01-27 15:47:49.851: DEBUG/VideoView(16432): Error: 1,0
01-27 15:47:50.034: INFO/Launcher(2581): onWindowFocusChanged(false)

Qualcuno può darci un occhio??? grazie