Skip to content

Commit 5bc75f4

Browse files
エンコーダごとの URI をレスポンスに格納するように修正
1 parent 3328f90 commit 5bc75f4

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/profile/HostMediaStreamingRecordingProfile.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.deviceconnect.android.deviceplugin.host.recorder.LiveStreaming;
2727
import org.deviceconnect.android.deviceplugin.host.recorder.camera.Camera2Recorder;
2828
import org.deviceconnect.android.deviceplugin.host.recorder.util.CapabilityUtil;
29+
import org.deviceconnect.android.deviceplugin.host.util.NetworkUtil;
2930
import org.deviceconnect.android.event.Event;
3031
import org.deviceconnect.android.event.EventError;
3132
import org.deviceconnect.android.event.EventManager;
@@ -1829,6 +1830,21 @@ private Bundle createVideoEncoder(HostMediaRecorder.EncoderSettings s) {
18291830
}
18301831
}
18311832

1833+
String host = NetworkUtil.getIPAddress(getContext());
1834+
if (host.equals("0.0.0.0")) {
1835+
host = "localhost";
1836+
}
1837+
1838+
if ("video/x-mjpeg".equals(s.getMimeType().getValue())) {
1839+
bundle.putString("uri", "http://" + host + ":" + s.getPort() + "/mjpeg");
1840+
} else if ("video/x-rtp".equals(s.getMimeType().getValue())) {
1841+
bundle.putString("uri", "rtsp://" + host + ":" + s.getPort());
1842+
} else if ("video/MP2T".equals(s.getMimeType().getValue())) {
1843+
bundle.putString("uri", "srt://" + host + ":" + s.getPort());
1844+
} else if ("video/x-rtmp".equals(s.getMimeType().getValue())) {
1845+
bundle.putString("uri", s.getBroadcastURI());
1846+
}
1847+
18321848
if (s.getPort() > 0) {
18331849
bundle.putInt("port", s.getPort());
18341850
}

0 commit comments

Comments
 (0)