Error in compile new codec module for VLC

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
systest
Blank Cone
Blank Cone
Posts: 22
Joined: 19 May 2004 15:16

Error in compile new codec module for VLC

Postby systest » 21 May 2004 05:05

Hi:

Following is my build.log



arm-linux-gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I/arm/arm-linux/include -I/home/xye1/vlc/SDL/include -I/home/xye1/vlc/vlc-0.7.1/modules/codec/sigma/RMF-INTEL-1.7.141.0/RMF_src/externalapi/rmf/ -DSYS_LINUX -I../../include `top_builddir="../.." ../../vlc-config --cflags builtin sigma` -Wsign-compare -Wall -finline-limit-30000 -pipe -c -o libsigma_a-sigma.o `test -f 'sigma.c' || echo './'`sigma.c

sigma.c:68: two or more data types in declaration of `OpenDecoder'

sigma.c: In function `vlc_entry__sigma':

sigma.c:79: warning: assignment from incompatible pointer type

sigma.c: At top level:

sigma.c:87: conflicting types for `OpenDecoder'

sigma.c:68: previous declaration of `OpenDecoder'

sigma.c: In function `OpenDecoder':

sigma.c:113: warning: assignment from incompatible pointer type

sigma.c: In function `DecodeBlock':

sigma.c:225: warning: control reaches end of non-void function

make[1]: *** [libsigma_a-sigma.o] Error 1

