<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>902</bug_id>
          
          <creation_ts>2013-11-11 18:54:59 +0100</creation_ts>
          <short_desc>GLMediaPlayer issue when using a File.toURI generated URI ( windows only )</short_desc>
          <delta_ts>2013-11-28 13:44:44 +0100</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>util</component>
          <version>2</version>
          <rep_platform>All</rep_platform>
          <op_sys>windows</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Maxime Caignart">maxime-jogamp</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          
          
          <cf_type>---</cf_type>
          <cf_scm_refs>eb9225c928b9a1a5660c865921fcd91f85cd1cd0</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>3313</commentid>
    <comment_count>0</comment_count>
    <who name="Maxime Caignart">maxime-jogamp</who>
    <bug_when>2013-11-11 18:54:59 +0100</bug_when>
    <thetext>When using GLMediaPlayer.initStream(java.net.URI, int, int, int) method ( http://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/util/av/GLMediaPlayer.html#initStream(java.net.URI, int, int, int) , if the URI targets a local file and has been generated by File.toURI ( http://docs.oracle.com/javase/7/docs/api/java/io/File.html#toURI()), GLMediaPlayer is not able to use the URI.

This happens only on Windows. An educated guess would be that the URI form &quot;file://c:/mypath/mymovie.mp4&quot; is not well handled by libav.

A workaround would be to rebuild the URI by hand, using the absolute path of the file :

------------------ NOT WORKING --------------
File movieFile = new File(&quot;res/mymovie.mp4&quot;);
URI uri = movieFile.toURI();
mediaPlayer.initStream(uri, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, 3);


------------------ WORKING ------------------
File movieFile = new File(&quot;res/mymovie.mp4&quot;);
//IOUtil is from the package com.jogamp.common.util
String uriPath = IOUtil.encodeToURI(IOUtil.slashify(movieFile.getAbsolutePath(), false, false));
URI uri = new URI(uriPath);
mediaPlayer.initStream(uri, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, 3);

This URI is still compliant with RFCs and well handled by libav under Windows.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3410</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-11-28 13:44:44 +0100</bug_when>
    <thetext>eb9225c928b9a1a5660c865921fcd91f85cd1cd0
  FFMPEGMediaPlayer uses IOUtil.decodeURIIfFilePath(uri) to decode proper file-scheme if applicable - otherwise encoded ASCII URI.

See test case com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple
and it&apos;s &apos;-file1&apos; and &apos;-file2&apos; arguments.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>