mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
gst/cdxaparse/gstcdxaparse.*: some renaming add some checks/sanity prepare for seek addition
Original commit message from CVS: * gst/cdxaparse/gstcdxaparse.c: * gst/cdxaparse/gstcdxaparse.h: some renaming add some checks/sanity prepare for seek addition * sys/sunaudio/gstsunaudio.c: remove exported dupe init function
This commit is contained in:
parent
f4c6cf17f8
commit
04590b8920
4 changed files with 126 additions and 154 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
2004-05-21 Stephane Loeuillet <stephane.loeuillet@tiscali.fr>
|
||||||
|
|
||||||
|
* gst/cdxaparse/gstcdxaparse.c:
|
||||||
|
* gst/cdxaparse/gstcdxaparse.h:
|
||||||
|
some renaming
|
||||||
|
add some checks/sanity
|
||||||
|
prepare for seek addition
|
||||||
|
|
||||||
|
* sys/sunaudio/gstsunaudio.c:
|
||||||
|
remove exported dupe init function
|
||||||
|
|
||||||
2004-05-21 Jan Schmidt <thaytan@mad.scientist.com>
|
2004-05-21 Jan Schmidt <thaytan@mad.scientist.com>
|
||||||
|
|
||||||
* ext/dv/gstdvdec.c: (gst_dvdec_init), (gst_dvdec_get_formats),
|
* ext/dv/gstdvdec.c: (gst_dvdec_init), (gst_dvdec_get_formats),
|
||||||
|
@ -18,7 +29,7 @@
|
||||||
2004-05-20 Stephane Loeuillet <stephane.loeuillet@tiscali.fr>
|
2004-05-20 Stephane Loeuillet <stephane.loeuillet@tiscali.fr>
|
||||||
|
|
||||||
* configure.ac:
|
* configure.ac:
|
||||||
test for FIONREAD ioctl in sys/filio.h forSolaris compat.
|
test for FIONREAD ioctl in sys/filio.h for Solaris compat.
|
||||||
* gst/tcp/gsttcpclientsrc.c: idem
|
* gst/tcp/gsttcpclientsrc.c: idem
|
||||||
* gst/tcp/gsttcpserversink.c: idem
|
* gst/tcp/gsttcpserversink.c: idem
|
||||||
* gst/tcp/gsttcpserversrc.c: idem
|
* gst/tcp/gsttcpserversrc.c: idem
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: t; c-basic-offset: 2 -*- */
|
|
||||||
/* GStreamer
|
/* GStreamer
|
||||||
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
||||||
* <2002> Wim Taymans <wim.taymans@chello.be>
|
* <2002> Wim Taymans <wim.taymans@chello.be>
|
||||||
|
@ -29,20 +28,13 @@
|
||||||
#include "gst/riff/riff-ids.h"
|
#include "gst/riff/riff-ids.h"
|
||||||
#include "gst/riff/riff-media.h"
|
#include "gst/riff/riff-media.h"
|
||||||
|
|
||||||
static void gst_cdxa_parse_base_init (gpointer g_class);
|
static void gst_cdxaparse_base_init (gpointer g_class);
|
||||||
static void gst_cdxa_parse_class_init (GstCDXAParseClass * klass);
|
static void gst_cdxaparse_class_init (GstCDXAParseClass * klass);
|
||||||
static void gst_cdxa_parse_init (GstCDXAParse * cdxa_parse);
|
static void gst_cdxaparse_init (GstCDXAParse * cdxaparse);
|
||||||
|
|
||||||
static GstElementStateReturn gst_cdxa_parse_change_state (GstElement * element);
|
static GstElementStateReturn gst_cdxaparse_change_state (GstElement * element);
|
||||||
|
|
||||||
static void gst_cdxa_parse_loop (GstElement * element);
|
static void gst_cdxaparse_loop (GstElement * element);
|
||||||
|
|
||||||
/* elementfactory information */
|
|
||||||
static GstElementDetails gst_cdxa_parse_details =
|
|
||||||
GST_ELEMENT_DETAILS (".dat parser",
|
|
||||||
"Codec/Parser",
|
|
||||||
"Parse a .dat file (VCD) into raw mpeg1",
|
|
||||||
"Wim Taymans <wim.taymans@tvd.be>");
|
|
||||||
|
|
||||||
static GstStaticPadTemplate sink_template_factory =
|
static GstStaticPadTemplate sink_template_factory =
|
||||||
GST_STATIC_PAD_TEMPLATE ("sink",
|
GST_STATIC_PAD_TEMPLATE ("sink",
|
||||||
|
@ -73,40 +65,43 @@ enum
|
||||||
|
|
||||||
static GstElementClass *parent_class = NULL;
|
static GstElementClass *parent_class = NULL;
|
||||||
|
|
||||||
/*static guint gst_cdxa_parse_signals[LAST_SIGNAL] = { 0 }; */
|
|
||||||
|
|
||||||
GType
|
GType
|
||||||
gst_cdxa_parse_get_type (void)
|
gst_cdxaparse_get_type (void)
|
||||||
{
|
{
|
||||||
static GType cdxa_parse_type = 0;
|
static GType cdxaparse_type = 0;
|
||||||
|
|
||||||
if (!cdxa_parse_type) {
|
if (!cdxaparse_type) {
|
||||||
static const GTypeInfo cdxa_parse_info = {
|
static const GTypeInfo cdxaparse_info = {
|
||||||
sizeof (GstCDXAParseClass),
|
sizeof (GstCDXAParseClass),
|
||||||
gst_cdxa_parse_base_init,
|
gst_cdxaparse_base_init,
|
||||||
NULL,
|
NULL,
|
||||||
(GClassInitFunc) gst_cdxa_parse_class_init,
|
(GClassInitFunc) gst_cdxaparse_class_init,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
sizeof (GstCDXAParse),
|
sizeof (GstCDXAParse),
|
||||||
0,
|
0,
|
||||||
(GInstanceInitFunc) gst_cdxa_parse_init,
|
(GInstanceInitFunc) gst_cdxaparse_init,
|
||||||
};
|
};
|
||||||
|
|
||||||
cdxa_parse_type =
|
cdxaparse_type =
|
||||||
g_type_register_static (GST_TYPE_RIFF_READ, "GstCDXAParse",
|
g_type_register_static (GST_TYPE_RIFF_READ, "GstCDXAParse",
|
||||||
&cdxa_parse_info, 0);
|
&cdxaparse_info, 0);
|
||||||
}
|
}
|
||||||
return cdxa_parse_type;
|
return cdxaparse_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_cdxa_parse_base_init (gpointer g_class)
|
gst_cdxaparse_base_init (gpointer g_class)
|
||||||
{
|
{
|
||||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||||
|
static GstElementDetails gst_cdxaparse_details =
|
||||||
|
GST_ELEMENT_DETAILS (".dat parser",
|
||||||
|
"Codec/Parser",
|
||||||
|
"Parse a .dat file (VCD) into raw mpeg1",
|
||||||
|
"Wim Taymans <wim.taymans@tvd.be>");
|
||||||
|
|
||||||
gst_element_class_set_details (element_class, &gst_cdxa_parse_details);
|
gst_element_class_set_details (element_class, &gst_cdxaparse_details);
|
||||||
|
|
||||||
/* register src pads */
|
/* register src pads */
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_pad_template (element_class,
|
||||||
|
@ -116,7 +111,7 @@ gst_cdxa_parse_base_init (gpointer g_class)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_cdxa_parse_class_init (GstCDXAParseClass * klass)
|
gst_cdxaparse_class_init (GstCDXAParseClass * klass)
|
||||||
{
|
{
|
||||||
GstElementClass *gstelement_class;
|
GstElementClass *gstelement_class;
|
||||||
GObjectClass *object_class;
|
GObjectClass *object_class;
|
||||||
|
@ -126,45 +121,44 @@ gst_cdxa_parse_class_init (GstCDXAParseClass * klass)
|
||||||
|
|
||||||
parent_class = g_type_class_ref (GST_TYPE_RIFF_READ);
|
parent_class = g_type_class_ref (GST_TYPE_RIFF_READ);
|
||||||
|
|
||||||
gstelement_class->change_state = gst_cdxa_parse_change_state;
|
gstelement_class->change_state = gst_cdxaparse_change_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_cdxa_parse_init (GstCDXAParse * cdxa_parse)
|
gst_cdxaparse_init (GstCDXAParse * cdxaparse)
|
||||||
{
|
{
|
||||||
/* sink */
|
/* sink */
|
||||||
cdxa_parse->sinkpad =
|
cdxaparse->sinkpad =
|
||||||
gst_pad_new_from_template (gst_static_pad_template_get
|
gst_pad_new_from_template (gst_static_pad_template_get
|
||||||
(&sink_template_factory), "sink");
|
(&sink_template_factory), "sink");
|
||||||
gst_element_add_pad (GST_ELEMENT (cdxa_parse), cdxa_parse->sinkpad);
|
gst_element_add_pad (GST_ELEMENT (cdxaparse), cdxaparse->sinkpad);
|
||||||
GST_RIFF_READ (cdxa_parse)->sinkpad = cdxa_parse->sinkpad;
|
GST_RIFF_READ (cdxaparse)->sinkpad = cdxaparse->sinkpad;
|
||||||
|
|
||||||
|
|
||||||
gst_element_set_loop_function (GST_ELEMENT (cdxa_parse), gst_cdxa_parse_loop);
|
gst_element_set_loop_function (GST_ELEMENT (cdxaparse), gst_cdxaparse_loop);
|
||||||
|
|
||||||
|
cdxaparse->state = GST_CDXAPARSE_START;
|
||||||
|
|
||||||
cdxa_parse->srcpad =
|
cdxaparse->srcpad =
|
||||||
gst_pad_new_from_template (gst_static_pad_template_get
|
gst_pad_new_from_template (gst_static_pad_template_get
|
||||||
(&src_template_factory), "src");
|
(&src_template_factory), "src");
|
||||||
gst_element_add_pad (GST_ELEMENT (cdxa_parse), cdxa_parse->srcpad);
|
gst_element_add_pad (GST_ELEMENT (cdxaparse), cdxaparse->srcpad);
|
||||||
|
|
||||||
cdxa_parse->state = GST_CDXA_PARSE_START;
|
cdxaparse->seek_pending = FALSE;
|
||||||
|
cdxaparse->seek_offset = 0;
|
||||||
cdxa_parse->seek_pending = FALSE;
|
|
||||||
cdxa_parse->seek_offset = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_cdxa_parse_stream_init (GstCDXAParse * cdxa_parse)
|
gst_cdxaparse_stream_init (GstCDXAParse * cdxa)
|
||||||
{
|
{
|
||||||
GstRiffRead *riff = GST_RIFF_READ (cdxa_parse);
|
GstRiffRead *riff = GST_RIFF_READ (cdxa);
|
||||||
guint32 doctype;
|
guint32 doctype;
|
||||||
|
|
||||||
if (!gst_riff_read_header (riff, &doctype))
|
if (!gst_riff_read_header (riff, &doctype))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (doctype != GST_RIFF_RIFF_CDXA) {
|
if (doctype != GST_RIFF_RIFF_CDXA) {
|
||||||
GST_ELEMENT_ERROR (cdxa_parse, STREAM, WRONG_TYPE, (NULL), (NULL));
|
GST_ELEMENT_ERROR (cdxa, STREAM, WRONG_TYPE, (NULL), (NULL));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,9 +167,9 @@ gst_cdxa_parse_stream_init (GstCDXAParse * cdxa_parse)
|
||||||
|
|
||||||
/* Read 'fmt ' header */
|
/* Read 'fmt ' header */
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_cdxa_parse_fmt (GstCDXAParse * cdxa_parse)
|
gst_cdxaparse_fmt (GstCDXAParse * cdxa)
|
||||||
{
|
{
|
||||||
GstRiffRead *riff = GST_RIFF_READ (cdxa_parse);
|
GstRiffRead *riff = GST_RIFF_READ (cdxa);
|
||||||
gst_riff_strf_auds *header;
|
gst_riff_strf_auds *header;
|
||||||
|
|
||||||
if (!gst_riff_read_strf_auds (riff, &header)) {
|
if (!gst_riff_read_strf_auds (riff, &header)) {
|
||||||
|
@ -189,50 +183,34 @@ gst_cdxa_parse_fmt (GstCDXAParse * cdxa_parse)
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_cdxa_parse_other (GstCDXAParse * cdxa_parse)
|
gst_cdxaparse_other (GstCDXAParse * cdxa)
|
||||||
{
|
{
|
||||||
GstRiffRead *riff = GST_RIFF_READ (cdxa_parse);
|
GstRiffRead *riff = GST_RIFF_READ (cdxa);
|
||||||
guint32 tag, length;
|
guint32 tag, length;
|
||||||
|
|
||||||
/* Fixme, need to handle a seek...can you seek in cdxa? */
|
|
||||||
|
|
||||||
if (!gst_riff_peek_head (riff, &tag, &length, NULL)) {
|
if (!gst_riff_peek_head (riff, &tag, &length, NULL)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (tag) {
|
switch (tag) {
|
||||||
case GST_RIFF_TAG_data:
|
case GST_RIFF_TAG_data:
|
||||||
gst_bytestream_flush (riff->bs, 8);
|
if (!gst_bytestream_flush (riff->bs, 8))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
cdxa_parse->state = GST_CDXA_PARSE_DATA;
|
cdxa->state = GST_CDXAPARSE_DATA;
|
||||||
cdxa_parse->dataleft = (guint64) length;
|
cdxa->dataleft = cdxa->datasize = (guint64) length;
|
||||||
|
cdxa->datastart = gst_bytestream_tell (riff->bs);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
gst_riff_read_skip (riff);
|
if (!gst_riff_read_skip (riff))
|
||||||
|
return FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MAX_BUFFER_SIZE 4096
|
|
||||||
|
|
||||||
static void
|
|
||||||
gst_cdxa_parse_loop (GstElement * element)
|
|
||||||
{
|
|
||||||
GstCDXAParse *cdxa_parse = GST_CDXA_PARSE (element);
|
|
||||||
GstRiffRead *riff = GST_RIFF_READ (cdxa_parse);
|
|
||||||
|
|
||||||
if (cdxa_parse->state == GST_CDXA_PARSE_DATA) {
|
|
||||||
if (cdxa_parse->dataleft > 0) {
|
|
||||||
guint32 got_bytes, desired;
|
|
||||||
GstBuffer *buf, *outbuf;
|
|
||||||
|
|
||||||
desired = GST_CDXA_SECTOR_SIZE;
|
|
||||||
|
|
||||||
buf = gst_riff_read_element_data (riff, desired, &got_bytes);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
A sector is 2352 bytes long and is composed of:
|
A sector is 2352 bytes long and is composed of:
|
||||||
|
@ -250,60 +228,69 @@ edc : checksum
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
static void
|
||||||
if (got_bytes < GST_CDXA_SECTOR_SIZE) {
|
gst_cdxaparse_loop (GstElement * element)
|
||||||
gst_cdxa_parse_handle_event (cdxa_parse);
|
{
|
||||||
|
GstCDXAParse *cdxa = GST_CDXAPARSE (element);
|
||||||
|
GstRiffRead *riff = GST_RIFF_READ (cdxa);
|
||||||
|
|
||||||
|
if (cdxa->state == GST_CDXAPARSE_DATA) {
|
||||||
|
|
||||||
|
if (cdxa->dataleft > 0) {
|
||||||
|
guint32 got_bytes, desired;
|
||||||
|
GstBuffer *buf = NULL;
|
||||||
|
GstBuffer *outbuf = NULL;
|
||||||
|
|
||||||
|
desired = GST_CDXA_SECTOR_SIZE;
|
||||||
|
|
||||||
|
if (!(buf = gst_riff_read_element_data (riff, desired, &got_bytes)))
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Extract time from CDXA header */
|
/* Skip CDXA headers, only keep data */
|
||||||
/* printf( "%02u:%02u:%02u\n", (unsigned char) *(GST_BUFFER_DATA(buf)+12), (unsigned char) *(GST_BUFFER_DATA(buf)+13), (unsigned char) *(GST_BUFFER_DATA(buf)+14) );*/
|
outbuf =
|
||||||
|
gst_buffer_create_sub (buf, GST_CDXA_HEADER_SIZE, GST_CDXA_DATA_SIZE);
|
||||||
|
|
||||||
/* Jump CDXA headers, only keep data */
|
|
||||||
outbuf = gst_buffer_create_sub (buf, 24, GST_CDXA_DATA_SIZE);
|
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
|
gst_pad_push (cdxa->srcpad, GST_DATA (outbuf));
|
||||||
|
|
||||||
gst_pad_push (cdxa_parse->srcpad, GST_DATA (outbuf));
|
cdxa->byteoffset += got_bytes;
|
||||||
|
if (got_bytes < cdxa->dataleft) {
|
||||||
cdxa_parse->byteoffset += got_bytes;
|
cdxa->dataleft -= got_bytes;
|
||||||
if (got_bytes < cdxa_parse->dataleft) {
|
|
||||||
cdxa_parse->dataleft -= got_bytes;
|
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
cdxa_parse->dataleft = 0;
|
cdxa->dataleft = 0;
|
||||||
cdxa_parse->state = GST_CDXA_PARSE_OTHER;
|
cdxa->state = GST_CDXAPARSE_OTHER;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cdxa_parse->state = GST_CDXA_PARSE_OTHER;
|
cdxa->state = GST_CDXAPARSE_OTHER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (cdxa_parse->state) {
|
switch (cdxa->state) {
|
||||||
case GST_CDXA_PARSE_START:
|
case GST_CDXAPARSE_START:
|
||||||
if (!gst_cdxa_parse_stream_init (cdxa_parse)) {
|
if (!gst_cdxaparse_stream_init (cdxa)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cdxa_parse->state = GST_CDXA_PARSE_FMT;
|
cdxa->state = GST_CDXAPARSE_FMT;
|
||||||
/* fall-through */
|
/* fall-through */
|
||||||
|
|
||||||
case GST_CDXA_PARSE_FMT:
|
case GST_CDXAPARSE_FMT:
|
||||||
if (!gst_cdxa_parse_fmt (cdxa_parse)) {
|
if (!gst_cdxaparse_fmt (cdxa)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cdxa_parse->state = GST_CDXA_PARSE_OTHER;
|
cdxa->state = GST_CDXAPARSE_OTHER;
|
||||||
/* fall-through */
|
/* fall-through */
|
||||||
|
|
||||||
case GST_CDXA_PARSE_OTHER:
|
case GST_CDXAPARSE_OTHER:
|
||||||
if (!gst_cdxa_parse_other (cdxa_parse)) {
|
if (!gst_cdxaparse_other (cdxa)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GST_CDXA_PARSE_DATA:
|
case GST_CDXAPARSE_DATA:
|
||||||
|
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
|
@ -311,16 +298,16 @@ edc : checksum
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstElementStateReturn
|
static GstElementStateReturn
|
||||||
gst_cdxa_parse_change_state (GstElement * element)
|
gst_cdxaparse_change_state (GstElement * element)
|
||||||
{
|
{
|
||||||
GstCDXAParse *cdxa_parse = GST_CDXA_PARSE (element);
|
GstCDXAParse *cdxa = GST_CDXAPARSE (element);
|
||||||
|
|
||||||
switch (GST_STATE_TRANSITION (element)) {
|
switch (GST_STATE_TRANSITION (element)) {
|
||||||
case GST_STATE_NULL_TO_READY:
|
case GST_STATE_NULL_TO_READY:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GST_STATE_READY_TO_PAUSED:
|
case GST_STATE_READY_TO_PAUSED:
|
||||||
cdxa_parse->state = GST_CDXA_PARSE_START;
|
cdxa->state = GST_CDXAPARSE_START;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GST_STATE_PAUSED_TO_PLAYING:
|
case GST_STATE_PAUSED_TO_PLAYING:
|
||||||
|
@ -330,11 +317,10 @@ gst_cdxa_parse_change_state (GstElement * element)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GST_STATE_PAUSED_TO_READY:
|
case GST_STATE_PAUSED_TO_READY:
|
||||||
cdxa_parse->state = GST_CDXA_PARSE_START;
|
cdxa->state = GST_CDXAPARSE_START;
|
||||||
|
|
||||||
|
cdxa->seek_pending = FALSE;
|
||||||
cdxa_parse->seek_pending = FALSE;
|
cdxa->seek_offset = 0;
|
||||||
cdxa_parse->seek_offset = 0;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GST_STATE_READY_TO_NULL:
|
case GST_STATE_READY_TO_NULL:
|
||||||
|
@ -354,8 +340,8 @@ plugin_init (GstPlugin * plugin)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return gst_element_register (plugin, "cdxaparse", GST_RANK_SECONDARY,
|
return gst_element_register (plugin, "cdxaparse", GST_RANK_PRIMARY,
|
||||||
GST_TYPE_CDXA_PARSE);
|
GST_TYPE_CDXAPARSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef __GST_CDXA_PARSE_H__
|
#ifndef __GST_CDXAPARSE_H__
|
||||||
#define __GST_CDXA_PARSE_H__
|
#define __GST_CDXAPARSE_H__
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include "gst/riff/riff-ids.h"
|
#include "gst/riff/riff-ids.h"
|
||||||
|
@ -30,25 +30,26 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
#define GST_TYPE_CDXA_PARSE \
|
#define GST_TYPE_CDXAPARSE \
|
||||||
(gst_cdxa_parse_get_type())
|
(gst_cdxaparse_get_type())
|
||||||
#define GST_CDXA_PARSE(obj) \
|
#define GST_CDXAPARSE(obj) \
|
||||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_CDXA_PARSE,GstCDXAParse))
|
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_CDXAPARSE,GstCDXAParse))
|
||||||
#define GST_CDXA_PARSE_CLASS(klass) \
|
#define GST_CDXAPARSE_CLASS(klass) \
|
||||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_CDXA_PARSE,GstCDXAParse))
|
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_CDXAPARSE,GstCDXAParse))
|
||||||
#define GST_IS_CDXA_PARSE(obj) \
|
#define GST_IS_CDXAPARSE(obj) \
|
||||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_CDXA_PARSE))
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_CDXAPARSE))
|
||||||
#define GST_IS_CDXA_PARSE_CLASS(obj) \
|
#define GST_IS_CDXAPARSE_CLASS(obj) \
|
||||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_CDXA_PARSE))
|
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_CDXAPARSE))
|
||||||
|
|
||||||
#define GST_CDXA_SECTOR_SIZE 2352
|
#define GST_CDXA_SECTOR_SIZE 2352
|
||||||
#define GST_CDXA_DATA_SIZE 2324
|
#define GST_CDXA_DATA_SIZE 2324
|
||||||
|
#define GST_CDXA_HEADER_SIZE 24
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
GST_CDXA_PARSE_START,
|
GST_CDXAPARSE_START,
|
||||||
GST_CDXA_PARSE_FMT,
|
GST_CDXAPARSE_FMT,
|
||||||
GST_CDXA_PARSE_OTHER,
|
GST_CDXAPARSE_OTHER,
|
||||||
GST_CDXA_PARSE_DATA,
|
GST_CDXAPARSE_DATA,
|
||||||
} GstCDXAParseState;
|
} GstCDXAParseState;
|
||||||
|
|
||||||
typedef struct _GstCDXAParse GstCDXAParse;
|
typedef struct _GstCDXAParse GstCDXAParse;
|
||||||
|
@ -63,23 +64,7 @@ struct _GstCDXAParse {
|
||||||
/* CDXA decoding state */
|
/* CDXA decoding state */
|
||||||
GstCDXAParseState state;
|
GstCDXAParseState state;
|
||||||
|
|
||||||
/* useful CDXA data
|
guint64 dataleft, datasize, datastart;
|
||||||
guint32 riff_size;
|
|
||||||
guint32 data_size;
|
|
||||||
guint32 sectors;
|
|
||||||
|
|
||||||
#define CDXA_SUB_MODE_EOF(c) ((c&0x80)>>7)
|
|
||||||
#define CDXA_SUB_MODE_RT(c) ((c&0x40)>>6)
|
|
||||||
#define CDXA_SUB_MODE_FORM(c) ((c&0x20)>>5)
|
|
||||||
#define CDXA_SUB_MODE_TRIGGER(c)((c&0x10)>>4)
|
|
||||||
#define CDXA_SUB_MODE_DATA(c) ((c&0x08)>>3)
|
|
||||||
#define CDXA_SUB_MODE_VIDEO(c) ((c&0x04)>>2)
|
|
||||||
#define CDXA_SUB_MODE_AUDIO(c) ((c&0x02)>>1)
|
|
||||||
#define CDXA_SUB_MODE_EOR(c) ((c&0x01) )
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
guint64 dataleft;
|
|
||||||
int byteoffset;
|
int byteoffset;
|
||||||
|
|
||||||
gboolean seek_pending;
|
gboolean seek_pending;
|
||||||
|
@ -90,12 +75,12 @@ struct _GstCDXAParseClass {
|
||||||
GstElementClass parent_class;
|
GstElementClass parent_class;
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gst_cdxa_parse_get_type (void);
|
GType gst_cdxaparse_get_type (void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GST_CDXA_PARSE_H__ */
|
#endif /* __GST_CDXAPARSE_H__ */
|
||||||
|
|
||||||
|
|
|
@ -81,14 +81,14 @@ static GstElementDetails plugin_details = {
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
/* FILL ME */
|
/* FILL ME */
|
||||||
LAST_SIGNAL
|
LAST_SIGNAL,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
ARG_0,
|
ARG_0,
|
||||||
ARG_DEVICE,
|
ARG_DEVICE,
|
||||||
ARG_BUFFER_SIZE
|
ARG_BUFFER_SIZE,
|
||||||
};
|
};
|
||||||
|
|
||||||
static GstStaticPadTemplate gst_sunaudiosink_sink_factory =
|
static GstStaticPadTemplate gst_sunaudiosink_sink_factory =
|
||||||
|
@ -422,16 +422,6 @@ gst_sunaudiosink_get_property (GObject * object, guint prop_id,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
|
||||||
gst_sunaudiosink_plugin_init (GstPlugin * plugin)
|
|
||||||
{
|
|
||||||
if (!gst_element_register (plugin, "sunaudiosink", GST_RANK_NONE,
|
|
||||||
GST_TYPE_SUNAUDIOSINK))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
plugin_init (GstPlugin * plugin)
|
plugin_init (GstPlugin * plugin)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue