mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
ext/raw1394/gstdv1394src.c (gst_dv1394src_iso_receive): Note license info in the source code -- was only in the commi...
Original commit message from CVS: 2005-08-16 Andy Wingo <wingo@pobox.com> * ext/raw1394/gstdv1394src.c (gst_dv1394src_iso_receive): Note license info in the source code -- was only in the commit log before. * ext/dv/gstdvdec.h: * ext/dv/gstdvdec.c: Only decodes systemstream=FALSE dv video -- old pipelines using dvdec should probably have a dvdemux first. * ext/dv/gstdvdemux.h: * ext/dv/gstdvdemux.c: Split out from dvdec, chunks the incoming systemstream=TRUE data into frames, sets caps data, and spits out PCM audio in addition to systemstream=FALSE video frames. Operates in chain mode only for now; should make a getrange version as well. * ext/dv/gstdv.c: New file, registers the libgstdv plugin. * ext/dv/Makefile.am: Library name changed to libgstdv. Split dvdec into dvdemux and dvdec.
This commit is contained in:
parent
27a2fdb58b
commit
c3f3fe9f25
8 changed files with 1285 additions and 1232 deletions
22
ChangeLog
22
ChangeLog
|
@ -1,3 +1,25 @@
|
|||
2005-08-16 Andy Wingo <wingo@pobox.com>
|
||||
|
||||
* ext/raw1394/gstdv1394src.c (gst_dv1394src_iso_receive): Note
|
||||
license info in the source code -- was only in the commit log
|
||||
before.
|
||||
|
||||
* ext/dv/gstdvdec.h:
|
||||
* ext/dv/gstdvdec.c: Only decodes systemstream=FALSE dv video --
|
||||
old pipelines using dvdec should probably have a dvdemux first.
|
||||
|
||||
* ext/dv/gstdvdemux.h:
|
||||
* ext/dv/gstdvdemux.c: Split out from dvdec, chunks the incoming
|
||||
systemstream=TRUE data into frames, sets caps data, and spits out
|
||||
PCM audio in addition to systemstream=FALSE video frames. Operates
|
||||
in chain mode only for now; should make a getrange version as
|
||||
well.
|
||||
|
||||
* ext/dv/gstdv.c: New file, registers the libgstdv plugin.
|
||||
|
||||
* ext/dv/Makefile.am: Library name changed to libgstdv. Split
|
||||
dvdec into dvdemux and dvdec.
|
||||
|
||||
2005-08-16 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||
|
||||
* ext/faad/gstfaad.c: (gst_faad_event), (gst_faad_chain):
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
|
||||
plugin_LTLIBRARIES = libgstdvdec.la
|
||||
plugin_LTLIBRARIES = libgstdv.la
|
||||
|
||||
libgstdvdec_la_SOURCES = gstdvdec.c
|
||||
libgstdvdec_la_CFLAGS = $(GST_CFLAGS) $(LIBDV_CFLAGS)
|
||||
libgstdvdec_la_LIBADD = $(LIBDV_LIBS) $(GST_BASE_LIBS)
|
||||
libgstdvdec_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(GST_PLUGINS_BASE_LIBS)
|
||||
libgstdv_la_SOURCES = gstdv.c gstdvdec.c gstdvdemux.c
|
||||
libgstdv_la_CFLAGS = $(GST_CFLAGS) $(LIBDV_CFLAGS)
|
||||
libgstdv_la_LIBADD = $(LIBDV_LIBS) $(GST_BASE_LIBS)
|
||||
libgstdv_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(GST_PLUGINS_BASE_LIBS)
|
||||
|
||||
noinst_HEADERS = gstdvdec.h
|
||||
noinst_HEADERS = gstdvdemux.h gstdvdec.h
|
||||
|
||||
#if HAVE_GTK
|
||||
#noinst_PROGRAMS = demo-play
|
||||
|
|
46
ext/dv/gstdv.c
Normal file
46
ext/dv/gstdv.c
Normal file
|
@ -0,0 +1,46 @@
|
|||
/* GStreamer
|
||||
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
||||
* <2005> Wim Taymans <wim@fluendo.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "gstdvdec.h"
|
||||
#include "gstdvdemux.h"
|
||||
|
||||
static gboolean
|
||||
plugin_init (GstPlugin * plugin)
|
||||
{
|
||||
if (!gst_element_register (plugin, "dvdemux", GST_RANK_PRIMARY,
|
||||
gst_dvdemux_get_type ()))
|
||||
return FALSE;
|
||||
|
||||
if (!gst_element_register (plugin, "dvdec", GST_RANK_SECONDARY,
|
||||
gst_dvdec_get_type ()))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
||||
GST_VERSION_MINOR,
|
||||
"dv",
|
||||
"DV demuxer and decoder based on libdv (libdv.sf.net)",
|
||||
plugin_init, VERSION, "LGPL", GST_PACKAGE, GST_ORIGIN);
|
1242
ext/dv/gstdvdec.c
1242
ext/dv/gstdvdec.c
File diff suppressed because it is too large
Load diff
|
@ -21,109 +21,65 @@
|
|||
#ifndef __GST_DVDEC_H__
|
||||
#define __GST_DVDEC_H__
|
||||
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <libdv/dv.h>
|
||||
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#include <libdv/dv.h>
|
||||
#include <gst/base/gstadapter.h>
|
||||
|
||||
/* This is the definition of the element's object structure. */
|
||||
#define GST_TYPE_DVDEC \
|
||||
(gst_dvdec_get_type())
|
||||
#define GST_DVDEC(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DVDEC,GstDVDec))
|
||||
#define GST_DVDEC_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DVDEC,GstDVDec))
|
||||
#define GST_IS_DVDEC(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DVDEC))
|
||||
#define GST_IS_DVDEC_CLASS(obj) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DVDEC))
|
||||
|
||||
|
||||
typedef struct _GstDVDec GstDVDec;
|
||||
typedef struct _GstDVDecClass GstDVDecClass;
|
||||
|
||||
|
||||
/* The structure itself is derived from GstElement, as can be seen by the
|
||||
* fact that there's a complete instance of the GstElement structure at
|
||||
* the beginning of the object. This allows the element to be cast to
|
||||
* an Element or even an Object.
|
||||
*/
|
||||
struct _GstDVDec {
|
||||
GstElement element;
|
||||
|
||||
/* We need to keep track of our pads, so we do so here. */
|
||||
GstPad *sinkpad;
|
||||
GstPad *videosrcpad;
|
||||
GstPad *audiosrcpad;
|
||||
GstPad *srcpad;
|
||||
|
||||
dv_decoder_t *decoder;
|
||||
gboolean clamp_luma;
|
||||
gboolean clamp_chroma;
|
||||
gint quality;
|
||||
|
||||
GstAdapter *adapter;
|
||||
gint frame_len;
|
||||
|
||||
/* PAL or NTSC flag */
|
||||
gboolean PAL;
|
||||
/* video params */
|
||||
gdouble framerate;
|
||||
gint height;
|
||||
gboolean wide;
|
||||
/* audio params */
|
||||
gint frequency;
|
||||
gint channels;
|
||||
|
||||
/* negotiated output */
|
||||
dv_color_space_t space;
|
||||
gint bpp;
|
||||
|
||||
gint video_offset;
|
||||
gint drop_factor;
|
||||
gint framecount;
|
||||
|
||||
guint64 timestamp;
|
||||
guint64 duration;
|
||||
guint64 audio_offset;
|
||||
guint64 video_offset;
|
||||
|
||||
gint64 start_byte;
|
||||
gint64 stop_byte;
|
||||
gint64 start_timestamp;
|
||||
gint64 stop_timestamp;
|
||||
|
||||
gboolean need_discont;
|
||||
gboolean new_media;
|
||||
gboolean loop;
|
||||
|
||||
gboolean found_header;
|
||||
|
||||
gint16 *audio_buffers[4];
|
||||
gboolean headers_seen;
|
||||
};
|
||||
|
||||
/* The other half of the object is its class. The class also derives from
|
||||
* the same parent, though it must be the class structure this time.
|
||||
* Function pointers for polymophic methods and signals are placed in this
|
||||
* structure. */
|
||||
typedef struct _GstDVDecClass GstDVDecClass;
|
||||
|
||||
struct _GstDVDecClass {
|
||||
GstElementClass parent_class;
|
||||
};
|
||||
|
||||
/* Five standard preprocessing macros are used in the Gtk+ object system.
|
||||
* The first uses the object's _get_type function to return the GType
|
||||
* of the object.
|
||||
*/
|
||||
#define GST_TYPE_DVDEC \
|
||||
(gst_dvdec_get_type())
|
||||
/* The second is a checking cast to the correct type. If the object passed
|
||||
* is not the right type, a warning will be generated on stderr.
|
||||
*/
|
||||
#define GST_DVDEC(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DVDEC,GstDVDec))
|
||||
/* The third is a checking cast of the class instead of the object. */
|
||||
#define GST_DVDEC_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DVDEC,GstDVDec))
|
||||
/* The last two simply check to see if the passed pointer is an object or
|
||||
* class of the correct type. */
|
||||
#define GST_IS_DVDEC(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DVDEC))
|
||||
#define GST_IS_DVDEC_CLASS(obj) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DVDEC))
|
||||
|
||||
/* This is the only prototype needed, because it is used in the above
|
||||
* GST_TYPE_DVDEC macro.
|
||||
*/
|
||||
GType gst_dvdec_get_type(void);
|
||||
GType gst_dvdec_get_type (void);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
#endif /* __GST_DVDEC_H__ */
|
||||
|
|
1001
ext/dv/gstdvdemux.c
Normal file
1001
ext/dv/gstdvdemux.c
Normal file
File diff suppressed because it is too large
Load diff
102
ext/dv/gstdvdemux.h
Normal file
102
ext/dv/gstdvdemux.h
Normal file
|
@ -0,0 +1,102 @@
|
|||
/* GStreamer
|
||||
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __GST_DVDEMUX_H__
|
||||
#define __GST_DVDEMUX_H__
|
||||
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <libdv/dv.h>
|
||||
#include <gst/base/gstadapter.h>
|
||||
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
#define GST_TYPE_DVDEMUX \
|
||||
(gst_dvdemux_get_type())
|
||||
#define GST_DVDEMUX(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DVDEMUX,GstDVDemux))
|
||||
#define GST_DVDEMUX_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DVDEMUX,GstDVDemux))
|
||||
#define GST_IS_DVDEMUX(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DVDEMUX))
|
||||
#define GST_IS_DVDEMUX_CLASS(obj) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DVDEMUX))
|
||||
|
||||
|
||||
typedef struct _GstDVDemux GstDVDemux;
|
||||
typedef struct _GstDVDemuxClass GstDVDemuxClass;
|
||||
|
||||
|
||||
struct _GstDVDemux {
|
||||
GstElement element;
|
||||
|
||||
GstPad *sinkpad;
|
||||
GstPad *videosrcpad;
|
||||
GstPad *audiosrcpad;
|
||||
|
||||
dv_decoder_t *decoder;
|
||||
|
||||
GstAdapter *adapter;
|
||||
gint frame_len;
|
||||
|
||||
/* PAL or NTSC flag */
|
||||
gboolean PAL;
|
||||
/* video params */
|
||||
gdouble framerate;
|
||||
gint height;
|
||||
gboolean wide;
|
||||
/* audio params */
|
||||
gint frequency;
|
||||
gint channels;
|
||||
|
||||
gint framecount;
|
||||
|
||||
guint64 timestamp;
|
||||
guint64 duration;
|
||||
guint64 audio_offset;
|
||||
guint64 video_offset;
|
||||
|
||||
gint64 start_byte;
|
||||
gint64 stop_byte;
|
||||
gint64 start_timestamp;
|
||||
gint64 stop_timestamp;
|
||||
|
||||
gboolean need_discont;
|
||||
gboolean new_media;
|
||||
|
||||
gboolean found_header;
|
||||
|
||||
gint16 *audio_buffers[4];
|
||||
};
|
||||
|
||||
struct _GstDVDemuxClass {
|
||||
GstElementClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
GType gst_dvdemux_get_type (void);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
#endif /* __GST_DVDEMUX_H__ */
|
|
@ -344,6 +344,8 @@ gst_dv1394src_iso_receive (raw1394handle_t handle, int channel, size_t len,
|
|||
if (len > 16) {
|
||||
/*
|
||||
the following code taken from kino-0.51 (Dan Dennedy/Charles Yates)
|
||||
Kindly relicensed under the LGPL. See the commit log for version 1.6 of
|
||||
this file in CVS.
|
||||
*/
|
||||
unsigned char *p = (unsigned char *) &data[3];
|
||||
int section_type = p[0] >> 5; /* section type is in bits 5 - 7 */
|
||||
|
|
Loading…
Reference in a new issue