Using mpegtsmux the correct way

I don’t understand the C code example, so a simple explanation could help. However, my goal is to implement this in Go using the generated bindings being developed by @RSWilli.

Specifically, is this correct way to get a sink pad

videoSinkPad := mpegtsmux.RequestPadSimple(someString)
audioSinkPad := mpegtsmux.RequestPadSimple(someOtherString)

and what should someString and someOtherString contain?

I need to send H265 and AAC over UDP to an ADALM-PLUTO or equivalent.

Basically, how to convert this using the @RSWilli generated bindings?

static void
advertise_service (GstElement * mux)
{
  GstMpegtsSDTService *service;
  GstMpegtsSDT *sdt;
  GstMpegtsDescriptor *desc;
  GstMpegtsSection *section;

  sdt = gst_mpegts_sdt_new ();

  sdt->actual_ts = TRUE;
  sdt->transport_stream_id = 42;

  service = gst_mpegts_sdt_service_new ();
  service->service_id = 42;
  service->running_status =
      GST_MPEGTS_RUNNING_STATUS_RUNNING + service->service_id;
  service->EIT_schedule_flag = FALSE;
  service->EIT_present_following_flag = FALSE;
  service->free_CA_mode = FALSE;

  desc = gst_mpegts_descriptor_from_dvb_service
      (GST_DVB_SERVICE_DIGITAL_TELEVISION, "some-service", NULL);

  g_ptr_array_add (service->descriptors, desc);
  g_ptr_array_add (sdt->services, service);

  section = gst_mpegts_section_from_sdt (sdt);
  gst_mpegts_section_send_event (section, mux);
  gst_mpegts_section_unref (section);
}

I have not used the go bindings but I believe someString and someOtherString should both be replaced with

“sink_%d”

including the quotes.

Thank you @jbb194, but the gstreamer documentation is far from helpful and there’s a lot more to it than that. sink_%d could be something like sink_41, but finding the numbers for HECV and ACC is proving impossible. I also think other metadata needs to be added somehow. The new generated bindings don’t have any documentation at this time, making it difficult to know if a particular data type, function, variable or constant even exists.

Hello.

When you request a pad you provide the pad template name as a string. For mpegtsmux that is ‘sink_%d’. Exactly like that, with both the underscore and the percentage sign.
So if Go works the same as C:

videoSinkPad := mpegtsmux.RequestPadSimple("sink_%d")
audioSinkPad := mpegtsmux.RequestPadSimple("sink_%d")

Where can you find the template name for a pad?
With gst-inspect, or in the docs.

How do you specify if it’s for video or audio?
For mpegtsmux you don’t specify that via the pad name, gstreamer will negotiate the caps. Or you can use capsfilters I guess.

I agree it’s confusing though, since the _%d makes it seem like some kind of placeholder and not an actual name you’re supposed to use.

Here is the C docs for request_pad_simple.