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 * Copyright (C) 2014, 2015 Sebastian Dröge <sebastian@centricular.com>
6 * Copyright (C) 2015, 2016 Metrological Group B.V.
7 * Copyright (C) 2015, 2016 Igalia, S.L
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24#pragma once
25
26#if ENABLE(VIDEO) && ENABLE(MEDIA_SOURCE) && USE(GSTREAMER)
27
28#include "GStreamerCommon.h"
29#include "MediaPlayer.h"
30#include "MediaSource.h"
31#include "MediaSourcePrivate.h"
32#include "SourceBufferPrivate.h"
33#include "SourceBufferPrivateClient.h"
34#include <gst/gst.h>
35
36namespace WebCore {
37
38class MediaPlayerPrivateGStreamerMSE;
39
40enum MediaSourceStreamTypeGStreamer { Invalid, Unknown, Audio, Video, Text };
41
42}
43
44G_BEGIN_DECLS
45
46#define WEBKIT_TYPE_MEDIA_SRC (webkit_media_src_get_type ())
47#define WEBKIT_MEDIA_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WEBKIT_TYPE_MEDIA_SRC, WebKitMediaSrc))
48#define WEBKIT_MEDIA_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WEBKIT_TYPE_MEDIA_SRC, WebKitMediaSrcClass))
49#define WEBKIT_IS_MEDIA_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WEBKIT_TYPE_MEDIA_SRC))
50#define WEBKIT_IS_MEDIA_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WEBKIT_TYPE_MEDIA_SRC))
51
52typedef struct _WebKitMediaSrc WebKitMediaSrc;
53typedef struct _WebKitMediaSrcClass WebKitMediaSrcClass;
54typedef struct _WebKitMediaSrcPrivate WebKitMediaSrcPrivate;
55
56struct _WebKitMediaSrc {
57 GstBin parent;
58
59 WebKitMediaSrcPrivate *priv;
60};
61
62struct _WebKitMediaSrcClass {
63 GstBinClass parentClass;
64
65 // Notify app that number of audio/video/text streams changed.
66 void (*videoChanged)(WebKitMediaSrc*);
67 void (*audioChanged)(WebKitMediaSrc*);
68 void (*textChanged)(WebKitMediaSrc*);
69};
70
71GType webkit_media_src_get_type(void);
72
73void webKitMediaSrcSetMediaPlayerPrivate(WebKitMediaSrc*, WebCore::MediaPlayerPrivateGStreamerMSE*);
74
75void webKitMediaSrcPrepareSeek(WebKitMediaSrc*, const MediaTime&);
76void webKitMediaSrcSetReadyForSamples(WebKitMediaSrc*, bool);
77
78G_END_DECLS
79
80#endif // USE(GSTREAMER)
81