modules/media/src/main/java/com/sun/media/jfxmediaimpl/platform/gstreamer/GSTPlatform.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 32,41 ****
--- 32,42 ----
import com.sun.media.jfxmedia.locator.Locator;
import com.sun.media.jfxmedia.logging.Logger;
import com.sun.media.jfxmediaimpl.HostUtils;
import com.sun.media.jfxmediaimpl.MediaUtils;
import com.sun.media.jfxmediaimpl.platform.Platform;
+ import java.util.Arrays;
/**
* GStreamer platform implementation.
*/
public final class GSTPlatform extends Platform {
*** 55,79 ****
"video/x-m4v",
"application/vnd.apple.mpegurl",
"audio/mpegurl"
};
! private static GSTPlatform globalInstance = null;
!
! // HACK: move this back to native when we fix the jdeveloper crash
! private static final String[] contentTypes;
! static {
! // HACK: remove this when we go back to polling native
! if (!HostUtils.isMacOSX()) {
! contentTypes = new String[CONTENT_TYPES.length];
! System.arraycopy(CONTENT_TYPES, 0, contentTypes,
! 0, CONTENT_TYPES.length);
! } else {
! contentTypes = CONTENT_TYPES;
! }
! }
@Override
public boolean loadPlatform() {
// Initialize GStreamer JNI and supporting native classes.
MediaError ret;
--- 56,75 ----
"video/x-m4v",
"application/vnd.apple.mpegurl",
"audio/mpegurl"
};
! /**
! * All supported protocols.
! */
! private static final String[] PROTOCOLS = {
! "file",
! "http",
! "https"
! };
! private static GSTPlatform globalInstance = null;
@Override
public boolean loadPlatform() {
// Initialize GStreamer JNI and supporting native classes.
MediaError ret;
*** 102,114 ****
private GSTPlatform() {}
@Override
public String[] getSupportedContentTypes() {
! String[] contentTypesCopy = new String[contentTypes.length];
! System.arraycopy(contentTypes, 0, contentTypesCopy, 0, contentTypes.length);
! return contentTypesCopy;
}
@Override
public Media createMedia(Locator source) {
return new GSTMedia(source);
--- 98,113 ----
private GSTPlatform() {}
@Override
public String[] getSupportedContentTypes() {
! return Arrays.copyOf(CONTENT_TYPES, CONTENT_TYPES.length);
! }
!
! @Override
! public String[] getSupportedProtocols() {
! return Arrays.copyOf(PROTOCOLS, PROTOCOLS.length);
}
@Override
public Media createMedia(Locator source) {
return new GSTMedia(source);
*** 133,143 ****
|| source.getStringLocation().endsWith(".m3u8"))
{
// Block until player transitions to READY or HALTED.
// Timeouts in milliseconds.
! final long timeout = source.getURI().getScheme().equals("http") ?
60000L : 5000L;
final long iterationTime = 50L;
long timeWaited = 0L;
final Object lock = new Object();
--- 132,143 ----
|| source.getStringLocation().endsWith(".m3u8"))
{
// Block until player transitions to READY or HALTED.
// Timeouts in milliseconds.
! String scheme = source.getURI().getScheme();
! final long timeout = (scheme.equals("http") || scheme.equals("https")) ?
60000L : 5000L;
final long iterationTime = 50L;
long timeWaited = 0L;
final Object lock = new Object();