Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Info required on attaching two Multimedia plugins: (3 Items)
   
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
    


Re: Info required on attaching two Multimedia plugins  
"MmAttachChannels" is failing !!

Re: Info required on attaching two Multimedia plugins  
Hi Satish,

Sorry you haven't received any answers so far on your MM questions.  If you're still having difficulty, can you repost 
these questions on the MM forums?

Here is the link:
http://community.qnx.com/sf/discussion/do/listForums/projects.multimedia/discussion

Also, there is updated code in that multimedia project.  Check out the source guide here:
http://community.qnx.com/sf/wiki/do/viewPage/projects.multimedia/wiki/SourceGuide