СoreAVC for Linux (Патчи для MPlayer, mythtv, xine)

  • Цитата

    Со слов пользователя Goga777
    короче, вопрос - можно ли coreavc for linux & xine рекомендовать для использования с вдр ? нет ли в этом варианте других подводных камней ?


    1. Мультитред работает. Загрузка 35-70 % на c2d 2.13


    2. Я использую xineliboutput а не xine - как-то второй у меня немного подтормаживает - не выяснял, xinelib меня устраивает на 100%


    3. Из подводных камней - размер 1920х1080 зашит жестко при инициализации coreavc - значит на каналах отличных от 1080 будут глюки. Если кто знает как узнать размер кадра из потока - скажите, поправлю.


    4. При первом запуске если vdr включает сразу hd-канал - не определяется корректно что поток h.264 - лечится переключением на любой другой канал и обратно.

  • Цитата

    Со слов пользователя Walery
    1. Мультитред работает. Загрузка 35-70 % на c2d 2.13


    не многовата зарузка для такого проца ?
    напомни , пожалуйста, - какая у тебя видяха, какие видеодрова и видеовывод ?


    Цитата


    2. Я использую xineliboutput а не xine - как-то второй у меня немного подтормаживает - не выяснял, xinelib меня устраивает на 100%


    xinelib версии 1.2 или 1.1.* ?


    Цитата


    инициализации coreavc - значит на каналах отличных от 1080 будут глюки.


    а много таких ?


    Цитата


    Если кто знает как узнать размер кадра из потока - скажите, поправлю.


    может с помощью dvbsnoop ?

  • Такая же как в вениках, канал-то 1920х1080. на кино - 35-40, на спорте и под 60-70 прыгает, от битрейта зависит..


    Видяха nvidia g7300, дрова из комплекта suse 10.3, вывожу через dvi-hdmi переходник на 40-дюймовый ящик FHD


    Xinelib 1.2 патченный для работы с кореавц.


    ну я ошибся конечно, не 1080 а 1920 - много вещают в 1440, есть и в 720..


    параметры надо узнать изнутри плагина xineliboutput (тоже патченный кстати).

  • Цитата

    Со слов пользователя Walery
    Видяха nvidia g7300, дрова из комплекта suse 10.3, вывожу через dvi-hdmi переходник на 40-дюймовый ящик FHD


    с nvidia purevideo under Linux также глухо, как и с ati avivo hd uvd ?
    не пробовал под виндой включать аппаратное ускорение на своей видяхе ? судя по Пожалуйста зарегистрируйся для просмотра данной ссылки на страницу. g7300 поддерживает purevideo.


    под "видеовыводом" я имел ввиду драйвер типа - xv, xshm, ... - какой у тебя ?


    ну и последний вопрос - с интерлейсом как борешься ? встроенным в телик деинтерлейсером ?

  • Ускорение не пробовал - не доверяю этим штучкам, толку мне кажется не будет - слишком много увязок с дровами, операционкой и т.п. Вспомни как долго кричали про ускорение декодинга мпег-2 :) И где оно? аппаратно так и не сделано.. А по линуксом вобще глухо. Единственный выход - аппаратный декодинг на какой-нить сигме или мощный проц с любой встроенной видюхой (меньше грется будет)
    Вывожу через xv. Интерлейса нету ни на одном из 3-х каналов что у меня есть. Не знаю, может coreavc этим занимается ;) На телеке выключен, потому как выдаю 1920х1080х60 прогрессив с видяхи.

  • Цитата

    Со слов пользователя Goga777
    хотел уточнить - какая версия coreavc у тебя - Version 1.5.0.1 (20070827) ?


    и с мплеером этот патч дружит все-таки ? или только с xine & mythtv ?


    ps
    сообщил разработчикам xine и Ниссл, что coreavc for linux реально работает с xine-lib 1.2 - как я понял, для них это была новость.


    у меня 1.5.0 - отсюда hxxp://rapidshare.com/files/50207674/coreavcdecoder_unpacked.zip
    Хотя и 1.3 работает тоже..
    с мплеером дружит его патч (мплеера) - он в том же пакете что и патч для ксине и myth

  • Для работы xine-plugin с vdr нужно в xine-lib пропатчить pes-demuxer по аналогии с ts-demuxer (там инициализация coreavc происходит)
    Для xineliboutput-plugin для инициализаци coreavc нужно патчить
    сам плагин, xine_input_vdr.c функцию detect_h264 - тот же код добавить.

  • Кстати, следующая версия coreavc будет еще интересней


    CoreAVC™ Enterprise Edition* COMING SOON!
    Plays everything that CoreAVC Standard Edition does but adds support for windows video systems that need support for SAT TV, IPTV, DVB. For the highend video zealots CoreAVC Professional Edition even supports SMP processors like the Intel® CoreTM 2 Duo, allowing for even fast multitasking while playing back high-definition CoreAVC H.264 video.


    - H.264 Baseline, Main, Extended, High, High10, 4:2:2, 4:4:4 support
    - Interlaced support (full)
    - SMP support
    - GPU support

  • Цитата

    Со слов пользователя Goga777
    а фокусы с виндузовым реестром ты тоже проводил для регистрации ?


    нет, они для xine не нужны. только для мплеера и myth

  • а вот этой новости пока еще на линуксовых сайтах не было :)


    CorePlayer™ Professional for Linux


    Пожалуйста зарегистрируйся для просмотра данной ссылки на страницу.
    Пожалуйста зарегистрируйся для просмотра данной ссылки на страницу.


    летом ожидается линуксовый плеер CorePlayer™ Professional от CoreCodec, если к тому времени товарищи из ffmpeg-dev не обратят свой пристальный взор на проблемы, возникающие при h.264 декодировании, то этот плеер станет самым быстрым среди существующих.


    Пожалуйста зарегистрируйся для просмотра данной ссылки на страницу.


    I have been asked about CorePlayer Pro on Linux..... and the answer to that is YES it will be available by summer if not sooner our roadmap continues on its current pace. Also note that it is already available for our OEM customers for licensing.

  • чтобы запустить плагин xine с coreavc надо в /xine-lib/src/demuxer/demux_mpeg_pes.c после


    lprintf("%s%c\n", (this->mpeg12_h264_detected & 1) ? "H.264" : "MPEG1/2", (this->mpeg12_h264_detected & 2) ? '!' : '?');
    if (this->mpeg12_h264_detected == 3){


    добавить этот код:


    if (sent_header == 0) {
    printf("INIT H264\n");
    xine_bmiheader bih;
    buf_element_t *buf = this->video_fifo->buffer_pool_alloc (this->video_fifo);
    buf->decoder_flags = BUF_FLAG_STDHEADER;


    memset(&bih, 0x00, sizeof(bih));
    bih.biWidth = 1920;
    bih.biHeight = 1080;
    bih.biPlanes = 1;
    bih.biBitCount = 24;
    bih.biCompression = 0x34363248; //31435641; //AVC1
    bih.biSizeImage = 0;
    bih.biXPelsPerMeter=10000;
    bih.biYPelsPerMeter=10000;
    bih.biClrUsed=0;
    bih.biClrImportant=0;
    bih.biSize = sizeof(bih);
    buf->content = malloc(sizeof(bih));
    memcpy(buf->content, &bih, sizeof(bih));
    //memcpy(buf->content, &bih, sizeof(bih));
    buf->size = sizeof(bih);
    buf->type = BUF_VIDEO_H264;
    buf->decoder_flags |= BUF_FLAG_FRAME_END;
    this->video_fifo->put (this->video_fifo, buf);
    sent_header = 1;
    buf = NULL;
    }


    ну и переменную sent_header завести :


    +int sent_header = 0;
    static int32_t parse_video_stream(demux_mpeg_pes_t *this, uint8_t *p, buf_element_t *buf) {


    и здесь обнулить:


    if (this->mpeg12_h264_detected < 2) {
    + sent_header=0;

  • спросили в привате - Walery - не подскажешь, где грабли у пипла. Скорее всего он должен указать xineliboutput использовать coreavc кодек, а он у него ffmpeg использует.


    I'm eager to test CoreAVC and I've read the thread on VDR-ML.
    I have done all the patching to xine-lib, ( patch from
    coreavc-for-linux-read-only + additional from happysat ). Then I've put
    CoreAVCDecoder.ax in /usr/lib/win32.


    I'm running VDR with xineliboutput.


    -P "xineliboutput --fullscreen --local=sxfe --audio=alsa --remote=none"


    What more do I have to do, ( extra arguments etc. ) to use CoreAVC? When
    I start VDR now I can't see any difference from using ffmpeg.


    .....
    load_plugins: plugin
    /usr/local/lib/xine/plugins/1.1.9/xineplug_dmx_nsv.so found
    load_plugins: plugin
    /usr/local/lib/xine/plugins/1.1.9/xineplug_decode_a52.so found
    video_out_xv: using Xv port 275 from adaptor NV17 Video Texture for
    hardware colour space conversion and scaling.
    video_out_xv: this adaptor supports the yuy2 format.
    video_out_xv: this adaptor supports the yv12 format.
    audio_alsa_out : supported modes are 8bit 16bit 24bit 32bit mono stereo
    (4-channel not enabled in xine config) (4.1-channel
    not enabled in xine config) (5-channel not enabled in xine config)
    (5.1-channel not enabled in xine config) (a/52 and DTS pass-through not
    enabled in xine config)
    xine: found input plugin : VDR (Video Disk Recorder) input plugin
    input cache plugin disabled
    xine: found demuxer plugin: DVD/VOB demux plugin
    video_out_xv: VO_PROP_INTERLACED(1)
    av_offset=0 pts
    video_out_xv: VO_PROP_ZOOM_X = 100
    prebuffer=14400 pts
    prebuffer=14400 pts
    prebuffer=14400 pts
    prebuffer=14400 pts
    prebuffer=14400 pts
    video: synced early
    prebuffer=14400 pts
    prebuffer=14400 pts
    video: synced early
    prebuffer=14400 pts
    prebuffer=14400 pts
    video: synced early
    [h264 @ 0x11c43f0]non existing PPS referenced
    [h264 @ 0x11c43f0]decode_slice_header error
    [h264 @ 0x11c43f0]non existing PPS referenced
    [h264 @ 0x11c43f0]decode_slice_header error
    .....

  • ok, значит этот патч и для xineliboutput подходит. А вот у меня упомянутая тобой строчка, после которой надо добавлять код немного по другому заканчивается - это ничего ?


    lprintf("%s%c\n", (this->mpeg12_h264_detected & 1) ? "H.264" : "MPEG1/2", (this->mpeg12_h264_detected & 2) ? '!' : '?');
    }


    /* when an H.264 AUD is seen, we first need to tell the decoder that the
    previous frame was complete.
    */
    if (this->mpeg12_h264_detected & 1) {



    и у меня xine.patch наложился с 2 режектами - это поправить можно ?
    patching file src/libw32dll/Makefile.am
    Hunk #1 FAILED at 13.
    Hunk #2 FAILED at 33.
    2 out of 2 hunks FAILED -- saving rejects to file src/libw32dll/Makefile.am.rej




    Makefile.am.rej
    *************** xineplug_LTLIBRARIES = $(w32dll_codec) $
    *** 13,19 ****


    EXTRA_DIST = common.c


    - xineplug_decode_w32dll_la_SOURCES = w32codec.c
    xineplug_decode_w32dll_la_LDFLAGS = -avoid-version -module
    xineplug_decode_w32dll_la_LIBADD = \
    $(top_builddir)/src/libw32dll/wine/libwine.la \
    --- 13,19 ----


    EXTRA_DIST = common.c


    + xineplug_decode_w32dll_la_SOURCES = w32codec.c nal_parser.c
    xineplug_decode_w32dll_la_LDFLAGS = -avoid-version -module
    xineplug_decode_w32dll_la_LIBADD = \
    $(top_builddir)/src/libw32dll/wine/libwine.la \
    *************** xineplug_decode_qt_la_LIBADD = \
    *** 33,36 ****
    -lm \
    @KSTAT_LIBS@


    - noinst_HEADERS = libwin32.h w32codec.h
    --- 33,36 ----
    -lm \
    @KSTAT_LIBS@


    + noinst_HEADERS = libwin32.h w32codec.h nal_parser.h



    Makefile.am.orig


    include $(top_srcdir)/misc/Makefile.common


    AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
    AM_CPPFLAGS = -I$(srcdir)/wine -DWIN32_PATH=\"$(w32_path)\"
    AM_LDFLAGS = $(xineplug_ldflags)


    SUBDIRS =
    if ENABLE_W32DLL
    SUBDIRS += wine DirectShow dmo qtx
    endif


    EXTRA_DIST = common.c


    noinst_HEADERS = libwin32.h w32codec.h


    if ENABLE_W32DLL
    xineplug_LTLIBRARIES = xineplug_decode_w32dll.la xineplug_decode_qt.la
    endif


    xineplug_decode_w32dll_la_SOURCES = w32codec.c
    xineplug_decode_w32dll_la_DEPS = $(XDG_BASEDIR_DEPS)
    xineplug_decode_w32dll_la_LIBADD = \
    $(top_builddir)/src/libw32dll/wine/libwine.la \
    $(top_builddir)/src/libw32dll/DirectShow/libds_filter.la \
    $(top_builddir)/src/libw32dll/dmo/libdmo_filter.la \
    $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL) -lm $(KSTAT_LIBS) $(XDG_BASEDIR_LIBS)
    xineplug_decode_w32dll_la_CPPFLAGS = $(AM_CPPFLAGS) $(XDG_BASEDIR_CPPFLAGS)


    xineplug_decode_qt_la_SOURCES = qt_decoder.c
    xineplug_decode_qt_la_LIBADD = \
    $(top_builddir)/src/libw32dll/wine/libwine.la \
    $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL) -lm $(KSTAT_LIBS) $(XDG_BASEDIR_LIBS)

  • я чуть ошибся.. вот правильный кусок:


    pp = memchr(pp, 0x01, pp_limit - pp);
    }
    usleep(100);
    lprintf("%s%c\n", (this->mpeg12_h264_detected & 1) ? "H.264" : "MPEG1/2", (this->mpeg12_h264_detected & 2) ? '!' : '?');
    if (this->mpeg12_h264_detected == 3){
    if (sent_header == 0) {
    printf("INIT H264\n");
    xine_bmiheader bih;
    buf_element_t *buf = this->video_fifo->buffer_pool_alloc (this->video_fifo);
    buf->decoder_flags = BUF_FLAG_STDHEADER;


    memset(&bih, 0x00, sizeof(bih));
    bih.biWidth = 1920;
    bih.biHeight = 1080;
    bih.biPlanes = 1;
    bih.biBitCount = 24;
    bih.biCompression = 0x34363248; //31435641; //AVC1
    bih.biSizeImage = 0;
    bih.biXPelsPerMeter=10000;
    bih.biYPelsPerMeter=10000;
    bih.biClrUsed=0;
    bih.biClrImportant=0;
    bih.biSize = sizeof(bih);
    buf->content = malloc(sizeof(bih));
    memcpy(buf->content, &bih, sizeof(bih));
    //memcpy(buf->content, &bih, sizeof(bih));
    buf->size = sizeof(bih);
    buf->type = BUF_VIDEO_H264;
    buf->decoder_flags |= BUF_FLAG_FRAME_END;
    this->video_fifo->put (this->video_fifo, buf);
    sent_header = 1;
    buf = NULL;
    }
    }
    }


    /* when an H.264 AUD is seen, we first need to tell the decoder that the
    previous frame was complete.
    */
    if (this->mpeg12_h264_detected & 1) {
    buf_type = BUF_VIDEO_H264;
    /* omit sending BUF_FLAG_FRAME_END for the first AUD occurence */



    а вот правильный makefile.am


    include $(top_srcdir)/misc/Makefile.common


    AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
    AM_CPPFLAGS = -I$(srcdir)/wine -DWIN32_PATH=\"$(w32_path)\"
    AM_LDFLAGS = $(xineplug_ldflags)


    SUBDIRS =
    if ENABLE_W32DLL
    SUBDIRS += wine DirectShow dmo qtx
    endif


    EXTRA_DIST = common.c


    noinst_HEADERS = libwin32.h w32codec.h nal_parser.h


    if ENABLE_W32DLL
    xineplug_LTLIBRARIES = xineplug_decode_w32dll.la
    endif


    xineplug_decode_w32dll_la_SOURCES = w32codec.c nal_parser.c
    xineplug_decode_w32dll_la_DEPS = $(XDG_BASEDIR_DEPS)
    xineplug_decode_w32dll_la_LIBADD = \
    $(top_builddir)/src/libw32dll/wine/libwine.la \
    $(top_builddir)/src/libw32dll/DirectShow/libds_filter.la \
    $(top_builddir)/src/libw32dll/dmo/libdmo_filter.la \
    $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL) -lm $(KSTAT_LIBS) $(XDG_BASEDIR_LIBS)
    xineplug_decode_w32dll_la_CPPFLAGS = $(AM_CPPFLAGS) $(XDG_BASEDIR_CPPFLAGS)


    $(top_builddir)/src/libw32dll/wine/libwine.la \
    $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL) -lm $(KSTAT_LIBS)



    да, нужно еще запретить декодировать встроенному ffmpeg-у - для тестов можно просто удалить из /usr/local/lib/xine/plugins/1.1.9/ xineplugdecode_ff.so и xineplugdecode_qt.so

    Сообщение было отредактировано 1 раз, последнее редактирование пользователем Walery ().

  • что-то не компилится у меня - по крайней мере 2 ошибки выскакивают


    с правленным demux_mpeg_pes.c


    DNDEBUG -D_REENTRANT -DXINE_COMPILE -O3 -ffast-math -fexpensive-optimizations -mtune=pentiumpro -fvisibility=hidden -pipe -Wall -Wformat=2 -Wno-format-zero-length -Wmissing-format-attribute -Werror-implicit-function-declaration -Wstrict-aliasing=2 -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wpointer-arith -g -MT demux_mpeg_pes.lo -MD -MP -MF .deps/demux_mpeg_pes.Tpo -c demux_mpeg_pes.c -fPIC -DPIC -o .libs/demux_mpeg_pes.o
    demux_mpeg_pes.c: In function 'parse_video_stream':
    demux_mpeg_pes.c:1164: error: 'sent_header' undeclared (first use in this function)
    demux_mpeg_pes.c:1164: error: (Each undeclared identifier is reported only once
    demux_mpeg_pes.c:1164: error: for each function it appears in.)
    demux_mpeg_pes.c:1100: warning: unused variable 'buf_type'
    demux_mpeg_pes.c:1099: warning: unused variable 'chunk_length'
    demux_mpeg_pes.c:1098: warning: unused variable 'i'
    demux_mpeg_pes.c:1097: warning: unused variable 'todo_length'
    demux_mpeg_pes.c: At top level:
    demux_mpeg_pes.c:1198: error: expected identifier or '(' before 'if'
    demux_mpeg_pes.c:1217: error: expected identifier or '(' before 'if'
    demux_mpeg_pes.c:1227: error: expected identifier or '(' before 'else'
    demux_mpeg_pes.c:1231: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
    demux_mpeg_pes.c:1232: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
    demux_mpeg_pes.c:1233: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
    demux_mpeg_pes.c:1234: error: expected identifier or '(' before 'if'
    demux_mpeg_pes.c:1237: error: expected '=', ',', ';', 'asm' or '__attribute__' before '->' token
    demux_mpeg_pes.c:1238: error: expected identifier or '(' before 'while'
    demux_mpeg_pes.c:1269: error: expected identifier or '(' before 'do'
    demux_mpeg_pes.c:1269: error: expected identifier or '(' before 'while'
    demux_mpeg_pes.c:1271: error: expected identifier or '(' before 'return'
    demux_mpeg_pes.c:1272: error: expected identifier or '(' before '}' token
    make[2]: *** [demux_mpeg_pes.lo] Ошибка 1
    make[2]: Leaving directory `/usr/local/src/xine-lib-1.2/src/demuxers'
    make[1]: *** [all-recursive] Ошибка 1
    make[1]: Leaving directory `/usr/local/src/xine-lib-1.2/src'
    make: *** [all-recursive] Ошибка 1
    goga:/usr/local/src/xine-lib-1.2#


    и




    arith -g -MT DS_VideoDecoder.lo -MD -MP -MF .deps/DS_VideoDecoder.Tpo -c DS_VideoDecoder.c -fPIC -DPIC -o .libs/DS_VideoDecoder.o
    In file included from ../wine/pe_image.h:5,
    from ../wine/module.h:11,
    from guids.h:5,
    from DS_VideoDecoder.c:8:
    ../wine/winbase.h:544: warning: 'packed' attribute ignored for field of type 'CHAR[8]'
    In file included from ../wine/module.h:11,
    from guids.h:5,
    from DS_VideoDecoder.c:8:
    ../wine/pe_image.h:60: warning: 'packed' attribute ignored for field of type 'BYTE'
    ../wine/pe_image.h:62: warning: 'packed' attribute ignored for field of type 'BYTE'
    ../wine/pe_image.h:64: warning: 'packed' attribute ignored for field of type 'BYTE'
    ../wine/pe_image.h:66: warning: 'packed' attribute ignored for field of type 'BYTE'
    ../wine/pe_image.h:67: warning: 'packed' attribute ignored for field of type 'BYTE'
    ../wine/pe_image.h:69: warning: 'packed' attribute ignored for field of type 'BYTE'
    DS_VideoDecoder.c:18:23: error: xineutils.h: No such file or directory
    DS_VideoDecoder.c:88: warning: no previous prototype for 'avc_quant'
    DS_VideoDecoder.c: In function 'avc_quant':
    DS_VideoDecoder.c:94: error: implicit declaration of function 'xine_fast_memcpy'
    DS_VideoDecoder.c:99: warning: suggest parentheses around arithmetic in operand of |
    DS_VideoDecoder.c:105: warning: suggest parentheses around arithmetic in operand of |
    DS_VideoDecoder.c: At top level:
    DS_VideoDecoder.c:113: warning: no previous prototype for 'ConvertVIHtoMPEG2VI'
    DS_VideoDecoder.c: In function 'ConvertVIHtoMPEG2VI':
    DS_VideoDecoder.c:161: warning: unused variable 'i'
    DS_VideoDecoder.c:140: warning: unused variable 'data'
    make[3]: *** [DS_VideoDecoder.lo] Ошибка 1
    make[3]: Leaving directory `/usr/local/src/xine-lib-1.2/src/libw32dll/DirectShow'
    make[2]: *** [all-recursive] Ошибка 1
    make[2]: Leaving directory `/usr/local/src/xine-lib-1.2/src/libw32dll'
    make[1]: *** [all-recursive] Ошибка 1
    make[1]: Leaving directory `/usr/local/src/xine-lib-1.2/src'
    make: *** [all-recursive] Ошибка 1
    goga:/usr/local/src/xine-lib-1.2#



    а у того пипла все скомпилилось вроде, как ты и описал НО


    I get a black screen with OSD and sound


    Problem is I don't se any "INIT H264" on console.


    Is there any way to see that my CoreAVCDecoder.ax get's loaded. I
    haven't done anything but taking the coreavcdecoder_unpacked.zip you
    linked to, unzipped it and renamed it to CoreAVCDecoder.ax and put it in
    /usr/lib/win32


    If I do:


    ....
    [root@mm dshowserver]# ./dshowserver -c CoreAVCDecoder.ax -s 1280x720 -g
    09571a4b-f1fe-4c60-9760de6d310c7c31 -b 12 -f 0x34363248 -o 0x30323449
    shm:/dshow_shm.(null)
    sem1:/dshow_sem1.(null)
    sem2:/dshow_sem2.(null)
    Opening device
    Creating new registry
    Failed to open registry file '/root/.mplayer/registry32' for writing.
    len: 948
    ProductVersion: 1.5.0.0
    Decoder supports the following YUV formats: YUY2 IYUV YV12 I420
    Decoder is capable of YUV output (flags 0x27)
    Setting fmt
    Starting
    Initialization is complete
    shm_open failed: No such file or directory
    ....


    it looks like it's correct so far.


    I'm confused, but thank's anyway for all your help.


    Per

  • Цитата

    Со слов пользователя Walery
    Для работы xine-plugin с vdr нужно в xine-lib пропатчить pes-demuxer по аналогии с ts-demuxer (там инициализация coreavc происходит)
    Для xineliboutput-plugin для инициализаци coreavc нужно патчить
    сам плагин, xine_input_vdr.c функцию detect_h264 - тот же код добавить.


    то, что ты описал выше с demux_mpeg_pes.c - это и есть инициализация coreavc ?

  • да. Ну судя по последнему сообщению в мейл-листе vdr у него заработал xine-plugin.
    Для xineliboutput - нужен свой патч..


    --- xine_input_vdr.c.new 2007-12-21 07:48:40.000000000 +0300
    +++ xine_input_vdr.c 2008-01-20 07:09:09.000000000 +0300
    @@ -4,7 +4,7 @@
    * See the main source file 'xineliboutput.c' for copyright information and
    * how to reach the author.
    *
    - * $Id: xine_input_vdr.c,v 1.103 2007/12/19 23:32:34 phintuka Exp $
    + * $Id: xine_input_vdr.c,v 1.104 2007/12/22 21:57:02 phintuka Exp $
    *
    */

    @@ -1383,7 +1383,7 @@
    }

    #if XINE_VERSION_CODE < 10190
    -# define fifo_buffer_new (stream, n, s) _x_fifo_buffer_new(n, s)
    +# define fifo_buffer_new(stream, n, s) _x_fifo_buffer_new(n, s)
    #else
    static fifo_buffer_t *fifo_buffer_new (xine_stream_t *stream, int num_buffers, uint32_t buf_size)
    {
    @@ -4859,7 +4859,7 @@
    }
    return 0;
    }
    -
    +int sent_header = 0;
    #ifdef TEST_H264
    static int detect_h264(vdr_input_plugin_t *this, uint8_t *data, int len)
    {
    @@ -4870,18 +4870,53 @@
    if (data[i] == 0 && data[i + 1] == 0 && data[i + 2] == 1) {
    if (data[i + 3] == 0x09) {
    LOGMSG("H.264 scanner: Possible H.264 NAL AUD");
    + printf("H.264 scanner: Possible H.264 NAL AUD\n");
    + if (sent_header == 0) {
    + printf("INIT H264\n");
    + xine_bmiheader bih;
    + buf_element_t *buf = this->stream->video_fifo->buffer_pool_alloc (this->stream->video_fifo);
    + buf->decoder_flags = BUF_FLAG_STDHEADER;
    +
    + memset(&bih, 0x00, sizeof(bih));
    + bih.biWidth = 1920;
    + bih.biHeight = 1080;
    + bih.biPlanes = 1;
    + bih.biBitCount = 24;
    + bih.biCompression = 0x34363248; //31435641; //AVC1
    + bih.biSizeImage = 0;
    + bih.biXPelsPerMeter=10000;
    + bih.biYPelsPerMeter=10000;
    + bih.biClrUsed=0;
    + bih.biClrImportant=0;
    + bih.biSize = sizeof(bih);
    + buf->content = malloc(sizeof(bih));
    + memcpy(buf->content, &bih, sizeof(bih));
    + //memcpy(buf->content, &bih, sizeof(bih));
    + buf->size = sizeof(bih);
    + buf->type = BUF_VIDEO_H264;
    + buf->decoder_flags |= BUF_FLAG_FRAME_END;
    + this->stream->video_fifo->put (this->stream->video_fifo, buf);
    + sent_header = 1;
    + buf = NULL;
    + }
    +
    return 1;
    }
    if (data[i + 3] == (0x09 | 0x80)) {
    LOGMSG("H.264 scanner: Possible VDR H.264 NAL AUD (0x09|0x80) ?");
    + printf("H.264 scanner: Possible VDR H.264 NAL AUD (0x09|0x80) ?\n");
    return this->h264; /* no state change */
    }
    if (data[i + 3] == 0) {
    LOGDBG("H.264 scanner: Possible MPEG2 start code PICTURE (0x00)");
    + printf("H.264 scanner: Possible MPEG2 start code PICTURE (0x00)\n");
    + sent_header = 0;
    return 0;
    }
    if (data[i + 3] >= 0x80) {
    LOGDBG("H.264 scanner: Possible MPEG2 start code (0x%02x)", data[i + 3]);
    + printf("H.264 scanner: Possible MPEG2 start code (0x%02x)\n", data[i + 3]);
    + sent_header = 0;
    return 0;
    }
    LOGMSG("H.264 scanner: Unregonized header 00 00 01 %02x", data[i + 3]);
    @@ -4913,11 +4948,12 @@
    if (data[i + 3] == (0x09 | 0x80)) {
    data[i + 3] = 0x09;
    LOGMSG("H.264: NAL AUD ? (0x89 -> 0x09)");
    + printf("H.264: NAL AUD ? (0x89 -> 0x09)\n");
    }

    /* Access Unit Delimiter */
    - if (data[i + 3] == 0x09)
    - post_frame_end (this, BUF_VIDEO_H264);
    +// if (data[i + 3] == 0x09)
    +// post_frame_end (this, BUF_VIDEO_H264);

    if (data[i + 3] >= 0x80) {
    LOGMSG("H.264: Possible MPEG2 start code (0x%02x)", data[i + 3]);
    @@ -4954,15 +4990,12 @@
    /* xine ffmpeg decoder does not handle pts <-> dts difference very well if P/B frames have pts */
    if (abs(pts - this->last_delivered_vid_pts) < 90000 && pts < this->last_delivered_vid_pts) {
    LOGDBG("H.264: -> pts %"PRId64" <- 0", pts);
    - /*buf->pts = 0;*/
    } else if (dts>0) {
    LOGDBG("H.264: -> pts %"PRId64" <- 0 (DTS %"PRId64")", pts, dts);
    - /*buf->pts = 0;*/
    } else {
    LOGDBG("H.264: -> pts %"PRId64, pts);
    buf->pts = pts;
    }
    -
    this->last_delivered_vid_pts = pts;
    }

    @@ -4971,7 +5004,7 @@
    buf->type = BUF_VIDEO_H264;
    buf->content += i;
    buf->size -= i;
    -
    +//printf("put H.264 frame\n");
    this->stream->video_fifo->put (this->stream->video_fifo, buf);

    return NULL;
    @@ -5128,6 +5161,8 @@

    /* Send current PTS ? */
    if(this->stream_start) {
    + printf("start new stream\n");
    + sent_header = 0;
    this->last_delivered_vid_pts = INT64_C(-1);
    this->send_pts = 1;
    this->stream_start = 0;