×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Nokia Developer Champion
    Join Date
    Mar 2004
    Location
    Czech Republic
    Posts
    2,037

    CMdaAudioOutputStream::WriteL()

    Hi,

    I have a question related to the CMdaAudioOutputStream::WriteL().

    When the CMdaAudioOutputStream::WriteL() method is called more than once in row (means not waiting for the MaoscBufferCopied() callback), then according to the SDK documentation the client can call WriteL() again before MaoscBufferCopied notification takes place because the buffers are maintained in a client-side queue until they have been sent. The parameter of the WriteL() method is const TDesC8 &aData.

    My question is: Should the client keep in the FIFO list of passed parameters and pop them on regularly base in each MaoscBufferCopied() callback method? So far it looks that if I create the stack based TPtr8 variable and pass it as a WriteL() method parameter the client panics with USER 19 (member function of an 8 bit variant descriptor if the descriptor is invalid) error.

    The code which does not work:
    Code:
    TPtr8 buf( iBufferLoad + iBufferPlayPos, BUFFER_PLAY_SIZE, BUFFER_PLAY_SIZE );
    iStreamOutput->WriteL( buf );
    There is also FAQ-1004:
    http://library.forum.nokia.com/index...QIndexCPP.html, which says The application may not replace or delete the aData buffer ahead until it has been received by the client application in the following callback, but the description is probably related to the buffer with data itself, not to the TPtr8/TPtrC8 descriptor passed as the WriteL() method parameter.

    BR
    STeN

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2004
    Location
    Czech Republic
    Posts
    2,037

    Re: CMdaAudioOutputStream::WriteL()

    Hi,

    I am not sure why the CMdaAudioOutputStream is implemented in a way that the caller should keep the TPtr8/TPtrC8 passed to WriteL(), but after implementing a simple FIFO to hold those variables class works perfectly.

    BR
    STeN

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,570

    Re: CMdaAudioOutputStream::WriteL()

    The passed variable has to remain accessible because the queue stores addresses. Remember that you get back exactly the same TDesC8 variable in MaoscBufferCopied.

  4. #4
    Nokia Developer Champion
    Join Date
    Mar 2004
    Location
    Czech Republic
    Posts
    2,037

    Re: CMdaAudioOutputStream::WriteL()

    Thanks for reply!

    Regards,
    STeN

Similar Threads

  1. Replies: 2
    Last Post: 2011-01-17, 10:11
  2. Replies: 1
    Last Post: 2008-08-01, 08:35
  3. Replies: 2
    Last Post: 2006-11-08, 09:13
  4. RFile.WriteL()
    By nicholasgaye in forum Symbian
    Replies: 5
    Last Post: 2005-08-01, 08:16
  5. CMdaAudioOutputStream - WriteL function leaves with KErrInUse
    By juliand77 in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2005-02-23, 15:54

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •