{"action":"created","issue":{"url":"https://api.github.com/repos/Bilibili/ijkplayer/issues/256","labels_url":"https://api.github.com/repos/Bilibili/ijkplayer/issues/256/labels{/name}","comments_url":"https://api.github.com/repos/Bilibili/ijkplayer/issues/256/comments","events_url":"https://api.github.com/repos/Bilibili/ijkplayer/issues/256/events","html_url":"https://github.com/Bilibili/ijkplayer/issues/256","id":83469813,"number":256,"title":"硬件解码初始化失败，但如果页面跳转在恢复到播放页面硬件解码是可以的","user":{"login":"10045125","id":2945098,"avatar_url":"https://avatars.githubusercontent.com/u/2945098?v=3","gravatar_id":"","url":"https://api.github.com/users/10045125","html_url":"https://github.com/10045125","followers_url":"https://api.github.com/users/10045125/followers","following_url":"https://api.github.com/users/10045125/following{/other_user}","gists_url":"https://api.github.com/users/10045125/gists{/gist_id}","starred_url":"https://api.github.com/users/10045125/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/10045125/subscriptions","organizations_url":"https://api.github.com/users/10045125/orgs","repos_url":"https://api.github.com/users/10045125/repos","events_url":"https://api.github.com/users/10045125/events{/privacy}","received_events_url":"https://api.github.com/users/10045125/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-01T12:34:12Z","updated_at":"2015-06-02T04:25:10Z","closed_at":null,"body":"![image](https://cloud.githubusercontent.com/assets/2945098/7912619/ba7831de-089b-11e5-8483-7adfd0db0a60.png)\r\n这个是暂停的log\r\n![image](https://cloud.githubusercontent.com/assets/2945098/7912637/ea874630-089b-11e5-96a5-c0a2175dd16c.png)\r\n 如果这个时候从一个Activity的页面回到播放器页面，硬件解码显示是成功的，log为\r\n06-01 20:22:45.935: W/IJKMEDIA(31391): SDL_AMediaCodecJava_start\r\n06-01 20:22:45.935: I/ACodec(31391): [OMX.Exynos.avc.dec] Now Loaded->Idle\r\n06-01 20:22:45.935: E/Parcel(31391): nm 96\r\n06-01 20:22:45.950: E/Parcel(31391): nm 96\r\n06-01 20:22:45.955: I/IJKMEDIA(31391): VideoCodec: MediaCodec, OMX.Exynos.avc.dec\r\n06-01 20:22:45.955: I/IJKMEDIA(31391): fps: 30.303030 (normal)\r\n06-01 20:22:45.955: I/IJKMEDIA(31391): fps: 30.000000 (normal)\r\n06-01 20:22:45.955: I/IJKMEDIA(31391): SDL_RunThread: [469] ff_video_dec\r\n06-01 20:22:45.955: W/IJKMEDIA(31391): ijkmp_get_msg: FFP_MSG_PREPARED\r\n06-01 20:22:45.955: W/IJKMEDIA(31391): FFP_MSG_PREPARED:\r\n06-01 20:22:45.955: W/IJKMEDIA(31391): FFP_MSG_VIDEO_SIZE_CHANGED: 1280, 720\r\n06-01 20:22:45.955: W/IJKMEDIA(31391): FFP_MSG_SAR_CHANGED: 1, 1\r\n06-01 20:22:45.955: I/IJKMEDIA(31391): SDL_RunThread: [470] amediacodec_input_thread\r\n06-01 20:22:45.980: I/ACodec(31391): [OMX.Exynos.avc.dec] Now Idle->Executing\r\n06-01 20:22:45.980: D/tv.danmaku.ijk.media.widget.VideoView(31391): onPrepared\r\n06-01 20:22:45.980: W/IJKMEDIA(31391): IjkMediaPlayer_start\r\n06-01 20:22:45.980: W/IJKMEDIA(31391): ijkmp_start()\r\n06-01 20:22:45.980: W/IJKMEDIA(31391): ijkmp_start()=0\r\n06-01 20:22:45.980: W/IJKMEDIA(31391): ijkmp_get_msg: FFP_REQ_START\r\n06-01 20:22:45.980: D/IJKMEDIA(31391): ijkmp_get_msg: FFP_REQ_START: start on fly\r\n06-01 20:22:45.980: D/tv.danmaku.ijk.media.widget.VideoView(31391): onVideoSizeChanged: (1280x720)\r\n06-01 20:22:45.980: I/ACodec(31391): [OMX.Exynos.avc.dec] Now Executing\r\n06-01 20:22:45.980: D/tv.danmaku.ijk.media.widget.VideoView(31391): onVideoSizeChanged: (1280x720)\r\n06-01 20:22:45.990: I/onScrollMax(31391): onScrollMax\r\n06-01 20:22:45.990: E/mFrameLayoutMain Max(31391): 1\r\n06-01 20:22:45.990: E/Max(31391): View.VISIBLE0\r\n06-01 20:22:45.990: I/ACodec(31391): [OMX.Exynos.avc.dec] Now handling output port settings change\r\n06-01 20:22:45.995: E/Parcel(31391): nm 96\r\n06-01 20:22:46.010: I/ACodec(31391): [OMX.Exynos.avc.dec] Now Executing\r\n\r\n\r\n我不确定是什么原因，在java层很少关于硬件解码的代码。希望作者回复，谢谢！"},"comment":{"url":"https://api.github.com/repos/Bilibili/ijkplayer/issues/comments/107798733","html_url":"https://github.com/Bilibili/ijkplayer/issues/256#issuecomment-107798733","issue_url":"https://api.github.com/repos/Bilibili/ijkplayer/issues/256","id":107798733,"user":{"login":"10045125","id":2945098,"avatar_url":"https://avatars.githubusercontent.com/u/2945098?v=3","gravatar_id":"","url":"https://api.github.com/users/10045125","html_url":"https://github.com/10045125","followers_url":"https://api.github.com/users/10045125/followers","following_url":"https://api.github.com/users/10045125/following{/other_user}","gists_url":"https://api.github.com/users/10045125/gists{/gist_id}","starred_url":"https://api.github.com/users/10045125/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/10045125/subscriptions","organizations_url":"https://api.github.com/users/10045125/orgs","repos_url":"https://api.github.com/users/10045125/repos","events_url":"https://api.github.com/users/10045125/events{/privacy}","received_events_url":"https://api.github.com/users/10045125/received_events","type":"User","site_admin":false},"created_at":"2015-06-02T04:25:10Z","updated_at":"2015-06-02T04:25:10Z","body":"Thanks,是你说的问题，我修改过来了。我为了适配横屏的视频大小修改了一小部分源码，按视频很屏幕比例进行了缩放。\r\n\r\n具体是在\r\n@Override\r\n\tprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\r\n\t\t// int width = getDefaultSize(mVideoWidth, widthMeasureSpec);\r\n\t\t// int height = getDefaultSize(mVideoHeight, heightMeasureSpec);\r\n\t\tint width = getDefaultSize(mVideoWidth, widthMeasureSpec);\r\n\t\tint height = getDefaultSize(mVideoHeight, heightMeasureSpec);\r\n\r\n\t\tif (mVideoWidth > 0 && mVideoHeight > 0) {\r\n\t\t\tif (mVideoWidth * height > width * mVideoHeight) {\r\n\t\t\t\theight = width * mVideoHeight / mVideoWidth;\r\n\t\t\t} else if (mVideoWidth * height < width * mVideoHeight) {\r\n\t\t\t\twidth = height * mVideoWidth / mVideoHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t\tsetMeasuredDimension(width, height);\r\n\t}\r\n\r\n之后将setVideoLayout修改为getHolder().setFixedSize(mVideoWidth, mVideoHeight);就能够适应横竖屏的适配缩放。\r\n       再次感谢你的耐心解答，Thanks."}}