[S] Change in osmo-mgw[master]: simplify unused transcoding/processing call-back

2024-03-20 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/36357?usp=email )

 (

1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted 
one.
 )Change subject: simplify unused transcoding/processing call-back
..

simplify unused transcoding/processing call-back

the processing call-back is working with a raw buffer + length,
while we actually work with struct msgb.  Let's simply pass the msgb
into the call-back, and the call-back can then do what they want with
the contents of that msgb.

Change-Id: I002624f9008726e3d754d48aa2282c38e3b42953
---
M include/osmocom/mgcp/mgcp.h
M include/osmocom/mgcp/mgcp_network.h
M src/libosmo-mgcp/mgcp_network.c
3 files changed, 20 insertions(+), 13 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  fixeria: Looks good to me, but someone else must approve
  pespin: Looks good to me, but someone else must approve




diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h
index 42d67cf..bfb412b 100644
--- a/include/osmocom/mgcp/mgcp.h
+++ b/include/osmocom/mgcp/mgcp.h
@@ -70,12 +70,10 @@
 /**
  * Return:
  *   <  0 in case no audio was processed
- *   >= 0 in case audio was processed. The remaining payload
- *   length will be returned.
+ *   >= 0 in case audio was processed.
  */
 typedef int (*mgcp_processing)(struct mgcp_endpoint *endp,
-  struct mgcp_rtp_end *dst_end,
-  char *data, int *len, int buf_size);
+  struct mgcp_rtp_end *dst_end, struct msgb *msg);

 struct mgcp_conn_rtp;

diff --git a/include/osmocom/mgcp/mgcp_network.h 
b/include/osmocom/mgcp/mgcp_network.h
index a7bd333..1ec8979 100644
--- a/include/osmocom/mgcp/mgcp_network.h
+++ b/include/osmocom/mgcp/mgcp_network.h
@@ -159,8 +159,7 @@
 int mgcp_get_local_addr(char *addr, struct mgcp_conn_rtp *conn);

 /* payload processing default functions */
-int mgcp_rtp_processing_default(struct mgcp_endpoint *endp, struct 
mgcp_rtp_end *dst_end,
-   char *data, int *len, int buf_size);
+int mgcp_rtp_processing_default(struct mgcp_endpoint *endp, struct 
mgcp_rtp_end *dst_end, struct msgb *msg);

 int mgcp_setup_rtp_processing_default(struct mgcp_endpoint *endp,
  struct mgcp_conn_rtp *conn_dst,
diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index 19fcd9f..ee25f74 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -404,13 +404,11 @@
 /*! dummy callback to disable transcoding (see also cfg->rtp_processing_cb).
  *  \param[in] associated endpoint.
  *  \param[in] destination RTP end.
- *  \param[in,out] pointer to buffer with voice data.
- *  \param[in] voice data length.
- *  \param[in] maximum size of caller provided voice data buffer.
+ *  \param[in,out] msg message bufffer containing data. Function might change 
length.
  *  \returns ignores input parameters, return always 0. */
 int mgcp_rtp_processing_default(struct mgcp_endpoint *endp,
struct mgcp_rtp_end *dst_end,
-   char *data, int *len, int buf_size)
+   struct msgb *msg)
 {
return 0;
 }
@@ -1167,14 +1165,12 @@
 osmo_sockaddr_port(_end->addr.u.sa), 
ntohs(rtp_end->rtcp_port)
);
} else if (is_rtp) {
-   int buflen = msgb_length(msg);
-
/* Make sure we have a valid RTP header, in cases where no RTP
 * header is present, we will generate one. */
gen_rtp_header(msg, rtp_end, rtp_state);

/* Run transcoder */
-   rc = endp->trunk->cfg->rtp_processing_cb(endp, rtp_end, (char 
*)msgb_data(msg), , RTP_BUF_SIZE);
+   rc = endp->trunk->cfg->rtp_processing_cb(endp, rtp_end, msg);
if (rc < 0) {
LOGPENDP(endp, DRTP, LOGL_ERROR, "Error %d during 
transcoding\n", rc);
return rc;

--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/36357?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I002624f9008726e3d754d48aa2282c38e3b42953
Gerrit-Change-Number: 36357
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


[S] Change in osmo-mgw[master]: simplify unused transcoding/processing call-back

2024-03-20 Thread laforge
Attention is currently required from: dexter.

Hello Jenkins Builder, dexter, fixeria, pespin,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-mgw/+/36357?usp=email

to look at the new patch set (#2).

The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder

The change is no longer submittable: Verified is unsatisfied now.


Change subject: simplify unused transcoding/processing call-back
..

simplify unused transcoding/processing call-back

the processing call-back is working with a raw buffer + length,
while we actually work with struct msgb.  Let's simply pass the msgb
into the call-back, and the call-back can then do what they want with
the contents of that msgb.

Change-Id: I002624f9008726e3d754d48aa2282c38e3b42953
---
M include/osmocom/mgcp/mgcp.h
M include/osmocom/mgcp/mgcp_network.h
M src/libosmo-mgcp/mgcp_network.c
3 files changed, 20 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/57/36357/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/36357?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I002624f9008726e3d754d48aa2282c38e3b42953
Gerrit-Change-Number: 36357
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: dexter 
Gerrit-MessageType: newpatchset


[S] Change in osmo-mgw[master]: simplify unused transcoding/processing call-back

2024-03-20 Thread laforge
Attention is currently required from: dexter.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/36357?usp=email )

Change subject: simplify unused transcoding/processing call-back
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/36357?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I002624f9008726e3d754d48aa2282c38e3b42953
Gerrit-Change-Number: 36357
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Wed, 20 Mar 2024 12:56:00 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-mgw[master]: simplify unused transcoding/processing call-back

2024-03-20 Thread pespin
Attention is currently required from: dexter, laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/36357?usp=email )

Change subject: simplify unused transcoding/processing call-back
..


Patch Set 1: Code-Review+1

(1 comment)

Patchset:

PS1:
Ok now I see you are doing even more changes. Let's see if we end up doing 
something with this callback...



--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/36357?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I002624f9008726e3d754d48aa2282c38e3b42953
Gerrit-Change-Number: 36357
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Wed, 20 Mar 2024 12:37:51 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-mgw[master]: simplify unused transcoding/processing call-back

2024-03-20 Thread fixeria
Attention is currently required from: dexter, laforge, pespin.

fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/36357?usp=email )

Change subject: simplify unused transcoding/processing call-back
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/36357?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I002624f9008726e3d754d48aa2282c38e3b42953
Gerrit-Change-Number: 36357
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: pespin 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Wed, 20 Mar 2024 07:20:03 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-mgw[master]: simplify unused transcoding/processing call-back

2024-03-19 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/36357?usp=email )


