summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2009-02-23 16:22:54 +0000
committerphintuka <phintuka>2009-02-23 16:22:54 +0000
commit9cf743bb9886c644ce95f3fda865dd88b331dbce (patch)
treea7139cacb65018941791f2f9c6770be814beded9
parentddf1cb0b87290fe15702515a005cf29c3e8479d9 (diff)
downloadxineliboutput-9cf743bb9886c644ce95f3fda865dd88b331dbce.tar.gz
xineliboutput-9cf743bb9886c644ce95f3fda865dd88b331dbce.tar.bz2
Moved video decoder detection from input plugin
-rw-r--r--xine/demux_xvdr.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/xine/demux_xvdr.c b/xine/demux_xvdr.c
index b66ce4be..9428d10d 100644
--- a/xine/demux_xvdr.c
+++ b/xine/demux_xvdr.c
@@ -81,6 +81,9 @@ typedef struct demux_xvdr_s {
uint32_t last_audio_stream_id;
int64_t last_vpts;
uint8_t dvd_subtitles : 1;
+
+ uint8_t ffmpeg_mpeg2_decoder : 1;
+ uint8_t coreavc_h264_decoder : 1;
} demux_xvdr_t ;
typedef struct {
@@ -93,6 +96,32 @@ typedef struct {
config_values_t *config;
} demux_xvdr_class_t;
+
+static const char * get_decoder_name(xine_t *xine, int video_type)
+{
+ int streamtype = (video_type >> 16) & 0xFF;
+ plugin_node_t *node = xine->plugin_catalog->video_decoder_map[streamtype][0];
+ if (node) {
+ plugin_info_t *info = node->info;
+ if (info)
+ return info->id;
+ }
+ return "";
+}
+
+static void detect_video_decoders(demux_xvdr_t *this)
+{
+ if (!strcmp(get_decoder_name(this->stream->xine, BUF_VIDEO_MPEG), "ffmpegvideo"))
+ this->ffmpeg_mpeg2_decoder = 1;
+ LOGMSG("Using decoder \"%s\" for mpeg2 video",
+ this->ffmpeg_mpeg2_decoder ? "FFmpeg" : "libmpeg2");
+
+ if (!strcmp(get_decoder_name(this->stream->xine, BUF_VIDEO_H264), "dshowserver"))
+ this->coreavc_h264_decoder = 1;
+ LOGMSG("Using decoder \"%s\" for H.264 video",
+ this->coreavc_h264_decoder ? "dshowserver (CoreAVC)" : "FFmpeg");
+}
+
static void demux_xvdr_parse_ts(demux_xvdr_t *this, buf_element_t *buf);
static void demux_xvdr_parse_pes(demux_xvdr_t *this, buf_element_t *buf);
@@ -791,6 +820,8 @@ static demux_plugin_t *demux_xvdr_open_plugin (demux_class_t *class_gen,
this->status = DEMUX_FINISHED;
+ detect_video_decoders(this);
+
return &this->demux_plugin;
}