summaryrefslogtreecommitdiff
path: root/swfdec/swfdec_codec_gst.h
blob: 31e831954f0a7fa63c6c521347f4d7031277bf45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/* Swfdec
 * Copyright (C) 2003-2006 David Schleef <ds@schleef.org>
 *		 2005-2006 Eric Anholt <eric@anholt.net>
 *		 2006-2007 Benjamin Otte <otte@gnome.org>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 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
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, 
 * Boston, MA  02110-1301  USA
 */

#ifndef __SWFDEC_CODEC_GST_H__
#define __SWFDEC_CODEC_GST_H__

#include <gst/gst.h>
#include <swfdec/swfdec.h>

G_BEGIN_DECLS

typedef struct {
  GstElement *		bin;
  GstPad *		src;
  GstPad *		sink;
  GQueue *		queue;		/* all the stored output GstBuffers */
} SwfdecGstDecoder;

gboolean	swfdec_gst_decoder_init		(SwfdecGstDecoder *	dec,
						 GstCaps *		srccaps,
						 GstCaps *		sinkcaps,
						 ...) G_GNUC_NULL_TERMINATED;
void		swfdec_gst_decoder_set_codec_data
						(SwfdecGstDecoder *	dec,
						 GstBuffer *		buffer);
void		swfdec_gst_decoder_push_eos	(SwfdecGstDecoder *	dec);
GstBuffer *	swfdec_gst_decoder_pull		(SwfdecGstDecoder *	dec);
gboolean	swfdec_gst_decoder_push		(SwfdecGstDecoder *	dec,
						 GstBuffer *		buffer);
void		swfdec_gst_decoder_finish	(SwfdecGstDecoder *	dec);


/* NB: references argument more than once */
#define swfdec_buffer_new_from_gst(buffer) \
  swfdec_buffer_new_full (GST_BUFFER_DATA (buffer), GST_BUFFER_SIZE (buffer), \
      (SwfdecBufferFreeFunc) gst_mini_object_unref, (buffer))
GstBuffer *	swfdec_gst_buffer_new		(SwfdecBuffer *		buffer);


GstElementFactory *
		swfdec_gst_get_element_factory	(GstCaps *		caps);


G_END_DECLS
#endif