示例#1
0
文件: Media.java 项目: vyloy/lnvc
  public Media(String URI, int position) {
    mLocation = URI;

    LibVLC mLibVlc = null;
    try {
      mLibVlc = LibVLC.getInstance();
      mType = TYPE_ALL;

      TrackInfo[] tracks = mLibVlc.readTracksInfoPosition(position);

      extractTrackInfo(tracks);
    } catch (LibVlcException e) {
      e.printStackTrace();
    }
  }
示例#2
0
  public String[] getMediaOptions(int position) {
    boolean noHardwareAcceleration = false;
    boolean noVideo = false;
    if (isValid(position)) {
      noHardwareAcceleration = mInternalList.get(position).noHardwareAcceleration;
      noVideo = mInternalList.get(position).noVideo;
    }

    return mLibVLC.getMediaOptions(noHardwareAcceleration, noVideo);
  }
示例#3
0
文件: Media.java 项目: vyloy/lnvc
  /**
   * Create a new Media
   *
   * @param context Application context of the caller
   * @param media URI
   * @param addToDb Should it be added to the file database?
   */
  public Media(String URI, Boolean addToDb) {
    mLocation = URI;

    LibVLC mLibVlc = null;
    try {
      mLibVlc = LibVLC.getInstance();
      mType = TYPE_ALL;

      TrackInfo[] tracks = mLibVlc.readTracksInfo(mLocation);

      extractTrackInfo(tracks);
    } catch (LibVlcException e) {
      e.printStackTrace();
    }

    if (addToDb) {
      // Add this item to database
      DatabaseManager db = DatabaseManager.getInstance(VLCApplication.getAppContext());
      db.addMedia(this);
    }
  }