Fix video recording with aidl

This commit is contained in:
PavelRatushny 2017-09-01 12:47:25 +03:00
parent 3cdda4773f
commit 656c50be1d
4 changed files with 7 additions and 7 deletions

View file

@ -406,7 +406,7 @@ public class OsmandAidlApi {
if (plugin != null) {
double lat = intent.getDoubleExtra(AIDL_LATITUDE, Double.NaN);
double lon = intent.getDoubleExtra(AIDL_LONGITUDE, Double.NaN);
plugin.recordVideo(lat, lon, mapActivity);
plugin.recordVideo(lat, lon, mapActivity, true);
}
}
};

View file

@ -641,7 +641,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
@Override
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked) {
recordVideo(latitude, longitude, mapActivity);
recordVideo(latitude, longitude, mapActivity, false);
return true;
}
})
@ -769,7 +769,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
private void takeAction(final MapActivity mapActivity, double lon, double lat, int action) {
if (action == AV_DEFAULT_ACTION_VIDEO) {
recordVideo(lat, lon, mapActivity);
recordVideo(lat, lon, mapActivity, false);
} else if (action == AV_DEFAULT_ACTION_TAKEPICTURE) {
takePhoto(lat, lon, mapActivity, false, false);
} else if (action == AV_DEFAULT_ACTION_AUDIO) {
@ -874,8 +874,8 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
}
}
public void recordVideo(final double lat, final double lon, final MapActivity mapActivity) {
if (AV_EXTERNAL_RECORDER.get()) {
public void recordVideo(final double lat, final double lon, final MapActivity mapActivity, final boolean forceExternal) {
if (AV_EXTERNAL_RECORDER.get() || forceExternal) {
captureVideoExternal(lat, lon, mapActivity);
} else {
if (ActivityCompat.checkSelfPermission(mapActivity, Manifest.permission.CAMERA)

View file

@ -31,7 +31,7 @@ public class TakeVideoNoteAction extends QuickAction {
AudioVideoNotesPlugin plugin = OsmandPlugin.getPlugin(AudioVideoNotesPlugin.class);
if (plugin != null)
plugin.recordVideo(latLon.getLatitude(), latLon.getLongitude(), activity);
plugin.recordVideo(latLon.getLatitude(), latLon.getLongitude(), activity, false);
}
@Override

View file

@ -285,7 +285,7 @@ public class ExternalApiHelper {
if (API_CMD_RECORD_AUDIO.equals(cmd)) {
plugin.recordAudio(lat, lon, mapActivity);
} else if (API_CMD_RECORD_VIDEO.equals(cmd)) {
plugin.recordVideo(lat, lon, mapActivity);
plugin.recordVideo(lat, lon, mapActivity, false);
} else if (API_CMD_RECORD_PHOTO.equals(cmd)) {
plugin.takePhoto(lat, lon, mapActivity, true, false);
}