Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove unused get/put_field_json functions #221

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,10 @@

#include "include_internal/ten_runtime/msg/loop_fields.h"
#include "ten_utils/container/list.h"
#include "ten_utils/lib/json.h"

typedef struct ten_msg_t ten_msg_t;
typedef struct ten_error_t ten_error_t;

TEN_RUNTIME_PRIVATE_API bool ten_audio_frame_put_bytes_per_sample_to_json(
ten_msg_t *self, ten_json_t *json, ten_error_t *err);

TEN_RUNTIME_PRIVATE_API bool ten_audio_frame_get_bytes_per_sample_from_json(
ten_msg_t *self, ten_json_t *json, ten_error_t *err);

TEN_RUNTIME_PRIVATE_API void ten_audio_frame_copy_bytes_per_sample(
ten_msg_t *self, ten_msg_t *src, ten_list_t *excluded_field_ids);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,9 @@
#include <stdbool.h>

#include "ten_utils/container/list.h"
#include "ten_utils/lib/json.h"

typedef struct ten_msg_t ten_msg_t;
typedef struct ten_error_t ten_error_t;

TEN_RUNTIME_PRIVATE_API void ten_audio_frame_put_channel_layout_to_json(
ten_msg_t *self, ten_json_t *json);

TEN_RUNTIME_PRIVATE_API bool ten_audio_frame_get_channel_layout_from_json(
ten_msg_t *self, ten_json_t *json, ten_error_t *err);

TEN_RUNTIME_PRIVATE_API void ten_audio_frame_copy_channel_layout(
ten_msg_t *self, ten_msg_t *src, ten_list_t *excluded_field_ids);
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,10 @@
#include "include_internal/ten_runtime/msg/loop_fields.h"
#include "ten_runtime/msg/audio_frame/audio_frame.h"
#include "ten_utils/container/list.h"
#include "ten_utils/lib/json.h"

typedef struct ten_msg_t ten_msg_t;
typedef struct ten_error_t ten_error_t;

TEN_RUNTIME_PRIVATE_API bool ten_audio_frame_put_data_fmt_to_json(
ten_msg_t *self, ten_json_t *json, ten_error_t *err);

TEN_RUNTIME_PRIVATE_API bool ten_audio_frame_get_data_fmt_from_json(
ten_msg_t *self, ten_json_t *json, ten_error_t *err);

TEN_RUNTIME_PRIVATE_API void ten_audio_frame_copy_data_fmt(
ten_msg_t *self, ten_msg_t *src, ten_list_t *excluded_field_ids);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,20 @@ static const ten_msg_field_info_t ten_audio_frame_fields_info[] = {
{
.field_name = NULL,
.field_id = -1,
.put_field_to_json = ten_raw_msg_put_field_to_json,
.get_field_from_json = ten_raw_msg_get_field_from_json,
.copy_field = ten_raw_msg_copy_field,
.process_field = ten_raw_msg_process_field,
},
[TEN_AUDIO_FRAME_FIELD_TIMESTAMP] =
{
.field_name = NULL,
.field_id = TEN_MSG_FIELD_LAST + TEN_AUDIO_FRAME_FIELD_TIMESTAMP,
.put_field_to_json = ten_audio_frame_put_timestamp_to_json,
.get_field_from_json = ten_audio_frame_get_timestamp_from_json,
.copy_field = ten_audio_frame_copy_timestamp,
.process_field = ten_audio_frame_process_timestamp,
},
[TEN_AUDIO_FRAME_FIELD_SAMPLE_RATE] =
{
.field_name = NULL,
.field_id = TEN_MSG_FIELD_LAST + TEN_AUDIO_FRAME_FIELD_SAMPLE_RATE,
.put_field_to_json = ten_audio_frame_put_sample_rate_to_json,
.get_field_from_json = ten_audio_frame_get_sample_rate_from_json,
.copy_field = ten_audio_frame_copy_sample_rate,
.process_field = ten_audio_frame_process_sample_rate,
},
Expand All @@ -58,9 +52,6 @@ static const ten_msg_field_info_t ten_audio_frame_fields_info[] = {
.field_name = NULL,
.field_id =
TEN_MSG_FIELD_LAST + TEN_AUDIO_FRAME_FIELD_BYTES_PER_SAMPLE,
.put_field_to_json = ten_audio_frame_put_bytes_per_sample_to_json,
.get_field_from_json =
ten_audio_frame_get_bytes_per_sample_from_json,
.copy_field = ten_audio_frame_copy_bytes_per_sample,
.process_field = ten_audio_frame_process_bytes_per_sample,
},
Expand All @@ -69,10 +60,6 @@ static const ten_msg_field_info_t ten_audio_frame_fields_info[] = {
.field_name = NULL,
.field_id =
TEN_MSG_FIELD_LAST + TEN_AUDIO_FRAME_FIELD_SAMPLES_PER_CHANNEL,
.put_field_to_json =
ten_audio_frame_put_samples_per_channel_to_json,
.get_field_from_json =
ten_audio_frame_get_samples_per_channel_from_json,
.copy_field = ten_audio_frame_copy_samples_per_channel,
.process_field = ten_audio_frame_process_samples_per_channel,
},
Expand All @@ -81,41 +68,27 @@ static const ten_msg_field_info_t ten_audio_frame_fields_info[] = {
.field_name = NULL,
.field_id =
TEN_MSG_FIELD_LAST + TEN_AUDIO_FRAME_FIELD_NUMBER_OF_CHANNEL,
.put_field_to_json = ten_audio_frame_put_number_of_channel_to_json,
.get_field_from_json =
ten_audio_frame_get_number_of_channel_from_json,
.copy_field = ten_audio_frame_copy_number_of_channel,
.process_field = ten_audio_frame_process_number_of_channel,
},
[TEN_AUDIO_FRAME_FIELD_DATA_FMT] =
{
.field_name = NULL,
.field_id = TEN_MSG_FIELD_LAST + TEN_AUDIO_FRAME_FIELD_DATA_FMT,
.put_field_to_json = ten_audio_frame_put_data_fmt_to_json,
.get_field_from_json = ten_audio_frame_get_data_fmt_from_json,
.copy_field = ten_audio_frame_copy_data_fmt,
.process_field = ten_audio_frame_process_data_fmt,
},
[TEN_AUDIO_FRAME_FIELD_BUF] =
{
.field_name = NULL,
.field_id = TEN_MSG_FIELD_LAST + TEN_AUDIO_FRAME_FIELD_BUF,

// It is not possible to get/put the binary content of a memory
// buffer from/into JSON (unless you use base64). If needed, clients
// must use explicit get/set properties from/to the buffer; clients
// cannot use JSON for this.
.put_field_to_json = NULL,
.get_field_from_json = NULL,
.copy_field = NULL,
.process_field = ten_audio_frame_process_buf,
},
[TEN_AUDIO_FRAME_FIELD_LINE_SIZE] =
{
.field_name = NULL,
.field_id = TEN_MSG_FIELD_LAST + TEN_AUDIO_FRAME_FIELD_LINE_SIZE,
.put_field_to_json = ten_audio_frame_put_line_size_to_json,
.get_field_from_json = ten_audio_frame_get_line_size_from_json,
.copy_field = ten_audio_frame_copy_line_size,
.process_field = ten_audio_frame_process_line_size,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,10 @@

#include "include_internal/ten_runtime/msg/loop_fields.h"
#include "ten_utils/container/list.h"
#include "ten_utils/lib/json.h"

typedef struct ten_msg_t ten_msg_t;
typedef struct ten_error_t ten_error_t;

TEN_RUNTIME_PRIVATE_API bool ten_audio_frame_put_line_size_to_json(
ten_msg_t *self, ten_json_t *json, ten_error_t *err);

TEN_RUNTIME_PRIVATE_API bool ten_audio_frame_get_line_size_from_json(
ten_msg_t *self, ten_json_t *json, ten_error_t *err);

TEN_RUNTIME_PRIVATE_API void ten_audio_frame_copy_line_size(
ten_msg_t *self, ten_msg_t *src, ten_list_t *excluded_field_ids);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,10 @@

#include "include_internal/ten_runtime/msg/loop_fields.h"
#include "ten_utils/container/list.h"
#include "ten_utils/lib/json.h"

typedef struct ten_msg_t ten_msg_t;
typedef struct ten_error_t ten_error_t;

TEN_RUNTIME_PRIVATE_API bool ten_audio_frame_put_number_of_channel_to_json(
ten_msg_t *self, ten_json_t *json, ten_error_t *err);

TEN_RUNTIME_PRIVATE_API bool ten_audio_frame_get_number_of_channel_from_json(
ten_msg_t *self, ten_json_t *json, ten_error_t *err);

TEN_RUNTIME_PRIVATE_API void ten_audio_frame_copy_number_of_channel(
ten_msg_t *self, ten_msg_t *src, ten_list_t *excluded_field_ids);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,10 @@

#include "include_internal/ten_runtime/msg/loop_fields.h"
#include "ten_utils/container/list.h"
#include "ten_utils/lib/json.h"

typedef struct ten_msg_t ten_msg_t;
typedef struct ten_error_t ten_error_t;

TEN_RUNTIME_PRIVATE_API bool ten_audio_frame_put_sample_rate_to_json(
ten_msg_t *self, ten_json_t *json, ten_error_t *err);

TEN_RUNTIME_PRIVATE_API bool ten_audio_frame_get_sample_rate_from_json(
ten_msg_t *self, ten_json_t *json, ten_error_t *err);

TEN_RUNTIME_PRIVATE_API void ten_audio_frame_copy_sample_rate(
ten_msg_t *self, ten_msg_t *src, ten_list_t *excluded_field_ids);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,10 @@

#include "include_internal/ten_runtime/msg/loop_fields.h"
#include "ten_utils/container/list.h"
#include "ten_utils/lib/json.h"

typedef struct ten_msg_t ten_msg_t;
typedef struct ten_error_t ten_error_t;

TEN_RUNTIME_PRIVATE_API bool ten_audio_frame_put_samples_per_channel_to_json(
ten_msg_t *self, ten_json_t *json, ten_error_t *err);

TEN_RUNTIME_PRIVATE_API bool ten_audio_frame_get_samples_per_channel_from_json(
ten_msg_t *self, ten_json_t *json, ten_error_t *err);

TEN_RUNTIME_PRIVATE_API void ten_audio_frame_copy_samples_per_channel(
ten_msg_t *self, ten_msg_t *src, ten_list_t *excluded_field_ids);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,10 @@

#include "include_internal/ten_runtime/msg/loop_fields.h"
#include "ten_utils/container/list.h"
#include "ten_utils/lib/json.h"

typedef struct ten_msg_t ten_msg_t;
typedef struct ten_error_t ten_error_t;

TEN_RUNTIME_PRIVATE_API bool ten_audio_frame_put_timestamp_to_json(
ten_msg_t *self, ten_json_t *json, ten_error_t *err);

TEN_RUNTIME_PRIVATE_API bool ten_audio_frame_get_timestamp_from_json(
ten_msg_t *self, ten_json_t *json, ten_error_t *err);

TEN_RUNTIME_PRIVATE_API void ten_audio_frame_copy_timestamp(
ten_msg_t *self, ten_msg_t *src, ten_list_t *excluded_field_ids);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ static const ten_msg_field_info_t ten_cmd_close_app_fields_info[] = {
[TEN_CMD_CLOSE_APP_FIELD_CMD_HDR] =
{
.field_name = NULL,
.put_field_to_json = ten_raw_cmd_put_field_to_json,
.get_field_from_json = ten_raw_cmd_get_field_from_json,
.copy_field = NULL,
.process_field = ten_raw_cmd_process_field,
},
Expand Down
8 changes: 0 additions & 8 deletions core/include_internal/ten_runtime/msg/cmd_base/cmd/cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ TEN_RUNTIME_PRIVATE_API void ten_raw_cmd_init(ten_cmd_t *self,

TEN_RUNTIME_PRIVATE_API void ten_raw_cmd_deinit(ten_cmd_t *self);

TEN_RUNTIME_PRIVATE_API bool ten_raw_cmd_get_field_from_json(ten_msg_t *self,
ten_json_t *json,
ten_error_t *err);

TEN_RUNTIME_PRIVATE_API bool ten_raw_cmd_put_field_to_json(ten_msg_t *self,
ten_json_t *json,
ten_error_t *err);

TEN_RUNTIME_PRIVATE_API void ten_raw_cmd_copy_field(
ten_msg_t *self, ten_msg_t *src, ten_list_t *excluded_field_ids);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ static const ten_msg_field_info_t ten_cmd_custom_fields_info[] = {
{
.field_name = NULL,
.field_id = -1,
.put_field_to_json = ten_raw_cmd_put_field_to_json,
.get_field_from_json = ten_raw_cmd_get_field_from_json,
.copy_field = ten_raw_cmd_copy_field,
.process_field = ten_raw_cmd_process_field,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ static const ten_msg_field_info_t ten_cmd_fields_info[] = {
{
.field_name = NULL,
.field_id = -1,
.put_field_to_json = ten_raw_cmd_base_put_field_to_json,
.get_field_from_json = ten_raw_cmd_base_get_field_from_json,
.copy_field = ten_raw_cmd_base_copy_field,
.process_field = ten_raw_cmd_base_process_field,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,10 @@

#include "include_internal/ten_runtime/msg/loop_fields.h"
#include "ten_utils/container/list.h"
#include "ten_utils/lib/json.h"

typedef struct ten_msg_t ten_msg_t;
typedef struct ten_error_t ten_error_t;

TEN_RUNTIME_PRIVATE_API bool ten_cmd_start_graph_put_extension_info_to_json(
ten_msg_t *self, ten_json_t *json, ten_error_t *err);

TEN_RUNTIME_PRIVATE_API bool ten_cmd_start_graph_get_extension_info_from_json(
ten_msg_t *self, ten_json_t *json, ten_error_t *err);

TEN_RUNTIME_PRIVATE_API void ten_cmd_start_graph_copy_extensions_info(
ten_msg_t *self, ten_msg_t *src, ten_list_t *excluded_field_ids);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,37 +27,24 @@ static const ten_msg_field_info_t ten_cmd_start_graph_fields_info[] = {
[TEN_CMD_CONNECT_FIELD_CMD_HDR] =
{
.field_name = NULL,
.put_field_to_json = ten_raw_cmd_put_field_to_json,
.get_field_from_json = ten_raw_cmd_get_field_from_json,
.copy_field = ten_raw_cmd_copy_field,
.process_field = ten_raw_cmd_process_field,
},
[TEN_CMD_CONNECT_FIELD_LONG_RUNNING_MODE] =
{
.field_name = TEN_STR_LONG_RUNNING_MODE,
.put_field_to_json =
ten_cmd_start_graph_put_long_running_mode_to_json,
.get_field_from_json =
ten_cmd_start_graph_get_long_running_mode_from_json,
.copy_field = ten_cmd_start_graph_copy_long_running_mode,
.process_field = ten_cmd_start_graph_process_long_running_mode,
},
[TEN_CMD_CONNECT_FIELD_PREDEFINED_GRAPH] =
{
.field_name = TEN_STR_PREDEFINED_GRAPH,
.put_field_to_json =
ten_cmd_start_graph_put_predefined_graph_name_to_json,
.get_field_from_json =
ten_cmd_start_graph_get_predefined_graph_name_from_json,
.copy_field = ten_cmd_start_graph_copy_predefined_graph_name,
.process_field = ten_cmd_start_graph_process_predefined_graph_name,
},
[TEN_CMD_CONNECT_FIELD_EXTENSION_INFO] =
{
.field_name = NULL,
.put_field_to_json = ten_cmd_start_graph_put_extension_info_to_json,
.get_field_from_json =
ten_cmd_start_graph_get_extension_info_from_json,
.copy_field = ten_cmd_start_graph_copy_extensions_info,
.process_field = ten_cmd_start_graph_process_extensions_info,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,10 @@

#include "include_internal/ten_runtime/msg/loop_fields.h"
#include "ten_utils/container/list.h"
#include "ten_utils/lib/json.h"

typedef struct ten_msg_t ten_msg_t;
typedef struct ten_error_t ten_error_t;

TEN_RUNTIME_PRIVATE_API bool ten_cmd_start_graph_put_long_running_mode_to_json(
ten_msg_t *self, ten_json_t *json, ten_error_t *err);

TEN_RUNTIME_PRIVATE_API bool
ten_cmd_start_graph_get_long_running_mode_from_json(ten_msg_t *self,
ten_json_t *json,
ten_error_t *err);

TEN_RUNTIME_PRIVATE_API void ten_cmd_start_graph_copy_long_running_mode(
ten_msg_t *self, ten_msg_t *src, ten_list_t *excluded_field_ids);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,10 @@

#include "include_internal/ten_runtime/msg/loop_fields.h"
#include "ten_utils/container/list.h"
#include "ten_utils/lib/json.h"

typedef struct ten_msg_t ten_msg_t;
typedef struct ten_error_t ten_error_t;

TEN_RUNTIME_PRIVATE_API bool
ten_cmd_start_graph_put_predefined_graph_name_to_json(ten_msg_t *self,
ten_json_t *json,
ten_error_t *err);

TEN_RUNTIME_PRIVATE_API bool
ten_cmd_start_graph_get_predefined_graph_name_from_json(ten_msg_t *self,
ten_json_t *json,
ten_error_t *err);

TEN_RUNTIME_PRIVATE_API void ten_cmd_start_graph_copy_predefined_graph_name(
ten_msg_t *self, ten_msg_t *src, ten_list_t *excluded_field_ids);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,12 @@ static const ten_msg_field_info_t ten_cmd_stop_graph_fields_info[] = {
[TEN_CMD_STOP_GRAPH_FIELD_CMD_HDR] =
{
.field_name = NULL,
.put_field_to_json = ten_raw_cmd_put_field_to_json,
.get_field_from_json = ten_raw_cmd_get_field_from_json,
.copy_field = ten_raw_cmd_copy_field,
.process_field = ten_raw_cmd_process_field,
},
[TEN_CMD_STOP_GRAPH_FIELD_GRAPH_NAME] =
{
.field_name = TEN_STR_GRAPH_NAME,
.put_field_to_json = ten_cmd_stop_graph_put_graph_id_to_json,
.get_field_from_json = ten_cmd_stop_graph_get_graph_id_from_json,
.copy_field = ten_cmd_stop_graph_copy_graph_id,
.process_field = ten_cmd_stop_graph_process_graph_id,
},
Expand Down
Loading
Loading