[Live-devel] Help me for a buffering section from playCommon.cpp

Rishi kerala rishikerala at gmail.com
Thu Jan 4 19:08:54 PST 2007


Hi Ross,

I know full source is here. I am jusr going through the source for Client
module. I am not good in C++.
I already written a client module with player I will just give the code
below


Here In player I am using a VLC stucture.

static block_t *Block_New(RMuint32 i_size);
static int Block_FifoPut(block_fifo_t*,block_t *);
static block_t *Block_FifoGet(block_fifo_t *);
static block_fifo_t *Block_FifoNew();

/******************************************************************
 *
 ******************************************************************/
static block_t *BlockParseRTP(block_t *p_block);
block_t *stream_Block(RMuint32 i_size,struct context_per_task *p_task);
static int Stream_Read_Block(void *p_read, RMuint32 i_read,struct
context_per_task *p_task);
static block_t *Read_Block(struct context_per_task *);

I just want to prebuffer .. to pass to the harware decoder.



if(!pre_done){
                          for(;;){
                                  if(p_task->p_sys == NULL){
                                          printf("stream_sys_t null\n");
                                          goto cleanup;
                                  }

                                  if(p_task->p_sys-> block.i_size >
STREAM_CACHE_SIZE){//STREAM_CACHE_PREBUFFER_SIZE){
                                          printf("[%s:%d] cache size(%lu)
pre done\n",__FUNCTION__,__LINE__,p_task->p_sys->block.i_size );
                                          pre_done = TRUE;
                                          break;
                                  }


                                  block_t *b;
                                  if((b = Read_Block(p_task)) == NULL){
                                          perror("fetch error");
                                          continue;
                                  }


                                  //    while(b){
                                  p_task->p_sys->block.i_size +=
b->i_buffer;
                                  *p_task->p_sys->block.pp_last = b;
                                  p_task->p_sys-> block.pp_last =
&b->p_next;

                                  b = b->p_next;
                                  //}



                                  //    Block_FifoPut(gp_fifo,b);
                                  }
                                  p_task->p_sys->block.p_current =
p_task->p_sys->block.p_first;
                          }

                          p_block = stream_Block(UDP_PACKET_SIZE *
3,p_task);
}

static int Block_FifoPut(block_fifo_t *p_fifo, block_t *p_block)
{
        RMuint32 i_size = 0;

        pthread_mutex_lock(&p_fifo->lock);


        //              do{
                i_size += p_block->i_buffer;
                *p_fifo->pp_last = p_block;
                p_fifo->pp_last = &p_block->p_next;
                p_fifo->i_depth++;
                p_fifo->i_size += p_block->i_buffer;

                p_block = p_block->p_next;
                //}while(p_block);

        pthread_cond_signal(&p_fifo->wait);
        pthread_mutex_unlock(&p_fifo->lock);


        return i_size;
}


I am trying to port the openRTSP module (Client) to my board. Here I have to
pass the buffer like this. the player is written in c.
so i need to avoid the header portion and pass data to the deoder. I am
trying to make a api module from LiveMedia Client module.
So that I can get the buffer to the player by calling this api. i am now
concentrating on mpeg2-ts only.
I just need to get the buffer ( which is skipped with all header).

Please give me some idea and where I need to hack for this. this is a
personal mail I am doing.
If possible help me ..
Rgds
Rishi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.live555.com/pipermail/live-devel/attachments/20070104/730059b2/attachment.html 


More information about the live-devel mailing list