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. Ngeflame ah

Jadi panas gak boss HH nya

He3x
#cari yg ice mencair


-- Jus\j_r00tMB300 Preclair 2.1 v1.3\
Sent from my Android phone with K-9 Mail. Please excuse my brevity.





-- 
===============
"

2. WTHELP : incredible restart trus..

Entah knapa sjak pagi incredible ga bsa booting. So saya mau coba untuk
reflash romnya... pas mo masuk ke recovery, ehh restart lg.. saya coba pilih
factory reset.. sama jg dya restart.. mohon pencerahan suhu2 skalian.. many
thanks in advance..

-- 
===============
"

3. Layout templates repository

4. Notification ringtone keeps on repeating.

5. Gamine 0.3 (3D game engine)

6. [WTShare] SantaDroid

7. nexian jurney