CoreAVC + xineliboutput

Message ID 47928DA3.1080501@mellander.org
State New
Headers

Commit Message

Per Mellander Jan. 19, 2008, 11:54 p.m. UTC
  Morfsta skrev:
> I'm having the same problem. I've put the .ax file in /usr/lib/win32,
> registed the key in ~/.mplayer/registry32 and then done: -

You don't have to register.

I patched xine-lib with coreavc for Linux xine.patch @
http://coreavc-for-linux.googlecode.com/svn/trunk/xine/xine.patch

Then you have to add additional code to demux_mpeg_pes.c ( see attached 
patch )

You have to delete xineplug_decode_ff.so and xineplug_decode_qt.so in 
/usr/local/lib/xine/plugins/1.1.9/

I tried xineliboutput first but that give me black screen with epg + 
sound. With vdr-xine-0.8.1.tgz it all seems to work :)

root@mm plugins]# lsof | grep Core
xine       4548      root  mem       REG        8,2  1031168    1999941 
/usr/lib/win32/CoreAVCDecoder.ax

Many thanks to Igor who has been a great help!
  

Comments

Goga777 Jan. 20, 2008, 10:06 a.m. UTC | #1
> > I'm having the same problem. I've put the .ax file in /usr/lib/win32,
> > registed the key in ~/.mplayer/registry32 and then done: -
> 
> You don't have to register.

yes, for xine no need any coreavc-registration.

> I patched xine-lib with coreavc for Linux xine.patch @
> http://coreavc-for-linux.googlecode.com/svn/trunk/xine/xine.patch

no any rejects ? with which xine-lib version did you work ?

> Then you have to add additional code to demux_mpeg_pes.c ( see attached 
> patch )

did you install the additional patches from hXXp://dvbn.happysat.org ?

> You have to delete xineplug_decode_ff.so and xineplug_decode_qt.so in 
> /usr/local/lib/xine/plugins/1.1.9/

yes, may be the option --disable-ffmpeg during xine-lib compilaton will help, too

> I tried xineliboutput first but that give me black screen with epg + 
> sound. 

for xineliboutput you have to try the patch from http://allrussian.info/thread.php?postid=1226448#post1226448
(very many thanks to Walery)

>>With vdr-xine-0.8.1.tgz it all seems to work :)

fine !!! and what about your impressions ?

> Many thanks to Igor who has been a great help!

ah, not to me ! To Walery from our forum - he helped to me and to you yesterday evening.

@ALL
can somebody to make cumulative coreavc-patch for xine and xineliboutput with "xine.patch + patches from dvbn.happysat + patches" from allrussian ?

@Per
can you write more detail HOWTO (my English is not so good, sorry)

Igor
  

Patch

--- demux_mpeg_pes.c.org	2008-01-19 22:09:58.000000000 +0100
+++ demux_mpeg_pes.c	2008-01-19 22:10:02.000000000 +0100
@@ -1092,6 +1092,7 @@  static int32_t parse_private_stream_1(de
     return this->packet_len + result;
 }
 
+int sent_header = 0; /* Added by Mel */
 static int32_t parse_video_stream(demux_mpeg_pes_t *this, uint8_t *p, buf_element_t *buf) {
   int32_t result;
   uint32_t todo_length=0;
@@ -1136,6 +1137,7 @@  static int32_t parse_video_stream(demux_
      an AUD has been found at the beginning of the payload.
    */
   if (this->mpeg12_h264_detected < 2) {
+    sent_header = 0; /* Added by Mel */
     uint8_t *pp = p + 2, *pp_limit = p + payload_size - 1;
     while (0 < pp && pp < pp_limit) {
       if (pp[0] == 0x01 && pp[-1] == 0x00 && pp[-2] == 0x00) {
@@ -1156,9 +1158,44 @@  static int32_t parse_video_stream(demux_
       pp++;
       pp = memchr(pp, 0x01, pp_limit - pp);
     }
+    usleep(100); /* Added by Mel */
     lprintf("%s%c\n", (this->mpeg12_h264_detected & 1) ? "H.264" : "MPEG1/2", (this->mpeg12_h264_detected & 2) ? '!' : '?');
+
+// Mel START
+
+  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;
+    }
   }
+}
 
+// Mel END
   /* when an H.264 AUD is seen, we first need to tell the decoder that the
      previous frame was complete.
    */