AW: unknown type name 'GstMpegTsDescriptor'
Bernhard Graaf
bernhard.graaf at gmx.de
Mon Jan 12 07:11:20 PST 2015
I have installed a new version of ubuntu 14.10 with gstreamer 1.4.3
included, have also installed the development-packets. But I get the same
result: unknown type name 'GstMpegTsDescriptor'
The right mpegts.h is loaded and the header files are also in the right
directory.
My Makefile:
OBJECTS = bgls_rec2_3gst.o
LIBS = `pkg-config --libs gstreamer-1.0 --cflags` -lmysqlclient
-lgstmpegts-1.0
CFLAGS = -c -Wall -W -Wformat-nonliteral -Wcast-align -Wpointer-arith \
-Wbad-function-cast -Winline -Wundef -Wnested-externs
-Wcast-qual \
-Wshadow -Wwrite-strings -Wno-unused-parameter -Wfloat-equal
-pedantic -ansi -std=c99
bgls_rec_epg: $(OBJECTS)
gcc -o $@ $(OBJECTS) $(LIBS)
%.o: %.c
gcc $(CFLAGS) $< $(LIBS)
The regarding code from the C-file:
#define GST_USE_UNSTABLE_API
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <gst/gst.h>
#include <glib.h>
#include <syslog.h>
#include <sys/time.h>
#include <sys/select.h>
#include <mysql/mysql.h>
#include <gst/mpegts/mpegts.h>
static void
dump_descriptors (GPtrArray * descriptors, guint spacing, GstDateTime
*start_time, guint32 duration, guint16 sid, gint actual)
{
guint i;
gint day=0, month=0, year=0;
gint hour=0, minute=0;
guint32 dur = 0;
guint t_hour = 0, t_min = 0;
char tmp_str2[20];
char tmp_str[8192];
struct tm newtime;
unsigned int x;
if(!start_time) return;
year = gst_date_time_get_year(start_time);
month = gst_date_time_get_month(start_time);
day = gst_date_time_get_day(start_time);
hour = gst_date_time_get_hour(start_time);
minute = gst_date_time_get_minute(start_time);
dur = duration;
newtime.tm_year = year-1900; newtime.tm_mon = month-1; newtime.tm_mday =
day;
if(difftime(t,mktime(&newtime)) < 0) return; // Nur die nächsten 14 Tage
dur = dur / 60;
t_hour = dur / 60;
t_min = dur - (t_hour * 60);
sprintf(tmp_str2, "%i%02i%02i%02i%05i", day, month, hour, minute, sid);
printf("Am '%i-%02i-%02i' um '%02i:%02i' Uhr (Laufzeit=%u)\n", year,
month, day, hour, minute, duration);
for (i = 0; i < descriptors->len; i++)
{
GstMpegTsDescriptor *desc = g_ptr_array_index (descriptors, i);
switch (desc->tag)
{
case GST_MTS_DESC_DVB_SHORT_EVENT:
{
gchar *language_code, *event_name, *text;
if (gst_mpegts_descriptor_parse_dvb_short_event (desc,
&language_code, &event_name, &text))
{
for(x=0; x<strlen(event_name); ++x) { if((event_name[x] == '\'')
|| (event_name[x] == '"')) event_name[x] = ' '; }
if(text) { for(x=0; x<strlen(text); ++x) { if((text[x] == '\'') ||
(text[x] == '"')) text[x] = ' '; } }
if(actual != GST_MPEGTS_RUNNING_STATUS_OFF_AIR)
{
if((text) && (strlen(text)>0)) sprintf(tmp_str,"INSERT INTO EPG
VALUES(\"%i\",\"%s\",\"%s\",NULL,NULL,\"%i-%02i-%02i\",\"%02i:%02i:00\",\"%0
2i:%02i:00\",%s)",sid,event_name,text,year,month,day,hour,minute,t_hour,
t_min,tmp_str2);
else sprintf(tmp_str,"INSERT INTO EPG VALUES(\"%i\",\"%s\",\"
\",NULL,NULL,\"%i-%02i-%02i\",\"%02i:%02i:00\",\"%02i:%02i:00\",%s)",sid,eve
nt_name,year,month,day,hour,minute,t_hour, t_min,tmp_str2);
}
else sprintf(tmp_str,"DELETE FROM EPG WHERE ID=%s", tmp_str2);
// g_print("%s (event=%u/text=%u)\n", tmp_str, strlen(event_name),
strlen(text));
mysql_query(my, tmp_str);
g_free (language_code);
g_free (event_name);
if(text) g_free (text);
}
}
break;
default: break;
}
}
}
static void dump_eit (GstMpegTsSection * section)
{
const GstMpegTsEIT *eit = gst_mpegts_section_get_eit (section);
guint i, len;
guint16 sid;
if (!eit) return;
if(func != EPG) return;
sid = section->subtable_extension;
len = eit->events->len;
g_print (" service_id %i: %d Event(s)\n", sid, len);
for (i = 0; i < len; i++) {
GstMpegTsEITEvent *event = g_ptr_array_index (eit->events, i);
dump_descriptors (event->descriptors, 9, event->start_time,
event->duration, sid, event->running_status);
}
}
static gboolean
dvb_bus_call (GstBus *tmp_bus,
GstMessage *msg,
gpointer data)
{
switch (GST_MESSAGE_TYPE (msg)) {
case GST_MESSAGE_EOS:
g_print ("End of stream\n");
syslog(LOG_ERR, "End of stream\n");
g_main_loop_quit (loop);
break;
case GST_MESSAGE_ERROR: {
gchar *debug;
GError *error;
gst_message_parse_error (msg, &error, &debug);
g_free (debug);
g_printerr ("%s\n", error->message);
syslog(LOG_ERR, "%s\n",error->message);
g_error_free (error);
g_main_loop_quit (loop);
break;
}
case GST_MESSAGE_ELEMENT:
{
GstMpegTsSection *section;
if ((section = gst_message_parse_mpegts_section (msg)))
{
if (GST_MPEGTS_SECTION_TYPE (section) == GST_MPEGTS_SECTION_EIT)
dump_eit (section);
if(section) gst_mpegts_section_unref (section);
}
break;
}
default:
break;
}
return TRUE;
}
But with make I get this result:
gcc -c -Wall -W -Wformat-nonliteral -Wcast-align -Wpointer-arith
-Wbad-function-cast -Winline -Wundef -Wnested-externs -Wcast-qual -Wshadow
-Wwrite-strings -Wno-unused-parameter -Wfloat-equal -pedantic -ansi -std=c99
bgls_rec2_3gst.c `pkg-config --libs gstreamer-1.0 --cflags` -lmysqlclient
-lgstmpegts-1.0
In file included from /usr/local/include/gstreamer-1.0/gst/gstpad.h:69:0,
from /usr/local/include/gstreamer-1.0/gst/gstelement.h:57,
from /usr/local/include/gstreamer-1.0/gst/gstbin.h:27,
from /usr/local/include/gstreamer-1.0/gst/gst.h:35,
from bgls_rec2_3gst.c:11:
/usr/local/include/gstreamer-1.0/gst/gstcaps.h: In function gst_caps_copy:
/usr/local/include/gstreamer-1.0/gst/gstminiobject.h:33:45: warning: cast
discards __attribute__((const)) qualifier from pointer target type
[-Wcast-qual]
#define GST_MINI_OBJECT_CAST(obj) ((GstMiniObject*)(obj))
^
/usr/local/include/gstreamer-1.0/gst/gstcaps.h:35:47: note: in definition of
macro GST_CAPS_CAST
#define GST_CAPS_CAST(obj) ((GstCaps*)(obj))
^
/usr/local/include/gstreamer-1.0/gst/gstcaps.h:256:10: note: in expansion of
macro GST_CAPS
return GST_CAPS (gst_mini_object_copy (GST_MINI_OBJECT_CAST (caps)));
^
/usr/local/include/gstreamer-1.0/gst/gstcaps.h:256:42: note: in expansion of
macro GST_MINI_OBJECT_CAST
return GST_CAPS (gst_mini_object_copy (GST_MINI_OBJECT_CAST (caps)));
^
In file included from /usr/local/include/gstreamer-1.0/gst/gstevent.h:179:0,
from
/usr/local/include/gstreamer-1.0/gst/gstpadtemplate.h:36,
from /usr/local/include/gstreamer-1.0/gst/gstpad.h:70,
from /usr/local/include/gstreamer-1.0/gst/gstelement.h:57,
from /usr/local/include/gstreamer-1.0/gst/gstbin.h:27,
from /usr/local/include/gstreamer-1.0/gst/gst.h:35,
from bgls_rec2_3gst.c:11:
/usr/local/include/gstreamer-1.0/gst/gsttaglist.h: In function
gst_tag_list_copy:
/usr/local/include/gstreamer-1.0/gst/gstminiobject.h:33:45: warning: cast
discards __attribute__((const)) qualifier from pointer target type
[-Wcast-qual]
#define GST_MINI_OBJECT_CAST(obj) ((GstMiniObject*)(obj))
^
/usr/local/include/gstreamer-1.0/gst/gsttaglist.h:159:48: note: in
definition of macro GST_TAG_LIST
#define GST_TAG_LIST(x) ((GstTagList *) (x))
^
/usr/local/include/gstreamer-1.0/gst/gsttaglist.h:441:46: note: in expansion
of macro GST_MINI_OBJECT_CAST
return GST_TAG_LIST (gst_mini_object_copy (GST_MINI_OBJECT_CAST
(taglist)));
^
bgls_rec2_3gst.c: In function dump_descriptors:
bgls_rec2_3gst.c:80:5: error: unknown type name GstMpegTsDescriptor
GstMpegTsDescriptor *desc = g_ptr_array_index (descriptors, i);
^
bgls_rec2_3gst.c:81:17: error: request for member tag in something not a
structure or union
switch (desc->tag)
^
bgls_rec2_3gst.c:86:9: warning: passing argument 1 of
gst_mpegts_descriptor_parse_dvb_short_event from incompatible pointer type
[enabled by default]
if (gst_mpegts_descriptor_parse_dvb_short_event (desc,
&language_code, &event_name, &text))
^
In file included from
/usr/local/include/gstreamer-1.0/gst/mpegts/mpegts.h:33:0,
from bgls_rec2_3gst.c:17:
/usr/local/include/gstreamer-1.0/gst/mpegts/gst-dvb-descriptor.h:468:10:
note: expected const struct GstMpegtsDescriptor * but argument is of type
int *
gboolean gst_mpegts_descriptor_parse_dvb_short_event (const
GstMpegtsDescriptor *descriptor,
^
bgls_rec2_3gst.c: At top level:
bgls_rec2_3gst.c:106:23: error: unknown type name GstMpegTsSection
static void dump_eit (GstMpegTsSection * section)
^
bgls_rec2_3gst.c: In function dvb_bus_call:
bgls_rec2_3gst.c:160:7: error: unknown type name GstMpegTsSection
GstMpegTsSection *section;
^
bgls_rec2_3gst.c:161:20: warning: assignment from incompatible pointer type
[enabled by default]
if ((section = gst_message_parse_mpegts_section (msg)))
^
bgls_rec2_3gst.c:163:9: warning: implicit declaration of function dump_eit
[-Wimplicit-function-declaration]
if (GST_MPEGTS_SECTION_TYPE (section) == GST_MPEGTS_SECTION_EIT)
dump_eit (section);
^
bgls_rec2_3gst.c:163:9: warning: nested extern declaration of dump_eit
[-Wnested-externs]
bgls_rec2_3gst.c: At top level:
bgls_rec2_3gst.c:47:1: warning: dump_descriptors defined but not used
[-Wunused-function]
dump_descriptors (GPtrArray * descriptors, guint spacing, GstDateTime
*start_time, guint32 duration, guint16 sid)
^
make: *** [bgls_rec2_3gst.o] Fehler 1
I dont understand where the fault is!
Many thanks for every idea!
Bernhard
_____
Von: gstreamer-devel [mailto:gstreamer-devel-bounces at lists.freedesktop.org]
Im Auftrag von Nicolas Dufresne
Gesendet: Sonntag, 11. Januar 2015 20:59
An: gstreamer-devel at lists.freedesktop.org
Betreff: Re: unknown type name 'GstMpegTsDescriptor'
Le 2015-01-11 14:53, Bernhard Graaf a écrit :
I try to build a code with using mpegts.h but I get the error: unknown type
name GstMpegTsDescriptor. mpegts.h is loaded but the code is not compiled.
Make sure you are not mixing incompatible version when building different
repository.
Nicolas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150112/7139de96/attachment-0001.html>
More information about the gstreamer-devel
mailing list