Match the GigabyteLib event model
Compared with 82933f8:
- remove the public event-mask setter, getter, mask type, exports, and per-channel mask state
- always register and forward the complete event set created by GvfgCreateEvents
- keep audio enablement as the only event-creation choice exposed to applications
- preserve event polling, signal recovery, format notifications, capture, format switching, zero-copy, and register access
- update customer and architecture documentation to remove the obsolete event-mask controls
This commit is contained in:
@@ -305,12 +305,11 @@ gvfg_status_t GigabyteCaptureSession::get_audio_format(GigabyteAudioInfo &out) c
|
||||
}
|
||||
|
||||
gvfg_status_t GigabyteCaptureSession::set_event_callback(
|
||||
GigabyteEventCallback callback, void *user, uint32_t eventMask)
|
||||
GigabyteEventCallback callback, void *user)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(callback_mutex_);
|
||||
event_callback_ = callback;
|
||||
event_callback_user_ = user;
|
||||
event_mask_filter_ = eventMask;
|
||||
return GVFG_OK;
|
||||
}
|
||||
|
||||
@@ -590,12 +589,7 @@ void GigabyteCaptureSession::event_thread_proc()
|
||||
void GigabyteCaptureSession::emit_event(gvfg_event_type_t type) const
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(callback_mutex_);
|
||||
uint32_t bit = 0;
|
||||
if (type == GVFG_EVENT_SIGNAL_CONNECTED) bit = GVFG_EVENT_MASK_SIGNAL_CONNECTED;
|
||||
if (type == GVFG_EVENT_SIGNAL_DISCONNECTED) bit = GVFG_EVENT_MASK_SIGNAL_DISCONNECTED;
|
||||
if (type == GVFG_EVENT_STREAM_READY) bit = GVFG_EVENT_MASK_STREAM_READY;
|
||||
if (type == GVFG_EVENT_FORMAT_CHANGE_BEGIN) bit = GVFG_EVENT_MASK_FORMAT_CHANGE_BEGIN;
|
||||
if (event_callback_ && (event_mask_filter_ & bit) != 0)
|
||||
if (event_callback_)
|
||||
event_callback_(type, event_callback_user_);
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace gvfg::internal
|
||||
gvfg_status_t get_device_capabilities(gvfg_device_capabilities_t &out) const;
|
||||
gvfg_status_t get_sdi_info(gvfg_sdi_info_t &out) const;
|
||||
gvfg_status_t get_audio_format(GigabyteAudioInfo &out) const;
|
||||
gvfg_status_t set_event_callback(GigabyteEventCallback callback, void *user, uint32_t eventMask);
|
||||
gvfg_status_t set_event_callback(GigabyteEventCallback callback, void *user);
|
||||
gvfg_status_t configure_stream();
|
||||
gvfg_status_t start_stream();
|
||||
gvfg_status_t stop_stream();
|
||||
@@ -96,7 +96,6 @@ namespace gvfg::internal
|
||||
mutable std::mutex callback_mutex_;
|
||||
GigabyteEventCallback event_callback_ = nullptr;
|
||||
void *event_callback_user_ = nullptr;
|
||||
uint32_t event_mask_filter_ = GVFG_EVENT_MASK_ALL;
|
||||
mutable std::mutex state_mutex_;
|
||||
std::vector<uint8_t> copy_buffer_;
|
||||
bool frame_held_ = false;
|
||||
|
||||
Reference in New Issue
Block a user