mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 05:16:13 +00:00
dvb: GstMpegTS => GstMpegTs
This commit is contained in:
parent
1f2bb15618
commit
b8ad909bd7
9 changed files with 35 additions and 35 deletions
|
@ -70,7 +70,7 @@ cam_conditional_access_destroy (CamConditionalAccess * cas)
|
||||||
}
|
}
|
||||||
|
|
||||||
static CamReturn
|
static CamReturn
|
||||||
send_ca_pmt (CamConditionalAccess * cas, GstMpegTSPMT * pmt,
|
send_ca_pmt (CamConditionalAccess * cas, GstMpegTsPMT * pmt,
|
||||||
guint8 list_management, guint8 cmd_id)
|
guint8 list_management, guint8 cmd_id)
|
||||||
{
|
{
|
||||||
CamReturn ret;
|
CamReturn ret;
|
||||||
|
@ -108,7 +108,7 @@ send_ca_pmt (CamConditionalAccess * cas, GstMpegTSPMT * pmt,
|
||||||
|
|
||||||
CamReturn
|
CamReturn
|
||||||
cam_conditional_access_set_pmt (CamConditionalAccess * cas,
|
cam_conditional_access_set_pmt (CamConditionalAccess * cas,
|
||||||
GstMpegTSPMT * pmt, CamConditionalAccessPmtFlag flag)
|
GstMpegTsPMT * pmt, CamConditionalAccessPmtFlag flag)
|
||||||
{
|
{
|
||||||
return send_ca_pmt (cas, pmt, flag, 0x01 /* ok_descrambling */ );
|
return send_ca_pmt (cas, pmt, flag, 0x01 /* ok_descrambling */ );
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,6 @@ CamConditionalAccess *cam_conditional_access_new (void);
|
||||||
void cam_conditional_access_destroy (CamConditionalAccess *cas);
|
void cam_conditional_access_destroy (CamConditionalAccess *cas);
|
||||||
|
|
||||||
CamReturn cam_conditional_access_set_pmt (CamConditionalAccess *cas,
|
CamReturn cam_conditional_access_set_pmt (CamConditionalAccess *cas,
|
||||||
GstMpegTSPMT *pmt, CamConditionalAccessPmtFlag flag);
|
GstMpegTsPMT *pmt, CamConditionalAccessPmtFlag flag);
|
||||||
|
|
||||||
#endif /* CAM_CONDITIONAL_ACCESS_H */
|
#endif /* CAM_CONDITIONAL_ACCESS_H */
|
||||||
|
|
|
@ -217,7 +217,7 @@ cam_device_ready (CamDevice * device)
|
||||||
|
|
||||||
void
|
void
|
||||||
cam_device_set_pmt (CamDevice * device,
|
cam_device_set_pmt (CamDevice * device,
|
||||||
GstMpegTSPMT * pmt, CamConditionalAccessPmtFlag flag)
|
GstMpegTsPMT * pmt, CamConditionalAccessPmtFlag flag)
|
||||||
{
|
{
|
||||||
g_return_if_fail (device != NULL);
|
g_return_if_fail (device != NULL);
|
||||||
g_return_if_fail (device->state == CAM_DEVICE_STATE_OPEN);
|
g_return_if_fail (device->state == CAM_DEVICE_STATE_OPEN);
|
||||||
|
|
|
@ -64,6 +64,6 @@ void cam_device_close (CamDevice *device);
|
||||||
gboolean cam_device_ready (CamDevice *device);
|
gboolean cam_device_ready (CamDevice *device);
|
||||||
void cam_device_poll (CamDevice *device);
|
void cam_device_poll (CamDevice *device);
|
||||||
void cam_device_set_pmt (CamDevice *device,
|
void cam_device_set_pmt (CamDevice *device,
|
||||||
GstMpegTSPMT *pmt, CamConditionalAccessPmtFlag flag);
|
GstMpegTsPMT *pmt, CamConditionalAccessPmtFlag flag);
|
||||||
|
|
||||||
#endif /* CAM_DEVICE_H */
|
#endif /* CAM_DEVICE_H */
|
||||||
|
|
|
@ -110,7 +110,7 @@ cam_sw_client_close (CamSwClient * client)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
send_ca_pmt (CamSwClient * client, GstMpegTSPMT * pmt,
|
send_ca_pmt (CamSwClient * client, GstMpegTsPMT * pmt,
|
||||||
guint8 list_management, guint8 cmd_id)
|
guint8 list_management, guint8 cmd_id)
|
||||||
{
|
{
|
||||||
guint8 *buffer;
|
guint8 *buffer;
|
||||||
|
@ -145,7 +145,7 @@ send_ca_pmt (CamSwClient * client, GstMpegTSPMT * pmt,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cam_sw_client_set_pmt (CamSwClient * client, GstMpegTSPMT * pmt)
|
cam_sw_client_set_pmt (CamSwClient * client, GstMpegTsPMT * pmt)
|
||||||
{
|
{
|
||||||
g_return_if_fail (client != NULL);
|
g_return_if_fail (client != NULL);
|
||||||
g_return_if_fail (pmt != NULL);
|
g_return_if_fail (pmt != NULL);
|
||||||
|
@ -155,7 +155,7 @@ cam_sw_client_set_pmt (CamSwClient * client, GstMpegTSPMT * pmt)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cam_sw_client_update_pmt (CamSwClient * client, GstMpegTSPMT * pmt)
|
cam_sw_client_update_pmt (CamSwClient * client, GstMpegTsPMT * pmt)
|
||||||
{
|
{
|
||||||
g_return_if_fail (client != NULL);
|
g_return_if_fail (client != NULL);
|
||||||
g_return_if_fail (pmt != NULL);
|
g_return_if_fail (pmt != NULL);
|
||||||
|
|
|
@ -48,7 +48,7 @@ void cam_sw_client_free (CamSwClient *sw_client);
|
||||||
gboolean cam_sw_client_open (CamSwClient *sw_client, const char *sock_path);
|
gboolean cam_sw_client_open (CamSwClient *sw_client, const char *sock_path);
|
||||||
void cam_sw_client_close (CamSwClient *sw_client);
|
void cam_sw_client_close (CamSwClient *sw_client);
|
||||||
|
|
||||||
void cam_sw_client_set_pmt (CamSwClient *sw_client, GstMpegTSPMT *pmt);
|
void cam_sw_client_set_pmt (CamSwClient *sw_client, GstMpegTsPMT *pmt);
|
||||||
void cam_sw_client_update_pmt (CamSwClient *sw_client, GstMpegTSPMT *pmt);
|
void cam_sw_client_update_pmt (CamSwClient *sw_client, GstMpegTsPMT *pmt);
|
||||||
|
|
||||||
#endif /* CAM_SW_CLIENT_H */
|
#endif /* CAM_SW_CLIENT_H */
|
||||||
|
|
|
@ -178,8 +178,8 @@ get_ca_descriptors_length (GArray * descriptors)
|
||||||
guint len = 0;
|
guint len = 0;
|
||||||
|
|
||||||
for (i = 0; i < nb_desc; i++) {
|
for (i = 0; i < nb_desc; i++) {
|
||||||
GstMpegTSDescriptor *desc =
|
GstMpegTsDescriptor *desc =
|
||||||
&g_array_index (descriptors, GstMpegTSDescriptor, i);
|
&g_array_index (descriptors, GstMpegTsDescriptor, i);
|
||||||
if (desc->descriptor_tag == 0x09)
|
if (desc->descriptor_tag == 0x09)
|
||||||
len += desc->descriptor_length;
|
len += desc->descriptor_length;
|
||||||
}
|
}
|
||||||
|
@ -194,8 +194,8 @@ write_ca_descriptors (guint8 * body, GArray * descriptors)
|
||||||
|
|
||||||
nb_desc = descriptors->len;
|
nb_desc = descriptors->len;
|
||||||
for (i = 0; i < nb_desc; i++) {
|
for (i = 0; i < nb_desc; i++) {
|
||||||
GstMpegTSDescriptor *desc =
|
GstMpegTsDescriptor *desc =
|
||||||
&g_array_index (descriptors, GstMpegTSDescriptor, i);
|
&g_array_index (descriptors, GstMpegTsDescriptor, i);
|
||||||
if (desc->descriptor_tag == 0x09) {
|
if (desc->descriptor_tag == 0x09) {
|
||||||
memcpy (body, desc->descriptor_data, desc->descriptor_length);
|
memcpy (body, desc->descriptor_data, desc->descriptor_length);
|
||||||
body += desc->descriptor_length;
|
body += desc->descriptor_length;
|
||||||
|
@ -206,10 +206,10 @@ write_ca_descriptors (guint8 * body, GArray * descriptors)
|
||||||
}
|
}
|
||||||
|
|
||||||
guint8 *
|
guint8 *
|
||||||
cam_build_ca_pmt (GstMpegTSPMT * pmt, guint8 list_management, guint8 cmd_id,
|
cam_build_ca_pmt (GstMpegTsPMT * pmt, guint8 list_management, guint8 cmd_id,
|
||||||
guint * size)
|
guint * size)
|
||||||
{
|
{
|
||||||
GstMpegTSSection *section = (GstMpegTSSection *) pmt;
|
GstMpegTsSection *section = (GstMpegTsSection *) pmt;
|
||||||
guint body_size = 0;
|
guint body_size = 0;
|
||||||
guint8 *buffer;
|
guint8 *buffer;
|
||||||
guint8 *body;
|
guint8 *body;
|
||||||
|
@ -227,7 +227,7 @@ cam_build_ca_pmt (GstMpegTSPMT * pmt, guint8 list_management, guint8 cmd_id,
|
||||||
body_size += 6 + len;
|
body_size += 6 + len;
|
||||||
|
|
||||||
for (i = 0; i < pmt->streams->len; i++) {
|
for (i = 0; i < pmt->streams->len; i++) {
|
||||||
GstMpegTSPMTStream *pmtstream = g_ptr_array_index (pmt->streams, i);
|
GstMpegTsPMTStream *pmtstream = g_ptr_array_index (pmt->streams, i);
|
||||||
|
|
||||||
len = get_ca_descriptors_length (pmtstream->descriptors);
|
len = get_ca_descriptors_length (pmtstream->descriptors);
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
|
@ -271,7 +271,7 @@ cam_build_ca_pmt (GstMpegTSPMT * pmt, guint8 list_management, guint8 cmd_id,
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < pmt->streams->len; i++) {
|
for (i = 0; i < pmt->streams->len; i++) {
|
||||||
GstMpegTSPMTStream *pmtstream = g_ptr_array_index (pmt->streams, i);
|
GstMpegTsPMTStream *pmtstream = g_ptr_array_index (pmt->streams, i);
|
||||||
|
|
||||||
*body++ = pmtstream->stream_type;
|
*body++ = pmtstream->stream_type;
|
||||||
GST_WRITE_UINT16_BE (body, pmtstream->pid);
|
GST_WRITE_UINT16_BE (body, pmtstream->pid);
|
||||||
|
|
|
@ -55,6 +55,6 @@ typedef enum
|
||||||
guint8 cam_calc_length_field_size (guint length);
|
guint8 cam_calc_length_field_size (guint length);
|
||||||
guint8 cam_write_length_field (guint8 *buff, guint length);
|
guint8 cam_write_length_field (guint8 *buff, guint length);
|
||||||
guint8 cam_read_length_field (guint8 *buff, guint *length);
|
guint8 cam_read_length_field (guint8 *buff, guint *length);
|
||||||
guint8 *cam_build_ca_pmt (GstMpegTSPMT *pmt, guint8 list_management, guint8 cmd_id, guint *size);
|
guint8 *cam_build_ca_pmt (GstMpegTsPMT *pmt, guint8 list_management, guint8 cmd_id, guint *size);
|
||||||
|
|
||||||
#endif /* CAM_UTILS_H */
|
#endif /* CAM_UTILS_H */
|
||||||
|
|
|
@ -85,8 +85,8 @@ typedef struct
|
||||||
gint program_number;
|
gint program_number;
|
||||||
guint16 pmt_pid;
|
guint16 pmt_pid;
|
||||||
guint16 pcr_pid;
|
guint16 pcr_pid;
|
||||||
GstMpegTSPMT *pmt;
|
GstMpegTsPMT *pmt;
|
||||||
GstMpegTSPMT *old_pmt;
|
GstMpegTsPMT *old_pmt;
|
||||||
gboolean selected;
|
gboolean selected;
|
||||||
gboolean pmt_active;
|
gboolean pmt_active;
|
||||||
gboolean active;
|
gboolean active;
|
||||||
|
@ -106,9 +106,9 @@ static GstStateChangeReturn dvb_base_bin_change_state (GstElement * element,
|
||||||
GstStateChange transition);
|
GstStateChange transition);
|
||||||
static void dvb_base_bin_handle_message (GstBin * bin, GstMessage * message);
|
static void dvb_base_bin_handle_message (GstBin * bin, GstMessage * message);
|
||||||
static void dvb_base_bin_pat_info_cb (DvbBaseBin * dvbbasebin,
|
static void dvb_base_bin_pat_info_cb (DvbBaseBin * dvbbasebin,
|
||||||
GstMpegTSSection * pat);
|
GstMpegTsSection * pat);
|
||||||
static void dvb_base_bin_pmt_info_cb (DvbBaseBin * dvbbasebin,
|
static void dvb_base_bin_pmt_info_cb (DvbBaseBin * dvbbasebin,
|
||||||
GstMpegTSSection * pmt);
|
GstMpegTsSection * pmt);
|
||||||
static GstPad *dvb_base_bin_request_new_pad (GstElement * element,
|
static GstPad *dvb_base_bin_request_new_pad (GstElement * element,
|
||||||
GstPadTemplate * templ, const gchar * name, const GstCaps * caps);
|
GstPadTemplate * templ, const gchar * name, const GstCaps * caps);
|
||||||
static void dvb_base_bin_release_pad (GstElement * element, GstPad * pad);
|
static void dvb_base_bin_release_pad (GstElement * element, GstPad * pad);
|
||||||
|
@ -541,7 +541,7 @@ dvb_base_bin_reset_pmtlist (DvbBaseBin * dvbbasebin)
|
||||||
{
|
{
|
||||||
CamConditionalAccessPmtFlag flag;
|
CamConditionalAccessPmtFlag flag;
|
||||||
GList *walk;
|
GList *walk;
|
||||||
GstMpegTSPMT *pmt;
|
GstMpegTsPMT *pmt;
|
||||||
|
|
||||||
walk = dvbbasebin->pmtlist;
|
walk = dvbbasebin->pmtlist;
|
||||||
while (walk) {
|
while (walk) {
|
||||||
|
@ -557,7 +557,7 @@ dvb_base_bin_reset_pmtlist (DvbBaseBin * dvbbasebin)
|
||||||
flag = CAM_CONDITIONAL_ACCESS_PMT_FLAG_MORE;
|
flag = CAM_CONDITIONAL_ACCESS_PMT_FLAG_MORE;
|
||||||
}
|
}
|
||||||
|
|
||||||
pmt = (GstMpegTSPMT *) walk->data;
|
pmt = (GstMpegTsPMT *) walk->data;
|
||||||
cam_device_set_pmt (dvbbasebin->hwcam, pmt, flag);
|
cam_device_set_pmt (dvbbasebin->hwcam, pmt, flag);
|
||||||
|
|
||||||
walk = walk->next;
|
walk = walk->next;
|
||||||
|
@ -661,13 +661,13 @@ dvb_base_bin_rebuild_filter (DvbBaseBin * dvbbasebin)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dvb_base_bin_remove_pmt_streams (DvbBaseBin * dvbbasebin, GstMpegTSPMT * pmt)
|
dvb_base_bin_remove_pmt_streams (DvbBaseBin * dvbbasebin, GstMpegTsPMT * pmt)
|
||||||
{
|
{
|
||||||
gint i;
|
gint i;
|
||||||
DvbBaseBinStream *stream;
|
DvbBaseBinStream *stream;
|
||||||
|
|
||||||
for (i = 0; i < pmt->streams->len; i++) {
|
for (i = 0; i < pmt->streams->len; i++) {
|
||||||
GstMpegTSPMTStream *pmtstream = g_ptr_array_index (pmt->streams, i);
|
GstMpegTsPMTStream *pmtstream = g_ptr_array_index (pmt->streams, i);
|
||||||
|
|
||||||
stream = dvb_base_bin_get_stream (dvbbasebin, pmtstream->pid);
|
stream = dvb_base_bin_get_stream (dvbbasebin, pmtstream->pid);
|
||||||
if (stream == NULL) {
|
if (stream == NULL) {
|
||||||
|
@ -681,13 +681,13 @@ dvb_base_bin_remove_pmt_streams (DvbBaseBin * dvbbasebin, GstMpegTSPMT * pmt)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dvb_base_bin_add_pmt_streams (DvbBaseBin * dvbbasebin, GstMpegTSPMT * pmt)
|
dvb_base_bin_add_pmt_streams (DvbBaseBin * dvbbasebin, GstMpegTsPMT * pmt)
|
||||||
{
|
{
|
||||||
DvbBaseBinStream *stream;
|
DvbBaseBinStream *stream;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
for (i = 0; i < pmt->streams->len; i++) {
|
for (i = 0; i < pmt->streams->len; i++) {
|
||||||
GstMpegTSPMTStream *pmtstream = g_ptr_array_index (pmt->streams, i);
|
GstMpegTsPMTStream *pmtstream = g_ptr_array_index (pmt->streams, i);
|
||||||
|
|
||||||
GST_DEBUG ("filtering stream %d stream_type %d", pmtstream->pid,
|
GST_DEBUG ("filtering stream %d stream_type %d", pmtstream->pid,
|
||||||
pmtstream->stream_type);
|
pmtstream->stream_type);
|
||||||
|
@ -776,7 +776,7 @@ dvb_base_bin_handle_message (GstBin * bin, GstMessage * message)
|
||||||
dvbbasebin = GST_DVB_BASE_BIN (bin);
|
dvbbasebin = GST_DVB_BASE_BIN (bin);
|
||||||
|
|
||||||
if (GST_ELEMENT (message->src) == GST_ELEMENT (dvbbasebin->tsparse)) {
|
if (GST_ELEMENT (message->src) == GST_ELEMENT (dvbbasebin->tsparse)) {
|
||||||
GstMpegTSSection *section = gst_message_parse_mpegts_section (message);
|
GstMpegTsSection *section = gst_message_parse_mpegts_section (message);
|
||||||
|
|
||||||
if (section) {
|
if (section) {
|
||||||
switch (GST_MPEGTS_SECTION_TYPE (section)) {
|
switch (GST_MPEGTS_SECTION_TYPE (section)) {
|
||||||
|
@ -800,7 +800,7 @@ dvb_base_bin_handle_message (GstBin * bin, GstMessage * message)
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dvb_base_bin_pat_info_cb (DvbBaseBin * dvbbasebin, GstMpegTSSection * section)
|
dvb_base_bin_pat_info_cb (DvbBaseBin * dvbbasebin, GstMpegTsSection * section)
|
||||||
{
|
{
|
||||||
GArray *pat;
|
GArray *pat;
|
||||||
DvbBaseBinProgram *program;
|
DvbBaseBinProgram *program;
|
||||||
|
@ -815,7 +815,7 @@ dvb_base_bin_pat_info_cb (DvbBaseBin * dvbbasebin, GstMpegTSSection * section)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < pat->len; i++) {
|
for (i = 0; i < pat->len; i++) {
|
||||||
GstMpegTSPatProgram *patp = &g_array_index (pat, GstMpegTSPatProgram, i);
|
GstMpegTsPatProgram *patp = &g_array_index (pat, GstMpegTsPatProgram, i);
|
||||||
|
|
||||||
program = dvb_base_bin_get_program (dvbbasebin, patp->program_number);
|
program = dvb_base_bin_get_program (dvbbasebin, patp->program_number);
|
||||||
if (program == NULL)
|
if (program == NULL)
|
||||||
|
@ -844,9 +844,9 @@ dvb_base_bin_pat_info_cb (DvbBaseBin * dvbbasebin, GstMpegTSSection * section)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dvb_base_bin_pmt_info_cb (DvbBaseBin * dvbbasebin, GstMpegTSSection * section)
|
dvb_base_bin_pmt_info_cb (DvbBaseBin * dvbbasebin, GstMpegTsSection * section)
|
||||||
{
|
{
|
||||||
GstMpegTSPMT *pmt = (GstMpegTSPMT *) section;
|
GstMpegTsPMT *pmt = (GstMpegTsPMT *) section;
|
||||||
DvbBaseBinProgram *program;
|
DvbBaseBinProgram *program;
|
||||||
guint program_number;
|
guint program_number;
|
||||||
|
|
||||||
|
@ -860,7 +860,7 @@ dvb_base_bin_pmt_info_cb (DvbBaseBin * dvbbasebin, GstMpegTSSection * section)
|
||||||
}
|
}
|
||||||
|
|
||||||
program->old_pmt = program->pmt;
|
program->old_pmt = program->pmt;
|
||||||
program->pmt = (GstMpegTSPMT *) gst_mpegts_section_ref (pmt);
|
program->pmt = (GstMpegTsPMT *) gst_mpegts_section_ref (pmt);
|
||||||
|
|
||||||
/* activate the program if it's selected and either it's not active or its pmt
|
/* activate the program if it's selected and either it's not active or its pmt
|
||||||
* changed */
|
* changed */
|
||||||
|
|
Loading…
Reference in a new issue