Commit Graph

139 Commits

Author SHA1 Message Date
Willem Melching 6cafad7e30 route.cc: include <array>
old-commit-hash: b379fca0ae9d6046658d2a11f71462090aadfcbc
2022-04-06 07:34:11 -07:00
Willem Melching 619b88c1f4 api.cc: expose error type in requestDone signal (#24064)
* put error in requestDone

* only check in tools
old-commit-hash: 34a8a5ea76d05432ee24f5d2a2307b74ad755971
2022-03-30 12:12:33 +02:00
Cameron Clough b4cc54b278 replay: fix wrong format code in print (#24006)
old-commit-hash: 602cbfcba0ff005e5847e846a4e1c9ae5881c84b
2022-03-20 16:53:42 -07:00
Gijs Koning cedd8abc05 Rename RGB vision streams to match YUV streams (#23961)
* Renaming VISION_STREAM_RGB_.. to match yuv names like VISION_STREAM_ROAD
VISION_STREAM_RGB_BACK -> VISION_STREAM_RGB_ROAD
VISION_STREAM_RGB_FRONT -> VISION_STREAM_RGB_DRIVER

* little more

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 57b6fdc17a1f84ec922647c044da5df3cafc0ddc
2022-03-14 14:03:54 -07:00
Willem Melching 760564da61 replay: use VideoToolbox HW decoder on Mac (#23832)
* replay: support VideoToolbox HW decoding

* rename flag

* remove debug assert
old-commit-hash: dc7de79dc9d546465030acab1df1d9cc36e1d4d6
2022-02-23 13:52:50 +01:00
Willem Melching 33a4fda7fd replay: use QCoreApplication (#23831)
old-commit-hash: df88280e0fa2f3b7799c48306c6ce9abdf3ebfb4
2022-02-23 13:34:31 +01:00
Willem Melching d4f372cfd7 Update raw_logger/framereader to new new ffmpeg api (#23799)
* Update raw_logger/framereader to new new ffmpeg api

* Can be removed now

* Handled by avcodec_free_context

* handle EAGAIN and clean up
old-commit-hash: 724bab8ef3aaad2c69b53fafc68f7afa0ebbe659
2022-02-21 16:39:32 +01:00
Dean Lee fab73e6e9f remove trailing whitespaces (#23716)
old-commit-hash: 786152f0f125f9c78dc129cab8f24a98d93f36a1
2022-02-06 10:42:41 -08:00
Jonathan Frey 9ae66079f7 replay: fix pause key doc (#23697)
old-commit-hash: a39e635b5ce271738504abaa84d060c7b26206c0
2022-02-03 09:59:07 -08:00
Dean Lee 1dae4aef54 replay: fix wrong logging for local route (#23652)
old-commit-hash: fa3a787e9a1294f1d0521d0c4bd27e952bb1d381
2022-01-28 12:03:19 -08:00
Dean Lee 212935863a replay: add test case for local route (#23650)
* add test for local route

* retry download on network error

* sleep 500ms before retry

* read 100 frames

* read more segments from route

* add REQUIRE
old-commit-hash: 520c99a050bba537e0b39e311b19f4fe22cf7ee9
2022-01-28 12:02:29 -08:00
Dean Lee d6292e7c08 replay: cleanup functions (#23655)
* cleanup function seek

* cleanup signals&slots

* use false

* add comment back
old-commit-hash: 2f9144138243b18ddd22eb541dd98f0a166e8cb4
2022-01-28 12:02:11 -08:00
Dean Lee 99198156e3 log error on avcodec_receive_frame (#23649)
old-commit-hash: a901104a96b3df7131d7ff7b0dac490e230bf6b5
2022-01-27 19:35:18 -08:00
Dean Lee c8b528e850 replay: ncurses GUI (#23608)
* initial version

* print all message's in ncurses window

* show download progress bar

* move all to class ConsoleUI

* timeline

* improve timeline&stats

* fix logMessage

* add warning indicator

* continue

* cleanup

* cast type to int

* simplify seekToFlag

* more

* <=

* handle enter

* add box to logging window

* fix multiple threads problem

* fix concurrency issues

* draw indicator

* many improvements

* more

* fix multipe threads logging

* stop replay before exit

* use lambda instead of std::bind

* cleanup

* small cleanup

* use carFingerPrint

* don't emit signal in replay::stream

* merge car_events into timeline

* cleanup DonloadStats

* cleanup

* rename carname to carFingerprint

* improve alert

* add comments

* add help functions

templete function

* handle term resize

* display replaying status

* rename to INSTANT

* helper function pauseReplay

* more

* cleanup

use rDebug

* no template

* less colors

* remove function mv_add_str

* use BORDER_SIZE

* tune colors

* add spaces

* apply reviews

use /
old-commit-hash: 3ca8e3653b4dd7552c2cca6d3eb6ed76c98240be
2022-01-27 13:17:41 -08:00
Dean Lee 1f0b5a6bc0 replay: handle abort in getRemoteFileSize (#23427)
old-commit-hash: 86d730774de0b18ba2541490df4733d922d6291d
2022-01-06 15:56:14 +01:00
Cameron Clough 6d714fb21a replay: add missing import for std::optional (#23416)
old-commit-hash: 64caee88ebf3d3fe99a2baf7021a93e4ecd79a66
2022-01-05 09:19:51 -08:00
Dean Lee 10ce89d1ae replay: Add next engagement / disengagement jump capabilities (#23248)
* seek engament/disengament in qlogs

* cleanup

* cleanup

* little more

* add output

* remove qinfo

* fix typo

* do nothing if tm less than current mono time

* const

* short variable name

* lgtm
old-commit-hash: d2948f250b0c62e22f23e4067f460ce7108da2df
2022-01-04 16:02:04 +01:00
Dean Lee 84481c134b replay/logreader: handle abort in load (#23321)
* handle abort

* handle abort in decompressBZ2
old-commit-hash: 937a0df57bd0469af49b7bb4f44ca5ea3c4ae881
2022-01-04 12:06:23 +01:00
Dean Lee fef9d05507 replay tests: retry on network failure (#23383)
old-commit-hash: 8dd8b1905bec171995f1eab331e69969bae444df
2022-01-03 20:10:57 -08:00
Dean Lee 2a3a9e0bef replay: add flag to disable video (#23353)
old-commit-hash: 1e309a51f53a7678f42f40010fb0371b20c2f213
2022-01-02 11:54:49 -08:00
Dean Lee ed55910aa9 replay/segment: pass member function pointer to QtConcurrent::run (#23312)
old-commit-hash: 58a363e07d640938e74f938d14dfc5beb6fa1036
2021-12-28 11:38:31 +01:00
Dean Lee 9191452120 replay: add flag REPLAY_FLAG_FULL_SPEED to play at full speed (#23324)
* add flag REPLAY_FLAG_FULL_SPEED

* use hasFlag
old-commit-hash: de6126ba06fc27978237a70049e444412ed22fce
2021-12-28 11:37:33 +01:00
Dean Lee 1860d9c18c replay/util: initialize curl at startup (#23314)
old-commit-hash: 21fc9d537548f7694177f8bb3a1e31cb94995624
2021-12-27 13:22:42 -08:00
Dean Lee 446e59d10f replay: fix segfault or hanging on quit (#23323)
old-commit-hash: c9da1403bcb4491db0fd9ee9e2e921c630ad96a9
2021-12-27 13:02:18 -08:00
Dean Lee 7c71bc1b98 replay/camera: use existing YUV_BUFFER_COUNT (#23297)
old-commit-hash: 94e435cededb90ff9215e1ecd9d0fa0dcfaf365e
2021-12-22 20:36:16 -08:00
George Hotz 6bac4f1c4a build for mac (#23048)
old-commit-hash: 16dd7ce1fe2a2b0537fefd5ad131d1494d0d09ad
2021-12-18 22:00:09 -08:00
Dean Lee 20c50f8f51 framereader: use the same alignement as visionbuf (#23208)
* aligned rgb buffer

* fix yuv stride
old-commit-hash: 768cfdb92a70f30435cf4c4ab1de083d8fbe6491
2021-12-15 16:19:07 -08:00
Dean Lee 066528dc2b replay: use std::unique_ptr to manage memory, reuse events buffer. (#23049)
* reuse events buffer

* Trigger Build
old-commit-hash: 8a84263c2d20484d83c30f1928c0312d7fa8a350
2021-12-13 15:22:31 +01:00
Dean Lee 9b0fcaeb84 rename yuv streams (#23071)
* rename yuv streams

* bump cereal

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 348d2d2b0d169b0d181a51eb0e23b1f9b8fc6793
2021-11-29 18:14:59 -08:00
Dean Lee 71c282d42a logreader: support reading from corrupt log (#23050)
* catch exception outside loop

* print decompress error

* add test case for corrupt log

* fix decompressbz2 stuck if log is corrupt

* recovered from corrupt data

* add output

* ass space

* std::endl

* override load(), load from buffer

* override FrameReader::load to load from the buffer

* replace NULL with nullptr

* fix test case for corrupt log

* Trigger Build

* check bzerror too

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: dbec761941c7599591fb59e9bb9f74b4f8cab2f7
2021-11-29 14:10:24 +01:00
Dean Lee c6ae32ecb3 framereader: refactor seeking (#22926)
* refactor seeking

* ckeck packets.empty()

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 296c4076a2ae8dfdcae5f300c922eac7d1df69cc
2021-11-29 12:09:14 +01:00
Dean Lee 67c748d62a refactor httprequest: emit single signals (#23039)
* refactor httprequest

* Trigger Build
old-commit-hash: 3fd02649601856b2780168d36c49940ff49f4de2
2021-11-29 11:19:08 +01:00
Dean Lee 43812ae898 replay: refactor http download (#23052)
* refactor http download

* use chunk_size instead of parts

testcase:set chunksize to 5mb

* use template

space

* cleanup

* remove unused include

* check buffer overfllow

* simplify print download speed
old-commit-hash: f5e48678640bbde0f2616e955ced53f30d61ac6c
2021-11-29 11:13:30 +01:00
Dean Lee 4ac4b61272 framereader: fix crash after fallback to cpu decoding (#23055)
old-commit-hash: a449b856cac746647ad994eb511600929d529498
2021-11-28 13:29:40 -08:00
Dean Lee e308bc0a3f framereader: replace swscale with libyuv, reduce cpu usage by half (#22992)
* use libyuv

* cleanup
old-commit-hash: 5ae51745097e3245c541456029fbc0fcce63a3c3
2021-11-26 14:41:14 +01:00
Dean Lee 8f9ca8d3f6 replay: add test to check dcam and ecam (#22993)
old-commit-hash: 1d2dfab81c60e48ebaeabe01efe74222190a7071
2021-11-20 18:56:27 -08:00
Dean Lee 2d8780e5c6 logreader: fix memory leak in Event (#22987)
old-commit-hash: 9cb46cc4a12063c0ec27e9cf932cb8f7a10ed63a
2021-11-20 11:12:52 +01:00
Dean Lee 816fbec7ab replay: fix swsscale crash on nv12->yuv conversion (#22961)
old-commit-hash: ddea21e6482a16cb80c772f5a4fd0a19a038d393
2021-11-17 20:04:45 -08:00
Dean Lee e72feb1263 framereader: remove memory copy overhead for AVIO (#22894)
* no memory copy

* merge master

better
old-commit-hash: dc8e23c94b29a8c26cc377f8649e497f33036c33
2021-11-17 13:25:40 +01:00
Dean Lee 0c26c21c9c framereader: support hardware decoding (#22906)
* support hardware accelerated video decoding

* support cuda only

* print decode info

* add yuv flag back

* fix height

* default is cuda

* fallback to CPU decoding

fix memory leak&cleanup

add output
old-commit-hash: 20d3cf1fcb3d5c64d438426b0706b2478b72e3d7
2021-11-17 11:17:59 +01:00
Dean Lee e0fa9b7909 framereader: remove deprecated ffmpeg functions (#22895)
old-commit-hash: c0b9c1f3afed048f7ae54d9ffe872e0a41b79968
2021-11-13 11:55:04 -08:00
Dean Lee 1e67fc25f1 replay: add qcam and YUV flags (#22788)
* common flags

* cleanup

* remove double semicolon

* camera

* apply reviews
old-commit-hash: fb8ba34f3103513705de2cb6397796b38a0c0689
2021-11-09 14:08:24 -08:00
Dean Lee 7ff2217c8b util: remove function to_hex (#22792)
old-commit-hash: ff33ca341382be19a4be9bd71b97af1b01b553c7
2021-11-04 16:18:01 +01:00
Mayfield 43e1903073 enable wshadow (#22756)
* enable wshadow (#22714)

* fix replay

* more build fixes

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 5246f0231e6bfa572c0dd89c60e538910817faa2
2021-11-02 17:08:53 +01:00
Dean Lee 5f454307fc replay: fix qcam download error (#22777)
* fix qcam download error

* test loading qlog/qcamera
old-commit-hash: 79651b6c4917415c11d1b462a87e1e18853d6e68
2021-11-02 11:24:59 +01:00
Dean Lee 526cfdd0fb replay: print colored text (#22771)
old-commit-hash: 09858f7f6f890ed43a4410412f6a9e9165b93847
2021-11-02 11:24:45 +01:00
Dean Lee 07ffd9c095 replay: fix frame lag when replaying to the next segment (#22773)
old-commit-hash: 0a5ca716030025f4164109702d8a29429911748d
2021-11-02 11:24:12 +01:00
Willem Melching 86e72f88c3 framereader.cc: better avformat_open_input error printing
old-commit-hash: f8d050298ecf969e1890fe10120ee0a748ed7eba
2021-11-02 09:56:49 +01:00
Dean Lee 993aa64067 replay: fix hanging on exit if stream thread has not been started yet (#22770)
old-commit-hash: 6f78cc77fc7bbc8e9d9efc5e9ae7e66dfeb06940
2021-11-01 16:06:39 -07:00
Dean Lee a031b938b0 replay: improve segment download and merge (#22654)
* no-cache mode

* fix test cases build error

* space

* don't create cache dir in no-cache mode

* fix errors in test cases

* no_local_cache_

* set the number of connections by chunk_size

* use size_t instead of int64_t

* add test case for no-cache mode

* rename variables

* fix SIGSEGV

* cleanup

* faster decompressBZ2

* always decompress bz2

* add test cases

* prepare for python interface

* fix test cases build error

* continue

* camera_replay: cache remote file

* protected inheritance

* single option name

* TODO

* test_case for LogReader&FrameReader

* fix wrong require

* test case for FileReader

* cleanup test

* test:fix wrong filename

* check cached file's checksum

* fix mkdir permissions err

cleanup filereader

* remove initialize libav network libraries.

dd

* abort all loading if one failed

* cleanup tests

* use threadpool to limit concurrent downloads

* cache more segments

* merge 3 segments for replay

* one segment uses about 100M of memory

* use segments_need_merge.size()

* shutdown

* fix stuck if exit replay  before keyboard thread started

* load one segment at a time

* small cleanup

* cleanup filereader

* space

* tiny cleanup

* merge master

* cleanup test cases

* use util:create_directories

* cleanup framereader
old-commit-hash: 2b4a477fbc8fc02da5876aee4f955194916f19a3
2021-11-01 11:55:56 +01:00