当前位置: 首页>>代码示例>>Java>>正文


Java Media.addOption方法代码示例

本文整理汇总了Java中org.videolan.libvlc.Media.addOption方法的典型用法代码示例。如果您正苦于以下问题:Java Media.addOption方法的具体用法?Java Media.addOption怎么用?Java Media.addOption使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.videolan.libvlc.Media的用法示例。


在下文中一共展示了Media.addOption方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: browse

import org.videolan.libvlc.Media; //导入方法依赖的package包/类
/**
 * Browse to the specified media.
 *
 * @param media Can be a media returned by MediaBrowser.
 * @param flags see {@link Flag}
 */
@MainThread
public void browse(Media media, int flags) {
    /* media can be associated with a medialist,
     * so increment ref count in order to don't clean it with the medialist
     */
    media.retain();
    media.addOption(IGNORE_LIST_OPTION + mIgnoreList);
    if ((flags & Flag.NoSlavesAutodetect) != 0)
        media.addOption(":no-sub-autodetect-file");
    if ((flags & Flag.ShowHiddenFiles) != 0)
        media.addOption(":show-hiddenfiles");
    int mediaFlags = Media.Parse.ParseNetwork;
    if ((flags & Flag.Interact) != 0)
        mediaFlags |= Media.Parse.DoInteract;
    reset();
    mBrowserMediaList = media.subItems();
    mBrowserMediaList.setEventListener(mBrowserMediaListEventListener, mHandler);
    media.parseAsync(mediaFlags, 0);
    mMedia = media;
}
 
开发者ID:pedroSG94,项目名称:vlc-example-streamplayer,代码行数:27,代码来源:MediaBrowser.java

示例2: setMediaOptions

import org.videolan.libvlc.Media; //导入方法依赖的package包/类
public static void setMediaOptions(Media media, Context context, int flags) {
    boolean noHardwareAcceleration = (flags & MEDIA_NO_HWACCEL) != 0;
    boolean noVideo = (flags & MEDIA_VIDEO) == 0;
    final boolean paused = (flags & MEDIA_PAUSED) != 0;
    int hardwareAcceleration = HW_ACCELERATION_DISABLED;

    if (!noHardwareAcceleration) {
        try {
            hardwareAcceleration = PrefUtils.get(context, Prefs.HW_ACCELERATION, HW_ACCELERATION_AUTOMATIC);
        } catch (NumberFormatException ignored) {}
    }
    if (hardwareAcceleration == HW_ACCELERATION_DISABLED)
        media.setHWDecoderEnabled(false, false);
    else if (hardwareAcceleration == HW_ACCELERATION_FULL || hardwareAcceleration == HW_ACCELERATION_DECODING) {
        media.setHWDecoderEnabled(true, true);
        if (hardwareAcceleration == HW_ACCELERATION_DECODING) {
            media.addOption(":no-mediacodec-dr");
            media.addOption(":no-omxil-dr");
        }
    } /* else automatic: use default options */

    if (noVideo)
        media.addOption(":no-video");
    if (paused)
        media.addOption(":start-paused");
}
 
开发者ID:PTCE,项目名称:popcorn-android,代码行数:27,代码来源:VLCOptions.java

示例3: browse

import org.videolan.libvlc.Media; //导入方法依赖的package包/类
/**
 * Browse to the specified media.
 *
 * @param media Can be a media returned by MediaBrowser.
 * @param flags see {@link MediaBrowser.Flag}
 */
@MainThread
public void browse(Media media, int flags) {
    /* media can be associated with a medialist,
     * so increment ref count in order to don't clean it with the medialist
     */
    media.retain();
    media.addOption(IGNORE_LIST_OPTION + mIgnoreList);
    if ((flags & Flag.NoSlavesAutodetect) != 0)
        media.addOption(":no-sub-autodetect-file");
    int mediaFlags = Media.Parse.ParseNetwork;
    if ((flags & Flag.Interact) != 0)
        mediaFlags |= Media.Parse.DoInteract;
    reset();
    mBrowserMediaList = media.subItems();
    mBrowserMediaList.setEventListener(mBrowserMediaListEventListener);
    media.parseAsync(mediaFlags, 0);
    mMedia = media;
}
 
开发者ID:m-damavandi,项目名称:Android-VLC-Sample,代码行数:25,代码来源:MediaBrowser.java

示例4: getThumbnail

import org.videolan.libvlc.Media; //导入方法依赖的package包/类
public static byte[] getThumbnail(Media media, int i_width, int i_height) {
    media.addOption(":no-audio");
    media.addOption(":no-spu");
    media.addOption(":no-osd");
    media.addOption(":input-fast-seek");
    return nativeGetThumbnail(media, i_width, i_height);
}
 
