本文主要是介绍Windows/Android/iOS平台H265编码视频播放器EasyPlayerPro支持高码率视频播放和D3D画面旋转代码参考,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
EasyPlayerPro是一款全功能的流媒体播放器,支持RTSP、RTMP、HTTP、HLS、UDP、RTP、File等多种流媒体协议播放、支持本地文件播放,支持本地抓拍、本地录像、播放旋转、多屏播放等多种功能特性,核心基于ffmpeg,稳定、高效、可靠,支持Windows、Android、iOS三个平台,EasyPlayerPro播放器可广泛应用于流媒体客户端、互联网直播、在线教育、IPTV、赛事直播、本地视频文件播放等项目中。
我们今天介绍一下EasyPlayerPro-win版的D3D画面旋转实现方法,可以从 https://github.com/tsingsee/EasyPlayerPro-Win 下载到工程代码。
其中定义的tagEASY_PARAM_ID枚举和EasyPlayerPro_Setparam(Easy_PlayerPro_Handle player, EASY_PARAM_ID param_id, EASY_HANDLE param)函数可以完成很多功能。
typedef enum tagEASY_PARAM_ID
{//++ public// duration & positionEASY_PARAM_MEDIA_DURATION = 0x1000,EASY_PARAM_MEDIA_POSITION,// media detail infoEASY_PARAM_MEDIA_INFO,EASY_PARAM_VIDEO_WIDTH,EASY_PARAM_VIDEO_HEIGHT,// video display modeEASY_PARAM_VIDEO_MODE,// audio volume controlEASY_PARAM_AUDIO_VOLUME,// playback speed controlEASY_PARAM_PLAY_SPEED,EASY_PARAM_PLAY_SPEED_TYPE,// video decode thread countEASY_PARAM_DECODE_THREAD_COUNT,// visual effect modeEASY_PARAM_VISUAL_EFFECT,// audio/video sync diffEASY_PARAM_AVSYNC_TIME_DIFF,// player event/audio/video callbackEASY_PARAM_PLAYER_CALLBACK,// player event/audio/video callback userdataEASY_PARAM_PLAYER_USERDATA,// audio/video streamEASY_PARAM_AUDIO_STREAM_TOTAL,EASY_PARAM_VIDEO_STREAM_TOTAL,EASY_PARAM_SUBTITLE_STREAM_TOTAL,EASY_PARAM_AUDIO_STREAM_CUR,EASY_PARAM_VIDEO_STREAM_CUR,EASY_PARAM_SUBTITLE_STREAM_CUR,//++ for media record EASY_PARAM_RECORD_TIME,EASY_PARAM_RECORD_PIECE_ID,//-- for media record//-- public//++ for audio render typeEASY_PARAM_ADEV_RENDER_TYPE = 0x2000,EASY_PARAM_ADEV_GET_CONTEXT,EASY_PARAM_ADEV_MUTE,//-- for audio render type//++ for vdevEASY_PARAM_VDEV_RENDER_TYPE = 0x3000,EASY_PARAM_VDEV_FRAME_RATE,EASY_PARAM_VDEV_GET_CONTEXT,EASY_PARAM_VDEV_POST_SURFACE,EASY_PARAM_VDEV_GET_D3DDEV,EASY_PARAM_VDEV_D3D_ROTATE,EASY_PARAM_VDEV_RENDER_SHOW,//-- for vdev//++ for renderEASY_PARAM_RENDER_UPDATE = 0x4000,EASY_PARAM_RENDER_START_PTS,//-- for render}EASY_PARAM_ID;
枚举类型中 EASY_PARAM_VDEV_D3D_ROTATE 为D3D画面旋转需要用到的类型,在HandleCommand函数中,如下方法实现旋转(每次旋转90度):
case POP_MENU_STREAM_D3D_ROTATE: //d3d视频旋转{int angle = 0;EasyPlayerPro_Getparam(m_pMainDlg->m_hPlayer, EASY_PARAM_VDEV_D3D_ROTATE, &angle);angle += 90; angle %= 360;EasyPlayerPro_Setparam(m_pMainDlg->m_hPlayer, EASY_PARAM_VDEV_D3D_ROTATE, &angle);}break;
下面我们看下实际效果:
这篇关于Windows/Android/iOS平台H265编码视频播放器EasyPlayerPro支持高码率视频播放和D3D画面旋转代码参考的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!