1/*
2 *  Copyright (C) 2009, 2010 Sebastian Dröge <sebastian.droege@collabora.co.uk>
3 *  Copyright (C) 2013 Collabora Ltd.
4 *  Copyright (C) 2013 Orange
5 *
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 of the License, or (at your option) any later version.
10 *
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.
15 *
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, Boston, MA  02110-1301  USA
19 */
20
21#ifndef WebKitMediaSourceGStreamer_h
22#define WebKitMediaSourceGStreamer_h
23#if ENABLE(VIDEO) && ENABLE(MEDIA_SOURCE) && USE(GSTREAMER)
24
25#include "MediaPlayer.h"
26#include <gst/gst.h>
27
28G_BEGIN_DECLS
29
30#define WEBKIT_TYPE_MEDIA_SRC            (webkit_media_src_get_type ())
31#define WEBKIT_MEDIA_SRC(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), WEBKIT_TYPE_MEDIA_SRC, WebKitMediaSrc))
32#define WEBKIT_MEDIA_SRC_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), WEBKIT_TYPE_MEDIA_SRC, WebKitMediaSrcClass))
33#define WEBKIT_IS_MEDIA_SRC(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WEBKIT_TYPE_MEDIA_SRC))
34#define WEBKIT_IS_MEDIA_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WEBKIT_TYPE_MEDIA_SRC))
35
36typedef struct _WebKitMediaSrc        WebKitMediaSrc;
37typedef struct _WebKitMediaSrcClass   WebKitMediaSrcClass;
38typedef struct _WebKitMediaSrcPrivate WebKitMediaSrcPrivate;
39
40struct _WebKitMediaSrc {
41    GstBin parent;
42
43    WebKitMediaSrcPrivate *priv;
44};
45
46struct _WebKitMediaSrcClass {
47    GstBinClass parentClass;
48};
49
50GType webkit_media_src_get_type(void);
51void webKitMediaSrcSetMediaPlayer(WebKitMediaSrc*, WebCore::MediaPlayer*);
52void webKitMediaSrcSetPlayBin(WebKitMediaSrc*, GstElement*);
53
54G_END_DECLS
55
56class MediaSourceClientGstreamer: public RefCounted<MediaSourceClientGstreamer> {
57    public:
58        MediaSourceClientGstreamer(WebKitMediaSrc*);
59        ~MediaSourceClientGstreamer();
60
61        void didReceiveDuration(double);
62        void didReceiveData(const char*, int, String);
63        void didFinishLoading(double);
64        void didFail();
65
66    private:
67        WebKitMediaSrc* m_src;
68};
69
70
71#endif // USE(GSTREAMER)
72#endif
73