aboutsummaryrefslogtreecommitdiff
path: root/ext/resindvd/rsndec.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/resindvd/rsndec.c')
-rw-r--r--ext/resindvd/rsndec.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/ext/resindvd/rsndec.c b/ext/resindvd/rsndec.c
index 788857a3..2c999d5e 100644
--- a/ext/resindvd/rsndec.c
+++ b/ext/resindvd/rsndec.c
@@ -23,6 +23,8 @@
#endif
#include <string.h>
+#include <gst/video/video.h>
+#include <gst/audio/audio.h>
#include "rsndec.h"
@@ -53,9 +55,9 @@ rsn_dec_class_init (RsnDecClass * klass)
}
static gboolean
-rsn_dec_sink_event (GstPad * pad, GstEvent * event)
+rsn_dec_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
{
- RsnDec *self = RSN_DEC (gst_pad_get_parent (pad));
+ RsnDec *self = RSN_DEC (parent);
gboolean ret = TRUE;
const GstStructure *s = gst_event_get_structure (event);
const gchar *name = (s ? gst_structure_get_name (s) : NULL);
@@ -63,9 +65,7 @@ rsn_dec_sink_event (GstPad * pad, GstEvent * event)
if (name && g_str_equal (name, "application/x-gst-dvd"))
ret = gst_pad_push_event (GST_PAD_CAST (self->srcpad), event);
else
- ret = self->sink_event_func (pad, event);
-
- gst_object_unref (self);
+ ret = self->sink_event_func (pad, parent, event);
return ret;
}
@@ -246,10 +246,13 @@ _get_decoder_factories (gpointer arg)
RsnDecFactoryFilterCtx ctx = { NULL, };
GstCaps *raw;
gboolean raw_audio;
+ GstRegistry *registry = gst_registry_get ();
ctx.desired_caps = gst_pad_template_get_caps (templ);
- raw = gst_caps_from_string ("audio/x-raw-float");
+ raw =
+ gst_caps_from_string
+ ("audio/x-raw,format=(string){ F32LE, F32BE, F64LE, F64BE }");
raw_audio = gst_caps_can_intersect (raw, ctx.desired_caps);
if (raw_audio) {
GstCaps *sub = gst_caps_subtract (ctx.desired_caps, raw);
@@ -263,7 +266,7 @@ _get_decoder_factories (gpointer arg)
ctx.decoder_caps = gst_caps_new_empty ();
GST_DEBUG ("Finding factories for caps: %" GST_PTR_FORMAT, ctx.desired_caps);
- factories = gst_default_registry_feature_filter (
+ factories = gst_registry_feature_filter (registry,
(GstPluginFeatureFilter) rsndec_factory_filter, FALSE, &ctx);
/* If these are audio caps, we add audioconvert, which is not a decoder,
@@ -274,7 +277,7 @@ _get_decoder_factories (gpointer arg)
GstPluginFeature *feature;
GST_DEBUG ("These are audio caps, adding audioconvert");
feature =
- gst_default_registry_find_feature ("audioconvert",
+ gst_registry_find_feature (registry, "audioconvert",
GST_TYPE_ELEMENT_FACTORY);
if (feature) {
factories = g_list_append (factories, feature);
@@ -372,23 +375,14 @@ static GstStaticPadTemplate audio_sink_template =
GST_STATIC_CAPS ("audio/mpeg,mpegversion=(int)1;"
"audio/x-private1-lpcm;"
"audio/x-private1-ac3;" "audio/ac3;" "audio/x-ac3;"
- "audio/x-private1-dts; audio/x-raw-float")
+ "audio/x-private1-dts; audio/x-raw,format=(string)"
+ GST_AUDIO_FORMATS_ALL)
);
static GstStaticPadTemplate audio_src_template = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS ("audio/x-raw-float, "
- "rate = (int) [ 1, MAX ], "
- "channels = (int) [ 1, MAX ], "
- "endianness = (int) BYTE_ORDER, "
- "width = (int) { 32, 64 }; "
- "audio/x-raw-int, "
- "rate = (int) [ 1, MAX ], "
- "channels = (int) [ 1, MAX ], "
- "endianness = (int) { 1234, 4321 },"
- "width = (int) [ 1, 32 ], "
- "depth = (int) [ 1, 32 ], " "signed = (boolean) { false, true }")
+ GST_STATIC_CAPS (GST_AUDIO_CAPS_MAKE (GST_AUDIO_FORMATS_ALL))
);
G_DEFINE_TYPE (RsnAudioDec, rsn_audiodec, RSN_TYPE_DEC);
@@ -438,7 +432,7 @@ GST_STATIC_PAD_TEMPLATE ("sink",
static GstStaticPadTemplate video_src_template = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS ("video/x-raw-yuv")
+ GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (GST_VIDEO_FORMATS_ALL))
);
G_DEFINE_TYPE (RsnVideoDec, rsn_videodec, RSN_TYPE_DEC);