Reworked AC3 decoder. No seeking yet but at least we do not need ac3parse anymore.
Original commit message from CVS: Reworked AC3 decoder. No seeking yet but at least we do not need ac3parse anymore. Reworked dvdsrc to read scrambled data (DeCSS not included). I have modified DeCSS a bit to work in GStreamer. Can I release the code or is there some lawyer that's going to sue me? MPEG2 SSE motion compensation. Tried to add PTS to the MPEG decoder but failed.
This commit is contained in:
parent
01eb2caf72
commit
92c447c536
@ -225,6 +225,7 @@ control_create_menus (control_data_t *control_data)
|
|||||||
bonobo_ui_util_set_pixbuf (control_data->uic, "/commands/Stop", pixbuf);
|
bonobo_ui_util_set_pixbuf (control_data->uic, "/commands/Stop", pixbuf);
|
||||||
gdk_pixbuf_unref (pixbuf);
|
gdk_pixbuf_unref (pixbuf);
|
||||||
|
|
||||||
|
g_print("create menu done\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -226,12 +226,13 @@ PLUGINS_SRCDIR=`pwd`/$srcdir
|
|||||||
AC_DEFINE_UNQUOTED(PLUGINS_SRCDIR,"$PLUGINS_SRCDIR")
|
AC_DEFINE_UNQUOTED(PLUGINS_SRCDIR,"$PLUGINS_SRCDIR")
|
||||||
AC_SUBST(PLUGINS_SRCDIR)
|
AC_SUBST(PLUGINS_SRCDIR)
|
||||||
|
|
||||||
dnl check if css.c exists (FIXME)
|
dnl check if css-auth.c exists (FIXME)
|
||||||
AC_MSG_CHECKING(DVD CSS code)
|
AC_MSG_CHECKING(DVD CSS code)
|
||||||
if test -f plugins/dvdsrc/css.c
|
if test -f plugins/dvdsrc/css-auth.c
|
||||||
then
|
then
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
HAVE_CSSAUTH="yes"
|
HAVE_CSSAUTH="yes"
|
||||||
|
AC_DEFINE(HAVE_CSSAUTH)
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
HAVE_CSSAUTH="no"
|
HAVE_CSSAUTH="no"
|
||||||
|
@ -176,7 +176,7 @@
|
|||||||
|
|
||||||
<partintro>
|
<partintro>
|
||||||
<para>
|
<para>
|
||||||
In this part we will describe how you create a new plugin
|
In this part we will describe how you can create a new plugin
|
||||||
to be used in <application>GStreamer</application>.
|
to be used in <application>GStreamer</application>.
|
||||||
</para>
|
</para>
|
||||||
</partintro>
|
</partintro>
|
||||||
|
@ -89,7 +89,8 @@ gst_disksrc_get_type(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_disksrc_class_init(GstDiskSrcClass *klass) {
|
gst_disksrc_class_init (GstDiskSrcClass *klass)
|
||||||
|
{
|
||||||
GtkObjectClass *gtkobject_class;
|
GtkObjectClass *gtkobject_class;
|
||||||
GstElementClass *gstelement_class;
|
GstElementClass *gstelement_class;
|
||||||
GstSrcClass *gstsrc_class;
|
GstSrcClass *gstsrc_class;
|
||||||
@ -119,7 +120,9 @@ gst_disksrc_class_init(GstDiskSrcClass *klass) {
|
|||||||
gstsrc_class->push_region = NULL;
|
gstsrc_class->push_region = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gst_disksrc_init(GstDiskSrc *disksrc) {
|
static void
|
||||||
|
gst_disksrc_init (GstDiskSrc *disksrc)
|
||||||
|
{
|
||||||
disksrc->srcpad = gst_pad_new ("src", GST_PAD_SRC);
|
disksrc->srcpad = gst_pad_new ("src", GST_PAD_SRC);
|
||||||
gst_element_add_pad (GST_ELEMENT (disksrc), disksrc->srcpad);
|
gst_element_add_pad (GST_ELEMENT (disksrc), disksrc->srcpad);
|
||||||
|
|
||||||
@ -133,11 +136,14 @@ static void gst_disksrc_init(GstDiskSrc *disksrc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void gst_disksrc_set_arg(GtkObject *object,GtkArg *arg,guint id) {
|
static void
|
||||||
|
gst_disksrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
|
||||||
|
{
|
||||||
GstDiskSrc *src;
|
GstDiskSrc *src;
|
||||||
|
|
||||||
/* it's not null if we got it, but it might not be ours */
|
/* it's not null if we got it, but it might not be ours */
|
||||||
g_return_if_fail (GST_IS_DISKSRC (object));
|
g_return_if_fail (GST_IS_DISKSRC (object));
|
||||||
|
|
||||||
src = GST_DISKSRC (object);
|
src = GST_DISKSRC (object);
|
||||||
|
|
||||||
switch(id) {
|
switch(id) {
|
||||||
@ -170,7 +176,9 @@ static void gst_disksrc_set_arg(GtkObject *object,GtkArg *arg,guint id) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gst_disksrc_get_arg(GtkObject *object,GtkArg *arg,guint id) {
|
static void
|
||||||
|
gst_disksrc_get_arg (GtkObject *object, GtkArg *arg, guint id)
|
||||||
|
{
|
||||||
GstDiskSrc *src;
|
GstDiskSrc *src;
|
||||||
|
|
||||||
/* it's not null if we got it, but it might not be ours */
|
/* it's not null if we got it, but it might not be ours */
|
||||||
@ -196,7 +204,9 @@ static void gst_disksrc_get_arg(GtkObject *object,GtkArg *arg,guint id) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gst_disksrc_push(GstSrc *src) {
|
static void
|
||||||
|
gst_disksrc_push (GstSrc *src)
|
||||||
|
{
|
||||||
GstDiskSrc *disksrc;
|
GstDiskSrc *disksrc;
|
||||||
GstBuffer *buf;
|
GstBuffer *buf;
|
||||||
glong readbytes;
|
glong readbytes;
|
||||||
@ -205,6 +215,7 @@ void gst_disksrc_push(GstSrc *src) {
|
|||||||
g_return_if_fail (GST_IS_DISKSRC (src));
|
g_return_if_fail (GST_IS_DISKSRC (src));
|
||||||
g_return_if_fail (GST_FLAG_IS_SET (src, GST_DISKSRC_OPEN));
|
g_return_if_fail (GST_FLAG_IS_SET (src, GST_DISKSRC_OPEN));
|
||||||
g_return_if_fail (GST_STATE (src) >= GST_STATE_READY);
|
g_return_if_fail (GST_STATE (src) >= GST_STATE_READY);
|
||||||
|
|
||||||
disksrc = GST_DISKSRC (src);
|
disksrc = GST_DISKSRC (src);
|
||||||
|
|
||||||
/* create the buffer */
|
/* create the buffer */
|
||||||
@ -251,7 +262,9 @@ void gst_disksrc_push(GstSrc *src) {
|
|||||||
|
|
||||||
|
|
||||||
/* open the file, necessary to go to RUNNING state */
|
/* open the file, necessary to go to RUNNING state */
|
||||||
static gboolean gst_disksrc_open_file(GstDiskSrc *src) {
|
static gboolean
|
||||||
|
gst_disksrc_open_file (GstDiskSrc *src)
|
||||||
|
{
|
||||||
struct stat f_stat;
|
struct stat f_stat;
|
||||||
|
|
||||||
g_return_val_if_fail (!GST_FLAG_IS_SET (src, GST_DISKSRC_OPEN), FALSE);
|
g_return_val_if_fail (!GST_FLAG_IS_SET (src, GST_DISKSRC_OPEN), FALSE);
|
||||||
@ -276,7 +289,9 @@ static gboolean gst_disksrc_open_file(GstDiskSrc *src) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* close the file */
|
/* close the file */
|
||||||
static void gst_disksrc_close_file(GstDiskSrc *src) {
|
static void
|
||||||
|
gst_disksrc_close_file (GstDiskSrc *src)
|
||||||
|
{
|
||||||
g_return_if_fail (GST_FLAG_IS_SET (src, GST_DISKSRC_OPEN));
|
g_return_if_fail (GST_FLAG_IS_SET (src, GST_DISKSRC_OPEN));
|
||||||
|
|
||||||
/* close the file */
|
/* close the file */
|
||||||
@ -291,7 +306,9 @@ static void gst_disksrc_close_file(GstDiskSrc *src) {
|
|||||||
GST_FLAG_UNSET (src, GST_DISKSRC_OPEN);
|
GST_FLAG_UNSET (src, GST_DISKSRC_OPEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstElementStateReturn gst_disksrc_change_state(GstElement *element) {
|
static GstElementStateReturn
|
||||||
|
gst_disksrc_change_state (GstElement *element)
|
||||||
|
{
|
||||||
g_return_val_if_fail (GST_IS_DISKSRC (element), GST_STATE_FAILURE);
|
g_return_val_if_fail (GST_IS_DISKSRC (element), GST_STATE_FAILURE);
|
||||||
|
|
||||||
DEBUG("gstdisksrc: state pending %d\n", GST_STATE_PENDING (element));
|
DEBUG("gstdisksrc: state pending %d\n", GST_STATE_PENDING (element));
|
||||||
|
@ -302,6 +302,16 @@ on_gst_media_play_destroy (GtkWidget *widget,
|
|||||||
gst_main_quit ();
|
gst_main_quit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
on_exit_menu_activate (GtkWidget *widget,
|
||||||
|
GstMediaPlay *mplay)
|
||||||
|
{
|
||||||
|
gdk_threads_leave ();
|
||||||
|
gst_play_stop (mplay->play);
|
||||||
|
gdk_threads_enter ();
|
||||||
|
gst_main_quit ();
|
||||||
|
}
|
||||||
|
|
||||||
gint
|
gint
|
||||||
on_gst_media_play_delete_event (GtkWidget *widget,
|
on_gst_media_play_delete_event (GtkWidget *widget,
|
||||||
GdkEvent *event,
|
GdkEvent *event,
|
||||||
|
@ -260,6 +260,7 @@ gst_play_set_uri (GstPlay *play,
|
|||||||
priv->uri = g_strdup (uri);
|
priv->uri = g_strdup (uri);
|
||||||
|
|
||||||
priv->src = gst_elementfactory_make ("asyncdisksrc", "disk_src");
|
priv->src = gst_elementfactory_make ("asyncdisksrc", "disk_src");
|
||||||
|
//priv->src = gst_elementfactory_make ("dvdsrc", "disk_src");
|
||||||
g_return_val_if_fail (priv->src != NULL, -1);
|
g_return_val_if_fail (priv->src != NULL, -1);
|
||||||
gtk_object_set (GTK_OBJECT (priv->src),"location",uri,NULL);
|
gtk_object_set (GTK_OBJECT (priv->src),"location",uri,NULL);
|
||||||
gtk_signal_connect (GTK_OBJECT (priv->src), "eos", GTK_SIGNAL_FUNC (gst_play_eos), play);
|
gtk_signal_connect (GTK_OBJECT (priv->src), "eos", GTK_SIGNAL_FUNC (gst_play_eos), play);
|
||||||
|
@ -89,7 +89,8 @@ gst_disksrc_get_type(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_disksrc_class_init(GstDiskSrcClass *klass) {
|
gst_disksrc_class_init (GstDiskSrcClass *klass)
|
||||||
|
{
|
||||||
GtkObjectClass *gtkobject_class;
|
GtkObjectClass *gtkobject_class;
|
||||||
GstElementClass *gstelement_class;
|
GstElementClass *gstelement_class;
|
||||||
GstSrcClass *gstsrc_class;
|
GstSrcClass *gstsrc_class;
|
||||||
@ -119,7 +120,9 @@ gst_disksrc_class_init(GstDiskSrcClass *klass) {
|
|||||||
gstsrc_class->push_region = NULL;
|
gstsrc_class->push_region = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gst_disksrc_init(GstDiskSrc *disksrc) {
|
static void
|
||||||
|
gst_disksrc_init (GstDiskSrc *disksrc)
|
||||||
|
{
|
||||||
disksrc->srcpad = gst_pad_new ("src", GST_PAD_SRC);
|
disksrc->srcpad = gst_pad_new ("src", GST_PAD_SRC);
|
||||||
gst_element_add_pad (GST_ELEMENT (disksrc), disksrc->srcpad);
|
gst_element_add_pad (GST_ELEMENT (disksrc), disksrc->srcpad);
|
||||||
|
|
||||||
@ -133,11 +136,14 @@ static void gst_disksrc_init(GstDiskSrc *disksrc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void gst_disksrc_set_arg(GtkObject *object,GtkArg *arg,guint id) {
|
static void
|
||||||
|
gst_disksrc_set_arg (GtkObject *object, GtkArg *arg, guint id)
|
||||||
|
{
|
||||||
GstDiskSrc *src;
|
GstDiskSrc *src;
|
||||||
|
|
||||||
/* it's not null if we got it, but it might not be ours */
|
/* it's not null if we got it, but it might not be ours */
|
||||||
g_return_if_fail (GST_IS_DISKSRC (object));
|
g_return_if_fail (GST_IS_DISKSRC (object));
|
||||||
|
|
||||||
src = GST_DISKSRC (object);
|
src = GST_DISKSRC (object);
|
||||||
|
|
||||||
switch(id) {
|
switch(id) {
|
||||||
@ -170,7 +176,9 @@ static void gst_disksrc_set_arg(GtkObject *object,GtkArg *arg,guint id) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gst_disksrc_get_arg(GtkObject *object,GtkArg *arg,guint id) {
|
static void
|
||||||
|
gst_disksrc_get_arg (GtkObject *object, GtkArg *arg, guint id)
|
||||||
|
{
|
||||||
GstDiskSrc *src;
|
GstDiskSrc *src;
|
||||||
|
|
||||||
/* it's not null if we got it, but it might not be ours */
|
/* it's not null if we got it, but it might not be ours */
|
||||||
@ -196,7 +204,9 @@ static void gst_disksrc_get_arg(GtkObject *object,GtkArg *arg,guint id) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gst_disksrc_push(GstSrc *src) {
|
static void
|
||||||
|
gst_disksrc_push (GstSrc *src)
|
||||||
|
{
|
||||||
GstDiskSrc *disksrc;
|
GstDiskSrc *disksrc;
|
||||||
GstBuffer *buf;
|
GstBuffer *buf;
|
||||||
glong readbytes;
|
glong readbytes;
|
||||||
@ -205,6 +215,7 @@ void gst_disksrc_push(GstSrc *src) {
|
|||||||
g_return_if_fail (GST_IS_DISKSRC (src));
|
g_return_if_fail (GST_IS_DISKSRC (src));
|
||||||
g_return_if_fail (GST_FLAG_IS_SET (src, GST_DISKSRC_OPEN));
|
g_return_if_fail (GST_FLAG_IS_SET (src, GST_DISKSRC_OPEN));
|
||||||
g_return_if_fail (GST_STATE (src) >= GST_STATE_READY);
|
g_return_if_fail (GST_STATE (src) >= GST_STATE_READY);
|
||||||
|
|
||||||
disksrc = GST_DISKSRC (src);
|
disksrc = GST_DISKSRC (src);
|
||||||
|
|
||||||
/* create the buffer */
|
/* create the buffer */
|
||||||
@ -251,7 +262,9 @@ void gst_disksrc_push(GstSrc *src) {
|
|||||||
|
|
||||||
|
|
||||||
/* open the file, necessary to go to RUNNING state */
|
/* open the file, necessary to go to RUNNING state */
|
||||||
static gboolean gst_disksrc_open_file(GstDiskSrc *src) {
|
static gboolean
|
||||||
|
gst_disksrc_open_file (GstDiskSrc *src)
|
||||||
|
{
|
||||||
struct stat f_stat;
|
struct stat f_stat;
|
||||||
|
|
||||||
g_return_val_if_fail (!GST_FLAG_IS_SET (src, GST_DISKSRC_OPEN), FALSE);
|
g_return_val_if_fail (!GST_FLAG_IS_SET (src, GST_DISKSRC_OPEN), FALSE);
|
||||||
@ -276,7 +289,9 @@ static gboolean gst_disksrc_open_file(GstDiskSrc *src) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* close the file */
|
/* close the file */
|
||||||
static void gst_disksrc_close_file(GstDiskSrc *src) {
|
static void
|
||||||
|
gst_disksrc_close_file (GstDiskSrc *src)
|
||||||
|
{
|
||||||
g_return_if_fail (GST_FLAG_IS_SET (src, GST_DISKSRC_OPEN));
|
g_return_if_fail (GST_FLAG_IS_SET (src, GST_DISKSRC_OPEN));
|
||||||
|
|
||||||
/* close the file */
|
/* close the file */
|
||||||
@ -291,7 +306,9 @@ static void gst_disksrc_close_file(GstDiskSrc *src) {
|
|||||||
GST_FLAG_UNSET (src, GST_DISKSRC_OPEN);
|
GST_FLAG_UNSET (src, GST_DISKSRC_OPEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstElementStateReturn gst_disksrc_change_state(GstElement *element) {
|
static GstElementStateReturn
|
||||||
|
gst_disksrc_change_state (GstElement *element)
|
||||||
|
{
|
||||||
g_return_val_if_fail (GST_IS_DISKSRC (element), GST_STATE_FAILURE);
|
g_return_val_if_fail (GST_IS_DISKSRC (element), GST_STATE_FAILURE);
|
||||||
|
|
||||||
DEBUG("gstdisksrc: state pending %d\n", GST_STATE_PENDING (element));
|
DEBUG("gstdisksrc: state pending %d\n", GST_STATE_PENDING (element));
|
||||||
|
@ -13,7 +13,6 @@ int main(int argc,char *argv[]) {
|
|||||||
|
|
||||||
_gst_plugin_spew = TRUE;
|
_gst_plugin_spew = TRUE;
|
||||||
gst_init(&argc,&argv);
|
gst_init(&argc,&argv);
|
||||||
gst_plugin_load_all();
|
|
||||||
// gst_plugin_load("dvdsrc");
|
// gst_plugin_load("dvdsrc");
|
||||||
|
|
||||||
fd = creat("output.vob",0644);
|
fd = creat("output.vob",0644);
|
||||||
@ -23,9 +22,11 @@ int main(int argc,char *argv[]) {
|
|||||||
|
|
||||||
src = gst_elementfactory_make("dvdsrc","src");
|
src = gst_elementfactory_make("dvdsrc","src");
|
||||||
g_return_if_fail(src != NULL);
|
g_return_if_fail(src != NULL);
|
||||||
|
|
||||||
gtk_object_set(GTK_OBJECT(src),"location",argv[1],NULL);
|
gtk_object_set(GTK_OBJECT(src),"location",argv[1],NULL);
|
||||||
if (argc >= 3)
|
if (argc >= 3)
|
||||||
gtk_object_set(GTK_OBJECT(src),"offset",atoi(argv[2]),NULL);
|
gtk_object_set(GTK_OBJECT(src),"offset",atoi(argv[2]),NULL);
|
||||||
|
|
||||||
sink = gst_elementfactory_make("fdsink","sink");
|
sink = gst_elementfactory_make("fdsink","sink");
|
||||||
g_return_if_fail(sink != NULL);
|
g_return_if_fail(sink != NULL);
|
||||||
gtk_object_set(GTK_OBJECT(sink),"fd",fd,NULL);
|
gtk_object_set(GTK_OBJECT(sink),"fd",fd,NULL);
|
||||||
@ -39,8 +40,6 @@ int main(int argc,char *argv[]) {
|
|||||||
gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_READY);
|
gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_READY);
|
||||||
gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_PLAYING);
|
gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_PLAYING);
|
||||||
|
|
||||||
// while (GST_STATE_IS_SET(src,GST_STATE_READY))
|
while (1)
|
||||||
// while (1)
|
|
||||||
while (GST_STATE(src) & 1<<16)
|
|
||||||
gst_src_push(GST_SRC(src));
|
gst_src_push(GST_SRC(src));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user