Change subject: simplify unused transcoding/processing call-back
..

simplify unused transcoding/processing call-back

the processing call-back is working with a raw buffer + length,
while we actually work with struct msgb.  Let's simply pass the msgb
into the call-back, and the call-back can then do what they want with
the contents of that msgb.

Change-Id: I002624f9008726e3d754d48aa2282c38e3b42953
---
M include/osmocom/mgcp/mgcp.h
M include/osmocom/mgcp/mgcp_network.h
M src/libosmo-mgcp/mgcp_network.c
3 files changed, 20 insertions(+), 13 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/57/36357/1

diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h
index 42d67cf..bfb412b 100644
--- a/include/osmocom/mgcp/mgcp.h
+++ b/include/osmocom/mgcp/mgcp.h
@@ -70,12 +70,10 @@
 /**
  * Return:
  *   <  0 in case no audio was processed
- *   >= 0 in case audio was processed. The remaining payload
- *   length will be returned.
+ *   >= 0 in case audio was processed.
  */
 typedef int (*mgcp_processing)(struct mgcp_endpoint *endp,
-  struct mgcp_rtp_end *dst_end,
-  char *data, int *len, int buf_size);
+  struct mgcp_rtp_end *dst_end, struct msgb *msg);

 struct mgcp_conn_rtp;

diff --git a/include/osmocom/mgcp/mgcp_network.h 
b/include/osmocom/mgcp/mgcp_network.h
index a7bd333..1ec8979 100644
--- a/include/osmocom/mgcp/mgcp_network.h
+++ b/include/osmocom/mgcp/mgcp_network.h
@@ -159,8 +159,7 @@
 int mgcp_get_local_addr(char *addr, struct mgcp_conn_rtp *conn);

 /* payload processing default functions */
-int mgcp_rtp_processing_default(struct mgcp_endpoint *endp, struct 
mgcp_rtp_end *dst_end,
-   char *data, int *len, int buf_size);
+int mgcp_rtp_processing_default(struct mgcp_endpoint *endp, struct 
mgcp_rtp_end *dst_end, struct msgb *msg);

 int mgcp_setup_rtp_processing_default(struct mgcp_endpoint *endp,
  struct mgcp_conn_rtp *conn_dst,
diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index 31c02d2..4e5b307 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -404,13 +404,11 @@
 /*! dummy callback to disable transcoding (see also cfg->rtp_processing_cb).
  *  \param[in] associated endpoint.
  *  \param[in] destination RTP end.
- *  \param[in,out] pointer to buffer with voice data.
- *  \param[in] voice data length.
- *  \param[in] maximum size of caller provided voice data buffer.
+ *  \param[in,out] msg message bufffer containing data. Function might change 
length.
  *  \returns ignores input parameters, return always 0. */
 int mgcp_rtp_processing_default(struct mgcp_endpoint *endp,
struct mgcp_rtp_end *dst_end,
-   char *data, int *len, int buf_size)
+   struct msgb *msg)
 {
LOGPENDP(endp, DRTP, LOGL_DEBUG, "transcoding disabled\n");
return 0;
@@ -1168,14 +1166,12 @@
 osmo_sockaddr_port(_end->addr.u.sa), 
ntohs(rtp_end->rtcp_port)
);
} else if (is_rtp) {
-   int buflen = msgb_length(msg);
-
/* Make sure we have a valid RTP header, in cases where no RTP
 * header is present, we will generate one. */
gen_rtp_header(msg, rtp_end, rtp_state);

/* Run transcoder */
-   rc = endp->trunk->cfg->rtp_processing_cb(endp, rtp_end, (char 
*)msgb_data(msg), , RTP_BUF_SIZE);
+   rc = endp->trunk->cfg->rtp_processing_cb(endp, rtp_end, msg);
if (rc < 0) {
LOGPENDP(endp, DRTP, LOGL_ERROR, "Error %d during 
transcoding\n", rc);
return rc;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/36357?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I002624f9008726e3d754d48aa2282c38e3b42953
Gerrit-Change-Number: 36357
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange