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


Java VLCUtil类代码示例

本文整理汇总了Java中org.videolan.libvlc.util.VLCUtil的典型用法代码示例。如果您正苦于以下问题:Java VLCUtil类的具体用法?Java VLCUtil怎么用?Java VLCUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getDeblocking

import org.videolan.libvlc.util.VLCUtil; //导入依赖的package包/类
private static int getDeblocking(int deblocking) {
    int ret = deblocking;
    if (deblocking < 0) {
        /**
         * Set some reasonable sDeblocking defaults:
         *
         * Skip all (4) for armv6 and MIPS by default
         * Skip non-ref (1) for all armv7 more than 1.2 Ghz and more than 2 cores
         * Skip non-key (3) for all devices that don't meet anything above
         */
        VLCUtil.MachineSpecs m = VLCUtil.getMachineSpecs();
        if (m == null)
            return ret;
        if ((m.hasArmV6 && !(m.hasArmV7)) || m.hasMips)
            ret = 4;
        else if (m.frequency >= 1200 && m.processors > 2)
            ret = 1;
        else if (m.bogoMIPS >= 1200 && m.processors > 2) {
            ret = 1;
        } else
            ret = 3;
    } else if (deblocking > 4) { // sanity check
        ret = 3;
    }
    return ret;
}
 
开发者ID:ghondar,项目名称:react-native-vlc-player,代码行数:27,代码来源:PlayerActivity.java

示例2: onCreate

import org.videolan.libvlc.util.VLCUtil; //导入依赖的package包/类
/**
 * Simple friendly activity to tell the user something's wrong.
 *
 * Intent parameters (all optional):
 * runtimeError (bool) - Set to true if you want to show a runtime error
 *                       (defaults to a compatibility error)
 * message (string) - the more detailed problem
 */
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.not_compatible);

    String errorMsg = VLCUtil.getErrorMsg();
    if(getIntent().getBooleanExtra("runtimeError", false))
        if(getIntent().getStringExtra("message") != null) {
            errorMsg = getIntent().getStringExtra("message");
            TextView tvo = (TextView)findViewById(R.id.message);
            tvo.setText(R.string.error_problem);
        }

    TextView tv = (TextView)findViewById(R.id.errormsg);
    tv.setText(getResources().getString(R.string.error_message_is) + "\n" + errorMsg);

    //AsyncHttpRequest asyncHttpRequest = new AsyncHttpRequest();
    //asyncHttpRequest.execute(Build.MODEL, Build.DEVICE);
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:28,代码来源:CompatErrorActivity.java

示例3: onCreate

import org.videolan.libvlc.util.VLCUtil; //导入依赖的package包/类
/**
 * Simple friendly activity to tell the user something's wrong.
 *
 * Intent parameters (all optional):
 * runtimeError (bool) - Set to true if you want to show a runtime error
 *                       (defaults to a compatibility error)
 * message (string) - the more detailed problem
 */
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.not_compatible);

    String errorMsg = VLCUtil.getErrorMsg();
    if(getIntent().getBooleanExtra("runtimeError", false))
        if(getIntent().getStringExtra("message") != null) {
            errorMsg = getIntent().getStringExtra("message");
            TextView tvo = (TextView)findViewById(R.id.message);
            tvo.setText(R.string.error_problem);
        }

    TextView tv = (TextView)findViewById(R.id.errormsg);
    tv.setText(getResources().getString(R.string.error_message_is) + "\n" + errorMsg);
}
 
开发者ID:hanhailong,项目名称:VCL-Android,代码行数:25,代码来源:CompatErrorActivity.java

示例4: Media

import org.videolan.libvlc.util.VLCUtil; //导入依赖的package包/类
/**
 *
 * @param ml Should not be released and locked
 * @param index index of the Media from the MediaList
 */
protected Media(MediaList ml, int index) {
    super(ml);
    if (ml == null || ml.isReleased())
        throw new IllegalArgumentException("MediaList is null or released");
    if (!ml.isLocked())
        throw new IllegalStateException("MediaList should be locked");
    nativeNewFromMediaList(ml, index);
    mUri = VLCUtil.UriFromMrl(nativeGetMrl());
}
 
开发者ID:pedroSG94,项目名称:vlc-example-streamplayer,代码行数:15,代码来源:Media.java

示例5: Media

import org.videolan.libvlc.util.VLCUtil; //导入依赖的package包/类
/**
 * @param ml    Should not be released and locked
 * @param index index of the Media from the MediaList
 */
protected Media(MediaList ml, int index) {
    super(ml);
    if (ml == null || ml.isReleased())
        throw new IllegalArgumentException("MediaList is null or released");
    if (!ml.isLocked())
        throw new IllegalStateException("MediaList should be locked");
    nativeNewFromMediaList(ml, index);
    mUri = VLCUtil.UriFromMrl(nativeGetMrl());
}
 
