mirror of
https://github.com/pikvm/ustreamer.git
synced 2025-12-23 18:50:00 +00:00
refactoring
This commit is contained in:
parent
6475eeef4c
commit
646afbffff
@ -162,8 +162,8 @@ int us_drm_open(us_drm_s *drm, const us_device_s *dev) {
|
||||
}
|
||||
|
||||
run->unplugged_reported = false;
|
||||
run->stub = (stub > 0);
|
||||
_D_LOG_INFO("Opened for %s ...", (run->stub ? "STUB" : "DMA"));
|
||||
run->opened_for_stub = (stub > 0);
|
||||
_D_LOG_INFO("Opened for %s ...", (run->opened_for_stub ? "STUB" : "DMA"));
|
||||
return stub;
|
||||
|
||||
error:
|
||||
@ -298,7 +298,7 @@ int us_drm_expose_stub(us_drm_s *drm, us_drm_stub_e stub, const us_device_s *dev
|
||||
us_drm_runtime_s *const run = drm->run;
|
||||
|
||||
assert(run->fd >= 0);
|
||||
assert(run->stub);
|
||||
assert(run->opened_for_stub);
|
||||
|
||||
switch (_drm_check_status(drm)) {
|
||||
case 0: break;
|
||||
@ -367,7 +367,7 @@ int us_drm_expose_dma(us_drm_s *drm, const us_hw_buffer_s *hw) {
|
||||
us_drm_buffer_s *const buf = &run->bufs[hw->buf.index];
|
||||
|
||||
assert(run->fd >= 0);
|
||||
assert(!run->stub);
|
||||
assert(!run->opened_for_stub);
|
||||
|
||||
switch (_drm_check_status(drm)) {
|
||||
case 0: break;
|
||||
|
||||
@ -62,11 +62,11 @@ typedef struct {
|
||||
uint n_bufs;
|
||||
drmModeCrtc *saved_crtc;
|
||||
int dpms_state;
|
||||
bool opened_for_stub;
|
||||
bool has_vsync;
|
||||
uint stub_n_buf;
|
||||
bool stub;
|
||||
us_frametext_s *ft;
|
||||
bool unplugged_reported;
|
||||
us_frametext_s *ft;
|
||||
} us_drm_runtime_s;
|
||||
|
||||
typedef struct {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user