satish pattar(deleted)
|
Info required on attaching two Multimedia plugins
|
satish pattar(deleted)
02/27/2009 7:55 AM
post23066
|
Info required on attaching two Multimedia plugins
Hi,
I am trying to attach two multimedia filters i.e., ogg decoder with audio writer filter which come as part of sample
filters in QNX 6.3.2.
below is the code snippet..
#include <stdio.h>
#include <mmedia/mmedia.h>
#include <mmedia/mmconvenience.h>
#include <aoi/aoi.h>
int main(int argc,char *argv[])
{
MmGraph_t *graph;
MmFilter_t *rf,*mpf,*xf,*af, *mdf;
MmChannel_t *rc,*mpic,*mpoc,*xic,*xoc,*ac,*mdic,*mdoc;
int ret;
MmInitialize(NULL);
printf(" MM lib is initialized\n");
graph=MmCreateGraph("mp3 player");
printf(" Finding ogg decoder\n");
if (!(mdf=MmFindFilter(graph,"ogg_decoder")))
{
printf("Couldn't grab the ogg decoder.\n");
MmDestroyGraph(graph);
exit(-5);
}
// grab the mp3_decoder filter output channel
if (!(mdoc=MmAcquireOutputChannel(mdf,MEDIA_TYPE_AUDIO)))
{
printf("Couldn't get a audio output channel from mp3_dec
MmDestroyGraph(graph);
exit(-10);
}
printf("Finding Audio writer \n");
// grab the audio_writer filter
if (!(af=MmFindFilter(graph,"audio_writer")))
{
printf("Couldn't grab the audio_writer filter.\n");
MmDestroyGraph(graph);
exit(-11);
}
printf("Audio writer found\n");
printf("Acquiring Writer's I/P channel\n");
// grab the audio input channel
if (!(ac=MmAcquireInputChannel(af,MEDIA_TYPE_AUDIO)))
{
printf("Couldn't get an audio input channel from audio_writer.\n");
MmDestroyGraph(graph);
exit(-12);
}
printf("Writer's I/P channel acquired\n");
printf("Attaching channels : (Decoder->Writer)\n");
if (MmAttachChannels(mdoc,ac)!=0)
{
printf("Couldn't attach mp3_decoder and audio_writer channels.\n");
MmDestroyGraph(graph);
exit(-13);
}
printf("Attaching channels Done : (Decoder->Writer)\n");
return 0;
}
Please help me understand where I am doing wrong.
Thanks in advance,
Satish
|
|
|