summaryrefslogtreecommitdiff
path: root/src/dxr3
diff options
context:
space:
mode:
Diffstat (limited to 'src/dxr3')
-rw-r--r--src/dxr3/Makefile.am39
-rw-r--r--src/dxr3/dxr3.h22
-rw-r--r--src/dxr3/dxr3_decode_spu.c55
-rw-r--r--src/dxr3/dxr3_decode_video.c56
-rw-r--r--src/dxr3/dxr3_mpeg_encoders.c2
-rw-r--r--src/dxr3/dxr3_scr.h2
-rw-r--r--src/dxr3/video_out_dxr3.c37
-rw-r--r--src/dxr3/video_out_dxr3.h4
8 files changed, 71 insertions, 146 deletions
diff --git a/src/dxr3/Makefile.am b/src/dxr3/Makefile.am
index f1a61ce12..8cef3753c 100644
--- a/src/dxr3/Makefile.am
+++ b/src/dxr3/Makefile.am
@@ -1,40 +1,41 @@
include $(top_srcdir)/misc/Makefile.common
-AM_CFLAGS = $(X_CFLAGS) $(LIBFAME_CFLAGS)
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_CPPFLAGS =
+AM_LDFLAGS = $(xineplug_ldflags)
-if HAVE_DXR3
-dxr3_modules = xineplug_decode_dxr3_video.la \
- xineplug_decode_dxr3_spu.la \
- xineplug_vo_out_dxr3.la
-endif
if HAVE_X11
+AM_CFLAGS += $(X_CFLAGS)
link_x_libs = $(X_LIBS) -lXext
endif
if HAVE_LIBFAME
-link_fame = $(LIBFAME_LIBS)
+AM_CFLAGS += $(LIBFAME_CFLAGS)
+link_fame = $(LIBFAME_LIBS)
endif
if HAVE_LIBRTE
link_rte = -lrte
endif
-xineplug_LTLIBRARIES = $(dxr3_modules)
+noinst_HEADERS = em8300.h dxr3.h dxr3_scr.h video_out_dxr3.h
+
+if ENABLE_DXR3
+xineplug_LTLIBRARIES = xineplug_decode_dxr3_video.la \
+ xineplug_decode_dxr3_spu.la \
+ xineplug_vo_out_dxr3.la
+endif
xineplug_decode_dxr3_video_la_SOURCES = dxr3_decode_video.c
xineplug_decode_dxr3_video_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
-xineplug_decode_dxr3_video_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_decode_dxr3_video_la_LDFLAGS = -avoid-version -module
-if HAVE_DVDNAV
-AM_CPPFLAGS = $(DVDNAV_CFLAGS)
+if WITH_EXTERNAL_DVDNAV
xineplug_decode_dxr3_spu_la_SOURCES = dxr3_decode_spu.c
xineplug_decode_dxr3_spu_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(DVDNAV_LIBS)
+xineplug_decode_dxr3_spu_la_CFLAGS = $(AM_CFLAGS) $(DVDNAV_CFLAGS)
else
-AM_CPPFLAGS = -I$(top_srcdir)/src/input/libdvdnav
xineplug_decode_dxr3_spu_la_SOURCES = dxr3_decode_spu.c nav_read.c
xineplug_decode_dxr3_spu_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
+xineplug_decode_dxr3_spu_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src/input/libdvdnav
endif
-xineplug_decode_dxr3_spu_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_decode_dxr3_spu_la_LDFLAGS = -avoid-version -module
xineplug_vo_out_dxr3_la_SOURCES = \
dxr3_mpeg_encoders.c \
@@ -43,11 +44,3 @@ xineplug_vo_out_dxr3_la_SOURCES = \
video_out_dxr3.c
xineplug_vo_out_dxr3_la_LIBADD = $(XINE_LIB) $(link_fame) $(link_rte) $(link_x_libs) $(LTLIBINTL) $(DYNAMIC_LD_LIBS) -lm
-xineplug_vo_out_dxr3_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_vo_out_dxr3_la_LDFLAGS = -avoid-version -module
-
-noinst_HEADERS = \
- em8300.h \
- dxr3.h \
- dxr3_scr.h \
- video_out_dxr3.h
diff --git a/src/dxr3/dxr3.h b/src/dxr3/dxr3.h
index f08ddcd04..12dedf07f 100644
--- a/src/dxr3/dxr3.h
+++ b/src/dxr3/dxr3.h
@@ -23,7 +23,11 @@
#include "em8300.h"
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
+
+#ifndef LOG_VID
+#define LOG_VID 0
+#endif
/* data for the device name config entry */
#define CONF_KEY "dxr3.device_number"
@@ -37,5 +41,19 @@
* (used by decoders to check for dxr3 presence) */
#define DXR3_VO_ID "dxr3"
-#endif
+/* inline helper implementations */
+static inline int dxr3_present(xine_stream_t *stream)
+{
+ int present = 0;
+
+ if (stream->video_driver && stream->video_driver->node &&
+ stream->video_driver->node->plugin_class ) {
+ const video_driver_class_t *const vo_class = (video_driver_class_t *)stream->video_driver->node->plugin_class;
+ if (vo_class->identifier)
+ present = (strcmp(vo_class->identifier, DXR3_VO_ID) == 0);
+ }
+ llprintf(LOG_VID, "dxr3 %s\n", present ? "present" : "not present");
+ return present;
+}
+#endif
diff --git a/src/dxr3/dxr3_decode_spu.c b/src/dxr3/dxr3_decode_spu.c
index 139939d8e..01dd20b05 100644
--- a/src/dxr3/dxr3_decode_spu.c
+++ b/src/dxr3/dxr3_decode_spu.c
@@ -42,9 +42,9 @@
#define LOG_SPU 0
#define LOG_BTN 0
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "buffer.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/buffer.h>
#include "xine-engine/bswap.h"
#ifdef HAVE_DVDNAV
# include <dvdnav/nav_types.h>
@@ -64,7 +64,7 @@ static void *dxr3_spudec_init_plugin(xine_t *xine, void *);
/* plugin catalog information */
-static uint32_t supported_types[] = { BUF_SPU_DVD, 0 };
+static const uint32_t supported_types[] = { BUF_SPU_DVD, 0 };
static const decoder_info_t dxr3_spudec_info = {
supported_types, /* supported types */
@@ -73,16 +73,13 @@ static const decoder_info_t dxr3_spudec_info = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_SPU_DECODER, 16, "dxr3-spudec", XINE_VERSION_CODE, &dxr3_spudec_info, &dxr3_spudec_init_plugin },
+ { PLUGIN_SPU_DECODER, 17, "dxr3-spudec", XINE_VERSION_CODE, &dxr3_spudec_info, &dxr3_spudec_init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
/* plugin class functions */
static spu_decoder_t *dxr3_spudec_open_plugin(spu_decoder_class_t *class_gen, xine_stream_t *stream);
-static char *dxr3_spudec_get_identifier(spu_decoder_class_t *class_gen);
-static char *dxr3_spudec_get_description(spu_decoder_class_t *class_gen);
-static void dxr3_spudec_class_dispose(spu_decoder_class_t *class_gen);
/* plugin instance functions */
static void dxr3_spudec_decode_data(spu_decoder_t *this_gen, buf_element_t *buf);
@@ -145,24 +142,6 @@ static int dxr3_spudec_copy_nav_to_btn(dxr3_spudec_t *this, int32_t mode
static inline void dxr3_swab_clut(int* clut);
/* inline helper implementations */
-static inline int dxr3_present(xine_stream_t *stream)
-{
- plugin_node_t *node;
- video_driver_class_t *vo_class;
- int present = 0;
-
- if (stream->video_driver && stream->video_driver->node) {
- node = (plugin_node_t *)stream->video_driver->node;
- if (node->plugin_class) {
- vo_class = (video_driver_class_t *)node->plugin_class;
- if (vo_class->get_identifier)
- present = (strcmp(vo_class->get_identifier(vo_class), DXR3_VO_ID) == 0);
- }
- }
- llprintf(LOG_SPU, "dxr3 %s\n", present ? "present" : "not present");
- return present;
-}
-
static inline void dxr3_spudec_clear_nav_list(dxr3_spudec_t *this)
{
while (this->pci_cur.next) {
@@ -202,9 +181,9 @@ static void *dxr3_spudec_init_plugin(xine_t *xine, void* data)
if (!this) return NULL;
this->spu_decoder_class.open_plugin = dxr3_spudec_open_plugin;
- this->spu_decoder_class.get_identifier = dxr3_spudec_get_identifier;
- this->spu_decoder_class.get_description = dxr3_spudec_get_description;
- this->spu_decoder_class.dispose = dxr3_spudec_class_dispose;
+ this->spu_decoder_class.identifier = "dxr3-spudec";
+ this->spu_decoder_class.description = N_("subtitle decoder plugin using the hardware decoding capabilities of a DXR3 decoder card");
+ this->spu_decoder_class.dispose = default_spu_decoder_class_dispose;
this->instance = 0;
@@ -275,22 +254,6 @@ static spu_decoder_t *dxr3_spudec_open_plugin(spu_decoder_class_t *class_gen, xi
return &this->spu_decoder;
}
-static char *dxr3_spudec_get_identifier(spu_decoder_class_t *class_gen)
-{
- return "dxr3-spudec";
-}
-
-static char *dxr3_spudec_get_description(spu_decoder_class_t *class_gen)
-{
- return "subtitle decoder plugin using the hardware decoding capabilities of a DXR3 decoder card";
-}
-
-static void dxr3_spudec_class_dispose(spu_decoder_class_t *class_gen)
-{
- free(class_gen);
-}
-
-
static void dxr3_spudec_decode_data(spu_decoder_t *this_gen, buf_element_t *buf)
{
dxr3_spudec_t *this = (dxr3_spudec_t *)this_gen;
@@ -571,7 +534,7 @@ static void dxr3_spudec_discontinuity(spu_decoder_t *this_gen)
static void dxr3_spudec_dispose(spu_decoder_t *this_gen)
{
- uint8_t empty_spu[] = {
+ static const uint8_t empty_spu[] = {
0x00, 0x26, 0x00, 0x08, 0x80, 0x00, 0x00, 0x80,
0x00, 0x00, 0x00, 0x20, 0x01, 0x03, 0x00, 0x00,
0x04, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x00,
diff --git a/src/dxr3/dxr3_decode_video.c b/src/dxr3/dxr3_decode_video.c
index 3f1c273ff..4347fb808 100644
--- a/src/dxr3/dxr3_decode_video.c
+++ b/src/dxr3/dxr3_decode_video.c
@@ -40,8 +40,8 @@
#define LOG_VID 0
#define LOG_PTS 0
-#include "xine_internal.h"
-#include "buffer.h"
+#include <xine/xine_internal.h>
+#include <xine/buffer.h>
#include "video_out_dxr3.h"
#include "dxr3.h"
@@ -65,7 +65,7 @@ static void *dxr3_init_plugin(xine_t *xine, void *);
/* plugin catalog information */
-static uint32_t supported_types[] = { BUF_VIDEO_MPEG, 0 };
+static const uint32_t supported_types[] = { BUF_VIDEO_MPEG, 0 };
static const decoder_info_t dxr3_video_decoder_info = {
supported_types, /* supported types */
@@ -74,16 +74,13 @@ static const decoder_info_t dxr3_video_decoder_info = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_DECODER, 18, "dxr3-mpeg2", XINE_VERSION_CODE, &dxr3_video_decoder_info, &dxr3_init_plugin },
+ { PLUGIN_VIDEO_DECODER, 19, "dxr3-mpeg2", XINE_VERSION_CODE, &dxr3_video_decoder_info, &dxr3_init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
/* plugin class functions */
static video_decoder_t *dxr3_open_plugin(video_decoder_class_t *class_gen, xine_stream_t *stream);
-static char *dxr3_get_identifier(video_decoder_class_t *class_gen);
-static char *dxr3_get_description(video_decoder_class_t *class_gen);
-static void dxr3_class_dispose(video_decoder_class_t *class_gen);
/* plugin instance functions */
static void dxr3_decode_data(video_decoder_t *this_gen, buf_element_t *buf);
@@ -146,7 +143,6 @@ typedef struct dxr3_decoder_s {
} dxr3_decoder_t;
/* helper functions */
-static inline int dxr3_present(xine_stream_t *stream);
static inline int dxr3_mvcommand(int fd_control, int command);
static void parse_mpeg_header(dxr3_decoder_t *this, uint8_t *buffer);
static int get_duration(dxr3_decoder_t *this);
@@ -159,24 +155,6 @@ static void dxr3_update_enhanced_mode(void *this_gen, xine_cfg_entry_t *ent
static void dxr3_update_correct_durations(void *this_gen, xine_cfg_entry_t *entry);
/* inline helper implementations */
-static inline int dxr3_present(xine_stream_t *stream)
-{
- plugin_node_t *node;
- video_driver_class_t *vo_class;
- int present = 0;
-
- if (stream->video_driver && stream->video_driver->node) {
- node = (plugin_node_t *)stream->video_driver->node;
- if (node->plugin_class) {
- vo_class = (video_driver_class_t *)node->plugin_class;
- if (vo_class->get_identifier)
- present = (strcmp(vo_class->get_identifier(vo_class), DXR3_VO_ID) == 0);
- }
- }
- llprintf(LOG_VID, "dxr3 %s\n", present ? "present" : "not present");
- return present;
-}
-
static inline int dxr3_mvcommand(int fd_control, int command)
{
em8300_register_t reg;
@@ -197,9 +175,9 @@ static void *dxr3_init_plugin(xine_t *xine, void *data)
if (!this) return NULL;
this->video_decoder_class.open_plugin = dxr3_open_plugin;
- this->video_decoder_class.get_identifier = dxr3_get_identifier;
- this->video_decoder_class.get_description = dxr3_get_description;
- this->video_decoder_class.dispose = dxr3_class_dispose;
+ this->video_decoder_class.identifier = "dxr3-mpeg2";
+ this->video_decoder_class.description = N_("MPEGI/II decoder plugin using the hardware decoding capabilities of a DXR3 decoder card.");
+ this->video_decoder_class.dispose = default_video_decoder_class_dispose;
this->instance = 0;
@@ -211,7 +189,7 @@ static void *dxr3_init_plugin(xine_t *xine, void *data)
static video_decoder_t *dxr3_open_plugin(video_decoder_class_t *class_gen, xine_stream_t *stream)
{
- static char *panscan_types[] = { "only when forced", "use MPEG hint", "use DVB hint", NULL };
+ static const char *const panscan_types[] = { "only when forced", "use MPEG hint", "use DVB hint", NULL };
dxr3_decoder_t *this;
dxr3_decoder_class_t *class = (dxr3_decoder_class_t *)class_gen;
config_values_t *cfg;
@@ -299,22 +277,6 @@ static video_decoder_t *dxr3_open_plugin(video_decoder_class_t *class_gen, xine_
return &this->video_decoder;
}
-static char *dxr3_get_identifier(video_decoder_class_t *class_gen)
-{
- return "dxr3-mpeg2";
-}
-
-static char *dxr3_get_description(video_decoder_class_t *class_gen)
-{
- return "MPEGI/II decoder plugin using the hardware decoding capabilities of a DXR3 decoder card.";
-}
-
-static void dxr3_class_dispose(video_decoder_class_t *class_gen)
-{
- free(class_gen);
-}
-
-
static void dxr3_decode_data(video_decoder_t *this_gen, buf_element_t *buf)
{
dxr3_decoder_t *this = (dxr3_decoder_t *)this_gen;
@@ -644,7 +606,7 @@ static void dxr3_flush(video_decoder_t *this_gen)
* (the highlights won't move without), but some dvds have stills
* with no sequence end code. Since it is very likely that flush() is called
* in still situations, we send one here. */
- static uint8_t end_buffer[4] = { 0x00, 0x00, 0x01, 0xb7 };
+ static const uint8_t end_buffer[4] = { 0x00, 0x00, 0x01, 0xb7 };
write(this->fd_video, &end_buffer, 4);
this->sequence_open = 0;
xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "dxr3_decode_video: WARNING: added missing end sequence\n");
diff --git a/src/dxr3/dxr3_mpeg_encoders.c b/src/dxr3/dxr3_mpeg_encoders.c
index 0c59b0b93..19ff8b81d 100644
--- a/src/dxr3/dxr3_mpeg_encoders.c
+++ b/src/dxr3/dxr3_mpeg_encoders.c
@@ -48,7 +48,7 @@
/* #define LOG_VERBOSE */
/* #define LOG */
-#include "xineutils.h"
+#include <xine/xineutils.h>
#include "video_out_dxr3.h"
/* buffer size for encoded mpeg1 stream; will hold one intra frame
diff --git a/src/dxr3/dxr3_scr.h b/src/dxr3/dxr3_scr.h
index d0e155c27..b9f35d643 100644
--- a/src/dxr3/dxr3_scr.h
+++ b/src/dxr3/dxr3_scr.h
@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*/
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
/* plugin structure */
diff --git a/src/dxr3/video_out_dxr3.c b/src/dxr3/video_out_dxr3.c
index c51354157..69b2d3eed 100644
--- a/src/dxr3/video_out_dxr3.c
+++ b/src/dxr3/video_out_dxr3.c
@@ -60,9 +60,9 @@
#define LOG_VID 0
#define LOG_OVR 0
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "video_out.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/video_out.h>
#include "dxr3.h"
#include "video_out_dxr3.h"
@@ -92,17 +92,15 @@ static const vo_info_t vo_info_dxr3_aa = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
#ifdef HAVE_X11
- { PLUGIN_VIDEO_OUT, 21, "dxr3", XINE_VERSION_CODE, &vo_info_dxr3_x11, &dxr3_x11_init_plugin },
+ { PLUGIN_VIDEO_OUT, 22, "dxr3", XINE_VERSION_CODE, &vo_info_dxr3_x11, &dxr3_x11_init_plugin },
#endif
- { PLUGIN_VIDEO_OUT, 21, "aadxr3", XINE_VERSION_CODE, &vo_info_dxr3_aa, &dxr3_aa_init_plugin },
+ { PLUGIN_VIDEO_OUT, 22, "aadxr3", XINE_VERSION_CODE, &vo_info_dxr3_aa, &dxr3_aa_init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
/* plugin class functions */
static vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const void *visual);
-static char *dxr3_vo_get_identifier(video_driver_class_t *class_gen);
-static char *dxr3_vo_get_description(video_driver_class_t *class_gen);
static void dxr3_vo_class_dispose(video_driver_class_t *class_gen);
/* plugin instance functions */
@@ -176,8 +174,8 @@ static dxr3_driver_class_t *dxr3_vo_init_plugin(xine_t *xine, void *visual_gen)
CONF_KEY, 0, CONF_NAME, CONF_HELP, 10, NULL, NULL);
this->video_driver_class.open_plugin = dxr3_vo_open_plugin;
- this->video_driver_class.get_identifier = dxr3_vo_get_identifier;
- this->video_driver_class.get_description = dxr3_vo_get_description;
+ this->video_driver_class.identifier = DXR3_VO_ID;
+ this->video_driver_class.description = N_("video output plugin displaying images through your DXR3 decoder card");
this->video_driver_class.dispose = dxr3_vo_class_dispose;
this->xine = xine;
@@ -189,16 +187,6 @@ static dxr3_driver_class_t *dxr3_vo_init_plugin(xine_t *xine, void *visual_gen)
return this;
}
-static char *dxr3_vo_get_identifier(video_driver_class_t *class_gen)
-{
- return DXR3_VO_ID;
-}
-
-static char *dxr3_vo_get_description(video_driver_class_t *class_gen)
-{
- return "video output plugin displaying images through your DXR3 decoder card";
-}
-
static void dxr3_vo_class_dispose(video_driver_class_t *class_gen)
{
dxr3_driver_class_t *class = (dxr3_driver_class_t *)class_gen;
@@ -220,13 +208,14 @@ static vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const v
static char *available_encoders[SUPPORTED_ENCODER_COUNT + 2];
plugin_node_t *node;
+ static const char *const videoout_modes[] = {
+ "letterboxed tv", "widescreen tv",
#ifdef HAVE_X11
- static const char const *videoout_modes[] = { "letterboxed tv", "widescreen tv",
- "letterboxed overlay", "widescreen overlay", NULL };
-#else
- static const char const *videoout_modes[] = { "letterboxed tv", "widescreen tv", NULL };
+ "letterboxed overlay", "widescreen overlay",
#endif
- static const char const *tv_modes[] = { "ntsc", "pal", "pal60" , "default", NULL };
+ NULL
+ };
+ static const char *const tv_modes[] = { "ntsc", "pal", "pal60" , "default", NULL };
int list_id, list_size;
xine_sarray_t *plugin_list;
diff --git a/src/dxr3/video_out_dxr3.h b/src/dxr3/video_out_dxr3.h
index 0297204dd..b3c607109 100644
--- a/src/dxr3/video_out_dxr3.h
+++ b/src/dxr3/video_out_dxr3.h
@@ -26,8 +26,8 @@
# include <X11/Xlib.h>
#endif
-#include "xine_internal.h"
-#include "vo_scale.h"
+#include <xine/xine_internal.h>
+#include <xine/vo_scale.h>
#include "dxr3_scr.h"
#include "dxr3.h"