Invalid conversion!

18 posts
Thanks Meter: 8
By curt54, Junior Member on 19th August 2014, 10:11 PM
Post Reply Subscribe to Thread Email Thread
I'm trying to build CM10.2 for an Allwinner A31 device. I also have an A31 dev tree for stock 4.2.2, which has the Cedarx framework I need, so I've imported it into the CM dev tree. Most things build fine without any, or much, changes but I'm getting the below error and haven't been able to fix it.

I've looked at just about everything and there doesn't seam to be a reason for the error. I have some "C" experience and I can handle some things but this is beyond my understanding.

frameworks/av/media/CedarX-Projects/CedarA/CedarARender.cpp: In member function 'android::status_t android::CedarAAudioPlayer::start(bool)':
frameworks/av/media/CedarX-Projects/CedarA/CedarARender.cpp:122:46: error: invalid conversion from 'int' to 'audio_output_flags_t' [-fpermissive]
In file included from frameworks/av/media/CedarX-Projects/CedarA/CedarARender.cpp:22:0:
frameworks/av/include/media/AudioTrack.h:168:25: error:   initializing argument 6 of 'android::AudioTrack::AudioTrack(audio_stream_type_t, uint32_t, audio_format_t, audio_channel_mask_t, int, audio_output_flags_t, android::AudioTrack::callback_t, void*, int, int)' [-fpermissive]
make: *** [/home/curt/android/system/out/target/product/novo9/obj/SHARED_LIBRARIES/libCedarA_intermediates/CedarARender.o] Error 1
The CedarARender.cpp code is:
        mAudioTrack = new AudioTrack(
                AUDIO_STREAM_MUSIC, mSampleRate, AUDIO_FORMAT_PCM_16_BIT,
                (mNumChannels == 2)
                    ? AUDIO_CHANNEL_OUT_STEREO
                    : AUDIO_CHANNEL_OUT_MONO,
                0, 0, &AudioCallback, this, 0);   //This is line 122! The first "0".
These are the header lines referenced in the error:
                        AudioTrack( audio_stream_type_t streamType,
                                    uint32_t sampleRate  = 0,
                                    audio_format_t format = AUDIO_FORMAT_DEFAULT,
                                    audio_channel_mask_t channelMask = 0,
                                    int frameCount       = 0,
                                    audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE,
                                    callback_t cbf       = NULL,
                                    void* user           = NULL,
                                    int notificationFrames = 0,
                                    int sessionId        = 0);
The value of AUDIO_OUTPUT_FLAG_NONE is from <system/audio.h>:
typedef enum {
    AUDIO_OUTPUT_FLAG_NONE = 0x0,       // no attributes
    AUDIO_OUTPUT_FLAG_DIRECT = 0x1,     // this output directly connects a track
                                        // to one output stream: no software mixer
    AUDIO_OUTPUT_FLAG_PRIMARY = 0x2,    // this output is the primary output of
                                        // the device. It is unique and must be
                                        // present. It is opened by default and
                                        // receives routing, audio mode and volume
                                        // controls related to voice calls.
    AUDIO_OUTPUT_FLAG_FAST = 0x4,       // output supports "fast tracks",
                                        // defined elsewhere
    AUDIO_OUTPUT_FLAG_DEEP_BUFFER = 0x8,// use deep audio buffers
    //Qualcomm Flags
    AUDIO_OUTPUT_FLAG_LPA = 0x1000,      // use LPA
    AUDIO_OUTPUT_FLAG_TUNNEL = 0x2000,   // use Tunnel
    AUDIO_OUTPUT_FLAG_VOIP_RX = 0x4000,  // use this flag in combination with DIRECT to
                                         // indicate HAL to activate EC & NS
                                         // path for VOIP calls
    AUDIO_OUTPUT_FLAG_INCALL_MUSIC = 0x8000 //use this flag for incall music delivery
} audio_output_flags_t;
My question is, why is the "0" causing an error? I tried putting "AUDIO_OUTPUT_FLAG_NONE" and "0x0" in it's place but still get the error.

Any help would be appreciate!
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes