Gstreamer and Android app

de_ninja daniel at gretzke.de
Wed May 4 12:56:56 UTC 2016


Sebastian Dröge-3 wrote
> Can you play the file with another software?

Yes! It was playable with the normal Android Music App and it sounds good,
so I think the part of the programm where I receive the data works well. 


Sebastian Dröge-3 wrote
> Try enforcing the LC (low complexity) profile

In the faac wiki it sais that the default value of the profile is "LC", so I
think I have nothing to change here.
faac wiki page
<https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-plugins/html/gst-plugins-bad-plugins-faac.html>  

I also tried my code with an AAC sample track instead of the received file
but there is the same problem, the extractor works but the decoder doesn't.
I think something has to be wrong with the code of my decoder. 

I know this isn't the right forum for this, but maybe you can have a look at
my decoder code: 
*

            format = extractor.getTrackFormat(0);
            String mime = format.getString(MediaFormat.KEY_MIME);
            decoder = MediaCodec.createDecoderByType(mime);
            decoder.configure(format, null, null, 0);


            while (!stopTrack) {


                multicastSocket.receive(packet);

                decoder.start();
                data = packet.getData();

                inputBuffers = decoder.getInputBuffers();
                outputBuffers = decoder.getOutputBuffers();
                inputBufferIndex = decoder.dequeueInputBuffer(-1);

                if (inputBufferIndex >= 0)
                {
                    inputBuffer = inputBuffers[inputBufferIndex];
                    inputBuffer.clear();

                    inputBuffer.put(data);

                    decoder.queueInputBuffer(inputBufferIndex, 0,
data.length, 0, 0);
                }

                bufferInfo = new MediaCodec.BufferInfo();
                outputBufferIndex = decoder.dequeueOutputBuffer(bufferInfo,
0);

                while (outputBufferIndex >= 0)
                {
                    outputBuffer = outputBuffers[outputBufferIndex];

                    outputBuffer.position(bufferInfo.offset);
                    outputBuffer.limit(bufferInfo.offset + bufferInfo.size);

                    outData = new byte[bufferInfo.size];
                    outputBuffer.get(outData);

                    //  Log.d("AudioDecoder", outData.length + " bytes
decoded");

                   track.write(outData, 0, outData.length);

                    decoder.releaseOutputBuffer(outputBufferIndex, false);
                    outputBufferIndex =
decoder.dequeueOutputBuffer(bufferInfo, 0);

                }
*

Any idea how I could test what is wrong?

By the way: Thanks for all your support! 



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Gstreamer-and-Android-app-tp4677265p4677327.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list