Commit Graph

75 Commits

Author SHA1 Message Date
baldurk 1792673864 Show an error message if saving changes fails 2018-02-19 00:52:14 +00:00
baldurk 04fac1d6f8 Use android properties to pass capture options to the device 2018-02-14 19:22:23 +00:00
baldurk 8622471277 Reset android vulkan layer property as late as possible
* We can't reliably know when we can safely remove the layer property
  at capture time because it's impossible to know if an android app will
  use vulkan or not. So instead we fall back to unsetting it whenever we
  need to - before opening a capture or when shutting down the remote
  server (in case after capturing, no frame capture was actually opened)
* This means that if the UI crashes without unsetting it, we will poison
  the state, but this seems unavoidable.
2018-02-09 14:02:31 +00:00
baldurk 427a89db0b Create parent directory for file transfers to remote server 2018-02-01 18:25:31 +00:00
baldurk 5527c57e68 Split out some miscellaneous utility functions
* We also wrap up and cache the fetching of friendly names by serial
  number to avoid some adb traffic.
2018-01-26 16:30:16 +00:00
baldurk ae7300e524 Move android files to separate subfolder 2018-01-26 15:49:09 +00:00
baldurk b22f93f458 Avoid remote server timing out if starting android packages.
* Android::StartAndroidPackageForCapture can take a long time, and we
  want to preserve the connection, so we spin up a temporary thread to
  continually Ping().
2018-01-26 15:42:15 +00:00
baldurk 91dbfc4cc6 Ensure we tidy up progress ticker and callback even if replay fails 2018-01-22 20:04:17 +00:00
baldurk e305029ddd Update copyright years to 2018 2018-01-01 17:55:29 +00:00
baldurk 96e39cb781 Add a preview window ability to remote servers. Always on for android
* On android in particular this shows some sense of what's happening on
  the device and gives user feedback that it's not completely dead.
2018-01-01 17:31:23 +00:00
baldurk 7a2305ae31 Change by-ref passed float or bool parameters to callbacks in public API
* Mostly used for passing a progress float back during a long blocking
  call like opening a capture or doing a copy.
* This is much more feasible for python to bind to.
* In several cases we just use a tiny lambda that updates a float anyway
  since we can't push the progress directly into a progress dialog, but
  need to let it query from a temporary in-between float.
2018-01-01 17:31:23 +00:00
baldurk beaa642f73 Remove bool parameter to InitResolver to cancel resolving 2018-01-01 17:31:20 +00:00
baldurk ed98925eef Generalise progress tracking to allow multiple progress updates
* We track the progress through making a capture as well as the progress
  we already tracked loading a capture.
* Also incidentally fix a copy-paste bug that was calculating the wrong
  progress for loading captures by applying FileInitialRead instead of
  FrameEventsRead for the frame replay.
2017-12-29 18:30:40 +00:00
baldurk 184e5c7f8d Change RDCDriver to enum class, don't manually stringify anywhere 2017-12-29 18:30:35 +00:00
baldurk 669fa9dc40 Expose the total number of sections via ICaptureAccess
* This lets external code iterate over all sections.
2017-12-20 18:01:20 +00:00
baldurk 26d879df12 Hide renderdoc's packages from enumerated list 2017-12-14 16:46:59 +00:00
baldurk e189ae030c Remove the need for a preceeding / on android (Allow empty root path) 2017-11-29 19:01:23 +00:00
baldurk 413a06b299 Change stream I/O behaviour around sockets
* Previously each read and write would 1:1 become a send or recv call.
* Now we buffer writes and send in batch (or when a chunk finishes),
  and every time we read we try to non-blocking read more data to fill
  the buffer, to allow batching reads where possible without blocking
  on data that will never come.
