{"action":"created","issue":{"url":"https://api.github.com/repos/begeekmyfriend/yasea/issues/41","repository_url":"https://api.github.com/repos/begeekmyfriend/yasea","labels_url":"https://api.github.com/repos/begeekmyfriend/yasea/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/begeekmyfriend/yasea/issues/41/comments","events_url":"https://api.github.com/repos/begeekmyfriend/yasea/issues/41/events","html_url":"https://github.com/begeekmyfriend/yasea/issues/41","id":160430038,"number":41,"title":"Question: can you help me use Yasea with a custom Camera Preview?","user":{"login":"gouravd","id":3840752,"avatar_url":"https://avatars.githubusercontent.com/u/3840752?v=3","gravatar_id":"","url":"https://api.github.com/users/gouravd","html_url":"https://github.com/gouravd","followers_url":"https://api.github.com/users/gouravd/followers","following_url":"https://api.github.com/users/gouravd/following{/other_user}","gists_url":"https://api.github.com/users/gouravd/gists{/gist_id}","starred_url":"https://api.github.com/users/gouravd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gouravd/subscriptions","organizations_url":"https://api.github.com/users/gouravd/orgs","repos_url":"https://api.github.com/users/gouravd/repos","events_url":"https://api.github.com/users/gouravd/events{/privacy}","received_events_url":"https://api.github.com/users/gouravd/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/begeekmyfriend/yasea/labels/help%20wanted","name":"help wanted","color":"128A0C"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-06-15T14:02:48Z","updated_at":"2016-06-15T19:04:36Z","closed_at":null,"body":"Hi @begeekmyfriend , in my app I am using GLSurfaceView for displaying the camera preview frames so that I can add filters. \r\n\r\nCan you help me use Yasea with this custom Camera?\r\n\r\nBasically in the Yasea example, this is where the magic happens\r\n\r\n    private void onGetYuvFrame(byte[] data) {\r\n        if(isPushing)\r\n            mEncoder.onGetYuvFrame(data);\r\n    }\r\n\r\nBut in the custom camera, \r\n\r\n1) We extend GLSurfaceView\r\n2) Set renderer\r\n\r\n      mRenderer = new CameraSurfaceRenderer(this);\r\n      setEGLContextClientVersion(2);\t// GLES 2.0, API >= 8\r\n      setRenderer(mRenderer);\r\n      /*// the frequency of refreshing of camera preview is at most 15 fps\r\n      // and RENDERMODE_WHEN_DIRTY is better to reduce power consumption*/\r\n      setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);\r\n\r\n3) On draw we draw to the Preview Surface and to the Media Codec as well\r\n\r\n        GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);\r\n\r\n        if(applyEffect)\r\n        {\r\n            applyEffect = false;\r\n            mDrawer.applyEffect(effect);\r\n        }\r\n\r\n        if (requesrUpdateTex) {\r\n            requesrUpdateTex = false;\r\n            // update texture(came from camera)\r\n            mSTexture.updateTexImage();\r\n            // get texture matrix\r\n            mSTexture.getTransformMatrix(mStMatrix);\r\n        }\r\n\r\n        // draw to preview screen\r\n        mDrawer.draw(hTex[0], mStMatrix);\r\n        if (mVideoEncoder != null) {\r\n                    // notify to capturing thread that the camera frame is available.\r\n                   mVideoEncoder.frameAvailableSoon(mStMatrix, mMvpMatrix);\r\n        }\r\n        \r\n4) In the MediaEncoder, \r\n\r\n    mSurface = mMediaCodec.createInputSurface(); ==> We create an input surface\r\n\r\n    mRenderHandler.setEglContext(shared_context, tex_id, mSurface, true); ==. Set EGLContext\r\n\r\n\r\nCan help me figure out how to record from the OpenGL texture instead of the YUVFrame? This will be a great enhancement and we can add realtime video filters to live streaming."},"comment":{"url":"https://api.github.com/repos/begeekmyfriend/yasea/issues/comments/226287902","html_url":"https://github.com/begeekmyfriend/yasea/issues/41#issuecomment-226287902","issue_url":"https://api.github.com/repos/begeekmyfriend/yasea/issues/41","id":226287902,"user":{"login":"gouravd","id":3840752,"avatar_url":"https://avatars.githubusercontent.com/u/3840752?v=3","gravatar_id":"","url":"https://api.github.com/users/gouravd","html_url":"https://github.com/gouravd","followers_url":"https://api.github.com/users/gouravd/followers","following_url":"https://api.github.com/users/gouravd/following{/other_user}","gists_url":"https://api.github.com/users/gouravd/gists{/gist_id}","starred_url":"https://api.github.com/users/gouravd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gouravd/subscriptions","organizations_url":"https://api.github.com/users/gouravd/orgs","repos_url":"https://api.github.com/users/gouravd/repos","events_url":"https://api.github.com/users/gouravd/events{/privacy}","received_events_url":"https://api.github.com/users/gouravd/received_events","type":"User","site_admin":false},"created_at":"2016-06-15T19:04:36Z","updated_at":"2016-06-15T19:04:36Z","body":"My code is adapted from https://github.com/saki4510t/AudioVideoRecordingSample which lays out the basics for Audio/Video recording using MediaCodec from Camera."}}
{"actor":{"display_login":"gouravd"}}