aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2022-05-05 11:37:24 +0900
committer坂本 貴史 <o-takashi@sakamocchi.jp>2022-05-05 16:09:50 +0900
commit985a21ca90edc350f043521d46f3499b631b40e5 (patch)
tree5d62e9984d33486e28405c62b295ccea8dfe30c0
parent2cfc1bddb11d40477844f8f50c8c66c0799fb17f (diff)
downloadlibhinoko-985a21ca90edc350f043521d46f3499b631b40e5.tar.gz
fw_iso_ctx: obsolete instance private data to deligate ownership to derived objects
This commit is for preparation to make Hinoko.FwIsoCtx as GObject Interface. The interface can not have private data in instance level. The data should be owned by classes implementing the interface. This commit obsoletes such private data in Hinoko.FwIsoCtx so that the derived object classes own it. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-rw-r--r--src/fw_iso_ctx.c280
-rw-r--r--src/fw_iso_ctx.h1
-rw-r--r--src/fw_iso_ctx_private.h32
-rw-r--r--src/fw_iso_rx_multiple.c85
-rw-r--r--src/fw_iso_rx_multiple.h1
-rw-r--r--src/fw_iso_rx_single.c78
-rw-r--r--src/fw_iso_rx_single.h1
-rw-r--r--src/fw_iso_tx.c78
-rw-r--r--src/fw_iso_tx.h1
-rw-r--r--src/hinoko.map5
10 files changed, 116 insertions, 446 deletions
diff --git a/src/fw_iso_ctx.c b/src/fw_iso_ctx.c
index e777cd3..591f6a7 100644
--- a/src/fw_iso_ctx.c
+++ b/src/fw_iso_ctx.c
@@ -12,9 +12,8 @@
* subsystem specific request commands. This object is designed for internal
* use, therefore a few method and properties are available for applications.
*/
-typedef struct fw_iso_ctx_state HinokoFwIsoCtxPrivate;
-G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE(HinokoFwIsoCtx, hinoko_fw_iso_ctx, G_TYPE_OBJECT)
+G_DEFINE_ABSTRACT_TYPE(HinokoFwIsoCtx, hinoko_fw_iso_ctx, G_TYPE_OBJECT)
/**
* hinoko_fw_iso_ctx_error_quark:
@@ -57,25 +56,7 @@ static guint fw_iso_ctx_sigs[FW_ISO_CTX_SIG_TYPE_COUNT] = { 0 };
static void fw_iso_ctx_get_property(GObject *obj, guint id, GValue *val, GParamSpec *spec)
{
- HinokoFwIsoCtx *self = HINOKO_FW_ISO_CTX(obj);
- const HinokoFwIsoCtxPrivate *priv = hinoko_fw_iso_ctx_get_instance_private(self);
-
- fw_iso_ctx_state_get_property(priv, obj, id, val, spec);
-}
-
-static void fw_iso_ctx_set_property(GObject *obj, guint id, const GValue *val,
- GParamSpec *spec)
-{
- G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, id, spec);
-}
-
-static void fw_iso_ctx_finalize(GObject *obj)
-{
- HinokoFwIsoCtx *self = HINOKO_FW_ISO_CTX(obj);
-
- hinoko_fw_iso_ctx_release(self);
-
- G_OBJECT_CLASS(hinoko_fw_iso_ctx_parent_class)->finalize(obj);
+ return;
}
static void hinoko_fw_iso_ctx_class_init(HinokoFwIsoCtxClass *klass)
@@ -83,8 +64,6 @@ static void hinoko_fw_iso_ctx_class_init(HinokoFwIsoCtxClass *klass)
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
gobject_class->get_property = fw_iso_ctx_get_property;
- gobject_class->set_property = fw_iso_ctx_set_property;
- gobject_class->finalize = fw_iso_ctx_finalize;
g_object_class_install_property(gobject_class, FW_ISO_CTX_PROP_TYPE_BYTES_PER_CHUNK,
g_param_spec_uint(BYTES_PER_CHUNK_PROP_NAME, "bytes-per-chunk",
@@ -124,98 +103,7 @@ static void hinoko_fw_iso_ctx_class_init(HinokoFwIsoCtxClass *klass)
static void hinoko_fw_iso_ctx_init(HinokoFwIsoCtx *self)
{
- HinokoFwIsoCtxPrivate *priv = hinoko_fw_iso_ctx_get_instance_private(self);
-
- fw_iso_ctx_state_init(priv);
-}
-
-gboolean fw_iso_ctx_handle_event_real(HinokoFwIsoCtx *inst, const union fw_cdev_event *event,
- GError **error)
-{
- return TRUE;
-}
-
-/**
- * hinoko_fw_iso_ctx_allocate:
- * @self: A [class@FwIsoCtx].
- * @path: A path to any Linux FireWire character device.
- * @mode: The mode of context, one of [enum@FwIsoCtxMode] enumerations.
- * @scode: The speed of context, one of [enum@FwScode] enumerations.
- * @channel: The numeric channel of context up to 64.
- * @header_size: The number of bytes for header of isochronous context.
- * @error: A [struct@GLib.Error].
- *
- * Allocate a isochronous context to 1394 OHCI controller. A local node of the
- * node corresponding to the given path is used as the controller, thus any
- * path is accepted as long as process has enough permission for the path.
- */
-void hinoko_fw_iso_ctx_allocate(HinokoFwIsoCtx *self, const char *path,
- HinokoFwIsoCtxMode mode, HinokoFwScode scode,
- guint channel, guint header_size,
- GError **error)
-{
- HinokoFwIsoCtxPrivate *priv;
-
- g_return_if_fail(HINOKO_IS_FW_ISO_CTX(self));
- priv = hinoko_fw_iso_ctx_get_instance_private(self);
-
- (void)fw_iso_ctx_state_allocate(priv, path, mode, scode, channel, header_size, error);
-}
-
-/**
- * hinoko_fw_iso_ctx_release:
- * @self: A [class@FwIsoCtx].
- *
- * Release allocated isochronous context from 1394 OHCI controller.
- */
-void hinoko_fw_iso_ctx_release(HinokoFwIsoCtx *self)
-{
- HinokoFwIsoCtxPrivate *priv;
-
- g_return_if_fail(HINOKO_IS_FW_ISO_CTX(self));
- priv = hinoko_fw_iso_ctx_get_instance_private(self);
-
- hinoko_fw_iso_ctx_unmap_buffer(self);
-
- fw_iso_ctx_state_release(priv);
-}
-
-/**
- * hinoko_fw_iso_ctx_map_buffer:
- * @self: A [class@FwIsoCtx].
- * @bytes_per_chunk: The number of bytes per chunk in buffer going to be allocated.
- * @chunks_per_buffer: The number of chunks in buffer going to be allocated.
- * @error: A [struct@GLib.Error].
- *
- * Map intermediate buffer to share payload of isochronous context with 1394 OHCI controller.
- */
-void hinoko_fw_iso_ctx_map_buffer(HinokoFwIsoCtx *self, guint bytes_per_chunk,
- guint chunks_per_buffer, GError **error)
-{
- HinokoFwIsoCtxPrivate *priv;
-
- g_return_if_fail(HINOKO_IS_FW_ISO_CTX(self));
- priv = hinoko_fw_iso_ctx_get_instance_private(self);
-
- (void)fw_iso_ctx_state_map_buffer(priv, bytes_per_chunk, chunks_per_buffer, error);
-}
-
-/**
- * hinoko_fw_iso_ctx_unmap_buffer:
- * @self: A [class@FwIsoCtx].
- *
- * Unmap intermediate buffer shard with 1394 OHCI controller for payload of isochronous context.
- */
-void hinoko_fw_iso_ctx_unmap_buffer(HinokoFwIsoCtx *self)
-{
- HinokoFwIsoCtxPrivate *priv;
-
- g_return_if_fail(HINOKO_IS_FW_ISO_CTX(self));
- priv = hinoko_fw_iso_ctx_get_instance_private(self);
-
- hinoko_fw_iso_ctx_stop(self);
-
- fw_iso_ctx_state_unmap_buffer(priv);
+ return;
}
/**
@@ -233,80 +121,11 @@ void hinoko_fw_iso_ctx_get_cycle_timer(HinokoFwIsoCtx *self, gint clock_id,
HinokoCycleTimer *const *cycle_timer,
GError **error)
{
- HinokoFwIsoCtxPrivate *priv;
-
g_return_if_fail(HINOKO_IS_FW_ISO_CTX(self));
g_return_if_fail(cycle_timer != NULL);
g_return_if_fail(error == NULL || *error == NULL);
- priv = hinoko_fw_iso_ctx_get_instance_private(self);
-
- (void)fw_iso_ctx_state_get_cycle_timer(priv, clock_id, cycle_timer, error);
-}
-
-/**
- * hinoko_fw_iso_ctx_set_rx_channels:
- * @self: A [class@FwIsoCtx].
- * @channel_flags: Flags for channels to listen to.
- * @error: A [struct@GLib.Error].
- *
- * Indicate channels to listen to for IR context in buffer-fill mode.
- */
-void hinoko_fw_iso_ctx_set_rx_channels(HinokoFwIsoCtx *self,
- guint64 *channel_flags,
- GError **error)
-{
- HinokoFwIsoCtxPrivate *priv;
- struct fw_cdev_set_iso_channels set = {0};
-
- g_return_if_fail(HINOKO_IS_FW_ISO_CTX(self));
- g_return_if_fail(error == NULL || *error == NULL);
-
- priv = hinoko_fw_iso_ctx_get_instance_private(self);
- g_return_if_fail(priv->mode == HINOKO_FW_ISO_CTX_MODE_RX_MULTIPLE);
-
- if (priv->fd < 0) {
- generate_local_error(error, HINOKO_FW_ISO_CTX_ERROR_NOT_ALLOCATED);
- return;
- }
-
- set.channels = *channel_flags;
- set.handle = priv->handle;
- if (ioctl(priv->fd, FW_CDEV_IOC_SET_ISO_CHANNELS, &set) < 0) {
- generate_syscall_error(error, errno, "ioctl(%s)", "FW_CDEV_IOC_SET_ISO_CHANNELS");
- return;
- }
- *channel_flags = set.channels;
-}
-
-/**
- * hinoko_fw_iso_ctx_register_chunk:
- * @self: A [class@FwIsoCtx].
- * @skip: Whether to skip packet transmission or not.
- * @tags: The value of tag field for isochronous packet to handle.
- * @sy: The value of sy field for isochronous packet to handle.
- * @header: (array length=header_length) (element-type guint8): The content of header for IT
- * context, nothing for IR context.
- * @header_length: The number of bytes for @header.
- * @payload_length: The number of bytes for payload of isochronous context.
- * @schedule_interrupt: schedule hardware interrupt at isochronous cycle for the chunk.
- * @error: A [struct@GLib.Error].
- *
- * Register data on buffer for payload of isochronous context.
- */
-void hinoko_fw_iso_ctx_register_chunk(HinokoFwIsoCtx *self, gboolean skip,
- HinokoFwIsoCtxMatchFlag tags, guint sy,
- const guint8 *header, guint header_length,
- guint payload_length, gboolean schedule_interrupt,
- GError **error)
-{
- HinokoFwIsoCtxPrivate *priv;
-
- g_return_if_fail(HINOKO_IS_FW_ISO_CTX(self));
- priv = hinoko_fw_iso_ctx_get_instance_private(self);
-
- (void)fw_iso_ctx_state_register_chunk(priv, skip, tags, sy, header, header_length,
- payload_length, schedule_interrupt, error);
+ HINOKO_FW_ISO_CTX_CLASS(self)->get_cycle_timer(self, clock_id, cycle_timer, error);
}
static gboolean check_src(GSource *source)
@@ -323,7 +142,6 @@ static gboolean check_src(GSource *source)
static gboolean dispatch_src(GSource *source, GSourceFunc cb, gpointer user_data)
{
FwIsoCtxSource *src = (FwIsoCtxSource *)source;
- HinokoFwIsoCtxPrivate *priv;
GIOCondition condition;
GError *error = NULL;
int len;
@@ -348,15 +166,10 @@ static gboolean dispatch_src(GSource *source, GSourceFunc cb, gpointer user_data
if (!src->handle_event(src->self, event, &error))
goto error;
- priv = hinoko_fw_iso_ctx_get_instance_private(src->self);
- if (!fw_iso_ctx_state_queue_chunks(priv, &error))
- goto error;
-
// Just be sure to continue to process this source.
return G_SOURCE_CONTINUE;
error:
hinoko_fw_iso_ctx_stop(src->self);
- g_signal_emit(src->self, fw_iso_ctx_sigs[FW_ISO_CTX_SIG_TYPE_STOPPED], 0, error);
g_clear_error(&error);
return G_SOURCE_REMOVE;
}
@@ -436,52 +249,11 @@ gboolean fw_iso_ctx_state_create_source(struct fw_iso_ctx_state *state, HinokoFw
*/
void hinoko_fw_iso_ctx_create_source(HinokoFwIsoCtx *self, GSource **source, GError **error)
{
- HinokoFwIsoCtxPrivate *priv;
-
- gboolean (*handle_event)(HinokoFwIsoCtx *inst, const union fw_cdev_event *event,
- GError **error);
-
g_return_if_fail(HINOKO_IS_FW_ISO_CTX(self));
g_return_if_fail(source != NULL);
g_return_if_fail(error == NULL || *error == NULL);
- priv = hinoko_fw_iso_ctx_get_instance_private(self);
-
- if (HINOKO_IS_FW_ISO_RX_SINGLE(self))
- handle_event = fw_iso_rx_single_handle_event;
- else if (HINOKO_IS_FW_ISO_RX_MULTIPLE(self))
- handle_event = fw_iso_rx_multiple_handle_event;
- else if (HINOKO_IS_FW_ISO_TX(self))
- handle_event = fw_iso_tx_handle_event;
- else
- handle_event = fw_iso_ctx_handle_event_real;
-
- fw_iso_ctx_state_create_source(priv, self, handle_event, source, error);
-}
-
-/**
- * hinoko_fw_iso_ctx_start:
- * @self: A [class@FwIsoCtx].
- * @cycle_match: (array fixed-size=2) (element-type guint16) (in) (nullable): The isochronous cycle
- * to start packet processing. The first element should be the second part of
- * isochronous cycle, up to 3. The second element should be the cycle part of
- * isochronous cycle, up to 7999.
- * @sync: The value of sync field in isochronous header for packet processing, up to 15.
- * @tags: The value of tag field in isochronous header for packet processing.
- * @error: A [struct@GLib.Error].
- *
- * Start isochronous context.
- */
-void hinoko_fw_iso_ctx_start(HinokoFwIsoCtx *self, const guint16 *cycle_match, guint32 sync,
- HinokoFwIsoCtxMatchFlag tags, GError **error)
-{
- HinokoFwIsoCtxPrivate *priv;
-
- g_return_if_fail(HINOKO_IS_FW_ISO_CTX(self));
- g_return_if_fail(error == NULL || *error == NULL);
- priv = hinoko_fw_iso_ctx_get_instance_private(self);
-
- (void)fw_iso_ctx_state_start(priv, cycle_match, sync, tags, error);
+ (void)HINOKO_FW_ISO_CTX_CLASS(self)->create_source(self, source, error);
}
/**
@@ -489,44 +261,14 @@ void hinoko_fw_iso_ctx_start(HinokoFwIsoCtx *self, const guint16 *cycle_match, g
* @self: A [class@FwIsoCtx].
*
* Stop isochronous context.
- */
-void hinoko_fw_iso_ctx_stop(HinokoFwIsoCtx *self)
-{
- HinokoFwIsoCtxPrivate *priv;
- gboolean running;
-
- g_return_if_fail(HINOKO_IS_FW_ISO_CTX(self));
- priv = hinoko_fw_iso_ctx_get_instance_private(self);
-
- running = priv->running;
-
- fw_iso_ctx_state_stop(priv);
-
- if (priv->running != running)
- g_signal_emit(self, fw_iso_ctx_sigs[FW_ISO_CTX_SIG_TYPE_STOPPED], 0, NULL);
-}
-
-/**
- * hinoko_fw_iso_ctx_read_frames:
- * @self: A [class@FwIsoCtx].
- * @offset: offset from head of buffer.
- * @length: the number of bytes to read.
- * @frames: (array length=frame_size)(out)(transfer none)(nullable): The array to fill the same
- * data frame as @frame_size.
- * @frame_size: this value is for a case to truncate due to the end of buffer.
*
- * Read frames to given buffer.
+ * Since: 0.7.
*/
-void hinoko_fw_iso_ctx_read_frames(HinokoFwIsoCtx *self, guint offset,
- guint length, const guint8 **frames,
- guint *frame_size)
+void hinoko_fw_iso_ctx_stop(HinokoFwIsoCtx *self)
{
- HinokoFwIsoCtxPrivate *priv;
-
g_return_if_fail(HINOKO_IS_FW_ISO_CTX(self));
- priv = hinoko_fw_iso_ctx_get_instance_private(self);
- fw_iso_ctx_state_read_frame(priv, offset, length, frames, frame_size);
+ HINOKO_FW_ISO_CTX_CLASS(self)->stop(self);
}
/**
@@ -542,10 +284,8 @@ void hinoko_fw_iso_ctx_read_frames(HinokoFwIsoCtx *self, guint offset,
*/
void hinoko_fw_iso_ctx_flush_completions(HinokoFwIsoCtx *self, GError **error)
{
- HinokoFwIsoCtxPrivate *priv;
-
g_return_if_fail(HINOKO_IS_FW_ISO_CTX(self));
- priv = hinoko_fw_iso_ctx_get_instance_private(self);
+ g_return_if_fail(error == NULL || *error == NULL);
- (void)fw_iso_ctx_state_flush_completions(priv, error);
+ (void)HINOKO_FW_ISO_CTX_CLASS(self)->flush_completions(self, error);
}
diff --git a/src/fw_iso_ctx.h b/src/fw_iso_ctx.h
index 6b41369..3419c40 100644
--- a/src/fw_iso_ctx.h
+++ b/src/fw_iso_ctx.h
@@ -36,6 +36,7 @@ struct _HinokoFwIsoCtxClass {
void (*stopped)(HinokoFwIsoCtx *self, const GError *error);
};
+void hinoko_fw_iso_ctx_stop(HinokoFwIsoCtx *self);
void hinoko_fw_iso_ctx_get_cycle_timer(HinokoFwIsoCtx *self, gint clock_id,
HinokoCycleTimer *const *cycle_timer,
diff --git a/src/fw_iso_ctx_private.h b/src/fw_iso_ctx_private.h
index 8acbf57..15c15de 100644
--- a/src/fw_iso_ctx_private.h
+++ b/src/fw_iso_ctx_private.h
@@ -95,36 +95,4 @@ gboolean fw_iso_ctx_state_create_source(struct fw_iso_ctx_state *state, HinokoFw
GError **error),
GSource **source, GError **error);
-void hinoko_fw_iso_ctx_allocate(HinokoFwIsoCtx *self, const char *path,
- HinokoFwIsoCtxMode mode, HinokoFwScode scode,
- guint channel, guint header_size,
- GError **error);
-void hinoko_fw_iso_ctx_release(HinokoFwIsoCtx *self);
-void hinoko_fw_iso_ctx_map_buffer(HinokoFwIsoCtx *self, guint bytes_per_chunk,
- guint chunks_per_buffer, GError **error);
-void hinoko_fw_iso_ctx_unmap_buffer(HinokoFwIsoCtx *self);
-void hinoko_fw_iso_ctx_register_chunk(HinokoFwIsoCtx *self, gboolean skip,
- HinokoFwIsoCtxMatchFlag tags, guint sy,
- const guint8 *header, guint header_length,
- guint payload_length, gboolean schedule_interrupt,
- GError **error);
-void hinoko_fw_iso_ctx_set_rx_channels(HinokoFwIsoCtx *self,
- guint64 *channel_flags,
- GError **error);
-void hinoko_fw_iso_ctx_start(HinokoFwIsoCtx *self, const guint16 *cycle_match, guint32 sync,
- HinokoFwIsoCtxMatchFlag tags, GError **error);
-void hinoko_fw_iso_ctx_stop(HinokoFwIsoCtx *self);
-void hinoko_fw_iso_ctx_read_frames(HinokoFwIsoCtx *self, guint offset,
- guint length, const guint8 **frames,
- guint *frame_size);
-
-gboolean fw_iso_rx_single_handle_event(HinokoFwIsoCtx *inst, const union fw_cdev_event *event,
- GError **error);
-
-gboolean fw_iso_rx_multiple_handle_event(HinokoFwIsoCtx *inst, const union fw_cdev_event *event,
- GError **error);
-
-gboolean fw_iso_tx_handle_event(HinokoFwIsoCtx *inst, const union fw_cdev_event *event,
- GError **error);
-
#endif
diff --git a/src/fw_iso_rx_multiple.c b/src/fw_iso_rx_multiple.c
index 6e82de0..626b634 100644
--- a/src/fw_iso_rx_multiple.c
+++ b/src/fw_iso_rx_multiple.c
@@ -53,7 +53,7 @@ static void fw_iso_rx_multiple_get_property(GObject *obj, guint id, GValue *val,
g_value_set_static_boxed(val, priv->channels);
break;
default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, id, spec);
+ fw_iso_ctx_state_get_property(&priv->state, obj, id, val, spec);
break;
}
}
@@ -75,6 +75,7 @@ static void hinoko_fw_iso_rx_multiple_class_init(HinokoFwIsoRxMultipleClass *kla
gobject_class->get_property = fw_iso_rx_multiple_get_property;
gobject_class->finalize = fw_iso_rx_multiple_finalize;
+ fw_iso_ctx_class_override_properties(gobject_class);
fw_iso_ctx_class_init(parent_class);
g_object_class_install_property(gobject_class, FW_ISO_RX_MULTIPLE_PROP_TYPE_CHANNELS,
@@ -173,10 +174,8 @@ static gboolean fw_iso_rx_multiple_register_chunk(HinokoFwIsoRxMultiple *self, G
priv->accumulated_chunk_count %= priv->chunks_per_irq;
}
- hinoko_fw_iso_ctx_register_chunk(HINOKO_FW_ISO_CTX(self), FALSE, 0, 0, NULL, 0, 0,
- schedule_irq, error);
-
- return TRUE;
+ return fw_iso_ctx_state_register_chunk(&priv->state, FALSE, 0, 0, NULL, 0, 0, schedule_irq,
+ error);
}
gboolean fw_iso_rx_multiple_handle_event(HinokoFwIsoCtx *inst, const union fw_cdev_event *event,
@@ -203,10 +202,8 @@ gboolean fw_iso_rx_multiple_handle_event(HinokoFwIsoCtx *inst, const union fw_cd
ev = &event->iso_interrupt_mc;
- g_object_get(G_OBJECT(self),
- "bytes-per-chunk", &bytes_per_chunk,
- "chunks-per-buffer", &chunks_per_buffer, NULL);
-
+ bytes_per_chunk = priv->state.bytes_per_chunk;
+ chunks_per_buffer = priv->state.chunks_per_buffer;
bytes_per_buffer = bytes_per_chunk * chunks_per_buffer;
accum_end = ev->completed;
@@ -229,8 +226,7 @@ gboolean fw_iso_rx_multiple_handle_event(HinokoFwIsoCtx *inst, const union fw_cd
break;
offset = (priv->prev_offset + accum_length) % bytes_per_buffer;
- hinoko_fw_iso_ctx_read_frames(HINOKO_FW_ISO_CTX(self), offset,
- 4, &frames, &frame_size);
+ fw_iso_ctx_state_read_frame(&priv->state, offset, 4, &frames, &frame_size);
buf = (const guint32 *)frames;
iso_header = GUINT32_FROM_LE(buf[0]);
@@ -270,7 +266,7 @@ gboolean fw_iso_rx_multiple_handle_event(HinokoFwIsoCtx *inst, const union fw_cd
priv->prev_offset += accum_length;
priv->prev_offset %= bytes_per_buffer;
- return TRUE;
+ return fw_iso_ctx_state_queue_chunks(&priv->state, error);
}
gboolean fw_iso_rx_multiple_create_source(HinokoFwIsoCtx *inst, GSource **source, GError **error)
@@ -327,34 +323,31 @@ void hinoko_fw_iso_rx_multiple_allocate(HinokoFwIsoRxMultiple *self,
{
HinokoFwIsoRxMultiplePrivate *priv;
- guint64 channel_flags;
int i;
+ struct fw_cdev_set_iso_channels set = {0};
g_return_if_fail(HINOKO_IS_FW_ISO_RX_MULTIPLE(self));
g_return_if_fail(error == NULL || *error == NULL);
g_return_if_fail(channels_length > 0);
- channel_flags = 0;
for (i = 0; i < channels_length; ++i) {
g_return_if_fail(channels[i] < 64);
- channel_flags |= G_GUINT64_CONSTANT(1) << channels[i];
+ set.channels |= G_GUINT64_CONSTANT(1) << channels[i];
}
priv = hinoko_fw_iso_rx_multiple_get_instance_private(self);
- hinoko_fw_iso_ctx_allocate(HINOKO_FW_ISO_CTX(self), path,
- HINOKO_FW_ISO_CTX_MODE_RX_MULTIPLE, 0, 0,
- 0, error);
- if (*error != NULL)
+ if (!fw_iso_ctx_state_allocate(&priv->state, path, HINOKO_FW_ISO_CTX_MODE_RX_MULTIPLE, 0,
+ 0, 0, error))
return;
- hinoko_fw_iso_ctx_set_rx_channels(HINOKO_FW_ISO_CTX(self),
- &channel_flags, error);
- if (*error != NULL)
+ set.handle = priv->state.handle;
+ if (ioctl(priv->state.fd, FW_CDEV_IOC_SET_ISO_CHANNELS, &set) < 0) {
+ generate_syscall_error(error, errno, "ioctl(%s)", "FW_CDEV_IOC_SET_ISO_CHANNELS");
return;
- if (channel_flags == 0) {
+ } else if (set.channels == 0) {
g_set_error_literal(error, HINOKO_FW_ISO_CTX_ERROR,
HINOKO_FW_ISO_CTX_ERROR_NO_ISOC_CHANNEL,
"No isochronous channel is available");
@@ -363,7 +356,7 @@ void hinoko_fw_iso_rx_multiple_allocate(HinokoFwIsoRxMultiple *self,
priv->channels = g_byte_array_new();
for (i = 0; i < 64; ++i) {
- if (!(channel_flags & (G_GUINT64_CONSTANT(1) << i)))
+ if (!(set.channels & (G_GUINT64_CONSTANT(1) << i)))
continue;
g_byte_array_append(priv->channels, (const guint8 *)&i, 1);
@@ -383,9 +376,8 @@ void hinoko_fw_iso_rx_multiple_release(HinokoFwIsoRxMultiple *self)
g_return_if_fail(HINOKO_IS_FW_ISO_RX_MULTIPLE(self));
priv = hinoko_fw_iso_rx_multiple_get_instance_private(self);
- hinoko_fw_iso_rx_multiple_unmap_buffer(self);
-
- hinoko_fw_iso_ctx_release(HINOKO_FW_ISO_CTX(self));
+ fw_iso_ctx_state_unmap_buffer(&priv->state);
+ fw_iso_ctx_state_release(&priv->state);
if (priv->channels != NULL)
g_byte_array_unref(priv->channels);
@@ -428,12 +420,11 @@ void hinoko_fw_iso_rx_multiple_map_buffer(HinokoFwIsoRxMultiple *self,
priv->concat_frames = g_malloc_n(4, bytes_per_chunk);
- hinoko_fw_iso_ctx_map_buffer(HINOKO_FW_ISO_CTX(self), bytes_per_chunk,
- chunks_per_buffer, error);
+ if (!fw_iso_ctx_state_map_buffer(&priv->state, bytes_per_chunk, chunks_per_buffer, error))
+ return;
- g_object_get(G_OBJECT(self),
- "bytes-per-chunk", &bytes_per_chunk,
- "chunks-per-buffer", &chunks_per_buffer, NULL);
+ bytes_per_chunk = priv->state.bytes_per_chunk;
+ chunks_per_buffer = priv->state.chunks_per_buffer;
priv->ctx_payloads = g_malloc_n(bytes_per_chunk * chunks_per_buffer / 8 / 2,
sizeof(*priv->ctx_payloads));
@@ -452,9 +443,8 @@ void hinoko_fw_iso_rx_multiple_unmap_buffer(HinokoFwIsoRxMultiple *self)
g_return_if_fail(HINOKO_IS_FW_ISO_RX_MULTIPLE(self));
priv = hinoko_fw_iso_rx_multiple_get_instance_private(self);
- hinoko_fw_iso_rx_multiple_stop(self);
-
- hinoko_fw_iso_ctx_unmap_buffer(HINOKO_FW_ISO_CTX(self));
+ hinoko_fw_iso_ctx_stop(HINOKO_FW_ISO_CTX(self));
+ fw_iso_ctx_state_unmap_buffer(&priv->state);
if (priv->concat_frames != NULL)
free(priv->concat_frames);
@@ -492,7 +482,7 @@ void hinoko_fw_iso_rx_multiple_start(HinokoFwIsoRxMultiple *self,
priv = hinoko_fw_iso_rx_multiple_get_instance_private(self);
- g_object_get(G_OBJECT(self), "chunks-per-buffer", &chunks_per_buffer, NULL);
+ chunks_per_buffer = priv->state.chunks_per_buffer;
g_return_if_fail(chunks_per_irq < chunks_per_buffer);
priv->chunks_per_irq = chunks_per_irq;
@@ -504,20 +494,7 @@ void hinoko_fw_iso_rx_multiple_start(HinokoFwIsoRxMultiple *self,
}
priv->prev_offset = 0;
- hinoko_fw_iso_ctx_start(HINOKO_FW_ISO_CTX(self), cycle_match, sync, tags, error);
-}
-
-/**
- * hinoko_fw_iso_rx_multiple_stop:
- * @self: A [class@FwIsoRxMultiple].
- *
- * Stop IR context.
- */
-void hinoko_fw_iso_rx_multiple_stop(HinokoFwIsoRxMultiple *self)
-{
- g_return_if_fail(HINOKO_IS_FW_ISO_RX_MULTIPLE(self));
-
- hinoko_fw_iso_ctx_stop(HINOKO_FW_ISO_CTX(self));
+ (void)fw_iso_ctx_state_start(&priv->state, cycle_match, sync, tags, error);
}
/**
@@ -545,17 +522,15 @@ void hinoko_fw_iso_rx_multiple_get_payload(HinokoFwIsoRxMultiple *self,
g_return_if_fail(index < priv->ctx_payload_count);
ctx_payload = &priv->ctx_payloads[index];
- hinoko_fw_iso_ctx_read_frames(HINOKO_FW_ISO_CTX(self),
- ctx_payload->offset, ctx_payload->length,
- payload, &frame_size);
+ fw_iso_ctx_state_read_frame(&priv->state, ctx_payload->offset, ctx_payload->length, payload,
+ &frame_size);
if (frame_size < ctx_payload->length) {
unsigned int done = frame_size;
unsigned int rest = ctx_payload->length - frame_size;
memcpy(priv->concat_frames, *payload, done);
- hinoko_fw_iso_ctx_read_frames(HINOKO_FW_ISO_CTX(self), 0, rest,
- payload, &frame_size);
+ fw_iso_ctx_state_read_frame(&priv->state, 0, rest, payload, &frame_size);
g_return_if_fail(frame_size == rest);
memcpy(priv->concat_frames + done, *payload, rest);
diff --git a/src/fw_iso_rx_multiple.h b/src/fw_iso_rx_multiple.h
index 6e8382b..f258e0a 100644
--- a/src/fw_iso_rx_multiple.h
+++ b/src/fw_iso_rx_multiple.h
@@ -43,7 +43,6 @@ void hinoko_fw_iso_rx_multiple_start(HinokoFwIsoRxMultiple *self,
const guint16 *cycle_match, guint32 sync,
HinokoFwIsoCtxMatchFlag tags,
guint chunks_per_irq, GError **error);
-void hinoko_fw_iso_rx_multiple_stop(HinokoFwIsoRxMultiple *self);
void hinoko_fw_iso_rx_multiple_get_payload(HinokoFwIsoRxMultiple *self,
guint index, const guint8 **payload,
diff --git a/src/fw_iso_rx_single.c b/src/fw_iso_rx_single.c
index 2d1fb6c..d2161e8 100644
--- a/src/fw_iso_rx_single.c
+++ b/src/fw_iso_rx_single.c
@@ -32,7 +32,10 @@ static guint fw_iso_rx_single_sigs[FW_ISO_RX_SINGLE_SIG_TYPE_COUNT] = { 0 };
static void fw_iso_rx_single_get_property(GObject *obj, guint id, GValue *val, GParamSpec *spec)
{
- return;
+ HinokoFwIsoRxSingle *self = HINOKO_FW_ISO_RX_SINGLE(obj);
+ HinokoFwIsoRxSinglePrivate *priv = hinoko_fw_iso_rx_single_get_instance_private(self);
+
+ fw_iso_ctx_state_get_property(&priv->state, obj, id, val, spec);
}
static void fw_iso_rx_single_finalize(GObject *obj)
@@ -52,6 +55,7 @@ static void hinoko_fw_iso_rx_single_class_init(HinokoFwIsoRxSingleClass *klass)
gobject_class->get_property = fw_iso_rx_single_get_property;
gobject_class->finalize = fw_iso_rx_single_finalize;
+ fw_iso_ctx_class_override_properties(gobject_class);
fw_iso_ctx_class_init(parent_class);
/**
@@ -168,16 +172,10 @@ gboolean fw_iso_rx_single_handle_event(HinokoFwIsoCtx *inst, const union fw_cdev
priv->ev = NULL;
priv->chunk_cursor += count;
- if (priv->chunk_cursor >= G_MAXINT) {
- guint chunks_per_buffer;
-
- g_object_get(G_OBJECT(self),
- "chunks-per-buffer", &chunks_per_buffer, NULL);
+ if (priv->chunk_cursor >= G_MAXINT)
+ priv->chunk_cursor %= priv->state.chunks_per_buffer;
- priv->chunk_cursor %= chunks_per_buffer;
- }
-
- return TRUE;
+ return fw_iso_ctx_state_queue_chunks(&priv->state, error);
}
gboolean fw_iso_rx_single_create_source(HinokoFwIsoCtx *inst, GSource **source, GError **error)
@@ -237,10 +235,8 @@ void hinoko_fw_iso_rx_single_allocate(HinokoFwIsoRxSingle *self,
priv = hinoko_fw_iso_rx_single_get_instance_private(self);
- hinoko_fw_iso_ctx_allocate(HINOKO_FW_ISO_CTX(self), path,
- HINOKO_FW_ISO_CTX_MODE_RX_SINGLE, 0,
- channel, header_size, error);
- if (*error != NULL)
+ if (!fw_iso_ctx_state_allocate(&priv->state, path, HINOKO_FW_ISO_CTX_MODE_RX_SINGLE, 0,
+ channel, header_size, error))
return;
priv->header_size = header_size;
@@ -254,10 +250,13 @@ void hinoko_fw_iso_rx_single_allocate(HinokoFwIsoRxSingle *self,
*/
void hinoko_fw_iso_rx_single_release(HinokoFwIsoRxSingle *self)
{
+ HinokoFwIsoRxSinglePrivate *priv;
+
g_return_if_fail(HINOKO_IS_FW_ISO_RX_SINGLE(self));
+ priv = hinoko_fw_iso_rx_single_get_instance_private(self);
- hinoko_fw_iso_rx_single_unmap_buffer(self);
- hinoko_fw_iso_ctx_release(HINOKO_FW_ISO_CTX(self));
+ fw_iso_ctx_state_unmap_buffer(&priv->state);
+ fw_iso_ctx_state_release(&priv->state);
}
/*
@@ -274,12 +273,15 @@ void hinoko_fw_iso_rx_single_map_buffer(HinokoFwIsoRxSingle *self,
guint payloads_per_buffer,
GError **error)
{
+ HinokoFwIsoRxSinglePrivate *priv;
+
g_return_if_fail(HINOKO_IS_FW_ISO_RX_SINGLE(self));
g_return_if_fail(error == NULL || *error == NULL);
- hinoko_fw_iso_ctx_map_buffer(HINOKO_FW_ISO_CTX(self),
- maximum_bytes_per_payload,
- payloads_per_buffer, error);
+ priv = hinoko_fw_iso_rx_single_get_instance_private(self);
+
+ (void)fw_iso_ctx_state_map_buffer(&priv->state, maximum_bytes_per_payload,
+ payloads_per_buffer, error);
}
/**
@@ -290,10 +292,13 @@ void hinoko_fw_iso_rx_single_map_buffer(HinokoFwIsoRxSingle *self,
*/
void hinoko_fw_iso_rx_single_unmap_buffer(HinokoFwIsoRxSingle *self)
{
+ HinokoFwIsoRxSinglePrivate *priv;
+
g_return_if_fail(HINOKO_IS_FW_ISO_RX_SINGLE(self));
+ priv = hinoko_fw_iso_rx_single_get_instance_private(self);
- hinoko_fw_iso_rx_single_stop(self);
- hinoko_fw_iso_ctx_unmap_buffer(HINOKO_FW_ISO_CTX(self));
+ hinoko_fw_iso_ctx_stop(HINOKO_FW_ISO_CTX(self));
+ fw_iso_ctx_state_unmap_buffer(&priv->state);
}
/**
@@ -311,8 +316,13 @@ void hinoko_fw_iso_rx_single_unmap_buffer(HinokoFwIsoRxSingle *self)
void hinoko_fw_iso_rx_single_register_packet(HinokoFwIsoRxSingle *self, gboolean schedule_interrupt,
GError **error)
{
- hinoko_fw_iso_ctx_register_chunk(HINOKO_FW_ISO_CTX(self), FALSE, 0, 0, NULL, 0, 0,
- schedule_interrupt, error);
+ HinokoFwIsoRxSinglePrivate *priv;
+
+ g_return_if_fail(HINOKO_IS_FW_ISO_RX_SINGLE(self));
+ priv = hinoko_fw_iso_rx_single_get_instance_private(self);
+
+ (void)fw_iso_ctx_state_register_chunk(&priv->state, FALSE, 0, 0, NULL, 0, 0,
+ schedule_interrupt, error);
}
/**
@@ -342,21 +352,9 @@ void hinoko_fw_iso_rx_single_start(HinokoFwIsoRxSingle *self, const guint16 *cyc
priv->chunk_cursor = 0;
- hinoko_fw_iso_ctx_start(HINOKO_FW_ISO_CTX(self), cycle_match, sync, tags, error);
+ (void)fw_iso_ctx_state_start(&priv->state, cycle_match, sync, tags, error);
}
-/**
- * hinoko_fw_iso_rx_single_stop:
- * @self: A [class@FwIsoRxSingle].
- *
- * Stop IR context.
- */
-void hinoko_fw_iso_rx_single_stop(HinokoFwIsoRxSingle *self)
-{
- g_return_if_fail(HINOKO_IS_FW_ISO_RX_SINGLE(self));
-
- hinoko_fw_iso_ctx_stop(HINOKO_FW_ISO_CTX(self));
-}
/**
* hinoko_fw_iso_rx_single_get_payload:
@@ -389,9 +387,8 @@ void hinoko_fw_iso_rx_single_get_payload(HinokoFwIsoRxSingle *self, guint index,
g_return_if_fail(priv->ev != NULL);
g_return_if_fail(index * priv->header_size <= priv->ev->header_length);
- g_object_get(G_OBJECT(self),
- "bytes-per-chunk", &bytes_per_chunk,
- "chunks-per-buffer", &chunks_per_buffer, NULL);
+ bytes_per_chunk = priv->state.bytes_per_chunk;
+ chunks_per_buffer = priv->state.chunks_per_buffer;
pos = index * priv->header_size / 4;
iso_header = GUINT32_FROM_BE(priv->ev->header[pos]);
@@ -401,7 +398,6 @@ void hinoko_fw_iso_rx_single_get_payload(HinokoFwIsoRxSingle *self, guint index,
index = (priv->chunk_cursor + index) % chunks_per_buffer;
offset = index * bytes_per_chunk;
- hinoko_fw_iso_ctx_read_frames(HINOKO_FW_ISO_CTX(self), offset, *length,
- payload, &frame_size);
+ fw_iso_ctx_state_read_frame(&priv->state, offset, *length, payload, &frame_size);
g_return_if_fail(frame_size == *length);
}
diff --git a/src/fw_iso_rx_single.h b/src/fw_iso_rx_single.h
index c4b719a..ad28cdb 100644
--- a/src/fw_iso_rx_single.h
+++ b/src/fw_iso_rx_single.h
@@ -50,7 +50,6 @@ void hinoko_fw_iso_rx_single_register_packet(HinokoFwIsoRxSingle *self, gboolean
void hinoko_fw_iso_rx_single_start(HinokoFwIsoRxSingle *self, const guint16 *cycle_match,
guint32 sync, HinokoFwIsoCtxMatchFlag tags, GError **error);
-void hinoko_fw_iso_rx_single_stop(HinokoFwIsoRxSingle *self);
void hinoko_fw_iso_rx_single_get_payload(HinokoFwIsoRxSingle *self, guint index,
const guint8 **payload, guint *length,
diff --git a/src/fw_iso_tx.c b/src/fw_iso_tx.c
index f6d961c..657fed9 100644
--- a/src/fw_iso_tx.c
+++ b/src/fw_iso_tx.c
@@ -26,7 +26,10 @@ static guint fw_iso_tx_sigs[FW_ISO_TX_SIG_TYPE_COUNT] = { 0 };
static void fw_iso_tx_get_property(GObject *obj, guint id, GValue *val, GParamSpec *spec)
{
- return;
+ HinokoFwIsoTx *self = HINOKO_FW_ISO_TX(obj);
+ HinokoFwIsoTxPrivate *priv = hinoko_fw_iso_tx_get_instance_private(self);
+
+ fw_iso_ctx_state_get_property(&priv->state, obj, id, val, spec);
}
static void fw_iso_tx_finalize(GObject *obj)
@@ -46,6 +49,7 @@ static void hinoko_fw_iso_tx_class_init(HinokoFwIsoTxClass *klass)
gobject_class->get_property = fw_iso_tx_get_property;
gobject_class->finalize = fw_iso_tx_finalize;
+ fw_iso_ctx_class_override_properties(gobject_class);
fw_iso_ctx_class_init(parent_class);
/**
@@ -133,11 +137,17 @@ static gboolean fw_iso_tx_flush_completions(HinokoFwIsoCtx *inst, GError **error
gboolean fw_iso_tx_handle_event(HinokoFwIsoCtx *inst, const union fw_cdev_event *event,
GError **error)
{
+ HinokoFwIsoTx *self;
+ HinokoFwIsoTxPrivate *priv;
+
const struct fw_cdev_event_iso_interrupt *ev;
g_return_val_if_fail(HINOKO_FW_ISO_TX(inst), FALSE);
g_return_val_if_fail(event->common.type == FW_CDEV_EVENT_ISO_INTERRUPT, FALSE);
+ self = HINOKO_FW_ISO_TX(inst);
+ priv = hinoko_fw_iso_tx_get_instance_private(self);
+
ev = &event->iso_interrupt;
guint sec = (ev->cycle & 0x0000e000) >> 13;
@@ -147,7 +157,7 @@ gboolean fw_iso_tx_handle_event(HinokoFwIsoCtx *inst, const union fw_cdev_event
g_signal_emit(inst, fw_iso_tx_sigs[FW_ISO_TX_SIG_TYPE_IRQ], 0, sec, cycle, ev->header,
ev->header_length, pkt_count);
- return TRUE;
+ return fw_iso_ctx_state_queue_chunks(&priv->state, error);
}
gboolean fw_iso_tx_create_source(HinokoFwIsoCtx *inst, GSource **source, GError **error)
@@ -200,12 +210,14 @@ void hinoko_fw_iso_tx_allocate(HinokoFwIsoTx *self, const char *path,
HinokoFwScode scode, guint channel,
guint header_size, GError **error)
{
+ HinokoFwIsoTxPrivate *priv;
+
g_return_if_fail(HINOKO_IS_FW_ISO_TX(self));
g_return_if_fail(error == NULL || *error == NULL);
+ priv = hinoko_fw_iso_tx_get_instance_private(self);
- hinoko_fw_iso_ctx_allocate(HINOKO_FW_ISO_CTX(self), path,
- HINOKO_FW_ISO_CTX_MODE_TX, scode, channel,
- header_size, error);
+ (void)fw_iso_ctx_state_allocate(&priv->state, path, HINOKO_FW_ISO_CTX_MODE_TX, scode,
+ channel, header_size, error);
}
/**
@@ -216,11 +228,13 @@ void hinoko_fw_iso_tx_allocate(HinokoFwIsoTx *self, const char *path,
*/
void hinoko_fw_iso_tx_release(HinokoFwIsoTx *self)
{
- g_return_if_fail(HINOKO_IS_FW_ISO_TX(self));
+ HinokoFwIsoTxPrivate *priv;
- hinoko_fw_iso_tx_unmap_buffer(self);
+ g_return_if_fail(HINOKO_IS_FW_ISO_TX(self));
+ priv = hinoko_fw_iso_tx_get_instance_private(self);
- hinoko_fw_iso_ctx_release(HINOKO_FW_ISO_CTX(self));
+ fw_iso_ctx_state_unmap_buffer(&priv->state);
+ fw_iso_ctx_state_release(&priv->state);
}
/**
@@ -243,11 +257,8 @@ void hinoko_fw_iso_tx_map_buffer(HinokoFwIsoTx *self,
g_return_if_fail(error == NULL || *error == NULL);
priv = hinoko_fw_iso_tx_get_instance_private(self);
- hinoko_fw_iso_ctx_map_buffer(HINOKO_FW_ISO_CTX(self),
- maximum_bytes_per_payload,
- payloads_per_buffer, error);
-
- priv->offset = 0;
+ (void)fw_iso_ctx_state_map_buffer(&priv->state, maximum_bytes_per_payload,
+ payloads_per_buffer, error);
}
/**
@@ -258,11 +269,13 @@ void hinoko_fw_iso_tx_map_buffer(HinokoFwIsoTx *self,
*/
void hinoko_fw_iso_tx_unmap_buffer(HinokoFwIsoTx *self)
{
- g_return_if_fail(HINOKO_IS_FW_ISO_TX(self));
+ HinokoFwIsoTxPrivate *priv;
- hinoko_fw_iso_tx_stop(self);
+ g_return_if_fail(HINOKO_IS_FW_ISO_TX(self));
+ priv = hinoko_fw_iso_tx_get_instance_private(self);
- hinoko_fw_iso_ctx_unmap_buffer(HINOKO_FW_ISO_CTX(self));
+ hinoko_fw_iso_ctx_stop(HINOKO_FW_ISO_CTX(self));
+ fw_iso_ctx_state_unmap_buffer(&priv->state);
}
/**
@@ -280,29 +293,13 @@ void hinoko_fw_iso_tx_unmap_buffer(HinokoFwIsoTx *self)
*/
void hinoko_fw_iso_tx_start(HinokoFwIsoTx *self, const guint16 *cycle_match, GError **error)
{
- g_return_if_fail(HINOKO_IS_FW_ISO_TX(self));
- g_return_if_fail(error == NULL || *error == NULL);
-
- hinoko_fw_iso_ctx_start(HINOKO_FW_ISO_CTX(self), cycle_match, 0, 0, error);
-
-}
-
-/**
- * hinoko_fw_iso_tx_stop:
- * @self: A [class@FwIsoTx].
- *
- * Stop IT context.
- */
-void hinoko_fw_iso_tx_stop(HinokoFwIsoTx *self)
-{
HinokoFwIsoTxPrivate *priv;
g_return_if_fail(HINOKO_IS_FW_ISO_TX(self));
+ g_return_if_fail(error == NULL || *error == NULL);
priv = hinoko_fw_iso_tx_get_instance_private(self);
- hinoko_fw_iso_ctx_stop(HINOKO_FW_ISO_CTX(self));
-
- priv->offset = 0;
+ (void)fw_iso_ctx_state_start(&priv->state, cycle_match, 0, 0, error);
}
/**
@@ -348,14 +345,12 @@ void hinoko_fw_iso_tx_register_packet(HinokoFwIsoTx *self,
if (header_length == 0 && payload_length == 0)
skip = TRUE;
- hinoko_fw_iso_ctx_register_chunk(HINOKO_FW_ISO_CTX(self), skip, tags, sy, header,
- header_length, payload_length, schedule_interrupt,
- error);
- if (*error != NULL)
+ if (!fw_iso_ctx_state_register_chunk(&priv->state, skip, tags, sy, header, header_length,
+ payload_length, schedule_interrupt, error))
return;
- hinoko_fw_iso_ctx_read_frames(HINOKO_FW_ISO_CTX(self), priv->offset,
- payload_length, &frames, &frame_size);
+ fw_iso_ctx_state_read_frame(&priv->state, priv->offset, payload_length, &frames,
+ &frame_size);
memcpy((void *)frames, payload, frame_size);
priv->offset += frame_size;
@@ -363,8 +358,7 @@ void hinoko_fw_iso_tx_register_packet(HinokoFwIsoTx *self,
guint rest = payload_length - frame_size;
payload += frame_size;
- hinoko_fw_iso_ctx_read_frames(HINOKO_FW_ISO_CTX(self), 0,
- rest, &frames, &frame_size);
+ fw_iso_ctx_state_read_frame(&priv->state, 0, rest, &frames, &frame_size);
memcpy((void *)frames, payload, frame_size);
priv->offset = frame_size;
diff --git a/src/fw_iso_tx.h b/src/fw_iso_tx.h
index 92f2bba..e442b73 100644
--- a/src/fw_iso_tx.h
+++ b/src/fw_iso_tx.h
@@ -44,7 +44,6 @@ void hinoko_fw_iso_tx_map_buffer(HinokoFwIsoTx *self,
void hinoko_fw_iso_tx_unmap_buffer(HinokoFwIsoTx *self);
void hinoko_fw_iso_tx_start(HinokoFwIsoTx *self, const guint16 *cycle_match, GError **error);
-void hinoko_fw_iso_tx_stop(HinokoFwIsoTx *self);
void hinoko_fw_iso_tx_register_packet(HinokoFwIsoTx *self,
HinokoFwIsoCtxMatchFlag tags, guint sy,
diff --git a/src/hinoko.map b/src/hinoko.map
index 8c9db1c..2b60ace 100644
--- a/src/hinoko.map
+++ b/src/hinoko.map
@@ -14,7 +14,6 @@ HINOKO_0_1_0 {
"hinoko_fw_iso_rx_single_release";
"hinoko_fw_iso_rx_single_map_buffer";
"hinoko_fw_iso_rx_single_unmap_buffer";
- "hinoko_fw_iso_rx_single_stop";
"hinoko_fw_iso_rx_single_get_payload";
"hinoko_fw_iso_rx_multiple_get_type";
@@ -24,7 +23,6 @@ HINOKO_0_1_0 {
"hinoko_fw_iso_rx_multiple_map_buffer";
"hinoko_fw_iso_rx_multiple_unmap_buffer";
"hinoko_fw_iso_rx_multiple_start";
- "hinoko_fw_iso_rx_multiple_stop";
"hinoko_fw_iso_rx_multiple_get_payload";
"hinoko_fw_iso_tx_get_type";
@@ -33,7 +31,6 @@ HINOKO_0_1_0 {
"hinoko_fw_iso_tx_release";
"hinoko_fw_iso_tx_map_buffer";
"hinoko_fw_iso_tx_unmap_buffer";
- "hinoko_fw_iso_tx_stop";
local:
*;
};
@@ -81,6 +78,8 @@ HINOKO_0_6_0 {
HINOKO_0_7_0 {
global:
+ "hinoko_fw_iso_ctx_stop";
+
"hinoko_fw_iso_resource_get_type";
"hinoko_fw_iso_resource_open";
"hinoko_fw_iso_resource_create_source";