Package javax.media.protocol

Examples of javax.media.protocol.URLDataSource.connect()


    catch (Exception e)
    {  logger.log(Level.WARNING, ""  + e, e);
      throw new NoPlayerException();
    }
    final URLDataSource dataSource = new URLDataSource(url);
    dataSource.connect()// TODO: there is a problem because we connect to the datasource here, but
                // the following call may try twice or more to use the datasource with a player, once
                // for the right content type, and multiple times for unknown.  The first attempt (for example) may actually
                // read data, in which case the second one will be missing data when it reads.
                // really, the datasource needs to be recreated.
                // The workaround for now is that URLDataSource (and others) allows repeated connect() calls.
View Full Code Here


    catch (Exception e)
    {  logger.log(Level.WARNING, ""  + e, e);
      throw new NoProcessorException();
    }
    final URLDataSource dataSource = new URLDataSource(url);
    dataSource.connect();
    return createProcessor(dataSource);
  }

  private static Processor createProcessor(DataSource source, String contentType)
      throws java.io.IOException, NoProcessorException
View Full Code Here

    catch (Exception e)
    {  logger.log(Level.WARNING, ""  + e, e);
      throw new NoDataSourceException();
    }
    final URLDataSource dataSource = new URLDataSource(url);
    dataSource.connect();
    return dataSource;
  }

  public static DataSource createMergingDataSource(DataSource[] sources) throws IncompatibleSourceException
  {
View Full Code Here

    try
    {
      // test to verify that URLDataSource does not use MimeManager
      final File file = File.createTempFile("test", ".html");
      final URLDataSource d = new URLDataSource(new URL("file://" + file.getAbsolutePath()));
      d.connect();
      assertEquals(d.getContentType(), "text.html");
     
     
      com.sun.media.protocol.file.DataSource d2 = new com.sun.media.protocol.file.DataSource();
      d2.setLocator(new MediaLocator("file://" + file.getAbsolutePath()));
View Full Code Here

    try
    {
      // test to verify that URLDataSource does not use MimeManager
      File file = new File("samplemedia/safexmas.mov");
      URLDataSource d = new URLDataSource(new URL("file://" + file.getAbsolutePath()));
      d.connect();
      assertEquals(d.getContentType(), "video.quicktime");
     
    } catch (MalformedURLException e)
    {
      e.printStackTrace();
View Full Code Here

    {
      File file = File.createTempFile("test", "foo");
      // test to verify that URLDataSource does not use MimeManager
      //File file = new File("test.foo");
      URLDataSource d = new URLDataSource(new URL("file://" + file.getAbsolutePath()));
      d.connect();
      assertEquals(d.getContentType(), "content.unknown");
     
    } catch (MalformedURLException e)
    {
      e.printStackTrace();
View Full Code Here

    }
    catch (Error e)
    {  assertTrue(e.getClass() == Error.class);
      assertEquals(e.getMessage(), "Unconnected source.");
    }
    s.connect();
    assertEquals(s.getContentType(), "video.quicktime");
    PullSourceStream sts[] = s.getStreams();
    assertEquals(sts.length, 1);
   
    PullSourceStream st = sts[0];
View Full Code Here

      assertEquals(res, 1);
    }
   
    s.start();
    s.stop();
    s.connect()// new connection - new streams?
   
    assertEquals(s.getStreams().length, 1);
    assertTrue(s.getStreams() != sts);
    assertTrue(s.getStreams()[0] != st);
   
View Full Code Here

        catch (Exception e)
        {   logger.log(Level.WARNING, ""  + e, e);
            throw new NoPlayerException();
        }
        final URLDataSource dataSource = new URLDataSource(url);
        dataSource.connect();   // TODO: there is a problem because we connect to the datasource here, but
                                // the following call may try twice or more to use the datasource with a player, once
                                // for the right content type, and multiple times for unknown.  The first attempt (for example) may actually
                                // read data, in which case the second one will be missing data when it reads.
                                // really, the datasource needs to be recreated.
                                // The workaround for now is that URLDataSource (and others) allows repeated connect() calls.
View Full Code Here

        catch (Exception e)
        {   logger.log(Level.WARNING, ""  + e, e);
            throw new NoDataSourceException();
        }
        final URLDataSource dataSource = new URLDataSource(url);
        dataSource.connect();
        return dataSource;
    }

    public static TimeBase getSystemTimeBase()
    {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.