开发者ID:pedroSG94,项目名称:vlc-example-streamplayer,代码行数:8,代码来源:VLCUtil.java

示例5: setMedia

import org.videolan.libvlc.Media; //导入方法依赖的package包/类
private void setMedia(Media media) {
  //delay = network buffer + file buffer
  //media.addOption(":network-caching=" + Constants.BUFFER);
  //media.addOption(":file-caching=" + Constants.BUFFER);
  media.addOption(":fullscreen");
  media.setHWDecoderEnabled(true, false);
  player = new MediaPlayer(vlcInstance);
  player.setMedia(media);
  player.setEventListener(this);

  IVLCVout vlcOut = player.getVLCVout();
  //set correct class for render depend of constructor called
  if (surfaceView != null) {
    vlcOut.setVideoView(surfaceView);
    width = surfaceView.getWidth();
    height = surfaceView.getHeight();
  } else if (textureView != null) {
    vlcOut.setVideoView(textureView);
    width = textureView.getWidth();
    height = textureView.getHeight();
  } else if (surfaceTexture != null) {
    vlcOut.setVideoSurface(surfaceTexture);
  } else if (surface != null) {
    vlcOut.setVideoSurface(surface, surfaceHolder);
  } else {
    throw new RuntimeException("You cant set a null render object");
  }
  if (width != 0 && height != 0) vlcOut.setWindowSize(width, height);
  vlcOut.attachViews();
  player.setVideoTrackEnabled(true);
  player.play();
}
 
开发者ID:pedroSG94,项目名称:vlc-example-streamplayer,代码行数:33,代码来源:VlcVideoLibrary.java

示例6: browse

import org.videolan.libvlc.Media; //导入方法依赖的package包/类
/**
 * Browse to the specified media.
 *
 * @param media Can be a media returned by MediaBrowser.
 */
public synchronized void browse(Media media) {
    /* media can be associated with a medialist,
     * so increment ref count in order to don't clean it with the medialist
     */
    media.retain();
    media.addOption(IGNORE_LIST_OPTION+mIgnoreList);
    reset();
    mBrowserMediaList = media.subItems();
    mBrowserMediaList.setEventListener(mBrowserMediaListEventListener);
    media.parseAsync(Media.Parse.ParseNetwork);
    mMedia = media;
}
 
开发者ID:PTCE,项目名称:popcorn-android,代码行数:18,代码来源:MediaBrowser.java

示例7: setMediaOptions

import org.videolan.libvlc.Media; //导入方法依赖的package包/类
public static void setMediaOptions(Media media, Context context, int flags) {
    boolean noHardwareAcceleration = (flags & MediaWrapper.MEDIA_NO_HWACCEL) != 0;
    boolean noVideo = (flags & MediaWrapper.MEDIA_VIDEO) == 0;
    final boolean paused = (flags & MediaWrapper.MEDIA_PAUSED) != 0;
    int hardwareAcceleration = HW_ACCELERATION_DISABLED;

    if (!noHardwareAcceleration) {
        try {
            final SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);
            hardwareAcceleration = Integer.parseInt(pref.getString("hardware_acceleration", "-1"));
        } catch (NumberFormatException ignored) {}
    }
    if (hardwareAcceleration == HW_ACCELERATION_DISABLED)
        media.setHWDecoderEnabled(false, false);
    else if (hardwareAcceleration == HW_ACCELERATION_FULL || hardwareAcceleration == HW_ACCELERATION_DECODING) {
        media.setHWDecoderEnabled(true, true);
        if (hardwareAcceleration == HW_ACCELERATION_DECODING) {
            media.addOption(":no-mediacodec-dr");
            media.addOption(":no-omxil-dr");
        }
    } /* else automatic: use default options */

    if (noVideo)
        media.addOption(":no-video");
    if (paused)
        media.addOption(":start-paused");
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:28,代码来源:VLCOptions.java

示例8: getThumbnail

import org.videolan.libvlc.Media; //导入方法依赖的package包/类
public static byte[] getThumbnail(Media media, int i_width, int i_height) {
    media.addOption(":no-audio");
    media.addOption(":no-spu");
    media.addOption(":no-osd");
    return nativeGetThumbnail(media, i_width, i_height);
}
 
开发者ID:PTCE,项目名称:popcorn-android,代码行数:7,代码来源:VLCUtil.java


注:本文中的org.videolan.libvlc.Media.addOption方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。