mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 12:32:29 +00:00
ext/a52dec/: Re-enable CPU flags, use liboil to get them.
Original commit message from CVS: * ext/a52dec/Makefile.am: * ext/a52dec/gsta52dec.c: (gst_a52dec_base_init), (gst_a52dec_class_init), (gst_a52dec_sink_event), (gst_a52dec_change_state): * ext/a52dec/gsta52dec.h: Re-enable CPU flags, use liboil to get them.
This commit is contained in:
parent
a08e63fd01
commit
3dcbdad99c
4 changed files with 39 additions and 21 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2005-10-20 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
|
* ext/a52dec/Makefile.am:
|
||||||
|
* ext/a52dec/gsta52dec.c: (gst_a52dec_base_init),
|
||||||
|
(gst_a52dec_class_init), (gst_a52dec_sink_event),
|
||||||
|
(gst_a52dec_change_state):
|
||||||
|
* ext/a52dec/gsta52dec.h:
|
||||||
|
Re-enable CPU flags, use liboil to get them.
|
||||||
|
|
||||||
2005-10-20 Josef Zlomek <josef dot zlomek at xeris dot cz>
|
2005-10-20 Josef Zlomek <josef dot zlomek at xeris dot cz>
|
||||||
|
|
||||||
Reviewed by: Tim-Philipp Müller <tim at centricular dot net>
|
Reviewed by: Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
|
@ -4,9 +4,11 @@ plugin_LTLIBRARIES = libgsta52dec.la
|
||||||
libgsta52dec_la_SOURCES = gsta52dec.c
|
libgsta52dec_la_SOURCES = gsta52dec.c
|
||||||
libgsta52dec_la_CFLAGS = \
|
libgsta52dec_la_CFLAGS = \
|
||||||
$(GST_CFLAGS) \
|
$(GST_CFLAGS) \
|
||||||
|
$(LIBOIL_CFLAGS) \
|
||||||
$(GST_PLUGINS_BASE_CFLAGS)
|
$(GST_PLUGINS_BASE_CFLAGS)
|
||||||
libgsta52dec_la_LIBADD = \
|
libgsta52dec_la_LIBADD = \
|
||||||
$(A52DEC_LIBS) \
|
$(A52DEC_LIBS) \
|
||||||
|
$(LIBOIL_LIBS) \
|
||||||
$(GST_PLUGINS_BASE_LIBS) \
|
$(GST_PLUGINS_BASE_LIBS) \
|
||||||
-lgstaudio-@GST_MAJORMINOR@
|
-lgstaudio-@GST_MAJORMINOR@
|
||||||
libgsta52dec_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
libgsta52dec_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
||||||
|
|
|
@ -33,6 +33,10 @@
|
||||||
#include <a52dec/mm_accel.h>
|
#include <a52dec/mm_accel.h>
|
||||||
#include "gsta52dec.h"
|
#include "gsta52dec.h"
|
||||||
|
|
||||||
|
#include <liboil/liboil.h>
|
||||||
|
#include <liboil/liboilcpu.h>
|
||||||
|
#include <liboil/liboilfunction.h>
|
||||||
|
|
||||||
/* elementfactory information */
|
/* elementfactory information */
|
||||||
static GstElementDetails gst_a52dec_details = {
|
static GstElementDetails gst_a52dec_details = {
|
||||||
"ATSC A/52 audio decoder",
|
"ATSC A/52 audio decoder",
|
||||||
|
@ -132,6 +136,7 @@ gst_a52dec_class_init (GstA52DecClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
GstElementClass *gstelement_class;
|
GstElementClass *gstelement_class;
|
||||||
|
guint cpuflags;
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = (GObjectClass *) klass;
|
||||||
gstelement_class = (GstElementClass *) klass;
|
gstelement_class = (GstElementClass *) klass;
|
||||||
|
@ -146,6 +151,19 @@ gst_a52dec_class_init (GstA52DecClass * klass)
|
||||||
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DRC,
|
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DRC,
|
||||||
g_param_spec_boolean ("drc", "Dynamic Range Compression",
|
g_param_spec_boolean ("drc", "Dynamic Range Compression",
|
||||||
"Use Dynamic Range Compression", FALSE, G_PARAM_READWRITE));
|
"Use Dynamic Range Compression", FALSE, G_PARAM_READWRITE));
|
||||||
|
|
||||||
|
oil_init ();
|
||||||
|
|
||||||
|
klass->a52_cpuflags = 0;
|
||||||
|
cpuflags = oil_cpu_get_flags ();
|
||||||
|
if (cpuflags & OIL_IMPL_FLAG_MMX)
|
||||||
|
klass->a52_cpuflags |= MM_ACCEL_X86_MMX;
|
||||||
|
if (cpuflags & OIL_IMPL_FLAG_3DNOW)
|
||||||
|
klass->a52_cpuflags |= MM_ACCEL_X86_3DNOW;
|
||||||
|
if (cpuflags & OIL_IMPL_FLAG_MMXEXT)
|
||||||
|
klass->a52_cpuflags |= MM_ACCEL_X86_MMXEXT;
|
||||||
|
|
||||||
|
GST_LOG ("CPU flags: a52=%08x, liboil=%08x", klass->a52_cpuflags, cpuflags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -331,10 +349,9 @@ static gboolean
|
||||||
gst_a52dec_sink_event (GstPad * pad, GstEvent * event)
|
gst_a52dec_sink_event (GstPad * pad, GstEvent * event)
|
||||||
{
|
{
|
||||||
GstA52Dec *a52dec = GST_A52DEC (gst_pad_get_parent (pad));
|
GstA52Dec *a52dec = GST_A52DEC (gst_pad_get_parent (pad));
|
||||||
gboolean ret = TRUE;
|
gboolean ret = FALSE;
|
||||||
|
|
||||||
GST_LOG ("Handling event of type %d timestamp %llu", GST_EVENT_TYPE (event),
|
GST_LOG ("Handling %s event", GST_EVENT_TYPE_NAME (event));
|
||||||
GST_EVENT_TIMESTAMP (event));
|
|
||||||
|
|
||||||
switch (GST_EVENT_TYPE (event)) {
|
switch (GST_EVENT_TYPE (event)) {
|
||||||
case GST_EVENT_NEWSEGMENT:{
|
case GST_EVENT_NEWSEGMENT:{
|
||||||
|
@ -539,29 +556,17 @@ gst_a52dec_chain (GstPad * pad, GstBuffer * buf)
|
||||||
static GstStateChangeReturn
|
static GstStateChangeReturn
|
||||||
gst_a52dec_change_state (GstElement * element, GstStateChange transition)
|
gst_a52dec_change_state (GstElement * element, GstStateChange transition)
|
||||||
{
|
{
|
||||||
GstA52Dec *a52dec = GST_A52DEC (element);
|
|
||||||
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
|
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
|
||||||
|
GstA52Dec *a52dec = GST_A52DEC (element);
|
||||||
#if 0
|
|
||||||
GstCPUFlags cpuflags;
|
|
||||||
uint32_t a52_cpuflags = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
switch (transition) {
|
switch (transition) {
|
||||||
case GST_STATE_CHANGE_NULL_TO_READY:
|
case GST_STATE_CHANGE_NULL_TO_READY:{
|
||||||
#if 0
|
GstA52DecClass *klass;
|
||||||
cpuflags = gst_cpu_get_flags ();
|
|
||||||
if (cpuflags & GST_CPU_FLAG_MMX)
|
|
||||||
a52_cpuflags |= MM_ACCEL_X86_MMX;
|
|
||||||
if (cpuflags & GST_CPU_FLAG_3DNOW)
|
|
||||||
a52_cpuflags |= MM_ACCEL_X86_3DNOW;
|
|
||||||
if (cpuflags & GST_CPU_FLAG_MMXEXT)
|
|
||||||
a52_cpuflags |= MM_ACCEL_X86_MMXEXT;
|
|
||||||
|
|
||||||
a52dec->state = a52_init (a52_cpuflags);
|
klass = GST_A52DEC_CLASS (G_OBJECT_GET_CLASS (a52dec));
|
||||||
#endif
|
a52dec->state = a52_init (klass->a52_cpuflags);
|
||||||
a52dec->state = a52_init (0);
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
||||||
a52dec->samples = a52_samples (a52dec->state);
|
a52dec->samples = a52_samples (a52dec->state);
|
||||||
a52dec->bit_rate = -1;
|
a52dec->bit_rate = -1;
|
||||||
|
|
|
@ -63,6 +63,8 @@ struct _GstA52Dec {
|
||||||
|
|
||||||
struct _GstA52DecClass {
|
struct _GstA52DecClass {
|
||||||
GstElementClass parent_class;
|
GstElementClass parent_class;
|
||||||
|
|
||||||
|
guint32 a52_cpuflags;
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gst_a52dec_get_type (void);
|
GType gst_a52dec_get_type (void);
|
||||||
|
|
Loading…
Reference in a new issue