loggerd: switch to v4l encoder try 2 (#24380)
* start v4l encoder
* v4l encoder starts
* start and stop
* fill in proper controls
* it dequeued a buffer
* getting bytes
* it made a video
* it does make files
* getting close
* ahh, so that's how dequeue works
* qcam works (no remuxing)
* remuxing works
* we just need to make shutdown and rollover graceful
* graceful destruction
* switch to polling
* should work now
* fix pc build
* refactors, stop properly
* touchups, remove a copy
* add v4l encoder to release
* inlcude file
* move writing to it's own thread
* fix minor memory leak
* block instead of dropping frames
* add counter, fix tests maybe
* better debugging and test print
* print file path in assert
* format string in test
* no more oversized qlogs
* match qcam
* touchups, remove omx encoder
* remove omx include files
* checked ioctl, better debugging, open by name
* unused import
* move linux includes to third_party/linux/include
* simple encoderd
* full packet
* encoderd should be complete
* lagging print
* updates
* name dq thread
* subset idx
* video file writing works
* debug
* potential bugfix
* rotation works
* iframe
* keep writing support
* ci should pass
* loggerd, not encoderd
* remote encoder code
* support remote encoder
* cereal to master, add encoderd
* header no longer required
* put that back there
* realtime
* lower decoder latency
* don't use queue for VisionIpcBufExtra, disable realtime again
* assert all written
* hmm simpler
* only push to to_write if we are writing
* assert timestamp is right
* use at and remove assert
* revert to queue
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 0baa4c3e2ad9ee6f8daba8267db44c2cd44caa62
2022-04-30 09:22:52 -07:00
|
|
|
Import('env', 'arch', 'cereal', 'messaging', 'common', 'visionipc')
|
2021-01-20 04:16:12 +08:00
|
|
|
|
2022-02-06 14:08:02 -08:00
|
|
|
libs = [common, cereal, messaging, visionipc,
|
2021-04-08 11:17:07 -07:00
|
|
|
'zmq', 'capnp', 'kj', 'z',
|
2021-01-07 23:08:40 -08:00
|
|
|
'avformat', 'avcodec', 'swscale', 'avutil',
|
2022-05-03 14:09:17 +02:00
|
|
|
'yuv', 'OpenCL', 'pthread']
|
2020-01-17 11:20:17 -08:00
|
|
|
|
2022-09-23 01:41:09 +08:00
|
|
|
src = ['logger.cc', 'video_writer.cc', 'encoder/encoder.cc', 'encoder/v4l_encoder.cc']
|
|
|
|
|
if arch != "larch64":
|
2022-05-10 15:20:51 -07:00
|
|
|
src += ['encoder/ffmpeg_encoder.cc']
|
2020-01-17 11:20:17 -08:00
|
|
|
|
2021-01-08 14:54:25 +01:00
|
|
|
if arch == "Darwin":
|
|
|
|
|
# fix OpenCL
|
|
|
|
|
del libs[libs.index('OpenCL')]
|
|
|
|
|
env['FRAMEWORKS'] = ['OpenCL']
|
|
|
|
|
|
2022-02-06 14:08:02 -08:00
|
|
|
logger_lib = env.Library('logger', src)
|
|
|
|
|
libs.insert(0, logger_lib)
|
|
|
|
|
|
2022-05-13 17:56:02 -07:00
|
|
|
env.Program('loggerd', ['loggerd.cc'], LIBS=libs)
|
2022-05-10 15:20:51 -07:00
|
|
|
env.Program('encoderd', ['encoderd.cc'], LIBS=libs)
|
2021-01-20 04:16:12 +08:00
|
|
|
env.Program('bootlog.cc', LIBS=libs)
|
2021-08-31 08:12:09 +08:00
|
|
|
|
|
|
|
|
if GetOption('test'):
|
2022-05-13 17:56:02 -07:00
|
|
|
env.Program('tests/test_logger', ['tests/test_runner.cc', 'tests/test_logger.cc'], LIBS=libs + ['curl', 'crypto'])
|