2017-11-27 18:54:19 +00:00
baldurk 01e2e00b5f Add error checking and handling while loading captures
* Previously once we started loading a capture we'd blindly continue
  until we loaded it (and then it's assumed to be successful), or we
  crash.
* Now errors can be reported during serialisation and bubbled up to
  abort the file load process. The next steps are to add error checking
  in each function serialise before doing any replay calls to the API
  with potentially corrupt data, and on top of that catching API-only
  errors when the serialisation is (seemingly) fine, and propagating
  those in a reasonable way.
* We also harden the serialisation a bit so that if it reads an
  obviously invalid byte length for a buffer or array count, it won't
  continue. It's still not perfect as the sizes could still be large and
  invalid but within range, but it should catch the worst cases.
2017-11-24 18:14:21 +00:00
baldurk 43d561a4c0 Fix NULL checking and NULL dereferencing issues
* Reported by Coverity Scan - most of these are not an issue and a
  couple of them are coverity getting really confused (like seeing a
  pointer being assigned to NULL and a count to 0, then a few lines
  later declaring that a loop 0..count will dereference the pointer).
* However it's harmless in all cases to add a bit of robustness to keep
  the analysis happy.
2017-11-22 19:11:21 +00:00
baldurk 2e508adb43 Fix compile issue about mismatched override/non-override in class 2017-11-17 17:52:15 +00:00
baldurk bb6452c334 Expand IStackResolver into ICaptureAccess to allow section read/write 2017-11-17 16:31:01 +00:00
baldurk 7ca6c80414 Add ability to convert a capture to structured data without replaying 2017-11-08 18:24:22 +00:00
baldurk 536c467b46 Convert remote server to new serialisation and replay initialisation 2017-11-07 19:30:37 +00:00
baldurk dc6f11f07b Remove socket_helpers.h - serialiser can now write directly to socket 2017-11-07 19:30:32 +00:00
baldurk 3aa3262089 Expose ToStr interface publicly, split out into separate files
* Note that while this is public and uses std::string, because it's a
  template with specialisations in a .inl the string never crosses a
  module boundary - each including module has its own implementation.
* This will be used as part of the upcoming serialisation refactor.
* Some POD structs are still given ToStr implementations as we haven't
  yet switched over the serialisation system to expect all structs to
  have serialise functions.
2017-11-03 16:23:02 +00:00
baldurk 276783b948 Move custom printf & string_utils out of serialise/ folder 2017-11-03 16:07:46 +00:00
baldurk e6c5c03896 Remove rdctype namespace. Rename rdctype::str -> rdcstr, rdcarray, etc
* Since these types are more prevalent than originally designed, it
  makes more sense to remove the namespace for ease of typing/naming.
* Also add a specialised type 'bytebuf' for an array of bytes.
* This makes mapping easier to SWIG since there's no special casing for
  namespaced arrays. Especially so for nested cases like
  rdctype::array<rdctype::str> -> rdcarray<rdcstr>
2017-11-03 16:04:59 +00:00
baldurk 5e59616a8c Update rdctype::array to have a more stl-like mutable interface
* For the most part the interface is stl-compatible, but we have a few
  little changes of our own for convenience.
* This class is still needed after deleting the C# UI, because we don't
  want to pass C++ stl structs over module boundaries and possibly run
  into hard to diagnose incompatibilities.
2017-11-03 16:01:58 +00:00
baldurk d3d35ee216 Change thread creation type to std::function to allow lambdas 2017-09-29 12:11:13 +01:00
baldurk 40a0272a3e Remove use of bool32 replay API type&optimise mem layout in some structs 2017-08-24 10:44:45 +01:00
baldurk 2053f21462 Move android code into separate file for organisation's sake 2017-08-18 19:37:15 +01:00
baldurk bc98513088 Remove C entry points for C++ API - only used by P/Invoke C# access 2017-08-18 19:37:14 +01:00
Cody Northrop e0dfdedb24 android: Add execCommand and update adbExecCommand
This adds a convenient way to call out to commands other than adb
and see their result.  Updated adbExecCommand to use the new helper.
2017-07-21 10:29:46 -07:00
baldurk 6423a82d18 Add support for multiple connected android devices
* We forward a different range of ports to each device so we can pick
  and choose which to communicate with based on its index.
* The index is encoded in the 'hostname' like so: adb:X:deviceidhere
* Whenever we want to interact with an android device we always specify
  the device, never leave it to a default.
2017-06-15 05:28:07 -07:00
baldurk 6a0538dcd4 Fix mismatched serialising on remote server code, std::vector both sides 2017-05-18 11:18:45 +01:00
baldurk 6930841705 Rename ReplayRenderer to ReplayController
* It's not a renderer, it's an interface to controlling the replay and
  any 'renderer' type work actually happens in ReplayOutput.
2017-04-18 14:57:47 +01:00
baldurk bc79e2296f Make EnvironmentModification struct and pass around array directly
* The old 'store in opaque void*' is kept as entry point wrappers only
  for the C# UI.
2017-04-18 14:57:47 +01:00
baldurk f6c045f473 Refactor public interface to be less strict C and more python friendly
* Generally this means removing ref out parameters and instead returning
  values. In a couple of cases we will want to avoid copies in future
  either by returning const references (e.g. to the pipeline state which
  is immutable).
* At the same time, some pointless bool return values that were always
  true and didn't indicate errors have been removed. They can be added
  again if an error condition comes back.
* Some free functions still have out parameters as C linkage doesn't
  allow returning user types by value.
* The C# UI still invokes into C wrappers for all the C++ classes, which
  handle taking the return value and doing a copy into an out parameter
  still for compatibility.
2017-04-18 14:57:46 +01:00
baldurk 587fba0b68 Rename DirectoryFile/FileProperty to Path, and re-use struct in OS code
* They describe directories or files, and really describe a single path
  on the remote system.
2017-04-18 14:57:38 +01:00
baldurk d40fc8471d Change API enums to enum class, remove now redundant prefixing
* This gives a little nicer syntax, a bit better type safety, and also
  reflects better for SWIG bindings. Overall it's a minor change but
  better.
* We don't update the C# UI at all, since it's soon to be removed and
  not worth the effort/code churn.
* For now so we're ABI compatible with C#, all enums are uint32_t, but
  that is an obvious optimisation in future to reduce struct packing.
* We avoid 'None' as an enum value, because it's a reserved word in
  python so will cause problems generating bindings.
2017-04-18 14:57:33 +01:00
baldurk 487a1b7903 Start moving towards C++ only UI code. Assume C++ for the replay API
* The C# P/Invoke stuff doesn't directly use the header, and we are soon
  going to deprecate the C interface entirely.
2017-03-13 17:56:00 +00:00
Michael Rennie eb6db1dcc5 Move host adb: check into ExecuteAndInject(), so qrenderdoc has it too. 2017-03-09 19:13:24 +00:00
baldurk e896233284 Fetch file size and last modified data when enumerating remote files 2017-02-09 19:28:22 +00:00
baldurk 030cbfde9a Batch update copyright years everywhere 2017-01-06 12:13:31 +00:00
Michael Rennie d249faacd3 Test Android target connection for up to MaxConnectTimeout seconds.
Added new setting to SettingsDialog, and passed it to native code via
RenderDoc::Inst().GetConfigSetting("MaxConnectTimeout")
2016-12-24 19:22:10 +00:00
Michael Rennie bcb9914665 Start remoteserver and captured packages by adb commands in native code.
Use adb to enumerate installed 3rd party packages in capture dialog.
Cleaned up all the "adb:" strcmp's.
2016-11-02 16:10:29 +01:00
Michael Rennie ab71450fb0 Add offset to Android network ports, to differentiate from localhost.
This requires adb forward to include the offset, for example:
adb forward tcp:38970 tcp:38920
adb forward tcp:39970 tcp:39920
2016-09-15 13:42:05 +01:00
baldurk c9eeef3151 [Coverity] Add proper NULL check before comparison 2016-09-14 17:41:14 +02:00
baldurk 4dc9857341 detect adb: (invalid in normal hostname) as android remote target
* For now, just redirect to 127.0.0.1 and assume the user has proper
  port forwarding set up, but in future we'd do this ourselves and maybe
  parse out a device name after the adb:
2016-09-12 20:05:51 +02:00