mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 05:31:15 +00:00
ext/dts/gstdtsdec.c: A few small clean-ups.
Original commit message from CVS: * ext/dts/gstdtsdec.c: (gst_dtsdec_init), (gst_dtsdec_sink_event): A few small clean-ups. * gst/real/gstrealaudiodec.c: (gst_real_audio_dec_setcaps): More debug output for failure cases.
This commit is contained in:
parent
c8e4999eb0
commit
6ca3c959b6
3 changed files with 24 additions and 30 deletions
|
@ -1,3 +1,11 @@
|
|||
2007-03-02 Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
||||
* ext/dts/gstdtsdec.c: (gst_dtsdec_init), (gst_dtsdec_sink_event):
|
||||
A few small clean-ups.
|
||||
|
||||
* gst/real/gstrealaudiodec.c: (gst_real_audio_dec_setcaps):
|
||||
More debug output for failure cases.
|
||||
|
||||
2007-03-02 Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
||||
Patch by: Young-Ho Cha <ganadist at chollian net>
|
||||
|
|
|
@ -45,17 +45,10 @@ GST_ELEMENT_DETAILS ("DTS audio decoder",
|
|||
"Decodes DTS audio streams",
|
||||
"Ronald Bultje <rbultje@ronald.bitfreak.net>");
|
||||
|
||||
enum
|
||||
{
|
||||
/* FILL ME */
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
ARG_0,
|
||||
ARG_DRC
|
||||
/* FILL ME */
|
||||
};
|
||||
|
||||
static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||
|
@ -153,18 +146,14 @@ gst_dtsdec_class_init (GstDtsDecClass * klass)
|
|||
static void
|
||||
gst_dtsdec_init (GstDtsDec * dtsdec, GstDtsDecClass * g_class)
|
||||
{
|
||||
/* create the sink and src pads */
|
||||
dtsdec->sinkpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get
|
||||
(&sink_factory), "sink");
|
||||
gst_pad_set_chain_function (dtsdec->sinkpad, gst_dtsdec_chain);
|
||||
dtsdec->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink");
|
||||
gst_pad_set_chain_function (dtsdec->sinkpad,
|
||||
GST_DEBUG_FUNCPTR (gst_dtsdec_chain));
|
||||
gst_pad_set_event_function (dtsdec->sinkpad,
|
||||
GST_DEBUG_FUNCPTR (gst_dtsdec_sink_event));
|
||||
gst_element_add_pad (GST_ELEMENT (dtsdec), dtsdec->sinkpad);
|
||||
|
||||
dtsdec->srcpad =
|
||||
gst_pad_new_from_template (gst_static_pad_template_get
|
||||
(&src_factory), "src");
|
||||
dtsdec->srcpad = gst_pad_new_from_static_template (&src_factory, "src");
|
||||
gst_pad_use_fixed_caps (dtsdec->srcpad);
|
||||
gst_element_add_pad (GST_ELEMENT (dtsdec), dtsdec->srcpad);
|
||||
|
||||
|
@ -308,8 +297,7 @@ gst_dtsdec_sink_event (GstPad * pad, GstEvent * event)
|
|||
GstDtsDec *dtsdec = GST_DTSDEC (gst_pad_get_parent (pad));
|
||||
gboolean ret = FALSE;
|
||||
|
||||
GST_LOG ("Handling event of type %d timestamp %llu", GST_EVENT_TYPE (event),
|
||||
GST_EVENT_TIMESTAMP (event));
|
||||
GST_LOG_OBJECT (dtsdec, "%s event", GST_EVENT_TYPE_NAME (event));
|
||||
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_NEWSEGMENT:{
|
||||
|
@ -331,14 +319,6 @@ gst_dtsdec_sink_event (GstPad * pad, GstEvent * event)
|
|||
ret = gst_pad_event_default (pad, event);
|
||||
break;
|
||||
}
|
||||
case GST_EVENT_TAG:
|
||||
case GST_EVENT_EOS:{
|
||||
ret = gst_pad_event_default (pad, event);
|
||||
break;
|
||||
}
|
||||
case GST_EVENT_FLUSH_START:
|
||||
ret = gst_pad_event_default (pad, event);
|
||||
break;
|
||||
case GST_EVENT_FLUSH_STOP:
|
||||
if (dtsdec->cache) {
|
||||
gst_buffer_unref (dtsdec->cache);
|
||||
|
|
|
@ -237,8 +237,10 @@ gst_real_audio_dec_setcaps (GstPad * pad, GstCaps * caps)
|
|||
if (funcs.SetDLLAccessPath)
|
||||
funcs.SetDLLAccessPath (DEFAULT_PATH);
|
||||
|
||||
if ((res = funcs.RAOpenCodec2 (&context, NULL)))
|
||||
if ((res = funcs.RAOpenCodec2 (&context, NULL))) {
|
||||
GST_DEBUG_OBJECT (dec, "RAOpenCodec2() failed");
|
||||
goto could_not_initialize;
|
||||
}
|
||||
|
||||
data.samplerate = rate;
|
||||
data.width = width;
|
||||
|
@ -249,15 +251,19 @@ gst_real_audio_dec_setcaps (GstPad * pad, GstCaps * caps)
|
|||
data.datalen = buf ? GST_BUFFER_SIZE (buf) : 0;
|
||||
data.data = buf ? GST_BUFFER_DATA (buf) : NULL;
|
||||
|
||||
if ((res = funcs.RAInitDecoder (context, &data)))
|
||||
if ((res = funcs.RAInitDecoder (context, &data))) {
|
||||
GST_DEBUG_OBJECT (dec, "RAInitDecoder() failed");
|
||||
goto could_not_initialize;
|
||||
}
|
||||
|
||||
if (funcs.RASetPwd)
|
||||
if (funcs.RASetPwd) {
|
||||
funcs.RASetPwd (dec->context, dec->pwd ? dec->pwd : DEFAULT_PWD);
|
||||
}
|
||||
|
||||
res = funcs.RASetFlavor (context, flavor);
|
||||
if (res)
|
||||
if ((res = funcs.RASetFlavor (context, flavor))) {
|
||||
GST_DEBUG_OBJECT (dec, "RASetFlavor(%d) failed", flavor);
|
||||
goto could_not_initialize;
|
||||
}
|
||||
|
||||
caps = gst_caps_new_simple ("audio/x-raw-int",
|
||||
"endianness", G_TYPE_INT, G_BYTE_ORDER,
|
||||
|
|
Loading…
Reference in a new issue