1 | /* |
2 | * Copyright (C) 2016 Metrological Group B.V. |
3 | * Copyright (C) 2016 Igalia S.L |
4 | * |
5 | * This library is free software; you can redistribute it and/or |
6 | * modify it under the terms of the GNU Library General Public |
7 | * License as published by the Free Software Foundation; either |
8 | * version 2 of the License, or (at your option) any later version. |
9 | * |
10 | * This library is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | * Library General Public License for more details. |
14 | * |
15 | * You should have received a copy of the GNU Library General Public License |
16 | * aint with this library; see the file COPYING.LIB. If not, write to |
17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 | * Boston, MA 02110-1301, USA. |
19 | */ |
20 | |
21 | #pragma once |
22 | |
23 | #if ENABLE(VIDEO) && USE(GSTREAMER) && ENABLE(MEDIA_SOURCE) |
24 | |
25 | #include "GStreamerCommon.h" |
26 | #include "MediaDescription.h" |
27 | |
28 | #include <gst/gst.h> |
29 | #include <wtf/text/AtomicString.h> |
30 | |
31 | namespace WebCore { |
32 | |
33 | class GStreamerMediaDescription : public MediaDescription { |
34 | public: |
35 | static Ref<GStreamerMediaDescription> create(GstCaps* caps) |
36 | { |
37 | return adoptRef(*new GStreamerMediaDescription(caps)); |
38 | } |
39 | |
40 | virtual ~GStreamerMediaDescription() = default; |
41 | |
42 | AtomicString codec() const override; |
43 | bool isVideo() const override; |
44 | bool isAudio() const override; |
45 | bool isText() const override; |
46 | |
47 | private: |
48 | GStreamerMediaDescription(GstCaps* caps) |
49 | : MediaDescription() |
50 | , m_caps(caps) |
51 | { |
52 | m_codecName = extractCodecName(); |
53 | } |
54 | |
55 | AtomicString (); |
56 | GRefPtr<GstCaps> m_caps; |
57 | AtomicString m_codecName; |
58 | }; |
59 | |
60 | } // namespace WebCore. |
61 | |
62 | #endif // USE(GSTREAMER) |
63 | |