android: Switch to the camera for input

This commit is contained in:
Jan Schmidt 2019-09-14 03:20:59 +10:00 committed by Matthew Waters
parent 91b3002fa0
commit 1c3c194fd2
3 changed files with 19 additions and 17 deletions

View file

@ -3,9 +3,11 @@
package="org.freedesktop.gstreamer.webrtc">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:glEsVersion="0x00020000"/>
<application android:label="@string/app_name">

View file

@ -30,20 +30,14 @@ endif
GSTREAMER_NDK_BUILD_PATH := $(GSTREAMER_ROOT)/share/gst-android/ndk-build/
include $(GSTREAMER_NDK_BUILD_PATH)/plugins.mk
GSTREAMER_PLUGINS := $(GSTREAMER_PLUGINS_CORE) \
$(GSTREAMER_PLUGINS_PLAYBACK) \
$(GSTREAMER_PLUGINS_NET) \
$(GSTREAMER_PLUGINS_SYS) \
$(GSTREAMER_PLUGINS_CODECS_RESTRICTED) \
$(GSTREAMER_CODECS_GPL) \
$(GSTREAMER_PLUGINS_ENCODING) \
$(GSTREAMER_PLUGINS_VIS) \
$(GSTREAMER_PLUGINS_EFFECTS) \
$(GSTREAMER_PLUGINS_NET_RESTRICTED) \
subparse ogg theora vorbis opus ivorbisdec alaw apetag audioparsers auparse avi dv flac flv flxdec icydemux id3demux isomp4 jpeg lame matroska mpg123 mulaw multipart png speex taglib vpx wavenc wavpack wavparse y4menc adpcmdec adpcmenc dashdemux dvbsuboverlay dvdspu hls id3tag kate midi mxf openh264 opusparse pcapparse pnm rfbsrc siren smoothstreaming subenc videoparsersbad y4mdec jpegformat gdp rsvg openjpeg spandsp sbc \
nice androidmedia
# $(GSTREAMER_PLUGINS_CODECS)
GSTREAMER_PLUGINS_CORE_CUSTOM := coreelements app audioconvert audiorate audioresample videoconvert videorate videoscale videotestsrc volume
GSTREAMER_PLUGINS_CODECS_CUSTOM := videoparsersbad vpx opus audioparsers opusparse androidmedia
GSTREAMER_PLUGINS_NET_CUSTOM := tcp rtsp rtp rtpmanager udp srtp webrtc dtls nice
GSTREAMER_PLUGINS := $(GSTREAMER_PLUGINS_CORE_CUSTOM) $(GSTREAMER_PLUGINS_CODECS_CUSTOM) $(GSTREAMER_PLUGINS_NET_CUSTOM) \
$(GSTREAMER_PLUGINS_ENCODING) \
$(GSTREAMER_PLUGINS_SYS)
GSTREAMER_EXTRA_DEPS := gstreamer-webrtc-1.0 gstreamer-sdp-1.0 gstreamer-video-1.0 libsoup-2.4 json-glib-1.0 glib-2.0
G_IO_MODULES = gnutls

View file

@ -322,8 +322,8 @@ start_pipeline (WebRTC * webrtc)
webrtc->pipe =
gst_parse_launch ("webrtcbin name=sendrecv "
"videotestsrc pattern=ball ! queue ! vp8enc deadline=1 error-resilient=default ! rtpvp8pay picture-id-mode=15-bit ! "
"queue ! " RTP_CAPS_VP8 " ! sendrecv.sink_0 "
"ahcsrc ! queue max-size-buffers=2 ! videoconvert ! vp8enc deadline=1 error-resilient=default ! rtpvp8pay picture-id-mode=15-bit ! "
"queue max-size-buffers=1 ! " RTP_CAPS_VP8 " ! sendrecv.sink_0 "
"openslessrc ! queue ! audioconvert ! audioresample ! audiorate ! queue ! opusenc ! rtpopuspay ! "
"queue ! " RTP_CAPS_OPUS " ! sendrecv.sink_1 ",
&error);
@ -497,6 +497,9 @@ on_server_message (SoupWebsocketConnection * conn, SoupWebsocketDataType type,
JsonNode *root;
JsonObject *object;
JsonParser *parser = json_parser_new ();
g_print ("Got server message %s", text);
if (!json_parser_load_from_data (parser, text, -1, NULL)) {
g_printerr ("Unknown message '%s', ignoring", text);
g_object_unref (parser);
@ -520,7 +523,10 @@ on_server_message (SoupWebsocketConnection * conn, SoupWebsocketDataType type,
g_assert (webrtc->app_state == PEER_CALL_NEGOTIATING);
object = json_object_get_object_member (object, "sdp");
g_assert (json_object_has_member (object, "type"));
/* In this example, we always create the offer and receive one answer.
* See tests/examples/webrtcbidirectional.c in gst-plugins-bad for how to
* handle offers from peers and reply with answers using webrtcbin. */
@ -799,7 +805,7 @@ native_class_init (JNIEnv * env, jclass klass)
(*env)->ThrowNew (env, exception_class, message);
}
gst_debug_set_threshold_from_string ("gl*:7", FALSE);
//gst_debug_set_threshold_from_string ("gl*:7", FALSE);
}
static void