From patchwork Sun Jan 20 14:38:55 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Per Mellander X-Patchwork-Id: 12583 Received: from mail.mmtab.se ([84.243.56.194]) by www.linuxtv.org with esmtp (Exim 4.63) (envelope-from ) id 1JGbKI-0005gD-2g for vdr@linuxtv.org; Sun, 20 Jan 2008 15:39:10 +0100 Received: from [10.0.1.198] (c-74b9e455.39-0129-74657210.cust.bredbandsbolaget.se [85.228.185.116]) (authenticated bits=0) by mail.mmtab.se (8.13.8/8.13.8) with ESMTP id m0KEd1Zw011960 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 20 Jan 2008 15:39:04 +0100 Message-ID: <47935CFF.7060509@mellander.org> Date: Sun, 20 Jan 2008 15:38:55 +0100 From: Per Mellander User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Igor , VDR Mailing List References: <47928DA3.1080501@mellander.org> In-Reply-To: Subject: Re: [vdr] CoreAVC + xineliboutput X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.9 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2008 14:39:10 -0000 Status: O X-Status: X-Keywords: X-UID: 15180 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. */