2002-01-26 02:48:47 +00:00
|
|
|
/* GStreamer
|
2001-12-23 16:42:33 +00:00
|
|
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
Ported DVdec to 0.9.
Original commit message from CVS:
* configure.ac:
* ext/dv/Makefile.am:
* ext/dv/gstdvdec.c: (gst_dvdec_class_init), (gst_dvdec_init),
(gst_dvdec_get_src_query_types), (gst_dvdec_src_query),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_video_getcaps), (gst_dvdec_video_setcaps),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_chain),
(gst_dvdec_change_state), (gst_dvdec_set_property),
(gst_dvdec_get_property), (plugin_init):
* ext/dv/gstdvdec.h:
* ext/esd/esdsink.c: (gst_esdsink_class_init):
Ported DVdec to 0.9.
Parent of esdsink is GstAudioSink.
2005-07-07 17:03:47 +00:00
|
|
|
* <2005> Wim Taymans <wim@fluendo.com>
|
2001-12-23 16:42:33 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
docs/plugins/: Added dvdec and dvdemux to docs.
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-good-plugins-docs.sgml:
* docs/plugins/gst-plugins-good-plugins-sections.txt:
Added dvdec and dvdemux to docs.
* ext/dv/gstdvdec.c: (gst_dvdec_base_init), (gst_dvdec_chain):
Added docs.
Check frame sizes so we don't crash when don't have enough
data.
Send nice error messages on error.
* ext/dv/gstdvdemux.c: (gst_dvdemux_base_init),
(gst_dvdemux_class_init), (gst_dvdemux_init),
(gst_dvdemux_finalize), (gst_dvdemux_reset),
(gst_dvdemux_src_convert), (gst_dvdemux_sink_convert),
(gst_dvdemux_src_query), (gst_dvdemux_sink_query),
(gst_dvdemux_push_event), (gst_dvdemux_handle_sink_event),
(gst_dvdemux_convert_src_pair), (gst_dvdemux_convert_sink_pair),
(gst_dvdemux_convert_src_to_sink), (gst_dvdemux_handle_push_seek),
(gst_dvdemux_do_seek), (gst_dvdemux_handle_pull_seek),
(gst_dvdemux_handle_src_event), (gst_dvdemux_demux_audio),
(gst_dvdemux_demux_video), (gst_dvdemux_demux_frame),
(gst_dvdemux_flush), (gst_dvdemux_chain), (gst_dvdemux_loop),
(gst_dvdemux_sink_activate_push), (gst_dvdemux_sink_activate_pull),
(gst_dvdemux_sink_activate), (gst_dvdemux_change_state):
* ext/dv/gstdvdemux.h:
Added docs.
Implement pull mode.
Fix memleaks.
Reduce memcpy for the video demuxing.
2006-02-28 10:22:11 +00:00
|
|
|
/**
|
|
|
|
* SECTION:element-dvdec
|
|
|
|
*
|
|
|
|
* dvdec decodes DV video into raw video. The element expects a full DV frame
|
|
|
|
* as input, which is 120000 bytes for NTSC and 144000 for PAL video.
|
2009-01-28 15:46:06 +00:00
|
|
|
*
|
|
|
|
* This element can perform simple frame dropping with the #GstDVDec:drop-factor
|
docs/plugins/: Added dvdec and dvdemux to docs.
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-good-plugins-docs.sgml:
* docs/plugins/gst-plugins-good-plugins-sections.txt:
Added dvdec and dvdemux to docs.
* ext/dv/gstdvdec.c: (gst_dvdec_base_init), (gst_dvdec_chain):
Added docs.
Check frame sizes so we don't crash when don't have enough
data.
Send nice error messages on error.
* ext/dv/gstdvdemux.c: (gst_dvdemux_base_init),
(gst_dvdemux_class_init), (gst_dvdemux_init),
(gst_dvdemux_finalize), (gst_dvdemux_reset),
(gst_dvdemux_src_convert), (gst_dvdemux_sink_convert),
(gst_dvdemux_src_query), (gst_dvdemux_sink_query),
(gst_dvdemux_push_event), (gst_dvdemux_handle_sink_event),
(gst_dvdemux_convert_src_pair), (gst_dvdemux_convert_sink_pair),
(gst_dvdemux_convert_src_to_sink), (gst_dvdemux_handle_push_seek),
(gst_dvdemux_do_seek), (gst_dvdemux_handle_pull_seek),
(gst_dvdemux_handle_src_event), (gst_dvdemux_demux_audio),
(gst_dvdemux_demux_video), (gst_dvdemux_demux_frame),
(gst_dvdemux_flush), (gst_dvdemux_chain), (gst_dvdemux_loop),
(gst_dvdemux_sink_activate_push), (gst_dvdemux_sink_activate_pull),
(gst_dvdemux_sink_activate), (gst_dvdemux_change_state):
* ext/dv/gstdvdemux.h:
Added docs.
Implement pull mode.
Fix memleaks.
Reduce memcpy for the video demuxing.
2006-02-28 10:22:11 +00:00
|
|
|
* property. Setting this property to a value N > 1 will only decode every
|
|
|
|
* Nth frame.
|
2009-01-28 15:46:06 +00:00
|
|
|
*
|
|
|
|
* <refsect2>
|
docs/plugins/: Added dvdec and dvdemux to docs.
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-good-plugins-docs.sgml:
* docs/plugins/gst-plugins-good-plugins-sections.txt:
Added dvdec and dvdemux to docs.
* ext/dv/gstdvdec.c: (gst_dvdec_base_init), (gst_dvdec_chain):
Added docs.
Check frame sizes so we don't crash when don't have enough
data.
Send nice error messages on error.
* ext/dv/gstdvdemux.c: (gst_dvdemux_base_init),
(gst_dvdemux_class_init), (gst_dvdemux_init),
(gst_dvdemux_finalize), (gst_dvdemux_reset),
(gst_dvdemux_src_convert), (gst_dvdemux_sink_convert),
(gst_dvdemux_src_query), (gst_dvdemux_sink_query),
(gst_dvdemux_push_event), (gst_dvdemux_handle_sink_event),
(gst_dvdemux_convert_src_pair), (gst_dvdemux_convert_sink_pair),
(gst_dvdemux_convert_src_to_sink), (gst_dvdemux_handle_push_seek),
(gst_dvdemux_do_seek), (gst_dvdemux_handle_pull_seek),
(gst_dvdemux_handle_src_event), (gst_dvdemux_demux_audio),
(gst_dvdemux_demux_video), (gst_dvdemux_demux_frame),
(gst_dvdemux_flush), (gst_dvdemux_chain), (gst_dvdemux_loop),
(gst_dvdemux_sink_activate_push), (gst_dvdemux_sink_activate_pull),
(gst_dvdemux_sink_activate), (gst_dvdemux_change_state):
* ext/dv/gstdvdemux.h:
Added docs.
Implement pull mode.
Fix memleaks.
Reduce memcpy for the video demuxing.
2006-02-28 10:22:11 +00:00
|
|
|
* <title>Example launch line</title>
|
2009-01-28 15:46:06 +00:00
|
|
|
* |[
|
docs/plugins/: Added dvdec and dvdemux to docs.
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-good-plugins-docs.sgml:
* docs/plugins/gst-plugins-good-plugins-sections.txt:
Added dvdec and dvdemux to docs.
* ext/dv/gstdvdec.c: (gst_dvdec_base_init), (gst_dvdec_chain):
Added docs.
Check frame sizes so we don't crash when don't have enough
data.
Send nice error messages on error.
* ext/dv/gstdvdemux.c: (gst_dvdemux_base_init),
(gst_dvdemux_class_init), (gst_dvdemux_init),
(gst_dvdemux_finalize), (gst_dvdemux_reset),
(gst_dvdemux_src_convert), (gst_dvdemux_sink_convert),
(gst_dvdemux_src_query), (gst_dvdemux_sink_query),
(gst_dvdemux_push_event), (gst_dvdemux_handle_sink_event),
(gst_dvdemux_convert_src_pair), (gst_dvdemux_convert_sink_pair),
(gst_dvdemux_convert_src_to_sink), (gst_dvdemux_handle_push_seek),
(gst_dvdemux_do_seek), (gst_dvdemux_handle_pull_seek),
(gst_dvdemux_handle_src_event), (gst_dvdemux_demux_audio),
(gst_dvdemux_demux_video), (gst_dvdemux_demux_frame),
(gst_dvdemux_flush), (gst_dvdemux_chain), (gst_dvdemux_loop),
(gst_dvdemux_sink_activate_push), (gst_dvdemux_sink_activate_pull),
(gst_dvdemux_sink_activate), (gst_dvdemux_change_state):
* ext/dv/gstdvdemux.h:
Added docs.
Implement pull mode.
Fix memleaks.
Reduce memcpy for the video demuxing.
2006-02-28 10:22:11 +00:00
|
|
|
* gst-launch filesrc location=test.dv ! dvdemux name=demux ! dvdec ! xvimagesink
|
2009-01-28 15:46:06 +00:00
|
|
|
* ]| This pipeline decodes and renders the raw DV stream to a videosink.
|
docs/plugins/: Added dvdec and dvdemux to docs.
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-good-plugins-docs.sgml:
* docs/plugins/gst-plugins-good-plugins-sections.txt:
Added dvdec and dvdemux to docs.
* ext/dv/gstdvdec.c: (gst_dvdec_base_init), (gst_dvdec_chain):
Added docs.
Check frame sizes so we don't crash when don't have enough
data.
Send nice error messages on error.
* ext/dv/gstdvdemux.c: (gst_dvdemux_base_init),
(gst_dvdemux_class_init), (gst_dvdemux_init),
(gst_dvdemux_finalize), (gst_dvdemux_reset),
(gst_dvdemux_src_convert), (gst_dvdemux_sink_convert),
(gst_dvdemux_src_query), (gst_dvdemux_sink_query),
(gst_dvdemux_push_event), (gst_dvdemux_handle_sink_event),
(gst_dvdemux_convert_src_pair), (gst_dvdemux_convert_sink_pair),
(gst_dvdemux_convert_src_to_sink), (gst_dvdemux_handle_push_seek),
(gst_dvdemux_do_seek), (gst_dvdemux_handle_pull_seek),
(gst_dvdemux_handle_src_event), (gst_dvdemux_demux_audio),
(gst_dvdemux_demux_video), (gst_dvdemux_demux_frame),
(gst_dvdemux_flush), (gst_dvdemux_chain), (gst_dvdemux_loop),
(gst_dvdemux_sink_activate_push), (gst_dvdemux_sink_activate_pull),
(gst_dvdemux_sink_activate), (gst_dvdemux_change_state):
* ext/dv/gstdvdemux.h:
Added docs.
Implement pull mode.
Fix memleaks.
Reduce memcpy for the video demuxing.
2006-02-28 10:22:11 +00:00
|
|
|
* </refsect2>
|
2009-01-28 15:46:06 +00:00
|
|
|
*
|
|
|
|
* Last reviewed on 2006-02-28 (0.10.3)
|
docs/plugins/: Added dvdec and dvdemux to docs.
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-good-plugins-docs.sgml:
* docs/plugins/gst-plugins-good-plugins-sections.txt:
Added dvdec and dvdemux to docs.
* ext/dv/gstdvdec.c: (gst_dvdec_base_init), (gst_dvdec_chain):
Added docs.
Check frame sizes so we don't crash when don't have enough
data.
Send nice error messages on error.
* ext/dv/gstdvdemux.c: (gst_dvdemux_base_init),
(gst_dvdemux_class_init), (gst_dvdemux_init),
(gst_dvdemux_finalize), (gst_dvdemux_reset),
(gst_dvdemux_src_convert), (gst_dvdemux_sink_convert),
(gst_dvdemux_src_query), (gst_dvdemux_sink_query),
(gst_dvdemux_push_event), (gst_dvdemux_handle_sink_event),
(gst_dvdemux_convert_src_pair), (gst_dvdemux_convert_sink_pair),
(gst_dvdemux_convert_src_to_sink), (gst_dvdemux_handle_push_seek),
(gst_dvdemux_do_seek), (gst_dvdemux_handle_pull_seek),
(gst_dvdemux_handle_src_event), (gst_dvdemux_demux_audio),
(gst_dvdemux_demux_video), (gst_dvdemux_demux_frame),
(gst_dvdemux_flush), (gst_dvdemux_chain), (gst_dvdemux_loop),
(gst_dvdemux_sink_activate_push), (gst_dvdemux_sink_activate_pull),
(gst_dvdemux_sink_activate), (gst_dvdemux_change_state):
* ext/dv/gstdvdemux.h:
Added docs.
Implement pull mode.
Fix memleaks.
Reduce memcpy for the video demuxing.
2006-02-28 10:22:11 +00:00
|
|
|
*/
|
|
|
|
|
2003-06-29 19:46:12 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
2001-12-23 16:42:33 +00:00
|
|
|
#include <string.h>
|
2004-10-26 17:59:18 +00:00
|
|
|
#include <math.h>
|
2009-02-26 03:58:29 +00:00
|
|
|
#include <gst/video/video.h>
|
2001-12-23 16:42:33 +00:00
|
|
|
|
|
|
|
#include "gstdvdec.h"
|
|
|
|
|
2004-10-18 14:02:51 +00:00
|
|
|
|
Define GstElementDetails as const and also static (when defined as global)
Original commit message from CVS:
* ext/aalib/gstaasink.c:
* ext/annodex/gstcmmldec.c:
* ext/annodex/gstcmmlenc.c:
* ext/cairo/gsttextoverlay.c:
* ext/cairo/gsttimeoverlay.c:
* ext/cdio/gstcdiocddasrc.c:
* ext/dv/gstdvdec.c:
* ext/dv/gstdvdemux.c:
* ext/esd/esdmon.c:
* ext/esd/esdsink.c:
* ext/flac/gstflacenc.c:
* ext/flac/gstflactag.c:
* ext/gconf/gstgconfaudiosink.c: (gst_gconf_audio_sink_base_init):
* ext/gconf/gstgconfaudiosrc.c: (gst_gconf_audio_src_base_init):
* ext/gconf/gstgconfvideosink.c: (gst_gconf_video_sink_base_init):
* ext/gconf/gstgconfvideosrc.c: (gst_gconf_video_src_base_init):
* ext/gdk_pixbuf/pixbufscale.c:
* ext/hal/gsthalaudiosink.c: (gst_hal_audio_sink_base_init):
* ext/hal/gsthalaudiosrc.c: (gst_hal_audio_src_base_init):
* ext/jpeg/gstjpegdec.c:
* ext/jpeg/gstjpegenc.c:
* ext/jpeg/gstsmokedec.c:
* ext/jpeg/gstsmokeenc.c:
* ext/libcaca/gstcacasink.c:
* ext/libmng/gstmngdec.c:
* ext/libmng/gstmngenc.c:
* ext/libpng/gstpngdec.c:
* ext/libpng/gstpngenc.c:
* ext/mikmod/gstmikmod.c:
* ext/raw1394/gstdv1394src.c:
* ext/shout2/gstshout2.c: (gst_shout2send_init):
* ext/shout2/gstshout2.h:
* ext/speex/gstspeexdec.c:
* ext/speex/gstspeexenc.c:
* gst/alpha/gstalpha.c:
* gst/alpha/gstalphacolor.c:
* gst/apetag/gstapedemux.c:
* gst/auparse/gstauparse.c:
* gst/autodetect/gstautoaudiosink.c:
(gst_auto_audio_sink_base_init):
* gst/autodetect/gstautovideosink.c:
(gst_auto_video_sink_base_init):
* gst/avi/gstavidemux.c: (gst_avi_demux_base_init):
* gst/avi/gstavimux.c: (gst_avimux_base_init):
* gst/cutter/gstcutter.c:
* gst/debug/breakmydata.c:
* gst/debug/efence.c:
* gst/debug/gstnavigationtest.c:
* gst/debug/gstnavseek.c:
* gst/debug/negotiation.c:
* gst/debug/progressreport.c:
* gst/debug/testplugin.c:
* gst/effectv/gstaging.c:
* gst/effectv/gstdice.c:
* gst/effectv/gstedge.c:
* gst/effectv/gstquark.c:
* gst/effectv/gstrev.c:
* gst/effectv/gstshagadelic.c:
* gst/effectv/gstvertigo.c:
* gst/effectv/gstwarp.c:
* gst/flx/gstflxdec.c:
* gst/goom/gstgoom.c:
* gst/icydemux/gsticydemux.c:
* gst/id3demux/gstid3demux.c:
* gst/interleave/deinterleave.c:
* gst/interleave/interleave.c:
* gst/law/alaw-decode.c: (gst_alawdec_base_init):
* gst/law/alaw-encode.c: (gst_alawenc_base_init):
* gst/law/mulaw-decode.c: (gst_mulawdec_base_init):
* gst/law/mulaw-encode.c: (gst_mulawenc_base_init):
* gst/level/gstlevel.c:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_base_init):
* gst/matroska/matroska-mux.c: (gst_matroska_mux_base_init):
* gst/median/gstmedian.c:
* gst/monoscope/gstmonoscope.c:
* gst/multipart/multipartdemux.c:
* gst/multipart/multipartmux.c:
* gst/oldcore/gstaggregator.c:
* gst/oldcore/gstfdsink.c:
* gst/oldcore/gstmd5sink.c:
* gst/oldcore/gstmultifilesrc.c:
* gst/oldcore/gstpipefilter.c:
* gst/oldcore/gstshaper.c:
* gst/oldcore/gststatistics.c:
* gst/rtp/gstasteriskh263.c:
* gst/rtp/gstrtpL16depay.c:
* gst/rtp/gstrtpL16pay.c:
* gst/rtp/gstrtpamrdepay.c:
* gst/rtp/gstrtpamrpay.c:
* gst/rtp/gstrtpdepay.c:
* gst/rtp/gstrtpgsmpay.c:
* gst/rtp/gstrtph263pay.c:
* gst/rtp/gstrtph263pdepay.c:
* gst/rtp/gstrtph263ppay.c:
* gst/rtp/gstrtpilbcdepay.c:
* gst/rtp/gstrtpmp4gpay.c:
* gst/rtp/gstrtpmp4vdepay.c:
* gst/rtp/gstrtpmp4vpay.c:
* gst/rtp/gstrtpmpadepay.c:
* gst/rtp/gstrtpmpapay.c:
* gst/rtp/gstrtppcmadepay.c:
* gst/rtp/gstrtppcmapay.c:
* gst/rtp/gstrtppcmudepay.c:
* gst/rtp/gstrtppcmupay.c:
* gst/rtp/gstrtpspeexdepay.c:
* gst/rtp/gstrtpspeexpay.c:
* gst/rtsp/gstrtpdec.c:
* gst/rtsp/gstrtspsrc.c:
* gst/smpte/gstsmpte.c:
* gst/udp/gstdynudpsink.c:
* gst/udp/gstmultiudpsink.c:
* gst/udp/gstudpsink.c:
* gst/udp/gstudpsrc.c:
* gst/videobox/gstvideobox.c:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init):
* gst/videofilter/gstvideobalance.c:
* gst/videofilter/gstvideoflip.c:
* gst/videofilter/gstvideotemplate.c:
(gst_videotemplate_base_init):
* gst/videomixer/videomixer.c:
* gst/wavparse/gstwavparse.c: (gst_wavparse_base_init),
(gst_wavparse_class_init), (gst_wavparse_dispose),
(gst_wavparse_reset), (gst_wavparse_init),
(gst_wavparse_perform_seek), (gst_wavparse_peek_chunk_info),
(gst_wavparse_peek_chunk), (gst_wavparse_stream_headers),
(gst_wavparse_parse_stream_init), (gst_wavparse_send_event),
(gst_wavparse_add_src_pad), (gst_wavparse_stream_data),
(gst_wavparse_chain), (gst_wavparse_srcpad_event),
(gst_wavparse_sink_activate), (gst_wavparse_sink_activate_pull),
(gst_wavparse_change_state):
* gst/wavparse/gstwavparse.h:
* sys/oss/gstossmixerelement.c:
* sys/oss/gstosssink.c:
* sys/oss/gstosssrc.c:
* sys/osxaudio/gstosxaudioelement.c:
* sys/osxaudio/gstosxaudiosink.c:
* sys/osxaudio/gstosxaudiosrc.c:
* sys/sunaudio/gstsunaudiomixer.c:
* sys/sunaudio/gstsunaudiosink.c:
Define GstElementDetails as const and also static (when defined as
global)
2006-04-25 21:39:46 +00:00
|
|
|
static const GstElementDetails dvdec_details =
|
2006-03-30 15:37:05 +00:00
|
|
|
GST_ELEMENT_DETAILS ("DV video decoder",
|
2004-03-14 20:54:13 +00:00
|
|
|
"Codec/Decoder/Video",
|
2006-03-30 15:37:05 +00:00
|
|
|
"Uses libdv to decode DV video (smpte314) (libdv.sourceforge.net)",
|
Ported DVdec to 0.9.
Original commit message from CVS:
* configure.ac:
* ext/dv/Makefile.am:
* ext/dv/gstdvdec.c: (gst_dvdec_class_init), (gst_dvdec_init),
(gst_dvdec_get_src_query_types), (gst_dvdec_src_query),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_video_getcaps), (gst_dvdec_video_setcaps),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_chain),
(gst_dvdec_change_state), (gst_dvdec_set_property),
(gst_dvdec_get_property), (plugin_init):
* ext/dv/gstdvdec.h:
* ext/esd/esdsink.c: (gst_esdsink_class_init):
Ported DVdec to 0.9.
Parent of esdsink is GstAudioSink.
2005-07-07 17:03:47 +00:00
|
|
|
"Erik Walthinsen <omega@cse.ogi.edu>," "Wim Taymans <wim@fluendo.com>");
|
2001-12-23 16:42:33 +00:00
|
|
|
|
docs/plugins/: Added dvdec and dvdemux to docs.
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-good-plugins-docs.sgml:
* docs/plugins/gst-plugins-good-plugins-sections.txt:
Added dvdec and dvdemux to docs.
* ext/dv/gstdvdec.c: (gst_dvdec_base_init), (gst_dvdec_chain):
Added docs.
Check frame sizes so we don't crash when don't have enough
data.
Send nice error messages on error.
* ext/dv/gstdvdemux.c: (gst_dvdemux_base_init),
(gst_dvdemux_class_init), (gst_dvdemux_init),
(gst_dvdemux_finalize), (gst_dvdemux_reset),
(gst_dvdemux_src_convert), (gst_dvdemux_sink_convert),
(gst_dvdemux_src_query), (gst_dvdemux_sink_query),
(gst_dvdemux_push_event), (gst_dvdemux_handle_sink_event),
(gst_dvdemux_convert_src_pair), (gst_dvdemux_convert_sink_pair),
(gst_dvdemux_convert_src_to_sink), (gst_dvdemux_handle_push_seek),
(gst_dvdemux_do_seek), (gst_dvdemux_handle_pull_seek),
(gst_dvdemux_handle_src_event), (gst_dvdemux_demux_audio),
(gst_dvdemux_demux_video), (gst_dvdemux_demux_frame),
(gst_dvdemux_flush), (gst_dvdemux_chain), (gst_dvdemux_loop),
(gst_dvdemux_sink_activate_push), (gst_dvdemux_sink_activate_pull),
(gst_dvdemux_sink_activate), (gst_dvdemux_change_state):
* ext/dv/gstdvdemux.h:
Added docs.
Implement pull mode.
Fix memleaks.
Reduce memcpy for the video demuxing.
2006-02-28 10:22:11 +00:00
|
|
|
/* sizes of one input buffer */
|
2007-03-09 17:32:32 +00:00
|
|
|
#define NTSC_HEIGHT 480
|
docs/plugins/: Added dvdec and dvdemux to docs.
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-good-plugins-docs.sgml:
* docs/plugins/gst-plugins-good-plugins-sections.txt:
Added dvdec and dvdemux to docs.
* ext/dv/gstdvdec.c: (gst_dvdec_base_init), (gst_dvdec_chain):
Added docs.
Check frame sizes so we don't crash when don't have enough
data.
Send nice error messages on error.
* ext/dv/gstdvdemux.c: (gst_dvdemux_base_init),
(gst_dvdemux_class_init), (gst_dvdemux_init),
(gst_dvdemux_finalize), (gst_dvdemux_reset),
(gst_dvdemux_src_convert), (gst_dvdemux_sink_convert),
(gst_dvdemux_src_query), (gst_dvdemux_sink_query),
(gst_dvdemux_push_event), (gst_dvdemux_handle_sink_event),
(gst_dvdemux_convert_src_pair), (gst_dvdemux_convert_sink_pair),
(gst_dvdemux_convert_src_to_sink), (gst_dvdemux_handle_push_seek),
(gst_dvdemux_do_seek), (gst_dvdemux_handle_pull_seek),
(gst_dvdemux_handle_src_event), (gst_dvdemux_demux_audio),
(gst_dvdemux_demux_video), (gst_dvdemux_demux_frame),
(gst_dvdemux_flush), (gst_dvdemux_chain), (gst_dvdemux_loop),
(gst_dvdemux_sink_activate_push), (gst_dvdemux_sink_activate_pull),
(gst_dvdemux_sink_activate), (gst_dvdemux_change_state):
* ext/dv/gstdvdemux.h:
Added docs.
Implement pull mode.
Fix memleaks.
Reduce memcpy for the video demuxing.
2006-02-28 10:22:11 +00:00
|
|
|
#define NTSC_BUFFER 120000
|
2007-03-09 17:32:32 +00:00
|
|
|
#define NTSC_FRAMERATE_NUMERATOR 30000
|
|
|
|
#define NTSC_FRAMERATE_DENOMINATOR 1001
|
|
|
|
|
|
|
|
#define PAL_HEIGHT 576
|
docs/plugins/: Added dvdec and dvdemux to docs.
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-good-plugins-docs.sgml:
* docs/plugins/gst-plugins-good-plugins-sections.txt:
Added dvdec and dvdemux to docs.
* ext/dv/gstdvdec.c: (gst_dvdec_base_init), (gst_dvdec_chain):
Added docs.
Check frame sizes so we don't crash when don't have enough
data.
Send nice error messages on error.
* ext/dv/gstdvdemux.c: (gst_dvdemux_base_init),
(gst_dvdemux_class_init), (gst_dvdemux_init),
(gst_dvdemux_finalize), (gst_dvdemux_reset),
(gst_dvdemux_src_convert), (gst_dvdemux_sink_convert),
(gst_dvdemux_src_query), (gst_dvdemux_sink_query),
(gst_dvdemux_push_event), (gst_dvdemux_handle_sink_event),
(gst_dvdemux_convert_src_pair), (gst_dvdemux_convert_sink_pair),
(gst_dvdemux_convert_src_to_sink), (gst_dvdemux_handle_push_seek),
(gst_dvdemux_do_seek), (gst_dvdemux_handle_pull_seek),
(gst_dvdemux_handle_src_event), (gst_dvdemux_demux_audio),
(gst_dvdemux_demux_video), (gst_dvdemux_demux_frame),
(gst_dvdemux_flush), (gst_dvdemux_chain), (gst_dvdemux_loop),
(gst_dvdemux_sink_activate_push), (gst_dvdemux_sink_activate_pull),
(gst_dvdemux_sink_activate), (gst_dvdemux_change_state):
* ext/dv/gstdvdemux.h:
Added docs.
Implement pull mode.
Fix memleaks.
Reduce memcpy for the video demuxing.
2006-02-28 10:22:11 +00:00
|
|
|
#define PAL_BUFFER 144000
|
2007-03-09 17:32:32 +00:00
|
|
|
#define PAL_FRAMERATE_NUMERATOR 25
|
|
|
|
#define PAL_FRAMERATE_DENOMINATOR 1
|
|
|
|
|
|
|
|
#define PAL_NORMAL_PAR_X 59
|
|
|
|
#define PAL_NORMAL_PAR_Y 54
|
|
|
|
#define PAL_WIDE_PAR_X 118
|
|
|
|
#define PAL_WIDE_PAR_Y 81
|
|
|
|
|
|
|
|
#define NTSC_NORMAL_PAR_X 10
|
|
|
|
#define NTSC_NORMAL_PAR_Y 11
|
|
|
|
#define NTSC_WIDE_PAR_X 40
|
|
|
|
#define NTSC_WIDE_PAR_Y 33
|
2002-01-26 02:48:47 +00:00
|
|
|
|
2004-06-27 16:38:41 +00:00
|
|
|
#define DV_DEFAULT_QUALITY DV_QUALITY_BEST
|
|
|
|
#define DV_DEFAULT_DECODE_NTH 1
|
|
|
|
|
2006-06-22 19:31:04 +00:00
|
|
|
GST_DEBUG_CATEGORY_STATIC (dvdec_debug);
|
ext/dv/: Ueber spiffify some more, added debug category.
Original commit message from CVS:
* ext/dv/gstdvdec.c: (gst_dvdec_base_init), (gst_dvdec_init),
(gst_dvdec_change_state):
* ext/dv/gstdvdec.h:
* ext/dv/gstdvdemux.c: (gst_dvdemux_base_init), (gst_dvdemux_init),
(gst_dvdemux_src_convert), (gst_dvdemux_sink_convert),
(gst_dvdemux_src_query), (gst_dvdemux_sink_query),
(gst_dvdemux_handle_sink_event), (gst_dvdemux_demux_frame),
(gst_dvdemux_flush), (gst_dvdemux_chain),
(gst_dvdemux_change_state):
* ext/dv/gstdvdemux.h:
Ueber spiffify some more, added debug category.
Use _scale.
Use segments, respect playback rate from newsegment.
Fix refcount issue.
2006-02-22 20:22:25 +00:00
|
|
|
#define GST_CAT_DEFAULT dvdec_debug
|
|
|
|
|
2004-03-14 20:54:13 +00:00
|
|
|
enum
|
|
|
|
{
|
2005-08-16 14:04:39 +00:00
|
|
|
PROP_0,
|
|
|
|
PROP_CLAMP_LUMA,
|
|
|
|
PROP_CLAMP_CHROMA,
|
|
|
|
PROP_QUALITY,
|
|
|
|
PROP_DECODE_NTH
|
2001-12-23 16:42:33 +00:00
|
|
|
};
|
|
|
|
|
2004-05-12 14:53:57 +00:00
|
|
|
const gint qualities[] = {
|
|
|
|
DV_QUALITY_DC,
|
|
|
|
DV_QUALITY_AC_1,
|
|
|
|
DV_QUALITY_AC_2,
|
|
|
|
DV_QUALITY_DC | DV_QUALITY_COLOR,
|
|
|
|
DV_QUALITY_AC_1 | DV_QUALITY_COLOR,
|
2004-05-21 23:28:57 +00:00
|
|
|
DV_QUALITY_AC_2 | DV_QUALITY_COLOR
|
2004-05-12 14:53:57 +00:00
|
|
|
};
|
|
|
|
|
2004-03-14 20:54:13 +00:00
|
|
|
static GstStaticPadTemplate sink_temp = GST_STATIC_PAD_TEMPLATE ("sink",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
2005-08-16 14:04:39 +00:00
|
|
|
GST_STATIC_CAPS ("video/x-dv, systemstream = (boolean) false")
|
2004-03-14 20:54:13 +00:00
|
|
|
);
|
|
|
|
|
2005-08-16 14:04:39 +00:00
|
|
|
static GstStaticPadTemplate src_temp = GST_STATIC_PAD_TEMPLATE ("src",
|
2004-03-14 20:54:13 +00:00
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS ("video/x-raw-yuv, "
|
2004-03-15 19:32:27 +00:00
|
|
|
"format = (fourcc) YUY2, "
|
|
|
|
"width = (int) 720, "
|
2005-11-22 17:09:36 +00:00
|
|
|
"framerate = (fraction) [ 1/1, 60/1 ];"
|
2004-03-15 19:32:27 +00:00
|
|
|
"video/x-raw-rgb, "
|
|
|
|
"bpp = (int) 32, "
|
2005-01-07 22:42:32 +00:00
|
|
|
"depth = (int) 24, "
|
2004-03-15 19:32:27 +00:00
|
|
|
"endianness = (int) " G_STRINGIFY (G_BIG_ENDIAN) ", "
|
2005-01-08 15:30:33 +00:00
|
|
|
"red_mask = (int) 0x0000ff00, "
|
|
|
|
"green_mask = (int) 0x00ff0000, "
|
|
|
|
"blue_mask = (int) 0xff000000, "
|
2004-03-15 19:32:27 +00:00
|
|
|
"width = (int) 720, "
|
2005-11-22 17:09:36 +00:00
|
|
|
"framerate = (fraction) [ 1/1, 60/1 ];"
|
2004-03-15 19:32:27 +00:00
|
|
|
"video/x-raw-rgb, "
|
|
|
|
"bpp = (int) 24, "
|
|
|
|
"depth = (int) 24, "
|
|
|
|
"endianness = (int) " G_STRINGIFY (G_BIG_ENDIAN) ", "
|
2004-05-07 16:17:25 +00:00
|
|
|
"red_mask = (int) 0x00ff0000, "
|
2004-03-15 19:32:27 +00:00
|
|
|
"green_mask = (int) 0x0000ff00, "
|
2004-05-07 16:17:25 +00:00
|
|
|
"blue_mask = (int) 0x000000ff, "
|
2005-11-22 17:09:36 +00:00
|
|
|
"width = (int) 720, " "framerate = (fraction) [ 1/1, 60/1 ]")
|
2004-03-14 20:54:13 +00:00
|
|
|
);
|
2001-12-23 16:42:33 +00:00
|
|
|
|
2002-09-09 22:20:34 +00:00
|
|
|
#define GST_TYPE_DVDEC_QUALITY (gst_dvdec_quality_get_type())
|
|
|
|
GType
|
|
|
|
gst_dvdec_quality_get_type (void)
|
|
|
|
{
|
|
|
|
static GType qtype = 0;
|
2004-03-14 20:54:13 +00:00
|
|
|
|
2002-09-09 22:20:34 +00:00
|
|
|
if (qtype == 0) {
|
2004-05-12 14:53:57 +00:00
|
|
|
static const GEnumValue values[] = {
|
2005-11-22 18:11:58 +00:00
|
|
|
{0, "Monochrome, DC (Fastest)", "fastest"},
|
|
|
|
{1, "Monochrome, first AC coefficient", "monochrome-ac"},
|
|
|
|
{2, "Monochrome, highest quality", "monochrome-best"},
|
|
|
|
{3, "Colour, DC, fastest", "colour-fastest"},
|
|
|
|
{4, "Colour, using only the first AC coefficient", "colour-ac"},
|
|
|
|
{5, "Highest quality colour decoding", "best"},
|
2004-05-19 09:21:43 +00:00
|
|
|
{0, NULL, NULL},
|
2002-09-09 22:20:34 +00:00
|
|
|
};
|
2004-03-15 19:32:27 +00:00
|
|
|
|
2004-05-12 14:53:57 +00:00
|
|
|
qtype = g_enum_register_static ("GstDVDecQualityEnum", values);
|
2002-09-09 22:20:34 +00:00
|
|
|
}
|
|
|
|
return qtype;
|
|
|
|
}
|
|
|
|
|
2005-08-16 14:04:39 +00:00
|
|
|
GST_BOILERPLATE (GstDVDec, gst_dvdec, GstElement, GST_TYPE_ELEMENT);
|
Ported DVdec to 0.9.
Original commit message from CVS:
* configure.ac:
* ext/dv/Makefile.am:
* ext/dv/gstdvdec.c: (gst_dvdec_class_init), (gst_dvdec_init),
(gst_dvdec_get_src_query_types), (gst_dvdec_src_query),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_video_getcaps), (gst_dvdec_video_setcaps),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_chain),
(gst_dvdec_change_state), (gst_dvdec_set_property),
(gst_dvdec_get_property), (plugin_init):
* ext/dv/gstdvdec.h:
* ext/esd/esdsink.c: (gst_esdsink_class_init):
Ported DVdec to 0.9.
Parent of esdsink is GstAudioSink.
2005-07-07 17:03:47 +00:00
|
|
|
|
2006-06-14 15:59:56 +00:00
|
|
|
static void gst_dvdec_finalize (GObject * object);
|
2005-08-16 14:04:39 +00:00
|
|
|
static gboolean gst_dvdec_sink_setcaps (GstPad * pad, GstCaps * caps);
|
Ported DVdec to 0.9.
Original commit message from CVS:
* configure.ac:
* ext/dv/Makefile.am:
* ext/dv/gstdvdec.c: (gst_dvdec_class_init), (gst_dvdec_init),
(gst_dvdec_get_src_query_types), (gst_dvdec_src_query),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_video_getcaps), (gst_dvdec_video_setcaps),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_chain),
(gst_dvdec_change_state), (gst_dvdec_set_property),
(gst_dvdec_get_property), (plugin_init):
* ext/dv/gstdvdec.h:
* ext/esd/esdsink.c: (gst_esdsink_class_init):
Ported DVdec to 0.9.
Parent of esdsink is GstAudioSink.
2005-07-07 17:03:47 +00:00
|
|
|
static GstFlowReturn gst_dvdec_chain (GstPad * pad, GstBuffer * buffer);
|
2006-06-02 11:33:18 +00:00
|
|
|
static gboolean gst_dvdec_sink_event (GstPad * pad, GstEvent * event);
|
2004-03-14 20:54:13 +00:00
|
|
|
|
2005-09-02 15:44:50 +00:00
|
|
|
static GstStateChangeReturn gst_dvdec_change_state (GstElement * element,
|
|
|
|
GstStateChange transition);
|
2004-03-14 20:54:13 +00:00
|
|
|
|
|
|
|
static void gst_dvdec_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec);
|
|
|
|
static void gst_dvdec_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec);
|
2001-12-23 16:42:33 +00:00
|
|
|
|
2003-11-02 03:32:31 +00:00
|
|
|
static void
|
|
|
|
gst_dvdec_base_init (gpointer g_class)
|
|
|
|
{
|
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
|
|
|
|
2004-03-14 20:54:13 +00:00
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&sink_temp));
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
2005-08-16 14:04:39 +00:00
|
|
|
gst_static_pad_template_get (&src_temp));
|
2003-11-02 03:32:31 +00:00
|
|
|
|
|
|
|
gst_element_class_set_details (element_class, &dvdec_details);
|
ext/dv/: Ueber spiffify some more, added debug category.
Original commit message from CVS:
* ext/dv/gstdvdec.c: (gst_dvdec_base_init), (gst_dvdec_init),
(gst_dvdec_change_state):
* ext/dv/gstdvdec.h:
* ext/dv/gstdvdemux.c: (gst_dvdemux_base_init), (gst_dvdemux_init),
(gst_dvdemux_src_convert), (gst_dvdemux_sink_convert),
(gst_dvdemux_src_query), (gst_dvdemux_sink_query),
(gst_dvdemux_handle_sink_event), (gst_dvdemux_demux_frame),
(gst_dvdemux_flush), (gst_dvdemux_chain),
(gst_dvdemux_change_state):
* ext/dv/gstdvdemux.h:
Ueber spiffify some more, added debug category.
Use _scale.
Use segments, respect playback rate from newsegment.
Fix refcount issue.
2006-02-22 20:22:25 +00:00
|
|
|
|
|
|
|
GST_DEBUG_CATEGORY_INIT (dvdec_debug, "dvdec", 0, "DV decoding element");
|
2003-11-02 03:32:31 +00:00
|
|
|
}
|
|
|
|
|
2001-12-23 16:42:33 +00:00
|
|
|
static void
|
2004-03-14 20:54:13 +00:00
|
|
|
gst_dvdec_class_init (GstDVDecClass * klass)
|
2001-12-23 16:42:33 +00:00
|
|
|
{
|
|
|
|
GObjectClass *gobject_class;
|
|
|
|
GstElementClass *gstelement_class;
|
|
|
|
|
2004-03-14 20:54:13 +00:00
|
|
|
gobject_class = (GObjectClass *) klass;
|
|
|
|
gstelement_class = (GstElementClass *) klass;
|
2001-12-23 16:42:33 +00:00
|
|
|
|
2006-06-14 15:59:56 +00:00
|
|
|
gobject_class->finalize = gst_dvdec_finalize;
|
Ported DVdec to 0.9.
Original commit message from CVS:
* configure.ac:
* ext/dv/Makefile.am:
* ext/dv/gstdvdec.c: (gst_dvdec_class_init), (gst_dvdec_init),
(gst_dvdec_get_src_query_types), (gst_dvdec_src_query),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_video_getcaps), (gst_dvdec_video_setcaps),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_chain),
(gst_dvdec_change_state), (gst_dvdec_set_property),
(gst_dvdec_get_property), (plugin_init):
* ext/dv/gstdvdec.h:
* ext/esd/esdsink.c: (gst_esdsink_class_init):
Ported DVdec to 0.9.
Parent of esdsink is GstAudioSink.
2005-07-07 17:03:47 +00:00
|
|
|
gobject_class->set_property = gst_dvdec_set_property;
|
|
|
|
gobject_class->get_property = gst_dvdec_get_property;
|
|
|
|
|
2005-08-16 14:04:39 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_CLAMP_LUMA,
|
2004-03-14 20:54:13 +00:00
|
|
|
g_param_spec_boolean ("clamp_luma", "Clamp luma", "Clamp luma",
|
2004-03-15 19:32:27 +00:00
|
|
|
FALSE, G_PARAM_READWRITE));
|
2005-08-16 14:04:39 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_CLAMP_CHROMA,
|
2004-03-14 20:54:13 +00:00
|
|
|
g_param_spec_boolean ("clamp_chroma", "Clamp chroma", "Clamp chroma",
|
2004-03-15 19:32:27 +00:00
|
|
|
FALSE, G_PARAM_READWRITE));
|
2005-08-16 14:04:39 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_QUALITY,
|
2004-05-12 14:53:57 +00:00
|
|
|
g_param_spec_enum ("quality", "Quality", "Decoding quality",
|
2004-06-27 16:38:41 +00:00
|
|
|
GST_TYPE_DVDEC_QUALITY, DV_DEFAULT_QUALITY, G_PARAM_READWRITE));
|
2005-08-16 14:04:39 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_DECODE_NTH,
|
2004-06-27 16:38:41 +00:00
|
|
|
g_param_spec_int ("drop-factor", "Drop Factor", "Only decode Nth frame",
|
|
|
|
1, G_MAXINT, DV_DEFAULT_DECODE_NTH, G_PARAM_READWRITE));
|
2002-09-09 22:20:34 +00:00
|
|
|
|
2002-01-26 02:48:47 +00:00
|
|
|
gstelement_class->change_state = gst_dvdec_change_state;
|
2001-12-23 16:42:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-08-28 17:59:20 +00:00
|
|
|
gst_dvdec_init (GstDVDec * dvdec, GstDVDecClass * g_class)
|
2001-12-23 16:42:33 +00:00
|
|
|
{
|
2007-03-04 13:41:00 +00:00
|
|
|
dvdec->sinkpad = gst_pad_new_from_static_template (&sink_temp, "sink");
|
2005-08-16 14:04:39 +00:00
|
|
|
gst_pad_set_setcaps_function (dvdec->sinkpad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_dvdec_sink_setcaps));
|
Ported DVdec to 0.9.
Original commit message from CVS:
* configure.ac:
* ext/dv/Makefile.am:
* ext/dv/gstdvdec.c: (gst_dvdec_class_init), (gst_dvdec_init),
(gst_dvdec_get_src_query_types), (gst_dvdec_src_query),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_video_getcaps), (gst_dvdec_video_setcaps),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_chain),
(gst_dvdec_change_state), (gst_dvdec_set_property),
(gst_dvdec_get_property), (plugin_init):
* ext/dv/gstdvdec.h:
* ext/esd/esdsink.c: (gst_esdsink_class_init):
Ported DVdec to 0.9.
Parent of esdsink is GstAudioSink.
2005-07-07 17:03:47 +00:00
|
|
|
gst_pad_set_chain_function (dvdec->sinkpad, gst_dvdec_chain);
|
2006-06-02 11:33:18 +00:00
|
|
|
gst_pad_set_event_function (dvdec->sinkpad, gst_dvdec_sink_event);
|
2004-05-21 13:28:24 +00:00
|
|
|
gst_element_add_pad (GST_ELEMENT (dvdec), dvdec->sinkpad);
|
2004-03-14 20:54:13 +00:00
|
|
|
|
2007-03-04 13:41:00 +00:00
|
|
|
dvdec->srcpad = gst_pad_new_from_static_template (&src_temp, "src");
|
2005-08-16 14:04:39 +00:00
|
|
|
gst_pad_use_fixed_caps (dvdec->srcpad);
|
|
|
|
gst_element_add_pad (GST_ELEMENT (dvdec), dvdec->srcpad);
|
2001-12-23 16:42:33 +00:00
|
|
|
|
2005-11-22 17:09:36 +00:00
|
|
|
dvdec->framerate_numerator = 0;
|
|
|
|
dvdec->framerate_denominator = 0;
|
2004-10-18 17:49:09 +00:00
|
|
|
dvdec->wide = FALSE;
|
2004-06-27 16:38:41 +00:00
|
|
|
dvdec->drop_factor = 1;
|
2004-03-14 20:54:13 +00:00
|
|
|
|
2002-09-09 22:20:34 +00:00
|
|
|
dvdec->clamp_luma = FALSE;
|
|
|
|
dvdec->clamp_chroma = FALSE;
|
2004-06-27 16:38:41 +00:00
|
|
|
dvdec->quality = DV_DEFAULT_QUALITY;
|
2006-06-14 15:59:56 +00:00
|
|
|
dvdec->segment = gst_segment_new ();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_dvdec_finalize (GObject * object)
|
|
|
|
{
|
|
|
|
GstDVDec *dvdec = GST_DVDEC (object);
|
|
|
|
|
|
|
|
gst_segment_free (dvdec->segment);
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
2002-01-26 02:48:47 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 14:45:46 +00:00
|
|
|
static gboolean
|
2005-08-16 14:04:39 +00:00
|
|
|
gst_dvdec_sink_setcaps (GstPad * pad, GstCaps * caps)
|
2002-06-16 14:45:46 +00:00
|
|
|
{
|
|
|
|
GstDVDec *dvdec;
|
2005-08-16 14:04:39 +00:00
|
|
|
GstStructure *s;
|
2005-11-26 12:54:47 +00:00
|
|
|
const GValue *par = NULL, *rate = NULL;
|
2004-03-14 20:54:13 +00:00
|
|
|
|
2002-06-16 14:45:46 +00:00
|
|
|
dvdec = GST_DVDEC (gst_pad_get_parent (pad));
|
2004-03-14 20:54:13 +00:00
|
|
|
|
2005-08-16 14:04:39 +00:00
|
|
|
/* first parse the caps */
|
|
|
|
s = gst_caps_get_structure (caps, 0);
|
2002-06-16 14:45:46 +00:00
|
|
|
|
2007-03-09 17:32:32 +00:00
|
|
|
/* we allow framerate and PAR to be overwritten. framerate is mandatory. */
|
2005-11-22 17:09:36 +00:00
|
|
|
if (!(rate = gst_structure_get_value (s, "framerate")))
|
2007-03-09 17:32:32 +00:00
|
|
|
goto no_framerate;
|
|
|
|
par = gst_structure_get_value (s, "pixel-aspect-ratio");
|
|
|
|
|
|
|
|
if (par) {
|
|
|
|
dvdec->par_x = gst_value_get_fraction_numerator (par);
|
|
|
|
dvdec->par_y = gst_value_get_fraction_denominator (par);
|
|
|
|
dvdec->need_par = FALSE;
|
|
|
|
} else {
|
|
|
|
dvdec->par_x = 0;
|
|
|
|
dvdec->par_y = 0;
|
|
|
|
dvdec->need_par = TRUE;
|
|
|
|
}
|
2005-11-22 17:09:36 +00:00
|
|
|
dvdec->framerate_numerator = gst_value_get_fraction_numerator (rate);
|
|
|
|
dvdec->framerate_denominator = gst_value_get_fraction_denominator (rate);
|
2007-03-09 17:32:32 +00:00
|
|
|
dvdec->sink_negotiated = TRUE;
|
|
|
|
dvdec->src_negotiated = FALSE;
|
2005-11-22 17:09:36 +00:00
|
|
|
|
2007-03-09 17:32:32 +00:00
|
|
|
gst_object_unref (dvdec);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
/* ERRORS */
|
|
|
|
no_framerate:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (dvdec, "no framerate specified in caps");
|
|
|
|
gst_object_unref (dvdec);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
ext/dv/gstdvdec.*: Implemented seeking in dvdec.
Original commit message from CVS:
* ext/dv/gstdvdec.c: (gst_dvdec_init), (gst_dvdec_src_convert),
(gst_dvdec_sink_convert), (gst_dvdec_get_src_query_types),
(gst_dvdec_src_query), (gst_dvdec_get_sink_query_types),
(gst_dvdec_sink_query), (gst_dvdec_send_event),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_flush), (gst_dvdec_chain):
* ext/dv/gstdvdec.h:
Implemented seeking in dvdec.
2005-07-19 11:56:11 +00:00
|
|
|
|
2007-03-09 17:32:32 +00:00
|
|
|
static gboolean
|
|
|
|
gst_dvdec_src_negotiate (GstDVDec * dvdec)
|
|
|
|
{
|
|
|
|
GstCaps *othercaps;
|
|
|
|
|
|
|
|
/* no PAR was specified in input, derive from encoded data */
|
|
|
|
if (dvdec->need_par) {
|
|
|
|
if (dvdec->PAL) {
|
|
|
|
if (dvdec->wide) {
|
|
|
|
dvdec->par_x = PAL_WIDE_PAR_X;
|
|
|
|
dvdec->par_y = PAL_WIDE_PAR_Y;
|
|
|
|
} else {
|
|
|
|
dvdec->par_x = PAL_NORMAL_PAR_X;
|
|
|
|
dvdec->par_y = PAL_NORMAL_PAR_Y;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (dvdec->wide) {
|
|
|
|
dvdec->par_x = NTSC_WIDE_PAR_X;
|
|
|
|
dvdec->par_y = NTSC_WIDE_PAR_Y;
|
|
|
|
} else {
|
|
|
|
dvdec->par_x = NTSC_NORMAL_PAR_X;
|
|
|
|
dvdec->par_y = NTSC_NORMAL_PAR_Y;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
GST_DEBUG_OBJECT (dvdec, "Inferred PAR %d/%d from video format",
|
|
|
|
dvdec->par_x, dvdec->par_y);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ignoring rgb, bgr0 for now */
|
2005-08-16 14:04:39 +00:00
|
|
|
dvdec->bpp = 2;
|
ext/dv/gstdvdec.*: Implemented seeking in dvdec.
Original commit message from CVS:
* ext/dv/gstdvdec.c: (gst_dvdec_init), (gst_dvdec_src_convert),
(gst_dvdec_sink_convert), (gst_dvdec_get_src_query_types),
(gst_dvdec_src_query), (gst_dvdec_get_sink_query_types),
(gst_dvdec_sink_query), (gst_dvdec_send_event),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_flush), (gst_dvdec_chain):
* ext/dv/gstdvdec.h:
Implemented seeking in dvdec.
2005-07-19 11:56:11 +00:00
|
|
|
|
2005-08-16 14:04:39 +00:00
|
|
|
othercaps = gst_caps_new_simple ("video/x-raw-yuv",
|
|
|
|
"format", GST_TYPE_FOURCC, GST_STR_FOURCC ("YUY2"),
|
|
|
|
"width", G_TYPE_INT, 720,
|
|
|
|
"height", G_TYPE_INT, dvdec->height,
|
2005-11-22 17:09:36 +00:00
|
|
|
"framerate", GST_TYPE_FRACTION, dvdec->framerate_numerator,
|
2007-03-09 17:32:32 +00:00
|
|
|
dvdec->framerate_denominator,
|
|
|
|
"pixel-aspect-ratio", GST_TYPE_FRACTION, dvdec->par_x,
|
2009-02-26 03:58:29 +00:00
|
|
|
dvdec->par_y, "interlaced", G_TYPE_BOOLEAN, dvdec->interlaced, NULL);
|
ext/dv/gstdvdec.*: Implemented seeking in dvdec.
Original commit message from CVS:
* ext/dv/gstdvdec.c: (gst_dvdec_init), (gst_dvdec_src_convert),
(gst_dvdec_sink_convert), (gst_dvdec_get_src_query_types),
(gst_dvdec_src_query), (gst_dvdec_get_sink_query_types),
(gst_dvdec_sink_query), (gst_dvdec_send_event),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_flush), (gst_dvdec_chain):
* ext/dv/gstdvdec.h:
Implemented seeking in dvdec.
2005-07-19 11:56:11 +00:00
|
|
|
|
2005-08-16 14:04:39 +00:00
|
|
|
gst_pad_set_caps (dvdec->srcpad, othercaps);
|
|
|
|
gst_caps_unref (othercaps);
|
ext/dv/gstdvdec.*: Implemented seeking in dvdec.
Original commit message from CVS:
* ext/dv/gstdvdec.c: (gst_dvdec_init), (gst_dvdec_src_convert),
(gst_dvdec_sink_convert), (gst_dvdec_get_src_query_types),
(gst_dvdec_src_query), (gst_dvdec_get_sink_query_types),
(gst_dvdec_sink_query), (gst_dvdec_send_event),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_flush), (gst_dvdec_chain):
* ext/dv/gstdvdec.h:
Implemented seeking in dvdec.
2005-07-19 11:56:11 +00:00
|
|
|
|
2007-03-09 17:32:32 +00:00
|
|
|
dvdec->src_negotiated = TRUE;
|
ext/dv/gstdvdec.*: Implemented seeking in dvdec.
Original commit message from CVS:
* ext/dv/gstdvdec.c: (gst_dvdec_init), (gst_dvdec_src_convert),
(gst_dvdec_sink_convert), (gst_dvdec_get_src_query_types),
(gst_dvdec_src_query), (gst_dvdec_get_sink_query_types),
(gst_dvdec_sink_query), (gst_dvdec_send_event),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_flush), (gst_dvdec_chain):
* ext/dv/gstdvdec.h:
Implemented seeking in dvdec.
2005-07-19 11:56:11 +00:00
|
|
|
|
2005-08-16 14:04:39 +00:00
|
|
|
return TRUE;
|
2004-02-07 13:04:09 +00:00
|
|
|
}
|
|
|
|
|
2006-06-02 11:33:18 +00:00
|
|
|
static gboolean
|
|
|
|
gst_dvdec_sink_event (GstPad * pad, GstEvent * event)
|
|
|
|
{
|
|
|
|
GstDVDec *dvdec;
|
|
|
|
gboolean res = TRUE;
|
|
|
|
|
|
|
|
dvdec = GST_DVDEC (gst_pad_get_parent (pad));
|
|
|
|
|
|
|
|
switch (GST_EVENT_TYPE (event)) {
|
2006-06-14 15:59:56 +00:00
|
|
|
case GST_EVENT_FLUSH_STOP:
|
|
|
|
gst_segment_init (dvdec->segment, GST_FORMAT_UNDEFINED);
|
|
|
|
break;
|
2006-06-02 11:33:18 +00:00
|
|
|
case GST_EVENT_NEWSEGMENT:{
|
|
|
|
gboolean update;
|
2006-11-01 13:59:49 +00:00
|
|
|
gdouble rate, applied_rate;
|
2006-06-02 11:33:18 +00:00
|
|
|
GstFormat format;
|
|
|
|
gint64 start, stop, position;
|
|
|
|
|
2006-11-01 13:59:49 +00:00
|
|
|
gst_event_parse_new_segment_full (event, &update, &rate, &applied_rate,
|
|
|
|
&format, &start, &stop, &position);
|
2006-06-14 15:59:56 +00:00
|
|
|
|
2006-06-02 11:33:18 +00:00
|
|
|
GST_DEBUG_OBJECT (dvdec, "Got NEWSEGMENT [%" GST_TIME_FORMAT
|
|
|
|
" - %" GST_TIME_FORMAT " / %" GST_TIME_FORMAT "]",
|
|
|
|
GST_TIME_ARGS (start), GST_TIME_ARGS (stop),
|
|
|
|
GST_TIME_ARGS (position));
|
2006-06-14 15:59:56 +00:00
|
|
|
|
2006-11-01 13:59:49 +00:00
|
|
|
gst_segment_set_newsegment_full (dvdec->segment, update, rate,
|
|
|
|
applied_rate, format, start, stop, position);
|
2006-06-02 11:33:18 +00:00
|
|
|
break;
|
2006-06-14 15:59:56 +00:00
|
|
|
}
|
2006-06-02 11:33:18 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
res = gst_pad_push_event (dvdec->srcpad, event);
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
Ported DVdec to 0.9.
Original commit message from CVS:
* configure.ac:
* ext/dv/Makefile.am:
* ext/dv/gstdvdec.c: (gst_dvdec_class_init), (gst_dvdec_init),
(gst_dvdec_get_src_query_types), (gst_dvdec_src_query),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_video_getcaps), (gst_dvdec_video_setcaps),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_chain),
(gst_dvdec_change_state), (gst_dvdec_set_property),
(gst_dvdec_get_property), (plugin_init):
* ext/dv/gstdvdec.h:
* ext/esd/esdsink.c: (gst_esdsink_class_init):
Ported DVdec to 0.9.
Parent of esdsink is GstAudioSink.
2005-07-07 17:03:47 +00:00
|
|
|
static GstFlowReturn
|
2005-08-16 14:04:39 +00:00
|
|
|
gst_dvdec_chain (GstPad * pad, GstBuffer * buf)
|
2004-03-14 20:54:13 +00:00
|
|
|
{
|
2005-08-16 14:04:39 +00:00
|
|
|
GstDVDec *dvdec;
|
|
|
|
guint8 *inframe;
|
Ported DVdec to 0.9.
Original commit message from CVS:
* configure.ac:
* ext/dv/Makefile.am:
* ext/dv/gstdvdec.c: (gst_dvdec_class_init), (gst_dvdec_init),
(gst_dvdec_get_src_query_types), (gst_dvdec_src_query),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_video_getcaps), (gst_dvdec_video_setcaps),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_chain),
(gst_dvdec_change_state), (gst_dvdec_set_property),
(gst_dvdec_get_property), (plugin_init):
* ext/dv/gstdvdec.h:
* ext/esd/esdsink.c: (gst_esdsink_class_init):
Ported DVdec to 0.9.
Parent of esdsink is GstAudioSink.
2005-07-07 17:03:47 +00:00
|
|
|
guint8 *outframe;
|
|
|
|
guint8 *outframe_ptrs[3];
|
|
|
|
gint outframe_pitches[3];
|
|
|
|
GstBuffer *outbuf;
|
ext/dv/gstdvdec.*: Implemented seeking in dvdec.
Original commit message from CVS:
* ext/dv/gstdvdec.c: (gst_dvdec_init), (gst_dvdec_src_convert),
(gst_dvdec_sink_convert), (gst_dvdec_get_src_query_types),
(gst_dvdec_src_query), (gst_dvdec_get_sink_query_types),
(gst_dvdec_sink_query), (gst_dvdec_send_event),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_flush), (gst_dvdec_chain):
* ext/dv/gstdvdec.h:
Implemented seeking in dvdec.
2005-07-19 11:56:11 +00:00
|
|
|
GstFlowReturn ret = GST_FLOW_OK;
|
docs/plugins/: Added dvdec and dvdemux to docs.
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-good-plugins-docs.sgml:
* docs/plugins/gst-plugins-good-plugins-sections.txt:
Added dvdec and dvdemux to docs.
* ext/dv/gstdvdec.c: (gst_dvdec_base_init), (gst_dvdec_chain):
Added docs.
Check frame sizes so we don't crash when don't have enough
data.
Send nice error messages on error.
* ext/dv/gstdvdemux.c: (gst_dvdemux_base_init),
(gst_dvdemux_class_init), (gst_dvdemux_init),
(gst_dvdemux_finalize), (gst_dvdemux_reset),
(gst_dvdemux_src_convert), (gst_dvdemux_sink_convert),
(gst_dvdemux_src_query), (gst_dvdemux_sink_query),
(gst_dvdemux_push_event), (gst_dvdemux_handle_sink_event),
(gst_dvdemux_convert_src_pair), (gst_dvdemux_convert_sink_pair),
(gst_dvdemux_convert_src_to_sink), (gst_dvdemux_handle_push_seek),
(gst_dvdemux_do_seek), (gst_dvdemux_handle_pull_seek),
(gst_dvdemux_handle_src_event), (gst_dvdemux_demux_audio),
(gst_dvdemux_demux_video), (gst_dvdemux_demux_frame),
(gst_dvdemux_flush), (gst_dvdemux_chain), (gst_dvdemux_loop),
(gst_dvdemux_sink_activate_push), (gst_dvdemux_sink_activate_pull),
(gst_dvdemux_sink_activate), (gst_dvdemux_change_state):
* ext/dv/gstdvdemux.h:
Added docs.
Implement pull mode.
Fix memleaks.
Reduce memcpy for the video demuxing.
2006-02-28 10:22:11 +00:00
|
|
|
guint length;
|
2006-06-02 11:33:18 +00:00
|
|
|
gint64 cstart, cstop;
|
2007-03-09 17:32:32 +00:00
|
|
|
gboolean PAL, wide;
|
Ported DVdec to 0.9.
Original commit message from CVS:
* configure.ac:
* ext/dv/Makefile.am:
* ext/dv/gstdvdec.c: (gst_dvdec_class_init), (gst_dvdec_init),
(gst_dvdec_get_src_query_types), (gst_dvdec_src_query),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_video_getcaps), (gst_dvdec_video_setcaps),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_chain),
(gst_dvdec_change_state), (gst_dvdec_set_property),
(gst_dvdec_get_property), (plugin_init):
* ext/dv/gstdvdec.h:
* ext/esd/esdsink.c: (gst_esdsink_class_init):
Ported DVdec to 0.9.
Parent of esdsink is GstAudioSink.
2005-07-07 17:03:47 +00:00
|
|
|
|
2005-08-16 14:04:39 +00:00
|
|
|
dvdec = GST_DVDEC (gst_pad_get_parent (pad));
|
|
|
|
inframe = GST_BUFFER_DATA (buf);
|
2004-03-14 20:54:13 +00:00
|
|
|
|
docs/plugins/: Added dvdec and dvdemux to docs.
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-good-plugins-docs.sgml:
* docs/plugins/gst-plugins-good-plugins-sections.txt:
Added dvdec and dvdemux to docs.
* ext/dv/gstdvdec.c: (gst_dvdec_base_init), (gst_dvdec_chain):
Added docs.
Check frame sizes so we don't crash when don't have enough
data.
Send nice error messages on error.
* ext/dv/gstdvdemux.c: (gst_dvdemux_base_init),
(gst_dvdemux_class_init), (gst_dvdemux_init),
(gst_dvdemux_finalize), (gst_dvdemux_reset),
(gst_dvdemux_src_convert), (gst_dvdemux_sink_convert),
(gst_dvdemux_src_query), (gst_dvdemux_sink_query),
(gst_dvdemux_push_event), (gst_dvdemux_handle_sink_event),
(gst_dvdemux_convert_src_pair), (gst_dvdemux_convert_sink_pair),
(gst_dvdemux_convert_src_to_sink), (gst_dvdemux_handle_push_seek),
(gst_dvdemux_do_seek), (gst_dvdemux_handle_pull_seek),
(gst_dvdemux_handle_src_event), (gst_dvdemux_demux_audio),
(gst_dvdemux_demux_video), (gst_dvdemux_demux_frame),
(gst_dvdemux_flush), (gst_dvdemux_chain), (gst_dvdemux_loop),
(gst_dvdemux_sink_activate_push), (gst_dvdemux_sink_activate_pull),
(gst_dvdemux_sink_activate), (gst_dvdemux_change_state):
* ext/dv/gstdvdemux.h:
Added docs.
Implement pull mode.
Fix memleaks.
Reduce memcpy for the video demuxing.
2006-02-28 10:22:11 +00:00
|
|
|
/* buffer should be at least the size of one NTSC frame, this should
|
|
|
|
* be enough to decode the header. */
|
|
|
|
if (G_UNLIKELY (GST_BUFFER_SIZE (buf) < NTSC_BUFFER))
|
|
|
|
goto wrong_size;
|
|
|
|
|
2006-06-02 11:33:18 +00:00
|
|
|
/* preliminary dropping. unref and return if outside of configured segment */
|
|
|
|
if ((dvdec->segment->format == GST_FORMAT_TIME) &&
|
|
|
|
(!(gst_segment_clip (dvdec->segment, GST_FORMAT_TIME,
|
|
|
|
GST_BUFFER_TIMESTAMP (buf),
|
|
|
|
GST_BUFFER_TIMESTAMP (buf) + GST_BUFFER_DURATION (buf),
|
|
|
|
&cstart, &cstop))))
|
|
|
|
goto dropping;
|
|
|
|
|
docs/plugins/: Added dvdec and dvdemux to docs.
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-good-plugins-docs.sgml:
* docs/plugins/gst-plugins-good-plugins-sections.txt:
Added dvdec and dvdemux to docs.
* ext/dv/gstdvdec.c: (gst_dvdec_base_init), (gst_dvdec_chain):
Added docs.
Check frame sizes so we don't crash when don't have enough
data.
Send nice error messages on error.
* ext/dv/gstdvdemux.c: (gst_dvdemux_base_init),
(gst_dvdemux_class_init), (gst_dvdemux_init),
(gst_dvdemux_finalize), (gst_dvdemux_reset),
(gst_dvdemux_src_convert), (gst_dvdemux_sink_convert),
(gst_dvdemux_src_query), (gst_dvdemux_sink_query),
(gst_dvdemux_push_event), (gst_dvdemux_handle_sink_event),
(gst_dvdemux_convert_src_pair), (gst_dvdemux_convert_sink_pair),
(gst_dvdemux_convert_src_to_sink), (gst_dvdemux_handle_push_seek),
(gst_dvdemux_do_seek), (gst_dvdemux_handle_pull_seek),
(gst_dvdemux_handle_src_event), (gst_dvdemux_demux_audio),
(gst_dvdemux_demux_video), (gst_dvdemux_demux_frame),
(gst_dvdemux_flush), (gst_dvdemux_chain), (gst_dvdemux_loop),
(gst_dvdemux_sink_activate_push), (gst_dvdemux_sink_activate_pull),
(gst_dvdemux_sink_activate), (gst_dvdemux_change_state):
* ext/dv/gstdvdemux.h:
Added docs.
Implement pull mode.
Fix memleaks.
Reduce memcpy for the video demuxing.
2006-02-28 10:22:11 +00:00
|
|
|
if (G_UNLIKELY (dv_parse_header (dvdec->decoder, inframe) < 0))
|
|
|
|
goto parse_header_error;
|
|
|
|
|
2007-03-09 17:32:32 +00:00
|
|
|
/* get size */
|
|
|
|
PAL = dv_system_50_fields (dvdec->decoder);
|
|
|
|
wide = dv_format_wide (dvdec->decoder);
|
|
|
|
|
docs/plugins/: Added dvdec and dvdemux to docs.
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-good-plugins-docs.sgml:
* docs/plugins/gst-plugins-good-plugins-sections.txt:
Added dvdec and dvdemux to docs.
* ext/dv/gstdvdec.c: (gst_dvdec_base_init), (gst_dvdec_chain):
Added docs.
Check frame sizes so we don't crash when don't have enough
data.
Send nice error messages on error.
* ext/dv/gstdvdemux.c: (gst_dvdemux_base_init),
(gst_dvdemux_class_init), (gst_dvdemux_init),
(gst_dvdemux_finalize), (gst_dvdemux_reset),
(gst_dvdemux_src_convert), (gst_dvdemux_sink_convert),
(gst_dvdemux_src_query), (gst_dvdemux_sink_query),
(gst_dvdemux_push_event), (gst_dvdemux_handle_sink_event),
(gst_dvdemux_convert_src_pair), (gst_dvdemux_convert_sink_pair),
(gst_dvdemux_convert_src_to_sink), (gst_dvdemux_handle_push_seek),
(gst_dvdemux_do_seek), (gst_dvdemux_handle_pull_seek),
(gst_dvdemux_handle_src_event), (gst_dvdemux_demux_audio),
(gst_dvdemux_demux_video), (gst_dvdemux_demux_frame),
(gst_dvdemux_flush), (gst_dvdemux_chain), (gst_dvdemux_loop),
(gst_dvdemux_sink_activate_push), (gst_dvdemux_sink_activate_pull),
(gst_dvdemux_sink_activate), (gst_dvdemux_change_state):
* ext/dv/gstdvdemux.h:
Added docs.
Implement pull mode.
Fix memleaks.
Reduce memcpy for the video demuxing.
2006-02-28 10:22:11 +00:00
|
|
|
/* check the buffer is of right size after we know if we are
|
|
|
|
* dealing with PAL or NTSC */
|
2007-03-09 17:32:32 +00:00
|
|
|
length = (PAL ? PAL_BUFFER : NTSC_BUFFER);
|
docs/plugins/: Added dvdec and dvdemux to docs.
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-good-plugins-docs.sgml:
* docs/plugins/gst-plugins-good-plugins-sections.txt:
Added dvdec and dvdemux to docs.
* ext/dv/gstdvdec.c: (gst_dvdec_base_init), (gst_dvdec_chain):
Added docs.
Check frame sizes so we don't crash when don't have enough
data.
Send nice error messages on error.
* ext/dv/gstdvdemux.c: (gst_dvdemux_base_init),
(gst_dvdemux_class_init), (gst_dvdemux_init),
(gst_dvdemux_finalize), (gst_dvdemux_reset),
(gst_dvdemux_src_convert), (gst_dvdemux_sink_convert),
(gst_dvdemux_src_query), (gst_dvdemux_sink_query),
(gst_dvdemux_push_event), (gst_dvdemux_handle_sink_event),
(gst_dvdemux_convert_src_pair), (gst_dvdemux_convert_sink_pair),
(gst_dvdemux_convert_src_to_sink), (gst_dvdemux_handle_push_seek),
(gst_dvdemux_do_seek), (gst_dvdemux_handle_pull_seek),
(gst_dvdemux_handle_src_event), (gst_dvdemux_demux_audio),
(gst_dvdemux_demux_video), (gst_dvdemux_demux_frame),
(gst_dvdemux_flush), (gst_dvdemux_chain), (gst_dvdemux_loop),
(gst_dvdemux_sink_activate_push), (gst_dvdemux_sink_activate_pull),
(gst_dvdemux_sink_activate), (gst_dvdemux_change_state):
* ext/dv/gstdvdemux.h:
Added docs.
Implement pull mode.
Fix memleaks.
Reduce memcpy for the video demuxing.
2006-02-28 10:22:11 +00:00
|
|
|
if (G_UNLIKELY (GST_BUFFER_SIZE (buf) < length))
|
|
|
|
goto wrong_size;
|
|
|
|
|
2005-08-16 14:04:39 +00:00
|
|
|
dv_parse_packs (dvdec->decoder, inframe);
|
2004-03-14 20:54:13 +00:00
|
|
|
|
2005-08-16 14:04:39 +00:00
|
|
|
if (dvdec->video_offset % dvdec->drop_factor != 0)
|
Ported DVdec to 0.9.
Original commit message from CVS:
* configure.ac:
* ext/dv/Makefile.am:
* ext/dv/gstdvdec.c: (gst_dvdec_class_init), (gst_dvdec_init),
(gst_dvdec_get_src_query_types), (gst_dvdec_src_query),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_video_getcaps), (gst_dvdec_video_setcaps),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_chain),
(gst_dvdec_change_state), (gst_dvdec_set_property),
(gst_dvdec_get_property), (plugin_init):
* ext/dv/gstdvdec.h:
* ext/esd/esdsink.c: (gst_esdsink_class_init):
Ported DVdec to 0.9.
Parent of esdsink is GstAudioSink.
2005-07-07 17:03:47 +00:00
|
|
|
goto skip;
|
|
|
|
|
2007-03-09 17:32:32 +00:00
|
|
|
/* renegotiate on change */
|
|
|
|
if (PAL != dvdec->PAL || wide != dvdec->wide) {
|
|
|
|
dvdec->src_negotiated = FALSE;
|
|
|
|
dvdec->PAL = PAL;
|
|
|
|
dvdec->wide = wide;
|
|
|
|
}
|
|
|
|
|
|
|
|
dvdec->height = (dvdec->PAL ? PAL_HEIGHT : NTSC_HEIGHT);
|
|
|
|
|
2009-02-26 03:58:29 +00:00
|
|
|
dvdec->interlaced = !dv_is_progressive (dvdec->decoder);
|
2007-03-09 17:32:32 +00:00
|
|
|
|
|
|
|
/* negotiate if not done yet */
|
|
|
|
if (!dvdec->src_negotiated) {
|
|
|
|
if (!gst_dvdec_src_negotiate (dvdec))
|
|
|
|
goto not_negotiated;
|
|
|
|
}
|
|
|
|
|
2005-07-19 15:29:08 +00:00
|
|
|
ret =
|
2005-12-05 13:03:00 +00:00
|
|
|
gst_pad_alloc_buffer_and_set_caps (dvdec->srcpad, 0,
|
2005-08-16 14:04:39 +00:00
|
|
|
(720 * dvdec->height) * dvdec->bpp,
|
|
|
|
GST_PAD_CAPS (dvdec->srcpad), &outbuf);
|
docs/plugins/: Added dvdec and dvdemux to docs.
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-good-plugins-docs.sgml:
* docs/plugins/gst-plugins-good-plugins-sections.txt:
Added dvdec and dvdemux to docs.
* ext/dv/gstdvdec.c: (gst_dvdec_base_init), (gst_dvdec_chain):
Added docs.
Check frame sizes so we don't crash when don't have enough
data.
Send nice error messages on error.
* ext/dv/gstdvdemux.c: (gst_dvdemux_base_init),
(gst_dvdemux_class_init), (gst_dvdemux_init),
(gst_dvdemux_finalize), (gst_dvdemux_reset),
(gst_dvdemux_src_convert), (gst_dvdemux_sink_convert),
(gst_dvdemux_src_query), (gst_dvdemux_sink_query),
(gst_dvdemux_push_event), (gst_dvdemux_handle_sink_event),
(gst_dvdemux_convert_src_pair), (gst_dvdemux_convert_sink_pair),
(gst_dvdemux_convert_src_to_sink), (gst_dvdemux_handle_push_seek),
(gst_dvdemux_do_seek), (gst_dvdemux_handle_pull_seek),
(gst_dvdemux_handle_src_event), (gst_dvdemux_demux_audio),
(gst_dvdemux_demux_video), (gst_dvdemux_demux_frame),
(gst_dvdemux_flush), (gst_dvdemux_chain), (gst_dvdemux_loop),
(gst_dvdemux_sink_activate_push), (gst_dvdemux_sink_activate_pull),
(gst_dvdemux_sink_activate), (gst_dvdemux_change_state):
* ext/dv/gstdvdemux.h:
Added docs.
Implement pull mode.
Fix memleaks.
Reduce memcpy for the video demuxing.
2006-02-28 10:22:11 +00:00
|
|
|
if (G_UNLIKELY (ret != GST_FLOW_OK))
|
Ported DVdec to 0.9.
Original commit message from CVS:
* configure.ac:
* ext/dv/Makefile.am:
* ext/dv/gstdvdec.c: (gst_dvdec_class_init), (gst_dvdec_init),
(gst_dvdec_get_src_query_types), (gst_dvdec_src_query),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_video_getcaps), (gst_dvdec_video_setcaps),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_chain),
(gst_dvdec_change_state), (gst_dvdec_set_property),
(gst_dvdec_get_property), (plugin_init):
* ext/dv/gstdvdec.h:
* ext/esd/esdsink.c: (gst_esdsink_class_init):
Ported DVdec to 0.9.
Parent of esdsink is GstAudioSink.
2005-07-07 17:03:47 +00:00
|
|
|
goto no_buffer;
|
|
|
|
|
|
|
|
outframe = GST_BUFFER_DATA (outbuf);
|
|
|
|
|
|
|
|
outframe_ptrs[0] = outframe;
|
|
|
|
outframe_pitches[0] = 720 * dvdec->bpp;
|
|
|
|
|
|
|
|
/* the rest only matters for YUY2 */
|
|
|
|
if (dvdec->bpp < 3) {
|
2005-08-16 14:04:39 +00:00
|
|
|
outframe_ptrs[1] = outframe_ptrs[0] + 720 * dvdec->height;
|
|
|
|
outframe_ptrs[2] = outframe_ptrs[1] + 360 * dvdec->height;
|
2001-12-23 16:42:33 +00:00
|
|
|
|
2005-08-16 14:04:39 +00:00
|
|
|
outframe_pitches[1] = dvdec->height / 2;
|
Ported DVdec to 0.9.
Original commit message from CVS:
* configure.ac:
* ext/dv/Makefile.am:
* ext/dv/gstdvdec.c: (gst_dvdec_class_init), (gst_dvdec_init),
(gst_dvdec_get_src_query_types), (gst_dvdec_src_query),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_video_getcaps), (gst_dvdec_video_setcaps),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_chain),
(gst_dvdec_change_state), (gst_dvdec_set_property),
(gst_dvdec_get_property), (plugin_init):
* ext/dv/gstdvdec.h:
* ext/esd/esdsink.c: (gst_esdsink_class_init):
Ported DVdec to 0.9.
Parent of esdsink is GstAudioSink.
2005-07-07 17:03:47 +00:00
|
|
|
outframe_pitches[2] = outframe_pitches[1];
|
2002-06-13 22:30:15 +00:00
|
|
|
}
|
|
|
|
|
2005-11-30 19:02:35 +00:00
|
|
|
GST_DEBUG_OBJECT (dvdec, "decoding and pushing buffer");
|
2005-08-16 14:04:39 +00:00
|
|
|
dv_decode_full_frame (dvdec->decoder, inframe,
|
|
|
|
e_dv_color_yuv, outframe_ptrs, outframe_pitches);
|
Ported DVdec to 0.9.
Original commit message from CVS:
* configure.ac:
* ext/dv/Makefile.am:
* ext/dv/gstdvdec.c: (gst_dvdec_class_init), (gst_dvdec_init),
(gst_dvdec_get_src_query_types), (gst_dvdec_src_query),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_video_getcaps), (gst_dvdec_video_setcaps),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_chain),
(gst_dvdec_change_state), (gst_dvdec_set_property),
(gst_dvdec_get_property), (plugin_init):
* ext/dv/gstdvdec.h:
* ext/esd/esdsink.c: (gst_esdsink_class_init):
Ported DVdec to 0.9.
Parent of esdsink is GstAudioSink.
2005-07-07 17:03:47 +00:00
|
|
|
|
2009-08-14 12:34:53 +00:00
|
|
|
GST_BUFFER_FLAG_UNSET (outbuf, GST_VIDEO_BUFFER_TFF);
|
2009-02-26 03:58:29 +00:00
|
|
|
|
2006-06-02 11:33:18 +00:00
|
|
|
GST_BUFFER_OFFSET (outbuf) = GST_BUFFER_OFFSET (buf);
|
|
|
|
GST_BUFFER_OFFSET_END (outbuf) = GST_BUFFER_OFFSET_END (buf);
|
|
|
|
GST_BUFFER_TIMESTAMP (outbuf) = cstart;
|
|
|
|
GST_BUFFER_DURATION (outbuf) = cstop - cstart;
|
ext/dv/gstdvdec.*: Implemented seeking in dvdec.
Original commit message from CVS:
* ext/dv/gstdvdec.c: (gst_dvdec_init), (gst_dvdec_src_convert),
(gst_dvdec_sink_convert), (gst_dvdec_get_src_query_types),
(gst_dvdec_src_query), (gst_dvdec_get_sink_query_types),
(gst_dvdec_sink_query), (gst_dvdec_send_event),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_flush), (gst_dvdec_chain):
* ext/dv/gstdvdec.h:
Implemented seeking in dvdec.
2005-07-19 11:56:11 +00:00
|
|
|
|
2005-08-16 14:04:39 +00:00
|
|
|
ret = gst_pad_push (dvdec->srcpad, outbuf);
|
Ported DVdec to 0.9.
Original commit message from CVS:
* configure.ac:
* ext/dv/Makefile.am:
* ext/dv/gstdvdec.c: (gst_dvdec_class_init), (gst_dvdec_init),
(gst_dvdec_get_src_query_types), (gst_dvdec_src_query),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_video_getcaps), (gst_dvdec_video_setcaps),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_chain),
(gst_dvdec_change_state), (gst_dvdec_set_property),
(gst_dvdec_get_property), (plugin_init):
* ext/dv/gstdvdec.h:
* ext/esd/esdsink.c: (gst_esdsink_class_init):
Ported DVdec to 0.9.
Parent of esdsink is GstAudioSink.
2005-07-07 17:03:47 +00:00
|
|
|
|
|
|
|
skip:
|
|
|
|
dvdec->video_offset++;
|
docs/plugins/: Added dvdec and dvdemux to docs.
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-good-plugins-docs.sgml:
* docs/plugins/gst-plugins-good-plugins-sections.txt:
Added dvdec and dvdemux to docs.
* ext/dv/gstdvdec.c: (gst_dvdec_base_init), (gst_dvdec_chain):
Added docs.
Check frame sizes so we don't crash when don't have enough
data.
Send nice error messages on error.
* ext/dv/gstdvdemux.c: (gst_dvdemux_base_init),
(gst_dvdemux_class_init), (gst_dvdemux_init),
(gst_dvdemux_finalize), (gst_dvdemux_reset),
(gst_dvdemux_src_convert), (gst_dvdemux_sink_convert),
(gst_dvdemux_src_query), (gst_dvdemux_sink_query),
(gst_dvdemux_push_event), (gst_dvdemux_handle_sink_event),
(gst_dvdemux_convert_src_pair), (gst_dvdemux_convert_sink_pair),
(gst_dvdemux_convert_src_to_sink), (gst_dvdemux_handle_push_seek),
(gst_dvdemux_do_seek), (gst_dvdemux_handle_pull_seek),
(gst_dvdemux_handle_src_event), (gst_dvdemux_demux_audio),
(gst_dvdemux_demux_video), (gst_dvdemux_demux_frame),
(gst_dvdemux_flush), (gst_dvdemux_chain), (gst_dvdemux_loop),
(gst_dvdemux_sink_activate_push), (gst_dvdemux_sink_activate_pull),
(gst_dvdemux_sink_activate), (gst_dvdemux_change_state):
* ext/dv/gstdvdemux.h:
Added docs.
Implement pull mode.
Fix memleaks.
Reduce memcpy for the video demuxing.
2006-02-28 10:22:11 +00:00
|
|
|
|
|
|
|
done:
|
|
|
|
gst_buffer_unref (buf);
|
2005-08-16 14:04:39 +00:00
|
|
|
gst_object_unref (dvdec);
|
Ported DVdec to 0.9.
Original commit message from CVS:
* configure.ac:
* ext/dv/Makefile.am:
* ext/dv/gstdvdec.c: (gst_dvdec_class_init), (gst_dvdec_init),
(gst_dvdec_get_src_query_types), (gst_dvdec_src_query),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_video_getcaps), (gst_dvdec_video_setcaps),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_chain),
(gst_dvdec_change_state), (gst_dvdec_set_property),
(gst_dvdec_get_property), (plugin_init):
* ext/dv/gstdvdec.h:
* ext/esd/esdsink.c: (gst_esdsink_class_init):
Ported DVdec to 0.9.
Parent of esdsink is GstAudioSink.
2005-07-07 17:03:47 +00:00
|
|
|
|
ext/dv/gstdvdec.*: Implemented seeking in dvdec.
Original commit message from CVS:
* ext/dv/gstdvdec.c: (gst_dvdec_init), (gst_dvdec_src_convert),
(gst_dvdec_sink_convert), (gst_dvdec_get_src_query_types),
(gst_dvdec_src_query), (gst_dvdec_get_sink_query_types),
(gst_dvdec_sink_query), (gst_dvdec_send_event),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_flush), (gst_dvdec_chain):
* ext/dv/gstdvdec.h:
Implemented seeking in dvdec.
2005-07-19 11:56:11 +00:00
|
|
|
return ret;
|
Ported DVdec to 0.9.
Original commit message from CVS:
* configure.ac:
* ext/dv/Makefile.am:
* ext/dv/gstdvdec.c: (gst_dvdec_class_init), (gst_dvdec_init),
(gst_dvdec_get_src_query_types), (gst_dvdec_src_query),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_video_getcaps), (gst_dvdec_video_setcaps),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_chain),
(gst_dvdec_change_state), (gst_dvdec_set_property),
(gst_dvdec_get_property), (plugin_init):
* ext/dv/gstdvdec.h:
* ext/esd/esdsink.c: (gst_esdsink_class_init):
Ported DVdec to 0.9.
Parent of esdsink is GstAudioSink.
2005-07-07 17:03:47 +00:00
|
|
|
|
|
|
|
/* ERRORS */
|
docs/plugins/: Added dvdec and dvdemux to docs.
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-good-plugins-docs.sgml:
* docs/plugins/gst-plugins-good-plugins-sections.txt:
Added dvdec and dvdemux to docs.
* ext/dv/gstdvdec.c: (gst_dvdec_base_init), (gst_dvdec_chain):
Added docs.
Check frame sizes so we don't crash when don't have enough
data.
Send nice error messages on error.
* ext/dv/gstdvdemux.c: (gst_dvdemux_base_init),
(gst_dvdemux_class_init), (gst_dvdemux_init),
(gst_dvdemux_finalize), (gst_dvdemux_reset),
(gst_dvdemux_src_convert), (gst_dvdemux_sink_convert),
(gst_dvdemux_src_query), (gst_dvdemux_sink_query),
(gst_dvdemux_push_event), (gst_dvdemux_handle_sink_event),
(gst_dvdemux_convert_src_pair), (gst_dvdemux_convert_sink_pair),
(gst_dvdemux_convert_src_to_sink), (gst_dvdemux_handle_push_seek),
(gst_dvdemux_do_seek), (gst_dvdemux_handle_pull_seek),
(gst_dvdemux_handle_src_event), (gst_dvdemux_demux_audio),
(gst_dvdemux_demux_video), (gst_dvdemux_demux_frame),
(gst_dvdemux_flush), (gst_dvdemux_chain), (gst_dvdemux_loop),
(gst_dvdemux_sink_activate_push), (gst_dvdemux_sink_activate_pull),
(gst_dvdemux_sink_activate), (gst_dvdemux_change_state):
* ext/dv/gstdvdemux.h:
Added docs.
Implement pull mode.
Fix memleaks.
Reduce memcpy for the video demuxing.
2006-02-28 10:22:11 +00:00
|
|
|
wrong_size:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (dvdec, STREAM, DECODE,
|
|
|
|
(NULL), ("Input buffer too small"));
|
|
|
|
ret = GST_FLOW_ERROR;
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
parse_header_error:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (dvdec, STREAM, DECODE,
|
|
|
|
(NULL), ("Error parsing DV header"));
|
|
|
|
ret = GST_FLOW_ERROR;
|
|
|
|
goto done;
|
|
|
|
}
|
2007-03-09 17:32:32 +00:00
|
|
|
not_negotiated:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (dvdec, "could not negotiate output");
|
|
|
|
ret = GST_FLOW_NOT_NEGOTIATED;
|
|
|
|
goto done;
|
|
|
|
}
|
Ported DVdec to 0.9.
Original commit message from CVS:
* configure.ac:
* ext/dv/Makefile.am:
* ext/dv/gstdvdec.c: (gst_dvdec_class_init), (gst_dvdec_init),
(gst_dvdec_get_src_query_types), (gst_dvdec_src_query),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_video_getcaps), (gst_dvdec_video_setcaps),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_chain),
(gst_dvdec_change_state), (gst_dvdec_set_property),
(gst_dvdec_get_property), (plugin_init):
* ext/dv/gstdvdec.h:
* ext/esd/esdsink.c: (gst_esdsink_class_init):
Ported DVdec to 0.9.
Parent of esdsink is GstAudioSink.
2005-07-07 17:03:47 +00:00
|
|
|
no_buffer:
|
|
|
|
{
|
2005-11-30 19:02:35 +00:00
|
|
|
GST_DEBUG_OBJECT (dvdec, "could not allocate buffer");
|
docs/plugins/: Added dvdec and dvdemux to docs.
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-good-plugins-docs.sgml:
* docs/plugins/gst-plugins-good-plugins-sections.txt:
Added dvdec and dvdemux to docs.
* ext/dv/gstdvdec.c: (gst_dvdec_base_init), (gst_dvdec_chain):
Added docs.
Check frame sizes so we don't crash when don't have enough
data.
Send nice error messages on error.
* ext/dv/gstdvdemux.c: (gst_dvdemux_base_init),
(gst_dvdemux_class_init), (gst_dvdemux_init),
(gst_dvdemux_finalize), (gst_dvdemux_reset),
(gst_dvdemux_src_convert), (gst_dvdemux_sink_convert),
(gst_dvdemux_src_query), (gst_dvdemux_sink_query),
(gst_dvdemux_push_event), (gst_dvdemux_handle_sink_event),
(gst_dvdemux_convert_src_pair), (gst_dvdemux_convert_sink_pair),
(gst_dvdemux_convert_src_to_sink), (gst_dvdemux_handle_push_seek),
(gst_dvdemux_do_seek), (gst_dvdemux_handle_pull_seek),
(gst_dvdemux_handle_src_event), (gst_dvdemux_demux_audio),
(gst_dvdemux_demux_video), (gst_dvdemux_demux_frame),
(gst_dvdemux_flush), (gst_dvdemux_chain), (gst_dvdemux_loop),
(gst_dvdemux_sink_activate_push), (gst_dvdemux_sink_activate_pull),
(gst_dvdemux_sink_activate), (gst_dvdemux_change_state):
* ext/dv/gstdvdemux.h:
Added docs.
Implement pull mode.
Fix memleaks.
Reduce memcpy for the video demuxing.
2006-02-28 10:22:11 +00:00
|
|
|
goto done;
|
ext/dv/gstdvdec.*: Implemented seeking in dvdec.
Original commit message from CVS:
* ext/dv/gstdvdec.c: (gst_dvdec_init), (gst_dvdec_src_convert),
(gst_dvdec_sink_convert), (gst_dvdec_get_src_query_types),
(gst_dvdec_src_query), (gst_dvdec_get_sink_query_types),
(gst_dvdec_sink_query), (gst_dvdec_send_event),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_flush), (gst_dvdec_chain):
* ext/dv/gstdvdec.h:
Implemented seeking in dvdec.
2005-07-19 11:56:11 +00:00
|
|
|
}
|
2006-06-02 11:33:18 +00:00
|
|
|
|
|
|
|
dropping:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (dvdec,
|
|
|
|
"dropping buffer since it's out of the configured segment");
|
|
|
|
goto done;
|
|
|
|
}
|
ext/dv/gstdvdec.*: Implemented seeking in dvdec.
Original commit message from CVS:
* ext/dv/gstdvdec.c: (gst_dvdec_init), (gst_dvdec_src_convert),
(gst_dvdec_sink_convert), (gst_dvdec_get_src_query_types),
(gst_dvdec_src_query), (gst_dvdec_get_sink_query_types),
(gst_dvdec_sink_query), (gst_dvdec_send_event),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_flush), (gst_dvdec_chain):
* ext/dv/gstdvdec.h:
Implemented seeking in dvdec.
2005-07-19 11:56:11 +00:00
|
|
|
}
|
|
|
|
|
2005-09-02 15:44:50 +00:00
|
|
|
static GstStateChangeReturn
|
|
|
|
gst_dvdec_change_state (GstElement * element, GstStateChange transition)
|
2002-01-26 02:48:47 +00:00
|
|
|
{
|
|
|
|
GstDVDec *dvdec = GST_DVDEC (element);
|
2005-09-02 15:44:50 +00:00
|
|
|
GstStateChangeReturn ret;
|
Ported DVdec to 0.9.
Original commit message from CVS:
* configure.ac:
* ext/dv/Makefile.am:
* ext/dv/gstdvdec.c: (gst_dvdec_class_init), (gst_dvdec_init),
(gst_dvdec_get_src_query_types), (gst_dvdec_src_query),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_video_getcaps), (gst_dvdec_video_setcaps),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_chain),
(gst_dvdec_change_state), (gst_dvdec_set_property),
(gst_dvdec_get_property), (plugin_init):
* ext/dv/gstdvdec.h:
* ext/esd/esdsink.c: (gst_esdsink_class_init):
Ported DVdec to 0.9.
Parent of esdsink is GstAudioSink.
2005-07-07 17:03:47 +00:00
|
|
|
|
2004-03-14 20:54:13 +00:00
|
|
|
|
Ported DVdec to 0.9.
Original commit message from CVS:
* configure.ac:
* ext/dv/Makefile.am:
* ext/dv/gstdvdec.c: (gst_dvdec_class_init), (gst_dvdec_init),
(gst_dvdec_get_src_query_types), (gst_dvdec_src_query),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_video_getcaps), (gst_dvdec_video_setcaps),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_chain),
(gst_dvdec_change_state), (gst_dvdec_set_property),
(gst_dvdec_get_property), (plugin_init):
* ext/dv/gstdvdec.h:
* ext/esd/esdsink.c: (gst_esdsink_class_init):
Ported DVdec to 0.9.
Parent of esdsink is GstAudioSink.
2005-07-07 17:03:47 +00:00
|
|
|
switch (transition) {
|
2005-09-02 15:44:50 +00:00
|
|
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
2002-01-26 02:48:47 +00:00
|
|
|
break;
|
2005-09-02 15:44:50 +00:00
|
|
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
2004-03-14 20:54:13 +00:00
|
|
|
dvdec->decoder =
|
2004-03-15 19:32:27 +00:00
|
|
|
dv_decoder_new (0, dvdec->clamp_luma, dvdec->clamp_chroma);
|
2004-05-12 14:53:57 +00:00
|
|
|
dvdec->decoder->quality = qualities[dvdec->quality];
|
2006-01-27 12:17:56 +00:00
|
|
|
dv_set_error_log (dvdec->decoder, NULL);
|
2006-06-02 11:33:18 +00:00
|
|
|
gst_segment_init (dvdec->segment, GST_FORMAT_UNDEFINED);
|
2007-03-09 17:32:32 +00:00
|
|
|
dvdec->src_negotiated = FALSE;
|
|
|
|
dvdec->sink_negotiated = FALSE;
|
2004-04-01 11:48:27 +00:00
|
|
|
/*
|
|
|
|
* Enable this function call when libdv2 0.100 or higher is more
|
|
|
|
* common
|
|
|
|
*/
|
2004-05-12 14:53:57 +00:00
|
|
|
/* dv_set_quality (dvdec->decoder, qualities [dvdec->quality]); */
|
2002-01-26 02:48:47 +00:00
|
|
|
break;
|
2005-09-02 15:44:50 +00:00
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
2002-01-26 02:48:47 +00:00
|
|
|
break;
|
Ported DVdec to 0.9.
Original commit message from CVS:
* configure.ac:
* ext/dv/Makefile.am:
* ext/dv/gstdvdec.c: (gst_dvdec_class_init), (gst_dvdec_init),
(gst_dvdec_get_src_query_types), (gst_dvdec_src_query),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_video_getcaps), (gst_dvdec_video_setcaps),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_chain),
(gst_dvdec_change_state), (gst_dvdec_set_property),
(gst_dvdec_get_property), (plugin_init):
* ext/dv/gstdvdec.h:
* ext/esd/esdsink.c: (gst_esdsink_class_init):
Ported DVdec to 0.9.
Parent of esdsink is GstAudioSink.
2005-07-07 17:03:47 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-09-02 15:44:50 +00:00
|
|
|
ret = parent_class->change_state (element, transition);
|
Ported DVdec to 0.9.
Original commit message from CVS:
* configure.ac:
* ext/dv/Makefile.am:
* ext/dv/gstdvdec.c: (gst_dvdec_class_init), (gst_dvdec_init),
(gst_dvdec_get_src_query_types), (gst_dvdec_src_query),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_video_getcaps), (gst_dvdec_video_setcaps),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_chain),
(gst_dvdec_change_state), (gst_dvdec_set_property),
(gst_dvdec_get_property), (plugin_init):
* ext/dv/gstdvdec.h:
* ext/esd/esdsink.c: (gst_esdsink_class_init):
Ported DVdec to 0.9.
Parent of esdsink is GstAudioSink.
2005-07-07 17:03:47 +00:00
|
|
|
|
|
|
|
switch (transition) {
|
2005-09-02 15:44:50 +00:00
|
|
|
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
2002-01-26 02:48:47 +00:00
|
|
|
break;
|
2005-09-02 15:44:50 +00:00
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
2002-09-09 22:20:34 +00:00
|
|
|
dv_decoder_free (dvdec->decoder);
|
|
|
|
dvdec->decoder = NULL;
|
2002-01-26 02:48:47 +00:00
|
|
|
break;
|
2005-09-02 15:44:50 +00:00
|
|
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
2002-01-26 02:48:47 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
Ported DVdec to 0.9.
Original commit message from CVS:
* configure.ac:
* ext/dv/Makefile.am:
* ext/dv/gstdvdec.c: (gst_dvdec_class_init), (gst_dvdec_init),
(gst_dvdec_get_src_query_types), (gst_dvdec_src_query),
(gst_dvdec_handle_sink_event), (gst_dvdec_handle_src_event),
(gst_dvdec_video_getcaps), (gst_dvdec_video_setcaps),
(gst_dvdec_decode_audio), (gst_dvdec_decode_video),
(gst_dvdec_decode_frame), (gst_dvdec_chain),
(gst_dvdec_change_state), (gst_dvdec_set_property),
(gst_dvdec_get_property), (plugin_init):
* ext/dv/gstdvdec.h:
* ext/esd/esdsink.c: (gst_esdsink_class_init):
Ported DVdec to 0.9.
Parent of esdsink is GstAudioSink.
2005-07-07 17:03:47 +00:00
|
|
|
return ret;
|
2001-12-23 16:42:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 20:54:13 +00:00
|
|
|
gst_dvdec_set_property (GObject * object, guint prop_id, const GValue * value,
|
|
|
|
GParamSpec * pspec)
|
2001-12-23 16:42:33 +00:00
|
|
|
{
|
2005-08-16 14:04:39 +00:00
|
|
|
GstDVDec *dvdec = GST_DVDEC (object);
|
2001-12-23 16:42:33 +00:00
|
|
|
|
|
|
|
switch (prop_id) {
|
2005-08-16 14:04:39 +00:00
|
|
|
case PROP_CLAMP_LUMA:
|
2002-09-09 22:20:34 +00:00
|
|
|
dvdec->clamp_luma = g_value_get_boolean (value);
|
|
|
|
break;
|
2005-08-16 14:04:39 +00:00
|
|
|
case PROP_CLAMP_CHROMA:
|
2002-09-09 22:20:34 +00:00
|
|
|
dvdec->clamp_chroma = g_value_get_boolean (value);
|
|
|
|
break;
|
2005-08-16 14:04:39 +00:00
|
|
|
case PROP_QUALITY:
|
2004-05-12 14:53:57 +00:00
|
|
|
dvdec->quality = g_value_get_enum (value);
|
|
|
|
if ((dvdec->quality < 0) || (dvdec->quality > 5))
|
|
|
|
dvdec->quality = 0;
|
2002-09-09 22:20:34 +00:00
|
|
|
break;
|
2005-08-16 14:04:39 +00:00
|
|
|
case PROP_DECODE_NTH:
|
2004-06-27 16:38:41 +00:00
|
|
|
dvdec->drop_factor = g_value_get_int (value);
|
|
|
|
break;
|
2001-12-23 16:42:33 +00:00
|
|
|
default:
|
2002-09-12 20:55:10 +00:00
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
2001-12-23 16:42:33 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 20:54:13 +00:00
|
|
|
gst_dvdec_get_property (GObject * object, guint prop_id, GValue * value,
|
|
|
|
GParamSpec * pspec)
|
2001-12-23 16:42:33 +00:00
|
|
|
{
|
2005-08-16 14:04:39 +00:00
|
|
|
GstDVDec *dvdec = GST_DVDEC (object);
|
2001-12-23 16:42:33 +00:00
|
|
|
|
|
|
|
switch (prop_id) {
|
2005-08-16 14:04:39 +00:00
|
|
|
case PROP_CLAMP_LUMA:
|
2002-09-09 22:20:34 +00:00
|
|
|
g_value_set_boolean (value, dvdec->clamp_luma);
|
|
|
|
break;
|
2005-08-16 14:04:39 +00:00
|
|
|
case PROP_CLAMP_CHROMA:
|
2002-09-09 22:20:34 +00:00
|
|
|
g_value_set_boolean (value, dvdec->clamp_chroma);
|
|
|
|
break;
|
2005-08-16 14:04:39 +00:00
|
|
|
case PROP_QUALITY:
|
2004-05-12 14:53:57 +00:00
|
|
|
g_value_set_enum (value, dvdec->quality);
|
2002-09-09 22:20:34 +00:00
|
|
|
break;
|
2005-08-16 14:04:39 +00:00
|
|
|
case PROP_DECODE_NTH:
|
2004-06-27 16:38:41 +00:00
|
|
|
g_value_set_int (value, dvdec->drop_factor);
|
|
|
|
break;
|
2001-12-23 16:42:33 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|