#include "../Audacity.h"
#include "ImportGStreamer.h"
#include <wx/window.h>
#include <wx/log.h>
#include "../Tags.h"
#include "../WaveTrack.h"
#include <gst/app/gstappsink.h>
#include <gst/audio/audio-format.h>
Go to the source code of this file.
|
#define | DESC XO("GStreamer-compatible files") |
|
#define | AUDCTX "audacity::context" |
|
#define | GETCTX(o) (GStreamContext *) g_object_get_data(G_OBJECT((o)), AUDCTX) |
|
#define | SETCTX(o, c) g_object_set_data(G_OBJECT((o)), AUDCTX, (gpointer) (c)) |
|
#define | WARN(e, msg) GST_ELEMENT_WARNING((e), STREAM, FAILED, msg, (NULL)); |
|
|
using | GstString = std::unique_ptr< gchar, Deleter< void, g_free > > |
|
using | GErrorHandle = std::unique_ptr< GError, Deleter< GError, g_error_free > > |
|
using | ParseFn = void(*)(GstMessage *message, GError **gerror, gchar **debug) |
|
template<typename T > |
using | GstObjHandle = std::unique_ptr< T, Deleter< void, gst_object_unref > > |
|
using | GstCapsHandle = std::unique_ptr< GstCaps, Deleter< GstCaps, GstCapsUnref > > |
|
|
void | GstMessageParse (ParseFn fn, GstMessage *msg, GErrorHandle &err, GstString &debug) |
|
static gint | GStreamerAutoplugSelectCallback (GstElement *WXUNUSED(element), GstPad *WXUNUSED(pad), GstCaps *WXUNUSED(caps), GstElementFactory *factory, gpointer WXUNUSED(data)) |
|
static void | GStreamerPadAddedCallback (GstElement *WXUNUSED(element), GstPad *pad, gpointer data) |
|
static void | GStreamerPadRemovedCallback (GstElement *WXUNUSED(element), GstPad *pad, gpointer data) |
|
void | GstSampleUnref (GstSample *p) |
|
static GstFlowReturn | GStreamerNewSample (GstAppSink *appsink, gpointer data) |
|
void | GstCapsUnref (GstCaps *p) |
|
void | GstMessageUnref (GstMessage *p) |
|
◆ AUDCTX
#define AUDCTX "audacity::context" |
◆ DESC
#define DESC XO("GStreamer-compatible files") |
◆ GETCTX
◆ SETCTX
#define SETCTX |
( |
|
o, |
|
|
|
c |
|
) |
| g_object_set_data(G_OBJECT((o)), AUDCTX, (gpointer) (c)) |
◆ WARN
#define WARN |
( |
|
e, |
|
|
|
msg |
|
) |
| GST_ELEMENT_WARNING((e), STREAM, FAILED, msg, (NULL)); |
◆ GErrorHandle
◆ GstCapsHandle
◆ GstObjHandle
◆ GstString
◆ ParseFn
using ParseFn = void (*)(GstMessage *message, GError **gerror, gchar **debug) |
◆ GstCapsUnref()
void GstCapsUnref |
( |
GstCaps * |
p | ) |
|
|
inline |
◆ GstMessageParse()
◆ GstMessageUnref()
void GstMessageUnref |
( |
GstMessage * |
p | ) |
|
|
inline |
◆ GStreamerAutoplugSelectCallback()
static gint GStreamerAutoplugSelectCallback |
( |
GstElement * |
WXUNUSEDelement, |
|
|
GstPad * |
WXUNUSEDpad, |
|
|
GstCaps * |
WXUNUSEDcaps, |
|
|
GstElementFactory * |
factory, |
|
|
gpointer |
WXUNUSEDdata |
|
) |
| |
|
static |
◆ GStreamerNewSample()
static GstFlowReturn GStreamerNewSample |
( |
GstAppSink * |
appsink, |
|
|
gpointer |
data |
|
) |
| |
|
static |
Definition at line 492 of file ImportGStreamer.cpp.
493{
494
495 return GuardedCall< GstFlowReturn > ( [&] {
497 static GMutex mutex;
498
499
500 std::unique_ptr < GstSample, Deleter< GstSample, GstSampleUnref> >
501 sample{ gst_app_sink_pull_sample(appsink) };
502
503
504
506
508
509 return GST_FLOW_OK;
511}
SimpleGuard< R > MakeSimpleGuard(R value) noexcept(noexcept(SimpleGuard< R >{ value }))
Convert a value to a handler function returning that value, suitable for GuardedCall<R>
! Does actual import, returned by GStreamerImportPlugin::Open
void OnNewSample(GStreamContext *c, GstSample *sample)
References GETCTX, MakeSimpleGuard(), and GStreamerImportFileHandle::OnNewSample().
◆ GStreamerPadAddedCallback()
static void GStreamerPadAddedCallback |
( |
GstElement * |
WXUNUSEDelement, |
|
|
GstPad * |
pad, |
|
|
gpointer |
data |
|
) |
| |
|
static |
◆ GStreamerPadRemovedCallback()
static void GStreamerPadRemovedCallback |
( |
GstElement * |
WXUNUSEDelement, |
|
|
GstPad * |
pad, |
|
|
gpointer |
data |
|
) |
| |
|
static |
◆ GstSampleUnref()
void GstSampleUnref |
( |
GstSample * |
p | ) |
|
|
inline |
◆ AppSinkBitBucket
GstAppSinkCallbacks AppSinkBitBucket |
|
static |
◆ AppSinkCallbacks
GstAppSinkCallbacks AppSinkCallbacks |
|
static |
◆ supportedCaps
GstStaticCaps supportedCaps |
|
static |