Skip to content

Commit 3aff872

Browse files
committed
rxtx: drop keyword video also from internal symbols
for those modules that process both audio and video now
1 parent 6f609f6 commit 3aff872

5 files changed

Lines changed: 55 additions & 57 deletions

File tree

src/rxtx/h264_sdp.c

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ struct audio_frame2;
7171

7272
#define MAGIC to_fourcc('V', 'X', 'h', 's')
7373

74-
struct h264_sdp_video_rxtx {
74+
struct sdp_rxtx {
7575
uint32_t magic;
7676
struct sdp *sdp_state;
7777

@@ -92,9 +92,9 @@ static void change_address_callback(void *udata, const char *address);
9292
static void done(void *state);
9393

9494
static void *
95-
create_video_rxtx_h264_sdp(const struct rxtx_params *params)
95+
create_rxtx_h264_sdp(const struct rxtx_params *params)
9696
{
97-
struct h264_sdp_video_rxtx *s = calloc(1, sizeof *s);
97+
struct sdp_rxtx *s = calloc(1, sizeof *s);
9898

9999
s->magic = MAGIC;
100100
s->audio_tx_port = -1;
@@ -165,7 +165,7 @@ sdp_send_change_address_message(struct module *root,
165165
static void
166166
change_address_callback(void *udata, const char *address)
167167
{
168-
struct h264_sdp_video_rxtx *s = udata;
168+
struct sdp_rxtx *s = udata;
169169
if (s->saved_addr == address) {
170170
return;
171171
}
@@ -183,7 +183,7 @@ change_address_callback(void *udata, const char *address)
183183
}
184184

185185
static bool
186-
h264_sdp_add_video(struct h264_sdp_video_rxtx *s, codec_t codec)
186+
h264_sdp_add_video(struct sdp_rxtx *s, codec_t codec)
187187
{
188188
const int rc = sdp_add_video(s->sdp_state, s->video_tx_port, codec);
189189
if (rc == -2) {
@@ -203,7 +203,7 @@ h264_sdp_add_video(struct h264_sdp_video_rxtx *s, codec_t codec)
203203
* stream is detected.
204204
*/
205205
static void
206-
send_frame_impl(struct h264_sdp_video_rxtx *s, struct video_frame *tx_frame)
206+
send_frame_impl(struct sdp_rxtx *s, struct video_frame *tx_frame)
207207
{
208208
struct rtp_rxtx_medium *video = &s->rtp_common->medium[TX_MEDIA_VIDEO];
209209

@@ -239,13 +239,13 @@ send_frame_impl(struct h264_sdp_video_rxtx *s, struct video_frame *tx_frame)
239239
/// wraps send_frame_impl to ensure tx_frame is disposed across all code paths
240240
static void
241241
send_frame(void *state, struct video_frame *tx_frame) {
242-
struct h264_sdp_video_rxtx *s = state;
242+
struct sdp_rxtx *s = state;
243243
send_frame_impl(s, tx_frame);
244244
tx_frame->callbacks.dispose(tx_frame);
245245
}
246246

247247
static void done(void *state) {
248-
struct h264_sdp_video_rxtx *s = state;
248+
struct sdp_rxtx *s = state;
249249

250250
rtp_rxtx_common_done(s->rtp_common);
251251
sdp_done(s->sdp_state);
@@ -254,7 +254,7 @@ static void done(void *state) {
254254
}
255255

256256
static void
257-
configure_audio(struct h264_sdp_video_rxtx *s, const struct audio_frame2 *frame)
257+
configure_audio(struct sdp_rxtx *s, const struct audio_frame2 *frame)
258258
{
259259
const struct audio_desc desc = audio_frame2_get_desc(frame);
260260
MSG(VERBOSE, "Setting audio desc %s to SDP.\n",
@@ -272,7 +272,7 @@ configure_audio(struct h264_sdp_video_rxtx *s, const struct audio_frame2 *frame)
272272
static void
273273
h264_sdp_send_audio_frame(void *state, const struct audio_frame2 *frame)
274274
{
275-
struct h264_sdp_video_rxtx *s = state;
275+
struct sdp_rxtx *s = state;
276276

277277
rtp_rxtx_sender_do_housekeeping(s->rtp_common, TX_MEDIA_AUDIO);
278278

@@ -288,7 +288,7 @@ static bool
288288
h264_sdp_ctl_property(void *state, enum rxtx_property p,
289289
void *val, size_t *len)
290290
{
291-
struct h264_sdp_video_rxtx *s = state;
291+
struct sdp_rxtx *s = state;
292292
assert(s->magic == MAGIC);
293293
switch (p) {
294294
case GET_RTP_COMMON_STATE: {
@@ -318,13 +318,13 @@ h264_sdp_ctl_property(void *state, enum rxtx_property p,
318318
static struct rx_audio_frames *
319319
h264_sdp_recv_audio_frame(void *state)
320320
{
321-
struct h264_sdp_video_rxtx *s = state;
321+
struct sdp_rxtx *s = state;
322322
return rtp_recv_audio_frame(s->rtp_common, decode_audio_frame_mulaw);
323323
}
324324

325-
static const struct rxtx_info h264_sdp_video_rxtx_info = {
325+
static const struct rxtx_info sdp_rxtx_info = {
326326
.long_name = "RTP standard (SDP version)",
327-
.create = create_video_rxtx_h264_sdp,
327+
.create = create_rxtx_h264_sdp,
328328
.done = done,
329329
.ctl_property = h264_sdp_ctl_property,
330330

@@ -337,5 +337,4 @@ static const struct rxtx_info h264_sdp_video_rxtx_info = {
337337
.join_video_sender = nullptr,
338338
};
339339

340-
REGISTER_MODULE(sdp, &h264_sdp_video_rxtx_info, LIBRARY_CLASS_RXTX, RXTX_ABI_VERSION);
341-
340+
REGISTER_MODULE(sdp, &sdp_rxtx_info, LIBRARY_CLASS_RXTX, RXTX_ABI_VERSION);

src/rxtx/jack_audio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct audio_frame2;
2323
#define MOD_NAME "[rxtx/jack] "
2424

2525
struct jack_audio_rxtx {
26-
void *jack_connection;
26+
void *jack_connection;
2727
struct rxtx *video_rxtx;
2828
};
2929

src/rxtx/loopback.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ done(void *state)
322322
free(s);
323323
}
324324

325-
static const struct rxtx_info loopback_video_rxtx_info = {
325+
static const struct rxtx_info loopback_rxtx_info = {
326326
.long_name = "loopback dummy transport",
327327
.create = init,
328328
.done = done,
@@ -337,5 +337,5 @@ static const struct rxtx_info loopback_video_rxtx_info = {
337337
.join_video_sender = nullptr,
338338
};
339339

340-
REGISTER_MODULE(loopback, &loopback_video_rxtx_info, LIBRARY_CLASS_RXTX, RXTX_ABI_VERSION);
341-
340+
REGISTER_MODULE(loopback, &loopback_rxtx_info, LIBRARY_CLASS_RXTX,
341+
RXTX_ABI_VERSION);

src/rxtx/rtsp.c

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ struct tx;
7676
#define MOD_NAME "[rxtx/rtsp] "
7777
#define MAGIC to_fourcc('R', 'T', 'r', 's')
7878

79-
struct h264_rtp_video_rxtx {
79+
struct h264_rtp_rxtx {
8080
uint32_t magic;
8181

8282
struct rtp_rxtx_common *rtp_common;
@@ -96,7 +96,7 @@ static void rtps_server_usage();
9696
static int get_rtsp_server_port(const char *config);
9797

9898
static void *
99-
create_video_rxtx_h264_std(const struct rxtx_params *params)
99+
create_rxtx_rtsp(const struct rxtx_params *params)
100100
{
101101
int rtsp_port = 0;
102102
const char *rtsp_port_str = params->protocol_opts;
@@ -110,7 +110,7 @@ create_video_rxtx_h264_std(const struct rxtx_params *params)
110110
return nullptr;
111111
}
112112
}
113-
struct h264_rtp_video_rxtx *s = calloc(1, sizeof *s);
113+
struct h264_rtp_rxtx *s = calloc(1, sizeof *s);
114114
s->magic = MAGIC;
115115
s->parent = params->parent;
116116
s->start_time = params->start_time;
@@ -144,10 +144,10 @@ create_video_rxtx_h264_std(const struct rxtx_params *params)
144144
* this function is used to configure their RTSP server either
145145
* for video-only or using both audio and video. For audio-only
146146
* RTSP server, the server is run directly from
147-
* h264_rtp_video_rxtx::set_audio_spec().
147+
* configure_audio().
148148
*/
149149
static void
150-
configure_rtsp_server_video(struct h264_rtp_video_rxtx *s)
150+
configure_rtsp_server_video(struct h264_rtp_rxtx *s)
151151
{
152152
assert((s->rtsp_params.avType & rtsp_type_video) != 0);
153153
switch (s->rtsp_params.video_codec) {
@@ -178,7 +178,7 @@ configure_rtsp_server_video(struct h264_rtp_video_rxtx *s)
178178
}
179179

180180
static void
181-
send_frame_impl(struct h264_rtp_video_rxtx *s, struct video_frame *tx_frame)
181+
send_frame_impl(struct h264_rtp_rxtx *s, struct video_frame *tx_frame)
182182
{
183183
struct rtp_rxtx_medium *video = &s->rtp_common->medium[TX_MEDIA_VIDEO];
184184

@@ -213,15 +213,15 @@ send_frame_impl(struct h264_rtp_video_rxtx *s, struct video_frame *tx_frame)
213213
static void
214214
send_frame(void *state, struct video_frame *tx_frame)
215215
{
216-
struct h264_rtp_video_rxtx *s = state;
216+
struct h264_rtp_rxtx *s = state;
217217
send_frame_impl(s, tx_frame);
218218
tx_frame->callbacks.dispose(tx_frame);
219219
}
220220

221221
static void
222222
join(void *state)
223223
{
224-
struct h264_rtp_video_rxtx *s = state;
224+
struct h264_rtp_rxtx *s = state;
225225
stop_rtsp_server(s->rtsp_server);
226226
s->rtsp_server = nullptr;
227227
}
@@ -259,13 +259,13 @@ static int get_rtsp_server_port(const char *config) {
259259
}
260260

261261
static void done(void *state) {
262-
struct h264_rtp_video_rxtx *s = state;
262+
struct h264_rtp_rxtx *s = state;
263263
rtp_rxtx_common_done(s->rtp_common);
264264
free(s);
265265
}
266266

267267
static void
268-
configure_audio(struct h264_rtp_video_rxtx *s, const struct audio_frame2 *frame)
268+
configure_audio(struct h264_rtp_rxtx *s, const struct audio_frame2 *frame)
269269
{
270270
s->rtsp_params.adesc = audio_frame2_get_desc(frame);
271271
MSG(VERBOSE, "Setting audio desc %s to RTSP.\n",
@@ -281,7 +281,7 @@ configure_audio(struct h264_rtp_video_rxtx *s, const struct audio_frame2 *frame)
281281
static void
282282
h264_rtp_send_audio_frame(void *state, const struct audio_frame2 *frame)
283283
{
284-
struct h264_rtp_video_rxtx *s = state;
284+
struct h264_rtp_rxtx *s = state;
285285

286286
rtp_rxtx_sender_do_housekeeping(s->rtp_common, TX_MEDIA_AUDIO);
287287

@@ -297,7 +297,7 @@ static bool
297297
h264_rtp_ctl_property(void *state, enum rxtx_property p,
298298
void *val, size_t *len)
299299
{
300-
struct h264_rtp_video_rxtx *s = state;
300+
struct h264_rtp_rxtx *s = state;
301301
assert(s->magic == MAGIC);
302302
switch (p) {
303303
case GET_RTP_COMMON_STATE: {
@@ -327,13 +327,13 @@ h264_rtp_ctl_property(void *state, enum rxtx_property p,
327327
static struct rx_audio_frames *
328328
h264_rtp_recv_audio_frame(void *state)
329329
{
330-
struct h264_rtp_video_rxtx *s = state;
330+
struct h264_rtp_rxtx *s = state;
331331
return rtp_recv_audio_frame(s->rtp_common, decode_audio_frame_mulaw);
332332
}
333333

334-
static const struct rxtx_info h264_video_rxtx_info = {
334+
static const struct rxtx_info rtsp_rxtx_info = {
335335
.long_name = "RTP standard (using RTSP)",
336-
.create = create_video_rxtx_h264_std,
336+
.create = create_rxtx_rtsp,
337337
.done = done,
338338
.ctl_property = h264_rtp_ctl_property,
339339

@@ -346,5 +346,4 @@ static const struct rxtx_info h264_video_rxtx_info = {
346346
.join_video_sender = join,
347347
};
348348

349-
REGISTER_MODULE(rtsp, &h264_video_rxtx_info, LIBRARY_CLASS_RXTX, RXTX_ABI_VERSION);
350-
349+
REGISTER_MODULE(rtsp, &rtsp_rxtx_info, LIBRARY_CLASS_RXTX, RXTX_ABI_VERSION);

0 commit comments

Comments
 (0)