Igor skrev:


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


I have started with a CVS xine-lib. Then applied the vdr-xine patch.

Download and apply the xine.patch from http://code.google.com/p/coreavc-for-linux/

There are also some patches here to fix some problems with xine-lib:
http://dvbn.happysat.org/viewtopic.php?p=243997

Walery's patch to demux_mpeg_pes.c is attached. Apply that to.

Per

--- 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; 
 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); 
     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.
    */
_______________________________________________
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

Reply via email to