/*
* Copyright (C) 2006 Bilibili
* Copyright (C) 2006 The Android Open Source Project
* Copyright (C) 2013 Zhang Rui <bbcallen@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package tv.danmaku.ijk.media.player;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.ContentResolver;
import android.content.Context;
import android.content.res.AssetFileDescriptor;
import android.graphics.SurfaceTexture;
import android.graphics.Rect;
import android.media.MediaCodecInfo;
import android.media.MediaCodecList;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.ParcelFileDescriptor;
import android.os.PowerManager;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.Log;
import android.view.Surface;
import android.view.SurfaceHolder;
import java.io.FileDescriptor;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
import java.security.InvalidParameterException;
import java.util.ArrayList;
import java.util.Locale;
import java.util.Map;
import tv.danmaku.ijk.media.player.annotations.AccessedByNative;
import tv.danmaku.ijk.media.player.annotations.CalledByNative;
import tv.danmaku.ijk.media.player.misc.IAndroidIO;
import tv.danmaku.ijk.media.player.misc.IMediaDataSource;
import tv.danmaku.ijk.media.player.misc.ITrackInfo;
import tv.danmaku.ijk.media.player.misc.IjkTrackInfo;
import tv.danmaku.ijk.media.player.pragma.DebugLog;
/**
* @author bbcallen
*
* Java wrapper of ffplay.
*/
public final class IjkMediaPlayer extends AbstractMediaPlayer {
private final static String TAG = IjkMediaPlayer.class.getName();
private static final int MEDIA_NOP = 0; // interface test message
private static final int MEDIA_PREPARED = 1;
private static final int MEDIA_PLAYBACK_COMPLETE = 2;
private static final int MEDIA_BUFFERING_UPDATE = 3;
private static final int MEDIA_SEEK_COMPLETE = 4;
private static final int MEDIA_SET_VIDEO_SIZE = 5;
private static final int MEDIA_TIMED_TEXT = 99;
private static final int MEDIA_ERROR = 100;
private static final int MEDIA_INFO = 200;
protected static final int MEDIA_SET_VIDEO_SAR = 10001;
//----------------------------------------
// options
public static final int IJK_LOG_UNKNOWN = 0;
public static final int IJK_LOG_DEFAULT = 1;
public static final int IJK_LOG_VERBOSE = 2;
public static final int IJK_LOG_DEBUG = 3;
public static final int IJK_LOG_INFO = 4;
public static final int IJK_LOG_WARN = 5;
public static final int IJK_LOG_ERROR = 6;
public static final int IJK_LOG_FATAL = 7;
public static final int IJK_LOG_SILENT = 8;
public static final int OPT_CATEGORY_FORMAT = 1;
public static final int OPT_CATEGORY_CODEC = 2;
public static final int OPT_CATEGORY_SWS = 3;
public static final int OPT_CATEGORY_PLAYER = 4;
public static final int SDL_FCC_YV12 = 0x32315659; // YV12
public static final int SDL_FCC_RV16 = 0x36315652; // RGB565
public static final int SDL_FCC_RV32 = 0x32335652; // RGBX8888
//----------------------------------------
//----------------------------------------
// properties
public static final int PROP_FLOAT_VIDEO_DECODE_FRAMES_PER_SECOND = 10001;
public static final int PROP_FLOAT_VIDEO_OUTPUT_FRAMES_PER_SECOND = 10002;
public static final int FFP_PROP_FLOAT_PLAYBACK_RATE = 10003;
public static final int FFP_PROP_FLOAT_DROP_FRAME_RATE = 10007;
public static final int FFP_PROP_INT64_SELECTED_VIDEO_STREAM = 20001;
public static final int FFP_PROP_INT64_SELECTED_AUDIO_STREAM = 20002;
public static final int FFP_PROP_INT64_SELECTED_TIMEDTEXT_STREAM = 20011;
public static final int FFP_PROP_INT64_VIDEO_DECODER = 20003;
public static final int FFP_PROP_INT64_AUDIO_DECODER = 20004;
public static final int FFP_PROPV_DECODER_UNKNOWN = 0;
public static final int FFP_PROPV_DECODER_AVCODEC = 1;
public static final int FFP_PROPV_DECODER_MEDIACODEC = 2;
public static final int FFP_PROPV_DECODER_VIDEOTOOLBOX = 3;
public static final int FFP_PROP_INT64_VIDEO_CACHED_DURATION = 20005;
public static final int FFP_PROP_INT64_AUDIO_CACHED_DURATION = 20006;
public static final int FFP_PROP_INT64_VIDEO_CACHED_BYTES = 20007;
public static final int FFP_PROP_INT64_AUDIO_CACHED_BYTES = 20008;
public static final int FFP_PROP_INT64_VIDEO_CACHED_PACKETS = 20009;
public static final int FFP_PROP_INT64_AUDIO_CACHED_PACKETS = 20010;
public static final int FFP_PROP_INT64_ASYNC_STATISTIC_BUF_BACKWARDS = 20201;
public static final int FFP_PROP_INT64_ASYNC_STATISTIC_BUF_FORWARDS = 20202;
public static final int FFP_PROP_INT64_ASYNC_STATISTIC_BUF_CAPACITY = 20203;
public static final int FFP_PROP_INT64_TRAFFIC_STATISTIC_BYTE_COUNT = 20204;
public static final int FFP_PROP_INT64_CACHE_STATISTIC_PHYSICAL_POS = 20205;
public static final int FFP_PROP_INT64_CACHE_STATISTIC_FILE_FORWARDS = 20206;
public static final int FFP_PROP_INT64_CACHE_STATISTIC_FILE_POS = 20207;
public static final int FFP_PROP_INT64_CACHE_STATISTIC_COUNT_BYTES = 20208;
public static final int FFP_PROP_INT64_LOGICAL_FILE_SIZE = 20209;
public static final int FFP_PROP_INT64_SHARE_CACHE_DATA = 20210;
public static final int FFP_PROP_INT64_BIT_RATE = 20100;
public static final int FFP_PROP_INT64_TCP_SPEED = 20200;
public static final int FFP_PROP_INT64_LATEST_SEEK_LOAD_DURATION = 20300;
public static final int FFP_PROP_INT64_IMMEDIATE_RECONNECT = 20211;
//----------------------------------------
@AccessedByNative
private long mNativeMediaPlayer;
@AccessedByNative
private long mNativeMediaDataSource;
@AccessedByNative
private long mNativeAndroidIO;
@AccessedByNative
private int mNativeSurfaceTexture;
@AccessedByNative
private int mListenerContext;
private SurfaceHolder mSurfaceHolder;
private EventHandler mEventHandler;
private PowerManager.WakeLock mWakeLock = null;
private boolean mScreenOnWhilePlaying;
private boolean mStayAwake;
private int mVideoWidth;
private int mVideoHeight;
private int mVideoSarNum;
private int mVideoSarDen;
private String mDataSource;
private Looper mLooper;
/**
* Default library loader
* Load them by yourself, if your libraries are not installed at default place.
*/
private static final IjkLibLoader sLocalLibLoader = new IjkLibLoader() {
@Override
public void loadLibrary(String libName) throws UnsatisfiedLinkError, SecurityException
张和阳
- 粉丝: 848
- 资源: 18
最新资源
- 多微网优化模型matlab 采用粒子群算法分析两个微网的优化调度,得到蓄电池,发电机以及微网间功率传输,程序有参考资料
- 潮流计算程序matlab 牛拉法 采用matlab对9节点进行潮流计算,采用牛拉法,程序运行可靠
- 微网优化调度matlab 采用matlab+yalmip编制含分布式和储能的微网优化模型,程序采用15分钟为采集节点,利用cplex求解,程序考虑发电机的启停约束,程序运行可靠
- PMSM永磁同步电机仿真三电平SVPWM矢量控制matlab PMSM双环矢量控制传统三电平
- 路径规划人工势场法以及改进人工势场法matlab代码,包含了
- MobaXterm 是一款功能强大且实用的终端仿真器软件.docx
- 三菱FX3U底层源码,PLSR源码 总体功能和指令可能支持在RUN中下载程序,支持注释的写入和读取,支持脉冲输出与定位指令(包括PLSY PWM PLSR PLSV DRVI DRVA 等指令
- Oracle Database Gateways for Win32-11gR2
- python071基于RSA加密算法软件的研究设计
- 成熟量产低压无刷伺服驱动 方案 全套软硬件资料 源码 原理图 需要的直接拿 基于28035平台
- 欧姆龙PLC ST语言6轴伺服RS232C通讯板CP1W-C IF0 真实项目程序,ST语言写的FB块 PLC用是两台CP1H-X40DT-D配置4块RS232C通讯板CP1W-CIF01 触摸屏是N
- 欧姆龙CP1H与力士乐VFC-x610变频器通讯程序功能:原创程序,可直接用于现场程序 欧姆龙CP1H的CIF11通讯板,实现对力士乐VFC-x610变频器 设定频率,控制正反转,读取实际频率,读取
- 级联型电力电子变压器,高压直流MMC控制系统,级联数可选,调 制方式有移相载波,nlm及混合调制,拥有冒泡排序,递归排序等方法,可控制三相不平衡与环流
- 西门子PLC双轴定位算法电池焊接控制程序-S7-1200 +威纶通触摸屏 S7-1200PLC做的电池焊接程序,电池包里面有n*m行列个电池 程序设计灵活SCL语言+梯形图,采用了位置试教与定位路径规
- 变压器副边突然短路simulink仿真
- MATLAB代码:基于模型预测控制的楼宇负荷需求响应研究 关键词:楼宇负荷 空调 模型预测控制 需求响应 仿真平台:MATLAB+CVX平台 主要内容:代码主要做的是一个建筑楼宇的需求响应问题,首
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论0