make the GStreamer decoder handle H264
[swfdec.git] / swfdec / swfdec_codec_gst.h
blob31e831954f0a7fa63c6c521347f4d7031277bf45
1 /* Swfdec
2 * Copyright (C) 2003-2006 David Schleef <ds@schleef.org>
3 * 2005-2006 Eric Anholt <eric@anholt.net>
4 * 2006-2007 Benjamin Otte <otte@gnome.org>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301 USA
22 #ifndef __SWFDEC_CODEC_GST_H__
23 #define __SWFDEC_CODEC_GST_H__
25 #include <gst/gst.h>
26 #include <swfdec/swfdec.h>
28 G_BEGIN_DECLS
30 typedef struct {
31 GstElement * bin;
32 GstPad * src;
33 GstPad * sink;
34 GQueue * queue; /* all the stored output GstBuffers */
35 } SwfdecGstDecoder;
37 gboolean swfdec_gst_decoder_init (SwfdecGstDecoder * dec,
38 GstCaps * srccaps,
39 GstCaps * sinkcaps,
40 ...) G_GNUC_NULL_TERMINATED;
41 void swfdec_gst_decoder_set_codec_data
42 (SwfdecGstDecoder * dec,
43 GstBuffer * buffer);
44 void swfdec_gst_decoder_push_eos (SwfdecGstDecoder * dec);
45 GstBuffer * swfdec_gst_decoder_pull (SwfdecGstDecoder * dec);
46 gboolean swfdec_gst_decoder_push (SwfdecGstDecoder * dec,
47 GstBuffer * buffer);
48 void swfdec_gst_decoder_finish (SwfdecGstDecoder * dec);
51 /* NB: references argument more than once */
52 #define swfdec_buffer_new_from_gst(buffer) \
53 swfdec_buffer_new_full (GST_BUFFER_DATA (buffer), GST_BUFFER_SIZE (buffer), \
54 (SwfdecBufferFreeFunc) gst_mini_object_unref, (buffer))
55 GstBuffer * swfdec_gst_buffer_new (SwfdecBuffer * buffer);
58 GstElementFactory *
59 swfdec_gst_get_element_factory (GstCaps * caps);
62 G_END_DECLS
63 #endif