开发者ID:SteinerOk,项目名称:libvlc-sdk-android,代码行数:14,代码来源:Media.java

示例6: getDeblocking

import org.videolan.libvlc.util.VLCUtil; //导入依赖的package包/类
private static int getDeblocking(int deblocking) {
    int ret = deblocking;
    if (deblocking < 0) {
        /**
         * Set some reasonable sDeblocking defaults:
         *
         * Skip all (4) for armv6 and MIPS by default
         * Skip non-ref (1) for all armv7 more than 1.2 Ghz and more than 2 cores
         * Skip non-key (3) for all devices that don't meet anything above
         */
        VLCUtil.MachineSpecs m = VLCUtil.getMachineSpecs();
        if (m == null)
            return ret;
        if ((m.hasArmV6 && !(m.hasArmV7)) || m.hasMips)
            ret = 4;
        else if (m.frequency >= 1200 && m.processors > 2)
            ret = 1;
        else if (m.bogoMIPS >= 1200 && m.processors > 2) {
            ret = 1;
            Log.d(TAG, "Used bogoMIPS due to lack of frequency info");
        } else
            ret = 3;
    } else if (deblocking > 4) { // sanity check
        ret = 3;
    }
    return ret;
}
 
开发者ID:PTCE,项目名称:popcorn-android,代码行数:28,代码来源:VLCOptions.java

示例7: testCompatibleCPU

import org.videolan.libvlc.util.VLCUtil; //导入依赖的package包/类
public static synchronized boolean testCompatibleCPU(Context context) {
    if (sLibVLC == null && !VLCUtil.hasCompatibleCPU(context)) {
        final Intent i = new Intent(context, CompatErrorActivity.class);
        context.startActivity(i);
        return false;
    } else
        return true;
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:9,代码来源:VLCInstance.java

示例8: hasCompatibleCPU

import org.videolan.libvlc.util.VLCUtil; //导入依赖的package包/类
public static synchronized boolean hasCompatibleCPU(Context context) {
    if (sLibVLC == null && !VLCUtil.hasCompatibleCPU(context)) {
        return false;
    } else
        return true;
}
 
开发者ID:PTCE,项目名称:popcorn-android,代码行数:7,代码来源:VLCInstance.java

示例9: run

import org.videolan.libvlc.util.VLCUtil; //导入依赖的package包/类
@Override
public void run() {
    final LibVLC libVlc = VLCInstance.get();
    if (libVlc == null)
        return;
    mMedia = new Media(libVlc, mItem.getUri());
    mMedia.parse();
    int videoHeight = mItem.getHeight();
    int videoWidth = mItem.getWidth();
    if (videoWidth == 0 || videoHeight == 0) {
        return;
    }

    mHandler.sendEmptyMessage(NEW_TEXT);

    DisplayMetrics screen = new DisplayMetrics();
    getActivity().getWindowManager().getDefaultDisplay().getMetrics(screen);
    int width, height;
    if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
        width = Math.min(screen.widthPixels, screen.heightPixels);
    } else {
        width = screen.widthPixels /2 ;
    }
    height = width * videoHeight/videoWidth;

    // Get the thumbnail.
    mImage = Bitmap.createBitmap(width, height, Config.ARGB_8888);

    byte[] b = VLCUtil.getThumbnail(mMedia, width, height);

    if (b == null) // We were not able to create a thumbnail for this item.
        return;

    if (Thread.interrupted()) {
        return;
    }
    mImage.copyPixelsFromBuffer(ByteBuffer.wrap(b));
    mImage = BitmapUtil.cropBorders(mImage, width, height);

    mHandler.sendEmptyMessage(NEW_IMAGE);
}
 
开发者ID:jiaZengShen,项目名称:vlc_android_win,代码行数:42,代码来源:MediaInfoFragment.java

示例10: run

import org.videolan.libvlc.util.VLCUtil; //导入依赖的package包/类
@Override
public void run() {
    final LibVLC libVlc = VLCInstance.get();
    if (libVlc == null)
        return;
    mMedia = new Media(libVlc, mItem.getUri());
    mMedia.parse();
    int videoHeight = mItem.getHeight();
    int videoWidth = mItem.getWidth();
    if (videoWidth == 0 || videoHeight == 0) {
        //FIXME : find a better way to display media info without video size
        videoWidth = 16;
        videoHeight = 9;
    }

    mHandler.sendEmptyMessage(NEW_TEXT);

    DisplayMetrics screen = new DisplayMetrics();
    getActivity().getWindowManager().getDefaultDisplay().getMetrics(screen);
    int width, height;
    if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
        width = Math.min(screen.widthPixels, screen.heightPixels);
    } else {
        width = screen.widthPixels /2 ;
    }
    height = width * videoHeight/videoWidth;

    // Get the thumbnail.
    mImage = Bitmap.createBitmap(width, height, Config.ARGB_8888);

    byte[] b = VLCUtil.getThumbnail(mMedia, width, height);

    if (b == null) // We were not able to create a thumbnail for this item.
        return;

    if (Thread.interrupted()) {
        return;
    }
    mImage.copyPixelsFromBuffer(ByteBuffer.wrap(b));
    mImage = BitmapUtil.cropBorders(mImage, width, height);

    mHandler.sendEmptyMessage(NEW_IMAGE);
}
 
