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


Java CalledByNative类代码示例

本文整理汇总了Java中tv.danmaku.ijk.media.player.annotations.CalledByNative的典型用法代码示例。如果您正苦于以下问题:Java CalledByNative类的具体用法?Java CalledByNative怎么用?Java CalledByNative使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: postEventFromNative

import tv.danmaku.ijk.media.player.annotations.CalledByNative; //导入依赖的package包/类
@CalledByNative
private static void postEventFromNative(Object weakThiz, int what,
        int arg1, int arg2, Object obj) {
    if (weakThiz == null)
        return;

    @SuppressWarnings("rawtypes")
    IjkMediaPlayer mp = (IjkMediaPlayer) ((WeakReference) weakThiz).get();
    if (mp == null) {
        return;
    }

    if (what == MEDIA_INFO && arg1 == MEDIA_INFO_STARTED_AS_NEXT) {
        // this acquires the wakelock if needed, and sets the client side
        // state
        mp.start();
    }
    if (mp.mEventHandler != null) {
        Message m = mp.mEventHandler.obtainMessage(what, arg1, arg2, obj);
        mp.mEventHandler.sendMessage(m);
    }
}
 
开发者ID:Dreamxiaoxuan,项目名称:AndroidTvDemo,代码行数:23,代码来源:IjkMediaPlayer.java

示例2: onSelectCodec

import tv.danmaku.ijk.media.player.annotations.CalledByNative; //导入依赖的package包/类
@CalledByNative
private static String onSelectCodec(Object weakThiz, String mimeType, int profile, int level) {
    if (weakThiz == null || !(weakThiz instanceof WeakReference<?>))
        return null;

    @SuppressWarnings("unchecked")
    WeakReference<IjkMediaPlayer> weakPlayer = (WeakReference<IjkMediaPlayer>) weakThiz;
    IjkMediaPlayer player = weakPlayer.get();
    if (player == null)
        return null;

    OnMediaCodecSelectListener listener = player.mOnMediaCodecSelectListener;
    if (listener == null)
        listener = DefaultMediaCodecSelector.sInstance;

    return listener.onMediaCodecSelect(player, mimeType, profile, level);
}
 
开发者ID:Dreamxiaoxuan,项目名称:AndroidTvDemo,代码行数:18,代码来源:IjkMediaPlayer.java

示例3: onControlResolveSegmentUrl

import tv.danmaku.ijk.media.player.annotations.CalledByNative; //导入依赖的package包/类
@CalledByNative
private static String onControlResolveSegmentUrl(Object weakThiz, int segment) {
    DebugLog.ifmt(TAG, "onControlResolveSegmentUrl %d", segment);
    if (weakThiz == null || !(weakThiz instanceof WeakReference<?>))
        return null;

    @SuppressWarnings("unchecked")
    WeakReference<IjkMediaPlayer> weakPlayer = (WeakReference<IjkMediaPlayer>) weakThiz;
    IjkMediaPlayer player = weakPlayer.get();
    if (player == null)
        return null;

    OnControlMessageListener listener = player.mOnControlMessageListener;
    if (listener == null)
        return null;

    return listener.onControlResolveSegmentUrl(segment);
}
 
开发者ID:hejunlin2013,项目名称:LivePlayback,代码行数:19,代码来源:IjkMediaPlayer.java

示例4: onNativeInvoke

import tv.danmaku.ijk.media.player.annotations.CalledByNative; //导入依赖的package包/类
@CalledByNative
private static boolean onNativeInvoke(Object weakThiz, int what, Bundle args) {
    DebugLog.ifmt(TAG, "onNativeInvoke %d", what);
    if (weakThiz == null || !(weakThiz instanceof WeakReference<?>))
        return false;

    @SuppressWarnings("unchecked")
    WeakReference<IjkMediaPlayer> weakPlayer = (WeakReference<IjkMediaPlayer>) weakThiz;
    IjkMediaPlayer player = weakPlayer.get();
    if (player == null)
        return false;

    OnNativeInvokeListener listener = player.mOnNativeInvokeListener;
    if (listener == null)
        return false;

    return listener.onNativeInvoke(what, args);
}
 
