Why the buffer is 0 when I play the "rtsp" movie from the internet?

by yjshi » Mon, 31 Aug 2009 19:35:13 GMT


Sponsored Links
 Why the buffer is 0 when I play the "rtsp" movie from the internet?
I wrote a appliaction to play the movie from the internet.I try many
times and could not found out the reason ,so I decided to have a look
at opencore source code.
I look at the opencore source code ,and I find that it is the most
important code is below.But I could not find out how the percentage is
increasing .So I could not find out where the reason caused all
these.could someone give me a hand?
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€void PlayerDriver::HandleInformationalEvent(const
PVAsyncInformationalEvent& aEvent)
{
......
 case PVMFInfoBufferingStatus:
            {
                const void *buffer = aEvent.GetLocalBuffer();
                const size_t size = aEvent.GetLocalBufferSize();
                int percentage;
                if (GetBufferingPercentage(buffer, size, &percentage))
                {

                    //This place print the log "D/PlayerDriver(   31):
buffering (0)"
                    LOGD("buffering (%d)", percentage);

                    mPvPlayer->sendEvent(MEDIA_BUFFERING_UPDATE,
percentage);
                }
            }
            break;
......

-----------------------------------------------------------------------------------------------------
bool GetBufferingPercentage(const void *buffer,
                            const size_t size,
                            int *percentage)
{
    if (buffer == NULL) {
                LOGI(" GetBufferingPercentage  Invalid buffer: NULL");
                LOGE("Invalid buffer: NULL");
        return false;
    }
    if (sizeof(int) != size)
    {
        LOGE("Invalid percentage buffer size %d (expected %d)", size,
sizeof(int));
        return false;
    }
    // TODO: The PVEvent class should expose a memcopy method
    // that does bound checking instead of having clients reaching
    // for its internal buffer.
    // Clamp the value and complain loudly.
    oscl_memcpy(percentage, buffer, sizeof(int));


    if (*percentage < 0 || *percentage > 100)
    {
        LOGE("Invalid percentage value %d", *percentage);
        return false;
    }
    return true;
}
____________________________________________________________-
log
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)

while play the "http" movie ,it's ok;
and now I don't konw where the percentage is not increasing ,and how
the percentage is increasing.
--~--~---------~--~----~------------~-------~--~----~



Why the buffer is 0 when I play the "rtsp" movie from the internet?

by yjshi » Mon, 31 Aug 2009 19:37:19 GMT


 Why the buffer is 0 when I play the "rtsp" movie from the internet?
I wrote a appliaction to play the movie from the internet.I try many
times and could not found out the reason ,so I decided to have a look
at opencore source code.
I look at the opencore source code ,and I find that it is the most
important code is below.But I could not find out how the percentage is
increasing .So I could not find out where the reason caused all
these.could someone give me a hand?
€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€void PlayerDriver::HandleInformationalEvent(const
PVAsyncInformationalEvent& aEvent)
{
......
 case PVMFInfoBufferingStatus:
            {
                const void *buffer = aEvent.GetLocalBuffer();
                const size_t size = aEvent.GetLocalBufferSize();
                int percentage;
                if (GetBufferingPercentage(buffer, size, &percentage))
                {

                    //This place print the log "D/PlayerDriver(   31):
buffering (0)"
                    LOGD("buffering (%d)", percentage);

                    mPvPlayer->sendEvent(MEDIA_BUFFERING_UPDATE,
percentage);
                }
            }
            break;
......

-----------------------------------------------------------------------------------------------------
bool GetBufferingPercentage(const void *buffer,
                            const size_t size,
                            int *percentage)
{
    if (buffer == NULL) {
                LOGI(" GetBufferingPercentage  Invalid buffer: NULL");
                LOGE("Invalid buffer: NULL");
        return false;
    }
    if (sizeof(int) != size)
    {
        LOGE("Invalid percentage buffer size %d (expected %d)", size,
sizeof(int));
        return false;
    }
    // TODO: The PVEvent class should expose a memcopy method
    // that does bound checking instead of having clients reaching
    // for its internal buffer.
    // Clamp the value and complain loudly.
    oscl_memcpy(percentage, buffer, sizeof(int));


    if (*percentage < 0 || *percentage > 100)
    {
        LOGE("Invalid percentage value %d", *percentage);
        return false;
    }
    return true;
}
____________________________________________________________-
log
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)
D/PlayerDriver(   31): buffering (0)

while play the "http" movie ,it's ok;
and now I don't konw where the percentage is not increasing ,and how
the percentage is increasing.
--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Did anyone else have to send their Driver License to get the Google Dev phone ?

I bought it yesterday and got this last night. I recently moved so my 
billing address isn't on my Driver License. I think people should know 
before they hand this company their credit card information they're 
going to be strong armed into sending over their photo or it's 
"cancelled" ...


*T**o accept **your order for shipment**, please provide a photo id copy *

*so that the billing address can be validated. *

* *

*Kindly reply, otherwise, the order will be cancelled.*

* *

*In addition, if your credit card has been charged, a refunded will be 
processed*


*and you will receive a credit card refund transaction notice via email.*

* *

*Our office will be closed Friday December 31, 2010*

* *

*If you comply with this request, the order will be released for 
shipment January 1, 2011*


* *

*Thank you for your patience and understanding in this matter.*

* *



*Rina Nixon*
Customer Advocate Administrator
*Brightstar*
1001 Technology Way,  Libertyville IL 60048
Android - By Phone:  1-877-727-9789 (from USA)
or 1-847-573-5171 (outside the USA)
Android Fax: 847-573-5184
Email:  andr...@brightstarcorp.com <mailto:andr...@brightstarcorp.com>

Phone: 1-847-573-2629
Fax 1-847-573-1276
Email:  rina.ni...@brightstarcorp.com <mailto:rina.ni...@brightstarcorp.com>
(A positive attitude is a good thing)

--
.

2. Using ProGuard

Hi. The android docs at:

http://developer.android.com/guide/developing/tools/proguard.html

say: When you create an Android project, a proguard.cfg file is
automatically generated in the root directory of the project.

Am I missing something? I can't see this file. Do I have to install or
download or configure something first?

Thanks.

-- 

3. Galaxy tabs promo

4. Eclipse: Export signed application log

5. ViewPad 4: Smartphone Yang Dipaksakan Menjadi Tablet

6. [wts] Usb FlashDisk 4Gb android Limited Stock

7. HELP: Camera SGS Not Working