/*
* Copyright (C) 2015 Bilibili
* Copyright (C) 2015 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.example.widget.media;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.DialogInterface;
import android.content.res.Resources;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.v7.app.AlertDialog;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.MediaController;
import android.widget.TableLayout;
import android.widget.TextView;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import tv.danmaku.ijk.media.exo.IjkExoMediaPlayer;
import tv.danmaku.ijk.media.player.AndroidMediaPlayer;
import tv.danmaku.ijk.media.player.IMediaPlayer;
import tv.danmaku.ijk.media.player.IjkMediaPlayer;
import tv.danmaku.ijk.media.player.IjkTimedText;
import tv.danmaku.ijk.media.player.TextureMediaPlayer;
import tv.danmaku.ijk.media.player.misc.IMediaDataSource;
import tv.danmaku.ijk.media.player.misc.IMediaFormat;
import tv.danmaku.ijk.media.player.misc.ITrackInfo;
import tv.danmaku.ijk.media.player.misc.IjkMediaFormat;
import tv.danmaku.ijk.media.example.R;
import tv.danmaku.ijk.media.example.application.Settings;
import tv.danmaku.ijk.media.example.services.MediaPlayerService;
public class IjkVideoView extends FrameLayout implements MediaController.MediaPlayerControl {
private String TAG = "IjkVideoView";
// settable by the client
private Uri mUri;
private Map<String, String> mHeaders;
// all possible internal states
private static final int STATE_ERROR = -1;
private static final int STATE_IDLE = 0;
private static final int STATE_PREPARING = 1;
private static final int STATE_PREPARED = 2;
private static final int STATE_PLAYING = 3;
private static final int STATE_PAUSED = 4;
private static final int STATE_PLAYBACK_COMPLETED = 5;
// mCurrentState is a VideoView object's current state.
// mTargetState is the state that a method caller intends to reach.
// For instance, regardless the VideoView object's current state,
// calling pause() intends to bring the object to a target state
// of STATE_PAUSED.
private int mCurrentState = STATE_IDLE;
private int mTargetState = STATE_IDLE;
// All the stuff we need for playing and showing a video
private IRenderView.ISurfaceHolder mSurfaceHolder = null;
private IMediaPlayer mMediaPlayer = null;
// private int mAudioSession;
private int mVideoWidth;
private int mVideoHeight;
private int mSurfaceWidth;
private int mSurfaceHeight;
private int mVideoRotationDegree;
private IMediaController mMediaController;
private IMediaPlayer.OnCompletionListener mOnCompletionListener;
private IMediaPlayer.OnPreparedListener mOnPreparedListener;
private int mCurrentBufferPercentage;
private IMediaPlayer.OnErrorListener mOnErrorListener;
private IMediaPlayer.OnInfoListener mOnInfoListener;
private int mSeekWhenPrepared; // recording the seek position while preparing
private boolean mCanPause = true;
private boolean mCanSeekBack = true;
private boolean mCanSeekForward = true;
/** Subtitle rendering widget overlaid on top of the video. */
// private RenderingWidget mSubtitleWidget;
/**
* Listener for changes to subtitle data, used to redraw when needed.
*/
// private RenderingWidget.OnChangedListener mSubtitlesChangedListener;
private Context mAppContext;
private Settings mSettings;
private IRenderView mRenderView;
private int mVideoSarNum;
private int mVideoSarDen;
private InfoHudViewHolder mHudViewHolder;
private long mPrepareStartTime = 0;
private long mPrepareEndTime = 0;
private long mSeekStartTime = 0;
private long mSeekEndTime = 0;
private TextView subtitleDisplay;
public IjkVideoView(Context context) {
super(context);
initVideoView(context);
}
public IjkVideoView(Context context, AttributeSet attrs) {
super(context, attrs);
initVideoView(context);
}
public IjkVideoView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initVideoView(context);
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public IjkVideoView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
initVideoView(context);
}
// REMOVED: onMeasure
// REMOVED: onInitializeAccessibilityEvent
// REMOVED: onInitializeAccessibilityNodeInfo
// REMOVED: resolveAdjustedSize
private void initVideoView(Context context) {
mAppContext = context.getApplicationContext();
mSettings = new Settings(mAppContext);
initBackground();
initRenders();
mVideoWidth = 0;
mVideoHeight = 0;
// REMOVED: getHolder().addCallback(mSHCallback);
// REMOVED: getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
setFocusable(true);
setFocusableInTouchMode(true);
requestFocus();
// REMOVED: mPendingSubtitleTracks = new Vector<Pair<InputStream, MediaFormat>>();
mCurrentState = STATE_IDLE;
mTargetState = STATE_IDLE;
subtitleDisplay = new TextView(context);
subtitleDisplay.setTextSize(24);
subtitleDisplay.setGravity(Gravity.CENTER);
FrameLayout.LayoutParams layoutParams_txt = new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.MATCH_PARENT,
FrameLayout.LayoutParams.WRAP_CONTENT,
Gravity.BOTTOM);
addView(subtitleDisplay, layoutParams_txt);
}
public void setRenderView(IRenderView renderView) {
if (mRenderView != null) {
if (mMediaPlayer != null)
mMediaPlayer.setDisplay(null);
View renderUIView = mRenderView.getView();
mRenderView.removeRenderCallback(mSHCallback);
mRenderView = null;
removeView(renderUIView);
}
if (renderView == null)
return;
mRenderView = renderView;
renderView.setAspectRatio(mCurrentAspectRatio);
if (mVideoWidth > 0 && mVideoHeight > 0)
renderView.setVideoSize(mVideoWidth, mVideoHeight);
if (mVideoSarNum > 0 && mVideoSarDen > 0)
renderView.setVideoSampleAspectRatio(mVideoSarNum, mVideoSarDen);
View renderUIView = mRenderView.getView();
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
FrameLayout.LayoutParams.WRAP_CONTENT,
FrameLayout.LayoutParams.WRAP_CONTENT,
Gravity.CENTER);
renderUIView.setLayoutParams(lp);
addView(renderUIView);
mRenderView.addRenderCallback(mSHCallback);
mRenderView.setVideoRotation(mVideoRotationDegree);
}
pu
没有合适的资源?快使用搜索试试~ 我知道了~
ijkplayer 编译后的工程 0.88 版本
共1350个文件
o:532个
d:532个
java:76个
需积分: 0 24 下载量 36 浏览量
2022-03-20
19:41:52
上传
评论
收藏 51.54MB ZIP 举报
温馨提示
ijkplayer 编译后的工程 0.88 版本 ; https://blog.csdn.net/shulianghan/category_11697316.html 专栏配套源码
资源详情
资源评论
资源推荐
收起资源包目录
ijkplayer 编译后的工程 0.88 版本 (1350个子文件)
libyuv_static.a 4.09MB
libyuv_static.a 3.85MB
libyuv_static.a 2.05MB
libyuv_static.a 1.45MB
libijkj4a.a 1.03MB
libijkj4a.a 1.01MB
libijksoundtouch.a 766KB
libijkj4a.a 750KB
libijkj4a.a 663KB
libijksoundtouch.a 614KB
libijksoundtouch.a 470KB
libijksoundtouch.a 364KB
libcpufeatures.a 59KB
libcpufeatures.a 55KB
libcpufeatures.a 48KB
libcpufeatures.a 29KB
libandroid-ndk-profiler.a 6KB
libandroid-ndk-profiler.a 6KB
libandroid-ndk-profiler.a 5KB
libandroid-ndk-profiler.a 4KB
android-ndk-prof 56B
android-ndk-prof 56B
android-ndk-prof 56B
android-ndk-prof 56B
android-ndk-prof 56B
gradlew.bat 2KB
.classpath 1KB
.classpath 508B
.classpath 508B
.classpath 508B
.classpath 508B
.classpath 508B
ffpipenode_android_mediacodec_vdec.o.d 42KB
ffpipenode_android_mediacodec_vdec.o.d 42KB
ffpipenode_android_mediacodec_vdec.o.d 41KB
ffpipenode_android_mediacodec_vdec.o.d 41KB
ffpipeline_android.o.d 40KB
ffpipeline_android.o.d 40KB
ffpipeline_android.o.d 39KB
ffpipeline_android.o.d 39KB
ijkplayer_android.o.d 39KB
ijkplayer_android.o.d 39KB
ijkplayer_jni.o.d 39KB
ijkplayer_jni.o.d 38KB
ijkplayer_android.o.d 38KB
ijkplayer_android.o.d 38KB
ijkplayer_jni.o.d 38KB
ijkplayer_jni.o.d 38KB
ff_ffplay.o.d 37KB
ff_ffplay.o.d 37KB
ff_ffplay.o.d 36KB
ff_ffplay.o.d 35KB
ffpipeline_ffplay.o.d 34KB
ffpipeline_ffplay.o.d 34KB
ffpipenode_ffplay_vdec.o.d 34KB
ijkplayer.o.d 34KB
ffpipenode_ffplay_vdec.o.d 33KB
ffpipeline_ffplay.o.d 33KB
ffpipeline_ffplay.o.d 33KB
ijkplayer.o.d 33KB
ff_ffpipeline.o.d 33KB
ijksdl_aout.o.d 33KB
ffpipenode_ffplay_vdec.o.d 33KB
ff_ffpipeline.o.d 33KB
ffpipenode_ffplay_vdec.o.d 33KB
ijkplayer.o.d 33KB
ijksdl_aout.o.d 32KB
ijkplayer.o.d 32KB
ff_ffpipeline.o.d 32KB
ff_ffpipeline.o.d 32KB
ijksdl_aout.o.d 32KB
ijksdl_aout.o.d 32KB
ffmpeg_api_jni.o.d 31KB
ffmpeg_api_jni.o.d 31KB
ijksdl_vout_android_nativewindow.o.d 31KB
ijksdl_vout_android_nativewindow.o.d 31KB
ffmpeg_api_jni.o.d 30KB
ffmpeg_api_jni.o.d 30KB
ijksdl_vout_android_nativewindow.o.d 30KB
ijksdl_vout_android_nativewindow.o.d 30KB
ijksdl_vout_android_surface.o.d 30KB
ijksdl_vout_android_surface.o.d 29KB
ijksdl_vout_overlay_android_mediacodec.o.d 29KB
ijksdl_vout_overlay_android_mediacodec.o.d 29KB
ff_cmdutils.o.d 29KB
ijksdl_vout_android_surface.o.d 29KB
ijksdl_vout_android_surface.o.d 29KB
ff_cmdutils.o.d 28KB
ijkmeta.o.d 28KB
ijkmeta.o.d 28KB
ijksdl_vout_overlay_android_mediacodec.o.d 28KB
ijksdl_vout_overlay_android_mediacodec.o.d 28KB
android_nativewindow.o.d 28KB
ff_cmdutils.o.d 28KB
ff_cmdutils.o.d 28KB
android_nativewindow.o.d 27KB
ijkmeta.o.d 27KB
ijksdl_vout_overlay_ffmpeg.o.d 27KB
ijkmeta.o.d 27KB
ijksdl_vout_overlay_ffmpeg.o.d 27KB
共 1350 条
- 1
- 2
- 3
- 4
- 5
- 6
- 14
韩曙亮
- 粉丝: 9w+
- 资源: 287
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- JSP-JTBC-CMS(SQLITE).rar
- MC3362和MC145151调频无线接收器的设计.pdf
- MiniRenamer-v100.0一款简单易用的批量文件重命名工具(已注册PRO版本).rar
- 小狐狸Ai系统 小狐狸ai付费创作系统V2.8.0 ChatGPT智能机器人
- 公孙离-内衣-肚兜.zipgsl
- 快慢指针判断链表是否有环-go 语言实现
- 学生成绩管理系统的设计与实现-收藏备用.pdf
- JSP+SQL网站流量统计管理系统(源代码+论文).rar
- IBM-PC-XT微机过程...道中模拟量数据的采集和处理.pdf
- JSP+SQL网上选课系统(源代码+论文+答辩PPT).rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0