diff options
Diffstat (limited to 'xine/demux_xvdr.c')
-rw-r--r-- | xine/demux_xvdr.c | 31 |
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; } |