make[1]: Leaving directory `/home/xye1/vlc/vlc-0.7.1/modules/codec'

make: *** [all-modules] Error 1



Anything wrong?

systest
Blank Cone
Blank Cone
Posts: 22
Joined: 19 May 2004 15:16

Postby systest » 21 May 2004 07:34

Following is my code:

/*****************************************************************************
* tarkin.c: tarkin decoder module making use of libtarkin.
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: tarkin.c,v 1.11 2004/01/25 18:20:12 bigben Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/

/*****************************************************************************
* Preamble
*****************************************************************************/
#include <vlc/vlc.h>
#include <vlc/decoder.h>

#include <rmexternalapi.h>

/* Aspect ratio (ISO/IEC 13818-2 section 6.3.3, table 6-3) */
#define AR_SQUARE_PICTURE 1 /* square pixels */
#define AR_3_4_PICTURE 2 /* 3:4 picture (TV) */
#define AR_16_9_PICTURE 3 /* 16:9 picture (wide screen) */
#define AR_221_1_PICTURE 4 /* 2.21:1 picture (movie) */
#define MAX_SAMPLE_SIZE 2048
#define COPYANDQUEUEDATA_TIMEOUT_MICROSEC 400000

/*****************************************************************************
* decoder_sys_t : sigma decoder descriptor
*****************************************************************************/
struct decoder_sys_t
{
//ExternalRMmp4Client mp4c;
//ExternalRMmp4Track mp4tV, mp4tA;
RMuint32 trackID;
RMmp4Sample sample;
ExternalRMaacDecoder aacdec;
RMuint8 *dsiBuf;
RMuint32 dsiSize;
RMuint8 *zone;
RMstatus status;
RUA_handle h;
RMint32 no;
RMuint8 *pcmBuf, *abuf, *vbuf;
RMuint32 pcmSize;
my_MPEG_WRITE_DATA vQ,aQ;
RMuint32 audioStatus, videoStatus;
RMuint32 aFlags, vFlags;
}

/*****************************************************************************
* Local prototypes
*****************************************************************************/
static int OpenDecoder ( vlc_object_t * ); //line 68
static void CloseDecoder ( vlc_object_t * );

static void *DecodeBlock ( decoder_t *, block_t ** );
//static picture_t *DecodePacket ( decoder_t *, block_t **, ogg_packet * );

//static void tarkin_CopyPicture( decoder_t *, picture_t *, uint8_t *, int );

/*****************************************************************************
* Module descriptor
*****************************************************************************/
vlc_module_begin();
set_description( _("Sigma decoder module") );
set_capability( "decoder", 100 );
set_callbacks( OpenDecoder, CloseDecoder );
add_shortcut( "sigma" );
vlc_module_end();

/*****************************************************************************
* OpenDecoder: probe the decoder and return score
*****************************************************************************/
static int OpenDecoder( vlc_object_t *p_this ) //line 87
{
decoder_t *p_dec = (decoder_t*)p_this;
decoder_sys_t *p_sys;

if( p_dec->fmt_in.i_codec != VLC_FOURCC('t','a','r','k') )
{
return VLC_EGENERIC;
}

/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
{
msg_Err( p_dec, "out of memory" );
return VLC_EGENERIC;
}
memset( p_sys, 0, sizeof(decoder_sys_t) );
/* Initialize hardware */
p_sys->h = RUA_OpenDevice(0,TRUE);
if (p_sys->h==NULL) {
fprintf(stderr,"can't AccessDevice\n");
return -1;
}
/* Set output properties */
RUA_DECODER_STREAMSTOP(p_sys->h, REALMAGICHWL_VIDEO|REALMAGICHWL_AUDIO|REALMAGICHWL_SPU);

edecVideoStd_type edecVideoStd_value=edecVideoStd_MPEG4Video;
RUA_DECODER_SET_PROPERTY(p_sys->h, DECODER_SET, edecVideoStd, sizeof(edecVideoStd_type), &edecVideoStd_value);

p_sys->vbuf = (RMuint8 *) NULL;
p_sys->vFlags = 0;

/* Set callbacks */
p_dec->pf_decode_video = (picture_t *(*)(decoder_t *, block_t **))
DecodeBlock;

/* Init supporting Tarkin structures needed in header parsing */
return VLC_SUCCESS;
}

/****************************************************************************
* DecodeBlock: the whole thing
****************************************************************************
* This function must be fed with ogg packets.
****************************************************************************/
static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
{
decoder_sys_t *p_sys = p_dec->p_sys;
block_t *p_block;

if( !pp_block || !*pp_block ) return NULL;

p_block = *pp_block;
p_sys->videoStatus = 1;
p_sys->vbuf = (RMuint8 *) malloc(MAX_SAMPLE_SIZE * sizeof(RMuint8));
memset (&p_sys->vQ, 0, sizeof(my_MPEG_WRITE_DATA));
RUA_DECODER_STREAMPLAY(p_sys->h, REALMAGICHWL_VIDEO|REALMAGICHWL_AUDIO|REALMAGICHWL_SPU, RUA_VideoHwPlayNormal, 0);
while ( p_sys->videoStatus > 0 ) {
//send_video:
if (p_sys->videoStatus > 0) {
if (p_sys->videoStatus == 1) {
p_sys->sample.buf = p_sys->vbuf;
p_sys->sample.size = MAX_SAMPLE_SIZE;
p_sys->vbuf = p_block->p_buffer;
p_sys->vQ.pData=p_sys->vbuf;
p_sys->vQ.DataLeft=p_sys->sample.size;
if (p_sys->sample.flags & MP4_AU_START) {
p_sys->vQ.Pts = RMuint64from2RMuint32(p_sys->sample.CTS_MSB, p_sys->sample.CTS_LSB);
p_sys->vFlags=RUA_CTS_AVAILABLE_FLAG;
}
else {
p_sys->vQ.Pts = 0;
p_sys->vFlags = 0;
}
}
if (RUA_DECODER_FEEDME(p_sys->h,REALMAGICHWL_VIDEO,p_sys->vFlags,&p_sys->vQ) != 0) {
p_sys->videoStatus = 2;
}
else {
p_sys->videoStatus = 1;
}
}

// when video and audio FIFOs are full waits for the hardware to consume data
if ( p_sys->videoStatus == 2 ) {
RMuint32 X = REALMAGICHWL_HAPPENING_DECODER_VIDEODMA_HALF| REALMAGICHWL_HAPPENING_DECODER_AUDIODMA_HALF;

RUA_DECODER_WAIT(p_sys->h,COPYANDQUEUEDATA_TIMEOUT_MICROSEC,&X);
}
}
}

/*****************************************************************************
* CloseDecoder: tarkin decoder destruction
*****************************************************************************/
static void CloseDecoder( vlc_object_t *p_this )
{
decoder_t *p_dec = (decoder_t *)p_this;
decoder_sys_t *p_sys = p_dec->p_sys;
p_sys->videoStatus = 1;
p_sys->vbuf = (RMuint8 *) malloc(MAX_SAMPLE_SIZE * sizeof(RMuint8));
memset (&p_sys->vQ, 0, sizeof(my_MPEG_WRITE_DATA));
free(p_sys);
}


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 21 guests