开发者ID:hejunlin2013,项目名称:LivePlayback,代码行数:19,代码来源:IjkMediaPlayer.java

示例5: onNativeInvoke

import tv.danmaku.ijk.media.player.annotations.CalledByNative; //导入依赖的package包/类
@CalledByNative
private static boolean onNativeInvoke(Object weakThiz, int what, Bundle args) {
    DebugLog.ifmt(TAG, "onNativeInvoke %d", what);
    if (weakThiz == null || !(weakThiz instanceof WeakReference<?>))
        throw new IllegalStateException("<null weakThiz>.onNativeInvoke()");

    @SuppressWarnings("unchecked")
    WeakReference<IjkMediaPlayer> weakPlayer = (WeakReference<IjkMediaPlayer>) weakThiz;
    IjkMediaPlayer player = weakPlayer.get();
    if (player == null)
        throw new IllegalStateException("<null weakPlayer>.onNativeInvoke()");

    OnNativeInvokeListener listener = player.mOnNativeInvokeListener;
    if (listener != null && listener.onNativeInvoke(what, args))
        return true;

    switch (what) {
        case OnNativeInvokeListener.ON_CONCAT_RESOLVE_SEGMENT: {
            OnControlMessageListener onControlMessageListener = player.mOnControlMessageListener;
            if (onControlMessageListener == null)
                return false;

            int segmentIndex = args.getInt(OnNativeInvokeListener.ARG_SEGMENT_INDEX, -1);
            if (segmentIndex < 0)
                throw new InvalidParameterException("onNativeInvoke(invalid segment index)");

            String newUrl = onControlMessageListener.onControlResolveSegmentUrl(segmentIndex);
            if (newUrl == null)
                throw new RuntimeException(new IOException("onNativeInvoke() = <NULL newUrl>"));

            args.putString(OnNativeInvokeListener.ARG_URL, newUrl);
            return true;
        }
        default:
            return false;
    }
}
 
开发者ID:Dreamxiaoxuan,项目名称:AndroidTvDemo,代码行数:38,代码来源:IjkMediaPlayer.java

示例6: onNativeInvoke

import tv.danmaku.ijk.media.player.annotations.CalledByNative; //导入依赖的package包/类
@CalledByNative
private static boolean onNativeInvoke(Object weakThiz, int what, Bundle args) {
    DebugLog.ifmt(TAG, "onNativeInvoke %d", what);
    if (weakThiz == null || !(weakThiz instanceof WeakReference<?>))
        throw new IllegalStateException("<null weakThiz>.onNativeInvoke()");

    @SuppressWarnings("unchecked")
    WeakReference<IjkMediaPlayer> weakPlayer = (WeakReference<IjkMediaPlayer>) weakThiz;
    IjkMediaPlayer player = weakPlayer.get();
    if (player == null)
        throw new IllegalStateException("<null weakPlayer>.onNativeInvoke()");

    OnNativeInvokeListener listener = player.mOnNativeInvokeListener;
    if (listener != null && listener.onNativeInvoke(what, args))
        return true;

    switch (what) {
        case OnNativeInvokeListener.CTRL_WILL_CONCAT_RESOLVE_SEGMENT: {
            OnControlMessageListener onControlMessageListener = player.mOnControlMessageListener;
            if (onControlMessageListener == null)
                return false;

            int segmentIndex = args.getInt(OnNativeInvokeListener.ARG_SEGMENT_INDEX, -1);
            if (segmentIndex < 0)
                throw new InvalidParameterException("onNativeInvoke(invalid segment index)");

            String newUrl = onControlMessageListener.onControlResolveSegmentUrl(segmentIndex);
            if (newUrl == null)
                throw new RuntimeException(new IOException("onNativeInvoke() = <NULL newUrl>"));

            args.putString(OnNativeInvokeListener.ARG_URL, newUrl);
            return true;
        }
        default:
            return false;
    }
}
 
开发者ID:bigjelly,项目名称:ShaddockVideoPlayer,代码行数:38,代码来源:IjkMediaPlayer.java


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