ScreenCapturerAndroid class in Chromium dev release does not appear in libjingle_peerconnection_java

637 views
Skip to first unread message

Joseph

unread,
Oct 10, 2016, 1:05:46 AM10/10/16
to discuss-webrtc
Hi

I'm interested in testing the Android screen capturing functionality added in https://codereview.webrtc.org/2276593003/
I've downloaded the latest Chromium dev channel release (version  55.0.2882.4) and I can see the ScreenCapturerAndroid.java file in the Android API code.
However when I build the Android webrtc  components I do not see the ScreenCapturerAndroid class file in the built libjingle_peerconnection_java.jar file.
Can anyone tell me why its in the source but it's not being packaged into the jar file ?

Regards

Joseph.

Kushtrim Pacaj

unread,
Oct 13, 2016, 3:58:13 AM10/13/16
to discuss-webrtc
I went through the configuration files to try and find a reason why it was excluded but no dice. Opened a bug report here.
If you want just to test it out the functionality before this is fixed, remove the .jar from you project, and import the source files directly into your project ( the org.webrtc package ).
To make it work in my case, I also had to disable an OpenGL error checker, or else it'd crash.

But ultimately, the feature works, I was able to successfully share the screen of my phone. 

Henrik Kjellander

unread,
Oct 13, 2016, 10:56:40 AM10/13/16
to discuss-webrtc, sa...@webrtc.org
I assigned the bug to sakal. If it works I don't see we wouldn't add it but maybe there's another reason?

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/e807bfdc-414c-42ff-a31c-1458ea209369%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kushtrim Pacaj

unread,
Oct 13, 2016, 11:31:53 AM10/13/16
to discuss-webrtc, sa...@webrtc.org
Forgot to tell what was I disabled, that used to crash.
It was the exception throwing inside GlUtil.checkNoGLES2Error. The cause of the exception should probably be dealt with, but as a workaround, it worked even if there is a GL error.

On Thursday, October 13, 2016 at 4:56:40 PM UTC+2, Henrik Kjellander wrote:
I assigned the bug to sakal. If it works I don't see we wouldn't add it but maybe there's another reason?
On Oct 13, 2016 00:58, "Kushtrim Pacaj" <kushtr...@gmail.com> wrote:
I went through the configuration files to try and find a reason why it was excluded but no dice. Opened a bug report here.
If you want just to test it out the functionality before this is fixed, remove the .jar from you project, and import the source files directly into your project ( the org.webrtc package ).
To make it work in my case, I also had to disable an OpenGL error checker, or else it'd crash.

But ultimately, the feature works, I was able to successfully share the screen of my phone. 


On Monday, October 10, 2016 at 7:05:46 AM UTC+2, Joseph wrote:
Hi

I'm interested in testing the Android screen capturing functionality added in https://codereview.webrtc.org/2276593003/
I've downloaded the latest Chromium dev channel release (version  55.0.2882.4) and I can see the ScreenCapturerAndroid.java file in the Android API code.
However when I build the Android webrtc  components I do not see the ScreenCapturerAndroid class file in the built libjingle_peerconnection_java.jar file.
Can anyone tell me why its in the source but it's not being packaged into the jar file ?

Regards

Joseph.

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.

RWebRTC

unread,
Oct 18, 2016, 12:10:55 AM10/18/16
to discuss-webrtc

RWebRTC

unread,
Oct 18, 2016, 12:10:55 AM10/18/16
to discuss-webrtc
Just For Android.


On Monday, 10 October 2016 13:05:46 UTC+8, Joseph wrote:

Kushtrim Pacaj

unread,
Oct 19, 2016, 6:02:42 AM10/19/16
to discuss-webrtc
Check the issue tracker. It was just fixed.


On Monday, October 10, 2016 at 7:05:46 AM UTC+2, Joseph wrote:

Chen Cong

unread,
Nov 2, 2016, 1:51:36 AM11/2/16
to discuss-webrtc
Hi,

I am confuse about how to use "ScreenCapturerAndroid" class. Can you give me a demo?

-Chen
Thanks


在 2016年10月19日星期三 UTC+8下午6:02:42,Kushtrim Pacaj写道:

Kushtrim Pacaj

unread,
Nov 2, 2016, 4:27:24 PM11/2/16
to discuss-webrtc
First you need to request from the user to allow your app to record the screen ( via the MediaProjectionAPI, available only from 5.0 and above). Sample code would be:

 MediaProjectionManager mediaProjectionService = (MediaProjectionManager) context.getSystemService(Context.MEDIA_PROJECTION_SERVICE);
 
Intent screenCaptureIntent = mediaProjectionService.createScreenCaptureIntent();
 startActivityForResult
(screenCaptureIntent,42);

Then:

public void onActivityResult(int requestCode, int resultCode, Intent data) {
 if ( requestCode == 42 && resultCode == Activity.RESULT_OK){
       // use the intent data.
       VideoCapturer capturer = new ScreenCapturerAndroid(data, new MediaProjection.Callback() {
                @Override
                public void onStop() {
                    super.onStop();
                    Log.d("VideoCapturer", "MediaProjection Callback onStop");
                }
            });
      // from here on, it's the same as if you were using camera. Use this capturer to create a video source, that to create a video track

 }



Chen Cong

unread,
Nov 2, 2016, 9:32:03 PM11/2/16
to discuss...@googlegroups.com
Got it. Thank you very much.

--

---
You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/yMrE6I4d_Wc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/09219993-e583-4bd0-83b9-7d57b837f85d%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages