| 1 | // Copyright (C) 2016 Jolla Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QGSTREAMERBUFFERPROBE_H |
| 5 | #define QGSTREAMERBUFFERPROBE_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists purely as an |
| 12 | // implementation detail. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <private/qtmultimediaglobal_p.h> |
| 19 | #include <gst/gst.h> |
| 20 | |
| 21 | #include <QtCore/qglobal.h> |
| 22 | |
| 23 | |
| 24 | QT_BEGIN_NAMESPACE |
| 25 | |
| 26 | class QGstreamerBufferProbe |
| 27 | { |
| 28 | public: |
| 29 | enum Flags |
| 30 | { |
| 31 | ProbeCaps = 0x01, |
| 32 | ProbeBuffers = 0x02, |
| 33 | ProbeAll = ProbeCaps | ProbeBuffers |
| 34 | }; |
| 35 | |
| 36 | explicit QGstreamerBufferProbe(Flags flags = ProbeAll); |
| 37 | virtual ~QGstreamerBufferProbe(); |
| 38 | |
| 39 | void addProbeToPad(GstPad *pad, bool downstream = true); |
| 40 | void removeProbeFromPad(GstPad *pad); |
| 41 | |
| 42 | protected: |
| 43 | virtual void probeCaps(GstCaps *caps); |
| 44 | virtual bool probeBuffer(GstBuffer *buffer); |
| 45 | |
| 46 | private: |
| 47 | static GstPadProbeReturn capsProbe(GstPad *pad, GstPadProbeInfo *info, gpointer user_data); |
| 48 | static GstPadProbeReturn bufferProbe(GstPad *pad, GstPadProbeInfo *info, gpointer user_data); |
| 49 | int m_capsProbeId = -1; |
| 50 | int m_bufferProbeId = -1; |
| 51 | const Flags m_flags; |
| 52 | }; |
| 53 | |
| 54 | QT_END_NAMESPACE |
| 55 | |
| 56 | #endif // QGSTREAMERBUFFERPROBE_H |
| 57 | |