开发者ID:hanhailong,项目名称:VCL-Android,代码行数:44,代码来源:MediaInfoFragment.java

示例11: run

import org.videolan.libvlc.util.VLCUtil; //导入依赖的package包/类
/**
     * Thread main function.
     */
    @Override
    public void run() {
        int count = 0;
        int total = 0;

        Log.d(TAG, "Thumbnailer started");
mainloop:
        while (!isStopping) {
            lock.lock();
            // Get the id of the file browser item to create its thumbnail.
            while (mItems.size() == 0) {
                try {
                    if (mVideoBrowser != null && mVideoBrowser.get() != null) {
                        mVideoBrowser.get().hideProgressBar();
                        mVideoBrowser.get().clearTextInfo();
                    }
                    mTotalCount = 0;
                    notEmpty.await();
                } catch (InterruptedException e) {
                    Log.i(TAG, "interruption probably requested by stop()");
                    lock.unlock();
                    break mainloop;
                }
            }
            total = mTotalCount;
            MediaWrapper item = mItems.poll();
            lock.unlock();

            if (mVideoBrowser != null && mVideoBrowser.get() != null) {
                mVideoBrowser.get().showProgressBar();
                mVideoBrowser.get().sendTextInfo(String.format("%s %s", mPrefix, item.getFileName()), count, total);
            }
            count++;
            if (item.getArtworkURL() != null)
                continue; //no need for thumbnail, we have a cover

            int width = (VLCApplication.getAppResources().getDimensionPixelSize(R.dimen.grid_card_thumb_width));
            int height = (VLCApplication.getAppResources().getDimensionPixelSize(R.dimen.grid_card_thumb_height));

            //Get bitmap
            byte[] b = VLCUtil.getThumbnail(VLCInstance.get(), item.getUri(), width, height);

            if (b == null) {// We were not able to create a thumbnail for this item, store a dummy
                MediaDatabase.setPicture(item, Bitmap.createBitmap(1, 1, Config.ARGB_8888));
                continue;
            }

            // Create the bitmap
            Bitmap thumbnail = Bitmap.createBitmap(width, height, Config.ARGB_8888);

            thumbnail.copyPixelsFromBuffer(ByteBuffer.wrap(b));

            Log.i(TAG, "Thumbnail created for " + item.getFileName());

            MediaDatabase.setPicture(item, thumbnail);
            // Post to the file browser the new item.
            if (mVideoBrowser != null && mVideoBrowser.get() != null) {
                mVideoBrowser.get().setItemToUpdate(item);
            }
        }
        /* cleanup */
        if (mVideoBrowser != null && mVideoBrowser.get() != null) {
            mVideoBrowser.get().hideProgressBar();
            mVideoBrowser.get().clearTextInfo();
            mVideoBrowser.clear();
        }
        Log.d(TAG, "Thumbnailer stopped");
    }
 
开发者ID:hanhailong,项目名称:VCL-Android,代码行数:72,代码来源:Thumbnailer.java

示例12: addSlave

import org.videolan.libvlc.util.VLCUtil; //导入依赖的package包/类
/**
 * Add a slave (or subtitle) to the current media player.
 *
 * @param type see {@link Media.Slave.Type}
 * @param uri a valid RFC 2396 Uri
 * @return true on success.
 */
public boolean addSlave(int type, Uri uri, boolean select) {
    return nativeAddSlave(type, VLCUtil.encodeVLCUri(uri), select);
}
 
开发者ID:pedroSG94,项目名称:vlc-example-streamplayer,代码行数:11,代码来源:MediaPlayer.java

示例13: addSlave

import org.videolan.libvlc.util.VLCUtil; //导入依赖的package包/类
/**
 * Add a slave (or subtitle) to the current media player.
 *
 * @param type see {@link Media.Slave.Type}
 * @param uri  a valid RFC 2396 Uri
 * @return true on success.
 */
public boolean addSlave(int type, Uri uri, boolean select) {
    return nativeAddSlave(type, VLCUtil.encodeVLCUri(uri), select);
}
 
开发者ID:SteinerOk,项目名称:libvlc-sdk-android,代码行数:11,代码来源:MediaPlayer.java


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